Skip to content

Commit f068fce

Browse files
committed
Issue scalatron#52: Updated the protocol documentation with the proposed keywords.
1 parent 1775ffe commit f068fce

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Scalatron/doc/markdown/Scalatron Protocol.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ following property names are reserved and must not be used for custom properties
232232
* "direction"
233233
* "master"
234234
* "collision"
235+
* "slaves"
235236

236237
Custom state properties cannot have empty strings as their values. Setting a custom state property
237238
to an empty string deletes it from the state.
@@ -246,7 +247,7 @@ These are the opcodes valid for commands sent by the server to a plug-in's contr
246247
Only one opcode will be present per control function invocation.
247248

248249

249-
### Welcome(name=String,apocalypse=int,round=int)
250+
### Welcome(name=String,apocalypse=int,round=int,maxslaves=int)
250251

251252
"Welcome" is the first command sent by the server to a plug-in before any other invocations of
252253
the control function.
@@ -262,9 +263,11 @@ Parameters:
262263
* `round`: the index of the round for which the control function was instantiated.
263264
A game server continually runs rounds of the game, and the round index is
264265
incremented each time.
266+
* `maxslaves`: the number of slave bots that a user can have alive at any one time. If a call
267+
to `Spawn` is made when this number of user bots exist, then the request will be
268+
denied.
265269

266-
267-
### React(generation=int,name=string,time=int,view=string,energy=string,master=int:int,collision=int:int,...)
270+
### React(generation=int,name=string,time=int,view=string,energy=string,master=int:int,collision=int:int,slaves=int,...)
268271

269272
"React" is invoked by the server once for each entity for each step in which the entity is
270273
allowed to move (mini-bots every cycle, bots every second cycle - see the *Game Rules* for
@@ -296,6 +299,7 @@ Parameters:
296299
collision with another entity occurred, this parameter is set to the direction of the
297300
failed move, e.g. "1:-1" if a move right and up could not be executed. If no collision
298301
occurred, this property is not defined.
302+
* `slaves` the number of slave bots that the user currently has alive as at the current `time`.
299303

300304
In addition to these system-generated parameters, the server passes in all state parameters of
301305
the entity that were set by the player via `Spawn()` or `Set()` (see below). If, for example,

0 commit comments

Comments
 (0)