fix config not saving with broken listeners, fix cursor ReferenceError

This commit is contained in:
ari melody 2025-03-31 13:36:02 +01:00
parent 6db35b2f99
commit ed86aff2a2
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
3 changed files with 9 additions and 12 deletions

View file

@ -88,13 +88,13 @@ func handleClient(client *CursorClient) {
client.Route = args[1]
mutex.Lock()
for _, otherClient := range clients {
if otherClient.ID == client.ID { continue }
if otherClient.Route != client.Route { continue }
client.Send([]byte(fmt.Sprintf("join:%d", otherClient.ID)))
client.Send([]byte(fmt.Sprintf("pos:%d:%f:%f", otherClient.ID, otherClient.X, otherClient.Y)))
for otherClientID, otherClient := range clients {
if otherClientID == client.ID || otherClient.Route != client.Route { continue }
client.Send([]byte(fmt.Sprintf("join:%d", otherClientID)))
client.Send([]byte(fmt.Sprintf("pos:%d:%f:%f", otherClientID, otherClient.X, otherClient.Y)))
}
mutex.Unlock()
broadcast <- CursorMessage{
[]byte(fmt.Sprintf("join:%d", client.ID)),
client.Route,