void xrServer::AttachNewClient (IClient* CL) { MSYS_CONFIG msgConfig; msgConfig.sign1 = 0x12071980; msgConfig.sign2 = 0x26111975; msgConfig.is_battleye = 0; #ifdef BATTLEYE msgConfig.is_battleye = (g_pGameLevel && Level().battleye_system.server != 0)? 1 : 0; #endif // BATTLEYE if(psNET_direct_connect) //single_game { SV_Client = CL; CL->flags.bLocal = 1; SendTo_LL( SV_Client->ID, &msgConfig, sizeof(msgConfig), net_flags(TRUE,TRUE,TRUE,TRUE) ); } else { SendTo_LL (CL->ID,&msgConfig,sizeof(msgConfig), net_flags(TRUE, TRUE, TRUE, TRUE)); Server_Client_Check (CL); } // gen message if (!NeedToCheckClient_GameSpy_CDKey(CL)) { //------------------------------------------------------------- Check_GameSpy_CDKey_Success(CL); } //xrClientData * CL_D=(xrClientData*)(CL); //ip_address ClAddress; //GetClientAddress (CL->ID, ClAddress); CL->m_guid[0]=0; }
void xrServer::OnCL_Disconnected (IClient* CL) { //csPlayers.Enter (); // Game config (all, info includes deleted player now, excludes at the next cl-update) NET_Packet P; P.B.count = 0; P.w_clientID(CL->ID); xrClientData* xrCData = (xrClientData*)(CL); VERIFY(xrCData); if (!xrCData->ps) return; P.w_stringZ(xrCData->ps->getName()); P.w_u16(xrCData->ps->GameID); P.r_pos = 0; ClientID clientID; clientID.set(0); game->AddDelayedEvent(P,GAME_EVENT_PLAYER_DISCONNECTED, 0, clientID); // xrS_entities::iterator I=entities.begin(),E=entities.end(); if (GetClientsCount()>1 && !CL->flags.bLocal) { // Migrate entities for (; I!=E; ++I) { CSE_Abstract* entity = I->second; if (entity->owner == CL) PerformMigration (entity,(xrClientData*)CL,SelectBestClientToMigrateTo(entity,TRUE)); } } else { // Destroy entities while (!entities.empty()) { CSE_Abstract* entity = entities.begin()->second; entity_Destroy (entity); } } //csPlayers.Leave (); Server_Client_Check(CL); }