Skip to content

Commit 4391c9f

Browse files
author
nitrocaster
committed
Move GameSpy wrappers to xrGameSpy.
1 parent 56b8834 commit 4391c9f

File tree

93 files changed

+1205
-3400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1205
-3400
lines changed

src/xrGame/GamePersistent.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -219,32 +219,6 @@ LPCSTR GameTypeToString(EGameIDs gt, bool bShort)
219219
}
220220
}
221221

222-
EGameIDs ParseStringToGameType(LPCSTR str)
223-
{
224-
if (!xr_strcmp(str, "single"))
225-
return eGameIDSingle;
226-
else
227-
if (!xr_strcmp(str, "deathmatch") || !xr_strcmp(str, "dm"))
228-
return eGameIDDeathmatch;
229-
else
230-
if (!xr_strcmp(str, "teamdeathmatch") || !xr_strcmp(str, "tdm"))
231-
return eGameIDTeamDeathmatch;
232-
else
233-
if (!xr_strcmp(str, "artefacthunt") || !xr_strcmp(str, "ah"))
234-
return eGameIDArtefactHunt;
235-
else
236-
if (!xr_strcmp(str, "capturetheartefact") || !xr_strcmp(str, "cta"))
237-
return eGameIDCaptureTheArtefact;
238-
else
239-
if (!xr_strcmp(str, "dominationzone"))
240-
return eGameIDDominationZone;
241-
else
242-
if (!xr_strcmp(str, "teamdominationzone"))
243-
return eGameIDTeamDominationZone;
244-
else
245-
return eGameIDNoGame; //EGameIDs
246-
}
247-
248222
void CGamePersistent::UpdateGameType ()
249223
{
250224
__super::UpdateGameType ();

src/xrGame/Level_GameSpy_Funcs.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#include "Level.h"
33
#include "xrMessages.h"
44
#include "xrEngine/x_ray.h"
5-
#include "GameSpy/GameSpy_GCD_Client.h"
6-
7-
5+
#include "xrGameSpy/GameSpy_GCD_Client.h"
86
#include "xrEngine/IGame_Persistent.h"
7+
#include "ui/UICDkey.h"
8+
99
void CLevel::OnGameSpyChallenge (NET_Packet* P)
1010
{
1111
#ifndef MASTER_GOLD
@@ -19,7 +19,9 @@ void CLevel::OnGameSpyChallenge (NET_Packet* P)
1919
//--------------------------------------------------------------------
2020
string128 ResponseStr="";
2121
CGameSpy_GCD_Client GCD;
22-
GCD.CreateRespond(ResponseStr, ChallengeStr, Reauth);
22+
string512 cdkey = "";
23+
GetCDKey_FromRegistry(cdkey);
24+
GCD.CreateRespond(cdkey, ResponseStr, ChallengeStr, Reauth);
2325
//--------- Send Respond ---------------------------------------------
2426
NET_Packet newP;
2527

src/xrGame/MainMenu.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
#include <dinput.h>
1212
#include "ui\UIBtnHint.h"
1313
#include "UICursor.h"
14-
#include "gamespy/GameSpy_Full.h"
15-
#include "gamespy/GameSpy_HTTP.h"
16-
#include "gamespy/GameSpy_Available.h"
17-
#include "gamespy/GameSpy_Browser.h"
14+
#include "xrGameSpy/GameSpy_Full.h"
15+
#include "xrGameSpy/GameSpy_HTTP.h"
16+
#include "xrGameSpy/GameSpy_Available.h"
17+
#include "xrGameSpy/GameSpy_Browser.h"
18+
#include "xrGameSpy/xrGameSpy.h"
1819
#include "CdkeyDecode/cdkeydecode.h"
1920
#include "string_table.h"
2021
#include "xrCore/os_clipboard.h"
@@ -759,7 +760,7 @@ bool CMainMenu::IsCDKeyIsValid()
759760
int GameID = 0;
760761
for (int i=0; i<4; i++)
761762
{
762-
m_pGameSpyFull->GetGameSpyHTTP()->xrGS_GetGameID(&GameID, i);
763+
GetGameID(&GameID, i);
763764
if (VerifyClientCheck(CDKey, unsigned short (GameID)) == 1)
764765
return true;
765766
};
@@ -795,14 +796,7 @@ void CMainMenu::OnConnectToMasterServerOkClicked(CUIWindow*, void*)
795796
LPCSTR CMainMenu::GetGSVer()
796797
{
797798
static string256 buff;
798-
if(m_pGameSpyFull)
799-
{
800-
xr_strcpy(buff, m_pGameSpyFull->GetGameVersion());
801-
}else
802-
{
803-
buff[0] = 0;
804-
}
805-
799+
xr_strcpy(buff, GetGameVersion());
806800
return buff;
807801
}
808802

src/xrGame/account_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "stdafx.h"
22
#include "account_manager.h"
3-
#include "gamespy/GameSpy_GP.h"
3+
#include "xrGameSpy/GameSpy_GP.h"
44

55
#include "MainMenu.h" //for accesssing to login_manager, if there's deleting profile
66
#include "login_manager.h" //for deleting profile (verifying) and deleting profile class instance

src/xrGame/account_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "Common/Noncopyable.hpp"
55
#include "mixed_delegate.h"
6-
#include "GameSpy/GameSpy_FuncDefs.h"
6+
#include "xrGameSpy/GameSpy_FuncDefs.h"
77

88
#include "queued_async_method.h"
99

src/xrGame/account_manager_console.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "stdafx.h"
22
#include "account_manager_console.h"
3-
#include "gamespy/GameSpy_Full.h"
4-
#include "gamespy/GameSpy_GP.h"
5-
#include "gamespy/GameSpy_SAKE.h"
3+
#include "xrGameSpy/GameSpy_Full.h"
4+
#include "xrGameSpy/GameSpy_GP.h"
5+
#include "xrGameSpy/GameSpy_SAKE.h"
66
#include "account_manager.h"
77
#include "login_manager.h"
88
#include "profile_store.h"

src/xrGame/awards_store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "stdafx.h"
22
#include "awards_store.h"
3-
#include "GameSpy/GameSpy_Full.h"
4-
#include "GameSpy/GAmeSpy_SAKE.h"
3+
#include "xrGameSpy/GameSpy_Full.h"
4+
#include "xrGameSpy/GAmeSpy_SAKE.h"
55

66
namespace gamespy_profile
77
{

src/xrGame/best_scores_store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "stdafx.h"
22
#include "best_scores_store.h"
3-
#include "GameSpy/GameSpy_Full.h"
4-
#include "GameSpy/GAmeSpy_SAKE.h"
3+
#include "xrGameSpy/GameSpy_Full.h"
4+
#include "xrGameSpy/GameSpy_SAKE.h"
55

66
namespace gamespy_profile
77
{

src/xrGame/console_commands.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
#include "character_hit_animations_params.h"
4444
#include "inventory_upgrade_manager.h"
4545

46-
#include "GameSpy/GameSpy_Full.h"
47-
#include "GameSpy/GameSpy_Patching.h"
46+
#include "xrGameSpy/GameSpy_Full.h"
47+
#include "xrGameSpy/GameSpy_Patching.h"
4848

4949
#include "ai_debug_variables.h"
5050
#include "xrPhysics/console_vars.h"

src/xrGame/console_commands_mp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "xrGameSpy/xrGameSpy_MainDefs.h"
2121
#include "DemoPlay_Control.h"
2222
#include "account_manager_console.h"
23-
#include "gamespy/GameSpy_GP.h"
23+
#include "xrGameSpy/GameSpy_GP.h"
2424

2525
EGameIDs ParseStringToGameType (LPCSTR str);
2626
LPCSTR GameTypeToString (EGameIDs gt, bool bShort);

0 commit comments

Comments
 (0)