Skip to content

Commit

Permalink
Update to v1.7
Browse files Browse the repository at this point in the history
close #1
close #2
  • Loading branch information
Lost-MSth committed Nov 27, 2020
1 parent 30690b2 commit dfcbb6f
Show file tree
Hide file tree
Showing 22 changed files with 1,635 additions and 296 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ This is a small local Arcaea server based on Python and Flask, which can simulat
- 爬梯 Climbing steps
- 自定义世界模式 Customizable World Mode
- 自定义歌曲下载 Customizable songs download
- 单曲和曲包购买(没啥用) Single songs and song packs purchase(useless)
- 全角色立绘 All character drawings
- 角色技能 Character skills
- 自定义角色属性 Customizable characters attributes
- 全剧情解锁 Unlock all the stories
- 后台查分 Background search scores
- 后台自定义歌曲定数 Customize chart consts in the background
- 后台查询 Background search
- 后台自定义信息 Customize some things in the background
- 成绩校验 Score check
- 下载校验 Download check

没有以下 We don't have:
- 角色数值 Character characteristic value
- 购买 Purchase
- 歌曲解锁、曲包解锁 Songs unlocking and music packs unlocking
- 数据同步的时间和设备记录 The record of time and device for data synchronization
- 服务器安全性保证 Server security assurance

可能有问题 There may be problems:
- Recent 30
- 一些歌曲的解锁 Some Songs' unlocking

## 说明 Statement
只是很有趣,用处探索中。
Expand All @@ -53,13 +54,16 @@ It is just so interesting. What it can do is under exploration.
>
> Tips: When updating, please keep the original database in case of data loss.
### Version 1.6
- 适用于Arcaea 3.2.3版本 For Arcaea 3.2.3
### Version 1.7
- 仍然适用于Arcaea 3.2.3版本 Still for Arcaea 3.2.3
- 更新了歌曲数据库 Update the song database.
- 新增了自定义角色属性 Add customizable characters attributes.
- 用户的记忆源点可以修改了,但仍然没有实际用途 The users' memories can be modified, but still is of no practical use.
- 网页端安全性增强,用户名及密码可修改 The security of webpage is enhanced, and the username and password can be modified now.
- 改进了数据库更新方式,可以一定程度上应对数据表结构修改 The method of database updating is improved, which can deal with the modification of data table structure to some extent.
- 新增了购买系统,包括单曲购买和曲包购买 Add purchase system, including single purchase and pack purchase.
- 后台查询与修改项目增多 Increase background query and modification items.
- 新增用户下载量限制和下载校验 Add user download limit and download verification.
- 新增了****的语音 Add the voice of **Yume**.
- 新增了网站图标 Add a favicon.
- 尝试解锁了所有的场景 Try to unlock all the scenes.
- 修复了一些Bug Fix some bugs.

## 运行环境与依赖 Running environment and requirements
- Windows操作系统 Windows operating system
Expand All @@ -81,7 +85,9 @@ It is just so interesting. What it can do is under exploration.

