How oonym/l2interludeserver works
Main Components and Their Roles
• Client(s):
• The game client (official Lineage 2 client) that connects to the server.
• Login Server:
• Manages connections, authentication, and account verification.
• Includes packages under “net/sf/l2j/loginserver” (clientpackets, crypt, gameserverpackets, serverpackets, etc.).
• Game Server:
• Handles in-game logic, world management, and user actions.
• Organized under “net/sf/l2j/gameserver” and includes subpackages (clientpackets, communitybbs, events, handlers, network, object models, AI, geodata, etc.).
• Status Server:
• Provides server status updates and monitoring.
• Found in packages like “net/sf/l2j/status”.
• Database/Data Access Layer:
• Managed by classes such as L2DatabaseFactory and associated util classes.
• Uses configuration files and SQL scripts located in the “sql” directory.
• Scripting and Configuration:
• Supports dynamic behavior via scripting (see the “script” packages including jython-based quests and events).
• The configuration files in the “config” or “java/config” directories hold server properties and settings.
• Utility Components:
• Includes common utilities (e.g., “util” packages, task manager, id factories, and file logging), used across the application.
• External Libraries:
• The lib folder shows third-party libraries such as c3p0, jython, MySQL connector, etc., which are integrated to support database pooling, scripting, and network communications.
Relationships and Data Flow
• The game client first connects to the Login Server.
• The Login Server authenticates the client using credentials (by interacting with the database) and then passes a session or ticket to the Game Server.
• The Game Server uses this session to let the player connect, then loads and updates world data.
• Both servers use common utility classes to log actions, schedule tasks (via taskmanager), manage packets (network packages), and handle configuration.
• The Status Server monitors overall server health and reports game server and login server metrics.
• A clear flow exists: client → login server (auth) → game server (gameplay) with support from caching, task scheduling, and scripting modules.
Architectural Patterns and Design Principles
• Modular and Layered Architecture:
• The project is separated into logical modules: network communication, business logic (game mechanics, quest management), database interaction, and administration.
• Event-driven Design:
• Numerous classes in “clientpackets,” “serverpackets,” and “events” indicate that the system uses an event-based architecture to process and respond to messages.
• Dependency Injection / Factory Patterns:
• The presence of factories (IdFactory, L2DatabaseFactory) and handler interfaces (e.g., IAdminCommandHandler, IUserCommandHandler) suggest an extensible design that supports plug-in components.
• Task Scheduling:
• TaskManager classes and scheduled tasks indicate asynchronous processing (e.g., decay, cleanup, periodic updates) throughout the server.
Relevant Technologies and Frameworks
• Java Platform – core language and runtime.
• MySQL for the database with JDBC connectivity (mysql-connector-java) and connection pooling (c3p0).
• Jython for scripting support.
• Third-party libraries (e.g., Apache Commons Logging, Javolution) for performance and logging.