B193 server crash fix

endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue
I've been noticing since B190-193 (they all came so fast) that the server has been crashing quite frequently, all pointing to the same line of code when a player quits.
I've removed that code and so far it appears to have fixed the problem, only time will tell if it truly has.

The last thing logged by the server before it restarts is:

Client disconnected (118.209.xxx.xxx) Quit
Script Error: lua/Player_Server.lua:31: Attempt to access an object that no longer exists (was type ServerClient)
[C]:-1

Here is the contents of Player_server.lua before the change:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// Returns true if this player is a bot
function Player:GetIsVirtual()

    local isVirtual = false
    
    if self.client then
        isVirtual = self.client:GetIsVirtual()
    end
    
    return isVirtual
    
end<!--c2--></div><!--ec2-->

And after:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// Returns true if this player is a bot
function Player:GetIsVirtual()

    local isVirtual = false
    return isVirtual
    
end<!--c2--></div><!--ec2-->

I'm not too worried about that piece of code not running, as I don't use bots.
<a href="http://getsatisfaction.com/unknownworlds/topics/server_crash_when_player_leaves_log_attached" target="_blank">http://getsatisfaction.com/unknownworlds/t...es_log_attached</a>

Comments

  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Thanks. We caught this too after 193. It will be in 194 which will be out very soon.
Sign In or Register to comment.