a
This commit is contained in:
parent
63208cd293
commit
8d4b7a2376
1 changed files with 14 additions and 2 deletions
|
@ -14,13 +14,27 @@ app.get('/', (req, res) => {
|
|||
res.send('Grand Tabernacle Auto VI');
|
||||
});
|
||||
|
||||
players.push({
|
||||
id: playerCount,
|
||||
x: 0,
|
||||
y: 0,
|
||||
dir: 0,
|
||||
visibleDir: 0,
|
||||
name: playerCount.toString() + "joueur"
|
||||
})
|
||||
playerCount++;
|
||||
|
||||
function createNewPlayer(socket){
|
||||
var obj = {
|
||||
id: playerCount,
|
||||
x: 0,
|
||||
y: 0,
|
||||
dir: 0,
|
||||
visibleDir: 0,
|
||||
name: playerCount.toString() + "joueur"
|
||||
}
|
||||
players.push(obj);
|
||||
playerCount++;
|
||||
|
||||
socket.send(JSON.stringify({
|
||||
type: "connect",
|
||||
|
@ -37,8 +51,6 @@ function createNewPlayer(socket){
|
|||
|
||||
socket.id = obj.id;
|
||||
connections.add(socket);
|
||||
players.push(obj);
|
||||
playerCount++;
|
||||
}
|
||||
|
||||
wss.on('connection', (socket) => {
|
||||
|
|
Loading…
Reference in a new issue