fix bug with signs for players

This commit is contained in:
rofl256 2017-07-25 01:58:25 +02:00
parent 4addf2696a
commit fdb5637e3b
2 changed files with 8 additions and 6 deletions

View File

@ -34,12 +34,16 @@ socket.on('getmap', function (conent) {
socket.on('objAction', function (obj) {
console.log(obj);
var mapX = obj["mapX"]*32;
var mapY = obj["mapY"]*32;
$(".overlay").remove();
$("#main").append('<div class="overlay" id="" style="background: rgba(206, 0, 104, 0.45); width:32px; height:32px; z-index:2; position:absolute; top:'+mapY+'px; left:'+mapX+'px;"></div>');
var mapY = obj["mapY"]*32+3;
$(".overlay"+obj["socketId"]).remove();
$("#main").append('<div class="overlay'+obj["socketId"]+'" id="" style="background: rgba(206, 0, 104, 0.45); width:32px; height:32px; z-index:2; position:absolute; top:'+mapY+'px; left:'+mapX+'px;"></div>');
});
socket.on('stopAction', function (socketId) {
$(".overlay"+socketId).remove();
});
socket.on('removeUtil', function (obj) {
console.log(obj);
$("."+obj["mapY"]+'-'+obj["mapX"]+'.'+obj["name"]).remove();
@ -214,9 +218,6 @@ $(document).ready(function() {
$( document ).keyup(function( event ) {
var key = event.which;
socket.emit("keyUp", key );
if(key==32) {
$(".overlay").remove();
}
keys[key] = false;
});

View File

@ -62,6 +62,7 @@ io.on('connection', function(socket){
clearTimeout(playerActionTimer);
playerActionTimer = null;
}
io.sockets.emit("stopAction", socket.id);
}
});