win_session_local.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code 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. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. /*
  21. ================================================================================================
  22. Contains the windows implementation of the network session
  23. ================================================================================================
  24. */
  25. #pragma hdrstop
  26. #include "../../idlib/precompiled.h"
  27. #include "../../framework/Common_local.h"
  28. #include "../sys_session_local.h"
  29. #include "../sys_stats.h"
  30. #include "../sys_savegame.h"
  31. #include "../sys_lobby_backend_direct.h"
  32. #include "../sys_voicechat.h"
  33. #include "win_achievements.h"
  34. #include "win_local.h"
  35. /*
  36. ========================
  37. Global variables
  38. ========================
  39. */
  40. extern idCVar net_port;
  41. /*
  42. ========================
  43. idSessionLocalWin::idSessionLocalWin
  44. ========================
  45. */
  46. class idSessionLocalWin : public idSessionLocal {
  47. friend class idLobbyToSessionCBLocal;
  48. public:
  49. idSessionLocalWin();
  50. virtual ~idSessionLocalWin();
  51. // idSessionLocal interface
  52. virtual void Initialize();
  53. virtual void Shutdown();
  54. virtual void InitializeSoundRelatedSystems();
  55. virtual void ShutdownSoundRelatedSystems();
  56. virtual void PlatformPump();
  57. virtual void InviteFriends();
  58. virtual void InviteParty();
  59. virtual void ShowPartySessions();
  60. virtual void ShowSystemMarketplaceUI() const;
  61. virtual void ListServers( const idCallback & callback );
  62. virtual void CancelListServers();
  63. virtual int NumServers() const;
  64. virtual const serverInfo_t * ServerInfo( int i ) const;
  65. virtual void ConnectToServer( int i );
  66. virtual void ShowServerGamerCardUI( int i );
  67. virtual void ShowLobbyUserGamerCardUI( lobbyUserID_t lobbyUserID );
  68. virtual void ShowOnlineSignin() {}
  69. virtual void UpdateRichPresence() {}
  70. virtual void CheckVoicePrivileges() {}
  71. virtual bool ProcessInputEvent( const sysEvent_t * ev );
  72. // System UI
  73. virtual bool IsSystemUIShowing() const;
  74. virtual void SetSystemUIShowing( bool show );
  75. // Invites
  76. virtual void HandleBootableInvite( int64 lobbyId = 0 );
  77. virtual void ClearBootableInvite();
  78. virtual void ClearPendingInvite();
  79. virtual bool HasPendingBootableInvite();
  80. virtual void SetDiscSwapMPInvite( void * parm );
  81. virtual void * GetDiscSwapMPInviteParms();
  82. virtual void EnumerateDownloadableContent();
  83. virtual void HandleServerQueryRequest( lobbyAddress_t & remoteAddr, idBitMsg & msg, int msgType );
  84. virtual void HandleServerQueryAck( lobbyAddress_t & remoteAddr, idBitMsg & msg );
  85. // Leaderboards
  86. virtual void LeaderboardUpload( lobbyUserID_t lobbyUserID, const leaderboardDefinition_t * leaderboard, const column_t * stats, const idFile_Memory * attachment = NULL );
  87. virtual void LeaderboardDownload( int sessionUserIndex, const leaderboardDefinition_t * leaderboard, int startingRank, int numRows, const idLeaderboardCallback & callback );
  88. virtual void LeaderboardDownloadAttachment( int sessionUserIndex, const leaderboardDefinition_t * leaderboard, int64 attachmentID );
  89. // Scoring (currently just for TrueSkill)
  90. virtual void SetLobbyUserRelativeScore( lobbyUserID_t lobbyUserID, int relativeScore, int team ) {}
  91. virtual void LeaderboardFlush();
  92. virtual idNetSessionPort & GetPort( bool dedicated = false );
  93. virtual idLobbyBackend * CreateLobbyBackend( const idMatchParameters & p, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType );
  94. virtual idLobbyBackend * FindLobbyBackend( const idMatchParameters & p, int numPartyUsers, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType );
  95. virtual idLobbyBackend * JoinFromConnectInfo( const lobbyConnectInfo_t & connectInfo , idLobbyBackend::lobbyBackendType_t lobbyType );
  96. virtual void DestroyLobbyBackend( idLobbyBackend * lobbyBackend );
  97. virtual void PumpLobbies();
  98. virtual void JoinAfterSwap( void * joinID );
  99. virtual bool GetLobbyAddressFromNetAddress( const netadr_t & netAddr, lobbyAddress_t & outAddr ) const;
  100. virtual bool GetNetAddressFromLobbyAddress( const lobbyAddress_t & lobbyAddress, netadr_t & outNetAddr ) const;
  101. public:
  102. void Connect_f( const idCmdArgs &args );
  103. private:
  104. void EnsurePort();
  105. idLobbyBackend * CreateLobbyInternal( idLobbyBackend::lobbyBackendType_t lobbyType );
  106. idArray< idLobbyBackend *, 3 > lobbyBackends;
  107. idNetSessionPort port;
  108. bool canJoinLocalHost;
  109. idLobbyToSessionCBLocal * lobbyToSessionCB;
  110. };
  111. idSessionLocalWin sessionLocalWin;
  112. idSession * session = &sessionLocalWin;
  113. /*
  114. ========================
  115. idLobbyToSessionCBLocal
  116. ========================
  117. */
  118. class idLobbyToSessionCBLocal : public idLobbyToSessionCB {
  119. public:
  120. idLobbyToSessionCBLocal( idSessionLocalWin * sessionLocalWin_ ) : sessionLocalWin( sessionLocalWin_ ) { }
  121. virtual bool CanJoinLocalHost() const { sessionLocalWin->EnsurePort(); return sessionLocalWin->canJoinLocalHost; }
  122. virtual class idLobbyBackend * GetLobbyBackend( idLobbyBackend::lobbyBackendType_t type ) const { return sessionLocalWin->lobbyBackends[ type ]; }
  123. private:
  124. idSessionLocalWin * sessionLocalWin;
  125. };
  126. idLobbyToSessionCBLocal lobbyToSessionCBLocal( &sessionLocalWin );
  127. idLobbyToSessionCB * lobbyToSessionCB = &lobbyToSessionCBLocal;
  128. class idVoiceChatMgrWin : public idVoiceChatMgr {
  129. public:
  130. virtual bool GetLocalChatDataInternal( int talkerIndex, byte * data, int & dataSize ) { return false; }
  131. virtual void SubmitIncomingChatDataInternal( int talkerIndex, const byte * data, int dataSize ) { }
  132. virtual bool TalkerHasData( int talkerIndex ) { return false; }
  133. virtual bool RegisterTalkerInternal( int index ) { return true; }
  134. virtual void UnregisterTalkerInternal( int index ) { }
  135. };
  136. /*
  137. ========================
  138. idSessionLocalWin::idSessionLocalWin
  139. ========================
  140. */
  141. idSessionLocalWin::idSessionLocalWin() {
  142. signInManager = new (TAG_SYSTEM) idSignInManagerWin;
  143. saveGameManager = new (TAG_SAVEGAMES) idSaveGameManager();
  144. voiceChat = new (TAG_SYSTEM) idVoiceChatMgrWin();
  145. lobbyToSessionCB = new (TAG_SYSTEM) idLobbyToSessionCBLocal( this );
  146. canJoinLocalHost = false;
  147. lobbyBackends.Zero();
  148. }
  149. /*
  150. ========================
  151. idSessionLocalWin::idSessionLocalWin
  152. ========================
  153. */
  154. idSessionLocalWin::~idSessionLocalWin() {
  155. delete voiceChat;
  156. delete lobbyToSessionCB;
  157. }
  158. /*
  159. ========================
  160. idSessionLocalWin::Initialize
  161. ========================
  162. */
  163. void idSessionLocalWin::Initialize() {
  164. idSessionLocal::Initialize();
  165. // The shipping path doesn't load title storage
  166. // Instead, we inject values through code which is protected through steam DRM
  167. titleStorageVars.Set( "MAX_PLAYERS_ALLOWED", "8" );
  168. titleStorageLoaded = true;
  169. // First-time check for downloadable content once game is launched
  170. EnumerateDownloadableContent();
  171. GetPartyLobby().Initialize( idLobby::TYPE_PARTY, sessionCallbacks );
  172. GetGameLobby().Initialize( idLobby::TYPE_GAME, sessionCallbacks );
  173. GetGameStateLobby().Initialize( idLobby::TYPE_GAME_STATE, sessionCallbacks );
  174. achievementSystem = new (TAG_SYSTEM) idAchievementSystemWin();
  175. achievementSystem->Init();
  176. }
  177. /*
  178. ========================
  179. idSessionLocalWin::Shutdown
  180. ========================
  181. */
  182. void idSessionLocalWin::Shutdown() {
  183. NET_VERBOSE_PRINT( "NET: Shutdown\n" );
  184. idSessionLocal::Shutdown();
  185. MoveToMainMenu();
  186. // Wait until we fully shutdown
  187. while ( localState != STATE_IDLE && localState != STATE_PRESS_START ) {
  188. Pump();
  189. }
  190. if ( achievementSystem != NULL ) {
  191. achievementSystem->Shutdown();
  192. delete achievementSystem;
  193. achievementSystem = NULL;
  194. }
  195. }
  196. /*
  197. ========================
  198. idSessionLocalWin::InitializeSoundRelatedSystems
  199. ========================
  200. */
  201. void idSessionLocalWin::InitializeSoundRelatedSystems() {
  202. if ( voiceChat != NULL ) {
  203. voiceChat->Init( NULL );
  204. }
  205. }
  206. /*
  207. ========================
  208. idSessionLocalWin::ShutdownSoundRelatedSystems
  209. ========================
  210. */
  211. void idSessionLocalWin::ShutdownSoundRelatedSystems() {
  212. if ( voiceChat != NULL ) {
  213. voiceChat->Shutdown();
  214. }
  215. }
  216. /*
  217. ========================
  218. idSessionLocalWin::PlatformPump
  219. ========================
  220. */
  221. void idSessionLocalWin::PlatformPump() {
  222. }
  223. /*
  224. ========================
  225. idSessionLocalWin::InviteFriends
  226. ========================
  227. */
  228. void idSessionLocalWin::InviteFriends() {
  229. }
  230. /*
  231. ========================
  232. idSessionLocalWin::InviteParty
  233. ========================
  234. */
  235. void idSessionLocalWin::InviteParty() {
  236. }
  237. /*
  238. ========================
  239. idSessionLocalWin::ShowPartySessions
  240. ========================
  241. */
  242. void idSessionLocalWin::ShowPartySessions() {
  243. }
  244. /*
  245. ========================
  246. idSessionLocalWin::ShowSystemMarketplaceUI
  247. ========================
  248. */
  249. void idSessionLocalWin::ShowSystemMarketplaceUI() const {
  250. }
  251. /*
  252. ========================
  253. idSessionLocalWin::ListServers
  254. ========================
  255. */
  256. void idSessionLocalWin::ListServers( const idCallback & callback ) {
  257. ListServersCommon();
  258. }
  259. /*
  260. ========================
  261. idSessionLocalWin::CancelListServers
  262. ========================
  263. */
  264. void idSessionLocalWin::CancelListServers() {
  265. }
  266. /*
  267. ========================
  268. idSessionLocalWin::NumServers
  269. ========================
  270. */
  271. int idSessionLocalWin::NumServers() const {
  272. return 0;
  273. }
  274. /*
  275. ========================
  276. idSessionLocalWin::ServerInfo
  277. ========================
  278. */
  279. const serverInfo_t * idSessionLocalWin::ServerInfo( int i ) const {
  280. return NULL;
  281. }
  282. /*
  283. ========================
  284. idSessionLocalWin::ConnectToServer
  285. ========================
  286. */
  287. void idSessionLocalWin::ConnectToServer( int i ) {
  288. }
  289. /*
  290. ========================
  291. idSessionLocalWin::Connect_f
  292. ========================
  293. */
  294. void idSessionLocalWin::Connect_f( const idCmdArgs &args ) {
  295. if ( args.Argc() < 2 ) {
  296. idLib::Printf( "Usage: Connect to IP. Use with net_port. \n");
  297. return;
  298. }
  299. Cancel();
  300. if ( signInManager->GetMasterLocalUser() == NULL ) {
  301. signInManager->RegisterLocalUser( 0 );
  302. }
  303. lobbyConnectInfo_t connectInfo;
  304. Sys_StringToNetAdr( args.Argv(1), &connectInfo.netAddr, true );
  305. connectInfo.netAddr.port = net_port.GetInteger();
  306. ConnectAndMoveToLobby( GetPartyLobby(), connectInfo, false );
  307. }
  308. /*
  309. ========================
  310. void Connect_f
  311. ========================
  312. */
  313. CONSOLE_COMMAND( connect, "Connect to the specified IP", NULL ) {
  314. sessionLocalWin.Connect_f( args );
  315. }
  316. /*
  317. ========================
  318. idSessionLocalWin::ShowServerGamerCardUI
  319. ========================
  320. */
  321. void idSessionLocalWin::ShowServerGamerCardUI( int i ) {
  322. }
  323. /*
  324. ========================
  325. idSessionLocalWin::ShowLobbyUserGamerCardUI(
  326. ========================
  327. */
  328. void idSessionLocalWin::ShowLobbyUserGamerCardUI( lobbyUserID_t lobbyUserID ) {
  329. }
  330. /*
  331. ========================
  332. idSessionLocalWin::ProcessInputEvent
  333. ========================
  334. */
  335. bool idSessionLocalWin::ProcessInputEvent( const sysEvent_t * ev ) {
  336. if ( GetSignInManager().ProcessInputEvent( ev ) ) {
  337. return true;
  338. }
  339. return false;
  340. }
  341. /*
  342. ========================
  343. idSessionLocalWin::IsSystemUIShowing
  344. ========================
  345. */
  346. bool idSessionLocalWin::IsSystemUIShowing() const {
  347. return !win32.activeApp || isSysUIShowing; // If the user alt+tabs away, treat it the same as bringing up the steam overlay
  348. }
  349. /*
  350. ========================
  351. idSessionLocalWin::SetSystemUIShowing
  352. ========================
  353. */
  354. void idSessionLocalWin::SetSystemUIShowing( bool show ) {
  355. isSysUIShowing = show;
  356. }
  357. /*
  358. ========================
  359. idSessionLocalWin::HandleServerQueryRequest
  360. ========================
  361. */
  362. void idSessionLocalWin::HandleServerQueryRequest( lobbyAddress_t & remoteAddr, idBitMsg & msg, int msgType ) {
  363. NET_VERBOSE_PRINT( "HandleServerQueryRequest from %s\n", remoteAddr.ToString() );
  364. }
  365. /*
  366. ========================
  367. idSessionLocalWin::HandleServerQueryAck
  368. ========================
  369. */
  370. void idSessionLocalWin::HandleServerQueryAck( lobbyAddress_t & remoteAddr, idBitMsg & msg ) {
  371. NET_VERBOSE_PRINT( "HandleServerQueryAck from %s\n", remoteAddr.ToString() );
  372. }
  373. /*
  374. ========================
  375. idSessionLocalWin::ClearBootableInvite
  376. ========================
  377. */
  378. void idSessionLocalWin::ClearBootableInvite() {
  379. }
  380. /*
  381. ========================
  382. idSessionLocalWin::ClearPendingInvite
  383. ========================
  384. */
  385. void idSessionLocalWin::ClearPendingInvite() {
  386. }
  387. /*
  388. ========================
  389. idSessionLocalWin::HandleBootableInvite
  390. ========================
  391. */
  392. void idSessionLocalWin::HandleBootableInvite( int64 lobbyId ) {
  393. }
  394. /*
  395. ========================
  396. idSessionLocalWin::HasPendingBootableInvite
  397. ========================
  398. */
  399. bool idSessionLocalWin::HasPendingBootableInvite() {
  400. return false;
  401. }
  402. /*
  403. ========================
  404. idSessionLocal::SetDiscSwapMPInvite
  405. ========================
  406. */
  407. void idSessionLocalWin::SetDiscSwapMPInvite( void * parm ) {
  408. }
  409. /*
  410. ========================
  411. idSessionLocal::GetDiscSwapMPInviteParms
  412. ========================
  413. */
  414. void * idSessionLocalWin::GetDiscSwapMPInviteParms() {
  415. return NULL;
  416. }
  417. /*
  418. ========================
  419. idSessionLocalWin::EnumerateDownloadableContent
  420. ========================
  421. */
  422. void idSessionLocalWin::EnumerateDownloadableContent() {
  423. }
  424. /*
  425. ========================
  426. idSessionLocalWin::LeaderboardUpload
  427. ========================
  428. */
  429. void idSessionLocalWin::LeaderboardUpload( lobbyUserID_t lobbyUserID, const leaderboardDefinition_t * leaderboard, const column_t * stats, const idFile_Memory * attachment ) {
  430. }
  431. /*
  432. ========================
  433. idSessionLocalWin::LeaderboardFlush
  434. ========================
  435. */
  436. void idSessionLocalWin::LeaderboardFlush() {
  437. }
  438. /*
  439. ========================
  440. idSessionLocalWin::LeaderboardDownload
  441. ========================
  442. */
  443. void idSessionLocalWin::LeaderboardDownload( int sessionUserIndex, const leaderboardDefinition_t * leaderboard, int startingRank, int numRows, const idLeaderboardCallback & callback ) {
  444. }
  445. /*
  446. ========================
  447. idSessionLocalWin::LeaderboardDownloadAttachment
  448. ========================
  449. */
  450. void idSessionLocalWin::LeaderboardDownloadAttachment( int sessionUserIndex, const leaderboardDefinition_t * leaderboard, int64 attachmentID ) {
  451. }
  452. /*
  453. ========================
  454. idSessionLocalWin::EnsurePort
  455. ========================
  456. */
  457. void idSessionLocalWin::EnsurePort() {
  458. // Init the port using reqular windows sockets
  459. if ( port.IsOpen() ) {
  460. return; // Already initialized
  461. }
  462. if ( port.InitPort( net_port.GetInteger(), false ) ) {
  463. canJoinLocalHost = false;
  464. } else {
  465. // Assume this is another instantiation on the same machine, and just init using any available port
  466. port.InitPort( PORT_ANY, false );
  467. canJoinLocalHost = true;
  468. }
  469. }
  470. /*
  471. ========================
  472. idSessionLocalWin::GetPort
  473. ========================
  474. */
  475. idNetSessionPort & idSessionLocalWin::GetPort( bool dedicated ) {
  476. EnsurePort();
  477. return port;
  478. }
  479. /*
  480. ========================
  481. idSessionLocalWin::CreateLobbyBackend
  482. ========================
  483. */
  484. idLobbyBackend * idSessionLocalWin::CreateLobbyBackend( const idMatchParameters & p, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType ) {
  485. idLobbyBackend * lobbyBackend = CreateLobbyInternal( lobbyType );
  486. lobbyBackend->StartHosting( p, skillLevel, lobbyType );
  487. return lobbyBackend;
  488. }
  489. /*
  490. ========================
  491. idSessionLocalWin::FindLobbyBackend
  492. ========================
  493. */
  494. idLobbyBackend * idSessionLocalWin::FindLobbyBackend( const idMatchParameters & p, int numPartyUsers, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType ) {
  495. idLobbyBackend * lobbyBackend = CreateLobbyInternal( lobbyType );
  496. lobbyBackend->StartFinding( p, numPartyUsers, skillLevel );
  497. return lobbyBackend;
  498. }
  499. /*
  500. ========================
  501. idSessionLocalWin::JoinFromConnectInfo
  502. ========================
  503. */
  504. idLobbyBackend * idSessionLocalWin::JoinFromConnectInfo( const lobbyConnectInfo_t & connectInfo, idLobbyBackend::lobbyBackendType_t lobbyType ) {
  505. idLobbyBackend * lobbyBackend = CreateLobbyInternal( lobbyType );
  506. lobbyBackend->JoinFromConnectInfo( connectInfo );
  507. return lobbyBackend;
  508. }
  509. /*
  510. ========================
  511. idSessionLocalWin::DestroyLobbyBackend
  512. ========================
  513. */
  514. void idSessionLocalWin::DestroyLobbyBackend( idLobbyBackend * lobbyBackend ) {
  515. assert( lobbyBackend != NULL );
  516. assert( lobbyBackends[lobbyBackend->GetLobbyType()] == lobbyBackend );
  517. lobbyBackends[lobbyBackend->GetLobbyType()] = NULL;
  518. lobbyBackend->Shutdown();
  519. delete lobbyBackend;
  520. }
  521. /*
  522. ========================
  523. idSessionLocalWin::PumpLobbies
  524. ========================
  525. */
  526. void idSessionLocalWin::PumpLobbies() {
  527. assert( lobbyBackends[idLobbyBackend::TYPE_PARTY] == NULL || lobbyBackends[idLobbyBackend::TYPE_PARTY]->GetLobbyType() == idLobbyBackend::TYPE_PARTY );
  528. assert( lobbyBackends[idLobbyBackend::TYPE_GAME] == NULL || lobbyBackends[idLobbyBackend::TYPE_GAME]->GetLobbyType() == idLobbyBackend::TYPE_GAME );
  529. assert( lobbyBackends[idLobbyBackend::TYPE_GAME_STATE] == NULL || lobbyBackends[idLobbyBackend::TYPE_GAME_STATE]->GetLobbyType() == idLobbyBackend::TYPE_GAME_STATE );
  530. // Pump lobbyBackends
  531. for ( int i = 0; i < lobbyBackends.Num(); i++ ) {
  532. if ( lobbyBackends[i] != NULL ) {
  533. lobbyBackends[i]->Pump();
  534. }
  535. }
  536. }
  537. /*
  538. ========================
  539. idSessionLocalWin::CreateLobbyInternal
  540. ========================
  541. */
  542. idLobbyBackend * idSessionLocalWin::CreateLobbyInternal( idLobbyBackend::lobbyBackendType_t lobbyType ) {
  543. EnsurePort();
  544. idLobbyBackend * lobbyBackend = new (TAG_NETWORKING) idLobbyBackendDirect();
  545. lobbyBackend->SetLobbyType( lobbyType );
  546. assert( lobbyBackends[lobbyType] == NULL );
  547. lobbyBackends[lobbyType] = lobbyBackend;
  548. return lobbyBackend;
  549. }
  550. /*
  551. ========================
  552. idSessionLocalWin::JoinAfterSwap
  553. ========================
  554. */
  555. void idSessionLocalWin::JoinAfterSwap( void * joinID ) {
  556. }
  557. /*
  558. ========================
  559. idSessionLocalWin::GetLobbyAddressFromNetAddress
  560. ========================
  561. */
  562. bool idSessionLocalWin::GetLobbyAddressFromNetAddress( const netadr_t & netAddr, lobbyAddress_t & outAddr ) const {
  563. return false;
  564. }
  565. /*
  566. ========================
  567. idSessionLocalWin::GetNetAddressFromLobbyAddress
  568. ========================
  569. */
  570. bool idSessionLocalWin::GetNetAddressFromLobbyAddress( const lobbyAddress_t & lobbyAddress, netadr_t & outNetAddr ) const {
  571. return false;
  572. }