/// <summary> /// Loads the player object /// </summary> public PlayerObject LoadMyPlayerObject() { LobbyConnection lobbyConnection = GetLobbyConnection().Join(); if (lobbyConnection != null) { PlayerObject playerObject = lobbyConnection.GetPlayerObject(); lobbyConnection.Disconnect(); return(playerObject); } return(null); }
/// <summary> /// Loads a profile /// </summary> /// <param name="username">The username</param> public Profile LoadProfile(string username) { LobbyConnection lobbyConnection = GetLobbyConnection().Join(); if (lobbyConnection != null) { Profile profile = lobbyConnection.GetProfile(username); lobbyConnection.Disconnect(); return(profile); } return(null); }
/// <summary> /// Creates a lobby connection /// </summary> /// <returns>The lobby connection</returns> internal Connection JoinLobby() { int currentVersion = GetGameVersion(); if (currentVersion == -1) { //Logged message will be from .GetGameVersion() if failed. return(null); } PlayerType currentPlayerType = GetConnectionType(ConnectionUserId); string lobbyRoomFormat = (currentPlayerType == PlayerType.Guest) ? m_Config.LobbyGuestRoom : m_Config.LobbyRoom; string lobbyRoom = string.Format(lobbyRoomFormat, currentVersion); LobbyConnection lobbyCon = new LobbyConnection(this); return(m_Client.Multiplayer.CreateJoinRoom(ConnectionUserId, lobbyRoom, true, null, null)); }