Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2010, 09:16 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default COMMITTED: Faction Values

Issue: faction_values table size can become exponential with a large player base

Discussion: Server writes all values for faction changes to the database; even those that have no faction adjustment (0 faction). Example: KOS (id:366) does not need +/- adjustments when you kill an NPC on faction KOS. However, when a PC kills that NPC, the server sets a new faction value which turns out to be 0.

Recommendation: Remove all current entries with zero faction adjustment as the server already accounts for 0. Prevent the server from adding faction values of 0.

Code Modifications:
Code:
Index: faction.cpp
===================================================================
--- faction.cpp	(revision 1098)
+++ faction.cpp	(working copy)
@@ -841,7 +841,11 @@
 		safe_delete_array(query);
 		return false;
 	}
-	
+
+	if (value == 0) {
+		return true;
+	}
+
 	if (!RunQuery(query, MakeAnyLenString(&query, 
 		"INSERT INTO faction_values (char_id,faction_id,current_value) VALUES (%i,%i,%i)", 
 		char_id, faction_id,value), errbuf, 0, &affected_rows)) {
Optional SQL Code:
Code:
DELETE FROM faction_values WHERE current_value = 0;

Last edited by Derision; 01-17-2010 at 05:43 PM.. Reason: Stickied for review by me
Reply With Quote
  #2  
Old 01-18-2010, 02:57 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

This is in Rev1118. I don't pretend to understand the intricacies of how faction values are handled, but this change seemed to make sense to me.
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 09:57 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3