Ejemplo n.º 1
0
 public void Set(U16 addr)
 {
     Queue._liveQueue.Write(Y, () => {
         Queue._liveQueue.Push(Id);
         Queue._liveQueue.Push(addr.Hi);
         Queue._liveQueue.Push(addr.Lo);
     });
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //用户登录验证
         pyrc.zoneNet login = new pyrc.zoneNet();
         //login.tempsession();//测试用
         login.loginCheck();
         login.authority(4);
         //类别列表
         SqlConnection sqlconn = new SqlConnection();
         sqlconn.ConnectionString = ConfigurationManager.ConnectionStrings["zoneNetConn"].ConnectionString;
         SqlDataAdapter sqldar = new SqlDataAdapter("select * from [optUserType] where A00<>4", sqlconn);//4为系统管理员
         DataSet        Ds     = new DataSet();
         sqldar.Fill(Ds, "List");
         U16.DataSource     = Ds.Tables["List"].DefaultView;
         U16.DataTextField  = "A01";
         U16.DataValueField = "A00";
         sqlconn.Open();
         U16.DataBind();
         sqlconn.Close();
         //根据参数判别是否加载数据
         if (Request.QueryString["id"] != null)
         {
             int id  = System.Int32.Parse(Request.QueryString["id"]);
             var cmd = new SqlCommand("select * from TableUser where U00=" + id, sqlconn);
             sqlconn.Open();
             SqlDataReader read = cmd.ExecuteReader(CommandBehavior.CloseConnection);
             if (read.Read())
             {
                 U16.SelectedValue = read["U16"].ToString();
                 U02.Text          = read["U02"].ToString();
                 //U03.Text = read["U03"].ToString();
                 U04.Text       = read["U04"].ToString();
                 U05.Text       = read["U05"].ToString();
                 U06.Text       = read["U06"].ToString();
                 U07.Text       = read["U07"].ToString();
                 U08.Text       = read["U08"].ToString();
                 U09.Text       = read["U09"].ToString();
                 U10.Text       = read["U10"].ToString();
                 U11.Text       = read["U11"].ToString();
                 U12.Text       = read["U12"].ToString();
                 U13.Text       = read["U13"].ToString();
                 U15.InnerText  = read["U15"].ToString();
                 U02.Enabled    = false;
                 U04.Enabled    = false;
                 U16.Enabled    = false;
                 Label1.Visible = true;
             }
             read.Close();
         }
     }
 }
        //TODO: this doesn't have to be aligned to a page, so allow scenes to use this directly with their ram refs
        public void Setup(U16 pageStart, U8 length)
        {
            _done = VByte.New(Ram, $"{nameof(VRamQueue)}{nameof(_done)}");
            _executeLoopContinue = Labels.New();
            _executeLoopBreak    = Labels.New();

            var VRAM = Ram.Allocate(Addr(pageStart), Addr((U16)(pageStart + 0xFF)), "VRAM");

            _ops = new List <VRamQueueOp>();
            _ops.Add(new NOP());
            _opHandlers = new List <Label>();
            _liveQueue  = LiveQueue.New(Zp, Ram, VRAM, length, $"{nameof(VRamQueue)}{nameof(_liveQueue)}", Op <Stop>()?.Id ?? 255);
        }
Ejemplo n.º 4
0
        //TODO: this doesn't have to be aligned to a page, so allow scenes to use this directly with their ram refs
        public void SetupAligned(U16 pageStart, U8 length, params Option[] options)
        {
            _done = VByte.New(Ram, $"{nameof(VRamQueue)}{nameof(_done)}");
            //_handlerAddress = VWord.New(ram, "VRamQueue_handlerAddress");
            _executeLoopContinue = Labels.New();
            _executeLoopBreak    = Labels.New();

            var VRAM = Ram.Allocate(Addr(pageStart), Addr((U16)(pageStart + 0xFF)), "VRAM");

            _liveQueue = LiveQueue.New(Zp, Ram, VRAM, length, $"{nameof(VRamQueue)}{nameof(_liveQueue)}", Op.Stop);

            _options = options ?? Array.Empty <Option>();

            OptionModules();
        }
