Commit 79a96684 authored by Geovanny Vera's avatar Geovanny Vera

Fixed replication of UI elements

parent 5438f039
......@@ -19,7 +19,10 @@ async function main(){
const ip = await publicIp.v4();
const response = await fetch('https://api.ev3.me/instances/add-world-server', {
//const api = 'https://api.ev3.me/';
const api = 'http://localhost:1337/';
const response = await fetch(`${api}instances/add-world-server`, {
headers: {
'X-Orig-IP': ip
}
......
[FilterPlugin]
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
;
; Examples:
; /README.txt
; /Extras/...
; /Binaries/ThirdParty/*.dll
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.3",
"FriendlyName": "OWSPlugin",
"Description": "Open World Server",
"Category": "Other",
"CreatedBy": "Sabre Dart Studios",
"CreatedByURL": "http://www.sabredartstudios.com",
"DocsURL": "http://rpgwebapi.sabredartstudios.com/Docs/API",
"MarketplaceURL": "",
"SupportURL": "",
"EngineVersion": "4.25.0",
"CanContainContent": true,
"IsBetaVersion": false,
"Installed": true,
"Modules": [
{
"Name": "OWSPlugin",
"Type": "Runtime",
"LoadingPhase": "PreDefault"
}
],
"Plugins": [
{
"Name": "GameplayAbilities",
"Enabled": true
},
{
"Name": "ReplicationGraph",
"Enabled": true
}
]
}
\ No newline at end of file
......@@ -69,7 +69,8 @@ void UHttpService::SetRequestHeaders(TSharedRef<IHttpRequest>& Request) {
TSharedRef<IHttpRequest> UHttpService::RequestWithRoute(FString Subroute) {
// I have to set it here because for some reason if I set it on the constructor it becomes empty when it reaches here
// TODO: Figure out why that happens and fix it to remove this line
FString VRCAPIPath1 = FString(TEXT("https://api.ev3.me/"));
//FString VRCAPIPath1 = FString(TEXT("https://api.ev3.me/"));
FString VRCAPIPath1 = FString(TEXT("http://localhost:1337/"));
Http = &FHttpModule::Get();
TSharedRef<IHttpRequest> Request = Http->CreateRequest();
......
// Copyright 2018 Sabre Dart Studios
#include "MyMMOCharacterWithAbilities.h"
......@@ -31,9 +31,6 @@ void AVRCPlayerController::ConnectToCampus() {
auth.Append(token);
Request->SetHeader("Authorization", auth);
//FString url = FString(VRCAPIPath + "instances/join-server");
//Request->SetURL(url);
Request->ProcessRequest();
}
......@@ -75,9 +72,7 @@ void AVRCPlayerController::ConnectToMeeting(int32 MeetingId) {
FString SubRoute = "instances/join-classroom/";
SubRoute.AppendInt(MeetingId);
TSharedRef<IHttpRequest> Request = Http->GetRequest(SubRoute);
//FString url = "http://localhost:1337/instances/join-classroom/";
//url.AppendInt(MeetingId);
//Request->SetURL(url);
FString auth = "Bearer ";
auth.Append(token);
Request->SetHeader("Authorization", auth);
......
......@@ -15,7 +15,6 @@ void UVRCScheduleWidget::GetMeetings() {
Http->SetTimeout(5.0f);
TSharedRef<IHttpRequest> Request = Http->GetRequest("users/meetings");
//Request->SetURL(FString("http://localhost:1337/users/meetings"));
Request->SetHeader("Accepts", TEXT("application/json"));
Request->OnProcessRequestComplete().BindUObject(this, &UVRCScheduleWidget::OnGetMeetingsResponseRecieved);
FString auth = "Bearer ";
......@@ -23,22 +22,6 @@ void UVRCScheduleWidget::GetMeetings() {
Request->SetHeader("Authorization", auth);
Request->ProcessRequest();
//Testy();
}
void UVRCScheduleWidget::Testy() {
FString asd = "[{\"id\":34,\"map_id\":1,\"name\":\"CSC123\",\"password\":\"angry\",\"repeating\":0,\"active\":0,\"creator_id\":1}]";
TArray<FMeetingInfo> responseMeetings;
if (FJsonObjectConverter::JsonArrayStringToUStruct(asd, &responseMeetings, 0, 0)) {
meetings = responseMeetings;
FMeetingInfo temp = meetings[0];
UE_LOG(LogTemp, Log, TEXT("Good shit id: %d, name: %s"), temp.id, *temp.name);
NotifyGetMeetings();
}
else {
UE_LOG(LogTemp, Log, TEXT("Bad shit"));
}
}
void UVRCScheduleWidget::OnGetMeetingsResponseRecieved(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) {
......
......@@ -28,5 +28,8 @@ void AVRCWidgetActor::Tick(float DeltaTime)
void AVRCWidgetActor::ToggleWidget(bool bActive) {
if (!WidgetVRC) return;
BeforeToggleWidget(bActive);
WidgetVRC->ToggleWidget(bActive);
}
\ No newline at end of file
// Copyright 2018 Sabre Dart Studios
#pragma once
#include "CoreMinimal.h"
#include "OWSCharacterWithAbilities.h"
#include "MyMMOCharacterWithAbilities.generated.h"
/**
*
*/
UCLASS()
class VRCLASSROOM_API AMyMMOCharacterWithAbilities : public AOWSCharacterWithAbilities
{
GENERATED_BODY()
};
......@@ -20,6 +20,13 @@ struct FUserData
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "User")
bool bIsLoggedIn;
};
UENUM(BlueprintType)
enum class EVRCGameMode : uint8 {
Home UMETA(DisplayName = "Home"),
Hub UMETA(DisplayName = "Hub"),
Meeting UMETA(DisplayName = "Meeting")
};
/**
*
*/
......@@ -34,6 +41,9 @@ public:
FUserData User;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EVRCGameMode curGameMode;
UFUNCTION(BlueprintCallable, Category = "Http")
UHttpService* GetHttpService();
......
......@@ -48,8 +48,6 @@ public:
UFUNCTION(BlueprintCallable, Category = "Meetings")
void GetMeetings();
void Testy();
void OnGetMeetingsResponseRecieved(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
UFUNCTION(BlueprintImplementableEvent, Category = "Meetings")
......
......@@ -30,4 +30,7 @@ public:
UFUNCTION(BlueprintCallable, Category = "Widget")
void ToggleWidget(bool bActive);
UFUNCTION(BlueprintImplementableEvent, Category = "Widget")
void BeforeToggleWidget(bool bActive);
};
......@@ -11,7 +11,6 @@ public class VRClassroom : ModuleRules
PublicDependencyModuleNames.AddRange(new string[] { "Core",
"CoreUObject",
"Engine",
"OWSPlugin",
"AIModule",
"Http",
"Json",
......@@ -22,7 +21,7 @@ public class VRClassroom : ModuleRules
PrivateDependencyModuleNames.AddRange(new string[] { "UMG" });
PublicIncludePathModuleNames.AddRange(new string[] { "OWSPlugin" });
//PublicIncludePathModuleNames.AddRange(new string[] { "OWSPlugin" });
// Uncomment if you are using Slate UI
//PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
......
......@@ -12,7 +12,6 @@
"Engine",
"UMG",
"GameplayAbilities",
"OWSPlugin"
]
}
],
......@@ -35,10 +34,6 @@
"Name": "MessagingDebugger",
"Enabled": true
},
{
"Name": "OWSPlugin",
"Enabled": true
},
{
"Name": "ReplicationGraph",
"Enabled": true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment