How ao-libre/ao-server works
Main Components
• Server Core & Game Engine: The heart of the system is in the “Codigo” folder. This comprises modules that handle game logic (e.g., GameLogic.bas), combat (SistemaCombate.bas), quests (modQuests.bas), NPCs, clan management and other in-game mechanics.
• Network Communication Module: Files like TCP.bas, Protocol.bas, and modSendData.bas indicate the presence of a network layer to handle client connections and messaging. Mark this as the “TCP/Protocol Module.”
• Data Management and Persistence: The “Dat” folder holds many configuration and game data files (Balance.dat, Map.dat, NPCs.dat, etc.), which are used by the server to load game content and state. Indicate a “Data Access Layer” that reads/writes these files.
• User and Account Management: Directories like “Account” and modules such as Cuentas.bas and modUserRecords.bas suggest dedicated components for account handling, user profiles, and character management.
• Administrative & Monitoring Interfaces: Forms like frmAdmin, frmCargando, and the “Logs” folder imply that there is a GUI component for administrators as well as logging mechanisms for error and event tracking.
• Library Dependencies & External Services: The “Librerias” folder contains necessary OCX/DLL files required by VB6, and the README describes integration with external APIs (ao-api-server for functions like emailing and backups) and automatic update functionality.
• Maps/Worlds Data: The “Mundos” directory stores the various map files that define the game world, highlighting a dedicated subsystem for world and terrain management.
• Miscellaneous Components: Additional directories such as “AntiCheats,” “Charfile,” “Foros,” and “Guilds” organize ancillary functionalities like anti-cheat mechanisms, chat logs or character files, forum integrations, and guilds management.
• “Administrative Interface” module (GUI forms) as interfacing with the core engine for server control and monitoring, also reading logs from the “Logs” repository.
• Integration with external services (e.g., the ao-api-server for email, backup, and version updates) as an external dependency that communicates with the core engine.
• If needed, illustrate a “Library/Dependency” component representing the pre-installed OCX/DLL libraries that the VB6 project relies on.
Architectural Patterns and Principles
• A layered architecture: separate network handling, business logic (game engine), and data management.
• Modular design – each physical .bas, .cls, or .frm file in “Codigo” typically plays a distinct role (e.g., processing events, managing queues, or handling security).
– From Clients (external user connections) → Network Module → Game Engine.
– Game Engine ↔ Data Access (read/write operations on .dat files).
– Administrative Interface ↔ Game Engine and Logging components.
– Game Engine → External API Services.