public Client( IGameUnitOfWorkFactory gameUnitOfWorkFactory, ICharacterManager characterManager, ClientPacketHandler handler) { _gameUnitOfWorkFactory = gameUnitOfWorkFactory; _characterManager = characterManager; _handler = handler; _handler.RegisterClient(this); }
public Client( IGameUnitOfWorkFactory gameUnitOfWorkFactory, ICharacterManager characterManager, ClientPacketHandler handler) { _gameUnitOfWorkFactory = gameUnitOfWorkFactory; _characterManager = characterManager; inboundData = BufferManager.RequestBuffer(); inboundData.Length = 0; _handler = handler; _handler.RegisterClient(this); }
public Client(LengthedSocket socket, ClientCryptData data, Server server) { _handler = new ClientPacketHandler(this); Socket = socket; Data = data; Server = server; State = ClientState.Connected; Socket.OnError += OnError; Socket.OnReceive += OnReceive; Socket.OnEncrypt += OnEncrypt; Socket.OnDecrypt += OnDecrypt; Socket.ReceiveAsync(); for (var i = 0; i < 256; ++i) { SendSequence[i] = 1; } Logger.WriteLog(LogType.Network, "*** Client connected from {0}", Socket.RemoteAddress); }