tempest.games 0.2.95 → 0.2.97

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.
@@ -3063,7 +3063,7 @@ var ParentSocket = class extends CustomSocket {
3063
3063
  incompleteData = ``;
3064
3064
  unprocessedEvents = [];
3065
3065
  relays;
3066
- relayServices;
3066
+ initRelay;
3067
3067
  proc;
3068
3068
  id = `#####`;
3069
3069
  log(...args) {
@@ -3089,7 +3089,9 @@ var ParentSocket = class extends CustomSocket {
3089
3089
  this.proc = proc;
3090
3090
  this.proc.stdin.resume();
3091
3091
  this.relays = /* @__PURE__ */ new Map;
3092
- this.relayServices = [];
3092
+ this.initRelay = () => {
3093
+ this.logger.info(`\uD83D\uDD17`, `nothing to relay`);
3094
+ };
3093
3095
  this.proc.stdin.on(`data`, (buffer) => {
3094
3096
  const pieces = buffer.toString().split(`\x03`);
3095
3097
  const initialMaybeWellFormed = pieces[0];
@@ -3144,15 +3146,13 @@ var ParentSocket = class extends CustomSocket {
3144
3146
  if (this.proc.pid)
3145
3147
  this.id = this.proc.pid?.toString();
3146
3148
  this.on(`user-joins`, (userKey) => {
3147
- this.logger.info(`\uD83D\uDC64`, `user`, userKey, `joined`);
3149
+ this.logger.info(`\uD83D\uDC64`, userKey, `joined`);
3148
3150
  const relay = new SubjectSocket(userKey);
3149
3151
  this.relays.set(userKey, relay);
3150
- this.logger.info(`\uD83D\uDD17`, `attaching services:`, `[${[...this.relayServices.keys()].join(`, `)}]`);
3151
- for (const attachRelay of this.relayServices) {
3152
- const cleanupRelay = attachRelay(relay, userKey);
3153
- if (cleanupRelay)
3154
- relay.disposalFunctions.push(cleanupRelay);
3155
- }
3152
+ this.logger.info(`\uD83D\uDD17`, `attaching services for user`, userKey);
3153
+ const cleanupRelay = this.initRelay(relay, userKey);
3154
+ if (cleanupRelay)
3155
+ relay.disposalFunctions.push(cleanupRelay);
3156
3156
  this.on(userKey, (...data) => {
3157
3157
  relay.in.next(data);
3158
3158
  });
@@ -3172,7 +3172,7 @@ var ParentSocket = class extends CustomSocket {
3172
3172
  }
3173
3173
  receiveRelay(attachServices) {
3174
3174
  this.logger.info(`\uD83D\uDD17`, `running relay method`);
3175
- this.relayServices.push(attachServices);
3175
+ this.initRelay = attachServices;
3176
3176
  }
3177
3177
  };
3178
3178
  var ChildSocket = class extends CustomSocket {