Server Crashuje

Započeo Plen Ki Mun, Mart 12, 2018, 16:09:01 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Problem(error/warning): Kod registracije je sve u redu, ali kada idem login upisem sifru server se crashuje
Dio skripte:
case DIALOG_LOGIN:
		{
			if ( !response ) return Kick ( playerid );
			if( response )
			{
				new hashpass[ 129 ], string[ 180 ];
				WP_Hash(hashpass,sizeof(hashpass), inputtext);
				if(!strcmp(hashpass, PInfo[playerid][Pass], false))
				{
					INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
					
					GivePlayerMoneyEx(playerid, PInfo[playerid][Cash]);
					SetPlayerScore(playerid,PInfo[playerid][Score]);

     				if(PInfo[playerid][pclanID] != -1 && clanInfo[PInfo[playerid][pclanID]][gActive] == 0)
					{
					    PInfo[playerid][pclanID] = -1;
						PInfo[playerid][pclanRank] = 0;
					}
				}
				else
				{
					format(string, sizeof(string), "Dobrodosao %s "COL_WHITE"na CnR Server.\nUpisite sifru", GetName(playerid));
        			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Login", "Exit");
					PInfo[playerid][FailToLogin]++;
					switch (PInfo[playerid][FailToLogin])
					{
   						case 1: SCM(playerid, COLOR_ORANGE_RED, "Kriva sifra (1/3)");
			    		case 2: SCM(playerid, COLOR_ORANGE_RED, "Kriva sifra (2/3)");
			    		case 3:
			    		{
							SCM(playerid, COLOR_ORANGE_RED, "Upisao si sifru vise puta krivo i izbacensi (3/3)");
							SetTimerEx("KickPlayer", 100,false,"i",playerid);
 						}
   					}
   					return 1;
					
				}
				return 1;
			}
		}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
[16:05:46] [join] Rakija has joined the server (0:127.0.0.1)
[16:06:19] [debug] Server crashed while executing CNR.amx
[16:06:19] [debug] AMX backtrace:
[16:06:19] [debug] #0 000ac58c in public OnDialogResponse () from CNR.amx
[16:06:20] [debug] Native backtrace:
[16:06:20] [debug] #0 6620abc9 in ?? () from plugins\crashdetect.DLL
[16:06:20] [debug] #1 6620c8c7 in ?? () from plugins\crashdetect.DLL
[16:06:20] [debug] #2 66211489 in ?? () from plugins\crashdetect.DLL
[16:06:21] [debug] #3 66211666 in ?? () from plugins\crashdetect.DLL
[16:06:21] [debug] #4 6620a207 in ?? () from plugins\crashdetect.DLL
[16:06:21] [debug] #5 6620c87a in ?? () from plugins\crashdetect.DLL
[16:06:21] [debug] #6 65ec4629 in ?? () from plugins\streamer.DLL
[16:06:21] [debug] #7 0046ec31 in ?? () from samp-server.exe
[16:06:21] [debug] #8 00452270 in ?? () from samp-server.exe
[16:06:21] [debug] #9 0049eef9 in ?? () from samp-server.exe
[16:06:21] [debug] #10 004aa31e in ?? () from samp-server.exe

Slika/video ingame problema(obavezno ako je ingame problem): Nije potrebno
Poslednja Izmena: Mart 12, 2018, 16:10:54 POSLE PODNE od Vantage


Citat: Belegija poslato Mart 12, 2018, 16:36:26 POSLE PODNE
vrati u udb_hash i update crashdetect

Ti boga mi nisi normal, sve radi kako treba što bih vraćao lol.


Citat: Belegija poslato Mart 12, 2018, 17:34:24 POSLE PODNE
@Vantage  pa jel tebi kresuje ili svima?

Ovo je na test serveru, to jest kucnom. Sve je ok, ali kada upisem lozinku odmah se server crashuje.

Crasha kada upises pravilnu sifru ili kada pogrijesis sifru?
Software Developer

Citat: Ino42O poslato Mart 12, 2018, 18:11:39 POSLE PODNE
Crasha kada upises pravilnu sifru ili kada pogrijesis sifru?

Kada upisem pravilnu crashuje server, a kada upisem krivu sifru to jest s kojom se nisam registrirao sve je ok... To jest provjera za krivu sifru uopce ne reagira

@Ino42O

Oprostite na DP ali nema button za edit. Sada kada upisem krivu lozinku, daje mi poruku da je kriva sifra, sto je uredu. Ali i dalje crashuje kada upisem tocnu lozinku nakon krive upisane lozinke i prvi puta kada se moram login.

Jos se jednom ispricavam moderatoru ali nemoj lock temu zbog DP, morao sam jer nema edit button.
Poslednja Izmena: Mart 12, 2018, 18:44:38 POSLE PODNE od Vantage

Ovako, postavi ovo umjesto statementa gdje je uspjesan login

print(" :: DEBUG :: 1");
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);


print(" :: DEBUG :: 2");
GivePlayerMoneyEx(playerid, PInfo[playerid][Cash]);


print(" :: DEBUG :: 3");
SetPlayerScore(playerid,PInfo[playerid][Score]);


print(" :: DEBUG :: 4");

if(PInfo[playerid][pclanID] != -1 && clanInfo[PInfo[playerid][pclanID]][gActive] == 0)
{
	PInfo[playerid][pclanID] = -1;
	PInfo[playerid][pclanRank] = 0;
}


print(" :: DEBUG :: 5");


i kada crasha vidi u server_log.txt koje je sve debug korake ispisalo
Software Developer

Log:

[18:52:50] [join] Rakija has joined the server (0:127.0.0.1)
[18:52:58]  :: DEBUG :: 1
[18:52:58]  :: DEBUG :: 2
[18:52:58] [debug] Server crashed while executing CNR.amx
[18:52:58] [debug] AMX backtrace:
[18:52:58] [debug] #0 000ac5dc in public OnDialogResponse () from CNR.amx
[18:53:00] [debug] Native backtrace:
[18:53:00] [debug] #0 6994abc9 in ?? () from plugins\crashdetect.DLL
[18:53:00] [debug] #1 6994c8c7 in ?? () from plugins\crashdetect.DLL
[18:53:00] [debug] #2 69951489 in ?? () from plugins\crashdetect.DLL
[18:53:00] [debug] #3 69951666 in ?? () from plugins\crashdetect.DLL
[18:53:00] [debug] #4 6994a207 in ?? () from plugins\crashdetect.DLL
[18:53:00] [debug] #5 6994c87a in ?? () from plugins\crashdetect.DLL
[18:53:00] [debug] #6 66fb4629 in ?? () from plugins\streamer.DLL
[18:53:00] [debug] #7 0046ec31 in ?? () from samp-server.exe
[18:53:00] [debug] #8 00452270 in ?? () from samp-server.exe
[18:53:00] [debug] #9 0049eef9 in ?? () from samp-server.exe
[18:53:00] [debug] #10 004aa31e in ?? () from samp-server.exe


Kod:

case DIALOG_LOGIN:
		{
			if ( !response ) return Kick ( playerid );
			if( response )
			{
			    ClearChat(playerid, 30);
				new hashpass[ 129 ], string[ 180 ];
				WP_Hash(hashpass,sizeof(hashpass), inputtext);
				if(!strcmp(hashpass, PInfo[playerid][Pass], false))
				{
				    print(" :: DEBUG :: 1");
					INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
					
					print(" :: DEBUG :: 2");
					GivePlayerMoneyEx(playerid, PInfo[playerid][Cash]);
					
					print(" :: DEBUG :: 3");
					SetPlayerScore(playerid,PInfo[playerid][Score]);
					
					LoggedIn[playerid] = 1;

					UpdateIP(playerid);
					
					if(PInfo[playerid][Banned] == 1) return Kick(playerid);

                    print(" :: DEBUG :: 4");
     				if(PInfo[playerid][pclanID] != -1 && clanInfo[PInfo[playerid][pclanID]][gActive] == 0)
					{
					    PInfo[playerid][pclanID] = -1;
						PInfo[playerid][pclanRank] = 0;
					}
					print(" :: DEBUG :: 5");
				}
				else
				{
				    format(string, sizeof(string), "Dobrodosao %s na CnR server\nUpisite sifru", GetName(playerid));
        			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Login", "Exit");
    				PInfo[playerid][FailToLogin]++;
					switch (PInfo[playerid][FailToLogin])
					{
   						case 1: SCM(playerid, -1, "Kriva Sifra (1/3)");
			    		case 2: SCM(playerid, -1, "Kriva Sifra (2/3)");
			    		case 3:
			    		{
							SCM(playerid, -1, "Izbaceni si, fulao si sanse za login (3/3)");
							SetTimerEx("KickPlayer", 100,false,"i",playerid);
 						}
   					}
   					return 1;
                }
			}
			return 1;
		}



Evo poneÅ¡to vezanu uz to. Ali kakve veze ima to sa mojim problemom (Pitam, zelim znati)  :)

Svugdje koristim to jer imam server sided, nisam ima prije sa time problema.

forward GivePlayerMoneyEx(playerid,ammount);


public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney[playerid] = GetPlayerMoney(playerid);
      NewMoney[playerid] = ammount;
      GivePlayerMoneyEx(playerid,ammount);

      return 1;
}




Poslednja Izmena: Mart 12, 2018, 19:09:27 POSLE PODNE od Vantage

Funkcija poziva samo sebe i tako stvara infinite loop.
Eo fix:
public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney[playerid] = GetPlayerMoney(playerid);
      NewMoney[playerid] = ammount;
      GivePlayerMoney(playerid,ammount);

      return 1;
}

public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney[playerid] = GetPlayerMoney(playerid);
      NewMoney[playerid] = ammount + OldMoney[playerid];
      GivePlayerMoney(playerid,ammount);

      return 1;
}

Ne znam sta si zamislio sa ovim old i newmoney. Probaj sada.


bilo je lijepo dok je trajalo.


Citat: .ксундер poslato Mart 12, 2018, 19:08:59 POSLE PODNE
Funkcija poziva samo sebe i tako stvara infinite loop.
Eo fix:
public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney[playerid] = GetPlayerMoney(playerid);
      NewMoney[playerid] = ammount;
      GivePlayerMoney(playerid,ammount);

      return 1;
}


Hvala ti puno. Daj adresu da ti doÄ'em ljubit noge  :D