DayZ 1.24
Loading...
Searching...
No Matches
BiosUserManager.c
Go to the documentation of this file.
1
7
15
17{
19
23
25
33
36
38
44
45
47
57
59
69
71
77
79
83
85
89
91 {
92 bool success = false;
93
95 if (selectedUser && selectedUser != user && g_Game.GetGameState() != DayZGameState.MAIN_MENU)
96 {
98 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE & ~DisconnectSessionFlags.SELECT_USER);
99 }
100 else
102
103 if (!success)
105
106 return success;
107 }
108
110
115 {
117 g_Game.SetDatabaseID(dbID);
118 }
119
121
125 {
127 {
128 GetGame().GetInput().ResetActiveGamepad();
129 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE);
130 }
131 }
132
134
139 {
140 if (!user)
141 {
142 GetGame().GetInput().ResetActiveGamepad();
143 g_Game.GamepadCheck();
144 }
146 {
147 if (SelectUserEx(user))
148 {
149 if (GetGame().GetMission())
150 GetGame().GetMission().Reset();
152 g_Game.SelectUser(GetGame().GetInput().GetUserGamepad(user));
153 }
154 }
155 }
156
159 {
160 if (user && GetSelectedUser() == user)
161 g_Game.SelectUser(GetGame().GetInput().GetUserGamepad(user));
162 }
163
166 {
168 }
169
171
177 {
178
179 }
180
182
188 {
189 if (user == GetSelectedUser())
190 {
192 GetGame().GetInput().ResetActiveGamepad();
193 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE & ~DisconnectSessionFlags.SELECT_USER);
194 }
195 }
196
198
207 void OnJoin(EBiosJoinType type, BiosUser joiner, string handle, string joinee, EBiosError error)
208 {
210 {
212
215
216 if (g_Game.GetGameState() == DayZGameState.IN_GAME)
217 {
218 g_Game.SetLoadState(DayZLoadState.JOIN_START);
220 }
221 else
222 {
223 if (GetGame().GetUIManager() && GetGame().GetInput().IsActiveGamepadSelected())
224 {
225 GetGame().GetUIManager().CloseMenu(MENU_TITLE_SCREEN);
226 GetGame().GetInput().IdentifyGamepad(GamepadButton.BUTTON_NONE);
227 }
228 g_Game.SetLoadState(DayZLoadState.JOIN_START);
229 g_Game.GamepadCheck();
230 }
231 }
232 else
233 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_JOIN);
234 }
235
237
245 {
246#ifdef PLATFORM_PS4
247 if (host)
248#endif
249 {
251
252#ifdef PLATFORM_PS4
253 if (!host.IsOnline())
255#endif
256 }
257
258
259 if (GetGame().GetUIManager())
260 GetGame().GetUIManager().CloseMenu(MENU_TITLE_SCREEN);
261
263 if (g_Game.GetGameState() != DayZGameState.IN_GAME && g_Game.GetGameState() != DayZGameState.CONNECTING)
264 {
265 if (!GetGame().GetUIManager().GetMenu() || GetGame().GetUIManager().GetMenu().GetID() != MENU_MAIN)
266 GetGame().GetUIManager().EnterScriptedMenu(MENU_MAIN, GetGame().GetUIManager().GetMenu());
267 g_Game.SetGameState(DayZGameState.PARTY);
268 g_Game.SetLoadState(DayZLoadState.PARTY_START);
269 g_Game.GamepadCheck();
270 }
271 }
272
274
280 {
281 if (user == GetSelectedUser())
282 {
283 g_Game.SetPlayerName(user.GetName());
284#ifdef PLATFORM_CONSOLE
285 g_Game.SetPlayerGameName(user.GetName());
286#endif
287 if (GetGame().GetUIManager().GetMenu())
288 GetGame().GetUIManager().GetMenu().Refresh();
289 }
290 }
291
293 {
296 foreach (BiosUser user : user_list)
297 {
298 if (user.GetUid() == user_id)
299 return user;
300 }
301 return null;
302 }
303};
ActionInput GetInput()
Definition ActionBase.c:989
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:3528
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:517
NotificationType
DEPRECATED (moved into NotificationSystem)
BiosClientServices class provides individual online services.
proto native BiosClientServices GetClientServices()
proto native owned string GetName()
proto native bool IsOnline()
proto native owned string GetUid()
void OnUserPicked(BiosUser user, EBiosError error)
Callback function.
void OnLoggedOn(BiosUser user)
Callback function.
void OnSignedOut(BiosUser user)
Callback function.
void OnJoin(EBiosJoinType type, BiosUser joiner, string handle, string joinee, EBiosError error)
Callback function.
proto native EBiosError GetUserDatabaseIdAsync()
Call async function to get database ID.
proto native bool SelectUser(BiosUser user)
Informs the engine about the current selected user.
void OnGameNameChanged(BiosUser user)
Callback function.
void OnLoggedOff(BiosUser user)
Callback function.
proto native EBiosError GetUserList(array< ref BiosUser > user_list)
Gets the currently present list of users.
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
void OnUserDatabaseId(string dbID, EBiosError error)
Callback function.
proto native EBiosError ParseJoinAsync(string join_data)
Parse the join data from from command line parameters.
void OnSignedIn(BiosUser user)
Callback function.
void OnUserLoggedOn(EBiosError error)
Callback function.
proto native EBiosError PickUserAsync()
Display a system dependant account picket.
void OnPartyHost(BiosUser host, array< string > invitee_list, EBiosError error)
Callback function.
BiosUser GetUser(string user_id)
proto native EBiosError ParsePartyAsync(string party_data)
Parse the party data from from command line parameters.
proto native BiosUser GetTitleInitiator()
Gets the initiatior of the title.
proto native EBiosError LogOnUserAsync(BiosUser user)
Display a system dependant ui for log-on.
bool SelectUserEx(BiosUser user)
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
static void SetSessionHandle(string handle)
static void SetPendingInviteList(array< string > invitees)
static void GetSession()
static void SetBiosUser(BiosUser user)
static bool ErrorCaught(EBiosError error)
proto native CGame GetGame()
GamepadButton
Definition EnSystem.c:341
const int MENU_TITLE_SCREEN
Definition constants.c:186
const int MENU_MAIN
Definition constants.c:172