-
Notifications
You must be signed in to change notification settings - Fork 0
/
NetworkContext.cs
32 lines (29 loc) · 980 Bytes
/
NetworkContext.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
namespace Jonathon594.SimpleTCP
{
/// <summary>
/// A class holding contextual information for use in <see cref="Packet.Handle(NetworkContext, NetworkDirection)"/>.
/// </summary>
public class NetworkContext
{
private ServerClient clientSender;
private Server server;
/// <summary>
/// The <see cref="ServerClient"/> who sent the packet.
/// </summary>
public ServerClient ClientSender { get => clientSender; set => clientSender = value; }
/// <summary>
/// The <see cref="Server"/> the packet was recieved on.
/// </summary>
public Server Server { get => server; set => server = value; }
internal NetworkContext(ServerClient serverClient, Server server)
{
ClientSender = serverClient;
Server = server;
}
internal NetworkContext()
{
ClientSender = null;
server = null;
}
}
}