Ejemplo n.º 5
0
        public override void Decode(byte[] byteArray, ref int p)
        {
            var start = p;

            Id = new Hash();
            Id.Decode(byteArray, ref p);

            Begin = new BlockNumber();
            Begin.Decode(byteArray, ref p);

            Duration = new U16();
            Duration.Decode(byteArray, ref p);

            EventType = new EnumType <GameEventType>();
            EventType.Decode(byteArray, ref p);

            Hashes = new Vec <Hash>();
            Hashes.Decode(byteArray, ref p);

            Value = new U64();
            Value.Decode(byteArray, ref p);

            _size = p - start;
        }
Ejemplo n.º 6
0
 public void SetROM(U16 addr)
 {
     Raw(Id);
     Raw(addr.Lo, addr.Hi);
 }
Ejemplo n.º 7
0
 public void SetROM(U16 addr)
 {
     Raw(_opAddr);
     Raw(addr.Hi, addr.Lo);
 }
Ejemplo n.º 8
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (EvolutionId != 0UL)
            {
                hash ^= EvolutionId.GetHashCode();
            }
            if (TrainerId != 0UL)
            {
                hash ^= TrainerId.GetHashCode();
            }
            if (MonsterIdCurrent != 0UL)
            {
                hash ^= MonsterIdCurrent.GetHashCode();
            }
            if (MonsterIdNext != 0UL)
            {
                hash ^= MonsterIdNext.GetHashCode();
            }
            if (U5 != 0)
            {
                hash ^= U5.GetHashCode();
            }
            if (U6 != 0)
            {
                hash ^= U6.GetHashCode();
            }
            if (U7 != 0)
            {
                hash ^= U7.GetHashCode();
            }
            if (U8 != 0)
            {
                hash ^= U8.GetHashCode();
            }
            if (U9 != 0)
            {
                hash ^= U9.GetHashCode();
            }
            if (U10 != 0)
            {
                hash ^= U10.GetHashCode();
            }
            if (U11 != 0)
            {
                hash ^= U11.GetHashCode();
            }
            if (U12 != 0)
            {
                hash ^= U12.GetHashCode();
            }
            if (U13 != 0)
            {
                hash ^= U13.GetHashCode();
            }
            if (U14 != 0)
            {
                hash ^= U14.GetHashCode();
            }
            if (U15 != 0)
            {
                hash ^= U15.GetHashCode();
            }
            if (U16 != 0)
            {
                hash ^= U16.GetHashCode();
            }
            if (U17 != 0)
            {
                hash ^= U17.GetHashCode();
            }
            if (U18 != 0)
            {
                hash ^= U18.GetHashCode();
            }
            if (U19 != 0)
            {
                hash ^= U19.GetHashCode();
            }
            if (U20 != 0)
            {
                hash ^= U20.GetHashCode();
            }
            if (ScheduleId.Length != 0)
            {
                hash ^= ScheduleId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 9
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (QuestId != 0UL)
            {
                hash ^= QuestId.GetHashCode();
            }
            if (QuestTitle.Length != 0)
            {
                hash ^= QuestTitle.GetHashCode();
            }
            if (QuestId2 != 0UL)
            {
                hash ^= QuestId2.GetHashCode();
            }
            if (U4 != 0L)
            {
                hash ^= U4.GetHashCode();
            }
            if (U05 != 0UL)
            {
                hash ^= U05.GetHashCode();
            }
            if (U06 != 0UL)
            {
                hash ^= U06.GetHashCode();
            }
            if (QuestId3 != 0UL)
            {
                hash ^= QuestId3.GetHashCode();
            }
            if (U08 != 0UL)
            {
                hash ^= U08.GetHashCode();
            }
            if (U09 != 0UL)
            {
                hash ^= U09.GetHashCode();
            }
            if (U10.Length != 0)
            {
                hash ^= U10.GetHashCode();
            }
            if (U11 != 0UL)
            {
                hash ^= U11.GetHashCode();
            }
            if (U12 != 0UL)
            {
                hash ^= U12.GetHashCode();
            }
            if (U13 != 0UL)
            {
                hash ^= U13.GetHashCode();
            }
            if (U14.Length != 0)
            {
                hash ^= U14.GetHashCode();
            }
            if (U15 != 0UL)
            {
                hash ^= U15.GetHashCode();
            }
            if (U16 != 0UL)
            {
                hash ^= U16.GetHashCode();
            }
            if (U17 != 0UL)
            {
                hash ^= U17.GetHashCode();
            }
            if (U18 != 0UL)
            {
                hash ^= U18.GetHashCode();
            }
            if (U19 != 0UL)
            {
                hash ^= U19.GetHashCode();
            }
            if (U20 != 0UL)
            {
                hash ^= U20.GetHashCode();
            }
            if (U21 != 0UL)
            {
                hash ^= U21.GetHashCode();
            }
            if (U22 != 0UL)
            {
                hash ^= U22.GetHashCode();
            }
            if (QuestId4 != 0UL)
            {
                hash ^= QuestId4.GetHashCode();
            }
            if (U24 != 0UL)
            {
                hash ^= U24.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 10
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (DeckPresetId != 0)
            {
                hash ^= DeckPresetId.GetHashCode();
            }
            if (Character1Id != 0L)
            {
                hash ^= Character1Id.GetHashCode();
            }
            if (Trainer1Id != 0L)
            {
                hash ^= Trainer1Id.GetHashCode();
            }
            if (U4 != 0)
            {
                hash ^= U4.GetHashCode();
            }
            if (U5 != 0)
            {
                hash ^= U5.GetHashCode();
            }
            if (U6 != 0)
            {
                hash ^= U6.GetHashCode();
            }
            if (U7 != 0)
            {
                hash ^= U7.GetHashCode();
            }
            if (U8 != 0)
            {
                hash ^= U8.GetHashCode();
            }
            if (U9 != 0)
            {
                hash ^= U9.GetHashCode();
            }
            if (Character2Id != 0L)
            {
                hash ^= Character2Id.GetHashCode();
            }
            if (Trainer2Id != 0L)
            {
                hash ^= Trainer2Id.GetHashCode();
            }
            if (U14 != 0)
            {
                hash ^= U14.GetHashCode();
            }
            if (U15 != 0)
            {
                hash ^= U15.GetHashCode();
            }
            if (U16 != 0)
            {
                hash ^= U16.GetHashCode();
            }
            if (U17 != 0)
            {
                hash ^= U17.GetHashCode();
            }
            if (U18 != 0)
            {
                hash ^= U18.GetHashCode();
            }
            if (U19 != 0)
            {
                hash ^= U19.GetHashCode();
            }
            if (Character3Id != 0L)
            {
                hash ^= Character3Id.GetHashCode();
            }
            if (Trainer3Id != 0L)
            {
                hash ^= Trainer3Id.GetHashCode();
            }
            if (U24 != 0)
            {
                hash ^= U24.GetHashCode();
            }
            if (U25 != 0)
            {
                hash ^= U25.GetHashCode();
            }
            if (U26 != 0)
            {
                hash ^= U26.GetHashCode();
            }
            if (U27 != 0)
            {
                hash ^= U27.GetHashCode();
            }
            if (U28 != 0)
            {
                hash ^= U28.GetHashCode();
            }
            if (U29 != 0)
            {
                hash ^= U29.GetHashCode();
            }
            if (Item1Id != 0L)
            {
                hash ^= Item1Id.GetHashCode();
            }
            if (U33 != 0)
            {
                hash ^= U33.GetHashCode();
            }
            if (U34 != 0)
            {
                hash ^= U34.GetHashCode();
            }
            if (Item2Id != 0L)
            {
                hash ^= Item2Id.GetHashCode();
            }
            if (U36 != 0)
            {
                hash ^= U36.GetHashCode();
            }
            if (U37 != 0)
            {
                hash ^= U37.GetHashCode();
            }
            if (Item3Id != 0L)
            {
                hash ^= Item3Id.GetHashCode();
            }
            if (U39 != 0)
            {
                hash ^= U39.GetHashCode();
            }
            if (U40 != 0)
            {
                hash ^= U40.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 11
0
        private void ReadBytecode(Stream input, FunctionDefinition funcDef)
        {
            funcDef.Instructions       = new List <IInstruction>();
            funcDef.InstructionOffsets = new List <int>();
            var unencodedByteCodeLength = input.ReadValueEncodedS32();
            int read;

            for (read = 0; read < unencodedByteCodeLength;)
            {
                funcDef.InstructionOffsets.Add(read);
                var op     = input.ReadValueU8();
                var opcode = (Script.Opcode)op;

                read++;
                Script.IInstruction instruction = null;

                switch (opcode)
                {
                case Script.Opcode.OP_Target:
                {
                    instruction = new Target();
                    break;
                }

                case Script.Opcode.OP_ShortConst:
                {
                    instruction = new ShortConst();
                    break;
                }

                case Script.Opcode.OP_IntConst:
                {
                    instruction = new IntConst();
                    break;
                }

                case Script.Opcode.OP_FloatConst:
                {
                    instruction = new FloatConst();
                    break;
                }

                case Script.Opcode.OP_StringConst:
                {
                    instruction = new StringConst(this);
                    break;
                }

                case Script.Opcode.OP_VirtualFunc:
                {
                    instruction = new VirtualFunc(this);
                    break;
                }

                case Script.Opcode.OP_Context:
                case Script.Opcode.OP_SwitchLabel:
                {
                    instruction = new U16U16(opcode);
                    break;
                }

                case Script.Opcode.OP_Assign:
                case Script.Opcode.OP_JumpIfFalse:
                case Script.Opcode.OP_Jump:
                case Script.Opcode.OP_Skip:
                {
                    instruction = new U16(opcode);
                    break;
                }

                case Script.Opcode.OP_LocalVar:
                case Script.Opcode.OP_ObjectVar:
                case Script.Opcode.OP_ParamVar:
                case Script.Opcode.OP_StructMember:
                {
                    instruction = new TypeMember(opcode, this);
                    break;
                }

                case Script.Opcode.OP_Switch:
                {
                    instruction = new Switch();
                    break;
                }

                case Script.Opcode.OP_Constructor:
                {
                    instruction = new Constructor(this);
                    break;
                }

                case Script.Opcode.OP_TestEqual:
                case Script.Opcode.OP_EnumToInt:
                case Script.Opcode.OP_ArrayPushBack:
                case Script.Opcode.OP_ArraySize:
                case Script.Opcode.OP_ArrayElement:
                case Script.Opcode.OP_New:
                case Script.Opcode.OP_ArrayClear:
                case Script.Opcode.OP_DynamicCast:
                case Script.Opcode.OP_ArrayContainsFast:
                case Script.Opcode.OP_ArrayRemoveFast:
                case Script.Opcode.OP_TestNotEqual:
                case Script.Opcode.OP_ArrayErase:
                case Script.Opcode.OP_EnumToString:
                case Script.Opcode.OP_ArrayContains:
                case Script.Opcode.OP_ArrayResize:
                case Script.Opcode.OP_ArrayInsert:
                case Script.Opcode.OP_ArrayGrow:
                case Script.Opcode.OP_ArrayFindFirstFast:
                case Script.Opcode.OP_ArrayLast:
                case Script.Opcode.OP_ArrayRemove:
                case Script.Opcode.OP_SaveValue:
                {
                    instruction = new TypeRef(opcode, this);
                    break;
                }

                case Script.Opcode.OP_NameConst:
                {
                    instruction = new NameConst(Strings);
                    break;
                }

                case Script.Opcode.OP_FinalFunc:
                {
                    instruction = new FinalFunc(this);
                    break;
                }

                case Script.Opcode.OP_EntryFunc:
                case Script.Opcode.OP_SavePoint:
                {
                    instruction = new U16S32(opcode, this);
                    break;
                }

                case Script.Opcode.OP_Nop:
                case Script.Opcode.OP_ParamEnd:
                case Script.Opcode.OP_IntZero:
                case Script.Opcode.OP_IntOne:
                case Script.Opcode.OP_BoolFalse:
                case Script.Opcode.OP_BoolTrue:
                case Script.Opcode.OP_Return:
                case Script.Opcode.OP_GetServer:
                case Script.Opcode.OP_GetCamera:
                case Script.Opcode.OP_NameToString:
                case Script.Opcode.OP_GetPlayer:
                case Script.Opcode.OP_IntToFloat:
                case Script.Opcode.OP_This:
                case Script.Opcode.OP_Null:
                case Script.Opcode.OP_GetGame:
                case Script.Opcode.OP_ObjectToBool:
                case Script.Opcode.OP_IntToString:
                case Script.Opcode.OP_FloatToString:
                case Script.Opcode.OP_IntToByte:
                case Script.Opcode.OP_ObjectToString:
                case Script.Opcode.OP_SwitchDefault:
                case Script.Opcode.OP_BoolToString:
                case Script.Opcode.OP_GetHud:
                case Script.Opcode.OP_FloatToInt:
                case Script.Opcode.OP_NameToBool:
                case Script.Opcode.OP_Parent:
                case Script.Opcode.OP_IntToBool:
                case Script.Opcode.OP_ByteToInt:
                case Script.Opcode.OP_FloatToBool:
                case Script.Opcode.OP_ByteToFloat:
                case Script.Opcode.OP_StringToBool:
                case Script.Opcode.OP_SavePointEnd:
                case Script.Opcode.OP_StringToInt:
                case Script.Opcode.OP_GetSound:
                {
                    instruction = new Simple(opcode);
                    break;
                }

                default:
                {
                    throw new NotImplementedException("unhandled " + opcode.ToString());
                }
                }
                read += instruction.Deserialize(input);
                funcDef.Instructions.Add(instruction);
            }

            if (read != unencodedByteCodeLength)
            {
                throw new InvalidOperationException();
            }
        }
Ejemplo n.º 12
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TrainerId != 0L)
            {
                hash ^= TrainerId.GetHashCode();
            }
            if (TrainerKind != 0)
            {
                hash ^= TrainerKind.GetHashCode();
            }
            if (ScoutMethod != 0)
            {
                hash ^= ScoutMethod.GetHashCode();
            }
            if (Exclusivity != 0L)
            {
                hash ^= Exclusivity.GetHashCode();
            }
            if (TrainerBaseId != 0)
            {
                hash ^= TrainerBaseId.GetHashCode();
            }
            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (Rarity != 0)
            {
                hash ^= Rarity.GetHashCode();
            }
            if (Role != 0)
            {
                hash ^= Role.GetHashCode();
            }
            if (MonsterId != 0UL)
            {
                hash ^= MonsterId.GetHashCode();
            }
            if (Move1Id != 0)
            {
                hash ^= Move1Id.GetHashCode();
            }
            if (Move2Id != 0)
            {
                hash ^= Move2Id.GetHashCode();
            }
            if (Move3Id != 0)
            {
                hash ^= Move3Id.GetHashCode();
            }
            if (Move4Id != 0)
            {
                hash ^= Move4Id.GetHashCode();
            }
            if (Weakness != 0)
            {
                hash ^= Weakness.GetHashCode();
            }
            if (StoryQuest != 0UL)
            {
                hash ^= StoryQuest.GetHashCode();
            }
            if (U16 != 0)
            {
                hash ^= U16.GetHashCode();
            }
            if (Passive1Id != 0)
            {
                hash ^= Passive1Id.GetHashCode();
            }
            if (Passive2Id != 0)
            {
                hash ^= Passive2Id.GetHashCode();
            }
            if (Passive3Id != 0)
            {
                hash ^= Passive3Id.GetHashCode();
            }
            if (Passive4Id != 0)
            {
                hash ^= Passive4Id.GetHashCode();
            }
            if (TeamSkill1Id != 0)
            {
                hash ^= TeamSkill1Id.GetHashCode();
            }
            if (TeamSkill2Id != 0)
            {
                hash ^= TeamSkill2Id.GetHashCode();
            }
            if (TeamSkill3Id != 0)
            {
                hash ^= TeamSkill3Id.GetHashCode();
            }
            if (TeamSkill4Id != 0)
            {
                hash ^= TeamSkill4Id.GetHashCode();
            }
            if (TeamSkill5Id != 0)
            {
                hash ^= TeamSkill5Id.GetHashCode();
            }
            if (U26 != 0)
            {
                hash ^= U26.GetHashCode();
            }
            if (U27 != 0)
            {
                hash ^= U27.GetHashCode();
            }
            if (Number != 0)
            {
                hash ^= Number.GetHashCode();
            }
            if (ScheduleId.Length != 0)
            {
                hash ^= ScheduleId.GetHashCode();
            }
            if (ExScheduleId.Length != 0)
            {
                hash ^= ExScheduleId.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 13
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BattleParameterId != 0)
            {
                hash ^= BattleParameterId.GetHashCode();
            }
            if (BattleNameJp.Length != 0)
            {
                hash ^= BattleNameJp.GetHashCode();
            }
            if (U3 != 0)
            {
                hash ^= U3.GetHashCode();
            }
            if (U4 != 0)
            {
                hash ^= U4.GetHashCode();
            }
            if (U5 != 0)
            {
                hash ^= U5.GetHashCode();
            }
            if (U6 != 0)
            {
                hash ^= U6.GetHashCode();
            }
            if (U7 != 0)
            {
                hash ^= U7.GetHashCode();
            }
            if (U8 != 0)
            {
                hash ^= U8.GetHashCode();
            }
            if (U9 != 0)
            {
                hash ^= U9.GetHashCode();
            }
            if (U10 != 0)
            {
                hash ^= U10.GetHashCode();
            }
            if (U11 != 0)
            {
                hash ^= U11.GetHashCode();
            }
            if (U12 != 0)
            {
                hash ^= U12.GetHashCode();
            }
            if (U13 != 0)
            {
                hash ^= U13.GetHashCode();
            }
            if (U14 != 0)
            {
                hash ^= U14.GetHashCode();
            }
            if (U15 != 0)
            {
                hash ^= U15.GetHashCode();
            }
            if (U16 != 0)
            {
                hash ^= U16.GetHashCode();
            }
            if (U17 != 0)
            {
                hash ^= U17.GetHashCode();
            }
            if (NpcUnitId1 != 0)
            {
                hash ^= NpcUnitId1.GetHashCode();
            }
            if (NpcUnitId2 != 0)
            {
                hash ^= NpcUnitId2.GetHashCode();
            }
            if (NpcUnitId3 != 0)
            {
                hash ^= NpcUnitId3.GetHashCode();
            }
            if (BackgroundId != 0)
            {
                hash ^= BackgroundId.GetHashCode();
            }
            if (TrainerNameId.Length != 0)
            {
                hash ^= TrainerNameId.GetHashCode();
            }
            if (U23 != 0)
            {
                hash ^= U23.GetHashCode();
            }
            if (U24 != 0)
            {
                hash ^= U24.GetHashCode();
            }
            if (U25 != 0)
            {
                hash ^= U25.GetHashCode();
            }
            if (U26 != 0)
            {
                hash ^= U26.GetHashCode();
            }
            if (U27 != 0)
            {
                hash ^= U27.GetHashCode();
            }
            if (U28 != 0)
            {
                hash ^= U28.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }