Skip to content
Merged

Dev #337

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions autopcr/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'Accept-Encoding': 'gzip',
'User-Agent': 'Dalvik/2.1.0 (Linux, U, Android 5.1.1, PCRT00 Build/LMY48Z)',
'X-Unity-Version': '2021.3.20f1c1',
'APP-VER': "11.7.1",
'APP-VER': "11.7.2",
'BATTLE-LOGIC-VERSION': '4',
'BUNDLE-VER': '',
'DEVICE': '2',
Expand All @@ -70,7 +70,7 @@
'Accept-Encoding': 'gzip',
'User-Agent': 'priconne/24 CFNetwork/1492.0.1 Darwin/23.3.0',
'X-Unity-Version': '2021.3.20f1c1',
'APP-VER': "11.7.1",
'APP-VER': "11.7.2",
'BATTLE-LOGIC-VERSION': '4',
'BUNDLE-VER': '',
'DEVICE': '1',
Expand All @@ -89,7 +89,7 @@


def refresh_headers(version: str = None):
default_ver = '11.4.0'
default_ver = '11.7.2'
if version is not None:
with open(os.path.join(CACHE_DIR, 'version.txt'), 'w', encoding='utf-8') as f:
f.write(version)
Expand Down
3 changes: 1 addition & 2 deletions autopcr/core/datamgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ def get_campaign_times(self, condition_func) -> int:
if not times:
return 0
times = max(times)
# return int(times)
return int(times) // 2 # TODO delete // 2 when stop speed up
return int(times)

def get_heart_piece_campaign_times(self) -> int:
return self.get_campaign_times(db.is_heart_piece_campaign) // 1000
Expand Down
23 changes: 18 additions & 5 deletions autopcr/core/pcrclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,30 @@ async def alces_read_story(self, story_id: int):
req.story_id = story_id
return await self.request(req)

async def alces_exec(self, serial_id: int):
req = AlcesExecRequest()
async def alces_exec(self, serial_id: int, exec_type: int = 1):
req = AlcesExecSubStatusRequest()
req.serial_id = serial_id
req.current_alces_point = self.data.get_inventory((eInventoryType.Item, 26202))
req.current_gold = self.data.get_mana()
req.exec_type = exec_type
return await self.request(req)

async def alces_exec_auto(self, serial_id: int, exec_count: int, target_status_list: List[int], target_step: int = 5):
req = AlcesExecSubStatusAutoRequest()
req.serial_id = serial_id
req.exec_count = exec_count
req.current_alces_point = self.data.get_inventory((eInventoryType.Item, 26202))
req.current_gold = self.data.get_mana()
req.target_sub_status = AlcesAutoTargetSubStatus(
status_list=target_status_list,
step=target_step,
)
return await self.request(req)

async def alces_lock_slot(self, serial_id: int, slot_number: int, is_lock: int):
req = AlcesLockSlotRequest()
req.lock_list = [
AlcesDataPost(
AlcesSubStatusResultPost(
serial_id=serial_id,
sub_status=[ExtraEquipSubStatusPost(
slot_number=slot_number,
Expand All @@ -130,12 +143,12 @@ async def alces_lock_slot(self, serial_id: int, slot_number: int, is_lock: int):
return await self.request(req)

async def alces_cancel_result(self, serial_id: int):
req = AlcesCancelResultRequest()
req = AlcesCancelSubStatusResultRequest()
req.serial_id = serial_id
return await self.request(req)

async def alces_fix_result(self, serial_id: int):
req = AlcesFixResultRequest()
req = AlcesFixSubStatusResultRequest()
req.serial_id = serial_id
return await self.request(req)

Expand Down
6 changes: 2 additions & 4 deletions autopcr/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2475,14 +2475,12 @@ def is_campaign(self, campaign: str, now: Union[None, datetime.datetime] = None,
tomorrow = now + datetime.timedelta(days = 1)
half_day = datetime.timedelta(hours = 7)
n3 = (flow(self.campaign_schedule.values())
.where(lambda x: self.is_normal_quest_campaign(x.id) and x.value >= 6000 and self.is_level_effective_scope_in_campaign(level, x.id)) # TODO change 3000 when stop speed up
# .where(lambda x: self.is_normal_quest_campaign(x.id) and x.value >= 3000 and self.is_level_effective_scope_in_campaign(level, x.id))
.where(lambda x: self.is_normal_quest_campaign(x.id) and x.value >= 3000 and self.is_level_effective_scope_in_campaign(level, x.id))
.select(lambda x: (db.parse_time(x.start_time), db.parse_time(x.end_time)))
.to_list()
)
h3 = (flow(self.campaign_schedule.values())
.where(lambda x: self.is_hard_quest_campaign(x.id) and x.value >= 6000) # TODO change 3000 when stop speed up
# .where(lambda x: self.is_hard_quest_campaign(x.id) and x.value >= 3000)
.where(lambda x: self.is_hard_quest_campaign(x.id) and x.value >= 3000)
.select(lambda x: (db.parse_time(x.start_time), db.parse_time(x.end_time)))
.to_list()
)
Expand Down
Loading
Loading