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
@ -31,15 +31,22 @@ public virtual bool ClientGetNextMessage(out TransportEvent transportEvent, out
|
|||||||
Telepathy.Message message;
|
Telepathy.Message message;
|
||||||
if (client.GetNextMessage(out message))
|
if (client.GetNextMessage(out message))
|
||||||
{
|
{
|
||||||
// convert Telepathy EventType to TransportEvent
|
switch (message.eventType)
|
||||||
if (message.eventType == Telepathy.EventType.Connected)
|
{
|
||||||
transportEvent = TransportEvent.Connected;
|
// convert Telepathy EventType to TransportEvent
|
||||||
else if (message.eventType == Telepathy.EventType.Data)
|
case Telepathy.EventType.Connected:
|
||||||
transportEvent = TransportEvent.Data;
|
transportEvent = TransportEvent.Connected;
|
||||||
else if (message.eventType == Telepathy.EventType.Disconnected)
|
break;
|
||||||
transportEvent = TransportEvent.Disconnected;
|
case Telepathy.EventType.Data:
|
||||||
else
|
transportEvent = TransportEvent.Data;
|
||||||
transportEvent = TransportEvent.Disconnected;
|
break;
|
||||||
|
case Telepathy.EventType.Disconnected:
|
||||||
|
transportEvent = TransportEvent.Disconnected;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
transportEvent = TransportEvent.Disconnected;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// assign rest of the values and return true
|
// assign rest of the values and return true
|
||||||
data = message.data;
|
data = message.data;
|
||||||
@ -65,15 +72,22 @@ public virtual bool ServerGetNextMessage(out int connectionId, out TransportEven
|
|||||||
Telepathy.Message message;
|
Telepathy.Message message;
|
||||||
if (server.GetNextMessage(out message))
|
if (server.GetNextMessage(out message))
|
||||||
{
|
{
|
||||||
// convert Telepathy EventType to TransportEvent
|
switch (message.eventType)
|
||||||
if (message.eventType == Telepathy.EventType.Connected)
|
{
|
||||||
transportEvent = TransportEvent.Connected;
|
// convert Telepathy EventType to TransportEvent
|
||||||
else if (message.eventType == Telepathy.EventType.Data)
|
case Telepathy.EventType.Connected:
|
||||||
transportEvent = TransportEvent.Data;
|
transportEvent = TransportEvent.Connected;
|
||||||
else if (message.eventType == Telepathy.EventType.Disconnected)
|
break;
|
||||||
transportEvent = TransportEvent.Disconnected;
|
case Telepathy.EventType.Data:
|
||||||
else
|
transportEvent = TransportEvent.Data;
|
||||||
transportEvent = TransportEvent.Disconnected;
|
break;
|
||||||
|
case Telepathy.EventType.Disconnected:
|
||||||
|
transportEvent = TransportEvent.Disconnected;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
transportEvent = TransportEvent.Disconnected;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// assign rest of the values and return true
|
// assign rest of the values and return true
|
||||||
connectionId = message.connectionId;
|
connectionId = message.connectionId;
|
||||||
|
Loading…
Reference in New Issue
Block a user