Null Reference Error

Posts 1–9 of 9 · Page 1 of 1
Null Reference Error
Hi,

System.*********enceException: Object reference not set to an instance of an obj
ect. at wServer.realm.entities.player.Player.Death(String killer) in c:\Users\user\Documents\GitHub\Phoenix-Realms\wServer\realm\entities\player\Player.cs:lin e 1274

Getting the above error when anyone on the server dies, so that their character doesn't actually die.

Phoenix 1.9.2 build.

Any Ideas?
Is this for everyone, or just for people above rank 2?
Not 100% sure about lower ranks, but we've tried at rank 8 10 12 and 22, all deaths weren't permanent.

Edit: It generally happens after this (before this error the perma death works)

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.SendAsync(SocketAsyncEve ntArgs e)
at wServer.NetworkHandler.SendPacket(Packet pkt) in c:\Users\user\Document
s\GitHub\Phoenix-Realms\wServer\NetworkHandler.cs:line 231
Quote Originally Posted by phoenixice View Post
Not 100% sure about lower ranks, but we've tried at rank 8 10 12 and 22, all deaths weren't permanent.

Edit: It generally happens after this (before this error the perma death works)

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.SendAsync(SocketAsyncEve ntArgs e)
at wServer.NetworkHandler.SendPacket(Packet pkt) in c:\Users\user\Document
s\GitHub\Phoenix-Realms\wServer\NetworkHandler.cs:line 231
if you're using the latest phoenix source... Staff members can't die, It's a thing we implemented to make sure that only legit players got put on the legends board.

As for the error you just posted, It happens on all servers. It can't crash the server. It's just a problem with sending packets to a disconnected / not connected client. Nothing needs to be done about it.
Quote Originally Posted by Kithio View Post
if you're using the latest phoenix source... Staff members can't die, It's a thing we implemented to make sure that only legit players got put on the legends board.

As for the error you just posted, It happens on all servers. It can't crash the server. It's just a problem with sending packets to a disconnected / not connected client. Nothing needs to be done about it.
No one is staff currently, this is just testing to make sure the server is working - players don't permanently die, then sometimes they do - they stop permanently dying when that error happens (might be because its an uncaught error, you have no validation on whether the client is connected, or a try catch block setup to protect against it)

This also causes immense server lag, causing players to all not receive packets eventually, I've managed to apply a temporary fix by doing a check prior to attempting to send packets to disconnected clients on that line.

But this doesn't stop the problem with .death() null reference issue, as I'm not even sure what is null here (haven't read through the code thoroughly enough to understand whats going on)
If you want to change it so that staff can die,

Code:
if (Client.Account.Rank > 2)
            {
                HP = psr.Character.MaxHitPoints;
                psr.Disconnect();
                return;
            }
Note I don't know what rank number it is on the latest phoenix source

Just change the
Code:
if (Client.Account.Rank > 2)
to whatever rank number you want and then rebuild solution and now anyone can die

Not hard to do which is funny as people don't know this
Quote Originally Posted by Ahl View Post
If you want to change it so that staff can die,

Code:
if (Client.Account.Rank > 2)
            {
                HP = psr.Character.MaxHitPoints;
                psr.Disconnect();
                return;
            }
Note I don't know what rank number it is on the latest phoenix source

Just change the
Code:
if (Client.Account.Rank > 2)
to whatever rank number you want and then rebuild solution and now anyone can die

Not hard to do which is funny as people don't know this
I believe you missed a very important part in the latest reply:
"No one is staff currently"

This issue isn't happening because player are staff, players are not getting perma death when dying, but this is not always the case, it turns off and on depending on whether that error above happens (first post) it has nothing to do with staff, as the method itself is erroring.

EDIT: Just realized what you guys mean by Ranks, thought ranks meant their current level, apologies - but no one that is dying is ranked higher then 0 in the db.
Quote Originally Posted by phoenixice View Post
I believe you missed a very important part in the latest reply:
"No one is staff currently"

This issue isn't happening because player are staff, players are not getting perma death when dying, but this is not always the case, it turns off and on depending on whether that error above happens (first post) it has nothing to do with staff, as the method itself is erroring.

EDIT: Just realized what you guys mean by Ranks, thought ranks meant their current level, apologies - but no one that is dying is ranked higher then 0 in the db.
Lol yeah I was responding to what Kithio said.

Anyways is this in dungeons as well including the realm?
@Stellar Spark Any suggestions?
Quote Originally Posted by Ahl View Post


Lol yeah I was responding to what Kithio said.

Anyways is this in dungeons as well including the realm?
@Stellar Spark Any suggestions?
I can't say for certain it happens in the dungeon or not - as when someone dies and the null reference happens, all players on the server stop getting perma death'd
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us