DayZ 1.24
Loading...
Searching...
No Matches
BiosUserManager Class Reference

Private Member Functions

proto native BiosUser GetTitleInitiator ()
 Gets the initiatior of the title.
 
proto native EBiosError GetUserList (array< ref BiosUser > user_list)
 Gets the currently present list of users.
 
proto native EBiosError LogOnUserAsync (BiosUser user)
 Display a system dependant ui for log-on.
 
proto native EBiosError PickUserAsync ()
 Display a system dependant account picket.
 
proto native EBiosError ParseJoinAsync (string join_data)
 Parse the join data from from command line parameters.
 
proto native EBiosError ParsePartyAsync (string party_data)
 Parse the party data from from command line parameters.
 
proto native bool SelectUser (BiosUser user)
 Informs the engine about the current selected user.
 
proto native BiosUser GetSelectedUser ()
 Returns the currently selected user.
 
proto native EBiosError GetUserDatabaseIdAsync ()
 Call async function to get database ID.
 
bool SelectUserEx (BiosUser user)
 
void OnUserDatabaseId (string dbID, EBiosError error)
 Callback function.
 
void OnUserLoggedOn (EBiosError error)
 Callback function.
 
void OnUserPicked (BiosUser user, EBiosError error)
 Callback function.
 
void OnLoggedOn (BiosUser user)
 Callback function.
 
void OnLoggedOff (BiosUser user)
 Callback function.
 
void OnSignedIn (BiosUser user)
 Callback function.
 
void OnSignedOut (BiosUser user)
 Callback function.
 
void OnJoin (EBiosJoinType type, BiosUser joiner, string handle, string joinee, EBiosError error)
 Callback function.
 
void OnPartyHost (BiosUser host, array< string > invitee_list, EBiosError error)
 Callback function.
 
void OnGameNameChanged (BiosUser user)
 Callback function.
 
BiosUser GetUser (string user_id)
 

Detailed Description

Definition at line 16 of file BiosUserManager.c.

Member Function Documentation

◆ GetSelectedUser()

proto native BiosUser BiosUserManager::GetSelectedUser ( )
private

Returns the currently selected user.

Returns
BiosUser the selected user. May be NULL.

Referenced by OnGameNameChanged(), OnLoggedOn(), OnSignedOut(), and SelectUserEx().

◆ GetTitleInitiator()

proto native BiosUser BiosUserManager::GetTitleInitiator ( )
private

Gets the initiatior of the title.

Returns
BiosUser the initiator. May be NULL.

◆ GetUser()

BiosUser BiosUserManager::GetUser ( string user_id)
inlineprivate

Definition at line 292 of file BiosUserManager.c.

293 {
296 foreach (BiosUser user : user_list)
297 {
298 if (user.GetUid() == user_id)
299 return user;
300 }
301 return null;
302 }
proto native EBiosError GetUserList(array< ref BiosUser > user_list)
Gets the currently present list of users.

References GetUserList().

◆ GetUserDatabaseIdAsync()

proto native EBiosError BiosUserManager::GetUserDatabaseIdAsync ( )
private

Call async function to get database ID.

Returns
EBiosError indicating if the async operation is pending. If active user is not set, then return NOT_FOUND

◆ GetUserList()

proto native EBiosError BiosUserManager::GetUserList ( array< ref BiosUser > user_list)
private

Gets the currently present list of users.

Fills in the array. Expected errors: BAD_PARAMETER - user_list is NULL,

Returns
EBiosError indicating if the operation is done.

Referenced by GetUser().

◆ LogOnUserAsync()

proto native EBiosError BiosUserManager::LogOnUserAsync ( BiosUser user)
private

Display a system dependant ui for log-on.

Referenced by OnPartyHost().

◆ OnGameNameChanged()

void BiosUserManager::OnGameNameChanged ( BiosUser user)
inlineprivate

Callback function.

Called when display info of a signed in user changed.

Parameters
userthe user affected by the change.

