Skip to content

Commit 55ddebc

Browse files
committed
[v7.0] Reconnect!
1 parent 355423c commit 55ddebc

File tree

7 files changed

+10
-0
lines changed

7 files changed

+10
-0
lines changed

Client/scripts/gameLoopHandlers/gameLoopHandlers.gml

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ addHandler("play", function(data) {
5353
})
5454

5555

56+
addHandler("reconnect", function(data) {
57+
trace("reconnected!")
58+
})
59+
5660
// changing rooms
5761
addHandler("room transition", function(data) {
5862
if (use_timestamps(data)) return;

JavascriptServer/concepts/client.js

+3
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,14 @@ export default class Client extends SendStuff {
237237
}
238238

239239
onReconnect() {
240+
this.send({ cmd: 'reconnect' /* ... */ });
241+
240242
if (this.lobby)
241243
this.sendLobbyJoin(this.lobby);
242244
if (this.room && this.entity)
243245
this.sendPlay(this.lobby, this.room, this.entity.pos, this.entity.uuid);
244246

247+
// receive all entities from the room once again
245248
this.room_join_timer = global.config.room.recently_joined_timer;
246249
}
247250

Release/GMClient.zip

13 Bytes
Binary file not shown.

Release/JSServer.zip

957 Bytes
Binary file not shown.

Release/TSServer.zip

41 Bytes
Binary file not shown.

Release/Warp.yymps

13 Bytes
Binary file not shown.

TypescriptServer/src/concepts/client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,14 @@ export default class Client extends SendStuff implements IClient {
257257
}
258258

259259
onReconnect() {
260+
this.send({ cmd: 'reconnect' /* ... */ });
261+
260262
if (this.lobby)
261263
this.sendLobbyJoin(this.lobby);
262264
if (this.room && this.entity)
263265
this.sendPlay(this.lobby, this.room, this.entity.pos, this.entity.uuid);
264266

267+
// receive all entities from the room once again
265268
this.room_join_timer = global.config.room.recently_joined_timer;
266269
}
267270

0 commit comments

Comments
 (0)