示例#1
0
        public frmMain()
        {
            MapleKeys.Initialize();

            this.InitializeComponent();

            this.Acceptor = new Acceptor(8484);
            this.Acceptor.OnClientAccepted = OnClientAccepted;

            frmMain.Instance = this;
        }
示例#2
0
        public static byte[] Get(ServerInfo info)
        {
            if (MapleKeys.Keys == null)
            {
                MapleKeys.Initialize();
            }

            if (!MapleKeys.Keys.ContainsKey(info.Localisation))
            {
                return(null);
            }

            byte subVersion = byte.Parse(info.Subversion);

            for (; info.Version > 0; info.Version--)
            {
                for (byte b = subVersion; b > 0; b--)
                {
                    var container = new KeyValuePair <ushort, byte>(info.Version, b);

                    if (MapleKeys.Keys[info.Localisation].ContainsKey(container))
                    {
                        byte[] key = MapleKeys.Keys[info.Localisation][container];
                        byte[] ret = new byte[32];

                        for (int i = 0; i < 8; i++)
                        {
                            ret[i * 4] = key[i];
                        }

                        return(ret);
                    }
                }
            }

            return(null);
        }