DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
BiosUserManager.c
Go to the documentation of this file.
1
3{
6};
7
9{
10 proto native owned string GetName();
11 proto native owned string GetUid();
13 proto native bool IsOnline();
14};
15
17{
19
23
25
33
36
38
43 proto native EBiosError PickUserAsync();
44
45
47
56 proto native EBiosError ParseJoinAsync(string join_data);
57
59
68 proto native EBiosError ParsePartyAsync(string party_data);
69
71
76 proto native void SelectUser(BiosUser user);
77
79
82 proto native BiosUser GetSelectedUser();
83
85
89
91 {
92 BiosUser selectedUser = GetSelectedUser();
93 if (selectedUser && selectedUser != user && g_Game.GetGameState() != DayZGameState.MAIN_MENU)
94 {
95 SelectUser(user);
96 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE & ~DisconnectSessionFlags.SELECT_USER);
97 }
98 else
99 SelectUser(user);
100 }
101
103
107 void OnUserDatabaseId(string dbID, EBiosError error)
108 {
109 if ( !OnlineServices.ErrorCaught( error ) )
110 {
111 g_Game.SetDatabaseID( dbID );
112 }
113 }
114
116
120 {
121 if ( OnlineServices.ErrorCaught( error ) )
122 {
124 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE);
125 }
126 }
127
129
134 {
135 if ( !user )
136 {
138 g_Game.GamepadCheck();
139 }
140 else if ( !OnlineServices.ErrorCaught( error ) )
141 {
142 SelectUserEx( user );
143 if ( GetGame().GetMission() )
145 OnGameNameChanged( user );
146 g_Game.SelectUser(GetGame().GetInput().GetUserGamepad(user));
147 }
148 }
149
152 {
153 if ( user && GetSelectedUser() == user )
154 g_Game.SelectUser(GetGame().GetInput().GetUserGamepad(user));
155 }
156
159 {
160 OnSignedOut( user );
161 }
162
164
170 {
171
172 }
173
175
181 {
182 if ( user == GetSelectedUser() )
183 {
184 SelectUserEx( null );
186 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE & ~DisconnectSessionFlags.SELECT_USER);
187 }
188 }
189
191
200 void OnJoin(EBiosJoinType type, BiosUser joiner, string handle, string joinee, EBiosError error)
201 {
202 if ( !OnlineServices.ErrorCaught( error ) )
203 {
204 OnlineServices.SetBiosUser( joiner );
205
206 SelectUserEx( joiner );
208
209 if ( g_Game.GetGameState() == DayZGameState.IN_GAME )
210 {
211 g_Game.SetLoadState( DayZLoadState.JOIN_START );
213 }
214 else
215 {
216 if ( GetGame().GetUIManager() && GetGame().GetInput().IsActiveGamepadSelected() )
217 {
220 }
221 g_Game.SetLoadState( DayZLoadState.JOIN_START );
222 g_Game.GamepadCheck();
223 }
224 }
225 else
226 {
227 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
228 }
229 }
230
232
239 void OnPartyHost(BiosUser host, array<string> invitee_list, EBiosError error)
240 {
241 #ifdef PLATFORM_PS4
242 if (host)
243 #endif
244 {
245 SelectUserEx(host);
246
247 #ifdef PLATFORM_PS4
248 if (!host.IsOnline())
249 {
250 LogOnUserAsync( host );
251 }
252 #endif
253 }
254
255
256 if (GetGame().GetUIManager())
257 {
259 }
260
261 OnlineServices.SetPendingInviteList( invitee_list );
262 if (g_Game.GetGameState() != DayZGameState.IN_GAME && g_Game.GetGameState() != DayZGameState.CONNECTING)
263 {
264 if (!GetGame().GetUIManager().GetMenu() || GetGame().GetUIManager().GetMenu().GetID() != MENU_MAIN)
265 {
266 GetGame().GetUIManager().EnterScriptedMenu(MENU_MAIN, GetGame().GetUIManager().GetMenu());
267 }
268 g_Game.SetGameState( DayZGameState.PARTY );
269 g_Game.SetLoadState( DayZLoadState.PARTY_START );
270 g_Game.GamepadCheck();
271 }
272 }
273
275
281 {
282 if ( user == GetSelectedUser() )
283 {
284 g_Game.SetPlayerName( user.GetName() );
285 #ifdef PLATFORM_CONSOLE
286 g_Game.SetPlayerGameName( user.GetName() );
287 #endif
288 if ( GetGame().GetUIManager().GetMenu() )
289 {
291 }
292 }
293 }
294
295 BiosUser GetUser( string user_id )
296 {
298 GetUserList( user_list );
299 foreach ( BiosUser user : user_list )
300 {
301 if ( user.GetUid() == user_id )
302 {
303 return user;
304 }
305 }
306 return null;
307 }
308};
ActionInput GetInput()
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
EBiosJoinType
@ ACTIVITY
@ INVITE
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
DayZGame g_Game
Definition DayZGame.c:3654
DisconnectSessionFlags
Definition DayZGame.c:2
const int DISCONNECT_SESSION_FLAGS_JOIN
Definition DayZGame.c:14
int GetID()
Get the ID registered in SEffectManager.
Definition Effect.c:525
BiosClientServices class provides individual online services.
proto native bool IsOnline()
proto native BiosClientServices GetClientServices()
proto native owned string GetName()
proto native owned string GetUid()
proto native EBiosError ParsePartyAsync(string party_data)
Parse the party data from from command line parameters.
proto native EBiosError LogOnUserAsync(BiosUser user)
Display a system dependant ui for log-on.
void OnUserLoggedOn(EBiosError error)
Callback function.
BiosUser GetUser(string user_id)
void OnUserPicked(BiosUser user, EBiosError error)
Callback function.
void OnGameNameChanged(BiosUser user)
Callback function.
proto native void SelectUser(BiosUser user)
Informs the engine about the current selected user.
void OnSignedOut(BiosUser user)
Callback function.
void OnPartyHost(BiosUser host, array< string > invitee_list, EBiosError error)
Callback function.
void OnJoin(EBiosJoinType type, BiosUser joiner, string handle, string joinee, EBiosError error)
Callback function.
void OnLoggedOn(BiosUser user)
Callback function.
proto native EBiosError ParseJoinAsync(string join_data)
Parse the join data from from command line parameters.
void OnSignedIn(BiosUser user)
Callback function.
proto native BiosUser GetTitleInitiator()
Gets the initiatior of the title.
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
void OnUserDatabaseId(string dbID, EBiosError error)
Callback function.
void SelectUserEx(BiosUser user)
void OnLoggedOff(BiosUser user)
Callback function.
proto native EBiosError PickUserAsync()
Display a system dependant account picket.
proto native EBiosError GetUserList(array< ref BiosUser > user_list)
Gets the currently present list of users.
proto native EBiosError GetUserDatabaseIdAsync()
Call async function to get database ID.
proto native Mission GetMission()
proto native Input GetInput()
proto native UIManager GetUIManager()
proto native void IdentifyGamepad(GamepadButton button)
the on OnGamepadIdentification callback will return the first gamepad where the button was pressed
proto native void ResetActiveGamepad()
clears active gamepad
void Reset()
Definition gameplay.c:693
static void SetSessionHandle(string handle)
static void GetSession()
static void SetPendingInviteList(array< string > invitees)
static void SetBiosUser(BiosUser user)
static bool ErrorCaught(EBiosError error)
bool CloseMenu(int id)
Close menu with specific ID (see MenuID)
Definition UIManager.c:119
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent)
Create & open menu with specific id (see MenuID) and set its parent.
override void Refresh()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
GamepadButton
Definition EnSystem.c:341
const int MENU_TITLE_SCREEN
Definition constants.c:174
const int MENU_MAIN
Definition constants.c:160