mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using QuantumUNET.Messages;
|
|
using QuantumUNET.Transport;
|
|
|
|
namespace QuantumUNET
|
|
{
|
|
internal class QULocalConnectionToClient : QNetworkConnection
|
|
{
|
|
public QULocalConnectionToClient(QLocalClient localClient)
|
|
{
|
|
address = "localClient";
|
|
LocalClient = localClient;
|
|
}
|
|
|
|
public QLocalClient LocalClient { get; }
|
|
|
|
public override bool Send(short msgType, QMessageBase msg)
|
|
{
|
|
LocalClient.InvokeHandlerOnClient(msgType, msg, 0);
|
|
return true;
|
|
}
|
|
|
|
public override bool SendUnreliable(short msgType, QMessageBase msg)
|
|
{
|
|
LocalClient.InvokeHandlerOnClient(msgType, msg, 1);
|
|
return true;
|
|
}
|
|
|
|
public override bool SendByChannel(short msgType, QMessageBase msg, int channelId)
|
|
{
|
|
LocalClient.InvokeHandlerOnClient(msgType, msg, channelId);
|
|
return true;
|
|
}
|
|
|
|
public override bool SendBytes(byte[] bytes, int numBytes, int channelId)
|
|
{
|
|
LocalClient.InvokeBytesOnClient(bytes, channelId);
|
|
return true;
|
|
}
|
|
|
|
public override bool SendWriter(QNetworkWriter writer, int channelId)
|
|
{
|
|
LocalClient.InvokeBytesOnClient(writer.AsArray(), channelId);
|
|
return true;
|
|
}
|
|
}
|
|
} |