Skip to content

Commit

Permalink
紧急修复国服修改域名导致的扩展资源无法使用
Browse files Browse the repository at this point in the history
修改配置文件名称以防止与迁移的 1.x 用户发生冲突
发布v2.0.0-beta.4
  • Loading branch information
Yesterday17 committed Aug 18, 2019
1 parent 625e656 commit d1c10b8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "majsoul-plus-client",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"productName": "Majsoul Plus",
"author": "MajsoulPlus Team",
"description": "Majsoul Plus",
Expand Down
2 changes: 1 addition & 1 deletion src/bin/main/mainLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MajsoulPlus } from '../../majsoul_plus'
const userConfigs: MajsoulPlus.UserConfig = require(Global.UserConfigPath)

const remoteDomains = [
{ id: 0, name: 'zh', domain: 'https://majsoul.union-game.com/0/' },
{ id: 0, name: 'zh', domain: 'https://www.majsoul.com/1/' },
{ id: 1, name: 'jp', domain: 'https://game.mahjongsoul.com/' },
{ id: 2, name: 'en', domain: 'https://mahjongsoul.game.yo-star.com/' }
]
Expand Down
2 changes: 1 addition & 1 deletion src/extension/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class MajsoulPlusExtensionManager extends BaseManager {
await Promise.all(this.useScriptPromises)

// 针对 code.js 进行特殊处理 注入扩展
const originalUrl = ctx.request.originalUrl.replace(/^\/0\//g, '')
const originalUrl = ctx.request.originalUrl.replace(/^\/\d\//g, '')
let prefix = '',
postfix = ''
if (path.basename(originalUrl) === 'code.js') {
Expand Down
10 changes: 2 additions & 8 deletions src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const GlobalPath: MajsoulPlus.GlobalPath = {

// tslint:disable-next-line
export const RemoteDomains = [
{ id: 0, name: 'zh', domain: 'https://majsoul.union-game.com/0/' },
{ id: 0, name: 'zh', domain: 'https://www.majsoul.com/1/' },
{ id: 1, name: 'jp', domain: 'https://game.mahjongsoul.com/' },
{ id: 2, name: 'en', domain: 'https://mahjongsoul.game.yo-star.com/' }
]
Expand All @@ -65,7 +65,7 @@ export const Global: MajsoulPlus.Global = {
ResourcePackConfigPath: '',
ExtensionConfigPath: '',
ToolConfigPath: '',
UserConfigPath: path.join(appDataDir, 'configs-user.json'),
UserConfigPath: path.join(appDataDir, 'user-config.json'),
LocalCachePath: path.join(appDataDir, GlobalPath.LocalDir),
ResourceFolderPath: path.join(appDataDir, GlobalPath.ResourcePackDir),
ExtensionFolderPath: path.join(appDataDir, GlobalPath.ExtensionDir),
Expand All @@ -77,11 +77,6 @@ export const Global: MajsoulPlus.Global = {
frame: true,
resizable: true,
backgroundColor: '#000000',
webPreferences: {
// webSecurity: false
// nodeIntegration: false
// plugins: true
},
autoHideMenuBar: true,
// useContentSize: true,
icon: appIcon,
Expand All @@ -96,7 +91,6 @@ export const Global: MajsoulPlus.Global = {
backgroundColor: '#FFFFFF',
webPreferences: {
webSecurity: false
// allowRunningInsecureContent: true
},
title: '雀魂Plus',
autoHideMenuBar: true,
Expand Down
2 changes: 1 addition & 1 deletion src/manager/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
appDataDir: ipcRenderer.sendSync('sandbox-appdata-request'),
UserConfigPath: path.join(
ipcRenderer.sendSync('sandbox-appdata-request'),
'configs-user.json'
'user-config.json'
),
ResourcePackDir: path.join(
ipcRenderer.sendSync('sandbox-appdata-request'),
Expand Down
2 changes: 1 addition & 1 deletion src/manager/utils/Ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as tcpPing from 'tcp-ping'
import i18n from '../../i18n'

export const remoteDomains = [
{ id: 0, name: 'zh', domain: 'https://majsoul.union-game.com/0' },
{ id: 0, name: 'zh', domain: 'https://www.majsoul.com/1' },
{ id: 1, name: 'jp', domain: 'https://game.mahjongsoul.com' },
{ id: 2, name: 'en', domain: 'https://mahjongsoul.game.yo-star.com' }
]
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export async function getRemoteOrCachedFile(
encode = true,
callback: (data: Buffer) => Buffer = data => data
): Promise<{ code: number; data: Buffer | string }> {
const originalUrl = url.replace(/^\/0\//g, '')
const originalUrl = url.replace(/^\/\d\//g, '')
const isEncrypted = isEncryptRes(originalUrl)
const isRoutePath = isPath(originalUrl)
const localPath = getLocalURI(originalUrl)
Expand Down

0 comments on commit d1c10b8

Please sign in to comment.