public void SendMessage(string msgName, PBStreamWriter writer) { if (_socket == null) { return; } var msgid = StringUtility.Hash(msgName); _socket.SendPacket(msgid, writer.ToArray()); }
static int ToArray(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); PBStreamWriter obj = (PBStreamWriter)ToLua.CheckObject(L, 1, typeof(PBStreamWriter)); byte[] o = obj.ToArray(); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }