Skip to content

Commit e51ed07

Browse files
committed
xrGame: remove undefined reference of GameSpy
1 parent 7efe754 commit e51ed07

22 files changed

+135
-26
lines changed

src/xrGame/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./stalker
6868
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./static_cast_checked_test.cpp")
6969
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_Client_BattlEye.cpp")
7070
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_Server_BattlEye.cpp")
71+
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./best_scores_store.cpp")
72+
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./stats_submitter.cpp")
7173
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ai/monsters/rats/ai_rat_fsm.cpp")
7274
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ui/CExtraContentFilter.cpp")
7375
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ui/UIDebugFonts.cpp")

src/xrGame/MainMenu.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ CMainMenu::CMainMenu()
8080
m_deactivated_frame = 0;
8181

8282
m_sPatchURL = "";
83+
#ifdef WINDOWS
8384
m_pGameSpyFull = NULL;
8485
m_account_mngr = NULL;
8586
m_login_mngr = NULL;
8687
m_profile_store = NULL;
8788
m_stats_submitter = NULL;
8889
m_atlas_submit_queue = NULL;
90+
#endif
8991

9092
m_sPDProgress.IsInProgress = false;
9193
m_downloaded_mp_map_url._set("");
@@ -103,6 +105,7 @@ CMainMenu::CMainMenu()
103105
{
104106
g_btnHint = new CUIButtonHint();
105107
g_statHint = new CUIButtonHint();
108+
#ifdef WINDOWS
106109
m_pGameSpyFull = new CGameSpy_Full();
107110

108111
for (u32 i = 0; i < u32(ErrMax); i++)
@@ -127,6 +130,7 @@ CMainMenu::CMainMenu()
127130
m_profile_store = new gamespy_profile::profile_store(m_pGameSpyFull);
128131
m_stats_submitter = new gamespy_profile::stats_submitter(m_pGameSpyFull);
129132
m_atlas_submit_queue = new atlas_submit_queue(m_stats_submitter);
133+
#endif
130134
}
131135

132136
Device.seqFrame.Add(this, REG_PRIORITY_LOW - 1000);
@@ -140,13 +144,15 @@ CMainMenu::~CMainMenu()
140144
xr_delete(m_startDialog);
141145
g_pGamePersistent->m_pMainMenu = NULL;
142146

147+
#ifdef WINDOWS
143148
xr_delete(m_account_mngr);
144149
xr_delete(m_login_mngr);
145150
xr_delete(m_profile_store);
146151
xr_delete(m_stats_submitter);
147152
xr_delete(m_atlas_submit_queue);
148153

149154
xr_delete(m_pGameSpyFull);
155+
#endif
150156

151157
xr_delete(m_demo_info_loader);
152158
delete_data(m_pMB_ErrDlgs);
@@ -521,6 +527,7 @@ void CMainMenu::OnFrame()
521527
Console->Show();
522528
}
523529

530+
#ifdef WINDOWS
524531
if (IsActive() || m_sPDProgress.IsInProgress)
525532
{
526533
GSUpdateStatus status = m_pGameSpyFull->Update();
@@ -534,6 +541,7 @@ void CMainMenu::OnFrame()
534541
}
535542
m_atlas_submit_queue->update();
536543
}
544+
#endif
537545

