Exemplo n.º 1
0
        public bool CreateLobby(HanksiteSession ownerSession, LobbySettings settings)
        {
            lock (syncObject)
            {
                if (lobbyManagers.Any(manager => manager.Name == settings.Name))
                {
                    return(false);
                }

                lobbyManagers.Add(LobbyManager.CreateLobbyManager(ownerSession, settings));
                return(true);
            }
        }
Exemplo n.º 2
0
        public LobbySettingsWithMembersSnapshot ConnectToLobby(HanksiteSession playerSession, string lobbyName)
        {
            lock (syncObject)
            {
                LobbyManager lobbyManager = lobbyManagers.SingleOrDefault(lobby => lobby.Name == lobbyName);
                if (lobbyManager == null)
                {
                    return(null);
                }

                if (!lobbyManager.ConnectPlayer(playerSession))
                {
                    return(null);
                }

                return(lobbyManager.Snapshot);
            }
        }
Exemplo n.º 3
0
 public void RemoveLobbyManager(LobbyManager lobbyManager)
 {
     LobbyManagerRepository.Instance.RemoveLobbyManager(lobbyManager);
 }
Exemplo n.º 4
0
 public ILobbyMember CreateLobbyMember(HanksiteSession session, LobbyManager lobbyManager)
 {
     return(new LobbyMember(session, lobbyManager));
 }