forked from FabianTerhorst/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ISharedCore.cs
142 lines (86 loc) · 3.97 KB
/
ISharedCore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
using System.Numerics;
using AltV.Net.CApi;
using AltV.Net.Data;
using AltV.Net.Elements.Args;
using AltV.Net.Elements.Entities;
using AltV.Net.Shared.Elements.Entities;
using AltV.Net.Shared.Events;
namespace AltV.Net.Shared
{
public interface ISharedCore : ICApiCore
{
IList<ushort> UnansweredServerRpcRequest { get; }
IList<ushort> UnansweredClientRpcRequest { get; }
ISharedPoolManager PoolManager { get; }
EventStateManager EventStateManager { get; }
ISharedNativeResource Resource { get; }
ISharedBaseObject GetBaseObjectById(BaseObjectType type, uint id);
IntPtr NativePointer { get; }
string SdkVersion { get; }
string CApiVersion { get; }
string Version { get; }
string Branch { get; }
bool IsDebug { get; }
void LogInfo(string message);
uint Hash(string hash);
/// <summary>
/// Do NOT use unless you know what you are doing
/// </summary>
void LogDebug(string message);
void LogWarning(string message);
void LogError(string message);
void LogColored(string message);
void LogInfo(IntPtr message);
/// <summary>
/// Do NOT use unless you know what you are doing
/// </summary>
void LogDebug(IntPtr message);
void LogWarning(IntPtr message);
void LogError(IntPtr message);
void LogColored(IntPtr message);
bool IsMainThread();
string PtrToStringUtf8AndFree(nint str, int size);
#region MValueAdapters
void RegisterMValueAdapter<T>(IMValueAdapter<T> adapter);
bool ToMValue(object obj, Type type, out MValueConst mValue);
bool FromMValue(in MValueConst mValue, Type type, out object obj);
bool MValueFromObject(object obj, Type type, out object result);
bool IsMValueConvertible(Type type);
#endregion
#region MValues
void CreateMValueNil(out MValueConst mValue);
void CreateMValueBool(out MValueConst mValue, bool value);
void CreateMValueInt(out MValueConst mValue, long value);
void CreateMValueUInt(out MValueConst mValue, ulong value);
void CreateMValueDouble(out MValueConst mValue, double value);
void CreateMValueString(out MValueConst mValue, string value);
void CreateMValueList(out MValueConst mValue, MValueConst[] val, ulong size);
void CreateMValueDict(out MValueConst mValue, string[] keys, MValueConst[] val,
ulong size);
void CreateMValueBaseObject(out MValueConst mValue, ISharedBaseObject value);
void CreateMValueFunction(out MValueConst mValue, IntPtr value);
void CreateMValueVector3(out MValueConst mValue, Position value);
void CreateMValueVector2(out MValueConst mValue, Vector2 value);
void CreateMValueRgba(out MValueConst mValue, Rgba value);
void CreateMValueByteArray(out MValueConst mValue, byte[] value);
void CreateMValue(out MValueConst mValue, object obj);
void CreateMValues(MValueConst[] mValues, object[] objects);
#endregion
void SetMetaData(string key, object value);
bool HasMetaData(string key);
void DeleteMetaData(string key);
void GetMetaData(string key, out MValueConst value);
bool HasSyncedMetaData(string key);
void GetSyncedMetaData(string key, out MValueConst value);
#region TriggerLocalEvent
void TriggerLocalEvent(string eventName, MValueConst[] args);
void TriggerLocalEvent(IntPtr eventNamePtr, MValueConst[] args);
void TriggerLocalEvent(string eventName, IntPtr[] args);
void TriggerLocalEvent(IntPtr eventNamePtr, IntPtr[] args);
void TriggerLocalEvent(IntPtr eventNamePtr, params object[] args);
void TriggerLocalEvent(string eventName, params object[] args);
#endregion
VoiceConnectionState GetVoiceConnectionState();
int NetTime { get; }
}
}