-
Notifications
You must be signed in to change notification settings - Fork 0
/
INetMessage.cs
62 lines (41 loc) · 1.32 KB
/
INetMessage.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
// This file is provided under The MIT License as part of SqualiveNetworking.
// Copyright (c) Squalive-Studios
// For additional information please see the included LICENSE.md file or view it on GitHub:
// https://github.com/Squalive/SqualiveNetworking
using SqualiveNetworking.Message.Processor;
using Unity.Collections;
using Unity.Networking.Transport;
namespace SqualiveNetworking
{
public enum SendType
{
None = 0,
Unreliable,
Reliable,
Frag,
}
public struct MessageReceivedArgs
{
public ushort ClientID;
public NetworkConnection Connection;
public ushort MessageID;
public DataStreamReader Stream;
public byte HasProcessorOutput;
public MessageProcessor Processor;
public unsafe void* ProcessorOutputPtr;
}
internal unsafe struct MessageReceivedPtr
{
public MessageReceivedArgs Args;
public void* StreamPtr;
public int Length;
public int BytesRead;
}
public delegate void MessageReceivedCallback( ref MessageReceivedArgs args );
public interface INetMessage
{
void Serialize( ref DataStreamWriter writer );
void Deserialize( ref DataStreamReader reader );
ushort MessageID();
}
}