SA-MP Forums Archive
[Ajuda] Server Caindo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Server Caindo (/showthread.php?tid=658466)



Server Caindo - ViniBnT - 04.09.2018

Bom pessoal oq estб acontecendo й o seguinte, meu servidor estб caindo umas 3 vezes por dia e sу volta quando reinicio o samp-server.
Recebo sempre essas mesmas mensagens no server-log:

PHP код:
[AVISORafael_Helper (IP177.37.127.28conectou-se.
Rafael_Helper logou no server.
[
partFEAR8 has left the server (6:1)
[
connection177.37.127.28:65529 requests connection cookie.
Kicking 177.37.127.28 because they didn't logon to the game.
[connection] 177.37.127.28:59884 requests connection cookie.
Kicking 177.37.127.28 because they didn'
t logon to the game.
[
connection177.37.127.28:60703 requests connection cookie.
[
connection177.37.127.28:60703 requests connection cookie.
[
connection187.23.130.253:58576 requests connection cookie.
Kicking 177.37.127.28 because they didn't logon to the game.
Kicking 187.23.130.253 because they didn'
t logon to the game.
[
connection177.37.127.28:60705 requests connection cookie.
Kicking 177.37.127.28 because they didn't logon to the game. 
Tenho um FS de monitoramento de Callbacks, quando acontece isso sempre a ultima Callback й OnPlayerDisconnect, vou postar aqui duas ocasiхes que o server caiu:
PHP код:
[14:30:36Rafael_Fonseca in OnPlayerStateChange7 1 Date03/09
[14:30:36Rafael_Fonseca in OnPlayerDeath0 65535 255 Date03/09
[14:30:36Gustavo_BnT in OnPlayerWeaponShot4 24 0 65535 -979.37 1079.64 1344.16 Date03/09
[14:30:36Douglasz in OnPlayerDisconnectDate03/09
[11:25:26FEAR8 in OnPlayerEnterVehicle431 0 Date04/09
[11:25:26FEAR8 in OnPlayerEnterVehicle431 0 Date04/09
[11:25:28FEAR8 in OnPlayerDisconnectDate04/09 
Serб que pode ser algo no OnPlayerDisconnect?
Vou mandar o cуdigo da Callback aqui:
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
//SendDeathMessage(INVALID_PLAYER_ID,playerid,201);
    //KillTimer(FomeSedeTimer[playerid]);
    
VendendoInv[playerid] = 0;
    
OnPlayerSave(playerid);
    
DestroyVehicle(RC[playerid]);
    
SalvarAcessoriosPlayer(playerid);
    
SalvarInventario(playerid);
    if(
PlayerInfo[playerid][pTut] == 0){
        
KillTimer(PlayerInfo[playerid][pTimerTuto]);
    }
    if(
gPlayerLogged[playerid]){
        
Delete3DTextLabel(labelDano[playerid]);
    }
    if(
GetPVarInt(playerid,"roped") == 1)
    {
        for(new 
destr=0;destr<=ropelength;destr++)
         {
              
DestroyDynamicObject(r0pes[playerid][destr]);
        }
    }
    
removerRace(playerid);
    if(
GetPVarInt(playerid"varAdmin") > 0){
         
PlayerInfo[playerid][pAdmin] = GetPVarInt(playerid"varAdmin");
    }
    new 
string[256];
    if(
MecanicMission[playerid])
    {
        
EndMission(playerid);
    }
    if(
GetPVarInt(playerid"VarBomba"))
    {
        new 
objectid GetPVarInt(playerid"VarObject");
        
DestroyDynamicObject(objectid);
    }
    
destroyPlayerSound(playerid);
    switch(
reason)
    {
        case 
0:format(string,sizeof(string),"**%s: saiu do servidor por erro de conexгo ou crash."PlayerName(playerid));
        case 
1:format(string,sizeof(string),"**%s: saiu do servidor por vontade propria."PlayerName(playerid));
        case 
2:format(string,sizeof(string),"**%s: saiu do servidor kickado ou banido."PlayerName(playerid));
        default:
format(string,sizeof(string),"**%s: saiu do servidor por causa desconhecida."PlayerName(playerid));
    }
    
SendClientMessageInRange(30.0playeridstringCOLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2);
    
DestroyDynamicObject(GetPVarInt(playerid"neon1"));
     
DestroyDynamicObject(GetPVarInt(playerid"neon2"));
    if( 
InTeste[playerid])
    {
        
TestEnd(playerid0);
    }
// territorios skate
    
if(ProvocoSkate[playerid] == 1)
    {
        
GangZoneStopFlashForAll(GZSkate);
        
GangZoneShowForAll(GZSkate0xFFFFFF96);
        
GuerranoSkate 0;
        
ProvocoSkate[playerid] = 0;
        
donoskate 0;
        
Dominando[playerid] = 0;
        
KillTimer(TempoGuerraSkate);
        
EmPista[playerid] = 0;
    }
// territorios skate
    
if(ProvocoGalpao[playerid] == 1// Se o Player Estiver Domindo ( /do ), se ele sair, a GZ Ficarб Branca Denovo, Assim Podendo Dominar Denovo.
    
{
        
// Essas Funзхes Abaixo Reseta a GangZone, Porque o Player que estavб dominando saiu, a GZ Volta ao seu estado de inнcio.
        
GangZoneStopFlashForAll(GZGalpao); // Para Fazer a GangZone Parar de Piscar.
        
GangZoneShowForAll(GZGalpao0xFFFFFF96); // GangZone Voltarб a Ficar Branca.
        
GuerranoGalpao 0// Setando Para poder dominar.
        
ProvocoGalpao[playerid] = 0// Setando Para poder dominar.
        
donoGalpao 0// Setando para o dono 0 ( ninguem ).
        
DominandoGalpao[playerid] = 0// Setando que ninguem estб dominando.
        
KillTimer(TempoGuerraGalpao); // Destroi o SetTimer Criado Para Dominar a GZ
        
EmGalpao[playerid] = 0;
    }
    if(
EmGuerra[playerid] && TendoGuerra >= 1)
    {
          
format(stringsizeof(string), "* %s saiu da Guerra!",PlayerName(playerid));
          
SendFamilyMessage(3,GetPlayerColor(playerid), string);
          
SendFamilyMessage(15,GetPlayerColor(playerid), string);
          
SendFamilyMessage(23,GetPlayerColor(playerid), string);
          
EmGuerra[playerid] = 0;
    }
    if(
GuerranoGalpao >= && EmGalpao[playerid] >= 1)
    {
          
EmGalpao[playerid] = 0;
    }
    if(
GuerranoSkate >= && EmPista[playerid] >= 1)
    {
          
EmPista[playerid] = 0;
    }
    if(
EmGuerraMorro[playerid] && GuerraMorro[gGuerra] == true)
    {
          
format(stringsizeof(string), "* %s saiu da Guerra do Morro!",PlayerName(playerid));
          
SendFamilyMessage(1,GetPlayerColor(playerid), string);
          
SendFamilyMessage(2,GetPlayerColor(playerid), string);
          
SendFamilyMessage(5,GetPlayerColor(playerid), string);
          
SendFamilyMessage(6,GetPlayerColor(playerid), string);
          
SendFamilyMessage(14,GetPlayerColor(playerid), string);
          
SendFamilyMessage(17,GetPlayerColor(playerid), string);
          
SendFamilyMessage(18,GetPlayerColor(playerid), string);
          
SendFamilyMessage(19,GetPlayerColor(playerid), string);
          
SendFamilyMessage(21,GetPlayerColor(playerid), string);
          
SendFamilyMessage(26,GetPlayerColor(playerid), string);
          
SendFamilyMessage(33,GetPlayerColor(playerid), string);
          
SendFamilyMessage(34,GetPlayerColor(playerid), string);
          
EmGuerraMorro[playerid] = 0;
    }
    if(
PlayerPaintballing[playerid] != 0)
    {
        
PaintballPlayers --;
    }
    if(
PlayerKarting[playerid] > && PlayerInKart[playerid] > 0)
    {
        
KartingPlayers --;
    }
    for(new 
iMAX_PREGOSi++)
    {
        if(
SpikeInfo[i][sCreated] && SpikeInfo[i][sID] == playerid)
        {
               
SpikeInfo[i][sID]=999;
            
SpikeInfo[i][sCreated]=0;
            
DestroyDynamicObject(SpikeInfo[i][sObject]);
            
Delete3DTextLabel(SpikeInfo[i][sText]);
        }
    }
    for(new 
iMAX_BARREIRASi++)
    {
        if(
BarreiraInfo[i][brCreated] && BarreiraInfo[i][brID] == playerid)
        {
               
BarreiraInfo[i][brID]=999;
            
BarreiraInfo[i][brCreated]=0;
            
DestroyDynamicObject(BarreiraInfo[i][brObject]);
            
Delete3DTextLabel(BarreiraInfo[i][brText]);
        }
    }
    for(new 
i100i++)
    {
        if(
BloqueioInfo[i][bqCreated] && BloqueioInfo[i][bqID] == playerid)
        {
               
BloqueioInfo[i][bqID]=999;
            
BloqueioInfo[i][bqCreated]=0;
            
DestroyDynamicObject(BloqueioInfo[i][bqObject]);
            
Delete3DTextLabel(BloqueioInfo[i][bqText]);
        }
    }
    
DisablePlayerCheckpoint(playerid);
    
KillTimer(TimerSS[playerid]);
    new 
caller Mobile[playerid];
    
OnPlayerSave(playerid);
    if(
VozDePrisao[playerid] == 1)
    {
        
PlayerInfo[playerid][pJailed] = 1;
        
PlayerInfo[playerid][pJailTime] = 60;
        
format(stringsizeof(string), "* %s saiu do servidor com voz de prisao, e foi preso automaticamente!"PlayerName(playerid));
        
SendClientMessageInRange(50.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
VozDePrisao[playerid] = 0;
    }
    if(
caller != 255)
    {
        if(
caller 255)
        {
            
SendClientMessage(caller,  COLOR_GRAD2"A ligaзгo caiu..");
            
CellTime[caller] = 0;
            
CellTime[playerid] = 0;
            
Mobile[caller] = 255;
        }
        
Mobile[playerid] = 255;
        
CellTime[playerid] = 0;
    }
    if(
HireCar[playerid] > 0)
    {
        
VTrancado[HireCar[playerid]] = 0;
        
UnLockCar(HireCar[playerid]);
        
SetVehicleToRespawn(HireCar[playerid]);
        
HireCar[playerid] = 0;
    }
    if (
gLastCar[playerid] > 0)
    {
        
gLastDriver[gLastCar[playerid]] = 300;
        if(
PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
        {
            
gCarLock[gLastCar[playerid]] = 0;
            
UnLockCar(gLastCar[playerid]);
        }
    }
    foreach(new 
Player)
    {
            if(
GetPVarInt(playerid"MercID") == i)
            {
                
format(stringsizeof string"* Seu ajudante %s saiu do servidor."NomePlayer(playerid));
                
SendClientMessage(iCOLOR_YELLOWstring);
            }
            else if(
GetPVarInt(i"MercID") == playerid)
            {
                
format(stringsizeof string"* O jogador que vocк estava ajudando: [%s] saiu do servidor."NomePlayer(playerid));
                
SendClientMessage(iCOLOR_YELLOWstring);
                
SetPVarInt(i"MercID"999);
            }
            if(
TaxiAccepted[i] < 999)
            {
                if(
TaxiAccepted[i] == playerid)
                  {
                    
TaxiAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~O Cliente~n~~r~Saiu do jogo"50001);
                    
TaxiCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
            if(
PizzaAccepted[i] < 999)
            {
                if(
PizzaAccepted[i] == playerid)
                  {
                    
PizzaAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~O Cliente~n~~r~Saiu do jogo"50001);
                    
PizzaCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
            else if(
CopsrondaAccepted[i] < 999)
            {
                if(
CopsrondaAccepted[i] == playerid)
                {
                    
CopsrondaAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~Policial o player~n~~r~Deixou o jogo"50001);
                    
CopsrondaCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
            else if(
MedicAccepted[i] < 999)
            {
                if(
MedicAccepted[i] == playerid)
                {
                    
MedicAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~O Cliente~n~~r~Saiu do jogo"50001);
                    
MedicCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
            else if(
BombAccepted[i] < 999)
            {
                if(
BombAccepted[i] == playerid)
                {
                    
BombAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~O Cliente~n~~r~Saiu do jogo"50001);
                    
BombCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
            else if(
MechanicAccepted[i] < 999)
            {
                if(
MechanicAccepted[i] == playerid)
                {
                    
MechanicAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~O Cliente~n~~r~Saiu do jogo"50001);
                    
MechanicCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
            else if(
BusAccepted[i] < 999)
            {
                if(
BusAccepted[i] == playerid)
                {
                    
BusAccepted[i] = 999;
                    
GameTextForPlayer(i"~w~O Cliente~n~~r~Saiu do jogo"50001);
                    
BusCallTime[i] = 0;
                    
DisablePlayerCheckpoint(i);
                }
            }
    }
    if(
TransportCost[playerid] > && TransportDriver[playerid] < 999)
    {
        if(
IsPlayerConnected(TransportDriver[playerid]))
        {
            
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
            
TransportTime[TransportDriver[playerid]] = 0;
            
TransportCost[TransportDriver[playerid]] = 0;
            
format(stringsizeof(string), "~w~Passageiro saiu~n~~g~ganhou R$%d",TransportCost[playerid]);
            
GameTextForPlayer(TransportDriver[playerid], string50001);
        }
    }
    if(
GotHit[playerid] > 0)
    {
        if(
GetChased[playerid] < 999)
        {
            if(
IsPlayerConnected(GetChased[playerid]))
            {
                
SendClientMessage(GetChased[playerid], COLOR_YELLOW"Seu contrato saiu do servidor.");
                
GoChase[GetChased[playerid]] = 999;
            }
        }
    }
    if(
GotTri[playerid] > 0)
    {
        if(
GetChased[playerid] < 999)
        {
            if(
IsPlayerConnected(GetChased[playerid]))
            {
                
SendClientMessage(GetChased[playerid], COLOR_YELLOW"Seu contrato saiu do servidor.");
                
GoChase[GetChased[playerid]] = 999;
            }
        }
    }
    if(
GotMer[playerid] > 0)
    {
        if(
GetChased[playerid] < 999)
        {
            if(
IsPlayerConnected(GetChased[playerid]))
            {
                
SendClientMessage(GetChased[playerid], COLOR_YELLOW"Seu contrato saiu do servidor.");
                
GoChase[GetChased[playerid]] = 999;
            }
        }
    }
    if(
HireCar[playerid] != 299)
    {
        
gLastDriver[HireCar[playerid]] = 300;
        
VTrancado[HireCar[playerid]] = 0;
        
UnLockCar(HireCar[playerid]);
    }
    if (
gLastCar[playerid] > 0)
    {
        
gLastDriver[gLastCar[playerid]] = 300;
        if(
PlayerInfo[playerid][pPHousekey] != gLastCar[playerid]-1)
        {
            
VTrancado[gLastCar[playerid]] = 0;
            
UnLockCar(gLastCar[playerid]);
        }
    }
    if(
TransportDuty[playerid] == 1)
    {
        
TaxiDrivers -= 1;
    }
    if(
TransportDuty[playerid] == 2)
    {
        
BusDrivers -= 1;
    }
    if(
IsACop(playerid))
    {
        if(
EmpregoDuty[playerid] == 2) { Copsronda -= 1; }
    }
    if(
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pLider] == 4)//1 daki pr baixo os 3
    
{
        if(
EmpregoDuty[playerid] == 2) { Medics -= 1; }
    }
    if(
IsAMec(playerid))
    {
        if(
EmpregoDuty[playerid] == 2) { Mechanics -= 1; }
    }
    if((
PlayerInfo[playerid][pAdmin] >= 1) && (PlayerInfo[playerid][pAdmin] <= 1341))
    {
        new 
AdminName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridAdminNamesizeof(AdminName));
        
format(stringsizeof(string), "~y~%s: ~r~OFF"AdminName);
        
GameTextForAll(string50001);
    }
    
ResetVars(playerid);
    return 
true;




Re: Server Caindo - ViniBnT - 04.09.2018

Estou reparando uma coisa tambйm, tem uns caras que estгo entrando e usando um Xiter pra trollar o servidor e quando vc vai banir, aparece Server Closed Connection. Nгo dб pra banir os xiters, e depois disso passa um tempinho e o Server Cai. Alguйm jб passou por isso e conhece este Xiter Anti-ban, e serб que pode ser isso que estб fazendo o Server cair?


Re: Server Caindo - LeViNS - 04.09.2018

Use o crashdetect.
Para saber a linha exata do erro coloque o pawn.cfg na pasta pawno do seu gamemode e o re-compile. (usando o crashdetect)


Re: Server Caindo - ViniBnT - 04.09.2018

Eu jб uso crashdetect, jб tenho este arquivo pawn.cfg. Nгo acontece nenhum tipo de Debug quando o server cai. O que eu estou achando que pode ser й este Xiter que possui Anti-ban, pois por coincidкncia, toda vez que tenta banir este player que estб com Xiter, acontece o contrбrio eu sou banido, e depois de um tempo o server cai e todos servidor sгo kickados e ninguйm consegue logar mais.


Re: Server Caindo - LeViNS - 04.09.2018

o crashdetect estб configurado para carregar primeiro que os outros no server.cfg?

exemplo:
plugins crashdetect.so outros.so


Re: Server Caindo - ViniBnT - 04.09.2018

Sim, uso 4 plugins: crashdetect streamer sscanf mapandreas
Nesta Ordem


Re: Server Caindo - GSantana - 04.09.2018

pode me mandar a funзгo que dб ban nos player ? se tu usa Ban(playerid); й por isso, tem um hack que faz o server cair quando usa estб funзгo


Re: Server Caindo - ViniBnT - 05.09.2018

Comando de Ban:
PHP код:
    CMD:ban(playeridparams[])
    {
            new 
result[64];
            if(
sscanf(params"us[64]"giveplayeridresult))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /ban [id] [motivo]");
                return 
true;
            }
            if(
IsPlayerDono(giveplayerid))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode avisar um Admin Dono! Vocк foi Banido!");
                
Ban(playerid);
                return 
true;
            }
            new 
string[256];
            if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
IsPlayerNPC(giveplayerid))return SendClientMessage(playeridCOLOR_YELLOW"SMS: Se vocк usar este comando em um de nossos robфs, vocк irб sofrer as consequкncias!, enviou: Gasparzinho (000)");
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
format(stringsizeof(string), "[BAN]: %s foi banido por %s, Motivo: %s"giveplayersendername, (result));
                        
BPFLogs("ban"string);
                        
format(stringsizeof(string), "[BAN]: %s foi banido por %s, Motivo: %s"giveplayersendername, (result));
                        
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        
PlayerInfo[giveplayerid][pBan] = 1;
                        
TextDrawShowForPlayer(giveplayeridTextBan);
                        
SBan(giveplayeridresultPlayerName(playerid));
                        
PlayerPlaySound(giveplayerid312020.00.00.0);
                        return 
true;
                    }
                }
//not connected
            
}
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"    Vocк nгo pode usar este comando!");
            }
            return 
true;
    } 



Re: Server Caindo - ViniBnT - 05.09.2018

Й essa parte do cуdigo que vc queria ver mesmo?


Re: Server Caindo - connork - 05.09.2018

Faзa um debug dos loops dentro da funзгo, tambйm seria ъtil o debug de toda a callback. Vocк pode fazer isto simplesmente adicionando um "printf" a cada "etapa" do script.

Por exemplo:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    //SendDeathMessage(INVALID_PLAYER_ID,playerid,201);

    //KillTimer(FomeSedeTimer[playerid]);
    VendendoInv[playerid] = 0;
    printf("Iniciando OnPlayerSave(%d)", playerid);
    OnPlayerSave(playerid);
    [...]