First let me say ... Lovely system you got here.
We had this in on a B36 server with about 30 different regions, and when we updated we got both those crashes (spells and skills) and found that support/updates to fix this without killing the regions is not given (that I could find). So, I devised my own work-around. I will share it here. A warning to you all though, this requires a double replacement of files and 2 restarts of the server
I have both Druid and Cleric systems installed and Registered, so I will be basing my regions off of a Spell list count of 700.
So, let's get started...
First, open RestrictGump.cs
Find the two locations that have "100 : 500" (Lines 74 and 90)
Change the 500 to 800.
Save and exit that script.
Next,
MAKE A COPY/BACKUP OF YOUR RegionStone.cs
Then, open up the RegionStone.cs
Go to case 1 of the Deserialize method (lines 477-490)
CHANGE :
Code:
case 1:
{
Coords = ReadRect2DArray( reader );
m_Priority = (CustomRegionPriority) reader.ReadInt();
m_PlayerLogoutDelay = reader.ReadTimeSpan();
m_RestrictedSpells = ReadBitArray( reader );
m_RestrictedSkills = ReadBitArray( reader );
m_Flags = (RegionFlag)reader.ReadInt();
m_RegionName = reader.ReadString();
break;
}
TO :
Code:
case 1:
{
Coords = ReadRect2DArray( reader );
m_Priority = (CustomRegionPriority) reader.ReadInt();
m_PlayerLogoutDelay = reader.ReadTimeSpan();
/*Transfering all spells/skills to new BitArray of correct size/locations*/
BitArray SpellTemp = ReadBitArray( reader );
BitArray SkillTemp = ReadBitArray( reader );
m_RestrictedSpells = new BitArray( SpellRegistry.Types.Length );
m_RestrictedSkills = new BitArray( SkillInfo.Table.Length );
for( int i = 0; i < SpellTemp.Count; i++ )
{
[color=blue] if( i > 400 && i < 413 )
{
m_RestrictedSpells[i+200] = SpellTemp[i];
m_RestrictedSpells[i] = false;
continue;
}[/color]
m_RestrictedSpells[i] = SpellTemp[i];
}
for( int i = 0; i < SkillTemp.Count; i++ )
{
m_RestrictedSkills[i] = SkillTemp[i];
}
/*Transfering all spells/skills to new BitArray of correct size/locations*/
m_Flags = (RegionFlag)reader.ReadInt();
m_RegionName = reader.ReadString();
break;
}
Let me explain the code in
Blue...
If your initializer has
NOT changed, you do not need this.
If your initializer has changed for addition of new spells, this is where you would set the new numbers as being restricted....(kinda confusing, I know)
My old Cleric spells were registered at 401-412, but the new abilities for SE will be on there, so I had to re-register them at a different number...I chose 601-612. So you see how I changed the bitarray locations with that if statement in blue.
Code:
if( i > 400 && i < 413 )
{
m_RestrictedSpells[i+200] = SpellTemp[i];
m_RestrictedSpells[i] = false;
continue;
}
the numbers in the if statement are the old registry entries. The 200 in m_RestrictedSpells[ i+200 ] is the OFFSET that would make it equal the NEW registry. 401 + 200 = 601.
Once you have done that code to your needs, save and start the server. Find one of your RegionControls and see if you can click on the Restrict Spells AND Restrict Skills button. If you can without a crash, you were successful!
SAVE the server and close it down.
Replace your edited RegionStone.cs with the ORIGINAL one that you backed up and load the server and everything should be dandy!
Hope this helps everyone that has been having crashes!
(Suggests to ASayre8 that this could be avoided by using a different method of storing the values) - aka a new value that stores the name of the spell AND the bool, stored in an ArrayList....(just a quick off-the-top-of-my-head suggestion)
Have fun and good luck everyone!