538546
if (IsActive())
539547
{
@@ -629,6 +637,7 @@ void CMainMenu::OnPatchCheck(bool success, LPCSTR VersionName, LPCSTR URL)
629637

630638
void CMainMenu::OnDownloadPatch(CUIWindow*, void*)
631639
{
640+
#ifdef WINDOWS
632641
CGameSpy_Available GSA;
633642
shared_str result_string;
634643
if (!GSA.CheckAvailableServices(result_string))
@@ -643,9 +652,7 @@ void CMainMenu::OnDownloadPatch(CUIWindow*, void*)
643652

644653
string4096 FilePath = "";
645654
char* FileName = NULL;
646-
#ifndef LINUX // FIXME!!!
647655
GetFullPathName(fileName, 4096, FilePath, &FileName);
648-
#endif
649656
string_path fname;
650657
if (FS.path_exist("$downloads$"))
651658
{
@@ -665,6 +672,7 @@ void CMainMenu::OnDownloadPatch(CUIWindow*, void*)
665672
progressCallback.bind(this, &CMainMenu::OnDownloadPatchProgress);
666673
m_pGameSpyFull->GetGameSpyHTTP()->DownloadFile(
667674
*m_sPatchURL, *m_sPatchFileName, completionCallback, progressCallback);
675+
#endif
668676
}
669677

670678
void CMainMenu::OnDownloadPatchResult(bool success)
@@ -724,8 +732,10 @@ void CMainMenu::OnRunDownloadedPatch(CUIWindow*, void*)
724732

725733
void CMainMenu::CancelDownload()
726734
{
735+
#ifdef WINDOWS
727736
m_pGameSpyFull->GetGameSpyHTTP()->StopDownload();
728737
m_sPDProgress.IsInProgress = false;
738+
#endif
729739
}
730740

731741
void CMainMenu::SetNeedVidRestart() { m_Flags.set(flNeedVidRestart, TRUE); }
@@ -781,6 +791,7 @@ LPCSTR DelHyphens(LPCSTR c)
781791

782792
bool CMainMenu::IsCDKeyIsValid()
783793
{
794+
#ifdef WINDOWS
784795
if (!m_pGameSpyFull || !m_pGameSpyFull->GetGameSpyHTTP())
785796
return false;
786797
string64 CDKey = "";
@@ -799,6 +810,9 @@ bool CMainMenu::IsCDKeyIsValid()
799810
return true;
800811
};
801812
return false;
813+
#else
814+
return true;
815+
#endif
802816
}
803817

804818
bool CMainMenu::ValidateCDKey()
@@ -831,12 +845,15 @@ void CMainMenu::OnConnectToMasterServerOkClicked(CUIWindow*, void*) { Hide_CTMS_
831845
LPCSTR CMainMenu::GetGSVer()
832846
{
833847
static string256 buff;
848+
#ifdef WINDOWS
834849
xr_strcpy(buff, GetGameVersion());
850+
#endif
835851
return buff;
836852
}
837853

838854
LPCSTR CMainMenu::GetPlayerName()
839855
{
856+
#ifdef WINDOWS
840857
gamespy_gp::login_manager* l_mngr = GetLoginMngr();
841858
gamespy_gp::profile const* tmp_prof = l_mngr ? l_mngr->get_current_profile() : NULL;
842859

@@ -845,6 +862,7 @@ LPCSTR CMainMenu::GetPlayerName()
845862
m_player_name = tmp_prof->unique_nick();
846863
}
847864
else
865+
#endif
848866
{
849867
string512 name;
850868
GetPlayerName_FromRegistry(name, sizeof(name));

src/xrGame/MainMenu.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ class CMainMenu : public IMainMenu,
6969
void ReadTextureInfo();
7070

7171
xr_vector<CUIWindow*> m_pp_draw_wnds;
72-
72+
#ifdef WINDOWS
7373
CGameSpy_Full* m_pGameSpyFull;
7474
gamespy_gp::account_manager* m_account_mngr;
7575
gamespy_gp::login_manager* m_login_mngr;
7676
gamespy_profile::profile_store* m_profile_store;
7777
gamespy_profile::stats_submitter* m_stats_submitter;
7878
atlas_submit_queue* m_atlas_submit_queue;
79-
79+
#endif
8080
demo_info_loader* m_demo_info_loader;
8181

8282
public:
@@ -107,13 +107,14 @@ class CMainMenu : public IMainMenu,
107107
Patch_Dawnload_Progress m_sPDProgress;
108108
Patch_Dawnload_Progress* GetPatchProgress() { return &m_sPDProgress; }
109109
void CancelDownload();
110-
110+
#ifdef WINDOWS
111111
CGameSpy_Full* GetGS() { return m_pGameSpyFull; };
112112
gamespy_gp::account_manager* GetAccountMngr() { return m_account_mngr; };
113113
gamespy_gp::login_manager* GetLoginMngr() { return m_login_mngr; };
114114
gamespy_profile::profile_store* GetProfileStore() { return m_profile_store; };
115115
gamespy_profile::stats_submitter* GetStatsSubmitter() { return m_stats_submitter; };
116116
atlas_submit_queue* GetSubmitQueue() { return m_atlas_submit_queue; };
117+
#endif
117118
protected:
118119
EErrorDlg m_NeedErrDialog;
119120
u32 m_start_time;
@@ -166,7 +167,7 @@ class CMainMenu : public IMainMenu,
166167
void UnregisterPPDraw(CUIWindow* w);
167168

168169
void SetErrorDialog(EErrorDlg ErrDlg);
169-
EErrorDlg GetErrorDialogType() const { return m_NeedErrDialog; };
170+
EErrorDlg GetErrorDialogType() const { return m_NeedErrDialog; }
170171
void CheckForErrorDlg();
171172
void SwitchToMultiplayerMenu();
172173
void xr_stdcall OnPatchCheck(bool success, LPCSTR VersionName, LPCSTR URL);

src/xrGame/account_manager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void account_manager::delete_profile(account_operation_cb dpcb)
234234
{
235235
m_profile_deleting_cb = dpcb;
236236
}
237-
237+
#ifdef WINDOWS
238238
login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
239239
VERIFY(tmp_lmngr);
240240
if (!tmp_lmngr->get_current_profile())
@@ -248,6 +248,7 @@ void account_manager::delete_profile(account_operation_cb dpcb)
248248
{
249249
m_profile_deleting_cb(false, CGameSpy_GP::TryToTranslate(tmp_res).c_str());
250250
}
251+
#endif
251252
}
252253

253254
void account_manager::get_account_profiles(char const* email, char const* password, account_profiles_cb profiles_cb)
@@ -446,10 +447,12 @@ void __cdecl account_manager::delete_profile_cb(GPConnection* connection, void*
446447
return;
447448
}
448449
VERIFY(tmp_inst->m_gamespy_gp);
450+
#ifdef WINDOWS
449451
login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
450452
VERIFY(tmp_lmngr);
451453
tmp_lmngr->delete_profile_obj();
452454
tmp_inst->m_profile_deleting_cb(true, "");
455+
#endif
453456
}
454457

455458
void __cdecl account_manager::search_profile_cb(GPConnection* connection, void* arg, void* param)

src/xrGame/account_manager_console.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
void CCC_CreateGameSpyAccount::Execute(LPCSTR args)
1414
{
15+
#ifdef WINDOWS
1516
if (!args || (xr_strlen(args) == 0))
1617
{
1718
TInfo tmp_info;
@@ -39,10 +40,12 @@ void CCC_CreateGameSpyAccount::Execute(LPCSTR args)
3940
prof_data.password = tmp_password;
4041

4142
tmp_acc_mngr->create_profile(tmp_nick, tmp_unick, tmp_email, tmp_password, gamespy_gp::account_operation_cb());
43+
#endif
4244
}
4345

4446
void CCC_GapySpyListProfiles::Execute(LPCSTR args)
4547
{
48+
#ifdef WINDOWS
4649
if (!args || (xr_strlen(args) == 0))
4750
{
4851
TInfo tmp_info;
@@ -60,10 +63,12 @@ void CCC_GapySpyListProfiles::Execute(LPCSTR args)
6063
VERIFY(tmp_gp);
6164
gamespy_gp::account_manager* tmp_acc_mngr = MainMenu()->GetAccountMngr();
6265
tmp_acc_mngr->get_account_profiles(tmp_email, tmp_password, gamespy_gp::account_profiles_cb());
66+
#endif
6367
}
6468

6569
void CCC_GameSpyLogin::Execute(LPCSTR args)
6670
{
71+
#ifdef WINDOWS
6772
if (!args || (xr_strlen(args) == 0))
6873
{
6974
TInfo tmp_info;
@@ -83,14 +88,17 @@ void CCC_GameSpyLogin::Execute(LPCSTR args)
8388
gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
8489
VERIFY(tmp_lmngr);
8590
tmp_lmngr->login(tmp_email, tmp_nick, tmp_password, gamespy_gp::login_operation_cb());
91+
#endif
8692
}
8793

8894
void CCC_GameSpyLogout::Execute(LPCSTR args)
8995
{
96+
#ifdef WINDOWS
9097
VERIFY(MainMenu() && MainMenu()->GetGS());
9198
gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
9299
VERIFY(tmp_lmngr);
93100
tmp_lmngr->logout();
101+
#endif
94102
}
95103

96104
static char const* print_time(time_t const& src_time, string64& dest_time)
@@ -103,6 +111,7 @@ static char const* print_time(time_t const& src_time, string64& dest_time)
103111

104112
void CCC_GameSpyPrintProfile::Execute(LPCSTR args)
105113
{
114+
#ifdef WINDOWS
106115
VERIFY(MainMenu() && MainMenu()->GetGS());
107116
gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
108117
gamespy_gp::profile const* tmp_profile = tmp_lmngr->get_current_profile();
@@ -145,40 +154,48 @@ void CCC_GameSpyPrintProfile::Execute(LPCSTR args)
145154
{
146155
Msg("- No profile. You are not loged in.");
147156
}
157+
#endif
148158
}
149159

150160
void CCC_GameSpySuggestUNicks::Execute(LPCSTR args)
151161
{
162+
#ifdef WINDOWS
152163
VERIFY(MainMenu() && MainMenu()->GetGS());
153164
string256 tmp_unick;
154165
sscanf(args, "%s", tmp_unick);
155166
gamespy_gp::account_manager* tmp_amngr = MainMenu()->GetAccountMngr();
156167
VERIFY(tmp_amngr);
157168
tmp_amngr->suggest_unique_nicks(tmp_unick, gamespy_gp::suggest_nicks_cb());
169+
#endif
158170
}
159171

160172
void CCC_GameSpyRegisterUniqueNick::Execute(LPCSTR args)
161173
{
174+
#ifdef WINDOWS
162175
VERIFY(MainMenu() && MainMenu()->GetGS());
163176
gamespy_gp::login_manager::unique_nick_t tmp_unick;
164177
sscanf(args, "%s", tmp_unick);
165178
gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
166179
VERIFY(tmp_lmngr);
167180
tmp_lmngr->set_unique_nick(tmp_unick, gamespy_gp::login_operation_cb());
181+
#endif
168182
}
169183

170184
void CCC_GameSpyDeleteProfile::Execute(LPCSTR args)
171185
{
186+
#ifdef WINDOWS
172187
VERIFY(MainMenu() && MainMenu()->GetGS());
173188
gamespy_gp::account_manager* tmp_amngr = MainMenu()->GetAccountMngr();
174189
VERIFY(tmp_amngr);
175190
tmp_amngr->delete_profile(gamespy_gp::account_operation_cb());
191+
#endif
176192
}
177193

178194
static gamespy_profile::all_best_scores_t debug_best_scores;
179195

180196
void CCC_GameSpyProfile::Execute(LPCSTR args)
181197
{
198+
#ifdef WINDOWS
182199
VERIFY(MainMenu());
183200
gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr();
184201
VERIFY(tmp_lmngr);
@@ -241,4 +258,5 @@ void CCC_GameSpyProfile::Execute(LPCSTR args)
241258
std::make_pair(static_cast<gamespy_profile::enum_best_score_type>(score_id), score_value));
242259
tmp_ssubmitter->set_best_scores(&debug_best_scores, tmp_curr_prof, gamespy_profile::store_operation_cb());
243260
}
261+
#endif
244262
}

0 commit comments

Comments
 (0)