2 #include <sys/socket.h>
3 #include <netinet/in.h>
14 #include "controller.h"
16 #ifndef NETWORK_CONTROLLER_H
17 #define NETWORK_CONTROLLER_H
20 class NetworkController : public Controller
23 NetworkController(const Piece::Colour & newColour, const char * newName = "no-name");
24 virtual ~NetworkController();
26 virtual bool Valid() {return sfd != -1;}
28 virtual void Message(const char * string) {fprintf(stderr, "NetworkController unimplemented!\n"); assert(false);}
29 virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]) {fprintf(stderr, "NetworkController unimplemented!\n"); assert(false);}
30 virtual MovementResult QueryMove(std::string & buffer) {fprintf(stderr, "NetworkController unimplemented!\n"); assert(false);}
34 static const int port = 666;
37 class Server : public NetworkController
40 Server(const Piece::Colour & newColour, const char * newName = "no-name");
44 class Client : public NetworkController
47 Client(const Piece::Colour & newColour, const char * newName = "no-name", const char * server="127.0.0.1");
51 #endif //NETWORK_CONTROLLER_H