refactor: update player position saving to include optional label for enhanced tracking
This commit is contained in:
@@ -326,7 +326,7 @@ wss.on('connection', (ws, req) => {
|
||||
} else if (data.type === 'player_update') {
|
||||
// Player position from pocket computer
|
||||
if (data.playerID && data.position) {
|
||||
db.savePlayerPosition(data.playerID, data.position);
|
||||
db.savePlayerPosition(data.playerID, data.position, data.label || null);
|
||||
broadcastToClients({
|
||||
type: 'player_update',
|
||||
playerID: data.playerID,
|
||||
@@ -1517,7 +1517,7 @@ app.post('/api/player/update', (req, res) => {
|
||||
return res.status(400).json({ error: 'Missing playerID or position' });
|
||||
}
|
||||
|
||||
db.savePlayerPosition(playerID, position);
|
||||
db.savePlayerPosition(playerID, position, label || null);
|
||||
|
||||
// Broadcast to WebSocket clients
|
||||
broadcastToClients({
|
||||
|
||||
Reference in New Issue
Block a user