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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,4 @@ plugins/OWSPlugin/Saved/
plugins/OWSPluginUE5/Binaries/
plugins/OWSPluginUE5/Intermediate/
plugins/OWSPluginUE5/Saved/
/plugins/OWSPluginUE5/Source/OWSPlugin/Public/OWSPlayerController.h.bak
4 changes: 2 additions & 2 deletions plugins/OWSPluginUE5/OWSPlugin.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 5,
"VersionName": "5.4",
"VersionName": "5.5",
"FriendlyName": "OWSPlugin",
"Description": "Open World Server",
"Category": "Other",
Expand All @@ -10,7 +10,7 @@
"DocsURL": "https://www.openworldserver.com",
"MarketplaceURL": "",
"SupportURL": "",
"EngineVersion": "5.4.0",
"EngineVersion": "5.5.0",
"CanContainContent": true,
"IsBetaVersion": false,
"Installed": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ AOWSAdvancedProjectile::AOWSAdvancedProjectile(const class FObjectInitializer& O
bHasSpawnedFully = false;

NetPriority = 2.f;
MinNetUpdateFrequency = 100.0f;
SetMinNetUpdateFrequency(100.0f);
}

void AOWSAdvancedProjectile::PreInitializeComponents()
Expand Down Expand Up @@ -129,7 +129,7 @@ void AOWSAdvancedProjectile::OnRep_Instigator()
//InstigatorTeamNum = GetTeamNum(); // this checks Instigator first

InstigatorController = GetInstigator()->Controller;
if (Cast<AOWSAdvancedProjectile>(GetInstigator()))
if (Cast<AOWSCharacterWithAbilities>(GetInstigator()))
{
((AOWSCharacterWithAbilities*)(GetInstigator()))->LastFiredProjectile = this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ AOWSCharacterWithAbilities::AOWSCharacterWithAbilities(const class FObjectInitia
AbilitySystem->SetIsReplicated(true);
AbilitySystem->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);

SpellAbilityHandles.SetNum(22, false);
WeaponAbilityHandles.SetNum(22, false);
SpellAbilityHandles.SetNum(22, EAllowShrinking::No);
WeaponAbilityHandles.SetNum(22, EAllowShrinking::No);

OWSAttributes = CreateDefaultSubobject<UOWSAttributeSet>(TEXT("AttributeSet"));
}
Expand Down
43 changes: 19 additions & 24 deletions plugins/OWSPluginUE5/Source/OWSPlugin/Private/OWSGameMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,35 +469,30 @@ void AOWSGameMode::SaveAllPlayerLocations()
{
if (NextSaveGroupIndex == PlayerIndex % SplitSaveIntoHowManyGroups)
{
AOWSPlayerController* PlayerControllerToSave = Cast<AOWSPlayerController>(Iterator->Get());

if (PlayerControllerToSave)
if (APlayerController* PlayerControllerToSave = Cast<APlayerController>(Iterator->Get()))
{
APawn* MyPawn = Iterator->Get()->GetPawn();

if (MyPawn)
{
PlayerControllerToSave->LastCharacterLocation = MyPawn->GetActorLocation();
PlayerControllerToSave->LastCharacterRotation = MyPawn->GetActorRotation();
FVector PawnLocation = MyPawn->GetActorLocation();
FRotator PawnRotation = MyPawn->GetActorRotation();

DataToSave.Append(PlayerControllerToSave->PlayerState->GetPlayerName());
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnLocation.X));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnLocation.Y));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnLocation.Z));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnRotation.Roll));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnRotation.Pitch));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnRotation.Yaw));
DataToSave.Append("|");
}

FVector PawnLocation = PlayerControllerToSave->LastCharacterLocation;
FRotator PawnRotation = PlayerControllerToSave->LastCharacterRotation;

DataToSave.Append(PlayerControllerToSave->PlayerState->GetPlayerName());
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnLocation.X));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnLocation.Y));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnLocation.Z));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnRotation.Roll));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnRotation.Pitch));
DataToSave.Append(":");
DataToSave.Append(FString::SanitizeFloat(PawnRotation.Yaw));
DataToSave.Append("|");
}
}

