04.09.2018, 17:49
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:
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:
Serб que pode ser algo no OnPlayerDisconnect?
Vou mandar o cуdigo da Callback aqui:
Recebo sempre essas mesmas mensagens no server-log:
PHP код:
[AVISO] Rafael_Helper (IP: 177.37.127.28) conectou-se.
Rafael_Helper logou no server.
[part] FEAR8 has left the server (6:1)
[connection] 177.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.
[connection] 177.37.127.28:60703 requests connection cookie.
[connection] 177.37.127.28:60703 requests connection cookie.
[connection] 187.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.
[connection] 177.37.127.28:60705 requests connection cookie.
Kicking 177.37.127.28 because they didn't logon to the game.
PHP код:
[14:30:36] Rafael_Fonseca in OnPlayerStateChange: 7 1 | Date: 03/09
[14:30:36] Rafael_Fonseca in OnPlayerDeath: 0 65535 255 | Date: 03/09
[14:30:36] Gustavo_BnT in OnPlayerWeaponShot: 4 24 0 65535 -979.37 1079.64 1344.16 | Date: 03/09
[14:30:36] Douglasz in OnPlayerDisconnect: 7 | Date: 03/09
[11:25:26] FEAR8 in OnPlayerEnterVehicle: 431 0 | Date: 04/09
[11:25:26] FEAR8 in OnPlayerEnterVehicle: 431 0 | Date: 04/09
[11:25:28] FEAR8 in OnPlayerDisconnect: 6 | Date: 04/09
Vou mandar o cуdigo da Callback aqui:
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
//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.0, playerid, string, COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2);
DestroyDynamicObject(GetPVarInt(playerid, "neon1"));
DestroyDynamicObject(GetPVarInt(playerid, "neon2"));
if( InTeste[playerid])
{
TestEnd(playerid, 0);
}
// territorios skate
if(ProvocoSkate[playerid] == 1)
{
GangZoneStopFlashForAll(GZSkate);
GangZoneShowForAll(GZSkate, 0xFFFFFF96);
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(GZGalpao, 0xFFFFFF96); // 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(string, sizeof(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 >= 1 && EmGalpao[playerid] >= 1)
{
EmGalpao[playerid] = 0;
}
if(GuerranoSkate >= 1 && EmPista[playerid] >= 1)
{
EmPista[playerid] = 0;
}
if(EmGuerraMorro[playerid] && GuerraMorro[gGuerra] == true)
{
format(string, sizeof(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] > 0 && PlayerInKart[playerid] > 0)
{
KartingPlayers --;
}
for(new i; i < MAX_PREGOS; i++)
{
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 i; i < MAX_BARREIRAS; i++)
{
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 i; i < 100; i++)
{
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] = 8 * 60;
format(string, sizeof(string), "* %s saiu do servidor com voz de prisao, e foi preso automaticamente!", PlayerName(playerid));
SendClientMessageInRange(50.0, playerid, string, COLOR_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 i : Player)
{
if(GetPVarInt(playerid, "MercID") == i)
{
format(string, sizeof string, "* Seu ajudante %s saiu do servidor.", NomePlayer(playerid));
SendClientMessage(i, COLOR_YELLOW, string);
}
else if(GetPVarInt(i, "MercID") == playerid)
{
format(string, sizeof string, "* O jogador que vocк estava ajudando: [%s] saiu do servidor.", NomePlayer(playerid));
SendClientMessage(i, COLOR_YELLOW, string);
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", 5000, 1);
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", 5000, 1);
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", 5000, 1);
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", 5000, 1);
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", 5000, 1);
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", 5000, 1);
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", 5000, 1);
BusCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(string, sizeof(string), "~w~Passageiro saiu~n~~g~ganhou R$%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
}
}
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] == 4 || 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(playerid, AdminName, sizeof(AdminName));
format(string, sizeof(string), "~y~%s: ~r~OFF", AdminName);
GameTextForAll(string, 5000, 1);
}
ResetVars(playerid);
return true;
}