mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-04 21:47:28 +08:00
[Enhance] World Parallel
- For Arcaea 6.11.3 - Add partial support for World Parallel Mode. - Add some new partners, including "VIIM", "Helena" and "Yuno". Note: Link Play server has updated and do not support old clients anymore. World Parallel Mode and Link Play may have bugs, because I haven't check out all things carefully.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from .config_manager import Config
|
||||
|
||||
ARCAEA_SERVER_VERSION = 'v2.12.1.6'
|
||||
ARCAEA_DATABASE_VERSION = 'v2.12.1.6'
|
||||
ARCAEA_SERVER_VERSION = 'v2.12.1.7'
|
||||
ARCAEA_DATABASE_VERSION = 'v2.12.1.7'
|
||||
ARCAEA_LOG_DATBASE_VERSION = 'v1.1'
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class Constant:
|
||||
BUNDLE_DOWNLOAD_TIME_GAP_LIMIT = Config.BUNDLE_DOWNLOAD_TIME_GAP_LIMIT
|
||||
BUNDLE_DOWNLOAD_LINK_PREFIX = Config.BUNDLE_DOWNLOAD_LINK_PREFIX
|
||||
|
||||
LINKPLAY_UNLOCK_LENGTH = 512 # Units: bytes
|
||||
LINKPLAY_UNLOCK_LENGTH = 1024 # Units: bytes
|
||||
LINKPLAY_TIMEOUT = 5 # Units: seconds
|
||||
|
||||
LINKPLAY_HOST = '127.0.0.1' if Config.SET_LINKPLAY_SERVER_AS_SUB_PROCESS else Config.LINKPLAY_HOST
|
||||
|
||||
@@ -255,6 +255,11 @@ class UserPlay(UserScore):
|
||||
self.highest_health: int = None
|
||||
self.lowest_health: int = None
|
||||
|
||||
# room score
|
||||
self.room_code: str = None
|
||||
self.room_total_score: int = None
|
||||
self.room_total_players: int = None
|
||||
|
||||
self.invasion_flag: int = None # 1: invasion_start, 2: invasion_hard
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
|
||||
@@ -566,6 +566,8 @@ class UserInfo(User):
|
||||
# "feature": "paymentlink"
|
||||
# }
|
||||
# ],
|
||||
|
||||
# has_email: True
|
||||
}
|
||||
|
||||
def from_list(self, x: list) -> 'UserInfo':
|
||||
|
||||
@@ -160,11 +160,12 @@ class Map:
|
||||
self.require_localunlock_challengeid: str = None
|
||||
self.chain_info: dict = None
|
||||
|
||||
# self.requires: list[dict] = None
|
||||
self.requires: 'list[dict]' = None
|
||||
self.requires_any: 'list[dict]' = None
|
||||
|
||||
self.disable_over: bool = None
|
||||
self.new_law: str = None
|
||||
self.is_linkplay_allowed: bool = None
|
||||
|
||||
@property
|
||||
def rewards(self) -> list:
|
||||
@@ -219,6 +220,10 @@ class Map:
|
||||
r['new_law'] = self.new_law
|
||||
if self.requires_any:
|
||||
r['requires_any'] = self.requires_any
|
||||
if self.requires:
|
||||
r['requires'] = self.requires
|
||||
if self.is_linkplay_allowed:
|
||||
r['is_linkplay_allowed'] = self.is_linkplay_allowed
|
||||
return r
|
||||
|
||||
def from_dict(self, raw_dict: dict) -> 'Map':
|
||||
@@ -245,9 +250,11 @@ class Map:
|
||||
self.chain_info = raw_dict.get('chain_info')
|
||||
self.steps = [Step().from_dict(s) for s in raw_dict.get('steps')]
|
||||
|
||||
self.is_linkplay_allowed = raw_dict.get('is_linkplay_allowed', False)
|
||||
self.disable_over = raw_dict.get('disable_over')
|
||||
self.new_law = raw_dict.get('new_law')
|
||||
self.requires_any = raw_dict.get('requires_any')
|
||||
self.requires = raw_dict.get('requires')
|
||||
return self
|
||||
|
||||
def select_map_info(self):
|
||||
@@ -844,11 +851,13 @@ class BaseWorldPlay(WorldSkillMixin):
|
||||
# 'wpaid': 'helloworld', # world play id ???
|
||||
'progress_before_sub_boost': self.final_progress,
|
||||
'progress_sub_boost_amount': 0,
|
||||
'partner_multiply': self.partner_multiply,
|
||||
# 'subscription_multiply'
|
||||
|
||||
# lephon_final: bool dynamic map info
|
||||
# lephon_active: bool dynamic map info
|
||||
# 'steps_modified': False,
|
||||
|
||||
}
|
||||
|
||||
if self.character_used.skill_id_displayed == 'skill_maya':
|
||||
@@ -861,6 +870,15 @@ class BaseWorldPlay(WorldSkillMixin):
|
||||
if self.user_play.prog_boost_multiply != 0: # 源韵强化
|
||||
r['prog_boost_multiply'] = self.user_play.prog_boost_multiply
|
||||
|
||||
# progress_linkplay_boost_amount
|
||||
# linkplay_boost
|
||||
# progress_before_linkplay_boost
|
||||
if arcmap.is_linkplay_allowed:
|
||||
r['linkplay_boost'] = self.linkplay_boost # 同步率
|
||||
r['progress_before_linkplay_boost'] = self.progress_before_linkplay_boost
|
||||
r['progress_linkplay_boost_amount'] = self.progress_before_linkplay_boost * \
|
||||
(self.linkplay_boost - 1) * self.step_times
|
||||
|
||||
return r
|
||||
|
||||
@property
|
||||
@@ -892,6 +910,32 @@ class BaseWorldPlay(WorldSkillMixin):
|
||||
def final_progress(self) -> float:
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def partner_multiply(self) -> float:
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def progress_before_linkplay_boost(self) -> float:
|
||||
return self.progress_normalized
|
||||
|
||||
@property
|
||||
def linkplay_boost(self) -> float:
|
||||
if not self.user.current_map.is_linkplay_allowed:
|
||||
return 1.0
|
||||
score = self.user_play.room_total_score
|
||||
player_count = self.user_play.room_total_players
|
||||
if score and player_count:
|
||||
if player_count >= 4:
|
||||
factor = 80_000_000
|
||||
elif player_count == 3:
|
||||
factor = 100_000_000
|
||||
elif player_count == 2:
|
||||
factor = 200_000_000
|
||||
else:
|
||||
return 1.0
|
||||
return 1 + score / factor
|
||||
return 1.0
|
||||
|
||||
def before_update(self) -> None:
|
||||
if self.user_play.prog_boost_multiply != 0:
|
||||
self.user.update_user_one_column('prog_boost', 0)
|
||||
@@ -997,6 +1041,7 @@ class WorldPlay(BaseWorldPlay):
|
||||
|
||||
r["user_map"]["steps"] = [x.to_dict()
|
||||
for x in self.user.current_map.steps_for_climbing]
|
||||
|
||||
return r
|
||||
|
||||
@property
|
||||
@@ -1013,7 +1058,11 @@ class WorldPlay(BaseWorldPlay):
|
||||
|
||||
@property
|
||||
def final_progress(self) -> float:
|
||||
return (self.progress_normalized + (self.character_bonus_progress_normalized or 0)) * self.step_times + (self.kanae_added_progress or 0) - (self.kanae_stored_progress or 0)
|
||||
return self.progress_before_linkplay_boost * self.linkplay_boost * self.step_times + (self.kanae_added_progress or 0) - (self.kanae_stored_progress or 0)
|
||||
|
||||
@property
|
||||
def progress_before_linkplay_boost(self) -> float:
|
||||
return self.progress_normalized + (self.character_bonus_progress_normalized or 0)
|
||||
|
||||
@property
|
||||
def partner_adjusted_prog(self) -> float:
|
||||
@@ -1025,9 +1074,13 @@ class WorldPlay(BaseWorldPlay):
|
||||
prog += self.prog_skill_increase
|
||||
return prog
|
||||
|
||||
@property
|
||||
def partner_multiply(self) -> float:
|
||||
return self.partner_adjusted_prog / 50
|
||||
|
||||
@property
|
||||
def progress_normalized(self) -> float:
|
||||
return self.base_progress * (self.partner_adjusted_prog / 50)
|
||||
return self.base_progress * self.partner_multiply
|
||||
|
||||
def after_update(self) -> None:
|
||||
'''世界模式更新'''
|
||||
@@ -1093,8 +1146,6 @@ class BeyondWorldPlay(BaseWorldPlay):
|
||||
r['pre_boost_progress'] = self.progress_normalized * \
|
||||
self.user_play.fragment_multiply / 100
|
||||
|
||||
r['partner_multiply'] = self.partner_multiply
|
||||
|
||||
if self.over_skill_increase is not None:
|
||||
r['char_stats']['over_skill_increase'] = self.over_skill_increase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user