NetworkDesign: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann |
imported>Hendrik Brummermann |
||
| Line 32: | Line 32: | ||
[[Image:messages-loggedin.png|thumb|Selecting a character and transmitting world meta data.]] |
[[Image:messages-loggedin.png|thumb|Selecting a character and transmitting world meta data.]] |
||
The logging in stuff was complicated. But luckily things are getting much easier now. After the login completed successfully the server sends a [http://stendhal.game-host.org/hudson/job/marauroa_HEAD/javadoc/marauroa/common/net/message/MessageS2CServerInfo.html S2CServerInfo] message. It tells the client about what kind of server is running, and details on how to contact the server administrator (e.g. their email address). The message is composed of a List of strings of the form "attribute=value". In addition this message also contains the list of defined RPClasses. |
|||
Directly afterwards a [http://stendhal.game-host.org/hudson/job/marauroa_HEAD/javadoc/marauroa/common/net/message/MessageS2CCharacterList.html S2CCharacterList] message is sent from the server to the client. It offers a choice of character to play with. This feature models the behavior of having several characters associated with a single account. Each character name must be unique at server level, and it is assigned when the character is created. |
|||
Now the client picks one of the offered characters. Games that do not support multiple characters can pick the one that matches the account name. The choice is transmitted to the server using a [http://stendhal.game-host.org/hudson/job/marauroa_HEAD/javadoc/marauroa/common/net/message/MessageC2SChooseCharacter.html C2SChooseCharacter] message. The name of the character must be one of the names listed in the character list. |
|||
The server will check the selected character and reply for a [http://stendhal.game-host.org/hudson/job/marauroa_HEAD/javadoc/marauroa/common/net/message/MessageS2CChooseCharacterNACK.html S2CChooseCharacterNACK] if the choice was invalid. This implies that the client should send another C2SChooseCharacter message. |
|||
If the selection, however, was successful, a [http://stendhal.game-host.org/hudson/job/marauroa_HEAD/javadoc/marauroa/common/net/message/MessageS2CChooseCharacterACK.html ChooseCharacterACK] message is sent and the client state changed to "in game". |
|||
{{br}} |
{{br}} |
||