DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BiosSessionService.c
См. документацию.
2{
3 protected int m_GetSessionAttempts;
5
7
16 proto native EBiosError EnterGameplaySessionAsync(string session_address, int session_port);
17
19
30 proto native EBiosError LeaveGameplaySessionAsync(string session_address, int session_port);
31
33
36 proto native void OnSessionPlayerListUpdate(array<string> newPlayers);
37
39
47 void TryGetSession( string join_handle = "" )
48 {
49 if ( join_handle != "" )
50 {
52 m_CurrentHandle = join_handle;
53 }
54
55 if ( m_GetSessionAttempts < 10 )
57 else
58 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
59 }
60
62
70 proto native EBiosError GetSessionAsync(string join_handle);
71
73
82 proto native EBiosError SetGameplayActivityAsync(string session_address, int session_port);
83
85 //proto native EBiosError SetLobbyActivityAsync(...);
86
88
95
97
107 proto native EBiosError ShowInviteToGameplaySessionAsync(string session_address, int session_port);
108
110
120 proto native EBiosError InviteToGameplaySessionAsync(string session_address, int session_port, array<string> invitee_list);
121
123 proto native void SetMultiplayState(bool is_active);
124
126
130 {
132 }
133
135
139 {
140 }
141
143
147 void OnGetGameplaySession(string session_address, int session_port)
148 {
150 switch (g_Game.GetGameState())
151 {
152 case DayZGameState.IN_GAME:
153 {
154 string addr;
155 int port;
156 bool found = g_Game.GetHostAddress( addr, port );
157 if (addr != session_address || port != session_port )
158 {
159 if (found)
160 {
161 OnlineServices.SetInviteServerInfo( session_address, session_port );
162
163 // an earlier invite already started the logout and it cannot be taken
164 // back, so only retarget it, do not tear the dialog down and ask the
165 // server for a second logout it would ignore anyway
166 if (!g_Game.GetUIManager().IsMenuOpen( MENU_INVITE_TIMER ))
167 {
168 g_Game.GetUIManager().CloseAll();
169 if (!g_Game.GetUIManager().EnterScriptedMenu( MENU_INVITE_TIMER, null ))
170 {
172 }
173 }
174 }
175 else
176 {
178 }
179 }
180 else
181 {
182 NotificationSystem.AddNotification( NotificationType.INVITE_FAIL_SAME_SERVER, NotificationSystem.DEFAULT_TIME_DISPLAYED, "#ps4_already_in_session" );
183 }
184 break;
185 }
186 case DayZGameState.CONNECTING:
187 {
188 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE);
189 // Intentionally no break, fall through to connecting
190 }
191 default:
192 {
193 g_Game.ConnectFromJoin( session_address, session_port );
194 break;
195 }
196 }
197 }
198
200 /*void OnGetLobbySession(...)
201 {
202 }*/
203
205
209 {
212
213 #ifdef PLATFORM_MSSTORE
214 GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( TryGetSession, 100, false, "" );
215 #endif
216 #ifdef PLATFORM_XBOX
217 g_Game.GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( TryGetSession, 100, false, "" );
218 #endif
219 #ifdef PLATFORM_PS4
220 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
221 #endif
222 }
223
225
230 void OnEnterGameplaySession(string session_address, int session_port, EBiosError error)
231 {
232 if ( !OnlineServices.ErrorCaught( error ) )
233 {
234 SetGameplayActivityAsync( session_address, session_port );
236 InviteToGameplaySessionAsync( session_address, session_port, OnlineServices.GetPendingInviteList() );
237
238 //OnlineServices.GetCurrentServerInfo(session_address, session_port);
239 }
240 }
241
243
247 {
248 }
249
251
258
260
264 {
265
266 }
267
272
274
278 {
279 TStringArray playerList = GetSessionPlayerList();
280 outPlayerList.Copy(playerList);
281 }
282
283};
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
Определения BIOSErrorModule.c:7
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
DayZGame g_Game
Определения DayZGame.c:4074
const int DISCONNECT_SESSION_FLAGS_JOIN
Определения DayZGame.c:14
NotificationType
DEPRECATED (moved into NotificationSystem)
Определения NotificationSystem.c:4
int m_GetSessionAttempts
Определения BiosSessionService.c:3
void OnClearActivity(EBiosError error)
Callback function.
Определения BiosSessionService.c:138
void OnGetGameplaySession(string session_address, int session_port)
Callback function.
Определения BiosSessionService.c:147
void OnSetActivity(EBiosError error)
Callback function.
Определения BiosSessionService.c:129
void OnLeaveGameplaySession(EBiosError error)
Callback function.
Определения BiosSessionService.c:246
void OnInviteToGameplaySession(EBiosError error)
Callback function.
Определения BiosSessionService.c:263
void OnEnterGameplaySession(string session_address, int session_port, EBiosError error)
Callback function.
Определения BiosSessionService.c:230
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.
Определения BiosSessionService.c:47
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.
string m_CurrentHandle
Определения BiosSessionService.c:4
void OnGetSessionError(EBiosError error)
//! Callback function, not implemented
Определения BiosSessionService.c:208
proto native EBiosError LeaveGameplaySessionAsync(string session_address, int session_port)
Leave a gameplay session.
void GetSessionPlayerListEx(TStringArray outPlayerList)
Native callback function to retrieve the session player list.
Определения BiosSessionService.c:277
proto native EBiosError ShowInviteToGameplaySessionAsync(string session_address, int session_port)
Show system UI to invite friends to current gameplay session.
array< string > GetSessionPlayerList()
Определения BiosSessionService.c:268
proto native EBiosError EnterGameplaySessionAsync(string session_address, int session_port)
Enter a gameplay session.
void OnShowInviteToGameplaySession(EBiosError error)
Callback function.
Определения BiosSessionService.c:254
proto native EBiosError ClearActivityAsync()
not implemented
static array< string > GetSimplePlayerList()
Определения ClientData.c:92
Определения ClientData.c:2
const int DEFAULT_TIME_DISPLAYED
Определения NotificationSystem.c:71
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
Определения NotificationSystem.c:192
static array< string > GetPendingInviteList()
Определения OnlineServices.c:599
static bool ErrorCaught(EBiosError error)
Определения OnlineServices.c:82
static void SetInviteServerInfo(string ip, int port)
Определения OnlineServices.c:185
Определения OnlineServices.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame GetGame()
Определения gameplay.c:636
class array< Class T > TStringArray
const int MENU_INVITE_TIMER
Определения 3_Game/DayZ/constants.c:212
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8