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

Protected Member Functions

proto native EBiosError EnterGameplaySessionAsync (string session_address, int session_port)
 Enter a gameplay session.
 
proto native EBiosError LeaveGameplaySessionAsync (string session_address, int session_port)
 Leave a gameplay session.
 
proto native void OnSessionPlayerListUpdate (array< string > newPlayers)
 Alerts engine that players in current session have changed.
 
void TryGetSession (string join_handle="")
 Gets a session from a join handle.
 
proto native EBiosError GetSessionAsync (string join_handle)
 Gets a session from a join handle.
 
proto native EBiosError SetGameplayActivityAsync (string session_address, int session_port)
 Sets the activity to a gameplay session.
 
proto native EBiosError ClearActivityAsync ()
 not implemented
 
proto native EBiosError ShowInviteToGameplaySessionAsync (string session_address, int session_port)
 Show system UI to invite friends to current gameplay session.
 
proto native EBiosError InviteToGameplaySessionAsync (string session_address, int session_port, array< string > invitee_list)
 Send invite to list of users.
 
proto native void SetMultiplayState (bool is_active)
 Notifiy about interactive multiplayer state.
 
void OnSetActivity (EBiosError error)
 Callback function.
 
void OnClearActivity (EBiosError error)
 Callback function.
 
void OnGetGameplaySession (string session_address, int session_port)
 Callback function.
 
void OnGetSessionError (EBiosError error)
 //! Callback function, not implemented
 
void OnEnterGameplaySession (string session_address, int session_port, EBiosError error)
 Callback function.
 
void OnLeaveGameplaySession (EBiosError error)
 Callback function.
 
void OnShowInviteToGameplaySession (EBiosError error)
 Callback function.
 
void OnInviteToGameplaySession (EBiosError error)
 Callback function.
 
array< stringGetSessionPlayerList ()
 

Protected Attributes

int m_GetSessionAttempts
 
string m_CurrentHandle
 

Detailed Description

Definition at line 1 of file BiosSessionService.c.

Member Function Documentation

◆ ClearActivityAsync()

proto native EBiosError BiosSessionService::ClearActivityAsync ( )
protected

not implemented

Clears the current activity

The async result is returned in the OnClearActivity callback. Expected errors:

Returns
EBiosError indicating if the async operation is pending.

◆ EnterGameplaySessionAsync()

proto native EBiosError BiosSessionService::EnterGameplaySessionAsync ( string session_address,
int session_port )
protected

Enter a gameplay session.

The async result is returned in the OnEnterGameplaySession callback. Expected errors: LOGICAL - if the user is currently in an active gameplay session.

Parameters
session_addressserver IP address.
session_portserver port.
Returns
EBiosError indicating if the async operation is pending.

◆ GetSessionAsync()

proto native EBiosError BiosSessionService::GetSessionAsync ( string join_handle)
protected

Gets a session from a join handle.

The async result is returned in the OnGetGameplaySession, OnGetLobbySession or OnGetSessionError callback, dependinng on the type of session, or error. Expected errors:

Parameters
join_handlethe parsed join handle.
Returns
EBiosError indicating if the async operation is pending.

Referenced by TryGetSession().

◆ GetSessionPlayerList()

array< string > BiosSessionService::GetSessionPlayerList ( )
inlineprotected

Definition at line 252 of file BiosSessionService.c.

253 {
255 }
static array< string > GetSimplePlayerList()
Definition ClientData.c:84

References ClientData::GetSimplePlayerList().

◆ InviteToGameplaySessionAsync()

proto native EBiosError BiosSessionService::InviteToGameplaySessionAsync ( string session_address,
int session_port,
array< string > invitee_list )
protected

Send invite to list of users.

The async result is returned in the OnInviteToGameplaySession callback. The user must be inside the session. That means, OnEnterGameplaySession must be called with no errors.

Parameters
session_addressserver IP address.
session_portserver port.
invitee_listlist of users to invite
Returns
EBiosError indicating if the async operation is pending.

Referenced by OnEnterGameplaySession().

◆ LeaveGameplaySessionAsync()

proto native EBiosError BiosSessionService::LeaveGameplaySessionAsync ( string session_address,
int session_port )
protected

