RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Mono Custom Gumps Problem?

KonssnoK

Sorceror
Mono Custom Gumps Problem?

Hi all, i'm using Runuo on mono 1.9 and on XP with .net.

I have no prob running on XP

but instead using mono i can't use customized gumps apart for the first i open..

Example :
logged, [admin -> gump appears.
[who [add .. does not appear anymore.. ( even if i retype [admin )

Vendors gumps work.

in Xp have no prob.

Help :)
 

evilgoat

Wanderer
Was there a fix for this? I'm having the same problem.

1st time ok, 2nd time chinese characters, 3rd time client crash.

No error on console usually, when I keep trying to load gumps I get, Client: 124.169.*.*: Too much data pending, disconnecting...
 

Scriptiz

Sorceror
It was the same for me (Mono 1.2.6) but it was an error due to the bad reference to libz.

This command solved it :

Code:
sudo ln -s /usr/lib/libz.so.1 /usr/lib/libz.so

It create a symbolic link to libz.so.1 on the name of libz.so :)
 

ZackCrick

Sorceror
I'm using Mono 1.9.1 on Debian Lenny and i have the same problem with the gumps. I can open one gump and afterwards no more. When i spam for example Admin i receive a "Compression buffer overflowed on packet 0xDD ('DisplayGumpPacked') (length=0) and the client is disconnected.

If it is libz related - i'm using libz.so.1.2.3.3
Any suggestions?
 

Scriptiz

Sorceror
This must work for you ZackCrick :
Code:
sudo ln -s /usr/lib/libz.so.1.2.3.3 /usr/lib/libz.so

Before check if libz.so.1.2.3.3 is the real file that you have :
Code:
cd /usr/lib/
ls libz*

It will return you all the files that begin with libz so you can see on wich one you have to do the symbolic link.
 
As far as I know the symbolic links do exist already:

Code:
/usr/lib# ls -l libz*
lrwxrwxrwx 1 root root    18  2. Aug 20:19 libz.so -> /usr/lib/libz.so.1
lrwxrwxrwx 1 root root    15  1. Aug 17:45 libz.so.1 -> libz.so.1.2.3.3
-rw-r--r-- 1 root root 93504  6. Apr 20:18 libz.so.1.2.3.3

The reason has to be something else.

The Runuo.exe is compiled from SVN 300 with Mono 1.9.1 using the 07Feb08 RunUOForge fixes.
And an additional fix to the CastConvertList<TInput,TOutput> in Utility.cs.
 
I did some further testing. It is clearly ZLib (libz) related.
I disabled the compressed packets in Gump.cs and everything gump related works like a charm.
So I checked what else the compression is used for and wether it is messed up aswell.
Testing custom houses made it obvious, that there has to be some serious problem with libz, because it ain't visible in the client.

I get the following error in the console, when placing a custom house:
Code:
OnDelete()ZLib error: BufferError (#-5)
ZLib error: BufferError (#-5)

Any help on how this might be solved is appreciated.

*edit
might be related:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=258087

*edit2
It's a 64 Bit AMD CPU.
 
I found some more information on the error in the log files:

compression_overflow.log
Code:
02.08.2008 20:28:46 Warning: Compression buffer overflowed on packet 0xDD ('DisplayGumpPacked') (length=0)
   at Server.Network.Packet.InternalCompile(Boolean compress)
   at Server.Network.Packet.Compile(Boolean compress, Int32 ByRef length)
   at Server.Network.NetState.Send(Server.Network.Packet p)
   at Server.Gumps.Gump.SendTo(Server.Network.NetState state)
   at Server.Mobile.SendGump(Server.Gumps.Gump g, Boolean throwOnOffline)
   at Server.Mobile.SendGump(Server.Gumps.Gump g)
   at Server.Gumps.AdminGump.Admin_OnCommand(Server.Commands.CommandEventArgs e)
   at Server.Commands.CommandSystem.Handle(Server.Mobile from, System.String text, MessageType type)
   at Server.Mobile.DoSpeech(System.String text, System.Int32[] keywords, MessageType type, Int32 hue)
   at Server.Mobiles.PlayerMobile.DoSpeech(System.String text, System.Int32[] keywords, MessageType type, Int32 hue)
   at Server.Network.PacketHandlers.UnicodeSpeech(Server.Network.NetState state, Server.Network.PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(Server.Network.NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(System.String[] args)

null_send.log
Code:
02.08.2008 20:28:46 Client: 192.168.191.24: null buffer send, disconnecting...
   at Server.Network.NetState.Send(Server.Network.Packet p)
   at Server.Gumps.Gump.SendTo(Server.Network.NetState state)
   at Server.Mobile.SendGump(Server.Gumps.Gump g, Boolean throwOnOffline)
   at Server.Mobile.SendGump(Server.Gumps.Gump g)
   at Server.Gumps.AdminGump.Admin_OnCommand(Server.Commands.CommandEventArgs e)
   at Server.Commands.CommandSystem.Handle(Server.Mobile from, System.String text, MessageType type)
   at Server.Mobile.DoSpeech(System.String text, System.Int32[] keywords, MessageType type, Int32 hue)
   at Server.Mobiles.PlayerMobile.DoSpeech(System.String text, System.Int32[] keywords, MessageType type, Int32 hue)
   at Server.Network.PacketHandlers.UnicodeSpeech(Server.Network.NetState state, Server.Network.PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(Server.Network.NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(System.String[] args)

If I understood that correctly then Zlib return the "Buffer Error" when it is passed an empty buffer. And that this behavior is new since a few versions.
 
I got it.
It's a compatibility issue between windows and unix.
Koders Code Search: ZLib.cs - C# - GPL
gave me the idea on what to do.

I edited Compression.cs in the following way:

Code:
//...

public sealed class CompressorUnix : ICompressor {
		[DllImport( "libz" )]
		private static extern string zlibVersion();

		[DllImport( "libz" )]
		private static extern ZLibError compress( byte[] dest, ref long destLength, byte[] source, int sourceLength );

		[DllImport( "libz" )]
		private static extern ZLibError compress2( byte[] dest, ref long destLength, byte[] source, int sourceLength, ZLibQuality quality );

		[DllImport( "libz" )]
		private static extern ZLibError uncompress( byte[] dest, ref long destLen, byte[] source, int sourceLen );

		public CompressorUnix() {
		}

		public string Version {
			get {
				return zlibVersion();
			}
		}

		public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
            long d = destLength;
            ZLibError ret = compress( dest, ref d, source, sourceLength );
            destLength = (int)d;
            return ret;
		}

		public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength, ZLibQuality quality ) {
            long d = destLength;
            ZLibError ret = compress2( dest, ref d, source, sourceLength, quality );
            destLength = (int)d;
            return ret;
		}

		public ZLibError Decompress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
            long d = destLength;
            ZLibError ret = uncompress( dest, ref d, source, sourceLength );
            destLength = (int)d;
            return ret;
		}
	}

//...

I noticed, that without a user name and pass I am not able to commit to the svn.
But I think it would make a valuable addition.
 

ntony

Sorceror
Lord_Helmchen;772422 said:
I got it.
It's a compatibility issue between windows and unix.
Koders Code Search: ZLib.cs - C# - GPL
gave me the idea on what to do.

I edited Compression.cs in the following way:

Code:
//...

public sealed class CompressorUnix : ICompressor {
		[DllImport( "libz" )]
		private static extern string zlibVersion();

		[DllImport( "libz" )]
		private static extern ZLibError compress( byte[] dest, ref long destLength, byte[] source, int sourceLength );

		[DllImport( "libz" )]
		private static extern ZLibError compress2( byte[] dest, ref long destLength, byte[] source, int sourceLength, ZLibQuality quality );

		[DllImport( "libz" )]
		private static extern ZLibError uncompress( byte[] dest, ref long destLen, byte[] source, int sourceLen );

		public CompressorUnix() {
		}

		public string Version {
			get {
				return zlibVersion();
			}
		}

		public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
            long d = destLength;
            ZLibError ret = compress( dest, ref d, source, sourceLength );
            destLength = (int)d;
            return ret;
		}

		public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength, ZLibQuality quality ) {
            long d = destLength;
            ZLibError ret = compress2( dest, ref d, source, sourceLength, quality );
            destLength = (int)d;
            return ret;
		}

		public ZLibError Decompress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
            long d = destLength;
            ZLibError ret = uncompress( dest, ref d, source, sourceLength );
            destLength = (int)d;
            return ret;
		}
	}

//...

I noticed, that without a user name and pass I am not able to commit to the svn.
But I think it would make a valuable addition.


Hi Lord_Helmchen!

I got the same finding as yours and did the same thing as well. However, I failed on fixing it. Perhaps I havent' fixed it correctly because I didn't assign the destLength to a long variable on the compress() function inplementation.

As a supplement, I think you should also edit the sourceLength variable type to long.
 
ntony;780495 said:
Hi Lord_Helmchen!

I got the same finding as yours and did the same thing as well. However, I failed on fixing it. Perhaps I havent' fixed it correctly because I didn't assign the destLength to a long variable on the compress() function inplementation.

As a supplement, I think you should also edit the sourceLength variable type to long.

Indeed, sourceLength should be a long, too. That's an oversight by me.
The actual fix is changing the type to long, because otherwise it won't work.
 

ntony

Sorceror
I got it fixed.

I edited the Compression.cs in source code ur_src_code_dir/Network directory.

I'm not sure if this can fix or ruin your own risk if you use it.
 

Attachments

  • Compression.cs
    12.9 KB · Views: 17
Top