mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Merge branch 'web_interface' of github.com:EQEmu/Server into web_interface
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "worldserver.h"
|
||||
#include "QuestParserCollection.h"
|
||||
#include "../common/StringUtil.h"
|
||||
#include "../common/web_interface_utils.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <math.h>
|
||||
@@ -31,6 +32,7 @@ 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,
|
||||
@@ -1213,6 +1215,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;
|
||||
}
|
||||
}
|
||||
|
||||
// this is for SendPosUpdate()
|
||||
|
||||
@@ -100,6 +100,7 @@ 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);
|
||||
|
||||
@@ -89,7 +89,7 @@ XS(XS_EntityList_GetMob)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->GetMob(name);
|
||||
RETVAL = THIS->GetMob(name);
|
||||
ST(0) = sv_newmortal();
|
||||
sv_setref_pv(ST(0), "Mob", (void*)RETVAL);
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ 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)
|
||||
@@ -1777,6 +1778,13 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user