Exemple #1
0
 /// <summary>
 /// This starts the server when we click File->New Server->Host New Server.
 /// </summary>
 private void hostNewGameToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Server_Shutdown();
     HostServer = new Server(PlayerSettings.Settings.Host_ServerName, PlayerSettings.Settings.Host_ServerPassword);
     HostServer.Init();
     Debug.Log(string.Format("Opened new server {0}", HostServer.ServerName));
     MessageBox.Show(NetworkTools.GetLocalIPAddress());
     Connect(string.Empty, PlayerSettings.Settings.Host_ServerPassword);
     //ClientSendMessage(BoggleInstructions.SET_NAME, PlayerSettings.Settings.Host_ServerPassword);
     StartServer();
     //ConnectPlayer();
     ServerTick.Start();
     Text = string.Format("NET Boggle on {0}", HostServer.ServerName);
 }
Exemple #2
0
        private void FillIPTextBoxes()
        {
#if DEBUG
            this.textBoxIPFrom.Text = "192.168.178.1";
            this.textBoxIPTo.Text   = "192.168.178.254";
#else
            var myIp = NetworkTools.GetLocalIPAddress(AddressFamily.InterNetwork);

            if (myIp == null || myIp == IPAddress.None)
            {
                return;
            }

            var myIPStr = myIp.ToString();
            var strArr  = myIPStr.Split('.');
            strArr[3] = "1";
            var ipFrom = string.Join(".", strArr);
            this.textBoxIPFrom.Text = ipFrom;

            strArr[3] = "254";
            var ipTo = string.Join(".", strArr);
            this.textBoxIPTo.Text = ipTo;
#endif
        }
Exemple #3
0
 private void printIPAddressToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Debug.Log(NetworkTools.GetLocalIPAddress());
 }