Recursos del cliente y servidor de Argentum Online
Before utilizing these assets, it is crucial that you thoroughly review the license terms. For detailed information on usage rights and restrictions, please consult the license.txt file. Your understanding and adherence to these terms ensure the respectful and lawful use of these resources.
Although configuration files (such as DATs, INIs, graphics, etc.) can be freely adjusted by anyone, the resource repository is fully functional to ensure all game features work smoothly. However, configuration values, like object positions on maps, weapon statistics, and spell balance, can be customized. This allows for flexibility while maintaining the core structure of the game intact.
Por favor considera apoyarnos en https://www.patreon.com/nolandstudios
This is a document with context and coding rules to help the AI understand how we code in Argentum Online using Visual Basic 6.
AI doesn’t guess well — if you don’t give it proper instructions, it will return incorrect, modern, or inconsistent code.
- First, copy and paste the Context into the chat. This tells the AI exactly what kind of project it’s working on and how it should think.
- Once the AI responds or acknowledges, paste the VB6 coding rules so it knows how to format and structure the code correctly.
- Now you're ready to ask for code improvements, refactors, or new implementations — and the AI will (usually) follow the correct style.
You are an experienced Visual Basic 6 developer working on the legacy MMORPG Argentum Online.
The project uses a client-server architecture, where both the server and the client are written in VB6.
Communication between them occurs via a custom packet protocol.
All development must follow legacy-compatible practices and the official coding standards.
Prioritize clean, readable code with minimal risk of regression.
Add comments to the code to make it understandable.
Avoid modern syntax not supported by VB6. Follow the standards in this document.
🛠️ Example of a good prompt:
Context: [paste the text from step 1] These are our coding rules: [paste rules from this document] Now, can you rewrite this function to follow those standards? [paste your VB6 function]
Because if you don’t:
- The AI might write VB.NET or modern syntax that VB6 doesn’t support
- It may ignore the style rules used in Argentum Online
- You’ll waste time correcting formatting or compatibility issues
- Server repository: ao-org/argentum-online-server
- Client repository: ao-org/argentum-online-client
- Always use
Call
when invoking anySub
. - Always include parentheses, even if there are no arguments.
Call GuardarDatos()
Call EnviarMensaje("Hola", 2)
- Even when ignoring the return value, functions must be called with parentheses.
Call ObtenerTiempoActual()
Dim puntos As Long
puntos = CalcularPuntos(usuarioId)
Element | Convention | Example |
---|---|---|
Modules | mod prefix |
modNetwork , modLogin |
Forms | frm prefix |
frmMain , frmLogin |
Controls | Hungarian notation | txtNombre , lblError |
Variables | camelCase |
userIndex , goldAmount |
Constants | UPPER |
GOLD_PRICE |
Functions/Subs | PascalCase |
Call ValidarUsuario() |
Enums | e_ prefix |
e_TipoPago |
- Use 4-space indentation.
- One blank line between procedures.
- Align related variable declarations:
Dim userGold As Long
Dim userSilver As Long
Dim userName As String
- Declare all fixed values as constants in shared modules.
Public Const GOLD_PRICE As Long = 50000
If .Stats.GLD < GOLD_PRICE Then
Call EscribirError("No tenés suficiente oro.")
End If
- Always use
On Error GoTo Name_Err
with a label at the end of theSub
.
Private Sub ValidarSesion()
On Error GoTo ValidarSesion_Err
Call HacerAlgo()
Exit Sub
ValidarSesion_Err:
Call TraceError(Err.Number, Err.Description, "modLogin.ValidarSesion", Erl)
End Sub
- Use clear, specific names.
- Avoid generic names like
dato
,res
,temp
.
Dim creditAmount As Long
Dim connectionId As Integer
- Always use parameterized queries (
?
). - Always close all
Recordset
objects.
Dim RS As ADODB.Recordset
Set RS = Query("SELECT nivel FROM user WHERE id = ?;", userId)
If Not RS.EOF Then
nivel = RS!nivel
End If
Call RS.Close
On the server, we use message IDs to send localised messages to clients. This approach allows for easy translation and dynamic content insertion.
- The server sends a message by referencing a message ID.
- The client resolves that ID using a message index file provided in the
argentum-online-creador-indices
repository. - These message definitions are part of the assets system.
Call WriteLocaleMsg(UserIndex, "1291", FONTTYPE_INFOBOLD, GOLD_PRICE)
"1291"
refers to a message like:
"You need at least ¬1 gold to sell your character"
GOLD_PRICE
dynamically replaces¬1
in the final message shown to the user.
For messages handled purely on the client side, we use JSON files for translation, located in the Languages
folder of the client repository:
Example:
Call MsgBox(JsonLanguage.Item("MENSAJE_ERROR_CARGAR_OPCIONES"), vbCritical, JsonLanguage.Item("TITULO_ERROR_CARGAR"))
This allows full client-side UI translation and supports switching languages at runtime by loading the appropriate JSON file.
- Use
Exit Sub
for early exits. - Avoid unnecessary nested structures.
If Not EstaAutenticado(UserIndex) Then
Call Desconectar(UserIndex)
Exit Sub
End If
- Prefer
Function
for validations or transformations. - Avoid modifying global variables unnecessarily.