Skip to content

Commit

Permalink
Added support for EN server
Browse files Browse the repository at this point in the history
  • Loading branch information
aku3 committed May 1, 2019
1 parent 029af35 commit 833c119
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 46 deletions.
2 changes: 1 addition & 1 deletion bin/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>雀魂Plus</title>
<title>Majsoul Plus</title>
<style>
@font-face {
font-family: '思源黑体 CN';
Expand Down
2 changes: 1 addition & 1 deletion bin/main/loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>雀魂Plus</title>
<title>Majsoul Plus</title>
<style>
body {
height: 100vh;
Expand Down
4 changes: 2 additions & 2 deletions bin/main/mainLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ const testIsLocalGameWindow = url => {
}
const getLocalUrlWithParams = url => {
if (url.includes('?')) {
return `https://localhost:${serverPort}/0/${url.substring(
return `https://localhost:${serverPort}/${url.substring(
url.indexOf('?')
)}`
}
return `https://localhost:${serverPort}/0/`
return `https://localhost:${serverPort}/`
}
const redirectGameWindow = (url, gameWindow) => {
const localUrl = getLocalUrlWithParams(url)
Expand Down
6 changes: 3 additions & 3 deletions configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const CONFIGS = {
// PIPE_PORT: 8888,
XOR_KEY: 73,
EXTEND_RES_KEYWORD: 'extendRes',
REMOTE_DOMAIN: 'https://majsoul.union-game.com/',
HTTP_REMOTE_DOMAIN: 'http://majsoul.union-game.com/',
REMOTE_DOMAIN: 'https://mahjongsoul.game.yo-star.com',
HTTP_REMOTE_DOMAIN: 'http://mahjongsoul.game.yo-star.com',
LOCAL_DIR: '/static',
MODS_DIR: '/mod',
MODS_CONFIG_PATH: path.join(appDataDir, 'modsEnabled.json'),
Expand Down Expand Up @@ -70,7 +70,7 @@ const CONFIGS = {
webSecurity: false,
allowRunningInsecureContent: true
},
title: '雀魂Plus',
title: 'Majsoul Plus',
autoHideMenuBar: true,
icon: getIcon(),
maximizable: false,
Expand Down
9 changes: 1 addition & 8 deletions execute/active.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,5 @@
"localStorage": false,
"writeableWindowObject": false
}
},
{
"name": "解除强制实名认证",
"author": "Handle",
"description": "如果您是海外玩家或没有中国身份证号码,这个插件能够帮到您!\n游戏时请遵守当地法律法规。",
"entry": "script.js",
"preview": "preview.png"
}
}
]
4 changes: 2 additions & 2 deletions execute/reportVoice/execute.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "解锁所有语音",
"name": "Unlock all voices",
"author": "Majsoul Plus Team",
"description": "可以在本地解锁全部报番型、主菜单交互语音。\n让您获得完整麻将体验。",
"description": "Unlocks all your character's voice lines locally.",
"entry": "script.js",
"executePreferences": {
"document": false,
Expand Down
2 changes: 1 addition & 1 deletion i18n/locales/en-US/servers.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mainland": "Mainland China",
"mainland": "EN",
"cn": "China",
"hk": "Hong Kong",
"tw": "Taiwan",
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ const windowControl = {
} else {
windowControl.windowMap['game'].webContents.send(
'load-url',
`https://localhost:${sererHttps.address().port}/0/`
`https://localhost:${sererHttps.address().port}/`
)
}
break
Expand Down
6 changes: 3 additions & 3 deletions manager/Ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ class Ping {

_getVersion () {
const url = this._getRandomUrl(
'https://majsoul.union-game.com/0/version.json'
'http://mahjongsoul.game.yo-star.com/version.json'
)
return NetworkUtil.getJson(url).then(res => res.version)
}

_getResVersion (version) {
const originUrl = `https://majsoul.union-game.com/0/resversion${version}.json`
const originUrl = `http://mahjongsoul.game.yo-star.com/resversion${version}.json`
const url = this._getRandomUrl(originUrl)
return NetworkUtil.getJson(url).then(res => res.res['config.json'].prefix)
}

_getConfig (prefix) {
const originUrl = `https://majsoul.union-game.com/0/${prefix}/config.json`
const originUrl = `http://mahjongsoul.game.yo-star.com/${prefix}/config.json`
const url = this._getRandomUrl(originUrl)
return NetworkUtil.getJson(url).then(res => res.ip)
}
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name": "majsoul-plus-client",
"version": "1.12.0-beta.4",
"productName": "Majsoul Plus",
"productName": "Majsoul Plus EN",
"author": "MajsoulPlus Team",
"description": "Majsoul Plus",
"description": "Majsoul Plus EN",
"main": "index.js",
"scripts": {
"start": "concurrently --success \"first\" --kill-others \"gulp\" \"cross-env NODE_ENV=development electron . --enable_logging\"",
"pack": "npm run lint && npm run build",
"lint": "standard --fix | snazzy",
"build": "npm run build-win32 && npm run build-linux && npm run build-darwin",
"build-win32": "gulp sass && electron-packager . Majsoul_Plus --platform=win32 --arch=all --out ./build/unpacked --ignore=build --overwrite --icon=bin/icons/icon.ico",
"build-linux": "gulp sass && electron-packager . Majsoul_Plus --platform=linux --arch=all --out ./build/unpacked --ignore=build --overwrite --icon=bin/icons/icon.png",
"build-win32": "gulp sass && electron-packager . Majsoul_Plus_EN --platform=win32 --arch=x64 --out ./build/unpacked --ignore=build --overwrite --icon=bin/icons/icon.ico",
"build-linux": "gulp sass && electron-packager . Majsoul_Plus_EN --platform=linux --arch=all --out ./build/unpacked --ignore=build --overwrite --icon=bin/icons/icon.png",
"build-darwin": "gulp sass && electron-builder --mac",
"test": "echo \"Error: no test specified\""
},
"build": {
"productName": "Majsoul Plus",
"productName": "Majsoul Plus EN",
"directories": {
"output": "build/packed"
},
"mac": {
"icon": "bin/icons/icon.icns",
"asar": false,
"artifactName": "Majsoul_Plus-${platform}-${arch}.${ext}",
"artifactName": "Majsoul_Plus_EN-${platform}-${arch}.${ext}",
"darkModeSupport": true
},
"dmg": {
"artifactName": "Majsoul_Plus-${platform}-${arch}.${ext}"
"artifactName": "Majsoul_Plus_EN-${platform}-${arch}.${ext}"
}
},
"standard": {
Expand Down
18 changes: 9 additions & 9 deletions tool/desktopCreator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>雀魂Plus-桌布制作工具</title>
<title>Majsoul Plus - Tablecloth making tool</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<input id="selectImg" type="file" accept="image/*" value="选择图像" /><label
<input id="selectImg" type="file" accept="image/*" value="Select image" /><label
for="selectImg" id="selectImgLabel"
>选择图像</label
>Select image</label
><br />

<label for="darknessRange"
>叠加黑色<span id="darknessRangeText">0.2</span></label
>Opacity<span id="darknessRangeText">0.2</span></label
><br />
<input
id="darknessRange"
Expand All @@ -25,12 +25,12 @@
max="100"
/><br />

<input type="text" placeholder="文件夹名称" id="dirName" /><br />
<input type="text" placeholder="Mod名称" id="name" /><br />
<input type="text" placeholder="作者" id="author" /><br />
<textarea placeholder="简介" id="description" rows="4"></textarea> <br />
<input type="text" placeholder="Folder name" id="dirName" /><br />
<input type="text" placeholder="Mod name" id="name" /><br />
<input type="text" placeholder="Author" id="author" /><br />
<textarea placeholder="Description" id="description" rows="4"></textarea> <br />

<input id="saveAndInstall" type="button" value="保存并安装" /><br />
<input id="saveAndInstall" type="button" value="Save and install" /><br />

<canvas width="2048" height="2048" id="canvas"></canvas>
<script src="script.js"></script>
Expand Down
12 changes: 6 additions & 6 deletions tool/desktopCreator/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ saveAndInstall.addEventListener('click', event => {
const description = document.getElementById('description').value
const dirPath = path.join(__dirname, '../../', config.MODS_DIR, dirName)
if (dirName.length < 4) {
alert('文件夹名长度过短')
alert('The folder name is too short.')
return
}
if (name.length === 0) {
alert('Mod名称不能为空')
alert('The mod name cannot be empty.')
return
}
const stat = (() => {
Expand All @@ -115,7 +115,7 @@ saveAndInstall.addEventListener('click', event => {
}
})()
if (stat) {
alert('文件夹名称已存在!')
alert('The folder name already exists!')
return
}
fs.mkdirSync(dirPath)
Expand All @@ -129,11 +129,11 @@ saveAndInstall.addEventListener('click', event => {
replace: [
{
from:
'/0/[^/]+/scene/Assets/Resource/tablecloth/tablecloth_default/Table_Dif.jpg',
'/[^/]+/scene/Assets/Resource/tablecloth/tablecloth_default/Table_Dif.jpg',
to: '/Table_Dif.jpg'
},
{
from: '/0/[^/]+/myres2/tablecloth/tablecloth_default/preview.jpg',
from: '/[^/]+/en/myres2/tablecloth/tablecloth_default/preview.jpg',
to: '/preview.jpg'
}
]
Expand Down Expand Up @@ -173,6 +173,6 @@ saveAndInstall.addEventListener('click', event => {
)
)
]).then(() => {
alert('已保存!\n请刷新模组后启用')
alert('Saved!\nPlease refresh and enable the mod.')
})
})
4 changes: 2 additions & 2 deletions tool/desktopCreator/tool.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "桌布制作工具",
"name": "Tablecloth making tool",
"author": "Handle",
"description": "简单几步生成桌布Mod,桌布随心换",
"description": "Create a tablecloth mod in a few simple steps",
"index": "index.html",
"windowOptions": {
"width": 640,
Expand Down

0 comments on commit 833c119

Please sign in to comment.