Пример #1
0
 private void client_LayerClientLogin(ILayerClient sender)
 {
     foreach (ILayerClient client in new List <ILayerClient>(this.Clients.Values))
     {
         client.SendAccountLogin(sender.Username, sender.Privileges);
     }
 }
Пример #2
0
 private void client_UidRegistered(ILayerClient sender)
 {
     foreach (ILayerClient client in new List <ILayerClient>(this.Clients.Values))
     {
         client.SendRegisteredUid(sender.ProconEventsUid, sender.Username);
     }
 }
Пример #3
0
 private void client_LayerClientQuit(ILayerClient sender)
 {
     if (this.Clients.ContainsKey(sender.IPPort) == true)
     {
         this.Clients.Remove(sender.IPPort);
         this.BroadcastAccountLogout(sender.Username);
     }
 }
Пример #4
0
 private void PRoConLayer_ClientConnected(ILayerClient sender)
 {
     sender.Login          += client_LayerClientLogin;
     sender.Logout         += client_LayerClientLogout;
     sender.Quit           += client_LayerClientQuit;
     sender.ClientShutdown += client_LayerClientShutdown;
     sender.UidRegistered  += client_UidRegistered;
 }
Пример #5
0
        protected void OnClientConnected(ILayerClient client)
        {
            var handler = this.ClientConnected;

            if (handler != null)
            {
                handler(client);
            }
        }
Пример #6
0
 private void Layer_LayerClientLogout(ILayerClient sender)
 {
     this.InvokeIfRequired(() => {
         if (this.lsvLayerAccounts.Items.ContainsKey(sender.Username) == true)
         {
             this.lsvLayerAccounts.Items[sender.Username].ImageKey = @"status_offline.png";
         }
     });
 }
Пример #7
0
        private void client_LayerClientShutdown(ILayerClient sender)
        {
            sender.Login          -= client_LayerClientLogin;
            sender.Logout         -= client_LayerClientLogout;
            sender.Quit           -= client_LayerClientQuit;
            sender.ClientShutdown -= client_LayerClientShutdown;
            sender.UidRegistered  -= client_UidRegistered;

            this.Clients.Remove(sender.IPPort);

            this.BroadcastAccountLogout(sender.Username);
        }
Пример #8
0
 private void client_LayerClientLogout(ILayerClient sender)
 {
     this.BroadcastAccountLogout(sender.Username);
 }
Пример #9
0
 private void Layer_ClientConnected(ILayerClient client) {
     client.Login += Layer_LayerClientLogin;
     client.Logout += Layer_LayerClientLogout;
 }
Пример #10
0
 private void client_LayerClientLogin(ILayerClient sender) {
     foreach (ILayerClient client in new List<ILayerClient>(this.Clients.Values)) {
         client.SendAccountLogin(sender.Username, sender.Privileges);
     }
 }
Пример #11
0
 private void client_LayerClientLogout(ILayerClient sender) {
     this.BroadcastAccountLogout(sender.Username);
 }
Пример #12
0
 private void client_LayerClientQuit(ILayerClient sender) {
     if (this.Clients.ContainsKey(sender.IPPort) == true) {
         this.Clients.Remove(sender.IPPort);
         this.BroadcastAccountLogout(sender.Username);
     }
 }
Пример #13
0
        private void client_LayerClientShutdown(ILayerClient sender) {
            sender.Login -= client_LayerClientLogin;
            sender.Logout -= client_LayerClientLogout;
            sender.Quit -= client_LayerClientQuit;
            sender.ClientShutdown -= client_LayerClientShutdown;
            sender.UidRegistered -= client_UidRegistered;

            this.Clients.Remove(sender.IPPort);

            this.BroadcastAccountLogout(sender.Username);
        }
Пример #14
0
 private void PRoConLayer_ClientConnected(ILayerClient sender) {
     sender.Login += client_LayerClientLogin;
     sender.Logout += client_LayerClientLogout;
     sender.Quit += client_LayerClientQuit;
     sender.ClientShutdown += client_LayerClientShutdown;
     sender.UidRegistered += client_UidRegistered;
 }
Пример #15
0
 protected void OnClientConnected(ILayerClient client) {
     var handler = this.ClientConnected;
     if (handler != null) {
         handler(client);
     }
 }
Пример #16
0
 void Layer_ClientConnected(ILayerClient client)
 {
     client.Login  += Layer_LayerClientLogin;
     client.Logout += Layer_LayerClientLogout;
 }
Пример #17
0
 private void client_UidRegistered(ILayerClient sender) {
     foreach (ILayerClient client in new List<ILayerClient>(this.Clients.Values)) {
         client.SendRegisteredUid(sender.ProconEventsUid, sender.Username);
     }
 }
Пример #18
0
        public void SendProconLayerPacket(ILayerClient sender, Packet cpPassOn) {
            lock (new object()) {
                UInt32 ui32MainConnSequence = Game.Connection.AcquireSequenceNumber;

                if (m_dicForwardedPackets.ContainsKey(ui32MainConnSequence) == false) {
                    var spopForwardedPacket = new SOriginalForwardedPacket();
                    spopForwardedPacket.m_ui32OriginalSequence = cpPassOn.SequenceNumber;
                    spopForwardedPacket.m_sender = sender;
                    spopForwardedPacket.m_lstWords = new List<string>(cpPassOn.Words);

                    // Register the packet as forwared. 
                    m_dicForwardedPackets.Add(ui32MainConnSequence, spopForwardedPacket);

                    if (cpPassOn.Words.Count >= 5 && String.Compare(cpPassOn.Words[0], "procon.admin.yell") == 0) {
                        if (IsPRoConConnection == false) {
                            if (Game is MOHWClient) {
                                cpPassOn.Words.RemoveAt(3);
                            }
                            // Just yell it, we'll capture it and process the return in OnBeforePacketRecv
                            cpPassOn.Words.RemoveAt(1);
                            cpPassOn.Words[0] = "admin.yell";
                        }
                        // Else forward the packet as is so the layer above can append its username.
                    }
                    else if (cpPassOn.Words.Count >= 4 && String.Compare(cpPassOn.Words[0], "procon.admin.say") == 0) {
                        if (IsPRoConConnection == false) {
                            // Just yell it, we'll capture it and process the return in OnBeforePacketRecv
                            cpPassOn.Words.RemoveAt(1);
                            cpPassOn.Words[0] = "admin.say";
                        }
                        // Else forward the packet as is so the layer above can append its username.
                    }

                    // Now forward the packet.
                    SendPacket(new Packet(false, false, ui32MainConnSequence, cpPassOn.Words));
                }
            }
        }
Пример #19
0
 private void Layer_LayerClientLogin(ILayerClient sender) {
     InvokeOnAllEnabled("OnAccountLogin", sender.Username, sender.IPPort, sender.Privileges);
 }
Пример #20
0
 private void Layer_LayerClientLogout(ILayerClient sender) {
     this.InvokeIfRequired(() => {
         if (this.lsvLayerAccounts.Items.ContainsKey(sender.Username) == true) {
             this.lsvLayerAccounts.Items[sender.Username].ImageKey = @"status_offline.png";
         }
     });
 }