DayZ 1.24
Loading...
Searching...
No Matches
OnlineServices Class Reference
Collaboration diagram for OnlineServices:
[legend]

Static Protected Member Functions

static void Init ()
 
static bool IsInitialized ()
 
static void GetClientServices ()
 
static bool ErrorCaught (EBiosError error)
 
static void LoadServers (notnull GetServersInput inputValues)
 
static void GetFavoriteServers (TStringArray favServers)
 
static void GetCachedFavServerInfo (array< ref CachedServerInfo > favServersInfoCache)
 
static void SetServerFavorited (string ipAddress, int port, int steamQueryPort, bool is_favorited)
 
static void GetCurrentServerInfo (string ip, int port)
 
static GetServersResultRow GetCurrentServerInfo ()
 
static void ClearCurrentServerInfo ()
 
static void SetInviteServerInfo (string ip, int port)
 
static void GetInviteServerInfo (out string ip, out int port)
 
static void OnLoadServersAsync (GetServersResult result_list, EBiosError error, string response)
 
static void LoadFriends ()
 
static void ShowUserProfile (string uid)
 
static void OnUserProfileAsync (EBiosError error)
 
static void OnFriendsAsync (BiosFriendInfoArray friend_list, EBiosError error)
 
static void LoadPermissions (array< string > player_list)
 
static void OnPermissionsAsync (BiosPrivacyUidResultArray result_list, EBiosError error)
 
static bool IsPlayerMuted (string id)
 
static bool MutePlayer (string id, bool mute)
 
static map< string, boolGetMuteList ()
 
static void ShowInviteScreen ()
 
static void LoadMPPrivilege ()
 
static void LoadVoicePrivilege ()
 
static void OnLoadMPPrivilege (EBiosError err)
 
static void OnLoadVoicePrivilege (EBiosError err)
 
static void SetSessionHandle (string handle)
 
static string GetSessionHandle ()
 
static void GetSession ()
 
static BiosUser GetBiosUser ()
 
static void SetBiosUser (BiosUser user)
 
static bool GetMultiplayState ()
 
static void SetMultiplayState (bool state)
 
static void EnterGameplaySession ()
 
static void LeaveGameplaySession ()
 
static void SetGameplayActivity ()
 
static void SetPendingInviteList (array< string > invitees)
 
static array< stringGetPendingInviteList ()
 
static void ClearPendingInviteList (array< string > invitees)
 
static void AutoConnectToEmptyServer ()
 
static GetServersResultRow GetRandomFreeResult (GetFirstServerWithEmptySlotResult results)
 
static void OnAutoConnectToEmptyServer (GetFirstServerWithEmptySlotResult result_list, EBiosError error)
 
static void GetServerModList (string server_id)
 
static void OnGetServerModList (GetServerModListResult result_list, EBiosError error)
 
static bool IsGameTrial (bool sim)
 
static bool IsGameActive (bool sim)
 
static bool CheckUpdate ()
 
static void PromptUpdate ()
 

Static Protected Attributes

static string m_InviteServerIP
 
static int m_InviteServerPort
 
static string m_CurrentServerIP
 
static int m_CurrentServerPort
 
static ref GetServersResultRow m_CurrentServerInfo
 
static ref map< string, ref BiosFriendInfom_FriendsList
 
static ref map< string, boolm_MuteList
 
static ref map< string, ref BiosPrivacyPermissionResultArraym_PermissionsList
 
static bool m_FirstFriendsLoad = true
 
static bool m_MultiplayState = false
 
static ref array< stringm_PendingInvites
 
static ref BiosUser m_BiosUser
 
static int m_AutoConnectTries = 0
 

Static Private Attributes

static ref ScriptInvoker m_FriendsAsyncInvoker = new ScriptInvoker()
 
static ref ScriptInvoker m_PermissionsAsyncInvoker = new ScriptInvoker()
 
static ref ScriptInvoker m_ServersAsyncInvoker = new ScriptInvoker()
 
static ref ScriptInvoker m_ServerAsyncInvoker = new ScriptInvoker()
 
static ref ScriptInvoker m_MuteUpdateAsyncInvoker = new ScriptInvoker()
 
static ref ScriptInvoker m_ServerModLoadAsyncInvoker = new ScriptInvoker()
 
static ref BiosClientServices m_ClientServices
 
static ref TrialService m_TrialService
 

Detailed Description

Definition at line 1 of file OnlineServices.c.

Member Function Documentation

◆ AutoConnectToEmptyServer()

static void OnlineServices::AutoConnectToEmptyServer ( )
inlinestaticprotected

Definition at line 553 of file OnlineServices.c.

554 {
557 {
560 input.SetOfficial(true);
561 m_ClientServices.GetLobbyService().GetFirstServerWithEmptySlot(input);
562 }
563 }
GetServersInput the input structure of the GetServers operation.
static void GetClientServices()
static int m_AutoConnectTries
static ref BiosClientServices m_ClientServices

References GetClientServices(), m_AutoConnectTries, and m_ClientServices.

