Exemple #1
0
        public Client(
            IGameUnitOfWorkFactory gameUnitOfWorkFactory,
            ICharacterManager characterManager,
            ClientPacketHandler handler)
        {
            _gameUnitOfWorkFactory = gameUnitOfWorkFactory;
            _characterManager      = characterManager;

            _handler = handler;
            _handler.RegisterClient(this);
        }
Exemple #2
0
        public Client(
            IGameUnitOfWorkFactory gameUnitOfWorkFactory,
            ICharacterManager characterManager,
            ClientPacketHandler handler)
        {
            _gameUnitOfWorkFactory = gameUnitOfWorkFactory;
            _characterManager      = characterManager;

            inboundData        = BufferManager.RequestBuffer();
            inboundData.Length = 0;

            _handler = handler;
            _handler.RegisterClient(this);
        }
Exemple #3
0
        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);
        }