mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
整理 - 优化部分代码
This commit is contained in:
parent
055efc0f04
commit
c3f3e90942
@ -43,6 +43,8 @@ MCSERVER.login = function (username, password, rand, loginSuccess, loginError, e
|
||||
}
|
||||
}
|
||||
|
||||
// 想要执行登录,我们将自动获取
|
||||
// id 为 login-userid 与 login-passwd 的 input 元素
|
||||
$(function () {
|
||||
var logining = false;
|
||||
var $btnLogin = $('#login-button');
|
||||
@ -54,7 +56,8 @@ $(function () {
|
||||
$btnLogin
|
||||
.html('正在验证...')
|
||||
.attr("disabled", "disabled");
|
||||
MCSERVER.login($('#login-userid').val(), $('#login-passwd').val(), 548314,
|
||||
|
||||
MCSERVER.login($('#login-userid').val(), $('#login-passwd').val(), Math.random(),
|
||||
function () {
|
||||
//成功登陆
|
||||
$btnLogin
|
||||
@ -78,7 +81,7 @@ $(function () {
|
||||
function () {
|
||||
//服务器错误
|
||||
$btnLogin
|
||||
.html('服务器错误,请重试登陆')
|
||||
.html('服务器错误 :(')
|
||||
.removeAttr("disabled");
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
(function () {
|
||||
MCSERVER.findPropertiesShow = function (key) {
|
||||
|
||||
var SuwingsLoveYou = {
|
||||
"generator-settings": "用于自定义超平坦世界的生成,不生成超平坦世界请留空",
|
||||
"allow-nether": "是否允许下界(包括地狱)",
|
||||
@ -37,11 +38,11 @@
|
||||
"resource-pack": "统一资源标识符 (URI) 指向一个资源包。玩家可选择是否使用",
|
||||
"max-world-size": "最大世界大小"
|
||||
}
|
||||
//1.1
|
||||
|
||||
if (SuwingsLoveYou.hasOwnProperty(key)) {
|
||||
return SuwingsLoveYou[key];
|
||||
} else {
|
||||
//Not find, Return space
|
||||
return ' ';
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@
|
||||
MI.routeListener('ws/muem', function (data) {
|
||||
//菜单选项选择
|
||||
MI.listener("SideMeumClick", function () {
|
||||
console.log("--- 菜单选项被选择 ---");
|
||||
DEBUG && console.log("--- 菜单选项被选择 ---");
|
||||
// MCSERVER.autoColmDo();
|
||||
});
|
||||
|
||||
|
@ -38,9 +38,9 @@
|
||||
tmp_callback && tmp_callback();
|
||||
tmp_callback = null;
|
||||
} catch (e) {
|
||||
console.log('Websocket 收到的数据异常:');
|
||||
console.log('收到的数据是:' + e.data)
|
||||
console.log(e)
|
||||
DEBUG && console.log('Websocket 收到的数据异常:');
|
||||
DEBUG && console.log('收到的数据是:' + e.data)
|
||||
DEBUG && console.log(e)
|
||||
}
|
||||
};
|
||||
WS.onerror = function (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user