-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partially rewrite sessions to support new squad stuff and added confi…
…g option for logging.
- Loading branch information
1 parent
4e5691c
commit f3f64fd
Showing
36 changed files
with
1,086 additions
and
810 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,30 @@ | ||
using Uncreated.Warfare.Kits; | ||
using Uncreated.Warfare.Models.Kits; | ||
|
||
namespace Uncreated.Warfare.Events.Models.Kits; | ||
|
||
/// <summary> | ||
/// Handles when a player's kit is changed, re-equipped, or dequiped. | ||
/// </summary> | ||
public class PlayerKitChanged : PlayerEvent | ||
{ | ||
/// <summary> | ||
/// The kit the player changed to, or <see langword="null"/> if the kit was dequipped. | ||
/// </summary> | ||
public required Kit? Kit { get; init; } | ||
|
||
/// <summary> | ||
/// The ID of the kit the player changed to, or 0 if the kit was dequipped. | ||
/// </summary> | ||
public required uint KitId { get; init; } | ||
|
||
/// <summary> | ||
/// The name of the kit the player changed to, or <see langword="null"/> if the kit was dequipped. | ||
/// </summary> | ||
public required string? KitName { get; init; } | ||
|
||
/// <summary> | ||
/// The class of the kit that was changed to. | ||
/// </summary> | ||
public required Class Class { get; init; } | ||
} |
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 |
---|---|---|
@@ -1,16 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Uncreated.Warfare.Players; | ||
using Uncreated.Warfare.Squads; | ||
|
||
namespace Uncreated.Warfare.Events.Models.Squads; | ||
|
||
/// <summary> | ||
/// Event listener args which fires after a <see cref="Squad"/> is created. | ||
/// </summary> | ||
internal class SquadCreated | ||
[EventModel(SynchronizedModelTags = [ "squads" ])] | ||
public class SquadCreated : SquadUpdated, IPlayerEvent | ||
{ | ||
/// <summary> | ||
/// The <see cref="Squad"/> that was created. | ||
/// The player that created the squad. | ||
/// </summary> | ||
public required WarfarePlayer Player { get; init; } | ||
|
||
/// <summary> | ||
/// The ID of the player that created the squad. | ||
/// </summary> | ||
public required Squad Squad { get; init; } | ||
} | ||
public CSteamID Steam64 => Player.Steam64; | ||
} |
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 |
---|---|---|
@@ -1,16 +1,9 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Uncreated.Warfare.Squads; | ||
using Uncreated.Warfare.Squads; | ||
|
||
namespace Uncreated.Warfare.Events.Models.Squads; | ||
|
||
/// <summary> | ||
/// Event listener args which fires after a <see cref="Squad"/> is disbanded. | ||
/// </summary> | ||
internal class SquadDisbanded | ||
{ | ||
/// <summary> | ||
/// The <see cref="Squad"/> that was disbanded. | ||
/// </summary> | ||
public required Squad Squad { get; init; } | ||
} | ||
[EventModel(SynchronizedModelTags = [ "squads" ])] | ||
public class SquadDisbanded : SquadUpdated; |
21 changes: 21 additions & 0 deletions
21
UncreatedWarfare/Events/Models/Squads/SquadLeaderUpdated.cs
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 @@ | ||
using Uncreated.Warfare.Players; | ||
using Uncreated.Warfare.Squads; | ||
|
||
namespace Uncreated.Warfare.Events.Models.Squads; | ||
|
||
/// <summary> | ||
/// Event listener args which fires after a player joines a <see cref="Squad"/>. | ||
/// </summary> | ||
[EventModel(SynchronizedModelTags = [ "squads" ])] | ||
public class SquadLeaderUpdated : SquadUpdated | ||
{ | ||
/// <summary> | ||
/// The player that used to be the squad leader. This player may not be online. | ||
/// </summary> | ||
public required WarfarePlayer OldLeader { get; init; } | ||
|
||
/// <summary> | ||
/// The player that is now the squad leader. This player may not be online. | ||
/// </summary> | ||
public required WarfarePlayer NewLeader { get; init; } | ||
} |
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,15 @@ | ||
using Uncreated.Warfare.Squads; | ||
|
||
namespace Uncreated.Warfare.Events.Models.Squads; | ||
|
||
/// <summary> | ||
/// Event listener args which fires after a player joines a <see cref="Squad"/>. | ||
/// </summary> | ||
[EventModel(SynchronizedModelTags = [ "squads" ])] | ||
public class SquadLockUpdated : SquadUpdated | ||
{ | ||
/// <summary> | ||
/// If the squad is now locked. The old state is just the opposite of this. | ||
/// </summary> | ||
public required bool NewLockState { get; init; } | ||
} |
21 changes: 11 additions & 10 deletions
21
UncreatedWarfare/Events/Models/Squads/SquadMemberJoined.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Uncreated.Warfare.Squads; | ||
|
||
namespace Uncreated.Warfare.Events.Models.Squads; | ||
|
||
/// <summary> | ||
/// Base event for all <see cref="Warfare.Squads.Squad"/> updates. | ||
/// </summary> | ||
[EventModel(SynchronizedModelTags = [ "squads" ])] | ||
public abstract class SquadUpdated | ||
{ | ||
/// <summary> | ||
/// The squad that the player joined. | ||
/// </summary> | ||
public required Squad Squad { get; init; } | ||
} |
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
Oops, something went wrong.