diff --git a/src/AltV.Atlas.Peds.csproj b/src/AltV.Atlas.Peds.csproj index 2305e65..ca5a3f2 100644 --- a/src/AltV.Atlas.Peds.csproj +++ b/src/AltV.Atlas.Peds.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.3.0 + 2.4.0 GPL-3.0-or-later README.md https://github.com/altv-atlas/Peds.git diff --git a/src/Base/AtlasPed.cs b/src/Base/AtlasPed.cs index f717609..4a7cf32 100644 --- a/src/Base/AtlasPed.cs +++ b/src/Base/AtlasPed.cs @@ -22,10 +22,9 @@ namespace AltV.Atlas.Peds.Base; public class AtlasPed : AsyncPed, IAtlasServerPed { private readonly ILogger _logger; - - private readonly JsonTypeConverter pedTaskJsonConverter = new(); - + private readonly JsonTypeConverter _pedTaskJsonConverter = new(); private IPedTask? _currentTask; + /// /// The current ped task /// @@ -36,12 +35,12 @@ private set _currentTask = value; if( _currentTask is null ) - DeleteStreamSyncedMetaData( "atlas:peds:currentTask" ); + DeleteStreamSyncedMetaData( PedConstants.CurrentTaskMetaKey ); else { - var json = JsonSerializer.Serialize( _currentTask, JsonOptions.WithConverters( pedTaskJsonConverter ) ); - _logger.LogInformation( "converted to json: {Json}", json ); - SetStreamSyncedMetaData( "atlas:peds:currentTask", json ); + var json = JsonSerializer.Serialize( _currentTask, JsonOptions.WithConverters( _pedTaskJsonConverter ) ); + _logger.LogTrace( "converted to json: {Json}", json ); + SetStreamSyncedMetaData( PedConstants.CurrentTaskMetaKey, json ); } } } @@ -131,7 +130,7 @@ private void OnNetworkOwnerChange( IEntity target, IPlayer? oldNetOwner, IPlayer /// pedTask for the task public void SetPedTask( T pedTask ) where T : class, IPedTask { - _logger.LogInformation( "SetPedTask {PedTask}", typeof(T) ); + _logger.LogTrace( "SetPedTask {PedTask}", typeof(T) ); OnTaskChange?.Invoke( CurrentTask, pedTask ); CurrentTask = pedTask; } diff --git a/src/PedModule.cs b/src/PedModule.cs index 07a31f0..7f1e4db 100644 --- a/src/PedModule.cs +++ b/src/PedModule.cs @@ -22,7 +22,7 @@ public static class PedModule /// The service collection public static IServiceCollection RegisterPedModule( this IServiceCollection serviceCollection ) { - Alt.Log( "[ATLAS] Ped Module Registered!" ); + Console.WriteLine( "[ATLAS] Ped Module Registered!" ); serviceCollection.AddTransient( ); serviceCollection.AddTransient( ); serviceCollection.AddTransient( );