Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

Sphere freezes every midnight #398

Closed d56Wr closed 4 years ago

d56Wr commented 4 years ago

SphereServer Version X1-Nightly [WIN64] by www.spherecommunity.net. Compiled at Apr 1 2020 (18:39:06) [build 3254 / GIT hash 1e2d2f5d07e3134b1e676db5fa35017a3eb32e25]

image

After every midnight, sphere freezes. It doesn't respond to any commands, player cannot login. You must kill the process in order to restart it.

GitMadKing commented 4 years ago

maybe happens for some reason when saving statics 1) try changing the hour when savestatics occurrs (serv_triggers.scp line 168) 2) try saving manually STATICS and see if it still hangs

d56Wr commented 4 years ago
[FUNCTION f_onserver_save]
// This function is called before server worldsave start.
// Variables:
//  ARGN1 --> Save is forced (writable)
//  ARGN2 --> Save stage (for backgroud save goes 1 to 6146 [sector count + 2])
// Return:
//  0 --> Allow save (default action)
//  1 --> Deny save

SERV.SaveStatics    //Uncomment this line if you are building your server, so static items are saved also with normal saves, or comment it again in live servers to speed up the save proccess (if commented, you MUST type manually .serv.savestatics to save static items)

There is no hour settings. Statics are saved with every save (20 minutes). image

GitMadKing commented 4 years ago

so is not connected with statics, because during the day work, must be something connected to new day and first statics save maybe something connected to other day than when started.

alexdan2 commented 4 years ago

I can confirm this issue, me and other my friend have same.

Additional info:

cbnolok commented 4 years ago

I think to have found the cause, i'll add the fix to the commit i'm working on

Il sab 4 apr 2020, 19:34 Alessandro notifications@github.com ha scritto:

I can confirm this issue, me and other my friend have same.

Additional info:

  • When happen server process use 0%
  • If close (X) the server window he not really shutdown, have to terminate from taskmgr.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Sphereserver/Source-X/issues/398#issuecomment-609062991, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADS2CJDB7JHZXLOS745ZDKLRK5VQPANCNFSM4L57DTGA .

xwerswoodx commented 4 years ago

I don't know if they are connected but when I use .resurrect command, sphere freezes. It doesn't give any error, it doesn't crash the sphere, or it doesn't try to get response, it's just freeze and when you close the application you have to stop it from process in task manager to close. This error occurs when I kill myself with kill command and try to resurrect. There is no freeze or any other problem until I try to use .resurrect command, but when I try to use that command, freeze the server.

-Resurrection spell also freezes the server -Resurrect the player button on .admin menu also freezes the server. -Resurrection only causes freeze when I try to use it on dead characters.

IMPORTANT: When you resurrect player far from the corpse, there is no problem. I guess the error that causes the error is where the resurrection try to raise corpse.

UPDATE: After many tests, found out the issue is the "CContainer::ContentsDump" function, because it doesn't increase i value, so it causes the infinite loop that freezes the server.

My Resurrection Spell Code:

[SPELL 59]
DEFNAME=s_resurrection
NAME=Resurrection
SOUND=snd_spell_resurrection
RUNES=AC
CAST_TIME=2.3
RESOURCES=i_reag_blood_moss,i_reag_garlic,i_reag_ginseng
RUNE_ITEM=i_rune_resurrection
SCROLL_ITEM=i_scroll_resurrection
FLAGS=spellflag_dir_anim|spellflag_targ_char|spellflag_fx_targ|spellflag_good|spellflag_targ_dead|spellflag_playeronly
EFFECT_ID=i_fx_sparkle
EFFECT=0
DURATION=0.0
MANAUSE=50
SKILLREQ=MAGERY 80.0
INTERRUPT=100.0,100.0

I think these could be connected, because if someone die and try to resurrect that can be the reason of the freeze for him too.

d56Wr commented 4 years ago

Sphere no longer freezes after midnight. Thanks for the fix.