From 2d4ddecde9c4ee46f5e04e6d3b9c6bd9016b4471 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 18:59:09 +0100 Subject: async loading --- webAO/client.js | 105 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 36 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index ec12c13..eba1483 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -74,6 +74,9 @@ class Client extends EventEmitter { this.playerID = 1; this.charID = -1; + this.char_list_length = 0; + this.evidence_list_length = 0; + this.music_list_length = 0; this.testimonyID = 0; this.chars = []; @@ -536,6 +539,34 @@ class Client extends EventEmitter { }, false); } + /** + * Handles the incoming character information, and downloads the sprite + ini for it + * @param {Array} args packet arguments + */ + async handleCharacterInfo(chargs, charid) { + let cini = {}; + try { + const cinidata = await request(AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char.ini"); + cini = INI.parse(cinidata.toLowerCase()); + } catch(err) { + cini = {options: {name: chargs[0].toLowerCase(),showname: chargs[0].toLowerCase(),side: "def", gender: "male"}}; + } + console.log(cini); + this.chars[charid] = { + name: chargs[0], + showname: cini.options.showname, + desc: chargs[1], + gender: cini.options.gender, + evidence: chargs[3], + icon: AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png", + inifile: cini + }; + // need to take care of src alt onclick and onerror when the char comes in + let img = document.getElementById(`demo_${charid}`); + img.src = AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png"; + img.alt = chargs[0]; + } + /** * Handles incoming character information, bundling multiple characters * per packet. @@ -543,35 +574,27 @@ class Client extends EventEmitter { */ handleCI(args) { document.getElementById("client_loadingtext").innerHTML = "Loading Character " + args[1]; - this.serv.send("AN#" + ((args[1] / 10) + 1) + "#%"); for (let i = 2; i < args.length - 1; i++) { if (i % 2 === 0) { + document.getElementById("client_loadingtext").innerHTML = `Loading Character ${i}/${this.char_list_length}`; const chargs = args[i].split("&"); - this.chars[args[i - 1]] = { - name: chargs[0], - desc: chargs[1], - evidence: chargs[3], - icon: AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png" - }; + this.handleCharacterInfo(chargs, i-1); } } + this.serv.send("AN#" + ((args[1] / 10) + 1) + "#%"); } /** - * Handles incoming character information, containing only one character - * per packet. + * Handles incoming character information, containing all characters + * in one packet. * @param {Array} args packet arguments */ handleSC(args) { document.getElementById("client_loadingtext").innerHTML = "Loading Characters"; for (let i = 1; i < args.length - 1; i++) { + document.getElementById("client_loadingtext").innerHTML = `Loading Character ${i}/${this.char_list_length}`; const chargs = args[i].split("&"); - this.chars[i - 1] = { - name: chargs[0], - desc: chargs[1], - evidence: chargs[3], - icon: AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png" - }; + this.handleCharacterInfo(chargs, i-1); } this.serv.send("RM#%"); } @@ -584,7 +607,7 @@ class Client extends EventEmitter { * @param {Array} args packet arguments */ handleEI(args) { - document.getElementById("client_loadingtext").innerHTML = "Loading Evidence " + args[1]; + document.getElementById("client_loadingtext").innerHTML = `Loading Evidence ${args[1]}/${this.evidence_list_length}`; //serv.send("AE#" + (args[1] + 1) + "#%"); this.serv.send("RM#%"); } @@ -832,7 +855,28 @@ class Client extends EventEmitter { * but we use it as a cue to begin retrieving characters. * @param {Array} args packet arguments */ - handleSI(_args) { + handleSI(args) { + this.char_list_length = args[1]; + this.evidence_list_length = args[2]; + this.music_list_length = args[3]; + + // create the charselect grid, to be filled by the character loader + document.getElementById("client_chartable").innerHTML = ""; + let tr; + for (let i = 0; i < this.char_list_length; i++) { + if (i % CHAR_SELECT_WIDTH === 0) { + tr = document.createElement("TR"); + } + const td = document.createElement("TD"); + + td.innerHTML = ``; + + tr.appendChild(td); + if (i % CHAR_SELECT_WIDTH === 0) { + document.getElementById("client_chartable").appendChild(tr); + } + } + if (oldLoading) { this.serv.send("askchar2#%"); } else { @@ -845,26 +889,15 @@ class Client extends EventEmitter { * @param {Array} args packet arguments */ handleCharsCheck(args) { - document.getElementById("client_chartable").innerHTML = ""; - let tr; - for (let i = 0; i < this.chars.length; i++) { - if (i % CHAR_SELECT_WIDTH === 0) { - tr = document.createElement("TR"); - } - const td = document.createElement("TD"); - let icon_chosen = ""; - const thispick = this.chars[i].icon; + for (let i = 0; i < this.char_list_length; i++) { + let icon_chosen = "demothing"; if (args[i + 1] === "-1") { - icon_chosen = " dark"; - } - td.innerHTML = `${this.chars[i].name}`; - tr.appendChild(td); - if (i % CHAR_SELECT_WIDTH === 0) { - document.getElementById("client_chartable").appendChild(tr); + icon_chosen += " dark"; } + let img = document.getElementById(`demo_${i}`); + img.classList = icon_chosen; } + //changeBackground("def"); } @@ -883,8 +916,8 @@ class Client extends EventEmitter { const emotesList = document.getElementById("client_emo"); emotesList.innerHTML = ""; // Clear emote box emotesList.style.display = ""; - - const data = await request(AO_HOST + "characters/" + escape(this.character.name.toLowerCase()) + "/char.ini"); + console.log(me.inifile); + const data = await request(AO_HOST + "characters/" + escape(me.name.toLowerCase()) + "/char.ini"); const ini = INI.parse(data.toLowerCase()); me.side = ini.options.side; updateActionCommands(me.side); -- cgit From 564928dfbbe62ed47af39b44b9c060fea3b12064 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 18:59:53 +0100 Subject: out with demoerror so it shows the alt name instead --- webAO/client.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index eba1483..d02527d 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -869,7 +869,7 @@ class Client extends EventEmitter { } const td = document.createElement("TD"); - td.innerHTML = ``; + td.innerHTML = ``; tr.appendChild(td); if (i % CHAR_SELECT_WIDTH === 0) { @@ -1542,17 +1542,6 @@ export function imgError(image) { } window.imgError = imgError; -/** - * Triggered when there was an error loading a character icon. - * @param {HTMLImageElement} image the element containing the missing image - */ -export function demoError(image) { - image.onerror = ""; - image.src = "misc/placeholder.png"; - return true; -} -window.demoError = demoError; - /** * Make a GET request for a specific URI. * @param {string} url the URI to be requested -- cgit From e93ebd4a735e1c19d8040d42c99585df310e7358 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 19:53:33 +0100 Subject: make blips work ((and break showname)) --- webAO/client.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index d02527d..8c1ba6b 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -466,13 +466,14 @@ class Client extends EventEmitter { document.getElementById("client_inner_chat").innerHTML = ""; const chatmsg = { preanim: escape(args[2]), // get preanim - nameplate: args[3], // TODO: parse INI to get this info + nameplate: this.chars[args[9]].showname, name: args[3], speaking: "(b)" + escape(args[4]), silent: "(a)" + escape(args[4]), content: this.prepChat(args[5]), // Escape HTML tag, Use BBCode Only! side: args[6], sound: escape(args[7]), + blips: this.chars[args[9]].gender, type: args[8], charid: args[9], snddelay: args[10], @@ -549,7 +550,7 @@ class Client extends EventEmitter { const cinidata = await request(AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char.ini"); cini = INI.parse(cinidata.toLowerCase()); } catch(err) { - cini = {options: {name: chargs[0].toLowerCase(),showname: chargs[0].toLowerCase(),side: "def", gender: "male"}}; + cini = {options: {name: chargs[0].toLowerCase(),showname: chargs[0],side: "def", gender: "male"}}; } console.log(cini); this.chars[charid] = { @@ -967,7 +968,6 @@ class Viewport { // Allocate multiple blip audio channels to make blips less jittery - // TODO: read blip type ("gender") from ini this.blipChannels = new Array(6); this.blipChannels.fill(new Audio(AO_HOST + "sounds/general/sfx-blipmale.wav")) .forEach(channel => channel.volume = 0.5); @@ -1024,6 +1024,7 @@ class Viewport { this.chatmsg = chatmsg; appendICLog(chatmsg.content, chatmsg.nameplate); changeBackground(chatmsg.side); + this.blipChannels.forEach(channel => channel.src = AO_HOST + `sounds/general/sfx-blip${chatmsg.blips}.wav`); this.textnow = ""; this.sfxplayed = 0; this.textTimer = 0; -- cgit From 863a532d7602352df93fa52ddd62cc3534dc9690 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 19:58:46 +0100 Subject: speeeeeeed --- webAO/client.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 8c1ba6b..0865f68 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -917,9 +917,7 @@ class Client extends EventEmitter { const emotesList = document.getElementById("client_emo"); emotesList.innerHTML = ""; // Clear emote box emotesList.style.display = ""; - console.log(me.inifile); - const data = await request(AO_HOST + "characters/" + escape(me.name.toLowerCase()) + "/char.ini"); - const ini = INI.parse(data.toLowerCase()); + const ini = me.cini; me.side = ini.options.side; updateActionCommands(me.side); for (let i = 1; i <= ini.emotions.number; i++) { -- cgit From 71fc9efce9c1afb09353bdf05161bc986cf49622 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 20:01:49 +0100 Subject: some defaults for fucked inis --- webAO/client.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 0865f68..9a663f2 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -550,8 +550,17 @@ class Client extends EventEmitter { const cinidata = await request(AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char.ini"); cini = INI.parse(cinidata.toLowerCase()); } catch(err) { - cini = {options: {name: chargs[0].toLowerCase(),showname: chargs[0],side: "def", gender: "male"}}; + cini = {}; } + if (cini.options.name === undefined) + cini.options.name = chargs[0].toLowerCase(); + if (cini.options.showname === undefined) + cini.options.showname = chargs[0]; + if (cini.options.side === undefined) + cini.options.side = "def"; + if (cini.options.gender === undefined) + cini.options.gender = "male"; + console.log(cini); this.chars[charid] = { name: chargs[0], -- cgit From 14f409a31c0da8076b9d555617e70e22418ebb22 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 20:20:20 +0100 Subject: wrong variable name --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 9a663f2..1f71d57 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -926,7 +926,7 @@ class Client extends EventEmitter { const emotesList = document.getElementById("client_emo"); emotesList.innerHTML = ""; // Clear emote box emotesList.style.display = ""; - const ini = me.cini; + const ini = me.inifile; me.side = ini.options.side; updateActionCommands(me.side); for (let i = 1; i <= ini.emotions.number; i++) { -- cgit From fa8de7b9e26100d2d9baed236a10d29e9355e52f Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 20:43:48 +0100 Subject: pimp my lowerCase --- webAO/client.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 1f71d57..15f51e3 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -465,14 +465,14 @@ class Client extends EventEmitter { if (args[4] !== viewport.chatmsg.content) { document.getElementById("client_inner_chat").innerHTML = ""; const chatmsg = { - preanim: escape(args[2]), // get preanim + preanim: escape(args[2]).toLowerCase(), // get preanim nameplate: this.chars[args[9]].showname, - name: args[3], - speaking: "(b)" + escape(args[4]), - silent: "(a)" + escape(args[4]), + name: args[3].toLowerCase(), + speaking: "(b)" + escape(args[4]).toLowerCase(), + silent: "(a)" + escape(args[4]).toLowerCase(), content: this.prepChat(args[5]), // Escape HTML tag, Use BBCode Only! - side: args[6], - sound: escape(args[7]), + side: args[6].toLowerCase(), + sound: escape(args[7]).toLowerCase(), blips: this.chars[args[9]].gender, type: args[8], charid: args[9], @@ -548,7 +548,7 @@ class Client extends EventEmitter { let cini = {}; try { const cinidata = await request(AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char.ini"); - cini = INI.parse(cinidata.toLowerCase()); + cini = INI.parse(cinidata); } catch(err) { cini = {}; } @@ -563,10 +563,10 @@ class Client extends EventEmitter { console.log(cini); this.chars[charid] = { - name: chargs[0], + name: chargs[0].toLowerCase(), showname: cini.options.showname, desc: chargs[1], - gender: cini.options.gender, + gender: cini.options.gender.toLowerCase(), evidence: chargs[3], icon: AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png", inifile: cini @@ -1039,7 +1039,7 @@ class Viewport { clearTimeout(this.updater); // If preanim existed then determine the length if (chatmsg.preanim !== "-") { - const delay = await this.getAnimLength(`${AO_HOST}characters/${escape(chatmsg.name.toLowerCase())}/${chatmsg.preanim.toLowerCase()}.gif`); + const delay = await this.getAnimLength(`${AO_HOST}characters/${escape(chatmsg.name)}/${chatmsg.preanim}.gif`); chatmsg.preanimdelay = delay; this.initUpdater(delay); } else { @@ -1356,14 +1356,18 @@ class INI { } else if (regex.param.test(line)) { const match = line.match(regex.param); if (section) { - value[section][match[1]] = match[2]; - } else { - value[match[1]] = match[2]; + if(match[1].toLowerCase() === "showname"){ //don't lowercase the showname + value[section][match[1].toLowerCase()] = match[2]; + } else { + value[section][match[1].toLowerCase()] = match[2].toLowerCase(); + } + //} else { // we don't care about attributes without a section + // value[match[1]] = match[2]; } } else if (regex.section.test(line)) { const match = line.match(regex.section); - value[match[1]] = {}; - section = match[1]; + value[match[1].toLowerCase()] = {}; //lowercase everything else + section = match[1].toLowerCase(); } }); return value; -- cgit From a87c23afc6cced094922b2087233da6c202ae3f5 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 20:45:50 +0100 Subject: remove double charicon url --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 15f51e3..d8ad42b 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -573,7 +573,7 @@ class Client extends EventEmitter { }; // need to take care of src alt onclick and onerror when the char comes in let img = document.getElementById(`demo_${charid}`); - img.src = AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png"; + img.src = this.chars[charid].icon; img.alt = chargs[0]; } -- cgit From ff947c36cc35169826a78da6ed47456edf109ec4 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 20:56:48 +0100 Subject: more fallbacks for ini files --- webAO/client.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index d8ad42b..7549e2d 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -552,6 +552,8 @@ class Client extends EventEmitter { } catch(err) { cini = {}; } + if (cini.options === undefined) + cini.options = {} if (cini.options.name === undefined) cini.options.name = chargs[0].toLowerCase(); if (cini.options.showname === undefined) -- cgit From 861e032f972d7d939aed558ffdf4edd1598d5b88 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 21:22:30 +0100 Subject: chars without inis are displayed upside down chars with inis just alt --- webAO/client.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 7549e2d..7c01d42 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -546,14 +546,22 @@ class Client extends EventEmitter { */ async handleCharacterInfo(chargs, charid) { let cini = {}; + let icon = AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png"; + let img = document.getElementById(`demo_${charid}`); + img.alt = chargs[0]; + img.src = icon; // seems like a good time to load the icon + try { const cinidata = await request(AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char.ini"); cini = INI.parse(cinidata); } catch(err) { cini = {}; + img.classList.add("noini"); } + + // fix all the funny ini business if (cini.options === undefined) - cini.options = {} + cini.options = {}; if (cini.options.name === undefined) cini.options.name = chargs[0].toLowerCase(); if (cini.options.showname === undefined) @@ -570,13 +578,11 @@ class Client extends EventEmitter { desc: chargs[1], gender: cini.options.gender.toLowerCase(), evidence: chargs[3], - icon: AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char_icon.png", + icon: icon, inifile: cini }; - // need to take care of src alt onclick and onerror when the char comes in - let img = document.getElementById(`demo_${charid}`); - img.src = this.chars[charid].icon; - img.alt = chargs[0]; + + } /** @@ -902,11 +908,15 @@ class Client extends EventEmitter { */ handleCharsCheck(args) { for (let i = 0; i < this.char_list_length; i++) { + let img = document.getElementById(`demo_${i}`); let icon_chosen = "demothing"; - if (args[i + 1] === "-1") { + console.log(img.classList); + if (img.classList.contains("noini")) + icon_chosen += " noini"; + + if (args[i + 1] === "-1") icon_chosen += " dark"; - } - let img = document.getElementById(`demo_${i}`); + img.classList = icon_chosen; } -- cgit From a264b00a6222754ae57d5030828741ccdf8dc4a7 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 21:34:00 +0100 Subject: get rid of my debug logging --- webAO/client.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 7c01d42..dd4c777 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -571,7 +571,6 @@ class Client extends EventEmitter { if (cini.options.gender === undefined) cini.options.gender = "male"; - console.log(cini); this.chars[charid] = { name: chargs[0].toLowerCase(), showname: cini.options.showname, @@ -910,7 +909,7 @@ class Client extends EventEmitter { for (let i = 0; i < this.char_list_length; i++) { let img = document.getElementById(`demo_${i}`); let icon_chosen = "demothing"; - console.log(img.classList); + if (img.classList.contains("noini")) icon_chosen += " noini"; @@ -1101,7 +1100,6 @@ class Viewport { async getAnimLength(filename) { try { const file = await requestBuffer(filename); - console.log(filename); return this.calculateGifLength(file); } catch (err) { return 0; @@ -1713,7 +1711,6 @@ async function changeBackground(position) { export function ReconnectButton() { client.cleanup(); client = new Client(serverIP); - console.log(client); if (client) { mode = "join"; // HACK: see client.onOpen document.getElementById("client_error").style.display = "none"; -- cgit From 087091275b7bd8c6154272f20506138dc4424da5 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 21:38:06 +0100 Subject: music loading info --- webAO/client.js | 1 + 1 file changed, 1 insertion(+) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index dd4c777..12d89a9 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -669,6 +669,7 @@ class Client extends EventEmitter { const hmusiclist = document.getElementById("client_musiclist"); for (let i = 2; i < args.length - 1; i++) { if (i % 2 === 0) { + document.getElementById("client_loadingtext").innerHTML = `Loading Music ${i}/${this.music_list_length}`; const newentry = document.createElement("OPTION"); newentry.text = args[i]; hmusiclist.options.add(newentry); -- cgit From a538e2359a86a1f20a66841a9da7b976cf9ebb67 Mon Sep 17 00:00:00 2001 From: sD Date: Wed, 18 Dec 2019 21:38:41 +0100 Subject: loading music info --- webAO/client.js | 1 + 1 file changed, 1 insertion(+) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 12d89a9..9f6039e 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -689,6 +689,7 @@ class Client extends EventEmitter { for (let i = 1; i < args.length - 1; i++) { // Check when found the song for the first time + document.getElementById("client_loadingtext").innerHTML = `Loading Music ${i}/${this.music_list_length}`; if (/\.(?:wav|mp3|mp4|ogg|opus)$/i.test(args[i]) && !flagAudio) { flagAudio = true; } -- cgit From 9fc6fa6e2308c74394698645b652fbf579b02b88 Mon Sep 17 00:00:00 2001 From: sD Date: Thu, 19 Dec 2019 16:05:18 +0100 Subject: assign looks neat --- webAO/client.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 9f6039e..d1b8cb9 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -560,16 +560,13 @@ class Client extends EventEmitter { } // fix all the funny ini business - if (cini.options === undefined) - cini.options = {}; - if (cini.options.name === undefined) - cini.options.name = chargs[0].toLowerCase(); - if (cini.options.showname === undefined) - cini.options.showname = chargs[0]; - if (cini.options.side === undefined) - cini.options.side = "def"; - if (cini.options.gender === undefined) - cini.options.gender = "male"; + const default_options = { + name: chargs[0].toLowerCase(), + showname: chargs[0], + side: "def", + gender: "male" + }; + cini.options = Object.assign(default_options, cini.options); this.chars[charid] = { name: chargs[0].toLowerCase(), -- cgit