mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Added rapidjson library
Added web_interface_utils.cpp/.h to common to provide string based functions for outputting JSON Adjusted CMake to include rapidjson library and new web_interface_utils.h/cpp to common Currently, I have code set up hackishly for testing so do not think it is final. It is merely for demonstrating what I've done and played with.
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>
|
||||
@@ -1216,6 +1217,17 @@ void Mob::MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct *spu){
|
||||
spu->padding0014 =0x7f;
|
||||
spu->padding0018 =0x5df27;
|
||||
|
||||
/* Testing */
|
||||
if (IsNPC()){
|
||||
std::string str = MakeJSON("ResponseType:PositionUpdate,entity:" + IntegerToString(GetID()) + ",x:" + FloatToString(x_pos) + ",y:" + FloatToString(y_pos) + ",z:" + FloatToString(z_pos) + ",h:" + FloatToString(heading));
|
||||
char * writable = new char[str.size() + 1];
|
||||
std::copy(str.begin(), str.end(), writable);
|
||||
ServerPacket* wipack = new ServerPacket(ServerOP_WIWorldResponse, str.size() + 1);
|
||||
wipack->WriteString(writable);
|
||||
if (worldserver.Connected()) { worldserver.SendPacket(wipack); }
|
||||
safe_delete(wipack);
|
||||
delete[] writable;
|
||||
}
|
||||
}
|
||||
|
||||
// this is for SendPosUpdate()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1777,6 +1777,11 @@ void WorldServer::Process() {
|
||||
|
||||
break;
|
||||
}
|
||||
case ServerOP_WIServGeneric:
|
||||
{
|
||||
/* Do Nothing for now */
|
||||
break;
|
||||
}
|
||||
case ServerOP_CZSignalClient:
|
||||
{
|
||||
CZClientSignal_Struct* CZCS = (CZClientSignal_Struct*) pack->pBuffer;
|
||||
|
||||
Reference in New Issue
Block a user