Register for your free account! | Forgot your password?

You last visited: Today at 23:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



DPS Meter Problem

Discussion on DPS Meter Problem within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,221
Received Thanks: 1,457
DPS Meter Problem

1 Problem the first attacker is adding in table but not record the dmg
2 Problem popup only if a second char attack
3 Problem its update all chars dmg if one char attack

Does anyone know where the problem is?

Code:
#region UNIQUE_SELECT
                                else if (_pck.Opcode == 0xB070)
                                {
                                    try
                                    {
                                        DataTable dame = Task.Run(async () => await sqlCon.GetList($"SELECT * FROM SRO_VT_MAIN.._DPSMetterDame Where TargetID = {this.uinque078} ORDER BY DameCount DESC")).Result;
                                        byte isSuccess = _pck.ReadUInt8();
                                        if (isSuccess == 1) //
                                        {
                                            _pck.ReadUInt8();
                                            _pck.ReadUInt8();
                                            this.Skill_ID = _pck.ReadInt32();
                                            this.uinque = _pck.ReadUInt32(); //char unique id 
                                            _pck.ReadUInt32();
                                            this.uinque2 = _pck.ReadInt32(); //boss uniqueid
                                            _pck.ReadUInt8();
                                            byte atackType = _pck.ReadUInt8();
                                            if (atackType == 2)
                                            {
                                                _pck.ReadUInt8();
                                                _pck.ReadUInt32();
                                                _pck.ReadUInt8();
                                                _pck.ReadUInt32();
                                                _pck.ReadUInt32();
                                                _pck.ReadUInt8();
                                                _pck.ReadUInt8();
                                                this.dame1 = _pck.ReadUInt16();
                                            }
                                            Task.Run(async () => await sqlCon.exec($"EXEC [SRO_VT_MAIN].[dbo].[_UpdateDPS] '{this.sqlCharName}', {dame1},{this.uinque},'{this.uinque2}'"));
                                            if (MainForm.UniqueSkills.Contains(Skill_ID))//check if in list unique_skill
                                            {
                                                Task.Run(async () => await sqlCon.exec($"EXEC [SRO_VT_MAIN].[dbo].[_UpdateDPS] '{this.sqlCharName}', {dame1},{this.uinque},'{this.uinque2}'"));
                                                this.updateDPS();
                                                this.UniqueSelectST = true;
                                                this.UniqueSELECT2();
                                                Send(true);
                                            }
                                            else
                                            {
                                                this.UniqueSelectST = false;
                                                this.UniqueSELECT0();
                                                Send(true);
                                            }
                                        }
                                    }
                                    catch { }
                                }
                                else if (_pck.Opcode == 0x3057)
                                {
                                    _pck.ReadUInt32();
                                    if (_pck.ReadUInt8() == 0x10)
                                    {
                                        this.updateDPS();
                                        UniqueSELECT0();
                                        Send(true);
                                    }
                                    //else if(!this.UniqueSelectST)
                                    //{
                                    //    this.HideControl(5011, 5);
                                    //    this.CleanDPS();
                                    //}
                                }
                                else if (_pck.Opcode == 0x3013)
                                {
                                    this.updateDPS();
                                    UniqueSELECT0();
                                    Send(true);
                                }
                                else if (_pck.Opcode == 0xB071)
                                {
                                    try
                                    {
                                        byte isSuccess = _pck.ReadUInt8();
                                        if (isSuccess == 1)
                                        {
                                            uint uinque071 = _pck.ReadUInt32();
                                            uint uinque073 = _pck.ReadUInt32();
                                            //MainForm.WriteLine(2, "uinque073 ID [" + uinque073 + "]");
                                            byte hasDmg = _pck.ReadUInt8();
                                            if (hasDmg == 1)
                                            {
                                                byte hitcount = _pck.ReadUInt8();

                                                byte targetCount = _pck.ReadUInt8();

                                                for (uint i = 0; i < targetCount; i++)
                                                {
                                                    uint uinque072 = _pck.ReadUInt32(); //boss id
                                                    //MainForm.WriteLine(2, "SKILL ID 071 [" + this.Skill_ID + "]");
                                                    for (uint ii = 0; ii < hitcount; ii++)
                                                    {
                                                        byte effects = _pck.ReadUInt8();   // bitmask --> ATTACK_STATE_KNOCKBACK = 0x01,    ATTACK_STATE_BLOCK = 0x02,    ATTACK_STATE_POSITION = 0x04,   abort ? --> 0x08   ATTACK_STATE_DEAD = 0x80

                                                        byte dmgSource = _pck.ReadUInt8();// bitmask --> DAMAGE_STATE_NORMAL = 0x01,    DAMAGE_STATE_CRIT = 0x02,    DAMAGE_STATE_STATUS = 0x10
                                                        if ((effects & 0x0A) != 0x00)  // if ATTACK_STATE_BLOCK or abort --> no more data
                                                        {
                                                            continue;
                                                        }

                                                        this.targetCoun7t = _pck.ReadUInt32();
                                                        if (uinque072 != this.uniqueID && this.uniqueID == this.uinque)
                                                        {
                                                            this.uinque078 = uinque072;
                                                            
                                                            if (this.UniqueSelectST&& this.targetCoun7t<3000000)
                                                            {
                                                                Task.Run(async () => await sqlCon.exec($"EXEC [SRO_VT_MAIN].[dbo].[_UpdateDPS] '{sqlCon.clean(this.sqlCharName)}', {this.targetCoun7t},{uinque078},'{this.uniqueID}'"));
                                                            }
                                                        }
                                                        else
                                                        {
                                                            this.targetCoun7t = 0;
                                                        }
                                                        _pck.ReadUInt8();
                                                        _pck.ReadUInt8();
                                                        _pck.ReadUInt8();
                                                    }
                                                }
                                            }
                                            else if (isSuccess == 2)
                                            {
                                                MainForm.WriteLine(2, "a3 [" + isSuccess + "]");
                                            }
                                        }
                                    }
                                    catch { }
                                }
                                #endregion
Code:
 public void updateDPS()
        {
            DataTable dame = Task.Run(async () => await sqlCon.GetList($"SELECT * FROM SRO_VT_MAIN.._DPSMetterDame Where TargetID = {this.uinque078} ORDER BY DameCount DESC")).Result;
            int i = 1;
            foreach (DataRow dts in dame.Rows)
            {

                string Name = dts["CharName"].ToString();
                string DameCount = dts["DameCount"].ToString();
                string TargetID = dts["TargetID"].ToString();
                int code;
                int.TryParse(DameCount.ToString(), out code);
                uint TargetIDS;
                uint.TryParse(TargetID.ToString(), out TargetIDS);
                if (i == 1)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a1 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 1);
                }
                if (i == 2)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a2 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 2);
                }
                if (i == 3)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a3 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 3);
                }
                if (i == 4)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a3 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 4);
                }
                if (i == 5)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a3 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 5);
                }
                if (i == 6)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a3 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 6);
                }
                if (i == 7)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a3 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 7);
                }
                if (i == 8)
                {
                    if (TargetIDS == uinque078)
                        //MainForm.WriteLine(2, "a3 [" + i + "]");
                        this.ShowControl(5011, 1, Name, code, 8);
                }
                if (i > 9)
                    break;
                i++;

            }
        }
NorseGodTyr is offline  
Old 10/21/2020, 14:44   #2
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,221
Received Thanks: 1,457
Quote:
Originally Posted by thaidu0ngpr0 View Post


not doing but asking for food
i have do more for the community than you will ever do

Quote:
Originally Posted by thaidu0ngpr0 View Post


not doing but asking for food
Are you talking about yourself
NorseGodTyr is offline  
Old 10/21/2020, 16:56   #3
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,097
Received Thanks: 889
Oh no! Are you seriously updating SQL each hit done on a unique!!

Never do that dude, that will exhaust both your SQL and tool and result errors on traffic.
#HB is offline  
Thanks
1 User
Old 10/21/2020, 17:33   #4
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,221
Received Thanks: 1,457
Quote:
Originally Posted by #HB View Post
Oh no! Are you seriously updating SQL each hit done on a unique!!

Never do that dude, that will exhaust both your SQL and tool and result errors on traffic.
the dps source is from thaidu0ngpr0 i know its buggy that why i ask
NorseGodTyr is offline  
Old 12/14/2020, 07:29   #5
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 344
Received Thanks: 770
The code looks pretty weird actually.

0xB070 it's checking if the SKILL_ID exist on a UNIQUES SKILL LIST?
I don't know, kind tracking if the unique attacks a player but not when player is attacking?

This is a better example about how to parse skill start/end.

You won't need to parse any other packet to do the job.

You'll have to check if at least one TargetUniqueID from the skill belongs to a Unique Mob to track the damage from it, otherwise just ignore it.
JellyBitz is offline  
Thanks
4 Users
Old 02/01/2021, 13:22   #6
 
Exner.'s Avatar
 
elite*gold: 5
Join Date: Jul 2020
Posts: 182
Received Thanks: 53
If you find a solution, let us know I have the same problem
Exner. is offline  
Reply


Similar Threads Similar Threads
DPS Meter?
06/17/2016 - Blade & Soul - 15 Replies
any one have a clue? I donwloaded ACT and use the bns dps meter that is currently floating around but i couldnt get it to log anything >_<
Tera DPS Meter
01/28/2015 - Tera - 11 Replies
This tool acts as a DPS meter for TERA. It uses winpcap to sniff the network traffic for the damage packages. It's not touching TERA in any way and provides a HTML interface for displaying the results. It's not an live DPS overlay, but rather displays the results of a fight after the mob has been killed. Screenshot: http://i.imgur.com/zRwZJAI.jpg Download Version 1.2.0: https://www.sendspace.com/file/vdz5cx VT: http://goo.gl/SyevOn
[LF] german dps meter
04/03/2011 - Aion - 0 Replies
ich suche ein programm das den dps misst und auch mit deutschen clients funzt.



All times are GMT +2. The time now is 23:40.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.