Problema verificare nume starter

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
bogdilord123
Utilizator interzis !

Utilizator interzis !
Mesaje: 113
Membru din: 16 Sep 2015, 16:25
Server: Metin2 Tradition
Regat: Jinno
Aprecieri: 6  
Mulţumiri: 2  
Medalii

Saut, am o problema la verificarea numelui starterului C++.

Problema este in felul urmator, daca numele starterului nu corespunde cu cel pus in protectie, nu te lasa sa intri pe un cont de player, doar pe cele cu drepturi implementor.

Am schimbat numele in protectie ca sa fie acelasi nume ca si in client, dar degeaba, tot nu merge. Am incercat sa pun in loc de GM_IMPLEMENTOR, GM_PLAYER, si acum nu ma lasa sa intru pe cont de GM =))


Aa este protectia:
#ifdef __PROTECTION_STARTER_NAME
void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
{
if (!ch)
{
return;
}

TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;

// If the file name is not metin2client.exe and the GM level is not equal with GM_IMPLEMENTOR kick the player
if (strcmp(p->filename, "Morality2.exe") && ch->GetGMLevel() != GM_IMPLEMENTOR)
{
// immediately close the connection with the player
sys_err("%s[%d] has been disconnected: %s", ch->GetName(), ch->GetPlayerID(), p->filename);
ch->GetDesc()->SetPhase(PHASE_CLOSE);
return;
}

sys_log(0, "VERSION: %s %s %s", ch->GetName(), p->timestamp, p->filename);
ch->GetDesc()->SetClientVersion(p->timestamp);
}
#else
void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
{
if (!ch)
return;

TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;
sys_log(0, "VERSION: %s %s %s", ch->GetName(), p->timestamp, p->filename);
ch->GetDesc()->SetClientVersion(p->timestamp);
}
#endif
Astept un raspuns =) Ms anticipat
Imagine
Afișează semnătura
Avatar utilizator
[RaffaeL]
Software Developer

Software Developer
Mesaje: 3223
Membru din: 19 Mar 2016, 12:58
Server: ...
Aprecieri: 15  
Mulţumiri: 2502  
  Rezolvări prob.: 2
Discord: Copiază ID
 Contact:
Medalii

bogdilord123 scrie:Saut, am o problema la verificarea numelui starterului C++.

Problema este in felul urmator, daca numele starterului nu corespunde cu cel pus in protectie, nu te lasa sa intri pe un cont de player, doar pe cele cu drepturi implementor.

Am schimbat numele in protectie ca sa fie acelasi nume ca si in client, dar degeaba, tot nu merge. Am incercat sa pun in loc de GM_IMPLEMENTOR, GM_PLAYER, si acum nu ma lasa sa intru pe cont de GM =))


Aa este protectia:
#ifdef __PROTECTION_STARTER_NAME
void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
{
if (!ch)
{
return;
}

TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;

// If the file name is not metin2client.exe and the GM level is not equal with GM_IMPLEMENTOR kick the player
if (strcmp(p->filename, "Morality2.exe") && ch->GetGMLevel() != GM_IMPLEMENTOR)
{
// immediately close the connection with the player
sys_err("%s[%d] has been disconnected: %s", ch->GetName(), ch->GetPlayerID(), p->filename);
ch->GetDesc()->SetPhase(PHASE_CLOSE);
return;
}

sys_log(0, "VERSION: %s %s %s", ch->GetName(), p->timestamp, p->filename);
ch->GetDesc()->SetClientVersion(p->timestamp);
}
#else
void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
{
if (!ch)
return;

TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;
sys_log(0, "VERSION: %s %s %s", ch->GetName(), p->timestamp, p->filename);
ch->GetDesc()->SetClientVersion(p->timestamp);
}
#endif
Astept un raspuns =) Ms anticipat
Scoate partea cu verificare GM : (&& ch->GetGMLevel() != GM_IMPLEMENTOR)
Imagine
Imagine
https://www.youtube.com/watch?v=GhYkCIETEto
Do everything, if you know what you're doing, else... Imagine
Ma gasesti si aici: Discord https://discord.gg/5J5GnyZVSR
Afișează semnătura
Avatar utilizator
Vincent Griffith
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 1807
Membru din: 09 Mai 2016, 17:45
Aprecieri: 194  
Mulţumiri: 1331  
Medalii

Posteaza dupa modelul dat.
Arhivat.
Închis
Răspunsuri
5
Vizualizări
1525
Răspunsuri
14
Vizualizări
1438
Răspunsuri
5
Vizualizări
252

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie