|
@@ -8,6 +8,7 @@ import { BaseView } from '../../../framework/layer/BaseView';
|
|
import { AsyncQueue, NextFunction } from '../../../framework/queue/AsyncQueue';
|
|
import { AsyncQueue, NextFunction } from '../../../framework/queue/AsyncQueue';
|
|
import { BulletlPool, DecoratePool, FloatTextPool, GoodsPool, IconPool, MaterialPool, PopPool, RewardPool, RolePool, TipsPool } from '../../common/Pool';
|
|
import { BulletlPool, DecoratePool, FloatTextPool, GoodsPool, IconPool, MaterialPool, PopPool, RewardPool, RolePool, TipsPool } from '../../common/Pool';
|
|
import { UserData } from '../../data/UserData';
|
|
import { UserData } from '../../data/UserData';
|
|
|
|
+import { AccountData } from '../../data/AccountData.ts';
|
|
import { LoginMgr } from '../../common/LoginManager';
|
|
import { LoginMgr } from '../../common/LoginManager';
|
|
import { StringUtil } from '../../../framework/util/StringUtil';
|
|
import { StringUtil } from '../../../framework/util/StringUtil';
|
|
import { GameEvent } from '../../data/GameEvent';
|
|
import { GameEvent } from '../../data/GameEvent';
|
|
@@ -113,7 +114,8 @@ export class LoginUI extends BaseView {
|
|
let uid = UserData.save_locally('UserID')
|
|
let uid = UserData.save_locally('UserID')
|
|
let choose_server = UserData.save_locally('choose_server', null, {})
|
|
let choose_server = UserData.save_locally('choose_server', null, {})
|
|
let lastArea = UserData.save_locally('LastArea', null, '1');
|
|
let lastArea = UserData.save_locally('LastArea', null, '1');
|
|
- UserData.setAreanId(lastArea);
|
|
+ AccountData.setAreanId(lastArea);
|
|
|
|
+ AccountData.setSid(UserData.save_locally('lastsid',null,-1))
|
|
|
|
|
|
this.loginData = {
|
|
this.loginData = {
|
|
url: getParameterByName("url") || ServergatewaylistConf.data.debug['Url' + lastArea],
|
|
url: getParameterByName("url") || ServergatewaylistConf.data.debug['Url' + lastArea],
|
|
@@ -188,7 +190,7 @@ export class LoginUI extends BaseView {
|
|
}
|
|
}
|
|
|
|
|
|
LoginMgr.getGateway(_gateway_data, this.serverData.host, () => {
|
|
LoginMgr.getGateway(_gateway_data, this.serverData.host, () => {
|
|
- let lastArea = UserData.getAreanId();
|
|
+ let lastArea = AccountData.getAreanId();
|
|
UserData.save_locally('LastArea', lastArea);
|
|
UserData.save_locally('LastArea', lastArea);
|
|
if (UserData['mark'].first_login && UserData['mark'].first_login == 1) {
|
|
if (UserData['mark'].first_login && UserData['mark'].first_login == 1) {
|
|
|
|
|
|
@@ -359,8 +361,8 @@ export class LoginUI extends BaseView {
|
|
private getServerList() {
|
|
private getServerList() {
|
|
LoginMgr.getServerList((data) => {
|
|
LoginMgr.getServerList((data) => {
|
|
if (data) {
|
|
if (data) {
|
|
- UserData.parseLoginData(data);
|
|
+ AccountData.parseLoginData(data);
|
|
- this.accountData = UserData.getAccountData()
|
|
+ this.accountData = AccountData.getAccountData()
|
|
this.updateCurServer()
|
|
this.updateCurServer()
|
|
}
|
|
}
|
|
}, this.loginData)
|
|
}, this.loginData)
|
|
@@ -369,13 +371,13 @@ export class LoginUI extends BaseView {
|
|
updateCurServer(isRefresh?: boolean) {
|
|
updateCurServer(isRefresh?: boolean) {
|
|
let sid = -1;
|
|
let sid = -1;
|
|
if (isRefresh) {
|
|
if (isRefresh) {
|
|
- sid = UserData.getSid();
|
|
+ sid = AccountData.getSid();
|
|
}
|
|
}
|
|
if (sid == -1) {
|
|
if (sid == -1) {
|
|
- const roles = UserData.getRoleServers();
|
|
+ const roles = AccountData.getRoleServers();
|
|
if (roles.length === 0) {
|
|
if (roles.length === 0) {
|
|
|
|
|
|
- const recmds = UserData.getRecmdServers();
|
|
+ const recmds = AccountData.getRecmdServers();
|
|
for (const v of recmds) {
|
|
for (const v of recmds) {
|
|
if (v && v.sid) {
|
|
if (v && v.sid) {
|
|
sid = v.sid;
|
|
sid = v.sid;
|
|
@@ -393,14 +395,14 @@ export class LoginUI extends BaseView {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- let serverData = UserData.getServerBySid(sid)
|
|
+ let serverData = AccountData.getServerBySid(sid)
|
|
if (!serverData) {
|
|
if (!serverData) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
this.serverData = serverData;
|
|
this.serverData = serverData;
|
|
|
|
|
|
- UserData.setSid(serverData['sid'], false);
|
|
+ AccountData.setSid(serverData['sid'], false);
|
|
this.serverIndex.string = `${serverData.sid}${StringUtil.getLanguageData('服')}`;
|
|
this.serverIndex.string = `${serverData.sid}${StringUtil.getLanguageData('服')}`;
|
|
this.serverName.string = serverData.name;
|
|
this.serverName.string = serverData.name;
|
|
|
|
|