pref: format @/game.

This commit is contained in:
Rintim 2024-04-16 00:49:47 +08:00
parent 16555acdd8
commit 5197d6b2ce
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
18 changed files with 34474 additions and 32178 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
// apk每次安装后第一次启动加载Service Worker会失败 // apk每次安装后第一次启动加载Service Worker会失败
// 所以每次导入这个ts判断是否会成功失败的话重启一次 // 所以每次导入这个ts判断是否会成功失败的话重启一次
export const text: string = 'ts文件导入成功'; export const text: string = "ts文件导入成功";

File diff suppressed because it is too large Load Diff

View File

@ -1,249 +1,410 @@
window.config={ window.config = {
extension_sources:{ extension_sources: {
'GitHub Proxy':'https://mirror.ghproxy.com/https://raw.githubusercontent.com/libccy/noname-extension/master/', "GitHub Proxy":
FastGit:'https://raw.fgit.cf/libccy/noname-extension/master/', "https://mirror.ghproxy.com/https://raw.githubusercontent.com/libccy/noname-extension/master/",
GitHub:'https://raw.githubusercontent.com/libccy/noname-extension/master/' FastGit: "https://raw.fgit.cf/libccy/noname-extension/master/",
GitHub: "https://raw.githubusercontent.com/libccy/noname-extension/master/",
}, },
extension_source:'GitHub Proxy', extension_source: "GitHub Proxy",
forbidai:['ns_liuzhang'], forbidai: ["ns_liuzhang"],
forbidai_user:[], forbidai_user: [],
forbidall:[], forbidall: [],
forbidstone:['zhugedan','pal_xuanxiao','hs_malfurion','lusu','chenlin','hs_siwangzhiyi', forbidstone: [
'gjqt_bailitusu','yuanshao','swd_anka','swd_nicole','daqiao','re_daqiao','hs_xuanzhuanjijia', "zhugedan",
'zhuran','huatuo','swd_tuwei','hs_guldan','wangyi','caoang','swd_guyue','swd_rongshuang', "pal_xuanxiao",
'swd_jiangziya','guojia','re_guojia','shen_caocao','swd_qiner','caopi','hs_yngvar','guansuo', "hs_malfurion",
'gjqt_aruan','swd_hanluo','hs_anduin','swd_huanglei','yxs_yujix','yxs_luzhishen','swd_muyun','ow_tianshi', "lusu",
'pal_yuejinzhao','hs_antonidas','xushi','hs_lreno' "chenlin",
"hs_siwangzhiyi",
"gjqt_bailitusu",
"yuanshao",
"swd_anka",
"swd_nicole",
"daqiao",
"re_daqiao",
"hs_xuanzhuanjijia",
"zhuran",
"huatuo",
"swd_tuwei",
"hs_guldan",
"wangyi",
"caoang",
"swd_guyue",
"swd_rongshuang",
"swd_jiangziya",
"guojia",
"re_guojia",
"shen_caocao",
"swd_qiner",
"caopi",
"hs_yngvar",
"guansuo",
"gjqt_aruan",
"swd_hanluo",
"hs_anduin",
"swd_huanglei",
"yxs_yujix",
"yxs_luzhishen",
"swd_muyun",
"ow_tianshi",
"pal_yuejinzhao",
"hs_antonidas",
"xushi",
"hs_lreno",
], ],
forbidchess:['hetaihou','swd_kangnalishi'], forbidchess: ["hetaihou", "swd_kangnalishi"],
forbidboss:['caiwenji','gjqt_aruan','pal_xuanxiao','swd_hupo'], forbidboss: ["caiwenji", "gjqt_aruan", "pal_xuanxiao", "swd_hupo"],
forbiddouble:['zhugedan','swd_kangnalishi','dongzhuo','wutugu','hs_siwangzhiyi','hs_ronghejuren','hs_shanlingjuren'], forbiddouble: [
forbidthreecard:['qiankunbiao','shenhuofeiya','gw_ciguhanshuang','gw_birinongwu','gw_qinpendayu','gw_poxiao'], "zhugedan",
zhinang_tricks:['guohe','wuxie','wuzhong','dongzhuxianji'], "swd_kangnalishi",
connect_zhinang_tricks:['guohe','wuxie','wuzhong','dongzhuxianji'], "dongzhuo",
all:{ "wutugu",
sgscharacters:['standard','shenhua','xinghuoliaoyuan','refresh','yijiang','sp','sp2','xianding','huicui','extra','old','mobile','shiji','tw','yingbian','offline','jsrg','sb','clan','collab','onlyOL'], "hs_siwangzhiyi",
sgscards:['standard','extra','sp','guozhan','zhulu','yingbian','yongjian'], "hs_ronghejuren",
sgsmodes:['identity','guozhan','versus','doudizhu','single','brawl','connect'], "hs_shanlingjuren",
stockmode:['identity','guozhan','versus','boss','doudizhu','single','chess','stone','connect','brawl','tafang'], ],
stockextension:['boss','cardpile','coin','wuxing'], forbidthreecard: [
layout:['default','newlayout'], "qiankunbiao",
theme:['woodden','music','simple'], "shenhuofeiya",
card_font:['xiaozhuan','huangcao','caoshu','xingshu'], "gw_ciguhanshuang",
double_hp:['hejiansan','pingjun','zuidazhi','zuixiaozhi','zonghe'], "gw_birinongwu",
image_background_filter:['default','blur','gray','sepia','invert','saturate','contrast','hue','brightness'], "gw_qinpendayu",
"gw_poxiao",
],
zhinang_tricks: ["guohe", "wuxie", "wuzhong", "dongzhuxianji"],
connect_zhinang_tricks: ["guohe", "wuxie", "wuzhong", "dongzhuxianji"],
all: {
sgscharacters: [
"standard",
"shenhua",
"xinghuoliaoyuan",
"refresh",
"yijiang",
"sp",
"sp2",
"xianding",
"huicui",
"extra",
"old",
"mobile",
"shiji",
"tw",
"yingbian",
"offline",
"jsrg",
"sb",
"clan",
"collab",
"onlyOL",
],
sgscards: [
"standard",
"extra",
"sp",
"guozhan",
"zhulu",
"yingbian",
"yongjian",
],
sgsmodes: [
"identity",
"guozhan",
"versus",
"doudizhu",
"single",
"brawl",
"connect",
],
stockmode: [
"identity",
"guozhan",
"versus",
"boss",
"doudizhu",
"single",
"chess",
"stone",
"connect",
"brawl",
"tafang",
],
stockextension: ["boss", "cardpile", "coin", "wuxing"],
layout: ["default", "newlayout"],
theme: ["woodden", "music", "simple"],
card_font: ["xiaozhuan", "huangcao", "caoshu", "xingshu"],
double_hp: ["hejiansan", "pingjun", "zuidazhi", "zuixiaozhi", "zonghe"],
image_background_filter: [
"default",
"blur",
"gray",
"sepia",
"invert",
"saturate",
"contrast",
"hue",
"brightness",
],
}, },
game:'sgs', game: "sgs",
duration:500, duration: 500,
hoveration:1000, hoveration: 1000,
doubleclick_intro:true, doubleclick_intro: true,
cheat:false, cheat: false,
volumn_background:8, volumn_background: 8,
volumn_audio:8, volumn_audio: 8,
connect_avatar:'caocao', connect_avatar: "caocao",
connect_nickname:'无名玩家', connect_nickname: "无名玩家",
config_menu:true, config_menu: true,
auto_popped_config:true, auto_popped_config: true,
auto_popped_history:false, auto_popped_history: false,
auto_skill:true, auto_skill: true,
auto_confirm:true, auto_confirm: true,
enable_drag:true, enable_drag: true,
enable_pressure:false, enable_pressure: false,
pressure_taptic:true, pressure_taptic: true,
hover_handcard:true, hover_handcard: true,
hover_all:true, hover_all: true,
right_info:true, right_info: true,
longpress_info:true, longpress_info: true,
long_info:true, long_info: true,
background_music:'music_default', background_music: "music_default",
background_audio:true, background_audio: true,
background_speak:true, background_speak: true,
glow_phase:'yellow', glow_phase: "yellow",
die_move:'flip', die_move: "flip",
skin:{}, skin: {},
gameRecord:{}, gameRecord: {},
extensionInfo:{}, extensionInfo: {},
autoskilllist:[], autoskilllist: [],
hiddenModePack:[], hiddenModePack: [],
hiddenCharacterPack:[], hiddenCharacterPack: [],
hiddenCardPack:[], hiddenCardPack: [],
hiddenPlayPack:[], hiddenPlayPack: [],
hiddenBackgroundPack:[], hiddenBackgroundPack: [],
customBackgroundPack:[], customBackgroundPack: [],
favouriteCharacter:[], favouriteCharacter: [],
favouriteMode:[], favouriteMode: [],
recentIP:[], recentIP: [],
vintageSkills:[], vintageSkills: [],
alteredSkills:[], alteredSkills: [],
brokenFile:[], brokenFile: [],
theme:'woodden', theme: "woodden",
layout:'mobile', layout: "mobile",
card_style:'default', card_style: "default",
cardback_style:'default', cardback_style: "default",
hp_style:'default', hp_style: "default",
image_character:'default', image_character: "default",
image_background:'default', image_background: "default",
asset_image:true, asset_image: true,
asset_font:true, asset_font: true,
card_font:'xiaozhuan', card_font: "xiaozhuan",
show_statusbar_ios:'off', show_statusbar_ios: "off",
show_statusbar_android:false, show_statusbar_android: false,
show_name:true, show_name: true,
show_replay:false, show_replay: false,
show_round_menu:true, show_round_menu: true,
show_pause:true, show_pause: true,
show_auto:true, show_auto: true,
show_volumn:true, show_volumn: true,
show_cardpile:true, show_cardpile: true,
only_fullskin:true, only_fullskin: true,
show_connect:true, show_connect: true,
show_wuxie:false, show_wuxie: false,
show_wuxie_self:true, show_wuxie_self: true,
show_stat:true, show_stat: true,
show_playerids:true, show_playerids: true,
show_scrollbar:false, show_scrollbar: false,
mousewheel:true, mousewheel: true,
fold_card:true, fold_card: true,
threed_card:false, threed_card: false,
vertical_scroll:false, vertical_scroll: false,
handcard_scroll:0, handcard_scroll: 0,
animation:true, animation: true,
skill_animation_type:'default', skill_animation_type: "default",
paused:false, paused: false,
title:false, title: false,
button_press:true, button_press: true,
damage_shake:true, damage_shake: true,
log_highlight:true, log_highlight: true,
player_border:'normal', player_border: "normal",
radius_size:'default', radius_size: "default",
modeconfig:false, modeconfig: false,
gameconfig:false, gameconfig: false,
appearence:false, appearence: false,
video:'20', video: "20",
coin:0, coin: 0,
intro:'i', intro: "i",
right_click:'pause', right_click: "pause",
sort:'type_sort', sort: "type_sort",
cards:['standard','extra'], cards: ["standard", "extra"],
characters:['standard','shenhua','sp','sp2','yijiang','refresh','xinghuoliaoyuan','mobile','extra','yingbian','sb','tw','offline','clan','collab','xianding','huicui','shiji','jsrg','onlyOL'], characters: [
connect_characters:['diy'], "standard",
connect_cards:['huanlekapai','guozhan','sp','zhulu','yingbian','yongjian'], "shenhua",
plays:[], "sp",
extensions:[], "sp2",
banned:[], "yijiang",
bannedcards:[], "refresh",
forbidlist:[], "xinghuoliaoyuan",
bannedpile:{}, "mobile",
customcardpile:{}, "extra",
addedpile:{}, "yingbian",
"sb",
"tw",
"offline",
"clan",
"collab",
"xianding",
"huicui",
"shiji",
"jsrg",
"onlyOL",
],
connect_characters: ["diy"],
connect_cards: [
"huanlekapai",
"guozhan",
"sp",
"zhulu",
"yingbian",
"yongjian",
],
plays: [],
extensions: [],
banned: [],
bannedcards: [],
forbidlist: [],
bannedpile: {},
customcardpile: {},
addedpile: {},
mode:'identity', mode: "identity",
mode_config:{ mode_config: {
global:{ global: {
player_number:8, player_number: 8,
auto_identity:'off', auto_identity: "off",
double_character:false, double_character: false,
save_progress:true, save_progress: true,
free_choose:true, free_choose: true,
swap:true, swap: true,
change_identity:true, change_identity: true,
battle_number:3, battle_number: 3,
double_hp:'pingjun', double_hp: "pingjun",
}, },
identity:{ identity: {
identity:[ identity: [
['zhu','fan'], ["zhu", "fan"],
['zhu','nei','fan'], ["zhu", "nei", "fan"],
['zhu','zhong','nei','fan'], ["zhu", "zhong", "nei", "fan"],
['zhu','zhong','nei','fan','fan'], ["zhu", "zhong", "nei", "fan", "fan"],
['zhu','zhong','nei','fan','fan','fan'], ["zhu", "zhong", "nei", "fan", "fan", "fan"],
['zhu','zhong','zhong','nei','fan','fan','fan'], ["zhu", "zhong", "zhong", "nei", "fan", "fan", "fan"],
['zhu','zhong','zhong','nei','fan','fan','fan','fan'], ["zhu", "zhong", "zhong", "nei", "fan", "fan", "fan", "fan"],
['zhu','zhong','zhong','zhong','nei','fan','fan','fan','fan'], [
['zhu','zhong','zhong','zhong','nei','nei','fan','fan','fan','fan'], "zhu",
"zhong",
"zhong",
"zhong",
"nei",
"fan",
"fan",
"fan",
"fan",
],
[
"zhu",
"zhong",
"zhong",
"zhong",
"nei",
"nei",
"fan",
"fan",
"fan",
"fan",
],
], ],
choice:{ choice: {
zhu:3, zhu: 3,
zhong:4, zhong: 4,
nei:5, nei: 5,
fan:3, fan: 3,
}, },
show_identity:true, show_identity: true,
difficulty:'normal', difficulty: "normal",
dierestart:true dierestart: true,
}, },
guozhan:{ guozhan: {
difficulty:'normal', difficulty: "normal",
initshow_draw:'mark', initshow_draw: "mark",
dierestart:true dierestart: true,
}, },
}, },
current_mode:{}, current_mode: {},
customforbid:[], customforbid: [],
forbid:[ forbid: [
['huashen'], ["huashen"],
['rehuashen'], ["rehuashen"],
['xinmanjuan'], ["xinmanjuan"],
//['xinleiji','fuji'], //['xinleiji','fuji'],
['xinleiji','xinfu_jijun'], ["xinleiji", "xinfu_jijun"],
['reluanji','jueqing'], ["reluanji", "jueqing"],
['lianying','rende'], ["lianying", "rende"],
['lianying','anxian'], ["lianying", "anxian"],
['lianying','yinguo'], ["lianying", "yinguo"],
['lianying','qingjian'], ["lianying", "qingjian"],
['boss_juejing','rende'], ["boss_juejing", "rende"],
['boss_juejing','anxian'], ["boss_juejing", "anxian"],
['boss_juejing','yinguo'], ["boss_juejing", "yinguo"],
['boss_juejing','qingjian'], ["boss_juejing", "qingjian"],
['shangshi','rende'], ["shangshi", "rende"],
['shangshi','anxian'], ["shangshi", "anxian"],
['shangshi','yinguo'], ["shangshi", "yinguo"],
['shangshi','qingjian'], ["shangshi", "qingjian"],
['rende','relianying'], ["rende", "relianying"],
['anxian','relianying'], ["anxian", "relianying"],
['yinguo','relianying'], ["yinguo", "relianying"],
['shenxing','relianying'], ["shenxing", "relianying"],
['qingjian','relianying'], ["qingjian", "relianying"],
['rende','yuling'], ["rende", "yuling"],
['anxian','yuling'], ["anxian", "yuling"],
['yinguo','yuling'], ["yinguo", "yuling"],
['qingjian','yuling'], ["qingjian", "yuling"],
//['qingnang','yiji'], //['qingnang','yiji'],
//['qingnang','reyiji'], //['qingnang','reyiji'],
//['qingjian','tuntian'], //['qingjian','tuntian'],
// ['yiji','tuntian'], // ['yiji','tuntian'],
// ['reyiji','tuntian'], // ['reyiji','tuntian'],
['tuntian','guidao'], ["tuntian", "guidao"],
['tuntian','tiandao'], ["tuntian", "tiandao"],
['tuntian','huanshi'], ["tuntian", "huanshi"],
// ['tuntian','guicai'], // ['tuntian','guicai'],
// ['jiang','chongzhen'], // ['jiang','chongzhen'],
// ['fenji','yuling'], // ['fenji','yuling'],
['jiushi','guixin'], ["jiushi", "guixin"],
['xiuhua','qiaoxie'], ["xiuhua", "qiaoxie"],
['xiuhua','xuanfeng'], ["xiuhua", "xuanfeng"],
['xiuhua','duanxing'], ["xiuhua", "duanxing"],
['xiuhua','xiaoji'], ["xiuhua", "xiaoji"],
['xiuhua','xiaoji'], ["xiuhua", "xiaoji"],
// ['jiushi','jushou'], // ['jiushi','jushou'],
// ['jiushi','kuiwei'], // ['jiushi','kuiwei'],
['zishu','xinfu_songsang'], ["zishu", "xinfu_songsang"],
['zishu','shenxing'], ["zishu", "shenxing"],
['minishendao','luoshen'], ["minishendao", "luoshen"],
['minishendao','reluoshen'], ["minishendao", "reluoshen"],
['akane_quanqing','lianying'], ["akane_quanqing", "lianying"],
['akane_quanqing','relianying'], ["akane_quanqing", "relianying"],
['akane_quanqing','shangshi'], ["akane_quanqing", "shangshi"],
['dcruyi','cxliushi'], ["dcruyi", "cxliushi"],
] ],
}; };

View File

@ -1,176 +1,198 @@
var fs=require('fs'); var fs = require("fs");
var path=require('path'); var path = require("path");
var exec = require('child_process').exec; var exec = require("child_process").exec;
global.window=global; global.window = global;
require(__dirname+'/update.js'); require(__dirname + "/update.js");
require(__dirname+'/asset.js'); require(__dirname + "/asset.js");
var updates=window.noname_update; var updates = window.noname_update;
var newversion=false; var newversion = false;
var commit=false var commit = false;
if(process.argv[2]){ if (process.argv[2]) {
if(/[0-9]/.test(process.argv[2][0])){ if (/[0-9]/.test(process.argv[2][0])) {
newversion=true; newversion = true;
updates.update = updates.version; updates.update = updates.version;
updates.version = '1.9.' + process.argv[2]; updates.version = "1.9." + process.argv[2];
commit=updates.version; commit = updates.version;
} } else {
else{ commit = process.argv[2];
commit=process.argv[2]; }
} }
} var assetlist = "";
var assetlist=''; var skinlist = "window.noname_skin_list={\n";
var skinlist='window.noname_skin_list={\n'; var entrylist = [];
var entrylist=[]; var entrymap = {};
var entrymap={}; var get = function (dir, callback) {
var get = function(dir,callback){ fs.readdir(dir, function (err, list) {
fs.readdir(dir,function(err,list){ var shift = function () {
var shift=function(){ if (list.length) {
if(list.length){ var filename = list.shift();
var filename=list.shift(); var delay = false;
var delay=false; if (!/\.|~|_/.test(filename[0])) {
if(!/\.|~|_/.test(filename[0])){ var url = dir + "/" + filename;
var url=dir+'/'+filename; var stat = fs.statSync(url);
var stat=fs.statSync(url); if (stat.isFile()) {
if(stat.isFile()){ if (
if(['.jpg','.png','.mp3','.ttf'].indexOf(path.extname(url))!=-1){ [".jpg", ".png", ".mp3", ".ttf"].indexOf(
var assetentry=path.relative(path.dirname(__dirname),url); path.extname(url)
assetlist+=',\n\t\''+assetentry+'\''; ) != -1
entrylist.push(assetentry); ) {
} var assetentry = path.relative(
} path.dirname(__dirname),
else if(stat.isDirectory()){ url
if(dir==path.dirname(__dirname)+'/image/skin'){ );
fs.readdir(url,function(err,list){ assetlist += ",\n\t'" + assetentry + "'";
var num=0; entrylist.push(assetentry);
for(var i=0;i<list.length;i++){ }
var url2=url+'/'+list[i]; } else if (stat.isDirectory()) {
var stat=fs.statSync(url2); if (dir == path.dirname(__dirname) + "/image/skin") {
if(stat.isFile()&&path.extname(url2)=='.jpg'){ fs.readdir(url, function (err, list) {
num++; var num = 0;
} for (var i = 0; i < list.length; i++) {
} var url2 = url + "/" + list[i];
skinlist+='\t'+filename+':'+num+',\n'; var stat = fs.statSync(url2);
entrymap[filename]=num; if (
shift(); stat.isFile() &&
}); path.extname(url2) == ".jpg"
delay=true; ) {
} num++;
else{ }
get(url,shift); }
delay=true; skinlist += "\t" + filename + ":" + num + ",\n";
} entrymap[filename] = num;
} shift();
} });
if(!delay){ delay = true;
shift(); } else {
} get(url, shift);
} delay = true;
else{ }
callback(); }
} }
} if (!delay) {
shift(); shift();
}); }
}; } else {
callback();
}
get(path.dirname(__dirname),function(){ };
var diff=false; shift();
if(window.noname_asset_list.length==entrylist.length+1){ });
for(var i=0;i<entrylist.length;i++){ };
if(entrylist[i]!=window.noname_asset_list[i+1]){
diff=true; get(path.dirname(__dirname), function () {
break; var diff = false;
} if (window.noname_asset_list.length == entrylist.length + 1) {
} for (var i = 0; i < entrylist.length; i++) {
if(!diff){ if (entrylist[i] != window.noname_asset_list[i + 1]) {
for(var i in entrymap){ diff = true;
if(window.noname_skin_list[i]!==entrymap[i]){ break;
diff=true; }
break; }
} if (!diff) {
} for (var i in entrymap) {
for(var i in noname_skin_list){ if (window.noname_skin_list[i] !== entrymap[i]) {
if(window.noname_skin_list[i]!==entrymap[i]){ diff = true;
diff=true; break;
break; }
} }
} for (var i in noname_skin_list) {
} if (window.noname_skin_list[i] !== entrymap[i]) {
} diff = true;
else{ break;
diff=true; }
} }
var next=function(){ }
exec('git diff --name-only', (error, stdout, stderr) => { } else {
var updatelist='window.noname_update={\n\tversion:\''+updates.version+'\','; diff = true;
updatelist+='\n\tupdate:\''+(updates.update||'')+'\','; }
var apply=function(name,list){ var next = function () {
updatelist+='\n\t'+name+':[\n'; exec("git diff --name-only", (error, stdout, stderr) => {
for(var i=0;i<list.length;i++){ var updatelist =
updatelist+='\t\t\''+list[i]+'\''; "window.noname_update={\n\tversion:'" + updates.version + "',";
if(i<list.length-1){ updatelist += "\n\tupdate:'" + (updates.update || "") + "',";
updatelist+=','; var apply = function (name, list) {
} updatelist += "\n\t" + name + ":[\n";
updatelist+='\n'; for (var i = 0; i < list.length; i++) {
} updatelist += "\t\t'" + list[i] + "'";
updatelist+='\t]'; if (i < list.length - 1) {
}; updatelist += ",";
if(updates.changeLog){ }
apply('changeLog',updates.changeLog); updatelist += "\n";
updatelist+=','; }
} updatelist += "\t]";
if(updates.players){ };
apply('players',updates.players); if (updates.changeLog) {
updatelist+=','; apply("changeLog", updates.changeLog);
} updatelist += ",";
if(updates.cards){ }
apply('cards',updates.cards); if (updates.players) {
updatelist+=','; apply("players", updates.players);
} updatelist += ",";
var changes = stdout.split('\n'); }
for(var i=0;i<changes.length;i++){ if (updates.cards) {
var extname=path.extname(changes[i]); apply("cards", updates.cards);
if(!changes[i]||(extname!='.js'&&extname!='.css')||changes[i]=='game/update.js'){ updatelist += ",";
changes.splice(i--,1); }
} var changes = stdout.split("\n");
} for (var i = 0; i < changes.length; i++) {
var files; var extname = path.extname(changes[i]);
if(newversion){ if (
files = []; !changes[i] ||
} (extname != ".js" && extname != ".css") ||
else{ changes[i] == "game/update.js"
files = updates.files || []; ) {
} changes.splice(i--, 1);
for(var i=0;i<changes.length;i++){ }
if(files.indexOf(changes[i])===-1){ }
files.push(changes[i]) var files;
} if (newversion) {
} files = [];
files.sort(function(a,b){ } else {
if (a>b) return 1; files = updates.files || [];
if (a<b) return -1; }
return 0; for (var i = 0; i < changes.length; i++) {
}) if (files.indexOf(changes[i]) === -1) {
apply('files',files); files.push(changes[i]);
fs.writeFile('game/update.js',updatelist+'\n};','utf-8',function(){ }
console.log('updated update.js'); }
if(commit && typeof commit==='string'){ files.sort(function (a, b) {
exec('git add . && git commit -am '+commit); if (a > b) return 1;
console.log('committed '+commit); if (a < b) return -1;
} return 0;
}); });
}); apply("files", files);
} fs.writeFile(
if(diff){ "game/update.js",
var assetversion='window.noname_asset_list=[\n\t\''+updates.version+'\''; updatelist + "\n};",
fs.writeFile('game/asset.js',assetversion+assetlist+'\n];\n'+skinlist.slice(0,skinlist.length-2)+'\n};','utf-8',function(){ "utf-8",
console.log('udpated asset.js'); function () {
next(); console.log("updated update.js");
}); if (commit && typeof commit === "string") {
} exec("git add . && git commit -am " + commit);
else{ console.log("committed " + commit);
next(); }
} }
}); );
});
};
if (diff) {
var assetversion =
"window.noname_asset_list=[\n\t'" + updates.version + "'";
fs.writeFile(
"game/asset.js",
assetversion +
assetlist +
"\n];\n" +
skinlist.slice(0, skinlist.length - 2) +
"\n};",
"utf-8",
function () {
console.log("udpated asset.js");
next();
}
);
} else {
next();
}
});

View File

@ -1,137 +1,171 @@
import { game, get, lib, boot } from "../noname.js"; import { game, get, lib, boot } from "../noname.js";
import { canUseHttpProtocol, sendUpdate } from "../noname/init/index.js"; import { canUseHttpProtocol, sendUpdate } from "../noname/init/index.js";
import { userAgent } from "../noname/util/index.js"; import { userAgent } from "../noname/util/index.js";
const coreAndVersion = get.coreInfo(); const coreAndVersion = get.coreInfo();
const core = coreAndVersion[0], version = coreAndVersion[1]; const core = coreAndVersion[0],
//@todo: 77 -> 80 version = coreAndVersion[1];
if (core === 'chrome' && !isNaN(version) && version < 77) { //@todo: 77 -> 80
const tip = '检测到您的浏览器内核版本小于77请及时升级浏览器或手机webview内核'; if (core === "chrome" && !isNaN(version) && version < 77) {
console.warn(tip); const tip =
game.print(tip); "检测到您的浏览器内核版本小于77请及时升级浏览器或手机webview内核";
const redirect_tip = `您使用的浏览器或无名杀客户端内核版本过低,将在未来的版本被废弃!\n目前使用的浏览器UA信息为\n${userAgent}\n点击“确认”以前往GitHub下载最新版无名杀客户端可能需要科学上网`; console.warn(tip);
if (confirm(redirect_tip)) { game.print(tip);
window.open('https://github.com/libccy/noname/releases/tag/chromium77-client'); const redirect_tip = `您使用的浏览器或无名杀客户端内核版本过低,将在未来的版本被废弃!\n目前使用的浏览器UA信息为\n${userAgent}\n点击“确认”以前往GitHub下载最新版无名杀客户端可能需要科学上网`;
} if (confirm(redirect_tip)) {
} window.open(
"https://github.com/libccy/noname/releases/tag/chromium77-client"
boot().then(() => { );
// 判断是否从file协议切换到http/s协议 }
if (canUseHttpProtocol()) { }
/*
升级方法: boot().then(() => {
1. 游戏启动后导出数据然后以http/s协议重启 // 判断是否从file协议切换到http/s协议
2. 以http/s协议导入数据 if (canUseHttpProtocol()) {
3. 保存http/s协议的状态以后不再以file协议启动 /*
*/ 升级方法:
// 导出数据到根目录的noname.config.txt 1. 游戏启动后导出数据然后以http/s协议重启
let data; 2. 以http/s协议导入数据
let export_data = function (data) { 3. 保存http/s协议的状态以后不再以file协议启动
game.promises.writeFile(lib.init.encode(JSON.stringify(data)), './', 'noname.config.txt') */
.then(saveProtocol) // 导出数据到根目录的noname.config.txt
.catch(e => { let data;
console.error('升级失败:', e); let export_data = function (data) {
}); game.promises
}; .writeFile(
// @ts-ignore lib.init.encode(JSON.stringify(data)),
if (!lib.db) { "./",
data = {}; "noname.config.txt"
for (let i in localStorage) { )
if (i.startsWith(lib.configprefix)) { .then(saveProtocol)
data[i] = localStorage[i]; .catch((e) => {
} console.error("升级失败:", e);
} });
export_data(data); };
} // @ts-ignore
else { if (!lib.db) {
game.getDB('config', null, function (data1) { data = {};
game.getDB('data', null, function (data2) { for (let i in localStorage) {
export_data({ if (i.startsWith(lib.configprefix)) {
config: data1, data[i] = localStorage[i];
data: data2 }
}); }
}); export_data(data);
}); } else {
} game.getDB("config", null, function (data1) {
// 保存协议的切换状态 game.getDB("data", null, function (data2) {
function saveProtocol() { export_data({
const url = sendUpdate(); config: data1,
if (typeof url == 'string') { data: data2,
if (typeof window.require == 'function' && typeof window.process == 'object') { });
// @ts-ignore });
const remote = require('@electron/remote'); });
const thisWindow = remote.getCurrentWindow(); }
thisWindow.loadURL(url); // 保存协议的切换状态
} else { function saveProtocol() {
location.href = url; const url = sendUpdate();
} if (typeof url == "string") {
} if (
} typeof window.require == "function" &&
} else { typeof window.process == "object"
// 成功导入后删除noname.config.txt ) {
let searchParams = new URLSearchParams(location.search); // @ts-ignore
for (let [key, value] of searchParams) { const remote = require("@electron/remote");
if (key === 'sendUpdate' && value === 'true') { const thisWindow = remote.getCurrentWindow();
game.promises.readFileAsText('noname.config.txt').then(data => { thisWindow.loadURL(url);
return /** @type {Promise<void>} */(new Promise(async (resolve, reject) => { } else {
if (!data) return reject('!data'); location.href = url;
try { }
data = JSON.parse(lib.init.decode(data)); }
if (!data || typeof data != 'object') { }
throw ('err'); } else {
} // 成功导入后删除noname.config.txt
// @ts-ignore let searchParams = new URLSearchParams(location.search);
if (lib.db && (!data.config || !data.data)) { for (let [key, value] of searchParams) {
throw ('err'); if (key === "sendUpdate" && value === "true") {
} game.promises
} .readFileAsText("noname.config.txt")
catch (e) { .then((data) => {
console.log(e); return /** @type {Promise<void>} */ (
if (e == 'err') { new Promise(async (resolve, reject) => {
alert('导入文件格式不正确'); if (!data) return reject("!data");
reject('导入文件格式不正确'); try {
} else { data = JSON.parse(lib.init.decode(data));
alert('导入失败: ' + e.message); if (!data || typeof data != "object") {
reject('导入失败: ' + e.message); throw "err";
} }
return; // @ts-ignore
} if (
alert('导入成功, 即将自动重启'); lib.db &&
// @ts-ignore (!data.config || !data.data)
if (!lib.db) { ) {
const noname_inited = localStorage.getItem('noname_inited'); throw "err";
const onlineKey = localStorage.getItem(lib.configprefix + 'key'); }
localStorage.clear(); } catch (e) {
if (noname_inited) { console.log(e);
localStorage.setItem('noname_inited', noname_inited); if (e == "err") {
} alert("导入文件格式不正确");
if (onlineKey) { reject("导入文件格式不正确");
localStorage.setItem(lib.configprefix + 'key', onlineKey); } else {
} alert("导入失败: " + e.message);
for (let i in data) { reject("导入失败: " + e.message);
localStorage.setItem(i, data[i]); }
} return;
} }
else { alert("导入成功, 即将自动重启");
for (let i in data.config) { // @ts-ignore
await game.putDB('config', i, data.config[i]); if (!lib.db) {
lib.config[i] = data.config[i]; const noname_inited =
} localStorage.getItem("noname_inited");
for (let i in data.data) { const onlineKey = localStorage.getItem(
await game.putDB('data', i, data.data[i]); lib.configprefix + "key"
} );
} localStorage.clear();
lib.init.background(); if (noname_inited) {
resolve(); localStorage.setItem(
})); "noname_inited",
}).then(() => { noname_inited
return game.promises.removeFile('noname.config.txt'); );
}).then(() => { }
const url = new URL(location.href); if (onlineKey) {
location.href = url.origin + url.pathname; localStorage.setItem(
}); lib.configprefix + "key",
} onlineKey
} );
} }
}); for (let i in data) {
localStorage.setItem(i, data[i]);
}
} else {
for (let i in data.config) {
await game.putDB(
"config",
i,
data.config[i]
);
lib.config[i] = data.config[i];
}
for (let i in data.data) {
await game.putDB(
"data",
i,
data.data[i]
);
}
}
lib.init.background();
resolve();
})
);
})
.then(() => {
return game.promises.removeFile("noname.config.txt");
})
.then(() => {
const url = new URL(location.href);
location.href = url.origin + url.pathname;
});
}
}
}
});

View File

@ -1,232 +1,301 @@
"use strict"; "use strict";
new Promise(resolve => { new Promise((resolve) => {
// 客户端自带core.js的请注意跟进core.js版本 // 客户端自带core.js的请注意跟进core.js版本
if ('__core-js_shared__' in window) resolve(null); if ("__core-js_shared__" in window) resolve(null);
else { else {
const nonameInitialized = localStorage.getItem('noname_inited'); const nonameInitialized = localStorage.getItem("noname_inited");
const assetURL = location.protocol.startsWith('http') || typeof nonameInitialized != 'string' || nonameInitialized == 'nodejs' ? '' : nonameInitialized; const assetURL =
const coreJSBundle = document.createElement('script'); location.protocol.startsWith("http") ||
coreJSBundle.onerror = coreJSBundle.onload = resolve; typeof nonameInitialized != "string" ||
coreJSBundle.src = `${assetURL}game/core-js-bundle.js`; nonameInitialized == "nodejs"
document.head.appendChild(coreJSBundle); ? ""
} : nonameInitialized;
}).then(() => { const coreJSBundle = document.createElement("script");
const nonameInitialized = localStorage.getItem('noname_inited'); coreJSBundle.onerror = coreJSBundle.onload = resolve;
const assetURL = location.protocol.startsWith('http') || typeof nonameInitialized != 'string' || nonameInitialized == 'nodejs' ? '' : nonameInitialized; coreJSBundle.src = `${assetURL}game/core-js-bundle.js`;
const userAgent = navigator.userAgent.toLowerCase(); document.head.appendChild(coreJSBundle);
}
const exit = () => { }).then(() => {
const ios = userAgent.includes('iphone') || userAgent.includes('ipad') || userAgent.includes('macintosh'); const nonameInitialized = localStorage.getItem("noname_inited");
//electron const assetURL =
if (typeof window.process == 'object' && typeof window.require == 'function') { location.protocol.startsWith("http") ||
const versions = window.process.versions; typeof nonameInitialized != "string" ||
// @ts-ignore nonameInitialized == "nodejs"
const electronVersion = parseFloat(versions.electron); ? ""
let remote; : nonameInitialized;
if (electronVersion >= 14) { const userAgent = navigator.userAgent.toLowerCase();
// @ts-ignore
remote = require('@electron/remote'); const exit = () => {
} else { const ios =
// @ts-ignore userAgent.includes("iphone") ||
remote = require('electron').remote; userAgent.includes("ipad") ||
} userAgent.includes("macintosh");
const thisWindow = remote.getCurrentWindow(); //electron
thisWindow.destroy(); if (
window.process.exit(); typeof window.process == "object" &&
} typeof window.require == "function"
//android-cordova环境 ) {
//ios-cordova环境或ios浏览器环境 const versions = window.process.versions;
//非ios的网页版 // @ts-ignore
else if (!ios) { const electronVersion = parseFloat(versions.electron);
window.close(); let remote;
} if (electronVersion >= 14) {
}; // @ts-ignore
remote = require("@electron/remote");
// 这个弹窗在升级到http协议下的客户端不应该进行提示。 } else {
if (!localStorage.getItem('gplv3_noname_alerted')) { // @ts-ignore
const nonameInitialized = localStorage.getItem('noname_inited'); remote = require("electron").remote;
const callback = () => { }
if (confirm('①无名杀是一款基于GPLv3协议的开源软件\n你可以在遵守GPLv3协议的基础上任意使用修改并转发《无名杀》以及所有基于《无名杀》开发的拓展。\n点击“确定”即代表您认可并接受GPLv3协议↓\nhttps://www.gnu.org/licenses/gpl-3.0.html\n②无名杀官方发布地址仅有GitHub仓库\n其他所有的所谓“无名杀”社群包括但不限于绝大多数“官方”QQ群、QQ频道等均为玩家自发组织与无名杀官方无关')) { const thisWindow = remote.getCurrentWindow();
// @ts-ignore thisWindow.destroy();
localStorage.setItem('gplv3_noname_alerted', true); window.process.exit();
} }
else { //android-cordova环境
exit(); //ios-cordova环境或ios浏览器环境
} //非ios的网页版
}; else if (!ios) {
if (location.protocol.startsWith('http')) { window.close();
if (!nonameInitialized || nonameInitialized.length == 0) { }
callback(); };
} else {
// @ts-ignore // 这个弹窗在升级到http协议下的客户端不应该进行提示。
localStorage.setItem('gplv3_noname_alerted', true); if (!localStorage.getItem("gplv3_noname_alerted")) {
} const nonameInitialized = localStorage.getItem("noname_inited");
} else callback(); const callback = () => {
if (
} confirm(
window['b' + 'ann' + 'e' + 'dE' + 'x' + 'ten' + 's' + 'i' + 'o' + 'ns'] = ['\u4fa0\u4e49', '\u5168\u6559\u7a0b']; "①无名杀是一款基于GPLv3协议的开源软件\n你可以在遵守GPLv3协议的基础上任意使用修改并转发《无名杀》以及所有基于《无名杀》开发的拓展。\n点击“确定”即代表您认可并接受GPLv3协议↓\nhttps://www.gnu.org/licenses/gpl-3.0.html\n②无名杀官方发布地址仅有GitHub仓库\n其他所有的所谓“无名杀”社群包括但不限于绝大多数“官方”QQ群、QQ频道等均为玩家自发组织与无名杀官方无关"
)
/** ) {
* // @ts-ignore
* @returns {["firefox" | "chrome" | "safari" | "other", number, number, number]} localStorage.setItem("gplv3_noname_alerted", true);
*/ } else {
function coreInfo() { exit();
const regex = /(firefox|chrome|safari)\/(\d+(?:\.\d+)+)/ }
let result };
if (!(result = userAgent.match(regex))) return ["other", NaN, NaN, NaN] if (location.protocol.startsWith("http")) {
if (result[1] != "safari") { if (!nonameInitialized || nonameInitialized.length == 0) {
const [major, minor, patch] = result[2].split(".") callback();
// @ts-ignore } else {
return [result[1], parseInt(major), parseInt(minor), parseInt(patch)] // @ts-ignore
} localStorage.setItem("gplv3_noname_alerted", true);
result = userAgent.match(/version\/(\d+(?:\.\d+)+).*safari/) }
// @ts-ignore } else callback();
const [major, minor, patch] = result[1].split(".") }
return ["safari", parseInt(major), parseInt(minor), parseInt(patch)] window["b" + "ann" + "e" + "dE" + "x" + "ten" + "s" + "i" + "o" + "ns"] = [
} "\u4fa0\u4e49",
const [core, major, minor, patch] = coreInfo(); "\u5168\u6559\u7a0b",
const supportMap = { ];
"firefox": [60, 0, 0],
"chrome": [61, 0, 0], /**
"safari": [14, 5, 0] *
} * @returns {["firefox" | "chrome" | "safari" | "other", number, number, number]}
const versions = [major, minor, patch] */
// require是需求的版本号current是浏览器环境本身的版本号 function coreInfo() {
const check = (require, current) => { const regex = /(firefox|chrome|safari)\/(\d+(?:\.\d+)+)/;
// 防止不存在的意外,提前截断当前版本号的长度 let result;
if (current.length > require.length) current.length = require.length if (!(result = userAgent.match(regex))) return ["other", NaN, NaN, NaN];
if (result[1] != "safari") {
// 考虑到玄学的NaN情况记录是否存在NaN const [major, minor, patch] = result[2].split(".");
let flag = false // @ts-ignore
// 从主版本号遍历到修订版本号,只考虑当前版本号的长度 return [
for (let i = 0; i < current.length; ++i) { result[1],
// 当前环境版本号当前位若是NaN则记录后直接到下一位 parseInt(major),
if (isNaN(current[i])) { parseInt(minor),
flag = true parseInt(patch),
continue ];
} }
// 如果此时flag为true且current[i]不为NaN版本号则不合法直接否 result = userAgent.match(/version\/(\d+(?:\.\d+)+).*safari/);
if (flag) return false // @ts-ignore
// 上位版本号未达到要求,直接否决 const [major, minor, patch] = result[1].split(".");
if (require[i] > current[i]) return false return ["safari", parseInt(major), parseInt(minor), parseInt(patch)];
// 上位版本号已超过要求,直接可行 }
if (current[i] > require[i]) return true const [core, major, minor, patch] = coreInfo();
} const supportMap = {
return true firefox: [60, 0, 0],
} chrome: [61, 0, 0],
safari: [14, 5, 0],
if (core in supportMap && !check(supportMap[core], versions)) { };
const tip = '检测到您的浏览器内核版本无法支持当前无名杀所需的功能请立即升级浏览器或手机webview内核'; const versions = [major, minor, patch];
console.error(tip); // require是需求的版本号current是浏览器环境本身的版本号
let redirect_tip = `您使用的浏览器或无名杀客户端内核版本过低,已经无法正常运行无名杀!\n目前使用的浏览器UA信息为\n${userAgent}\n点击“确认”以前往GitHub下载最新版无名杀客户端可能需要科学上网\n稍后您的无名杀将自动退出(可能的话)`; const check = (require, current) => {
if (core === 'safari') { // 防止不存在的意外,提前截断当前版本号的长度
alert(`您使用的safari浏览器无法支持当前无名杀所需的功能请至少升级至14.5.0\n稍后您的无名杀将自动退出(可能的话)`); if (current.length > require.length) current.length = require.length;
} else {
if (confirm(redirect_tip)) { // 考虑到玄学的NaN情况记录是否存在NaN
window.open('https://github.com/libccy/noname/releases/tag/chromium77-client'); let flag = false;
} // 从主版本号遍历到修订版本号,只考虑当前版本号的长度
} for (let i = 0; i < current.length; ++i) {
exit(); // 当前环境版本号当前位若是NaN则记录后直接到下一位
} if (isNaN(current[i])) {
else { flag = true;
// node环境下 continue;
if (typeof window.require == 'function' && }
typeof window.process == 'object' && // 如果此时flag为true且current[i]不为NaN版本号则不合法直接否
typeof window.__dirname == 'string') { if (flag) return false;
// 在http环境下修改__dirname和require的逻辑 // 上位版本号未达到要求,直接否决
if (location.protocol.startsWith('http') && if (require[i] > current[i]) return false;
window.__dirname.endsWith('electron.asar\\renderer')) { // 上位版本号已超过要求,直接可行
const path = require('path'); if (current[i] > require[i]) return true;
window.__dirname = path.join(path.resolve(), 'resources/app'); }
const oldData = Object.entries(window.require); return true;
// @ts-ignore };
window.require = function (moduleId) {
try { if (core in supportMap && !check(supportMap[core], versions)) {
return module.require(moduleId); const tip =
} catch { "检测到您的浏览器内核版本无法支持当前无名杀所需的功能请立即升级浏览器或手机webview内核";
return module.require(path.join(window.__dirname, moduleId)); console.error(tip);
} let redirect_tip = `您使用的浏览器或无名杀客户端内核版本过低,已经无法正常运行无名杀!\n目前使用的浏览器UA信息为\n${userAgent}\n点击“确认”以前往GitHub下载最新版无名杀客户端可能需要科学上网\n稍后您的无名杀将自动退出(可能的话)`;
}; if (core === "safari") {
oldData.forEach(([key, value]) => { alert(
window.require[key] = value; `您使用的safari浏览器无法支持当前无名杀所需的功能请至少升级至14.5.0\n稍后您的无名杀将自动退出(可能的话)`
}); );
} } else {
// 增加导入ts的逻辑 if (confirm(redirect_tip)) {
window.require.extensions['.ts'] = function (module, filename) { window.open(
// @ts-ignore "https://github.com/libccy/noname/releases/tag/chromium77-client"
const _compile = module._compile; );
// @ts-ignore }
module._compile = function (code, fileName) { }
/** exit();
* @type { import('typescript') } } else {
*/ // node环境下
// @ts-ignore if (
const ts = require('./game/typescript.js'); typeof window.require == "function" &&
// 使用ts compiler对ts文件进行编译 typeof window.process == "object" &&
const result = ts.transpile(code, { typeof window.__dirname == "string"
module: ts.ModuleKind.CommonJS, ) {
//@todo: ES2019 -> ES2020 // 在http环境下修改__dirname和require的逻辑
target: ts.ScriptTarget.ES2019, if (
inlineSourceMap: true, location.protocol.startsWith("http") &&
resolveJsonModule: true, window.__dirname.endsWith("electron.asar\\renderer")
esModuleInterop: true, ) {
}, fileName); const path = require("path");
// 使用默认的js编译函数获取返回值 window.__dirname = path.join(path.resolve(), "resources/app");
return _compile.call(this, result, fileName); const oldData = Object.entries(window.require);
} // @ts-ignore
// @ts-ignore window.require = function (moduleId) {
module._compile(require('fs').readFileSync(filename, 'utf8'), filename); try {
}; return module.require(moduleId);
} } catch {
// 使serviceWorker加载完成后再加载entry.js return module.require(
const loadEntryJs = () => { path.join(window.__dirname, moduleId)
const script = document.createElement('script') );
script.type = "module"; }
script.src = `${assetURL}game/entry.js`; };
script.async = true; oldData.forEach(([key, value]) => {
script.onerror = event => { window.require[key] = value;
console.error(event); });
const message = `您使用的浏览器或《无名杀》客户端加载内容失败!\n请检查是否缺少游戏文件!隔版本更新请下载完整包而不是离线包!\n目前使用的浏览器UA信息为\n${userAgent}\n若您使用的客户端为自带内核的旧版“兼容版”,请及时更新客户端版本!\n若您使用的客户端为手机端的非兼容版《无名杀》请尝试更新手机的WebView内核或者更换为1.8.2版本及以上的兼容版!\n若您是直接使用浏览器加载index.html进行游戏请改为运行文件夹内的“noname-server.exe”或使用VSCode等工具启动Live Server以动态服务器的方式启动《无名杀》\n若您使用的是苹果端请至少将Safari升级至14.5.0`; }
console.error(message); // 增加导入ts的逻辑
alert(message); window.require.extensions[".ts"] = function (module, filename) {
exit(); // @ts-ignore
} const _compile = module._compile;
document.head.appendChild(script); // @ts-ignore
}; module._compile = function (code, fileName) {
/**
if (location.protocol.startsWith('http') && 'serviceWorker' in navigator) { * @type { import('typescript') }
let scope = window.location.protocol + '//' + window.location.host + '/'; */
navigator.serviceWorker.getRegistrations() // @ts-ignore
.then(async registrations => { const ts = require("./game/typescript.js");
let findServiceWorker = registrations.find(registration => { // 使用ts compiler对ts文件进行编译
return registration && registration.active && registration.active.scriptURL == `${scope}service-worker.js`; const result = ts.transpile(
}); code,
try { {
const registration_1 = await navigator.serviceWorker.register(`${scope}service-worker.js`, { module: ts.ModuleKind.CommonJS,
type: 'module', //@todo: ES2019 -> ES2020
updateViaCache: "all", target: ts.ScriptTarget.ES2019,
scope, inlineSourceMap: true,
}); resolveJsonModule: true,
// 初次加载worker需要重新启动一次 esModuleInterop: true,
if (!findServiceWorker) location.reload(); },
// 接收消息,暂时没用到 fileName
navigator.serviceWorker.addEventListener('message', e => { );
console.log(e); // 使用默认的js编译函数获取返回值
}); return _compile.call(this, result, fileName);
registration_1.update().catch(e => console.error('worker update失败', e)); };
if (!sessionStorage.getItem('canUseTs')) { // @ts-ignore
await import('./canUse.ts').then(({ text }) => console.log(text)).catch(() => { module._compile(
sessionStorage.setItem('canUseTs', '1'); require("fs").readFileSync(filename, "utf8"),
location.reload(); filename
}); );
} };
} catch (e_1) { }
console.log('serviceWorker加载失败: ', e_1); // 使serviceWorker加载完成后再加载entry.js
} const loadEntryJs = () => {
}).finally(loadEntryJs); const script = document.createElement("script");
} else { script.type = "module";
loadEntryJs(); script.src = `${assetURL}game/entry.js`;
} script.async = true;
} script.onerror = (event) => {
}); console.error(event);
const message = `您使用的浏览器或《无名杀》客户端加载内容失败!\n请检查是否缺少游戏文件!隔版本更新请下载完整包而不是离线包!\n目前使用的浏览器UA信息为\n${userAgent}\n若您使用的客户端为自带内核的旧版“兼容版”,请及时更新客户端版本!\n若您使用的客户端为手机端的非兼容版《无名杀》请尝试更新手机的WebView内核或者更换为1.8.2版本及以上的兼容版!\n若您是直接使用浏览器加载index.html进行游戏请改为运行文件夹内的“noname-server.exe”或使用VSCode等工具启动Live Server以动态服务器的方式启动《无名杀》\n若您使用的是苹果端请至少将Safari升级至14.5.0`;
console.error(message);
alert(message);
exit();
};
document.head.appendChild(script);
};
if (
location.protocol.startsWith("http") &&
"serviceWorker" in navigator
) {
let scope =
window.location.protocol + "//" + window.location.host + "/";
navigator.serviceWorker
.getRegistrations()
.then(async (registrations) => {
let findServiceWorker = registrations.find(
(registration) => {
return (
registration &&
registration.active &&
registration.active.scriptURL ==
`${scope}service-worker.js`
);
}
);
try {
const registration_1 =
await navigator.serviceWorker.register(
`${scope}service-worker.js`,
{
type: "module",
updateViaCache: "all",
scope,
}
);
// 初次加载worker需要重新启动一次
if (!findServiceWorker) location.reload();
// 接收消息,暂时没用到
navigator.serviceWorker.addEventListener(
"message",
(e) => {
console.log(e);
}
);
registration_1
.update()
.catch((e) =>
console.error("worker update失败", e)
);
if (!sessionStorage.getItem("canUseTs")) {
await import("./canUse.ts")
.then(({ text }) => console.log(text))
.catch(() => {
sessionStorage.setItem("canUseTs", "1");
location.reload();
});
}
} catch (e_1) {
console.log("serviceWorker加载失败: ", e_1);
}
})
.finally(loadEntryJs);
} else {
loadEntryJs();
}
}
});

View File

@ -1,87 +1,111 @@
var http = require('http'); var http = require("http");
var fs = require('fs'); var fs = require("fs");
var server = new http.Server(); var server = new http.Server();
server.listen(80); server.listen(80);
server.on('request', function(request, response) { server.on("request", function (request, response) {
var url = require('url').parse(request.url); var url = require("url").parse(request.url);
switch(url.pathname) { switch (url.pathname) {
case ''||'/' : case "" || "/":
fs.readFile('./index.html', function(err, content){ fs.readFile("./index.html", function (err, content) {
if(err) { if (err) {
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' }); response.writeHead(404, {
response.write(err.message); "Content-Type": 'text/plain; charset="UTF-8"',
response.end(); });
} else { response.write(err.message);
response.writeHead(200, { 'Content-Type' : 'text/html; charset=UTF-8' }); response.end();
response.write(content); } else {
response.end(); response.writeHead(200, {
} "Content-Type": "text/html; charset=UTF-8",
}); });
break; response.write(content);
case '/test/delay': response.end();
var delay = parseInt(url.query) || 2000; }
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'}); });
response.write('Sleeping for' + delay + ' milliseconds...'); break;
setTimeout(function(){ case "/test/delay":
response.write('done.'); var delay = parseInt(url.query) || 2000;
response.end(); response.writeHead(200, {
}, delay); "Content-type": "text/plain; charset=UTF-8",
break; });
case '/test/mirror': response.write("Sleeping for" + delay + " milliseconds...");
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'}); setTimeout(function () {
response.write(request.mothod + ' ' + request.url + ' HTTP/' + request.httpVersion + '\r\n'); response.write("done.");
for (var h in request.headers) { response.end();
response.write(h + ':' + request.headers[h] + '\r\n'); }, delay);
} break;
response.write('\r\n'); case "/test/mirror":
request.on('data', function(chunk) { response.write(chunk); }); response.writeHead(200, {
request.on('end', function(chunk){ response.end(); }); "Content-type": "text/plain; charset=UTF-8",
break; });
case '/json' : response.write(
response.writeHead(200, {'Content-type':'application/json; charset=UTF-8'}); request.mothod +
response.write(JSON.stringify({test:'success'})); " " +
response.end(); request.url +
break; " HTTP/" +
default: request.httpVersion +
var filename = url.pathname.substring(1); "\r\n"
var type = getType(filename.substring(filename.lastIndexOf('.')+1)); );
fs.readFile(filename, function(err, content){ for (var h in request.headers) {
if(err) { response.write(h + ":" + request.headers[h] + "\r\n");
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' }); }
response.write(err.message); response.write("\r\n");
response.end(); request.on("data", function (chunk) {
} else { response.write(chunk);
response.writeHead(200, { 'Content-Type' : type }); });
response.write(content); request.on("end", function (chunk) {
response.end(); response.end();
} });
}); break;
break; case "/json":
} response.writeHead(200, {
"Content-type": "application/json; charset=UTF-8",
}); });
function getType(endTag){ response.write(JSON.stringify({ test: "success" }));
var type=null; response.end();
switch(endTag){ break;
case 'html' : default:
case 'htm' : var filename = url.pathname.substring(1);
type = 'text/html; charset=UTF-8'; var type = getType(
break; filename.substring(filename.lastIndexOf(".") + 1)
case 'js' : );
type = 'application/javascript; charset="UTF-8"'; fs.readFile(filename, function (err, content) {
break; if (err) {
case 'css' : response.writeHead(404, {
type = 'text/css; charset="UTF-8"'; "Content-Type": 'text/plain; charset="UTF-8"',
break; });
case 'txt' : response.write(err.message);
type = 'text/plain; charset="UTF-8"'; response.end();
break; } else {
case 'manifest' : response.writeHead(200, { "Content-Type": type });
type = 'text/cache-manifest; charset="UTF-8"'; response.write(content);
break; response.end();
default : }
type = 'application/octet-stream'; });
break; break;
} }
return type; });
} function getType(endTag) {
var type = null;
switch (endTag) {
case "html":
case "htm":
type = "text/html; charset=UTF-8";
break;
case "js":
type = 'application/javascript; charset="UTF-8"';
break;
case "css":
type = 'text/css; charset="UTF-8"';
break;
case "txt":
type = 'text/plain; charset="UTF-8"';
break;
case "manifest":
type = 'text/cache-manifest; charset="UTF-8"';
break;
default:
type = "application/octet-stream";
break;
}
return type;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
window.bannedKeyWords=JSON.parse( window.bannedKeyWords=JSON.parse(
decodeURIComponent( decodeURIComponent(
atob("JTVCJTIyZ2hzJTIyJTJDJTIyJUU3JTlCJUI0JUU4JTgyJUEwJTIyJTJDJTIyJUU2JTgwJUE3JUU0JUJBJUE0JTIyJTJDJTIyJUU1JTgxJTlBJUU3JTg4JUIxJTIyJTJDJTIyaHR0cCUyMiUyQyUyMiVFNSU5MCU4MyVFNSVBNSVCNiUyMiUyQyUyMiVFOSVBQSU5QSVFOSU4MCVCQyUyMiUyQyUyMiVFNSU5MyU4OCVFNSVCNyVCNCVFNyU4QiU5NyUyMiUyQyUyMiVFNyVCRSU4RSVFNyU5QyU4OSUyMiUyQyUyMiVFNyU5OSU4QyUyMiUyQyUyMiVFNSVCMSU4MSVFNyU5QyVCQyUyMiUyQyUyMiVFOCU4OSVCOSUyMiUyQyUyMiVFNSU4MiVCQiVFOSU4MCVCQyUyMiUyQyUyMiVFNiU5MyU4RCVFNCVCRCVBMCUyMiUyQyUyMiVFNSU4MSU5QSVFOSVCOCVBMSUyMiUyQyUyMiVFNSVBNSVCOCUyMiUyQyUyMiVFNSVBNyVBNiUyMiUyQyUyMiVFNSU4RCU4RSVFNCVCOCVCQSUyMiUyQyUyMiVFNSVCMSU4NCUyMiUyQyUyMiVFNyU4QiU5NyVFNSVBRCU5MCUyMiUyQyUyMiVFNSVCMSU4RSUyMiUyQyUyMiVFNSU5MCU4QyVFNiU4MCVBNyVFNiU4MSU4QiUyMiUyQyUyMiVFOCU4MiU5NiVFNiU4OCU5OCUyMiUyQyUyMiVFOSVCOCVBMSVFNSVCNyVCNCUyMiUyQyUyMiVFNyVCMiVCRSVFNiVCNiVCMiUyMiUyQyUyMiVFNyVCMiVBQSVFNiVCMCVCNCUyMiUyQyUyMiVFNiU4QyU4MiVFNiU5QyU4OCVFNCVCQSVBRSVFNCVCOCVBRCUyMiUyQyUyMiVFOCVCNCVCMSVFOSVBQSVBOCVFNSVBNCVCNCUyMiUyQyUyMiVFNSU5MCU4MyVFNSVCMSU4MSUyMiUyQyUyMiVFNSU4MiVCQiUyMiUyQyUyMiVFNSVBNSVBNSVFNSU4OCVBOSVFNyVCQiU5OSUyMiUyQyUyMiVFNCVCOCU4MSVFNyU5QyU5RiUyMiUyQyUyMiVFOCU5QiU4NiUyMiUyQyUyMiVFOSVCQyVBMCVFOSVCQyVBMCUyMiUyQyUyMiVFOSVCQyVBMCVFNCVCQSVCQSUyMiUyQyUyMiVFNyVBNSU5RSVFNSU4RiU4QiUyMiUyQyUyMiUzQyUyRmElM0UlMjIlNUQ="))); atob("JTVCJTIyZ2hzJTIyJTJDJTIyJUU3JTlCJUI0JUU4JTgyJUEwJTIyJTJDJTIyJUU2JTgwJUE3JUU0JUJBJUE0JTIyJTJDJTIyJUU1JTgxJTlBJUU3JTg4JUIxJTIyJTJDJTIyaHR0cCUyMiUyQyUyMiVFNSU5MCU4MyVFNSVBNSVCNiUyMiUyQyUyMiVFOSVBQSU5QSVFOSU4MCVCQyUyMiUyQyUyMiVFNSU5MyU4OCVFNSVCNyVCNCVFNyU4QiU5NyUyMiUyQyUyMiVFNyVCRSU4RSVFNyU5QyU4OSUyMiUyQyUyMiVFNyU5OSU4QyUyMiUyQyUyMiVFNSVCMSU4MSVFNyU5QyVCQyUyMiUyQyUyMiVFOCU4OSVCOSUyMiUyQyUyMiVFNSU4MiVCQiVFOSU4MCVCQyUyMiUyQyUyMiVFNiU5MyU4RCVFNCVCRCVBMCUyMiUyQyUyMiVFNSU4MSU5QSVFOSVCOCVBMSUyMiUyQyUyMiVFNSVBNSVCOCUyMiUyQyUyMiVFNSVBNyVBNiUyMiUyQyUyMiVFNSU4RCU4RSVFNCVCOCVCQSUyMiUyQyUyMiVFNSVCMSU4NCUyMiUyQyUyMiVFNyU4QiU5NyVFNSVBRCU5MCUyMiUyQyUyMiVFNSVCMSU4RSUyMiUyQyUyMiVFNSU5MCU4QyVFNiU4MCVBNyVFNiU4MSU4QiUyMiUyQyUyMiVFOCU4MiU5NiVFNiU4OCU5OCUyMiUyQyUyMiVFOSVCOCVBMSVFNSVCNyVCNCUyMiUyQyUyMiVFNyVCMiVCRSVFNiVCNiVCMiUyMiUyQyUyMiVFNyVCMiVBQSVFNiVCMCVCNCUyMiUyQyUyMiVFNiU4QyU4MiVFNiU5QyU4OCVFNCVCQSVBRSVFNCVCOCVBRCUyMiUyQyUyMiVFOCVCNCVCMSVFOSVBQSVBOCVFNSVBNCVCNCUyMiUyQyUyMiVFNSU5MCU4MyVFNSVCMSU4MSUyMiUyQyUyMiVFNSU4MiVCQiUyMiUyQyUyMiVFNSVBNSVBNSVFNSU4OCVBOSVFNyVCQiU5OSUyMiUyQyUyMiVFNCVCOCU4MSVFNyU5QyU5RiUyMiUyQyUyMiVFOCU5QiU4NiUyMiUyQyUyMiVFOSVCQyVBMCVFOSVCQyVBMCUyMiUyQyUyMiVFOSVCQyVBMCVFNCVCQSVCQSUyMiUyQyUyMiVFNyVBNSU5RSVFNSU4RiU4QiUyMiUyQyUyMiUzQyUyRmElM0UlMjIlNUQ=")));

View File

@ -1,144 +1,144 @@
window.noname_package={ window.noname_package = {
character:{ character: {
standard:'标准', standard: "标准",
refresh:'界限突破', refresh: "界限突破",
shenhua:'神话再临', shenhua: "神话再临",
yijiang:'一将成名', yijiang: "一将成名",
sp:'璀璨星河', sp: "璀璨星河",
onlyOL:'OL专属', onlyOL: "OL专属",
yingbian:'文德武备', yingbian: "文德武备",
clan:'门阀士族', clan: "门阀士族",
xinghuoliaoyuan:'星火燎原', xinghuoliaoyuan: "星火燎原",
huicui:'群英荟萃', huicui: "群英荟萃",
xianding:'限定专属', xianding: "限定专属",
sp2:'系列专属', sp2: "系列专属",
extra:'神将', extra: "神将",
mobile:'移动版', mobile: "移动版",
shiji:'始计篇', shiji: "始计篇",
sb:'谋攻篇', sb: "谋攻篇",
tw:'外服武将', tw: "外服武将",
collab:'联动卡', collab: "联动卡",
offline:'线下武将', offline: "线下武将",
jsrg:'江山如故', jsrg: "江山如故",
old:'怀旧', old: "怀旧",
diy:'DIY', diy: "DIY",
ddd:'3D精选', ddd: "3D精选",
yxs:'英雄杀', yxs: "英雄杀",
hearth:'炉石传说', hearth: "炉石传说",
gwent:'昆特牌', gwent: "昆特牌",
mtg:'万智牌', mtg: "万智牌",
ow:'守望先锋', ow: "守望先锋",
swd:'轩辕剑', swd: "轩辕剑",
gujian:'古剑奇谭', gujian: "古剑奇谭",
xianjian:'仙剑奇侠传', xianjian: "仙剑奇侠传",
}, },
card:{ card: {
standard:'标准', standard: "标准",
extra:'军争', extra: "军争",
guozhan:'国战', guozhan: "国战",
yingbian:'应变篇', yingbian: "应变篇",
yongjian:'用间篇', yongjian: "用间篇",
sp:'忠胆英杰', sp: "忠胆英杰",
zhulu:'逐鹿天下', zhulu: "逐鹿天下",
yunchou:'运筹帷幄', yunchou: "运筹帷幄",
zhenfa:'阵法', zhenfa: "阵法",
swd:'轩辕剑', swd: "轩辕剑",
gujian:'古剑奇谭', gujian: "古剑奇谭",
hearth:'炉石传说', hearth: "炉石传说",
gwent:'昆特牌', gwent: "昆特牌",
mtg:'万智牌', mtg: "万智牌",
huanlekapai:'欢乐卡牌', huanlekapai: "欢乐卡牌",
}, },
play:{ play: {
boss:'诸神降临', boss: "诸神降临",
cardpile:'牌堆补充', cardpile: "牌堆补充",
wuxing:'五行生克', wuxing: "五行生克",
coin:'富甲天下', coin: "富甲天下",
}, },
mode:{ mode: {
identity:'身份', identity: "身份",
guozhan:'国战', guozhan: "国战",
versus:'对决', versus: "对决",
connect:'联机', connect: "联机",
boss:'挑战', boss: "挑战",
doudizhu:'斗地主', doudizhu: "斗地主",
single:'单挑', single: "单挑",
chess:'战棋', chess: "战棋",
tafang:'塔防', tafang: "塔防",
stone:'炉石', stone: "炉石",
brawl:'乱斗', brawl: "乱斗",
}, },
submode:{ submode: {
identity:{ identity: {
normal:'身份模式', normal: "身份模式",
zhong:'忠胆英杰', zhong: "忠胆英杰",
purple:'3v3v2', purple: "3v3v2",
}, },
guozhan:{ guozhan: {
normal:'国战模式', normal: "国战模式",
mingjiang:'明将国战' mingjiang: "明将国战",
}, },
versus:{ versus: {
four:'四人对抗', four: "四人对抗",
three:'统率三军', three: "统率三军",
two:'欢乐成双', two: "欢乐成双",
jiange:'守卫剑阁', jiange: "守卫剑阁",
siguo:'四国争霸', siguo: "四国争霸",
standard:'自由对决' standard: "自由对决",
}, },
chess:{ chess: {
combat:'战棋模式', combat: "战棋模式",
three:'战棋统率', three: "战棋统率",
leader:'战棋君主' leader: "战棋君主",
}, },
single:{ single: {
normal:'新1v1', normal: "新1v1",
}, },
}, },
background:{ background: {
ol_bg:'龙纹', ol_bg: "龙纹",
planetarian_bg:'星梦', planetarian_bg: "星梦",
heaven_bg:'红烧', heaven_bg: "红烧",
kyoani_bg:'京都', kyoani_bg: "京都",
key_bg:'键社', key_bg: "键社",
xiaowu_bg:'小无', xiaowu_bg: "小无",
noname_bg:'璀璨', noname_bg: "璀璨",
wuming_bg:'无名', wuming_bg: "无名",
zhulin_bg:'竹林', zhulin_bg: "竹林",
shengshi_bg:'盛世', shengshi_bg: "盛世",
taoyuan_bg:'桃园', taoyuan_bg: "桃园",
zhanhuo_bg:'战火', zhanhuo_bg: "战火",
huangtian_bg:'黄天', huangtian_bg: "黄天",
september_bg:'九月', september_bg: "九月",
yinxiang_bg:'印象', yinxiang_bg: "印象",
zhanyun_bg:'战云', zhanyun_bg: "战云",
beipan_bg:'背叛', beipan_bg: "背叛",
lanting_bg:'兰亭', lanting_bg: "兰亭",
lingju_bg:'灵雎', lingju_bg: "灵雎",
sanying_bg:'三英', sanying_bg: "三英",
wangshi_bg:'往事', wangshi_bg: "往事",
xiongxin_bg:'雄心', xiongxin_bg: "雄心",
xinsha_bg:'新杀', xinsha_bg: "新杀",
}, },
music:{ music: {
music_phliosophy:'Philosophy of ours', music_phliosophy: "Philosophy of ours",
music_diaochan:'貂蝉', music_diaochan: "貂蝉",
music_shezhan:'舌战群儒', music_shezhan: "舌战群儒",
music_danji:'千里走单骑', music_danji: "千里走单骑",
music_jifeng:'祭风', music_jifeng: "祭风",
music_jilve:'极略', music_jilve: "极略",
}, },
font:{ font: {
xiaozhuan:'方正小篆体', xiaozhuan: "方正小篆体",
xinwei:'华文新魏_GBK', xinwei: "华文新魏_GBK",
huangcao:'方正黄草_GBK', huangcao: "方正黄草_GBK",
yuanli:'方正北魏楷书_GBK', yuanli: "方正北魏楷书_GBK",
xingkai:'方正行楷_GBK', xingkai: "方正行楷_GBK",
shousha:'方正隶变_GBK', shousha: "方正隶变_GBK",
},
theme: {
woodden: "木纹",
music: "音乐",
simple: "简约",
}, },
theme:{
woodden:'木纹',
music:'音乐',
simple:'简约'
}
}; };

View File

@ -1,29 +1,29 @@
var fs = require('fs'); var fs = require('fs');
var webpage = require('webpage') var webpage = require('webpage')
var load = function(id){ var load = function(id){
var page = webpage.create(); var page = webpage.create();
page.settings.userAgent = 'NonameServer'; page.settings.userAgent = 'NonameServer';
page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) { page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) {
if(status !== 'success') { if(status !== 'success') {
console.log(fs.workingDirectory); console.log(fs.workingDirectory);
console.log('Unable to access network'); console.log('Unable to access network');
} }
setInterval(function(){ setInterval(function(){
if(page.evaluate(function(){ if(page.evaluate(function(){
if(!lib.node||!lib.node.clients||!lib.node.clients.length){ if(!lib.node||!lib.node.clients||!lib.node.clients.length){
return true; return true;
} }
else{ else{
return false; return false;
} }
})){ })){
page.close(); page.close();
load(id); load(id);
} }
},600000); },600000);
}); });
} }
load(1); load(1);
load(2); load(2);
load(3); load(3);

View File

@ -41646,4 +41646,4 @@ var pinyin_dict_withtone = "yī,dīng zhēng,kǎo qiǎo yú,qī,shàng,xià,hǎn
pinyinUtilx.dict = dict; pinyinUtilx.dict = dict;
window.pinyinUtilx = pinyinUtilx; window.pinyinUtilx = pinyinUtilx;
}); });

File diff suppressed because it is too large Load Diff

View File

@ -1,386 +1,402 @@
(function(){ (function () {
var WebSocketServer=require('ws').Server; var WebSocketServer = require("ws").Server;
var wss=new WebSocketServer({port:8080}); var wss = new WebSocketServer({ port: 8080 });
var bannedKeys=[]; var bannedKeys = [];
var bannedIps=[]; var bannedIps = [];
var rooms=[]; var rooms = [];
var events=[]; var events = [];
var clients={}; var clients = {};
var bannedKeyWords=[]; var bannedKeyWords = [];
var messages={ var messages = {
create:function(key,nickname,avatar,config,mode){ create: function (key, nickname, avatar, config, mode) {
if(this.onlineKey!=key) return; if (this.onlineKey != key) return;
this.nickname=util.getNickname(nickname); this.nickname = util.getNickname(nickname);
this.avatar=avatar; this.avatar = avatar;
var room={}; var room = {};
rooms.push(room); rooms.push(room);
this.room=room; this.room = room;
delete this.status; delete this.status;
room.owner=this; room.owner = this;
room.key=key; room.key = key;
this.sendl('createroom',key); this.sendl("createroom", key);
}, },
enter:function(key,nickname,avatar){ enter: function (key, nickname, avatar) {
this.nickname=util.getNickname(nickname); this.nickname = util.getNickname(nickname);
this.avatar=avatar; this.avatar = avatar;
var room=false; var room = false;
for(var i of rooms){ for (var i of rooms) {
if(i.key==key){ if (i.key == key) {
room=i; room = i;
break; break;
} }
} }
if(!room){ if (!room) {
this.sendl('enterroomfailed'); this.sendl("enterroomfailed");
return; return;
} }
this.room=room; this.room = room;
delete this.status; delete this.status;
if(room.owner){ if (room.owner) {
if(room.servermode&&!room.owner._onconfig&&config&&mode){ if (
room.owner.sendl('createroom',index,config,mode); room.servermode &&
room.owner._onconfig=this; !room.owner._onconfig &&
room.owner.nickname=util.getNickname(nickname); config &&
room.owner.avatar=avatar; mode
} ) {
else if(!room.config||(room.config.gameStarted&&(!room.config.observe||!room.config.observeReady))){ room.owner.sendl("createroom", index, config, mode);
this.sendl('enterroomfailed'); room.owner._onconfig = this;
} room.owner.nickname = util.getNickname(nickname);
else{ room.owner.avatar = avatar;
this.owner=room.owner; } else if (
this.owner.sendl('onconnection',this.wsid); !room.config ||
(room.config.gameStarted &&
(!room.config.observe || !room.config.observeReady))
) {
this.sendl("enterroomfailed");
} else {
this.owner = room.owner;
this.owner.sendl("onconnection", this.wsid);
} }
util.updaterooms(); util.updaterooms();
} }
}, },
changeAvatar:function(nickname,avatar){ changeAvatar: function (nickname, avatar) {
this.nickname=util.getNickname(nickname); this.nickname = util.getNickname(nickname);
this.avatar=avatar; this.avatar = avatar;
util.updateclients(); util.updateclients();
}, },
server:function(cfg){ server: function (cfg) {
if(cfg){ if (cfg) {
this.servermode=true; this.servermode = true;
var room=rooms[cfg[0]]; var room = rooms[cfg[0]];
if(!room||room.owner){ if (!room || room.owner) {
this.sendl('reloadroom',true); this.sendl("reloadroom", true);
} else {
room.owner = this;
this.room = room;
this.nickname = util.getNickname(cfg[1]);
this.avatar = cfg[2];
this.sendl("createroom", cfg[0], {}, "auto");
} }
else{ } else {
room.owner=this; for (var i = 0; i < rooms.length; i++) {
this.room=room; if (!rooms[i].owner) {
this.nickname=util.getNickname(cfg[1]); rooms[i].owner = this;
this.avatar=cfg[2]; rooms[i].servermode = true;
this.sendl('createroom',cfg[0],{},'auto') this.room = rooms[i];
} this.servermode = true;
}
else{
for(var i=0;i<rooms.length;i++){
if(!rooms[i].owner){
rooms[i].owner=this;
rooms[i].servermode=true;
this.room=rooms[i];
this.servermode=true;
break; break;
} }
} }
util.updaterooms(); util.updaterooms();
} }
}, },
key:function(id){ key: function (id) {
if(!id||typeof id!='object'){ if (!id || typeof id != "object") {
this.sendl('denied','key'); this.sendl("denied", "key");
this.close(); this.close();
clearTimeout(this.keyCheck); clearTimeout(this.keyCheck);
delete this.keyCheck; delete this.keyCheck;
return; return;
} } else if (bannedKeys.indexOf(id[0]) != -1) {
else if(bannedKeys.indexOf(id[0])!=-1){
bannedIps.push(this._socket.remoteAddress); bannedIps.push(this._socket.remoteAddress);
this.close(); this.close();
} }
this.onlineKey=id[0]; this.onlineKey = id[0];
clearTimeout(this.keyCheck); clearTimeout(this.keyCheck);
delete this.keyCheck; delete this.keyCheck;
}, },
events:function(cfg,id,type){ events: function (cfg, id, type) {
if(bannedKeys.indexOf(id)!=-1||typeof id!='string'||this.onlineKey!=id){ if (
bannedKeys.indexOf(id) != -1 ||
typeof id != "string" ||
this.onlineKey != id
) {
bannedIps.push(this._socket.remoteAddress); bannedIps.push(this._socket.remoteAddress);
console.log(id, this._socket.remoteAddress); console.log(id, this._socket.remoteAddress);
this.close(); this.close();
return; return;
} }
var changed=false; var changed = false;
var time=(new Date()).getTime(); var time = new Date().getTime();
if(cfg&&id){ if (cfg && id) {
if(typeof cfg=='string'){ if (typeof cfg == "string") {
for(var i=0;i<events.length;i++){ for (var i = 0; i < events.length; i++) {
if(events[i].id==cfg){ if (events[i].id == cfg) {
if(type=='join'){ if (type == "join") {
if(events[i].members.indexOf(id)==-1){ if (events[i].members.indexOf(id) == -1) {
events[i].members.push(id); events[i].members.push(id);
} }
changed=true; changed = true;
} } else if (type == "leave") {
else if(type=='leave'){ var index = events[i].members.indexOf(id);
var index=events[i].members.indexOf(id); if (index != -1) {
if(index!=-1){ events[i].members.splice(index, 1);
events[i].members.splice(index,1); if (events[i].members.length == 0) {
if(events[i].members.length==0){ events.splice(i--, 1);
events.splice(i--,1);
} }
} }
changed=true; changed = true;
} }
} }
} }
} } else if (
else if(cfg.hasOwnProperty('utc')&& cfg.hasOwnProperty("utc") &&
cfg.hasOwnProperty('day')&& cfg.hasOwnProperty("day") &&
cfg.hasOwnProperty('hour')&& cfg.hasOwnProperty("hour") &&
cfg.hasOwnProperty('content')){ cfg.hasOwnProperty("content")
if(events.length>=20){ ) {
this.sendl('eventsdenied','total'); if (events.length >= 20) {
} this.sendl("eventsdenied", "total");
else if(cfg.utc<=time){ } else if (cfg.utc <= time) {
this.sendl('eventsdenied','time'); this.sendl("eventsdenied", "time");
} } else if (util.isBanned(cfg.content)) {
else if(util.isBanned(cfg.content)){ this.sendl("eventsdenied", "ban");
this.sendl('eventsdenied','ban'); } else {
} cfg.nickname = util.getNickname(cfg.nickname);
else{ cfg.avatar = cfg.nickname || "caocao";
cfg.nickname=util.getNickname(cfg.nickname); cfg.creator = id;
cfg.avatar=cfg.nickname||'caocao'; cfg.id = util.getid();
cfg.creator=id; cfg.members = [id];
cfg.id=util.getid();
cfg.members=[id];
events.unshift(cfg); events.unshift(cfg);
changed=true; changed = true;
} }
} }
} }
if(changed){ if (changed) {
util.updateevents(); util.updateevents();
} }
}, },
config:function(config){ config: function (config) {
var room=this.room; var room = this.room;
if(room&&room.owner==this){ if (room && room.owner == this) {
if(room.servermode){ if (room.servermode) {
room.servermode=false; room.servermode = false;
if(this._onconfig){ if (this._onconfig) {
if(clients[this._onconfig.wsid]){ if (clients[this._onconfig.wsid]) {
this._onconfig.owner=this; this._onconfig.owner = this;
this.sendl('onconnection',this._onconfig.wsid); this.sendl("onconnection", this._onconfig.wsid);
} }
delete this._onconfig; delete this._onconfig;
} }
} }
room.config=config; room.config = config;
} }
util.updaterooms(); util.updaterooms();
}, },
status:function(str){ status: function (str) {
if(typeof str=='string'){ if (typeof str == "string") {
this.status=str; this.status = str;
} } else {
else{
delete this.status; delete this.status;
} }
util.updateclients(); util.updateclients();
}, },
send:function(id,message){ send: function (id, message) {
if(clients[id]&&clients[id].owner==this){ if (clients[id] && clients[id].owner == this) {
try{ try {
clients[id].send(message); clients[id].send(message);
} } catch (e) {
catch(e){
clients[id].close(); clients[id].close();
} }
} }
}, },
close:function(id){ close: function (id) {
if(clients[id]&&clients[id].owner==this){ if (clients[id] && clients[id].owner == this) {
clients[id].close(); clients[id].close();
} }
}, },
}; };
var util={ var util = {
getNickname:function(str){ getNickname: function (str) {
return typeof str=='string'?(str.slice(0,12)):'无名玩家'; return typeof str == "string" ? str.slice(0, 12) : "无名玩家";
}, },
isBanned:function(str){ isBanned: function (str) {
for(var i of bannedKeyWords){ for (var i of bannedKeyWords) {
if(str.indexOf(i)!=-1) return true; if (str.indexOf(i) != -1) return true;
} }
return false; return false;
}, },
sendl:function(){ sendl: function () {
var args=[]; var args = [];
for(var i=0;i<arguments.length;i++){ for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]); args.push(arguments[i]);
} }
try{ try {
this.send(JSON.stringify(args)); this.send(JSON.stringify(args));
} } catch (e) {
catch(e){
this.close(); this.close();
} }
}, },
getid:function(){ getid: function () {
return (Math.floor(1000000000+9000000000*Math.random())).toString(); return Math.floor(
1000000000 + 9000000000 * Math.random()
).toString();
}, },
getroomlist:function(){ getroomlist: function () {
var roomlist=[]; var roomlist = [];
for(var i=0;i<rooms.length;i++){ for (var i = 0; i < rooms.length; i++) {
rooms[i]._num=0; rooms[i]._num = 0;
} }
for(var i in clients){ for (var i in clients) {
if(clients[i].room&&!clients[i].servermode){ if (clients[i].room && !clients[i].servermode) {
clients[i].room._num++; clients[i].room._num++;
} }
} }
for(var i=0;i<rooms.length;i++){ for (var i = 0; i < rooms.length; i++) {
if(rooms[i].servermode){ if (rooms[i].servermode) {
roomlist[i]='server'; roomlist[i] = "server";
} } else if (rooms[i].owner && rooms[i].config) {
else if(rooms[i].owner&&rooms[i].config){ if (rooms[i]._num == 0) {
if(rooms[i]._num==0){ rooms[i].owner.sendl("reloadroom");
rooms[i].owner.sendl('reloadroom');
} }
roomlist.push([rooms[i].owner.nickname,rooms[i].owner.avatar, roomlist.push([
rooms[i].config,rooms[i]._num,rooms[i].key]); rooms[i].owner.nickname,
rooms[i].owner.avatar,
rooms[i].config,
rooms[i]._num,
rooms[i].key,
]);
} }
delete rooms[i]._num; delete rooms[i]._num;
} }
return roomlist; return roomlist;
}, },
getclientlist:function(){ getclientlist: function () {
var clientlist=[]; var clientlist = [];
for(var i in clients){ for (var i in clients) {
clientlist.push([clients[i].nickname,clients[i].avatar,!clients[i].room,clients[i].status,clients[i].wsid,clients[i].onlineKey]); clientlist.push([
clients[i].nickname,
clients[i].avatar,
!clients[i].room,
clients[i].status,
clients[i].wsid,
clients[i].onlineKey,
]);
} }
return clientlist; return clientlist;
}, },
updaterooms:function(){ updaterooms: function () {
var roomlist=util.getroomlist(); var roomlist = util.getroomlist();
var clientlist=util.getclientlist(); var clientlist = util.getclientlist();
for(var i in clients){ for (var i in clients) {
if(!clients[i].room){ if (!clients[i].room) {
clients[i].sendl('updaterooms',roomlist,clientlist); clients[i].sendl("updaterooms", roomlist, clientlist);
} }
} }
}, },
updateclients:function(){ updateclients: function () {
var clientlist=util.getclientlist(); var clientlist = util.getclientlist();
for(var i in clients){ for (var i in clients) {
if(!clients[i].room){ if (!clients[i].room) {
clients[i].sendl('updateclients',clientlist); clients[i].sendl("updateclients", clientlist);
} }
} }
}, },
checkevents:function(){ checkevents: function () {
if(events.length){ if (events.length) {
var time=(new Date()).getTime(); var time = new Date().getTime();
for(var i=0;i<events.length;i++){ for (var i = 0; i < events.length; i++) {
if(events[i].utc<=time){ if (events[i].utc <= time) {
events.splice(i--,1); events.splice(i--, 1);
} }
} }
} }
return events; return events;
}, },
updateevents:function(){ updateevents: function () {
util.checkevents(); util.checkevents();
for(var i in clients){ for (var i in clients) {
if(!clients[i].room){ if (!clients[i].room) {
clients[i].sendl('updateevents',events); clients[i].sendl("updateevents", events);
} }
} }
} },
}; };
wss.on('connection',function(ws){ wss.on("connection", function (ws) {
ws.sendl=util.sendl; ws.sendl = util.sendl;
if(bannedIps.indexOf(ws._socket.remoteAddress)!=-1){ if (bannedIps.indexOf(ws._socket.remoteAddress) != -1) {
ws.sendl('denied','banned'); ws.sendl("denied", "banned");
setTimeout(function(){ setTimeout(function () {
ws.close(); ws.close();
},500); }, 500);
return; return;
} }
ws.keyCheck=setTimeout(function(){ ws.keyCheck = setTimeout(function () {
ws.sendl('denied','key'); ws.sendl("denied", "key");
setTimeout(function(){ setTimeout(function () {
ws.close(); ws.close();
},500); }, 500);
},2000); }, 2000);
ws.wsid=util.getid(); ws.wsid = util.getid();
clients[ws.wsid]=ws; clients[ws.wsid] = ws;
ws.sendl('roomlist',util.getroomlist(),util.checkevents(),util.getclientlist(ws),ws.wsid); ws.sendl(
ws.heartbeat=setInterval(function(){ "roomlist",
if(ws.beat){ util.getroomlist(),
util.checkevents(),
util.getclientlist(ws),
ws.wsid
);
ws.heartbeat = setInterval(function () {
if (ws.beat) {
ws.close(); ws.close();
clearInterval(ws.heartbeat); clearInterval(ws.heartbeat);
} } else {
else{ ws.beat = true;
ws.beat=true; try {
try{ ws.send("heartbeat");
ws.send('heartbeat'); } catch (e) {
}
catch(e){
ws.close(); ws.close();
} }
} }
},60000); }, 60000);
ws.on('message',function(message){ ws.on("message", function (message) {
if(!clients[this.wsid]) return; if (!clients[this.wsid]) return;
if(message=='heartbeat'){ if (message == "heartbeat") {
this.beat=false; this.beat = false;
} } else if (this.owner) {
else if(this.owner){ this.owner.sendl("onmessage", this.wsid, message);
this.owner.sendl('onmessage',this.wsid,message); } else {
}
else{
var arr; var arr;
try{ try {
arr=JSON.parse(message); arr = JSON.parse(message);
if(!Array.isArray(arr)){ if (!Array.isArray(arr)) {
throw('err'); throw "err";
} }
} } catch (e) {
catch(e){ this.sendl("denied", "banned");
this.sendl('denied','banned');
return; return;
} }
if(arr.shift()=='server'){ if (arr.shift() == "server") {
var type=arr.shift(); var type = arr.shift();
if(messages[type]){ if (messages[type]) {
messages[type].apply(this,arr); messages[type].apply(this, arr);
} }
} }
} }
}); });
ws.on('close',function(){ ws.on("close", function () {
for(var i=0;i<rooms.length;i++){ for (var i = 0; i < rooms.length; i++) {
if(rooms[i].owner==this){ if (rooms[i].owner == this) {
for(var j in clients){ for (var j in clients) {
if(clients[j].room==rooms[i]&&clients[j]!=this){ if (clients[j].room == rooms[i] && clients[j] != this) {
clients[j].sendl('selfclose'); clients[j].sendl("selfclose");
// clients[j].close(); // clients[j].close();
// delete clients[j]; // delete clients[j];
} }
} }
rooms.splice(i--,1); rooms.splice(i--, 1);
} }
} }
if(clients[this.wsid]){ if (clients[this.wsid]) {
if(this.owner){ if (this.owner) {
this.owner.sendl('onclose',this.wsid); this.owner.sendl("onclose", this.wsid);
} }
delete clients[this.wsid]; delete clients[this.wsid];
} }
if(this.room) util.updaterooms(); if (this.room) util.updaterooms();
else util.updateclients(); else util.updateclients();
}); });
}); });
}()); })();

