change some ints into their QMsgTypes

This commit is contained in:
Mister_Nebula 2021-09-05 13:12:42 +01:00
parent d16b061078
commit ae18276fa4

View File

@ -408,7 +408,7 @@ namespace QuantumUNET
}
m_AsyncConnect = ConnectState.Connected;
m_Connection.InvokeHandlerNoData(32);
m_Connection.InvokeHandlerNoData(QMsgType.Connect);
break;
case NetworkEventType.DisconnectEvent:
@ -423,7 +423,7 @@ namespace QuantumUNET
}
QClientScene.HandleClientDisconnect(m_Connection);
m_Connection?.InvokeHandlerNoData(33);
m_Connection?.InvokeHandlerNoData(QMsgType.Disconnect);
break;
case NetworkEventType.Nothing:
@ -487,8 +487,8 @@ namespace QuantumUNET
private void GenerateError(int error)
{
var handler = m_MessageHandlers.GetHandler(34)
?? m_MessageHandlers.GetHandler(34);
var handler = m_MessageHandlers.GetHandler(QMsgType.Error)
?? m_MessageHandlers.GetHandler(QMsgType.Error);
if (handler != null)
{
var errorMessage = new QErrorMessage
@ -501,7 +501,7 @@ namespace QuantumUNET
var reader = new QNetworkReader(buffer);
handler(new QNetworkMessage
{
MsgType = 34,
MsgType = QMsgType.Error,
Reader = reader,
Connection = m_Connection,
ChannelId = 0