suriyun-production / mmorpg-kit-docs

This is document for MMORPG KIT project (https://www.assetstore.unity3d.com/#!/content/110188?aid=1100lGeN)
https://suriyun-production.github.io/mmorpg-kit-docs
49 stars 11 forks source link

[SUG] Proper Server Stop #2333

Closed chumleader closed 7 months ago

chumleader commented 8 months ago

no proper way of stopping server closing the server file makes the progress of every player rollback to maybe 5 mins of progress

SkyRain2020 commented 8 months ago

up for this !

insthync commented 8 months ago

up for this !

For what?

SkyRain2020 commented 8 months ago

up for this !

For what?

the server does not have proper way of shutting down , it causes rollback when you off or even restart the server files

there must be a kick all users before the entire server shuts down ( to be able to save all users in the game)

i hope you get the what i am saying

thank you brother

insthync commented 8 months ago

No, what is the reason for repeating me? rush me to do it?

LordPhrozen commented 8 months ago

No, what is the reason for repeating me? rush me to do it?

I believe he's just showing support for you addressing this issue..

Callepo commented 8 months ago

no proper way of stopping server closing the server file makes the progress of every player rollback to maybe 5 mins of progress

I do agree it could use some better way. But when im closing mine, i dont get any rollback, how are u closing/killing the server?

When i stop the server it shows logs like this image

Meaning every Server instance is being stopped, and in those StopServers, player data is saved. before everything shuts down

insthync commented 8 months ago

@Callepo It might relate to this https://github.com/suriyun-production/mmorpg-kit-docs/issues/2334 , it has a bottleneck when saving.

Callepo commented 8 months ago

@Callepo It might relate to this #2334 , it has a bottleneck when saving.

ok ok i see

Callepo commented 8 months ago

But either way, if u have the process running in shell, you can Ctlr + C to stop it properly

If u have it in nohup

KILL HEADLESS SERVER SAFELY 1) jobs 2) Look at the [Number] of the process running 3) fg #Number 4) Ctrl + C

fg brings the process to the foreground in which case u can just Ctrl +C like before to stop the process instead of killing the shell or killing the process unsafely

Callepo commented 8 months ago

@chumleader idk if that helps, if ur not doing any of those atm, might try that and see if any difference. If u are already doing it like that or something very similar which closes the server process safely, then yea, might just be on the bottleneck of too many users when saving

chumleader commented 8 months ago

But either way, if u have the process running in shell, you can Ctlr + C to stop it properly

If u have it in nohup

KILL HEADLESS SERVER SAFELY

  1. jobs
  2. Look at the [Number] of the process running
  3. fg #Number
  4. Ctrl + C

fg brings the process to the foreground in which case u can just Ctrl +C like before to stop the process instead of killing the shell or killing the process unsafely

even with this, rollback still occur. this occurs even with -startDatabaseServer. which uses the built in database server in unity server build, try it in default kit, make progress for about 2 mins with items. then do what you suggested. it will roll back. i tested it in fully stopped server using this. no more unity server process. then when started, the progress has been lost

Callepo commented 8 months ago

hmm weird, ive never seen that, or im just not paying attention, i will try it today and make a video of it all and share, thats really concerning.

i will let u know later today

insthync commented 8 months ago

Cannot reproduce :P

Callepo commented 8 months ago

But either way, if u have the process running in shell, you can Ctlr + C to stop it properly If u have it in nohup KILL HEADLESS SERVER SAFELY

  1. jobs
  2. Look at the [Number] of the process running
  3. fg #Number
  4. Ctrl + C

fg brings the process to the foreground in which case u can just Ctrl +C like before to stop the process instead of killing the shell or killing the process unsafely

even with this, rollback still occur. this occurs even with -startDatabaseServer. which uses the built in database server in unity server build, try it in default kit, make progress for about 2 mins with items. then do what you suggested. it will roll back. i tested it in fully stopped server using this. no more unity server process. then when started, the progress has been lost

Ive tested it, with Mysql DB + SQLITE It happens frequently when u close the server back, aka when i killed the terminal without stopping server.

But when i did stop server correctly, it only happened like one time from 5 different tests, and the rollback was smaller in comparison to killing terminal.

From using the kit for a while now, i can say this didnt use to happen, ive been killing the server incorrectly while testing hundreds of times, never seen a data loss, and atm, my char wasnt even in same location anymore, got my items i dropped back, quest i started wasnt there.

@insthync i confirmed it, 100% happening. Wrong termination of server using SQLITE or MSQL, and sometimes even stopping the service. i think it doesnt have enough time to write all, but happened even with 1 character online.

insthync commented 8 months ago

I know it will occuring, why it won't? if you close database management before the map or close the map before the save message arrive to database management server :P

Just have to add some codes to store saving characters then kick all characters then make sure all saving messages were sent and proceeded before closing servers, that is it.

chumleader commented 8 months ago

I know it will occuring, why it won't? if you close database management before the map or close the map before the save message arrive to database management server :P

Just have to add some codes to store saving characters then kick all characters then make sure all saving messages were sent and proceeded before closing servers, that is it.

i am starting each server in different terminals to properly execute each task like start each map, and stop each map if something happens in a specific map only (I can restart it without affecting other maps with this). and i am certain that database server is not stopping first before everything stops.

Now i am using the Net 7.0 Database Server which is hosted in a different machine. which makes me more certain that the database is not stopping when map server is stopped

SkyRain2020 commented 8 months ago

if we can kick all user from all maps/channels etc. before closing the server will somehow fix the problem. Kick all users connected then close all maps running

that way after they were all kick out, the data already saved so closing all running servers after this, are now safe to do, preventing rollbacks

P.S this is different situation regarding duplicate items due to rollback, while server is running

insthync commented 8 months ago

@SkyRain2020

I know it will occuring, why it won't? if you close database management before the map or close the map before the save message arrive to database management server :P

Just have to add some codes to store saving characters then kick all characters then make sure all saving messages were sent and proceeded before closing servers, that is it.

@SkyRain2020 Like I said?

sayonarakit commented 7 months ago

good day is there update this problem it seems alarming when not properly address

Just have to add some codes to store saving characters then kick all characters then make sure all saving messages were sent and proceeded before closing servers, that is it.

is the latest version have this function sir?

insthync commented 7 months ago

Will have it in next version

sayonarakit commented 7 months ago

Will have it in next version

when next update?

insthync commented 7 months ago

If you to try it now, try the MMO repo.

I don't know when, I always don't know.