markdwags / Razor

Razor is a free tool designed to help with simple tasks while playing Ultima Online.
https://www.razorce.com
GNU General Public License v3.0
139 stars 97 forks source link

[BUG] systemmessagesgump #201

Closed DemonRok closed 1 year ago

DemonRok commented 2 years ago

last Razor Dev Preview

Sometime, when sysmsgs exceed 3rd page, by selecting a text or closing gump, the client disconnects. On the server log is indicated: Humongous packet (length 2569) type 0xB1, 1280 bytes. I'm using polserver and CUO.

markdwags commented 1 year ago

I spun up a polserver locally and was able to reproduce the issue. This doesn't occur on non polservers.

Marking this one help wanted, hopefully something who has experience with a polserver could shed some light on the situation.

DemonRok commented 1 year ago

I solved by reducing the number of pages of the gump, accordingly reducing the number of saved sysmsgs and reordering them.

Razor\Core\SystemMessages.cs

 if (Messages.Count == 0)
            { 
                Messages.Add(text);
            }
            else
            { 
                Messages.Insert(0, text);
            }
            if (Messages.Count >= 16)
            {
                Messages.RemoveAt(Messages.Count - 1);
            }

Razor\Gumps\Internal\SystemMessagesGump.cs

 public SystemMessagesGump() : base(5, 35)
        {
            Closable = true;
            Disposable = true;
            int id = 0;
            int count = 0;
            //foreach (string message in SystemMessages.Messages.ToArray().Reverse())
            foreach (string message in SystemMessages.Messages.ToArray())
markdwags commented 1 year ago

That's more of a work around vs. an actual solution. Default Razor system message queue was 25, I bumped it to 100 recently. You change sets it to 16.

DemonRok commented 1 year ago

Yes you are absolutely right, it is not a solution but a correction of the case, limited to the pol. But being a limited "problem" I'd say leave it as solved