예제 #1
0
        private static void ProcessClientUserCommand(ServerClient client, BitStream message)
        {
            var         numCommands = message.ReadByte();
            var         commands    = new UserCommand[numCommands];
            UserCommand?lastCommand = null;

            for (int i = 0; i < numCommands; i++)
            {
                commands[i] = new UserCommand();
                commands[i].Deserialize(message, lastCommand);

                lastCommand = commands[i];
            }

            if (client.State != ServerClientState.Active && client.State != ServerClientState.Zombie)
            {
                client.InitializeEntity();
            }

            foreach (var command in commands)
            {
                client.ProcessCommand(command);
            }
        }
예제 #2
0
 public void ProcessCommand(UserCommand command)
 {
     Entity.Command = command;
     Entity.Think();
 }