KcpClient/Server: change callbacks to protected so inheriting classes can use them too

This commit is contained in:
vis2k 2023-03-19 11:27:56 +08:00
parent 660b57ecb7
commit dd50a43b9b
2 changed files with 8 additions and 8 deletions

View File

@ -35,10 +35,10 @@ public class KcpClient
// events are readonly, set in constructor.
// this ensures they are always initialized when used.
// fixes https://github.com/MirrorNetworking/Mirror/issues/3337 and more
readonly Action OnConnected;
readonly Action<ArraySegment<byte>, KcpChannel> OnData;
readonly Action OnDisconnected;
readonly Action<ErrorCode, string> OnError;
protected readonly Action OnConnected;
protected readonly Action<ArraySegment<byte>, KcpChannel> OnData;
protected readonly Action OnDisconnected;
protected readonly Action<ErrorCode, string> OnError;
// state
public bool connected;

View File

@ -18,10 +18,10 @@ public class KcpServer
// events are readonly, set in constructor.
// this ensures they are always initialized when used.
// fixes https://github.com/MirrorNetworking/Mirror/issues/3337 and more
readonly Action<int> OnConnected;
readonly Action<int, ArraySegment<byte>, KcpChannel> OnData;
readonly Action<int> OnDisconnected;
readonly Action<int, ErrorCode, string> OnError;
protected readonly Action<int> OnConnected;
protected readonly Action<int, ArraySegment<byte>, KcpChannel> OnData;
protected readonly Action<int> OnDisconnected;
protected readonly Action<int, ErrorCode, string> OnError;
// configuration
readonly KcpConfig config;