Пример #1
0
        /// <summary>
        /// Handles Disconnected events of all connected clients.
        /// </summary>
        /// <param name="sender">Source of event</param>
        /// <param name="e">Event arguments</param>
        private void Client_Disconnected(object sender, EventArgs e)
        {
            var client = (IScsServerClient)sender;

            Clients.Remove(client.ClientId);
            OnClientDisconnected(client);
        }
Пример #2
0
        private void ClientDisconnected(object sender, EventArgs e)
        {
            var client = sender as IScsServiceClient;

            if (client == null)
            {
                return;
            }
            if (!Clients.GetAllItems().Exists(oo => oo.IndexInAdminList == client.ClientId))
            {
                return;
            }
            var index = Clients[client.ClientId].IndexInAdminList;

            Task.Factory.StartNew(delegate
            {
                OnClientCrashed(Clients[index].UserName);
                Clients.Remove(index);
            });
        }
Пример #3
0
        /// <summary>
        ///     Handles ClientDisconnected event of _zcfServer object.
        /// </summary>
        /// <param name="sender">Source of event</param>
        /// <param name="e">Event arguments</param>
        private void ZcfServerClientDisconnected(object sender, ServerClientEventArgs e)
        {
            var serviceClient = _serviceClients[e.Client.ClientId];

            if (serviceClient == null)
            {
                return;
            }

            _serviceClients.Remove(e.Client.ClientId);
            OnClientDisconnected(serviceClient);
        }
Пример #4
0
        public virtual void UnregisterSession(long characterId)
        {
            // Get client from client list, if not in list do not continue
            var session = _sessions[characterId];

            if (session == null)
            {
                return;
            }

            // Remove client from online clients list
            _sessions.Remove(characterId);

            LastUnregister = DateTime.Now;
        }
Пример #5
0
        public void UnregisterSession(long characterId)
        {
            // Get client from client list, if not in list do not continue
            var session = _sessions[characterId];
            if (session == null)
            {
                return;
            }

            // Remove client from online clients list
            _sessions.Remove(characterId);
            if (session.HasCurrentMapInstance && _sessions.Count == 0)
            {
                session.CurrentMapInstance.IsSleeping = true;
            }
            LastUnregister = DateTime.Now;
        }
        private void ClientLogout(long clientId)
        {
            var client = _clients[clientId];

            if (client == null)
            {
                return;
            }

            _clients.Remove(client.Client.ClientId);

            client.Client.Disconnected -= Client_Disconnected;

            Task.Factory.StartNew(
                () =>
            {
                OnModuleListChanged();
                SendUserLogoutInfoToAllClients(client.User.Name);
            });
        }
Пример #7
0
 public void RemoveNpc(MapNpc npcToRemove) => _npcs.Remove(npcToRemove.MapNpcId);
Пример #8
0
 public void RemoveMonster(MapMonster monsterToRemove) => _monsters.Remove(monsterToRemove.MapMonsterId);
Пример #9
0
 public void RemoveDelayedMonster(MapMonster monsterToRemove) => _delayedMonsters.Remove(monsterToRemove.MapMonsterId);
Пример #10
0
 public void LeaveGroup(ClientSession session)
 {
     session.Character.Group = null;
     _characters.Remove(session.Character.CharacterId);
 }
Пример #11
0
 private void RemoveGroup(Group grp)
 {
     _groups.Remove(grp.GroupId);
 }
 private void RemoveRaid(Raid raid)
 {
     _raids.Remove(raid.RaidId);
 }
Пример #13
0
 public void KickPlayerFromRaid(ClientSession session)
 {
     session.Character.Raid = null;
     _characters.Remove(session.Character.CharacterId);
 }
Пример #14
0
 private void ClientDisconnected(object sender, EventArgs e)
 {
     Authed.Remove(((IScsServiceClient)sender).ClientId);
     Log.Info("InformerService: Client disconnected...");
 }
Пример #15
0
 /// <summary>
 ///     Removes a previously added service object from this service application.
 ///     It removes object according to interface type.
 /// </summary>
 /// <typeparam name="TServiceInterface">Service interface type</typeparam>
 /// <returns>True: removed. False: no service object with this interface</returns>
 public bool RemoveService <TServiceInterface>()
     where TServiceInterface : class
 {
     return(_serviceObjects.Remove(typeof(TServiceInterface).Name));
 }