6060
6161#include " WWDownload/Registry.h"
6262
63+ #include " ../ngmp_interfaces.h"
64+ #include " ../ngmp_include.h"
65+
6366#ifdef _INTERNAL
6467// for occasional debugging...
6568// #pragma optimize("", off)
@@ -91,7 +94,7 @@ static GameWindow *checkBoxNonAsianFont = NULL;
9194
9295static Bool isOverlayActive = false ;
9396static Bool raiseMessageBox = false ;
94- static Int lookAtPlayerID = 0 ;
97+ static int64_t lookAtPlayerID = 0 ;
9598static std::string lookAtPlayerName;
9699
97100
@@ -182,6 +185,8 @@ Int GetAdditionalDisconnectsFromUserFile(Int playerID)
182185 return 0 ;
183186 }
184187
188+ // TODO_NGMP_STATS:
189+ /*
185190 if (TheGameSpyInfo->getAdditionalDisconnects() > 0 && !retval)
186191 {
187192 DEBUG_LOG(("Clearing additional disconnects\n"));
@@ -192,6 +197,7 @@ Int GetAdditionalDisconnectsFromUserFile(Int playerID)
192197 {
193198 return TheGameSpyInfo->getAdditionalDisconnects();
194199 }
200+ */
195201
196202 return retval;
197203}
@@ -243,16 +249,18 @@ void GetAdditionalDisconnectsFromUserFile(PSPlayerStats *stats)
243249// default values
244250RankPoints::RankPoints (void )
245251{
252+ auto statsInterface = NGMP_OnlineServicesManager::GetInstance ()->GetStatsInterface ();
253+
246254 m_ranks[RANK_PRIVATE] = 0 ;
247- m_ranks[RANK_CORPORAL] = TheGameSpyConfig ->getPointsForRank (RANK_CORPORAL); // 5
248- m_ranks[RANK_SERGEANT] = TheGameSpyConfig ->getPointsForRank (RANK_SERGEANT); // 10
249- m_ranks[RANK_LIEUTENANT] = TheGameSpyConfig ->getPointsForRank (RANK_LIEUTENANT); // 20
250- m_ranks[RANK_CAPTAIN] = TheGameSpyConfig ->getPointsForRank (RANK_CAPTAIN); // 50
251- m_ranks[RANK_MAJOR] = TheGameSpyConfig ->getPointsForRank (RANK_MAJOR); // 100
252- m_ranks[RANK_COLONEL] = TheGameSpyConfig ->getPointsForRank (RANK_COLONEL); // 200
253- m_ranks[RANK_BRIGADIER_GENERAL] = TheGameSpyConfig ->getPointsForRank (RANK_BRIGADIER_GENERAL); // 500
254- m_ranks[RANK_GENERAL] = TheGameSpyConfig ->getPointsForRank (RANK_GENERAL); // 1000
255- m_ranks[RANK_COMMANDER_IN_CHIEF] = TheGameSpyConfig ->getPointsForRank (RANK_COMMANDER_IN_CHIEF); // 2000
255+ m_ranks[RANK_CORPORAL] = statsInterface ->getPointsForRank (RANK_CORPORAL); // 5
256+ m_ranks[RANK_SERGEANT] = statsInterface ->getPointsForRank (RANK_SERGEANT); // 10
257+ m_ranks[RANK_LIEUTENANT] = statsInterface ->getPointsForRank (RANK_LIEUTENANT); // 20
258+ m_ranks[RANK_CAPTAIN] = statsInterface ->getPointsForRank (RANK_CAPTAIN); // 50
259+ m_ranks[RANK_MAJOR] = statsInterface ->getPointsForRank (RANK_MAJOR); // 100
260+ m_ranks[RANK_COLONEL] = statsInterface ->getPointsForRank (RANK_COLONEL); // 200
261+ m_ranks[RANK_BRIGADIER_GENERAL] = statsInterface ->getPointsForRank (RANK_BRIGADIER_GENERAL); // 500
262+ m_ranks[RANK_GENERAL] = statsInterface ->getPointsForRank (RANK_GENERAL); // 1000
263+ m_ranks[RANK_COMMANDER_IN_CHIEF] = statsInterface ->getPointsForRank (RANK_COMMANDER_IN_CHIEF); // 2000
256264
257265 m_winMultiplier = 3 .0f ;
258266 m_lostMultiplier = 0 .0f ;
@@ -263,7 +271,7 @@ RankPoints::RankPoints(void)
263271
264272RankPoints *TheRankPointValues = NULL ;
265273
266- void SetLookAtPlayer ( Int id, AsciiString nick)
274+ void SetLookAtPlayer (int64_t id, AsciiString nick)
267275{
268276 lookAtPlayerID = id;
269277 lookAtPlayerName = nick.str ();
@@ -721,7 +729,10 @@ static void populateBattleHonors(const PSPlayerStats& stats, Int battleHonors, I
721729 }
722730 */
723731
724- if (TheGameSpyInfo->didPlayerPreorder (stats.id ))
732+ // TODO_NGMP_STATS
733+ bool bPreordered = true ;
734+ // if (TheGameSpyInfo->didPlayerPreorder(stats.id))
735+ if (bPreordered)
725736 {
726737 InsertBattleHonor (list, TheMappedImageCollection->findImageByName (" OfficersClub" ), TRUE ,
727738 BATTLE_HONOR_OFFICERSCLUB, row, column);
@@ -749,6 +760,7 @@ Int GetFavoriteSide( const PSPlayerStats& stats )
749760 return favorite;
750761}
751762
763+ // TODO_NGMP: We should calculate this and store it on server side too so we can display on website
752764Int CalculateRank ( const PSPlayerStats& stats )
753765{
754766 if (stats.id == 0 || !TheRankPointValues)
@@ -811,22 +823,23 @@ static GameWindow* findWindow(GameWindow *parent, AsciiString baseWindow, AsciiS
811823
812824void PopulatePlayerInfoWindows ( AsciiString parentWindowName )
813825{
814- Int lookupID = TheGameSpyInfo->getLocalProfileID ();
826+ int64_t localID = NGMP_OnlineServicesManager::GetInstance ()->GetAuthInterface ()->GetUserID ();
827+ int64_t lookupID = localID;
815828 if (parentWindowName == " PopupPlayerInfo.wnd" )
816829 {
817830 lookupID = lookAtPlayerID;
818- if (lookAtPlayerID <= 0 || !parent)
831+ if (lookAtPlayerID == - 1 || !parent)
819832 return ;
820833 }
821834
822- PSPlayerStats stats = TheGameSpyPSMessageQueue ->findPlayerStatsByID (lookupID);
835+ PSPlayerStats stats = NGMP_OnlineServicesManager::GetInstance ()-> GetStatsInterface () ->findPlayerStatsByID (lookupID);
823836
824837 Bool weHaveStats = (stats.id != 0 );
825838
826839 // if we don't have the stats from the server, see if we have cached stats
827- if ( !weHaveStats && lookupID == TheGameSpyInfo-> getLocalProfileID () )
840+ if ( !weHaveStats && lookupID == localID )
828841 {
829- stats = TheGameSpyInfo ->getCachedLocalPlayerStats ();
842+ stats = NGMP_OnlineServicesManager::GetInstance ()-> GetStatsInterface () ->getCachedLocalPlayerStats ();
830843
831844 weHaveStats = TRUE ;
832845 }
@@ -1303,7 +1316,7 @@ void GameSpyPlayerInfoOverlayInit( WindowLayout *layout, void *userData )
13031316 PopulatePlayerInfoWindows (" PopupPlayerInfo.wnd" );
13041317
13051318 // we're on the myinfo screen
1306- if (lookAtPlayerID == TheGameSpyInfo-> getLocalProfileID ())
1319+ if (lookAtPlayerID == NGMP_OnlineServicesManager::GetInstance ()-> GetAuthInterface ()-> GetUserID ())
13071320 {
13081321 // buttonbuttonOptions->winHide(FALSE);
13091322 buttonSetLocale->winHide (FALSE );
0 commit comments