diff --git a/Source/Integration/IntegrationGameModeBase.cpp b/Source/Integration/IntegrationGameModeBase.cpp index 8b965dc6..342e54fb 100644 --- a/Source/Integration/IntegrationGameModeBase.cpp +++ b/Source/Integration/IntegrationGameModeBase.cpp @@ -134,9 +134,19 @@ void AIntegrationGameModeBase::UpdateTangibles() { void AIntegrationGameModeBase::ExecuteDebuggingCommand(const FString &fs) { if (fs == "\\invokeplayer") { - // FlxLockedWrapper w(LockableWrapper); - // int64 player = w.GetActor(); - // w->play_invoke_player(w.Get(), player, datapk); + DPrint(TEXT("Trying to invoke 'myfunction' in lua")); + FlxLockedWrapper w(LockableWrapper); + FlxStreamBuffer sb; + sb.write_string("myfunction"); + sb.write_simple_dynamic_tag(SimpleDynamicTag::NUMBER); + sb.write_double(3.0); + sb.write_simple_dynamic_tag(SimpleDynamicTag::STRING); + sb.write_string("Howdy"); + sb.write_simple_dynamic_tag(SimpleDynamicTag::BOOLEAN); + sb.write_bool(true); + std::string_view datapk = sb.view(); + int64 player = w.GetActor(); + w->play_invoke_engio(w.Get(), player, datapk.size(), datapk.data()); } else { ConsoleOutput.AppendLine(TEXT("Unknown Command")); } diff --git a/Source/Integration/StringDecoder.h b/Source/Integration/StringDecoder.h index 44ebf251..0527f8ff 100644 --- a/Source/Integration/StringDecoder.h +++ b/Source/Integration/StringDecoder.h @@ -4,6 +4,8 @@ #include "lpx-basebuffer.hpp" +using FlxSimpleDynamic = SimpleDynamic; + class FlxStreamBufferCore { private: bool err_eof_on_read_; @@ -28,13 +30,13 @@ class FlxStreamBuffer : public BaseBuffer { public: using BaseBuffer::BaseBuffer; - void write_dxyz(const FVector &xyz) { + void write_dvector(const FVector &xyz) { write_double(xyz.X); write_double(xyz.Y); write_double(xyz.Z); } - FVector read_dxyz() { + FVector read_dvector() { double x = read_double(); double y = read_double(); double z = read_double();