Exemple #1
0
    public void SendMessage(string msgName, PBStreamWriter writer)
    {
        if (_socket == null)
        {
            return;
        }

        var msgid = StringUtility.Hash(msgName);

        _socket.SendPacket(msgid, writer.ToArray());
    }
Exemple #2
0
 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));
     }
 }