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 08-17-2008, 11:51 AM   #1 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default Appears to be a problem with ser / deser using Custom regions in a box.

Hey everyone, a while ago my server just crashed, I was playing around with region control (using Custom Regions in a box).

When I try reboot, this is the error I get:

Quote:
World: Loading...Error:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt32()
at Server.World.Load()
at Server.ScriptCompiler.Compile(Boolean debug)
at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
Here is the crash log:

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

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.1433
Time: 2008/08/17 02:05:39 PM
Mobiles: 1207
Items: 103724
Clients:
- Count: 2
+ 41.246.168.103: (account = kyle) (mobile = 0x17E 'Brogen')
+ 192.168.1.104: (account = admin) (mobile = 0x3 'Pyros')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.RegionControl.get_CustomGoLocation()
at Server.Items.RegionControl.Serialize(GenericWriter writer)
at Server.StandardSaveStrategy.SaveItems(SaveMetrics metrics)
at Server.DualSaveStrategy.<>c__DisplayClass1.<Save>b __0()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 08-17-2008, 12:41 PM   #2 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 608
Default

either post the script ehre, or post your error in the thread of the script
__________________
Add your scripts!
Script Library for custom RunUO scripts >> sunny-productions.eu
b0b01 is offline   Reply With Quote
Old 08-17-2008, 01:00 PM   #3 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Well, I'm pretty sure its not a problem with the script, it has worked perfectly for a while now, and I have not touched anything in the script lately.


What I did was add a new custom region using the Custom Regions in a box and thats when the server crashed, yet I have used that many other places on the shard, and never had a problem before.

Anyway, considering I have already started a new thread, here is a link to the Custom Regions in a box release thread:

[RunUO 2.0 RC1] Custom Regions in a Box V4.0

Thanks for the help in advance

Regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 08-17-2008, 01:07 PM   #4 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 608
Default

doesn't look like a stable script to me.

the regions script never was written very well anyway.

my best bet is that your region was null

change this

Code:
 [CommandProperty(AccessLevel.GameMaster)]
        public Point3D CustomGoLocation
        {
            get { return m_Region.GoLocation; }
            set 
            { 
                m_Region.GoLocation = value;
                m_CustomGoLocation = value;
                UpdateRegion();           
            }
        }
to

Code:
 [CommandProperty(AccessLevel.GameMaster)]
        public Point3D CustomGoLocation
        {
            get { return m_Region.GoLocation == null ? Point3D.Zero : m_Region.GoLocation; }
            set 
            { 
                m_Region.GoLocation = value;
                m_CustomGoLocation = value;
                UpdateRegion();           
            }
        }
__________________
Add your scripts!
Script Library for custom RunUO scripts >> sunny-productions.eu
b0b01 is offline   Reply With Quote
Old 08-17-2008, 01:35 PM   #5 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Hey man, Thank you so much for going to so much effort to help me out with this

I just remembered, that was most definately the case (the region was null) I had not specified the boundries yet.

Your piece of code gives 1 error:

Quote:
Errors:
+ Custom/Custom Regions/RegionControl.cs:
CS0121: Line 541: The call is ambiguous between the following methods or pro
perties: 'Server.Point3D.operator ==(Server.Point3D, Server.Point3D)' and 'Serve
r.Point3D.operator ==(Server.Point3D, Server.IPoint3D)'
Thanks for the reply
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 08-17-2008, 01:51 PM   #6 (permalink)
Forum Novice
 
Join Date: Sep 2004
Posts: 283
Default

Believe also I read on the forums here, that if you don't "name" the region then create another one, it will crash the server
milva is offline   Reply With Quote
Old 08-17-2008, 02:01 PM   #7 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Ahh okay, thanks for the tip m8, but I'm pretty sure I didnt specify the region's boundries...Which is what it said I didnt do in the crashlog

So we have pinpointed the problem, just need to figure out how to fix it :>
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 08-18-2008, 08:36 AM   #8 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 608
Default

sorry, try this:

