-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathINetworkManager.cs
More file actions
45 lines (41 loc) · 1.29 KB
/
INetworkManager.cs
File metadata and controls
45 lines (41 loc) · 1.29 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VRage;
using VRage.Library.Collections;
using VRage.Network;
namespace Torch.API.Managers
{
/// <summary>
/// API for the network intercept.
/// </summary>
public interface INetworkManager : IManager
{
/// <summary>
/// Register a network handler.
/// </summary>
void RegisterNetworkHandler(INetworkHandler handler);
/// <summary>
/// Unregister a network handler.
/// </summary>
/// <returns>true if the handler was unregistered, false if it wasn't registered to begin with</returns>
bool UnregisterNetworkHandler(INetworkHandler handler);
}
/// <summary>
/// Handler for multiplayer network messages.
/// </summary>
public interface INetworkHandler
{
/// <summary>
/// Returns if the handler can process the call site.
/// </summary>
bool CanHandle(CallSite callSite);
/// <summary>
/// Processes a network message.
/// </summary>
/// <returns>true if the message should be discarded</returns>
bool Handle(ulong remoteUserId, CallSite site, BitStream stream, object obj, MyPacket packet);
}
}