@colyseus/sdk 0.17.34 → 0.17.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +1 -2
  2. package/build/3rd_party/discord.cjs +1 -1
  3. package/build/3rd_party/discord.mjs +1 -1
  4. package/build/Auth.cjs +1 -1
  5. package/build/Auth.mjs +1 -1
  6. package/build/Client.cjs +1 -1
  7. package/build/Client.mjs +1 -1
  8. package/build/Connection.cjs +1 -1
  9. package/build/Connection.mjs +1 -1
  10. package/build/HTTP.cjs +1 -1
  11. package/build/HTTP.mjs +1 -1
  12. package/build/Room.cjs +8 -3
  13. package/build/Room.cjs.map +1 -1
  14. package/build/Room.d.ts +6 -0
  15. package/build/Room.mjs +8 -3
  16. package/build/Room.mjs.map +1 -1
  17. package/build/Storage.cjs +1 -1
  18. package/build/Storage.mjs +1 -1
  19. package/build/core/nanoevents.cjs +1 -1
  20. package/build/core/nanoevents.mjs +1 -1
  21. package/build/core/signal.cjs +1 -1
  22. package/build/core/signal.mjs +1 -1
  23. package/build/core/utils.cjs +1 -1
  24. package/build/core/utils.mjs +1 -1
  25. package/build/debug.cjs +12 -11
  26. package/build/debug.cjs.map +1 -1
  27. package/build/debug.mjs +12 -11
  28. package/build/debug.mjs.map +1 -1
  29. package/build/errors/Errors.cjs +1 -1
  30. package/build/errors/Errors.mjs +1 -1
  31. package/build/index.cjs +1 -1
  32. package/build/index.mjs +1 -1
  33. package/build/legacy.cjs +1 -1
  34. package/build/legacy.mjs +1 -1
  35. package/build/serializer/NoneSerializer.cjs +1 -1
  36. package/build/serializer/NoneSerializer.mjs +1 -1
  37. package/build/serializer/SchemaSerializer.cjs +1 -1
  38. package/build/serializer/SchemaSerializer.mjs +1 -1
  39. package/build/serializer/Serializer.cjs +1 -1
  40. package/build/serializer/Serializer.mjs +1 -1
  41. package/build/transport/H3Transport.cjs +1 -1
  42. package/build/transport/H3Transport.mjs +1 -1
  43. package/build/transport/WebSocketTransport.cjs +1 -1
  44. package/build/transport/WebSocketTransport.mjs +1 -1
  45. package/dist/colyseus-cocos-creator.js +8 -3
  46. package/dist/colyseus-cocos-creator.js.map +1 -1
  47. package/dist/colyseus.js +8 -3
  48. package/dist/colyseus.js.map +1 -1
  49. package/dist/debug.js +12 -11
  50. package/dist/debug.js.map +1 -1
  51. package/package.json +2 -2
  52. package/src/Room.ts +15 -2
  53. package/src/debug.ts +11 -10
  54. package/README.md +0 -27
  55. package/build/HTTP.bkp.d.ts +0 -103
  56. package/build/HTTP_bkp.d.ts +0 -18
  57. package/build/Protocol.cjs +0 -34
  58. package/build/Protocol.cjs.map +0 -1
  59. package/build/Protocol.d.ts +0 -21
  60. package/build/Protocol.mjs +0 -34
  61. package/build/Protocol.mjs.map +0 -1
  62. package/dist/colyseus.d.ts +0 -4148
package/build/debug.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.34
6
+ // colyseus.js@0.17.36
7
7
  'use strict';
8
8
 
9
9
  var Client = require('./Client.cjs');
@@ -42,7 +42,7 @@ const preferences = {
42
42
  position: 'top-right' // 'bottom-right', 'bottom-left', 'top-left', 'top-right'
43
43
  }
44
44
  };
45
- // Load preferences from localStorage
45
+ // Load preferences from localStorage (hidden state from sessionStorage)
46
46
  function loadPreferences() {
47
47
  try {
48
48
  const savedPrefs = localStorage.getItem('colyseus-debug-preferences') || '{}';
@@ -59,26 +59,26 @@ function loadPreferences() {
59
59
  preferences.latencySimulation.enabled = latencyValue > 0;
60
60
  }
61
61
  }
62
- // Load hidden state
63
- if (prefs.hidden === true) {
62
+ // Load hidden state from sessionStorage
63
+ if (sessionStorage.getItem('colyseus-debug-hidden') === 'true') {
64
64
  panelsHidden = true;
65
65
  }
66
66
  }
67
67
  catch (e) {
68
- // localStorage might not be available or JSON parse failed, ignore
68
+ // Storage might not be available or JSON parse failed, ignore
69
69
  }
70
70
  }
71
- // Save preferences to localStorage
71
+ // Save preferences to localStorage (hidden state to sessionStorage)
72
72
  function savePreferences() {
73
73
  try {
74
74
  localStorage.setItem('colyseus-debug-preferences', JSON.stringify({
75
75
  position: preferences.panelPosition.position,
76
76
  latency: preferences.latencySimulation.delay,
77
- hidden: panelsHidden
78
77
  }));
78
+ sessionStorage.setItem('colyseus-debug-hidden', panelsHidden ? 'true' : 'false');
79
79
  }
80
80
  catch (e) {
81
- // localStorage might not be available, ignore
81
+ // Storage might not be available, ignore
82
82
  }
83
83
  }
84
84
  // Panel visibility state
@@ -2354,10 +2354,11 @@ function applyMonkeyPatches() {
2354
2354
  // Generate a consistent room ID
2355
2355
  const roomId = room.roomId;
2356
2356
  const sessionId = room.sessionId;
2357
- // Generate unique panel ID: use sessionId if available, otherwise use roomId + timestamp
2358
- const uniquePanelId = sessionId && sessionId !== 'N/A' && sessionId !== ''
2357
+ // Generate unique panel ID: use roomId + sessionId to avoid collisions
2358
+ // when the same sessionId is reused across rooms (e.g. QueueRoom handoff)
2359
+ const uniquePanelId = roomId + '_' + (sessionId && sessionId !== 'N/A' && sessionId !== ''
2359
2360
  ? sessionId
2360
- : roomId + '-' + Date.now() + '-' + Math.random().toString(36).substring(2, 9);
2361
+ : Date.now() + '-' + Math.random().toString(36).substring(2, 9));
2361
2362
  const transport = (_a = room.connection) === null || _a === void 0 ? void 0 : _a.transport;
2362
2363
  const endpoint = ((_b = transport.ws) === null || _b === void 0 ? void 0 : _b.url) || 'N/A';
2363
2364
  const debugInfo = {