Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress NPM's no-licence warning by linking to LICENSE file #185

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install g++ make memcached libncurses5 redis-server git -y
$ sudo apt-get install g++ make memcached libncurses5 redis-server git curl -y
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get install nodejs
$ sudo apt-get install nodejs -y

Clone the git repo:

Expand Down
39 changes: 20 additions & 19 deletions client/js/game.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@


define(['infomanager', 'bubble', 'renderer', 'map', 'animation', 'sprite',
'tile', 'warrior', 'gameclient', 'audio', 'updater', 'transition',
'pathfinder', 'item', 'mob', 'npc', 'player', 'character', 'chest',
'mobs', 'exceptions', 'config', 'guild', '../../shared/js/gametypes'],
'mobs', 'exceptions', 'config', 'guild', '../shared/js/gametypes'],
function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedTile,
Warrior, GameClient, AudioManager, Updater, Transition, Pathfinder,
Item, Mob, Npc, Player, Character, Chest, Mobs, Exceptions, config,
Expand Down Expand Up @@ -69,7 +70,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT

// debug
this.debugPathing = false;

// pvp
this.pvpFlag = false;

Expand Down Expand Up @@ -393,7 +394,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
else {
this.targetColor = "rgba(255, 255, 255, 0.5)";
}

if(this.hoveringPlayer && this.started) {
if(this.pvpFlag)
this.setCursor("sword");
Expand All @@ -407,7 +408,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
this.hoveringTarget = false;
this.hoveringPlayer = false;
this.targetCellVisible = false;

}
else if(this.hoveringNpc && this.started) {
this.setCursor("talk");
Expand Down Expand Up @@ -644,7 +645,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
this.userpw = userpw;
this.email = email;
},

loadAudio: function() {
this.audioManager = new AudioManager(this);
},
Expand Down Expand Up @@ -1296,7 +1297,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
item.blink(150);
}
});

self.client.onGuildError(function(errorType, info) {
if(errorType === Types.Messages.GUILDERRORTYPE.BADNAME){
self.showNotification(info + " seems to be an inappropriate guild name…");
Expand All @@ -1314,21 +1315,21 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.showNotification(info+" is ALREADY a member of “"+self.player.getGuild().name+"”");
}
});

self.client.onGuildCreate(function(guildId, guildName) {
self.player.setGuild(new Guild(guildId, guildName));
self.storage.setPlayerGuild(self.player.getGuild());
self.showNotification("You successfully created and joined…");
setTimeout(function(){self.showNotification("…" + self.player.getGuild().name)},2500);
});

self.client.onGuildInvite(function(guildId, guildName, invitorName) {
self.showNotification(invitorName + " invited you to join “"+guildName+"”.");
self.player.addInvite(guildId);
setTimeout(function(){$("#chatinput").attr("placeholder", "Do you want to join "+guildName+" ? Type /guild accept yes or /guild accept no");
self.app.showChat();},2500);
});

self.client.onGuildJoin(function(playerName, id, guildId, guildName) {
if(typeof id === "undefined"){
self.showNotification(playerName + " failed to answer to your invitation in time.");
Expand All @@ -1347,7 +1348,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.showNotification(playerName+" is now a jolly member of “"+guildName+"”.");//#updateguild
}
});

self.client.onGuildLeave(function(name, playerId, guildName) {
if(self.player.id===playerId){
if(self.player.hasGuild()){
Expand All @@ -1363,7 +1364,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.showNotification(name + " has left “"+guildName+"”.");//#updateguild
}
});

self.client.onGuildTalk(function(name, id, message) {
if(id===self.player.id){
self.showNotification("YOU: "+message);
Expand All @@ -1376,11 +1377,11 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.client.onMemberConnect(function(name) {
self.showNotification(name + " connected to your world.");//#updateguild
});

self.client.onMemberDisconnect(function(name) {
self.showNotification(name + " lost connection with your world.");
});

self.client.onReceiveGuildMembers(function(memberNames) {
self.showNotification(memberNames.join(", ") + ((memberNames.length===1) ? " is " : " are ") +"currently online.");//#updateguild
});
Expand Down Expand Up @@ -1459,7 +1460,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.player.level = level;
self.player.experience = exp;
self.updateExpBar();

self.infoManager.addDamageInfo("+"+mobExp+" exp", self.player.x, self.player.y - 15, "exp", 3000);

var expInThisLevel = self.player.experience - Types.expForLevel[self.player.level-1];
Expand Down Expand Up @@ -1595,7 +1596,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.nbplayers_callback(worldPlayers, totalPlayers);
}
});

self.client.onGuildPopulation(function(guildName, guildPopulation) {
if(self.nbguildplayers_callback) {
self.nbguildplayers_callback(guildName, guildPopulation);
Expand Down Expand Up @@ -2255,7 +2256,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
onCharacterUpdate: function(character) {
var time = this.currentTime,
self = this;

// If mob has finished moving to a different tile in order to avoid stacking, attack again from the new position.
if(character.previousTarget && !character.isMoving() && character instanceof Mob) {
var t = character.previousTarget;
Expand Down Expand Up @@ -2467,7 +2468,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
this.showNotification("“guild accept” is a YES or NO question!!");
}
break;
}
}
}
this.client.sendChat(message);
},
Expand Down Expand Up @@ -2574,7 +2575,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
onNbPlayersChange: function(callback) {
this.nbplayers_callback = callback;
},

onGuildPopulationChange: function(callback) {
this.nbguildplayers_callback = callback;
},
Expand Down Expand Up @@ -2622,7 +2623,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
this.updatetarget_callback(target);
}
},

