Skip to content

Commit

Permalink
[v7.0] Reconnect!
Browse files Browse the repository at this point in the history
  • Loading branch information
evolutionleo committed Dec 4, 2024
1 parent 355423c commit 55ddebc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Client/scripts/gameLoopHandlers/gameLoopHandlers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ addHandler("play", function(data) {
})


addHandler("reconnect", function(data) {
trace("reconnected!")
})

// changing rooms
addHandler("room transition", function(data) {
if (use_timestamps(data)) return;
Expand Down
3 changes: 3 additions & 0 deletions JavascriptServer/concepts/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,14 @@ export default class Client extends SendStuff {
}

onReconnect() {
this.send({ cmd: 'reconnect' /* ... */ });

if (this.lobby)
this.sendLobbyJoin(this.lobby);
if (this.room && this.entity)
this.sendPlay(this.lobby, this.room, this.entity.pos, this.entity.uuid);

// receive all entities from the room once again
this.room_join_timer = global.config.room.recently_joined_timer;
}

Expand Down
Binary file modified Release/GMClient.zip
Binary file not shown.
Binary file modified Release/JSServer.zip
Binary file not shown.
Binary file modified Release/TSServer.zip
Binary file not shown.
Binary file modified Release/Warp.yymps
Binary file not shown.
3 changes: 3 additions & 0 deletions TypescriptServer/src/concepts/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,14 @@ export default class Client extends SendStuff implements IClient {
}

onReconnect() {
this.send({ cmd: 'reconnect' /* ... */ });

if (this.lobby)
this.sendLobbyJoin(this.lobby);
if (this.room && this.entity)
this.sendPlay(this.lobby, this.room, this.entity.pos, this.entity.uuid);

// receive all entities from the room once again
this.room_join_timer = global.config.room.recently_joined_timer;
}

Expand Down

0 comments on commit 55ddebc

Please sign in to comment.