Esempio n. 1
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);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tcpClient">socket</param>
 public OthelloPlayerServer(OthelloTCPClient tcpClient)
 {
     client = tcpClient;
     client.SetOrderHandler(this);
 }