More work on getting remote calls up and running, added two remote calls list_zones and get_zone_info.

This commit is contained in:
KimLS
2014-07-30 15:23:14 -07:00
parent 927580b983
commit 780789fbad
21 changed files with 528 additions and 167 deletions
+13 -15
View File
@@ -22,7 +22,6 @@
#include "worldserver.h"
#include "QuestParserCollection.h"
#include "../common/StringUtil.h"
#include "../common/web_interface_utils.h"
#include <sstream>
#include <math.h>
@@ -32,7 +31,6 @@ extern EntityList entity_list;
extern Zone* zone;
extern WorldServer worldserver;
extern std::string WS_Client_Connected;
Mob::Mob(const char* in_name,
const char* in_lastname,
@@ -1215,19 +1213,19 @@ void Mob::MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct *spu){
spu->padding0014 =0x7f;
spu->padding0018 =0x5df27;
/* Testing */
if (IsNPC() && WS_Client_Connected.size() != 0){
std::string str = MakeJSON("ResponseType:PositionUpdate,entity:" + std::to_string(GetID()) + ",name:" + GetName() + ",x:" + std::to_string(x_pos) + ",y:" + std::to_string(y_pos) + ",z:" + std::to_string(z_pos) + ",h:" + std::to_string(heading));
char * writable = new char[str.size() + 1];
std::copy(str.begin(), str.end(), writable);
ServerPacket* pack = new ServerPacket(ServerOP_WIWorldResponse, sizeof(WI_Client_Response_Struct)+str.length() + 1);
WI_Client_Response_Struct* WICR = (WI_Client_Response_Struct*)pack->pBuffer;
strn0cpy(WICR->Client_UUID, WS_Client_Connected.c_str(), 64);
strn0cpy(WICR->JSON_Data, str.c_str(), str.length() + 1);
if (worldserver.Connected()) { worldserver.SendPacket(pack); }
safe_delete(pack);
delete[] writable;
}
///* Testing */
//if (IsNPC() && WS_Client_Connected.size() != 0){
// std::string str = MakeJSON("ResponseType:PositionUpdate,entity:" + std::to_string(GetID()) + ",name:" + GetName() + ",x:" + std::to_string(x_pos) + ",y:" + std::to_string(y_pos) + ",z:" + std::to_string(z_pos) + ",h:" + std::to_string(heading));
// char * writable = new char[str.size() + 1];
// std::copy(str.begin(), str.end(), writable);
// ServerPacket* pack = new ServerPacket(ServerOP_WIWorldResponse, sizeof(WI_Client_Response_Struct)+str.length() + 1);
// WI_Client_Response_Struct* WICR = (WI_Client_Response_Struct*)pack->pBuffer;
// strn0cpy(WICR->Client_UUID, WS_Client_Connected.c_str(), 64);
// strn0cpy(WICR->JSON_Data, str.c_str(), str.length() + 1);
// if (worldserver.Connected()) { worldserver.SendPacket(pack); }
// safe_delete(pack);
// delete[] writable;
//}
}
// this is for SendPosUpdate()
-1
View File
@@ -100,7 +100,6 @@ DBAsyncFinishedQueue MTdbafq;
DBAsync *dbasync = nullptr;
TaskManager *taskmanager = 0;
QuestParserCollection *parse = 0;
std::string WS_Client_Connected;
const SPDat_Spell_Struct* spells;
void LoadSpells(EQEmu::MemoryMappedFile **mmf);
-8
View File
@@ -62,7 +62,6 @@ extern NetConnection net;
extern PetitionList petition_list;
extern uint32 numclients;
extern volatile bool RunLoops;
extern std::string WS_Client_Connected;
WorldServer::WorldServer()
: WorldConnection(EmuTCPConnection::packetModeZone)
@@ -1778,13 +1777,6 @@ void WorldServer::Process() {
break;
}
case ServerOP_WIClientRequest:
{
WI_Client_Request_Struct* WICR = (WI_Client_Request_Struct*)pack->pBuffer;
WS_Client_Connected = WICR->Client_UUID;
_log(WEB_INTERFACE__ERROR, "Recieved packet from World, setting Client Connected to %s", WICR->Client_UUID);
break;
}
case ServerOP_CZSignalClient:
{
CZClientSignal_Struct* CZCS = (CZClientSignal_Struct*) pack->pBuffer;