baltica 2.0.8 → 2.0.9
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/dist/client/client.js +6 -2
- package/package.json +1 -1
package/dist/client/client.js
CHANGED
|
@@ -137,7 +137,9 @@ class Client extends utils_1.Emitter {
|
|
|
137
137
|
}
|
|
138
138
|
close() {
|
|
139
139
|
try {
|
|
140
|
-
this.raknet.close
|
|
140
|
+
if (this.raknet && typeof this.raknet.close === "function") {
|
|
141
|
+
this.raknet.close();
|
|
142
|
+
}
|
|
141
143
|
}
|
|
142
144
|
catch { }
|
|
143
145
|
this.removeAllListeners();
|
|
@@ -145,7 +147,9 @@ class Client extends utils_1.Emitter {
|
|
|
145
147
|
disconnect(reason = "client disconnect") {
|
|
146
148
|
this.emit("disconnect", reason);
|
|
147
149
|
setTimeout(() => {
|
|
148
|
-
this.raknet.disconnect
|
|
150
|
+
if (this.raknet && typeof this.raknet.disconnect === "function") {
|
|
151
|
+
this.raknet.disconnect();
|
|
152
|
+
}
|
|
149
153
|
this.removeAllListeners();
|
|
150
154
|
}, 50);
|
|
151
155
|
}
|