RunUO 1.0_Final Help Please...

Discussion in 'Script Support' started by Sythen, Feb 16, 2017.

  1. Sythen

    Sythen Sorceror

    Messages:
    2,744
    I am going through each runuo version trying to get them to work correctly... right now I'm on RunUO 1.0_Final.
    The problem I am having with the TargetCommands and the CommandHandler commands is that I always get a server crash with the following error: (this example is from the [who command)

    Server Crash Report
    ===================

    RunUO Version 1.0.0, Build 0
    Operating System: Microsoft Windows NT 6.2.9200.0
    .NET Framework: 2.0.50727.8745
    Time: 2/16/2017 9:02:05 PM
    Mobiles: 1
    Items: 30
    Clients:
    - Count: 1
    + 174.64.110.2: (account = A.A.R) (mobile = 0x1 'Test')

    Exception:
    System.OverflowException: Arithmetic operation resulted in an overflow.
    at System.IntPtr.ToInt32()
    at Server.Gumps.Gump.GetTypeID(Type type)
    at Server.Gumps.Gump..ctor(Int32 x, Int32 y)
    at Server.Gumps.WhoGump..ctor(Mobile owner, ArrayList list, Int32 page) in c:\Users\trf-c\Desktop\Test Server\Scripts\Communication\Game\Command\Who.cs:line 116
    at Server.Gumps.WhoGump..ctor(Mobile owner) in c:\Users\trf-c\Desktop\Test Server\Scripts\Communication\Game\Command\Who.cs:line 111
    at Server.Gumps.WhoGump.WhoList_OnCommand(CommandEventArgs e) in c:\Users\trf-c\Desktop\Test Server\Scripts\Communication\Game\Command\Who.cs:line 21
    at Server.Commands.Handle(Mobile from, String text)
    at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
    at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
    at Server.Network.MessagePump.HandleReceive(NetState ns)
    at Server.Network.MessagePump.Slice()
    at Server.Core.Main(String[] args)

    Below I've included my who script and the base script for this command:

  2. Arvoreen

    Arvoreen Sorceror

    Messages:
    2,606
    I would say setup some debugging for all your maths in your gump to monitor the values for sanity. It looks as if somewhere in your whogump some numbers are perhaps getting out of control and exceeding what an Int32 will hold. I would check and double check all of them to make sure nothing is exceeding expected values.

    Also, side advice, you should use gist (https://gist.github.com/) or something for code samples, with everything in your post being completely left-aligned, makes it nearly impossible to read. :)
  3. Sythen

    Sythen Sorceror

    Messages:
    2,744
    This issue has been fixed... thanks for the advice :)

    The problem wasn't within the command scripts, the issue was using a 32-Bit application on a 64-Bit machine; somehow the this can mess with certain functions, even if the 32-Bit application seems to run successfully.
    Last edited: Feb 17, 2017
  4. Sythen

    Sythen Sorceror

    Messages:
    2,744
    My apologies though, normally I would post the fix that was made but I forgot where it was, and forgot to comment it. It was a late evening last night and I had a lot of help trying to fix this issue.

    **20 minutes later**

    So I reviewed the code from last night and found the fix for everything. This will stop the RunUO 1.0_Final server console from crashing when ever you type an admin command; some commands worked, while others would restart the server over and over again.

    In Gump.cs:

    around line 42... (your line will be different)... Look for: public Gump(int x, int y)

    You'll have a similar line to this:

    m_TypeID = GetTypeID( this.GetType() );

    and you'll need to change it to this:

    m_TypeID = GetType().FullName.GetHashCode();

    In Mobile.cs:

    around line 6004... (your line will be different)... Look for:
    public bool CloseGump( Type type, int buttonID, bool throwOnOffline )

    You'll have a similar line to this:

    m_NetState.Send( new CloseGump( Gump.GetTypeID( type ), buttonID ) );

    and you'll need to change it to this:

    m_NetState.Send(new CloseGump(type.FullName.GetHashCode(), buttonID));

    __________________________________________

    These are both core changes which means that you will need to recompile the server. I hope this makes sense. I would like to thank the person who helped me; you know who you are. I appreciated the help getting this up and running. :)
    Last edited: Feb 17, 2017
  5. Fraz

    Fraz Traveler

    Messages:
    164
    Looking forward to working with you a lot more in the future!
    Sythen likes this.

Share This Page