EBNF - ogrady/inf3project GitHub Wiki
The EBNF describes all the messages that can be sent from the server to a client. Rules are written in ALLCAPS, while literals are enclosed in quotation marks.
S: "begin:",INT,SERVERMES,"end:",INT SERVERMES: UPDATE|DELETE|MAP|MESSAGE|ANSWER|RESULT|CHALLENGE|PLAYER|YOURID|TIME|ONLINE|ENTITIES|PLAYERS|SERVER SERVER: "begin:server","ver:",INT,"end:server" RESULT: "begin:result","round:",INT,"running:",BOOLEAN,"delay:",INT,"begin:opponents",OPPONENT,OPPONENT","end:opponents","end:result" OPPONENT: "begin:opponent","id:"INT,"decision:",DECISION,"points:",INT,"total:",INT,"end:opponent" CHALLENGE: "begin:challenge","id:",INT,"type:",("DRAGON"|"STAGHUNT"|"SKIRMISH"),"accepted:",BOOLEAN,"end:challenge" DRAGON: "begin:dragon", "id:",INT,"type:Dragon","busy:"BOOLEAN,"desc:"STRING,"x:",INT,"y:",INT,"end:dragon" PLAYER: "begin:player","id:",INT,"type:Player","busy:"BOOLEAN,"desc:"STRING,"x:",INT,"y:",INT,"points:",INT"end:player" PLAYERS: "begin:players",{PLAYER},"end:players" ENTITIES: "begin:ents",{(PLAYER|DRAGON)},"end:ents" MAPCELL: "begin:cell","row:",INT,"col:",INT,"begin:props",{PROPERTY},"end:props","end:cell" MAP: "begin:map","width:"INT,"height:",INT,"begin:cells",{MAPCELL},"end:cells","end:map" MESSAGE: "begin:mes","srcid:",INT,"src:",STRING,"txt:",STRING,"end:mes" UPDATE: "begin:upd",(DRAGON|PLAYER|MAPCELL),"end:upd" DELETE: "begin:del",(DRAGON|PLAYER),"end:del" ANSWER: OKAY|DENY|UNKNOWN|INVALID OKAY: "ans:ok" DENY: "ans:no" UNKNOWN: "ans:unknown:",STRING INVALID: "ans:invalid" YOURID: "begin:yourid",INT,"end:yourid" TIME: "begin:time",LONG,"end:time" ONLINE: "begin:online",INT,"end:online" DECISION: DRAGONFIGHT|STAGHUNT|SKIRMISH DRAGONFIGHT: "FIGHT"|"REST" STAGHUNT: "STAG"|"BUNNY" SKIRMISH: "SWORD"|"ALCHEMY"|"MAGIC" PROPERTY: "WALKABLE"|"WALL"|"FOREST"|"WATER"|"HUNTABLE"