Example #1
0
        public void joinServer()
        {
            JoinServer js = new JoinServer();
            js.user = "******";
            byte[] to_send = Util.Wrap(js);
            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            Console.WriteLine(encoding.GetString(to_send));

            sendMessage(to_send);
        }
Example #2
0
 public void JoinCallback(string secret)
 {
     Log.Info(string.Format("Discord: join ({0})", secret));
     Log.Debug("Discord" + SceneManager.GetActiveScene().name);
     if (SceneManager.GetActiveScene().name == "StartScreen")
     {
         NitroxServiceLocator.BeginNewLifetimeScope();
         JoinServer.SaveGameMenuPrototype = FindObject(MainMenuRightSide.main.gameObject, "SavedGames");
         JoinServer joinServer   = gameObject.AddComponent <JoinServer>();
         string[]   serverIpPort = secret.Split(':');
         joinServer.ServerIp   = serverIpPort[0];
         joinServer.ServerPort = int.Parse(serverIpPort[1]);
     }
     else
     {
         Log.InGame("Please be in the mainmenu if you want to join a session.");
         Log.Warn("Discord: Can't join a server outside of the mainmenu.");
     }
 }
Example #3
0
 public void joinServer(String nick, int port)
 {
     this.nick = nick;
     this.udp_port = port;
     JoinServer joinServ = new JoinServer();
     sendMessage(joinServ);
     udpClient = new CovUdpClient(this, nick, port);
     udpClient.connect();
     Console.WriteLine("udp Client: " + udpClient);
 }