forked from altmp/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetworkLayer.cs
40 lines (33 loc) · 1.92 KB
/
NetworkLayer.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
using AltV.Net.EntitySync.Events;
namespace AltV.Net.EntitySync
{
/// <summary>
/// The Network layer transfers network events to the application layer
/// The Network layer transfers application events to the network layer
/// </summary>
public abstract class NetworkLayer
{
public abstract event ConnectionConnectEventDelegate OnConnectionConnect;
public abstract event ConnectionDisconnectEventDelegate OnConnectionDisconnect;
public abstract event ClientSubscribeEntityDelegate OnClientSubscribeEntity;
public abstract event ClientUnsubscribeEntityDelegate OnClientUnsubscribeEntity;
public abstract event EntityCreateEventDelegate OnEntityCreate;
public abstract event EntityRemoveEventDelegate OnEntityRemove;
public abstract event EntityPositionUpdateEventDelegate OnEntityPositionUpdate;
public abstract event EntityDataUpdateEventDelegate OnEntityDataUpdate;
public abstract event EntityNetOwnerUpdateEventDelegate OnEntityNetOwnerUpdate;
public readonly ulong ThreadCount;
public IClientRepository ClientRepository;
public NetworkLayer(ulong threadCount, IClientRepository clientRepository)
{
this.ThreadCount = threadCount;
this.ClientRepository = clientRepository;
}
public abstract void SendEvent(IClient client, in EntityCreateEvent entityCreate);
public abstract void SendEvent(IClient client, in EntityRemoveEvent entityRemove);
public abstract void SendEvent(IClient client, in EntityPositionUpdateEvent entityPositionUpdate);
public abstract void SendEvent(IClient client, in EntityDataChangeEvent entityDataChange);
public abstract void SendEvent(IClient client, in EntityClearCacheEvent entityClearCache);
public abstract void SendEvent(IClient client, in EntityNetOwnerChangeEvent entityNetOwnerChange);
}
}