VSH2-Devs / Vs-Saxton-Hale-2

VSH2 is a rewrite of the original VSH, meant to combine the best of VSH and FF2.
https://forums.alliedmods.net/showthread.php?t=286701
50 stars 15 forks source link

Errors when all players leave server with VSH2 running #28

Closed Starblaster64 closed 7 years ago

Starblaster64 commented 8 years ago

Getting several errors when all players leave a server while VSH2 is running. Lots of invalid client errors.

L 09/25/2016 - 12:55:11: [SM] Exception reported: Invalid client index 0 L 09/25/2016 - 12:55:11: [SM] Blaming: vsh2.smx() L 09/25/2016 - 12:55:11: [SM] Call stack trace: L 09/25/2016 - 12:55:11: [SM] [0] ThrowError L 09/25/2016 - 12:55:11: [SM] [1] Line 40, C:\hlserver\tf\addons\sourcemod\scripting\include\morecolors.inc::CPrintToChat() L 09/25/2016 - 12:55:11: [SM] [2] Line 1367, modules/handler.sp::_SkipBossPanel() L 09/25/2016 - 12:55:11: [SM] [4] Call_Finish L 09/25/2016 - 12:55:11: [SM] [5] Line 639, modules/stocks.inc::DoThink() L 09/25/2016 - 12:55:11: [SM] Exception reported: Invalid client index 0 L 09/25/2016 - 12:55:11: [SM] Blaming: vsh2.smx() L 09/25/2016 - 12:55:11: [SM] Call stack trace: L 09/25/2016 - 12:55:11: [SM] [0] ThrowError L 09/25/2016 - 12:55:11: [SM] [1] Line 40, C:\hlserver\tf\addons\sourcemod\scripting\include\morecolors.inc::CPrintToChat() L 09/25/2016 - 12:55:11: [SM] [2] Line 1367, modules/handler.sp::_SkipBossPanel() L 09/25/2016 - 12:55:11: [SM] [4] Call_Finish L 09/25/2016 - 12:55:11: [SM] [5] Line 639, modules/stocks.inc::DoThink() L 09/25/2016 - 12:55:25: [SM] Exception reported: Client index 0 is invalid L 09/25/2016 - 12:55:25: [SM] Blaming: vsh2.smx() L 09/25/2016 - 12:55:25: [SM] Call stack trace: L 09/25/2016 - 12:55:25: [SM] [0] AreClientCookiesCached L 09/25/2016 - 12:55:25: [SM] [1] Line 110, modules/base.sp::BaseFighter.iPresetType.get() L 09/25/2016 - 12:55:25: [SM] [2] Line 398, modules/gamemode.sp::VSHGameMode.GetBossType() L 09/25/2016 - 12:55:25: [SM] [3] Line 135, modules/events.sp::RoundStart()

Starblaster64 commented 8 years ago

stocks.inc line numbers might be a little off, since this is on the branch I'm doing all the model/material stuff on, but I didn't touch anything related to what's in the errors.

assyrianic commented 8 years ago

yea it errors out because it's not catching the disconnecting player fast enough. Do you know a hook/event that fires when a player is about to leave?

I should mention these errors do not affect the gameplay or mod entirely.

x3m77rus commented 7 years ago

https://wiki.alliedmods.net/Generic_Source_Server_Events#player_disconnect Is EventHookMode_Pre will be fast enough?

CookiesIO commented 7 years ago

In some cases for _SkipNextBoss() there's simply not enough players and so FindNextBoss doesn't return a valid a player. The loop looks for the next 3 players, but if there's less than that on the server, it wont find any and thus will try to send a chat message to client 0 (which is, as seen in errors logs, not good).

The upnext[j] there should be checked if it's a valid client before continuing on.

That block should probably be something like this

{
    upnext[j] = gamemode.FindNextBoss();
    if (IsValidClient(upnext[j].index))
    {
        upnext[j].bSetOnSpawn = true;
        if (!j)
            SkipBossPanelNotify(upnext[j].index);
        else CPrintToChat(upnext[j].index, "{olive}[VSH]{default} You are going to be a Boss soon! Type {olive}/halenext{default} to check/reset your queue points.");
    }
}
Starblaster64 commented 7 years ago

@CookiesIO Last time I remember seeing you was your release of BFF. Anyway, I actually already fixed what you pointed out when I noticed morecolors throwing errors about printing to bots, I'll push it along with the Goomba Stomp integration when I get around to it.

CookiesIO commented 7 years ago

@Starblaster64 Haha, yeah, that's some time ago. Actually I've returned to working on BFF, which we'll use for the server(s) my new community runs when it's ready, until then we're using VSH2.

Alright, neat. Reason I pointed it out is that we have run into quite the error spam after running it for a few days, I have a short list with proposed fixes (I got the error log thrown at me while I was sick, so didn't feel digging too deep and fix it myself at the time). Should I create issues for each of them, with the proposed fixes in them?

Starblaster64 commented 7 years ago

@CookiesIO Yea that'd be great. I haven't really had time to debug all the errors myself, and Nergal is working on other things I believe.

Good luck with your BFF server too.