diff --git a/config.js b/config.js index 6ba2338..93f2dba 100644 --- a/config.js +++ b/config.js @@ -155,7 +155,7 @@ module.exports = { // 49 and 50: its link to a colour picker. // 61: the Owner, Moderator and Verified name tag badges seen by everyone. // 62: "Custom pictures" in the settings menu, to hide players' item pictures. - buildVersion: env.AJ_BUILD_VERSION || "74", + buildVersion: env.AJ_BUILD_VERSION || "75", // what the official CDN is asked for; not ours to change. upstreamBuildVersion: "3", diff --git a/lib/http.js b/lib/http.js index a354678..7e9ab4f 100644 --- a/lib/http.js +++ b/lib/http.js @@ -432,6 +432,7 @@ const CAPTCHA_PAGE_HEADERS = {...PAGE_HEADERS, "Content-Security-Policy": captch // write, from config.js. const LEGAL_VALUES = {legalEmail: config.legalEmail, adminEmail: config.adminEmail, operator: config.operator, hostedIn: config.hostedIn, version: config.termsVersion, site: new URL(config.siteUrl).host}; +const MAX_RULES_LENGTH = 65536; // characters of data/rules.txt the game is sent const escapeHtml = text => String(text).replace(/[&<>"]/g, sign => ({"&": "&", "<": "<", ">": ">", "\"": """})[sign]); const sendLegalPage = async (res, file) => { for (const [name, value] of Object.entries(PAGE_HEADERS)) { @@ -1071,6 +1072,27 @@ const handle = async (req, res) => { case "GET /crossdomain.xml": send(res, 200, CROSS_DOMAIN, "text/xml"); return; + // the game's rules window (AJClient.showRules) shows this file, read + // again on every ask so it can be changed on a running server; made + // with a placeholder when there is none. + case "GET /rules.txt": { + const file = path.join(config.dataDir, "rules.txt"); + let text; + try { + text = await fs.promises.readFile(file, "utf8"); + } + catch (err) { + if (err.code !== "ENOENT") { + throw err; + } + text = "Example\n"; + await fs.promises.writeFile(file, text, {flag: "wx"}).catch(() => {}); + } + res.setHeader("Cache-Control", "no-cache"); + res.setHeader("X-Content-Type-Options", "nosniff"); + send(res, 200, text.slice(0, MAX_RULES_LENGTH), "text/plain; charset=utf-8"); + return; + } case "GET /gameClient/game/index.html": // not to be put in a frame of anyone's; the client shows it in a view of its own. res.setHeader("X-Frame-Options", "DENY"); diff --git a/swf-src/AJClient.as b/swf-src/AJClient.as index 667f5c2..0f46995 100644 --- a/swf-src/AJClient.as +++ b/swf-src/AJClient.as @@ -2298,8 +2298,55 @@ package drawChatFilter(); } - // the server's rules, word for word as the owner gave them - private static const RULES_HTML:String = "[1] Be Respectful / Have Common Sense
This is quite self explanatory. Be kind, treat people how you would want to be treated. If someone is uncomfortable with something you are saying and or doing, please respect that of them and do not argue against it, even if it may seem ridiculous in your eyes.

[2] No Direct Harassment / Bullying
If you are being disrespectful towards another person, Moderators have every right to punish you. Please don't be an asshole. Thank you.

[3] Keep Personal Information for Yourself.
As friendly that people may seem on this platform, never share personal identifying details with ANYONE. This leads to a lot of unsafe situations. Please be safe and responsible with the information you give to other people.

[4] Keep Drama OUT
If you have personal issues with another person, it is not our responsibility unless said person is confirmed to be problematic towards something against the rules of our server. Please do not bring arguments into our public chat, you will be muted until things clear up. Keep it in DMS.

[5] No NSFW!
NSFW and Suggestive Content are entirely banned from the server, period. We do not want to be a place that allows predatory behavior to fester. If you are unsure of what specific details this goes under, feel free to ask in a ticket.

[8] Report Any Issues
Issues can be anything from harassment, a person you are uncomfortable with, bugs, etc. Moderators are always happy to help!

Burrow gives players more freedom than the original game, including free chat. If you do not want to see certain content you may utilise the client side chat filter and block players, which has an option to completely hide them on your side.

These options are found in the in-game settings or player cards.

burrow.moe/terms"; + // the rules come from the server's data/rules.txt (GET /rules.txt), read + // each time the window opens, so they change without a new client: a + // line starting "# " is a heading, the rest is shown as it is written. + private static const RULES_HEADING:String = ""; + + private static const RULES_BODY:String = ""; + + private static function rulesHtml(param1:String) : String + { + var _loc2_:Array = param1.replace(/\r/g,"").split("\n"); + var _loc3_:Array = []; + var _loc4_:String = null; + var _loc5_:int = 0; + while(_loc5_ < _loc2_.length) + { + _loc4_ = String(_loc2_[_loc5_]).replace(/&/g,"&").replace(//g,">"); + if(_loc4_.indexOf("# ") == 0) + { + _loc3_.push(RULES_HEADING + _loc4_.substr(2) + ""); + } + else + { + _loc3_.push(RULES_BODY + _loc4_ + ""); + } + _loc5_++; + } + return _loc3_.join("
"); + } + + private function loadRules() : void + { + var _loc1_:URLLoader = new URLLoader(); + _rulesText.htmlText = rulesHtml("Loading..."); + _loc1_.addEventListener("complete",onRulesLoaded); + _loc1_.addEventListener("ioError",onRulesFailed); + _loc1_.addEventListener("securityError",onRulesFailed); + _loc1_.load(new URLRequest(gMainFrame.clientInfo.websiteURL + "rules.txt?t=" + new Date().getTime())); + } + + private function onRulesLoaded(param1:Event) : void + { + _rulesText.htmlText = rulesHtml(String(URLLoader(param1.currentTarget).data)); + _rulesText.scrollV = 1; + } + + private function onRulesFailed(param1:Event) : void + { + _rulesText.htmlText = rulesHtml("The rules could not be loaded. Try again in a moment."); + } private var _rulesWin:Sprite; @@ -2347,7 +2394,6 @@ package _rulesText.y = -158; _rulesText.width = 462; _rulesText.height = 338; - _rulesText.htmlText = RULES_HTML; _loc5_ = GETDEFINITIONBYNAME("arrow_r_btnContOld"); _loc5_.rotation = -90; _loc5_.x = 236; @@ -2379,6 +2425,7 @@ package _rulesWin.visible = param1; if(param1) { + loadRules(); _rulesText.scrollV = 1; setChildIndex(_rulesWin,numChildren - 1); } diff --git a/swf/ajclient.swf b/swf/ajclient.swf index 14f9577..04d0857 100644 Binary files a/swf/ajclient.swf and b/swf/ajclient.swf differ