public static bool IsRoomActivityFinished(this HideOut hideout) { var _loc1_ = 0; var _loc4_ = 0; var _loc2_ = HzAccountManger.GetAccByCharacterID(hideout.character_id).ServerTime; foreach (var room in hideout.Rooms) { if (room.CRoom.IsManuallyProductionRoom && room.status == HideoutRoomStatus.Producing && room.CurrentCalculatedResourceAmount() >= room.MaxResourceAmount()) { return(true); } if ((room.status == HideoutRoomStatus.Building || room.status == HideoutRoomStatus.Upgrading || room.status == HideoutRoomStatus.Storing || room.status == HideoutRoomStatus.Placing) && room.ts_activity_end <= _loc2_) { return(true); } } _loc1_ = 0; while (_loc1_ < HideoutUtil.MAX_LEVELS) { _loc4_ = 0; while (_loc4_ < HideoutUtil.MAX_SLOTS) { if (hideout.IsSlotUnlockInProgress(_loc1_, _loc4_) && hideout.GetSlotUnlockTsEnd(_loc1_, _loc4_) <= _loc2_) { return(true); } _loc4_++; } _loc1_++; } return(false); }
public static HideoutWorkerActivity GetCurrentWorkerActivity(this HideOut hideout) { var _loc4_ = 0; var _loc7_ = 0; var endTime = 0; HideOutRoom Room = null; var level = -1; var slot = -1; foreach (var room in hideout.Rooms) { if (room.status == HideoutRoomStatus.Building || room.status == HideoutRoomStatus.Placing || room.status == HideoutRoomStatus.Storing || room.status == HideoutRoomStatus.Upgrading) { if (room.ts_activity_end > endTime /* && room.ts_activity_end > HzAccountManger.GetAccByCharacterID(hideout.character_id).ServerTime*/) { endTime = room.ts_activity_end; Room = room; } } } _loc4_ = 0; while (_loc4_ < HideoutUtil.MAX_LEVELS) { _loc7_ = 0; while (_loc7_ < HideoutUtil.MAX_SLOTS) { if (hideout.IsSlotUnlockInProgress(_loc4_, _loc7_) && hideout.GetSlotUnlockTsEnd(_loc4_, _loc7_) > endTime /* && hideout.GetSlotUnlockTsEnd(_loc4_, _loc7_) > HzAccountManger.GetAccByCharacterID(hideout.character_id).ServerTime */) { endTime = hideout.GetSlotUnlockTsEnd(_loc4_, _loc7_); level = _loc4_; slot = _loc7_; } _loc7_++; } _loc4_++; } if (Room == null && level == -1 && slot == -1) { return(null); } return(new HideoutWorkerActivity(Room, level, slot, endTime)); }