Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
groworld_multiplayer_prototype [2009-03-12 15:06] – davegriffiths | groworld_multiplayer_prototype [2009-03-13 12:42] – davegriffiths | ||
---|---|---|---|
Line 18: | Line 18: | ||
^ Message ^ Data ^ Send when ^ Action on receive ^ | ^ Message ^ Data ^ Send when ^ Action on receive ^ | ||
- | | /register | + | | /join-game |
| /plant | Plant ID, postion, colour and structure | When starting game, your plant changes or /register recieved | If it's the first time you've seen this plant id, add plant to world, otherwise update plant | | | /plant | Plant ID, postion, colour and structure | When starting game, your plant changes or /register recieved | If it's the first time you've seen this plant id, add plant to world, otherwise update plant | | ||
+ | | /flower | Plant ID, Flower ID, Colour | Sucking pollen has changed a flower colour | Update colour for this plant/ | ||
| /spray | Plant ID, pollen type | Pollen release button pressed | Add pollen from plant into atmosphere | | | /spray | Plant ID, pollen type | Pollen release button pressed | Add pollen from plant into atmosphere | | ||
- | | /unregister | + | | /leave-game |
+ | |||
+ | When joining a game, you need to create a unique id for your plant. With no central server, this currently works in the following ad-hoc manner: | ||
+ | |||
+ | - Broadcast / | ||
+ | - Wait for 2 seconds, deal with all incoming /plant messages | ||
+ | - Count the number of plants, give yourself an id based on that | ||
+ | - Broadcast your new plant back with /plant | ||
===Structure information=== | ===Structure information=== |