DayZ 1.29
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 g_Game.GetUIManager().CloseAll();
163 if (!g_Game.GetUIManager().EnterScriptedMenu( MENU_INVITE_TIMER, null ))
164 {
166 }
167 }
168 else
169 {
171 }
172 }
173 else
174 {
175 NotificationSystem.AddNotification( NotificationType.INVITE_FAIL_SAME_SERVER, NotificationSystem.DEFAULT_TIME_DISPLAYED, "#ps4_already_in_session" );
176 }
177 break;
178 }
179 case DayZGameState.CONNECTING:
180 {
181 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE);
182 // Intentionally no break, fall through to connecting
183 }
184 default:
185 {
186 g_Game.ConnectFromJoin( session_address, session_port );
187 break;
188 }
189 }
190 }
191
193 /*void OnGetLobbySession(...)
194 {
195 }*/
196
198
202 {
205
206 #ifdef PLATFORM_MSSTORE
207 GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( TryGetSession, 100, false, "" );
208 #endif
209 #ifdef PLATFORM_XBOX
210 g_Game.GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( TryGetSession, 100, false, "" );
211 #endif
212 #ifdef PLATFORM_PS4
213 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
214 #endif
215 }
216
218
223 void OnEnterGameplaySession(string session_address, int session_port, EBiosError error)
224 {
225 if ( !OnlineServices.ErrorCaught( error ) )
226 {
227 SetGameplayActivityAsync( session_address, session_port );
229 InviteToGameplaySessionAsync( session_address, session_port, OnlineServices.GetPendingInviteList() );
230
231 //OnlineServices.GetCurrentServerInfo(session_address, session_port);
232 }
233 }
234
236
240 {
241 }
242
244
251
253
257 {
258
259 }
260
265
267
271 {
272 TStringArray playerList = GetSessionPlayerList();
273 outPlayerList.Copy(playerList);
274 }
275
276};
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:3942
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:239
void OnInviteToGameplaySession(EBiosError error)
Callback function.
Определения BiosSessionService.c:256
void OnEnterGameplaySession(string session_address, int session_port, EBiosError error)
Callback function.
Определения BiosSessionService.c:223
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:201
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:270
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:261
proto native EBiosError EnterGameplaySessionAsync(string session_address, int session_port)
Enter a gameplay session.
void OnShowInviteToGameplaySession(EBiosError error)
Callback function.
Определения BiosSessionService.c:247
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
array< string > TStringArray
Определения EnScript.c:712
const int MENU_INVITE_TIMER
Определения 3_Game/DayZ/constants.c:206
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8