diff -ruN a/client/config/config_build.json b/client/config/config_build.json
--- a/client/config/config_build.json 1969-12-31 21:00:00.000000000 -0300
+++ b/client/config/config_build.json 2026-11-09 16:30:38.382625378 -0300
@@ -0,0 +1,5 @@
+{
+ "host": "local",
+ "port": 0,
+ "dispatcher": false
+}
diff -ruN a/client/config/config_local.json b/client/config/config_local.json
--- a/client/config/config_local.json 1969-12-31 21:00:00.000000000 -0300
+++ b/client/config/config_local.json 2026-11-09 16:30:38.382906717 -0300
@@ -0,0 +1,5 @@
+{
+ "host": "local",
+ "port": 0,
+ "dispatcher": false
+}
diff -ruN a/client/css/main.css b/client/css/main.css
--- a/client/css/main.css 2012-04-10 14:30:26.000000000 -0300
+++ b/client/css/main.css 2026-11-09 16:30:38.382059659 -0300
@@ -61,26 +61,16 @@
@font-face {
font-family: 'GraphicPixel';
- src: url('../fonts/graphicpixel-webfont.eot');
- src: url('../fonts/graphicpixel-webfont.eot?#iefix') format('embedded-opentype'),
- url('../fonts/graphicpixel-webfont.woff') format('woff'),
- url('../fonts/graphicpixel-webfont.ttf') format('truetype'),
- url('../fonts/graphicpixel-webfont.svg#GraphicPixelRegular') format('svg');
+ src: url('../fonts/VT323-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
-
}
@font-face {
font-family: 'AdvoCut';
- src: url('../fonts/advocut-webfont.eot');
- src: url('../fonts/advocut-webfont.eot?#iefix') format('embedded-opentype'),
- url('../fonts/advocut-webfont.woff') format('woff'),
- url('../fonts/advocut-webfont.ttf') format('truetype'),
- url('../fonts/advocut-webfont.svg#AndinaRegular') format('svg');
+ src: url('../fonts/VT323-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
-
}
.gp {font-family: 'GraphicPixel', sans-serif;}
@@ -1229,4 +1219,7 @@
.opera #instructions, .opera #achievements { z-index: -30000;}
.opera #achievements.active, .opera #instructions.active { z-index: 30000;}
.opera #coinsparks {display:none;}
- .opera #death, .opera #about, .opera #credits, .opera #error, .opera #confirmation, .opera #loadcharacter { z-index: -30000; }
\ No newline at end of file
+ .opera #death, .opera #about, .opera #credits, .opera #error, .opera #confirmation, .opera #loadcharacter { z-index: -30000; }
+
+/* FredyGames: jogo de um jogador so */
+#moztab, #sharing, #playercount, #population, #chatbutton, #chatbox {display:none !important;}
diff -ruN a/client/index.html b/client/index.html
--- a/client/index.html 2012-04-10 14:30:26.000000000 -0300
+++ b/client/index.html 2026-11-09 16:30:38.386075111 -0300
@@ -1,19 +1,5 @@
-
+
@@ -21,12 +7,9 @@
-
-
-
-
-
-
+
+
+
@@ -49,7 +32,6 @@
You need to enable JavaScript to play BrowserQuest.
-
@@ -68,7 +50,7 @@
- A Massively Multiplayer Adventure
+ An Adventure in the Browser
@@ -126,7 +108,7 @@
- Made for Mozilla by Little Workshop
+ Made by Little Workshop
@@ -134,19 +116,17 @@
- click anywhere to close -
@@ -161,28 +141,17 @@
- BrowserQuest is a multiplayer game inviting you to explore a
- world of adventure from your Web browser.
+ BrowserQuest is an adventure game that you can play right in your browser.
-
- This demo is powered by HTML5 and WebSockets, which allow for real-time gaming and apps on the Web.
+ The whole game world runs inside this page, so you need no connection and no account: your character is saved on this device.
-
-
- Learn more about the technology
-
-
- BrowserQuest is available on Firefox, Chrome, Safari as well as iOS devices and Firefox for Android.
+ Explore the land, fight monsters, find better weapons and armor, and unlock achievements.
-
-
- Grab the source on Github
-
- click anywhere to close -
@@ -199,8 +168,8 @@
- We're sorry, but your browser does not support WebSockets.
- In order to play, we recommend using the latest version of Firefox, Chrome or Safari.
+ We're sorry, but your browser does not support Web Workers.
+ In order to play, we recommend using a recent version of Chrome, Firefox, Edge or Safari.
@@ -218,7 +187,6 @@
Left click or tap to move, attack and pick up items.
- Press ENTER to chat.
Your character is automatically saved as you play.
- click anywhere to close -
@@ -297,11 +265,6 @@
-
– Credits
@@ -314,9 +277,6 @@
???
???
-
-
-
@@ -344,7 +304,7 @@
target = document.getElementById("intro");
document.body.insertBefore(alert, target);
- } else if(localStorage && localStorage.data) {
+ } else if(localStorage && localStorage.getItem('data')) {
parchment.className = "loadcharacter";
}
diff -ruN a/client/js/app.js b/client/js/app.js
--- a/client/js/app.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/app.js 2026-11-09 16:30:38.384545665 -0300
@@ -240,9 +240,7 @@
armorPath = getIconPath(armor);
$('#weapon').css('background-image', 'url("' + weaponPath + '")');
- if(armor !== 'firefox') {
- $('#armor').css('background-image', 'url("' + armorPath + '")');
- }
+ $('#armor').css('background-image', 'url("' + armorPath + '")');
},
hideWindows: function() {
@@ -316,14 +314,7 @@
if(!achievement.hidden) {
self.setAchievementData($a, achievement.name, achievement.desc);
}
- $a.find('.twitter').attr('href', 'http://twitter.com/share?url=http%3A%2F%2Fbrowserquest.mozilla.org&text=I%20unlocked%20the%20%27'+ achievement.name +'%27%20achievement%20on%20Mozilla%27s%20%23BrowserQuest%21&related=glecollinet:Creators%20of%20BrowserQuest%2Cwhatthefranck');
$a.show();
- $a.find('a').click(function() {
- var url = $(this).attr('href');
-
- self.openPopup('twitter', url);
- return false;
- });
if((count - 1) % 4 === 0) {
page++;
@@ -394,7 +385,7 @@
} else {
if(currentState !== 'animate') {
if(currentState === 'about') {
- if(localStorage && localStorage.data) {
+ if(localStorage && localStorage.getItem('data')) {
this.animateParchment(currentState, 'loadcharacter');
} else {
this.animateParchment(currentState, 'createcharacter');
diff -ruN a/client/js/audio.js b/client/js/audio.js
--- a/client/js/audio.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/audio.js 2026-11-09 16:30:38.377323985 -0300
@@ -12,7 +12,7 @@
this.currentMusic = null;
this.areas = [];
this.musicNames = ["village", "beach", "forest", "cave", "desert", "lavaland", "boss"];
- this.soundNames = ["loot", "hit1", "hit2", "hurt", "heal", "chat", "revive", "death", "firefox", "achievement", "kill1", "kill2", "noloot", "teleport", "chest", "npc", "npc-end"];
+ this.soundNames = ["loot", "hit1", "hit2", "hurt", "heal", "chat", "revive", "death", "achievement", "kill1", "kill2", "noloot", "teleport", "chest", "npc", "npc-end"];
var loadSoundFiles = function() {
var counter = _.size(self.soundNames);
@@ -29,7 +29,8 @@
};
var loadMusicFiles = function() {
- if(!self.game.renderer.mobile) { // disable music on mobile devices
+ // FredyGames: o repositorio nao traz as musicas; sem elas, o jogo so toca os efeitos sonoros.
+ if(false) {
log.info("Loading music files...");
// Load the village music first, as players always start here
self.loadMusic(self.musicNames.shift(), function() {
diff -ruN a/client/js/detect.js b/client/js/detect.js
--- a/client/js/detect.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/detect.js 2026-11-09 16:30:38.378594635 -0300
@@ -2,7 +2,8 @@
var Detect = {};
Detect.supportsWebSocket = function() {
- return window.WebSocket || window.MozWebSocket;
+ // FredyGames: o servidor roda num Web Worker, nao ha WebSocket.
+ return !!window.Worker;
};
Detect.userAgentContains = function(string) {
@@ -11,7 +12,7 @@
Detect.isTablet = function(screenWidth) {
if(screenWidth > 640) {
- if((Detect.userAgentContains('Android') && Detect.userAgentContains('Firefox'))
+ if((Detect.userAgentContains('Android'))
|| Detect.userAgentContains('Mobile')) {
return true;
}
diff -ruN a/client/js/entityfactory.js b/client/js/entityfactory.js
--- a/client/js/entityfactory.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/entityfactory.js 2026-11-09 16:30:38.375994043 -0300
@@ -126,10 +126,6 @@
return new Items.Flask(id);
};
- EntityFactory.builders[Types.Entities.FIREPOTION] = function(id) {
- return new Items.FirePotion(id);
- };
-
EntityFactory.builders[Types.Entities.BURGER] = function(id) {
return new Items.Burger(id);
};
@@ -164,22 +160,10 @@
return new NPCs.Coder(id);
};
- EntityFactory.builders[Types.Entities.AGENT] = function(id) {
- return new NPCs.Agent(id);
- };
-
- EntityFactory.builders[Types.Entities.RICK] = function(id) {
- return new NPCs.Rick(id);
- };
-
EntityFactory.builders[Types.Entities.SCIENTIST] = function(id) {
return new NPCs.Scientist(id);
};
- EntityFactory.builders[Types.Entities.NYAN] = function(id) {
- return new NPCs.Nyan(id);
- };
-
EntityFactory.builders[Types.Entities.PRIEST] = function(id) {
return new NPCs.Priest(id);
};
@@ -188,10 +172,6 @@
return new NPCs.Sorcerer(id);
};
- EntityFactory.builders[Types.Entities.OCTOCAT] = function(id) {
- return new NPCs.Octocat(id);
- };
-
EntityFactory.builders[Types.Entities.BEACHNPC] = function(id) {
return new NPCs.BeachNpc(id);
};
diff -ruN a/client/js/game.js b/client/js/game.js
--- a/client/js/game.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/game.js 2026-11-09 16:30:38.383961737 -0300
@@ -1,7 +1,7 @@
define(['infomanager', 'bubble', 'renderer', 'map', 'animation', 'sprite', 'tile',
'warrior', 'gameclient', 'audio', 'updater', 'transition', 'pathfinder',
- 'item', 'mob', 'npc', 'player', 'character', 'chest', 'mobs', 'exceptions', 'config', '../../shared/js/gametypes'],
+ 'item', 'mob', 'npc', 'player', 'character', 'chest', 'mobs', 'exceptions', 'config', 'gametypes'],
function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedTile,
Warrior, GameClient, AudioManager, Updater, Transition, Pathfinder,
Item, Mob, Npc, Player, Character, Chest, Mobs, Exceptions, config) {
@@ -64,11 +64,11 @@
// sprites
this.spriteNames = ["hand", "sword", "loot", "target", "talk", "sparks", "shadow16", "rat", "skeleton", "skeleton2", "spectre", "boss", "deathknight",
- "ogre", "crab", "snake", "eye", "bat", "goblin", "wizard", "guard", "king", "villagegirl", "villager", "coder", "agent", "rick", "scientist", "nyan", "priest",
- "sorcerer", "octocat", "beachnpc", "forestnpc", "desertnpc", "lavanpc", "clotharmor", "leatherarmor", "mailarmor",
- "platearmor", "redarmor", "goldenarmor", "firefox", "death", "sword1", "axe", "chest",
+ "ogre", "crab", "snake", "eye", "bat", "goblin", "wizard", "guard", "king", "villagegirl", "villager", "coder", "scientist", "priest",
+ "sorcerer", "beachnpc", "forestnpc", "desertnpc", "lavanpc", "clotharmor", "leatherarmor", "mailarmor",
+ "platearmor", "redarmor", "goldenarmor", "death", "sword1", "axe", "chest",
"sword2", "redsword", "bluesword", "goldensword", "item-sword2", "item-axe", "item-redsword", "item-bluesword", "item-goldensword", "item-leatherarmor", "item-mailarmor",
- "item-platearmor", "item-redarmor", "item-goldenarmor", "item-flask", "item-cake", "item-burger", "morningstar", "item-morningstar", "item-firepotion"];
+ "item-platearmor", "item-redarmor", "item-goldenarmor", "item-flask", "item-cake", "item-burger", "morningstar", "item-morningstar"];
},
setup: function($bubbleContainer, canvas, background, foreground, input) {
@@ -269,23 +269,11 @@
name: "Hero",
desc: "Defeat the final boss"
},
- FOXY: {
- id: 18,
- name: "Foxy",
- desc: "Find the Firefox costume",
- hidden: true
- },
FOR_SCIENCE: {
- id: 19,
+ id: 18,
name: "For Science",
desc: "Enter into a portal",
hidden: true
- },
- RICKROLLD: {
- id: 20,
- name: "Rickroll'd",
- desc: "Take some singing lessons",
- hidden: true
}
};
@@ -716,19 +704,9 @@
this.client = new GameClient(this.host, this.port);
- //>>excludeStart("prodHost", pragmas.prodHost);
- var config = this.app.config.local || this.app.config.dev;
- if(config) {
- this.client.connect(config.dispatcher); // false if the client connects directly to a game server
- connecting = true;
- }
- //>>excludeEnd("prodHost");
-
- //>>includeStart("prodHost", pragmas.prodHost);
- if(!connecting) {
- this.client.connect(true); // always use the dispatcher in production
- }
- //>>includeEnd("prodHost");
+ // FredyGames: o servidor roda num Web Worker da propria pagina (ver gameclient.js).
+ this.client.connect(false);
+ connecting = true;
this.client.onDispatched(function(host, port) {
log.debug("Dispatched to game server "+host+ ":"+port);
@@ -919,11 +897,6 @@
self.tryUnlockingAchievement("FOR_SCIENCE");
}
- if(item.kind === Types.Entities.FIREPOTION) {
- self.tryUnlockingAchievement("FOXY");
- self.audioManager.playSound("firefox");
- }
-
if(Types.isHealingItem(item.kind)) {
self.audioManager.playSound("heal");
} else {
@@ -1061,11 +1034,6 @@
}
});
- self.player.onInvincible(function() {
- self.invincible_callback();
- self.player.switchArmor(self.sprites["firefox"]);
- });
-
self.client.onSpawnItem(function(item, x, y) {
log.info("Spawned " + Types.getKindAsString(item.kind) + " (" + item.id + ") at "+x+", "+y);
self.addItem(item, x, y);
@@ -1623,10 +1591,7 @@
this.audioManager.playSound("npc-end");
}
this.tryUnlockingAchievement("SMALL_TALK");
-
- if(npc.kind === Types.Entities.RICK) {
- this.tryUnlockingAchievement("RICKROLLD");
- }
+
}
},
diff -ruN a/client/js/gameclient.js b/client/js/gameclient.js
--- a/client/js/gameclient.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/gameclient.js 2026-11-09 16:30:38.378858556 -0300
@@ -1,6 +1,37 @@
define(['player', 'entityfactory', 'lib/bison'], function(Player, EntityFactory, BISON) {
+ // Faz o papel de um WebSocket (readyState, onopen, onmessage, onclose, send, close) falando com o servidor local.
+ var LocalSocket = function() {
+ var self = this;
+ this.readyState = 0;
+ this.worker = new Worker('js/bqserver.js');
+ this.worker.onmessage = function(e) {
+ var m = e.data;
+ if(m.type === 'ready') {
+ self.readyState = 1;
+ if(self.onopen) { self.onopen({}); }
+ self.worker.postMessage({ type: 'connect' });
+ } else if(m.type === 'msg') {
+ if(self.onmessage) { self.onmessage({ data: m.data }); }
+ } else if(m.type === 'close') {
+ self.readyState = 3;
+ if(self.onclose) { self.onclose({}); }
+ }
+ };
+ this.worker.onerror = function(e) {
+ if(self.onerror) { self.onerror(e); }
+ };
+ };
+ LocalSocket.prototype.send = function(data) {
+ this.worker.postMessage({ type: 'msg', data: data });
+ };
+ LocalSocket.prototype.close = function() {
+ this.readyState = 3;
+ this.worker.postMessage({ type: 'close' });
+ this.worker.terminate();
+ };
+
var GameClient = Class.extend({
init: function(host, port) {
this.connection = null;
@@ -45,16 +76,13 @@
},
connect: function(dispatcherMode) {
- var url = "ws://"+ this.host +":"+ this.port +"/",
- self = this;
+ var self = this;
- log.info("Trying to connect to server : "+url);
+ log.info("Starting the local game server");
- if(window.MozWebSocket) {
- this.connection = new MozWebSocket(url);
- } else {
- this.connection = new WebSocket(url);
- }
+ // FredyGames: no lugar do WebSocket, um Web Worker roda o servidor do jogo (js/bqserver.js) e troca
+ // as mesmas mensagens JSON do protocolo original.
+ this.connection = new LocalSocket();
if(dispatcherMode) {
this.connection.onmessage = function(e) {
diff -ruN a/client/js/items.js b/client/js/items.js
--- a/client/js/items.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/items.js 2026-11-09 16:30:38.376128171 -0300
@@ -101,16 +101,6 @@
},
}),
- FirePotion: Item.extend({
- init: function(id) {
- this._super(id, Types.Entities.FIREPOTION, "object");
- this.lootMessage = "You feel the power of Firefox!";
- },
-
- onLoot: function(player) {
- player.startInvincibility();
- },
- }),
};
return Items;
diff -ruN a/client/js/main.js b/client/js/main.js
--- a/client/js/main.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/main.js 2026-11-09 16:30:38.377904121 -0300
@@ -31,13 +31,6 @@
$(this).toggleClass('active');
});
- $('#chatbutton').click(function() {
- if($('#chatbutton').hasClass('active')) {
- app.showChat();
- } else {
- app.hideChat();
- }
- });
$('#helpbutton').click(function() {
app.toggleAbout();
@@ -122,19 +115,6 @@
app.hideWindows();
});
- $('.twitter').click(function() {
- var url = $(this).attr('href');
-
- app.openPopup('twitter', url);
- return false;
- });
-
- $('.facebook').click(function() {
- var url = $(this).attr('href');
-
- app.openPopup('facebook', url);
- return false;
- });
var data = app.storage.data;
if(data.hasAlreadyPlayed) {
@@ -307,13 +287,7 @@
var key = e.which,
$chat = $('#chatinput');
- if(key === 13) {
- if($('#chatbox').hasClass('active')) {
- app.hideChat();
- } else {
- app.showChat();
- }
- }
+ // FredyGames: sem chat (jogo de um jogador so).
});
$('#chatinput').keydown(function(e) {
diff -ruN a/client/js/npc.js b/client/js/npc.js
--- a/client/js/npc.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/npc.js 2026-11-09 16:30:38.377102064 -0300
@@ -27,9 +27,9 @@
"Hi there, adventurer!",
"How do you like this game?",
"It's all happening in a single web page! Isn't it crazy?",
- "It's all made possible thanks to WebSockets.",
+ "It's all made possible by a lot of JavaScript.",
"I don't know much about it, after all I'm just a program.",
- 'Why don't you read this blog post and learn all about it?'
+ "Maybe the coder at the edge of the village can tell you more."
],
"villager": [
@@ -41,45 +41,15 @@
"Maybe the forest, could interest you...",
"or instead, cook a rat stew."
],
-
- "agent": [
- "Do not try to bend the sword",
- "That's impossible",
- "Instead, only try to realize the truth...",
- "There is no sword."
- ],
-
- "rick": [
- "We're no strangers to love",
- "You know the rules and so do I",
- "A full commitment's what I'm thinking of",
- "You wouldn't get this from any other guy",
- "I just wanna tell you how I'm feeling",
- "Gotta make you understand",
- "Never gonna give you up",
- "Never gonna let you down",
- "Never gonna run around and desert you",
- "Never gonna make you cry",
- "Never gonna say goodbye",
- "Never gonna tell a lie and hurt you"
- ],
"scientist": [
"Greetings.",
- "I am the inventor of these two potions.",
+ "I am the inventor of these potions.",
"The red one will replenish your health points...",
- "The orange one will turn you into a firefox and make you invincible...",
- "But it only lasts for a short while.",
+ "Keep a few of them close, you will need them.",
"So make good use of it!",
"Now if you'll excuse me, I need to get back to my experiments..."
],
-
- "nyan": [
- "nyan nyan nyan nyan nyan",
- "nyan nyan nyan nyan nyan nyan nyan",
- "nyan nyan nyan nyan nyan nyan",
- "nyan nyan nyan nyan nyan nyan nyan nyan"
- ],
"beachnpc": [
"lorem ipsum dolor sit amet",
@@ -128,16 +98,10 @@
"Good luck."
],
- "octocat": [
- "Welcome to BrowserQuest!",
- "Want to see the source code?",
- 'Check out the repository on GitHub '
- ],
-
"coder": [
- "Hi! Do you know that you can also play BrowserQuest on your tablet or mobile?",
- "That's the beauty of HTML5!",
- "Give it a try..."
+ "Hi! I write the code that keeps this world running.",
+ "Everything you see here happens right inside your browser.",
+ "Enjoy your stay..."
],
"beachnpc": [
diff -ruN a/client/js/npcs.js b/client/js/npcs.js
--- a/client/js/npcs.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/npcs.js 2026-11-09 16:30:38.376496386 -0300
@@ -15,18 +15,6 @@
}
}),
- Agent: Npc.extend({
- init: function(id) {
- this._super(id, Types.Entities.AGENT, 1);
- }
- }),
-
- Rick: Npc.extend({
- init: function(id) {
- this._super(id, Types.Entities.RICK, 1);
- }
- }),
-
VillageGirl: Npc.extend({
init: function(id) {
this._super(id, Types.Entities.VILLAGEGIRL, 1);
@@ -51,13 +39,6 @@
}
}),
- Nyan: Npc.extend({
- init: function(id) {
- this._super(id, Types.Entities.NYAN, 1);
- this.idleSpeed = 50;
- }
- }),
-
Sorcerer: Npc.extend({
init: function(id) {
this._super(id, Types.Entities.SORCERER, 1);
@@ -93,12 +74,6 @@
init: function(id) {
this._super(id, Types.Entities.LAVANPC, 1);
}
- }),
-
- Octocat: Npc.extend({
- init: function(id) {
- this._super(id, Types.Entities.OCTOCAT, 1);
- }
})
};
diff -ruN a/client/js/sprites.js b/client/js/sprites.js
--- a/client/js/sprites.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/sprites.js 2026-11-09 16:30:38.371714503 -0300
@@ -1,5 +1,5 @@
-define(['text!../sprites/agent.json',
+define([
'text!../sprites/arrow.json',
'text!../sprites/axe.json',
'text!../sprites/bat.json',
@@ -14,7 +14,6 @@
'text!../sprites/deathknight.json',
'text!../sprites/desertnpc.json',
'text!../sprites/eye.json',
- 'text!../sprites/firefox.json',
'text!../sprites/forestnpc.json',
'text!../sprites/goblin.json',
'text!../sprites/goldenarmor.json',
@@ -26,7 +25,6 @@
'text!../sprites/item-bluesword.json',
'text!../sprites/item-burger.json',
'text!../sprites/item-cake.json',
- 'text!../sprites/item-firepotion.json',
'text!../sprites/item-flask.json',
'text!../sprites/item-goldenarmor.json',
'text!../sprites/item-goldensword.json',
@@ -44,15 +42,12 @@
'text!../sprites/loot.json',
'text!../sprites/mailarmor.json',
'text!../sprites/morningstar.json',
- 'text!../sprites/nyan.json',
- 'text!../sprites/octocat.json',
'text!../sprites/ogre.json',
'text!../sprites/platearmor.json',
'text!../sprites/priest.json',
'text!../sprites/rat.json',
'text!../sprites/redarmor.json',
'text!../sprites/redsword.json',
- 'text!../sprites/rick.json',
'text!../sprites/scientist.json',
'text!../sprites/shadow16.json',
'text!../sprites/skeleton.json',
diff -ruN a/client/js/storage.js b/client/js/storage.js
--- a/client/js/storage.js 2012-04-10 14:30:26.000000000 -0300
+++ b/client/js/storage.js 2026-11-09 16:30:38.385550726 -0300
@@ -3,8 +3,8 @@
var Storage = Class.extend({
init: function() {
- if(this.hasLocalStorage() && localStorage.data) {
- this.data = JSON.parse(localStorage.data);
+ if(this.hasLocalStorage() && localStorage.getItem('data')) {
+ this.data = JSON.parse(localStorage.getItem('data'));
} else {
this.resetData();
}
@@ -36,13 +36,13 @@
save: function() {
if(this.hasLocalStorage()) {
- localStorage.data = JSON.stringify(this.data);
+ localStorage.setItem('data', JSON.stringify(this.data));
}
},
clear: function() {
if(this.hasLocalStorage()) {
- localStorage.data = "";
+ localStorage.setItem('data', '');
this.resetData();
}
},
diff -ruN a/server/js/player.js b/server/js/player.js
--- a/server/js/player.js 2012-04-10 14:30:26.000000000 -0300
+++ b/server/js/player.js 2026-11-09 16:30:38.368429565 -0300
@@ -142,9 +142,6 @@
if(self.hitPoints <= 0) {
self.isDead = true;
- if(self.firepotionTimeout) {
- clearTimeout(self.firepotionTimeout);
- }
}
}
}
@@ -158,15 +155,7 @@
self.broadcast(item.despawn());
self.server.removeEntity(item);
- if(kind === Types.Entities.FIREPOTION) {
- self.updateHitPoints();
- self.broadcast(self.equip(Types.Entities.FIREFOX));
- self.firepotionTimeout = setTimeout(function() {
- self.broadcast(self.equip(self.armor)); // return to normal after 15 sec
- self.firepotionTimeout = null;
- }, 15000);
- self.send(new Messages.HitPoints(self.maxHitPoints).serialize());
- } else if(Types.isHealingItem(kind)) {
+ if(Types.isHealingItem(kind)) {
var amount;
switch(kind) {
@@ -223,9 +212,6 @@
});
this.connection.onClose(function() {
- if(self.firepotionTimeout) {
- clearTimeout(self.firepotionTimeout);
- }
clearTimeout(self.disconnectTimeout);
if(self.exit_callback) {
self.exit_callback();
@@ -372,8 +358,8 @@
},
resetTimeout: function() {
+ // FredyGames: jogo de um jogador so, sem desconexao por inatividade.
clearTimeout(this.disconnectTimeout);
- this.disconnectTimeout = setTimeout(this.timeout.bind(this), 1000 * 60 * 15); // 15 min.
},
timeout: function() {
diff -ruN a/server/js/properties.js b/server/js/properties.js
--- a/server/js/properties.js 2012-04-10 14:30:26.000000000 -0300
+++ b/server/js/properties.js 2026-11-09 16:30:38.365958893 -0300
@@ -5,8 +5,7 @@
rat: {
drops: {
flask: 40,
- burger: 10,
- firepotion: 5
+ burger: 10
},
hp: 25,
armor: 1,
@@ -17,8 +16,7 @@
drops: {
flask: 40,
mailarmor: 10,
- axe: 20,
- firepotion: 5
+ axe: 20
},
hp: 110,
armor: 2,
@@ -29,8 +27,7 @@
drops: {
flask: 50,
leatherarmor: 20,
- axe: 10,
- firepotion: 5
+ axe: 10
},
hp: 90,
armor: 2,
@@ -42,8 +39,7 @@
burger: 10,
flask: 50,
platearmor: 20,
- morningstar: 20,
- firepotion: 5
+ morningstar: 20
},
hp: 200,
armor: 3,
@@ -54,8 +50,7 @@
drops: {
flask: 30,
redarmor: 40,
- redsword: 30,
- firepotion: 5
+ redsword: 30
},
hp: 250,
armor: 2,
@@ -64,8 +59,7 @@
deathknight: {
drops: {
- burger: 95,
- firepotion: 5
+ burger: 95
},
hp: 250,
armor: 3,
@@ -76,8 +70,7 @@
drops: {
flask: 50,
axe: 20,
- leatherarmor: 10,
- firepotion: 5
+ leatherarmor: 10
},
hp: 60,
armor: 2,
@@ -88,8 +81,7 @@
drops: {
flask: 50,
mailarmor: 10,
- morningstar: 10,
- firepotion: 5
+ morningstar: 10
},
hp: 150,
armor: 3,
@@ -100,8 +92,7 @@
drops: {
flask: 60,
platearmor: 15,
- bluesword: 15,
- firepotion: 5
+ bluesword: 15
},
hp: 200,
armor: 3,
@@ -112,8 +103,7 @@
drops: {
flask: 50,
redarmor: 20,
- redsword: 10,
- firepotion: 5
+ redsword: 10
},
hp: 200,
armor: 3,
@@ -123,8 +113,7 @@
bat: {
drops: {
flask: 50,
- axe: 10,
- firepotion: 5
+ axe: 10
},
hp: 80,
armor: 2,
@@ -134,8 +123,7 @@
wizard: {
drops: {
flask: 50,
- platearmor: 20,
- firepotion: 5
+ platearmor: 20
},
hp: 100,
armor: 2,
diff -ruN a/shared/js/gametypes.js b/shared/js/gametypes.js
--- a/shared/js/gametypes.js 2012-04-10 14:30:26.000000000 -0300
+++ b/shared/js/gametypes.js 2026-11-09 16:30:38.364694494 -0300
@@ -125,7 +125,6 @@
goldensword: [Types.Entities.GOLDENSWORD, "weapon"],
morningstar: [Types.Entities.MORNINGSTAR, "weapon"],
- firefox: [Types.Entities.FIREFOX, "armor"],
clotharmor: [Types.Entities.CLOTHARMOR, "armor"],
leatherarmor: [Types.Entities.LEATHERARMOR, "armor"],
mailarmor: [Types.Entities.MAILARMOR, "armor"],
@@ -137,8 +136,7 @@
cake: [Types.Entities.CAKE, "object"],
burger: [Types.Entities.BURGER, "object"],
chest: [Types.Entities.CHEST, "object"],
- firepotion: [Types.Entities.FIREPOTION, "object"],
-
+
guard: [Types.Entities.GUARD, "npc"],
villagegirl: [Types.Entities.VILLAGEGIRL, "npc"],
villager: [Types.Entities.VILLAGER, "npc"],
@@ -146,11 +144,7 @@
scientist: [Types.Entities.SCIENTIST, "npc"],
priest: [Types.Entities.PRIEST, "npc"],
king: [Types.Entities.KING, "npc"],
- rick: [Types.Entities.RICK, "npc"],
- nyan: [Types.Entities.NYAN, "npc"],
sorcerer: [Types.Entities.SORCERER, "npc"],
- agent: [Types.Entities.AGENT, "npc"],
- octocat: [Types.Entities.OCTOCAT, "npc"],
beachnpc: [Types.Entities.BEACHNPC, "npc"],
forestnpc: [Types.Entities.FORESTNPC, "npc"],
desertnpc: [Types.Entities.DESERTNPC, "npc"],
@@ -233,7 +227,6 @@
Types.isExpendableItem = function(kind) {
return Types.isHealingItem(kind)
- || kind === Types.Entities.FIREPOTION
|| kind === Types.Entities.CAKE;
};