# Connect Four A simple version of the popular game "connect four" written in Java. ## API docs ### SOCKET API #### Basic structure A command consists of a json encoded string of type object which starts with `````` and ends with ``````. It contains: - id (int): some number, the response will contain the same number - header (int): the actual command to execute - data (mixed): data that has to be passed with the command A response consists of a json encoded string of type object which starts with `````` and ends with ``````. It contains: - id (int): id of the command - header (int): return code of the command (see later) - data (midex): returned data of the command #### Return codes The return codes are mostly identical with the HTTP standard codes. However there are some additional ones as well: #### Enums Some enumeration types - PlateType - 0: X - 1: O #### Commands - Confirm game start - command: 1 - requestdata: - type: null - responsedata: - type: object - def: - 'player' - type: PlateType - desc: the plate type the client will use - Insert a plate - command: 100 - requestdata: - type: int - decs: index of column to insert plate - replydata: - type: string - def: - 'ok': plate was inserted - 'err': plate was not inserted (either index out of range or clumn full) - 'X': insertion resulted in the winning of PlateType X - 'O': insertion resulted in the winning of PlateType O