Skip to content

ao-org/argentum-online-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,301 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

⚔️ Please consider supporting us at https://www.patreon.com/nolandstudios ⚔️

ao logo

🛡️ Argentum Online Server

image

Important: Do not download the code using the "Download as ZIP" button on GitHub, as this can cause issues with file encoding and may corrupt some files.

To download the code correctly, use a Git client. The command to clone the repository from the command line is:

git clone https://www.github.com/ao-org/argentum-online-server

🛡️ How to Run My Server:

Create a new folder named C:\AO20 and navigate to it. Follow these steps:

  1. Clone the repository git clone https://github.com/ao-org/argentum-online-server.git

  2. Rename the file Example.Server.ini to Server.ini

  3. Rename the file Example.feature_toggle.ini to feature_toggle.ini

  4. Rename the file Example.Configuracion.ini to Configuracion.ini

  5. Rename the file Empty_db.db to Database.db

  6. Rename the file ../Recursos/Dat/Example.Motd.ini to Motd.ini

  7. Clone Recursos (https://github.com/ao-org/Recursos)

  8. Open Visual Basic 6 as an administrator

  9. Open the file Server.VBP

🔛 Feature Toggle/Flag (Turn ON/OFF features)

When introducing new functionality to the server, it should include the capability to be disabled. To achieve this, we implement the feature flags design pattern, which is configured within the file Example.feature_toggle.ini.

🎬 Game Scenarios

In the following folders, you will find configuration files for events. When programming a new type of event, it must have its own configuration file. https://github.com/ao-org/Recursos/tree/master/Dat/Scenarios

🗄️ SQL Migrations

To modify the schema of the database or make alterations to existing tables, it is essential to create a new SQL migration file within the ScriptsDB directory. The project is configured to automatically detect and execute the required migration scripts. This process ensures that the database is systematically updated to reflect the latest schema changes without manual intervention. This approach not only maintains database integrity but also streamlines the update process, enabling seamless transitions between different database schema versions.

🛡️ Pull Requests

Precommit-hook

We have a pre-commit hook for the project, Visual Basic 6 IDE changes the names of the variables and it makes the Pull Requests very difficult to understand.

Please run the following commands with git bash or the client you are using.

chmod +x .githooks/pre-commit
git config core.hooksPath .githooks

Basically the pre-commit hook runs when you make a git commit and it will run the file git_ignore_case.sh to avoid false changes in the Pull Request. Is not perfect but it helps a lot. Please send the Pull Requests with only the neccesary code to be reviewed.

In case you have problems setting locally your pre-commit hook you can run the file git_ignore_case.sh by just doing double click.

🗺️ Maps Limitation 512 with VB6 Debugger

There is a limitation when running and debugging the game within Visual Basic 6. Due to VB6's constraints, it cannot load more than 512 maps during debugging. As a result, maps such as Dungeon Dinosaurios (Map 577) will not function properly and it will throw overflow error

🧪 Unit Testing

The project includes a built-in unit test suite that validates core server modules. There are currently 24 registered suites. When compiled with UNIT_TEST = 1, the server runs all test suites on startup, writes results to test_results.txt, and exits immediately.

Test suites

# Suite Module under test Notes
1 Unit_Math Matematicas.bas
2 Unit_Bitmask Bitmask helpers
3 Unit_StringValidation String validation
4 Unit_Pathfinding PathFinding.bas
5 Unit_Characters Character management
6 Unit_ElapsedTime modElapsedTime.bas
7 Unit_Timer modNuevoTimer.bas
8 Unit_Queue cColaArray.cls
9 Unit_UserNames UserNames.bas
10 Unit_General General.bas
11 Unit_Factions ModFacciones.bas
12 Unit_Commerce Comercio.bas
13 Unit_MapBounds ModMap.bas
14 Unit_StringBuilder cStringBuilder.cls
15 Unit_CombatMath SistemaCombate.bas
16 Unit_Crafting modCrafteos.bas
17 Unit_GameStatus Game status helpers
18 Unit_IniManager clsIniManager.cls Property tests: dump round-trip, ChangeValue/GetValue round-trip
19 Unit_WorldTime WorldTime.bas Property tests: ms range invariant, sec consistency, DayLenMs round-trip
20 Unit_TimeFormat modTime.bas Property test: GetTimeString format correctness
21 Unit_StringUtils StringUtils.bas Property tests: printable ASCII acceptance, invalid char rejection
22 Unit_Spawn modSpawn.bas Property test: output within map bounds
23 Unit_CommerceExt Comercio.bas (SalePrice) Property tests: base formula, non-negative invariant
24 Unit_ScoreBoard ScoreBoard.cls Property test: ranking descending order

Compile and run tests from CLI

# Compile with tests enabled
"C:\Program Files (x86)\Microsoft Visual Studio\VB98\vb6.exe" /make Server.VBP /out vb6build.log /d DEBUGGING=1:PYMMO=0:UNIT_TEST=1

# Run tests (writes test_results.txt and exits)
.\Server.exe

# Check results
type test_results.txt

The /d UNIT_TEST=1 flag overrides the project setting at compile time — no need to edit the .vbp file.

Test suites live in Codigo/Tests/. The runner is Codigo/UnitTesting.bas.

🛡️ Requirements

Database SQLite

Installing SQLite ODBC Driver for 32-bit Systems

To integrate SQLite with ODBC on a 32-bit system, please download the appropriate driver from the following link:

Optimizing Database Performance

To enhance the performance of your SQLite database, consider changing the journal mode to Write-Ahead Logging (WAL) by executing the following SQL command:

PRAGMA journal_mode=WAL;

Write-Ahead Logging can significantly improve the write performance and concurrency of your database. For more information on how WAL mode benefits your database operations, please visit the SQLite WAL documentation:

This mode enables most read operations to proceed without locking and allows updates to occur without interfering with reads, thus increasing the performance and scalability of your application when using SQLite.

Networking

Registrar manualmente libreria Aurora.Network.dll Abrir CMD como Administrador regsvr32 Aurora.Network.dll

Cryptography

CryptoSys is used in Argentum Online to cipher sensitive data.

Please note this is not free software and you will have to buy your own license to use CryptoSys

Microsoft Visual C++ Redistributable

🛡️ Logs

  • Location:

    • Logs folder
    • Errors folder
    • Windows Event Viewer
  • Handling "The description for Event ID:0..." error: Run the RegistrarEvento.bat script to resolve this error message within the Windows Event Viewer:

    The description for Event ID:0 in Source:'Argentum20' cannot be found. 
    Either the component that raises this event is not installed on your local computer 
    or the installation is corrupted. 
    You can install or repair the component on the local computer. 
    If the event originated on another computer, 
    the display information had to be saved with the event. 
    The following information was included with the event: 
    

Repo Activity

Alt

Star History

Star History Chart

Thank you

A big thank you ❤️ to these amazing people for contributing to this project!

About

Código fuente del servidor de Argentum Online

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors