SAMPLE_TEAM.gcreceiver
This module shows how the GameController Communication protocol can be used in python and also allows to be changed such that every team using python to interface with the GC can utilize the new protocol.
Modded by Egor Davydenko egordv@gmail.com for elsiros league
Module Contents
Classes
This class puts up a simple UDP Server which receives the |
|
This class puts up a simple UDP Server which receives the |
|
This class puts up a simple UDP Server which receives the |
Attributes
- class SAMPLE_TEAM.gcreceiver.GameStateReceiver(team, player, is_goalkeeper, addr=(DEFAULT_LISTENING_HOST, GAME_CONTROLLER_LISTEN_PORT), answer_port=GAME_CONTROLLER_ANSWER_PORT)[source]
Bases:
object
This class puts up a simple UDP Server which receives the addr parameter to listen to the packages from the game_controller.
If it receives a package it will be interpreted with the construct data structure and the
on_new_gamestate()
will be called with the content.After this we send a package back to the GC
- receive_once(self)[source]
Receives a package and interprets it. Calls
on_new_gamestate()
Sends an answer to the GC
- class SAMPLE_TEAM.gcreceiver.SampleGameStateReceiver(team, player, is_goalkeeper, addr=(DEFAULT_LISTENING_HOST, GAME_CONTROLLER_LISTEN_PORT), answer_port=GAME_CONTROLLER_ANSWER_PORT)[source]
Bases:
GameStateReceiver
This class puts up a simple UDP Server which receives the addr parameter to listen to the packages from the game_controller.
If it receives a package it will be interpreted with the construct data structure and the
on_new_gamestate()
will be called with the content.After this we send a package back to the GC
- class SAMPLE_TEAM.gcreceiver.ThreadedGameStateReceiver(team, player, is_goalkeeper, addr=(DEFAULT_LISTENING_HOST, GAME_CONTROLLER_LISTEN_PORT), answer_port=GAME_CONTROLLER_ANSWER_PORT)[source]
Bases:
GameStateReceiver
This class puts up a simple UDP Server which receives the addr parameter to listen to the packages from the game_controller.
If it receives a package it will be interpreted with the construct data structure and the
on_new_gamestate()
will be called with the content.After this we send a package back to the GC