Example #1
0
        public void Should_Get_Paginated_Issues()
        {
            const int NUMBER_OF_PAGINATED_ISSUES = 3;
            const int OFFSET = 1;

            var issues = fixture.RedmineManager.GetPaginatedObjects <Issue>(new NameValueCollection {
                { RedmineKeys.OFFSET, OFFSET.ToString() }, { RedmineKeys.LIMIT, NUMBER_OF_PAGINATED_ISSUES.ToString() }, { "sort", "id:desc" }
            });

            Assert.NotNull(issues.Items);
            //Assert.True(issues.Items.Count <= NUMBER_OF_PAGINATED_ISSUES, "number of issues ( "+ issues.Items.Count +" ) != " + NUMBER_OF_PAGINATED_ISSUES.ToString());
        }
Example #2
0
 /// <summary>
 /// アイテム情報の取得
 /// </summary>
 /// <param name="index">位置</param>
 /// <param name="offset">INVENTORY_INFO|SAFEBOX_INFO|STORAGE_INFO|LOCKER_INFO</param>
 /// <returns>InventoryItem 構造体</returns>
 unsafe private InventoryItem _GetInventoryItem (short index, OFFSET offset)
 {
     short id;
     short order;
     byte count;
     int off = (int)offset + index * 0x2c;
     MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off), &id, 2, null);
     MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off + 2), &order, 2, null);
     MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off + 4), &count, 1, null);
     InventoryItem item = new InventoryItem();
     item.id = id;
     item.order = order;
     item.count = count;
     return item;
 }
Example #3
0
        public static ZoneId ParseZoneOffsetOrZoneName(string zoneName)
        {
            Matcher matcher = OFFSET.matcher(zoneName);

            if (matcher.matches())
            {
                return(parseOffset(matcher));
            }
            try
            {
                return(_zoneNameParser.parse(zoneName.Replace(' ', '_')).query(TemporalQueries.zoneId()));
            }
            catch (DateTimeParseException e)
            {
                throw new TemporalParseException("Invalid value for TimeZone: " + e.Message, e.ParsedString, e.ErrorIndex, e);
            }
        }
Example #4
0
        /// <summary>
        /// アイテム情報の取得
        /// </summary>
        /// <param name="index">位置</param>
        /// <param name="offset">INVENTORY_INFO|SAFEBOX_INFO|STORAGE_INFO|LOCKER_INFO</param>
        /// <returns>InventoryItem 構造体</returns>
        unsafe private InventoryItem _GetInventoryItem (short index, OFFSET offset)
        {
            int off = (int)offset + index * 0x2c;
            /* short id;
            short order;
            int count;
            int extra;
            int flag;
            MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off), &id, 2, null);
            MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off + 2), &order, 2, null);
            MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off + 4), &count, 4, null);
            MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off + 8), &flag, 4, null);
            MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off + 16), &extra, 4, null);

             */
            InventoryItem item = new InventoryItem();
            MemoryProvider.ReadProcessMemory(pol.Handle, (IntPtr)((int)pol.BaseAddress + off), &item, 18, null);
            
            return item;
        }