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!

Cat's Jail System on RunUO 2.2 - SVN 862

Zycron

Squire
loads fine works fine but after u save server and reboot it gives a error line 292 of jail.cs

Code:
JailCount = idxReader.ReadInt();

of this section
Code:
public static void onLoad()
        {
            //System.Console.WriteLine("Loading Jailings");
            FileStream idxFileStream;
            FileStream binFileStream;
            //BinaryReader idxReader;
            BinaryFileReader idxReader;
            BinaryFileReader binReader;
            //GenericReader idxReader;
            long tPos;
            int tID;
            int tLength;
            JailSystem tJail;
            int JailCount = 0;
            int temp = 0;
            if ((File.Exists(idxPath)) && (File.Exists(binPath)))
            {
                idxFileStream = new FileStream(idxPath, (FileMode)3, (FileAccess)1, (FileShare)1);
                binFileStream = new FileStream(binPath, (FileMode)3, (FileAccess)1, (FileShare)1);
                try
                {
                    idxReader = new BinaryFileReader(new BinaryReader(idxFileStream));
                    binReader = new BinaryFileReader(new BinaryReader(binFileStream));
                    //JailCount = idxReader.ReadInt();
 
                    if (JailCount > 0)
                    {
                        for (int i = 0; i < JailCount; i++)
                        {
                            temp = idxReader.ReadInt();//catch the version number which we wont use
                            tID = idxReader.ReadInt();
                            tPos = idxReader.ReadLong();
                            tLength = idxReader.ReadInt();
                            tJail = new JailSystem(tID);
                            binReader.Seek(tPos, 0);
                            try
                            {
                                tJail.Deserialize((GenericReader)binReader);
                                if (binReader.Position != ((long)tPos + tLength))
                                    throw new Exception(String.Format("***** Bad serialize on {0} *****", tID));
                            }
                            catch
                            { }
                        }
                    }
                    loadingameeditsettings((GenericReader)binReader);

and of course if i comment that line out it does not load any of the jail settings or jailed people.
 

Scriptiz

Sorceror
@Zycron Fixed in the 2.2b release (just download it and replace your files).

NB : It seems that settings can't be modified with [adminjail (default settings are restored after every reboot). If you want to edit jail settings, just edit the values in the defaultSettings() method (line 88). I'll have a look about this as soon as I get enough time.
 

Zycron

Squire
ok would appreciate it.. its not just the settings people that were jailed are not jailed anymore but trapped in jail LOL its chaos ill just temp. remove the script until you get time to look at it ;) thankyou verymuch
 

Scriptiz

Sorceror
Yes it works but partially.

Actually saves aren't done, so if you Jail somebody, he will never leave Jail automatically if you restart the server. And if you edit the jail config with [adminjail command, it will not be saved after your restart your server.

I'd like to have some time to totally rewrite the jail saves but I have my tests to pass thus I don't have enough time for now.
 

romanthebrain

Sorceror
Got this problem ... its the same problem i had with your old system RunUO 2.0. Its when i open [adminjail and release the inside players. And now its when i only open [adminjail

PHP:
RunUO Version 2.2, Build 4425.25310
Operating System: Microsoft Windows NT 6.0.6002 Service Pack 2
.NET Framework: 4.0.30319.1
Time: 14.05.2012 21:07:38
Mobiles: 16241
Items: 131076
Exception:
System.ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: key
  bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
  bei System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
  bei Server.Commands.JailSystem.get_Prisoner()
  bei Server.Commands.JailAdminGump.buildReviews()
  bei Server.Commands.JailSystem.adminJail_OnCommand(CommandEventArgs e)
  bei Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
  bei Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
  bei Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
  bei Server.Network.MessagePump.HandleReceive(NetState ns)
  bei Server.Network.MessagePump.Slice()
  bei Server.Core.Main(String[] args)
 

Scriptiz

Sorceror
I have to work on this system to clean and upgrade it a lot.

I'll do that this summer after my exams ;)

I'll post here when it's finished (I hope for Augustus)
 
Top