A error

05/18/2010 13:03 2010mrsurfer#1
Okay so i get this error in the console when i run the server:
[Only registered and activated users can see links. Click Here To Register...]

I go into the source and theres no errors :S im not totally sure what it is...
Okay so this is the screenshot of the source:
[Only registered and activated users can see links. Click Here To Register...]

Sorry if the screenshots are abit hard to see, its a very sunny day and my blinds were open.
05/18/2010 13:27 PrettyGodness#2
i got same error =\
05/18/2010 13:37 2010mrsurfer#3
Quote:
Originally Posted by PrettyGodness View Post
i got same error =\
It confused me when i had a look, i couldnt see any errors ^^
05/18/2010 13:54 teroareboss1#4
if (MyMath.ChanceSuccess(90))
{
if (Char != null)
if (MobID == 1)
{
Char.CPs += 900;
Char.Silvers += 900;
}
}
05/19/2010 01:25 kinshi88#5
Read the error message carefully:
"Object reference not set to an instance of an object."

So you're using an object/variable when it hasn't been set to something.

Like if you're using a class called "Conquer", and you just define it like this:
Code:
public static Conquer MyCo;
Then you try to use it:
Code:
MyCo.Version += 10;
You'll get the same error, since MyCo == null.

So as @teroareboss1 pointed out, your Char is probably set to null, thus the error. =D
05/19/2010 04:57 pro4never#6
Quote:
Originally Posted by kinshi88 View Post
Read the error message carefully:
"Object reference not set to an instance of an object."

So you're using an object/variable when it hasn't been set to something.

Like if you're using a class called "Conquer", and you just define it like this:
Code:
public static Conquer MyCo;
Then you try to use it:
Code:
MyCo.Version += 10;
You'll get the same error, since MyCo == null.

So as @teroareboss1 pointed out, your Char is probably set to null, thus the error. =D
Damn you beat me to most of the explanation but the actual problem should be more related to setting the drop item. I had this for a short while when I was coding dis city drops.

If you are using a bunch of if/elseif statements to control what item id is dropped then you MUST make sure you have a backup plan.

Example:

Lets say you have a simple drop ratio on a specific map... if you had something along the lines of..

if(Calculation.PercentSuccess(50))
{
DropItem.ID = MeteorID;
}
else if (Calculation.PercentSuccess(50))
{
DropItem.ID = DragonBallId;
}


If you used something like that then you could theoretically NOT have anything set for the item ID causing this error. Yes you have two 50 percent chance things but just like flipping a coin... you can fail to flip heads twice in a row.

Basically check through your drop code and make sure that there isn't something in there that is being left empty. Chances are you are creating a structure for a new item and then filling in the blanks (what item ID, what +, what dura, etcetcetc) If one of those is left blank and not filled in then it can cause this kind of error to pop up as it seems to be.


I'd vote for that over character as it's happening in the drop item section of code. My other theory is that somewhere on the server a guard or something is killing monsters and the server isn't setup to control who the killer was and therefor is setting the "owner" of the item to something fucked up.... that seems less likely though.
05/19/2010 07:51 kinshi88#7
Well it might not be that that Char is null, but I did explain the object reference error =P
05/19/2010 08:28 Arcо#8
If the char was null it wouldn't be online?
05/19/2010 09:56 2010mrsurfer#9
I sort of understand what your saying, Thanks anyway :D i changed it