-
Notifications
You must be signed in to change notification settings - Fork 24
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
Synchronize #53
Closed
Closed
Synchronize #53
Conversation
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
For now it seems that the developers have designed this to be required. Its not an actual module but a placeholder for Types and other things to minimize the bloat in the minecraft/server module. Nobody knows at this time if bundling this with the behavior pack will remain a requirement in the future or if this is temporary. For now we ship it.
The before event essentially listens to verify if a command is given using the prefix and cancels messages being sent if true or if the prefix command doesn't exist we cancel the messages and notify the player. If in cases where a prefix is recognised we listen to the after event where we handle the commands. Canceling the message in the before event now cancels the after event since there is no message being broadcasted any longer. Canceling should only be used in delicate cases where its suitable. Otherwise we simply prevent broadcasting to any targeted player by ignoring them using 'sendToTargets'. This effectively allows the command handler to continue functioning by design in 1.20 with the current changes made in the API without causing issues, overlapping, race conditions, etc.
Starts from 0 and counts up versus the old style where it starts at 1 and counts down.
Where applicable. There were a few exceptions.
vanilla-data returns an enum for MinecraftEnchantmentTypes. In the "for loop" it returns a key with each iteration. The code plugged it in assuming it was returning the string. We now correctly get the string by using the key as an index for MinecraftEnchantmentTypes to return the actual string for hasEnchantment() so we can obtain the proper number in return.
- Moved the following dependencies from devDependencies to dependencies: - @minecraft/server-ui: v1.2.0-beta.1.20.10-stable - @minecraft/server: v1.4.0-beta.1.20.10-stable - typescript: v5.1.6 These changes were made to better organize the dependencies and ensure they are in their appropriate sections for improved maintenance and development workflow.
In this commit, I have introduced significant security improvements by switching to AES encryption for both hashing and data encryption in the following functions: 1. `crypto`: The custom hashing algorithm used in the `crypto` function has been replaced with AES encryption from `CryptoJS.AES.encrypt`. This change enhances the security and integrity of the hash generation process, making it more resilient against potential attacks. The provided salt is now utilized as the encryption key for AES, ensuring robust and reliable hashing. 2. `encryptString`: I have updated the `encryptString` function to use AES encryption for data encryption. The function now employs `CryptoJS.AES.encrypt` to securely encrypt the input string with the provided salt as the encryption key. This transition to AES ensures that sensitive data is adequately protected and remains confidential. 3. `decryptString`: The `decryptString` function has been revamped to complement the new AES encryption used in `encryptString`. It now properly removes the prefix added during encryption and decrypts the AES-encrypted string using `CryptoJS.AES.decrypt`. The decrypted data is then converted to a UTF-8 string, ensuring seamless compatibility and data integrity. These changes significantly bolster the security of Paradox, making it more resilient against potential vulnerabilities and unauthorized access.
Currently set up to be backward compatible with the old method only for a short time and then such code will be removed.
The crypto function has been updated to use SHA3-256 hashing algorithm instead of AES encryption for improved security. SHA3-256 provides stronger cryptographic properties, making it a more suitable choice for hashing sensitive data such as passwords and salts. This change ensures better protection against potential attacks and enhances the overall security of the application. The AES encryption was previously used in the crypto function, but it was found that even with the same salt and password, the output (hash) could vary due to the nature of AES encryption. This inconsistency could lead to false negatives during verification, causing potential issues with permissions and access control. By switching to SHA3-256, we ensure that the same salt and password always produce the same hash, allowing consistent verification and accurate comparison during permission checks.
Previous test was a fluke. Mistakenly and erroneously determined that the unique identifier worked but later tests showed I was wrong. This patch corrects my mistake.
This reverts commit 64d4190.
…unction The old code for the isAttackingFromOutsideView function had a mistake in the angle calculation logic, which caused incorrect results when checking if player2 is in view of player1. The function was incorrectly calculating both angle1 and angle2 and comparing them to 90 degrees, resulting in an incorrect evaluation. In the new code, we have updated the isAttackingFromOutsideView function to only calculate angle2, representing the angle between the view direction of player1 towards player2. By doing so, we accurately determine if player2 is in view of player1. With this fix, the function now correctly checks if player2 is or is not in view of player1 and returns the appropriate result.
This commit addresses memory management and potential memory leaks by optimizing the code for storing player inventory data. Maps are utilized to associate player IDs with their respective data, promoting organized and efficient management of player-related information. Additionally, proper data clearance procedures are now in place upon player logout, mitigating unnecessary memory consumption.
This commit refactors the `illegalItemsB` script to improve memory management, similar to the approach used in `illegalItemsA`. The code now employs more efficient data handling techniques, including proper clearing of maps and data structures when needed. This reduces the risk of memory leaks during gameplay.
…eplacement The regular expressions used for ban and kick checks were missing the 'g' flag, resulting in an error. This commit adds the 'g' flag to the regular expressions, ensuring they are applied globally. Additionally, corrected the usage of the 'replaceAll' method with regular expressions, using the 'replace' method with the 'g' flag as appropriate.
This commit enhances accuracy by incorporating the entityHurt and playerSpawn events. The entityHurt event prevents false flagging caused by knockback effects, ensuring fair movement analysis. Additionally, the playerSpawn event prevents false flagging due to sudden movements during respawns. These additions enhance cheat detection precision while maintaining gameplay integrity.
This commit enhances accuracy by incorporating the entityHurt and playerSpawn events. The entityHurt event prevents false flagging caused by knockback effects, ensuring fair movement analysis. Additionally, the playerSpawn event prevents false flagging due to sudden movements during respawns. These additions enhance cheat detection precision while maintaining gameplay integrity.
…r players This commit introduces an optimization to the existing code by utilizing the emptySlotsCount property of the Container object. The previousEmptySlotsCount map is used to track changes in the number of empty slots in each player's inventory. When iterating through players, the current empty slots count is compared with the previously stored value. If there's a change, the code iterates through the player's inventory; otherwise, the iteration is skipped. This enhancement aims to minimize unnecessary inventory iterations and improve overall performance.
Improved and clarified command examples for various commands.
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.
Bring repo in sync with fork