public static void ChangeCharacterRequest(int fromClient, Packet packet)
        {
            int characterHero  = packet.ReadInt();
            int sequenceNumber = packet.ReadInt();
            CharacterChangeCommand characterChangeCommand = new CharacterChangeCommand(sequenceNumber, characterHero);

            Server.clients[fromClient].serverMasterController.AccumulateChangeCharacterCommandToBePlayedOnServerFromClient(characterChangeCommand);
        }
Пример #2
0
 public static void ChangeCharacter(CharacterChangeCommand characterChangeCommand)
 {
     using (Packet packet = new Packet((int)ClientPackets.characterChangeCommand))
     {
         packet.Write(characterChangeCommand.characterHero);
         packet.Write(characterChangeCommand.sequenceNoCharacterChangeCommand);
         SendTCPData(packet);
     }
 }
Пример #3
0
        public void ChangeCharacter(string hero)
        {
            EnumData.Heroes heroEnum = (EnumData.Heroes)Enum.Parse(typeof(EnumData.Heroes), hero);

            if (clientlocalActor != null)
            {
                if (heroEnum != (EnumData.Heroes)clientlocalActor.hero)
                {
                    CharacterChangeCommand characterChangeCommand = new CharacterChangeCommand(clientlocalActor.GetLocalSequenceNo(), (int)heroEnum);
                    ClientSend.ChangeCharacter(characterChangeCommand);
                }
                else
                {
                    Debug.Log("Cant change character");
                }
            }
        }