Exemplo n.º 1
0
        public static ServerConnectInfo ReadMDLink(string filename)
        {
            // The info we need to connect to the server
            ServerConnectInfo info = new ServerConnectInfo();

            // The mdlink is an xml file
            XmlDocument d = new XmlDocument();
            d.Load(filename);

            // Grab the username
            info.username = XmlTool.XmlVal(d, "/ManicDiggerLink/User");
            // Grab the url
            info.url = XmlTool.XmlVal(d, "/ManicDiggerLink/Ip");
            // Grab the port
            info.port = int.Parse(XmlTool.XmlVal(d, "/ManicDiggerLink/Port"));
            // Grab the gamemode
            info.gamemode = XmlTool.XmlVal(d, "/ManicDiggerLink/GameMode");

            return info;
        }
Exemplo n.º 2
0
        public void Start()
        {
            w = new ManicDiggerGameWindow();
            audio = new AudioOpenAl();
            w.audio = audio;
            MakeGame(true);

            // Defaults for connectioninfo
            if (connectinfo == null)
            {
                connectinfo = new ServerConnectInfo();
                connectinfo.url = "127.0.0.1";
                connectinfo.port = 25570;
                connectinfo.username = "******";
            }

            // Temporary plugin of ServerConnectInfo.  Need to come back and clean this up.
            if (connectinfo.url != null)
            {
                w.GameUrl = connectinfo.url + ":" + connectinfo.port;
            }
            if (connectinfo.username != null)
            {
                w.username = connectinfo.username;
            }

            this.exit = w;
            w.Run();
        }