lo fixeas en el source del joinserver.
en que parte amigo ya le di vuelta y media al joinserver y no veo el codigo o donde ponerlo
este es el code
Code:
if(gAccountManager.GetAccountCount() >=
#if PROTECT_STATE
gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType]
#else
MAX_ACCOUNT
#endif
)
and CServerDisplayer::SetWindowName
Code:
wsprintf(buff,"[%s] JoinServer (QueueSize : %d) (AccountCount : %d/%d)",JOINSERVER_VERSION,gSocketManager.GetQueueSize(),
gAccountManager.GetAccountCount(),
#if PROTECT_STATE
gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType]
#else
MAX_ACCOUNT
#endif
);
by ashlay
si me enviara una foto donde ponerlo o el archivo .h o cpp seria feliz
la idea es formentar el aprendisaje
busca la funcion
void GJConnectAccountRecv(SDHP_CONNECT_ACCOUNT_RECV* lpMsg,int index) // OK
Remplaza la info dentro de esa funcion por esta.
{
SDHP_CONNECT_ACCOUNT_SEND pMsg;
pMsg.header.set(0x01,sizeof(pMsg));
pMsg.index = lpMsg->index;
memcpy(pMsg.account,lpMsg->account,sizeof(pMsg.account));
pMsg.result = 1;
if(CheckTextSyntax(lpMsg->account,sizeof(lpMsg->account)) == 0)
{
pMsg.result = 2;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
ACCOUNT_INFO AccountInfo;
if(gAccountManager.GetAccountInfo(&AccountInfo,lpMsg->account) != 0)
{
pMsg.result = 3;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
JGAccountAlreadyConnectedSend(AccountInfo.GameServerCode,AccountInfo.UserIndex,AccountInfo.Account);
return;
}
if(gAccountManager.GetAccountCount() >=
#if PROTECT_STATE
gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType]
#else
MAX_ACCOUNT
#endif
) //Fix 2
{
pMsg.result = 4;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
if(MD5Encryption == 0)
{
if(gQueryManager.ExecQuery("SELECT memb__pwd FROM MEMB_INFO WHERE memb___id='%s'",lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA)
{
gQueryManager.Close();
pMsg.result = 2;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
char password[11] = {0};
gQueryManager.GetAsString("memb__pwd",password,sizeof(password));
if(strcmp(lpMsg->password,password) != 0)
{
gQueryManager.Close();
pMsg.result = 0;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
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();
pMsg.result = 2;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
BYTE password[16] = {0};
gQueryManager.GetAsBinary("memb__pwd",password,sizeof(password));
MD5 MD5Hash;
if(MD5Hash.MD5_CheckValue(lpMsg->password,(char*)password,MakeAccountKey(lpMsg->account)) == 0)
{
gQueryManager.Close();
pMsg.result = 0;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
gQueryManager.Close();
}
if(gQueryManager.ExecQuery("SELECT sno__numb,bloc_code FROM MEMB_INFO WHERE memb___id='%s'",lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA)
{
gQueryManager.Close();
pMsg.result = 2;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
gQueryManager.GetAsString("sno__numb",pMsg.PersonalCode,sizeof(pMsg.PersonalCode));
pMsg.BlockCode = (BYTE)gQueryManager.GetAsInteger("bloc_code");
gQueryManager.Close();
if(gQueryManager.ExecQuery("EXEC WZ_GetAccountLevel '%s'",lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA)
{
gQueryManager.Close();
pMsg.result = 2;
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
return;
}
pMsg.AccountLevel = gQueryManager.GetAsInteger("AccountLevel");
gQueryManager.GetAsString("AccountExpireDate",pMsg.AccountExpireDate,sizeof(pMsg.AccountExpireDate));
gQueryManager.Close();
gQueryManager.ExecQuery("EXEC WZ_CONNECT_MEMB '%s','%s','%s'",lpMsg->account,gServerManager[index].m_ServerName,lpMsg->IpAddress);
gQueryManager.Close();
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
strcpy_s(AccountInfo.Account,lpMsg->account);
strcpy_s(AccountInfo.IpAddress,lpMsg->IpAddress);
AccountInfo.UserIndex = lpMsg->index;
AccountInfo.GameServerCode = gServerManager[index].m_ServerCode;
AccountInfo.MapServerMove = 0;
AccountInfo.MapServerMoveTime = 0;
AccountInfo.LastServerCode = -1;
AccountInfo.NextServerCode = -1;
AccountInfo.Map = 0;
AccountInfo.X = 0;
AccountInfo.Y = 0;
AccountInfo.AuthCode1 = 0;
AccountInfo.AuthCode2 = 0;
AccountInfo.AuthCode3 = 0;
AccountInfo.AuthCode4 = 0;
gAccountManager.InsertAccountInfo(AccountInfo);
gLog.Output(LOG_ACCOUNT,"[AccountInfo] Account connected (Account: %s, IpAddress: %s, GameServerCode: %d)",AccountInfo.Account,AccountInfo.IpAddress,AccountInfo.GameServerCode);
}
//mas facil imposible mi buen amigo.