From 30d9c9f4d9e46fec403f3fa810898017a18e93b6 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 15 Mar 2011 11:23:49 +0100 Subject: made network support clan name and country code for players --- src/game/server/gamecontext.cpp | 4 ++++ src/game/server/player.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game/server') diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 8c3dc3e3..348b6735 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -796,6 +796,8 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) // set start infos Server()->SetClientName(ClientID, pMsg->m_pName); + Server()->SetClientClan(ClientID, pMsg->m_pClan); + Server()->SetClientCountry(ClientID, pMsg->m_Country); str_copy(pPlayer->m_TeeInfos.m_SkinName, pMsg->m_pSkin, sizeof(pPlayer->m_TeeInfos.m_SkinName)); pPlayer->m_TeeInfos.m_UseCustomColor = pMsg->m_UseCustomColor; pPlayer->m_TeeInfos.m_ColorBody = pMsg->m_ColorBody; @@ -840,6 +842,8 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientID)); SendChat(-1, CGameContext::CHAT_ALL, aChatText); } + Server()->SetClientClan(ClientID, pMsg->m_pClan); + Server()->SetClientCountry(ClientID, pMsg->m_Country); str_copy(pPlayer->m_TeeInfos.m_SkinName, pMsg->m_pSkin, sizeof(pPlayer->m_TeeInfos.m_SkinName)); pPlayer->m_TeeInfos.m_UseCustomColor = pMsg->m_UseCustomColor; pPlayer->m_TeeInfos.m_ColorBody = pMsg->m_ColorBody; diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 82b45011..6c118a19 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -107,7 +107,9 @@ void CPlayer::Snap(int SnappingClient) if(!pClientInfo) return; - StrToInts(&pClientInfo->m_Name0, 6, Server()->ClientName(m_ClientID)); + StrToInts(&pClientInfo->m_Name0, 4, Server()->ClientName(m_ClientID)); + StrToInts(&pClientInfo->m_Clan0, 3, Server()->ClientClan(m_ClientID)); + pClientInfo->m_Country = Server()->ClientCountry(m_ClientID); StrToInts(&pClientInfo->m_Skin0, 6, m_TeeInfos.m_SkinName); pClientInfo->m_UseCustomColor = m_TeeInfos.m_UseCustomColor; pClientInfo->m_ColorBody = m_TeeInfos.m_ColorBody; -- cgit 1.4.1