mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
TelepathyTransport - switches (#221)
This commit is contained in:
parent
52d6792f73
commit
b96c92c0de
@ -30,16 +30,23 @@ public virtual bool ClientGetNextMessage(out TransportEvent transportEvent, out
|
||||
{
|
||||
Telepathy.Message message;
|
||||
if (client.GetNextMessage(out message))
|
||||
{
|
||||
switch (message.eventType)
|
||||
{
|
||||
// convert Telepathy EventType to TransportEvent
|
||||
if (message.eventType == Telepathy.EventType.Connected)
|
||||
case Telepathy.EventType.Connected:
|
||||
transportEvent = TransportEvent.Connected;
|
||||
else if (message.eventType == Telepathy.EventType.Data)
|
||||
break;
|
||||
case Telepathy.EventType.Data:
|
||||
transportEvent = TransportEvent.Data;
|
||||
else if (message.eventType == Telepathy.EventType.Disconnected)
|
||||
break;
|
||||
case Telepathy.EventType.Disconnected:
|
||||
transportEvent = TransportEvent.Disconnected;
|
||||
else
|
||||
break;
|
||||
default:
|
||||
transportEvent = TransportEvent.Disconnected;
|
||||
break;
|
||||
}
|
||||
|
||||
// assign rest of the values and return true
|
||||
data = message.data;
|
||||
@ -64,16 +71,23 @@ public virtual bool ServerGetNextMessage(out int connectionId, out TransportEven
|
||||
{
|
||||
Telepathy.Message message;
|
||||
if (server.GetNextMessage(out message))
|
||||
{
|
||||
switch (message.eventType)
|
||||
{
|
||||
// convert Telepathy EventType to TransportEvent
|
||||
if (message.eventType == Telepathy.EventType.Connected)
|
||||
case Telepathy.EventType.Connected:
|
||||
transportEvent = TransportEvent.Connected;
|
||||
else if (message.eventType == Telepathy.EventType.Data)
|
||||
break;
|
||||
case Telepathy.EventType.Data:
|
||||
transportEvent = TransportEvent.Data;
|
||||
else if (message.eventType == Telepathy.EventType.Disconnected)
|
||||
break;
|
||||
case Telepathy.EventType.Disconnected:
|
||||
transportEvent = TransportEvent.Disconnected;
|
||||
else
|
||||
break;
|
||||
default:
|
||||
transportEvent = TransportEvent.Disconnected;
|
||||
break;
|
||||
}
|
||||
|
||||
// assign rest of the values and return true
|
||||
connectionId = message.connectionId;
|
||||
|
Loading…
Reference in New Issue
Block a user