public void connect(string server)
     {
     iGlobal["$pref::Net::PacketRateToServer"] = 32;
     iGlobal["$pref::Net::PacketSize"] = 200;
     iGlobal["$platform::timeManagerProcessInterval"] = 1;
     coGameConnection conn = new Torque_Class_Helper("GameConnection", "ServerConnection").Create().AsString();
     ((coSimSet)"rootgroup").pushToBack(conn);
     conn.setConnectArgs(sGlobal["$pref::Player::Name"]);
     conn.setJoinPassword(sGlobal["$Client::Password"]);
     conn.connect(server);
     }
Exemplo n.º 2
0
        public bool CreateAndConnectToLocalServer(string serverType, string level)
            {
            if (!CreateServer(serverType, level))

                return false;


            coGameConnection client = new Torque_Class_Helper("GameConnection", "ServerConnection").Create();


            client.setConnectArgs(sGlobal["$pref::Player::Name"]);

            client.setJoinPassword(sGlobal["$Client::Password"]);

            string result = client.connectLocal();

            if (result != "")
                {
                client.delete();
                DestroyServer();
                return false;
                }
            return true;
            }