Jump to content

Why did the server crash?

Started by Pandette , Feb 15 2016 02:41 PM

  • Please log in to reply
5 replies to this topic

#1

Pandette
  • Pandette
  • Special Advisor to the Wizengamot
  • Administrators
  • 2648 posts
  • IGN:iarepandemonium

Hi Everyone,

 

I know a lot of people don't know how coding works, so I thought I would take this moment to explain why the server crashed when we opened Hogsmeade, that way you can understand what the problem was an why we had an issue figuring it out.

 

So, lets make you all aware, no one knew this was a problem and it was something we had to figure out so I am going to do this step by step to explain it.

 

Pandette wrote the code to keep anyone who is smaller than a 3rd year out of hogsmeade. The code for this was as follows:

 

WHEN SOMEONE MOVES INTO HOGSMEADE > teleport them to the location they were in before.

WHEN SOMEONE TELEPORTS INTO HOGSMEADE > teleport them to the location they were before.

 

Step 1:  Make this for just walking.  We made this for walking and then teleporting and when this happened we had no issues.

 

Server crash one.

 

We think this might be a null point exception which means something is being used that doesn't exist.  For example, if i am teleporting the person to where they were, perhaps something is wrong and it doesn't work.  To counter this we check if the from location is null and return if not.

 

Server crash two

 

We assume the issue has to do with floo and put the code in what we call a 'try catch'  ie: it tries it and if it fails it gets out.  Clearly this doesn't work.

 

Server crash three

 

At this point we realize the issue is with the from and its a looping problem.  IE: Someone teleports and then it gets called again and again so many times that it can't be stopped.

 

This is when we realize that it's being called when someone teleports TO hogsmeade.

 

So in this, we realize what if someone is a first year or second year and are ALREADY IN Hogsmeade ?  If they try to teleport to another location in hogsmeade, what happened?

 

They teleport FROM hogsmeade to HOGSMEADE they get teleported to the FROM but the FROM is in hogsmeade, so they get teleported to the FROM, but that FROM is also in Hogsmeade !

 

Oh noe ! They are stuck in a horrible loop.

 

So we set it so that if someone does this, it leaves and teleports them to spawn.  Cancelling the loop, and fixing the problem.

 

 

 

So I understand that this stuff is stuff some people don't understand exactly, but I thought perhaps you might want to know WHY the server was crashing and how even though it seems like we were doing nothing, we were trying to fix it.

 

In these situations, because it requires thinking about the issue, it is helpful if you are patient and wait to ask why it happened until after it's fixed.

 

Hope this cleared things up

 

Pandette


  • 0

#2

Pandette
  • Pandette
  • Special Advisor to the Wizengamot
  • Administrators
  • 2648 posts
  • IGN:iarepandemonium

#BlameDima


  • 0

#3

Veara Titan
  • Veara Titan
  • N.E.W.T. Student
  • Student
  • 403 posts
  • IGN:Veara Titan / Veara_

Thanks for this post, I fully understand why the server was crashing now :)


  • 0

#4

Crane
  • Crane
  • Chief of the Wizards Council
  • Administrators
  • 743 posts
  • IGN:Liam Blishwick

#BlameDima


  • 0

#5

TheStartreker
  • TheStartreker
  • Chief of the Wizards Council
  • Student
  • 771 posts
  • IGN:Star Thestral Holmes

#BlameDima


  • 0

#6

FroschThink
  • FroschThink
  • N.E.W.T. Student
  • Student
  • 205 posts
  • IGN:Josh Dun

#blameDima


  • 0


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users