[Release] Saga Save Timer

Newbie Spellweaver
Joined
Jun 22, 2004
Messages
8
Reaction score
0
Here is the gamenao code for Saga Revised to save the character data every 2mins to ensure no data is lost by a crash, Thanks to me of course and Gamenao.. sorry i didn't upload sources we actually have A LOT of changes and additions and i don't think it would be cool for everyone to just leach them because we put a lot of effort into coding the Normal AI and Boss AI and the fixes..
Enjoy, Acidx & gamenao.com



Inside Character.CS add this Around LASTLP_TICK
Code:
	/// <summary>
        /// Acidx - Defines the last time character saved tick
        /// </summary>
        internal int LASTSAVE_TICK = 0;




inside the function "public Character(uint CharacterId)" add this line

Code:
            this.LASTSAVE_TICK = Environment.TickCount;

inside "public bool OnRegenerateHP()" add this code
Code:
	    //Acidx Save implementation
            if (Environment.TickCount - this.LASTSAVE_TICK > 90000)
            {
                this.LASTSAVE_TICK = Environment.TickCount;
                this.bNeedsSave = true;
                this.client.SaveCharacter();
            }

Inside Client-Core.cs Add the following function
Code:
	/// <summary>
        /// Acidx - Save all Character data on a character timer
        /// </summary>
        public void SaveCharacter()
        {
            if (this.character != null)
            {
                Console.Write("Now Saving character data for {0}", this.character.Name);
                Console.WriteLine();
                Singleton.Database.SaveCharacter(this.character);
            }
        }

So easy a caveman can do it
 
Inside Character.CS add this Around LASTLP_TICK
Code:

/// <summary>
/// Acidx - Defines the last time character saved tick
/// </summary>
internal int LASTSAVE_TICK = 0;




inside the function "public Character(uint CharacterId)" add this line

Code:

this.LASTSAVE_TICK = Environment.TickCount;

inside "public bool OnRegenerateHP()" add this code
Code:

//Acidx Save implementation
if (Environment.TickCount - this.LASTSAVE_TICK > 90000)
{
this.LASTSAVE_TICK = Environment.TickCount;
this.bNeedsSave = true;
this.client.SaveCharacter();
}

Inside Client-Core.cs Add the following function
Code:


/// <summary>
/// Acidx - Save all Character data on a character timer
/// </summary>
public void SaveCharacter()
{
if (this.character != null)
{
Console.Write("Now Saving character data for {0}", this.character.Name);
Console.WriteLine();
Singleton.Database.SaveCharacter(this.character);
}
}


Where i need to add ? in 1st there LASTTLK 10 places
Another, where it open And where close scripts ? I added all server dont saving anything in 2 mins
 
anyone have tried this? i already put those codes. but when i try yo compile, it got eror. could anyone help?

Thanks.^^
 
Last edited:
I Got An Error.....

Code:
[COLOR=Red](CoreCompile target) ->
  PrimaryTypes\Character.cs(458,22): error CS1061: 'Saga.PrimaryTypes.Character
' does not contain a definition for 'bNeedsSave' and no extension method 'bNeed
sSave' accepting a first argument of type 'Saga.PrimaryTypes.Character' could b
e found (are you missing a using directive or an assembly reference?)[/COLOR]

:grr::grr::grr:
 
would have liked to use this but, people are stating errors... so I dont trust it yet. And this should be in the development section since it has to do with source. :/
 
Back