b
This commit is contained in:
1 parent
cb10fbfc7d
commit
0b3282da5c
4 files changed
+530
-1160
No files matched your search
+51
-20
@@ -4,7 +4,7 @@ class AppStrings {
|
||||
// Tab
|
||||
static const tabHome = '主页';
|
||||
static const tabTickets = '票据';
|
||||
static const tabTransfer = '发包';
|
||||
static const tabTransfer = '传分';
|
||||
static const tabSettings = '设置';
|
||||
static const tabAbout = '关于';
|
||||
|
||||
@@ -118,7 +118,7 @@ class AppStrings {
|
||||
static String ticketCooldownNotice(int remaining) =>
|
||||
'登录后需冷却 $ticketCooldownSeconds 秒,剩余 $remaining 秒后可使用功能票。';
|
||||
static String packetCooldownNotice(int remaining) =>
|
||||
'登录后需冷却 $ticketCooldownSeconds 秒,剩余 $remaining 秒后可发包。';
|
||||
'登录后需冷却 $ticketCooldownSeconds 秒,剩余 $remaining 秒后可上传成绩。';
|
||||
|
||||
// Settings
|
||||
static const titleServerSettings = 'Title Server 设置';
|
||||
@@ -163,28 +163,59 @@ class AppStrings {
|
||||
static const importFailed = '导入失败:剪贴板内容无效';
|
||||
static const noConfigToExport = '没有可导出的配置';
|
||||
|
||||
// Transfer Package (发包)
|
||||
static const transferTitle = '发包 (UpsertUserAll)';
|
||||
static const transferDesc = '拉取用户数据后,可修改角色槽位、锁定槽位和角色等级,然后发包回服务器。';
|
||||
// Transfer Score (传分 / UpsertUserAll 上传成绩)
|
||||
static const transferTitle = '传送分数';
|
||||
static const transferDesc =
|
||||
'新版本机台容易崩溃导致成绩传不上去。在此填入一首歌的成绩,程序会作为一次有效游玩记录上传回服务器。';
|
||||
static const transferFetchData = '拉取数据';
|
||||
static const transferFetching = '拉取中...';
|
||||
static const transferNotLoggedIn = '尚未登录游戏服务器,无法发包。';
|
||||
static const transferCharaSlot = '角色槽位 (charaSlot)';
|
||||
static const transferCharaLockSlot = '锁定槽位 (charaLockSlot)';
|
||||
static const transferCharacterLevels = '角色等级 (userCharacterList)';
|
||||
static const transferAddCharacter = '添加角色';
|
||||
static const transferCharacterId = '角色ID';
|
||||
static const transferLevel = '等级';
|
||||
static const transferAwakening = '觉醒';
|
||||
static const transferSend = '发包';
|
||||
static const transferSending = '发送中...';
|
||||
static const transferSuccess = '发包完成';
|
||||
static const transferFailed = '发包失败';
|
||||
static const transferUploadingPlaylog = '上传游戏记录...';
|
||||
static const transferRefetch = '重新拉取';
|
||||
static const transferNotLoggedIn = '尚未登录游戏服务器,无法上传成绩。';
|
||||
static const transferDataReady = '数据已就绪,填写下方成绩后点击上传。';
|
||||
|
||||
// Score form
|
||||
static const scoreFormTitle = '成绩信息';
|
||||
static const scoreMusicId = '歌曲 ID (musicId)';
|
||||
static const scoreLevel = '难度';
|
||||
static const scoreAchievement = '达成率 (achievement)';
|
||||
static const scoreAchievementHint = '例如 1010000 = 101.0000%';
|
||||
static const scoreComboStatus = 'Combo 状态';
|
||||
static const scoreSyncStatus = 'Sync 状态';
|
||||
static const scoreDeluxscore = 'DX 分 (deluxscoreMax)';
|
||||
static const scorePlayCount = '游玩次数 (playCount)';
|
||||
static const scoreRankLabel = '评级 (自动)';
|
||||
static const scoreInvalidInput = '请填写有效的歌曲 ID 与达成率。';
|
||||
|
||||
static const List<String> levelLabels = [
|
||||
'Basic (绿)',
|
||||
'Advanced (黄)',
|
||||
'Expert (红)',
|
||||
'Master (紫)',
|
||||
'Re:Master (白)',
|
||||
];
|
||||
|
||||
static const List<String> comboStatusLabels = [
|
||||
'无',
|
||||
'FC (Full Combo)',
|
||||
'FC+ (Full Combo+)',
|
||||
'AP (All Perfect)',
|
||||
'AP+ (All Perfect+)',
|
||||
];
|
||||
|
||||
static const List<String> syncStatusLabels = [
|
||||
'无',
|
||||
'FS (Full Sync)',
|
||||
'FS+ (Full Sync+)',
|
||||
'FDX (Full Sync DX)',
|
||||
'FDX+ (Full Sync DX+)',
|
||||
];
|
||||
|
||||
static const transferSend = '上传成绩';
|
||||
static const transferSending = '上传中...';
|
||||
static const transferSuccess = '成绩上传完成';
|
||||
static const transferFailed = '成绩上传失败';
|
||||
static const transferSlotLabel = '槽位';
|
||||
static const transferNoData = '⚠️ 未拉取到用户数据,请先点「拉取数据」按钮获取。';
|
||||
static const transferDataLoaded = '数据已就绪,可在下方编辑后发送。';
|
||||
static const transferRemove = '移除';
|
||||
|
||||
// About
|
||||
static const aboutTitle = 'Project Ichino';
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
class UserCharacter {
|
||||
int characterId;
|
||||
int level;
|
||||
int awakening;
|
||||
int useCount;
|
||||
|
||||
UserCharacter({
|
||||
required this.characterId,
|
||||
this.level = 1,
|
||||
this.awakening = 0,
|
||||
this.useCount = 0,
|
||||
});
|
||||
|
||||
factory UserCharacter.fromJson(Map<String, dynamic> json) {
|
||||
return UserCharacter(
|
||||
characterId: (json['characterId'] as num).toInt(),
|
||||
level: (json['level'] as num?)?.toInt() ?? 1,
|
||||
awakening: (json['awakening'] as num?)?.toInt() ?? 0,
|
||||
useCount: (json['useCount'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'characterId': characterId,
|
||||
'level': level,
|
||||
'awakening': awakening,
|
||||
'useCount': useCount,
|
||||
};
|
||||
}
|
||||
|
||||
/// The full UpsertUserAll API payload, constructed from fetched user data
|
||||
/// and editable fields (charaSlot, charaLockSlot, character levels).
|
||||
/// and an editable single-song score.
|
||||
class UpsertUserAllPayload {
|
||||
final int userId;
|
||||
final int playlogId;
|
||||
@@ -40,15 +10,6 @@ class UpsertUserAllPayload {
|
||||
/// The entire [upsertUserAll] sub-object from the JSON.
|
||||
final Map<String, dynamic> upsertUserAll;
|
||||
|
||||
/// Editable character slots (5 elements).
|
||||
final List<int> charaSlot;
|
||||
|
||||
/// Editable locked character slots (5 elements).
|
||||
final List<int> charaLockSlot;
|
||||
|
||||
/// Editable character list.
|
||||
final List<UserCharacter> userCharacterList;
|
||||
|
||||
/// Minimal playlog entry (required — server rejects empty playlogList).
|
||||
final Map<String, dynamic>? userPlaylog;
|
||||
|
||||
@@ -59,25 +20,11 @@ class UpsertUserAllPayload {
|
||||
this.isFreePlay = false,
|
||||
required this.loginDateTime,
|
||||
required this.upsertUserAll,
|
||||
required this.charaSlot,
|
||||
required this.charaLockSlot,
|
||||
required this.userCharacterList,
|
||||
this.userPlaylog,
|
||||
});
|
||||
|
||||
/// Serialize to the JSON packet expected by UpsertUserAllApi.
|
||||
Map<String, dynamic> toJson() {
|
||||
final copy = Map<String, dynamic>.from(upsertUserAll);
|
||||
final userData = List<Map<String, dynamic>>.from(
|
||||
(copy['userData'] as List<dynamic>)
|
||||
.map((e) => Map<String, dynamic>.from(e as Map)),
|
||||
);
|
||||
userData[0]['charaSlot'] = charaSlot;
|
||||
userData[0]['charaLockSlot'] = charaLockSlot;
|
||||
copy['userData'] = userData;
|
||||
copy['userCharacterList'] =
|
||||
userCharacterList.map((c) => c.toJson()).toList();
|
||||
|
||||
return {
|
||||
'userId': userId,
|
||||
'playlogId': playlogId,
|
||||
@@ -85,7 +32,7 @@ class UpsertUserAllPayload {
|
||||
'isFreePlay': isFreePlay,
|
||||
'loginDateTime': loginDateTime,
|
||||
'userPlaylogList': userPlaylog != null ? [userPlaylog] : <dynamic>[],
|
||||
'upsertUserAll': copy,
|
||||
'upsertUserAll': upsertUserAll,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Editable JSON fields that feed into the UpsertUserAll payload.
|
||||
/// Defaults match the Python script at E:\eaquira\sdgb\payload.py.
|
||||
class AdvancedFields {
|
||||
String userItemList;
|
||||
String userMapList;
|
||||
String userLoginBonusList;
|
||||
String userGetPointList;
|
||||
String userTradeItemList;
|
||||
|
||||
AdvancedFields({
|
||||
this.userItemList = '[]',
|
||||
this.userMapList = '[]',
|
||||
this.userLoginBonusList = '[]',
|
||||
this.userGetPointList = '[]',
|
||||
this.userTradeItemList = '[]',
|
||||
});
|
||||
|
||||
List<dynamic>? _parse(String src) {
|
||||
try {
|
||||
final decoded = jsonDecode(src);
|
||||
return decoded is List ? decoded : null;
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
List<dynamic> parsedUserItemList(String fb) => _parse(userItemList) ?? const [];
|
||||
List<dynamic> parsedUserMapList(String fb) => _parse(userMapList) ?? const [];
|
||||
List<dynamic> parsedUserLoginBonusList(String fb) => _parse(userLoginBonusList) ?? const [];
|
||||
List<dynamic> parsedUserGetPointList(String fb) => _parse(userGetPointList) ?? const [];
|
||||
List<dynamic> parsedUserTradeItemList(String fb) => _parse(userTradeItemList) ?? const [];
|
||||
|
||||
Map<String, String> toJson() => {
|
||||
'userItemList': userItemList,
|
||||
'userMapList': userMapList,
|
||||
'userLoginBonusList': userLoginBonusList,
|
||||
'userGetPointList': userGetPointList,
|
||||
'userTradeItemList': userTradeItemList,
|
||||
};
|
||||
|
||||
factory AdvancedFields.fromJson(Map<String, String> json) {
|
||||
return AdvancedFields(
|
||||
userItemList: json['userItemList'] ?? '[]',
|
||||
userMapList: json['userMapList'] ?? '[]',
|
||||
userLoginBonusList: json['userLoginBonusList'] ?? '[]',
|
||||
userGetPointList: json['userGetPointList'] ?? '[]',
|
||||
userTradeItemList: json['userTradeItemList'] ?? '[]',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Page that lets users paste raw JSON for advanced UpsertUserAll fields.
|
||||
class TransferAdvancedPage extends StatefulWidget {
|
||||
final AdvancedFields initial;
|
||||
|
||||
const TransferAdvancedPage({
|
||||
super.key,
|
||||
required this.initial,
|
||||
});
|
||||
|
||||
@override
|
||||
State<TransferAdvancedPage> createState() => _TransferAdvancedPageState();
|
||||
}
|
||||
|
||||
class _TransferAdvancedPageState extends State<TransferAdvancedPage> {
|
||||
late final List<_FieldMeta> _fields;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_fields = [
|
||||
_FieldMeta('userItemList', '物品列表', widget.initial.userItemList),
|
||||
_FieldMeta('userMapList', '地图列表', widget.initial.userMapList),
|
||||
_FieldMeta('userLoginBonusList', '登录奖励', widget.initial.userLoginBonusList),
|
||||
_FieldMeta('userGetPointList', '获取点数', widget.initial.userGetPointList),
|
||||
_FieldMeta('userTradeItemList', '交易物品', widget.initial.userTradeItemList),
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
for (final f in _fields) {
|
||||
f.ctrl.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
AdvancedFields get values => AdvancedFields(
|
||||
userItemList: _fields[0].ctrl.text,
|
||||
userMapList: _fields[1].ctrl.text,
|
||||
userLoginBonusList: _fields[2].ctrl.text,
|
||||
userGetPointList: _fields[3].ctrl.text,
|
||||
userTradeItemList: _fields[4].ctrl.text,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('高级字段'),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.check),
|
||||
tooltip: '保存并返回',
|
||||
onPressed: () => Navigator.of(context).pop(values),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orange.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Text(
|
||||
'以下字段默认来自 Python 脚本 (空数组 [] )。如需覆盖,请粘贴完整 JSON 数组。错误格式将回退为 []。',
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: Colors.orange.shade800,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
for (final field in _fields) _buildFieldCard(theme, field),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFieldCard(ThemeData theme, _FieldMeta field) {
|
||||
return Card(
|
||||
elevation: 0,
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(
|
||||
color: theme.colorScheme.outline.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
field.label,
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
field.ctrl.text = '[]';
|
||||
},
|
||||
child: Text('重置', style: theme.textTheme.labelSmall),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextField(
|
||||
controller: field.ctrl,
|
||||
maxLines: 6,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 12,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
contentPadding: const EdgeInsets.all(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _FieldMeta {
|
||||
final String key;
|
||||
final String label;
|
||||
final TextEditingController ctrl;
|
||||
|
||||
_FieldMeta(this.key, this.label, String initial)
|
||||
: ctrl = TextEditingController(text: initial);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user