playsocketjs 1.0.0 → 1.0.1

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.
package/README.md CHANGED
@@ -145,9 +145,8 @@ const app = express();
145
145
  const httpServer = http.createServer(app);
146
146
 
147
147
  // Create PlaySocket server with your HTTP server
148
- // Uses a custom path here (which you'll likely want to do if used this way)
149
- const playSocketServer = new PlaySocketServer({
150
- port,
148
+ // You'll likely want to use a custom path in this scenario
149
+ const playSocketServer = new PlaySocketServer({
151
150
  server: httpServer,
152
151
  path: '/socket'
153
152
  });
@@ -403,6 +403,10 @@ class PlaySocket {
403
403
  if (this.#socket) {
404
404
  this.#socket.close();
405
405
  this.#socket = null;
406
+
407
+ // Trigger events
408
+ this.#triggerEvent("status", "Destroyed.");
409
+ this.#triggerEvent("instanceDestroyed");
406
410
  }
407
411
 
408
412
  // Reset state
@@ -412,9 +416,6 @@ class PlaySocket {
412
416
  this.#storage = {};
413
417
  this.#roomId = null;
414
418
  this.#connectionCount = 0;
415
-
416
- this.#triggerEvent("status", "Destroyed.");
417
- this.#triggerEvent("instanceDestroyed");
418
419
  }
419
420
 
420
421
  // Public getters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playsocketjs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "WebSocket wrapper for creating simple multiplayer systems with ease.",
5
5
  "module": "dist/playsocket-client.js",
6
6
  "exports": {