When this work 0.3.7, but this dont work 0.3.7 R2 server.
Without call onplayerdisconnect public, join server?
[member=1371].silent[/member] [member=111]springfield[/member] [member=8182]ıllıllı 0β36 ıllıllı[/member] [member=9752]P3ti[/member]
Without call onplayerdisconnect public, join server?
Code:
sprintf_s(g_szNickName, 32, szNewPlayerName);
strcpy(playerInfo[g_myPlayerID].szPlayerName, g_szNickName);
int iVersion = NETGAME_VERSION;
unsigned int uiClientChallengeResponse = settings.uiChallange ^ iVersion;
BYTE byteMod = 1;
char auth_bs[4*16] = {0};
gen_gpci(auth_bs, 0x3e9);
BYTE byteAuthBSLen;
byteAuthBSLen = (BYTE)strlen(auth_bs);
BYTE byteNameLen = (BYTE)strlen(g_szNickName);
BYTE iClientVerLen = (BYTE)strlen(settings.szClientVersion);
RakNet::BitStream bsSend;
bsSend.Write(iVersion);
bsSend.Write(byteMod);
bsSend.Write(byteNameLen);
bsSend.Write(g_szNickName, byteNameLen);
bsSend.Write(uiClientChallengeResponse);
bsSend.Write(byteAuthBSLen);
bsSend.Write(auth_bs, byteAuthBSLen);
bsSend.Write(iClientVerLen);
bsSend.Write(settings.szClientVersion, iClientVerLen);
pRakClient->RPC(&RPC_ClientJoin, &bsSend, HIGH_PRIORITY, RELIABLE, 0, FALSE, UNASSIGNED_NETWORK_ID, NULL);
Code:
int gen_gpci(char buf[64], unsigned long factor) /* by bartekdvd */
{
unsigned char out[6*4] = {0};
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (int i = 0; i < 6*4; ++i)
out[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
out[6*4] = 0;
BIG_NUM_MUL((unsigned long*)out, (unsigned long*)out, factor);
unsigned int notzero = 0;
buf[0] = '0'; buf[1] = '\0';
if (factor == 0) return 1;
int pos = 0;
for (int i = 0; i < 24; i++)
{
unsigned char tmp = out[i] >> 4;
unsigned char tmp2 = out[i]&0x0F;
if (notzero || tmp)
{
buf[pos++] = (char)((tmp > 9)?(tmp + 55):(tmp + 48));
if (!notzero) notzero = 1;
}
if (notzero || tmp2)
{
buf[pos++] = (char)((tmp2 > 9)?(tmp2 + 55):(tmp2 + 48));
if (!notzero) notzero = 1;
}
}
buf[pos] = 0;
return pos;
}
[member=1371].silent[/member] [member=111]springfield[/member] [member=8182]ıllıllı 0β36 ıllıllı[/member] [member=9752]P3ti[/member]