44using System . Threading . Tasks ;
55using Microsoft . EntityFrameworkCore ;
66using Microsoft . Extensions . Configuration ;
7- using Microsoft . Extensions . Logging ;
87using Orleans ;
98using Turbo . Database . Context ;
109using Turbo . Logging ;
@@ -21,21 +20,18 @@ internal sealed class PlayerGrain : Grain, IPlayerGrain
2120{
2221 private readonly IDbContextFactory < TurboDbContext > _dbCtxFactory ;
2322 private readonly IGrainFactory _grainFactory ;
24- private readonly ILogger < PlayerGrain > _logger ;
2523 private readonly IConfiguration _configuration ;
2624
2725 private readonly PlayerLiveState _state ;
2826
2927 public PlayerGrain (
3028 IDbContextFactory < TurboDbContext > dbCtxFactory ,
3129 IGrainFactory grainFactory ,
32- ILogger < PlayerGrain > logger ,
3330 IConfiguration configuration
3431 )
3532 {
3633 _dbCtxFactory = dbCtxFactory ;
3734 _grainFactory = grainFactory ;
38- _logger = logger ;
3935 _configuration = configuration ;
4036
4137 _state = new ( ) { PlayerId = PlayerId . Parse ( ( int ) this . GetPrimaryKeyLong ( ) ) } ;
@@ -189,13 +185,6 @@ public async Task<int> ReceiveRespectAsync(PlayerId giverId, CancellationToken c
189185 _state . RespectTotal ++ ;
190186 await WriteToDatabaseAsync ( ct ) ;
191187
192- _logger . LogDebug (
193- "Player {PlayerId} received respect from {GiverId}. Total: {Total}" ,
194- _state . PlayerId ,
195- giverId ,
196- _state . RespectTotal
197- ) ;
198-
199188 return _state . RespectTotal ;
200189 }
201190
@@ -222,13 +211,6 @@ public async Task<bool> TryReplenishRespectAsync(int maxRespectPerDay, Cancellat
222211 _state . RespectLeft = maxRespectPerDay ;
223212 await WriteToDatabaseAsync ( ct ) ;
224213
225- _logger . LogDebug (
226- "Player {PlayerId} replenished respect. RespectLeft: {Left}, ReplenishesLeft: {Replenishes}" ,
227- _state . PlayerId ,
228- _state . RespectLeft ,
229- _state . RespectReplenishesLeft
230- ) ;
231-
232214 return true ;
233215 }
234216
@@ -263,13 +245,5 @@ private async Task TryResetDailyRespectIfNeededAsync(CancellationToken ct)
263245 var dailyReplenish = _configuration . GetValue ( "Turbo:Respect:DailyReplenishLimit" , 1 ) ;
264246
265247 await ResetDailyRespectAsync ( dailyRespect , dailyPetRespect , dailyReplenish , ct ) ;
266-
267- _logger . LogDebug (
268- "Player {PlayerId} daily respect reset. Respect: {Respect}, PetRespect: {PetRespect}, Replenishes: {Replenishes}" ,
269- _state . PlayerId ,
270- dailyRespect ,
271- dailyPetRespect ,
272- dailyReplenish
273- ) ;
274248 }
275249}
0 commit comments