PlaneShift

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Engine → Character Creation
  • Assigned To No-one
  • Operating System
  • Severity High
  • Priority
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: PlaneShift
Opened by Lanarel - 09.03.2009
Last edited by Lanarel - 10.03.2009

FS#2799 - Server crash when uploading character

Server crashed when uploading a char created on local server with custom path (everything randomized). I traced it back to vitals not being initialised. This probably is a compiler dependend bug (as other compilers may initialise floats) but my msvc9 did not.

Solution:
In the constructor of ServerVitals, set not only rates and max but also the values.
Tested and it works now (with mana set to 100%, instead of crashing when trying to write 1e38 to the database).

Closed by  Lanarel
10.03.2009 22:49
Reason for closing:  
Additional comments about closing:  

Works

Project Manager
Lanarel commented on 09.03.2009 21:56

Patch:


Index: src/server/bulkobjects/servervitals.cpp
===================================================================
--- src/server/bulkobjects/servervitals.cpp     (revision 3162)
+++ src/server/bulkobjects/servervitals.cpp     (working copy)
@@ -52,6 +52,12 @@
     vitals[VITAL_MENSTAMINA].drRate.Initialize(&statsDirty, DIRTY_VITAL_MENSTAMINA_RATE);
     vitals[VITAL_MENSTAMINA].max.Initialize(&statsDirty,    DIRTY_VITAL_MENSTAMINA_MAX);
 
+    //initialize values to a safe value:
+    vitals[VITAL_HITPOINTS].value = 0;
+    vitals[VITAL_MANA].value = 0;
+    vitals[VITAL_PYSSTAMINA].value = 0;
+    vitals[VITAL_MENSTAMINA].value = 0;
+
     vitals[VITAL_HITPOINTS].drRate.SetBase(HP_REGEN_RATE);
     vitals[VITAL_MANA].drRate.SetBase(MANA_REGEN_RATE);

Tristan Cragnolini commented on 10.03.2009 01:26

Commited in r3165, setting ready to test

Christian Bryant commented on 10.03.2009 20:41

I'm experiencing the same issue. The server is crashing as I attempt to upload a newly generated character. I'm not sure how to solve this problem. Can anyone assist me?

Project Manager
Lanarel commented on 10.03.2009 22:48

This may only help you if this is merged to stable and moved to the servers. THat is if it this this problem. I would guess that Laanx does not have this specific problem as otherwise noone would be able to add chars.
I tested and the problem I noticed is gone. So this report can be closed. AdonisESQ, if you still have this problem in a while, please make a new report.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing