Refactor
This commit is contained in:
parent
7e5d0b93a9
commit
a6ec9bfa6e
1 changed files with 1 additions and 8 deletions
|
@ -91,41 +91,34 @@ clientNSP.on('connection', socket => {
|
||||||
|
|
||||||
// monitorNSP.emit('updateGameState', 1);
|
// monitorNSP.emit('updateGameState', 1);
|
||||||
|
|
||||||
socket.on('moveStart_left', () => {
|
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
||||||
|
socket.on('moveStart_left', () => {
|
||||||
console.log('moveStart_left: ' + pl.type);
|
console.log('moveStart_left: ' + pl.type);
|
||||||
monitorNSP.emit('moveStart_left', pl.type);
|
monitorNSP.emit('moveStart_left', pl.type);
|
||||||
});
|
});
|
||||||
socket.on('moveStart_right', () => {
|
socket.on('moveStart_right', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveStart_right: ' + pl.type);
|
console.log('moveStart_right: ' + pl.type);
|
||||||
monitorNSP.emit('moveStart_right', pl.type);
|
monitorNSP.emit('moveStart_right', pl.type);
|
||||||
});
|
});
|
||||||
socket.on('moveStart_jump', () => {
|
socket.on('moveStart_jump', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveStart_jump: ' + pl.type);
|
console.log('moveStart_jump: ' + pl.type);
|
||||||
monitorNSP.emit('moveStart_jump', pl.type)
|
monitorNSP.emit('moveStart_jump', pl.type)
|
||||||
});
|
});
|
||||||
socket.on('moveStart_crouch', () => {
|
socket.on('moveStart_crouch', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveStart_crouch: ' + pl.type);
|
console.log('moveStart_crouch: ' + pl.type);
|
||||||
});
|
});
|
||||||
socket.on('moveEnd_left', () => {
|
socket.on('moveEnd_left', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveEnd_left: ' + pl.type);
|
console.log('moveEnd_left: ' + pl.type);
|
||||||
monitorNSP.emit('moveEnd_left', pl.type);
|
monitorNSP.emit('moveEnd_left', pl.type);
|
||||||
});
|
});
|
||||||
socket.on('moveEnd_right', () => {
|
socket.on('moveEnd_right', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveEnd_right: ' + pl.type);
|
console.log('moveEnd_right: ' + pl.type);
|
||||||
monitorNSP.emit('moveEnd_right', pl.type);
|
monitorNSP.emit('moveEnd_right', pl.type);
|
||||||
});
|
});
|
||||||
socket.on('moveEnd_jump', () => {
|
socket.on('moveEnd_jump', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveEnd_jump: ' + pl.type);
|
console.log('moveEnd_jump: ' + pl.type);
|
||||||
});
|
});
|
||||||
socket.on('moveEnd_crouch', () => {
|
socket.on('moveEnd_crouch', () => {
|
||||||
let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]);
|
|
||||||
console.log('moveEnd_crouch: ' + pl.type);
|
console.log('moveEnd_crouch: ' + pl.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Reference in a new issue