Raised This Month: $51 Target: $400
 12% 

Server crash when I disconnect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
revoolution
Junior Member
Join Date: Oct 2011
Old 10-30-2014 , 19:47   Server crash when I disconnect
Reply With Quote #1

Hello,
I'm suffering from a weird server crash ...
I'm starting linux cs:go server with latest mm and sm.

Everything is just fine, maps are changing, people are playing, everybody is happy with a smile on a face ... but when I (person who sets up a server) quit - the server crash and reload o.O

I added -debug to the starting parameters but i can't find nothing.

The only thing that appears in console when i CONNECT is :

Code:
[libprotobuf ERROR google/protobuf/descriptor.cc:4153] "MSG_SPLITSCREEN_TYPE_BITS" uses the same enum value as "MSG_SPLITSCREEN_REMOVEUSER". If this is intended, set 'option allow_alias = true;' to the enum definition.
Any1 help ?

debian-6.0.64bity

Maybe it will help .. i'm using this for autojoin ...

Code:
#include <cstrike>
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    HookEvent("player_connect_full", Event_OnFullConnect, EventHookMode_Pre);
    HookEvent("cs_match_end_restart", Event_OnMatchRestart, EventHookMode_Pre);
    HookEvent("player_team", Event_OnPlayerTeam, EventHookMode_Pre);
    HookEvent("player_death", Event_OnPlayerDeath, EventHookMode_Pre);
    AddCommandListener(Command_Join, "jointeam");
}

public Action:Event_OnFullConnect(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!client || !IsClientInGame(client))
        return Plugin_Continue;

    new iRed, iBlue;
    for(new i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i))
            continue;

        new iTeam = GetClientTeam(i);
        if(iTeam == CS_TEAM_T)
            iRed++;
        else if(iTeam == CS_TEAM_CT)
            iBlue++;
    }

    if(iRed < iBlue)
        SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_T);
    else
        SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_CT);

    ForcePlayerSuicide(client);
    CS_RespawnPlayer(client);
    return Plugin_Continue;
}

public Action:Event_OnMatchRestart(Handle:event, const String:name[], bool:dontBroadcast)
{
    new iRed, iBlue, iJoin;
    for(new i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i))
            continue;

        switch(GetClientTeam(i))
        {
            case CS_TEAM_T:
                iRed++;
            case CS_TEAM_CT:
                iBlue++;
        }
    }

    for(new i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i))
            continue;

        if(iRed < iBlue)
            iJoin = CS_TEAM_T;
        else if(iBlue < iRed)
            iJoin = CS_TEAM_CT;
        else
            iJoin = GetRandomInt(CS_TEAM_T, CS_TEAM_CT);

        switch(iJoin)
        {
            case CS_TEAM_T:
                iRed++;
            case CS_TEAM_CT:
                iBlue++;
        }

        ChangeClientTeam(i, iJoin);
    }
}

public Action:Event_OnPlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!client || !IsClientInGame(client))
        return Plugin_Continue;

    if(!IsPlayerAlive(client))
        CreateTimer(0.1, Timer_Respawn, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
    return Plugin_Continue;
}

public Action:Timer_Respawn(Handle:timer, any:userid)
{
    new client = GetClientOfUserId(userid);
    if(!client)
        return Plugin_Continue;

    new iTeam = GetClientTeam(client);
    if(iTeam <= CS_TEAM_SPECTATOR)
        return Plugin_Continue;

    if(IsPlayerAlive(client))
        return Plugin_Continue;

    CS_RespawnPlayer(client);

    return Plugin_Continue;
}

public Action:Command_Join(client, const String:command[], argc)
{
    decl String:sJoining[8];
    GetCmdArg(1, sJoining, sizeof(sJoining));
    new iJoining = StringToInt(sJoining);
    if(iJoining == CS_TEAM_SPECTATOR)
        return Plugin_Continue;

    new iTeam = GetClientTeam(client);
    if(iJoining == iTeam)
        return Plugin_Handled;
    else
    {
        SetEntProp(client, Prop_Send, "m_iTeamNum", iJoining);
        ForcePlayerSuicide(client);
        CS_RespawnPlayer(client);
    }

    return Plugin_Continue;
}


public Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!client || !IsClientInGame(client))
        return Plugin_Continue;
}

Last edited by revoolution; 10-30-2014 at 20:15.
revoolution is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 10-31-2014 , 09:02   Re: Server crash when I disconnect
Reply With Quote #2

I think you should check IsClientInGame in Timer_Respawn
h3bus is offline
revoolution
Junior Member
Join Date: Oct 2011
Old 10-31-2014 , 13:56   Re: Server crash when I disconnect
Reply With Quote #3

Nope, something else causes a crash :/
revoolution is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode