Exemplo n.º 1
0
        /// <summary>
        /// PB类型使用IoMessagePBTypeImpl反序列
        /// </summary>
        /// <param name="buf"></param>
        protected void pbType(byte[] buf)
        {
            IoMessagePBTypeImpl ioMessage = ProtostuffUtils.ProtobufDeserialize <IoMessagePBTypeImpl>(buf);

            //添加队列
            IoMessageHandler.getInstance().push(ioMessage);
        }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        ClientTcpIoMessage ioMessage = IoMessageHandler.getInstance().Pop();

        if (ioMessage != null)
        {
            Handler(ioMessage);
        }
    }