Exemple #1
0
            protected override void toWriteBytesSimple(BytesWriteStream stream)
            {
                if (!_g4)
                {
                    _m4 = instance.Type.GetMethod("toWriteBytesSimple", 1);
                    _g4 = true;
                }

                if (_m4 != null && !_b4)
                {
                    _b4    = true;
                    _p1[0] = stream;
                    appdomain.Invoke(_m4, instance, _p1);
                    _p1[0] = null;
                    _b4    = false;
                }
                else
                {
                    base.toWriteBytesSimple(stream);
                }
            }
Exemple #2
0
            protected override void toWriteBytesFull(BytesWriteStream stream)
            {
                if (!_g2)
                {
                    _m2 = instance.Type.GetMethod("toWriteBytesFull", 1);
                    _g2 = true;
                }

                if (_m2 != null && !_b2)
                {
                    _b2    = true;
                    _p1[0] = stream;
                    appdomain.Invoke(_m2, instance, _p1);
                    _p1[0] = null;
                    _b2    = false;
                }
                else
                {
                    base.toWriteBytesFull(stream);
                }
            }
Exemple #3
0
        /// <summary>
        /// 写入字节流(完整版,为DB)
        /// </summary>
        public void writeBytesFull(BytesWriteStream stream)
        {
            try
            {
                beforeWrite();
            }
            catch (Exception e)
            {
                Ctrl.errorLog(e);
            }

            stream.startWriteObj();

            try
            {
                toWriteBytesFull(stream);
            }
            catch (Exception e)
            {
                Ctrl.errorLog(e);
            }

            stream.endWriteObj();
        }
Exemple #4
0
 /** 写入字节 */
 public void writeBytes(BytesWriteStream stream)
 {
     stream.writeInt(id);
     stream.writeUTF(name);
     stream.writeByte(type);
 }
Exemple #5
0
 /// <summary>
 /// 写入字节流(简版)
 /// </summary>
 protected override void toWriteBytesSimple(BytesWriteStream stream)
 {
     stream.writeLong(this.timeSeconds);
 }
 protected override void write()
 {
     _postStream = new BytesWriteStream();
     _postStream.writeUTFBytes(_postData);
 }
Exemple #7
0
        /// <summary>
        /// 写入字节流(简版)
        /// </summary>
        protected override void toWriteBytesSimple(BytesWriteStream stream)
        {
            stream.writeInt(this.key);

            stream.writeInt(this.value);
        }
Exemple #8
0
        /// <summary>
        /// 写入字节流(简版)
        /// </summary>
        protected override void toWriteBytesSimple(BytesWriteStream stream)
        {
            base.toWriteBytesSimple(stream);

            stream.writeInt(this.index);
        }
Exemple #9
0
        /// <summary>
        /// 写入字节流(简版)
        /// </summary>
        protected override void toWriteBytesSimple(BytesWriteStream stream)
        {
            stream.writeUTF(this.name);

            stream.writeInt(this.type);

            stream.writeUTF(this.style);

            if (this.children != null)
            {
                stream.writeBoolean(true);
                stream.writeLen(this.children.size());
                if (!this.children.isEmpty())
                {
                    UIObjectData[] childrenVValues = this.children.getValues();
                    for (int childrenVI = 0, childrenVLen = this.children.length(); childrenVI < childrenVLen; ++childrenVI)
                    {
                        UIObjectData childrenV = childrenVValues[childrenVI];
                        if (childrenV != null)
                        {
                            stream.writeBoolean(true);
                            childrenV.writeBytesSimple(stream);
                        }
                        else
                        {
                            stream.writeBoolean(false);
                        }
                    }
                }
            }
            else
            {
                stream.writeBoolean(false);
            }

            if (this.intArgs != null)
            {
                stream.writeBoolean(true);
                int[] intArgsT = this.intArgs;
                stream.writeLen(intArgsT.Length);
                for (int intArgsVI = 0, intArgsVLen = intArgsT.Length; intArgsVI < intArgsVLen; ++intArgsVI)
                {
                    int intArgsV = intArgsT[intArgsVI];
                    stream.writeInt(intArgsV);
                }
            }
            else
            {
                stream.writeBoolean(false);
            }

            if (this.strArgs != null)
            {
                stream.writeBoolean(true);
                string[] strArgsT = this.strArgs;
                stream.writeLen(strArgsT.Length);
                for (int strArgsVI = 0, strArgsVLen = strArgsT.Length; strArgsVI < strArgsVLen; ++strArgsVI)
                {
                    string strArgsV = strArgsT[strArgsVI];
                    stream.writeUTF(strArgsV);
                }
            }
            else
            {
                stream.writeBoolean(false);
            }
        }
Exemple #10
0
 /** 同步发送(IO线程) */
 public abstract void toSendStream(BytesWriteStream stream);
Exemple #11
0
 /** 执行写入到流 */
 protected virtual void doWriteToStream(BytesWriteStream stream)
 {
     //写协议体
     doWriteBytesSimple(stream);
 }
Exemple #12
0
        /// <summary>
        /// 写入字节流(简版)
        /// </summary>
        protected override void toWriteBytesSimple(BytesWriteStream stream)
        {
            stream.writeInt(this.timePass);

            stream.writeInt(this.timeMax);
        }
Exemple #13
0
 public override void toSendStream(BytesWriteStream stream)
 {
     _kcp.Send(new Span <byte>(stream.getBuf(), 0, stream.length()));
 }
Exemple #14
0
 /// <summary>
 /// 实际写入字节流(简版,为通信)
 /// </summary>
 protected virtual void toWriteBytesSimple(BytesWriteStream stream)
 {
 }
Exemple #15
0
 /// <summary>
 /// 实际写入字节流(完整版,为DB)
 /// </summary>
 protected virtual void toWriteBytesFull(BytesWriteStream stream)
 {
 }
Exemple #16
0
        /// <summary>
        /// 写入字节流(简版,为通信)
        /// </summary>
        public void writeBytesSimple(BytesWriteStream stream)
        {
            beforeWrite();

            toWriteBytesSimple(stream);
        }