feat: migrate platform login scenes and native login flows
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "6072a7f3-9095-4e71-9dbd-c952d89a64a7",
|
||||
"uuid": "aea92450-9c09-40ed-8a4d-5cced7a56b3b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "c1b8189d-1134-4ff3-9426-d2668fd9ab6f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2eb9409f-115d-4a7d-bdc4-30a333b57a28",
|
||||
"uuid": "0693ece5-bed1-4b21-8ae7-7393c2eee8a7",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "d8981b12-16b5-49a7-95d6-a51eb735462a",
|
||||
"uuid": "4deb8dec-916d-4dda-b709-ac5f38fa0253",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
@@ -70,7 +70,7 @@ function sample(random: () => number, key: string): number {
|
||||
return sampleLocalRandom(random, (reason, cause) => wrap(key, 'random', reason, cause));
|
||||
}
|
||||
|
||||
function generate(random: () => number, key: string): LoginAccountIdentity {
|
||||
export function generate(random: () => number, key: string): LoginAccountIdentity {
|
||||
const id = Math.floor(sample(random, key) * 100000);
|
||||
const avatar = AVATARS[Math.floor(sample(random, key) * AVATARS.length)]!;
|
||||
const sex = Math.floor(sample(random, key) * 2) + 1;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "aea065db-0dfa-4da8-a2cb-f1fe0165d910",
|
||||
"uuid": "bb7c9b58-c08f-4dc9-b8d1-57c2b20f9c28",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "8499ef07-6051-4d8f-aca6-11996e448b7f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
import type { LoginAccountIdentity, DeviceLoginMode } from '../../protocol/contracts/login-contract.ts';
|
||||
import type { LoginPolicy } from '../../presentation/login-policy.ts';
|
||||
import { generate } from '../local/visitor-account.ts';
|
||||
import { readPhoneCode } from './phone-code.ts';
|
||||
|
||||
export interface LoginNativeSettings {
|
||||
accreditlogin(provider: number): void;
|
||||
getcompareCode(): number | string;
|
||||
}
|
||||
interface Options {
|
||||
storage: {getItem(key:string):string|null;setItem(key:string,value:string):void};
|
||||
settings?:LoginNativeSettings; random():number; now():number;
|
||||
gameid:string|number;agentid:string|number;policy:LoginPolicy;
|
||||
submit(account:LoginAccountIdentity,device:DeviceLoginMode):void;tip(message:string):void;
|
||||
}
|
||||
|
||||
/** MD5 is the legacy nickname derivation, not a security primitive. */
|
||||
export function nicknameHash(input:string):string {
|
||||
const bytes=Array.from(new TextEncoder().encode(input));const bitLength=bytes.length*8;
|
||||
bytes.push(128);while(bytes.length%64!==56)bytes.push(0);
|
||||
for(let i=0;i<8;i++)bytes.push(i<4?(bitLength>>>(8*i))&255:0);
|
||||
const shifts=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21];
|
||||
let state=[0x67452301,0xefcdab89,0x98badcfe,0x10325476];
|
||||
for(let offset=0;offset<bytes.length;offset+=64){
|
||||
const words=Array.from({length:16},(_,j)=>bytes[offset+j*4]|bytes[offset+j*4+1]<<8|bytes[offset+j*4+2]<<16|bytes[offset+j*4+3]<<24);
|
||||
let [a,b,c,d]=state;
|
||||
for(let i=0;i<64;i++){
|
||||
const round=Math.floor(i/16);let f:number,g:number;
|
||||
if(round===0){f=(b&c)|(~b&d);g=i;}else if(round===1){f=(d&b)|(~d&c);g=(5*i+1)%16;}
|
||||
else if(round===2){f=b^c^d;g=(3*i+5)%16;}else{f=c^(b|~d);g=(7*i)%16;}
|
||||
const sum=(a+f+Math.floor(Math.abs(Math.sin(i+1))*4294967296)+words[g])|0;
|
||||
const shift=shifts[round*4+i%4];const next=(b+((sum<<shift)|(sum>>>(32-shift))))|0;
|
||||
a=d;d=c;c=b;b=next;
|
||||
}
|
||||
state=state.map((v,i)=>(v+[a,b,c,d][i])|0);
|
||||
}
|
||||
return state.map(v=>[0,8,16,24].map(s=>((v>>>s)&255).toString(16).padStart(2,'0')).join('')).join('');
|
||||
}
|
||||
function record(value:unknown):Record<string,unknown>{
|
||||
if(typeof value==='string')value=JSON.parse(value);
|
||||
if(!value||typeof value!=='object'||Array.isArray(value))throw Error('Invalid sharelogin account');
|
||||
return value as Record<string,unknown>;
|
||||
}
|
||||
function accountFrom(value:unknown):LoginAccountIdentity {
|
||||
const data=record(value);
|
||||
for(const field of ['openid','headimgurl','nickname','city','Province'])if(typeof data[field]!=='string')throw Error(`Invalid sharelogin.${field}`);
|
||||
if(typeof data.unionid!=='string'&&typeof data.unionid!=='number')throw Error('Invalid sharelogin.unionid');
|
||||
const sex=data.sex?data.sex:1; // Func.sharelogin explicitly owns this default.
|
||||
if(typeof sex!=='number'||!Number.isFinite(sex))throw Error('Invalid sharelogin.sex');
|
||||
if(!data.nickname&&!data.headimgurl)throw Error('授权失败,请重新授权!');
|
||||
return {openid:data.openid as string,avatar:data.headimgurl as string,nickname:data.nickname as string,
|
||||
city:data.city as string,province:data.Province as string,unionid:data.unionid as string|number,sex};
|
||||
}
|
||||
|
||||
/** Exact native/cached account boundary; UI never invents account or server fields. */
|
||||
/** 账户统一入口:协议确认、缓存选择、原生授权及提交模式均由此处管理。 */
|
||||
export class LoginAccounts {
|
||||
readonly versionState:0|1;
|
||||
private hiddenClicks=0;
|
||||
/** 每次启动默认同意;按钮、缓存登录及原生回调读取同一份状态。 */
|
||||
private agreementAccepted=true;
|
||||
get agreed():boolean{return this.agreementAccepted;}
|
||||
setAgreement(accepted:boolean):void{
|
||||
if(accepted&&!this.agreementAccepted)this.options.tip('');
|
||||
this.agreementAccepted=accepted;
|
||||
}
|
||||
/** 未同意时只提示,不调用授权、不写缓存、不提交请求。 */
|
||||
requireAgreement():boolean{
|
||||
if(this.agreementAccepted)return true;
|
||||
this.options.tip('未同意协议');return false;
|
||||
}
|
||||
constructor(private readonly options:Options){
|
||||
// Browser source explicitly uses the legacy getVersionState default of zero.
|
||||
const state=options.settings?Number(options.settings.getcompareCode()):0;
|
||||
if(state!==0&&state!==1)throw Error('Invalid getcompareCode result');this.versionState=state;
|
||||
}
|
||||
private read(key:string,cookie:boolean):Record<string,unknown>|null {
|
||||
if(cookie&&this.versionState===0){
|
||||
const expiry=this.options.storage.getItem('tsgame_validtime');
|
||||
if(expiry===null)return null;
|
||||
if(!Number.isFinite(Number(expiry)))throw Error('Invalid tsgame_validtime');
|
||||
if(this.options.now()>=Number(expiry))return null;
|
||||
}
|
||||
const raw=this.options.storage.getItem(key);return raw===null?null:record(raw);
|
||||
}
|
||||
private save(account:LoginAccountIdentity,key:string,telphone?:string){
|
||||
const data={openid:account.openid,headimgurl:account.avatar,nickname:account.nickname,sex:account.sex,
|
||||
city:account.city,Province:account.province,unionid:account.unionid,...(telphone===undefined?{}:{telphone})};
|
||||
this.options.storage.setItem('tsgame_validtime',String(this.options.now()+48*60*60*1000));
|
||||
this.options.storage.setItem(key,JSON.stringify(data));
|
||||
}
|
||||
/** 保留原工程缓存优先级,游客开关先于手机模式判断。 */
|
||||
cached():LoginAccountIdentity|null {
|
||||
if(this.versionState!==0)return null;
|
||||
const policy=this.options.policy;
|
||||
const data=this.read(policy.showVisitor?'tsgame_visitorinfo':policy.deviceLogin?'tsgame_devicePlayer':'tsgame_wxinfo',true);
|
||||
return data===null?null:accountFrom(data);
|
||||
}
|
||||
autoLogin():void {
|
||||
if(!this.requireAgreement())return;
|
||||
const account=this.cached();if(account===null)throw Error('No cached login');
|
||||
// showVisitor selects the visitor cache above, even when the phone button is enabled.
|
||||
if(!this.options.policy.showVisitor&&this.options.policy.deviceLogin){
|
||||
const data=this.read('tsgame_devicePlayer',true)!;
|
||||
if(typeof data.telphone!=='string')throw Error('Cached device account missing telphone');
|
||||
this.options.submit(account,{enabled:true,telphone:data.telphone});
|
||||
}else this.options.submit(account,{enabled:false});
|
||||
}
|
||||
authorize(provider:'wechat'|'qq'):void {
|
||||
if(!this.requireAgreement())return;
|
||||
if(!this.options.settings){this.options.tip('当前宿主未提供原生登录授权接口');return;}
|
||||
if(provider==='wechat')this.options.storage.setItem(`tsgame_playerid_${this.options.gameid}${this.options.agentid}`,'');
|
||||
this.options.settings.accreditlogin(provider==='wechat'?2:1);
|
||||
}
|
||||
acceptNative(data:unknown,channel:'global'|'bridge'):void {
|
||||
if(!this.requireAgreement())return;
|
||||
const account=accountFrom(data);
|
||||
this.save(account,channel==='global'&&this.options.policy.showVisitor?'tsgame_visitorinfo':'tsgame_wxinfo');
|
||||
this.options.submit(account,{enabled:false});
|
||||
}
|
||||
/** 仅本次手机登录要求 tel,不能依据按钮显示配置要求游客响应携带手机号。 */
|
||||
loginSucceeded(value:unknown,mode:DeviceLoginMode):void {
|
||||
const data=record(value);
|
||||
if(data.state!==0)throw Error('Cannot cache an unsuccessful login');
|
||||
if(typeof data.playerid!=='string'&&(typeof data.playerid!=='number'||!Number.isFinite(data.playerid)))throw Error('Invalid login playerid');
|
||||
// Button availability is not the authentication mode of this request.
|
||||
if(mode.enabled){
|
||||
if(typeof data.tel!=='string')throw Error('Device login response missing tel');
|
||||
const account=accountFrom({...data,headimgurl:data.avatar,Province:data.province});
|
||||
this.save(account,'tsgame_devicePlayer',data.tel);
|
||||
this.options.storage.setItem('tsgame_dLogin','1');
|
||||
}
|
||||
this.options.storage.setItem(`tsgame_playerid_${this.options.gameid}${this.options.agentid}`,String(data.playerid));
|
||||
}
|
||||
visitor():void {
|
||||
if(!this.requireAgreement())return;
|
||||
const cached=this.read('tsgame_visitorinfo',false);
|
||||
const account=cached===null?generate(this.options.random,'tsgame_visitorinfo'):accountFrom(cached);
|
||||
this.save(account,this.options.policy.showVisitor?'tsgame_visitorinfo':'tsgame_wxinfo');
|
||||
this.options.submit(account,{enabled:false});
|
||||
}
|
||||
hiddenFirst():void{this.hiddenClicks++;}
|
||||
phonePanelState(){return readPhoneCode(this.options.storage.getItem('sgame_phoneCode'),this.options.now());}
|
||||
hiddenSecond():void{if(this.hiddenClicks>=5&&this.options.policy.hiddenVisitor){this.hiddenClicks=0;this.visitor();}}
|
||||
private deviceAccount(phone?:string):LoginAccountIdentity {
|
||||
const cached=this.read('tsgame_devicePlayer',true);if(cached)return accountFrom(cached);
|
||||
let unionid:string;
|
||||
if(phone!==undefined)unionid=`phone_${phone}`;
|
||||
else {
|
||||
const info=this.read('tsgame_phoneInfo1',false);
|
||||
if(info&&typeof info.PhoneIMEI==='string'&&info.PhoneIMEI)unionid=info.PhoneIMEI;
|
||||
else {
|
||||
const sets=['0123456789','qwertyuioplkjhgfdsazxcvbnm','QWERTYUIOPLKJHGFDSAZXCVBNM'];
|
||||
unionid=Array.from({length:25},()=>{const chars=sets[Math.round(this.options.random()*2)];return chars[Math.ceil(this.options.random()*100000000)%chars.length];}).join('');
|
||||
this.options.storage.setItem('tsgame_phoneInfo1',JSON.stringify({...info,PhoneIMEI:unionid}));
|
||||
}
|
||||
}
|
||||
const {avatarUrl,avatarRange}=this.options.policy;
|
||||
return {openid:unionid,unionid,nickname:`User_${nicknameHash(unionid).slice(0,6)}`,
|
||||
avatar:avatarUrl?`${avatarUrl}${avatarRange[0]+Math.round(this.options.random()*(avatarRange[1]-avatarRange[0]))}.jpg`:'',
|
||||
sex:Math.floor(this.options.random()*2)+1,city:'China',province:phone===undefined?'HongKong':'ShangHai'};
|
||||
}
|
||||
device():void{if(!this.requireAgreement())return;this.options.submit(this.deviceAccount(),{enabled:false});}
|
||||
phone(phone:string,code:string):void {
|
||||
if(!this.requireAgreement())return;
|
||||
if(!phone||!code){this.options.tip('手机号与验证码均不能为空!');return;}
|
||||
this.options.submit(this.deviceAccount(phone),{enabled:true,telphone:phone,smmcode:code});
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2597060c-ad16-46f1-89ed-42bfaec74ad9",
|
||||
"uuid": "57d7618f-3e88-4036-83de-96a6e63be657",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "27e9345c-5f75-4829-be9f-174141dec6e6",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "df3fb4b3-bb92-40f7-b661-05a158dec617",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/** Logic.readPhoneCode: sgame_phoneCode owns the phone number and 30-second expiry. */
|
||||
export function readPhoneCode(raw:string|null,now:number):{phoneNumber:string;restTime:number}|null {
|
||||
if(raw===null)return null;
|
||||
const data=JSON.parse(raw);
|
||||
if(!data||typeof data!=='object'||typeof data.phoneNumber!=='string')throw Error('Invalid phoneCode.phoneNumber');
|
||||
if(!Object.prototype.hasOwnProperty.call(data,'codeTime')||!['string','number'].includes(typeof data.codeTime)||!Number.isFinite(Number(data.codeTime)))throw Error('Invalid phoneCode.codeTime');
|
||||
const elapsed=now-Number(data.codeTime);
|
||||
return {phoneNumber:data.phoneNumber,restTime:elapsed>30000?0:Math.trunc(30-elapsed/1000)};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "bb46066c-73af-4603-9f7a-5579a2ad030b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "588b5341-c0f6-4eef-bf31-b47c815db2b0",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -63,8 +63,9 @@ export function assertLocalStartupContext(context: LocalStartupContext): void {
|
||||
if (!startupConfig.useLocalServer) fail('useLocalServer', 'source must be true');
|
||||
if (config.mode !== 'debug') fail('mode', 'must be debug');
|
||||
if (config.isDebugger !== true) fail('isDebugger', 'must be true');
|
||||
if (config.source !== 'remote') fail('source', 'must be remote');
|
||||
if (config.gameserver !== startupConfig.gameserver) fail('gameserver', 'must equal startupConfig remote entry');
|
||||
if (config.source !== startupConfig.configSource) fail('source', 'must equal startupConfig.configSource');
|
||||
const configEntry = startupConfig.configSource === 'local' ? startupConfig.localConfigResource : startupConfig.gameserver;
|
||||
if (config.gameserver !== configEntry) fail('gameserver', 'must equal startupConfig selected entry');
|
||||
if (!config.remoteConfig || typeof config.remoteConfig.getValue !== 'function') fail('remoteConfig', 'must provide memory view');
|
||||
if (!config.rawConfig || config.rawConfig !== config.remoteConfig.raw) fail('rawConfig', 'must share remoteConfig.raw');
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1d920343-a60b-4b40-8eba-f29b4a7d53fa",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -13,6 +13,10 @@ export interface DebugAccount {
|
||||
|
||||
export interface StartupConfig {
|
||||
readonly mode: RuntimeMode;
|
||||
/** 配置内容来源;local 仅允许 debug,独立于 WebSocket 服务器选择。 */
|
||||
readonly configSource: 'remote' | 'local';
|
||||
/** resources 下的 txt 路径,不含扩展名。 */
|
||||
readonly localConfigResource: string;
|
||||
readonly gameserver: string;
|
||||
readonly useLocalServer: boolean;
|
||||
readonly localServers: readonly string[];
|
||||
@@ -21,7 +25,10 @@ export interface StartupConfig {
|
||||
/** 唯一发布配置入口;mode 与服务器选择互相独立。 */
|
||||
export const STARTUP_CONFIG: Readonly<StartupConfig> = Object.freeze({
|
||||
mode: 'debug',
|
||||
gameserver: 'https://tsgames.daoqi88.cn/config/update_jsonv2.txt',
|
||||
// 开发时改为 local,编辑 assets/resources/dev-config/update_jsonv2.txt 后重新预览。
|
||||
configSource: 'local',
|
||||
localConfigResource: 'dev-config/update_jsonv2',
|
||||
gameserver: 'https://tsgames.daoqi88.cn/config_test/update_jsonv2.txt',
|
||||
useLocalServer: true,
|
||||
localServers: Object.freeze(['ws://127.0.0.1:3088']),
|
||||
});
|
||||
@@ -46,6 +53,11 @@ export function validateLocalServer(value: string, field = 'localServers'): void
|
||||
export function validateStartupConfig(source: Readonly<StartupConfig>): Readonly<StartupConfig> {
|
||||
if (!source || typeof source !== 'object') invalid('source', 'must be an object');
|
||||
const mode = resolveRuntimeMode(source.mode);
|
||||
if (source.configSource !== 'remote' && source.configSource !== 'local') invalid('configSource', 'must be remote or local');
|
||||
if (source.configSource === 'local' && mode !== 'debug') invalid('configSource', 'local is only allowed in debug mode');
|
||||
if (typeof source.localConfigResource !== 'string' || !/^[a-zA-Z0-9_-]+(?:\/[a-zA-Z0-9_-]+)*$/.test(source.localConfigResource)) {
|
||||
invalid('localConfigResource', 'must be a resources path without extension or traversal');
|
||||
}
|
||||
if (typeof source.useLocalServer !== 'boolean') invalid('useLocalServer', 'must be boolean');
|
||||
if (typeof source.gameserver !== 'string' || source.gameserver.trim() !== source.gameserver) invalid('gameserver', 'must be http(s) URL');
|
||||
let url: URL;
|
||||
@@ -53,7 +65,7 @@ export function validateStartupConfig(source: Readonly<StartupConfig>): Readonly
|
||||
if (url.protocol !== 'http:' && url.protocol !== 'https:') invalid('gameserver', 'must be http(s) URL');
|
||||
if (!Array.isArray(source.localServers) || source.localServers.length === 0) invalid('localServers', 'must be a nonempty array');
|
||||
for (let index = 0; index < source.localServers.length; index++) validateLocalServer(source.localServers[index], 'localServers[' + index + ']');
|
||||
return Object.freeze({mode, gameserver:source.gameserver, useLocalServer:source.useLocalServer, localServers:Object.freeze([...source.localServers])});
|
||||
return Object.freeze({mode, configSource:source.configSource, localConfigResource:source.localConfigResource, gameserver:source.gameserver, useLocalServer:source.useLocalServer, localServers:Object.freeze([...source.localServers])});
|
||||
}
|
||||
|
||||
/** 忠实旧 min_replaceAll 链:- → /,# → :,再包成 http://...txt。 */
|
||||
|
||||
@@ -51,29 +51,52 @@ function validateHierarchy(scope: ConfigObject, depth: number): void {
|
||||
for (const entry of list) validateHierarchy(requireObject(entry, listName), depth + 1);
|
||||
}
|
||||
|
||||
/** Preserve first loose identity match, truthy overrides and whole-object replacement. */
|
||||
/**
|
||||
* Port of Game_Surface_3/12_Logic.js get_paravalue. Only GameData globals are
|
||||
* replaced with the resolved identity argument; lookup order and truthiness stay exact.
|
||||
* createRemoteConfig validates the downloaded JSON before exposing this reader.
|
||||
*/
|
||||
export function get_paravalue(
|
||||
o_config: { readonly data?: Readonly<ConfigObject> | null },
|
||||
paraname: string,
|
||||
identity: Readonly<ChannelIdentity>,
|
||||
): unknown {
|
||||
const {agentid, gameid, channelid, marketid} = identity;
|
||||
let paravalue: unknown = null;
|
||||
const do_get_para = (arylist: unknown, keyname: string, keyvalue: string | number): ConfigObject | null => {
|
||||
if (arylist && keyname && keyvalue) {
|
||||
const list = arylist as ConfigObject[];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i][keyname] == keyvalue) {
|
||||
if (list[i][paraname]) paravalue = list[i][paraname];
|
||||
return list[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
if (!o_config.data) return paravalue;
|
||||
if (o_config.data[paraname]) paravalue = o_config.data[paraname];
|
||||
const _o_agent = do_get_para(o_config.data.agentlist, 'agentid', agentid);
|
||||
if (!_o_agent) return paravalue;
|
||||
const _o_game = do_get_para(_o_agent.gamelist, 'gameid', gameid);
|
||||
if (!_o_game) return paravalue;
|
||||
const _o_channel = do_get_para(_o_game.channellist, 'channelid', channelid);
|
||||
if (!_o_channel) return paravalue;
|
||||
const _o_market = do_get_para(_o_channel.marketlist, 'marketid', marketid);
|
||||
if (!_o_market) return paravalue;
|
||||
return paravalue;
|
||||
}
|
||||
|
||||
/** All consumers share get_paravalue; no separate hierarchy or override rules. */
|
||||
export function createRemoteConfig(input: unknown, identity: Readonly<ChannelIdentity>): RemoteConfig {
|
||||
const raw = requireObject(input, 'root');
|
||||
validateHierarchy(raw, 0);
|
||||
const scopes = [raw];
|
||||
let scope = raw;
|
||||
for (const [listName, key] of SCOPES) {
|
||||
const list = scope[listName] as ConfigObject[] | undefined;
|
||||
// Legacy do_get_para skips any falsy identity, including numeric marketid=0.
|
||||
if (!list || !identity[key]) break;
|
||||
const match = list.find(entry => entry[key] == identity[key]);
|
||||
if (!match) break;
|
||||
scopes.push(match);
|
||||
scope = match;
|
||||
}
|
||||
const wrapper = {data: raw};
|
||||
return Object.freeze({
|
||||
raw,
|
||||
getValue(name: string): unknown {
|
||||
let value: unknown = null;
|
||||
for (const current of scopes) {
|
||||
if (Object.prototype.hasOwnProperty.call(current, name) && current[name]) value = current[name];
|
||||
}
|
||||
return value;
|
||||
return get_paravalue(wrapper, name, identity);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ export interface RuntimeConfig {
|
||||
readonly isDebugger: boolean;
|
||||
readonly identity: Readonly<ChannelIdentity>;
|
||||
readonly servers: readonly string[];
|
||||
readonly source: 'remote';
|
||||
readonly source: 'remote' | 'local';
|
||||
/** 实际读取入口:remote 为最终 URL,local 为 resources 资源路径。 */
|
||||
readonly gameserver: string;
|
||||
readonly rawConfig: RemoteConfig['raw'];
|
||||
readonly remoteConfig: RemoteConfig;
|
||||
@@ -44,6 +45,8 @@ export interface ResolveRuntimeConfigOptions {
|
||||
readonly win: NativeHost;
|
||||
readonly search: string;
|
||||
readonly fetcher: ConfigFetcher;
|
||||
/** 由引擎层注入项目 txt 读取器;仅 local 模式需要,缺失直接报错。 */
|
||||
readonly localFetcher?: ConfigFetcher;
|
||||
readonly cacheBust?: () => string;
|
||||
}
|
||||
|
||||
@@ -78,17 +81,21 @@ export async function resolveRuntimeConfig(
|
||||
const startupConfig = validateStartupConfig(options.startupConfig === undefined ? STARTUP_CONFIG : options.startupConfig);
|
||||
const identity = resolveHostIdentity(options);
|
||||
|
||||
const gameserver = resolveGameServer({
|
||||
// 先选择唯一来源;本地模式不读取或应用宿主的远程 gameconfig 覆盖。
|
||||
const local = startupConfig.configSource === 'local';
|
||||
const gameserver = local ? startupConfig.localConfigResource : resolveGameServer({
|
||||
configured: startupConfig.gameserver,
|
||||
injectedGameConfig: resolveInjectedGameConfig(options),
|
||||
});
|
||||
|
||||
const fetcher = local ? options.localFetcher : options.fetcher;
|
||||
if (!fetcher) throw new ConfigFetchError('本地配置缺少 localFetcher');
|
||||
let raw: unknown;
|
||||
try {
|
||||
raw = await options.fetcher.fetch(gameserver, options.cacheBust);
|
||||
raw = await fetcher.fetch(gameserver, options.cacheBust);
|
||||
} catch (error) {
|
||||
if (error instanceof ConfigFetchError || error instanceof ConfigParseError) throw error;
|
||||
throw new ConfigFetchError(`远程配置抓取失败: ${gameserver}`);
|
||||
throw new ConfigFetchError(`${local ? '本地配置读取失败' : '远程配置抓取失败'}: ${gameserver}`);
|
||||
}
|
||||
const remoteConfig = createRemoteConfig(raw, identity);
|
||||
const servers = startupConfig.useLocalServer ? startupConfig.localServers : parseUrlServers(remoteConfig);
|
||||
@@ -99,7 +106,7 @@ export async function resolveRuntimeConfig(
|
||||
isDebugger: startupConfig.mode === 'debug',
|
||||
identity,
|
||||
servers,
|
||||
source: 'remote',
|
||||
source: startupConfig.configSource,
|
||||
gameserver,
|
||||
rawConfig: remoteConfig.raw,
|
||||
remoteConfig,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "4e90f0c8-b271-40a4-9909-68aa8f7d5974",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -8,8 +8,9 @@ export const DEFAULT_LAUNCH_WAIT_TIME_MS = 10;
|
||||
* gameid 每子游戏固定写死;agentid/channelid/marketid/version 为默认,运行期由 query/native/profile 覆盖。
|
||||
*/
|
||||
export const BUILD_IDENTITY: ChannelIdentity = {
|
||||
agentid: 'veRa0qrBf0df2K1G4de2tgfmVxB2jxpv',
|
||||
channelid: 'FtJf073aa0d6rI1xD8J1Y42fINTm0ziK',
|
||||
// This game's entry in config_test/update_jsonv2.txt belongs to this agent/channel.
|
||||
agentid: '1B2h0ccl205c390Y28m1Ajdplkuu4wgy',
|
||||
channelid: 'aouv0LotK0pYyQ0Pdrx0CsdcaezfzrcG',
|
||||
gameid: 'J9r4022t80pxlb01zOK76DN1WD4QewFl',
|
||||
marketid: 4,
|
||||
version: 1, // 数字 versionCode(联调时改成本地服要求的版本号)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "613b0457-be57-44e3-a1fb-e5d086b69468",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "4098ba4c-c444-459f-9427-0412f1a15bb6",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1a6fd8e5-5d0c-4fbb-a035-ef3a4f90badd",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "92bf4247-2b4b-460d-8992-8922baf78df2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "ac23132b-03ac-47c4-b6f8-93602c94f080",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3e0b81db-7986-47f4-9e23-fbc9b47d8a36",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "9f495e9b-65ae-4b3e-b44c-9c9a91f6679f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "4f5169b6-e140-4a3a-9eed-e155fecf24df",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3b11f970-2e0d-4784-8d65-c0fcc5e4ac6a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "68da9cca-3c8e-400b-ba7e-539b49994ed4",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8eb5d9a1-cfd3-4df4-b311-c67cb7db4423",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "717f5c0e-b085-47f8-879c-1b605e4fc773",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8650f2a7-9471-4a3e-bec9-0aecf6405cdb",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import type { RemoteConfig } from '../config/remote-config.ts';
|
||||
|
||||
/** Defaults owned here reproduce 04_Data.js and Game_Surface_3 Debugger. */
|
||||
const LOGIN_DEFAULTS = Object.freeze({ deviceLogin:0, showVisitor:0, qqLogin:0,
|
||||
avatarUrl:'https://projectimage.tscce.cn/image_132/', avatarRange:[100,10000] as readonly number[],
|
||||
hiddenVisitor:true });
|
||||
export interface LoginPolicy {
|
||||
deviceLogin:boolean; showVisitor:boolean; qqLogin:boolean; hiddenVisitor:boolean;
|
||||
avatarUrl:string; avatarRange:readonly number[];
|
||||
}
|
||||
function flag(value:unknown, name:string):boolean {
|
||||
if (![0,1,false,true].includes(value as number)) throw Error(`Invalid login config ${name}`);
|
||||
return Boolean(value);
|
||||
}
|
||||
export function resolveLoginPolicy(remote:RemoteConfig):LoginPolicy {
|
||||
const hallValue=remote.getValue('hall_config');
|
||||
if (hallValue != null && (typeof hallValue!=='object' || Array.isArray(hallValue))) throw Error('Invalid hall_config');
|
||||
const hall=hallValue as Record<string,unknown> | null;
|
||||
// Legacy hall_config merge precedes hallConfigName top-level overrides.
|
||||
const hallField=(name:'showVisitor'|'qqLogin')=> {
|
||||
const override=remote.getValue(name);
|
||||
if(override!=null) return override;
|
||||
return hall && Object.prototype.hasOwnProperty.call(hall,name)?hall[name]:LOGIN_DEFAULTS[name];
|
||||
};
|
||||
const sourceField=(name:'deviceLogin'|'avatarUrl'|'avatarRange')=> {
|
||||
const value=remote.getValue(name);return value==null?LOGIN_DEFAULTS[name]:value;
|
||||
};
|
||||
const avatarUrl=sourceField('avatarUrl'),range=sourceField('avatarRange');
|
||||
if(typeof avatarUrl!=='string')throw Error('Invalid login config avatarUrl');
|
||||
if(!Array.isArray(range)||range.length!==2||range.some(v=>!Number.isInteger(v))||range[1]<=range[0])throw Error('Invalid login config avatarRange');
|
||||
return Object.freeze({deviceLogin:flag(sourceField('deviceLogin'),'deviceLogin'),
|
||||
showVisitor:flag(hallField('showVisitor'),'showVisitor'),qqLogin:flag(hallField('qqLogin'),'qqLogin'),
|
||||
hiddenVisitor:LOGIN_DEFAULTS.hiddenVisitor,avatarUrl,avatarRange:Object.freeze([...range])});
|
||||
}
|
||||
/** Assignment order is significant: JumpWxAuth applies showVisitor/QQ after cache hiding. */
|
||||
export function loginButtons(policy:LoginPolicy, versionState:0|1, cached:boolean) {
|
||||
const account=versionState===0&&cached;
|
||||
let wechat=!policy.deviceLogin&&!account;
|
||||
let visitor=!account;
|
||||
if(versionState===0){visitor=false;if(policy.showVisitor){wechat=false;visitor=true;}}
|
||||
return {wechat,visitor,phone:policy.deviceLogin&&!account,quick:false,qq:policy.qqLogin,account};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "fe78702a-5e02-4006-844c-15123d950d80",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "093506bf-570f-47f8-9f4d-0a87d78cba2e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "024324ab-1239-4568-9b72-5f957e32ba15",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e6f7adfb-42be-43ed-a658-73aac741e2f2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "65fb20da-5c43-4171-a53a-66ae24890751",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "0b2dae51-cba0-4d30-95f6-a6ca50bc2f83",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+6
-2
@@ -42,7 +42,7 @@ export interface LoginAccountIdentity {
|
||||
|
||||
export type DeviceLoginMode =
|
||||
| { readonly enabled: false }
|
||||
| { readonly enabled: true; readonly telphone: string };
|
||||
| { readonly enabled: true; readonly telphone: string; readonly smmcode?: string };
|
||||
|
||||
export type LoginPlayerIdMode =
|
||||
| { readonly enabled: false }
|
||||
@@ -112,7 +112,11 @@ export function buildLoginRequest(
|
||||
const deviceLogin = requireRecord(deviceRecord.deviceLogin, '$.device.deviceLogin');
|
||||
if (requireBoolean(deviceLogin.enabled, '$.device.deviceLogin.enabled')) {
|
||||
data.telphone = requireString(deviceLogin.telphone, '$.device.deviceLogin.telphone');
|
||||
data.telphoneAuto = true;
|
||||
// Explicit phone verification (sharelogin) differs from cached device login.
|
||||
if (hasOwn(deviceLogin, 'smmcode')) {
|
||||
data.smmcode = requireString(deviceLogin.smmcode, '$.device.deviceLogin.smmcode');
|
||||
data.telphoneAuto = false;
|
||||
} else data.telphoneAuto = true;
|
||||
}
|
||||
|
||||
const loginPlayerId = requireRecord(deviceRecord.loginPlayerId, '$.device.loginPlayerId');
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e473d40d-15cb-4ba0-a9dd-2aee7db34288",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c39d248f-79e2-4e7e-935c-8640d7ba2c1d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "464618de-1031-4d9d-b47a-5abfc3884b2a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "396594e0-d025-4f59-8f09-55f5563149fc",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "bc28a4de-e56a-4ff3-9793-4a358b7f40e1",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "d8033485-9f99-48f1-8c69-80173036f33c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "7e0c41b9-1036-46cd-9401-98c4ae86794e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "f657f863-7e72-4697-827c-11240096d8be",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3ad6eade-cc0c-4971-bdfb-453f0016df2c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "bd3872ba-100e-4b2a-838f-2098366df9fb",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "03a2c16b-b059-4ef9-8c26-3fe3a9761720",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "a61c62b7-e973-4fb6-97be-69db3ed6fd90",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "5e7d1166-152b-4697-a882-032da5c60f10",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "f6eae679-99d7-45f3-b301-319b961625f1",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "650981bd-d942-4bb9-8e68-3efb07dda4dd",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "f1d3ef88-5577-4be2-853b-27900231ff29",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "754c5d58-de20-4a2d-9a62-406126c1cf93",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "2ade8276-e1d3-46ca-9c77-46b3c5f71413",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.AnimationClip",
|
||||
"_name": "LoginLoading",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_native": "",
|
||||
"sample": 3,
|
||||
"speed": 1,
|
||||
"wrapMode": 2,
|
||||
"enableTrsBlending": false,
|
||||
"_duration": 1,
|
||||
"_hash": 0,
|
||||
"_tracks": [
|
||||
{
|
||||
"__id__": 1
|
||||
}
|
||||
],
|
||||
"_exoticAnimation": null,
|
||||
"_events": [],
|
||||
"_embeddedPlayers": [],
|
||||
"_additiveSettings": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_auxiliaryCurveEntries": []
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.ObjectTrack",
|
||||
"_binding": {
|
||||
"__type__": "cc.animation.TrackBinding",
|
||||
"path": {
|
||||
"__id__": 2
|
||||
},
|
||||
"proxy": null
|
||||
},
|
||||
"_channel": {
|
||||
"__id__": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.TrackPath",
|
||||
"_paths": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
"spriteFrame"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.ComponentPath",
|
||||
"component": "cc.Sprite"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ObjectCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.3333333333333333,
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__uuid__": "41c0f42d-631a-4a3f-abf1-a36ed787e563@f9941",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
{
|
||||
"__uuid__": "bb80821b-0b3f-460e-a74a-1b1a7eaad560@f9941",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
{
|
||||
"__uuid__": "b39af9d6-4d70-43ca-a312-f993de9f961c@f9941",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AnimationClipAdditiveSettings",
|
||||
"enabled": false,
|
||||
"refClip": null
|
||||
}
|
||||
]
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "2.0.4",
|
||||
"importer": "animation-clip",
|
||||
"imported": true,
|
||||
"uuid": "d7f4b280-dc40-47c7-bfe5-9421350459fe",
|
||||
"files": [
|
||||
".bin"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"name": "LoginLoading"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+281
-100
@@ -25,14 +25,14 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 40
|
||||
"__id__": 50
|
||||
},
|
||||
{
|
||||
"__id__": 42
|
||||
"__id__": 52
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 44
|
||||
"__id__": 54
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -61,7 +61,7 @@
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "acrZGZbf1NerIwhXMce5C9"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
@@ -79,23 +79,23 @@
|
||||
"__id__": 11
|
||||
},
|
||||
{
|
||||
"__id__": 19
|
||||
},
|
||||
{
|
||||
"__id__": 27
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 35
|
||||
"__id__": 21
|
||||
},
|
||||
{
|
||||
"__id__": 37
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 45
|
||||
},
|
||||
{
|
||||
"__id__": 47
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 39
|
||||
"__id__": 49
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -124,7 +124,7 @@
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "e6VeYSc7NPirZdAaN4p44e"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
@@ -177,7 +177,7 @@
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "f1pHSoD4dILLRVFTIObRtT"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
@@ -201,7 +201,7 @@
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "a9XLkwiTVFH68tpCqSosju"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -246,7 +246,7 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": "15y0dNzphPKaTgoMZ3YkkU"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -282,7 +282,7 @@
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "8b8p/boZJEqocxUC1G22sv"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -320,10 +320,13 @@
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 18
|
||||
"__id__": 20
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -352,7 +355,7 @@
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "03KAkUqStGDaHp3GFOQbYR"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
@@ -376,7 +379,7 @@
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "feVdaeICBA07uZAmLtAU07"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -421,7 +424,7 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": "b6GW+6L8VHILl5D4tnXajn"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -457,12 +460,30 @@
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "5dO4+lWM1I74eFWhnD+bgo"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "MW2xRLaeE9itOcgHj0p+dQ"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.BlockInputEvents",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "4fv3LfgR5DPIoVUfROUOzr"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
@@ -478,32 +499,39 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "协议内容",
|
||||
"_name": "协议滚动",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 22
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 20
|
||||
"__id__": 28
|
||||
},
|
||||
{
|
||||
"__id__": 22
|
||||
"__id__": 30
|
||||
},
|
||||
{
|
||||
"__id__": 24
|
||||
"__id__": 32
|
||||
},
|
||||
{
|
||||
"__id__": 34
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 26
|
||||
"__id__": 36
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -5.5,
|
||||
"y": -208.5,
|
||||
"y": -5,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -527,7 +555,57 @@
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "fcOwSwvSpMlaZQPDjbA1f7"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "协议内容",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 21
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 23
|
||||
},
|
||||
{
|
||||
"__id__": 25
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 27
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": -203.5,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 33554432,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
@@ -535,11 +613,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 19
|
||||
"__id__": 22
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 21
|
||||
"__id__": 24
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -551,7 +629,7 @@
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "e4LJQjJ6FE6LjQy5yIP382"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -563,11 +641,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 19
|
||||
"__id__": 22
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 23
|
||||
"__id__": 26
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -596,48 +674,12 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": "bfkfehGNlIxp/fTJn+oOTB"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "1jOdeOrfg2vu2QJl+s+VeA"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 25
|
||||
},
|
||||
"_alignFlags": 16,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": -5.5,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "32AaRKNa5IUaPeF5jIfKTl"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "D1Qfc6QTWy0vKDGsx+qLQg"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
@@ -651,6 +693,146 @@
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 21
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 729,
|
||||
"height": 590
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "0bFbdo0btAnLpeg5XLVeih"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Mask",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 21
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 31
|
||||
},
|
||||
"_type": 0,
|
||||
"_inverted": false,
|
||||
"_segments": 64,
|
||||
"_alphaThreshold": 0.1,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "8bWDB4GxZEjZGyBHlWT8Ry"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Graphics",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 21
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 33
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_lineWidth": 1,
|
||||
"_strokeColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_lineJoin": 2,
|
||||
"_lineCap": 0,
|
||||
"_fillColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 0
|
||||
},
|
||||
"_miterLimit": 10,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "d5mkJTZEZFOru7Ifoe3YX/"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ScrollView",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 21
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 35
|
||||
},
|
||||
"bounceDuration": 1,
|
||||
"brake": 0.5,
|
||||
"elastic": true,
|
||||
"inertia": true,
|
||||
"horizontal": false,
|
||||
"vertical": true,
|
||||
"cancelInnerEvents": true,
|
||||
"scrollEvents": [],
|
||||
"_content": {
|
||||
"__id__": 22
|
||||
},
|
||||
"_horizontalScrollBar": null,
|
||||
"_verticalScrollBar": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "cfxheTMxVE45LJ6nYtvr4t"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "edhlQTi55MNo1ZWcRw9+qA",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Spirit253",
|
||||
@@ -663,17 +845,17 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 28
|
||||
"__id__": 38
|
||||
},
|
||||
{
|
||||
"__id__": 30
|
||||
"__id__": 40
|
||||
},
|
||||
{
|
||||
"__id__": 32
|
||||
"__id__": 42
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 34
|
||||
"__id__": 44
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -702,7 +884,7 @@
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "770rm+dOJPVJdLQnhaoDaZ"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
@@ -710,11 +892,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 27
|
||||
"__id__": 37
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 29
|
||||
"__id__": 39
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -726,7 +908,7 @@
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "02BeJasixOrpU3LpuhrkT+"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -738,11 +920,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 27
|
||||
"__id__": 37
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 31
|
||||
"__id__": 41
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -771,7 +953,7 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": "f372YRc0pCR5LhJkRDp5mj"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -783,11 +965,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 27
|
||||
"__id__": 37
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 33
|
||||
"__id__": 43
|
||||
},
|
||||
"_alignFlags": 16,
|
||||
"_target": null,
|
||||
@@ -807,7 +989,7 @@
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "46JhwhkSdK0KV8Lt3p+HOy"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -836,7 +1018,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 36
|
||||
"__id__": 46
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -848,7 +1030,7 @@
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "07nq/yMyxNHq4xU2y77PJH"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -864,7 +1046,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 38
|
||||
"__id__": 48
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
@@ -884,7 +1066,7 @@
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "fdaBoOjw5KN4+Xi8tr/T8R"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -913,7 +1095,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 41
|
||||
"__id__": 51
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -925,7 +1107,7 @@
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "52OXNuOopHTL574Hc5gszK"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -941,7 +1123,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 43
|
||||
"__id__": 53
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
@@ -961,7 +1143,7 @@
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "73lGoAY61JlYZxdhx3MnbQ"
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
@@ -977,7 +1159,6 @@
|
||||
},
|
||||
"fileId": "xSY2ymJa1y54ctanvQH+WQ",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
"targetOverrides": null
|
||||
}
|
||||
]
|
||||
]
|
||||
+157
-156
@@ -76,9 +76,6 @@
|
||||
},
|
||||
{
|
||||
"__id__": 29
|
||||
},
|
||||
{
|
||||
"__id__": 37
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
@@ -687,21 +684,25 @@
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 30
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 30
|
||||
"__id__": 38
|
||||
},
|
||||
{
|
||||
"__id__": 32
|
||||
"__id__": 40
|
||||
},
|
||||
{
|
||||
"__id__": 34
|
||||
"__id__": 42
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 36
|
||||
"__id__": 44
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -732,156 +733,34 @@
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 31
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 208,
|
||||
"height": 59
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "t4s+2kLm2F//czXxT9Xo8A"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 33
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "d313aa40-9397-4b44-8100-65ea389233f3@f9941",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 0,
|
||||
"_fillType": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "/rrApudp/UA/nOAEHDamNA"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 35
|
||||
},
|
||||
"_alignFlags": 16,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 671.37,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "v+C5/D9J96sTVhcAhSrUng"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "QQkO56LzjjkpTd+xNv6zcA",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Spirit3104",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
"__id__": 29
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 38
|
||||
"__id__": 31
|
||||
},
|
||||
{
|
||||
"__id__": 40
|
||||
"__id__": 33
|
||||
},
|
||||
{
|
||||
"__id__": 42
|
||||
"__id__": 35
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 44
|
||||
"__id__": 37
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 671.87,
|
||||
"y": 311.5,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -913,16 +792,16 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 37
|
||||
"__id__": 30
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 39
|
||||
"__id__": 32
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 63.005419342885375,
|
||||
"height": 17.64
|
||||
"width": 81.03130596899703,
|
||||
"height": 22.680000000000003
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -941,11 +820,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 37
|
||||
"__id__": 30
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 41
|
||||
"__id__": 34
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -960,10 +839,10 @@
|
||||
"_string": "Spirit3104",
|
||||
"_horizontalAlign": 1,
|
||||
"_verticalAlign": 1,
|
||||
"_actualFontSize": 14.758333333333333,
|
||||
"_fontSize": 14,
|
||||
"_actualFontSize": 18.975,
|
||||
"_fontSize": 18,
|
||||
"_fontFamily": "Arial",
|
||||
"_lineHeight": 14,
|
||||
"_lineHeight": 18,
|
||||
"_overflow": 0,
|
||||
"_enableWrapText": true,
|
||||
"_font": null,
|
||||
@@ -1009,19 +888,19 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 37
|
||||
"__id__": 30
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 43
|
||||
"__id__": 36
|
||||
},
|
||||
"_alignFlags": 16,
|
||||
"_alignFlags": 18,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 671.87,
|
||||
"_left": 63.484347015501484,
|
||||
"_right": 63.484347015501484,
|
||||
"_top": 18.159999999999997,
|
||||
"_bottom": 18.159999999999997,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
@@ -1029,8 +908,8 @@
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_originalWidth": 81.03130596899703,
|
||||
"_originalHeight": 22.680000000000003,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": ""
|
||||
@@ -1052,6 +931,128 @@
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 39
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 208,
|
||||
"height": 59
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "t4s+2kLm2F//czXxT9Xo8A"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 41
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "d313aa40-9397-4b44-8100-65ea389233f3@f9941",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 0,
|
||||
"_fillType": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "/rrApudp/UA/nOAEHDamNA"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 29
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 43
|
||||
},
|
||||
"_alignFlags": 16,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 671.37,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "v+C5/D9J96sTVhcAhSrUng"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "QQkO56LzjjkpTd+xNv6zcA",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
|
||||
+222
-194
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "1830368b-b039-44a1-8023-ede4c94e9dd3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"isBundle": true,
|
||||
"bundleConfigID": "default",
|
||||
"bundleName": "resources",
|
||||
"priority": 8
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "2d251f16-3748-411c-88b6-6ef547bc63a5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"importer": "text",
|
||||
"imported": true,
|
||||
"uuid": "cf18eee8-2e2c-476f-85c7-7cf6bcb17aee",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,416 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.SceneAsset",
|
||||
"_name": "PlatformLoading",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_native": "",
|
||||
"scene": {
|
||||
"__id__": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Scene",
|
||||
"_name": "PlatformLoading",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_id": "262ea1ac-58e5-4144-b79c-6e854d75d693"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Canvas",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 800,
|
||||
"y": 360,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 33554432,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "d9wH0yQuNFD6cIVq4RHwPA"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Camera",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1000
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "03SwPEvXVIrKlz1Ycix1/b"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Camera",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_projection": 0,
|
||||
"_priority": 0,
|
||||
"_fov": 45,
|
||||
"_fovAxis": 0,
|
||||
"_orthoHeight": 360,
|
||||
"_near": 1,
|
||||
"_far": 2000,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 51,
|
||||
"g": 51,
|
||||
"b": 51,
|
||||
"a": 255
|
||||
},
|
||||
"_depth": 1,
|
||||
"_stencil": 0,
|
||||
"_clearFlags": 7,
|
||||
"_rect": {
|
||||
"__type__": "cc.Rect",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1,
|
||||
"height": 1
|
||||
},
|
||||
"_aperture": 19,
|
||||
"_shutter": 7,
|
||||
"_iso": 0,
|
||||
"_screenScale": 1,
|
||||
"_visibility": 1107296256,
|
||||
"_targetTexture": null,
|
||||
"_postProcess": null,
|
||||
"_usePostProcess": false,
|
||||
"_cameraType": -1,
|
||||
"_trackingType": 0,
|
||||
"_id": "67kXVpE8xNtp7r60I1VAI2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1600,
|
||||
"height": 720
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "adybdpE3VDW4/URT3c6gX8"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Canvas",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_cameraComponent": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_alignCanvasWithScreen": true,
|
||||
"_id": "c6tdlDQhRJNIBJ8DjXiFQ/"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 8
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 10
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 11
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 12
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 13
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 14
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 15
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AmbientInfo",
|
||||
"_skyColorHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyColor": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyIllumHDR": 20000,
|
||||
"_skyIllum": 20000,
|
||||
"_groundAlbedoHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
},
|
||||
"_groundAlbedo": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
},
|
||||
"_skyColorLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 1
|
||||
},
|
||||
"_skyIllumLDR": 20000,
|
||||
"_groundAlbedoLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ShadowsInfo",
|
||||
"_enabled": false,
|
||||
"_type": 0,
|
||||
"_normal": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"_distance": 0,
|
||||
"_planeBias": 1,
|
||||
"_shadowColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 76
|
||||
},
|
||||
"_maxReceived": 4,
|
||||
"_size": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 1024,
|
||||
"y": 1024
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkyboxInfo",
|
||||
"_envLightingType": 0,
|
||||
"_envmapHDR": null,
|
||||
"_envmap": null,
|
||||
"_envmapLDR": null,
|
||||
"_diffuseMapHDR": null,
|
||||
"_diffuseMapLDR": null,
|
||||
"_enabled": false,
|
||||
"_useHDR": true,
|
||||
"_editableMaterial": null,
|
||||
"_reflectionHDR": null,
|
||||
"_reflectionLDR": null,
|
||||
"_rotationAngle": 0
|
||||
},
|
||||
{
|
||||
"__type__": "cc.FogInfo",
|
||||
"_type": 0,
|
||||
"_fogColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 200,
|
||||
"g": 200,
|
||||
"b": 200,
|
||||
"a": 255
|
||||
},
|
||||
"_enabled": false,
|
||||
"_fogDensity": 0.3,
|
||||
"_fogStart": 0.5,
|
||||
"_fogEnd": 300,
|
||||
"_fogAtten": 5,
|
||||
"_fogTop": 1.5,
|
||||
"_fogRange": 1.2,
|
||||
"_accurate": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.OctreeInfo",
|
||||
"_enabled": false,
|
||||
"_minPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -1024,
|
||||
"y": -1024,
|
||||
"z": -1024
|
||||
},
|
||||
"_maxPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1024,
|
||||
"y": 1024,
|
||||
"z": 1024
|
||||
},
|
||||
"_depth": 8
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkinInfo",
|
||||
"_enabled": true,
|
||||
"_blurRadius": 0.01,
|
||||
"_sssIntensity": 3
|
||||
},
|
||||
{
|
||||
"__type__": "cc.LightProbeInfo",
|
||||
"_giScale": 1,
|
||||
"_giSamples": 1024,
|
||||
"_bounces": 2,
|
||||
"_reduceRinging": 0,
|
||||
"_showProbe": true,
|
||||
"_showWireframe": true,
|
||||
"_showConvex": false,
|
||||
"_data": null,
|
||||
"_lightProbeSphereVolume": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PostSettingsInfo",
|
||||
"_toneMappingType": 0
|
||||
}
|
||||
]
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "1.1.50",
|
||||
"importer": "scene",
|
||||
"imported": true,
|
||||
"uuid": "67e69aac-9982-4e78-a44c-1d9c42f016ae",
|
||||
"uuid": "262ea1ac-58e5-4144-b79c-6e854d75d693",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
@@ -0,0 +1,416 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.SceneAsset",
|
||||
"_name": "PlatformLogin",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_native": "",
|
||||
"scene": {
|
||||
"__id__": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Scene",
|
||||
"_name": "PlatformLogin",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_id": "c6bf90e9-2e5e-4b7b-bfc0-ed8a4e243e4d"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Canvas",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 800,
|
||||
"y": 360,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 33554432,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "faTOCTLXRFdpZeZi7lNLQq"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Camera",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1000
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "6ayrdwHr9GLKXUxRdk2hH5"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Camera",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_projection": 0,
|
||||
"_priority": 0,
|
||||
"_fov": 45,
|
||||
"_fovAxis": 0,
|
||||
"_orthoHeight": 360,
|
||||
"_near": 1,
|
||||
"_far": 2000,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 51,
|
||||
"g": 51,
|
||||
"b": 51,
|
||||
"a": 255
|
||||
},
|
||||
"_depth": 1,
|
||||
"_stencil": 0,
|
||||
"_clearFlags": 7,
|
||||
"_rect": {
|
||||
"__type__": "cc.Rect",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1,
|
||||
"height": 1
|
||||
},
|
||||
"_aperture": 19,
|
||||
"_shutter": 7,
|
||||
"_iso": 0,
|
||||
"_screenScale": 1,
|
||||
"_visibility": 1107296256,
|
||||
"_targetTexture": null,
|
||||
"_postProcess": null,
|
||||
"_usePostProcess": false,
|
||||
"_cameraType": -1,
|
||||
"_trackingType": 0,
|
||||
"_id": "51tpdCan1JboRRHZOyhxuv"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1600,
|
||||
"height": 720
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "8ej3BZPwhAD6WQVYXaPCUB"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Canvas",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_cameraComponent": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_alignCanvasWithScreen": true,
|
||||
"_id": "cduZE+wFRG1q4NzbTvVx8E"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 8
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 10
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 11
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 12
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 13
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 14
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 15
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AmbientInfo",
|
||||
"_skyColorHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyColor": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyIllumHDR": 20000,
|
||||
"_skyIllum": 20000,
|
||||
"_groundAlbedoHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
},
|
||||
"_groundAlbedo": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
},
|
||||
"_skyColorLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 1
|
||||
},
|
||||
"_skyIllumLDR": 20000,
|
||||
"_groundAlbedoLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ShadowsInfo",
|
||||
"_enabled": false,
|
||||
"_type": 0,
|
||||
"_normal": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"_distance": 0,
|
||||
"_planeBias": 1,
|
||||
"_shadowColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 76
|
||||
},
|
||||
"_maxReceived": 4,
|
||||
"_size": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 1024,
|
||||
"y": 1024
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkyboxInfo",
|
||||
"_envLightingType": 0,
|
||||
"_envmapHDR": null,
|
||||
"_envmap": null,
|
||||
"_envmapLDR": null,
|
||||
"_diffuseMapHDR": null,
|
||||
"_diffuseMapLDR": null,
|
||||
"_enabled": false,
|
||||
"_useHDR": true,
|
||||
"_editableMaterial": null,
|
||||
"_reflectionHDR": null,
|
||||
"_reflectionLDR": null,
|
||||
"_rotationAngle": 0
|
||||
},
|
||||
{
|
||||
"__type__": "cc.FogInfo",
|
||||
"_type": 0,
|
||||
"_fogColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 200,
|
||||
"g": 200,
|
||||
"b": 200,
|
||||
"a": 255
|
||||
},
|
||||
"_enabled": false,
|
||||
"_fogDensity": 0.3,
|
||||
"_fogStart": 0.5,
|
||||
"_fogEnd": 300,
|
||||
"_fogAtten": 5,
|
||||
"_fogTop": 1.5,
|
||||
"_fogRange": 1.2,
|
||||
"_accurate": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.OctreeInfo",
|
||||
"_enabled": false,
|
||||
"_minPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -1024,
|
||||
"y": -1024,
|
||||
"z": -1024
|
||||
},
|
||||
"_maxPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1024,
|
||||
"y": 1024,
|
||||
"z": 1024
|
||||
},
|
||||
"_depth": 8
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkinInfo",
|
||||
"_enabled": true,
|
||||
"_blurRadius": 0.01,
|
||||
"_sssIntensity": 3
|
||||
},
|
||||
{
|
||||
"__type__": "cc.LightProbeInfo",
|
||||
"_giScale": 1,
|
||||
"_giSamples": 1024,
|
||||
"_bounces": 2,
|
||||
"_reduceRinging": 0,
|
||||
"_showProbe": true,
|
||||
"_showWireframe": true,
|
||||
"_showConvex": false,
|
||||
"_data": null,
|
||||
"_lightProbeSphereVolume": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PostSettingsInfo",
|
||||
"_toneMappingType": 0
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "scene",
|
||||
"imported": true,
|
||||
"uuid": "c6bf90e9-2e5e-4b7b-bfc0-ed8a4e243e4d",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.SceneAsset",
|
||||
"_name": "PlatformStartup",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_native": "",
|
||||
"scene": {
|
||||
"__id__": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Scene",
|
||||
"_name": "PlatformStartup",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_id": "1c10c2ee-adc2-496f-9005-d3e0e6ebbb56"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "PlatformServices",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "edK1iknZ1EDKLpdkoVy5NZ"
|
||||
},
|
||||
{
|
||||
"__type__": "6dba8Keu9dNqL1ILyFO7MyT",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"loadingScene": {
|
||||
"__uuid__": "262ea1ac-58e5-4144-b79c-6e854d75d693",
|
||||
"__expectedType__": "cc.SceneAsset"
|
||||
},
|
||||
"loginScene": {
|
||||
"__uuid__": "c6bf90e9-2e5e-4b7b-bfc0-ed8a4e243e4d",
|
||||
"__expectedType__": "cc.SceneAsset"
|
||||
},
|
||||
"loadingPrefab": {
|
||||
"__uuid__": "3e5a41f3-b043-45a5-94f6-e299ea9acc61",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
},
|
||||
"loginPrefab": {
|
||||
"__uuid__": "b209cefb-b381-4c7c-b765-94a5ab75a89c",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
},
|
||||
"protocolPrefab": {
|
||||
"__uuid__": "8fad42f6-6e14-4311-a344-e6ca87bc0087",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
},
|
||||
"phonePrefab": {
|
||||
"__uuid__": "b9ec1622-fe6d-4a07-8958-3a0732040e91",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
},
|
||||
"_id": "09m0ERGqxLWKsJIBthaeXP"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 5
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 7
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 8
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 9
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 10
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 11
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 12
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AmbientInfo",
|
||||
"_skyColorHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyColor": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyIllumHDR": 20000,
|
||||
"_skyIllum": 20000,
|
||||
"_groundAlbedoHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
},
|
||||
"_groundAlbedo": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
},
|
||||
"_skyColorLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 1
|
||||
},
|
||||
"_skyIllumLDR": 20000,
|
||||
"_groundAlbedoLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ShadowsInfo",
|
||||
"_enabled": false,
|
||||
"_type": 0,
|
||||
"_normal": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"_distance": 0,
|
||||
"_planeBias": 1,
|
||||
"_shadowColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 76
|
||||
},
|
||||
"_maxReceived": 4,
|
||||
"_size": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 1024,
|
||||
"y": 1024
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkyboxInfo",
|
||||
"_envLightingType": 0,
|
||||
"_envmapHDR": null,
|
||||
"_envmap": null,
|
||||
"_envmapLDR": null,
|
||||
"_diffuseMapHDR": null,
|
||||
"_diffuseMapLDR": null,
|
||||
"_enabled": false,
|
||||
"_useHDR": true,
|
||||
"_editableMaterial": null,
|
||||
"_reflectionHDR": null,
|
||||
"_reflectionLDR": null,
|
||||
"_rotationAngle": 0
|
||||
},
|
||||
{
|
||||
"__type__": "cc.FogInfo",
|
||||
"_type": 0,
|
||||
"_fogColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 200,
|
||||
"g": 200,
|
||||
"b": 200,
|
||||
"a": 255
|
||||
},
|
||||
"_enabled": false,
|
||||
"_fogDensity": 0.3,
|
||||
"_fogStart": 0.5,
|
||||
"_fogEnd": 300,
|
||||
"_fogAtten": 5,
|
||||
"_fogTop": 1.5,
|
||||
"_fogRange": 1.2,
|
||||
"_accurate": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.OctreeInfo",
|
||||
"_enabled": false,
|
||||
"_minPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -1024,
|
||||
"y": -1024,
|
||||
"z": -1024
|
||||
},
|
||||
"_maxPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1024,
|
||||
"y": 1024,
|
||||
"z": 1024
|
||||
},
|
||||
"_depth": 8
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkinInfo",
|
||||
"_enabled": true,
|
||||
"_blurRadius": 0.01,
|
||||
"_sssIntensity": 3
|
||||
},
|
||||
{
|
||||
"__type__": "cc.LightProbeInfo",
|
||||
"_giScale": 1,
|
||||
"_giSamples": 1024,
|
||||
"_bounces": 2,
|
||||
"_reduceRinging": 0,
|
||||
"_showProbe": true,
|
||||
"_showWireframe": true,
|
||||
"_showConvex": false,
|
||||
"_data": null,
|
||||
"_lightProbeSphereVolume": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PostSettingsInfo",
|
||||
"_toneMappingType": 0
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "scene",
|
||||
"imported": true,
|
||||
"uuid": "1c10c2ee-adc2-496f-9005-d3e0e6ebbb56",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,449 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.SceneAsset",
|
||||
"_name": "scene-2d",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_native": "",
|
||||
"scene": {
|
||||
"__id__": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Scene",
|
||||
"_name": "scene-2d",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_id": "aa6aad6d-aef0-4b69-95a0-18ffda41f4c7"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Canvas",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 800,
|
||||
"y": 360.00000000000006,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 33554432,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "beI88Z2HpFELqR4T5EMHpg"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Camera",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1000
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "ebFwiq8gBFaYpqYbdoDODe"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Camera",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_projection": 0,
|
||||
"_priority": 0,
|
||||
"_fov": 45,
|
||||
"_fovAxis": 0,
|
||||
"_orthoHeight": 360,
|
||||
"_near": 0,
|
||||
"_far": 2000,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_depth": 1,
|
||||
"_stencil": 0,
|
||||
"_clearFlags": 7,
|
||||
"_rect": {
|
||||
"__type__": "cc.Rect",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1,
|
||||
"height": 1
|
||||
},
|
||||
"_aperture": 19,
|
||||
"_shutter": 7,
|
||||
"_iso": 0,
|
||||
"_screenScale": 1,
|
||||
"_visibility": 1108344832,
|
||||
"_targetTexture": null,
|
||||
"_postProcess": null,
|
||||
"_usePostProcess": false,
|
||||
"_cameraType": -1,
|
||||
"_trackingType": 0,
|
||||
"_id": "63WIch3o5BEYRlXzTT0oWc"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1600,
|
||||
"height": 720
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "d6rUX5yfhMlKoWX2bSbawx"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Canvas",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_cameraComponent": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_alignCanvasWithScreen": true,
|
||||
"_id": "12O/ljcVlEqLmVm3U2gEOQ"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 5.684341886080802e-14,
|
||||
"_bottom": 5.684341886080802e-14,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "c5V1EV8IpMtrIvY1OE9t2u"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 9
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 11
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 12
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 13
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 14
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 15
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 16
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AmbientInfo",
|
||||
"_skyColorHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyColor": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 0.520833125
|
||||
},
|
||||
"_skyIllumHDR": 20000,
|
||||
"_skyIllum": 20000,
|
||||
"_groundAlbedoHDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 0
|
||||
},
|
||||
"_groundAlbedo": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 0
|
||||
},
|
||||
"_skyColorLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.5,
|
||||
"z": 0.8,
|
||||
"w": 1
|
||||
},
|
||||
"_skyIllumLDR": 20000,
|
||||
"_groundAlbedoLDR": {
|
||||
"__type__": "cc.Vec4",
|
||||
"x": 0.2,
|
||||
"y": 0.2,
|
||||
"z": 0.2,
|
||||
"w": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ShadowsInfo",
|
||||
"_enabled": false,
|
||||
"_type": 0,
|
||||
"_normal": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"_distance": 0,
|
||||
"_planeBias": 1,
|
||||
"_shadowColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 76,
|
||||
"g": 76,
|
||||
"b": 76,
|
||||
"a": 255
|
||||
},
|
||||
"_maxReceived": 4,
|
||||
"_size": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 512,
|
||||
"y": 512
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkyboxInfo",
|
||||
"_envLightingType": 0,
|
||||
"_envmapHDR": null,
|
||||
"_envmap": null,
|
||||
"_envmapLDR": null,
|
||||
"_diffuseMapHDR": null,
|
||||
"_diffuseMapLDR": null,
|
||||
"_enabled": false,
|
||||
"_useHDR": true,
|
||||
"_editableMaterial": null,
|
||||
"_reflectionHDR": null,
|
||||
"_reflectionLDR": null,
|
||||
"_rotationAngle": 0
|
||||
},
|
||||
{
|
||||
"__type__": "cc.FogInfo",
|
||||
"_type": 0,
|
||||
"_fogColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 200,
|
||||
"g": 200,
|
||||
"b": 200,
|
||||
"a": 255
|
||||
},
|
||||
"_enabled": false,
|
||||
"_fogDensity": 0.3,
|
||||
"_fogStart": 0.5,
|
||||
"_fogEnd": 300,
|
||||
"_fogAtten": 5,
|
||||
"_fogTop": 1.5,
|
||||
"_fogRange": 1.2,
|
||||
"_accurate": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.OctreeInfo",
|
||||
"_enabled": false,
|
||||
"_minPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -1024,
|
||||
"y": -1024,
|
||||
"z": -1024
|
||||
},
|
||||
"_maxPos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1024,
|
||||
"y": 1024,
|
||||
"z": 1024
|
||||
},
|
||||
"_depth": 8
|
||||
},
|
||||
{
|
||||
"__type__": "cc.SkinInfo",
|
||||
"_enabled": false,
|
||||
"_blurRadius": 0.01,
|
||||
"_sssIntensity": 3
|
||||
},
|
||||
{
|
||||
"__type__": "cc.LightProbeInfo",
|
||||
"_giScale": 1,
|
||||
"_giSamples": 1024,
|
||||
"_bounces": 2,
|
||||
"_reduceRinging": 0,
|
||||
"_showProbe": true,
|
||||
"_showWireframe": true,
|
||||
"_showConvex": false,
|
||||
"_data": null,
|
||||
"_lightProbeSphereVolume": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PostSettingsInfo",
|
||||
"_toneMappingType": 0
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "scene",
|
||||
"imported": true,
|
||||
"uuid": "aa6aad6d-aef0-4b69-95a0-18ffda41f4c7",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
-237
@@ -1,237 +0,0 @@
|
||||
import { _decorator, assetManager, Component, Label, Node, Prefab, ProgressBar, Sprite, instantiate, isValid, sys } from 'cc';
|
||||
import { DEBUG } from 'cc/env';
|
||||
import { HttpConfigFetcher } from '../../framework/config/remote-config-fetcher.ts';
|
||||
import { resolveLaunchWaitTime } from '../../framework/config/remote-config.ts';
|
||||
import type { NativeHost } from '../../framework/config/sources/native-settings.ts';
|
||||
import type { PageModel } from '../../framework/presentation/ui-contracts.ts';
|
||||
import { createLocalLoginHost, type LocalLoginHost } from './local-login-host.ts';
|
||||
import type { LocalLoginEvidence } from './local-login-transport.ts';
|
||||
import { CocosLocalLoginView, CocosLogoCountdownView, createLogoCountdown, createAssetLoadTask, createCocosFrameScheduler, positionDiagnosticStopButtonBelow, requireNode } from './local-login-view.ts';
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** Explicit DEBUG browser scene entry. All business state belongs to its host Runtime. */
|
||||
@ccclass('LocalPlatformLogin')
|
||||
export class LocalPlatformLogin extends Component {
|
||||
@property(Prefab) loadingPrefab: Prefab | null = null;
|
||||
@property(Prefab) loginPrefab: Prefab | null = null;
|
||||
@property(Node) loadingRoot: Node | null = null;
|
||||
@property(Node) loginRoot: Node | null = null;
|
||||
@property(Node) resultRoot: Node | null = null;
|
||||
@property(Node) statusOverlay: Node | null = null;
|
||||
@property(Label) statusLabel: Label | null = null;
|
||||
@property(Label) resultLabel: Label | null = null;
|
||||
@property(Node) stopButton: Node | null = null;
|
||||
|
||||
private host: LocalLoginHost | null = null;
|
||||
private view: CocosLocalLoginView | null = null;
|
||||
private resourceProgress: ProgressBar | null = null;
|
||||
private loginInstance: Node | null = null;
|
||||
private stopped = false;
|
||||
private firstDrawAt: number | null = null;
|
||||
private version: number | null = null;
|
||||
private countdown: ReturnType<typeof createLogoCountdown> | null = null;
|
||||
private countdownView: CocosLogoCountdownView | null = null;
|
||||
private readonly pending = new Set<() => void>();
|
||||
private readonly evidence: (LocalLoginEvidence & { at: number })[] = [];
|
||||
private pageModel: PageModel | null = null;
|
||||
private readonly stopTouch = () => this.stop();
|
||||
|
||||
async start(): Promise<void> {
|
||||
// This guard precedes reading browser storage, preparing account or creating socket.
|
||||
if (!DEBUG || sys.isNative) throw new Error('LocalPlatformLogin requires DEBUG browser preview');
|
||||
try {
|
||||
const loadingRoot = this.required(this.loadingRoot, 'loadingRoot');
|
||||
const loginRoot = this.required(this.loginRoot, 'loginRoot');
|
||||
const stopButton = this.required(this.stopButton, 'stopButton');
|
||||
this.view = new CocosLocalLoginView({ loadingRoot, loginRoot,
|
||||
resultRoot: this.required(this.resultRoot, 'resultRoot'),
|
||||
statusOverlay: this.required(this.statusOverlay, 'statusOverlay'),
|
||||
statusLabel: this.required(this.statusLabel, 'statusLabel'),
|
||||
resultLabel: this.required(this.resultLabel, 'resultLabel') });
|
||||
this.required(this.loadingPrefab, 'loadingPrefab');
|
||||
this.required(this.loginPrefab, 'loginPrefab');
|
||||
const logo = requireNode(loadingRoot, 'Layer1_Logo');
|
||||
this.resourceProgress = requireNode(logo, 'group-1/Spirit254').getComponent(ProgressBar);
|
||||
if (this.resourceProgress === null) throw new Error('Layer1_Logo/group-1/Spirit254 requires ProgressBar');
|
||||
requireNode(logo, 'group-32').active = false;
|
||||
const countdownLabels = logo.getComponentsInChildren(Label).filter(label => label.node.name === 'Spirit3104');
|
||||
if (countdownLabels.length !== 1) throw new Error('Logo requires exactly one Spirit3104 Label');
|
||||
const logoButton = requireNode(logo, 'group-1/Spirit3103');
|
||||
positionDiagnosticStopButtonBelow(stopButton, logoButton);
|
||||
this.countdownView = new CocosLogoCountdownView(logoButton, countdownLabels[0].node,
|
||||
() => this.countdown?.skip());
|
||||
this.countdown = createLogoCountdown({ now: () => performance.now(),
|
||||
schedule: (callback, ms) => {
|
||||
const timer = window.setTimeout(() => {
|
||||
try { callback(); } catch (error) { this.fail(error); }
|
||||
}, ms);
|
||||
return () => window.clearTimeout(timer);
|
||||
}, render: state => this.countdownView?.render(state) });
|
||||
this.validateSprites(loadingRoot);
|
||||
stopButton.on(Node.EventType.TOUCH_END, this.stopTouch);
|
||||
this.view.activate('loading');
|
||||
const firstDraw = this.nextDraw().then(() => {
|
||||
this.firstDrawAt = performance.now();
|
||||
this.record({ kind: 'loading-first-draw', data: null });
|
||||
});
|
||||
// A configuration failure can cancel this frame before Runtime consumes its gate.
|
||||
void firstDraw.catch(() => {});
|
||||
const view = this.view;
|
||||
const browser = window as unknown as NativeHost & { returnCitySN?: unknown };
|
||||
this.host = createLocalLoginHost({
|
||||
configOptions: { hostKind: 'h5', search: window.location.search,
|
||||
win: browser, fetcher: new HttpConfigFetcher() },
|
||||
storage: window.localStorage, random: Math.random, now: Date.now,
|
||||
sampleHost: () => ({ location: null,
|
||||
...('returnCitySN' in browser ? { returnCitySN: browser.returnCitySN } : {}) }),
|
||||
view: {
|
||||
render: model => { this.pageModel = model; this.record({ kind: 'page-model', data: model }); view.render(model); },
|
||||
activate: page => { view.activate(page); this.record({ kind: 'page-active', data: page }); },
|
||||
showOverlay: model => view.showOverlay(model),
|
||||
},
|
||||
scheduler: createCocosFrameScheduler(),
|
||||
onConfigResolved: config => {
|
||||
this.version = config.identity.version;
|
||||
this.required(this.countdown, 'Logo countdown').start(resolveLaunchWaitTime(config.remoteConfig));
|
||||
},
|
||||
onResourcesReady: () => {
|
||||
this.countdown?.resourcesReady();
|
||||
this.required(this.resourceProgress, 'resource ProgressBar').node.active = false;
|
||||
},
|
||||
onSocketReady: ready => this.countdown?.socketReady(ready),
|
||||
onStopped: () => { this.countdown?.cancel(); this.countdownView?.dispose(); },
|
||||
loadResources: () => this.loadResources(),
|
||||
waitForMinimumDisplay: async () => {
|
||||
await Promise.all([firstDraw, this.required(this.countdown, 'Logo countdown').promise]);
|
||||
const drawnAt = this.required(this.firstDrawAt, 'loading first draw');
|
||||
this.record({ kind: 'minimum-display-ready', data: performance.now() - drawnAt });
|
||||
},
|
||||
createSocket: url => new WebSocket(url), record: event => this.record(event),
|
||||
onBusy: busy => view.setBusy(busy),
|
||||
onFailure: error => this.fail(error),
|
||||
});
|
||||
await this.host.start();
|
||||
} catch (error) { this.fail(error); }
|
||||
}
|
||||
|
||||
private required<T>(value: T | null, name: string): T {
|
||||
if (value === null || value === undefined) throw new Error(`LocalPlatformLogin missing ${name}`);
|
||||
return value;
|
||||
}
|
||||
|
||||
private record(event: LocalLoginEvidence): void {
|
||||
this.evidence.push(Object.freeze({ ...event, at: performance.now() }));
|
||||
}
|
||||
|
||||
private validateSprites(root: Node): void {
|
||||
for (const sprite of root.getComponentsInChildren(Sprite)) {
|
||||
if (!sprite.node.activeInHierarchy) continue;
|
||||
const frame = sprite.spriteFrame;
|
||||
if (frame === null || !isValid(frame) || frame.texture === null || !isValid(frame.texture)) {
|
||||
throw new Error(`Invalid SpriteFrame/texture dependency: ${sprite.node.name}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async loadResources(): Promise<void> {
|
||||
if (this.stopped) throw new Error('Local login resources cancelled');
|
||||
const serializedPrefab = this.required(this.loginPrefab, 'loginPrefab');
|
||||
const loading = this.required(this.loadingPrefab, 'loadingPrefab');
|
||||
if (!isValid(serializedPrefab) || !isValid(serializedPrefab.data) || !isValid(loading) || !isValid(loading.data)) {
|
||||
throw new Error('Local login serialized Prefab dependency is invalid');
|
||||
}
|
||||
const progress = this.required(this.resourceProgress, 'resource ProgressBar');
|
||||
const task = createAssetLoadTask<Prefab>((onProgress, onComplete) => {
|
||||
assetManager.loadAny(serializedPrefab.uuid, onProgress, (error, asset) => onComplete(error, asset as Prefab));
|
||||
}, value => { progress.progress = value; });
|
||||
this.pending.add(task.cancel);
|
||||
let prefab: Prefab;
|
||||
try { prefab = await task.promise; }
|
||||
finally { this.pending.delete(task.cancel); }
|
||||
if (this.stopped) throw new Error('Local login resources cancelled');
|
||||
if (!isValid(prefab) || !isValid(prefab.data)) throw new Error('Loaded login Prefab dependency is invalid');
|
||||
const instance = instantiate(prefab);
|
||||
this.loginInstance = instance;
|
||||
instance.parent = this.required(this.loginRoot, 'loginRoot');
|
||||
const view = this.required(this.view, 'view');
|
||||
view.bindLogin(instance, () => {
|
||||
const host = this.required(this.host, 'host');
|
||||
void host.login().catch(error => this.fail(error));
|
||||
});
|
||||
view.setVersion(this.required(this.version, 'resolved identity.version'));
|
||||
// Validate active prefab content before the root is exposed as the login page.
|
||||
for (const sprite of instance.getComponentsInChildren(Sprite)) {
|
||||
if (!sprite.node.active) continue;
|
||||
const frame = sprite.spriteFrame;
|
||||
if (frame === null || !isValid(frame) || frame.texture === null || !isValid(frame.texture)) {
|
||||
throw new Error(`Invalid login SpriteFrame/texture dependency: ${sprite.node.name}`);
|
||||
}
|
||||
}
|
||||
await this.nextDraw();
|
||||
this.record({ kind: 'resources-ready', data: { login: prefab.uuid, loading: loading.uuid } });
|
||||
}
|
||||
|
||||
private nextDraw(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.stopped) { reject(new Error('Local login frame cancelled')); return; }
|
||||
const cancelFrame = createCocosFrameScheduler().request(() => {
|
||||
this.pending.delete(cancel); resolve();
|
||||
});
|
||||
const cancel = () => { cancelFrame(); this.pending.delete(cancel); reject(new Error('Local login frame cancelled')); };
|
||||
this.pending.add(cancel);
|
||||
});
|
||||
}
|
||||
|
||||
private delay(milliseconds: number): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.stopped) { reject(new Error('Local login timer cancelled')); return; }
|
||||
const timer = window.setTimeout(() => { this.pending.delete(cancel); resolve(); }, milliseconds);
|
||||
const cancel = () => { window.clearTimeout(timer); this.pending.delete(cancel); reject(new Error('Local login timer cancelled')); };
|
||||
this.pending.add(cancel);
|
||||
});
|
||||
}
|
||||
|
||||
private release(): void {
|
||||
this.stopped = true;
|
||||
this.countdown?.cancel();
|
||||
this.countdownView?.dispose();
|
||||
for (const cancel of [...this.pending]) cancel();
|
||||
this.stopButton?.off(Node.EventType.TOUCH_END, this.stopTouch);
|
||||
this.view?.dispose();
|
||||
this.host?.stop();
|
||||
}
|
||||
|
||||
private fail(error: unknown): void {
|
||||
if (this.stopped) return;
|
||||
this.record({ kind: 'component-failure', data: error });
|
||||
try { this.release(); }
|
||||
catch (cleanup) {
|
||||
this.record({ kind: 'cleanup-failure', data: cleanup });
|
||||
this.view?.showFailure({ error, cleanup });
|
||||
return;
|
||||
}
|
||||
this.view?.showFailure(error);
|
||||
if (this.view === null && this.statusLabel !== null) this.statusLabel.string = `验证失败:${String(error)}`;
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
if (this.stopped) return;
|
||||
this.view?.showStopped();
|
||||
try { this.release(); }
|
||||
catch (error) { this.view?.showFailure(error); }
|
||||
this.record({ kind: 'stopped', data: null });
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
this.stop();
|
||||
if (this.loginInstance !== null && isValid(this.loginInstance)) this.loginInstance.destroy();
|
||||
}
|
||||
|
||||
/** Local memory only: callers must redact raw account/device IDs before sharing. */
|
||||
getDiagnostics() {
|
||||
return Object.freeze({ events: Object.freeze([...this.evidence]), snapshot: this.host?.getSnapshot(),
|
||||
pageModel: this.pageModel, stopped: this.stopped, pendingCount: this.pending.size,
|
||||
firstDrawAt: this.firstDrawAt, resourceProgress: this.resourceProgress?.progress });
|
||||
}
|
||||
}
|
||||
-225
@@ -1,225 +0,0 @@
|
||||
import { resolveLocalStartup } from '../../framework/config/local-startup.ts';
|
||||
import type { ResolveRuntimeConfigOptions, RuntimeConfig } from '../../framework/config/runtime-config.ts';
|
||||
import { createLocalLoginSources, type LocalHostSnapshot, type LocalLoginSources } from '../../framework/adapters/local/login-sources.ts';
|
||||
import type { LocalStoragePort } from '../../framework/adapters/local/local-storage.ts';
|
||||
import { PlatformRuntime } from '../../framework/platform/runtime.ts';
|
||||
import type { PlatformState } from '../../framework/platform/stores/platform-types.ts';
|
||||
import { PlatformUiController } from '../../framework/presentation/platform-ui-controller.ts';
|
||||
import type { PlatformViewPort, FrameScheduler } from '../../framework/presentation/ui-contracts.ts';
|
||||
import { createDiagnosticGameEntry } from './local-login-game-entry.ts';
|
||||
import { createLocalLoginWire } from './local-login-wire.ts';
|
||||
import { LocalLoginTransport, type EvidenceSink } from './local-login-transport.ts';
|
||||
|
||||
export interface LocalLoginHostOptions {
|
||||
configOptions: ResolveRuntimeConfigOptions;
|
||||
storage: LocalStoragePort;
|
||||
random: () => number;
|
||||
now: () => number;
|
||||
sampleHost: () => LocalHostSnapshot;
|
||||
view: PlatformViewPort;
|
||||
scheduler: FrameScheduler;
|
||||
loadResources: (config: RuntimeConfig) => Promise<void>;
|
||||
waitForMinimumDisplay: (config: RuntimeConfig) => Promise<void>;
|
||||
onConfigResolved?: (config: RuntimeConfig) => void;
|
||||
onResourcesReady?: () => void;
|
||||
onSocketReady?: (ready: boolean) => void;
|
||||
onStopped?: () => void;
|
||||
createSocket: (url: string) => WebSocket;
|
||||
record: EvidenceSink;
|
||||
onBusy: (busy: boolean) => void;
|
||||
onFailure: (error: unknown) => void;
|
||||
}
|
||||
|
||||
export interface LocalLoginHost {
|
||||
start(): Promise<void>;
|
||||
login(): Promise<void>;
|
||||
stop(): void;
|
||||
getSnapshot(): { state: PlatformState | null; ready: boolean; busy: boolean };
|
||||
}
|
||||
|
||||
class LocalLoginHostFault extends Error {
|
||||
readonly errors: readonly unknown[];
|
||||
constructor(errors: readonly unknown[]) {
|
||||
super('Local login host failed with additional observer or cleanup errors');
|
||||
this.name = 'LocalLoginHostFault';
|
||||
this.errors = Object.freeze([...errors]);
|
||||
}
|
||||
}
|
||||
|
||||
function collected(errors: readonly unknown[]): unknown {
|
||||
return errors.length === 1 ? errors[0] : new LocalLoginHostFault(errors);
|
||||
}
|
||||
|
||||
/** Development composition only; Runtime remains the sole business state owner. */
|
||||
export function createLocalLoginHost(options: LocalLoginHostOptions): LocalLoginHost {
|
||||
let runtime: PlatformRuntime | null = null;
|
||||
let controller: PlatformUiController | null = null;
|
||||
let sources: LocalLoginSources | null = null;
|
||||
let startup: Promise<void> | null = null;
|
||||
let loginOperation: Promise<void> | null = null;
|
||||
let terminal = false;
|
||||
let busy = false;
|
||||
let cleanupErrors: unknown[] | null = null;
|
||||
let serverFailure: { data: unknown } | null = null;
|
||||
let unsubscribeState: (() => void) | null = null;
|
||||
|
||||
function requireActive(): void {
|
||||
if (terminal) throw new Error('Local login host is stopped or terminal');
|
||||
}
|
||||
|
||||
function setBusy(value: boolean): void {
|
||||
if (busy === value) return;
|
||||
busy = value;
|
||||
options.onBusy(value);
|
||||
}
|
||||
|
||||
function shutdown(errors: unknown[]): void {
|
||||
terminal = true;
|
||||
cleanupErrors = errors;
|
||||
try { options.onStopped?.(); } catch (error) { errors.push(error); }
|
||||
try { unsubscribeState?.(); unsubscribeState = null; } catch (error) { errors.push(error); }
|
||||
// Disable input before releasing either owner; dispose preserves drawn output.
|
||||
try { setBusy(false); } catch (error) { errors.push(error); }
|
||||
try { controller?.dispose(); } catch (error) { errors.push(error); }
|
||||
try { runtime?.stop(); } catch (error) { errors.push(error); }
|
||||
cleanupErrors = null;
|
||||
}
|
||||
|
||||
function fail(error: unknown): void {
|
||||
if (cleanupErrors !== null) {
|
||||
if (!cleanupErrors.includes(error)) cleanupErrors.push(error);
|
||||
return;
|
||||
}
|
||||
if (terminal) return;
|
||||
const errors = [error];
|
||||
shutdown(errors);
|
||||
options.onFailure(collected(errors));
|
||||
}
|
||||
|
||||
function wireFault(error: unknown): void {
|
||||
if (serverFailure === null) { fail(error); return; }
|
||||
// The Wire scope marker follows the existing denial/kick handler. Keep the
|
||||
// original server payload, and retain any independent Wire cleanup errors.
|
||||
const extras = error instanceof Error && 'errors' in error
|
||||
? (error as Error & { errors: readonly unknown[] }).errors.slice(1) : [];
|
||||
fail(collected([serverFailure.data, ...extras]));
|
||||
}
|
||||
|
||||
function transportFault(error: unknown): void {
|
||||
fail(serverFailure === null ? error : collected([serverFailure.data, error]));
|
||||
}
|
||||
|
||||
async function readyTask(task: () => Promise<void>): Promise<void> {
|
||||
try { requireActive(); await task(); requireActive(); }
|
||||
catch (error) { fail(error); throw error; }
|
||||
}
|
||||
|
||||
function start(): Promise<void> {
|
||||
if (startup !== null) return startup;
|
||||
if (terminal) return Promise.reject(new Error('Local login host is stopped or terminal'));
|
||||
startup = Promise.resolve().then(async () => {
|
||||
requireActive();
|
||||
const context = await resolveLocalStartup(options.configOptions);
|
||||
requireActive();
|
||||
options.onConfigResolved?.(context.config);
|
||||
requireActive();
|
||||
const { mode, isDebugger, identity, servers, source, gameserver } = context.config;
|
||||
options.record({ kind: 'startup-config', data: { mode, isDebugger, identity, servers, source, gameserver } });
|
||||
requireActive();
|
||||
const entry = createDiagnosticGameEntry(context.config.identity.gameid, options.record);
|
||||
sources = createLocalLoginSources({ context, storage: options.storage, random: options.random,
|
||||
now: options.now, sampleHost: options.sampleHost,
|
||||
isSessionActive: () => busy || runtime?.state.app.phase === 'logged-in' });
|
||||
controller = new PlatformUiController({
|
||||
render: model => {
|
||||
if (terminal) return;
|
||||
try { options.view.render(model); }
|
||||
catch (error) { fail(error); throw error; }
|
||||
},
|
||||
activate: page => {
|
||||
if (terminal) return;
|
||||
try {
|
||||
options.view.activate(page);
|
||||
if (!terminal && page === 'lobby') setBusy(false);
|
||||
} catch (error) { fail(error); throw error; }
|
||||
},
|
||||
showOverlay: model => {
|
||||
if (terminal) return;
|
||||
if (model.kind === 'denial') serverFailure = { data: model.outcome.data };
|
||||
if (model.kind === 'kicked') serverFailure = { data: model.data };
|
||||
try { options.view.showOverlay(model); }
|
||||
catch (error) {
|
||||
if (model.kind === 'fatal') fail(collected([model.error, error]));
|
||||
else transportFault(error);
|
||||
throw error;
|
||||
}
|
||||
if (model.kind === 'fatal') fail(model.error);
|
||||
},
|
||||
}, {
|
||||
request: callback => {
|
||||
try {
|
||||
const cancel = options.scheduler.request(callback);
|
||||
return () => {
|
||||
try { cancel(); }
|
||||
catch (error) { fail(error); throw error; }
|
||||
};
|
||||
} catch (error) { fail(error); throw error; }
|
||||
},
|
||||
}, fail);
|
||||
runtime = new PlatformRuntime({ gameEntry: entry,
|
||||
resolveRuntimeConfig: async () => context.config,
|
||||
createWireClient: () => createLocalLoginWire({ context, record: options.record, onFault: wireFault,
|
||||
transportFactory: () => new LocalLoginTransport({ context, createSocket: options.createSocket,
|
||||
record: options.record, onFault: transportFault }) }),
|
||||
scene: controller, loadResources: () => readyTask(async () => {
|
||||
await options.loadResources(context.config);
|
||||
requireActive(); options.onResourcesReady?.();
|
||||
}),
|
||||
waitForMinimumDisplay: () => readyTask(() => options.waitForMinimumDisplay(context.config)),
|
||||
getLoginDeviceSnapshot: sources.getLoginDeviceSnapshot,
|
||||
});
|
||||
unsubscribeState = runtime.subscribeState(state => {
|
||||
if (!terminal) options.onSocketReady?.(state.app.phase === 'connected' || state.app.phase === 'logged-in');
|
||||
}, fail);
|
||||
controller.connect(runtime);
|
||||
requireActive();
|
||||
await runtime.start();
|
||||
requireActive();
|
||||
}).catch(error => { fail(error); throw error; });
|
||||
return startup;
|
||||
}
|
||||
|
||||
function login(): Promise<void> {
|
||||
if (terminal) return Promise.reject(new Error('Local login host is stopped or terminal'));
|
||||
if (busy && loginOperation !== null) return loginOperation;
|
||||
if (runtime === null || controller === null || sources === null || !runtime.ready) {
|
||||
return Promise.reject(new Error('Local login host is not ready for login'));
|
||||
}
|
||||
const activeSources = sources;
|
||||
const activeController = controller;
|
||||
loginOperation = Promise.resolve().then(async () => {
|
||||
requireActive();
|
||||
const account = await activeSources.prepareLogin();
|
||||
requireActive();
|
||||
activeController.login(account);
|
||||
}).catch(error => { fail(error); throw error; });
|
||||
try { setBusy(true); } catch (error) { fail(error); }
|
||||
return loginOperation;
|
||||
}
|
||||
|
||||
return {
|
||||
start, login,
|
||||
stop() {
|
||||
if (terminal) return;
|
||||
const errors: unknown[] = [];
|
||||
shutdown(errors);
|
||||
if (errors.length > 0) {
|
||||
const error = collected(errors);
|
||||
options.onFailure(error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
getSnapshot: () => ({ state: runtime === null ? null : runtime.state,
|
||||
ready: !terminal && runtime !== null && runtime.ready, busy }),
|
||||
};
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2c6ce55f-b5a3-4503-bc65-ca12c5537c8f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
-138
@@ -1,138 +0,0 @@
|
||||
import {
|
||||
assertLocalConnectionTarget,
|
||||
type LocalStartupContext,
|
||||
} from '../../framework/config/local-startup.ts';
|
||||
import type { Transport } from '../../framework/net/transport.ts';
|
||||
|
||||
export type LocalLoginEvidence = { kind: string; data: unknown };
|
||||
export type EvidenceSink = (event: LocalLoginEvidence) => void;
|
||||
|
||||
interface LocalLoginTransportOptions {
|
||||
context: LocalStartupContext;
|
||||
createSocket: (url: string) => WebSocket;
|
||||
onFault: (error: unknown) => void;
|
||||
record: EvidenceSink;
|
||||
}
|
||||
|
||||
/** ES2020 aggregate: retain originals before notifying a terminal observer once. */
|
||||
class LocalLoginTransportFault extends Error {
|
||||
readonly errors: readonly unknown[];
|
||||
constructor(errors: readonly unknown[]) {
|
||||
super('Local login transport failed with an additional cleanup error');
|
||||
this.name = 'LocalLoginTransportFault';
|
||||
this.errors = Object.freeze([...errors]);
|
||||
}
|
||||
}
|
||||
|
||||
/** Local-only socket boundary; raw evidence precedes protocol decoding. */
|
||||
export class LocalLoginTransport implements Transport {
|
||||
private socket: WebSocket | null = null;
|
||||
private generation = 0;
|
||||
private openCallback?: () => void;
|
||||
private messageCallback?: (frame: string) => void;
|
||||
private closeCallback?: () => void;
|
||||
|
||||
constructor(private readonly options: LocalLoginTransportOptions) {}
|
||||
|
||||
connect(url: string): void {
|
||||
try {
|
||||
assertLocalConnectionTarget(this.options.context, url);
|
||||
} catch (error) {
|
||||
this.options.onFault(error);
|
||||
throw error;
|
||||
}
|
||||
this.close();
|
||||
let socket: WebSocket;
|
||||
try {
|
||||
socket = this.options.createSocket(url);
|
||||
} catch (error) {
|
||||
this.options.onFault(error);
|
||||
throw error;
|
||||
}
|
||||
this.socket = socket;
|
||||
const generation = this.generation;
|
||||
socket.onopen = () => {
|
||||
if (this.socket === socket) this.openCallback?.();
|
||||
};
|
||||
socket.onmessage = (event) => {
|
||||
if (this.socket !== socket) return;
|
||||
if (typeof event.data !== 'string') {
|
||||
this.stopWithFault(new TypeError('Local login WebSocket requires text frames'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.options.record({ kind: 'transport-receive', data: event.data });
|
||||
} catch (error) {
|
||||
throw this.stopWithFault(error);
|
||||
}
|
||||
if (this.socket === socket) this.messageCallback?.(event.data);
|
||||
};
|
||||
socket.onclose = () => {
|
||||
if (this.socket !== socket) return;
|
||||
this.socket = null;
|
||||
this.closeCallback?.();
|
||||
};
|
||||
socket.onerror = (event) => {
|
||||
if (this.socket !== socket) return;
|
||||
try {
|
||||
this.options.record({ kind: 'transport-error', data: event });
|
||||
} catch (error) {
|
||||
throw this.stopWithFault(error);
|
||||
}
|
||||
if (this.socket !== socket || this.generation !== generation) return;
|
||||
// Invalidate before close: browsers may dispatch close after error.
|
||||
this.socket = null;
|
||||
try {
|
||||
socket.close();
|
||||
} catch (error) {
|
||||
this.options.onFault(error);
|
||||
throw error;
|
||||
}
|
||||
if (this.generation === generation) this.closeCallback?.();
|
||||
};
|
||||
}
|
||||
|
||||
send(frame: string): void {
|
||||
const socket = this.socket;
|
||||
if (!socket || socket.readyState !== 1) {
|
||||
throw new Error('Local login WebSocket must be OPEN before send');
|
||||
}
|
||||
try {
|
||||
socket.send(frame);
|
||||
this.options.record({ kind: 'transport-send', data: frame });
|
||||
} catch (error) {
|
||||
throw this.stopWithFault(error);
|
||||
}
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.generation++;
|
||||
const socket = this.socket;
|
||||
this.socket = null;
|
||||
if (!socket) return;
|
||||
try {
|
||||
socket.close();
|
||||
} catch (error) {
|
||||
this.options.onFault(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
onOpen(callback: () => void): void { this.openCallback = callback; }
|
||||
onMessage(callback: (frame: string) => void): void { this.messageCallback = callback; }
|
||||
onClose(callback: () => void): void { this.closeCallback = callback; }
|
||||
|
||||
private stopWithFault(error: unknown): unknown {
|
||||
const socket = this.socket;
|
||||
this.socket = null;
|
||||
const errors: unknown[] = [error];
|
||||
try {
|
||||
socket?.close();
|
||||
} catch (cleanupError) {
|
||||
errors.push(cleanupError);
|
||||
}
|
||||
const fault = errors.length === 1 ? error : new LocalLoginTransportFault(errors);
|
||||
this.options.onFault(fault);
|
||||
return fault;
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2bbf94d8-6aa1-4b5f-a94c-c3f12205f46c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
-317
@@ -1,317 +0,0 @@
|
||||
import { Director, Label, Node, Sprite, UITransform, Vec3, Widget, director } from 'cc';
|
||||
import type { FrameScheduler, OverlayModel, PageId, PageModel, PlatformViewPort } from '../../framework/presentation/ui-contracts.ts';
|
||||
|
||||
interface ViewReferences {
|
||||
loadingRoot: Node; loginRoot: Node; resultRoot: Node;
|
||||
statusOverlay: Node; statusLabel: Label; resultLabel: Label;
|
||||
}
|
||||
|
||||
export interface LogoCountdownState { readonly visible: boolean; readonly text: string; }
|
||||
|
||||
const DIAGNOSTIC_STOP_GAP = 12;
|
||||
|
||||
/** Keeps the scene diagnostic control clear of the native Logo click region. */
|
||||
export function positionDiagnosticStopButtonBelow(stopButton: Node, logoButton: Node): void {
|
||||
const stopTransform = stopButton.getComponent(UITransform);
|
||||
const logoTransform = logoButton.getComponent(UITransform);
|
||||
const stopParentTransform = stopButton.parent?.getComponent(UITransform);
|
||||
if (!stopTransform || !logoTransform || !stopParentTransform) {
|
||||
throw new Error('Diagnostic stop layout requires native UITransform bindings');
|
||||
}
|
||||
const widget = stopButton.getComponent(Widget);
|
||||
if (widget) {
|
||||
widget.updateAlignment();
|
||||
widget.enabled = false;
|
||||
}
|
||||
const logoBottom = logoTransform.convertToWorldSpaceAR(
|
||||
new Vec3((0.5 - logoTransform.anchorX) * logoTransform.width, -logoTransform.anchorY * logoTransform.height, 0),
|
||||
);
|
||||
const bottomInStopParent = stopParentTransform.convertToNodeSpaceAR(logoBottom);
|
||||
const current = stopButton.position;
|
||||
stopButton.setPosition(new Vec3(current.x,
|
||||
bottomInStopParent.y - DIAGNOSTIC_STOP_GAP - (1 - stopTransform.anchorY) * stopTransform.height,
|
||||
current.z));
|
||||
}
|
||||
|
||||
/** Native input and measured label layout, independent of serialized label parentage. */
|
||||
export class CocosLogoCountdownView {
|
||||
private readonly label: Label;
|
||||
private readonly buttonTransform: UITransform;
|
||||
private readonly textTransform: UITransform;
|
||||
private readonly parentTransform: UITransform;
|
||||
private disposed = false;
|
||||
|
||||
constructor(private readonly button: Node, private readonly text: Node, private readonly onSkip: () => void) {
|
||||
const label = text.getComponent(Label), buttonTransform = button.getComponent(UITransform);
|
||||
const textTransform = text.getComponent(UITransform), parentTransform = text.parent?.getComponent(UITransform);
|
||||
if (!label || !buttonTransform || !textTransform || !parentTransform) {
|
||||
throw new Error('Logo countdown requires Label and native UITransform bindings');
|
||||
}
|
||||
this.label = label; this.buttonTransform = buttonTransform;
|
||||
this.textTransform = textTransform; this.parentTransform = parentTransform;
|
||||
// The label follows the actual button center, so its old absolute Widget must not fight layout.
|
||||
const widget = text.getComponent(Widget); if (widget) widget.enabled = false;
|
||||
this.label.overflow = Label.Overflow.NONE;
|
||||
button.active = false; text.active = false;
|
||||
button.on(Node.EventType.TOUCH_END, onSkip);
|
||||
}
|
||||
|
||||
render(state: LogoCountdownState): void {
|
||||
if (this.disposed) return;
|
||||
this.button.active = state.visible; this.text.active = state.visible;
|
||||
this.label.string = state.text;
|
||||
if (!state.visible) return;
|
||||
this.button.getComponent(Widget)?.updateAlignment();
|
||||
this.label.updateRenderData(true);
|
||||
const button = this.buttonTransform, text = this.textTransform;
|
||||
const center = button.convertToWorldSpaceAR(new Vec3((0.5 - button.anchorX) * button.width, (0.5 - button.anchorY) * button.height, 0));
|
||||
const position = this.parentTransform.convertToNodeSpaceAR(center);
|
||||
position.x += (text.anchorX - 0.5) * text.width;
|
||||
position.y += (text.anchorY - 0.5) * text.height;
|
||||
this.text.setPosition(position);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
if (this.disposed) return;
|
||||
this.disposed = true;
|
||||
this.button.off(Node.EventType.TOUCH_END, this.onSkip);
|
||||
this.button.active = false; this.text.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Display gate only. Runtime still independently owns resource/config/socket gates. */
|
||||
export function createLogoCountdown(options: {
|
||||
now(): number;
|
||||
schedule(callback: () => void, milliseconds: number): () => void;
|
||||
render(state: LogoCountdownState): void;
|
||||
}) {
|
||||
let started = false, finished = false, resources = false, socket = false;
|
||||
let remaining = 0, deadline = 0;
|
||||
let cancelDeadline: (() => void) | null = null, cancelTick: (() => void) | null = null;
|
||||
let resolve!: () => void, reject!: (error: unknown) => void;
|
||||
const promise = new Promise<void>((yes, no) => { resolve = yes; reject = no; });
|
||||
// Cancellation may precede the host attaching the display gate.
|
||||
void promise.catch(() => {});
|
||||
const render = () => options.render({ visible: started && !finished && remaining > 0,
|
||||
text: `倒计时${Math.ceil(Math.max(0, remaining) / 1000)}s${resources ? ' 跳过' : ''}` });
|
||||
const finish = (error?: unknown) => {
|
||||
if (finished) return;
|
||||
finished = true;
|
||||
const failures: unknown[] = error === undefined ? [] : [error];
|
||||
for (const cancel of [cancelDeadline, cancelTick]) {
|
||||
try { cancel?.(); } catch (failure) { failures.push(failure); }
|
||||
}
|
||||
cancelDeadline = null; cancelTick = null;
|
||||
try { render(); } catch (failure) { failures.push(failure); }
|
||||
if (failures.length > 0) reject(failures[0]); else resolve();
|
||||
};
|
||||
const guard = (operation: () => void) => {
|
||||
if (finished) return;
|
||||
try { operation(); } catch (error) { finish(error); }
|
||||
};
|
||||
const checkDeadline = () => {
|
||||
cancelDeadline = null;
|
||||
if (finished) return;
|
||||
const wait = deadline - options.now();
|
||||
if (wait <= 0) { finish(); return; }
|
||||
guard(() => { cancelDeadline = options.schedule(checkDeadline, wait); });
|
||||
};
|
||||
const tick = () => {
|
||||
cancelTick = null;
|
||||
if (finished) return;
|
||||
guard(() => {
|
||||
remaining -= 1000;
|
||||
render();
|
||||
if (remaining > 1000) cancelTick = options.schedule(tick, 1000);
|
||||
});
|
||||
};
|
||||
render();
|
||||
return {
|
||||
promise,
|
||||
start(milliseconds: number) {
|
||||
if (finished) return;
|
||||
if (started) throw new Error('Logo countdown already started');
|
||||
if (!Number.isFinite(milliseconds) || milliseconds < 0) throw new Error('Invalid launchWaitTime');
|
||||
started = true; remaining = milliseconds; deadline = options.now() + milliseconds;
|
||||
guard(() => {
|
||||
render(); checkDeadline();
|
||||
if (!finished && remaining > 1000) cancelTick = options.schedule(tick, 1000);
|
||||
});
|
||||
},
|
||||
resourcesReady() { guard(() => { resources = true; render(); }); },
|
||||
socketReady(value: boolean) { if (!finished) socket = value; },
|
||||
skip() { if (!finished && started && resources && socket) finish(); },
|
||||
cancel() { finish(new Error('Logo countdown cancelled')); },
|
||||
};
|
||||
}
|
||||
|
||||
export interface AssetLoadTask<T> {
|
||||
readonly promise: Promise<T>;
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
type AssetLoadStarter<T> = (
|
||||
onProgress: (completed: number, total: number) => void,
|
||||
onComplete: (error: unknown, asset?: T) => void,
|
||||
) => void;
|
||||
|
||||
/** Owns loader callback lifetime so stop/failure cannot revive the login flow. */
|
||||
export function createAssetLoadTask<T>(start: AssetLoadStarter<T>, setProgress: (progress: number) => void): AssetLoadTask<T> {
|
||||
let settled = false;
|
||||
let resolveTask!: (asset: T) => void;
|
||||
let rejectTask!: (error: unknown) => void;
|
||||
const promise = new Promise<T>((resolve, reject) => { resolveTask = resolve; rejectTask = reject; });
|
||||
const reject = (error: unknown) => {
|
||||
if (settled) return;
|
||||
settled = true;
|
||||
rejectTask(error);
|
||||
};
|
||||
try {
|
||||
setProgress(0);
|
||||
start((completed, total) => {
|
||||
if (settled) return;
|
||||
if (!Number.isInteger(completed) || !Number.isInteger(total) || completed < 0 || total <= 0 || completed > total) {
|
||||
reject(new Error(`Invalid asset load progress: completed=${completed}, total=${total}`));
|
||||
return;
|
||||
}
|
||||
try { setProgress(completed / total); }
|
||||
catch (error) { reject(error); }
|
||||
}, (error, asset) => {
|
||||
if (settled) return;
|
||||
if (error !== null && error !== undefined) { reject(error); return; }
|
||||
if (asset === null || asset === undefined) { reject(new Error('Asset loader completed without an asset')); return; }
|
||||
settled = true;
|
||||
resolveTask(asset);
|
||||
});
|
||||
} catch (error) { reject(error); }
|
||||
return { promise, cancel() { reject(new Error('Asset load cancelled')); } };
|
||||
}
|
||||
|
||||
export function requireNode(root: Node, path: string): Node {
|
||||
const node = root.getChildByPath(path);
|
||||
if (node === null) throw new Error(`Local login binding missing node: ${path}`);
|
||||
return node;
|
||||
}
|
||||
|
||||
function describeFailure(error: unknown): string {
|
||||
if (error instanceof Error) {
|
||||
const details = 'errors' in error ? (error as Error & { errors: unknown[] }).errors : [];
|
||||
return [error.message, ...details.map(describeFailure)].join('\n');
|
||||
}
|
||||
if (typeof error === 'string') return error;
|
||||
return JSON.stringify(error, (_key, value: unknown) => value instanceof Error ? describeFailure(value) : value);
|
||||
}
|
||||
|
||||
/** Projection of Controller models; owns only Cocos bindings and input state. */
|
||||
export class CocosLocalLoginView implements PlatformViewPort {
|
||||
private visitor: Node | null = null;
|
||||
private version: Label | null = null;
|
||||
private mask: Node | null = null;
|
||||
private touch: (() => void) | null = null;
|
||||
private canLogin = false;
|
||||
private busy = false;
|
||||
private terminal = false;
|
||||
private page: PageId = 'loading';
|
||||
|
||||
constructor(private readonly refs: ViewReferences) {
|
||||
for (const [name, value] of Object.entries(refs)) {
|
||||
if (value === null || value === undefined) throw new Error(`Local login binding missing ${name}`);
|
||||
}
|
||||
}
|
||||
|
||||
bindLogin(instance: Node, onLogin: () => void): void {
|
||||
if (this.visitor !== null || this.terminal) throw new Error('Local login view cannot bind twice or after disposal');
|
||||
const visitor = requireNode(instance, 'group-2/游客登录');
|
||||
if (visitor.getComponent(Sprite) === null) throw new Error('游客登录 requires Sprite');
|
||||
if (visitor.getComponent(UITransform) === null) throw new Error('游客登录 requires UITransform');
|
||||
const version = requireNode(instance, 'group-2/版本显示').getComponent(Label);
|
||||
if (version === null) throw new Error('版本显示 requires Label');
|
||||
const mask = requireNode(instance, 'group-2/登录中遮罩');
|
||||
const hidden = ['微信登录', '手机登录', 'qq登录', '快速登录', '隐藏快速登录-1', '隐藏快速登录-2',
|
||||
'登录头像背景框', '登录中头像', '登录中昵称', '登录中动画', '登录中头像框']
|
||||
.map(name => requireNode(instance, `group-2/${name}`));
|
||||
hidden.forEach(node => { node.active = false; });
|
||||
this.visitor = visitor; this.version = version; this.mask = mask;
|
||||
this.touch = () => {
|
||||
if (!this.terminal && !this.busy && this.canLogin && this.page === 'login') onLogin();
|
||||
};
|
||||
visitor.on(Node.EventType.TOUCH_END, this.touch);
|
||||
mask.active = this.busy;
|
||||
}
|
||||
|
||||
setVersion(version: number): void {
|
||||
if (this.version === null) throw new Error('Login instance must be bound before version display');
|
||||
this.version.string = String(version);
|
||||
}
|
||||
|
||||
render(model: PageModel): void {
|
||||
if (this.terminal) return;
|
||||
switch (model.page) {
|
||||
case 'loading': this.refs.statusLabel.string = '正在加载资源和连接本地服务…'; break;
|
||||
case 'login': this.canLogin = model.canLogin; break;
|
||||
case 'lobby':
|
||||
this.refs.resultLabel.string = `登录成功\n玩家 ID:${model.self.playerid}\n昵称:${model.self.nickname}\n豆豆:${model.self.bean}`;
|
||||
break;
|
||||
case 'room': throw new Error('Local login view cannot present room');
|
||||
}
|
||||
}
|
||||
|
||||
activate(page: PageId): void {
|
||||
if (this.terminal) return;
|
||||
if (page === 'room') throw new Error('Local login view cannot activate room');
|
||||
this.page = page;
|
||||
this.refs.loadingRoot.active = page === 'loading';
|
||||
this.refs.loginRoot.active = page === 'login';
|
||||
this.refs.resultRoot.active = page === 'lobby';
|
||||
this.refs.statusOverlay.active = page === 'loading' || this.busy;
|
||||
}
|
||||
|
||||
setBusy(busy: boolean): void {
|
||||
if (this.terminal) return;
|
||||
this.busy = busy;
|
||||
if (this.mask !== null) this.mask.active = busy;
|
||||
this.refs.statusOverlay.active = busy || this.page === 'loading';
|
||||
if (busy) this.refs.statusLabel.string = '正在登录,请稍候…';
|
||||
}
|
||||
|
||||
showOverlay(model: OverlayModel): void {
|
||||
if (this.terminal) return;
|
||||
switch (model.kind) {
|
||||
case 'none': this.refs.statusOverlay.active = this.busy || this.page === 'loading'; break;
|
||||
case 'reconnect':
|
||||
this.refs.statusOverlay.active = true;
|
||||
this.refs.statusLabel.string = '连接中断,正在重连…'; break;
|
||||
case 'denial': this.showFailure(model.outcome.data); break;
|
||||
case 'kicked': this.showFailure(model.data); break;
|
||||
case 'fatal': this.showFailure(model.error); break;
|
||||
}
|
||||
}
|
||||
|
||||
showFailure(error: unknown): void {
|
||||
this.dispose();
|
||||
this.refs.statusOverlay.active = true;
|
||||
this.refs.statusLabel.string = `验证失败:${describeFailure(error)}`;
|
||||
}
|
||||
|
||||
showStopped(): void {
|
||||
if (this.terminal) return;
|
||||
this.dispose();
|
||||
this.refs.statusOverlay.active = true;
|
||||
this.refs.statusLabel.string = '已停止本次验证';
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.terminal = true; this.canLogin = false; this.busy = false;
|
||||
if (this.visitor !== null && this.touch !== null) this.visitor.off(Node.EventType.TOUCH_END, this.touch);
|
||||
this.touch = null;
|
||||
if (this.mask !== null) this.mask.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
export function createCocosFrameScheduler(): FrameScheduler {
|
||||
return { request(callback) {
|
||||
const onDraw = () => { director.off(Director.EVENT_AFTER_DRAW, onDraw); callback(); };
|
||||
director.on(Director.EVENT_AFTER_DRAW, onDraw);
|
||||
return () => { director.off(Director.EVENT_AFTER_DRAW, onDraw); };
|
||||
} };
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "5af2497c-15f2-4493-be9b-a6391d25b878",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
import type { LocalStartupContext } from '../../framework/config/local-startup.ts';
|
||||
import type { Transport } from '../../framework/net/transport.ts';
|
||||
import { WireClient, type WireEvent } from '../../framework/net/wire-client.ts';
|
||||
import type { PlatformWireClient } from '../../framework/platform/runtime.ts';
|
||||
import { parseLoginResponse } from '../../framework/protocol/contracts/index.ts';
|
||||
import type { EvidenceSink } from './local-login-transport.ts';
|
||||
|
||||
interface LocalLoginWireOptions {
|
||||
context: LocalStartupContext;
|
||||
transportFactory: () => Transport;
|
||||
onFault: (error: unknown) => void;
|
||||
record: EvidenceSink;
|
||||
}
|
||||
|
||||
/** ES2020-compatible aggregate retaining original errors, including non-Error values. */
|
||||
class LocalLoginWireFault extends Error {
|
||||
readonly errors: readonly unknown[];
|
||||
constructor(errors: readonly unknown[]) {
|
||||
super('Local login Wire failed with additional cleanup or evidence errors');
|
||||
this.name = 'LocalLoginWireFault';
|
||||
this.errors = Object.freeze([...errors]);
|
||||
}
|
||||
}
|
||||
|
||||
export function createLocalLoginWire(options: LocalLoginWireOptions): PlatformWireClient {
|
||||
const wire = new WireClient({ servers: options.context.config.servers, transportFactory: options.transportFactory });
|
||||
const listeners = new Set<(event: WireEvent) => void>();
|
||||
let stopped = false;
|
||||
let faulted = false;
|
||||
let terminalDelivery = false;
|
||||
|
||||
function stop(): void {
|
||||
if (stopped) return;
|
||||
stopped = true;
|
||||
unsubscribe();
|
||||
listeners.clear();
|
||||
wire.stop();
|
||||
}
|
||||
|
||||
function fail(error: unknown, operation?: string, event?: WireEvent): unknown {
|
||||
if (faulted) return error;
|
||||
faulted = true;
|
||||
const errors = [error];
|
||||
try { stop(); } catch (cleanupError) { errors.push(cleanupError); }
|
||||
if (operation !== undefined) {
|
||||
try { options.record({ kind: 'scope-violation', data: { operation, event } }); }
|
||||
catch (recordError) { errors.push(recordError); }
|
||||
}
|
||||
const fault = errors.length === 1 ? error : new LocalLoginWireFault(errors);
|
||||
options.onFault(fault);
|
||||
return fault;
|
||||
}
|
||||
|
||||
function scopeError(operation: string): Error {
|
||||
return new Error(`Local platform login scope forbids ${operation}`);
|
||||
}
|
||||
|
||||
function assertActive(): void {
|
||||
if (stopped || faulted || terminalDelivery) throw new Error('Local login Wire is stopped or terminal');
|
||||
}
|
||||
|
||||
function deliver(event: WireEvent): void {
|
||||
for (const listener of [...listeners]) {
|
||||
if (stopped || faulted) break;
|
||||
listener(event);
|
||||
}
|
||||
}
|
||||
|
||||
const unsubscribe = wire.subscribe(event => {
|
||||
if (stopped || faulted || terminalDelivery) return;
|
||||
try {
|
||||
options.record({ kind: 'wire-event', data: event });
|
||||
if (stopped || faulted) return;
|
||||
if (event.type !== 'message') { deliver(event); return; }
|
||||
const { route, rpc, data } = event.message;
|
||||
if (rpc === 'connect_agentserver' || rpc === 'connect_roomserver' || (route !== 'agent' && route !== 'platform')) {
|
||||
fail(scopeError(`${route}/${rpc}`), `${route}/${rpc}`, event);
|
||||
return;
|
||||
}
|
||||
let terminalOperation: string | undefined;
|
||||
if (route === 'agent' && rpc === 'player_login') {
|
||||
const parsed = parseLoginResponse(data);
|
||||
if (parsed.state === 0 && parsed.room !== null) {
|
||||
fail(scopeError('login room recovery'), 'login room recovery', event);
|
||||
return;
|
||||
}
|
||||
if (parsed.state !== 0) terminalOperation = 'login rejected';
|
||||
}
|
||||
if (route === 'agent' && rpc === 'kick_server') terminalOperation = 'kick_server';
|
||||
if (terminalOperation !== undefined) {
|
||||
// Existing runtime failure display runs first, but cannot initiate more traffic.
|
||||
terminalDelivery = true;
|
||||
try { deliver(event); }
|
||||
catch (error) { fail(error); return; }
|
||||
fail(scopeError(terminalOperation), terminalOperation, event);
|
||||
return;
|
||||
}
|
||||
deliver(event);
|
||||
} catch (error) { fail(error); }
|
||||
});
|
||||
|
||||
return {
|
||||
subscribe(listener) {
|
||||
if (stopped || faulted) return () => {};
|
||||
listeners.add(listener);
|
||||
return () => { listeners.delete(listener); };
|
||||
},
|
||||
start() { assertActive(); wire.start(); },
|
||||
send(envelope) {
|
||||
assertActive();
|
||||
if (envelope.route !== 'agent' || envelope.rpc !== 'player_login') {
|
||||
throw fail(scopeError(`outbound ${envelope.route}/${envelope.rpc}`), `outbound ${envelope.route}/${envelope.rpc}`);
|
||||
}
|
||||
wire.send(envelope);
|
||||
},
|
||||
switchServer() { assertActive(); throw fail(scopeError('switchServer'), 'switchServer'); },
|
||||
reconnectCurrent() { assertActive(); wire.reconnectCurrent(); },
|
||||
stop,
|
||||
};
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "96a339e3-f954-4e96-b07f-9fe124d457f0",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "2d0af0de-962c-48db-a658-3f0396048806",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { _decorator, Component, SpriteFrame } from 'cc';
|
||||
const {ccclass,property}=_decorator;
|
||||
|
||||
/** Serialized frame references keep both original phone-panel modes in the build. */
|
||||
@ccclass('PhoneLoginAssets')
|
||||
export class PhoneLoginAssets extends Component {
|
||||
@property(SpriteFrame) loginTitle:SpriteFrame|null=null;
|
||||
@property(SpriteFrame) codeWaiting:SpriteFrame|null=null;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1f765b40-c144-4ae2-b1b0-7b6ba99fe17a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
import { _decorator, assetManager, Component, Director, Label, Node, Prefab, ProgressBar, SceneAsset,
|
||||
UITransform, Widget, director, instantiate, isValid } from 'cc';
|
||||
import { resolveRuntimeConfig, type RuntimeConfig } from '../../framework/config/runtime-config.ts';
|
||||
import { CocosLocalConfigFetcher } from './local-config-fetcher.ts';
|
||||
import { HttpConfigFetcher } from '../../framework/config/remote-config-fetcher.ts';
|
||||
import { resolveLaunchWaitTime } from '../../framework/config/remote-config.ts';
|
||||
import { resolveLoginPolicy, type LoginPolicy } from '../../framework/presentation/login-policy.ts';
|
||||
import { LoginAccounts, type LoginNativeSettings } from '../../framework/adapters/native/login-accounts.ts';
|
||||
import { WebViewJavascriptBridgeAdapter, type WebViewJavascriptBridgeEnvironment } from '../../framework/adapters/native/webview-javascript-bridge.ts';
|
||||
import { PlatformRuntime } from '../../framework/platform/runtime.ts';
|
||||
import { WireClient } from '../../framework/net/wire-client.ts';
|
||||
import { CocosWebSocketTransport } from '../../framework/net/cocos-transport.ts';
|
||||
import type { DeviceLoginMode, LoginAccountIdentity, LoginDeviceSnapshot } from '../../framework/protocol/contracts/login-contract.ts';
|
||||
import { createLoginStageGameEntry } from './login-stage-game-entry.ts';
|
||||
import { CocosLogoCountdownView, createLogoCountdown } from './logo-countdown.ts';
|
||||
import { requireNode } from './node-bindings.ts';
|
||||
import { SceneFlow } from './scene-flow.ts';
|
||||
import { LoginPanel } from './login-panel.ts';
|
||||
|
||||
const {ccclass,property}=_decorator;
|
||||
function required<T>(value:T|null|undefined,name:string):T{if(value==null)throw Error(`PlatformStartup missing ${name}`);return value;}
|
||||
|
||||
/** One persistent owner for config/socket/account; scenes own their own visual trees. */
|
||||
@ccclass('PlatformStartup')
|
||||
export class PlatformStartup extends Component {
|
||||
@property(SceneAsset) loadingScene:SceneAsset|null=null;
|
||||
@property(SceneAsset) loginScene:SceneAsset|null=null;
|
||||
@property(Prefab) loadingPrefab:Prefab|null=null;
|
||||
@property(Prefab) loginPrefab:Prefab|null=null;
|
||||
@property(Prefab) protocolPrefab:Prefab|null=null;
|
||||
@property(Prefab) phonePrefab:Prefab|null=null;
|
||||
private runtime:PlatformRuntime|null=null;
|
||||
private config:RuntimeConfig|null=null;
|
||||
private policy:LoginPolicy|null=null;
|
||||
private accounts:LoginAccounts|null=null;
|
||||
private panel:LoginPanel|null=null;
|
||||
private bridge:WebViewJavascriptBridgeAdapter|null=null;
|
||||
private restoreShareLogin:(()=>void)|null=null;
|
||||
private restoreLocation:(()=>void)|null=null;
|
||||
private startLocation:(()=>void)|null=null;
|
||||
private location:unknown=null;
|
||||
private loginResponse:unknown=null;
|
||||
private unsubscribe:(()=>void)|null=null;
|
||||
private countdown:ReturnType<typeof createLogoCountdown>|null=null;
|
||||
private countdownView:CocosLogoCountdownView|null=null;
|
||||
private progress:ProgressBar|null=null;
|
||||
private status:Label|null=null;
|
||||
private device:LoginDeviceSnapshot|null=null;
|
||||
private busy=false;
|
||||
private terminal=false;
|
||||
private readonly events:Array<{kind:string;data:unknown}>=[];
|
||||
private readonly flow=new SceneFlow(name=>new Promise<void>((resolve,reject)=>{
|
||||
if(!director.loadScene(name,error=>error?reject(error):resolve()))reject(Error(`Cannot load scene ${name}`));
|
||||
}));
|
||||
|
||||
/** 常驻服务按加载场景、配置与桥接、连接、登录场景顺序启动;场景仅拥有自己的 UI。 */
|
||||
async start():Promise<void>{
|
||||
try{
|
||||
required(this.loadingScene,'loadingScene');required(this.loginScene,'loginScene');
|
||||
required(this.loadingPrefab,'loadingPrefab');required(this.loginPrefab,'loginPrefab');
|
||||
required(this.protocolPrefab,'protocolPrefab');required(this.phonePrefab,'phonePrefab');
|
||||
director.addPersistRootNode(this.node);
|
||||
await this.flow.enter(this.loadingScene!.name,()=>this.bindLoading());
|
||||
if(this.terminal)return;
|
||||
const injected=window as unknown as {settings?:LoginNativeSettings & {startlocation(type:number):void};app_version?:number|string;app_appversion?:number|string};
|
||||
const bridgeHost=injected.app_version!==undefined&&Number(injected.app_version)!==0;
|
||||
const native=bridgeHost?{
|
||||
getcompareCode:()=>Number(injected.app_appversion),
|
||||
// uAgent_3 passes the original argument, not its unused local tp variable.
|
||||
accreditlogin:(provider:number)=>required(this.bridge,'native bridge').call('accreditlogin',provider===2?undefined:provider,()=>{}),
|
||||
}:injected.settings;
|
||||
this.config=await resolveRuntimeConfig({hostKind:bridgeHost?'uAgent_3':native?'native-settings':'h5',win:window as any,
|
||||
search:window.location.search,fetcher:new HttpConfigFetcher(),localFetcher:new CocosLocalConfigFetcher()});
|
||||
if(this.terminal)return;
|
||||
this.policy=resolveLoginPolicy(this.config.remoteConfig);
|
||||
const loginConfig={source:this.config.source,gameserver:this.config.gameserver,identity:this.config.identity,
|
||||
showVisitor:this.policy.showVisitor,deviceLogin:this.policy.deviceLogin,qqLogin:this.policy.qqLogin};
|
||||
this.events.push({kind:'login-config',data:loginConfig});
|
||||
if(this.config.isDebugger)console.info('[PlatformStartup] login-config',JSON.stringify(loginConfig));
|
||||
this.accounts=new LoginAccounts({storage:window.localStorage,settings:native,random:Math.random,now:Date.now,
|
||||
gameid:this.config.identity.gameid,agentid:this.config.identity.agentid,policy:this.policy,
|
||||
submit:(account,mode)=>this.login(account,mode),tip:text=>this.tip(text)});
|
||||
const previous=(window as any).sharelogin;
|
||||
const callback=(openid:unknown,headimgurl:unknown,nickname:unknown,sex:unknown,city:unknown,Province:unknown,unionid:unknown)=>{
|
||||
if(!this.terminal)this.acceptNative({openid,headimgurl,nickname,sex,city,Province,unionid},'global');
|
||||
};
|
||||
(window as any).sharelogin=callback;
|
||||
this.restoreShareLogin=()=>{if((window as any).sharelogin===callback){if(previous===undefined)delete (window as any).sharelogin;else (window as any).sharelogin=previous;}};
|
||||
const oldLocation=(window as any).getlocationinfo;
|
||||
const locationCallback=(data:unknown)=>{
|
||||
if(this.terminal)return;
|
||||
try{
|
||||
const value=typeof data==='string'?JSON.parse(data):data;
|
||||
if(value===null||typeof value!=='object'||Array.isArray(value))throw Error('Invalid getlocationinfo payload');
|
||||
this.location=value;
|
||||
}catch(error){this.tip(error instanceof Error?error.message:String(error));}
|
||||
};
|
||||
(window as any).getlocationinfo=locationCallback;
|
||||
this.restoreLocation=()=>{if((window as any).getlocationinfo===locationCallback){if(oldLocation===undefined)delete (window as any).getlocationinfo;else (window as any).getlocationinfo=oldLocation;}};
|
||||
if(native){
|
||||
this.bridge=new WebViewJavascriptBridgeAdapter(window as unknown as WebViewJavascriptBridgeEnvironment);
|
||||
this.bridge.register('sharelogin',data=>this.acceptNative(data,'bridge'));
|
||||
this.bridge.register('getlocationinfo',locationCallback);
|
||||
this.startLocation=()=>{if(bridgeHost)required(this.bridge,'native bridge').call('startlocation',2,()=>{});
|
||||
else required(injected.settings,'settings').startlocation(2);};
|
||||
}
|
||||
required(this.countdown,'countdown').start(resolveLaunchWaitTime(this.config.remoteConfig));
|
||||
this.runtime=new PlatformRuntime({gameEntry:createLoginStageGameEntry(this.config.identity.gameid,event=>this.events.push(event)),
|
||||
resolveRuntimeConfig:async()=>required(this.config,'config'),
|
||||
createWireClient:config=>{
|
||||
const wire=new WireClient({servers:config.servers,transportFactory:()=>new CocosWebSocketTransport()});
|
||||
wire.subscribe(event=>{this.events.push({kind:'wire',data:event.type});
|
||||
if(event.type==='message'&&event.message.route==='agent'&&event.message.rpc==='player_login')this.loginResponse=event.message.data;
|
||||
});return wire;
|
||||
},
|
||||
scene:{showLoading:()=>{},showLogin:()=>{void this.showLogin().catch(error=>this.fail(error));},
|
||||
showLobby:()=>{try{required(this.accounts,'accounts').loginSucceeded(required(this.loginResponse,'login response'),required(this.device,'prepared login device').deviceLogin);
|
||||
this.busy=false;this.panel?.setBusy(false);this.panel?.close();this.tip('登录成功');}catch(error){this.fail(error);}},
|
||||
showRoom:()=>this.fail(Error('当前入口尚未接入子游戏场景')),
|
||||
showReconnect:()=>this.tip('连接中断,正在重连…'),
|
||||
showKicked:data=>this.fail(Error(`账号退出:${JSON.stringify(data)}`)),
|
||||
showServerDenial:outcome=>{this.busy=false;this.panel?.setBusy(false);this.tip(JSON.stringify(outcome.data));},
|
||||
showFatal:error=>this.fail(error)},
|
||||
loadResources:()=>this.loadLoginResources(),
|
||||
waitForMinimumDisplay:()=>required(this.countdown,'countdown').promise,
|
||||
getLoginDeviceSnapshot:()=>required(this.device,'prepared login device'),
|
||||
});
|
||||
this.unsubscribe=this.runtime.subscribeState(state=>this.countdown?.socketReady(state.app.phase==='connected'||state.app.phase==='logged-in'),error=>this.fail(error));
|
||||
await this.runtime.start();
|
||||
}catch(error){this.fail(error);}
|
||||
}
|
||||
private canvas():Node{return required(director.getScene(),'scene').getChildByName('Canvas') ?? (()=>{throw Error('Scene requires Canvas');})();}
|
||||
private createStatus():void{
|
||||
const canvas=this.canvas();const node=new Node('Status');node.parent=canvas;node.layer=canvas.layer;
|
||||
node.setPosition(0,315,0);node.addComponent(UITransform).setContentSize(1200,60);
|
||||
this.status=node.addComponent(Label);this.status.string='';this.status.fontSize=24;this.status.lineHeight=28;
|
||||
}
|
||||
private async bindLoading():Promise<void>{
|
||||
const logo=instantiate(required(this.loadingPrefab,'loadingPrefab'));logo.parent=this.canvas();logo.setPosition(0,0,0);
|
||||
this.createStatus();requireNode(logo,'group-32').active=false;
|
||||
this.progress=required(requireNode(logo,'group-1/Spirit254').getComponent(ProgressBar),'Logo ProgressBar');
|
||||
const labels=logo.getComponentsInChildren(Label).filter(label=>label.node.name==='Spirit3104');
|
||||
if(labels.length!==1)throw Error('Logo requires one Spirit3104');
|
||||
this.countdownView=new CocosLogoCountdownView(requireNode(logo,'group-1/Spirit3103'),labels[0].node,()=>this.countdown?.skip());
|
||||
this.countdown=createLogoCountdown({now:()=>performance.now(),schedule:(callback,ms)=>{const id=window.setTimeout(callback,ms);return ()=>window.clearTimeout(id);},
|
||||
render:state=>this.countdownView?.render(state)});
|
||||
await new Promise<void>(resolve=>director.once(Director.EVENT_AFTER_DRAW,resolve));
|
||||
this.events.push({kind:'scene',data:'Loading'});
|
||||
}
|
||||
private async loadLoginResources():Promise<void>{
|
||||
const prefab=required(this.loginPrefab,'loginPrefab');
|
||||
await new Promise<void>((resolve,reject)=>assetManager.loadAny(prefab.uuid,(done,total)=>{
|
||||
if(!this.terminal&&this.progress&&total>0)this.progress.progress=done/total;
|
||||
},error=>error?reject(error):resolve()));
|
||||
if(this.terminal)throw Error('Startup stopped');
|
||||
this.countdown?.resourcesReady();required(this.progress,'progress').node.active=false;
|
||||
}
|
||||
/** 完成真实场景切换后再绑定按钮和尝试缓存登录;弹窗挂在独立 PopupRoot。 */
|
||||
private async showLogin():Promise<void>{
|
||||
this.countdownView?.dispose();this.countdownView=null;
|
||||
await this.flow.enter(required(this.loginScene,'loginScene').name,()=>{
|
||||
const root=instantiate(required(this.loginPrefab,'loginPrefab'));root.parent=this.canvas();root.setPosition(0,0,0);
|
||||
const popup=new Node('PopupRoot');popup.parent=this.canvas();popup.layer=root.layer;popup.addComponent(UITransform).setContentSize(1600,720);
|
||||
this.createStatus();this.panel=new LoginPanel(root,popup,required(this.protocolPrefab,'protocolPrefab'),required(this.phonePrefab,'phonePrefab'),
|
||||
required(this.accounts,'accounts'),required(this.policy,'policy'),message=>this.tip(message),
|
||||
()=>!this.busy&&!this.terminal&&this.runtime?.state.app.phase==='connected');
|
||||
const version=required(requireNode(root,'group-2/版本显示').getComponent(Label),'version Label');
|
||||
// Beta 展示格式使用当前渠道版本号;只改变显示,不改变登录协议中的数值版本。
|
||||
version.string=`v${required(this.config,'config').identity.version}.0.0 Beta`;
|
||||
// Label 自动尺寸更新后重新计算左上角 Widget,避免长版本文字向屏幕外扩展。
|
||||
required(version.node.getComponent(UITransform),'version UITransform').setAnchorPoint(0,1);
|
||||
version.updateRenderData(true);
|
||||
const versionWidget=required(version.node.getComponent(Widget),'version Widget');
|
||||
versionWidget.target=this.canvas();
|
||||
versionWidget.updateAlignment();
|
||||
this.events.push({kind:'scene',data:'Login'});
|
||||
// Legacy location acquisition is independent of login. Keep the source null
|
||||
// until a real callback arrives; report host failure without stopping the socket.
|
||||
try{this.startLocation?.();}catch(error){this.tip(`定位接口调用失败:${error instanceof Error?error.message:String(error)}`);}
|
||||
if(this.accounts!.cached())this.accounts!.autoLogin();
|
||||
});
|
||||
}
|
||||
private acceptNative(data:unknown,channel:'global'|'bridge'):void{
|
||||
if(this.terminal)return;
|
||||
try{required(this.accounts,'accounts').acceptNative(data,channel);}catch(error){this.tip(error instanceof Error?error.message:String(error));}
|
||||
}
|
||||
/** 所有登录最终收口:再次校验协议与就绪状态,保存本次模式供登录响应使用。 */
|
||||
private login(account:LoginAccountIdentity,mode:DeviceLoginMode):void{
|
||||
const runtime=required(this.runtime,'runtime');
|
||||
if(this.busy||this.terminal)return;
|
||||
if(!required(this.accounts,'accounts').requireAgreement())return;
|
||||
if(!runtime.ready)throw Error('登录资源或连接尚未就绪');
|
||||
const storage=window.localStorage;
|
||||
let machineid=storage.getItem('tsgame_machineId_');
|
||||
if(machineid===null){machineid=`${Date.now()}-${1000+Math.floor(Math.random()*8999)}`;storage.setItem('tsgame_machineId_',machineid);}
|
||||
const host=window as unknown as {returnCitySN?:{ip:string;province:string;city:string}};
|
||||
const city=host.returnCitySN;
|
||||
if(city!==undefined&&(!city||typeof city.ip!=='string'||typeof city.province!=='string'||typeof city.city!=='string'))throw Error('Invalid returnCitySN');
|
||||
this.device={location:this.location,machineid,machineroom:'',deviceLogin:mode,loginPlayerId:{enabled:false},...(city?{ip:city.ip}:{})};
|
||||
this.busy=true;this.panel?.setBusy(true);
|
||||
try{runtime.login(city?{...account,province:city.province,city:city.city}:account);}
|
||||
catch(error){this.busy=false;this.panel?.setBusy(false);throw error;}
|
||||
}
|
||||
private tip(text:string):void{if(this.status&&isValid(this.status))this.status.string=text;}
|
||||
private fail(error:unknown):void{
|
||||
this.tip(error instanceof Error?error.message:String(error));console.error('[PlatformStartup]',error);
|
||||
this.release();
|
||||
}
|
||||
/** 幂等释放计时器、订阅和宿主回调,阻止销毁后的迟到消息重新激活流程。 */
|
||||
private release():void{
|
||||
if(this.terminal)return;this.terminal=true;this.flow.dispose();this.panel?.dispose();
|
||||
this.countdown?.cancel();this.countdownView?.dispose();this.unsubscribe?.();this.bridge?.dispose();
|
||||
this.restoreShareLogin?.();this.restoreLocation?.();this.runtime?.stop();
|
||||
}
|
||||
onDestroy():void{this.release();}
|
||||
getDiagnostics(){return {events:[...this.events],ready:this.runtime?.ready,busy:this.busy,terminal:this.terminal};}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6dba829e-bbd7-4da8-bd48-2f214eeccc93",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
import { resources, TextAsset } from 'cc';
|
||||
import { DEBUG } from 'cc/env';
|
||||
import { ConfigFetchError, ConfigParseError, type ConfigFetcher } from '../../framework/config/remote-config.ts';
|
||||
|
||||
/**
|
||||
* 开发专用配置读取器。使用 Cocos 资源数据库读取项目 txt,支持预览和调试构建。
|
||||
* 路径由 profiles.ts 唯一指定;读取失败绝不改用远程,以免测试了错误的数据。
|
||||
*/
|
||||
export class CocosLocalConfigFetcher implements ConfigFetcher {
|
||||
async fetch(resourcePath: string): Promise<unknown> {
|
||||
// 除启动配置的 debug 限制外,发布构建也在引擎边界禁止加载开发配置。
|
||||
if (!DEBUG) throw new ConfigFetchError('本地配置仅允许开发预览或调试构建');
|
||||
const asset = await new Promise<TextAsset>((resolve, reject) => {
|
||||
resources.load(resourcePath, TextAsset, (error, result) => {
|
||||
if (error) reject(new ConfigFetchError(`本地配置读取失败: ${resourcePath}.txt: ${error.message}`));
|
||||
else if (!result) reject(new ConfigFetchError(`本地配置资源为空: ${resourcePath}.txt`));
|
||||
else resolve(result);
|
||||
});
|
||||
});
|
||||
try {
|
||||
return JSON.parse(asset.text) as unknown;
|
||||
} catch {
|
||||
throw new ConfigParseError(`本地配置 JSON 解析失败: ${resourcePath}.txt`);
|
||||
} finally {
|
||||
// 内容已转为普通数据;下次启动重新加载,避免沿用旧 TextAsset 缓存。
|
||||
resources.release(resourcePath, TextAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "97325d47-c809-4a38-9e1a-520ee2a3d863",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
import { Animation, assetManager, BlockInputEvents, Color, EditBox, ImageAsset, Label, Node, Prefab, ScrollView, Sprite, SpriteFrame, Texture2D, UITransform, Widget, instantiate, isValid } from 'cc';
|
||||
import type { LoginAccounts } from '../../framework/adapters/native/login-accounts.ts';
|
||||
import { loginButtons, type LoginPolicy } from '../../framework/presentation/login-policy.ts';
|
||||
import { requireNode } from './node-bindings.ts';
|
||||
import { PhoneLoginAssets } from './PhoneLoginAssets.ts';
|
||||
|
||||
/** 登录场景节点与弹窗的生命周期管理;协议状态和账户行为由 LoginAccounts 唯一持有。 */
|
||||
export class LoginPanel {
|
||||
private readonly releases:Array<()=>void>=[];
|
||||
private modal:Node|null=null;
|
||||
private modalReleases:Array<()=>void>=[];
|
||||
private disposed=false;
|
||||
private readonly loadingAnimation:Animation;
|
||||
constructor(readonly root:Node,private readonly popupRoot:Node,
|
||||
private readonly protocol:Prefab,private readonly phone:Prefab,
|
||||
private readonly accounts:LoginAccounts,policy:LoginPolicy,
|
||||
private readonly tip:(message:string)=>void,private readonly canAct:()=>boolean){
|
||||
const group=requireNode(root,'group-2');
|
||||
const animation=requireNode(group,'Logining/登录中动画').getComponent(Animation);
|
||||
if(!animation||!animation.defaultClip)throw Error('登录中动画 requires Animation and default clip');
|
||||
this.loadingAnimation=animation;
|
||||
const state=loginButtons(policy,accounts.versionState,accounts.cached()!==null);
|
||||
const names={wechat:'微信登录',visitor:'游客登录',phone:'手机登录',quick:'快速登录',qq:'qq登录'};
|
||||
for(const key of Object.keys(names) as Array<keyof typeof names>)requireNode(group,names[key]).active=state[key];
|
||||
// JumpWxAuth uses legacy 1280-wide coordinates; prefab coordinates are centered.
|
||||
const left=(name:string,x:number,width?:number,height?:number)=>{
|
||||
const node=requireNode(group,name),ui=node.getComponent(UITransform);if(!ui)throw Error(`${name} requires UITransform`);
|
||||
const widget=node.getComponent(Widget);if(widget)widget.enabled=false;
|
||||
if(width!==undefined&&height!==undefined)ui.setContentSize(width,height);
|
||||
node.setPosition(x-640+ui.width*ui.anchorX,node.position.y,node.position.z);
|
||||
};
|
||||
if(policy.deviceLogin)left('手机登录',490);
|
||||
if(accounts.versionState===1){requireNode(group,'渠道logo').active=false;left('微信登录',113,320,98);left('游客登录',488);}
|
||||
else left('微信登录',415);
|
||||
// Both switches may be enabled by the remote hierarchy. Keep both actions
|
||||
// visible, with the user-requested side-by-side layout instead of overlap.
|
||||
if(state.visitor&&state.phone){
|
||||
for(const [name,x] of [['游客登录',-210],['手机登录',210]] as const){
|
||||
const node=requireNode(group,name),widget=node.getComponent(Widget);if(widget)widget.enabled=false;
|
||||
node.setPosition(x,node.position.y,node.position.z);
|
||||
}
|
||||
}
|
||||
// 登录中展示节点统一位于 prefab 的 Logining 分组,路径必须与资源一致。
|
||||
const logining=requireNode(group,'Logining');
|
||||
for(const name of ['登录头像背景框','登录中头像','登录中昵称','登录中动画','登录中头像框'])requireNode(logining,name).active=state.account;
|
||||
this.setBusy(state.account);
|
||||
const cached=accounts.cached();if(cached){const label=requireNode(logining,'登录中昵称').getComponent(Label);if(!label)throw Error('登录中昵称 requires Label');label.string=cached.nickname;}
|
||||
if(cached?.avatar){
|
||||
const sprite=requireNode(logining,'登录中头像').getComponent(Sprite);if(!sprite)throw Error('登录中头像 requires Sprite');
|
||||
assetManager.loadRemote<ImageAsset>(cached.avatar,{ext:'.png'},(error,image)=>{
|
||||
if(this.disposed||!isValid(sprite))return;
|
||||
if(error){this.tip(`登录头像加载失败:${error.message}`);return;}
|
||||
const texture=new Texture2D();texture.image=image;const frame=new SpriteFrame();frame.texture=texture;sprite.spriteFrame=frame;
|
||||
this.releases.push(()=>{if(isValid(sprite))sprite.spriteFrame=null;frame.destroy();texture.destroy();});
|
||||
});
|
||||
}
|
||||
const check=requireNode(group,'协议确认/check');check.active=accounts.agreed;
|
||||
this.bind(requireNode(group,'协议确认'),()=>{accounts.setAgreement(!accounts.agreed);check.active=accounts.agreed;});
|
||||
this.bind(requireNode(group,'协议内容'),()=>this.openProtocol());
|
||||
this.bind(requireNode(group,'微信登录'),()=>accounts.authorize('wechat'));
|
||||
this.bind(requireNode(group,'qq登录'),()=>accounts.authorize('qq'));
|
||||
this.bind(requireNode(group,'游客登录'),()=>accounts.visitor());
|
||||
this.bind(requireNode(group,'快速登录'),()=>accounts.device());
|
||||
this.bind(requireNode(group,'手机登录'),()=>this.openPhone());
|
||||
this.bind(requireNode(group,'隐藏快速登录-1'),()=>accounts.hiddenFirst());
|
||||
this.bind(requireNode(group,'隐藏快速登录-2'),()=>accounts.hiddenSecond());
|
||||
}
|
||||
private bind(node:Node,action:()=>void,modal=false){
|
||||
const listener=()=>{if(this.disposed||!this.canAct())return;try{action();}catch(error){this.tip(error instanceof Error?error.message:String(error));}};
|
||||
node.on(Node.EventType.TOUCH_END,listener);
|
||||
(modal?this.modalReleases:this.releases).push(()=>node.off(Node.EventType.TOUCH_END,listener));
|
||||
}
|
||||
private open(prefab:Prefab):Node|null{
|
||||
if(this.modal!==null)return null;
|
||||
const modal=instantiate(prefab);modal.parent=this.popupRoot;modal.setPosition(0,0,0);modal.active=true;
|
||||
this.modal=modal;return modal;
|
||||
}
|
||||
/** 协议弹窗独立实例化,每次打开回到顶部,关闭时解除监听并销毁实例。 */
|
||||
openProtocol():void{
|
||||
const modal=this.open(this.protocol);if(!modal)return;
|
||||
const scroll=requireNode(modal,'group-37/协议滚动').getComponent(ScrollView);
|
||||
if(!scroll)throw Error('协议滚动 requires ScrollView');scroll.scrollToTop(0);
|
||||
for(const name of ['Spirit253','协议遮罩'])this.bind(requireNode(modal,`group-37/${name}`),()=>this.close(),true);
|
||||
}
|
||||
/** 沿用原工程输入与验证码倒计时规则;弹窗不另存协议勾选状态。 */
|
||||
openPhone():void{
|
||||
if(!this.accounts.requireAgreement())return;
|
||||
const modal=this.open(this.phone);if(!modal)return;
|
||||
const group=requireNode(modal,'group-106');
|
||||
requireNode(modal,'group-108').active=false;
|
||||
const frames=modal.getComponent(PhoneLoginAssets);
|
||||
if(!frames?.loginTitle||!frames.codeWaiting)throw Error('PhoneLoginAssets requires loginTitle/codeWaiting');
|
||||
const title=requireNode(group,'Spirit3252').getComponent(Sprite);if(!title)throw Error('Spirit3252 requires Sprite');title.spriteFrame=frames.loginTitle;
|
||||
const saved=this.accounts.phonePanelState();
|
||||
const input=(name:string,textName:string,placeholderName:string)=>{
|
||||
const node=requireNode(group,name),labelNode=requireNode(group,textName);
|
||||
const placeholder=requireNode(group,placeholderName);
|
||||
const glyph=labelNode.getComponent(UITransform);if(!glyph)throw Error(`${textName} requires UITransform`);
|
||||
// Existing art remains the input background; native EditBox owns text entry.
|
||||
const ui=node.getComponent(UITransform);if(!ui)throw Error(`${name} requires UITransform`);
|
||||
const text=new Node('InputText');text.parent=node;text.layer=node.layer;
|
||||
const textUi=text.addComponent(UITransform);textUi.setAnchorPoint(0,0.5);textUi.setContentSize(ui.width-85,ui.height);
|
||||
text.setPosition(-ui.width/2+65,0,0);
|
||||
const inputLabel=text.addComponent(Label);inputLabel.string='';inputLabel.fontSize=glyph.height;
|
||||
inputLabel.horizontalAlign=Label.HorizontalAlign.LEFT;inputLabel.overflow=Label.Overflow.CLAMP;inputLabel.color=Color.BLACK;
|
||||
const hint=new Node('Placeholder');hint.parent=node;hint.layer=node.layer;
|
||||
hint.addComponent(UITransform).setContentSize(ui.width-20,ui.height);
|
||||
const hintLabel=hint.addComponent(Label);hintLabel.string='';hintLabel.fontSize=glyph.height;
|
||||
// Configure before onLoad so EditBox does not create orphan default labels.
|
||||
labelNode.active=false;node.active=false;
|
||||
const edit=node.addComponent(EditBox);edit.textLabel=inputLabel;edit.placeholderLabel=hintLabel;
|
||||
edit.string='';edit.placeholder='';
|
||||
edit.inputMode=EditBox.InputMode.NUMERIC;edit.maxLength=18;
|
||||
const changed=()=>{edit.string=edit.string.replace(/\D/g,'');placeholder.active=edit.string.length===0;};
|
||||
node.on(EditBox.EventType.TEXT_CHANGED,changed);this.modalReleases.push(()=>node.off(EditBox.EventType.TEXT_CHANGED,changed));
|
||||
changed();node.active=true;
|
||||
const alignText=()=>{
|
||||
textUi.setAnchorPoint(0,1);textUi.setContentSize(ui.width-85,ui.height);
|
||||
text.setPosition(-ui.width/2+65,ui.height/2,0);inputLabel.verticalAlign=Label.VerticalAlign.CENTER;
|
||||
};
|
||||
alignText();node.on(Node.EventType.SIZE_CHANGED,alignText);
|
||||
this.modalReleases.push(()=>node.off(Node.EventType.SIZE_CHANGED,alignText));return edit;
|
||||
};
|
||||
const phone=input('Spirit3243','Spirit3247','Spirit3249');
|
||||
const code=input('Spirit3244','Spirit3248','Spirit3250');
|
||||
if(saved?.phoneNumber){phone.string=saved.phoneNumber;requireNode(group,'Spirit3249').active=false;}
|
||||
const codeButton=requireNode(group,'Spirit3245'),codeSprite=codeButton.getComponent(Sprite);
|
||||
if(!codeSprite||!codeSprite.spriteFrame)throw Error('Spirit3245 requires SpriteFrame');
|
||||
const idleFrame=codeSprite.spriteFrame;
|
||||
const timerNode=requireNode(group,'Spirit3246'),timerSprite=timerNode.getComponent(Sprite);
|
||||
if(!timerSprite)throw Error('Spirit3246 requires Sprite');timerSprite.enabled=false;
|
||||
const timerWidget=timerNode.getComponent(Widget);if(timerWidget)timerWidget.enabled=false;
|
||||
timerNode.setPosition(codeButton.position);timerNode.getComponent(UITransform)!.setContentSize(148,28);
|
||||
const timerText=new Node('CountdownText');timerText.parent=timerNode;timerText.layer=timerNode.layer;
|
||||
timerText.addComponent(UITransform).setContentSize(148,28);
|
||||
const timerLabel=timerText.addComponent(Label);timerLabel.fontSize=28;timerLabel.color=Color.BLACK;
|
||||
let restTime=saved===null?0:saved.restTime;
|
||||
let waiting=restTime>0;
|
||||
const renderTimer=()=>{timerNode.active=waiting;timerLabel.string=`${restTime}秒`;codeSprite.spriteFrame=waiting?frames.codeWaiting:idleFrame;};
|
||||
renderTimer();
|
||||
if(waiting){const timer=window.setInterval(()=>{restTime--;if(restTime<0){waiting=false;window.clearInterval(timer);}renderTimer();},1000);
|
||||
this.modalReleases.push(()=>window.clearInterval(timer));}
|
||||
this.bind(codeButton,()=>{if(restTime<=0&&phone.string)this.tip('请通过相关渠道获取');},true);
|
||||
this.bind(requireNode(group,'Spirit3253'),()=>{if(!this.accounts.requireAgreement())return;
|
||||
if(!phone.string||!code.string){this.tip('手机号与验证码均不能为空!');return;}
|
||||
this.accounts.phone(phone.string,code.string);this.close();},true);
|
||||
for(const name of ['Spirit3251','Spirit3241'])this.bind(requireNode(group,name),()=>this.close(),true);
|
||||
const background=requireNode(group,'Spirit3242');if(!background.getComponent(BlockInputEvents))background.addComponent(BlockInputEvents);
|
||||
}
|
||||
/** 帧切换由 prefab 的 AnimationClip 驱动;登录状态只负责显隐及播放生命周期。 */
|
||||
setBusy(busy:boolean):void{
|
||||
const group=requireNode(this.root,'group-2/Logining');
|
||||
group.active=busy;
|
||||
for(const name of ['登录中遮罩','登录头像背景框','登录中头像','登录中昵称','登录中动画','登录中头像框'])requireNode(group,name).active=busy;
|
||||
if(busy){
|
||||
const clip=this.loadingAnimation.defaultClip!;
|
||||
if(!this.loadingAnimation.getState(clip.name)?.isPlaying)this.loadingAnimation.play(clip.name);
|
||||
}else this.loadingAnimation.stop();
|
||||
}
|
||||
/** 清理弹窗事件和验证码计时器,避免反复打开时累积回调。 */
|
||||
close():void{
|
||||
this.modalReleases.splice(0).forEach(release=>release());
|
||||
if(this.modal&&isValid(this.modal))this.modal.destroy();this.modal=null;
|
||||
}
|
||||
dispose():void{this.setBusy(false);this.disposed=true;this.close();this.releases.splice(0).forEach(release=>release());}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e79a22bd-cbb6-41d0-a2ca-6ffb7e340f38",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
+7
-3
@@ -1,8 +1,12 @@
|
||||
import type { GameEntry } from '../../framework/sdk/contracts/game-entry.ts';
|
||||
import type { EvidenceSink } from './local-login-transport.ts';
|
||||
/** 登录阶段的诊断事件,仅供入口记录生命周期和越界操作。 */
|
||||
export type LoginEntryEvent = { kind: string; data: unknown };
|
||||
type EvidenceSink = (event: LoginEntryEvent) => void;
|
||||
|
||||
/** Satisfies entry validation while making every actual game operation a scope error. */
|
||||
export function createDiagnosticGameEntry(gameId: string | number, record: EvidenceSink): GameEntry {
|
||||
/** 登录阶段尚未接入子游戏:满足运行时入口契约,但任何游戏操作均显式拒绝。
|
||||
* 接入真实子游戏时应替换此入口,不能把占位实现当作大厅或房间支持。
|
||||
*/
|
||||
export function createLoginStageGameEntry(gameId: string | number, record: EvidenceSink): GameEntry {
|
||||
let nextInstanceId = 0;
|
||||
function violation(operation: string, instanceId?: number): never {
|
||||
record({ kind: 'scope-violation', data: { operation, instanceId } });
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "57db0201-3b1b-482e-b783-f19e5e9a47a7",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
import { Label, Node, UITransform, Vec3, Widget } from 'cc';
|
||||
|
||||
/** Logo 展示状态;倒计时只控制最短展示时间,资源和连接就绪由运行时独立管理。 */
|
||||
export interface LogoCountdownState { readonly visible: boolean; readonly text: string; }
|
||||
|
||||
/** Native input and measured label layout, independent of serialized label parentage. */
|
||||
export class CocosLogoCountdownView {
|
||||
private readonly label: Label;
|
||||
private readonly buttonTransform: UITransform;
|
||||
private readonly textTransform: UITransform;
|
||||
private readonly parentTransform: UITransform;
|
||||
private disposed = false;
|
||||
|
||||
constructor(private readonly button: Node, private readonly text: Node, private readonly onSkip: () => void) {
|
||||
const label = text.getComponent(Label), buttonTransform = button.getComponent(UITransform);
|
||||
const textTransform = text.getComponent(UITransform), parentTransform = text.parent?.getComponent(UITransform);
|
||||
if (!label || !buttonTransform || !textTransform || !parentTransform) {
|
||||
throw new Error('Logo countdown requires Label and native UITransform bindings');
|
||||
}
|
||||
this.label = label; this.buttonTransform = buttonTransform;
|
||||
this.textTransform = textTransform; this.parentTransform = parentTransform;
|
||||
// The label follows the actual button center, so its old absolute Widget must not fight layout.
|
||||
const widget = text.getComponent(Widget); if (widget) widget.enabled = false;
|
||||
this.label.overflow = Label.Overflow.NONE;
|
||||
button.active = false; text.active = false;
|
||||
button.on(Node.EventType.TOUCH_END, onSkip);
|
||||
}
|
||||
|
||||
render(state: LogoCountdownState): void {
|
||||
if (this.disposed) return;
|
||||
this.button.active = state.visible; this.text.active = state.visible;
|
||||
this.label.string = state.text;
|
||||
if (!state.visible) return;
|
||||
this.button.getComponent(Widget)?.updateAlignment();
|
||||
this.label.updateRenderData(true);
|
||||
const button = this.buttonTransform, text = this.textTransform;
|
||||
const center = button.convertToWorldSpaceAR(new Vec3((0.5 - button.anchorX) * button.width, (0.5 - button.anchorY) * button.height, 0));
|
||||
const position = this.parentTransform.convertToNodeSpaceAR(center);
|
||||
position.x += (text.anchorX - 0.5) * text.width;
|
||||
position.y += (text.anchorY - 0.5) * text.height;
|
||||
this.text.setPosition(position);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
if (this.disposed) return;
|
||||
this.disposed = true;
|
||||
this.button.off(Node.EventType.TOUCH_END, this.onSkip);
|
||||
this.button.active = false; this.text.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Display gate only. Runtime still independently owns resource/config/socket gates. */
|
||||
export function createLogoCountdown(options: {
|
||||
now(): number;
|
||||
schedule(callback: () => void, milliseconds: number): () => void;
|
||||
render(state: LogoCountdownState): void;
|
||||
}) {
|
||||
let started = false, finished = false, resources = false, socket = false;
|
||||
let remaining = 0, deadline = 0;
|
||||
let cancelDeadline: (() => void) | null = null, cancelTick: (() => void) | null = null;
|
||||
let resolve!: () => void, reject!: (error: unknown) => void;
|
||||
const promise = new Promise<void>((yes, no) => { resolve = yes; reject = no; });
|
||||
// Cancellation may precede the host attaching the display gate.
|
||||
void promise.catch(() => {});
|
||||
const render = () => options.render({ visible: started && !finished && remaining > 0,
|
||||
text: `倒计时${Math.ceil(Math.max(0, remaining) / 1000)}s${resources ? ' 跳过' : ''}` });
|
||||
const finish = (error?: unknown) => {
|
||||
if (finished) return;
|
||||
finished = true;
|
||||
const failures: unknown[] = error === undefined ? [] : [error];
|
||||
for (const cancel of [cancelDeadline, cancelTick]) {
|
||||
try { cancel?.(); } catch (failure) { failures.push(failure); }
|
||||
}
|
||||
cancelDeadline = null; cancelTick = null;
|
||||
try { render(); } catch (failure) { failures.push(failure); }
|
||||
if (failures.length > 0) reject(failures[0]); else resolve();
|
||||
};
|
||||
const guard = (operation: () => void) => {
|
||||
if (finished) return;
|
||||
try { operation(); } catch (error) { finish(error); }
|
||||
};
|
||||
const checkDeadline = () => {
|
||||
cancelDeadline = null;
|
||||
if (finished) return;
|
||||
const wait = deadline - options.now();
|
||||
if (wait <= 0) { finish(); return; }
|
||||
guard(() => { cancelDeadline = options.schedule(checkDeadline, wait); });
|
||||
};
|
||||
const tick = () => {
|
||||
cancelTick = null;
|
||||
if (finished) return;
|
||||
guard(() => {
|
||||
remaining -= 1000;
|
||||
render();
|
||||
if (remaining > 1000) cancelTick = options.schedule(tick, 1000);
|
||||
});
|
||||
};
|
||||
render();
|
||||
return {
|
||||
promise,
|
||||
start(milliseconds: number) {
|
||||
if (finished) return;
|
||||
if (started) throw new Error('Logo countdown already started');
|
||||
if (!Number.isFinite(milliseconds) || milliseconds < 0) throw new Error('Invalid launchWaitTime');
|
||||
started = true; remaining = milliseconds; deadline = options.now() + milliseconds;
|
||||
guard(() => {
|
||||
render(); checkDeadline();
|
||||
if (!finished && remaining > 1000) cancelTick = options.schedule(tick, 1000);
|
||||
});
|
||||
},
|
||||
resourcesReady() { guard(() => { resources = true; render(); }); },
|
||||
socketReady(value: boolean) { if (!finished) socket = value; },
|
||||
skip() { if (!finished && started && resources && socket) finish(); },
|
||||
cancel() { finish(new Error('Logo countdown cancelled')); },
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user