mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
QNetworkReader
This commit is contained in:
parent
8f148c5666
commit
a32e510c55
@ -16,14 +16,14 @@ namespace QuantumUNET
|
|||||||
public QNetworkClient()
|
public QNetworkClient()
|
||||||
{
|
{
|
||||||
m_MsgBuffer = new byte[65535];
|
m_MsgBuffer = new byte[65535];
|
||||||
m_MsgReader = new NetworkReader(m_MsgBuffer);
|
m_MsgReader = new QNetworkReader(m_MsgBuffer);
|
||||||
AddClient(this);
|
AddClient(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public QNetworkClient(QNetworkConnection conn)
|
public QNetworkClient(QNetworkConnection conn)
|
||||||
{
|
{
|
||||||
m_MsgBuffer = new byte[65535];
|
m_MsgBuffer = new byte[65535];
|
||||||
m_MsgReader = new NetworkReader(m_MsgBuffer);
|
m_MsgReader = new QNetworkReader(m_MsgBuffer);
|
||||||
AddClient(this);
|
AddClient(this);
|
||||||
SetActive(true);
|
SetActive(true);
|
||||||
m_Connection = conn;
|
m_Connection = conn;
|
||||||
@ -60,7 +60,7 @@ namespace QuantumUNET
|
|||||||
private readonly QNetworkMessageHandlers m_MessageHandlers = new();
|
private readonly QNetworkMessageHandlers m_MessageHandlers = new();
|
||||||
protected QNetworkConnection m_Connection;
|
protected QNetworkConnection m_Connection;
|
||||||
private readonly byte[] m_MsgBuffer;
|
private readonly byte[] m_MsgBuffer;
|
||||||
private readonly NetworkReader m_MsgReader;
|
private readonly QNetworkReader m_MsgReader;
|
||||||
protected ConnectState m_AsyncConnect = ConnectState.None;
|
protected ConnectState m_AsyncConnect = ConnectState.None;
|
||||||
private string m_RequestedServerHost = "";
|
private string m_RequestedServerHost = "";
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ namespace QuantumUNET
|
|||||||
public ReadOnlyCollection<QNetworkConnection> connections { get; }
|
public ReadOnlyCollection<QNetworkConnection> connections { get; }
|
||||||
public Dictionary<short, QNetworkMessageDelegate> handlers => m_MessageHandlers.GetHandlers();
|
public Dictionary<short, QNetworkMessageDelegate> handlers => m_MessageHandlers.GetHandlers();
|
||||||
public byte[] messageBuffer { get; private set; }
|
public byte[] messageBuffer { get; private set; }
|
||||||
public NetworkReader messageReader { get; private set; }
|
public QNetworkReader messageReader { get; private set; }
|
||||||
public Type networkConnectionClass { get; private set; } = typeof(QNetworkConnection);
|
public Type networkConnectionClass { get; private set; } = typeof(QNetworkConnection);
|
||||||
|
|
||||||
public void SetNetworkConnectionClass<T>()
|
public void SetNetworkConnectionClass<T>()
|
||||||
@ -32,7 +32,7 @@ namespace QuantumUNET
|
|||||||
m_Initialized = true;
|
m_Initialized = true;
|
||||||
NetworkTransport.Init();
|
NetworkTransport.Init();
|
||||||
messageBuffer = new byte[65535];
|
messageBuffer = new byte[65535];
|
||||||
messageReader = new NetworkReader(messageBuffer);
|
messageReader = new QNetworkReader(messageBuffer);
|
||||||
if (hostTopology == null)
|
if (hostTopology == null)
|
||||||
{
|
{
|
||||||
var connectionConfig = new ConnectionConfig();
|
var connectionConfig = new ConnectionConfig();
|
||||||
|
Loading…
Reference in New Issue
Block a user