getDeadMobPosition: function(mobId) {
var position;

Expand Down
38 changes: 19 additions & 19 deletions client/js/gameclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ define(['player', 'entityfactory', 'lib/bison'], function(Player, EntityFactory,
},

connect: function(dispatcherMode) {
var url = "ws://"+ this.host +":"+ this.port +"/",
var url = "ws://"+ this.host +":"+ 8080 +"/browserquest/",
self = this;

log.info("Trying to connect to server : "+url);
Expand Down Expand Up @@ -394,15 +394,15 @@ define(['player', 'entityfactory', 'lib/bison'], function(Player, EntityFactory,
this.pvp_callback(pvp);
}
},

receiveGuildError: function(data) {
var errorType = data[1];
var guildName = data[2];
if(this.guilderror_callback) {
this.guilderror_callback(errorType, guildName);
}
},

receiveGuild: function(data) {
if( (data[1] === Types.Messages.GUILDACTION.CONNECT) &&
this.guildmemberconnect_callback ){
Expand Down Expand Up @@ -430,7 +430,7 @@ define(['player', 'entityfactory', 'lib/bison'], function(Player, EntityFactory,
this.guildpopulation_callback(data[2], data[3]);//name, count
}
else if( (data[1] === Types.Messages.GUILDACTION.JOIN) &&
this.guildjoin_callback){
this.guildjoin_callback){
this.guildjoin_callback(data[2], data[3], data[4], data[5]);//name, (id, (guildId, guildName))
}
else if( (data[1] === Types.Messages.GUILDACTION.LEAVE) &&
Expand Down Expand Up @@ -540,39 +540,39 @@ define(['player', 'entityfactory', 'lib/bison'], function(Player, EntityFactory,
onGuildError: function(callback) {
this.guilderror_callback = callback;
},

onGuildCreate: function(callback) {
this.guildcreate_callback = callback;
},

onGuildInvite: function(callback) {
this.guildinvite_callback = callback;
},

onGuildJoin: function(callback) {
this.guildjoin_callback = callback;
},

onGuildLeave: function(callback) {
this.guildleave_callback = callback;
},

onGuildTalk: function(callback) {
this.guildtalk_callback = callback;
},

onMemberConnect: function(callback) {
this.guildmemberconnect_callback = callback;
},

onMemberDisconnect: function(callback) {
this.guildmemberdisconnect_callback = callback;
},

onReceiveGuildMembers: function(callback) {
this.guildonlinemembers_callback = callback;
},

onGuildPopulation: function(callback) {
this.guildpopulation_callback = callback;
},
Expand Down Expand Up @@ -672,28 +672,28 @@ define(['player', 'entityfactory', 'lib/bison'], function(Player, EntityFactory,
this.sendMessage([Types.Messages.CHECK,
id]);
},

sendWho: function(ids) {
ids.unshift(Types.Messages.WHO);
this.sendMessage(ids);
},

sendNewGuild: function(name) {
this.sendMessage([Types.Messages.GUILD, Types.Messages.GUILDACTION.CREATE, name]);
},

sendGuildInvite: function(invitee) {
this.sendMessage([Types.Messages.GUILD, Types.Messages.GUILDACTION.INVITE, invitee]);
},

sendGuildInviteReply: function(guild, answer) {
this.sendMessage([Types.Messages.GUILD, Types.Messages.GUILDACTION.JOIN, guild, answer]);
},

talkToGuild: function(message){
this.sendMessage([Types.Messages.GUILD, Types.Messages.GUILDACTION.TALK, message]);
},

sendLeaveGuild: function(){
this.sendMessage([Types.Messages.GUILD, Types.Messages.GUILDACTION.LEAVE]);
}
Expand Down
2 changes: 1 addition & 1 deletion client/js/lib/css3-mediaqueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,4 +776,4 @@ document.execCommand("BackgroundImageCache",false,true);
}
catch(e){
}

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "git",
"url": "https://github.com/browserquest/BrowserQuest.git"
},
"license": "LicenseRef-LICENSE",
"version": "0.0.1",
"dependencies": {
"bcrypt": ">=0",
Expand Down
2 changes: 1 addition & 1 deletion server/config_local.json-dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"nb_worlds": 5,
"map_filepath": "./server/maps/world_server.json",
"metrics_enabled": false
}
}
4 changes: 2 additions & 2 deletions server/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ function getConfigFile(path, callback) {
});
}

var defaultConfigPath = './server/config.json';
var customConfigPath = './server/config_local.json';
var defaultConfigPath = __dirname + '/../config.json';
var customConfigPath = __dirname + '/../config_local.json';

process.argv.forEach(function (val, index, array) {
if(index === 2) {
Expand Down
5 changes: 4 additions & 1 deletion server/js/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ WS.WebsocketServer = Server.extend({
// Generate (on the fly) the pages needing special treatment
app.use(function handleDynamicPageRequests(request, response) {
var path = url.parse(request.url).pathname;
console.log("DEY WANT A PATH: ", path);
switch (path) {
case '/status':
// The server status page
Expand Down Expand Up @@ -210,7 +211,9 @@ WS.WebsocketServer = Server.extend({
});
}

this._ioServer = new socketio(this._httpServer);
console.log(socketio);

this._ioServer = new socketio(this._httpServer, {path: '/browserquest'});
this._ioServer.on('connection', function webSocketListener(socket) {
log.info('Client socket connected from ' + socket.conn.remoteAddress);
// Add remoteAddress property
Expand Down