World Of Naruto
Would you like to react to this message? Create an account in a few clicks or log in to continue.


World of Naruto is based on the anime and manga Naruto created by Masashi Kishimoto. World of Naruto is a game that attempts to bring Masashi Kishimoto's universe to life. Every character in the series will appear in World of Naruto as a computer-controll
 
HomeLatest imagesSearchRegisterLog in

 

 Last night's accidental pfile partial wiping

Go down 
AuthorMessage
ichike
Immortal



Posts : 111
Join date : 2010-01-22

Last night's accidental pfile partial wiping Empty
PostSubject: Last night's accidental pfile partial wiping   Last night's accidental pfile partial wiping EmptyTue Feb 23, 2010 1:03 am

Last night, I was really irritated that maps weren't saving when you logged off, at least not for the new maps that I and other immortals had been making. For some reason, stock maps saved happily but the new ones that we spent so long on deleted themselves when we logged off.

I spent ages trying to figure out why then last night decided what the heck I will just manipulate the save.c file, the file that decides what items are saved or not.

The code had a part that said, basically:

If item->level > player->level + 2 then don't save
If item->level == TYPE_KEY then don't save
If item->level == TYPE_MAP and value[0] != 0 then don't save

Now, I want it to save ALL MAPS and ALL KEYS, so the first thing that I did was to wipe those two lines.

I tried this out and it worked brilliantly. I was so happy.

Then I thought that I would really like equipment more than 2 levels above you to save too. How high? Well, say, 20% levels higher than you. So at level 100, it'd save up to level 120 items. Min of 5 levels above you.

So I made a new variable called max_save_level, which determined what was the maximum level it could save items at.

Then the penultimate line was:

if player-> level < max_save_level then don't save

All fixed. All would be fine.

At 4.30am, when I put this in, I thought that all was great and it would work. I had tested it with other variations of it and all was great so I was sure that it was fine. It was time to go to bed as I had to get up at 6am for work. Really, 1 1/2 hours of sleep is hardly enough but I was on fire with adding new bits of code.

This morning, after I had had my shower and such, I thought to spend 10 minutes logging on to check messages and see how much people had liked the new changes.

Instead of the thanks I was expecting, there was a bug message from Vasuka:

"All of my equipment was wiped. Was this because of a bug? Can you fix it?"

I went to check it and it was totally wiped, but not the whole pfile. It was odd that it had only wiped equipment. Then I double checked my code. That last line was wrong.

It should have said:

If max_save_level < item->level then don't save

Oh no! That one little "typo" had meant that player files were wiped.

Well, no panic, that is usually a low time of the night when nobody much logs on, so hopefully Vasuka was the only one affected.

I checked and there were 15 players, well, including me, Hishia and Jyoshiya (3 imms) who had logged on in that 2 1/2 hour period.

I now had 3 minutes. I knew that I had made a full backup of the code, including player files, at 4.30am after making the changes, so not much was lost.

If I had had enough time, I would have unzipped the backup, gone into the 15 player files one by one and copied all of their equipment then pasted it into their new pfiles.

The problem is that that was going to take about 2-3 minutes per pfile, or about 30-45 minutes. I had 3 minutes.

So I only had enough time to restore the full player files from the backup from 2 1/2 hours earlier. I had to boot Samson as he refused to log off for the 3 seconds that it took to fix it (and somehow managed to stop me booting him too).

Then with 30 seconds left, I wrote a quick note to all immortals about what had happened, informing them that they may need to restore players who might have gained experience or mission points or maybe even items in that 2 1/2 hour period.

I was 3 minutes late for work, but I guess I can take that this once. I got yelled at a fair bit, and I could hardly explain why I was late.

At least it had only cost 2 1/2 hours worth. If I hadn't logged on before work, this would have been stuffing up pfiles all day, for 12 more hours at least, as I only just got home now, 12 hours later. We would have had about 50-100 players wiped and a lot of very angry people. At least we didn't lose much.

I was a bit surprised to have a note from Derryn complaining to have lost 3 levels worth of experience. I was surprised because Derryn has an immortal account Jyoshiya and should have read the note and indeed should have been able to have fixed it himself. Well, I do say no interactions with your own alts, but I think that this is a fair exception to the rule, as it is compensating.

It turned out that during that 2 1/2 hour period, Derryn had joined with Teruo to get experience for Derryn and mission points for Teruo. Teruo had lost something like 200 mission points and Derryn had lost 22,000 experience points, or 3 levels for him at 3rd time reincarnated, with 8,000 experience points/level.

It seems that they were the only 2 that had lost anything at all.

Pretty good really, although it is disappointing that I made this error.

I really shouldn't be doing things at 4am that have the potential to cause these kinds of problems, no matter how certain I am that it is working perfectly.

I didn't really want to post this on the MUD because it makes the MUD look bad, but I can post it here to explain it, for anyone who follows this forum.
Back to top Go down
 
Last night's accidental pfile partial wiping
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
World Of Naruto :: Info and announcements :: News-
Jump to: