Beispiel #1
0
        public GameServer addServer(ServerHost host)
        {
            List<GameServer> temp = findServersByHost(host);
            if (temp.Count > 0)
                return temp[0];

            GameServer server = new GameServer();
            server.host = host;
            servers.Add(server);
            return server;
        }
Beispiel #2
0
        public void updateServer(GameServer server)
        {
            // flush the entire thing for now
            // later throw these into a database,
            // or at least do a file per server

            FileInfo dbFile = new FileInfo(dbDir + "serverdb.xml");

            XmlSerializer xml = new XmlSerializer(typeof(List<GameServer>));

            FileStream fs = dbFile.OpenWrite();
            StreamWriter file = new StreamWriter(fs);

            xml.Serialize(file, servers);
            file.Close();
            fs.Close();
        }