View File

@ -1,305 +1,305 @@
window.noname_source_list=[ window.noname_source_list = [
'LICENSE', "LICENSE",
'noname.js', "noname.js",
'service-worker.js', "service-worker.js",
'noname/ai/basic.js', "noname/ai/basic.js",
'noname/ai/index.js', "noname/ai/index.js",
'noname/game/index.js', "noname/game/index.js",
'noname/game/promises.js', "noname/game/promises.js",
'noname/game/dynamic-style/index.js', "noname/game/dynamic-style/index.js",
'noname/get/index.js', "noname/get/index.js",
'noname/get/is.js', "noname/get/is.js",
'noname/gnc/index.js', "noname/gnc/index.js",
'noname/gnc/is.js', "noname/gnc/is.js",
'noname/init/cordova.js', "noname/init/cordova.js",
'noname/init/import.js', "noname/init/import.js",
'noname/init/index.js', "noname/init/index.js",
'noname/init/node.js', "noname/init/node.js",
'noname/init/onload.js', "noname/init/onload.js",
'noname/init/polyfill.js', "noname/init/polyfill.js",
'noname/library/index.js', "noname/library/index.js",
'noname/library/path.js', "noname/library/path.js",
'noname/library/update-urls.js', "noname/library/update-urls.js",
'noname/library/announce/index.d.ts', "noname/library/announce/index.d.ts",
'noname/library/announce/index.js', "noname/library/announce/index.js",
'noname/library/cache/cacheContext.js', "noname/library/cache/cacheContext.js",
'noname/library/cache/childNodesWatcher.js', "noname/library/cache/childNodesWatcher.js",
'noname/library/channel/index.js', "noname/library/channel/index.js",
'noname/library/crypt/md5.js', "noname/library/crypt/md5.js",
'noname/library/element/button.js', "noname/library/element/button.js",
'noname/library/element/card.js', "noname/library/element/card.js",
'noname/library/element/client.js', "noname/library/element/client.js",
'noname/library/element/content.js', "noname/library/element/content.js",
'noname/library/element/contents.js', "noname/library/element/contents.js",
'noname/library/element/control.js', "noname/library/element/control.js",
'noname/library/element/dialog.js', "noname/library/element/dialog.js",
'noname/library/element/gameEvent.js', "noname/library/element/gameEvent.js",
'noname/library/element/gameEventPromise.js', "noname/library/element/gameEventPromise.js",
'noname/library/element/index.js', "noname/library/element/index.js",
'noname/library/element/nodeWS.js', "noname/library/element/nodeWS.js",
'noname/library/element/player.js', "noname/library/element/player.js",
'noname/library/element/vcard.js', "noname/library/element/vcard.js",
'noname/library/experimental/index.js', "noname/library/experimental/index.js",
'noname/library/experimental/symbol.js', "noname/library/experimental/symbol.js",
'noname/library/init/index.js', "noname/library/init/index.js",
'noname/library/init/promises.js', "noname/library/init/promises.js",
'noname/status/index.js', "noname/status/index.js",
'noname/ui/index.js', "noname/ui/index.js",
'noname/ui/click/index.js', "noname/ui/click/index.js",
'noname/ui/create/index.js', "noname/ui/create/index.js",
'noname/ui/create/menu/index.js', "noname/ui/create/menu/index.js",
'noname/ui/create/menu/pages/cardPackMenu.js', "noname/ui/create/menu/pages/cardPackMenu.js",
'noname/ui/create/menu/pages/characterPackMenu.js', "noname/ui/create/menu/pages/characterPackMenu.js",
'noname/ui/create/menu/pages/exetensionMenu.js', "noname/ui/create/menu/pages/exetensionMenu.js",
'noname/ui/create/menu/pages/optionsMenu.js', "noname/ui/create/menu/pages/optionsMenu.js",
'noname/ui/create/menu/pages/otherMenu.js', "noname/ui/create/menu/pages/otherMenu.js",
'noname/ui/create/menu/pages/startMenu.js', "noname/ui/create/menu/pages/startMenu.js",
'noname/util/browser.js', "noname/util/browser.js",
'noname/util/config.js', "noname/util/config.js",
'noname/util/index.js', "noname/util/index.js",
'noname/util/mutex.js', "noname/util/mutex.js",
'noname/util/struct/index.js', "noname/util/struct/index.js",
'noname/util/struct/interface/index.d.ts', "noname/util/struct/interface/index.d.ts",
'noname/util/struct/interface/promise-error-handler.d.ts', "noname/util/struct/interface/promise-error-handler.d.ts",
'noname/util/struct/promise-error-handler/chrome.js', "noname/util/struct/promise-error-handler/chrome.js",
'noname/util/struct/promise-error-handler/firefox.js', "noname/util/struct/promise-error-handler/firefox.js",
'noname/util/struct/promise-error-handler/index.js', "noname/util/struct/promise-error-handler/index.js",
'noname/util/struct/promise-error-handler/unknown.js', "noname/util/struct/promise-error-handler/unknown.js",
'card/extra.js', "card/extra.js",
'card/gujian.js', "card/gujian.js",
'card/guozhan.js', "card/guozhan.js",
'card/gwent.js', "card/gwent.js",
'card/hearth.js', "card/hearth.js",
'card/huanlekapai.js', "card/huanlekapai.js",
'card/mtg.js', "card/mtg.js",
'card/sp.js', "card/sp.js",
'card/standard.js', "card/standard.js",
'card/swd.js', "card/swd.js",
'card/yingbian.js', "card/yingbian.js",
'card/yongjian.js', "card/yongjian.js",
'card/yunchou.js', "card/yunchou.js",
'card/zhenfa.js', "card/zhenfa.js",
'card/zhulu.js', "card/zhulu.js",
'character/clan.js', "character/clan.js",
'character/collab.js', "character/collab.js",
'character/ddd.js', "character/ddd.js",
'character/diy.js', "character/diy.js",
'character/extra.js', "character/extra.js",
'character/gujian.js', "character/gujian.js",
'character/gwent.js', "character/gwent.js",
'character/hearth.js', "character/hearth.js",
'character/huicui.js', "character/huicui.js",
'character/jiange.js', "character/jiange.js",
'character/jsrg.js', "character/jsrg.js",
'character/mobile.js', "character/mobile.js",
'character/mtg.js', "character/mtg.js",
'character/offline.js', "character/offline.js",
'character/old.js', "character/old.js",
'character/onlyOL.js', "character/onlyOL.js",
'character/ow.js', "character/ow.js",
'character/rank.js', "character/rank.js",
'character/refresh.js', "character/refresh.js",
'character/sb.js', "character/sb.js",
'character/shenhua.js', "character/shenhua.js",
'character/shiji.js', "character/shiji.js",
'character/sp.js', "character/sp.js",
'character/sp2.js', "character/sp2.js",
'character/standard.js', "character/standard.js",
'character/swd.js', "character/swd.js",
'character/tw.js', "character/tw.js",
'character/xiake.js', "character/xiake.js",
'character/xianding.js', "character/xianding.js",
'character/xianjian.js', "character/xianjian.js",
'character/xinghuoliaoyuan.js', "character/xinghuoliaoyuan.js",
'character/yijiang.js', "character/yijiang.js",
'character/yingbian.js', "character/yingbian.js",
'character/yxs.js', "character/yxs.js",
'character/zhuogui.js', "character/zhuogui.js",
'font/motoyamaru.woff2', "font/motoyamaru.woff2",
'font/suits.woff2', "font/suits.woff2",
'game/asset.js', "game/asset.js",
'game/codemirror.js', "game/codemirror.js",
'game/compiler-sfc.browser.js', "game/compiler-sfc.browser.js",
'game/config.js', "game/config.js",
'game/core-js-bundle.js', "game/core-js-bundle.js",
'game/directory.js', "game/directory.js",
'game/entry.js', "game/entry.js",
'game/game.js', "game/game.js",
'game/http.js', "game/http.js",
'game/jszip.js', "game/jszip.js",
'game/keyWords.js', "game/keyWords.js",
'game/NoSleep.js', "game/NoSleep.js",
'game/package.js', "game/package.js",
'game/phantom.js', "game/phantom.js",
'game/pinyinjs.js', "game/pinyinjs.js",
'game/pressure.js', "game/pressure.js",
'game/server.js', "game/server.js",
'game/source.js', "game/source.js",
'game/update.js', "game/update.js",
'game/vue.esm-browser.js', "game/vue.esm-browser.js",
'image/card/cardtempname_bg.png', "image/card/cardtempname_bg.png",
'image/flappybird/BG.png', "image/flappybird/BG.png",
'image/flappybird/botpipe.png', "image/flappybird/botpipe.png",
'image/flappybird/gameclear.png', "image/flappybird/gameclear.png",
'image/flappybird/gameover.png', "image/flappybird/gameover.png",
'image/flappybird/getready.png', "image/flappybird/getready.png",
'image/flappybird/ground.png', "image/flappybird/ground.png",
'image/flappybird/toppipe.png', "image/flappybird/toppipe.png",
'image/flappybird/bird/b0.png', "image/flappybird/bird/b0.png",
'image/flappybird/bird/b1.png', "image/flappybird/bird/b1.png",
'image/flappybird/bird/b2.png', "image/flappybird/bird/b2.png",
'image/flappybird/ground/g0.png', "image/flappybird/ground/g0.png",
'image/flappybird/ground/g1.png', "image/flappybird/ground/g1.png",
'image/flappybird/tap/t0.png', "image/flappybird/tap/t0.png",
'image/flappybird/tap/t1.png', "image/flappybird/tap/t1.png",
'layout/default/codemirror.css', "layout/default/codemirror.css",
'layout/default/layout.css', "layout/default/layout.css",
'layout/default/menu.css', "layout/default/menu.css",
'layout/default/phone.css', "layout/default/phone.css",
'layout/long/layout.css', "layout/long/layout.css",
'layout/long2/layout.css', "layout/long2/layout.css",
'layout/mobile/equip.css', "layout/mobile/equip.css",
'layout/mobile/layout.css', "layout/mobile/layout.css",
'layout/mode/boss.css', "layout/mode/boss.css",
'layout/mode/chess.css', "layout/mode/chess.css",
'layout/mode/stone.css', "layout/mode/stone.css",
'layout/mode/tafang.css', "layout/mode/tafang.css",
'layout/newlayout/equip.css', "layout/newlayout/equip.css",
'layout/newlayout/global.css', "layout/newlayout/global.css",
'layout/newlayout/layout.css', "layout/newlayout/layout.css",
'layout/nova/layout.css', "layout/nova/layout.css",
'mode/boss.js', "mode/boss.js",
'mode/chess.js', "mode/chess.js",
'mode/doudizhu.js', "mode/doudizhu.js",
'mode/guozhan.js', "mode/guozhan.js",
'mode/identity.js', "mode/identity.js",
'mode/tafang.js', "mode/tafang.js",
'mode/single.js', "mode/single.js",
'mode/stone.js', "mode/stone.js",
'mode/brawl.js', "mode/brawl.js",
'mode/versus.js', "mode/versus.js",
'mode/connect.js', "mode/connect.js",
'extension/boss/extension.js', "extension/boss/extension.js",
'extension/cardpile/extension.js', "extension/cardpile/extension.js",
'extension/coin/extension.js', "extension/coin/extension.js",
'extension/wuxing/extension.js', "extension/wuxing/extension.js",
'theme/music/grid.png', "theme/music/grid.png",
'theme/music/style.css', "theme/music/style.css",
'theme/music/wood.png', "theme/music/wood.png",
'theme/music/wood3.png', "theme/music/wood3.png",
'theme/simple/card.png', "theme/simple/card.png",
'theme/simple/grid.png', "theme/simple/grid.png",
'theme/simple/style.css', "theme/simple/style.css",
'theme/simple/unknown.png', "theme/simple/unknown.png",
'theme/simple/wood.png', "theme/simple/wood.png",
'theme/simple/wood3.png', "theme/simple/wood3.png",
'theme/woodden/grid.png', "theme/woodden/grid.png",
'theme/woodden/style.css', "theme/woodden/style.css",
'theme/woodden/wood.jpg', "theme/woodden/wood.jpg",
'theme/woodden/wood.png', "theme/woodden/wood.png",
'theme/woodden/wood2.jpg', "theme/woodden/wood2.jpg",
'theme/woodden/wood2.png', "theme/woodden/wood2.png",
'theme/style/card/custom.css', "theme/style/card/custom.css",
'theme/style/card/default.css', "theme/style/card/default.css",
'theme/style/card/music.css', "theme/style/card/music.css",
'theme/style/card/simple.css', "theme/style/card/simple.css",
'theme/style/card/wood.css', "theme/style/card/wood.css",
'theme/style/card/new.css', "theme/style/card/new.css",
'theme/style/card/ol.css', "theme/style/card/ol.css",
'theme/style/card/image/new.png', "theme/style/card/image/new.png",
'theme/style/card/image/ol.png', "theme/style/card/image/ol.png",
'theme/style/cardback/custom.css', "theme/style/cardback/custom.css",
'theme/style/cardback/default.css', "theme/style/cardback/default.css",
'theme/style/cardback/feicheng.css', "theme/style/cardback/feicheng.css",
'theme/style/cardback/liusha.css', "theme/style/cardback/liusha.css",
'theme/style/cardback/music.css', "theme/style/cardback/music.css",
'theme/style/cardback/new.css', "theme/style/cardback/new.css",
'theme/style/cardback/ol.css', "theme/style/cardback/ol.css",
'theme/style/cardback/official.css', "theme/style/cardback/official.css",
'theme/style/cardback/wood.css', "theme/style/cardback/wood.css",
'theme/style/cardback/image/feicheng.png', "theme/style/cardback/image/feicheng.png",
'theme/style/cardback/image/feicheng2.png', "theme/style/cardback/image/feicheng2.png",
'theme/style/cardback/image/liusha.png', "theme/style/cardback/image/liusha.png",
'theme/style/cardback/image/liusha2.png', "theme/style/cardback/image/liusha2.png",
'theme/style/cardback/image/new.png', "theme/style/cardback/image/new.png",
'theme/style/cardback/image/new2.png', "theme/style/cardback/image/new2.png",
'theme/style/cardback/image/official.png', "theme/style/cardback/image/official.png",
'theme/style/cardback/image/official2.png', "theme/style/cardback/image/official2.png",
'theme/style/cardback/image/ol.png', "theme/style/cardback/image/ol.png",
'theme/style/cardback/image/ol2.png', "theme/style/cardback/image/ol2.png",
'theme/style/hp/custom.css', "theme/style/hp/custom.css",
'theme/style/hp/default.css', "theme/style/hp/default.css",
'theme/style/hp/emotion.css', "theme/style/hp/emotion.css",
'theme/style/hp/glass.css', "theme/style/hp/glass.css",
'theme/style/hp/official.css', "theme/style/hp/official.css",
'theme/style/hp/ol.css', "theme/style/hp/ol.css",
'theme/style/hp/round.css', "theme/style/hp/round.css",
'theme/style/hp/xinglass.css', "theme/style/hp/xinglass.css",
'theme/style/hp/xinround.css', "theme/style/hp/xinround.css",
'theme/style/hp/image/emotion1.png', "theme/style/hp/image/emotion1.png",
'theme/style/hp/image/emotion2.png', "theme/style/hp/image/emotion2.png",
'theme/style/hp/image/emotion3.png', "theme/style/hp/image/emotion3.png",
'theme/style/hp/image/emotion4.png', "theme/style/hp/image/emotion4.png",
'theme/style/hp/image/glass1.png', "theme/style/hp/image/glass1.png",
'theme/style/hp/image/glass2.png', "theme/style/hp/image/glass2.png",
'theme/style/hp/image/glass3.png', "theme/style/hp/image/glass3.png",
'theme/style/hp/image/glass4.png', "theme/style/hp/image/glass4.png",
'theme/style/hp/image/official1.png', "theme/style/hp/image/official1.png",
'theme/style/hp/image/official2.png', "theme/style/hp/image/official2.png",
'theme/style/hp/image/official3.png', "theme/style/hp/image/official3.png",
'theme/style/hp/image/official4.png', "theme/style/hp/image/official4.png",
'theme/style/hp/image/ol1.png', "theme/style/hp/image/ol1.png",
'theme/style/hp/image/ol2.png', "theme/style/hp/image/ol2.png",
'theme/style/hp/image/ol3.png', "theme/style/hp/image/ol3.png",
'theme/style/hp/image/ol4.png', "theme/style/hp/image/ol4.png",
'theme/style/hp/image/round1.png', "theme/style/hp/image/round1.png",
'theme/style/hp/image/round2.png', "theme/style/hp/image/round2.png",
'theme/style/hp/image/round3.png', "theme/style/hp/image/round3.png",
'theme/style/hp/image/round4.png', "theme/style/hp/image/round4.png",
'theme/style/hp/image/shield.png', "theme/style/hp/image/shield.png",
'theme/style/hp/image/xinglass1.png', "theme/style/hp/image/xinglass1.png",
'theme/style/hp/image/xinglass2.png', "theme/style/hp/image/xinglass2.png",
'theme/style/hp/image/xinglass3.png', "theme/style/hp/image/xinglass3.png",
'theme/style/hp/image/xinglass4.png', "theme/style/hp/image/xinglass4.png",
'theme/style/hp/image/xinround1.png', "theme/style/hp/image/xinround1.png",
'theme/style/hp/image/xinround2.png', "theme/style/hp/image/xinround2.png",
'theme/style/hp/image/xinround3.png', "theme/style/hp/image/xinround3.png",
'theme/style/hp/image/xinround4.png', "theme/style/hp/image/xinround4.png",
'node_modules/options/.npmignore', "node_modules/options/.npmignore",
'node_modules/options/lib/options.js', "node_modules/options/lib/options.js",
'node_modules/options/package.json', "node_modules/options/package.json",
'node_modules/ultron/.npmignore', "node_modules/ultron/.npmignore",
'node_modules/ultron/.travis.yml', "node_modules/ultron/.travis.yml",
'node_modules/ultron/index.js', "node_modules/ultron/index.js",
'node_modules/ultron/package.json', "node_modules/ultron/package.json",
'node_modules/ultron/test.js', "node_modules/ultron/test.js",
'node_modules/ws/.npmignore', "node_modules/ws/.npmignore",
'node_modules/ws/.travis.yml', "node_modules/ws/.travis.yml",
'node_modules/ws/index.js', "node_modules/ws/index.js",
'node_modules/ws/lib/BufferPool.js', "node_modules/ws/lib/BufferPool.js",
'node_modules/ws/lib/BufferUtil.fallback.js', "node_modules/ws/lib/BufferUtil.fallback.js",
'node_modules/ws/lib/BufferUtil.js', "node_modules/ws/lib/BufferUtil.js",
'node_modules/ws/lib/ErrorCodes.js', "node_modules/ws/lib/ErrorCodes.js",
'node_modules/ws/lib/Extensions.js', "node_modules/ws/lib/Extensions.js",
'node_modules/ws/lib/PerMessageDeflate.js', "node_modules/ws/lib/PerMessageDeflate.js",
'node_modules/ws/lib/Receiver.hixie.js', "node_modules/ws/lib/Receiver.hixie.js",
'node_modules/ws/lib/Receiver.js', "node_modules/ws/lib/Receiver.js",
'node_modules/ws/lib/Sender.hixie.js', "node_modules/ws/lib/Sender.hixie.js",
'node_modules/ws/lib/Sender.js', "node_modules/ws/lib/Sender.js",
'node_modules/ws/lib/Validation.fallback.js', "node_modules/ws/lib/Validation.fallback.js",
'node_modules/ws/lib/Validation.js', "node_modules/ws/lib/Validation.js",
'node_modules/ws/lib/WebSocket.js', "node_modules/ws/lib/WebSocket.js",
'node_modules/ws/lib/WebSocketServer.js', "node_modules/ws/lib/WebSocketServer.js",
'node_modules/ws/package.json' "node_modules/ws/package.json",
]; ];

View File

@ -1,63 +1,63 @@
window.noname_update={ window.noname_update = {
version:'1.10.10', version: "1.10.10",
update:'1.10.9', update: "1.10.9",
changeLog:[ changeLog: [
'整合@kuangshen04 @mengxinzxz @lieren2023 @nonameShijian @PZ157 @XboxSoldier @universe-st @copcap 的Pull Request', "整合@kuangshen04 @mengxinzxz @lieren2023 @nonameShijian @PZ157 @XboxSoldier @universe-st @copcap 的Pull Request",
'OL界程普、界虞翻', "OL界程普、界虞翻",
'手杀杨奉、谋夏侯惇、谋高顺', "手杀杨奉、谋夏侯惇、谋高顺",
'引入Vue框架和新的换肤机制', "引入Vue框架和新的换肤机制",
'其他AI优化与bug修复', "其他AI优化与bug修复",
], ],
files:[ files: [
'service-worker.js', "service-worker.js",
'card/mtg.js', "card/mtg.js",
'card/standard.js', "card/standard.js",
'character/diy.js', "character/diy.js",
'character/extra.js', "character/extra.js",
'character/gwent.js', "character/gwent.js",
'character/huicui.js', "character/huicui.js",
'character/mobile.js', "character/mobile.js",
'character/offline.js', "character/offline.js",
'character/onlyOL.js', "character/onlyOL.js",
'character/ow.js', "character/ow.js",
'character/rank.js', "character/rank.js",
'character/refresh.js', "character/refresh.js",
'character/sb.js', "character/sb.js",
'character/shenhua.js', "character/shenhua.js",
'character/shiji.js', "character/shiji.js",
'character/sp.js', "character/sp.js",
'character/sp2.js', "character/sp2.js",
'character/standard.js', "character/standard.js",
'character/swd.js', "character/swd.js",
'character/tw.js', "character/tw.js",
'character/xianding.js', "character/xianding.js",
'character/xinghuoliaoyuan.js', "character/xinghuoliaoyuan.js",
'character/yijiang.js', "character/yijiang.js",
'character/yingbian.js', "character/yingbian.js",
'character/yxs.js', "character/yxs.js",
'game/compiler-sfc.browser.js', "game/compiler-sfc.browser.js",
'game/game.js', "game/game.js",
'game/pinyinjs.js', "game/pinyinjs.js",
'game/vue.esm-browser.js', "game/vue.esm-browser.js",
'layout/default/layout.css', "layout/default/layout.css",
'mode/boss.js', "mode/boss.js",
'mode/versus.js', "mode/versus.js",
'noname/game/index.js', "noname/game/index.js",
'noname/get/index.js', "noname/get/index.js",
'noname/get/is.js', "noname/get/is.js",
'noname/library/index.js', "noname/library/index.js",
'noname/library/element/content.js', "noname/library/element/content.js",
'noname/library/element/player.js', "noname/library/element/player.js",
'noname/library/init/index.js', "noname/library/init/index.js",
] ],
}; };