The PlayerServer class represents an
individual player on the server. Every time a new player connects to the server, a new instance of this
class is created and associated to the current connection. The player is then added to an attendants
queue. On each change of the queue the server tries to associate two nonplaying players to start a new
game session. A GameBoard instance is created and associated to both players. The class contains the
logic and mechanisms of a TicTacToe game. The PlayerServer interacts with this object to check if any
of the players won or if the match ended in a tie. The match can also end prematurely if one of the
players disconnects in the middle of the competition; in this case the server immediately notifies the
other player. The PlayerServer communicates with the client using a proxy built upon the interface
IGameClient . The user interface has been created to limit the possible interactions between the server
and the client to the bare minimum required; the server is not interested, and should not be, in how the
client is implemented and just needs to access its more generic methods.
Pages:
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832