示例#1
0
        public Master()
        {
            Instance = this;

            Accessor = new Accessor();

            DataProvider = new DataProvider();

            Login = new Login();
            Worlds = new List<World>(Constants.WorldNames.Length);

            ushort Port = 8485;

            for (int i = 0; i < Worlds.Capacity; i++)
            {
                World World = new World((byte)i, Port, 2);
                World.Name = Constants.WorldNames[i];
                Port += 2;

                Worlds.Add(World);
            }

            CashShop = new CashShop(9000);
        }
示例#2
0
        public static Packet Worldlist(World pWorld, int[] pLoads)
        {
            Packet p = new Packet();

            p.WriteShort((short)SendOpcodes.World_Information);

            p.WriteByte(pWorld.Id);
            p.WriteMapleString(pWorld.Name);
            p.WriteByte(2); // TODO: Flag.
            p.WriteMapleString(Constants.EventMessage);
            p.WriteShort(100);
            p.WriteShort(100);
            p.WriteByte(0);
            p.WriteByte((byte)pLoads.Length);

            int Id = 1;

            foreach (int Load in pLoads)
            {
                Console.WriteLine("Load: " + Load);
                p.WriteMapleString(String.Format("{0}-{1}", pWorld.Name, Id));
                p.WriteInt(Load * 200);
                p.WriteByte(pWorld.Id);
                p.WriteShort((short)(Id - 1));

                Id++;
            }

            p.WriteShort(0);
            p.WriteInt(0);
            p.WriteByte(0);

            return p;
        }