Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Content/Subsystems/FicsitRemoteMonitoring_BP.uasset
Binary file not shown.
4 changes: 2 additions & 2 deletions FicsitRemoteMonitoring.uplugin
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.5.1",
"SemVersion": "1.5.1",
"VersionName": "1.5.2",
"SemVersion": "1.5.2",
"AcceptsAnyRemoteVersion": true,
"FriendlyName": "Ficsit Remote Monitoring",
"Description": "Statistical and GeoLocation Monitoring for Satisfactory",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "FGCharacterPlayer.h"
#include "FGCreatureSubsystem.h"
#include "FGSporeFlower.h"
#include "FicsitRemoteMonitoring.h"
#include "RemoteMonitoringLibrary.h"
#include "Kismet/GameplayStatics.h"
Expand Down Expand Up @@ -91,4 +92,38 @@ void UPlayerLibrary::getCreatures(UObject* WorldContext, FRequestData RequestDat

OutJsonArray.Add(MakeShared<FJsonValueObject>(JCreature));
};
};

void UPlayerLibrary::getHazards(UObject* WorldContext, FRequestData RequestData, TArray<TSharedPtr<FJsonValue>>& OutJsonArray) {

UClass* SporeFlowerClass = AFGSporeFlower::StaticClass();
TArray<AActor*> FoundActors;

UGameplayStatics::GetAllActorsOfClass(WorldContext->GetWorld(), SporeFlowerClass, FoundActors);
for (AActor* SporeFlowerActor : FoundActors) {

AFGSporeFlower* SporeFlower = Cast<AFGSporeFlower>(SporeFlowerActor);

TSharedPtr<FJsonObject> JSporeFlower = CreateBaseJsonObject(SporeFlower);

AFicsitRemoteMonitoring* ModSubsystem = AFicsitRemoteMonitoring::Get(WorldContext->GetWorld());
fgcheck(ModSubsystem);

FString State;
FString GasState;
bool bIsSignificant;
bool bIsDead;

ModSubsystem->SporeFlower_BIE(SporeFlower, State, GasState, bIsSignificant, bIsDead);

JSporeFlower->Values.Add("ClassName", MakeShared<FJsonValueString>(UKismetSystemLibrary::GetClassDisplayName(SporeFlower->GetClass())));
JSporeFlower->Values.Add("location", MakeShared<FJsonValueObject>(getActorJSON(SporeFlower)));
JSporeFlower->Values.Add("State", MakeShared<FJsonValueString>(State));
JSporeFlower->Values.Add("GasState", MakeShared<FJsonValueString>(GasState));
JSporeFlower->Values.Add("Significant", MakeShared<FJsonValueBoolean>(bIsSignificant));
JSporeFlower->Values.Add("Dead", MakeShared<FJsonValueBoolean>(bIsDead));
JSporeFlower->Values.Add("features", MakeShared<FJsonValueObject>(getActorFeaturesJSON(SporeFlower, TEXT("Spore Flower"), TEXT("Spore Flower"))));

OutJsonArray.Add(MakeShared<FJsonValueObject>(JSporeFlower));
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ void AFicsitRemoteMonitoring::HandleApiRequest(UObject* World, uWS::HttpResponse
void AFicsitRemoteMonitoring::InitAPIRegistry()
{
//Registering Endpoints: API Name, bRequireGameThread, FunctionPtr
RegisterEndpoint(FAPIEndpoint("GET", "getArtifacts", &UResearch::getArtifacts).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getAssembler", &UFactoryLibrary::getAssembler));
RegisterEndpoint(FAPIEndpoint("GET", "getBelts", &ULogistics::getBelts));
RegisterEndpoint(FAPIEndpoint("GET", "getLifts", &ULogistics::getLifts));
Expand All @@ -761,6 +762,7 @@ void AFicsitRemoteMonitoring::InitAPIRegistry()
RegisterEndpoint(FAPIEndpoint("GET", "getFrackingActivator", &UResources::getFrackingActivator));
RegisterEndpoint(FAPIEndpoint("GET", "getFuelGenerator", &UPower::getFuelGenerator));
RegisterEndpoint(FAPIEndpoint("GET", "getGeothermalGenerator", &UPower::getGeothermalGenerator));
RegisterEndpoint(FAPIEndpoint("GET", "getHazards", &UPlayerLibrary::getHazards).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getHUBTerminal", &USupport::getHubTerminal).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getHyperEntrance", &UHypertubes::getHyperEntrance));
RegisterEndpoint(FAPIEndpoint("GET", "getHypertube", &UHypertubes::getHypertube));
Expand All @@ -776,8 +778,7 @@ void AFicsitRemoteMonitoring::InitAPIRegistry()
RegisterEndpoint(FAPIEndpoint("GET", "getPlayer", &UPlayerLibrary::getPlayer).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getPortal", &USupport::getPortal));
RegisterEndpoint(FAPIEndpoint("GET", "getPower", &UPower::getPower));
RegisterEndpoint(FAPIEndpoint("GET", "getPowerSlug", &UResources::getPowerSlug).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getArtifacts", &UResearch::getArtifacts).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getPowerSlug", &UResources::getPowerSlug).RequiresGameThread());
RegisterEndpoint(FAPIEndpoint("GET", "getPowerUsage", &UPower::getPowerUsage));
RegisterEndpoint(FAPIEndpoint("GET", "getProdStats", &USession::getProdStats));
RegisterEndpoint(FAPIEndpoint("GET", "getPump", &ULogistics::getPump));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ class FICSITREMOTEMONITORING_API UPlayerLibrary : public URemoteMonitoringLibrar
static void getPlayer(UObject* WorldContext, FRequestData RequestData, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
static void getDoggo(UObject* WorldContext, FRequestData RequestData, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
static void getCreatures(UObject* WorldContext, FRequestData RequestData, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
static void getHazards(UObject* WorldContext, FRequestData RequestData, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
};
3 changes: 3 additions & 0 deletions Source/FicsitRemoteMonitoring/Public/FicsitRemoteMonitoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ class FICSITREMOTEMONITORING_API AFicsitRemoteMonitoring : public AModSubsystem
UFUNCTION(BlueprintImplementableEvent, Category = "Ficsit Remote Monitoring")
void ResearchTreeNodeUnlockData_BIE(UFGResearchTreeNode* ResearchTreeNode, TArray<FIntPoint>& Parents, TArray<FIntPoint>& UnhiddenBy, FIntPoint& Coordinates);

UFUNCTION(BlueprintImplementableEvent, Category = "Ficsit Remote Monitoring")
void SporeFlower_BIE(AFGSporeFlower* SporeFlower, FString& State, FString& GasState, bool& bIsSignificant, bool& bIsDead);

// Array of API endpoints
TArray<FAPIEndpoint> APIEndpoints{};

Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
**** xref:json/Read/getCreatures.adoc[getCreatures]
**** xref:json/Read/getDoggo.adoc[getDoggo]
**** xref:json/Read/getDropPod.adoc[getDropPod]
**** xref:json/Read/getHazards.adoc[getHazards]
**** xref:json/Read/getMapMarkers.adoc[getMapMarkers]
**** xref:json/Read/getPowerSlug.adoc[getPowerSlug]
**** xref:json/Read/getProdStats.adoc[getProdStats]
Expand Down
65 changes: 65 additions & 0 deletions docs/modules/ROOT/pages/json/Read/getHazards.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
:url-repo: https://www.github.com/porisius/FicsitRemoteMonitoring
:depth:

= Get Hazards

Gets a list of all hazards.

== URL

`GET http://localhost:8080/getHazards`

include::../_responseBody.adoc[]

| ID | String | Unique ID of the Spore Flower.
| Name | String | Name of the Hazard.
| ClassName | String | ClassName of the Hazard.

{set:key-name:location}
{set:key-description:Location details of the Hazard.}
include::../Models/_location.adoc[]

| State | String | Current state of the hazard. Possible values are "Idle", "Expanding", "Retracting" and "Active".
| Gas State | String | Current state of the hazard. Possible values are "No Gas", "Gas", and "Cooldown".
| Significant | Boolean | Is the actor within range to perform animations, ticks, and other processing
| Dead | Boolean | Does the actor persist despite being blown up?

// features
include::../Models/_features.adoc[]

|===

== Example Response
[source,json]
-----------------
[
{
"ID": "BP_SporeFlower25_13738",
"ClassName": "BP_SporeFlower_C",
"location": {
"x": -17811,
"y": 269409,
"z": -6977.728515625,
"rotation": 90
},
"State": "Idle",
"GasState": "NoGas",
"Significant": false,
"Dead": false,
"features": {
"properties": {
"name": "BP_SporeFlower_C",
"type": "Spore Flower"
},
"geometry": {
"coordinates": {
"x": -17811,
"y": 269409,
"z": -6977.728515625
},
"type": "Point"
}
}
}
]
-----------------
Loading