-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Skyblock Joining & Leaving Logic, Fixed Location updates, Added Logging. #12
Conversation
Previously discussed with another developer a better way to determine when a client was joining a new skyblock world. This triggers on every single new join of world. Making sure that mods get the most up-to-date info from the client. Added some simple logging statements as well to further troubleshoot & test the aspects of Join & leave functions. Lastly, I moved the Location updateing code up to the Objective Update class, as it functioning requires updating on every objective update received from the client. SkyblockCore.java Added some simple logging to Location change event registry for testing to make sure it works correctly.
Previously discussed with another developer a better way to determine when a client was joining a new skyblock world. This triggers on every single new join of world. Making sure that mods get the most up-to-date info from the client. Added some simple logging statements as well to further troubleshoot & test the aspects of Join & leave functions. Lastly, I moved the Location updateing code up to the Objective Update class, as it functioning requires updating on every objective update received from the client. SkyblockCore.java Added some simple logging to Location change event registry for testing to make sure it works correctly.
Looks fine for the join and leave detection, given it works ofcourse. But for the logging, wouldn't devs just register a listener themselves to get a debug message like that? And furthermore, putting the actual message between "{}" doesn't make a whole lot of sense as those are generally used to log objects. Also when using the LOGGER object, the message is already prefixed with "(skyblockcore)" (the modid), so adding the name of the mod again also does not make that much sense. |
Haha, forgot to mention, I did some basic testing with Dungeons, Skyblock hub, Personal island, Main Lobby, and Prototype lobby and it worked flawlessly for the logic on the ones I tested here. However I need a bit more testing to make sure Kuudra, Rift, Straight to limbo, and all other Skyblock islands work, but I did not have time for those today.
Yes, but also, if its just built in, that allows people reporting issues/developers trying to find out why their mods not working with the core mod to do it without recompiling and re-logging into Hypixel.
Only did this for visibility sake temporarily while writing this. In the future, I'd like to have something more professional yes.
It in fact did not prefix my logs with that. Examples below: As to why it did not. I have no clue. Wasn't due to anything special that I am aware of either in the development environment/client testing I did there. (And yes, I was hoping it would actually prefix it, but since it didn't, I made this change to be able to spot it within my logs for the time being.) |
didnt mean to even push here but chAnGeS Changes
|
This reverts commit 13b933e.
### Changes - Changed all of the formatting of joining/leaving skyblock and zone changes to be a bit more simplified - Added a dev mode (currently there is no way to toggle this, to turn this off go to `src\main\...\SkyblockCore.java\` it is currently set to `TRUE` - @wiviw5 and I talked about adding some sort of ingame command and config, I have been working on this and the pr should come soon enough I have verifed that I am commiting to pr/12 I have checked and tested my code and it has launched and dev mode has worked both on `TRUE` and `FALSE`
Added better formatting for logs Changes
I have verifed that I am commiting to pr/12 |
SkyblockCore.java Temporary of course until we move these to a better class. But now the developer mode applies to all logging attempts and now looks like the other developer logs.
I fixed the last bit of formatting here, its of course still temporary. But now looks better for transitions between locations. |
Thanks! I actually fixed it but when i was re-pr'ing it somehow got deleted |
If you want you can start working on the command (or anyone else) since I can probably finish the config |
that's crazy |
👍 my phone vibrated for you, good job! |
got an email for that, good job! |
## Additions - Config creator and handler in JSON - Added a dev toggle and location toggle ## Changes - Merged formatting used in the last commit in this pr from @wiviw - Changed a few logging things to include MODID I have tested my code and it has launched with all toggles tested I have changed where I am commiting I have added information on how to add a config option in ModConfig.java ### TODO for this pr - Add a command ingame to toggle - at some point documentation...
Added a config file, and formatting Additions
Changes
I have tested my code and it has launched with all toggles tested TODO for this pr
|
…king still. No, it's not coded nicely. However, it works. Also, moved the config loading & Command registry to the correct areas of the main initialization, otherwise we get the wrong information. I also fixed the developer logger information from getting out of date data from an initial load object, to one that grabs the most up-to-date info from the loaded config. (it does not load from disk every time, just load from memory) SkyblockCoreCommand.java Completely new class. This is in basic the most simple reload config command I could make. In the future, we will have different `/skyblockcore <subcommand> <options>` Under this, it should have: - reload (Reloads from the config file) - nbt (Similar to the "/sba dev" or "/skytils dev nbt" commands, it grabs data from hovered items/entities. Useful for devs and curious people.) - dev (Shows in depth data about all developer related aspects, such as the dev packets.) - location (Shows in depth location data being handled and shown to mods)
Fixed some config file shenanigans & tested out a new command. (made sure that when checking if developer/location feedback mode was enabled was actually respected.) (Note, tested on development environment & Real Client.) AdditionsAdded a local only command to do testing with, and to eventually give users feedback. Currently looking at: With the subcommands being:
Changes
TODO
|
src/main/java/io/github/skyblockcore/command/SkyblockCoreCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/skyblockcore/command/SkyblockCoreCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/skyblockcore/command/SkyblockCoreCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/skyblockcore/mixin/PlayNetworkHandlerMixin.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/skyblockcore/mixin/PlayNetworkHandlerMixin.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Ascynx <78341107+Ascynx@users.noreply.github.com>
…nd.java Co-authored-by: Ascynx <78341107+Ascynx@users.noreply.github.com>
…nd.java Co-authored-by: Ascynx <78341107+Ascynx@users.noreply.github.com>
…nd.java Co-authored-by: Ascynx <78341107+Ascynx@users.noreply.github.com>
fix and optimise sub-island location detection from scoreboard
Fixed the (sub-island) location listener. It used to listen only for objective updates, but the location isn't actually an objective name - instead it's a team name. Now we only update the location when we actually receive a team update packet from Hypixel with the location character (U+23E3) as the first character (excluding whitespace). Works very reliably, and updates instantly when the player location changes in scoreboard. Added bonus effect of partial location updates as Hypixel partially updates the location (but these only persist for a few milliseconds until Hypixel sends the full update). |
### Changes - Made the TITLE string public - Made scoreboard strings public - Removed the private versions of ^ - Removed some random lines blankness - Formatted a tiny bit of logging and changed a few things ### Additions - Commands now have ingame replies (No color yet, and just basic they still dont do stuff) ### TODO - Make commands do stuff - Add color to commands - change around some logging - Fix config being nullable - add a time calc for reloading config - add a way to reload config - fix all of the headaches with LOGGER sometimes showing weird stuff - Fix issues with location I have checked that my code works in developer launch and normal minecraft
Fixed up player checks. |
src/main/java/io/github/skyblockcore/command/SkyblockCoreCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/skyblockcore/mixin/PlayNetworkHandlerMixin.java
Outdated
Show resolved
Hide resolved
…nd.java Remove unneeded meme comment.
…skyblock. This removes a single string comparison now that we check for anything but specific strings associated with skyblock.
Changed around format of getting whether the user has joined or left Skyblock. This removes a single string comparison now that we check for anything but specific strings associated with Skyblock. |
Additions
Changes
I have tested this and it has launched and built in dev and in minecraft TODO
|
Is this ready for reviews? |
You have pending changes iirc |
This updated code is for a new bit of logic where Detection is based on what the active scoreboard name is, rather than the old system of updating based on reading a line from the scoreboard (which broke during
SKIBLOCK
).How it works:
Joining to a Hypixel lobby gives us for example
Prototype
as a new name. Telling us that the client no longer is within Skyblock.Joining into Skyblock, we receive two Scoreboards, one named
health
and the otherSBScoreboard
, this also goes along with transferring islands, we also receive this set of packets.We ignore
health
as this can lead to false positives for other gamemodes (As it is a common name for scoreboard names)Next, we check for if it contains
SBScoreboard
and if it does, then we interact with the event, and we are officially "on Skyblock"lastly, we check for any other Scoreboard, if we do not find
SBScoreboard
but another one, we interact with the Leave Skyblock event, and are "off Skyblock"Currently known edge cases
One edge case of this code is that if we go straight to limbo (skipping any hub/lobby) The "leave" code is never activated, and we continue to think we are still on Skyblock, even if we leave and go to another server without a scoreboard or to a singleplayer world without a scoreboard.
So, this would affect a very minor subset of servers/singleplayer worlds, however, can be fixed with a simple IP check for
*.hypixel.net
(Not implemented) which would then only affect people who get booted straight to limbo. Please let me know if anyone has any solutions to this.Location Changes
Updated the location change code to the function of
onScoreboardDisplay
, as it needs to update on every single Scoreboard update currently.Logging Changes
Added logging for new Location change code, along with the join/leave Skyblock code.
In the future, this should be behind a toggle for developers for simply debugging if anything goes wrong with this code.