## 鸣谢 Thanks
歌曲数据库来自 Using song database from
[BotArcAPI releases](https://github.com/TheSnowfield/BotArcAPI/releases)
[BotArcAPI releases](https://github.com/TheSnowfield/BotArcAPI/releases)

网站图标来自 Using favicon from [black fate - てんてん - pixiv](https://www.pixiv.net/artworks/82374369)

## 联系方式 Contact
如有必要,可以联系本人 Contact me if necessary
Expand Down
Binary file modified latest version/database/arcaea_database.db
Binary file not shown.
Binary file modified latest version/database/arcsong.db
Binary file not shown.
124 changes: 91 additions & 33 deletions latest version/database/database_initialize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sqlite3
import hashlib
import time
import json

# 数据库初始化文件,删掉arcaea_database.db文件后运行即可,谨慎使用

Expand Down Expand Up @@ -171,59 +172,116 @@
prog_boost_multiply int,
primary key(user_id, song_id, difficulty)
);''')
c.execute('''create table if not exists download_token(user_id int,
song_id text,
file_name text,
token text,
time int,
primary key(user_id, song_id, file_name)
);''')
c.execute('''create table if not exists user_download(user_id int,
token text,
time int,
primary key(user_id, token, time)
);''')
c.execute('''create table if not exists item(item_id text,
type text,
is_available int,
price int,
orig_price int,
discount_from int,
discount_to int,
_id text,
primary key(item_id, type)
);''')
c.execute('''create table if not exists user_item(user_id int,
item_id text,
type text,
primary key(user_id, item_id, type)
);''')

char = ['Hikari','Tairitsu','Kou','Sapphire','Lethe','','Tairitsu(Axium)'
,'Tairitsu(Grievous Lady)','Stella','Hikari & Fisica','Ilith','Eto','Luna'
,'Shirabe','Hikari(Zero)','Hikari(Fracture)','Hikari(Summer)','Tairitsu(Summer)'
,'Tairitsu&Trin','Ayu','Eto&Luna','Yume','Seine & Hikari','Saya','Tairitsu & Chuni Penguin'
,'Chuni Penguin','Haruna','Nono','MTA-XXX','MDA-21','Kanae','Hikari(Fantasia)','Tairitsu(Sonata)','Sia','DORO*C'
,'Tairitsu(Tempest)','Brillante','Ilith(Summer)','Etude']
char = ['Hikari', 'Tairitsu', 'Kou', 'Sapphire', 'Lethe', '', 'Tairitsu(Axium)', 'Tairitsu(Grievous Lady)', 'Stella', 'Hikari & Fisica', 'Ilith', 'Eto', 'Luna', 'Shirabe', 'Hikari(Zero)', 'Hikari(Fracture)', 'Hikari(Summer)', 'Tairitsu(Summer)', 'Tairitsu&Trin',
'Ayu', 'Eto&Luna', 'Yume', 'Seine & Hikari', 'Saya', 'Tairitsu & Chuni Penguin', 'Chuni Penguin', 'Haruna', 'Nono', 'MTA-XXX', 'MDA-21', 'Kanae', 'Hikari(Fantasia)', 'Tairitsu(Sonata)', 'Sia', 'DORO*C', 'Tairitsu(Tempest)', 'Brillante', 'Ilith(Summer)', 'Etude']

skill_id = ['gauge_easy','','','','note_mirror','','','gauge_hard','frag_plus_10_pack_stellights','gauge_easy|frag_plus_15_pst&prs'
,'gauge_hard|fail_frag_minus_100','frag_plus_5_side_light','visual_hide_hp','frag_plus_5_side_conflict'
,'challenge_fullcombo_0gauge','gauge_overflow','gauge_easy|note_mirror','note_mirror'
,'visual_tomato_pack_tonesphere','frag_rng_ayu','gaugestart_30|gaugegain_70','combo_100-frag_1'
,'audio_gcemptyhit_pack_groovecoaster','gauge_saya','gauge_chuni','kantandeshou'
,'gauge_haruna','frags_nono','gauge_pandora','gauge_regulus','omatsuri_daynight'
,'','','sometimes(note_mirror|frag_plus_5)','scoreclear_aa|visual_scoregauge','gauge_tempest'
,'gauge_hard','gauge_ilith_summer','']
skill_id = ['gauge_easy', '', '', '', 'note_mirror', '', '', 'gauge_hard', 'frag_plus_10_pack_stellights', 'gauge_easy|frag_plus_15_pst&prs', 'gauge_hard|fail_frag_minus_100', 'frag_plus_5_side_light', 'visual_hide_hp', 'frag_plus_5_side_conflict', 'challenge_fullcombo_0gauge', 'gauge_overflow', 'gauge_easy|note_mirror', 'note_mirror', 'visual_tomato_pack_tonesphere',
'frag_rng_ayu', 'gaugestart_30|gaugegain_70', 'combo_100-frag_1', 'audio_gcemptyhit_pack_groovecoaster', 'gauge_saya', 'gauge_chuni', 'kantandeshou', 'gauge_haruna', 'frags_nono', 'gauge_pandora', 'gauge_regulus', 'omatsuri_daynight', '', '', 'sometimes(note_mirror|frag_plus_5)', 'scoreclear_aa|visual_scoregauge', 'gauge_tempest', 'gauge_hard', 'gauge_ilith_summer', '']

skill_id_uncap = ['','','frags_kou','','visual_ink','','','','','','','','','shirabe_entry_fee','','','','','','','','frags_yume','','','','','','','','','','','','','','','','','']
skill_id_uncap = ['', '', 'frags_kou', '', 'visual_ink', '', '', '', '', '', '', '', '', 'shirabe_entry_fee',
'', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']

for i in range(0, 39):
if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21]:
sql = 'insert into character values('+str(i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',1,1)'''
sql = 'insert into character values('+str(
i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',1,1)'''
c.execute(sql)
else:
if i != 5:
sql = 'insert into character values('+str(i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',0,0)'''
sql = 'insert into character values('+str(
i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',0,0)'''
c.execute(sql)


def b2int(x):
# int与布尔值转换
if x:
return 1
else:
return 0


def insert_items(c, items):
# 物品数据导入
for i in items:
if 'discount_from' not in i:
discount_from = -1
else:
discount_from = i['discount_from']
if 'discount_to' not in i:
discount_to = -1
else:
discount_to = i['discount_to']
for j in i['items']:
if "_id" not in j:
_id = ''
else:
_id = j['_id']
if j['type'] != 'character':
c.execute('''insert into item(item_id, type, is_available, price, orig_price, discount_from, discount_to, _id) values(:a,:b,:c,:d,:e,:f,:g,:h)''', {
'a': j['id'], 'b': j['type'], 'c': b2int(j['is_available']), 'd': i['price'], 'e': i['orig_price'], 'f': discount_from, 'g': discount_to, 'h': _id})


f = open('singles.json', 'r')
singles = json.load(f)
f.close()
insert_items(c, singles)

f = open('packs.json', 'r')
packs = json.load(f)
f.close()
insert_items(c, packs)

conn.commit()
conn.close()



def arc_register(name: str, password: str):
def arc_register(name: str, password: str):
def build_user_code(c):
return '123456789'

def build_user_id(c):
return 2000000

## def insert_user_char(c, user_id):
## for i in range(0, 38):
## if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21]:
## sql = 'insert into user_char values('+str(user_id)+','+str(
## i)+''',30,25000,25000,90,90,90,'',0,0,'',0,1,1)'''
## c.execute(sql)
## else:
## if i != 5:
## sql = 'insert into user_char values('+str(user_id)+','+str(
## i)+''',30,25000,25000,90,90,90,'',0,0,'',0,0,0)'''
## c.execute(sql)
# def insert_user_char(c, user_id):
# for i in range(0, 38):
# if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21]:
# sql = 'insert into user_char values('+str(user_id)+','+str(
# i)+''',30,25000,25000,90,90,90,'',0,0,'',0,1,1)'''
# c.execute(sql)
# else:
# if i != 5:
# sql = 'insert into user_char values('+str(user_id)+','+str(
# i)+''',30,25000,25000,90,90,90,'',0,0,'',0,0,0)'''
# c.execute(sql)
def insert_user_char(c, user_id):
# 为用户添加所有可用角色
c.execute('''select * from character''')
Expand All @@ -233,7 +291,6 @@ def insert_user_char(c, user_id):
c.execute('''insert into user_char values(:a,:b,:c,:d,:e,:f,:g,:h,:i,:j,:k,:l,:m,:n,:o)''', {
'a': user_id, 'b': i[0], 'c': i[2], 'd': i[3], 'e': i[4], 'f': i[5], 'g': i[6], 'h': i[7], 'i': i[8], 'j': i[9], 'k': i[10], 'l': i[11], 'm': i[12], 'n': i[14], 'o': i[15]})


conn = sqlite3.connect('arcaea_database.db')
c = conn.cursor()
hash_pwd = hashlib.sha256(password.encode("utf8")).hexdigest()
Expand All @@ -243,13 +300,14 @@ def insert_user_char(c, user_id):
user_code = build_user_code(c)
user_id = build_user_id(c)
now = int(time.time() * 1000)
c.execute('''insert into user(user_id, name, password, join_date, user_code, rating_ptt,
c.execute('''insert into user(user_id, name, password, join_date, user_code, rating_ptt,
character_id, is_skill_sealed, is_char_uncapped, is_char_uncapped_override, is_hide_rating, favorite_character, max_stamina_notification_enabled, current_map, ticket)
values(:user_id, :name, :password, :join_date, :user_code, 1250, 1, 0, 1, 0, 0, -1, 0, '', 114514)
''', {'user_code': user_code, 'user_id': user_id, 'join_date': now, 'name': name, 'password': hash_pwd})
c.execute('''insert into recent30(user_id) values(:user_id)''', {
'user_id': user_id})
c.execute('''insert into best_score values(2000000,'vexaria',3,10000000,100,0,0,0,100,0,1599667200,3,3,10.8)''')
c.execute(
'''insert into best_score values(2000000,'vexaria',3,10000000,100,0,0,0,100,0,1599667200,3,3,10.8)''')
insert_user_char(c, user_id)
conn.commit()
conn.close()
Expand Down
70 changes: 70 additions & 0 deletions latest version/database/map/byd_lumia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"map_id": "byd_lumia",
"is_legacy": false,
"chapter": 1001,
"available_from": -1,
"available_to": 9999999999999,
"is_repeatable": false,
"require_id": "lumia2",
"require_type": "chart_unlock",
"coordinate": "650,-650",
"is_beyond": true,
"stamina_cost": 3,
"beyond_health": 150,
"character_affinity": [0, 15, 14, 16],
"affinity_multiplier": [2.4, 1.9, 2.4, 2.9],
"step_count": 6,
"custom_bg": "",
"curr_position": 0,
"curr_capture": 0,
"is_locked": false,
"steps": [{
"map_id": "byd_lumia",
"position": 0,
"capture": 10,
"restrict_id": "core",
"restrict_type": "pack_id"
}, {
"map_id": "byd_lumia",
"position": 1,
"capture": 20,
"items": [{
"type": "fragment",
"amount": 200
}]
}, {
"map_id": "byd_lumia",
"position": 2,
"capture": 30,
"items": [{
"type": "core",
"id": "core_generic",
"amount": 1
}]
}, {
"map_id": "byd_lumia",
"position": 3,
"capture": 40,
"items": [{
"type": "fragment",
"amount": 250
}]
}, {
"map_id": "byd_lumia",
"position": 4,
"capture": 50,
"items": [{
"type": "core",
"id": "core_generic",
"amount": 1
}]
}, {
"map_id": "byd_lumia",
"position": 5,
"capture": 0,
"items": [{
"id": "lumia3",
"type": "world_song"
}]
}]
}
Loading

0 comments on commit dfcbb6f

Please sign in to comment.