Instrucciones para Agregar Registro en el Lado JoinServer
1. Modificaciones en stdafx.h
- Agregar la definición para el registro en el lado JoinServer:
stdafx.h

//Dakosmu #define LOGIN_REGISTER 1
2. Modificaciones en JoinServerProtocol.cpp
- Buscar la función
GJExternalDisconnectAccountRecv
y agregar el siguiente código:

Agregar la implementación de GJRegisterAccountRecv
al final del archivo JoinServerProtocol.cpp
:
#if(LOGIN_REGISTER) case 0x40: GJRegisterAccountRecv((SDHP_REGISTER_ACCOUNT_SEND*)lpMsg, index); break; #endif
y agregar en JoinServerProtocol.cpp este código al final de todo los demás códigos lo mas abajo posible

#if(LOGIN_REGISTER) void GJRegisterAccountRecv(SDHP_REGISTER_ACCOUNT_SEND* lpMsg, int index) { SDHP_CONNECT_ACCOUNT_SEND pMsg; pMsg.header.set(0x40, sizeof(pMsg)); pMsg.index = lpMsg->index; memcpy(pMsg.account, lpMsg->account, sizeof(pMsg.account)); pMsg.result = CREATE_ACCOUNT_FAIL_ID; if (CheckTextSyntax(lpMsg->account, sizeof(lpMsg->account)) == 0) { pMsg.result = CREATE_ACCOUNT_FAIL_RESIDENT; gSocketManager.DataSend(index, (BYTE*)&pMsg, pMsg.header.size); LogAdd(LOG_RED, "Account %s Register fail Syntax!"); return; } if (gAccountManager.GetAccountCount() >= #if PROTECT_STATE gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType] #else MAX_ACCOUNT #endif ) if (gAccountManager.GetAccountCount() >= gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType]) { pMsg.result = CREATE_ACCOUNT_FAIL_RESIDENT; gSocketManager.DataSend(index, (BYTE*)&pMsg, pMsg.header.size); LogAdd(LOG_RED, "Account %s Register fail, CONNECTION!!!"); return; } if (MD5Encryption == 0) { if (gQueryManager.ExecQuery("SELECT memb__pwd FROM MEMB_INFO WHERE memb___id='%s' COLLATE Latin1_General_BIN", lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA) { gQueryManager.Close(); if (gQueryManager.ExecQuery("INSERT INTO dbo.MEMB_INFO(memb___id, memb__pwd, memb_name, sno__numb, mail_addr, mail_chek, bloc_code, ctl1_code) VALUES ('%s', '%s', '%s', '%s', '%s', 1, 0, 1)", lpMsg->account, lpMsg->password, "JoinServer", lpMsg->personalcode, lpMsg->Email) == TRUE) { gQueryManager.Close(); pMsg.result = CREATE_ACCOUNT_SUCCESS; gLog.Output(LOG_ACCOUNT, "[AccountInfo] Account created (Account: %s, Password: %s )", lpMsg->account, lpMsg->password); } } else { pMsg.result = CREATE_ACCOUNT_FAIL_ID; gQueryManager.Close(); } } else { if (gQueryManager.ExecQuery("SELECT memb__pwd FROM MEMB_INFO WHERE memb___id='%s'", lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA) { gQueryManager.Close(); if (gQueryManager.ExecQuery("INSERT INTO dbo.MEMB_INFO(memb___id, memb__pwd, memb_name, sno__numb, mail_addr, mail_chek, bloc_code, ctl1_code) VALUES ('%s', '%s', '%s', '%s', '%s', 1, 0, 1)", lpMsg->account, lpMsg->password, "JoinServer", lpMsg->personalcode, lpMsg->Email) == TRUE) { gQueryManager.Close(); pMsg.result = CREATE_ACCOUNT_SUCCESS; gLog.Output(LOG_ACCOUNT, "[AccountInfo] Account created (Account: %s, Password: %s )", lpMsg->account, lpMsg->password); } } else { pMsg.result = CREATE_ACCOUNT_FAIL_ID; gQueryManager.Close(); } } gSocketManager.DataSend(index, (BYTE*)&pMsg, pMsg.header.size); } #endif
3. Modificaciones en JoinServerProtocol.h
- Agregar las definiciones de resultados de registro:

#define CREATE_ACCOUNT_FAIL_ID 0 #define CREATE_ACCOUNT_SUCCESS 1 #define CREATE_ACCOUNT_FAIL_RESIDENT 2
Buscar la estructura PWMSG_HEAD
y agregar la nueva estructura SDHP_REGISTER_ACCOUNT_SEND
:

4. Modificaciones en JoinServerProtocolCore
- Buscar
void JoinServerProtocolCore
y agregar la declaración de la función:
#if(LOGIN_REGISTER) struct SDHP_REGISTER_ACCOUNT_SEND { PBMSG_HEAD header; // C1:01 WORD index; char account[11]; char password[11]; char personalcode[11]; char Email[50]; }; #endif
Buscamos void JoinServerProtocolCore

Y agregamos
#if(LOGIN_REGISTER) void GJRegisterAccountRecv(SDHP_REGISTER_ACCOUNT_SEND* lpMsg, int index); #endif
Conclusión
Con estas modificaciones, habrás agregado la funcionalidad de registro de cuentas en el lado JoinServer. Asegúrate de probar el código para verificar que todo funcione correctamente. Si tienes alguna pregunta o necesitas más ayuda, no dudes en preguntar.