internal void InternalUnregisterPlayer(SteamPlayer player) { if (player == _localPlayer) { _localPlayer = null; } _players.Remove(player.id.uuid); _pendingAsyncPlayerGets.Remove(player.id.uuid); }
public void AsyncLogin(OnlinePlayerLoggedInDelegate callback) { if (_hticket == HAuthTicket.Invalid) { byte[] buff = new byte[1024]; uint len; _hticket = SteamUser.GetAuthSessionTicket(buff, buff.Length, out len); string ticket = System.BitConverter.ToString(buff, 0, (int)len); ticket = ticket.Replace("-", string.Empty); _localPlayer = new SteamLocalPlayer(this, ticket); GetFriends(EFriendFlags.k_EFriendFlagImmediate); #if !DEDICATED_SERVER && LOGIN_SERVER var connectLobby = Utils.GetCommandLineArg("+connect_lobby"); if (connectLobby != null) { uint lobbyID; if (uint.TryParse(connectLobby, out lobbyID)) { if (lobbyID != 0) { GameManager.instance.loginServer.pendingLobbyID = lobbyID; GameManager.instance.loginServer.pendingLobbyConnect = true; GameManager.instance.loginServer.pendingPassword = string.Empty; // password is set in LoginServerNetMsgDispatch Debug.Log("SteamServices: AsyncLogin passed connect_lobby=" + lobbyID); } } } #endif HookEvents(); callback(_localPlayer, null); } }