Jump to content

Proper way to restart the server without losing items


Recommended Posts

  • Premium

Basically, the server has a heartbeat at which it processes the entries in the database, if you kill the process via SSH before the heartbeat finishes, you will lose all your items and progress.

 

Best way is to /shutdown in game then killall in ssh, WITHOUT arguments, only killall cause it will be graceful everytime.

  • Good 1
Link to comment
Share on other sites

  • 3 weeks later...
struct SendDisconnectFunc
{
	void operator()(LPDESC d)
	{
		if(d->GetCharacter())
		{
			d->GetCharacter()->SaveReal();
			DWORD pid = d->GetCharacter()->GetPlayerID();
			db_clientdesc->DBPacketHeader(HEADER_GD_FLUSH_CACHE, 0, sizeof(DWORD));
			db_clientdesc->Packet(&pid, sizeof(DWORD));

			if(d->GetCharacter()->GetGMLevel() == GM_PLAYER)
			{
				d->GetCharacter()->ChatPacket(CHAT_TYPE_COMMAND, "quit Shutdown(SendDisconnectFunc)");
			}
		}
	}
};

 

  • Not Good 1
Link to comment
Share on other sites

  • Developer
43 minutes ago, DrTurk said:

struct SendDisconnectFunc
{
	void operator()(LPDESC d)
	{
		if(d->GetCharacter())
		{
			d->GetCharacter()->SaveReal();
			DWORD pid = d->GetCharacter()->GetPlayerID();
			db_clientdesc->DBPacketHeader(HEADER_GD_FLUSH_CACHE, 0, sizeof(DWORD));
			db_clientdesc->Packet(&pid, sizeof(DWORD));

			if(d->GetCharacter()->GetGMLevel() == GM_PLAYER)
			{
				d->GetCharacter()->ChatPacket(CHAT_TYPE_COMMAND, "quit Shutdown(SendDisconnectFunc)");
			}
		}
	}
};

 

I see what you did there, but this doesn't help at all, what if the player disconnected before the shutdown ?
As we said before, best way is to shutdown in-game, wait a few minutes and then just gracefully kill the cores.

r

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.