-
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
63 changed files
with
649 additions
and
561 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
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
2 changes: 1 addition & 1 deletion
2
GangsAPI/Services/IGangManager.cs → GangsAPI/Services/Gang/IGangManager.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
2 changes: 1 addition & 1 deletion
2
GangsAPI/Services/IPlayerManager.cs → GangsAPI/Services/Player/IPlayerManager.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
20 changes: 4 additions & 16 deletions
20
GangsAPI/Services/IPlayerStatManager.cs → ...API/Services/Player/IPlayerStatManager.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
using GangsAPI.Data.Gang; | ||
using GangsAPI.Services; | ||
using GangsAPI.Services.Player; | ||
|
||
namespace Mock; | ||
|
||
|
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,55 @@ | ||
using System.Data.Common; | ||
using GangsAPI; | ||
using GangsAPI.Services; | ||
using GangsAPI.Services.Gang; | ||
using GangsAPI.Services.Player; | ||
using GenericDB; | ||
using MySqlConnector; | ||
|
||
namespace SQLImpl; | ||
|
||
public class SQLGangInstanceManager(string connectionString, | ||
string table_prefix, bool testing = false) | ||
: AbstractInstanceManager<int>(connectionString, table_prefix, testing), | ||
IPluginBehavior, IGangStatManager { | ||
override protected string PrimaryKey => "GangId"; | ||
|
||
public Task<(bool, TV?)> GetForGang<TV>(int key, string statId) { | ||
return Get<TV>(key, statId); | ||
} | ||
|
||
public Task<bool> SetForGang<TV>(int gangId, string statId, TV value) { | ||
return Set(gangId, statId, value); | ||
} | ||
|
||
public Task<bool> RemoveFromGang(int gangId, string statId) { | ||
return Remove(gangId, statId); | ||
} | ||
|
||
override protected DbConnection CreateDbConnection(string connectionString) { | ||
return new MySqlConnection(connectionString); | ||
} | ||
} | ||
|
||
public class SQLPlayerInstanceManager(string connectionString, | ||
string table_prefix, bool testing = false) | ||
: AbstractInstanceManager<ulong>(connectionString, table_prefix, testing), | ||
IPlayerStatManager { | ||
override protected string PrimaryKey => "GangId"; | ||
|
||
public Task<(bool, TV?)> GetForPlayer<TV>(ulong steam, string statId) { | ||
return Get<TV>(steam, statId); | ||
} | ||
|
||
public Task<bool> SetForPlayer<TV>(ulong steam, string statId, TV value) { | ||
return Set(steam, statId, value); | ||
} | ||
|
||
public Task<bool> RemoveFromPlayer(ulong steam, string statId) { | ||
return Remove(steam, statId); | ||
} | ||
|
||
override protected DbConnection CreateDbConnection(string connectionString) { | ||
return new MySqlConnection(connectionString); | ||
} | ||
} |
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.