WOLLoginProfile.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/Commando/WOLLoginProfile.cpp $
  22. *
  23. * DESCRIPTION
  24. * Login profile holds the users login preferences as well as other
  25. * information that needs to be persistantly cached between game sessions.
  26. *
  27. * PROGRAMMER
  28. * Denzil E. Long, Jr.
  29. * $Author: Greg_h $
  30. *
  31. * VERSION INFO
  32. * $Revision: 14 $
  33. * $Modtime: 6/21/02 11:40a $
  34. *
  35. ******************************************************************************/
  36. #include "WOLLoginProfile.h"
  37. #include "_globals.h"
  38. #include "Resource.h"
  39. #include <WWOnline\WOLLoginInfo.h>
  40. #include <WWUI\DialogBase.h>
  41. #include <WWUI\ListCtrl.h>
  42. #include <WWLib\Registry.h>
  43. #include "String_IDs.h"
  44. #include <WWTranslateDB\TranslateDB.h>
  45. #include <stdio.h>
  46. using namespace WWOnline;
  47. #define MAX_STRING_LEN 64;
  48. static const char* REG_VALUE_SERVER = "Server";
  49. static const char* REG_VALUE_SIDEPREF = "SidePref";
  50. static const char* REG_VALUE_GAMESPLAYED = "Played";
  51. static const char* REG_VALUE_TEAMRANK = "RankTeam";
  52. static const char* REG_VALUE_CLANRANK = "RankClan";
  53. // Profile ranking columns
  54. static enum
  55. {
  56. COL_LADDERNAME = 0,
  57. COL_WINS,
  58. COL_DEATHS,
  59. COL_POINTS,
  60. COL_RANK,
  61. COL_MAXCOUNT
  62. };
  63. static void ShowRanking(ListCtrlClass* list, LadderType type, const LoginProfile::Ranking* rank);
  64. bool LoginProfile::_mSaveAllowed = true;
  65. LoginProfile* LoginProfile::_mCurrentProfile = NULL;
  66. /******************************************************************************
  67. *
  68. * NAME
  69. * LoginProfile::EnableSaving
  70. *
  71. * DESCRIPTION
  72. *
  73. * INPUTS
  74. *
  75. * RESULT
  76. * NONE
  77. *
  78. ******************************************************************************/
  79. void LoginProfile::EnableSaving(bool allowed)
  80. {
  81. _mSaveAllowed = allowed;
  82. }
  83. /******************************************************************************
  84. *
  85. * NAME
  86. * LoginProfile::SetCurrent
  87. *
  88. * DESCRIPTION
  89. *
  90. * INPUTS
  91. *
  92. * RESULT
  93. * NONE
  94. *
  95. ******************************************************************************/
  96. void LoginProfile::SetCurrent(LoginProfile* profile)
  97. {
  98. if (_mCurrentProfile != NULL)
  99. {
  100. _mCurrentProfile->Release_Ref();
  101. _mCurrentProfile = NULL;
  102. }
  103. if (profile)
  104. {
  105. profile->Add_Ref();
  106. _mCurrentProfile = profile;
  107. }
  108. }
  109. /******************************************************************************
  110. *
  111. * NAME
  112. * LoginProfile::Get
  113. *
  114. * DESCRIPTION
  115. * Get the login profile for the specified user.
  116. *
  117. * INPUTS
  118. * Name - Name of profile to get.
  119. *
  120. * RESULT
  121. * Profile - Instance to login profile
  122. *
  123. ******************************************************************************/
  124. LoginProfile* LoginProfile::Get(const wchar_t* loginName, bool createOK)
  125. {
  126. if (loginName && wcslen(loginName))
  127. {
  128. // Check the current profile first
  129. if (_mCurrentProfile)
  130. {
  131. if (wcsicmp(_mCurrentProfile->GetName(), loginName) == 0)
  132. {
  133. _mCurrentProfile->Add_Ref();
  134. return _mCurrentProfile;
  135. }
  136. }
  137. StringClass regKey(255, true);
  138. regKey.Format("%s\\%S", APPLICATION_SUB_KEY_NAME_LOGINS, loginName);
  139. if (RegistryClass::Exists(regKey) || createOK)
  140. {
  141. return Create(loginName);
  142. }
  143. }
  144. return NULL;
  145. }
  146. /******************************************************************************
  147. *
  148. * NAME
  149. * LoginProfile::Create
  150. *
  151. * DESCRIPTION
  152. * Create an instance of a login profile.
  153. *
  154. * INPUTS
  155. * Login - Login to create profile for.
  156. *
  157. * RESULT
  158. * Profile - Instance to login profile
  159. *
  160. ******************************************************************************/
  161. LoginProfile* LoginProfile::Create(const wchar_t* loginName)
  162. {
  163. LoginProfile* profile = NULL;
  164. if (loginName && wcslen(loginName))
  165. {
  166. profile = new LoginProfile;
  167. if (profile)
  168. {
  169. if (profile->FinalizeCreate(loginName) == false)
  170. {
  171. profile->Release_Ref();
  172. profile = NULL;
  173. }
  174. }
  175. }
  176. return profile;
  177. }
  178. /******************************************************************************
  179. *
  180. * NAME
  181. * LoginProfile::Delete
  182. *
  183. * DESCRIPTION
  184. * Delete a login profile.
  185. *
  186. * INPUTS
  187. * Name - Name of login profile to delete.
  188. *
  189. * RESULT
  190. * NONE
  191. *
  192. ******************************************************************************/
  193. void LoginProfile::Delete(const wchar_t* loginName)
  194. {
  195. if (loginName && wcslen(loginName))
  196. {
  197. RegistryClass registry(APPLICATION_SUB_KEY_NAME_LOGINS, false);
  198. if (registry.Is_Valid())
  199. {
  200. char valueName[64];
  201. wcstombs(valueName, loginName, sizeof(valueName));
  202. registry.Delete_Value(valueName);
  203. }
  204. }
  205. }
  206. /******************************************************************************
  207. *
  208. * NAME
  209. * LoginProfile::LoginProfile
  210. *
  211. * DESCRIPTION
  212. * Constructor
  213. *
  214. * INPUTS
  215. * NONE
  216. *
  217. * RESULT
  218. * NONE
  219. *
  220. ******************************************************************************/
  221. LoginProfile::LoginProfile() :
  222. mLocale(WOL::LOC_UNKNOWN),
  223. mSidePref(-1),
  224. mGamesPlayed(0)
  225. {
  226. memset(&mTeamRank, 0, sizeof(Ranking));
  227. memset(&mClanRank, 0, sizeof(Ranking));
  228. }
  229. /******************************************************************************
  230. *
  231. * NAME
  232. * LoginProfile::~LoginProfile
  233. *
  234. * DESCRIPTION
  235. * Destructor
  236. *
  237. * INPUTS
  238. * NONE
  239. *
  240. * RESULT
  241. * NONE
  242. *
  243. ******************************************************************************/
  244. LoginProfile::~LoginProfile()
  245. {
  246. WWDEBUG_SAY(("LoginProfile destroyed (%S)\n", (const WCHAR*)mName));
  247. }
  248. /******************************************************************************
  249. *
  250. * NAME
  251. * LoginProfile::FinalizeCreate
  252. *
  253. * DESCRIPTION
  254. * Finalize object creation
  255. *
  256. * INPUTS
  257. * Login - Login to initialize profile with.
  258. *
  259. * RESULT
  260. * True if successfull
  261. *
  262. ******************************************************************************/
  263. bool LoginProfile::FinalizeCreate(const wchar_t* loginName)
  264. {
  265. WWDEBUG_SAY(("LoginProfile created %S\n", loginName));
  266. mName = loginName;
  267. LoadSettings();
  268. return true;
  269. }
  270. /******************************************************************************
  271. *
  272. * NAME
  273. * LoginProfile::GetName
  274. *
  275. * DESCRIPTION
  276. * Get the name of this profile
  277. *
  278. * INPUTS
  279. * NONE
  280. *
  281. * RESULT
  282. * Name of profile
  283. *
  284. ******************************************************************************/
  285. const wchar_t* LoginProfile::GetName(void) const
  286. {
  287. return mName;
  288. }
  289. /******************************************************************************
  290. *
  291. * NAME
  292. * LoginProfile::SetPreferredServer
  293. *
  294. * DESCRIPTION
  295. * Set the preferred server for this login.
  296. *
  297. * INPUTS
  298. * Server - Name of preferred server.
  299. *
  300. * RESULT
  301. * NONE
  302. *
  303. ******************************************************************************/
  304. void LoginProfile::SetPreferredServer(const char* name)
  305. {
  306. mServer = name;
  307. }
  308. /******************************************************************************
  309. *
  310. * NAME
  311. * LoginProfile::SetSidePreference
  312. *
  313. * DESCRIPTION
  314. * Set the side preference
  315. *
  316. * INPUTS
  317. * Side - Prefered side
  318. *
  319. * RESULT
  320. * NONE
  321. *
  322. ******************************************************************************/
  323. void LoginProfile::SetSidePreference(int side)
  324. {
  325. mSidePref = side;
  326. }
  327. /******************************************************************************
  328. *
  329. * NAME
  330. * LoginProfile::SetGamesPlayed
  331. *
  332. * DESCRIPTION
  333. * Set the number of games played for this login.
  334. *
  335. * INPUTS
  336. * Played - Number of games played.
  337. *
  338. * RESULT
  339. * NONE
  340. *
  341. ******************************************************************************/
  342. void LoginProfile::SetGamesPlayed(unsigned long played)
  343. {
  344. mGamesPlayed = played;
  345. }
  346. /******************************************************************************
  347. *
  348. * NAME
  349. * LoginProfile::SetLocale
  350. *
  351. * DESCRIPTION
  352. * Set locale for this profile
  353. *
  354. * INPUTS
  355. * Locale - New locale
  356. *
  357. * RESULT
  358. * NONE
  359. *
  360. ******************************************************************************/
  361. void LoginProfile::SetLocale(WOL::Locale locale)
  362. {
  363. mLocale = max<WOL::Locale>(locale, WOL::LOC_UNKNOWN);
  364. }
  365. /******************************************************************************
  366. *
  367. * NAME
  368. * LoginProfile::GetRanking
  369. *
  370. * DESCRIPTION
  371. * Get ladder ranking information.
  372. *
  373. * INPUTS
  374. * Ladder - Type of ladder to get ranking information for.
  375. *
  376. * RESULT
  377. * Rank - Ladder ranking data
  378. *
  379. ******************************************************************************/
  380. const LoginProfile::Ranking* LoginProfile::GetRanking(LadderType type) const
  381. {
  382. if (type == LadderType_Team)
  383. {
  384. return &mTeamRank;
  385. }
  386. else if (type == LadderType_Clan)
  387. {
  388. return &mClanRank;
  389. }
  390. return NULL;
  391. }
  392. /******************************************************************************
  393. *
  394. * NAME
  395. * LoginProfile::SetRanking
  396. *
  397. * DESCRIPTION
  398. * Set ladder ranking information
  399. *
  400. * INPUTS
  401. * Ladder - Type of ladder to set ranking for.
  402. * Rank - Ranking data
  403. *
  404. * RESULT
  405. * NONE
  406. *
  407. ******************************************************************************/
  408. void LoginProfile::SetRanking(WWOnline::LadderType type, Ranking& rank)
  409. {
  410. if (type == LadderType_Team)
  411. {
  412. memcpy(&mTeamRank, &rank, sizeof(Ranking));
  413. }
  414. else if (type == LadderType_Clan)
  415. {
  416. memcpy(&mClanRank, &rank, sizeof(Ranking));
  417. }
  418. }
  419. /******************************************************************************
  420. *
  421. * NAME
  422. * LoginProfile::LoadSettings
  423. *
  424. * DESCRIPTION
  425. * Load cached profile settings.
  426. *
  427. * INPUTS
  428. * NONE
  429. *
  430. * RESULT
  431. * NONE
  432. *
  433. ******************************************************************************/
  434. void LoginProfile::LoadSettings(void)
  435. {
  436. // Get this logins locale
  437. mLocale = WOL::LOC_UNKNOWN;
  438. RefPtr<LoginInfo> login = LoginInfo::Find(GetName());
  439. if (login.IsValid())
  440. {
  441. mLocale = login->GetLocale();
  442. }
  443. // Get login preferences
  444. StringClass regKey(255, true);
  445. regKey.Format("%s\\%S", APPLICATION_SUB_KEY_NAME_LOGINS, GetName());
  446. RegistryClass registry(regKey, false);
  447. if (registry.Is_Valid())
  448. {
  449. registry.Get_String(REG_VALUE_SERVER, mServer, "");
  450. mSidePref = registry.Get_Int(REG_VALUE_SIDEPREF, -1);
  451. mGamesPlayed = registry.Get_Int(REG_VALUE_GAMESPLAYED, 0);
  452. }
  453. LoadRank(REG_VALUE_TEAMRANK, mTeamRank);
  454. LoadRank(REG_VALUE_CLANRANK, mClanRank);
  455. }
  456. /******************************************************************************
  457. *
  458. * NAME
  459. * LoginProfile::SaveSettings
  460. *
  461. * DESCRIPTION
  462. * Save current profile settings.
  463. *
  464. * INPUTS
  465. * NONE
  466. *
  467. * RESULT
  468. * NONE
  469. *
  470. ******************************************************************************/
  471. void LoginProfile::SaveSettings(void)
  472. {
  473. bool isStored = true;
  474. RefPtr<LoginInfo> login = LoginInfo::Find(GetName());
  475. if (login.IsValid())
  476. {
  477. isStored = login->IsStored();
  478. // Save locale
  479. login->SetLocale((WOL::Locale)mLocale);
  480. }
  481. // If we are allowed to
  482. if (_mSaveAllowed && isStored)
  483. {
  484. // Save login preferences
  485. StringClass regKey(255, true);
  486. regKey.Format("%s\\%S", APPLICATION_SUB_KEY_NAME_LOGINS, GetName());
  487. RegistryClass registry(regKey);
  488. if (registry.Is_Valid())
  489. {
  490. registry.Set_String(REG_VALUE_SERVER, mServer);
  491. registry.Set_Int(REG_VALUE_SIDEPREF, mSidePref);
  492. registry.Set_Int(REG_VALUE_GAMESPLAYED, mGamesPlayed);
  493. }
  494. SaveRank(REG_VALUE_TEAMRANK, mTeamRank);
  495. SaveRank(REG_VALUE_CLANRANK, mClanRank);
  496. }
  497. }
  498. /******************************************************************************
  499. *
  500. * NAME
  501. * LoginProfile::LoadRank
  502. *
  503. * DESCRIPTION
  504. * Load cached ranking data.
  505. *
  506. * INPUTS
  507. * Key - Registry key to load ranking from.
  508. * Rank - Ranking data to initialize.
  509. *
  510. * RESULT
  511. * NONE
  512. *
  513. ******************************************************************************/
  514. void LoginProfile::LoadRank(const char* valueName, LoginProfile::Ranking& rank)
  515. {
  516. WWASSERT(valueName);
  517. StringClass regKey(255, true);
  518. regKey.Format("%s\\%S", APPLICATION_SUB_KEY_NAME_LOGINS, GetName());
  519. RegistryClass registry(regKey, false);
  520. if (registry.Is_Valid())
  521. {
  522. char rankData[255];
  523. registry.Get_String(valueName, rankData, sizeof(rankData), "");
  524. sscanf(rankData, "%d,%d,%d,%d,%d,%d", &rank.Wins, &rank.Losses,
  525. &rank.Deaths, &rank.Kills, &rank.Points, &rank.Rank);
  526. }
  527. else
  528. {
  529. rank.Wins = (unsigned)-1;
  530. rank.Losses = (unsigned)-1;
  531. rank.Deaths = (unsigned)-1;
  532. rank.Kills = (unsigned)-1;
  533. rank.Points = (unsigned)-1;
  534. rank.Rank = (unsigned)-1;
  535. }
  536. }
  537. /******************************************************************************
  538. *
  539. * NAME
  540. * LoginProfile::SaveRank
  541. *
  542. * DESCRIPTION
  543. * Save current ranking data.
  544. *
  545. * INPUTS
  546. * Key - Registry key to save ranking data to.
  547. * Rank - Ranking data to save.
  548. *
  549. * RESULT
  550. * NONE
  551. *
  552. ******************************************************************************/
  553. void LoginProfile::SaveRank(const char* valueName, const LoginProfile::Ranking& rank)
  554. {
  555. WWASSERT(valueName);
  556. StringClass regKey(255, true);
  557. regKey.Format("%s\\%S", APPLICATION_SUB_KEY_NAME_LOGINS, GetName());
  558. RegistryClass registry(regKey);
  559. if (registry.Is_Valid())
  560. {
  561. char rankData[255];
  562. sprintf(rankData, "%d,%d,%d,%d,%d,%d", rank.Wins, rank.Losses, rank.Deaths,
  563. rank.Kills, rank.Points, rank.Rank);
  564. registry.Set_String(valueName, rankData);
  565. }
  566. }
  567. /******************************************************************************
  568. *
  569. * NAME
  570. * ShowProfileRanking
  571. *
  572. * DESCRIPTION
  573. *
  574. * INPUTS
  575. * Dialog - Dialog to display ranking on. (Must have neccessary controls)
  576. * Profile - Profile to display
  577. *
  578. * RESULT
  579. * NONE
  580. *
  581. ******************************************************************************/
  582. void ShowProfileRanking(DialogBaseClass* dialog, const LoginProfile* profile)
  583. {
  584. dialog->Set_Dlg_Item_Text(IDC_PROFILENAME, L"");
  585. ListCtrlClass* list = (ListCtrlClass*)dialog->Get_Dlg_Item(IDC_PROFILERANK);
  586. if (list)
  587. {
  588. list->Allow_Selection(false);
  589. list->Delete_All_Entries();
  590. if (list->Get_Column_Count() != COL_MAXCOUNT)
  591. {
  592. list->Delete_All_Columns();
  593. // Configure the columns
  594. Vector3 color(1, 1, 1);
  595. list->Add_Column(TRANSLATE(IDS_MENU_RANKING), 0.2F, color);
  596. list->Add_Column(TRANSLATE(IDS_MENU_WINS_LOSSES), 0.2F, color);
  597. list->Add_Column(TRANSLATE(IDS_BUDDY_COL_DEATHS_KILLS), 0.2F, color);
  598. list->Add_Column(TRANSLATE(IDS_BUDDY_COL_POINTS), 0.2F, color);
  599. list->Add_Column(TRANSLATE(IDS_BUDDY_COL_RANK), 0.2F, color);
  600. }
  601. //(gth) Renegade day 120 Patch: re-translate these strings each time!
  602. struct {const wchar_t* name; WWOnline::LadderType type;} _ladders[] =
  603. {
  604. {TRANSLATE(IDS_MENU_INDIVIDUAL), WWOnline::LadderType_Team},
  605. {TRANSLATE(IDS_MENU_CLAN), WWOnline::LadderType_Clan}
  606. };
  607. // Initialize with unknown data
  608. for (int index = 0; index < 2; ++index)
  609. {
  610. int item = list->Insert_Entry(index, _ladders[index].name);
  611. if (item != -1)
  612. {
  613. list->Set_Entry_Data(item, COL_LADDERNAME, _ladders[index].type);
  614. list->Set_Entry_Text(item, COL_WINS, L"- / -");
  615. list->Set_Entry_Text(item, COL_DEATHS, L"- / -");
  616. list->Set_Entry_Text(item, COL_POINTS, L"-");
  617. list->Set_Entry_Text(item, COL_RANK, L"-");
  618. }
  619. }
  620. // Show the profile's ranking
  621. if (profile)
  622. {
  623. WideStringClass profileName(128, true);
  624. profileName.Format(TRANSLATE(IDS_MENU_RANKING_PROFILE), profile->GetName());
  625. dialog->Set_Dlg_Item_Text(IDC_PROFILENAME, profileName);
  626. ShowRanking(list, WWOnline::LadderType_Team, profile->GetRanking(WWOnline::LadderType_Team));
  627. ShowRanking(list, WWOnline::LadderType_Clan, profile->GetRanking(WWOnline::LadderType_Clan));
  628. }
  629. }
  630. }
  631. /******************************************************************************
  632. *
  633. * NAME
  634. * ShowRanking
  635. *
  636. * DESCRIPTION
  637. *
  638. * INPUTS
  639. * List - List control to show ranking in
  640. * Type - Type of ladder
  641. * Rank - Ladder ranking data
  642. *
  643. * RESULT
  644. * NONE
  645. *
  646. ******************************************************************************/
  647. void ShowRanking(ListCtrlClass* list, WWOnline::LadderType type, const LoginProfile::Ranking* rank)
  648. {
  649. WWASSERT(list != NULL);
  650. WWASSERT(rank != NULL);
  651. int count = list->Get_Entry_Count();
  652. for (int index = 0; index < count; index++)
  653. {
  654. if ((WWOnline::LadderType)list->Get_Entry_Data(index, COL_LADDERNAME) == type)
  655. {
  656. WideStringClass text(64, true);
  657. if (rank->Wins != (unsigned)-1)
  658. {
  659. text.Format(L"%u / %u", rank->Wins, rank->Losses);
  660. list->Set_Entry_Text(index, COL_WINS, text);
  661. }
  662. else
  663. {
  664. list->Set_Entry_Text(index, COL_WINS, L"- / -");
  665. }
  666. if ((rank->Deaths != (unsigned)-1) && (rank->Kills != (unsigned)-1))
  667. {
  668. text.Format(L"%u / %u", rank->Deaths, rank->Kills);
  669. list->Set_Entry_Text(index, COL_DEATHS, text);
  670. }
  671. else
  672. {
  673. list->Set_Entry_Text(index, COL_DEATHS, L"- / -");
  674. }
  675. if (rank->Points != (unsigned)-1)
  676. {
  677. text.Format(L"%u", rank->Points);
  678. list->Set_Entry_Text(index, COL_POINTS, text);
  679. }
  680. else
  681. {
  682. list->Set_Entry_Text(index, COL_POINTS, L"-");
  683. }
  684. if (rank->Rank != (unsigned)-1)
  685. {
  686. text.Format(L"%u", rank->Rank);
  687. list->Set_Entry_Text(index, COL_RANK, text);
  688. }
  689. else
  690. {
  691. list->Set_Entry_Text(index, COL_RANK, L"-");
  692. }
  693. break;
  694. }
  695. }
  696. }