mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 03:11:28 +00:00
Merge pull request #48 from addtheice/master
Cleaned up Packet Handling in world/Client
This commit is contained in:
commit
9b015a2975
272
world/client.cpp
272
world/client.cpp
@ -368,46 +368,9 @@ void Client::SendPostEnterWorld() {
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::HandlePacket(const EQApplicationPacket *app) {
|
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
||||||
const WorldConfig *Config=WorldConfig::get();
|
|
||||||
EmuOpcode opcode = app->GetOpcode();
|
|
||||||
|
|
||||||
clog(WORLD__CLIENT_TRACE,"Recevied EQApplicationPacket");
|
|
||||||
_pkt(WORLD__CLIENT_TRACE,app);
|
|
||||||
|
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
if (!eqs->CheckState(ESTABLISHED)) {
|
|
||||||
clog(WORLD__CLIENT,"Client disconnected (net inactive on send)");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses
|
|
||||||
if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
|
|
||||||
if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) {
|
|
||||||
clog(WORLD__CLIENT,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
|
||||||
eqs->Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) {
|
|
||||||
// Got a packet other than OP_SendLoginInfo when not logged in
|
|
||||||
clog(WORLD__CLIENT_ERR,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (opcode == OP_AckPacket) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(opcode)
|
|
||||||
{
|
|
||||||
case OP_CrashDump:
|
|
||||||
break;
|
|
||||||
case OP_SendLoginInfo:
|
|
||||||
{
|
|
||||||
if (app->size != sizeof(LoginInfo_Struct)) {
|
if (app->size != sizeof(LoginInfo_Struct)) {
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginInfo_Struct *li=(LoginInfo_Struct *)app->pBuffer;
|
LoginInfo_Struct *li=(LoginInfo_Struct *)app->pBuffer;
|
||||||
@ -421,8 +384,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
if (strlen(password) <= 1) {
|
if (strlen(password) <= 1) {
|
||||||
// TODO: Find out how to tell the client wrong username/password
|
// TODO: Find out how to tell the client wrong username/password
|
||||||
clog(WORLD__CLIENT_ERR,"Login without a password");
|
clog(WORLD__CLIENT_ERR,"Login without a password");
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pZoning=(li->zoning==1);
|
pZoning=(li->zoning==1);
|
||||||
@ -447,8 +409,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
#else
|
#else
|
||||||
if (loginserverlist.Connected() == false && !pZoning) {
|
if (loginserverlist.Connected() == false && !pZoning) {
|
||||||
clog(WORLD__CLIENT_ERR,"Error: Login server login while not connected to login server.");
|
clog(WORLD__CLIENT_ERR,"Error: Login server login while not connected to login server.");
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if ((minilogin && (cle = client_list.CheckAuth(id,password,ip))) || (cle = client_list.CheckAuth(id, password)))
|
if ((minilogin && (cle = client_list.CheckAuth(id,password,ip))) || (cle = client_list.CheckAuth(id, password)))
|
||||||
#endif
|
#endif
|
||||||
@ -459,8 +420,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
clog(WORLD__CLIENT_ERR,"If so you forget the minilogin variable...");
|
clog(WORLD__CLIENT_ERR,"If so you forget the minilogin variable...");
|
||||||
else
|
else
|
||||||
clog(WORLD__CLIENT_ERR,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table.");
|
clog(WORLD__CLIENT_ERR,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table.");
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cle->SetOnline();
|
cle->SetOnline();
|
||||||
@ -474,6 +434,9 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
else {
|
else {
|
||||||
clog(WORLD__CLIENT,"LS Account #%d",cle->LSID());
|
clog(WORLD__CLIENT,"LS Account #%d",cle->LSID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WorldConfig *Config=WorldConfig::get();
|
||||||
|
|
||||||
if(Config->UpdateStats){
|
if(Config->UpdateStats){
|
||||||
ServerPacket* pack = new ServerPacket;
|
ServerPacket* pack = new ServerPacket;
|
||||||
pack->opcode = ServerOP_LSPlayerJoinWorld;
|
pack->opcode = ServerOP_LSPlayerJoinWorld;
|
||||||
@ -503,22 +466,23 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
else {
|
else {
|
||||||
// TODO: Find out how to tell the client wrong username/password
|
// TODO: Find out how to tell the client wrong username/password
|
||||||
clog(WORLD__CLIENT_ERR,"Bad/Expired session key '%s'",name);
|
clog(WORLD__CLIENT_ERR,"Bad/Expired session key '%s'",name);
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cle)
|
if (!cle)
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
cle->SetIP(GetIP());
|
cle->SetIP(GetIP());
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
case OP_ApproveName: //Name approval
|
|
||||||
{
|
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) {
|
||||||
|
|
||||||
if (GetAccountID() == 0) {
|
if (GetAccountID() == 0) {
|
||||||
clog(WORLD__CLIENT_ERR,"Name approval request with no logged in account");
|
clog(WORLD__CLIENT_ERR,"Name approval request with no logged in account");
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(char_name, 64, "%s", (char*)app->pBuffer);
|
snprintf(char_name, 64, "%s", (char*)app->pBuffer);
|
||||||
uchar race = app->pBuffer[64];
|
uchar race = app->pBuffer[64];
|
||||||
uchar clas = app->pBuffer[68];
|
uchar clas = app->pBuffer[68];
|
||||||
@ -530,6 +494,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
outapp->SetOpcode(OP_ApproveName);
|
outapp->SetOpcode(OP_ApproveName);
|
||||||
outapp->pBuffer = new uchar[1];
|
outapp->pBuffer = new uchar[1];
|
||||||
outapp->size = 1;
|
outapp->size = 1;
|
||||||
|
|
||||||
bool valid;
|
bool valid;
|
||||||
if(!database.CheckNameFilter(char_name)) {
|
if(!database.CheckNameFilter(char_name)) {
|
||||||
valid = false;
|
valid = false;
|
||||||
@ -552,10 +517,10 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
memset(char_name, 0, sizeof(char_name));
|
memset(char_name, 0, sizeof(char_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
case OP_RandomNameGenerator:
|
|
||||||
{
|
bool Client::HandleGenerateRandomNamePacket(const EQApplicationPacket *app) {
|
||||||
// creates up to a 10 char name
|
// creates up to a 10 char name
|
||||||
char vowels[18]="aeiouyaeiouaeioe";
|
char vowels[18]="aeiouyaeiouaeioe";
|
||||||
char cons[48]="bcdfghjklmnpqrstvwxzybcdgklmnprstvwbcdgkpstrkd";
|
char cons[48]="bcdfghjklmnpqrstvwxzybcdgklmnprstvwbcdgkpstrkd";
|
||||||
@ -630,16 +595,11 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
memset(ngs->name,0,64);
|
memset(ngs->name,0,64);
|
||||||
strcpy(ngs->name,rndname);
|
strcpy(ngs->name,rndname);
|
||||||
|
|
||||||
// char names[8][64] = { "How", "About", "You", "Think", "Of", "Your", "Own", "Name" };
|
|
||||||
// //Could have parts of the random name in this struct and they compile together
|
|
||||||
// NameGeneration_Struct* ngs = (NameGeneration_Struct*)app->pBuffer;
|
|
||||||
// strncpy(ngs->name,"Notcreated",64);
|
|
||||||
|
|
||||||
QueuePacket(app);
|
QueuePacket(app);
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
case OP_CharacterCreateRequest: {
|
|
||||||
|
bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app) {
|
||||||
// New OpCode in SoF
|
// New OpCode in SoF
|
||||||
uint32 allocs = character_create_allocations.size();
|
uint32 allocs = character_create_allocations.size();
|
||||||
uint32 combos = character_create_race_class_combos.size();
|
uint32 combos = character_create_race_class_combos.size();
|
||||||
@ -683,22 +643,22 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case OP_CharacterCreate: //Char create
|
bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
||||||
{
|
|
||||||
if (GetAccountID() == 0)
|
if (GetAccountID() == 0)
|
||||||
{
|
{
|
||||||
clog(WORLD__CLIENT_ERR,"Account ID not set; unable to create character.");
|
clog(WORLD__CLIENT_ERR,"Account ID not set; unable to create character.");
|
||||||
ret = false;
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if (app->size != sizeof(CharCreate_Struct))
|
else if (app->size != sizeof(CharCreate_Struct))
|
||||||
{
|
{
|
||||||
clog(WORLD__CLIENT_ERR,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct));
|
clog(WORLD__CLIENT_ERR,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct));
|
||||||
DumpPacket(app);
|
DumpPacket(app);
|
||||||
break;
|
// the previous behavior was essentially returning true here
|
||||||
|
// but that seems a bit odd to me.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CharCreate_Struct *cc = (CharCreate_Struct*)app->pBuffer;
|
CharCreate_Struct *cc = (CharCreate_Struct*)app->pBuffer;
|
||||||
@ -712,20 +672,23 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
SendCharInfo();
|
SendCharInfo();
|
||||||
break;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
case OP_EnterWorld: // Enter world
|
|
||||||
{
|
bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||||
|
|
||||||
if (GetAccountID() == 0) {
|
if (GetAccountID() == 0) {
|
||||||
clog(WORLD__CLIENT_ERR,"Enter world with no logged in account");
|
clog(WORLD__CLIENT_ERR,"Enter world with no logged in account");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GetAdmin() < 0)
|
if(GetAdmin() < 0)
|
||||||
{
|
{
|
||||||
clog(WORLD__CLIENT,"Account banned or suspended.");
|
clog(WORLD__CLIENT,"Account banned or suspended.");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RuleI(World, MaxClientsPerIP) >= 0) {
|
if (RuleI(World, MaxClientsPerIP) >= 0) {
|
||||||
@ -741,14 +704,14 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
if (charid == 0 || tmpaccid != GetAccountID()) {
|
if (charid == 0 || tmpaccid != GetAccountID()) {
|
||||||
clog(WORLD__CLIENT_ERR,"Could not get CharInfo for '%s'",char_name);
|
clog(WORLD__CLIENT_ERR,"Could not get CharInfo for '%s'",char_name);
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure this account owns this character
|
// Make sure this account owns this character
|
||||||
if (tmpaccid != GetAccountID()) {
|
if (tmpaccid != GetAccountID()) {
|
||||||
clog(WORLD__CLIENT_ERR,"This account does not own the character named '%s'",char_name);
|
clog(WORLD__CLIENT_ERR,"This account does not own the character named '%s'",char_name);
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pZoning && ew->return_home)
|
if(!pZoning && ew->return_home)
|
||||||
@ -765,7 +728,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
if(cs->gohome[x] == 1)
|
if(cs->gohome[x] == 1)
|
||||||
{
|
{
|
||||||
home_enabled = true;
|
home_enabled = true;
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -780,7 +743,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
clog(WORLD__CLIENT_ERR,"'%s' is trying to go home before they're able...",char_name);
|
clog(WORLD__CLIENT_ERR,"'%s' is trying to go home before they're able...",char_name);
|
||||||
database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able.");
|
database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able.");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,7 +760,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
if(cs->tutorial[x] == 1)
|
if(cs->tutorial[x] == 1)
|
||||||
{
|
{
|
||||||
tutorial_enabled = true;
|
tutorial_enabled = true;
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -813,7 +776,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
clog(WORLD__CLIENT_ERR,"'%s' is trying to go to tutorial but are not allowed...",char_name);
|
clog(WORLD__CLIENT_ERR,"'%s' is trying to go to tutorial but are not allowed...",char_name);
|
||||||
database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character.");
|
database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character.");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -893,6 +856,9 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
EQApplicationPacket *outapp2 = new EQApplicationPacket(OP_SetChatServer);
|
EQApplicationPacket *outapp2 = new EQApplicationPacket(OP_SetChatServer);
|
||||||
char buffer[112];
|
char buffer[112];
|
||||||
|
|
||||||
|
const WorldConfig *Config = WorldConfig::get();
|
||||||
|
|
||||||
sprintf(buffer,"%s,%i,%s.%s,%c%08X",
|
sprintf(buffer,"%s,%i,%s.%s,%c%08X",
|
||||||
Config->ChatHost.c_str(),
|
Config->ChatHost.c_str(),
|
||||||
Config->ChatPort,
|
Config->ChatPort,
|
||||||
@ -923,12 +889,12 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
safe_delete(outapp2);
|
safe_delete(outapp2);
|
||||||
|
|
||||||
EnterWorld();
|
EnterWorld();
|
||||||
break;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
case OP_LoginComplete:{
|
|
||||||
break;
|
bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) {
|
||||||
}
|
|
||||||
case OP_DeleteCharacter: {
|
|
||||||
uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer);
|
uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer);
|
||||||
if(char_acct_id == GetAccountID())
|
if(char_acct_id == GetAccountID())
|
||||||
{
|
{
|
||||||
@ -936,51 +902,119 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
database.DeleteCharacter((char *)app->pBuffer);
|
database.DeleteCharacter((char *)app->pBuffer);
|
||||||
SendCharInfo();
|
SendCharInfo();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OP_ApproveWorld:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OP_WorldClientReady:{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OP_World_Client_CRC1:
|
|
||||||
case OP_World_Client_CRC2: {
|
|
||||||
// There is no obvious entry in the CC struct to indicate that the 'Start Tutorial button
|
|
||||||
// is selected when a character is created. I have observed that in this case, OP_EnterWorld is sent
|
|
||||||
// before OP_World_Client_CRC1. Therefore, if we receive OP_World_Client_CRC1 before OP_EnterWorld,
|
|
||||||
// then 'Start Tutorial' was not chosen.
|
|
||||||
StartInTutorial = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OP_WearChange: { // User has selected a different character
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OP_WorldComplete: {
|
|
||||||
eqs->Close();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OP_LoginUnknown1:
|
|
||||||
case OP_LoginUnknown2:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OP_ZoneChange:
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Client::HandleZoneChangePacket(const EQApplicationPacket *app) {
|
||||||
// HoT sends this to world while zoning and wants it echoed back.
|
// HoT sends this to world while zoning and wants it echoed back.
|
||||||
if(ClientVersionBit & BIT_RoFAndLater)
|
if(ClientVersionBit & BIT_RoFAndLater)
|
||||||
{
|
{
|
||||||
QueuePacket(app);
|
QueuePacket(app);
|
||||||
}
|
}
|
||||||
break;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Client::HandlePacket(const EQApplicationPacket *app) {
|
||||||
|
|
||||||
default: {
|
EmuOpcode opcode = app->GetOpcode();
|
||||||
|
|
||||||
|
clog(WORLD__CLIENT_TRACE,"Recevied EQApplicationPacket");
|
||||||
|
_pkt(WORLD__CLIENT_TRACE,app);
|
||||||
|
|
||||||
|
if (!eqs->CheckState(ESTABLISHED)) {
|
||||||
|
clog(WORLD__CLIENT,"Client disconnected (net inactive on send)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses
|
||||||
|
if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
|
||||||
|
if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) {
|
||||||
|
clog(WORLD__CLIENT,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
||||||
|
eqs->Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) {
|
||||||
|
// Got a packet other than OP_SendLoginInfo when not logged in
|
||||||
|
clog(WORLD__CLIENT_ERR,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (opcode == OP_AckPacket) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(opcode)
|
||||||
|
{
|
||||||
|
case OP_World_Client_CRC1:
|
||||||
|
case OP_World_Client_CRC2:
|
||||||
|
{
|
||||||
|
// There is no obvious entry in the CC struct to indicate that the 'Start Tutorial button
|
||||||
|
// is selected when a character is created. I have observed that in this case, OP_EnterWorld is sent
|
||||||
|
// before OP_World_Client_CRC1. Therefore, if we receive OP_World_Client_CRC1 before OP_EnterWorld,
|
||||||
|
// then 'Start Tutorial' was not chosen.
|
||||||
|
StartInTutorial = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case OP_SendLoginInfo:
|
||||||
|
{
|
||||||
|
return HandleSendLoginInfoPacket(app);
|
||||||
|
}
|
||||||
|
case OP_ApproveName: //Name approval
|
||||||
|
{
|
||||||
|
return HandleNameApprovalPacket(app);
|
||||||
|
}
|
||||||
|
case OP_RandomNameGenerator:
|
||||||
|
{
|
||||||
|
return HandleGenerateRandomNamePacket(app);
|
||||||
|
}
|
||||||
|
case OP_CharacterCreateRequest:
|
||||||
|
{
|
||||||
|
// New OpCode in SoF
|
||||||
|
return HandleCharacterCreateRequestPacket(app);
|
||||||
|
}
|
||||||
|
case OP_CharacterCreate: //Char create
|
||||||
|
{
|
||||||
|
return HandleCharacterCreatePacket(app);
|
||||||
|
}
|
||||||
|
case OP_EnterWorld: // Enter world
|
||||||
|
{
|
||||||
|
return HandleEnterWorldPacket(app);
|
||||||
|
}
|
||||||
|
case OP_DeleteCharacter:
|
||||||
|
{
|
||||||
|
return HandleDeleteCharacterPacket(app);
|
||||||
|
}
|
||||||
|
case OP_WorldComplete:
|
||||||
|
{
|
||||||
|
eqs->Close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case OP_ZoneChange:
|
||||||
|
{
|
||||||
|
// HoT sends this to world while zoning and wants it echoed back.
|
||||||
|
return HandleZoneChangePacket(app);
|
||||||
|
}
|
||||||
|
case OP_LoginUnknown1:
|
||||||
|
case OP_LoginUnknown2:
|
||||||
|
case OP_CrashDump:
|
||||||
|
case OP_WearChange:
|
||||||
|
case OP_LoginComplete:
|
||||||
|
case OP_ApproveWorld:
|
||||||
|
case OP_WorldClientReady:
|
||||||
|
{
|
||||||
|
// Essentially we are just 'eating' these packets, indicating
|
||||||
|
// they are handled.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
clog(WORLD__CLIENT_ERR,"Received unknown EQApplicationPacket");
|
clog(WORLD__CLIENT_ERR,"Received unknown EQApplicationPacket");
|
||||||
_pkt(WORLD__CLIENT_ERR,app);
|
_pkt(WORLD__CLIENT_ERR,app);
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::Process() {
|
bool Client::Process() {
|
||||||
|
|||||||
@ -97,7 +97,17 @@ private:
|
|||||||
bool firstlogin;
|
bool firstlogin;
|
||||||
bool seencharsel;
|
bool seencharsel;
|
||||||
bool realfirstlogin;
|
bool realfirstlogin;
|
||||||
|
|
||||||
bool HandlePacket(const EQApplicationPacket *app);
|
bool HandlePacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleNameApprovalPacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleSendLoginInfoPacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleGenerateRandomNamePacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleCharacterCreateRequestPacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleCharacterCreatePacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleEnterWorldPacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleDeleteCharacterPacket(const EQApplicationPacket *app);
|
||||||
|
bool HandleZoneChangePacket(const EQApplicationPacket *app);
|
||||||
|
|
||||||
EQStreamInterface* const eqs;
|
EQStreamInterface* const eqs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user