Expand Down Expand Up @@ -714,7 +709,7 @@ void AOWSGameMode::UpdateNumberOfPlayers()

if (ZoneInstanceID < 1)
{
UE_LOG(OWS, Error, TEXT("UpdateNumberOfPlayers: ZoneInstanceId is empty!"));
UE_LOG(OWS, Warning, TEXT("UpdateNumberOfPlayers: ZoneInstanceId is empty! Ignore this warning if running from the Editor!"));
return;
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/OWSPluginUE5/Source/OWSPlugin/Private/OWSHUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ void AOWSHUD::RenderInteractiveInventoryGrid(UOWSInventory* Inventory, UTexture*

//UInventory* const Inventory = (UInventory*)InventoryObject;

FColor FontColor;
FVector2D* FontScale = new FVector2D(1.0f, 1.0f);

for (int32 curRow = 0; curRow < NumberOfRows; curRow++)
Expand Down Expand Up @@ -1067,7 +1066,6 @@ void AOWSHUD::RenderInteractiveInventoryGrid(UOWSInventory* Inventory, UTexture*
void AOWSHUD::RenderInteractiveInventoryGridUsingLockedSlotGroups(UOWSInventory* Inventory, UTexture* EmptySlotTexture, UTexture* LockedRowTexture, int32 X, int32 Y,
int32 XSpacing, int32 YSpacing, int32 iconWidth, int32 iconHeight, int32 NumberOfRows, int32 NumberOfCols, int32 SlotGroupRows, int32 SlotGroupCols, int32 SlotGroupXSpacing, int32 SlotGroupYSpacing)
{
FColor FontColor;
FVector2D* FontScale = new FVector2D(1.0f, 1.0f);
int32 SlotGroupWidth = NumberOfCols * (iconWidth + XSpacing) - XSpacing;
int32 SlotGroupHeight = NumberOfRows * (iconHeight + YSpacing) - YSpacing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ class OWSPLUGIN_API AOWSPlayerController : public APlayerController
float ServerTravelRY;
float ServerTravelRZ;

FVector LastCharacterLocation;
FRotator LastCharacterRotation;

UPROPERTY()
TMap<FString, int32> LocalMeshItemsMap;

Expand Down
2 changes: 1 addition & 1 deletion src/.docker/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
environment:
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
ports:
- "5432:5432"
- "15432:5432"
volumes:
- database:/var/lib/postgresql/data
container_name: PostgreSQL
Expand Down
2 changes: 1 addition & 1 deletion src/.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DATABASE_PASSWORD='yourStrong(!)Password'
# MSSQL
# DATABASE_CONNECTION_STRING="Server=host.docker.internal;Database=OpenWorldServer;User Id=SA;Password=${DATABASE_PASSWORD};ConnectRetryCount=0"
# Postgres
DATABASE_CONNECTION_STRING="Host=host.docker.internal;Port=5432;Database=openworldserver;Username=postgres;Password=${DATABASE_PASSWORD};"
DATABASE_CONNECTION_STRING="Host=host.docker.internal;Port=15432;Database=openworldserver;Username=postgres;Password=${DATABASE_PASSWORD};"
# Mysql
# DATABASE_CONNECTION_STRING="server=host.docker.internal;user=root;database=openworldserver;port=3306;password=${DATABASE_PASSWORD};Allow User Variables=True;SslMode=None"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private void HandleServerSpinUpMessage(Guid customerGUID, int worldServerID, int
ProcessName = proc.ProcessName
});

Log.Information($"{customerGUID} : {worldServerID} : {mapName} : {port} has started.");
Log.Information($"{customerGUID} : {worldServerID} : {mapName} : {port} has started. ProcessId: {proc.Id}, ProcessName: {proc.ProcessName}");

//The server has finished spinning up. Set the status to 2.
//_ = UpdateZoneServerStatusReady(zoneInstanceID);
Expand Down
Loading