ScriptUO

Scripting Resources & Utilities => Stealth Client => Topic started by: Blacklisted on May 31, 2016, 02:38:35 PM

Title: Getting Disconnected(Duplicates are not allowed)
Post by: Blacklisted on May 31, 2016, 02:38:35 PM
i am trying out some simple code to cast consecrate weapon but I keep getting disconnected after the second cast of the spell with the message "Duplicates are not allowed"

The call stack shows

Code: [Select]
An exception raised at 23:33:40:611
Duplicates not allowed
(00882C80){Stealth.exe } [00C83C80] ClassCharacter.{System.Generics.Collections}TDictionary<System.Word,ScriptTypes.TBuffIcon>.Add (Line 1846, "System.Generics.Collections.pas")
Call stack:
  (00882C7B){Stealth.exe } [00C83C7B] ClassCharacter.{System.Generics.Collections}TDictionary<System.Word,ScriptTypes.TBuffIcon>.Add (Line 1844, "System.Generics.Collections.pas")
  (008794F9){Stealth.exe } [00C7A4F9] ClassCharacter.TCharacter.GetInfoFromPacket_0xDF (Line 10422, "ClassCharacter.pas")
  (0086DA48){Stealth.exe } [00C6EA48] ClassCharacter.TCharacter.RedirectGamePacket (Line 6457, "ClassCharacter.pas")
  (0086BF8E){Stealth.exe } [00C6CF8E] ClassCharacter.TCharacter.GameClientOnRead (Line 5863, "ClassCharacter.pas")
  (002CCE91){Stealth.exe } [006CDE91] System.Win.ScktComp.TCustomSocket.Event (Line 1903, "System.Win.ScktComp.pas")
  (002CB42E){Stealth.exe } [006CC42E] System.Win.ScktComp.TCustomWinSocket.Event (Line 1013, "System.Win.ScktComp.pas")
  (002CBA09){Stealth.exe } [006CCA09] System.Win.ScktComp.TCustomWinSocket.WndProc (Line 1201, "System.Win.ScktComp.pas")
  (000D5CAC){Stealth.exe } [004D6CAC] System.Classes.StdWndProc (Line 16600, "System.Classes.pas")

Here's my code but I cant figure out whats wrong

Code: [Select]
class Program
    {
        static void Main(string[] args)
        {
            PlayerMobile player = PlayerMobile.GetPlayer();
            int hp = player.Hits;

            var spellname = string.Empty;
            var delay = 0;
            do
            {
                if (player.WarMode)
                {
                    if (player.Mana > 35 && hp > 35)
                    {
                        spellname = "Consecrate Weapon";
                        player.Cast(spellname);
                        delay = 4000;
                        Stealth.Client.Wait(delay);
                    }
                }
            } while (!player.Dead);
        }
    }
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: The Ghost on May 31, 2016, 02:44:28 PM
Which shard are you on and do you have the right client. 
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Blacklisted on May 31, 2016, 03:34:50 PM
Hi Ghost thanks for replying I'm on ATL OSl.
I've set the client to 7.0.50.0 in the stealth settings.
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: The Ghost on May 31, 2016, 05:11:57 PM
U just lost me, I don't do stealth yet.  Need to wait for crome to get on
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Tidus on June 01, 2016, 04:41:13 AM
The way it looks on your call stack is that it is trying to add the buff twice and you can only add it to the collection once.  So it is causing that error.

Are you using ScriptSDK or a different DLL for the C#?

i am trying out some simple code to cast consecrate weapon but I keep getting disconnected after the second cast of the spell with the message "Duplicates are not allowed"

The call stack shows

Code: [Select]
An exception raised at 23:33:40:611
Duplicates not allowed
(00882C80){Stealth.exe } [00C83C80] ClassCharacter.{System.Generics.Collections}TDictionary<System.Word,ScriptTypes.TBuffIcon>.Add (Line 1846, "System.Generics.Collections.pas")
Call stack:
  (00882C7B){Stealth.exe } [00C83C7B] ClassCharacter.{System.Generics.Collections}TDictionary<System.Word,ScriptTypes.TBuffIcon>.Add (Line 1844, "System.Generics.Collections.pas")
  (008794F9){Stealth.exe } [00C7A4F9] ClassCharacter.TCharacter.GetInfoFromPacket_0xDF (Line 10422, "ClassCharacter.pas")
  (0086DA48){Stealth.exe } [00C6EA48] ClassCharacter.TCharacter.RedirectGamePacket (Line 6457, "ClassCharacter.pas")
  (0086BF8E){Stealth.exe } [00C6CF8E] ClassCharacter.TCharacter.GameClientOnRead (Line 5863, "ClassCharacter.pas")
  (002CCE91){Stealth.exe } [006CDE91] System.Win.ScktComp.TCustomSocket.Event (Line 1903, "System.Win.ScktComp.pas")
  (002CB42E){Stealth.exe } [006CC42E] System.Win.ScktComp.TCustomWinSocket.Event (Line 1013, "System.Win.ScktComp.pas")
  (002CBA09){Stealth.exe } [006CCA09] System.Win.ScktComp.TCustomWinSocket.WndProc (Line 1201, "System.Win.ScktComp.pas")
  (000D5CAC){Stealth.exe } [004D6CAC] System.Classes.StdWndProc (Line 16600, "System.Classes.pas")

Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Crome969 on June 01, 2016, 05:22:54 AM
I understand the issue, will contact vizit0r.. Seems like we miss a "if (not data.containskey(key))" checkup. It tries to store data about buffs in a dictionary. duplicate identifiers arent allowed in dictionaries.

Thank you for reporting!
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Blacklisted on June 01, 2016, 11:23:02 AM
@Tidus I'm using ScriptSDK version 0.9 and stealth 6.7
no dramas, hi five
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Vizit0r on June 01, 2016, 08:19:07 PM
long, long time ago this bug fixed.
Just use newest version (7.4 instead of 6.7.1)
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Blacklisted on June 02, 2016, 01:34:22 AM
I was using 7.4 but it was causing the client to crash when using the graphical client. I'll give it another go tonight when I get home form work.
thanks   :D
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Blacklisted on June 02, 2016, 10:05:26 AM
I've tried using steath v7.4 ran as Administrator but im still getting a client crash when hitting the start client button.
when I debug with visual studio 2015 I get the error "Unhandled exception at 0x028171D8 (dbghelp.dll) in client.exe: 0xC0000005: Access violation writing location 0x63DB0DA0."

dbghelp.dll not loaded. but i think that is to do with the debugger not being able to access that dll so i cant give a more accurate explanation of what may be causing the crash.




Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: smitty on June 02, 2016, 09:28:21 PM
I was having that issue as well. What fixed it for me was clicking on the configuration button, going to the server tab and unchecking the "use dll" option. Hope this helps
Title: Re: Getting Disconnected(Duplicates are not allowed)
Post by: Blacklisted on June 03, 2016, 08:15:38 AM
Thanks Smitty its working now, I guess that's my weekend planned now lol