Referenced by UIScriptedMenu::AutoConnect().

◆ CheckUpdate()

static bool OnlineServices::CheckUpdate ( )
inlinestaticprotected

Definition at line 643 of file OnlineServices.c.

644 {
647 {
648 EBiosError error = m_ClientServices.GetPackageService().CheckUpdateAsync();
649
650 if (!error)
651 return true;
652 }
653
654 return false;
655 }
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....

References GetClientServices(), and m_ClientServices.

Referenced by DayZIntroSceneXbox::CheckXboxClientUpdate().

◆ ClearCurrentServerInfo()

static void OnlineServices::ClearCurrentServerInfo ( )
inlinestaticprotected

Definition at line 157 of file OnlineServices.c.

158 {
162 }
static ref GetServersResultRow m_CurrentServerInfo
static string m_CurrentServerIP
static int m_CurrentServerPort

References m_CurrentServerInfo, m_CurrentServerIP, and m_CurrentServerPort.

Referenced by CGame::OnEvent().

◆ ClearPendingInviteList()

static void OnlineServices::ClearPendingInviteList ( array< string > invitees)
inlinestaticprotected

Definition at line 547 of file OnlineServices.c.

548 {
549 delete m_PendingInvites;
550 }
static ref array< string > m_PendingInvites

References m_PendingInvites.

◆ EnterGameplaySession()

static void OnlineServices::EnterGameplaySession ( )
inlinestaticprotected

Definition at line 466 of file OnlineServices.c.

467 {
468 string addr;
469 int port;
470 if (GetGame().GetHostAddress(addr, port))
471 {
474 {
475 m_ClientServices.GetSessionService().EnterGameplaySessionAsync(addr, port);
476 SetMultiplayState(true);
477 }
478 }
479 }
static void SetMultiplayState(bool state)
proto native CGame GetGame()

References GetClientServices(), GetGame(), m_ClientServices, and SetMultiplayState().

Referenced by CGame::OnEvent().

◆ ErrorCaught()

static bool OnlineServices::ErrorCaught ( EBiosError error)
inlinestaticprotected

Definition at line 76 of file OnlineServices.c.

77 {
78 switch (error)
79 {
80 case EBiosError.OK:
81 {
82 return false;
83 }
84 }
85
86 DebugPrint.LogErrorAndTrace(string.Format("BiosClientServices Error: %1", ErrorModuleHandler.GetClientMessage(ErrorCategory.BIOSError, error)));
87 return true;
88 }
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
static void LogErrorAndTrace(string msg)
Prints debug message as error message and prints stack trace of calls.
Definition DebugPrint.c:124
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
static proto string GetClientMessage(ErrorCategory category, int code, string additionalInfo="")
Gets the Client Message for specified error.

References ErrorModuleHandler::GetClientMessage(), and DebugPrint::LogErrorAndTrace().

Referenced by LoadMPPrivilege(), LoadPermissions(), LoadVoicePrivilege(), OnAutoConnectToEmptyServer(), BiosSessionService::OnEnterGameplaySession(), OnFriendsAsync(), OnGetServerModList(), BiosSessionService::OnGetSessionError(), BiosUserManager::OnJoin(), OnLoadMPPrivilege(), OnLoadServersAsync(), OnLoadVoicePrivilege(), OnPermissionsAsync(), BiosPackageService::OnPromptUpdate(), BiosSessionService::OnSetActivity(), BiosSessionService::OnShowInviteToGameplaySession(), BiosPackageService::OnShowStore(), BiosUserManager::OnUserDatabaseId(), BiosUserManager::OnUserLoggedOn(), BiosUserManager::OnUserPicked(), OnUserProfileAsync(), and ShowInviteScreen().

◆ GetBiosUser()

static BiosUser OnlineServices::GetBiosUser ( )
inlinestaticprotected

Definition at line 439 of file OnlineServices.c.

440 {
441 return m_BiosUser;
442 }
static ref BiosUser m_BiosUser

References m_BiosUser.

Referenced by CGame::DisconnectSessionEx().

◆ GetCachedFavServerInfo()

static void OnlineServices::GetCachedFavServerInfo ( array< ref CachedServerInfo > favServersInfoCache)
inlinestaticprotected

Definition at line 104 of file OnlineServices.c.

105 {
106 m_ClientServices.GetLobbyService().GetCachedFavoriteServerInfo(favServersInfoCache);
107 }

References m_ClientServices.

Referenced by ServerBrowserTabPc::RefreshList().

◆ GetClientServices()

static void OnlineServices::GetClientServices ( )
inlinestaticprotected

Definition at line 57 of file OnlineServices.c.

58 {
59 BiosUserManager user_manager = GetGame().GetUserManager();
60 if (user_manager)
61 {
62 BiosUser selected_user = user_manager.GetSelectedUser();
63 if (selected_user)
64 m_ClientServices = selected_user.GetClientServices();
65#ifdef PLATFORM_WINDOWS
67 user_manager.GetUserList(user_list);
68 if (user_list.Count() > 0)
69 m_ClientServices = user_list.Get(0).GetClientServices();
70#endif
71 }
72 else
73 Error("BiosClientServices Error: Usermanager does not exist.");
74 }
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), GetGame(), and m_ClientServices.

Referenced by AutoConnectToEmptyServer(), CheckUpdate(), EnterGameplaySession(), GetCurrentServerInfo(), GetServerModList(), GetSession(), GetSessionHandle(), Init(), LeaveGameplaySession(), LoadFriends(), LoadMPPrivilege(), LoadPermissions(), LoadServers(), LoadVoicePrivilege(), PromptUpdate(), SetGameplayActivity(), SetPendingInviteList(), SetServerFavorited(), SetSessionHandle(), ShowInviteScreen(), and ShowUserProfile().

◆ GetCurrentServerInfo() [1/2]

static GetServersResultRow OnlineServices::GetCurrentServerInfo ( )
inlinestaticprotected

Definition at line 149 of file OnlineServices.c.

150 {
152 return m_CurrentServerInfo;
153 else
154 return g_Game.GetHostData();
155 }
DayZGame g_Game
Definition DayZGame.c:3528

References g_Game, and m_CurrentServerInfo.

Referenced by LeaveGameplaySession().

◆ GetCurrentServerInfo() [2/2]

static void OnlineServices::GetCurrentServerInfo ( string ip,
int port )
inlinestaticprotected

Definition at line 123 of file OnlineServices.c.

124 {
126
129
131
132 inputValues.SetHostIp(ip);
133 inputValues.SetHostPort(port);
134 inputValues.m_Page = 0;
135 inputValues.m_RowsPerPage = 10;
136 inputValues.m_Platform = 1;
137
138#ifdef PLATFORM_XBOX
139 inputValues.m_Platform = 2;
140#endif
141#ifdef PLATFORM_PS4
142 inputValues.m_Platform = 3;
143#endif
144
146 m_ClientServices.GetLobbyService().GetServers(inputValues);
147 }
GetServersInput the input structure of the GetServers operation.

References GetClientServices(), m_ClientServices, m_CurrentServerIP, and m_CurrentServerPort.

Referenced by CGame::RefreshCurrentServerInfo(), and UIScriptedMenu::SetServerInfo().

◆ GetFavoriteServers()

static void OnlineServices::GetFavoriteServers ( TStringArray favServers)
inlinestaticprotected

Definition at line 99 of file OnlineServices.c.

100 {
101 m_ClientServices.GetLobbyService().GetFavoriteServers(favServers);
102 }

References m_ClientServices.

Referenced by UIScriptedMenu::LoadFavoriteServers().

◆ GetInviteServerInfo()

static void OnlineServices::GetInviteServerInfo ( out string ip,
out int port )
inlinestaticprotected

Definition at line 170 of file OnlineServices.c.

171 {
174 }
static string m_InviteServerIP
static int m_InviteServerPort

References m_InviteServerIP, and m_InviteServerPort.

Referenced by UIScriptedMenu::Update().

◆ GetMultiplayState()

static bool OnlineServices::GetMultiplayState ( )
inlinestaticprotected

Definition at line 450 of file OnlineServices.c.

451 {
452 return m_MultiplayState;
453 }
static bool m_MultiplayState

References m_MultiplayState.

Referenced by ClientData::SyncEvent_OnRecievedPlayerList().

◆ GetMuteList()

static map< string, bool > OnlineServices::GetMuteList ( )
inlinestaticprotected

Definition at line 347 of file OnlineServices.c.

348 {
349 return m_MuteList;
350 }
static ref map< string, bool > m_MuteList

References m_MuteList.

Referenced by UIScriptedMenu::Init().

◆ GetPendingInviteList()

static array< string > OnlineServices::GetPendingInviteList ( )
inlinestaticprotected

Definition at line 530 of file OnlineServices.c.

531 {
534 {
536 foreach (string invitee : m_PendingInvites)
537 {
538 if (already_on_server.Find(invitee) == -1)
539 new_to_server.Insert(invitee);
540 }
541 return new_to_server;
542 }
543 else
544 return m_PendingInvites;
545 }
static array< string > GetSimplePlayerList()
Definition ClientData.c:84

References ClientData::GetSimplePlayerList(), and m_PendingInvites.

Referenced by BiosSessionService::OnEnterGameplaySession(), and SetPendingInviteList().

◆ GetRandomFreeResult()

static GetServersResultRow OnlineServices::GetRandomFreeResult ( GetFirstServerWithEmptySlotResult results)
inlinestaticprotected

Definition at line 565 of file OnlineServices.c.

566 {
569
570 if (results && results.m_Result && results.m_Result.m_Results && results.m_Result.m_Results.Count() > 0)
571 {
572 foreach (GetServersResultRow result_temp : results.m_Result.m_Results)
573 {
574 if (result_temp.m_FreeSlots > 0)
576 }
577 }
578
579 return results_free.GetRandomElement();
580 }

Referenced by OnAutoConnectToEmptyServer().

◆ GetServerModList()

static void OnlineServices::GetServerModList ( string server_id)
inlinestaticprotected

