Module name | Technology | Description |
---|---|---|
Application server | Java 2 SE | Superior module. Controls data flow between subordinate modules connected to it. |
Game | Java 2 SE | Runs on the server. Receives players' actions. Verifies correctness of actions and controls the run of match. Sends actions between players and game state to a logger. |
Player/Warrior | Template C++ code | Connects to a game. Receives opponet's action and answers with its own. |
Observer | Java 2 SE (Swing) | Connects to a game. Receives game state data. Visualizes or logs the run of game. |
Module name | Functions |
---|---|
Application server |
|
Game |
|
Player/Warrior |
|
Observer |
|
Module name | Sposob powitania |
---|---|
Game | Jest uruchamiana przez administratora systemu lub automatycznie przez serwer, gdy pojawia sie zadanie przylaczenia do gry od gracza i serwer nie ma wolnych gier. |
Player |
<message type="hello" id="12345"> <mod-type>player</mod-type> <name>Swapper</name> </message> |
Observer |
<message type="hello" id="12345"> <mod-type>observer</mod-type> <name>Logger</name> </message> |
<message type="params" id="12345"> <map width="10" height="8" goal="2"/> <attack side="-1" begin="true"/> </message>
<message type="log" id="12345"> <name>Killer</name> <name>Swapper</name> <map width="10" height="8" goal="2"/> <begin>Swapper</begin> <move time="15:37.45"> <type>1</type> <type>2</type> <type>3</type> </move> ... <error name="Wymiatacz">Niepoprawny komunikat</error> ... <move time="15:38.45"> <type>1</type> <type>2</type> <type>3</type> </move> ... <winner>Swapper</winner> </message>
Message type | Description |
---|---|
Game over |
<message type="game-over" id="12345"> <name>Swapper</name> </message> |
Message acception/refusal | Serwer potwierdza badz odrzuca kazda wiadomosc od klienta (gracza lub obserwatora).
Jezeli wiadomosc zostanie odrzucona, klient powinien ja zmienic zaleznie od podanego
przez serwer powodu odrzucenia i wyslac ponownie.
W przypadku otrzymania trzech kolejnych niepoprawych wiadomosci, serwer zamyka
polacznie z klientem, ktory je wyslac. Podobnie w sytuacji nadejscia wiadomosci
w momencie gdy serwer sie jej nie spodziewa (np. koniec gry). <message type="confirmation" id="12345"> <accepted/> </message> <message type="confirmation" id="12345"> <refused> Incorrect move. </refused> </message> |
Lista gier/Wybor gry do obserwacji |
<message type="games" id="12345"> <name>Red vs. Blue</name> <name>Freddy vs. Jason</name> </message> <message type="game" id="12345"> <name>RotoZoomer vs. PlasmaCloud</name> </message> |
PLAYER_1 GAME PLAYER_2 |-----\ H | | | \---->>| H /-------| | Ack /------|<<-----/ | |<<---/ |-------\ Ack | | P /------|-------\\----->>| |<<---/ | P \----->>| |-----\ Ack | Ack /-------| | \---->>|<<-----/ | | [T1b] | | | | | |-----\ A1 | | | \---->>| [T1e] | | Ack /------|-------\ A1 | |<<---/ | \----->>| | | Ack /-------| | [T2b] |<<-----/ | | | | | | A2 /-------| | [T2e] |<<-----/ | | A2 /------| | |<<---/ | | |-----\ Ack | | | \---->>| [T1b] | ... |-----\ An | | | \---->>| [T1e] | | Ack /------| | |<<---/ | | | GO /------|-------\ GO | |<<---/ | \----->>| | | | X X X