More work to actually make this usable

This commit is contained in:
KimLS
2015-06-26 01:01:37 -07:00
parent 923252dbcc
commit a6675a483d
28 changed files with 372 additions and 120 deletions
+7
View File
@@ -787,6 +787,13 @@ void Client::CompleteConnect()
std::string event_desc = StringFormat("Connect :: Logged into zoneid:%i instid:%i", this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Connect_State, this->CharacterID(), event_desc);
}
ServerPacket pack(ServerOP_ClientFileStatus, sizeof(ServerRequestClientFileStatus));
ServerRequestClientFileStatus *req = (ServerRequestClientFileStatus*)pack.pBuffer;
req->zone_id = zone->GetZoneID();
req->instance_id = zone->GetInstanceID();
strn0cpy(req->name, GetName(), 64);
worldserver.SendPacket(&pack);
}
if (zone) {
+2 -1
View File
@@ -113,7 +113,8 @@ const char *QuestEventSubroutines[_LargestEventID] = {
"EVENT_LEAVE_AREA",
"EVENT_RESPAWN",
"EVENT_DEATH_COMPLETE",
"EVENT_UNHANDLED_OPCODE"
"EVENT_UNHANDLED_OPCODE",
"EVENT_CLIENT_FILE_STATUS"
};
PerlembParser::PerlembParser() : perl(nullptr) {
+1
View File
@@ -82,6 +82,7 @@ typedef enum {
EVENT_RESPAWN,
EVENT_DEATH_COMPLETE,
EVENT_UNHANDLED_OPCODE,
EVENT_CLIENT_FILE_STATUS,
_LargestEventID
} QuestEventID;
+2 -1
View File
@@ -1713,7 +1713,8 @@ luabind::scope lua_register_events() {
luabind::value("enter_area", static_cast<int>(EVENT_ENTER_AREA)),
luabind::value("leave_area", static_cast<int>(EVENT_LEAVE_AREA)),
luabind::value("death_complete", static_cast<int>(EVENT_DEATH_COMPLETE)),
luabind::value("unhandled_opcode", static_cast<int>(EVENT_UNHANDLED_OPCODE))
luabind::value("unhandled_opcode", static_cast<int>(EVENT_UNHANDLED_OPCODE)),
luabind::value("client_file_status", static_cast<int>(EVENT_CLIENT_FILE_STATUS))
];
}
+5 -1
View File
@@ -843,7 +843,11 @@ luabind::scope lua_register_packet_opcodes() {
luabind::value("OpenContainer", static_cast<int>(OP_OpenContainer)),
luabind::value("Marquee", static_cast<int>(OP_Marquee)),
luabind::value("ClientTimeStamp", static_cast<int>(OP_ClientTimeStamp)),
luabind::value("GuildPromote", static_cast<int>(OP_GuildPromote))
luabind::value("GuildPromote", static_cast<int>(OP_GuildPromote)),
luabind::value("World_SpellFileCheck", static_cast<int>(OP_World_SpellFileCheck)),
luabind::value("World_SkillFileCheck", static_cast<int>(OP_World_SkillFileCheck)),
luabind::value("World_BaseDataFileCheck", static_cast<int>(OP_World_BaseDataFileCheck)),
luabind::value("World_ExeFileCheck", static_cast<int>(OP_World_ExeFileCheck))
];
}
+3 -1
View File
@@ -116,7 +116,8 @@ const char *LuaEvents[_LargestEventID] = {
"event_leave_area",
"event_respawn",
"event_death_complete",
"event_unhandled_opcode"
"event_unhandled_opcode",
"event_client_file_status"
};
extern Zone *zone;
@@ -198,6 +199,7 @@ LuaParser::LuaParser() {
PlayerArgumentDispatch[EVENT_LEAVE_AREA] = handle_player_area;
PlayerArgumentDispatch[EVENT_RESPAWN] = handle_player_respawn;
PlayerArgumentDispatch[EVENT_UNHANDLED_OPCODE] = handle_player_packet;
PlayerArgumentDispatch[EVENT_CLIENT_FILE_STATUS] = handle_player_file_status;
ItemArgumentDispatch[EVENT_ITEM_CLICK] = handle_item_click;
ItemArgumentDispatch[EVENT_ITEM_CLICK_CAST] = handle_item_click;
+25
View File
@@ -11,6 +11,7 @@
#include "masterentity.h"
#include "../common/seperator.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "lua_item.h"
#include "lua_iteminst.h"
#include "lua_entity.h"
@@ -501,6 +502,30 @@ void handle_player_packet(QuestInterface *parse, lua_State* L, Client* client, s
lua_setfield(L, -2, "connecting");
}
void handle_player_file_status(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
auto values = SplitString(data, ' ');
if(values.size() >= 4) {
auto spells = atoi(values[0].c_str());
auto skills = atoi(values[1].c_str());
auto basedata = atoi(values[2].c_str());
auto eqgame = atoi(values[3].c_str());
lua_pushboolean(L, spells == 1 ? true : false);
lua_setfield(L, -2, "spell_file_status");
lua_pushboolean(L, skills == 1 ? true : false);
lua_setfield(L, -2, "skills_file_status");
lua_pushboolean(L, basedata == 1 ? true : false);
lua_setfield(L, -2, "base_data_file_status");
lua_pushboolean(L, eqgame == 1 ? true : false);
lua_setfield(L, -2, "eqgame_file_status");
}
}
void handle_player_null(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
}
+2
View File
@@ -93,6 +93,8 @@ void handle_player_respawn(QuestInterface *parse, lua_State* L, Client* client,
std::vector<EQEmu::Any> *extra_pointers);
void handle_player_packet(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers);
void handle_player_file_status(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers);
void handle_player_null(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers);
+15 -1
View File
@@ -49,7 +49,7 @@
#include "worldserver.h"
#include "zone.h"
#include "zone_config.h"
#include "quest_parser_collection.h"
extern EntityList entity_list;
extern Zone* zone;
@@ -1841,6 +1841,20 @@ void WorldServer::Process() {
}
break;
}
case ServerOP_ClientFileStatus:
{
ServerResponseClientFileStatus *resp = (ServerResponseClientFileStatus*)pack->pBuffer;
Client* client = entity_list.GetClientByName(resp->name);
if(client) {
parse->EventPlayer(EVENT_CLIENT_FILE_STATUS, client, StringFormat("%d %d %d %d",
resp->spells ? 1 : 0,
resp->skills ? 1 : 0,
resp->base_data ? 1 : 0,
resp->eqgame ? 1 : 0).c_str(), 0);
}
break;
}
default: {
std::cout << " Unknown ZSopcode:" << (int)pack->opcode;
std::cout << " size:" << pack->size << std::endl;