Skip to content

Commit

Permalink
Fix alt.log issue. update to meta key const
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDutchDev committed Dec 1, 2023
1 parent 3bfc5ae commit c09a9c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/AltV.Atlas.Peds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.3.0</Version>
<Version>2.4.0</Version>
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/altv-atlas/Peds.git</RepositoryUrl>
Expand Down
15 changes: 7 additions & 8 deletions src/Base/AtlasPed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ namespace AltV.Atlas.Peds.Base;
public class AtlasPed : AsyncPed, IAtlasServerPed
{
private readonly ILogger<AtlasPed> _logger;

private readonly JsonTypeConverter<IPedTask> pedTaskJsonConverter = new();

private readonly JsonTypeConverter<IPedTask> _pedTaskJsonConverter = new();
private IPedTask? _currentTask;

/// <summary>
/// The current ped task
/// </summary>
Expand All @@ -36,12 +35,12 @@ private set
_currentTask = value;

if( _currentTask is null )
DeleteStreamSyncedMetaData( "atlas:peds:currentTask" );
DeleteStreamSyncedMetaData( PedConstants.CurrentTaskMetaKey );

Check failure on line 38 in src/Base/AtlasPed.cs

View workflow job for this annotation

GitHub Actions / create_nuget

The name 'PedConstants' does not exist in the current context
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 );

Check failure on line 43 in src/Base/AtlasPed.cs

View workflow job for this annotation

GitHub Actions / create_nuget

The name 'PedConstants' does not exist in the current context
}
}
}
Expand Down Expand Up @@ -131,7 +130,7 @@ private void OnNetworkOwnerChange( IEntity target, IPlayer? oldNetOwner, IPlayer
/// <param name="pedTask">pedTask for the task</param>
public void SetPedTask<T>( T pedTask ) where T : class, IPedTask
{
_logger.LogInformation( "SetPedTask {PedTask}", typeof(T) );
_logger.LogTrace( "SetPedTask {PedTask}", typeof(T) );
OnTaskChange?.Invoke( CurrentTask, pedTask );
CurrentTask = pedTask;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PedModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class PedModule
/// <returns>The service collection</returns>
public static IServiceCollection RegisterPedModule( this IServiceCollection serviceCollection )
{
Alt.Log( "[ATLAS] Ped Module Registered!" );
Console.WriteLine( "[ATLAS] Ped Module Registered!" );
serviceCollection.AddTransient<IAtlasServerPed, AtlasPed>( );
serviceCollection.AddTransient<AtlasPedFactory>( );
serviceCollection.AddTransient<IPed, AsyncPed>( );
Expand Down

0 comments on commit c09a9c5

Please sign in to comment.