Skip to content

Commit a832a9e

Browse files
committed
clrcore: update using to static CitizenFX.Core.Native.API
1 parent e860e6c commit a832a9e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

code/client/clrcore/Server/ServerWrappers.cs

+12-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Linq;
5-
using CitizenFX.Core.Native;
5+
6+
using static CitizenFX.Core.Native.API;
67

78
namespace CitizenFX.Core
89
{
@@ -22,19 +23,19 @@ internal Player(string sourceString)
2223
m_handle = sourceString;
2324
}
2425

25-
public string Name => API.GetPlayerName(m_handle);
26+
public string Name => GetPlayerName(m_handle);
2627

27-
public int Ping => API.GetPlayerPing(m_handle);
28+
public int Ping => GetPlayerPing(m_handle);
2829

29-
public int LastMsg => API.GetPlayerLastMsg(m_handle);
30+
public int LastMsg => GetPlayerLastMsg(m_handle);
3031

3132
public IdentifierCollection Identifiers => new IdentifierCollection(this);
3233

33-
public string EndPoint => API.GetPlayerEndpoint(m_handle);
34+
public string EndPoint => GetPlayerEndpoint(m_handle);
3435

3536
public Ped Character => Ped.FromPlayerHandle(m_handle);
3637

37-
public void Drop(string reason) => API.DropPlayer(m_handle, reason);
38+
public void Drop(string reason) => DropPlayer(m_handle, reason);
3839

3940
public void TriggerEvent(string eventName, params object[] args)
4041
{
@@ -44,7 +45,7 @@ public void TriggerEvent(string eventName, params object[] args)
4445
{
4546
fixed (byte* serialized = &argsSerialized[0])
4647
{
47-
API.TriggerClientEventInternal(eventName, m_handle, serialized, argsSerialized.Length);
48+
TriggerClientEventInternal(eventName, m_handle, serialized, argsSerialized.Length);
4849
}
4950
}
5051
}
@@ -91,11 +92,11 @@ internal IdentifierCollection(Player player)
9192

9293
public IEnumerator<string> GetEnumerator()
9394
{
94-
int numIndices = API.GetNumPlayerIdentifiers(m_player.Handle);
95+
int numIndices = GetNumPlayerIdentifiers(m_player.Handle);
9596

9697
for (var i = 0; i < numIndices; i++)
9798
{
98-
yield return API.GetPlayerIdentifier(m_player.Handle, i);
99+
yield return GetPlayerIdentifier(m_player.Handle, i);
99100
}
100101
}
101102

@@ -119,11 +120,11 @@ public class PlayerList : IEnumerable<Player>
119120
{
120121
public IEnumerator<Player> GetEnumerator()
121122
{
122-
int numIndices = API.GetNumPlayerIndices();
123+
int numIndices = GetNumPlayerIndices();
123124

124125
for (var i = 0; i < numIndices; i++)
125126
{
126-
yield return new Player(API.GetPlayerFromIndex(i));
127+
yield return new Player(GetPlayerFromIndex(i));
127128
}
128129
}
129130

0 commit comments

Comments
 (0)