Add C# transport-aware server listeners
This commit is contained in:
parent
2355617eca
commit
2453e44f11
7 changed files with 103 additions and 66 deletions
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using LiteNetLib;
|
||||
|
||||
namespace GameCult.Networking
|
||||
{
|
||||
|
|
@ -12,7 +11,7 @@ namespace GameCult.Networking
|
|||
{
|
||||
private readonly Server _server;
|
||||
private readonly CultNetSimulationObservationHub _hub;
|
||||
private readonly Func<CultNetSimulationObservationMessage, NetPeer, Task> _observationHandler;
|
||||
private readonly Func<CultNetSimulationObservationMessage, CultNetServerPeer, Task> _observationHandler;
|
||||
private bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -59,11 +58,6 @@ namespace GameCult.Networking
|
|||
_server.RemoveCultNetMessageListener<CultNetSimulationObservationMessage>(_observationHandler);
|
||||
}
|
||||
|
||||
private Task HandleObservationAsync(CultNetSimulationObservationMessage message, NetPeer peer)
|
||||
{
|
||||
return HandleObservationAsync(message, _server.GetPeerContext(peer));
|
||||
}
|
||||
|
||||
private Task HandleObservationAsync(CultNetSimulationObservationMessage message, CultNetServerPeer peer)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
Loading…
Reference in a new issue