Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2006, 04:13 PM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default auto save timer...

Hi i posted a thread about this a while ago but thought id post it again as it is a simple, but very useful. It is an auto save timer which basically does a #save every few minutes..

here is the .diff patch thingy..

Code:
--- client.h	2006/06/20 02:36:21	1.2
+++ client.h	2006/06/21 06:07:41	1.3
@@ -768,6 +768,7 @@
 	Timer	ooc_timer;
 	Timer	shield_timer;
 	Timer	fishing_timer;
+	Timer	save_timer; // Cripp: client->save(2) auto save
 #ifdef REVERSE_AGGRO
 	Timer	scanarea_timer;
 #endif
 
--- client.cpp	2006/06/20 02:36:20	1.2
+++ client.cpp	2006/06/21 06:07:41	1.3
@@ -143,6 +143,7 @@
 	ooc_timer(1000),
 	shield_timer(500),
 	fishing_timer(8000),
+	save_timer(60000), // Cripp: client->save(2) auto save
 #ifdef REVERSE_AGGRO
 	scanarea_timer(AIClientScanarea_delay),
 #endif
@@ -207,6 +207,7 @@
 	npclevel = 0;
 	pQueuedSaveWorkID = 0;
 	position_timer_counter = 0;
+	save_timer.Disable(); // Cripp: client->save(2) auto save
 	fishing_timer.Disable();
 	shield_timer.Disable();
 	dead_timer.Disable();
	
--- client_packet.cpp	2006/07/02 00:19:00	1.4
+++ client_packet.cpp	2006/07/08 20:19:32	1.5
@@ -6204,9 +6204,10 @@
 	
 	hpupdate_timer.Start();
 	position_timer.Start();
+	save_timer.Start(); // Cripp: client->save(2) auto save
 	SetDuelTarget(0);
 	SetDueling(false);
	
--- client_process.cpp	2006/06/20 02:36:21	1.2
+++ client_process.cpp	2006/06/21 06:07:41	1.3
@@ -146,7 +146,14 @@
 		if (fishing_timer.Check()) {
 			GoFish();
 		}
+
+		if (save_timer.Check()) { // Cripp: client->save(2) auto save
+			Save(2);
+			Message(0, "%s successfully saved.", GetName());
+			save_timer.Start(300000);
+		}
+
 		if (bardsong_timer.Check() && bardsong != 0) {
 			//NOTE: this is kinda a heavy-handed check to make sure the mob still exists before
 			//doing the next pulse on them...
please leave any comments/questions u have.
thx, have fun.
-cripp
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
Reply With Quote
  #2  
Old 11-06-2006, 04:23 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

I put this in, tunable with a rule.

One note is that the argument to save() tells it when to run the query. 2 means "block everything and save this bitch", where as 0 and 1 let it run the query in the background... that much more likely what you want.
Reply With Quote
Reply


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

Forum Jump

   

All times are GMT -4. The time now is 08:00 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3