Difference between revisions of "MultiplayerServerWML"

From The Battle for Wesnoth Wiki
m (Updating the lobby state)
(Updating the lobby state: major correction - now it should reflect reality :-))
Line 53: Line 53:
  
 
* server message - basically a diff from two [gamelist]s
 
* server message - basically a diff from two [gamelist]s
** '''[gamelist_diff]'''
+
** '''[gamelist_diff]''' Something happened.
*** '''[insert_child]''' or '''[delete_child]'''
+
*** ''index'' The index of a user (or game?).
**** ''index'' Index of the child (game or user).
+
*** '''[insert_child]''' or '''[delete_child]''' A new user (or game?) is added.
**** '''[gamelist]''' or '''[user]''' (repeated) Same tags/keys as above in [gamelist] and [user] possible
+
**** '''[user]'''
*** '''[change_child]''' Same tags as above in [gamelist] possible
+
***** ''name'' The name of the user.
**** ''index'' Index of the child (game or user).
+
**** '''[gamelist]''' (?)
**** '''[insert]''' or '''[delete]''' Same keys as above in [game] possible
+
*** '''[change_child]''' Something changed in the game or user list.
**** '''[gamelist]''' or '''[user]''' (repeated)
+
**** '''[user]''' (repeated?)
***** '''[change_child]''' Same tags as above in [gamelist] possible
+
***** '''[insert]''' or '''[delete]''' Same keys as above
****** '''[game]'''
+
****** ''available'' "yes" when the user left a game. "no" when the user joined a game
******* '''[insert]''' or '''[delete]''' Same keys as above in [game] possible
+
****** ''location'' The name of the game the user joined or 'x' when a game was left.
***** '''[insert_child]''' Same tags as above in [gamelist] possible
+
**** '''[gamelist]'''
 +
***** ''index'' Index of the game in question.
 +
***** '''[insert_child]''' or '''[delete_child]''' or '''[change_child]''' A game was created or ended or something changed in it.
 +
****** '''[game]''' Same keys as above possible
  
 
* server message - players joining([observer_quit])/quitting([observer] a game
 
* server message - players joining([observer_quit])/quitting([observer] a game

Revision as of 06:09, 20 July 2007

Multiplayer Server WML

This page describes the WML used to communicate with the multiplayer server (wesnothd).

The login procedure

  • server request (optional)
    • [version]
  • client response
    • [version]
      • version The client's version string.
  • server request
    • [mustlogin]
  • client response
    • [login]
      • username The username the client would like to have.
  • server response
    • [join_lobby]
  • server response
    • [gamelist]
      • [game]
        • mp_use_map_settings Does the game use the map settings specified in the scenario.
        • mp_fog Does the game use fog.
        • mp_shroud Does the game use shroud.
        • mp_countdown Does the game use a timer.
        • observer Are observers allowed or not.
        • map_data The map data.
        • experience_modifier The experience setting.
        • turn The current turn/max turn.
        • id The id of the game.
        • mp_countdown_reservoir_time
        • mp_village_gold The number of gold per village.
        • mp_countdown_init_time
        • mp_era The id of the used era.
        • mp_countdown_action_bonus
        • mp_countdown_turn_bonus
        • name The title of the game.
        • human_sides The number of sides played by humans.
        • hash The hash value of the map_data.
        • mp_scenario The id of the scenario.
        • slots The number of vacant/max slots.
    • [user]
      • name The username of the player.
      • location The name of the game the player is in.
      • available "yes" if the player is in the lobby; "no" if in a game.

Many of these keys are described more indepth on the ScenarioWML page.

Updating the lobby state

  • server message - basically a diff from two [gamelist]s
    • [gamelist_diff] Something happened.
      • index The index of a user (or game?).
      • [insert_child] or [delete_child] A new user (or game?) is added.
        • [user]
          • name The name of the user.
        • [gamelist] (?)
      • [change_child] Something changed in the game or user list.
        • [user] (repeated?)
          • [insert] or [delete] Same keys as above
            • available "yes" when the user left a game. "no" when the user joined a game
            • location The name of the game the user joined or 'x' when a game was left.
        • [gamelist]
          • index Index of the game in question.
          • [insert_child] or [delete_child] or [change_child] A game was created or ended or something changed in it.
            • [game] Same keys as above possible
  • server message - players joining([observer_quit])/quitting([observer] a game
    • [observer] or [observer_quit]
      • name Username of the player/observer.

Game creation

To create a game the client sends:

  • [create_game]
    • name The title of the game.
    • human_sides The number of sides played by humans.

followed by a message with the scenario options as under [game] (see above) plus the scenario data ([time], [era], [side], etc. see ScenarioWML)

  • [join]
    • id The id of the game.
    • observe Join the game as an observer.
  • [leave_game]

Error messages

  • [error]
    • message The error message.

Lobby chat

  • server message
    • [message]
      • sender The sender of the message.
      • message The message itself.
    • [whisper]
      • receiver The receiver of the whisper
      • sender The sender of the whisper.
      • message The message itself.
  • client message
    • [message]
      • sender (optional) The sender of the message.
      • message The message itself.
    • [whisper]
      • receiver The receiver of the whisper
      • sender (optional) The sender of the whisper.
      • message The message itself.

Administrative commands