Out with MagicOnion, in with LiteNetLib
Removed MagicOnion Added LiteNetLib Created client and server abstractions Fixed serialization bugs
This commit is contained in:
parent
433a7b4ae4
commit
e96146b7bb
869 changed files with 59401 additions and 16812 deletions
31
Assets/Scripts/ServerShared/NIH/LiteNetLib/BaseChannel.cs
Normal file
31
Assets/Scripts/ServerShared/NIH/LiteNetLib/BaseChannel.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace LiteNetLib
|
||||
{
|
||||
internal abstract class BaseChannel
|
||||
{
|
||||
public BaseChannel Next;
|
||||
protected readonly NetPeer Peer;
|
||||
protected readonly Queue<NetPacket> OutgoingQueue;
|
||||
|
||||
protected BaseChannel(NetPeer peer)
|
||||
{
|
||||
Peer = peer;
|
||||
OutgoingQueue = new Queue<NetPacket>(64);
|
||||
}
|
||||
|
||||
public int PacketsInQueue
|
||||
{
|
||||
get { return OutgoingQueue.Count; }
|
||||
}
|
||||
|
||||
public void AddToQueue(NetPacket packet)
|
||||
{
|
||||
lock (OutgoingQueue)
|
||||
OutgoingQueue.Enqueue(packet);
|
||||
}
|
||||
|
||||
public abstract void SendNextPackets();
|
||||
public abstract bool ProcessPacket(NetPacket packet);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue