Skip to content

Commit

Permalink
Merge pull request #140 from Lost-MSth/dev
Browse files Browse the repository at this point in the history
Update to v2.11.3
  • Loading branch information
Lost-MSth authored Dec 3, 2023
2 parents 5a4ff11 + de1d46f commit b6663ac
Show file tree
Hide file tree
Showing 31 changed files with 877 additions and 209 deletions.
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ This procedure is mainly used for study and research, and shall not be used for
## 特性 Features

:x: : 不支持 Not supported
:warning: : 可能存在问题 / 可能与官方不一样 Possible issues / may differ from official
:wastebasket: : 不再更新,可能会移除或重构 No longer updated, may be removed or refactored
:x: : 不支持 Not supported
:warning: : 可能存在问题 / 可能与官方不一样 Possible issues / may differ from official
:wastebasket: : 不再更新,可能会移除或重构 No longer updated, may be removed or refactored
:construction: : 建设中 In construction

- 登录、注册 Login and registration
Expand Down Expand Up @@ -86,14 +86,32 @@ It is just so interesting. What it can do is under exploration.
> 其它小改动请参考各个 commit 信息
> Please refer to the commit messages for other minor changes.
### Version 2.11.2

- 适用于 Arcaea 4.4.6 版本 For Arcaea 4.4.6
- 新搭档 **奈美(暮光)** 已解锁 Unlock the character **Nami (Twilight)**.
- 新增用户潜力值每日记录功能 Add support for recording users' potential each day.
- 修复搭档 **光 & 对立(Reunion)** 无法觉醒的问题 Fix a bug that the character **Hikari & Tairitsu (Reunion)** cannot be uncapped. (#100)
- 添加 `finale/finale_end` 接口尝试修复最终挑战无法解锁结局的问题 Add the `finale/finale_end` endpoint to try to fix the problem that the endings cannot be unlocked correctly in the finale challenge. (#110)
- 新增获取用户潜力值记录的 API 接口 Add an API endpoint for getting the user's rating records.
### Version 2.11.3

> v2.11.2.1 ~ v2.11.2.7 for Arcaea 4.5.0 ~ 5.2.0
- 适用于 Arcaea 5.2.0 版本
For Arcaea 5.2.0
- 新搭档 **Ilith & Ivy****Hikari & Vanessa****摩耶****露恩** 已解锁(注意“ 洞烛(至高:第八探索者)”因客户端因素不可选用)
Unlock the character **Ilith & Ivy**, **Hikari & Vanessa**, **Maya**, and **Luin**. (Note that "Insight(Ascendant - 8th Seeker)" is not available due to the client.)
- 为以上角色的技能提供服务端支持
Provide server-side support for the skills of the above characters.
- 设置中新增可选选项 `DOWNLOAD_FORBID_WHEN_NO_ITEM` 使得当 `songlist` 文件存在时,没有购买的用户无法下载曲目文件(实验性)
An option `DOWNLOAD_FORBID_WHEN_NO_ITEM` has been added to the config file to make that users cannot download the songs' files if they has not bought them when the `songlist` file exists. (Experimental)
- 支持文件 `video_720.mp4` & `video_1080.mp4` 的下载
Add support for downloading `video_720.mp4` & `video_1080.mp4`.
- 在存档全解锁和 `songlist` 解析器中支持更多东西,以适应游戏更新
Support more things in full cloud save unlocking and `songlist` parser, to adapt to game updates.
- Link Play 拥有更详细的控制台日志了
More detailed console log for Link Play.
- 修复一些搭档的技能在世界模式进度中显示不正确的问题
Fix a bug that some characters' skill cannot display proper values in world mode progression.
- 修复技能 "skill_mithra" 导致了 `prog` 值增加而不是世界模式进度增加的问题
Fix a bug that "skill_mithra" results in adding `prog` value instead of world mode progress.
- 重构 Link Play TCP 数据交换部分,以获得更好的安全性和扩展性
Code refactor of Link Play TCP data transmission for better security and scalability.
- 新增一个 HTTP API 用来获取 Link Play 中当前的房间和玩家信息
Add an HTTP API endpoint for getting the information of current rooms and players in Link Play.

## 运行环境与依赖 Running environment and requirements

Expand Down
15 changes: 5 additions & 10 deletions latest version/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
from flask import Blueprint

from . import (users, songs, token, system, items,
purchases, presents, redeems, characters)
purchases, presents, redeems, characters, multiplay)

bp = Blueprint('api', __name__, url_prefix='/api/v1')
bp.register_blueprint(users.bp)
bp.register_blueprint(songs.bp)
bp.register_blueprint(token.bp)
bp.register_blueprint(system.bp)
bp.register_blueprint(items.bp)
bp.register_blueprint(purchases.bp)
bp.register_blueprint(presents.bp)
bp.register_blueprint(redeems.bp)
bp.register_blueprint(characters.bp)
l = [users, songs, token, system, items, purchases,
presents, redeems, characters, multiplay]
for i in l:
bp.register_blueprint(i.bp)
21 changes: 21 additions & 0 deletions latest version/api/multiplay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from flask import Blueprint, request

from core.linkplay import RemoteMultiPlayer

from .api_auth import api_try, request_json_handle, role_required
from .api_code import success_return


bp = Blueprint('multiplay', __name__, url_prefix='/multiplay')


@bp.route('/rooms', methods=['GET'])
@role_required(request, ['select'])
@request_json_handle(request, optional_keys=['offset', 'limit'])
@api_try
def rooms_get(data, user):
'''获取房间列表'''

r = RemoteMultiPlayer().get_rooms(offset=data.get(
'offset', 0), limit=data.get('limit', 100))
return success_return(r)
8 changes: 6 additions & 2 deletions latest version/api/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ def users_user_put(data, user, user_id):
u.set_name(data['name'])
r['name'] = u.name
if 'password' in data:
u.set_password(data['password'])
r['password'] = u.hash_pwd
if data['password'] == '':
u.password = ''
r['password'] = ''
else:
u.set_password(data['password'])
r['password'] = u.hash_pwd
if 'email' in data:
u.set_email(data['email'])
r['email'] = u.email
Expand Down
41 changes: 31 additions & 10 deletions latest version/core/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ def __init__(self, c, character_id=None, user=None) -> None:
self.character_id = character_id
self.user = user

self.skill_flag: bool = None

@property
def skill_id_displayed(self) -> str:
'''对外显示的技能id'''
Expand All @@ -226,6 +228,12 @@ def skill_id_displayed(self) -> str:
return self.skill.skill_id
return None

@property
def skill_state(self) -> str:
if self.skill_id_displayed == 'skill_maya':
return 'add_random' if self.skill_flag else 'remove_random'
return None

def select_character_uncap_condition(self, user=None):
# parameter: user - User类或子类的实例
# 获取此角色的觉醒信息
Expand Down Expand Up @@ -255,20 +263,22 @@ def select_character_info(self, user=None):
if y is None:
raise NoData('The character of the user does not exist.')

self.name = y[7]
self.char_type = y[22]
self.name = y[8]
self.char_type = y[23]
self.is_uncapped = y[4] == 1
self.is_uncapped_override = y[5] == 1
self.level.level = y[2]
self.level.exp = y[3]
self.level.max_level = y[8]
self.frag.set_parameter(y[9], y[12], y[15])
self.prog.set_parameter(y[10], y[13], y[16])
self.overdrive.set_parameter(y[11], y[14], y[17])
self.skill.skill_id = y[18]
self.skill.skill_id_uncap = y[21]
self.skill.skill_unlock_level = y[19]
self.skill.skill_requires_uncap = y[20] == 1
self.level.max_level = y[9]
self.frag.set_parameter(y[10], y[13], y[16])
self.prog.set_parameter(y[11], y[14], y[17])
self.overdrive.set_parameter(y[12], y[15], y[18])
self.skill.skill_id = y[19]
self.skill.skill_id_uncap = y[22]
self.skill.skill_unlock_level = y[20]
self.skill.skill_requires_uncap = y[21] == 1

self.skill_flag = y[6] == 1

if self.character_id in (21, 46):
self.voice = [0, 1, 2, 3, 100, 1000, 1001]
Expand Down Expand Up @@ -302,6 +312,11 @@ def to_dict(self) -> dict:
r['fatalis_is_limited'] = False # emmmmmmm
if self.character_id in [1, 6, 7, 17, 18, 24, 32, 35, 52]:
r['base_character_id'] = 1

x = self.skill_state
if x:
r['skill_state'] = x

return r

def change_uncap_override(self, user=None):
Expand Down Expand Up @@ -409,6 +424,12 @@ def upgrade_by_core(self, user=None, core=None):
core.user_claim_item(self.user)
self.upgrade(self.user, - core.amount * Constant.CORE_EXP)

def change_skill_state(self) -> None:
'''翻转技能状态,目前为 skill_miya 专用'''
self.skill_flag = not self.skill_flag
self.c.execute(f'''update {self.database_table_name} set skill_flag = ? where user_id = ? and character_id = ?''', (
1 if self.skill_flag else 0, self.user.user_id, self.character_id))


class UserCharacterList:
'''
Expand Down
5 changes: 4 additions & 1 deletion latest version/core/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Config:

SONG_FILE_HASH_PRE_CALCULATE = True

GAME_API_PREFIX = '/pollen/22'
GAME_API_PREFIX = '/evolution/23'

ALLOW_APPVERSION = [] # list[str]

Expand All @@ -23,6 +23,7 @@ class Config:
LINKPLAY_TCP_PORT = 10901
LINKPLAY_AUTHENTICATION = 'my_link_play_server'
LINKPLAY_DISPLAY_HOST = ''
LINKPLAY_TCP_SECRET_KEY = '1145141919810'

SSL_CERT = ''
SSL_KEY = ''
Expand All @@ -48,6 +49,8 @@ class Config:
DOWNLOAD_TIMES_LIMIT = 3000
DOWNLOAD_TIME_GAP_LIMIT = 1000

DOWNLOAD_FORBID_WHEN_NO_ITEM = False

LOGIN_DEVICE_NUMBER_LIMIT = 1
ALLOW_LOGIN_SAME_DEVICE = False
ALLOW_BAN_MULTIDEVICE_USER_AUTO = True
Expand Down
9 changes: 8 additions & 1 deletion latest version/core/constant.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .config_manager import Config

ARCAEA_SERVER_VERSION = 'v2.11.2'
ARCAEA_SERVER_VERSION = 'v2.11.2.7'
ARCAEA_LOG_DATBASE_VERSION = 'v1.1'


Expand All @@ -19,6 +19,11 @@ class Constant:
LEVEL_STEPS = {1: 0, 2: 50, 3: 100, 4: 150, 5: 200, 6: 300, 7: 450, 8: 650, 9: 900, 10: 1200, 11: 1600, 12: 2100, 13: 2700, 14: 3400, 15: 4200, 16: 5100,
17: 6100, 18: 7200, 19: 8500, 20: 10000, 21: 11500, 22: 13000, 23: 14500, 24: 16000, 25: 17500, 26: 19000, 27: 20500, 28: 22000, 29: 23500, 30: 25000}

WORLD_VALUE_NAME_ENUM = ['frag', 'prog', 'over']

FREE_PACK_NAME = 'base'
SINGLE_PACK_NAME = 'single'

ETO_UNCAP_BONUS_PROGRESS = 7
LUNA_UNCAP_BONUS_PROGRESS = 7
AYU_UNCAP_BONUS_PROGRESS = 5
Expand Down Expand Up @@ -51,6 +56,8 @@ class Constant:
LINKPLAY_TCP_PORT = Config.LINKPLAY_TCP_PORT
LINKPLAY_UDP_PORT = Config.LINKPLAY_UDP_PORT
LINKPLAY_AUTHENTICATION = Config.LINKPLAY_AUTHENTICATION
LINKPLAY_TCP_SECRET_KEY = Config.LINKPLAY_TCP_SECRET_KEY
LINKPLAY_TCP_MAX_LENGTH = 0x0FFFFFFF

# Well, I can't say a word when I see this.
FINALE_SWITCH = [
Expand Down
Loading

0 comments on commit b6663ac

Please sign in to comment.