private PlayerDispatcher PlayerDispatcher; // player functions public Connection(TcpClient socket) { Socket = socket; IPAddress = ((IPEndPoint)socket.Client.RemoteEndPoint).Address; Port = ((IPEndPoint)socket.Client.RemoteEndPoint).Port; Stats = new Stats(); Equipment = new Equipment(); ResponseStack = new Stack <string>(); MessageReceivedDone = new ManualResetEvent(false); MessageSentDone = new ManualResetEvent(false); State = new StateObject((socket)); LoginDispatcher = new LoginDispatcher(this); StartReceiving(); }
private PlayerDispatcher PlayerDispatcher; // player functions #endregion Fields #region Constructors public Connection(TcpClient socket) { Socket = socket; IPAddress = ((IPEndPoint)socket.Client.RemoteEndPoint).Address; Port = ((IPEndPoint)socket.Client.RemoteEndPoint).Port; Stats = new Stats(); Equipment = new Equipment(); ResponseStack = new Stack<string>(); MessageReceivedDone = new ManualResetEvent(false); MessageSentDone = new ManualResetEvent(false); State = new StateObject((socket)); LoginDispatcher = new LoginDispatcher(this); StartReceiving(); }
public void StartPlayer() { LoginDispatcher = null; PlayerDispatcher = new PlayerDispatcher(this); Commands = PlayerDispatcher.OnPlayerMessageReceived; SystemEventPacket packet = new SystemEventPacket(EventType.login, this.Name + " has entered the world.", this); Common.Settings.SystemEventQueue.Push(packet); if (Room == null) { SetRoom(null); } Room.AddPlayer(this); }
public void StartPlayer() { LoginDispatcher = null; PlayerDispatcher = new PlayerDispatcher(this); Commands = PlayerDispatcher.OnPlayerMessageReceived; SystemEventPacket packet = new SystemEventPacket(EventType.login, this.Name + " has entered the world.", this); Common.Settings.SystemEventQueue.Push(packet); if (Room == null) SetRoom(null); Room.AddPlayer(this); }