Conversation
|
Warning Rate limit exceeded@Spatison has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 14 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe pull request introduces new localization files for the ghost respawn feature in both English and Russian, including strings that inform players about respawn mechanics, such as time remaining, maximum player limits, and rules regarding knowledge transfer from previous characters. Additionally, it removes certain localization strings in the Russian GUI file, indicating a potential simplification of the user interface related to ghost respawning. A new dependency is added to the game logic to enhance tracking of ghost return attempts. Changes
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
Content.Server/GameTicking/GameTicker.GamePreset.cs (1)
25-25: Dependency injection looks good, but improve the comment.The dependency injection for
GhostReturnToRoundSystemis properly set up. However, the "WD EDIT" comment is unclear. Consider using a more descriptive comment to convey the purpose of this change.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- Content.Client/Ghost/GhostSystem.cs (1 hunks)
- Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs (3 hunks)
- Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml (1 hunks)
- Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml.cs (2 hunks)
- Content.Server/GameTicking/GameTicker.GamePreset.cs (3 hunks)
- Content.Server/GameTicking/GameTicker.Spawning.cs (3 hunks)
- Content.Server/_White/Ghost/GhostReturnToRoundSystem.cs (1 hunks)
- Content.Shared/Ghost/SharedGhostSystem.cs (1 hunks)
- Content.Shared/_White/CVars.cs (2 hunks)
- Resources/Locale/en-US/_white/ghost/ghost-gui.ftl (1 hunks)
- Resources/Locale/en-US/_white/ghost/ghost-respawn.ftl (1 hunks)
- Resources/Locale/ru-RU/_white/ghost/ghost-gui.ftl (1 hunks)
- Resources/Locale/ru-RU/_white/ghost/ghost-respawn.ftl (1 hunks)
Files skipped from review due to trivial changes (2)
- Resources/Locale/en-US/_white/ghost/ghost-gui.ftl
- Resources/Locale/ru-RU/_white/ghost/ghost-gui.ftl
Additional comments not posted (29)
Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml (1)
8-8: LGTM!The addition of the "ReturnToRound" button aligns with the PR objectives to enhance the user experience by providing players with a straightforward option to respawn after their character has died. The button is correctly placed within the
BoxContaineralongside other navigation buttons, and the localization syntax is used appropriately to ensure the button text can be translated.Resources/Locale/ru-RU/_white/ghost/ghost-respawn.ftl (7)
1-4: LGTM!The code segment correctly handles the pluralization of the word "minute" based on the value of
$timefor the Russian language.
5-5: LGTM!The code segment clearly conveys the message that the respawn function is not available when the number of players on the server exceeds a certain limit.
6-7: LGTM!The code segment effectively communicates the respawn rules, emphasizing the obligation not to transfer knowledge from the previous character to the new one and mentioning the penalty for violating this rule.
8-8: LGTM!The code segment handles the scenario when the time of death is missing and sets a default value.
9-9: LGTM!The code segment provides clear instructions to the player to change the character in the character settings when trying to respawn as the same character.
11-14: LGTM!The code segment correctly handles the different verb forms for logging when a player enters or attempts to enter the round after returning to the lobby with a similar name.
15-15: LGTM!The code segment clearly logs when a player returns to the lobby.
Resources/Locale/en-US/_white/ghost/ghost-respawn.ftl (8)
1-3: LGTM!The localization string correctly uses a selector to display the appropriate plural form of "minute" based on the value of
$time. The Fluent syntax is followed accurately.
4-4: LGTM!The localization string correctly conveys the message that the respawn function is not available when the number of players on the server exceeds a certain limit. The
$playersvariable is used appropriately to display the number of players.
5-5: LGTM!The localization string correctly defines the title for the window displaying the rules for returning to the round.
6-6: LGTM!The localization string effectively communicates the rules and consequences of using the respawn feature. The use of color tags helps highlight important parts of the message, such as the agreement not to transfer knowledge and the potential ban for violating the rules. The Fluent syntax is followed correctly.
7-7: LGTM!The localization string correctly informs the user that when there is no time of death available, a standard value is set. The message is clear and concise.
8-8: LGTM!The localization string correctly informs the user that they cannot enter the round for the same character after respawning and suggests changing the character in the settings. The message is clear and provides a helpful suggestion to the user.
10-13: LGTM!The localization string correctly logs a message when a player joins or tries to join the round after respawning with a similar name. It uses a selector to display the appropriate verb form based on the value of
$try. The placeholders for the player's name, old name, and new name are used correctly. The Fluent syntax is followed accurately.
14-14: LGTM!The localization string correctly logs a message when a user returns to the lobby. The placeholder for the user's name (
$userName) is used appropriately. The message is clear and concise.Content.Shared/_White/CVars.cs (1)
35-41: LGTM!The new configuration variables for ghost respawn functionality are implemented correctly:
- Variable names are clear and descriptive.
- Default values are reasonable.
- Server-only access is appropriate.
- Code follows the existing style and structure of the class.
The changes align with the PR objective of adding a respawn button in the ghost menu.
Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml.cs (2)
17-17: LGTM!The new event
ReturnToRoundPressedis declared correctly in theGhostGuiclass. The event is public, allowing it to be subscribed from outside the class.
30-30: LGTM!The
ReturnToRoundbutton is correctly subscribed to theReturnToRoundPressedevent in the constructor of theGhostGuiclass. The event subscription is consistent with the other button event subscriptions in the constructor.Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs (3)
123-123: LGTM!The code change correctly subscribes the
ReturnToRoundmethod to handle the newReturnToRoundPressedevent of theGuiobject. This is consistent with the event subscription pattern followed in theLoadGuimethod.
137-137: LGTM!The code change correctly unsubscribes the
ReturnToRoundmethod from theReturnToRoundPressedevent of theGuiobject. This is consistent with the event unsubscription pattern followed in theUnloadGuimethod and ensures proper cleanup when the GUI is unloaded.
147-150: Verify theReturnToRoundmethod implementation.The
ReturnToRoundmethod is correctly implemented in theGhostUIControllerclass. It follows the pattern of other similar methods and safely calls theReturnToRoundmethod on the_systemobject using the null-conditional operator.Please ensure that the
ReturnToRoundmethod is properly implemented in theGhostSystemclass to handle the respawn logic as per the PR objectives.Run the following script to verify the
ReturnToRoundmethod implementation:Verification successful
The
ReturnToRoundmethod is correctly implemented in theGhostSystemclass.The method raises a network event
GhostReturnToRoundRequest, which aligns with the expected behavior for handling respawn logic. The implementation is consistent with the design pattern used for similar methods. No issues were found with the current implementation.
GhostSystem.cs: TheReturnToRoundmethod raises theGhostReturnToRoundRequestnetwork event.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the `ReturnToRound` method in the `GhostSystem` class. # Test: Search for the method declaration. Expect: The method should exist and contain the respawn logic. rg --type cs -A 10 $'void ReturnToRound\(\)'Length of output: 1418
Content.Server/_White/Ghost/GhostReturnToRoundSystem.cs (3)
24-28: LGTM!The
Initializemethod correctly subscribes to the required events.
30-102: LGTM!The
OnGhostReturnToRoundRequestmethod correctly handles the ghost respawn request based on the provided conditions. It uses the required dependencies to get the configuration values, send chat messages, log events, and respawn the player. The method also correctly updates theDeathTimedictionary.
104-107: LGTM!The
ResetDeathTimesmethod correctly clears theDeathTimedictionary when the round restarts.Content.Shared/Ghost/SharedGhostSystem.cs (1)
153-154: Clarify the purpose and usage of theGhostReturnToRoundRequestclass.The addition of the
GhostReturnToRoundRequestclass looks good. It appears to represent a network request for a ghost entity to return to the game round, based on the class name and theSerializableandNetSerializableattributes.However, please provide more information about the specific purpose and usage of this class. Consider adding XML documentation comments to describe the class and its intended behavior.
Also, the
WD EDITcomments suggest that this change is specific to a particular project or fork. Is this change intended to be included in the main codebase? If so, please remove theWD EDITcomments to avoid confusion.Content.Client/Ghost/GhostSystem.cs (1)
185-189: LGTM!The
ReturnToRoundmethod is implemented correctly and follows the existing pattern of raising network events in this class. The method name clearly conveys its purpose, and the public access modifier seems appropriate if it needs to be called from outside this class.Content.Server/GameTicking/GameTicker.Spawning.cs (2)
161-216: Respawn character name check added. LGTM!The added code block enhances the respawn system by checking if the player is attempting to respawn with the same or a similar character name. This helps prevent metagaming and confusion.
The check works as follows:
- Query all mind components with the same user ID.
- If an exact match is found, prevent the respawn and send a message to the player.
- If a high similarity (>= 85%) is found, send an admin alert and prevent the respawn.
- If a moderate similarity (>= 50%) is found, send an admin alert.
The code changes are well-structured and follow the existing coding style.
412-427: String similarity calculation function added. Looks good!The
CalculateStringSimilarityfunction calculates the similarity between two strings by comparing each character at the same position and counting the number of matching characters. The similarity percentage is then calculated as (matchingCharacters / maxLength) * 100.This simple character-by-character comparison serves the purpose of detecting most similar names. However, if more advanced similarity detection is needed in the future, consider using more sophisticated algorithms like Levenshtein distance or Jaro-Winkler distance.
|
ошибки линтера актуальные |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Remuchi
left a comment
There was a problem hiding this comment.
А еще merge conflict.
Переводы я не трогала, но там тоже ужас.
# Description This ports WWhiteDreamProject/wwdpublic#56 The new Respawn System is one that allows players to return themselves to the lobby after a configurable delay, while also requiring that they respawn as a different character upon returning. # TODO - [x] Finish the usual cleanup # Changelog :cl: - add: Ported a Respawn System. This system allows players to return themselves to the lobby, while also requiring that if they re-enter the round, that they must do so on a different character. --------- Co-authored-by: Spatison <[email protected]>
# Description This ports #56 The new Respawn System is one that allows players to return themselves to the lobby after a configurable delay, while also requiring that they respawn as a different character upon returning. # TODO - [x] Finish the usual cleanup # Changelog :cl: - add: Ported a Respawn System. This system allows players to return themselves to the lobby, while also requiring that if they re-enter the round, that they must do so on a different character. --------- Co-authored-by: Spatison <[email protected]> # Conflicts: # Resources/Locale/ru-RU/ghost/ghost-gui.ftl
This ports WWhiteDreamProject/wwdpublic#56 The new Respawn System is one that allows players to return themselves to the lobby after a configurable delay, while also requiring that they respawn as a different character upon returning. - [x] Finish the usual cleanup :cl: - add: Ported a Respawn System. This system allows players to return themselves to the lobby, while also requiring that if they re-enter the round, that they must do so on a different character. --------- Co-authored-by: Spatison <[email protected]>
* Port Respawn System (Goob-Station#998) This ports WWhiteDreamProject/wwdpublic#56 The new Respawn System is one that allows players to return themselves to the lobby after a configurable delay, while also requiring that they respawn as a different character upon returning. - [x] Finish the usual cleanup :cl: - add: Ported a Respawn System. This system allows players to return themselves to the lobby, while also requiring that if they re-enter the round, that they must do so on a different character. --------- Co-authored-by: Spatison <[email protected]> * markings * fixed bugs * some fixes * prevented ghostbar and antag planet from spawning --------- Co-authored-by: VMSolidus <[email protected]> Co-authored-by: Spatison <[email protected]>
This ports WWhiteDreamProject/wwdpublic#56 The new Respawn System is one that allows players to return themselves to the lobby after a configurable delay, while also requiring that they respawn as a different character upon returning. - [x] Finish the usual cleanup :cl: - add: Ported a Respawn System. This system allows players to return themselves to the lobby, while also requiring that if they re-enter the round, that they must do so on a different character. --------- Co-authored-by: Spatison <[email protected]>
* Port Respawn System (#998) This ports WWhiteDreamProject/wwdpublic#56 The new Respawn System is one that allows players to return themselves to the lobby after a configurable delay, while also requiring that they respawn as a different character upon returning. - [x] Finish the usual cleanup :cl: - add: Ported a Respawn System. This system allows players to return themselves to the lobby, while also requiring that if they re-enter the round, that they must do so on a different character. --------- Co-authored-by: Spatison <[email protected]> * Fix some Locales Seemingly Made Using Google Translate (#1006) # Description How did this pass code review? # Media <details>   </details> # Changelog N/A --------- Signed-off-by: Mnemotechnican <[email protected]> Co-authored-by: stellar-novas <[email protected]> * Respawn System CVar (#1015) This PR adds a CVar to the Respawn System that optionally allows players to respawn as the same character. This isn't player facing, so none. * Update ghost-respawn.ftl (#1511) Got hit by the anticheat and saw this Signed-off-by: DEATHB4DEFEAT <[email protected]> * Miscellaneous Fixes From White Dream (#1911) Ports the following PRs: WWhiteDreamProject/wwdpublic#271 WWhiteDreamProject/wwdpublic#282 WWhiteDreamProject/wwdpublic#255 WWhiteDreamProject/wwdpublic#254 WWhiteDreamProject/wwdpublic#246 WWhiteDreamProject/wwdpublic#223 WWhiteDreamProject/wwdpublic#220 WWhiteDreamProject/wwdpublic#219 WWhiteDreamProject/wwdpublic#213 This is a rather huge variety of fixes to be honest. :cl: White Dream - fix: Fixed airlock opening and closing visuals - fix: Fixed Weather spamming infinite sounds. - fix: Cockroaches no longer spam organs when stepped on. - fix: Fixed the timer on the Return To Round button - fix: Fixed Return to Round not remembering how long it's been since you died if you re-enter your body. - fix: Fixed harpy flight visuals not showing for other people. - fix: Fixed disabler bolts not going through windows like other kinds of lasers. - fix: Fixed Vim Harness being free - fix: Fixed handcuffs not respecting your arm length. - fix: Made tending wounds not as message spammy. - fix: Fixed shuttle windows not preventing you from being electrocuted by grills under them. --------- Co-authored-by: vanx <[email protected]> Co-authored-by: vanx <discord@vanxxxx> Co-authored-by: Spatison <[email protected]> Co-authored-by: Repo <[email protected]> * Fix some Cvars Using Double as Their Type (#2333) The engine [does not technically support](https://github.com/user-attachments/assets/9cb5645b-b767-4f1e-aa43-6fae3ee4e9c8) the `double` type, but it seems some system was converting the interpreted string into a double so CVars worked fine when defined by a config file or when using defaults, but the `cvar` *command* doesn't work with it. I'd add support for it, but we haven't switched engines yet. --- <details><summary><h1>Media</h1></summary> <p> Before  After  </p> </details> * chaves * tradução * damn * chore: Automatically update REUSE headers * chore: Automatically update REUSE headers * Move arquivos novos para _EinsteinEngines * Comenta arquivos modificados * chore: Automatically update REUSE headers --------- Signed-off-by: Mnemotechnican <[email protected]> Signed-off-by: DEATHB4DEFEAT <[email protected]> Co-authored-by: VMSolidus <[email protected]> Co-authored-by: Spatison <[email protected]> Co-authored-by: Mnemotechnican <[email protected]> Co-authored-by: stellar-novas <[email protected]> Co-authored-by: DEATHB4DEFEAT <[email protected]> Co-authored-by: vanx <[email protected]> Co-authored-by: vanx <discord@vanxxxx> Co-authored-by: Repo <[email protected]> Co-authored-by: GabyChangelog <[email protected]>
Описание PR
Порт кнопки респавна в меню призрака.
Изменения
🆑 Spatison