{ // Use IntelliSense to learn about possible Node.js debug attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceRoot}/server/index.js", "cwd": "${workspaceRoot}/server/" } ] } src/cca/platforms/android/** src/node_modules/** src/.sass-cache/** src/cca/www/** src/cca/config.xml src/cordova/platforms/** src/cordova/node_modules/** src/cordova/plugins/** src/cordova/www/** src/cordova/config.xml src/www/tmp/** build/** server/node_modules/** server/settings.json server/bans.json server/logs/** # IntelliJ IDEA files *.iml .idea *.sw[mnpcod] *.log *.tmp *.tmp.* # Compiled source # ################### *.com @@ -21,7 +34,7 @@ server/logs/** *.apk *.ap_ *.es2015.js *.es2015.js.map *.map # files for the dex VM *.dex exports.beat = function() { io.on('connection', function(socket) { // users.push(new User(socket)); new User(socket); }); }; @@ -56,16 +55,24 @@ class Room { } leave(user) { this.emit('leave', { guid: user.guid }); let userIndex = this.users.indexOf(user); if (userIndex == -1) return; this.users.splice(userIndex, 1); checkRoomEmpty(this); // HACK try { this.emit('leave', { guid: user.guid }); let userIndex = this.users.indexOf(user); if (userIndex == -1) return; this.users.splice(userIndex, 1); checkRoomEmpty(this); } catch(e) { log.info.log('warn', 'roomLeave', { e: e, thisCtx: this }); } } updateUser(user) { @@ -138,7 +145,7 @@ let userCommands = { "pawn": "passthrough", "bees": "passthrough", "color": function(color) { if (typeof color == "undefined") { if (typeof color != "undefined") { if (settings.bonziColors.indexOf(color) == -1) return; @@ -162,6 +169,12 @@ let userCommands = { target: sanitize(Utils.argsString(arguments)) }); }, "owo": function() { this.room.emit("owo", { guid: this.guid, target: sanitize(Utils.argsString(arguments)) }); }, "triggered": "passthrough", "vaporwave": function() { this.socket.emit("vaporwave"); @@ -254,6 +267,8 @@ class User { } login(data) { if (this.private.login) return; log.info.log('info', 'login', { guid: this.guid, }); @@ -339,6 +354,7 @@ class User { this.room.join(this); this.private.login = true; this.socket.removeAllListeners("login"); // Send all user info this.socket.emit('updateAll', { @@ -412,7 +428,6 @@ class User { } disconnect() { let ip = "N/A"; let port = "N/A"; @@ -456,7 +471,11 @@ class User { roomsPublic.splice(publicIndex, 1); } } } this.socket.removeAllListeners('talk'); this.socket.removeAllListeners('command'); this.socket.removeAllListeners('disconnect'); } catch(e) { log.info.log('warn', "exception", { guid: this.guid, 2 server/package.json @@ -1,6 +1,6 @@ { "name": "bonziworld_server", "version": "2.0", "version": "2.0.1", "description": "Server for the BonziWORLD chat client.", "main": "index.js", "author": "Joseph Judge", 133 server/rooms.js.old This file was deleted. 9 server/settings.example.json @@ -7,7 +7,6 @@ "runlevel": { "godmode": 0, "youtube": 0, "sanitize": 3, "joke": 0, "fact": 0, "backflip": 0, @@ -22,6 +21,8 @@ "vaporwave": 0, "unvaporwave": 0, "name": 0, "owo": 0, "sanitize": 3, "pope": 3 }, "room_max": 8, @@ -45,7 +46,6 @@ "runlevel": { "godmode": 0, "youtube": 0, "sanitize": 3, "joke": 0, "fact": 0, "backflip": 0, @@ -60,6 +60,8 @@ "vaporwave": 0, "unvaporwave": 0, "name": 0, "owo": 0, "sanitize": 3, "pope": 3 }, "room_max": 30, @@ -102,7 +104,8 @@ "green", "red", "black", "brown" "brown", "pink" ], "banLength": 1440, "port": 3000, BonziWORLD Leading the industry in gorilla-based chat clients. Joseph Judge "name": "com.jojudge.bonziworld", "displayName": "BonziWORLD", "version": "1.0.0", "description": "Meme machine, mobile edition", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Joseph Judge", "license": "MIT", "dependencies": { "cordova-android": "6.3.0", "cordova-plugin-whitelist": "^1.3.2" }, "cordova": { "plugins": { "cordova-plugin-whitelist": {} }, "platforms": [ "android" ] } } var isMobileApp = true; var isApp = true; var isDesktop = false; var setStatusBar; $(function() { setStatusBar = setInterval(function() { try { StatusBar.backgroundColorByHexString("#280071"); clearInterval(setStatusBar); } catch (e) {} }, 500); $("#readme").attr("target", "_self"); $.ajax({ url: "http://bonziworld.com", // BonziWORLD, huh? Let's check it out. timeout: 7777, // GRAND GET! type: "GET", // AJAX?!?! cache: false // GRAND GET }).fail(function() { // GRAND GET?!?! $("#page_error").show(); // WHAT THE SHIT "GRAND GET" }); // OHHHH $(".app_showcase").append( '' + 'Open on PC for the best experience.' + '' ); }); "grunt-babel": "^6.0.0", "grunt-build-number": "~1.0.0", "grunt-contrib-clean": "~1.0.0", "grunt-contrib-compress": "~1.3.0", "grunt-contrib-copy": "~1.0.0", "grunt-contrib-htmlmin": "~1.4.0", "grunt-contrib-imagemin": "~1.0.0", @@ -5,6 +5,7 @@ $bonzi_height: 160px; width: 100%; height: 100%; position: absolute; pointer-events: none; top: 0; left: 0; } @@ -67,7 +68,7 @@ $bonzi_height: 160px; top: 40px; &::after { background-image: url('/img/bonzi/bubble_tail_l.png'); background-image: url('../img/bonzi/bubble_tail_l.png'); width: 22px; height: 14px; @@ -81,7 +82,7 @@ $bonzi_height: 160px; left: $bonzi_width - 45px; &::after { background-image: url('/img/bonzi/bubble_tail_r.png'); background-image: url('../img/bonzi/bubble_tail_r.png'); width: 22px; height: 14px; @@ -94,7 +95,7 @@ $bonzi_height: 160px; top: $bonzi_height - 4px; &::after { background-image: url('/img/bonzi/bubble_tail_b.png'); background-image: url('../img/bonzi/bubble_tail_b.png'); width: 28px; height: 22px; @@ -107,18 +108,14 @@ $bonzi_height: 160px; bottom: 4px; &::after { background-image: url('/img/bonzi/bubble_tail_t.png'); background-image: url('../img/bonzi/bubble_tail_t.png'); width: 28px; height: 22px; left: 110px; } } .bubble_autowidth { width: auto !important; } .bonzi_name { border-style: solid; border-width: 4px 12px 4px 0; 27 src/www/css/desktop.scss @@ -22,12 +22,28 @@ z-index: 999; } #chat_tray { background-image: url("../img/desktop/notif_left.png"), url("../img/desktop/notif.png"); background-repeat: no-repeat; background-position: left; background-size: 5px 30px, 100% 100%; vertical-align: middle; padding-left: 7px; padding-top: 3px; width: 22px; } .chat_bar_top { top: 0; } #chat_send { width: 100px; user-select: none; background-image: url("../img/desktop/start.png"); background-size: 100%; background-repeat: no-repeat; @@ -69,4 +85,15 @@ right: 0; user-select: text; -webkit-user-select: text; } .tray_btn { width: 16px; height: 16px; display: inline-block; margin: 2px 0px; } #btn_tile { background-image: url("../img/desktop/tile.png"); } 24 src/www/css/desktop.vaporwave.scss @@ -22,6 +22,30 @@ body.vaporwave { z-index: 999; } #chat_tray { background-image: url("../img/desktop.vaporwave/notif_left.png"), url("../img/desktop.vaporwave/notif_right.png"), url("../img/desktop.vaporwave/notif.png"); background-repeat: no-repeat; background-position: left, right, left; background-size: 5px 28px, 3px 28px, 100% 100%; vertical-align: middle; padding-left: 7px; padding-top: 3px; width: 22px; } #btn_tile { background-image: url("../img/desktop.vaporwave/tile.png"); } #chat_send { width: 58px; background-image: url("../img/desktop.vaporwave/start.png"); BIN -5.6 KB src/www/img/app/chrome.png Binary file not shown. BIN +103 Bytes src/www/img/desktop.vaporwave/notif.png Binary file not shown. BIN +106 Bytes src/www/img/desktop.vaporwave/notif_left.png Binary file not shown. BIN +97 Bytes src/www/img/desktop.vaporwave/notif_right.png Binary file not shown. BIN +271 Bytes src/www/img/desktop.vaporwave/tile.png Binary file not shown. BIN +641 Bytes src/www/img/desktop/tile.png Binary file not shown. 11 src/www/index.html @@ -18,8 +18,7 @@ @@ -37,18 +36,22 @@
Room ID - ???
This room is public. This room is private.
You are the owner of this room.
send
106 src/www/js/bonzi.es2015 @@ -52,15 +52,11 @@ class Bonzi { // ======================================================================== this.selContainer = "#content"; this.$container = $(this.selContainer); var bonziSpot = BonziHandler.oneCanvas ? "
" : ""; this.$container.append(`
${bonziSpot}
@@ -72,17 +68,10 @@ class Bonzi { this.selDialogCont = this.selElement + " > .bubble > p"; this.selNametag = this.selElement + " > .bonzi_name"; if (BonziHandler.oneCanvas) { this.selCanvas = this.selElement + " > .bonzi_placeholder"; $(this.selCanvas) .width(this.data.size.x) .height(this.data.size.y); } else { this.selCanvas = this.selElement + " > canvas"; $(this.selCanvas) .attr("width", this.data.size.x) .attr("height", this.data.size.y); } this.selCanvas = this.selElement + " > .bonzi_placeholder"; $(this.selCanvas) .width(this.data.size.x) .height(this.data.size.y); this.$element = $(this.selElement); this.$canvas = $(this.selCanvas); @@ -94,12 +83,6 @@ class Bonzi { $.data(this.$element[0], "parent", this); // ======================================================================== // CREATEJS INIT // ======================================================================== if (!BonziHandler.oneCanvas) { this.stage = new createjs.Stage(this.$canvas[0]); } this.updateSprite(true); // ======================================================================== @@ -158,6 +141,14 @@ class Bonzi { list: ["asshole", this.userPublic.name] }); } }, "owo": { name: "Notice Bulge", callback: () => { socket.emit("command", { list: ["owo", this.userPublic.name] }); } } } }; }, @@ -230,12 +221,9 @@ class Bonzi { "marginTop": this.y }); if (BonziHandler.oneCanvas) { this.sprite.x = this.x; this.sprite.y = this.y; BonziHandler.needsUpdate = true; } this.sprite.x = this.x; this.sprite.y = this.y; BonziHandler.needsUpdate = true; this.updateDialog(); } @@ -278,12 +266,12 @@ class Bonzi { this.willCancel = true; } updateAnim() { if (this.event.timer === 0) this.sprite.gotoAndPlay(this.event.cur().anim); this.event.timer++; (BonziHandler.oneCanvas ? BonziHandler : this) .needsUpdate = true; BonziHandler.needsUpdate = true; if (this.event.timer >= this.event.cur().ticks) this.eventNext(); } @@ -327,8 +315,7 @@ class Bonzi { if (this.sprite.currentAnimation == "idle") this.eventNext(); (BonziHandler.oneCanvas ? BonziHandler : this) .needsUpdate = true; BonziHandler.needsUpdate = true; } } @@ -428,19 +415,16 @@ class Bonzi { deconstruct() { this.stopSpeaking(); BonziHandler.stage.removeChild(this.sprite); this.run = false; this.$element.remove(); if (BonziHandler.oneCanvas) BonziHandler.stage.removeChild(this.sprite); else delete this.stage; } updateName() { this.$nametag.text(this.userPublic.name); } youtube(vid) { if (!this.mute) { var tag = isChromeApp ? "webview" : "iframe"; var tag = "iframe"; this.$dialogCont .html(` <${tag} type="text/html" width="173" height="173" @@ -477,23 +461,6 @@ class Bonzi { this.runSingleEvent(event); } updateSprite(hide) { var stage = BonziHandler.oneCanvas ? BonziHandler.stage : this.stage; this.cancel(); stage.removeChild(this.sprite); if (this.colorPrev != this.color) { delete this.sprite; this.sprite = new createjs.Sprite( BonziHandler.spriteSheets[this.color], hide ? "gone" : "idle" ); } this.sprite.x = 0; this.sprite.y = 0; stage.addChild(this.sprite); this.move(); } updateDialog() { // ======================================================================== // DIALOG BOX @@ -555,4 +522,33 @@ class Bonzi { }] ); } owo(target) { this.runSingleEvent( [{ type: "text", text: `*notices ${target}'s BonziBulge™*`, say: `notices ${target}s bonzibulge` }, { type: "text", text: "owo, wat dis?", say: "oh woah, what diss?" }] ); } updateSprite(hide) { var stage = BonziHandler.stage; this.cancel(); stage.removeChild(this.sprite); if (this.colorPrev != this.color) { delete this.sprite; this.sprite = new createjs.Sprite( BonziHandler.spriteSheets[this.color], hide ? "gone" : "idle" ); } stage.addChild(this.sprite); this.move(); } } 158 src/www/js/bonziHandler.js @@ -1,25 +1,11 @@ var espeak = new Espeak('./js/lib/espeak/espeak.worker.js'); var auCtx = new (window.AudioContext || window.webkitAudioContext)(); // http://stackoverflow.com/a/22953053/2605226 function webgl_support() { try{ var canvas = document.createElement('canvas'); return !! window.WebGLRenderingContext && ( canvas.getContext('webgl') || canvas.getContext('experimental-webgl') ); }catch( e ) { return false; } }; $(document).ready(function() { window.BonziHandler = new (function() { this.framerate = 1.0/15.0; // MAKE SURE oneCanvas IS SET TO isMobileApp BEFORE CREATING DIST BUILD this.oneCanvas = isMobileApp; this.selCanvas = "#bonzi_canvas"; this.spriteSheets = {}; this.prepSprites = function() { var spriteColors = [ @@ -29,6 +15,7 @@ window.BonziHandler = new (function() { "green", "purple", "red", "pink", "pope" ]; @@ -44,89 +31,60 @@ window.BonziHandler = new (function() { }; this.prepSprites(); if (this.oneCanvas) { this.resizeCanvas = function() { $(this.selCanvas).attr({ "width": $(this.selCanvas).width(), "height": $(this.selCanvas).height() }); if (typeof this.stage != "undefined") { this.stage.removeAllChildren(); delete this.stage; } this.stage = new createjs.SpriteStage($(this.selCanvas)[0]); this.stage.tickOnUpdate = false; this.needsUpdate = true; for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].updateSprite(); bonzis[key].move(); } }; this.resizeCanvas(); this.resize = function() { setTimeout(this.resizeCanvas.bind(this), 1); }; this.$canvas = $("#bonzi_canvas"); this.stage = new createjs.StageGL(this.$canvas[0], { "transparent": true }); this.stage.tickOnUpdate = false; this.resizeCanvas = function() { var width = this.$canvas.width(); var height = this.$canvas.height(); this.$canvas.attr({ "width": this.$canvas.width(), "height": this.$canvas.height() }); this.stage.updateViewport(width, height); this.needsUpdate = true; for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].move(); } }; this.resizeCanvas(); this.intervalHelper = setInterval(function() { BonziHandler.needsUpdate = true; }, 1000); this.stageFramerate = 1.0/60.0; this.resize = function() { setTimeout(this.resizeCanvas.bind(this), 1); }; this.intervalTick = setInterval(function() { for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].update(); } BonziHandler.stage.tick(); }, this.framerate * 1000); this.needsUpdate = true; this.intervalMain = setInterval(function() { if (BonziHandler.needsUpdate) { BonziHandler.stage.update(); BonziHandler.needsUpdate = false; } }, this.stageFramerate * 1000); } else { $(this.selCanvas).remove(); this.resize = function() { setTimeout((function() { for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].move(); } }).bind(this), 1); }; this.intervalHelper = setInterval((function() { this.needsUpdate = true; }).bind(this), 1000); this.intervalHelper = setInterval(function() { for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].needsUpdate = true; } }, 1000); this.intervalTick = setInterval((function() { for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].update(); } this.stage.tick(); }).bind(this), this.framerate * 1000); this.intervalMain = setInterval((function() { if (this.needsUpdate) { this.stage.update(); this.needsUpdate = false; } }).bind(this), 1000.0 / 60.0); this.intervalMain = setInterval(function() { for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].update(); } }, this.framerate * 1000); } $(window).resize(function() { BonziHandler.resize(); }); $(window).resize(this.resize.bind(this)); if (isMobileApp) this.intervalFixAuCtx = setInterval((function() { BonziHandler.fixAuCtx(); }), 1000); this.fixAuCtx(); }).bind(this), 1000); // ======================================================================== // SPEECH @@ -191,6 +149,9 @@ window.BonziHandler = new (function() { } }; // UH OH // HACK ALERT this.checkAuCtx = function() { var keys = Object.keys(this.speakList); var allInitialized = true; @@ -223,6 +184,29 @@ window.BonziHandler = new (function() { } }; $("#btn_tile").click(function() { var winWidth = $(window).width(); var winHeight = $(window).height(); var minY = 0; var addY = 80; var x = 0, y = 0; for (var i = 0; i < usersAmt; i++) { var key = usersKeys[i]; bonzis[key].move(x, y); x += 200; if (x + 100 > winWidth) { x = 0; y += 160; if (y + 160 > winHeight) { minY += addY; addY /= 2; y = minY; } } } }); return this; })(); 2 src/www/js/loader.js @@ -7,6 +7,7 @@ var loadNeeded = [ "bonziGreen", "bonziPurple", "bonziRed", "bonziPink", "topjej" ]; @@ -25,6 +26,7 @@ function loadBonzis(callback) { {id: "bonziGreen", src:"./img/bonzi/green.png"}, {id: "bonziPurple", src:"./img/bonzi/purple.png"}, {id: "bonziRed", src:"./img/bonzi/red.png"}, {id: "bonziPink", src:"./img/bonzi/pink.png"}, {id: "topjej", src:"./img/misc/topjej.png"} ]); loadQueue.on("fileload", function(e) { 6 src/www/js/main.js @@ -148,6 +148,12 @@ function setup() { b.asshole(data.target); }); socket.on("owo", function(data) { var b = bonzis[data.guid]; b.cancel(); b.owo(data.target); }); socket.on("triggered", function(data) { var b = bonzis[data.guid]; b.cancel(); 15 src/www/js_ext/lib/easeljs.min.js Large diffs are not rendered by default. 1 src/www/js_ext/platform.js @@ -1,4 +1,3 @@ var isChromeApp = false; var isMobileApp = false; var isApp = false; var isDesktop = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i) == null; 0 comments on commit e18770d Please sign in to comment. © 2019 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub Pricing API Training Blog About