Aryman30

Member
Today i merge that system from my old runuo. But today when i try to load server i have problem with saves. Every time when i restart the server i see that info and i must delete all players :/

There is link to orginal post : link

Code:
Scripts : Compiling C # scripts ... done ( cached)
Scripts : Skipping VB.NET Scripts ... done ( use- vb is enable)
Scripts : Verifying ...
Finished ( 3919 items, 994 mobiles , 11 customs ) (1.41 seconds)
Regions : Loading ... done
World : Loading ... An error was encountered while loading a saved object
- Type: Server.Mobiles.PlayerMobile
- Serial : 0x00000001
Delete the object ? ( y / n)
Delete all objects of That type ? ( y / n)
After pressing return an exception will be thrown and the server will terminate .


error:
System.FormatException : Index ( with an initial value of zero ) must be
Increase from zero or equal to zero and less than the size of the argument list.
   in System.Text.StringBuilder.AppendFormat ( IFormatProvider provider , String for
mat , Object [] args)
   in System.String.Format ( IFormatProvider provider , String format , Object [] args
)
   in Server.World.Load () wh : \ ServUO -master \ Server \ World.cs : line 844
   in Server.Core.Main (String [] args) in h : \ ServUO -master \ Server \ main.cs : line 59
0
This exception is fatal , press return to exit
 
Last edited:
Looks like you messed up the Serialize/Deserialize portion of the merge. Most likely using wrong version numbers. ServUO's playermobile has a higher version number than that script shows. As Milva said, you should post your playermobile script.
 
First thing I see is you commented out this in your Deserialize. Any players already saved before this change won't load because you are skipping data that's already stored in your saves.
Code:
/*  m_LevelExp = reader.ReadLong();
    m_Exp = reader.ReadLong();
    m_Level = reader.ReadInt();
    m_ExpTitle = reader.ReadString();
*/

The next issue I see is that 'm_Level' and 'm_Exp' already exist as part of the Queens Loyalty System. The same variables you are trying to merge in from the Serbo Level System should be called something different so they will not conflict with what is already there.
 
But i delete any saves. When i create new character and login to the game and restart server problem are still that same. All of the queen royality system lines are comented out :/
 
If you aren't loading previous saves then ignore what I said about those commented lines. Good practice though would be to leave them and create a new version number that reads only what you need and bypasses the older version numbers.

Anyway, take a look at your Serialize method. It's missing info to write these lines for version 30 that you are trying to read in Deserialize.
Code:
case 30:
    {
        m_DisplayRaceTitle = reader.ReadBool();

        m_RaceType = (Rasa)reader.ReadEncodedInt();

        m_KlasaType = (Klasa)reader.ReadEncodedInt();
               
        goto case 29;
    }
 
i dont have idea why not work ... :/
i make serialize for case 31 and still that same :/

Greetings
 
Last edited:
i dont have idea why not work ... :/
No worries. I'll break it down for you.

Let's recap on what you currently have.

Serialize:
Code:
// ...
writer.Write(31); // version old 28

//Level System
writer.Write((int)m_Level);
writer.Write((int)m_MaxLevel);
writer.Write((int)m_Exp);
writer.Write((int)m_ToLevel);
writer.Write((int)m_kxp);
writer.Write((int)m_SKPoints);
writer.Write((int)m_StatPoints);
//End Level System

// Version 29
writer.Write(m_GauntletPoints);

#region Plant System
writer.Write(m_SSNextSeed);
writer.Write(m_SSSeedExpire);
writer.Write(m_SSSeedLocation);
writer.Write(m_SSSeedMap);
// ...

Deserialize:
Code:
// ...
int version = reader.ReadInt();

switch (version)
{
    //Level System
    case 31:
    {
        m_Level = reader.ReadInt();
        m_MaxLevel = reader.ReadInt();
        m_Exp = reader.ReadInt();
        m_ToLevel = reader.ReadInt();
        m_kxp = reader.ReadInt();
        m_SKPoints = reader.ReadInt();
        m_StatPoints = reader.ReadInt();

        goto case 30;
    }
    //End Level System

case 30:
{
    m_DisplayRaceTitle = reader.ReadBool();
    m_RaceType = (Rasa)reader.ReadEncodedInt();
    m_KlasaType = (Klasa)reader.ReadEncodedInt();
                   
    goto case 29;
}
case 29:
{
    m_GauntletPoints = reader.ReadDouble();

    m_SSNextSeed = reader.ReadDateTime();
    m_SSSeedExpire = reader.ReadDateTime();
    m_SSSeedLocation = reader.ReadPoint3D();
    m_SSSeedMap = reader.ReadMap();
// ...

Now everything you read and write must match up exactly or the server won't know how to handle the data.

Look at this section of your writer:
Code:
writer.Write((int)m_StatPoints);
//End Level System

// Version 29
writer.Write(m_GauntletPoints);

Now look at this section of your reader:
Code:
        m_StatPoints = reader.ReadInt();

        goto case 30;
    }
    //End Level System

case 30:
{
    m_DisplayRaceTitle = reader.ReadBool();
    m_RaceType = (Rasa)reader.ReadEncodedInt();
    m_KlasaType = (Klasa)reader.ReadEncodedInt();
                   
    goto case 29;
}
case 29:
{
    m_GauntletPoints = reader.ReadDouble();

Your writer jumps from 'm_StatPoints' straight to 'm_GauntletPoints' where you reader has 'm_DisplayRaceTitle', 'm_RaceType', and 'm_KlasaType' between the two former. You are either missing those 3 lines in the writer or they need to be commented out on the reader. My guess is you are missing the writer lines.


If you are still having problems figuring this out then the Serialize should look something like this:
Code:
writer.Write(31); // version old 28

//Level System
writer.Write((int)m_Level);
writer.Write((int)m_MaxLevel);
writer.Write((int)m_Exp);
writer.Write((int)m_ToLevel);
writer.Write((int)m_kxp);
writer.Write((int)m_SKPoints);
writer.Write((int)m_StatPoints);
//End Level System

writer.Write((bool)m_DisplayRaceTitle);
writer.WriteEncodedInt((int)m_RaceType);
writer.WriteEncodedInt((int)m_KlasaType);

// Version 29
writer.Write(m_GauntletPoints);

#region Plant System
writer.Write(m_SSNextSeed);
writer.Write(m_SSSeedExpire);
writer.Write(m_SSSeedLocation);
writer.Write(m_SSSeedMap);
 
Did you delete your saves like you did before? If not you would have to temporarily comment out the whole Case 30 section of your Deserialize to load them, resave, then uncomment those lines back.
 
Maybe i need to disable the queen royality on some other scripts ? ( if is somwhere i find it )
 

Attachments

  • PlayerMobile.cs
    141.5 KB · Views: 6
You copied some of the same lines back into your Deserialize.
Code:
case 29:
{
    m_GauntletPoints = reader.ReadDouble();

    m_SSNextSeed = reader.ReadDateTime();
    m_SSSeedExpire = reader.ReadDateTime();
    m_SSSeedLocation = reader.ReadPoint3D();
    m_SSSeedMap = reader.ReadMap();

    m_SSNextSeed = reader.ReadDateTime();
    m_SSSeedExpire = reader.ReadDateTime();
    m_SSSeedLocation = reader.ReadPoint3D();
    m_SSSeedMap = reader.ReadMap();

You need to delete 4 of those lines:
Code:
m_SSNextSeed = reader.ReadDateTime();
m_SSSeedExpire = reader.ReadDateTime();
m_SSSeedLocation = reader.ReadPoint3D();
m_SSSeedMap = reader.ReadMap();
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back