internal ClientManager() { this.ClientsBySocketId = new ClientSessionCollection(this.OnDisconnect); this.ClientsByUserId = new ConcurrentDictionary <uint, ClientSession>(); this.LastPingCheckTimer = new Timer(this.CheckForTimedoutConnections, null, 2500, 2500); }
internal MatchListing(ClientSession creator, LevelData levelData, string name, uint minRank, uint maxRank, uint maxMembers, bool onlyFriends) { this._Clients = new ClientSessionCollection(this.OnDisconnect); this.LobbyClients = new ClientSessionCollection(); this.BannedClients = new ConcurrentBag<IUserIdentifier>(); this.LevelData = levelData; this.Name = name; this.MinRank = minRank; this.MaxRank = maxRank; this.MaxMembers = maxMembers; this.OnlyFriends = onlyFriends; this._HostSocketId = creator.SocketId; this._SpotsLeft = (int)maxMembers; creator.OnDisconnect += this.OnCreatorDisconnectEarly; if (creator.Disconnected) { this.OnCreatorDisconnectEarly(); } }
internal MatchListing(MatchListingManager matchListingManager, MatchManager matchManager, MatchListingType type, ClientSession creator, LevelData levelData, string name, uint minRank, uint maxRank, uint maxMembers, bool onlyFriends) { this.matchListingManager = matchListingManager; this.matchManager = matchManager; this._Clients = new ClientSessionCollectionLimited((int)maxMembers, this.Leave0); this.LobbyClients = new ClientSessionCollection(); this.BannedClients = new ConcurrentBag <IUserIdentifier>(); this.LevelData = levelData; this.Name = name; this.MinRank = minRank; this.MaxRank = maxRank; this.MaxMembers = maxMembers; this.OnlyFriends = onlyFriends; this.Type = type; if (creator != null) { this._HostSocketId = creator.SocketId; creator.Connection.OnDisconnected += this.OnCreatorDisconnectEarly; } }
public ClientManager() { this.ClientsBySocketId = new ClientSessionCollection(this.OnAdded, this.OnRemoved); this.ClientsByUserId = new ConcurrentDictionary <uint, ClientSession>(); _ = this.CheckForTimedOutConnections(); }
public MatchListingManager(MatchManager matchManager) { this.matchManager = matchManager; this.MatchListings = new ConcurrentDictionary <string, MatchListing>(); this.QuickJoinClients = new ClientSessionCollection(); }
internal ChatRoom(ChatRoomType type, uint creatorUserId, string name, string pass, string note) { this.Clients = new ClientSessionCollection(removeCallback: this.Leave0); this.BannedClients = new ConcurrentBag <IUserIdentifier>(); this.RecentMessages = new ConcurrentQueue <ChatOutgoingMessage>(); this.CreatorUserId = creatorUserId; this.Type = type; this.Name = name; this.Pass = pass; this.Note = note; }
internal ChatRoom(ChatRoomType type, uint creatorUserId, string name, string pass, string note, params ClientSession[] clientSessions) { this.Clients = new ClientSessionCollection(this.OnDisconnect); this.BannedClients = new ConcurrentBag <IUserIdentifier>(); this.RecentMessages = new ConcurrentQueue <ChatOutgoingMessage>(); this.CreatorUserId = creatorUserId; this.Type = type; this.Name = name; this.Pass = pass; this.Note = note; foreach (ClientSession session in clientSessions) { this.Join(session); } }
internal MultiplayerMatch(string name, LevelData levelData) { this.Status = MultiplayerMatchStatus.PreparingForStart; this.ReservedFor = new ClientSessionCollection(this.OnReservedDisconnect); this.Clients = new ClientSessionCollection(this.OnDisconnect); this.DrawingUsers = new HashSet <uint>(); this.Players = new ConcurrentDictionary <uint, MatchPlayer>(); this.PlayerOrderKeeper = new Queue <MatchPlayer>(); this.Name = name; this.LevelData = levelData; this.NextHatId = 0; this.DroppedHats = new ConcurrentDictionary <uint, MatchPlayerHat>(); this.FinishBlocks = new HashSet <Point>(); }
internal MatchListingManager() { this.MatchListings = new ConcurrentDictionary <string, MatchListing>(); this.QuickJoinClients = new ClientSessionCollection(); }