예제 #1
0
        public static bool createAndConnectToLocalServer(string serverType, string level)
        {
            if (!createServer(serverType, level))
                return false;

            GameConnection conn = new ObjectCreator("GameConnection", "ServerConnection", t3d.sGlobal["$Pref::Server::Net::ClientGameConnectionModelClass"]).Create();

            ((SimGroup) "RootGroup").add(conn);

            conn.setConnectArgs(t3d.sGlobal["$pref::Player::Name"]);
            conn.setJoinPassword(t3d.sGlobal["$Client::Password"]);

            if (conn.connectLocal() != string.Empty)
                {
                conn.delete();
                destroyServer();
                return false;
                }
            return true;
        }