mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-03 17:10:20 +08:00
Added TODOs
This commit is contained in:
@@ -33,11 +33,13 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
updatePlayerInput = function (data) {
|
||||
var playerFound = false;
|
||||
|
||||
if(socket.id === data.id) {
|
||||
if(socket.socket.sessionid === data.id) {
|
||||
//TODO: Don't add if sequence state is already stored.
|
||||
updates.push(data);
|
||||
}
|
||||
else {
|
||||
for(var i = 0; i < players.length; i ++) {
|
||||
//TODO: Don't add if sequence state is already stored.
|
||||
if(players[i].id === data.id) {
|
||||
playerFound = true;
|
||||
players[i].state = data.state;
|
||||
|
||||
@@ -12,6 +12,7 @@ function GarageServerGame (socket, options) {
|
||||
GarageServerGame.prototype.updatePlayers = function () {
|
||||
var currentTime = new Date().getTime();
|
||||
for(var i = 0; i < this.players.length; i ++) {
|
||||
//TODO: Retink efficiency
|
||||
this.socket.emit('update', { id: this.players[i].client.id, state: this.players[i].state, seq: this.players[i].sequence, timestamp: currentTime });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user