[Feat] Респект и уважуха (#476)

* db

* wd comment

* manager & commands

* system & round end results

* raise ban event

* client manager & cached values

* role pick tweak

* tweak last commit

* more fixes

* weights fix

* Fix for short rounds

* tweak in cached dictionary

* reva pick system

* fix last commit

* cult role pick

* nukeops role picking

* fix cache in async & show command

* ooc msg show value

* move pick method to manager & traitor pick fix
This commit is contained in:
HitPanda
2023-10-08 15:53:28 +03:00
committed by Aviu00
parent a29e004eba
commit 7c9bd1d934
37 changed files with 3752 additions and 25 deletions

View File

@@ -281,6 +281,31 @@ namespace Content.Server.Database
Task MarkMessageAsSeen(int id);
#endregion
#region Player Reputation (WD edit)
/// <summary>
/// Set player's reputation to the certain value.
/// </summary>
/// <param name="player">Guid of the player to set the value.</param>
/// <param name="value">Value to set.</param>
Task SetPlayerReputation(Guid player, float value);
/// <summary>
/// Modify player's reputation by adding value (currentValue + value).
/// </summary>
/// <param name="player">Guid of the player to modify the value.</param>
/// <param name="value">Value to add.</param>
Task ModifyPlayerReputation(Guid player, float value);
/// <summary>
/// Gets value of player reputation.
/// </summary>
/// <param name="player">Guid of the player to get the value.</param>
/// <returns>Value of player's reputation.</returns>
Task<float> GetPlayerReputation(Guid player);
#endregion
}
public sealed class ServerDbManager : IServerDbManager
@@ -502,6 +527,28 @@ namespace Content.Server.Database
#endregion
#region Player Reputation (WD edit)
public Task SetPlayerReputation(Guid player, float value)
{
DbWriteOpsMetric.Inc();
return RunDbCommand(() => _db.SetPlayerReputation(player, value));
}
public Task ModifyPlayerReputation(Guid player, float value)
{
DbWriteOpsMetric.Inc();
return RunDbCommand(() => _db.ModifyPlayerReputation(player, value));
}
public Task<float> GetPlayerReputation(Guid player)
{
DbWriteOpsMetric.Inc();
return RunDbCommand(() => _db.GetPlayerReputation(player));
}
#endregion
public Task UpdatePlayerRecordAsync(
NetUserId userId,
string userName,