Leave a gameplay session.

The async result is returned in the OnLeaveGameplaySession callback. If there is an unexpected error the state is cleared. Expected errors: ERR_NOT_FOUND - when attempting to leave a gameplay session the user is not part of. ERR_LOGICAL - when the user is not in a gameplay session.

Parameters
session_addressserver IP address.
session_portserver port.
Returns
EBiosError indicating if the async operation is pending.

◆ OnClearActivity()

void BiosSessionService::OnClearActivity ( EBiosError error)
inlineprotected

Callback function.

Parameters
errorerror indicating success or fail of the async operation.

Definition at line 138 of file BiosSessionService.c.

139 {
140 }

◆ OnEnterGameplaySession()

void BiosSessionService::OnEnterGameplaySession ( string session_address,
int session_port,
EBiosError error )
inlineprotected

Callback function.

Parameters
session_addressserver IP address. Empty if failed.
session_portserver port. 0 if failed.
errorerror indicating success or fail of the async operation.

Definition at line 214 of file BiosSessionService.c.

215 {
217 {
221
222 //OnlineServices.GetCurrentServerInfo(session_address, session_port);
223 }
224 }
proto native EBiosError InviteToGameplaySessionAsync(string session_address, int session_port, array< string > invitee_list)
Send invite to list of users.
proto native EBiosError SetGameplayActivityAsync(string session_address, int session_port)
Sets the activity to a gameplay session.
static array< string > GetPendingInviteList()
static bool ErrorCaught(EBiosError error)

References OnlineServices::ErrorCaught(), OnlineServices::GetPendingInviteList(), InviteToGameplaySessionAsync(), and SetGameplayActivityAsync().

◆ OnGetGameplaySession()

void BiosSessionService::OnGetGameplaySession ( string session_address,
int session_port )
inlineprotected

Callback function.

Parameters
session_addressserver IP address.
session_portserver port.

Definition at line 147 of file BiosSessionService.c.

148 {
150 switch (g_Game.GetGameState())
151 {
152 case DayZGameState.IN_GAME:
153 {
154 string addr;
155 int port;
156 bool found = GetGame().GetHostAddress(addr, port);
158 {
159 if (found)
160 {
162 g_Game.GetUIManager().CloseAll();
163 if (!g_Game.GetUIManager().EnterScriptedMenu(MENU_INVITE_TIMER, null))
165 }
166 else
168 }
169 else
170 NotificationSystem.AddNotification(NotificationType.INVITE_FAIL_SAME_SERVER, NotificationSystem.DEFAULT_TIME_DISPLAYED, "#ps4_already_in_session");
171 break;
172 }
173 case DayZGameState.CONNECTING:
174 {
175 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE);
176 // Intentionally no break, fall through to connecting
177 }
178 default:
179 {
180 g_Game.ConnectFromJoin(session_address, session_port);
181 break;
182 }
183 }
184 }
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
DayZGame g_Game
Definition DayZGame.c:3528
NotificationType
DEPRECATED (moved into NotificationSystem)
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
static void SetInviteServerInfo(string ip, int port)
proto native CGame GetGame()
const int MENU_INVITE_TIMER
Definition constants.c:196

References NotificationSystem::AddNotification(), NotificationSystem::DEFAULT_TIME_DISPLAYED, DISCONNECT_SESSION_FLAGS_FORCE, g_Game, GetGame(), m_GetSessionAttempts, MENU_INVITE_TIMER, and OnlineServices::SetInviteServerInfo().

◆ OnGetSessionError()

void BiosSessionService::OnGetSessionError ( EBiosError error)
inlineprotected

//! Callback function, not implemented

Callback function

Parameters
errorerror indicating fail of the async operation. Cannot be OK.

Definition at line 195 of file BiosSessionService.c.

196 {
199
200#ifdef PLATFORM_XBOX
201 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(TryGetSession, 100, false, "");
202#endif
203#ifdef PLATFORM_PS4
204 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
205#endif
206 }
const int DISCONNECT_SESSION_FLAGS_JOIN
Definition DayZGame.c:14
void TryGetSession(string join_handle="")
Gets a session from a join handle.
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, DISCONNECT_SESSION_FLAGS_JOIN, OnlineServices::ErrorCaught(), g_Game, GetGame(), m_GetSessionAttempts, and TryGetSession().

◆ OnInviteToGameplaySession()

void BiosSessionService::OnInviteToGameplaySession ( EBiosError error)
inlineprotected

Callback function.

Parameters
errorindicating success or fail of the async operation.

Definition at line 247 of file BiosSessionService.c.

248 {
249
250 }

◆ OnLeaveGameplaySession()

void BiosSessionService::OnLeaveGameplaySession ( EBiosError error)
inlineprotected

Callback function.

Parameters
errorerror indicating success or fail of the async operation.

Definition at line 230 of file BiosSessionService.c.

231 {
232 }

◆ OnSessionPlayerListUpdate()

proto native void BiosSessionService::OnSessionPlayerListUpdate ( array< string > newPlayers)
protected

Alerts engine that players in current session have changed.

Parameters
newPlayersplayers that have just joined the server. When player joins a server, ALL players already on server count as new players.

◆ OnSetActivity()

void BiosSessionService::OnSetActivity ( EBiosError error)
inlineprotected

Callback function.

Parameters
errorerror indicating success or fail of the async operation.

Definition at line 129 of file BiosSessionService.c.

130 {
132 }

References OnlineServices::ErrorCaught().

◆ OnShowInviteToGameplaySession()

void BiosSessionService::OnShowInviteToGameplaySession ( EBiosError error)
inlineprotected

Callback function.

Parameters
errorindicating success or fail of the async operation.

Definition at line 238 of file BiosSessionService.c.

239 {
241 }

References OnlineServices::ErrorCaught().

◆ SetGameplayActivityAsync()

proto native EBiosError BiosSessionService::SetGameplayActivityAsync ( string session_address,
int session_port )
protected

Sets the activity to a gameplay session.

The async result is returned in the OnSetActivity callback. Expected errors: ERR_NOT_FOUND - when attempting to set a gameplay session activity the user is not part of.

Parameters
session_addressserver IP address.
session_portserver port.
Returns
EBiosError indicating if the async operation is pending.

Referenced by OnEnterGameplaySession().

◆ SetMultiplayState()

proto native void BiosSessionService::SetMultiplayState ( bool is_active)
protected

Notifiy about interactive multiplayer state.

◆ ShowInviteToGameplaySessionAsync()

proto native EBiosError BiosSessionService::ShowInviteToGameplaySessionAsync ( string session_address,
int session_port )
protected

Show system UI to invite friends to current gameplay session.

The async result is returned in the OnShowInviteToGameplaySession callback. On Xbox, if session with session_address and session_port does not exist, then xbox show message "We could not send the invite".

Parameters
session_addressserver IP address.
session_portserver port.
Returns
EBiosError indicating if the async operation is pending.

◆ TryGetSession()

void BiosSessionService::TryGetSession ( string join_handle = "")
inlineprotected

Gets a session from a join handle.

The async result is returned in the OnGetGameplaySession, OnGetLobbySession or OnGetSessionError callback, dependinng on the type of session, or error. Expected errors:

Parameters
join_handlethe parsed join handle.
Returns
EBiosError indicating if the async operation is pending.

Definition at line 47 of file BiosSessionService.c.

48 {
49 if (join_handle != "")
50 {
53 }
54
55 if (m_GetSessionAttempts < 10)
57 else
58 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
59 }
proto native EBiosError GetSessionAsync(string join_handle)
Gets a session from a join handle.

References DISCONNECT_SESSION_FLAGS_JOIN, g_Game, GetSessionAsync(), m_CurrentHandle, and m_GetSessionAttempts.

Referenced by OnGetSessionError().

Member Data Documentation

◆ m_CurrentHandle

string BiosSessionService::m_CurrentHandle
protected

Definition at line 4 of file BiosSessionService.c.

Referenced by TryGetSession().

◆ m_GetSessionAttempts

int BiosSessionService::m_GetSessionAttempts
protected

Definition at line 3 of file BiosSessionService.c.

Referenced by OnGetGameplaySession(), OnGetSessionError(), and TryGetSession().


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