-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add player join and quit messages. (#192)
* pumpkin: Add player join and quit messages. This implementation will send a 'joined the game' and 'left the game' message akin to the vanilla server when a player joins or disconnects respectively. One caveat with this implementation is that it only broadcasts the join/quit messages to players in the same world, unlike the vanilla server, which broadcasts it to all online players (regardless of their world). I discussed this with Alex who suggested to keep it as per-world (seemingly for now?) - [Discord conversation](https://discord.com/channels/1268592337445978193/1268611318617866261/1299668206734147597). Regardless, this implementation works perfectly on my end. (yes, it has been tested) * pumpkin: added logs for join/quit * Move disconnect message code to world from player Compiles and runs, sends join and quit messages in console with no errors. * Move join message from server to world
- Loading branch information
Showing
3 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ impl Server { | |
self.server_listing.lock().await.add_player(); | ||
} | ||
} | ||
|
||
(player, world.clone()) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters