-
Notifications
You must be signed in to change notification settings - Fork 2
/
MessageInitClient.cs
45 lines (36 loc) · 1.1 KB
/
MessageInitClient.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
using PtxUtils;
namespace Paranext.DataProvider.Messages;
/// <summary>
/// Message sent to the client to give it NetworkConnectorInfo
/// </summary>
public sealed class MessageInitClient : Message
{
public sealed class NetworkConnectorInfo
{
public const int CLIENT_ID_UNSET = -1;
/// <summary>
/// ONLY FOR DESERIALIZATION
/// </summary>
private NetworkConnectorInfo()
{
}
public NetworkConnectorInfo(int clientId)
{
ClientId = clientId;
}
public int ClientId { get; set; } = CLIENT_ID_UNSET;
}
/// <summary>
/// ONLY FOR DESERIALIZATION
/// </summary>
private MessageInitClient() : base(UNKNOWN_SENDER_ID)
{
ConnectorInfo = new NetworkConnectorInfo(NetworkConnectorInfo.CLIENT_ID_UNSET);
}
public MessageInitClient(int senderId, NetworkConnectorInfo connectorInfo) : base(senderId)
{
ConnectorInfo = connectorInfo;
}
public override Enum<MessageType> Type => MessageType.InitClient;
public NetworkConnectorInfo ConnectorInfo { get; set; }
}