home to your local SPACEGIRL 💫 arimelody.space
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix config not saving with broken listeners, fix cursor ReferenceError

+9 -12
+5 -5
cursor/cursor.go
··· 88 88 client.Route = args[1] 89 89 90 90 mutex.Lock() 91 - for _, otherClient := range clients { 92 - if otherClient.ID == client.ID { continue } 93 - if otherClient.Route != client.Route { continue } 94 - client.Send([]byte(fmt.Sprintf("join:%d", otherClient.ID))) 95 - client.Send([]byte(fmt.Sprintf("pos:%d:%f:%f", otherClient.ID, otherClient.X, otherClient.Y))) 91 + for otherClientID, otherClient := range clients { 92 + if otherClientID == client.ID || otherClient.Route != client.Route { continue } 93 + client.Send([]byte(fmt.Sprintf("join:%d", otherClientID))) 94 + client.Send([]byte(fmt.Sprintf("pos:%d:%f:%f", otherClientID, otherClient.X, otherClient.Y))) 96 95 } 97 96 mutex.Unlock() 97 + 98 98 broadcast <- CursorMessage{ 99 99 []byte(fmt.Sprintf("join:%d", client.ID)), 100 100 client.Route,
+3 -4
public/script/config.js
··· 55 55 get crt() { return this._crt } 56 56 set crt(/** @type boolean */ enabled) { 57 57 this._crt = enabled; 58 + this.save(); 58 59 59 60 if (enabled) { 60 61 document.body.classList.add("crt"); ··· 66 67 this.#listeners.get('crt').forEach(callback => { 67 68 callback(this._crt); 68 69 }) 69 - 70 - this.save(); 71 70 } 72 71 73 72 get cursor() { return this._cursor } 74 73 set cursor(/** @type boolean */ value) { 75 74 this._cursor = value; 75 + this.save(); 76 76 this.#listeners.get('cursor').forEach(callback => { 77 77 callback(this._cursor); 78 78 }) 79 - this.save(); 80 79 } 81 80 82 81 get cursorFunMode() { return this._cursorFunMode } 83 82 set cursorFunMode(/** @type boolean */ value) { 84 83 this._cursorFunMode = value; 84 + this.save(); 85 85 this.#listeners.get('cursorFunMode').forEach(callback => { 86 86 callback(this._cursorFunMode); 87 87 }) 88 - this.save(); 89 88 } 90 89 } 91 90
+1 -3
public/script/cursor.js
··· 328 328 329 329 switch (args[0]) { 330 330 case 'id': { 331 - myCursor.id = Number(args[1]); 331 + myCursor.id = id; 332 332 break; 333 333 } 334 334 case 'join': { ··· 384 384 385 385 cursors.clear(); 386 386 myCursor = null; 387 - 388 - cursorContainer.remove(); 389 387 390 388 console.log(`Cursor no longer tracking.`); 391 389 running = false;