Skip to content

Commit

Permalink
feat(shared): make baseobject SyncedMetaData obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Dec 20, 2023
1 parent 1552a52 commit f3b3897
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/AltV.Net.Shared/Elements/Entities/ISharedBaseObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public interface ISharedBaseObject : INative
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
/// <returns></returns>
[Obsolete]
bool HasSyncedMetaData(string key);

/// <summary>
Expand All @@ -145,6 +146,7 @@ public interface ISharedBaseObject : INative
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
/// <param name="result"></param>
[Obsolete]
bool GetSyncedMetaData(string key, out int result);

/// <summary>
Expand All @@ -153,6 +155,7 @@ public interface ISharedBaseObject : INative
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
/// <param name="result"></param>
[Obsolete]
bool GetSyncedMetaData(string key, out uint result);

/// <summary>
Expand All @@ -161,6 +164,7 @@ public interface ISharedBaseObject : INative
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
/// <param name="result"></param>
[Obsolete]
bool GetSyncedMetaData(string key, out float result);

/// <summary>
Expand All @@ -169,6 +173,7 @@ public interface ISharedBaseObject : INative
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
/// <param name="value"></param>
[Obsolete]
void GetSyncedMetaData(string key, out MValueConst value);

/// <summary>
Expand All @@ -180,6 +185,7 @@ public interface ISharedBaseObject : INative
/// <typeparam name="T"></typeparam>
/// <returns></returns>
/// <exception cref="EntityRemovedException">This entity was removed</exception>
[Obsolete]
bool GetSyncedMetaData<T>(string key, out T result);
}
}
6 changes: 6 additions & 0 deletions api/AltV.Net.Shared/Elements/Entities/SharedBaseObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ public virtual void SetCached(IntPtr cachedBaseObject)
this.Cached = true;
}

[Obsolete]
public void GetSyncedMetaData(string key, out MValueConst value)
{
CheckIfEntityExists();
Expand All @@ -283,6 +284,7 @@ public void GetSyncedMetaData(string key, out MValueConst value)
}
}

[Obsolete]
public bool GetSyncedMetaData<T>(string key, out T result)
{
CheckIfEntityExists();
Expand All @@ -299,6 +301,7 @@ public bool GetSyncedMetaData<T>(string key, out T result)
return true;
}

[Obsolete]
public bool HasSyncedMetaData(string key)
{
CheckIfEntityExists();
Expand All @@ -311,6 +314,7 @@ public bool HasSyncedMetaData(string key)
}
}

[Obsolete]
public bool GetSyncedMetaData(string key, out int result)
{
CheckIfEntityExists();
Expand All @@ -329,6 +333,7 @@ public bool GetSyncedMetaData(string key, out int result)
return true;
}

[Obsolete]
public bool GetSyncedMetaData(string key, out uint result)
{
CheckIfEntityExists();
Expand All @@ -347,6 +352,7 @@ public bool GetSyncedMetaData(string key, out uint result)
return true;
}

[Obsolete]
public bool GetSyncedMetaData(string key, out float result)
{
CheckIfEntityExists();
Expand Down
4 changes: 4 additions & 0 deletions api/AltV.Net/Elements/Entities/BaseObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public override void CheckIfCallIsValid()
{
}

[Obsolete]
public void SetSyncedMetaData(string key, object value)
{
CheckIfEntityExists();
Expand All @@ -65,6 +66,7 @@ public void SetSyncedMetaData(string key, object value)
mValue.Dispose();
}

[Obsolete]
public void SetSyncedMetaData(Dictionary<string, object> metaData)
{
unsafe
Expand Down Expand Up @@ -93,6 +95,7 @@ public void SetSyncedMetaData(Dictionary<string, object> metaData)
}
}

[Obsolete]
public void SetSyncedMetaData(string key, in MValueConst value)
{
unsafe
Expand All @@ -103,6 +106,7 @@ public void SetSyncedMetaData(string key, in MValueConst value)
}
}

[Obsolete]
public void DeleteSyncedMetaData(string key)
{
unsafe
Expand Down
4 changes: 4 additions & 0 deletions api/AltV.Net/Elements/Entities/IBaseObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ public interface IBaseObject : ISharedBaseObject
/// <param name="key"></param>
/// <param name="value"></param>
/// <exception cref="EntityRemovedException">This entity was removed</exception>
[Obsolete]
void SetSyncedMetaData(string key, object value);

[Obsolete]
void SetSyncedMetaData(Dictionary<string, object> metaData);

/// <summary>
Expand All @@ -27,13 +29,15 @@ public interface IBaseObject : ISharedBaseObject
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
/// <param name="value"></param>
[Obsolete]
void SetSyncedMetaData(string key, in MValueConst value);

/// <summary>
/// Deletes synced meta data from an entity.
/// </summary>
/// <remarks>Synced meta data is accessible across different serverside resources and across all clients.</remarks>
/// <param name="key"></param>
[Obsolete]
void DeleteSyncedMetaData(string key);
}
}

0 comments on commit f3b3897

Please sign in to comment.