示例#1
0
 public void ServerStart()
 {
     server.Close();
     client.Close();
     server = new NetFileTSever.NFTServer();
     client = new NetFileTClient.NFTClient();
     server.run(Serverport);
     Debug.Log("ServerStart");
 }
示例#2
0
 public void ClientStart()
 {
     server.Close();
     client.Close();
     server = new NetFileTSever.NFTServer();
     client = new NetFileTClient.NFTClient();
     server.run(Clientport);
     client.ConnectToIp(Serverip, Serverport);
     while (client.Transmission(EnCoder.StartMessage()) != 0)
     {
         Debug.Log("retry");
     }
     NetWorkScript.isConnected = true;
 }
示例#3
0
 public void Start()
 {
     if (isServer)
     {
         server = new NetFileTSever.NFTServer();
         client = new NetFileTClient.NFTClient();
         server.run(Serverport);
     }
     else
     {
         server = new NetFileTSever.NFTServer();
         client = new NetFileTClient.NFTClient();
         server.run(Clientport);
         client.ConnectToIp(Serverip, Serverport);
         while (client.Transmission(EnCoder.StartMessage()) != 0)
         {
             Debug.Log("retry");
         }
         netWorkTest.isConnected = true;
     }
 }