mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-13 21:34:43 +01:00
Init enter game
This commit is contained in:
27
KcpSharp/Base/KcpConversationUpdateNotification.cs
Normal file
27
KcpSharp/Base/KcpConversationUpdateNotification.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace KianaBH.KcpSharp.Base;
|
||||
|
||||
internal readonly struct KcpConversationUpdateNotification : IDisposable
|
||||
{
|
||||
private readonly IKcpConversationUpdateNotificationSource? _source;
|
||||
private readonly bool _skipTimerNotification;
|
||||
|
||||
public ReadOnlyMemory<byte> Packet => _source?.Packet ?? default;
|
||||
public bool TimerNotification => !_skipTimerNotification;
|
||||
|
||||
public KcpConversationUpdateNotification(IKcpConversationUpdateNotificationSource? source,
|
||||
bool skipTimerNotification)
|
||||
{
|
||||
_source = source;
|
||||
_skipTimerNotification = skipTimerNotification;
|
||||
}
|
||||
|
||||
public KcpConversationUpdateNotification WithTimerNotification(bool timerNotification)
|
||||
{
|
||||
return new KcpConversationUpdateNotification(_source, !_skipTimerNotification | timerNotification);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_source is not null) _source.Release();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user