Exemplo n.º 1
0
        public void SingleStep()
        {
            EndPoint sender = transport.CreateEndPoint();

            byte[] data = transport.Recv(256, ref sender);
            if (data != null)
            {
                Array.Reverse(data);
                transport.Send(data, sender);
            }
        }
Exemplo n.º 2
0
        public void SingleStep()
        {
            EndPoint sender = transport.CreateEndPoint();

            byte[] data = transport.Recv(256, ref sender);
            if (data != null)
            {
                byte command = data[0];
                if (commandsTable.ContainsKey(command))
                {
                    commandsTable[command](data, sender);
                }
            }
        }
Exemplo n.º 3
0
        public void Update()
        {
            EndPoint sender = transport.CreateEndPoint();

            byte[] data = transport.Recv(256, ref sender);

            if (data != null)
            {
                string message = ConvertBytesToString(data);
                string invMess = Reverse(message);

                byte[] invData = ConvertStringToBytes(invMess);
            }
        }
        public void SingleStep()
        {
            EndPoint sender = transport.CreateEndPoint();

            byte[] data = transport.Recv(256, ref sender);

            if (data != null)
            {
                byte gameCommand = data[0];
                if (commandsTable.ContainsKey(gameCommand))
                {
                    commandsTable[gameCommand](data, sender);
                }
                else
                {
                    throw new ServerException("Invalid GameCommand");
                }
            }
        }
Exemplo n.º 5
0
        //Dispatcher that recive packet and call every right command
        //TODO
        //Add Malus To Client who try to send empty packet

        public void SingleStep()
        {
            //if Game in a room is starting do this
            foreach (Room room in Rooms)
            {
                room.Process();
            }


            EndPoint sender = transport.CreateEndPoint();

            byte[] data = transport.Recv(256, ref sender);

            if (data == null)
            {
                return;
            }

            commands[data[0]](data, sender);
        }