コード例 #1
0
        public virtual object decode(global::haxe.io.BytesInput i, global::org.msgpack.DecodeOption option)
        {
            unchecked {
                                #line 41 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                try {
                                        #line 42 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    int b = i.readByte();
                    switch (b)
                    {
                    case 192:
                    {
                                                        #line 45 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(null);
                    }


                    case 194:
                    {
                                                        #line 48 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(false);
                    }


                    case 195:
                    {
                                                        #line 49 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(true);
                    }


                    case 196:
                    {
                                                        #line 52 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(i.readByte()));
                    }


                    case 197:
                    {
                                                        #line 53 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(i.readUInt16()));
                    }


                    case 198:
                    {
                                                        #line 54 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(i.readInt32()));
                    }


                    case 202:
                    {
                                                        #line 57 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readFloat());
                    }


                    case 203:
                    {
                                                        #line 58 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readDouble());
                    }


                    case 204:
                    {
                                                        #line 61 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readByte());
                    }


                    case 205:
                    {
                                                        #line 62 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readUInt16());
                    }


                    case 206:
                    {
                                                        #line 63 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt32());
                    }


                    case 207:
                    {
                                                        #line 64 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        throw global::haxe.lang.HaxeException.wrap("UInt64 not supported");
                    }


                    case 208:
                    {
                                                        #line 67 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt8());
                    }


                    case 209:
                    {
                                                        #line 68 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt16());
                    }


                    case 210:
                    {
                                                        #line 69 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt32());
                    }


                    case 211:
                    {
                                                        #line 70 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readInt64(i));
                    }


                    case 217:
                    {
                                                        #line 74 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        int len = i.readInt32();
                                                        #line 76 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(len).toString());
                    }


                    case 220:
                    {
                                                        #line 81 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readArray(i, i.readUInt16(), option));
                    }


                    case 221:
                    {
                                                        #line 82 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readArray(i, i.readInt32(), option));
                    }


                    case 222:
                    {
                                                        #line 85 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readMap(i, i.readUInt16(), option));
                    }


                    case 223:
                    {
                                                        #line 86 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readMap(i, i.readInt32(), option));
                    }


                    default:
                    {
                                                        #line 89 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        if ((b < 128))
                        {
                                                                #line 89 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(b);
                        }
                        else if ((b < 144))
                        {
                                                                #line 90 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(this.readMap(i, (15 & b), option));
                        }
                        else if ((b < 160))
                        {
                                                                #line 91 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(this.readArray(i, (15 & b), option));
                        }
                        else if ((b < 192))
                        {
                                                                #line 92 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(i.readString((31 & b), null));
                        }
                        else if ((b > 223))
                        {
                                                                #line 93 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(-256 | b);
                        }

                                                        #line 89 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        break;
                    }
                    }
                }
                catch (global::System.Exception catchallException) {
                                        #line 41 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    global::haxe.lang.Exceptions.exception = catchallException;
                                        #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    object realException = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                        #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    if ((realException is global::haxe.io.Eof))
                    {
                                                #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(realException));
                    }
                    else
                    {
                                                #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        throw;
                    }
                }


                                #line 97 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                return(null);
            }
                        #line default
        }
コード例 #2
0
        public static void addBytes(global::haxe.io.Bytes bytes, global::server.IHander hander, global::haxe.lang.Function callBack)
        {
            unchecked {
                                #line 360 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((hander != null))
                {
                                        #line 361 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    return;
                }

                                #line 363 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((bytes == null))
                {
                                        #line 364 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    return;
                }

                                #line 367 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((bytes.length > 1000))
                {
                                        #line 368 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    callBack.__hx_invoke4_o(default(double), false, default(double), null, default(double), global::web.proto.Web_Error.ERROR, default(double), hander);
                }

                                #line 371 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((global::web.proto.PacketBuilder.bytesBuff == null))
                {
                                        #line 372 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    global::web.proto.PacketBuilder.bytesBuff = bytes;
                }
                else
                {
                                        #line 374 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    global::haxe.io.BytesBuffer buffer = new global::haxe.io.BytesBuffer();
                    {
                                                #line 375 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        global::haxe.io.Bytes src = global::web.proto.PacketBuilder.bytesBuff;
                                                #line 375 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        (buffer.b as global::System.IO.Stream).Write(((byte[])(src.b)), ((int)(0)), ((int)(src.length)));
                    }

                                        #line 376 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    (buffer.b as global::System.IO.Stream).Write(((byte[])(bytes.b)), ((int)(0)), ((int)(bytes.length)));
                    global::web.proto.PacketBuilder.bytesBuff = buffer.getBytes();
                }

                                #line 379 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if (((global::web.proto.PacketBuilder.bytesBuff == null) || (global::web.proto.PacketBuilder.bytesBuff.length < 10)))
                {
                                        #line 380 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    return;
                }

                                #line 382 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                int available = global::web.proto.PacketBuilder.bytesBuff.length;
                global::haxe.io.BytesInput bi = new global::haxe.io.BytesInput(global::web.proto.PacketBuilder.bytesBuff, null, null);
                                #line 384 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                bi.set_bigEndian(false);
                while ((available >= 10))
                {
                                        #line 387 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int z = bi.readByte();
                    int h = bi.readByte();
                                        #line 389 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int y  = bi.readByte();
                    int v1 = bi.readByte();
                                        #line 391 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int v2 = bi.readByte();
                    int v3 = bi.readByte();
                                        #line 393 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int packetSize = bi.readInt32();
                    available -= 10;
                                        #line 396 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    if (!(global::web.proto.PacketBuilder.checkKey(z, h, y, v1, v2, v3)))
                    {
                                                #line 397 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        global::web.proto.PacketBuilder.bytesBuff = null;
                        global::haxe.Log.trace.__hx_invoke2_o(default(double), "f**k you !!! error message", default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "addBytes", "web.proto.PacketBuilder", "src/web/proto/PacketBuilder.hx" }, new int[] { 1981972957 }, new double[] { ((double)(398)) }));
                                                #line 399 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        available = 0;
                        callBack.__hx_invoke4_o(default(double), false, default(double), null, default(double), global::web.proto.Web_Error.ERROR, default(double), hander);
                                                #line 402 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        break;
                    }

                                        #line 405 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    bool error = false;
                    if ((packetSize <= available))
                    {
                                                #line 407 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        available -= packetSize;
                        global::haxe.io.Bytes msgBytes = bi.read(packetSize);
                                                #line 410 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        try {
                                                        #line 411 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            object p = global::org.msgpack.MsgPack.decode(msgBytes, null);
                                                        #line 413 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            callBack.__hx_invoke4_o(default(double), true, default(double), p, default(double), global::web.proto.Web_Error.OK, default(double), hander);
                        }
                        catch (global::System.Exception catchallException) {
                                                        #line 410 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            global::haxe.lang.Exceptions.exception = catchallException;
                                                        #line 415 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            {
                                                                #line 415 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                                object e = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                                                #line 415 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                                callBack.__hx_invoke4_o(default(double), false, default(double), null, default(double), global::web.proto.Web_Error.ERROR, default(double), hander);
                            }
                        }


                                                #line 417 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        break;
                    }
                    else
                    {
                                                #line 420 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        available += 10;
                                                #line 422 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        break;
                    }
                }

                                #line 425 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                global::web.proto.PacketBuilder.bytesBuff = null;
                available = 0;
                                #line 428 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                return;
            }
                        #line default
        }