Skip to content

Commit

Permalink
Fix remaining warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonKaminski committed Mar 24, 2024
1 parent b41c5c2 commit 8b93d47
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions UdpHosts/GameServer/Controllers/GenericShard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ public void RequestLogout(INetworkClient client, IPlayer player, ulong entityId,
}
}

_ = GRPCService.SaveCharacterSessionDataAsync(player.CharacterId + 0xFE, zone.ID, closestOutpostId,
(uint)DateTimeOffset.UtcNow.ToUnixTimeSeconds() - player.ConnectedAt);
_ = GRPCService.SaveCharacterSessionDataAsync(
player.CharacterId + 0xFE,
zone.ID,
closestOutpostId,
(uint)DateTimeOffset.UtcNow.ToUnixTimeSeconds() - player.ConnectedAt);
}

[MessageID((byte)Commands.RequestEncounterInfo)]
Expand Down
2 changes: 1 addition & 1 deletion UdpHosts/GameServer/Data/Zone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace GameServer.Data;

public class Zone
{
private static readonly HashSet<uint> OpenWorldZones = [162, 448, 1030];
private static readonly HashSet<uint> OpenWorldZones = new() { 162, 448, 1030 };

public Zone()
{
Expand Down
4 changes: 2 additions & 2 deletions UdpHosts/GameServer/Entities/Outpost/OutpostEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public OutpostEntity(IShard shard, ulong eid, Data.SDB.Records.customdata.Outpos

public SpawnPoint RandomSpawnPoint => SpawnPoints[Rng.Next(SpawnPoints.Count)];
public bool IsCapturedByHostiles => Faction.HostileFactionIds.Contains(Outpost_ObserverView.FactionIdProp);
private List<SpawnPoint> SpawnPoints { get; set; } = [];
private List<SpawnPoint> SpawnPoints { get; set; } = new();

private void InitFields()
{
Expand Down Expand Up @@ -70,7 +70,7 @@ private void AddSpawnPoints(Data.SDB.Records.customdata.Outpost record)
{
if (record.SpawnPoints.Count == 0)
{
SpawnPoints = [ new SpawnPoint { Position = record.Position } ];
SpawnPoints = new List<SpawnPoint> { new() { Position = record.Position } };
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion UdpHosts/GameServer/StaticDB/Records/customdata/Outpost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record Outpost

public uint OutpostName { get; set; }
public Vector3 Position { get; set; }
public List<SpawnPoint> SpawnPoints { get; set; } = [];
public List<SpawnPoint> SpawnPoints { get; set; } = new();
public uint LevelBandId { get; set; }
public byte SinUnlockIndex { get; set; }
public int TeleportCost { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace GameServer.Data.SDB.Records.dbcharacter;
public record class Faction
{
public static readonly HashSet<uint> HostileFactionIds = [2, 3, 5, 6, 7, 8, 17, 22, 42, 43, 45, 46, 47, 48];
public static readonly HashSet<uint> HostileFactionIds = new() { 2, 3, 5, 6, 7, 8, 17, 22, 42, 43, 45, 46, 47, 48 };

public uint LocalizedNameId { get; set; }
public int StartingReputation { get; set; }
Expand Down
8 changes: 6 additions & 2 deletions UdpHosts/GameServer/Test/DataUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ public static string FormatArmyTag(string armyTag)

private static void AddZone(uint id, string name, ulong timestamp, Vector3 spawn, uint defaultOutpostId = 0)
{
var zone = new Zone { ID = id, Name = name, Timestamp = timestamp, POIs = { { "origin", new Vector3(0.0f, 0.0f, 0.0f) }, { "spawn", spawn } },
DefaultOutpostId = defaultOutpostId };
var zone = new Zone
{
ID = id, Name = name, Timestamp = timestamp,
POIs = { { "origin", new Vector3(0.0f, 0.0f, 0.0f) }, { "spawn", spawn } },
DefaultOutpostId = defaultOutpostId
};
_zones.AddOrUpdate(zone.ID, zone, (_, nc) => nc);
}
}

0 comments on commit 8b93d47

Please sign in to comment.