Definition at line 279 of file BiosUserManager.c.

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 }
DayZGame g_Game
Definition DayZGame.c:3528
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
proto native CGame GetGame()

References g_Game, GetGame(), and GetSelectedUser().

Referenced by OnUserPicked().

◆ OnJoin()

void BiosUserManager::OnJoin ( EBiosJoinType type,
BiosUser joiner,
string handle,
string joinee,
EBiosError error )
inlineprivate

Callback function.

Called when a join is parsed or when a runtime join is accepted from the system UI.

Parameters
typethe type of join. Undefined on error.
joinerthe user that is joining. NULL on error.
handlejoin handle for a session. Empty on error.
joineeuid of the user that is being joined. Empty on error.
errorindicating if parsing failed. OK if not a result of ParseJoinAsync.

Definition at line 207 of file BiosUserManager.c.

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 }
ActionInput GetInput()
Definition ActionBase.c:989
const int DISCONNECT_SESSION_FLAGS_JOIN
Definition DayZGame.c:14
bool SelectUserEx(BiosUser user)
static void SetSessionHandle(string handle)
static void GetSession()
static void SetBiosUser(BiosUser user)
static bool ErrorCaught(EBiosError error)
GamepadButton
Definition EnSystem.c:341
const int MENU_TITLE_SCREEN
Definition constants.c:186

References DISCONNECT_SESSION_FLAGS_JOIN, OnlineServices::ErrorCaught(), g_Game, GetGame(), GetInput(), OnlineServices::GetSession(), MENU_TITLE_SCREEN, SelectUserEx(), OnlineServices::SetBiosUser(), and OnlineServices::SetSessionHandle().

◆ OnLoggedOff()

void BiosUserManager::OnLoggedOff ( BiosUser user)
inlineprivate

Callback function.

Definition at line 165 of file BiosUserManager.c.

166 {
168 }
void OnSignedOut(BiosUser user)
Callback function.

References OnSignedOut().

◆ OnLoggedOn()

void BiosUserManager::OnLoggedOn ( BiosUser user)
inlineprivate

Callback function.

Definition at line 158 of file BiosUserManager.c.

159 {
160 if (user && GetSelectedUser() == user)
161 g_Game.SelectUser(GetGame().GetInput().GetUserGamepad(user));
162 }

References g_Game, GetGame(), GetInput(), and GetSelectedUser().

◆ OnPartyHost()

void BiosUserManager::OnPartyHost ( BiosUser host,
array< string > invitee_list,
EBiosError error )
inlineprivate

Callback function.

Called when a party is parsed or when a party is hosted from the system UI.

Parameters
hostthe user that is hosting the party. NULL on error.
invitee_listlist of party members.
errorindicating if parsing failed. OK if not a result of ParsePartyAsync.

Definition at line 244 of file BiosUserManager.c.

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 }
int GetID()
Get the ID registered in SEffectManager.
Definition Effect.c:517
proto native EBiosError LogOnUserAsync(BiosUser user)
Display a system dependant ui for log-on.
static void SetPendingInviteList(array< string > invitees)
const int MENU_MAIN
Definition constants.c:172

References g_Game, GetGame(), GetID(), LogOnUserAsync(), MENU_MAIN, MENU_TITLE_SCREEN, SelectUserEx(), and OnlineServices::SetPendingInviteList().

◆ OnSignedIn()

void BiosUserManager::OnSignedIn ( BiosUser user)
inlineprivate

Callback function.

Called when a new user signed in

Parameters
userthe user that signed in. Cannot be NULL.

Definition at line 176 of file BiosUserManager.c.

177 {
178
179 }

◆ OnSignedOut()

void BiosUserManager::OnSignedOut ( BiosUser user)
inlineprivate

Callback function.

Called when a new user signed out

Parameters
userthe user that signed out. Cannot be NULL.

Definition at line 187 of file BiosUserManager.c.

