diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 649c399bb..56c175c28 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -190,6 +190,8 @@ CServer::CServer() : m_DemoRecorder(&m_SnapshotDelta) m_MapReload = 0; + memset(m_aPrevStates, CClient::STATE_EMPTY, MAX_CLIENTS * sizeof(int)); + m_RconClientId = -1; Init(); @@ -591,6 +593,7 @@ int CServer::DelClientCallback(int ClientId, const char *pReason, void *pUser) pThis->m_aClients[ClientId].m_aClan[0] = 0; pThis->m_aClients[ClientId].m_Authed = 0; pThis->m_aClients[ClientId].m_AuthTries = 0; + pThis->m_aPrevStates[ClientId] = CClient::STATE_EMPTY; memset(&pThis->m_aClients[ClientId].m_Addr, 0, sizeof(NETADDR)); pThis->m_aClients[ClientId].m_Snapshots.PurgeAll(); return 0; @@ -1147,6 +1150,11 @@ int CServer::LoadMap(const char *pMapName) io_read(File, m_pCurrentMapData, m_CurrentMapSize); io_close(File); } + + for(int i=0; iPlayerData(ClientId)->m_CurrentTime = Score()->PlayerData(ClientId)->m_BestTime; m_apPlayers[ClientId]->m_Score = (Score()->PlayerData(ClientId)->m_BestTime)?Score()->PlayerData(ClientId)->m_BestTime:-9999; - char aBuf[512]; - str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientId), m_pController->GetTeamName(m_apPlayers[ClientId]->GetTeam())); - SendChat(-1, CGameContext::CHAT_ALL, aBuf); - - SendChatTarget(ClientId, "DDRace Mod. Version: " DDRACE_VERSION); - SendChatTarget(ClientId, "Official site: DDRace.info"); - SendChatTarget(ClientId, "For more Info /cmdlist"); - SendChatTarget(ClientId, "Or visit DDRace.info"); - SendChatTarget(ClientId, "To see this again say /info"); - SendChatTarget(ClientId, "Note This is an Alpha release, just for testing, your feedback is important!!"); + if(((CServer *) Server())->m_aPrevStates[ClientId] < CServer::CClient::STATE_INGAME) + { + char aBuf[512]; + str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientId), m_pController->GetTeamName(m_apPlayers[ClientId]->GetTeam())); + SendChat(-1, CGameContext::CHAT_ALL, aBuf); - if(g_Config.m_SvWelcome[0]!=0) SendChatTarget(ClientId,g_Config.m_SvWelcome); - //str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' team=%d", ClientId, Server()->ClientName(ClientId), m_apPlayers[ClientId]->GetTeam()); + SendChatTarget(ClientId, "DDRace Mod. Version: " DDRACE_VERSION); + SendChatTarget(ClientId, "Official site: DDRace.info"); + SendChatTarget(ClientId, "For more Info /cmdlist"); + SendChatTarget(ClientId, "Or visit DDRace.info"); + SendChatTarget(ClientId, "To see this again say /info"); + SendChatTarget(ClientId, "Note This is an Alpha release, just for testing, your feedback is important!!"); + + if(g_Config.m_SvWelcome[0]!=0) SendChatTarget(ClientId,g_Config.m_SvWelcome); + //str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' team=%d", ClientId, Server()->ClientName(ClientId), m_apPlayers[ClientId]->GetTeam()); - Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf); + Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf); + } m_VoteUpdate = true; } diff --git a/src/game/server/gameworld.cpp b/src/game/server/gameworld.cpp index 577f69511..72c712149 100644 --- a/src/game/server/gameworld.cpp +++ b/src/game/server/gameworld.cpp @@ -268,5 +268,4 @@ void CGameWorld::ReleaseHooked(int ClientId) p->m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT; p->m_Core.m_HookState = HOOK_RETRACTED; } - }