This commit is contained in:
sin365 2024-12-03 20:05:12 +08:00
parent d1ded3446d
commit 02e94317e4

View File

@ -17,6 +17,8 @@ namespace AxibugEmuOnline.Client.Network
private NetMsg() { }
public static object lockQueueObj = new object();
#region RegisterMsgEvent
public void RegNetMsgEvent(int cmd, Action<byte[]> callback)
@ -60,11 +62,16 @@ namespace AxibugEmuOnline.Client.Network
#region PostEvent
public void EnqueueNesMsg(int cmd, int ERRCODE, byte[] arg)
{
lock (lockQueueObj)
{
queueNetMsg.Enqueue((cmd, ERRCODE, arg));
}
}
public void DequeueNesMsg()
{
lock (lockQueueObj)
{
while (queueNetMsg.Count > 0)
{
@ -72,6 +79,7 @@ namespace AxibugEmuOnline.Client.Network
PostNetMsgEvent(msgData.Item1, msgData.Item2, msgData.Item3);
}
}
}
public void PostNetMsgEvent(int cmd, int ERRCODE, byte[] arg)
{