/// <summary> /// creates a wrapper around the core Session, which is able to convert the packet data used /// in the battlefield 3 protocol into normal bytes /// </summary> /// <param name="session"></param> /// <param name="server"> </param> public PacketSession(IRconSession session, Battlefield3Server server) { Session = session; Server = server; PacketSerializer = new PacketSerializer(); PacketSequence = new PacketSequence(); EventsSent = new List<Packet>(); // create the hash value for validating crypted password HashValue = Guid.NewGuid().ToString().Replace("-", string.Empty); this.CommandHandlersList = new CommandHandlersList(); this.CommandHandlersList.Add(new MapListCommandHandlers()); this.CommandHandlersList.Add(new BanListCommandHandlers()); this.CommandHandlersList.Add(new VarsCommandHandlers()); this.CommandHandlersList.Add(new ReservedSlotsListCommandHandlers()); this.CommandHandlersList.Add(new AdminCommandHandlers()); this.CommandHandlersList.Add(new NotAuthenticatedCommandHandlers(server.ServiceLocator)); this.ClientCommandReceived += CommandHandlersList.OnCommandReceived; this.ServerEventResponseReceived += OnServerEventResponseReceived; if (session != null) { Session.DataReceived += OnDataReceived; Session.DataSent += OnDataSent; Session.Closed += SessionOnClosed; } }
public ClientEventArgs(IRconSession session) { this.Session = session; }
public SessionEventArgs(IRconSession irConSession) { this.IrConSession = irConSession; }
public bool Equals(IRconSession other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Uid.Equals(Uid); }
private void InvokeClientConnected(IRconSession irConSession) { if (ClientConnected == null) return; ClientConnected.InvokeAll(this, new ClientEventArgs(irConSession)); }