Exemple #1
0
        D2GameInfo ReadGameInfo()
        {
            try
            {
                D2Game game = ReadActiveGameInstance();
                if (game == null || game.Client.IsNull)
                {
                    return(null);
                }

                D2Client client = reader.Read <D2Client>(game.Client);

                // Make sure we are reading a player type.
                if (client.UnitType != 0)
                {
                    return(null);
                }

                // Get the player address from the list of units.
                DataPointer unitAddress = game.UnitLists[0][client.UnitId & 0x7F];
                if (unitAddress.IsNull)
                {
                    return(null);
                }

                // Read player with player data.
                var player     = reader.Read <D2Unit>(unitAddress);
                var playerData = player.UnitData.IsNull ?
                                 null : reader.Read <D2PlayerData>(player.UnitData);

                return(new D2GameInfo(game, player, playerData));
            }
            catch (ProcessMemoryReadException)
            {
                return(null);
            }
        }
Exemple #2
0
        public void Log(D2Game game, LogType logType, string message, params object[] args)
        {
            var overrideColor = Color.Empty;

            var argList = new List <object>(args);

            if (argList.Count > 0 && argList[0] is Color)
            {
                overrideColor = (Color)argList[0];
                argList.RemoveAt(0);
            }

            var time    = DateTime.Now;
            var dateStr = string.Format("[{0:D2}:{1:D2}:{2:D2}] ", time.Hour, time.Minute, time.Second);

            game.Overlay.logTextBox.InvokeAppendLine(dateStr, logType == LogType.Warning ? WarningColor : DefaultColor);

            if (header != "")
            {
                game.Overlay.logTextBox.InvokeAppendText(header + ": ", headerColor);
            }

            game.Overlay.logTextBox.InvokeAppendText(message, logType == LogType.Warning ? WarningColor : (overrideColor != Color.Empty ? overrideColor : DefaultColor), argList.ToArray());
        }
        // 1.14d: see game.552F60
        // get unit from the game unit list
        private D2Unit UnitByTypeAndGuid(D2Game game, D2UnitType type, int guid)
        {
            DataPointer unitAddress = game.UnitLists[(int)type][guid & 0x7F];

            return(UnitByGuid(unitAddress, guid));
        }
Exemple #4
0
 public InfravisionBreakPoint(D2Game game) : base(game, "d2client.dll", 0xB4A23)
 {
 }
Exemple #5
0
 public GameInfo(D2Game game, D2Unit player, D2PlayerData playerData)
 {
     Game       = game;
     Player     = player;
     PlayerData = playerData;
 }
Exemple #6
0
 public AutoTeleHandler(D2Game game)
 {
     this.game = game;
     th        = new Thread(() => Loop());
     th.Start();
 }
Exemple #7
0
 public LightBreakPoint(D2Game game) : base(game, "d2client.dll", 0x233A7)
 {
 }
Exemple #8
0
        public IActionResult func_getPwdByMail(string gate, int number, string email, string pstype, string lang, int ip)
        {
            if (!DC2Conf.IsProg && !this.IsVIP())
            {
                return(this.FuncResult(new APIReturn(-97, "IP没有访问权限")));
            }

            if (gate.IsNullOrEmpty())
            {
                return(this.FuncResult(new APIReturn(10000, "参数错误(gate)")));
            }
            if (email.IsNullOrEmpty() || !Utilities.IsValidEmail(email))
            {
                return(this.FuncResult(new APIReturn(10302, "帐号格式错误")));
            }

            string sendEmail = email;

            if (sendEmail.EndsWith("@2980.com"))
            {
                return(this.FuncResult(new APIReturn(10350, "2980帐号请到2980邮箱操作")));
            }
            if (number < 10000)
            {
                number = getnumberbyemail(email);
            }

            string[] mailfixs = new string[] { "yahoo.com.cn", "yahoo.cn" };
            if (Array.IndexOf <string>(mailfixs, sendEmail.Split('@')[1]) != -1)
            {
                DCClass dcc_urs = new DCClass();
                if (number < 20000000)//将升级到多益通帐号的number转成多益通number
                {
                    number = dcc_urs.URS_GetURSNumberByNumber(number);
                }
                dcc_urs = new DCClass();
                string bindMail = dcc_urs.URS_GetBindMail(number);
                if (!string.IsNullOrEmpty(bindMail) && bindMail.Length > 5)
                {
                    sendEmail = bindMail;
                }
            }

            bool tooMuch = D2getpass.CheckLast(email, 0, 1);

            if (tooMuch)
            {
                return(this.FuncResult(new APIReturn(10323, "找回密码太过频繁")));
            }

            EGTP egtpType = EGTP.邮箱找回密码;

            if (pstype == "web")//默认游戏
            {
                egtpType = EGTP.邮箱找回密码_网站;
            }
            D2getpassInfo passInfo = new D2getpassInfo()
            {
                GtpsGUID   = Guid.NewGuid().ToString("N"),
                GtpsIP     = ip,
                GtpsState  = (int)EGST.未发送,
                GtpsType   = (int)egtpType,
                GtpsGate   = gate,
                GtpsNumber = number,
                GtpsEMail  = sendEmail,
                GtpsTime1  = DateTime.Now
            };

            D2getpass.Insert(passInfo);

            bool rc = D2Game.Func_SendMail(passInfo, lang, _viewRender);

            if (rc)
            {
                Hashtable ht = new Hashtable();
                ht.Add("email", email);
                //重置成功
                return(this.FuncResult(new APIReturn(0, "", ht)));
            }
            else
            {
                return(this.FuncResult(new APIReturn(10502, "找回密码邮件发送失败")));
            }
        }
 public ItemNameBreakPoint(D2Game game) : base(game, "d2client.dll", 0x96736)
 {
 }
 public ReceivePacketBreakPoint(D2Game game) : base(game, "d2client.dll", 0x832FF)
 {
 }
Exemple #11
0
 public D2BreakPoint(D2Game game, string moduleName, uint address)
     : base(new IntPtr(address), 1, BreakpointCondition.Code)
 {
     this.Game       = game;
     this.moduleName = moduleName;
 }
Exemple #12
0
 public ViewInventoryBp1(D2Game game) : base(game, "d2client.dll", 0x997B2)
 {
 }
Exemple #13
0
 public WeatherBreakPoint(D2Game game) : base(game, "d2common.dll", 0x30C92)
 {
 }
Exemple #14
0
 public ViewInventoryBp2(D2Game game) : base(game, "d2client.dll", 0x98E84)
 {
 }
Exemple #15
0
 public ViewInventoryBp3(D2Game game) : base(game, "d2client.dll", 0x97E1A)
 {
 }
Exemple #16
0
        //protected List<ushort> m_aCollisionTypes = new List<ushort>();

        public CollisionMap(D2Game game)
        {
            this.game = game;
            m_map     = new WordMatrix();
        }