public static void HandleChannelLoad(PacketReader packet, CenterServer serv)
 {
     byte channels = packet.ReadByte();
     var ret = new Dictionary<int, int>();
     for (int i = 0; i < channels; ++i)
     {
         ret.Add(packet.ReadByte(), packet.ReadInt());
     }
     serv.channels = ret;
 }
 public static void HandleMigrate(CenterServer serv, PacketReader packet)
 {
     int accid = packet.ReadInt();
     int cid = packet.ReadInt();
     byte[] ip = packet.ReadBytes(4);
     ushort port = (ushort)packet.ReadShort();
     if (port == 0)
         Program.mServer.GetClientByAccountId(accid).SendPacket(PacketDefinitions.SelectCharacter(0x0C, 0x1F, ip, port, cid));
     else
         Program.mServer.GetClientByAccountId(accid).SendPacket(PacketDefinitions.SelectCharacter(0x00, 0x00, ip, port, cid));
 }
Exemplo n.º 3
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;
            }
        }