-
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.
- Loading branch information
Showing
9 changed files
with
70 additions
and
28 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
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 |
---|---|---|
@@ -1,26 +1,18 @@ | ||
/*using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Core.Capabilities; | ||
using SessionsLibrary; | ||
|
||
namespace Sessions; | ||
|
||
public class SessionsPlayer : ISessions | ||
public partial class Sessions | ||
{ | ||
private readonly PlayerSQL? _player; | ||
public static PlayerCapability<ISessionsPlayer> Capability_Player { get; } = new("sessions:player"); | ||
} | ||
|
||
public SessionsPlayer(CCSPlayerController player) | ||
{ | ||
_player = new PlayerSQL | ||
{ | ||
Id = 1, | ||
FirstSeen = DateTime.Now, | ||
LastSeen = DateTime.Now, | ||
Session = new SessionSQL | ||
{ | ||
Id = 1 | ||
} | ||
}; | ||
} | ||
public class SessionsPlayer(CCSPlayerController player, Sessions plugin) : ISessionsPlayer | ||
{ | ||
private readonly PlayerSQL? _player = plugin._players.TryGetValue(player.Slot, out PlayerSQL? value) ? value : null; | ||
|
||
public PlayerSQL? Player => _player; | ||
} | ||
*/ | ||
public PlayerSQL? PlayerSQL => _player; | ||
public SessionSQL? SessionSQL => _player?.Session; | ||
} |
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
Binary file not shown.
Binary file not shown.
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,25 @@ | ||
using CounterStrikeSharp.API; | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Core.Capabilities; | ||
using SessionsLibrary; | ||
|
||
namespace TestPlugin; | ||
|
||
public class TestPlugin : BasePlugin | ||
{ | ||
public override string ModuleName => "TestPlugin"; | ||
public override string ModuleVersion => "1.0.0"; | ||
|
||
public static PlayerCapability<ISessionsPlayer> Capability_Player { get; } = new("sessions:player"); | ||
|
||
public override void Load(bool isReload) | ||
{ | ||
foreach (CCSPlayerController player in Utilities.GetPlayers()) | ||
{ | ||
var temp = Capability_Player.Get(player); | ||
var temp2 = temp.SessionSQL; | ||
|
||
Console.WriteLine(temp2.Id); | ||
} | ||
} | ||
} |
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 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CounterStrikeSharp.API" Version="*" ExcludeAssets="runtime" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="SessionsLibrary"> | ||
<HintPath>..\SessionsLibrary\obj\Debug\net8.0\SessionsLibrary.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
</Project> |