DayZ 1.24
Loading...
Searching...
No Matches
BiosSessionService.c
Go to the documentation of this file.
2{
3 protected int m_GetSessionAttempts;
5
7
17
19
31
33
37
39
47 void TryGetSession(string join_handle = "")
48 {
49 if (join_handle != "")
50 {
53 }
54
55 if (m_GetSessionAttempts < 10)
57 else
58 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
59 }
60
62
71
73
83
85 //proto native EBiosError SetLobbyActivityAsync(...);
86
88
95
97
108
110
121
124
126
133
135
141
143
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 }
185
187 /*void OnGetLobbySession(...)
188 {
189 }*/
190
192
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 }
207
209
225
227
233
235
242
244
251
256
257};
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
DayZGame g_Game
Definition DayZGame.c:3528
const int DISCONNECT_SESSION_FLAGS_JOIN
Definition DayZGame.c:14
NotificationType
DEPRECATED (moved into NotificationSystem)
void OnClearActivity(EBiosError error)
Callback function.
void OnGetGameplaySession(string session_address, int session_port)
Callback function.
void OnSetActivity(EBiosError error)
Callback function.
void OnLeaveGameplaySession(EBiosError error)
Callback function.
void OnInviteToGameplaySession(EBiosError error)
Callback function.
void OnEnterGameplaySession(string session_address, int session_port, EBiosError error)
Callback function.
proto native EBiosError InviteToGameplaySessionAsync(string session_address, int session_port, array< string > invitee_list)
Send invite to list of users.
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 void SetMultiplayState(bool is_active)
Notifiy about interactive multiplayer state.
proto native void OnSessionPlayerListUpdate(array< string > newPlayers)
Alerts engine that players in current session have changed.
void OnGetSessionError(EBiosError error)
//! Callback function, not implemented
proto native EBiosError LeaveGameplaySessionAsync(string session_address, int session_port)
Leave a gameplay session.
proto native EBiosError ShowInviteToGameplaySessionAsync(string session_address, int session_port)
Show system UI to invite friends to current gameplay session.
array< string > GetSessionPlayerList()
proto native EBiosError EnterGameplaySessionAsync(string session_address, int session_port)
Enter a gameplay session.
void OnShowInviteToGameplaySession(EBiosError error)
Callback function.
proto native EBiosError ClearActivityAsync()
not implemented
static array< string > GetSimplePlayerList()
Definition ClientData.c:84
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
static array< string > GetPendingInviteList()
static bool ErrorCaught(EBiosError error)
static void SetInviteServerInfo(string ip, int port)
proto native CGame GetGame()
const int MENU_INVITE_TIMER
Definition constants.c:196
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8