Ejemplo n.º 1
0
 public static bool Connected(OthelloTCPClient client)
 {
     throw new NotImplementedException("[Connected] : Toolbox");
     //bool part1 = client.Socket.Poll(1000, System.Net.Sockets.SelectMode.SelectRead);
     //bool part2 = client.Socket.Available == 0;
     //return !(part1 & part2);
 }
Ejemplo n.º 2
0
        public void Connect(GameType localOrOnline)
        {
            // Init a new client
            client = new OthelloTCPClient();

            // Attach the client OrderHandler to this
            client.SetOrderHandler(this);

            // Connect the client to the target gametype server
            if (localOrOnline == GameType.Local)
            {
                IsLocalPlayer = true;
                client.ConnectTo(Properties.Settings.Default.LocalHostname, Properties.Settings.Default.LocalPort);
            }
            else
            {
                IsLocalPlayer = false;
                client.ConnectTo(Properties.Settings.Default.OnlineHostname, Properties.Settings.Default.OnlinePort);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tcpClient">socket</param>
 public OthelloPlayerServer(OthelloTCPClient tcpClient)
 {
     client = tcpClient;
     client.SetOrderHandler(this);
 }