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 | 

 Fix(?): Loginserver crash, banlist corruption/clearing

Go down 

Server : Last Moon(http://lastmoon.org), Dawn of Eternity(http://dawn-of-eternity.com)
Posts : 151
Join date : 2012-11-18

PostSubject: Fix(?): Loginserver crash, banlist corruption/clearing   Sun Feb 10, 2013 9:14 pm

I'm not sure if this is an actual fix since the bansystem is a fucking mess and I have no idea what it's really supposed to be doing, I'm probably going to remake the whole thing later.

The problem:
The loginserver will crash, corrupt/clear the banlist data every 4 hours(or whatever your MAINTENANCE_PERIOD is set to) or whenever the server tries to save the banlist. It's because of some overflow going on in the saveBanList().

char tYear[6] = "";
char tDay[6] = "";
sin << banlist[i].year;
std::string val = sin.str();
sin << banlist[i].yDay;
val = sin.str();
I guess the problems start occurring when you ban people for long period of times? I can't be bothered to test it because I can't even be bothered to figure out what year and yDay means.

The fix:
Haven't done any real testing, I've just changed the code to do what I think it's supposed to be doing and it has stopped the problems for me so far.

Replace your saveBanlist() method in MagixMainServer.cpp with this one:

    void saveBanlist()
      std::ofstream outFile("banlist.txt");
      string tBuffer;
      for(int i = 0; i < (int)banlist.size(); i++)
         std::ostringstream ssYear, ssDay;
         tBuffer = string(banlist[i].name);

         // Add year????
         ssYear << banlist[i].year;
         // Add day???
         ssDay << banlist[i].yDay;
         outFile.write(tBuffer.c_str(), tBuffer.length());
         for(int j = 0; j < (int)banlist[i].IPList.size(); j++)
            tBuffer = banlist[i].IPList[j] + ";";
         tBuffer = "\n";
Back to top Go down

Game username : -redeye-
Server : KITO
Male Posts : 2583
Join date : 2011-07-24
Age : 30

PostSubject: Re: Fix(?): Loginserver crash, banlist corruption/clearing   Sun Feb 10, 2013 9:27 pm

There was reported an error in saving bans, so this will probably fix the issue

Back to top Go down


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

PostSubject: Re: Fix(?): Loginserver crash, banlist corruption/clearing   Mon Feb 11, 2013 3:51 am

Thank you Myz for the code update.
I have added it to my compile and will advise of any issues.
I am currently testing with this alteration

Hope this fixes your Loginserver issues.


Just a 24 hour update. The login Server at Dragon's Den appears to be working fine with this fix.
Thanks again Myz. ~Lazyzim~
Back to top Go down
Very Helpful
Very Helpful

Male Posts : 314
Join date : 2013-07-21
Age : 17

PostSubject: Re: Fix(?): Loginserver crash, banlist corruption/clearing   Mon Jan 20, 2014 11:30 pm

Great work.
Thanks for this repair.
Back to top Go down
Sponsored content

PostSubject: Re: Fix(?): Loginserver crash, banlist corruption/clearing   

Back to top Go down
Fix(?): Loginserver crash, banlist corruption/clearing
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: START HERE :: KITO's IT Source Code :: Bugs & Patches-
Jump to: