Peršokti į turinį

Mysql R39-4


Recommended Posts

Sveiki i┼íkilo problema kai paleid┼żiu serveri leid┼żia registruotis bet ir tuo tarpu mane i┼ímeta kame problema?

 

MySQL LOG:

[23:59:02] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[23:59:02] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[23:59:02] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[23:59:02] [DEBUG] CMySQLConnection::Connect - connection was successful
[23:59:02] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[23:59:02] [DEBUG] CMySQLConnection::Connect - connection was successful
[23:59:02] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[23:59:02] [DEBUG] CMySQLConnection::Connect - connection was successful
[23:59:02] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[23:59:31] [DEBUG] orm_create - table: "zaidejai", connectionHandle: 1
[23:59:31] [DEBUG] COrm::Create - creating new orm object..
[23:59:31] [DEBUG] COrm::Create - orm object created (id: 1)
[23:59:31] [DEBUG] orm_addvar_int - orm_id: 1, var: 02816E90, varname: "ID"
[23:59:31] [DEBUG] orm_addvar_string - orm_id: 1, var: 02816E94, var_maxlen: 24, varname: "Vardas"
[23:59:31] [DEBUG] orm_addvar_string - orm_id: 1, var: 02816EF8, var_maxlen: 99, varname: "Slaptazodis"
[23:59:31] [DEBUG] orm_addvar_int - orm_id: 1, var: 02817094, varname: "XP"
[23:59:31] [DEBUG] orm_addvar_int - orm_id: 1, var: 02817090, varname: "Pinigai"
[23:59:31] [DEBUG] orm_addvar_float - orm_id: 1, var: 02817084, varname: "SpawnX"
[23:59:31] [DEBUG] orm_addvar_float - orm_id: 1, var: 02817088, varname: "SpawnY"
[23:59:31] [DEBUG] orm_addvar_float - orm_id: 1, var: 0281708C, varname: "SpawnZ"
[23:59:31] [DEBUG] orm_setkey - orm_id: 1, varname: "Vardas"
[23:59:31] [DEBUG] orm_select - orm_id: 1, callback: "ZaidejasPrisijunge", format: "i"
[23:59:31] [DEBUG] CMySQLQuery::Execute[ZaidejasPrisijunge] - starting query execution
[23:59:31] [DEBUG] CMySQLQuery::Execute[ZaidejasPrisijunge] - query was successfully executed within 29.105 milliseconds
[23:59:31] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[23:59:31] [DEBUG] Calling callback "ZaidejasPrisijunge"..
[23:59:31] [DEBUG] orm_setkey - orm_id: 1, varname: "Vardas"
[23:59:31] [ERROR] COrm::SetVariableAsKey - variable is already set as key
[23:59:31] [DEBUG] orm_errno - orm_id: 1
[23:59:31] [DEBUG] orm_errno - orm_id: 1
[23:59:31] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[23:59:33] [DEBUG] orm_insert - orm_id: 1, callback: "Uzsiregistruoja", format: "i"
[23:59:33] [DEBUG] CMySQLQuery::Execute[Uzsiregistruoja] - starting query execution
[23:59:33] [DEBUG] CMySQLQuery::Execute[Uzsiregistruoja] - query was successfully executed within 28.511 milliseconds
[23:59:33] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[23:59:33] [DEBUG] Calling callback "Uzsiregistruoja"..
[23:59:33] [DEBUG] orm_errno - orm_id: 1
[23:59:33] [DEBUG] orm_errno - orm_id: 1
[23:59:33] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called

Kur gali but klaida ma┼żdaug:┬á

	case 2:
	{
	    format(pInfo[playerid][Slaptazodis], 99, "%s", inputtext);
	    pInfo[playerid][Pinigai] = 1000;
	    pInfo[playerid][Patirtis]= 10;
	    SpawnPlayer(playerid);
	    orm_insert(pInfo[playerid][ORMID], "Uzsiregistruoja", "i", playerid);
		return 1;
	}

stock Saugojimas(playerid)
{
 GetPlayerPos(playerid, pInfo[playerid][SpawnX],pInfo[playerid][SpawnY],pInfo[playerid][SpawnZ]);
 pInfo[playerid][Pinigai] = GetPlayerMoney(playerid);
 pInfo[playerid][Patirtis] = GetPlayerScore(playerid);
 orm_update(pInfo[playerid][ORMID]);
 return 1;
}
forward Uzsiregistruoja(playerid);
public Uzsiregistruoja (playerid)
	{
	if(orm_errno(pInfo[playerid][ORMID]) == ERROR_OK) return printf("%s U┼żsiregistravo", pInfo[playerid][Vardas]);
	if(orm_errno(pInfo[playerid][ORMID]) == ERROR_NO_DATA) return print("ERROR: ┼Żaidejui nepavyko u┼żsiregistruoti"), Kick(playerid);
	return 1;
	}


Registruojantis nerodo vardo o statusus išsaugo:

 

tik pos dar ne ka┼żkod─Śl

 

2c02621a400c002b072f3070feace292756.png

Redaguota , nario Jothearch
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Vardo nei┼ísaugo? O kur nors ─» ORM kint─ům─ůj─» "Vardas" ─»ra┼íai vard─ů?

 

 

Manau kad i┼ímeta ne ┼íitas kick. O galb┼źt tau ra┼ío t─ů ┼żinut─Ö?

if(orm_errno(pInfo[playerid][ORMID]) == ERROR_NO_DATA) return print("ERROR: ┼Żaidejui nepavyko u┼żsiregistruoti"), Kick(playerid);

Nepamir┼ík kad tai yra lygiagreti u┼żklausa. Tai rei┼íkia kad kol bus vykdoma orm_insert serveris t─Ös ─»prasta vykdym─ů ir kai u┼żklausa baigs darb─ů, tada i┼íkvies "Uzsiregistruoja" funkcij─ů. Nors tas tarpas ir labai trumpas(tokiai u┼żklausai kelios MS), gali b┼źti kad ka┼żkur kitur tavo kode yra Kick d─Śl kurio i┼ímeta.

Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

(redaguota)

Vardo nei┼ísaugo? O kur nors ─» ORM kint─ům─ůj─» "Vardas" ─»ra┼íai vard─ů?

 

 

Manau kad i┼ímeta ne ┼íitas kick. O galb┼źt tau ra┼ío t─ů ┼żinut─Ö?

if(orm_errno(pInfo[playerid][ORMID]) == ERROR_NO_DATA) return print("ERROR: ┼Żaidejui nepavyko u┼żsiregistruoti"), Kick(playerid);

Nepamir┼ík kad tai yra lygiagreti u┼żklausa. Tai rei┼íkia kad kol bus vykdoma orm_insert serveris t─Ös ─»prasta vykdym─ů ir kai u┼żklausa baigs darb─ů, tada i┼íkvies "Uzsiregistruoja" funkcij─ů. Nors tas tarpas ir labai trumpas(tokiai u┼żklausai kelios MS), gali b┼źti kad ka┼żkur kitur tavo kode yra Kick d─Śl kurio i┼ímeta.

┼Żaid─Śjo DB: gal ─Źia ka┼żkas

 

 

enum PlayerDB {

ORM:ORMID,
ID,
Vardas[MAX_PLAYER_NAME+1],
Slaptazodis[99+0],
Float:SpawnX,
Float:SpawnY,
Float:SpawnZ,
Pinigai,
Patirtis
}
 

 

if(orm_errno(pInfo[playerid][ORMID]) == ERROR_NO_DATA) return print("ERROR: ┼Żaidejui nepavyko u┼żsiregistruoti"), Kick(playerid);

 

 

I┼íkvie─Źia ta komanda ir meta┬áERROR: ┼Żaidejui nepavyko u┼żsiregistruoti

 

Pagal pamoka dariausi bet vat ir ne ka┼żka :/

┼Żaid─Śjas prisijungia callback

 

 

forward ZaidejasPrisijunge(playerid);

public ZaidejasPrisijunge(playerid)
{
orm_setkey(pInfo[playerid][ORMID], "Vardas");
if(orm_errno(pInfo[playerid][ORMID]) == ERROR_OK) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Prisijungimas", "─«veskite Slapta┼żodi nor─Śdami prisijungti", "Vykdyti", "I┼íeiti");
if(orm_errno(pInfo[playerid][ORMID]) == ERROR_NO_DATA) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Registracija", "─«veskite Slapta┼żodi nor─Śdami prisijungti", "Vykdyti", "I┼íeiti");
return 1;
}

 

Daugiau KICK niekur n─Śra, nes ra┼íiau tik ┼íioje eilut─Śja

Redaguota , nario Jothearch
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Prisijungti prie diskusijos

Palikti atsakym─ů galite i┼í karto, o u┼żsiregistruoti v─Śliau. Jeigu jau turite paskyr─ů m┼źs┼│ forume, Prisijunkite.

Sve─Źias
Atsakyti šioje temoje...

×   ─«klijuotas tekstas turi teksto formatavim─ů.   Pa┼íalinti teksto formatavim─ů

  Galimi tik 75 veidukai.

×   Nuoroda buvo automati┼íkai ─»terpta.   ─«terpti nuorod─ů paprastai

×   J┼źs┼│ ankstesnis prane┼íimas buvo atkurtas.   I┼ívalyti redaktori┼│

×   J┼źs negalite ─»kelti nuotraukas tiesiogiai.─«kelkite arba ─»d─Śkite nuotraukas i┼í URL.

  • ┼áiame puslapyje nar┼ío:   0 nariai

    • N─Śra registruot┼│ nari┼│ per┼żi┼źrin─Źi┼│ ┼í─» forum─ů.

├Ś
├Ś
  • Sukurti nauj─ů...