Definition at line 608 of file OnlineServices.c.

609 {
612 m_ClientServices.GetLobbyService().GetServerModList(server_id);
613 }

References GetClientServices(), and m_ClientServices.

Referenced by ScriptedWidgetEventHandler::SetExpand().

◆ GetSession()

static void OnlineServices::GetSession ( )
inlinestaticprotected

Definition at line 432 of file OnlineServices.c.

433 {
436 m_ClientServices.GetSessionService().TryGetSession(GetSessionHandle());
437 }
static string GetSessionHandle()

References GetClientServices(), GetSessionHandle(), and m_ClientServices.

Referenced by BiosUserManager::OnJoin(), and CGame::TryConnect().

◆ GetSessionHandle()

static string OnlineServices::GetSessionHandle ( )
inlinestaticprotected

Definition at line 424 of file OnlineServices.c.

425 {
428 return m_ClientServices.GetSessionService().m_CurrentHandle;
429 return "";
430 }

References GetClientServices(), and m_ClientServices.

Referenced by GetSession().

◆ Init()

static void OnlineServices::Init ( )
inlinestaticprotected

Definition at line 30 of file OnlineServices.c.

31 {
32#ifdef PLATFORM_CONSOLE
33#ifndef PLATFORM_WINDOWS // if app is not on Windows with -XBOX parameter
34 if (!m_TrialService)
36 if (!m_FriendsList)
38 if (!m_MuteList)
42
43 m_FriendsList.Clear();
44 m_PermissionsList.Clear();
45 m_MuteList.Clear();
46#endif
47#endif
48
50 }
static ref TrialService m_TrialService
static ref map< string, ref BiosPrivacyPermissionResultArray > m_PermissionsList
static ref map< string, ref BiosFriendInfo > m_FriendsList
TrialService is used to query if the game is trial version or not.
Definition TrialService.c:4

References GetClientServices(), m_FriendsList, m_MuteList, m_PermissionsList, and m_TrialService.

Referenced by CGame::OnEvent().

◆ IsGameActive()

static bool OnlineServices::IsGameActive ( bool sim)
inlinestaticprotected

Definition at line 632 of file OnlineServices.c.

633 {
634#ifdef PLATFORM_XBOX
635#ifndef PLATFORM_WINDOWS
636 if (m_TrialService)
637 return m_TrialService.IsGameActive(sim);
638#endif
639#endif
640 return false;
641 }

References m_TrialService.

Referenced by CGame::IsDigitalCopy().

◆ IsGameTrial()

static bool OnlineServices::IsGameTrial ( bool sim)
inlinestaticprotected

Definition at line 621 of file OnlineServices.c.

622 {
623#ifdef PLATFORM_XBOX
624#ifndef PLATFORM_WINDOWS
625 if (m_TrialService)
626 return m_TrialService.IsGameTrial(sim);
627#endif
628#endif
629 return false;
630 }

References m_TrialService.

◆ IsInitialized()

static bool OnlineServices::IsInitialized ( )
inlinestaticprotected

Definition at line 52 of file OnlineServices.c.

53 {
54 return (m_ClientServices != null);
55 }

References m_ClientServices.

◆ IsPlayerMuted()

static bool OnlineServices::IsPlayerMuted ( string id)
inlinestaticprotected

Definition at line 323 of file OnlineServices.c.

324 {
325 if (m_MuteList.Contains(id))
326 return m_MuteList.Get(id);
327 return false;
328 }

References m_MuteList.

Referenced by UIScriptedMenu::Init(), and ScriptedWidgetEventHandler::ReloadLocal().

◆ LeaveGameplaySession()

static void OnlineServices::LeaveGameplaySession ( )
inlinestaticprotected

Definition at line 481 of file OnlineServices.c.

482 {
485 {
487
489 m_ClientServices.GetSessionService().LeaveGameplaySessionAsync(currentServerInfo.m_HostIp, currentServerInfo.m_HostPort);
490 else if (m_CurrentServerIP != "")
491 m_ClientServices.GetSessionService().LeaveGameplaySessionAsync(m_CurrentServerIP, m_CurrentServerPort);
492
493 SetMultiplayState(false);
494 m_FirstFriendsLoad = true;
495
496 if (m_FriendsList)
497 m_FriendsList.Clear();
498 }
499 }
static GetServersResultRow GetCurrentServerInfo()
static bool m_FirstFriendsLoad

References GetClientServices(), GetCurrentServerInfo(), m_ClientServices, m_CurrentServerIP, m_CurrentServerPort, m_FirstFriendsLoad, m_FriendsList, and SetMultiplayState().

Referenced by CGame::OnEvent().

◆ LoadFriends()

static void OnlineServices::LoadFriends ( )
inlinestaticprotected

Definition at line 214 of file OnlineServices.c.

215 {
218 m_ClientServices.GetSocialService().GetFriendsAsync();
219 else
220 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
221 }

