コード例 #1
0
 public void EndConnections()
 {
     if (client != null)
     {
         client.Disconnect();
         client = null;
     }
     if (server != null)
     {
         server.Disconnect();
         server = null;
     }
 }
コード例 #2
0
        public void StartConnections(World world)
        {
            if (!isServer)
            {
                //string[] ipSplit = serverIPAdress.Split('.');
                //if (ipSplit.Length < 4)
                //{
                //    Debug.LogError("ip must be 4 period separated integers");
                //    return;
                //}

                //byte[] ipComponents = new byte[4];
                //for (int i = 0; i < 4; i++)
                //{
                //    ipComponents[i] = byte.Parse(ipSplit[i]);
                //}
                //serverIP = new IPAddress(ipComponents);
                client = new VmClient(world, serverIP);
            }
            else if (allowConnections)
            {
                server = new VmServer(world);
            }
        }