From 084a8195dc7b431c0ad36e24aacc06bd66e0b2ff Mon Sep 17 00:00:00 2001 From: libccy Date: Sun, 10 Apr 2016 23:26:14 +0800 Subject: [PATCH] w --- character/yxs.js | 3 +- game/game.js | 301 +++++++++++++++++++++++++++++------- layout/default/layout.css | 6 +- layout/newlayout/global.css | 4 + mode/connect.js | 9 +- 5 files changed, 261 insertions(+), 62 deletions(-) diff --git a/character/yxs.js b/character/yxs.js index 5c20a7b99..ff1380184 100755 --- a/character/yxs.js +++ b/character/yxs.js @@ -2031,7 +2031,8 @@ character.yxs={ return 6-ai.get.value(card); }, filterCard:function(card){ - var info=lib.card[card.name].image; + var info=lib.card[card.name]; + if(!info) return false; return !info.image&&!info.fullimage; }, discard:false, diff --git a/game/game.js b/game/game.js index fedd917fd..1f95fbfb9 100755 --- a/game/game.js +++ b/game/game.js @@ -47,7 +47,7 @@ }; var lib={ configprefix:'noname_0.9_', - versionOL:2, + versionOL:3, updateURL:localStorage.getItem('noname_download_source')||'http://isha.applinzi.com/', assetURL:'', changeLog:[], @@ -3871,6 +3871,40 @@ game.send('result',result); } event.goto(0); + }, + connection:function(ws){ + var client={ + ws:ws, + id:get.id(), + closed:false + }; + lib.node.clients.push(client); + for(var i in lib.element.client){ + client[i]=lib.element.client[i]; + } + ws.on('message',function(messagestr){ + var message; + try{ + message=JSON.parse(messagestr); + if(!Array.isArray(message)|| + typeof lib.message.server[message[0]]!=='function'){ + throw('err'); + } + for(var i=1;idiv:not(.avatar):not(.name){ +.player.connect>div:not(.avatar):not(.name):not(.nameol){ display: none !important; } @@ -1008,6 +1008,10 @@ margin-bottom: 5px; #window>.player.connect[data-position='6']{left:calc(50% - 120px);top:calc(500% / 7 + 5px);} #window>.player.connect[data-position='7']{left:calc(75% - 60px);top:calc(500% / 7 + 5px);} +#window>.player.connect[data-position='c0']{left:calc(50% - 120px);top:calc(50% - 200px)} +#window>.player.connect[data-position='c1']{left:calc(50% - 120px);top:calc(50% - 60px)} +#window>.player.connect[data-position='c2']{left:calc(50% - 120px);top:calc(50% + 80px)} + .connectbutton{ top:calc(400% / 7 - 35px); width:130px; diff --git a/layout/newlayout/global.css b/layout/newlayout/global.css index ea0b9231e..dafa4bc2c 100644 --- a/layout/newlayout/global.css +++ b/layout/newlayout/global.css @@ -361,6 +361,10 @@ #window>.player.connect[data-position='6']{left:calc(400% / 7 - 300px / 7);top:calc(400% / 7 - 40px + 5px);} #window>.player.connect[data-position='7']{left:calc(500% / 7 + 150px / 7);top:calc(400% / 7 - 40px + 5px);} +#window>.player.connect[data-position='c0']{left:calc(50% - 255px);top:calc(50% - 90px)} +#window>.player.connect[data-position='c1']{left:calc(50% - 75px);top:calc(50% - 90px)} +#window>.player.connect[data-position='c2']{left:calc(50% + 105px);top:calc(50% - 90px)} + .connectbutton{ top:calc(500% / 7 + 80px + 5px); } diff --git a/mode/connect.js b/mode/connect.js index ca9c27fc0..20cf6b38b 100644 --- a/mode/connect.js +++ b/mode/connect.js @@ -59,13 +59,6 @@ mode.connect={ node.innerHTML=this.innerHTML; connect(); }; - var trimIP=function(str){ - var len=str.length-5; - if(str.lastIndexOf(':8080')==len){ - str=str.slice(0,len); - } - return str; - }; lib.setPopped(ui.recentIP,function(){ if(!lib.config.recentIP.length) return; var uiintro=ui.create.dialog('hidden'); @@ -74,7 +67,7 @@ mode.connect={ }); var list=ui.create.div('.caption'); for(var i=0;i清除');