예제 #1
0
        private bool LoadGameIMGConfig()
        {
            try
            {
                LogCharacter = new Dictionary<int, int>();
                center = new CenterServer();
                var reader = new ConfigReader(Program.GameIMGPath);

                port = reader.getUShort("", "port");
                gameWorldId = reader.getInt("", "gameWorldId");

                foreach (string s in reader.GetBlocks("logaccount", true))
                {
                    LogCharacter.Add(int.Parse(s), reader.getInt("logcharacter", s));
                }

                center.ip = reader.getString("center", "ip");
                center.port = reader.getUShort("center", "port");
                center.Name = reader.getString("center", "worldName");
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
예제 #2
0
        public bool LoadGameIMGConfig()
        {
            try
            {
                LogAccounts = new Dictionary<int, int>();
                centerServers = new Dictionary<string, CenterServer>();
                ConfigReader reader = new ConfigReader(Program.GameIMGPath);

                port = reader.getUShort("", "port");
                adminPort = reader.getUShort("", "adminPort");

                dbCatalogGlobalAccount = reader.getString("", "dbCatalogGlobalAccount");
                dbCatalogGameWorld = reader.getString("", "dbCatalogGameWorld");

                foreach (string s in reader.GetBlocks("logaccount", true))
                {
                    LogAccounts.Add(int.Parse(s), reader.getInt("logaccount", s));
                }

                foreach (string s in reader.GetBlocks("center", true))
                {
                    CenterServer centerServ = new CenterServer();
                    centerServ.ip = reader.getString(s, "ip");
                    centerServ.port = reader.getUShort(s, "port");
                    centerServ.world = reader.getInt(s, "world");
                    centerServ.channelNo = reader.getInt(s, "channelNo");
                    centerServers.Add(s, centerServ);
                }
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }