HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Server eating your items?

View previous topic View next topic Go down 
AuthorMessage
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 489
Join date : 2014-02-09
Age : 19

PostSubject: Server eating your items?   Fri Nov 17, 2017 6:18 am

it's kind of a joke at this point that the server on every game likes to "eat" your items through crashes. the reality of it is that, right now, the game only saves your items/pet/health to your server files when you log off - until then, it's just the game and servers keeping track of it without actually saving it.

i assume this was to create less load on the server, since i imagine it doesnt enjoy constantly updating files. however, its very annoying for users who work hard to hunt things and end up losing them due to an unstable connection.

so, here's how to save your items after every stash, equip, unequip, and optionally, after you tame something. i haven't seen what this does long-term, so if your server blows up your computer, don't blame me pls

in LoginServer.cpp (6.0) OR MagixMainServer.cpp (any other version), you have a ton of case statements that look like this:

Code:
case ID_SOMETHING:
 {
 code
 code
 code
 }
 break;

find the cases for ID_ITEMSTASH, ID_ITEMEQUIP and ID_ITEMUNEQUIP. if you want pets to save, ID_UPDATEPET too. then, add savePlayerData(tToken); above the final bracket, making the statement look like this:


Code:
case ID_SOMETHING:
 {
 code
 code
 code
 savePlayerData(tToken);
 }
 break;

now the server outputs your data every time it receives an item or pet update.

once again, this may be laggy as hell on more popular servers. i've only tested it with azop, and we're pretty dead right now. please let me know if this actually is killing your server because i'm curious.

________________________________
Back to top Go down
http://azoptaos.boards.net/
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 744
Join date : 2011-11-27

PostSubject: Re: Server eating your items?   Sun Nov 19, 2017 8:21 am

Thanks Hyper I have done some testing and see that it works for our compile. The real test will come once the players get the compile and the server has to work a bit harder. Remember that the original IT code was designed for computers with a lot less memory and older style CPUs. A modern CPU Server should have no issues with this code. I am using a single core Celeron CPU for the DD server and even at peak times with a heap of players it sits around 20% CPU Usage. It doesn't even get overly warm. I do not expect to see a major increase in load.

Hopefully this will free up a lot of issues.
Back to top Go down
Lamina

avatar

Game username : Lamina
Server : GuardiansFate (WIP)
Female Posts : 31
Join date : 2016-09-13
Age : 17
Location : In a virtual world.

PostSubject: Re: Server eating your items?   Sun Nov 19, 2017 8:08 pm

I'm currently messing with the version 5.5 but it cannot find the
Code:
savePlayerData(tToken);
Do you know the name of the same function for 5.5 and below by any chance, Hyper?
Back to top Go down
http://gurdiansfate.freeforums.net/
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 489
Join date : 2014-02-09
Age : 19

PostSubject: Re: Server eating your items?   Mon Nov 20, 2017 4:25 am

i'm not sure what you mean - you're adding it, not finding it. the function savePlayerData() should be the same

________________________________
Back to top Go down
http://azoptaos.boards.net/
Lamina

avatar

Game username : Lamina
Server : GuardiansFate (WIP)
Female Posts : 31
Join date : 2016-09-13
Age : 17
Location : In a virtual world.

PostSubject: Re: Server eating your items?   Sun Nov 26, 2017 7:27 pm

I tried to add the function savePlayerData() on both sources: 6.0 and 5.5. But on both it gives me a compilation error, where it cannot find the function savePlayerData() and also cannot find the functions argument tToken.
A screenshot of the scenario is provided below:


Maybe the function doesn't exists for some compiles or were added by you once? I just think it's strange, that it worked for LazyZim anyway.
Back to top Go down
http://gurdiansfate.freeforums.net/
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 489
Join date : 2014-02-09
Age : 19

PostSubject: Re: Server eating your items?   Sun Nov 26, 2017 11:22 pm

youre in magixserver, not magixmainserver

________________________________
Back to top Go down
http://azoptaos.boards.net/
Lamina

avatar

Game username : Lamina
Server : GuardiansFate (WIP)
Female Posts : 31
Join date : 2016-09-13
Age : 17
Location : In a virtual world.

PostSubject: Re: Server eating your items?   Fri Dec 01, 2017 7:21 pm

Oh.... oops xD
Well it worked now, thank you. ^^"
Back to top Go down
http://gurdiansfate.freeforums.net/
Sponsored content




PostSubject: Re: Server eating your items?   

Back to top Go down
 
Server eating your items?
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: DOWNLOADABLE CONTENT :: Programming Features-
Jump to: