-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from daud-io/firebase
Firebase
- Loading branch information
Showing
13 changed files
with
140 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Game.Engine.Auditing | ||
{ | ||
public class AuditEventBase | ||
{ | ||
public string Type { get => this.GetType().Name; } | ||
public string PublicURL { get; set; } | ||
public string WorldKey { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Game.Engine.Auditing | ||
{ | ||
using Game.Engine.Core; | ||
|
||
public class AuditEventDeath : AuditEventBase | ||
{ | ||
public long GameTime { get; set; } | ||
public AuditModelPlayer Killer { get; set; } | ||
public AuditModelPlayer Victim { get; set; } | ||
|
||
public AuditEventDeath(Player killer, Player victim, Fleet fleet) | ||
{ | ||
GameTime = fleet?.World.Time ?? 0; | ||
PublicURL = fleet?.World?.GameConfiguration?.PublicURL; | ||
WorldKey = fleet?.World?.WorldKey; | ||
|
||
Killer = new AuditModelPlayer(killer); | ||
Victim = new AuditModelPlayer(victim); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Game.Engine.Auditing | ||
{ | ||
using Game.Engine.Core; | ||
|
||
public class AuditEventSpawn : AuditEventBase | ||
{ | ||
public long GameTime { get; set; } | ||
public AuditModelPlayer Player { get; set; } | ||
|
||
public AuditEventSpawn(Player player) | ||
{ | ||
GameTime = player?.World?.Time ?? 0; | ||
PublicURL = player?.World?.GameConfiguration?.PublicURL; | ||
WorldKey = player?.World?.WorldKey; | ||
Player = new AuditModelPlayer(player); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Game.Engine.Auditing | ||
{ | ||
using Game.Engine.Core; | ||
|
||
public class AuditModelPlayer | ||
{ | ||
public ulong LoginID { get; } | ||
public string LoginName { get; set; } | ||
public uint FleetID { get; set; } | ||
public string FleetName { get; set; } | ||
public int FleetSize { get; set; } | ||
public int Score { get; set; } | ||
public long AliveSince { get; set; } | ||
public int ComboCounter { get; set; } | ||
public uint Latency { get; set; } | ||
|
||
public AuditModelPlayer(Player player) | ||
{ | ||
if (player == null) | ||
return; | ||
|
||
this.LoginID = player.LoginID; | ||
this.LoginName = player.LoginName; | ||
this.FleetID = player.Fleet?.ID ?? 0; | ||
this.FleetName = player.Name; | ||
this.FleetSize = player.Fleet?.Ships?.Count ?? 0; | ||
this.Score = player.Score; | ||
this.AliveSince = player.AliveSince; | ||
this.ComboCounter = player.ComboCounter; | ||
this.Latency = player.Connection?.Latency ?? 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Game.Engine.Auditing | ||
{ | ||
public class OnDeath | ||
{ | ||
#pragma warning disable IDE1006 // Naming Styles | ||
public string token { get; set; } | ||
public string name { get; set; } | ||
public string killedBy { get; set; } | ||
#pragma warning restore IDE1006 // Naming Styles | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters