Changes on the Battle Commands networking

Discussion in 'Development General' started by coyotte508, Sep 9, 2011.

Thread Status:
Not open for further replies.
  1. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    This thread is for listing changes, if you want to comment on them go to this thread instead.
     
  2. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    * Adding spectator names when they join a battle, after their ID
    * Adding a bool argument being true if the boost message is silent, or false otherwise
     
    Last edited: Sep 9, 2011
  3. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    * Sendback has now an extra boolean silent argument. It will be set to true when Red Card or Roar/Whirlwhind/Dragon Tail/OverThrow is used. (Before it was just not sent)
     
  4. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    StatusChange, Fail, UseAttack now have an extra silent argument (boolean)
     
  5. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    New battle command: ChoiceMade. Basically takes a BattleChoice.

    <ChoiceMade: uchar><player: uchar>[<slot:uchar><type: uchar><?type==SwitchType <pokeSlot: char> ?><?type==AttackType <attackSlot: char><target: char> ?><?type==RearrangeType <slot0: char><slot: char><slot char><slot3: char><slot4: char><slot5: char> ?>]

    What's in [] is a BattleChoice (battlestructs.h)

    Types:
    Code (c++):
    1. enum ChoiceType {
    2.     CancelType,
    3.     AttackType,
    4.     SwitchType,
    5.     RearrangeType,
    6.     CenterMoveType,
    7.     DrawType
    8. };
    This command is not used by the server at the moment, but it could be used to remind a player of what choice he made. This command is basically only used for replays (to store what choice we made manually) for now.
     
    Last edited: Jul 13, 2012
  6. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I noticed that PO still used an older newtorking for BattleConfiguration:

    Code (C++):
    1. in >> this->gen >> this->mode >> this->ids[0] >> this->ids[1] >> this->clauses;
    This has now been fixed to match the new network protocol. Network Protocol hence went from version (0,0) to version (1,0). I'm planning to maybe add other features (like items list of items that can be used in battle) for this protocol version, though. Changes will be stopped when the next version officially comes out.

    Next server will read the client version and send the appropriate BattleConfiguration, so there won't be a compatibility break. The Rated command will eventually disappear, since the rated info is already given in the BattleConfiguration. If you decide to use protocol version 1,0, then it's advised to display the Rated/Clause info at the same time as the Mode info, and ignore the BattleCommand Rated (which will become deprecated). If you decide to use protocol 0,0, then so be it, but a day or another it won't be supported anymore...
     
  7. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Android client will need to be updated on two things:
    - battles now have a tier parameter
    - pokebattles now have a nature parameter before happiness
     
Thread Status:
Not open for further replies.