Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 10-23-2007, 05:35 PM   #1 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,260
Default Ultima.dll StringList crash

Quote:
Server Crash Report
===================

RunUO Version 2.0, Build 2815.17577
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.832
Time: 10/23/2007 4:30:57 PM
Mobiles: 1
Items: 23
Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'.
Parameter name: chars
at System.Text.Encoding.ThrowCharsOverflow()
at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded)
at System.Text.UTF8Encoding.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, DecoderNLS baseDecoder)
at System.Text.DecoderNLS.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, Boolean flush)
at System.Text.DecoderNLS.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex, Boolean flush)
at System.Text.DecoderNLS.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex)
at System.IO.BinaryReader.InternalReadOneChar()
at System.IO.BinaryReader.Read()
at System.IO.BinaryReader.PeekChar()
at Ultima.StringList..ctor(String language)
at Server.AAHS.AAHS_Main.Initialize() in c:Ultima OnlineRunUOBlunt UOScriptsCustomEnginesAnti-AFK Harvest SystemMain.cs:line 29
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Objec t target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Server.ScriptCompiler.Compile(Boolean debug, Boolean cache)
at Server.Core.Main(String[] args)

Clients:
- Count: 0
Code:
using System;
using System.Collections.Generic;
using System.IO;
using Server;
using Server.Commands;
using Ultima;

namespace Server.AAHS
{
	public class AAHS_Main
	{
		public static int Version = 100;
		public static string ReleaseDate = "October 23, 2007";

		public static List<int> BodyTable;
		public static StringList stringList;

		[Usage("AAHS")]
		public static void AAHS_OnCommand(CommandEventArgs e)
		{
			Mobile mob = e.Mobile;

			mob.CloseGump(typeof(AAHS_Gump));
			mob.SendGump( new AAHS_Gump() );
		}

		public static void Initialize()
		{
			stringList = new StringList("enu"); 
I'm using the Ultima SDK...
Any ideas?

Last edited by Joeku; 10-23-2007 at 05:48 PM.
Joeku is offline   Reply With Quote
Old 10-23-2007, 06:46 PM   #2 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,891
Default

Quote:
Originally Posted by Joeku View Post
Code:
using System;
using System.Collections.Generic;
using System.IO;
using Server;
using Server.Commands;
using Ultima;

namespace Server.AAHS
{
	public class AAHS_Main
	{
		public static int Version = 100;
		public static string ReleaseDate = "October 23, 2007";

		public static List<int> BodyTable;
		public static StringList stringList;

		[Usage("AAHS")]
		public static void AAHS_OnCommand(CommandEventArgs e)
		{
			Mobile mob = e.Mobile;

			mob.CloseGump(typeof(AAHS_Gump));
			mob.SendGump( new AAHS_Gump() );
		}

		public static void Initialize()
		{
			stringList = new StringList("enu"); 
I'm using the Ultima SDK...
Any ideas?
ya thats not really a bug so much as it is a fix in 2.0

in StringList.cs it says sometihng like
Code:
while(bin.PeekChar())
needs to be
Code:
while (bin.BaseStream.Position != bin.BaseStream.Length)
that'll fix it
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 10-23-2007, 07:07 PM   #3 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,260
Default

I love you.
Joeku is offline   Reply With Quote
Old 10-24-2007, 08:13 AM   #4 (permalink)
Forum Novice
 
Dereckson's Avatar
 
Join Date: Dec 2005
Location: Belgium
Age: 25
Posts: 260
Send a message via Skype™ to Dereckson
Default

The funny thing with this issue is it produces on low ram systems, so it's rather difficult to catch it.

Try to launch Razor or Pandora's box (last version) on a box with 128 MB RAM, you'll get this exception.
__________________
La connaissance s'accroît quand on la partage.
Share your knowledge, you'll increase it.

Utopia. Votre Monde.
Dereckson is offline   Reply With Quote
Old 02-02-2008, 03:32 PM   #5 (permalink)
Forum Expert
 
Bradley's Avatar
 
Join Date: Oct 2002
Location: Hummelstown, PA
Age: 29
Posts: 487
Send a message via ICQ to Bradley Send a message via AIM to Bradley Send a message via MSN to Bradley Send a message via Yahoo to Bradley
Default

Opening the file with ASCII encoding instead of utf8 also seems to fix the problem. Since the actual contents are read as bytes by uosdk the encoding won't matter, but it will allow the peekchar to not overflow.
__________________
-----------------------
If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post.
I am refering to specific individuals.
You know who you are.
Bradley is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5