#145 Implement Minecraft player list component#176
Merged
kevinzhang03 merged 22 commits into0.4.3from Mar 1, 2023
Merged
Conversation
…Team/lodestone into 145-0.4.3-player-list
… resolution of avatar
… resolution of avatar
…Team/lodestone into 145-0.4.3-player-list
✅ Deploy Preview for lodestone-dashboard ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for lodestone-storybook ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
joeywangzr
reviewed
Feb 25, 2023
| const { selectedInstance: instance } = useContext(InstanceContext); | ||
| const uuid = instance?.uuid; | ||
|
|
||
| // JUST FOR TESTING |
Ynng
requested changes
Feb 25, 2023
Member
Ynng
left a comment
There was a problem hiding this comment.
overall really nice, just a few small things
mostly regarding the player list use state
|
|
||
| // Default value of playerList will be an empty array since we cannot have useState after a conditional block | ||
| const [playerList, setPlayerList] = useState([ | ||
| { type: 'MinecraftPlayer', uuid: '', name: ''} |
Member
|
also the icon looks a bit small... can you @Arcslogger take a look next week? |
…t neighbour on avatar, cleanup
Ynng
approved these changes
Mar 1, 2023
Member
Ynng
left a comment
There was a problem hiding this comment.
code looks good! let's merge this pr.
@CheatCod when can we get the player_list api changed merged to the backend?
https://github.com/Lodestone-Team/lodestone_core/tree/player_list_in_instance_info
Member
|
backend will follow up once the configurable refactor is merged in |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#145
Implements a Minecraft player list component that displays the player's username and avatar picture, and updates in real time as players join or leave the server. The profile pictures are retrieved from https://mc-heads.net/#basic using the player's UUID. The NAME button above the list allows for sorting usernames in alphabetical or reverse alphabetical order.
If there is no one online, the text changes to say "No players online".
The main files that contribute to this PR are are MinecraftPlayerList.tsx and PlayerListCard.tsx. MinecraftPlayerList.tsx mainly handles player data like setting the avatar and tracking online players, while PlayerListCard.tsx contains the UI.
InstanceInfo.ts and EventStream.ts also had to be modified in some way to support
Playerobjects and updating the list of them to reflect in the UI in real time.Type of change
How Has This Been Tested?
Extremely thorough testing B)