Code:
 [CommandProperty(AccessLevel.GameMaster)]
        public Point3D CustomGoLocation
        {
            get { return m_Region == null ? Point3D.Zero : m_Region.GoLocation; }
            set 
            { 
                m_Region.GoLocation = value;
                m_CustomGoLocation = value;
                UpdateRegion();           
            }
        }
I still think the code is rather messy, which was mainly caused by te fact that someone made it and others start modding it witout being as good at it as the original author.
__________________
Add your scripts!
Script Library for custom RunUO scripts >> sunny-productions.eu
b0b01 is offline   Reply With Quote
Old 08-18-2008, 11:30 AM   #9 (permalink)
Newbie
 
Sixkillers's Avatar
 
Join Date: May 2006
Location: Czech Republic
Posts: 78
Default

Quote:
World: Loading...Error:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt32()
at Server.World.Load()
at Server.ScriptCompiler.Compile(Boolean debug)
at Server.Core.Main(String[] args)
This exception occurs when you are trying to load world save which was created when server crash (crash during saving). This defect save you can only delete. In the 99% cases it is caused by bug in Serialize method. b0b01 is absolutely right. Custom region (exactly CustomGoLocation property) invoke exception during saving if you dont define CustomGoLocation because it is default null.
Sixkillers is offline   Reply With Quote
Old 08-18-2008, 06:07 PM   #10 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Okay, so what do you suggest I do to fix the problem ?
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 08-18-2008, 06:10 PM   #11 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 608
Default

Quote:
Originally Posted by typhoonbot View Post
Okay, so what do you suggest I do to fix the problem ?
read my post, the one before Sixkillers'
__________________
Add your scripts!
Script Library for custom RunUO scripts >> sunny-productions.eu
b0b01 is offline   Reply With Quote
Old 08-18-2008, 07:15 PM   #12 (permalink)
Forum Novice
 
Join Date: Oct 2003
Posts: 153
Default

The Fix is already listed in the origional thread even though the above may do the same

RegionControl.cs (line 536-551):
This fixes the crash problem with the custom go location.
Code:
        private Point3D m_CustomGoLocation;

        [CommandProperty(AccessLevel.GameMaster)]
        public Point3D CustomGoLocation
        {
            get { return (m_Region != null) ? m_Region.GoLocation : new Point3D(0,0,0); }
            set
            {
                if (m_Region != null)
                {
                    m_Region.GoLocation = value;
                    m_CustomGoLocation = value;
                    UpdateRegion();
                }
            }
        }
__________________
Developer BES Oasis
Blessed Items only bag / GetPet
Shard : BES Oasis

Last edited by datguy; 08-18-2008 at 07:17 PM.
datguy is offline   Reply With Quote
Old 08-19-2008, 12:12 PM   #13 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

OKay, I have made the change to the script, but the server is still giving the error when attempting to compile, due to it running a save as the shard crashed.

My idea would be to roll back to the last save, but I am not entirely sure how...

Any pointers ?

Ta
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 08-19-2008, 02:40 PM   #14 (permalink)
Newbie
 
Sixkillers's Avatar
 
Join Date: May 2006
Location: Czech Republic
Posts: 78
Default

Just delete folder "Saves" and copy folder from Backup folder and rename it to "Saves" and start emu.
Sixkillers is offline   Reply With Quote
Old 08-21-2008, 01:39 AM   #15 (permalink)
Newbie
 
Join Date: Feb 2007
Posts: 69
Default

Your current save is corrupt, nothing can be done to restore the current save, the ONLY solution is to restore one of the backup saves.
DragonBoy is offline   Reply With Quote
Old 08-21-2008, 05:02 AM   #16 (permalink)
Forum Novice
 
Tassyon T's Avatar
 
Join Date: Sep 2007
Posts: 367
Default

Quote:
Originally Posted by TyphoonBot View Post
My idea would be to roll back to the last save, but I am not entirely sure how...
Uh... open your backups folder. Open "most recent". Copy those folders/files. Paste them into your "Save" directory.
Tassyon T is offline   Reply With Quote
Reply

Bookmarks

Tags
custom, deser, error, region, ser


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