188 {
189 if (user == GetSelectedUser())
190 {
192 GetGame().GetInput().ResetActiveGamepad();
193 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE & ~DisconnectSessionFlags.SELECT_USER);
194 }
195 }
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
DisconnectSessionFlags
Definition DayZGame.c:2

References DISCONNECT_SESSION_FLAGS_FORCE, g_Game, GetGame(), GetSelectedUser(), and SelectUserEx().

Referenced by OnLoggedOff().

◆ OnUserDatabaseId()

void BiosUserManager::OnUserDatabaseId ( string dbID,
EBiosError error )
inlineprivate

Callback function.

Parameters
dbIDuser database ID. If something went wrong, then it is empty string.
errorindicating correct state.

Definition at line 114 of file BiosUserManager.c.

115 {
117 g_Game.SetDatabaseID(dbID);
118 }

References OnlineServices::ErrorCaught(), and g_Game.

◆ OnUserLoggedOn()

void BiosUserManager::OnUserLoggedOn ( EBiosError error)
inlineprivate

Callback function.

Parameters
errorerror indicating success or fail of the async operation.

Definition at line 124 of file BiosUserManager.c.

125 {
127 {
128 GetGame().GetInput().ResetActiveGamepad();
129 g_Game.DisconnectSessionEx(DISCONNECT_SESSION_FLAGS_FORCE);
130 }
131 }

References DISCONNECT_SESSION_FLAGS_FORCE, OnlineServices::ErrorCaught(), g_Game, and GetGame().

◆ OnUserPicked()

void BiosUserManager::OnUserPicked ( BiosUser user,
EBiosError error )
inlineprivate

Callback function.

Parameters
userpicked user. NULL on fail.
errorerror indicating success or fail of the async operation.

Definition at line 138 of file BiosUserManager.c.

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 }
void OnGameNameChanged(BiosUser user)
Callback function.

References OnlineServices::ErrorCaught(), g_Game, GetGame(), GetInput(), OnGameNameChanged(), and SelectUserEx().

◆ ParseJoinAsync()

proto native EBiosError BiosUserManager::ParseJoinAsync ( string join_data)
private

Parse the join data from from command line parameters.

The async result is returned in the OnJoin callback. The OnJoin callback is called also during runtime when a join is accepted. Expected errors: BAD_PARAMETER - join_data could not be parsed,

Parameters
join_datathe startup join data from command line parameters.
Returns
EBiosError indicating if the async operation is pending.

◆ ParsePartyAsync()

proto native EBiosError BiosUserManager::ParsePartyAsync ( string party_data)
private

Parse the party data from from command line parameters.

The async result is returned in the OnPartyHost callback. The OnPartyHost callback is called also during runtime when a player hosts a game for the party. Expected errors: BAD_PARAMETER - join_data could not be parsed,

Parameters
party_datathe startup party data from command line parameters.
Returns
EBiosError indicating if the async operation is pending.

◆ PickUserAsync()

proto native EBiosError BiosUserManager::PickUserAsync ( )
private

Display a system dependant account picket.

Xbox: The async result is returned in the OnUserPicked callback.

Returns
EBiosError indicating if the async operation is pending.

◆ SelectUser()

proto native bool BiosUserManager::SelectUser ( BiosUser user)
private

Informs the engine about the current selected user.

Must be called to ensure proper authentication etc.

Parameters
userthe user to select.

Referenced by SelectUserEx().

◆ SelectUserEx()

bool BiosUserManager::SelectUserEx ( BiosUser user)
inlineprivate

Definition at line 90 of file BiosUserManager.c.

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 }
NotificationType
DEPRECATED (moved into NotificationSystem)
proto native bool SelectUser(BiosUser user)
Informs the engine about the current selected user.
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.

References NotificationSystem::AddNotification(), NotificationSystem::DEFAULT_TIME_DISPLAYED, DISCONNECT_SESSION_FLAGS_FORCE, g_Game, GetSelectedUser(), and SelectUser().

Referenced by OnJoin(), OnPartyHost(), OnSignedOut(), and OnUserPicked().


The documentation for this class was generated from the following file: