private void client_LayerClientLogin(ILayerClient sender) { foreach (ILayerClient client in new List <ILayerClient>(this.Clients.Values)) { client.SendAccountLogin(sender.Username, sender.Privileges); } }
private void client_UidRegistered(ILayerClient sender) { foreach (ILayerClient client in new List <ILayerClient>(this.Clients.Values)) { client.SendRegisteredUid(sender.ProconEventsUid, sender.Username); } }
private void client_LayerClientQuit(ILayerClient sender) { if (this.Clients.ContainsKey(sender.IPPort) == true) { this.Clients.Remove(sender.IPPort); this.BroadcastAccountLogout(sender.Username); } }
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; }
protected void OnClientConnected(ILayerClient client) { var handler = this.ClientConnected; if (handler != null) { handler(client); } }
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"; } }); }
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); }
private void client_LayerClientLogout(ILayerClient sender) { this.BroadcastAccountLogout(sender.Username); }
private void Layer_ClientConnected(ILayerClient client) { client.Login += Layer_LayerClientLogin; client.Logout += Layer_LayerClientLogout; }
private void client_LayerClientLogin(ILayerClient sender) { foreach (ILayerClient client in new List<ILayerClient>(this.Clients.Values)) { client.SendAccountLogin(sender.Username, sender.Privileges); } }
void Layer_ClientConnected(ILayerClient client) { client.Login += Layer_LayerClientLogin; client.Logout += Layer_LayerClientLogout; }
private void client_UidRegistered(ILayerClient sender) { foreach (ILayerClient client in new List<ILayerClient>(this.Clients.Values)) { client.SendRegisteredUid(sender.ProconEventsUid, sender.Username); } }
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)); } } }
private void Layer_LayerClientLogin(ILayerClient sender) { InvokeOnAllEnabled("OnAccountLogin", sender.Username, sender.IPPort, sender.Privileges); }