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') {
|
} else if (data.type === 'player_update') {
|
||||||
// Player position from pocket computer
|
// Player position from pocket computer
|
||||||
if (data.playerID && data.position) {
|
if (data.playerID && data.position) {
|
||||||
db.savePlayerPosition(data.playerID, data.position);
|
db.savePlayerPosition(data.playerID, data.position, data.label || null);
|
||||||
broadcastToClients({
|
broadcastToClients({
|
||||||
type: 'player_update',
|
type: 'player_update',
|
||||||
playerID: data.playerID,
|
playerID: data.playerID,
|
||||||
@@ -1517,7 +1517,7 @@ app.post('/api/player/update', (req, res) => {
|
|||||||
return res.status(400).json({ error: 'Missing playerID or position' });
|
return res.status(400).json({ error: 'Missing playerID or position' });
|
||||||
}
|
}
|
||||||
|
|
||||||
db.savePlayerPosition(playerID, position);
|
db.savePlayerPosition(playerID, position, label || null);
|
||||||
|
|
||||||
// Broadcast to WebSocket clients
|
// Broadcast to WebSocket clients
|
||||||
broadcastToClients({
|
broadcastToClients({
|
||||||
|
|||||||
Reference in New Issue
Block a user