mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-14 22:04:36 +01:00
Initial commit
This commit is contained in:
69
sdk_server/__init__.py
Normal file
69
sdk_server/__init__.py
Normal file
@@ -0,0 +1,69 @@
|
||||
from game_server.config import *
|
||||
from sdk_server.controllers.account_controller import account_blueprint
|
||||
from sdk_server.controllers.config_controller import config_blueprint
|
||||
from sdk_server.controllers.dispatch_controller import dispatch_blueprint
|
||||
|
||||
class VerboseLevel(Enum):
|
||||
SILENT = 0
|
||||
NORMAL = 1
|
||||
DEBUG = 2
|
||||
|
||||
class RequestLoggingMiddleware:
|
||||
suppressed_routes = ["/report", "/sdk/dataUpload"]
|
||||
|
||||
def __init__(self, app, verbose_level):
|
||||
self.app = app
|
||||
self.verbose_level = verbose_level
|
||||
|
||||
def __call__(self, environ, start_response):
|
||||
path = environ.get('PATH_INFO', '')
|
||||
method = environ.get('REQUEST_METHOD', '').upper()
|
||||
|
||||
def custom_start_response(status, headers, *args):
|
||||
status_code = int(status.split()[0])
|
||||
|
||||
if self.verbose_level.value > VerboseLevel.NORMAL.value:
|
||||
Info(f"{status_code} {method} {path}")
|
||||
elif self.verbose_level.value > VerboseLevel.SILENT.value and path not in self.suppressed_routes:
|
||||
Info(f"{status_code} {method} {path}")
|
||||
|
||||
return start_response(status, headers, *args)
|
||||
|
||||
return self.app(environ, custom_start_response)
|
||||
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
app.wsgi_app = RequestLoggingMiddleware(app.wsgi_app, verbose_level=VerboseLevel.NORMAL)
|
||||
|
||||
|
||||
resources_path = Path(__file__).resolve().parent.parent / "resources/statics"
|
||||
if not resources_path.exists():
|
||||
resources_path.mkdir(parents=True)
|
||||
|
||||
@app.route('/statics/<path:filename>')
|
||||
def serve_statics(filename):
|
||||
return send_from_directory(resources_path, filename)
|
||||
|
||||
app.register_blueprint(account_blueprint)
|
||||
app.register_blueprint(config_blueprint)
|
||||
app.register_blueprint(dispatch_blueprint)
|
||||
|
||||
def HandleSdkServer(ServerIp, GameServerPort, SdkServerPort):
|
||||
app.config['SERVER_IP'] = ServerIp
|
||||
app.config['GAME_SERVER_PORT'] = GameServerPort
|
||||
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
|
||||
Info("HTTP server started on port 80")
|
||||
|
||||
app.run(host=ServerIp, port=SdkServerPort)
|
||||
|
||||
def HandleSslSdkServer():
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
Info("HTTPS server started on port 443")
|
||||
app.run(host='127.0.0.1', port=443,ssl_context='adhoc')
|
||||
121
sdk_server/controllers/account_controller.py
Normal file
121
sdk_server/controllers/account_controller.py
Normal file
@@ -0,0 +1,121 @@
|
||||
import json
|
||||
from flask import Blueprint, request, jsonify
|
||||
from sdk_server.models.risky_check import RiskyCheck,DataScheme
|
||||
from sdk_server.models.granter_login_body import GranterLoginBody
|
||||
|
||||
account_blueprint = Blueprint('account', __name__)
|
||||
|
||||
@account_blueprint.route('/account/risky/api/check', methods=['POST'])
|
||||
def check_risky():
|
||||
return jsonify({
|
||||
"retcode":0,
|
||||
"message":"",
|
||||
"data":{
|
||||
"id":"",
|
||||
"action":"ACTION_NONE",
|
||||
"geetest":None
|
||||
}
|
||||
})
|
||||
|
||||
@account_blueprint.route('/<game_biz>/combo/granter/login/v2/login', methods=['POST'])
|
||||
def granter_login(game_biz):
|
||||
body = request.json
|
||||
granter_login_body = GranterLoginBody(**body)
|
||||
|
||||
granter_login_body_data = json.loads(granter_login_body.data)
|
||||
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"combo_id": "0",
|
||||
"open_id": granter_login_body_data['uid'],
|
||||
"combo_token": granter_login_body_data['token'],
|
||||
"data": {"guest": granter_login_body_data['guest']},
|
||||
"heartbeat": False,
|
||||
"account_type": 1
|
||||
}
|
||||
})
|
||||
|
||||
@account_blueprint.route('/<game_biz>/mdk/shield/api/verify', methods=['POST'])
|
||||
def verify_shield(game_biz):
|
||||
shield_login_response = {
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"account": {
|
||||
"uid": "1337",
|
||||
"name": "Miku",
|
||||
"email": "",
|
||||
"mobile": "",
|
||||
"is_email_verify": "0",
|
||||
"realname": "",
|
||||
"identity_card": "",
|
||||
"token": "12931313131",
|
||||
"safe_mobile": "",
|
||||
"facebook_name": "",
|
||||
"google_name": "",
|
||||
"twitter_name": "",
|
||||
"game_center_name": "",
|
||||
"apple_name": "",
|
||||
"sony_name": "",
|
||||
"tap_name": "",
|
||||
"country": "SG",
|
||||
"reactivate_ticket": "",
|
||||
"area_code": "**",
|
||||
"device_grant_ticket": "",
|
||||
"steam_name": "",
|
||||
"unmasked_email": "",
|
||||
"unmasked_email_type": 0
|
||||
},
|
||||
"device_grant_required": False,
|
||||
"safe_mobile_required": False,
|
||||
"realperson_required": False,
|
||||
"reactivate_required": False,
|
||||
"realname_operation": "None"
|
||||
}
|
||||
}
|
||||
|
||||
return jsonify(shield_login_response)
|
||||
|
||||
@account_blueprint.route('/<game_biz>/mdk/shield/api/login', methods=['POST'])
|
||||
def shield_login(game_biz):
|
||||
|
||||
shield_login_response = {
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"account": {
|
||||
"uid": "1337",
|
||||
"name": "Miku",
|
||||
"email": "",
|
||||
"mobile": "",
|
||||
"is_email_verify": "0",
|
||||
"realname": "",
|
||||
"identity_card": "",
|
||||
"token": "12931313131",
|
||||
"safe_mobile": "",
|
||||
"facebook_name": "",
|
||||
"google_name": "",
|
||||
"twitter_name": "",
|
||||
"game_center_name": "",
|
||||
"apple_name": "",
|
||||
"sony_name": "",
|
||||
"tap_name": "",
|
||||
"country": "SG",
|
||||
"reactivate_ticket": "",
|
||||
"area_code": "**",
|
||||
"device_grant_ticket": "",
|
||||
"steam_name": "",
|
||||
"unmasked_email": "",
|
||||
"unmasked_email_type": 0
|
||||
},
|
||||
"device_grant_required": False,
|
||||
"safe_mobile_required": False,
|
||||
"realperson_required": False,
|
||||
"reactivate_required": False,
|
||||
"realname_operation": "None"
|
||||
}
|
||||
}
|
||||
|
||||
return jsonify(shield_login_response)
|
||||
204
sdk_server/controllers/config_controller.py
Normal file
204
sdk_server/controllers/config_controller.py
Normal file
@@ -0,0 +1,204 @@
|
||||
from flask import Blueprint, jsonify, request
|
||||
import random
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
config_blueprint = Blueprint('config', __name__)
|
||||
|
||||
@config_blueprint.route('/<game_biz>/mdk/agreement/api/getAgreementInfos', methods=['GET'])
|
||||
def get_agreement_infos(game_biz):
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"marketing_agreements": []
|
||||
}
|
||||
})
|
||||
|
||||
@config_blueprint.route('/data_abtest_api/config/experiment/list', methods=['POST'])
|
||||
def get_experiment_list():
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"success": True,
|
||||
"message": "",
|
||||
"data": []
|
||||
})
|
||||
|
||||
@config_blueprint.route('/account/device/api/listNewerDevices', methods=['POST'])
|
||||
def list_newer_devices():
|
||||
return jsonify({
|
||||
"data": {
|
||||
"devices": [],
|
||||
"latest_id": "0"
|
||||
},
|
||||
"message": "OK",
|
||||
"retcode": 0
|
||||
})
|
||||
|
||||
@config_blueprint.route('/<game_biz>/combo/granter/api/getConfig', methods=['GET'])
|
||||
def get_config(game_biz):
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"protocol": True,
|
||||
"qr_enabled": False,
|
||||
"log_level": "DEBUG",
|
||||
"announce_url": f"https://127.0.0.1/bh3/announcement/",
|
||||
"push_alias_type": 2,
|
||||
"disable_ysdk_guard": False,
|
||||
"enable_announce_pic_popup": False,
|
||||
"app_name": "崩坏3-东南亚",
|
||||
"qr_enabled_apps": {
|
||||
"bbs": False,
|
||||
"cloud": False
|
||||
},
|
||||
"qr_app_icons": {
|
||||
"app": "",
|
||||
"bbs": "",
|
||||
"cloud": ""
|
||||
},
|
||||
"qr_cloud_display_name": ""
|
||||
}
|
||||
})
|
||||
|
||||
@config_blueprint.route('/game_weather/weather/get_weather', methods=['GET'])
|
||||
def get_weather():
|
||||
weather_data = {
|
||||
"Retcode": 0,
|
||||
"Message": "OK",
|
||||
"Data": {
|
||||
"Timezone": 8,
|
||||
"Hourly": []
|
||||
}
|
||||
}
|
||||
for i in range(24):
|
||||
date_time = (datetime.now() + timedelta(hours=i)).strftime("%Y-%m-%d %H")
|
||||
weather_data["Data"]["Hourly"].append({
|
||||
"Condition": 1,
|
||||
"Date": date_time.split()[0],
|
||||
"Hour": int(date_time.split()[1].split(':')[0]),
|
||||
"Temp": random.randint(20, 30)
|
||||
})
|
||||
return jsonify(weather_data)
|
||||
|
||||
@config_blueprint.route('/<game_biz>/mdk/shield/api/loadConfig', methods=['GET'])
|
||||
def load_config(game_biz):
|
||||
game_key = request.args.get('game_key', '')
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"id": 16,
|
||||
"game_key": game_key,
|
||||
"client": "PC",
|
||||
"identity": "I_IDENTITY",
|
||||
"guest": False,
|
||||
"ignore_versions": "",
|
||||
"scene": "S_NORMAL",
|
||||
"name": "崩坏3rd-东南亚",
|
||||
"disable_regist": False,
|
||||
"enable_email_captcha": False,
|
||||
"thirdparty": [],
|
||||
"disable_mmt": False,
|
||||
"server_guest": False,
|
||||
"thirdparty_ignore": {},
|
||||
"enable_ps_bind_account": False,
|
||||
"thirdparty_login_configs": {},
|
||||
"initialize_firebase": False
|
||||
}
|
||||
})
|
||||
|
||||
@config_blueprint.route('/combo/box/api/config/sdk/combo', methods=['GET'])
|
||||
def sdk_combo():
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"vals": {
|
||||
"list_price_tierv2_enable": "false",
|
||||
"network_report_config": {
|
||||
"enable": 0,
|
||||
"status_codes": [206],
|
||||
"url_paths": ["dataUpload", "red_dot"]
|
||||
},
|
||||
"kibana_pc_config": {
|
||||
"enable": 1,
|
||||
"level": "Debug",
|
||||
"modules": ["download"]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@config_blueprint.route('/device-fp/api/getExtList', methods=['GET'])
|
||||
def get_ext_list():
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"code": 200,
|
||||
"msg": "ok",
|
||||
"ext_list": [
|
||||
"cpuName", "deviceModel", "deviceName", "deviceType", "deviceUID", "gpuID", "gpuName", "gpuAPI",
|
||||
"gpuVendor", "gpuVersion", "gpuMemory", "osVersion", "cpuCores", "cpuFrequency", "gpuVendorID",
|
||||
"isGpuMultiTread", "memorySize", "screenSize", "engineName", "addressMAC"
|
||||
],
|
||||
"pkg_list": [],
|
||||
"pkg_str": "/vK5WTh5SS3SAj8Zm0qPWg=="
|
||||
}
|
||||
})
|
||||
|
||||
@config_blueprint.route('/device-fp/api/getFp', methods=['GET'])
|
||||
def get_fp():
|
||||
device_fp = request.args.get('device_fp', '')
|
||||
return jsonify({
|
||||
"data": {
|
||||
"code": 200,
|
||||
"device_fp": device_fp,
|
||||
"msg": "ok"
|
||||
},
|
||||
"message": "OK",
|
||||
"retcode": 0
|
||||
})
|
||||
|
||||
@config_blueprint.route('/report', methods=['GET'])
|
||||
def report():
|
||||
return "GET LOG"
|
||||
|
||||
@config_blueprint.route('/admin/mi18n/<path:remainder>', methods=['GET'])
|
||||
def admin_mi18n(remainder):
|
||||
return jsonify({
|
||||
"version": 74
|
||||
})
|
||||
|
||||
@config_blueprint.route('/sdk/dataUpload', methods=['GET'])
|
||||
def data_upload():
|
||||
return jsonify({
|
||||
"code": 0
|
||||
})
|
||||
|
||||
@config_blueprint.route('/<game_biz>/combo/granter/api/compareProtocolVersion', methods=['POST'])
|
||||
def compare_protocol_version(game_biz):
|
||||
body = request.json
|
||||
app_id = body.get('AppId')
|
||||
language = body.get('Language')
|
||||
return jsonify({
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"modified": True,
|
||||
"protocol": {
|
||||
"id": 0,
|
||||
"app_id": app_id,
|
||||
"language": language,
|
||||
"user_proto": "",
|
||||
"priv_proto": "",
|
||||
"major": 0,
|
||||
"minimum": 3,
|
||||
"create_time": "0",
|
||||
"teenager_proto": "",
|
||||
"third_proto": ""
|
||||
}
|
||||
}
|
||||
})
|
||||
198
sdk_server/controllers/dispatch_controller.py
Normal file
198
sdk_server/controllers/dispatch_controller.py
Normal file
@@ -0,0 +1,198 @@
|
||||
from game_server.config import *
|
||||
|
||||
dispatch_blueprint = Blueprint('dispatch', __name__)
|
||||
|
||||
@dispatch_blueprint.route('/query_dispatch', methods=['GET'])
|
||||
def query_dispatch():
|
||||
version = request.args.get('version')
|
||||
response_data = {
|
||||
'retcode': 0,
|
||||
'region_list': [{
|
||||
'retcode': 0,
|
||||
'dispatch_url': f"http://{Config.GameServer.Ip}/query_gateway",
|
||||
'name': Config.RegionName,
|
||||
'title': "",
|
||||
'ext': get_ext(version)
|
||||
}]
|
||||
}
|
||||
return jsonify(response_data)
|
||||
|
||||
@dispatch_blueprint.route('/query_gateway', methods=['GET'])
|
||||
def query_gateway():
|
||||
version = request.args.get('version')
|
||||
gameserver = {
|
||||
'ip': Config.GameServer.Ip,
|
||||
'port': Config.GameServer.Port
|
||||
}
|
||||
|
||||
response_data = {
|
||||
'retcode': 0,
|
||||
'msg': "",
|
||||
'region_name': Config.RegionName,
|
||||
'account_url': f"http://{Config.GameServer.Ip}/account",
|
||||
'account_url_backup': f"http://{Config.GameServer.Ip}/account",
|
||||
'asset_bundle_url_list': get_asset_bundle_url_list(version),
|
||||
'ex_audio_and_video_url_list': get_ex_audio_and_video_url_list(version),
|
||||
'ex_resource_url_list': get_ex_resource_url_list(version),
|
||||
'ext': get_ext(version),
|
||||
'gameserver': gameserver,
|
||||
'gateway': gameserver,
|
||||
'is_data_ready': True,
|
||||
'oaserver_url': f"http://{Config.GameServer.Ip}/oaserver",
|
||||
'server_cur_time': int(time.time()),
|
||||
'server_cur_timezone': 8,
|
||||
'server_ext': {
|
||||
'cdkey_url': f"http://{Config.GameServer.Ip}/common",
|
||||
'mihoyo_sdk_env': "2"
|
||||
}
|
||||
}
|
||||
|
||||
return jsonify(response_data)
|
||||
|
||||
def get_ext(version):
|
||||
return {
|
||||
'ai_use_asset_bundle': "0" if Config.UseLocalCache else "1",
|
||||
'apm_log_level': "0",
|
||||
'apm_log_dest': "2",
|
||||
'apm_switch': "0",
|
||||
'apm_switch_game_log': "1",
|
||||
'apm_switch_crash': "1",
|
||||
'block_error_dialog': "1",
|
||||
'elevator_model_path': "GameEntry/EVA/StartLoading_Model",
|
||||
'data_use_asset_bundle': "1",
|
||||
'enable_watermark': "1",
|
||||
'ex_audio_and_video_url_list': get_ex_audio_and_video_url_list(version),
|
||||
'ex_res_buff_size': "10485760",
|
||||
'ex_res_pre_publish': "0",
|
||||
'ex_res_use_http': "1",
|
||||
'ex_resource_url_list': get_ex_resource_url_list(version),
|
||||
'is_xxxx': "0",
|
||||
'mtp_switch': "0",
|
||||
'network_feedback_enable': "0",
|
||||
'offline_report_switch': "0",
|
||||
'forbid_recharge': "1",
|
||||
'is_checksum_off': "0" if Config.UseLocalCache else "1",
|
||||
'res_use_asset_bundle': "1",
|
||||
'show_version_text': "0",
|
||||
'update_streaming_asb': "0",
|
||||
'use_multy_cdn': "1",
|
||||
'show_bulletin_button': "1",
|
||||
'show_bulletin_empty_dialog_bg': "0"
|
||||
}
|
||||
|
||||
def get_asset_bundle_url_list(version):
|
||||
# Compile the regex pattern
|
||||
regex = re.compile(r"^(.*?)_(os|gf|global)_(.*?)$")
|
||||
match = regex.match(version)
|
||||
value = match.group(2)
|
||||
if Config.UseLocalCache:
|
||||
return get_local_url_list(value, version)
|
||||
# Proceed if there's a match
|
||||
if match:
|
||||
# Return URLs based on the OS type
|
||||
if value == "os":
|
||||
return [
|
||||
"https://bundle-aliyun-os.honkaiimpact3.com/asset_bundle/overseas01/1.1",
|
||||
"https://hk-bundle-os-mihayo.akamaized.net/asset_bundle/overseas01/1.1"
|
||||
]
|
||||
elif value == "gf":
|
||||
if "beta" in version:
|
||||
return [
|
||||
"https://autopatchbeta.bh3.com/asset_bundle/beta_release/1.0",
|
||||
"https://autopatchbeta.bh3.com/asset_bundle/beta_release/1.0"
|
||||
]
|
||||
return [
|
||||
"https://bundle-qcloud.bh3.com/asset_bundle/android01/1.0",
|
||||
"https://bundle.bh3.com/asset_bundle/android01/1.0"
|
||||
]
|
||||
elif value == "global":
|
||||
return [
|
||||
"http://hk-bundle-west-mihayo.akamaized.net/asset_bundle/usa01/1.1",
|
||||
"http://bundle-aliyun-usa.honkaiimpact3.com/asset_bundle/usa01/1.1"
|
||||
]
|
||||
else:
|
||||
return [
|
||||
"https://bundle-aliyun-os.honkaiimpact3.com/asset_bundle/overseas01/1.1",
|
||||
"https://hk-bundle-os-mihayo.akamaized.net/asset_bundle/overseas01/1.1"
|
||||
]
|
||||
return []
|
||||
|
||||
def get_ex_audio_and_video_url_list(version):
|
||||
# Compile the regex pattern
|
||||
regex = re.compile(r"^(.*?)_(os|gf|global)_(.*?)$")
|
||||
match = regex.match(version)
|
||||
value = match.group(2)
|
||||
if Config.UseLocalCache:
|
||||
return get_local_url_list(value, version)
|
||||
if match:
|
||||
# Return URLs based on the OS type
|
||||
if value == "os":
|
||||
return [
|
||||
"bigfile-aliyun-os.honkaiimpact3.com/com.miHoYo.bh3oversea",
|
||||
"hk-bigfile-os-mihayo.akamaized.net/com.miHoYo.bh3oversea"
|
||||
]
|
||||
elif value == "gf":
|
||||
if "beta" in version:
|
||||
return [
|
||||
"autopatchbeta.bh3.com/tmp/CGAudio",
|
||||
"autopatchbeta.bh3.com/tmp/CGAudio"
|
||||
]
|
||||
return [
|
||||
"bh3rd-beta-qcloud.bh3.com/tmp/CGAudio",
|
||||
"bh3rd-beta.bh3.com/tmp/CGAudio"
|
||||
]
|
||||
elif value == "global":
|
||||
return [
|
||||
"bh3rd-beta-qcloud.bh3.com/tmp/CGAudio",
|
||||
"bh3rd-beta.bh3.com/tmp/CGAudio"
|
||||
]
|
||||
else:
|
||||
return [
|
||||
"bh3rd-beta-qcloud.bh3.com/tmp/CGAudio",
|
||||
"bh3rd-beta.bh3.com/tmp/CGAudio"
|
||||
]
|
||||
return []
|
||||
|
||||
def get_ex_resource_url_list(version):
|
||||
# Compile the regex pattern
|
||||
regex = re.compile(r"^(.*?)_(os|gf|global)_(.*?)$")
|
||||
match = regex.match(version)
|
||||
value = match.group(2)
|
||||
if Config.UseLocalCache:
|
||||
return get_local_url_list(value, version)
|
||||
# Proceed if there's a match
|
||||
if match:
|
||||
# Return URLs based on the OS type
|
||||
if value == "os":
|
||||
return [
|
||||
"bigfile-aliyun-os.honkaiimpact3.com/com.miHoYo.bh3oversea",
|
||||
"hk-bigfile-os-mihayo.akamaized.net/com.miHoYo.bh3oversea"
|
||||
]
|
||||
elif value == "gf":
|
||||
if "beta" in version:
|
||||
return [
|
||||
"autopatchbeta.bh3.com/tmp/beta",
|
||||
"autopatchbeta.bh3.com/tmp/beta"
|
||||
]
|
||||
return [
|
||||
"bundle-qcloud.bh3.com/tmp/Original",
|
||||
"bundle.bh3.com/tmp/Original"
|
||||
]
|
||||
elif value == "global":
|
||||
return [
|
||||
"hk-bundle-west-mihayo.akamaized.net/tmp/com.miHoYo.bh3global",
|
||||
"bigfile-aliyun-usa.honkaiimpact3.com/tmp/com.miHoYo.bh3global"
|
||||
]
|
||||
else:
|
||||
return [
|
||||
"bigfile-aliyun-os.honkaiimpact3.com/com.miHoYo.bh3oversea",
|
||||
"hk-bigfile-os-mihayo.akamaized.net/com.miHoYo.bh3oversea"
|
||||
]
|
||||
return []
|
||||
|
||||
def get_local_url_list(type, version):
|
||||
return [
|
||||
f"http://{Config.GameServer.Ip}/statics/{type}/{version.replace('.', '_')}",
|
||||
f"http://{Config.GameServer.Ip}/statics/{type}/{version.replace('.', '_')}"
|
||||
]
|
||||
|
||||
21
sdk_server/models/granter_login_body.py
Normal file
21
sdk_server/models/granter_login_body.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# sdkserver/models/granter_login_body.py
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
class GranterLoginBodyData(BaseModel):
|
||||
uid: str
|
||||
guest: bool
|
||||
token: str
|
||||
|
||||
class GranterLoginBody(BaseModel):
|
||||
app_id: int
|
||||
channel_id: int
|
||||
data: str # Assuming this is a JSON string that can be parsed
|
||||
device: str
|
||||
sign: str
|
||||
|
||||
@property
|
||||
def parsed_data(self) -> GranterLoginBodyData:
|
||||
"""Parse the data field into a GranterLoginBodyData instance."""
|
||||
return GranterLoginBodyData.parse_raw(self.data)
|
||||
14
sdk_server/models/risky_check.py
Normal file
14
sdk_server/models/risky_check.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# sdkserver/models/risky_check.py
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
class DataScheme(BaseModel):
|
||||
id: str
|
||||
action: str
|
||||
geetest: Optional[object]
|
||||
|
||||
class RiskyCheck(BaseModel):
|
||||
retcode: int
|
||||
message: str
|
||||
data: DataScheme
|
||||
5
sdk_server/models/shield_verify_body.py
Normal file
5
sdk_server/models/shield_verify_body.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
class ShieldVerifyBody(BaseModel):
|
||||
token: str
|
||||
uid: str
|
||||
Reference in New Issue
Block a user