Donations
Help us to pay our Server!
(: Consider a donation :)
Donation pic
Donators
Main Menu
Language
Recent changes

[Main Page]

Game Server Protocol

From Widelands.org

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy

Contents

Universal Game Server Protocol

THIS IS WORK IN PROGRESS


This draft describes the Game Server Concept of Widelands. This document describes the version 1.0 of the protocol, all other versions before are therefore no longer valid and should not be implemented.



What is a Game Server

The Game Server is a meta server, where players can connect to, chat and start games and join them. Very simple examples are the wesnoth server, very complex are battle.net or the bluebyte game channel. The basic idea is, that players can chat in the game, without leaving the 'virtual world' (look & feel) the game creates. Some game servers offer the functionality to update the game (through a binary patch system), some offer a database which counts win and looses or offer some tournament system.



What are the Protocols Features

The protocol is designed for easy enhancement, it started with vary basic functionality in 1.0 and (might) grow to a full featured Game Server Application in it's later versions. The Protocol is game independant. This means, that a game that fullfills the following criterias can easily implement the protocol and offer games on any game server that chooses to serve this game. The criterias are as follows:

  • A Network mode which allows players to connect to the host; players must then be presented a chatting screen where the game values are defined.
  • The connection to the game server must stay alive through the whole game (if it quits, the game can still continue, but the reconnection to the game server is not possible and the game will count as loose (or not at all)



The Protocol

First thing to notice: All sended strings are unicode !!

Second thing, all names written in BIG_LETTERS are numerical values which can be looked up in the widelands code in the file game_server_proto.h

The protocol consist of packages. Each package passes four stages:

  1. send by client or server, containing data of what to do
  2. executet by receiver
  3. receiver sends answer package
  4. sender executes answer package

Each package consits at least of the following data

<2B packetsize> <2B id> <4B INDEX> <2B FLAGS> <...packet data...>
The size of the packet in bytes The id defines the type of packet following The index is a simple number increasing with each sended packet. The Client starts with FIRST_CLIENT_PACKET_INDEX, the Server with FIRST_SERVER_PACKET_INDEX, wrapping occures before any of the ids mixes. So you can recognize by the id who send the package. Flags are currently only, if this packet is a reply The Data of this packet type.

When a client connects to a server it sends a connect package. This package also contains the ability of the client (see the hello package source for more informations).



The packages

Retrieved from "http://xoops.widelands.org/modules/mediawiki/index.php/Game_Server_Protocol"

This page has been accessed 2,637 times. This page was last modified 19:41, 30 January 2007. Content is available under GNU General Public License 2.





Search


Login
Username:

Password:


Lost Password?

Register now!
Polls
Which requires the fewest improvements
Animations in game (buildings, workers, nature, animals)
Graphics in main menu
Campaigns (as well as number of campaigns)
Network support
Sounds
Music
Structure of the economies of the tribes
Maps
The transportation system
In game user interface
The editor
Hosted by