diff --git a/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp b/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp index a7d6995..0c3298b 100644 --- a/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp +++ b/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp @@ -145,7 +145,7 @@ void UCMGameInstance::CloseServer(const FString& LobbyID) Request->SetURL(LobbyAPI + "/lobbies/" + LobbyID); Request->SetVerb("DELETE"); Request->SetHeader("Authorization", "Bearer " + JwtToken); - Request->SetHeader("Accept", "application/json"); + Request->SetHeader("Accept", "application/json");D Request->ProcessRequest(); } diff --git a/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.cpp b/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.cpp index 52b4b84..a1603e2 100644 --- a/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.cpp +++ b/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.cpp @@ -30,15 +30,7 @@ ACorruptedMemoryCharacter::ACorruptedMemoryCharacter() FirstPersonCameraComponent->SetupAttachment(GetCapsuleComponent()); FirstPersonCameraComponent->SetRelativeLocation(FVector(-10.f, 0.f, 60.f)); // Position the camera FirstPersonCameraComponent->bUsePawnControlRotation = true; - - // Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn) - // Mesh1P = CreateDefaultSubobject(TEXT("CharacterMesh1P")); - // Mesh1P->SetOnlyOwnerSee(true); - // Mesh1P->SetupAttachment(FirstPersonCameraComponent); - // Mesh1P->bCastDynamicShadow = false; - // Mesh1P->CastShadow = false; - // //Mesh1P->SetRelativeRotation(FRotator(0.9f, -19.19f, 5.2f)); - // Mesh1P->SetRelativeLocation(FVector(-30.f, 0.f, -150.f)); + bReplicates = true; PrimaryActorTick.bCanEverTick = true; } @@ -93,7 +85,6 @@ void ACorruptedMemoryCharacter::SetupPlayerInputComponent(class UInputComponent* void ACorruptedMemoryCharacter::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); - //Get the current scan percentage based on the timer elapsed and scan time ScanPercentage = GetWorldTimerManager().GetTimerElapsed(ScanTimerHandle) / ScanTime; } @@ -174,10 +165,7 @@ void ACorruptedMemoryCharacter::ScanStart(const FInputActionValue& Value) if (!IsValid(HitResult.GetActor())) return; if (HitResult.GetActor()->Tags.Contains("StoreShelf") && Cast(HitResult.GetActor())->GameplayTags.Contains("Corrupted")) { - //LastScannedShelf = Cast(HitResult.GetActor()); FString AccountName = Cast(GetWorld()->GetGameInstance())->AccountUsername; - //if (Cast(HitResult.GetActor())->GameplayTags.Contains(AccountName)) return; - //Cast(GetWorld()->GetFirstPlayerController())->ServerAddGameplayTagToShelf(HitResult.GetActor(), AccountName); if (GetWorldTimerManager().TimerExists(ScanTimerHandle)) { GetWorldTimerManager().ClearTimer(ScanTimerHandle); @@ -188,7 +176,6 @@ void ACorruptedMemoryCharacter::ScanStart(const FInputActionValue& Value) if (Cast(HitResult.GetActor())->GameplayTags.Contains("Scanned")) return; Cast(GetWorld()->GetFirstPlayerController())->ServerAddGameplayTagToShelf(HitResult.GetActor(), "Scanned"); ServerSuccessfulScan(AccountName); - LastScannedShelf = nullptr; }, 3.f, false); } } @@ -198,11 +185,6 @@ void ACorruptedMemoryCharacter::ScanCancel(const FInputActionValue& Value) const FString AccountName = Cast(GetWorld()->GetGameInstance())->AccountUsername; GetWorldTimerManager().ClearTimer(ScanTimerHandle); ScanPercentage = 0.f; - // if (IsValid(LastScannedShelf)) - // { - // LastScannedShelf = nullptr; - // Cast(GetWorld()->GetFirstPlayerController())->ServerRemoveGameplayTagToShelf(LastScannedShelf, AccountName); - // } } void ACorruptedMemoryCharacter::SetHasRifle(bool bNewHasRifle) diff --git a/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.h b/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.h index b2b7040..16d9fe8 100644 --- a/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.h +++ b/CorruptedMemory/Source/CorruptedMemory/CorruptedMemoryCharacter.h @@ -20,10 +20,7 @@ UCLASS(config=Game) class ACorruptedMemoryCharacter : public ACharacter { GENERATED_BODY() - - // /** Pawn mesh: 1st person view (arms; seen only by self) */ - // UPROPERTY(VisibleDefaultsOnly, Category=Mesh) - // USkeletalMeshComponent* Mesh1P; + DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnGameStart); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnGameEnd); @@ -114,12 +111,7 @@ protected: UPROPERTY() FTimerHandle ScanTimerHandle; - ACM_Shelving* LastScannedShelf = nullptr; - public: - /** Returns Mesh1P subobject **/ - // USkeletalMeshComponent* GetMesh1P() const { return Mesh1P; } - /** Returns FirstPersonCameraComponent subobject **/ UCameraComponent* GetFirstPersonCameraComponent() const { return FirstPersonCameraComponent; } virtual void Tick(float DeltaSeconds) override; UPROPERTY(EditDefaultsOnly)