Difference between revisions of "MultiplayerServerWML"

From The Battle for Wesnoth Wiki
(updating the lobby state)
([user] is actually not in [gamelist] but behind it)
Line 23: Line 23:
 
* server response
 
* server response
 
** '''[gamelist]'''
 
** '''[gamelist]'''
*** '''[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.
 
 
*** '''[game]'''
 
*** '''[game]'''
 
**** ''mp_use_map_settings'' Does the game use map settings specified in the scenario.
 
**** ''mp_use_map_settings'' Does the game use map settings specified in the scenario.
Line 48: Line 44:
 
**** ''mp_scenario'' The id of the scenario.
 
**** ''mp_scenario'' The id of the scenario.
 
**** ''slots'' The number of vacant/max slots.
 
**** ''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.
 
Many of these keys are described more indepth on the [[ScenarioWML]] page.
  
Line 56: Line 56:
 
*** '''[insert_child]''' or '''[delete_child]'''
 
*** '''[insert_child]''' or '''[delete_child]'''
 
**** ''index'' Index of the child (game or user).
 
**** ''index'' Index of the child (game or user).
**** '''[gamelist]''' Same tags/keys as above in [gamelist] possible
+
**** '''[gamelist]''' or '''[user]''' Same tags/keys as above in [gamelist] and [user] possible
 
*** '''[change_child]''' Same tags as above in [gamelist] possible
 
*** '''[change_child]''' Same tags as above in [gamelist] possible
 
**** ''index'' Index of the child (game or user).
 
**** ''index'' Index of the child (game or user).
***** '''[insert]''' or '''[delete]''' Same keys as above in [game] or [user] possible
+
***** '''[insert]''' or '''[delete]''' Same keys as above in [game] possible
**** '''[gamelist]'''  
+
**** '''[gamelist]''' or '''[user]'''
 
***** '''[change_child]''' Same tags as above in [gamelist] possible
 
***** '''[change_child]''' Same tags as above in [gamelist] possible
****** '''[insert]''' or '''[delete]''' Same keys as above in [game] or [user] possible
+
****** '''[insert]''' or '''[delete]''' Same keys as above in [game] possible
 
***** '''[insert_child]''' Same tags as above in [gamelist] possible
 
***** '''[insert_child]''' Same tags as above in [gamelist] possible
  

Revision as of 02:13, 29 June 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 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
        • nameThe 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]
      • [insert_child] or [delete_child]
        • index Index of the child (game or user).
        • [gamelist] or [user] Same tags/keys as above in [gamelist] and [user] possible
      • [change_child] Same tags as above in [gamelist] possible
        • index Index of the child (game or user).
          • [insert] or [delete] Same keys as above in [game] possible
        • [gamelist] or [user]
          • [change_child] Same tags as above in [gamelist] possible
            • [insert] or [delete] Same keys as above in [game] possible
          • [insert_child] Same tags as above in [gamelist] possible
  • server message - observers joining/quiting games
    • [observer] or [observer_quit]
      • name Username of the observer.

Lobby chat

  • server message
    • [message] or [whisper]
      • sender The sender of the message.
      • message The message itself.
  • client message
    • [message] or [whisper]
      • message The message itself.