References GetClientServices(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by ClientData::SyncEvent_OnRecievedPlayerList().

◆ LoadMPPrivilege()

static void OnlineServices::LoadMPPrivilege ( )
inlinestaticprotected

Definition at line 368 of file OnlineServices.c.

369 {
370#ifdef PLATFORM_CONSOLE
373 ErrorCaught(m_ClientServices.GetPrivacyService().GetPrivilegeAsync(EBiosPrivacyPrivilege.MULTIPLAYER_GAMEPLAY, true));
374 else
375 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
376#else
378#endif
379 }
EBiosPrivacyPrivilege
EBiosPrivacyPrivilege represents possible privacy privileges.
static bool ErrorCaught(EBiosError error)
static void OnLoadMPPrivilege(EBiosError err)

References ErrorCaught(), GetClientServices(), DebugPrint::LogErrorAndTrace(), m_ClientServices, and OnLoadMPPrivilege().

Referenced by CGame::ConnectFromServerBrowser(), ConnectErrorScriptModuleUI::DisconnectSession(), and CGame::SelectGamepad().

◆ LoadPermissions()

static void OnlineServices::LoadPermissions ( array< string > player_list)
inlinestaticprotected

Definition at line 279 of file OnlineServices.c.

280 {
283 {
285 perms.Insert(EBiosPrivacyPermission.COMMUNICATE_VOICE);
286
287 ErrorCaught(m_ClientServices.GetPrivacyService().GetPermissionsAsync(player_list, perms));
288 }
289 else
290 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
291 }
EBiosPrivacyPermission
EBiosPrivacyPermission represents possible privacy permissions.

References ErrorCaught(), GetClientServices(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by ClientData::SyncEvent_OnRecievedPlayerList().

◆ LoadServers()

static void OnlineServices::LoadServers ( notnull GetServersInput inputValues)
inlinestaticprotected

Definition at line 90 of file OnlineServices.c.

91 {
94 m_ClientServices.GetLobbyService().GetServers(inputValues);
95 else
96 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
97 }

References GetClientServices(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by GetNextPage(), ServerBrowserTabConsolePages::RefreshList(), ServerBrowserTabPc::RefreshList(), and RefreshList().

◆ LoadVoicePrivilege()

static void OnlineServices::LoadVoicePrivilege ( )
inlinestaticprotected

Definition at line 381 of file OnlineServices.c.

382 {
385 ErrorCaught(m_ClientServices.GetPrivacyService().GetPrivilegeAsync(EBiosPrivacyPrivilege.COMMUNICATE_VOICE, true));
386 else
387 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
388 }

References ErrorCaught(), GetClientServices(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by CGame::OnEvent().

◆ MutePlayer()

static bool OnlineServices::MutePlayer ( string id,
bool mute )
inlinestaticprotected

Definition at line 330 of file OnlineServices.c.

331 {
332 if (m_MuteList.Contains(id))
333 m_MuteList.Set(id, mute);
334 else
335 m_MuteList.Insert(id, mute);
336
337 // notify server
340 ctx.Write(id);
341 ctx.Write(mute);
342 ctx.Send();
343
344 return true;
345 }
const int INPUT_UDT_USER_MUTE_XBOX
Definition _constants.c:13

References INPUT_UDT_USER_MUTE_XBOX, and m_MuteList.

Referenced by ScriptedWidgetEventHandler::ToggleMute().

◆ OnAutoConnectToEmptyServer()

static void OnlineServices::OnAutoConnectToEmptyServer ( GetFirstServerWithEmptySlotResult result_list,
EBiosError error )
inlinestaticprotected

Definition at line 582 of file OnlineServices.c.

583 {
584 if (!ErrorCaught(error))
585 {
587 if (result)
588 {
589 g_Game.ConnectFromServerBrowser(result.m_HostIp, result.m_HostPort);
591 return;
592 }
593 else
594 GetGame().GetUIManager().ShowDialog("#str_xbox_authentification_fail_title", "#str_xbox_authentification_fail", 232, DBT_OK, DBB_NONE, DMT_INFO, GetGame().GetUIManager().GetMenu());
595 }
596
597 if (m_AutoConnectTries < 3)
598 {
601 input.SetOfficial(true);
602 m_ClientServices.GetLobbyService().GetFirstServerWithEmptySlot(input);
603 }
604 else
605 GetGame().GetUIManager().ShowDialog("#str_xbox_authentification_fail_title", "#xbox_authentification_fail", 232, DBT_OK, DBB_NONE, DMT_INFO, GetGame().GetUIManager().GetMenu());
606 }
static GetServersResultRow GetRandomFreeResult(GetFirstServerWithEmptySlotResult results)

References ErrorCaught(), g_Game, GetGame(), GetRandomFreeResult(), m_AutoConnectTries, and m_ClientServices.

Referenced by BiosLobbyService::OnGetFirstServerWithEmptySlot().

◆ OnFriendsAsync()

static void OnlineServices::OnFriendsAsync ( BiosFriendInfoArray friend_list,
EBiosError error )
inlinestaticprotected

Definition at line 237 of file OnlineServices.c.

238 {
239 if (!ErrorCaught(error))
240 {
242
244 for (int i = 0; i < friend_list.Count(); ++i)
245 {
246 string uid = friend_list[i].m_Uid;
249
250 if (storedBfi)
251 {
253 friends_simple.Insert(newBfi.m_Uid);
255 }
256 else
257 {
258 m_FriendsList.Insert(uid, newBfi);
259 friends_simple.Insert(newBfi.m_Uid);
260 }
261 }
262
264 {
265 if (ClientData.m_LastNewPlayers && ClientData.m_LastNewPlayers.m_PlayerList.Count() > 0)
266 {
267 foreach (SyncPlayer player : ClientData.m_LastNewPlayers.m_PlayerList)
268 {
269 if (m_FriendsList.Contains(player.m_UID))
270 NotificationSystem.AddNotification(NotificationType.FRIEND_CONNECTED, NotificationSystem.DEFAULT_TIME_DISPLAYED, player.m_PlayerName + " " + "#ps4_invite_has_joined_your_session");
271 }
272 ClientData.m_LastNewPlayers.m_PlayerList.Clear();
273 }
274 }
275 m_FirstFriendsLoad = false;
276 }
277 }
NotificationType
DEPRECATED (moved into NotificationSystem)
BiosFriendInfo represents friend information.
static bool Compare(BiosFriendInfo a, BiosFriendInfo b)
static ref SyncPlayerList m_LastNewPlayers
Definition ClientData.c:9
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
static ref ScriptInvoker m_FriendsAsyncInvoker

References NotificationSystem::AddNotification(), BiosFriendInfo::Compare(), NotificationSystem::DEFAULT_TIME_DISPLAYED, ErrorCaught(), m_FirstFriendsLoad, m_FriendsAsyncInvoker, m_FriendsList, and ClientData::m_LastNewPlayers.

Referenced by BiosSocialService::OnFriendsAsync().

◆ OnGetServerModList()

static void OnlineServices::OnGetServerModList ( GetServerModListResult result_list,
EBiosError error )
inlinestaticprotected

Definition at line 615 of file OnlineServices.c.

616 {
617 if (!ErrorCaught(error))
619 }
static ref ScriptInvoker m_ServerModLoadAsyncInvoker

References ErrorCaught(), and m_ServerModLoadAsyncInvoker.

Referenced by BiosLobbyService::OnServerModList().

◆ OnLoadMPPrivilege()

static void OnlineServices::OnLoadMPPrivilege ( EBiosError err)
inlinestaticprotected

Definition at line 390 of file OnlineServices.c.

391 {
392 if (!ErrorCaught(err))
393 g_Game.TryConnect();
394 else
395 {
396 if (g_Game.GetGameState() != DayZGameState.MAIN_MENU)
397 g_Game.MainMenuLaunch();
398 else
399 {
400 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
401 g_Game.GamepadCheck();
402 }
403 }
404 }

References ErrorCaught(), and g_Game.

Referenced by LoadMPPrivilege(), and BiosPrivacyService::OnPrivilege().

◆ OnLoadServersAsync()

static void OnlineServices::OnLoadServersAsync ( GetServersResult result_list,
EBiosError error,
string response )
inlinestaticprotected

Definition at line 176 of file OnlineServices.c.

177 {
178 if (!ErrorCaught(error))
179 {
180 if (m_CurrentServerIP != "" && m_CurrentServerPort > 0)
181 {
182 foreach (GetServersResultRow result : result_list.m_Results)
183 {
184 if (result.m_HostIp == m_CurrentServerIP && result.m_HostPort == m_CurrentServerPort)
185 {
189 }
190 }
191 }
192
193 // todo: remove
194 //foreach( GetServersResultRow res : result_list.m_Results )
195 //{
196 // Print("OnLoadServersAsync: result id: " + res.m_Id + "modded: " + res.m_Modded);
197 //}
198
199 // just for example execute the retrieving of extended info for the first server entry in the list
200 //if (result_list.m_Results.Count() > 0)
201 //{
202 //GetServersResultRow re = result_list.m_Results[0];
203 //EBiosError er = m_ClientServices.GetLobbyService().GetServerModList(re.m_Id);
204 //Print("OnLoadServersAsync GetServerModList returns:" + er);
205 //}
206
208 }
209 else
210 m_ServersAsyncInvoker.Invoke(null, error, "");
211 }
static ref ScriptInvoker m_ServersAsyncInvoker

References ErrorCaught(), m_CurrentServerInfo, m_CurrentServerIP, m_CurrentServerPort, and m_ServersAsyncInvoker.

Referenced by BiosLobbyService::OnDoneAsync().

◆ OnLoadVoicePrivilege()

static void OnlineServices::OnLoadVoicePrivilege ( EBiosError err)
inlinestaticprotected

Definition at line 406 of file OnlineServices.c.

407 {
408 if (g_Game.GetGameState() == DayZGameState.IN_GAME)
409 {
410#ifdef PLATFORM_PS4
411 GetGame().GetWorld().DisableReceiveVoN(ErrorCaught(err));
412#endif
413 GetGame().GetWorld().DisableTransmitVoN(ErrorCaught(err));
414 }
415 }

References ErrorCaught(), g_Game, and GetGame().

Referenced by BiosPrivacyService::OnPrivilege().

◆ OnPermissionsAsync()

static void OnlineServices::OnPermissionsAsync ( BiosPrivacyUidResultArray result_list,
EBiosError error )
inlinestaticprotected

Definition at line 293 of file OnlineServices.c.

294 {
295 if (!ErrorCaught(error))
296 {
298
299 for (int i = 0; i < result_list.Count(); i++)
300 {
302 string uid = result.m_Uid;
306 {
308 {
309 new_list.Insert(result);
311 }
312 }
313 else
314 {
316 new_list.Insert(result);
317 }
318 }
320 }
321 }
array< ref BiosPrivacyUidResult > BiosPrivacyUidResultArray
BiosPrivacyPermissionResult represents the per permission result of the GetPermissionsAsync reqeust.
static bool Compare(BiosPrivacyPermissionResult a, BiosPrivacyPermissionResult b)
BiosPrivacyUidResult represents the per user result of the GetPermissionsAsync request.
static ref ScriptInvoker m_PermissionsAsyncInvoker
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

References BiosPrivacyPermissionResult::Compare(), ErrorCaught(), m_PermissionsAsyncInvoker, and m_PermissionsList.

Referenced by BiosPrivacyService::OnPermissions().

◆ OnUserProfileAsync()

static void OnlineServices::OnUserProfileAsync ( EBiosError error)
inlinestaticprotected

Definition at line 232 of file OnlineServices.c.

233 {
235 }

References ErrorCaught().

Referenced by BiosSocialService::OnUserProfileAsync().

◆ PromptUpdate()

static void OnlineServices::PromptUpdate ( )
inlinestaticprotected

Definition at line 657 of file OnlineServices.c.

658 {
661 m_ClientServices.GetPackageService().PromptUpdateAsync();
662 }

References GetClientServices(), and m_ClientServices.

Referenced by BiosPackageService::OnCheckUpdate().

◆ SetBiosUser()

static void OnlineServices::SetBiosUser ( BiosUser user)
inlinestaticprotected

Definition at line 444 of file OnlineServices.c.

445 {
447 }

References m_BiosUser.

Referenced by BiosUserManager::OnJoin(), and CGame::SelectGamepad().

◆ SetGameplayActivity()

static void OnlineServices::SetGameplayActivity ( )
inlinestaticprotected

Definition at line 501 of file OnlineServices.c.

502 {
503 string addr;
504 int port;
505 if (GetGame().GetHostAddress(addr, port))
506 {
509 m_ClientServices.GetSessionService().SetGameplayActivityAsync(addr, port);
510 }
511 }

References GetClientServices(), GetGame(), and m_ClientServices.

◆ SetInviteServerInfo()

static void OnlineServices::SetInviteServerInfo ( string ip,
int port )
inlinestaticprotected

Definition at line 164 of file OnlineServices.c.

165 {
168 }

References m_InviteServerIP, and m_InviteServerPort.

Referenced by BiosSessionService::OnGetGameplaySession().

◆ SetMultiplayState()

static void OnlineServices::SetMultiplayState ( bool state)
inlinestaticprotected

◆ SetPendingInviteList()

static void OnlineServices::SetPendingInviteList ( array< string > invitees)
inlinestaticprotected

Definition at line 513 of file OnlineServices.c.

514 {
515 string addr;
516 int port;
517 if (GetGame().GetHostAddress(addr, port))
518 {
521 {
523 m_ClientServices.GetSessionService().InviteToGameplaySessionAsync(addr, port, GetPendingInviteList());
524 }
525 }
526 else
528 }
static array< string > GetPendingInviteList()

References GetClientServices(), GetGame(), GetPendingInviteList(), m_ClientServices, and m_PendingInvites.

Referenced by BiosUserManager::OnPartyHost().

◆ SetServerFavorited()

static void OnlineServices::SetServerFavorited ( string ipAddress,
int port,
int steamQueryPort,
bool is_favorited )
inlinestaticprotected

Definition at line 109 of file OnlineServices.c.

110 {
113 {
114 if (is_favorited)
115 m_ClientServices.GetLobbyService().AddServerFavorite(ipAddress, port, steamQueryPort);
116 else
117 m_ClientServices.GetLobbyService().RemoveServerFavorite(ipAddress, port, steamQueryPort);
118 }
119 else
120 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
121 }

References GetClientServices(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by ScriptedWidgetEventHandler::ToggleFavorite().

◆ SetSessionHandle()

static void OnlineServices::SetSessionHandle ( string handle)
inlinestaticprotected

Definition at line 417 of file OnlineServices.c.

418 {
421 m_ClientServices.GetSessionService().m_CurrentHandle = handle;
422 }

References GetClientServices(), and m_ClientServices.

Referenced by BiosUserManager::OnJoin().

◆ ShowInviteScreen()

static void OnlineServices::ShowInviteScreen ( )
inlinestaticprotected

Definition at line 352 of file OnlineServices.c.

353 {
354#ifdef PLATFORM_CONSOLE
357 {
358 string addr;
359 int port;
360 if (GetGame().GetHostAddress(addr, port))
361 ErrorCaught(m_ClientServices.GetSessionService().ShowInviteToGameplaySessionAsync(addr, port));
362 }
363 else
364 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
365#endif
366 }

References ErrorCaught(), GetClientServices(), GetGame(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by UIScriptedMenu::OnClick().

◆ ShowUserProfile()

static void OnlineServices::ShowUserProfile ( string uid)
inlinestaticprotected

Definition at line 223 of file OnlineServices.c.

224 {
227 m_ClientServices.GetSocialService().ShowUserProfileAsync(uid);
228 else
229 DebugPrint.LogErrorAndTrace("BiosClientServices Error: Service reference does not exist.");
230 }

References GetClientServices(), DebugPrint::LogErrorAndTrace(), and m_ClientServices.

Referenced by ScriptedWidgetEventHandler::OnDoubleClick(), and UIScriptedMenu::Update().

Member Data Documentation

◆ m_AutoConnectTries

int OnlineServices::m_AutoConnectTries = 0
staticprotected

Definition at line 552 of file OnlineServices.c.

Referenced by AutoConnectToEmptyServer(), and OnAutoConnectToEmptyServer().

◆ m_BiosUser

ref BiosUser OnlineServices::m_BiosUser
staticprotected

Definition at line 28 of file OnlineServices.c.

Referenced by GetBiosUser(), and SetBiosUser().

◆ m_ClientServices

◆ m_CurrentServerInfo

ref GetServersResultRow OnlineServices::m_CurrentServerInfo
staticprotected

◆ m_CurrentServerIP

string OnlineServices::m_CurrentServerIP
staticprotected

◆ m_CurrentServerPort

int OnlineServices::m_CurrentServerPort
staticprotected

◆ m_FirstFriendsLoad

bool OnlineServices::m_FirstFriendsLoad = true
staticprotected

Definition at line 24 of file OnlineServices.c.

Referenced by LeaveGameplaySession(), and OnFriendsAsync().

◆ m_FriendsAsyncInvoker

ref ScriptInvoker OnlineServices::m_FriendsAsyncInvoker = new ScriptInvoker()
staticprivate

Definition at line 3 of file OnlineServices.c.

Referenced by OnFriendsAsync().

◆ m_FriendsList

ref map<string, ref BiosFriendInfo> OnlineServices::m_FriendsList
staticprotected

Definition at line 20 of file OnlineServices.c.

Referenced by Init(), LeaveGameplaySession(), and OnFriendsAsync().

◆ m_InviteServerIP

string OnlineServices::m_InviteServerIP
staticprotected

Definition at line 13 of file OnlineServices.c.

Referenced by GetInviteServerInfo(), and SetInviteServerInfo().

◆ m_InviteServerPort

int OnlineServices::m_InviteServerPort
staticprotected

Definition at line 14 of file OnlineServices.c.

Referenced by GetInviteServerInfo(), and SetInviteServerInfo().

◆ m_MultiplayState

bool OnlineServices::m_MultiplayState = false
staticprotected

Definition at line 25 of file OnlineServices.c.

Referenced by GetMultiplayState(), and SetMultiplayState().

◆ m_MuteList

ref map<string, bool> OnlineServices::m_MuteList
staticprotected

Definition at line 21 of file OnlineServices.c.

Referenced by GetMuteList(), Init(), IsPlayerMuted(), and MutePlayer().

◆ m_MuteUpdateAsyncInvoker

ref ScriptInvoker OnlineServices::m_MuteUpdateAsyncInvoker = new ScriptInvoker()
staticprivate

Definition at line 7 of file OnlineServices.c.

◆ m_PendingInvites

ref array<string> OnlineServices::m_PendingInvites
staticprotected

◆ m_PermissionsAsyncInvoker

ref ScriptInvoker OnlineServices::m_PermissionsAsyncInvoker = new ScriptInvoker()
staticprivate

◆ m_PermissionsList

ref map<string, ref BiosPrivacyPermissionResultArray> OnlineServices::m_PermissionsList
staticprotected

Definition at line 22 of file OnlineServices.c.

Referenced by Init(), and OnPermissionsAsync().

◆ m_ServerAsyncInvoker

ref ScriptInvoker OnlineServices::m_ServerAsyncInvoker = new ScriptInvoker()
staticprivate

Definition at line 6 of file OnlineServices.c.

◆ m_ServerModLoadAsyncInvoker

ref ScriptInvoker OnlineServices::m_ServerModLoadAsyncInvoker = new ScriptInvoker()
staticprivate

◆ m_ServersAsyncInvoker

◆ m_TrialService

ref TrialService OnlineServices::m_TrialService
staticprivate

Definition at line 11 of file OnlineServices.c.

Referenced by Init(), IsGameActive(), and IsGameTrial().


The documentation for this class was generated from the following file: