public virtual void RegisterPlayerCharacter(long connectionId, BasePlayerCharacterEntity playerCharacterEntity) { if (playerCharacterEntity == null || !ConnectionIds.Contains(connectionId) || playerCharacters.ContainsKey(connectionId)) { return; } playerCharacters[connectionId] = playerCharacterEntity; playerCharactersById[playerCharacterEntity.Id] = playerCharacterEntity; connectionIdsByCharacterName[playerCharacterEntity.CharacterName] = connectionId; }
public void AddConnectionId(string newConnectionId) { if (ConnectionIds.Count >= MaxConnectionsPerUser) { //SendErrorMessage("Too many connections to the website. Please make sure you are not using same tool in multiply tabs."); //return; ConnectionIds.RemoveFirst(); } if (!ConnectionIds.Contains(newConnectionId)) // only for low number of connection { ConnectionIds.AddLast(newConnectionId); } //_hub = GlobalHost.ConnectionManager.GetHubContext<SessionHub>(); SetGuiState(_worker != null ? 1 : 0, newConnectionId); UpdateLastActivityTime(); }