2020-12-04 22:14:53 +00:00
|
|
|
|
namespace QuantumUNET
|
2020-12-02 18:40:38 +00:00
|
|
|
|
{
|
2020-12-03 08:28:05 +00:00
|
|
|
|
internal class QSBULocalConnectionToClient : QSBNetworkConnection
|
2020-12-02 18:40:38 +00:00
|
|
|
|
{
|
|
|
|
|
public QSBULocalConnectionToClient(QSBLocalClient localClient)
|
|
|
|
|
{
|
|
|
|
|
address = "localClient";
|
|
|
|
|
m_LocalClient = localClient;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public QSBLocalClient localClient
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return m_LocalClient;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 09:23:27 +00:00
|
|
|
|
public override bool Send(short msgType, QSBMessageBase msg)
|
2020-12-02 18:40:38 +00:00
|
|
|
|
{
|
|
|
|
|
m_LocalClient.InvokeHandlerOnClient(msgType, msg, 0);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 09:23:27 +00:00
|
|
|
|
public override bool SendUnreliable(short msgType, QSBMessageBase msg)
|
2020-12-02 18:40:38 +00:00
|
|
|
|
{
|
|
|
|
|
m_LocalClient.InvokeHandlerOnClient(msgType, msg, 1);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 09:23:27 +00:00
|
|
|
|
public override bool SendByChannel(short msgType, QSBMessageBase msg, int channelId)
|
2020-12-02 18:40:38 +00:00
|
|
|
|
{
|
|
|
|
|
m_LocalClient.InvokeHandlerOnClient(msgType, msg, channelId);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool SendBytes(byte[] bytes, int numBytes, int channelId)
|
|
|
|
|
{
|
|
|
|
|
m_LocalClient.InvokeBytesOnClient(bytes, channelId);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 09:23:27 +00:00
|
|
|
|
public override bool SendWriter(QSBNetworkWriter writer, int channelId)
|
2020-12-02 18:40:38 +00:00
|
|
|
|
{
|
|
|
|
|
m_LocalClient.InvokeBytesOnClient(writer.AsArray(), channelId);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void GetStatsOut(out int numMsgs, out int numBufferedMsgs, out int numBytes, out int lastBufferedPerSecond)
|
|
|
|
|
{
|
|
|
|
|
numMsgs = 0;
|
|
|
|
|
numBufferedMsgs = 0;
|
|
|
|
|
numBytes = 0;
|
|
|
|
|
lastBufferedPerSecond = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void GetStatsIn(out int numMsgs, out int numBytes)
|
|
|
|
|
{
|
|
|
|
|
numMsgs = 0;
|
|
|
|
|
numBytes = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private QSBLocalClient m_LocalClient;
|
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|