diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 00000000..b9be5257 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,17 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.Net.Component.4.6.2.TargetingPack", + "Microsoft.VisualStudio.Component.VC.14.33.17.3.ARM64", + "Microsoft.VisualStudio.Component.VC.14.33.17.3.x86.x64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.Windows10SDK", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.NativeCrossPlat", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.VisualStudio.Workload.NativeGame", + "Microsoft.VisualStudio.Workload.Universal" + ] +} diff --git a/Blaster.uproject b/Blaster.uproject index ea3b9fb3..9a1636a1 100644 --- a/Blaster.uproject +++ b/Blaster.uproject @@ -1,6 +1,6 @@ { "FileVersion": 3, - "EngineAssociation": "5.0", + "EngineAssociation": "5.1", "Category": "", "Description": "", "Modules": [ diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini index 2a85483a..e60b701d 100644 --- a/Config/DefaultGame.ini +++ b/Config/DefaultGame.ini @@ -46,40 +46,40 @@ bCookMapsOnly=False bCompressed=False bSkipEditorContent=False bSkipMovies=False --IniKeyBlacklist=KeyStorePassword --IniKeyBlacklist=KeyPassword --IniKeyBlacklist=rsa.privateexp --IniKeyBlacklist=rsa.modulus --IniKeyBlacklist=rsa.publicexp --IniKeyBlacklist=aes.key --IniKeyBlacklist=SigningPublicExponent --IniKeyBlacklist=SigningModulus --IniKeyBlacklist=SigningPrivateExponent --IniKeyBlacklist=EncryptionKey --IniKeyBlacklist=DevCenterUsername --IniKeyBlacklist=DevCenterPassword --IniKeyBlacklist=IOSTeamID --IniKeyBlacklist=SigningCertificate --IniKeyBlacklist=MobileProvision --IniKeyBlacklist=IniKeyBlacklist --IniKeyBlacklist=IniSectionBlacklist -+IniKeyBlacklist=KeyStorePassword -+IniKeyBlacklist=KeyPassword -+IniKeyBlacklist=rsa.privateexp -+IniKeyBlacklist=rsa.modulus -+IniKeyBlacklist=rsa.publicexp -+IniKeyBlacklist=aes.key -+IniKeyBlacklist=SigningPublicExponent -+IniKeyBlacklist=SigningModulus -+IniKeyBlacklist=SigningPrivateExponent -+IniKeyBlacklist=EncryptionKey -+IniKeyBlacklist=DevCenterUsername -+IniKeyBlacklist=DevCenterPassword -+IniKeyBlacklist=IOSTeamID -+IniKeyBlacklist=SigningCertificate -+IniKeyBlacklist=MobileProvision -+IniKeyBlacklist=IniKeyBlacklist -+IniKeyBlacklist=IniSectionBlacklist +-IniKeyDenylist=KeyStorePassword +-IniKeyDenylist=KeyPassword +-IniKeyDenylist=rsa.privateexp +-IniKeyDenylist=rsa.modulus +-IniKeyDenylist=rsa.publicexp +-IniKeyDenylist=aes.key +-IniKeyDenylist=SigningPublicExponent +-IniKeyDenylist=SigningModulus +-IniKeyDenylist=SigningPrivateExponent +-IniKeyDenylist=EncryptionKey +-IniKeyDenylist=DevCenterUsername +-IniKeyDenylist=DevCenterPassword +-IniKeyDenylist=IOSTeamID +-IniKeyDenylist=SigningCertificate +-IniKeyDenylist=MobileProvision +-IniKeyDenylist=IniKeyDenylist +-IniKeyDenylist=IniSectionBlacklist ++IniKeyDenylist=KeyStorePassword ++IniKeyDenylist=KeyPassword ++IniKeyDenylist=rsa.privateexp ++IniKeyDenylist=rsa.modulus ++IniKeyDenylist=rsa.publicexp ++IniKeyDenylist=aes.key ++IniKeyDenylist=SigningPublicExponent ++IniKeyDenylist=SigningModulus ++IniKeyDenylist=SigningPrivateExponent ++IniKeyDenylist=EncryptionKey ++IniKeyDenylist=DevCenterUsername ++IniKeyDenylist=DevCenterPassword ++IniKeyDenylist=IOSTeamID ++IniKeyDenylist=SigningCertificate ++IniKeyDenylist=MobileProvision ++IniKeyDenylist=IniKeyDenylist ++IniKeyDenylist=IniSectionBlacklist +MapsToCook=(FilePath="/Game/Maps/Lobby") +MapsToCook=(FilePath="/Game/Maps/GameStartupMap") +MapsToCook=(FilePath="/Game/Maps/TransitionMap") diff --git a/Config/DefaultInput.ini b/Config/DefaultInput.ini index a01735b3..1e31cf13 100644 --- a/Config/DefaultInput.ini +++ b/Config/DefaultInput.ini @@ -69,6 +69,11 @@ bUseMouseForTouch=False bEnableMouseSmoothing=True bEnableFOVScaling=True bCaptureMouseOnLaunch=True +bEnableLegacyInputScales=True +bEnableMotionControls=True +bFilterInputByPlatformUser=False +bShouldFlushPressedKeysOnViewportFocusLost=True +bEnableDynamicComponentInputBinding=True bAlwaysShowTouchInterface=False bShowConsoleOnFourFingerTap=True bEnableGestureRecognizer=False @@ -93,8 +98,8 @@ DoubleClickTime=0.200000 +AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A) +AxisMappings=(AxisName="Turn",Scale=1.000000,Key=MouseX) +AxisMappings=(AxisName="LookUp",Scale=-1.000000,Key=MouseY) -DefaultPlayerInputClass=/Script/Engine.PlayerInput -DefaultInputComponentClass=/Script/Engine.InputComponent +DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput +DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks -ConsoleKeys=Tilde +ConsoleKeys=Tilde diff --git a/Content/Maps/GameStartupMap.umap b/Content/Maps/GameStartupMap.umap index c26e0383..6adcf083 100644 Binary files a/Content/Maps/GameStartupMap.umap and b/Content/Maps/GameStartupMap.umap differ diff --git a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/Menu.cpp b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/Menu.cpp index f9117e32..aefcc1aa 100644 --- a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/Menu.cpp +++ b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/Menu.cpp @@ -65,12 +65,18 @@ bool UMenu::Initialize() return true; } +/* void UMenu::OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) { MenuTearDown(); Super::OnLevelRemovedFromWorld(InLevel, InWorld); } - +*/ +void UMenu::NativeDestruct() +{ + MenuTearDown(); + Super::NativeDestruct(); +} void UMenu::OnCreateSession(bool bWasSuccessful) { if (bWasSuccessful) diff --git a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/MultiplayerSessionsSubsystem.cpp b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/MultiplayerSessionsSubsystem.cpp index 16638481..e82ea6f4 100644 --- a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/MultiplayerSessionsSubsystem.cpp +++ b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Private/MultiplayerSessionsSubsystem.cpp @@ -12,11 +12,7 @@ UMultiplayerSessionsSubsystem::UMultiplayerSessionsSubsystem(): DestroySessionCompleteDelegate(FOnDestroySessionCompleteDelegate::CreateUObject(this, &ThisClass::OnDestroySessionComplete)), StartSessionCompleteDelegate(FOnStartSessionCompleteDelegate::CreateUObject(this, &ThisClass::OnStartSessionComplete)) { - IOnlineSubsystem* Subsystem = IOnlineSubsystem::Get(); - if (Subsystem) - { - SessionInterface = Subsystem->GetSessionInterface(); - } + } void UMultiplayerSessionsSubsystem::CreateSession(int32 NumPublicConnections, FString MatchType) @@ -64,7 +60,7 @@ void UMultiplayerSessionsSubsystem::CreateSession(int32 NumPublicConnections, FS void UMultiplayerSessionsSubsystem::FindSessions(int32 MaxSearchResults) { - if (!SessionInterface.IsValid()) + if (!IsValidSessionInterface()) { return; } @@ -178,3 +174,20 @@ void UMultiplayerSessionsSubsystem::OnDestroySessionComplete(FName SessionName, void UMultiplayerSessionsSubsystem::OnStartSessionComplete(FName SessionName, bool bWasSuccessful) { } + +bool UMultiplayerSessionsSubsystem::IsValidSessionInterface() +{ + if (!SessionInterface) + { + IOnlineSubsystem* Subsystem = IOnlineSubsystem::Get(); + + if (Subsystem) + { + SessionInterface = Subsystem->GetSessionInterface(); + } + + } + + + return SessionInterface.IsValid(); +} diff --git a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/Menu.h b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/Menu.h index 4e3a4ad2..d23f5bda 100644 --- a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/Menu.h +++ b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/Menu.h @@ -21,8 +21,8 @@ class MULTIPLAYERSESSIONS_API UMenu : public UUserWidget protected: virtual bool Initialize() override; - virtual void OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) override; - + //virtual void OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) override; + virtual void NativeDestruct() override; // // Callbacks for the custom delegates on the MultiplayerSessionsSubsystem // diff --git a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/MultiplayerSessionsSubsystem.h b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/MultiplayerSessionsSubsystem.h index a887f59a..398523b8 100644 --- a/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/MultiplayerSessionsSubsystem.h +++ b/Plugins/MultiplayerSessions/Source/MultiplayerSessions/Public/MultiplayerSessionsSubsystem.h @@ -59,6 +59,8 @@ class MULTIPLAYERSESSIONS_API UMultiplayerSessionsSubsystem : public UGameInstan void OnDestroySessionComplete(FName SessionName, bool bWasSuccessful); void OnStartSessionComplete(FName SessionName, bool bWasSuccessful); + bool IsValidSessionInterface(); + private: IOnlineSessionPtr SessionInterface; TSharedPtr LastSessionSettings; diff --git a/Source/Blaster/BlasterComponents/LagCompensationComponent.cpp b/Source/Blaster/BlasterComponents/LagCompensationComponent.cpp index 20a8fe81..f736ecbb 100644 --- a/Source/Blaster/BlasterComponents/LagCompensationComponent.cpp +++ b/Source/Blaster/BlasterComponents/LagCompensationComponent.cpp @@ -288,6 +288,7 @@ void ULagCompensationComponent::CacheBoxPositions(ABlasterCharacter* HitCharacte } } +/* void ULagCompensationComponent::MoveBoxes(ABlasterCharacter* HitCharacter, const FFramePackage& Package) { if (HitCharacter == nullptr) return; @@ -300,8 +301,30 @@ void ULagCompensationComponent::MoveBoxes(ABlasterCharacter* HitCharacter, const HitBoxPair.Value->SetBoxExtent(Package.HitBoxInfo[HitBoxPair.Key].BoxExtent); } } +}*/ + +void ULagCompensationComponent::MoveBoxes(ABlasterCharacter* HitCharacter, const FFramePackage& FramePackage) +{ + for (TTuple& HitBoxPair : HitCharacter->HitCollisionBoxes) + { + + if (HitBoxPair.Value != nullptr) + { + + const FBoxInformation* BoxValue = FramePackage.HitBoxInfo.Find(HitBoxPair.Key); + + if (BoxValue) + { + HitBoxPair.Value->SetWorldLocation(BoxValue->Location); + HitBoxPair.Value->SetWorldRotation(BoxValue->Rotation); + HitBoxPair.Value->SetBoxExtent(BoxValue->BoxExtent); + } + + } + } } +/* void ULagCompensationComponent::ResetHitBoxes(ABlasterCharacter* HitCharacter, const FFramePackage& Package) { if (HitCharacter == nullptr) return; @@ -315,6 +338,26 @@ void ULagCompensationComponent::ResetHitBoxes(ABlasterCharacter* HitCharacter, c HitBoxPair.Value->SetCollisionEnabled(ECollisionEnabled::NoCollision); } } +}*/ +void ULagCompensationComponent::ResetHitBoxes(ABlasterCharacter* HitCharacter, const FFramePackage& FramePackage) +{ + if (HitCharacter == nullptr) return; + + for (TTuple& HitBoxPair : HitCharacter->HitCollisionBoxes) + { + if (HitBoxPair.Value != nullptr) + { + const FBoxInformation* BoxValue = FramePackage.HitBoxInfo.Find(HitBoxPair.Key); + + if (BoxValue) + { + HitBoxPair.Value->SetWorldLocation(BoxValue->Location); + HitBoxPair.Value->SetWorldRotation(BoxValue->Rotation); + HitBoxPair.Value->SetBoxExtent(BoxValue->BoxExtent); + HitBoxPair.Value->SetCollisionEnabled(ECollisionEnabled::NoCollision); + } + } + } } void ULagCompensationComponent::EnableCharacterMeshCollision(ABlasterCharacter* HitCharacter, ECollisionEnabled::Type CollisionEnabled) diff --git a/Source/Blaster/BlasterComponents/LagCompensationComponent.h b/Source/Blaster/BlasterComponents/LagCompensationComponent.h index c5c51c1d..44f11a86 100644 --- a/Source/Blaster/BlasterComponents/LagCompensationComponent.h +++ b/Source/Blaster/BlasterComponents/LagCompensationComponent.h @@ -9,6 +9,13 @@ USTRUCT(BlueprintType) struct FBoxInformation { + // Constructor + FBoxInformation() + : Location(0.0f, 0.0f, 0.0f) + , Rotation(0.0f, 0.0f, 0.0f) + , BoxExtent(0.0f, 0.0f, 0.0f) + { + } GENERATED_BODY() UPROPERTY() @@ -19,11 +26,21 @@ struct FBoxInformation UPROPERTY() FVector BoxExtent; + + }; USTRUCT(BlueprintType) struct FFramePackage { + + // Constructor + FFramePackage() + : Time(0.0f) + , Character(nullptr) + { + } + GENERATED_BODY() UPROPERTY() @@ -34,11 +51,14 @@ struct FFramePackage UPROPERTY() ABlasterCharacter* Character; + + }; USTRUCT(BlueprintType) struct FServerSideRewindResult { + GENERATED_BODY() UPROPERTY() @@ -46,11 +66,16 @@ struct FServerSideRewindResult UPROPERTY() bool bHeadShot; + }; USTRUCT(BlueprintType) struct FShotgunServerSideRewindResult { + // Constructor + FShotgunServerSideRewindResult() + { + } GENERATED_BODY() UPROPERTY() @@ -59,6 +84,8 @@ struct FShotgunServerSideRewindResult UPROPERTY() TMap BodyShots; + + }; UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) diff --git a/Source/Blaster/HUD/OverheadWidget.cpp b/Source/Blaster/HUD/OverheadWidget.cpp index ddf4e2ba..9257de44 100644 --- a/Source/Blaster/HUD/OverheadWidget.cpp +++ b/Source/Blaster/HUD/OverheadWidget.cpp @@ -35,8 +35,16 @@ void UOverheadWidget::ShowPlayerNetRole(APawn* InPawn) SetDisplayText(RemoteRoleString); } -void UOverheadWidget::OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) +/*void UOverheadWidget::OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) { RemoveFromParent(); Super::OnLevelRemovedFromWorld(InLevel, InWorld); } +*/ +void UOverheadWidget::NativeDestruct() +{ + + RemoveFromParent(); + Super::NativeDestruct(); + +} diff --git a/Source/Blaster/HUD/OverheadWidget.h b/Source/Blaster/HUD/OverheadWidget.h index d7f77f14..2412219d 100644 --- a/Source/Blaster/HUD/OverheadWidget.h +++ b/Source/Blaster/HUD/OverheadWidget.h @@ -15,14 +15,15 @@ class BLASTER_API UOverheadWidget : public UUserWidget GENERATED_BODY() public: UPROPERTY(meta = (BindWidget)) - class UTextBlock* DisplayText; + class UTextBlock* DisplayText; void SetDisplayText(FString TextToDisplay); UFUNCTION(BlueprintCallable) - void ShowPlayerNetRole(APawn* InPawn); + void ShowPlayerNetRole(APawn* InPawn); protected: - virtual void OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) override; + //virtual void OnLevelRemovedFromWorld(ULevel* InLevel, UWorld* InWorld) override; + virtual void NativeDestruct() override; -}; +}; \ No newline at end of file diff --git a/Source/Blaster/PlayerController/BlasterPlayerController.cpp b/Source/Blaster/PlayerController/BlasterPlayerController.cpp index fe930ae9..00c01123 100644 --- a/Source/Blaster/PlayerController/BlasterPlayerController.cpp +++ b/Source/Blaster/PlayerController/BlasterPlayerController.cpp @@ -151,7 +151,7 @@ void ABlasterPlayerController::CheckPing(float DeltaTime) PlayerState = PlayerState == nullptr ? GetPlayerState() : PlayerState; if (PlayerState) { - if (PlayerState->GetPing() * 4 > HighPingThreshold) // ping is compressed; it's actually ping / 4 + if (PlayerState->GetPingInMilliseconds() * 4 > HighPingThreshold) // ping is compressed; it's actually ping / 4 { HighPingWarning(); PingAnimationRunningTime = 0.f; diff --git a/Source/Blaster/Weapon/ProjectileRocket.cpp b/Source/Blaster/Weapon/ProjectileRocket.cpp index 9cf08ca0..8ab373d1 100644 --- a/Source/Blaster/Weapon/ProjectileRocket.cpp +++ b/Source/Blaster/Weapon/ProjectileRocket.cpp @@ -77,9 +77,9 @@ void AProjectileRocket::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, { CollisionBox->SetCollisionEnabled(ECollisionEnabled::NoCollision); } - if (TrailSystemComponent && TrailSystemComponent->GetSystemInstance()) + if (TrailSystemComponent && TrailSystemComponent->GetSystemInstanceController()) { - TrailSystemComponent->GetSystemInstance()->Deactivate(); + TrailSystemComponent->GetSystemInstanceController()->Deactivate(); } if (ProjectileLoopComponent && ProjectileLoopComponent->IsPlaying()) { diff --git a/Source/Blaster/Weapon/Weapon.cpp b/Source/Blaster/Weapon/Weapon.cpp index c0aff910..af1c1e41 100644 --- a/Source/Blaster/Weapon/Weapon.cpp +++ b/Source/Blaster/Weapon/Weapon.cpp @@ -117,15 +117,29 @@ void AWeapon::SetHUDAmmo() void AWeapon::SpendRound() { Ammo = FMath::Clamp(Ammo - 1, 0, MagCapacity); - SetHUDAmmo(); - if (HasAuthority()) - { - ClientUpdateAmmo(Ammo); - } - else - { - ++Sequence; - } + //need to access player controller to change the ammo on the hud + //weapon will spend rounds very quickly + //instead of getting theowner and casting it to a blaster character over and over + //make a variable for the character & controller + + SetHUDAmmo(); + + /* + * We're setting ammo locally, but because we're firing a round both on client and server + * it'll be set on the server too + * if we're on the server, we need to send that info to client + * so te client knows the authoritative value of ammo + */ + + if (HasAuthority()) + { + ClientUpdateAmmo(Ammo); + } + else if (BlasterOwnerCharacter && BlasterOwnerCharacter->IsLocallyControlled()) + { + /*We've just spend a round and the server's replication of it hasn't yet reached us*/ + Sequence++; + } } void AWeapon::ClientUpdateAmmo_Implementation(int32 ServerAmmo)