Skip to content
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

station goal to centcom #1034

Merged
merged 1 commit into from
Feb 8, 2025
Merged

station goal to centcom #1034

merged 1 commit into from
Feb 8, 2025

Conversation

Rxup
Copy link
Owner

@Rxup Rxup commented Feb 7, 2025

🆑

  • fix: На цк теперь приходят цели станции
  • fix: На теперь есть консоль ЗУП
  • fix: ОЦК теперь может звонить на станцию через голопад

Summary by CodeRabbit

  • Рефакторинг
    • Улучшена обработка отправки целей станции через факс, обеспечивая более точное и последовательное выполнение операций.

  • Новые возможности
    • Оптимизированы объекты на карте: переработаны прототипы устройств, обновлены их физические свойства, добавлены новые интерактивные элементы и метки.

  • Стиль
    • Обновлены текстовые подписи и оформление некоторых терминалов для повышения единообразия и удобства восприятия.

@Rxup Rxup requested a review from Roudenn as a code owner February 7, 2025 14:20
Copy link
Contributor

coderabbitai bot commented Feb 7, 2025

Walkthrough

В системе StationGoalPaperSystem.cs добавлена зависимость от CentcommSystem. Логика метода SendStationGoal изменена: сначала проверяется, существует ли grid у факс-машины, затем удостоверяются, что он является наибольшим или относится к Centcomm. При успешной отправке факса осуществляется спавн сущностей с последующей установкой флага. В файлах centcomm.yml и holopad.yml внесены корректировки в прототипы, компоненты и параметры сущностей, включая обновление суффиксов, позиций и меток.

Changes

Файл Изменения
Content.Server/.../StationGoalPaperSystem.cs Добавлена зависимость CentcommSystem; изменена логика проверки grid (null, наибольший, Centcomm) и упрощена последовательность отправки факса и спавна сущностей.
Resources/Maps/centcomm.yml Удалён entity uid:207 из BackmenVendingMachineChang, добавлен под ComputerWage; удалён компонент Physics, добавлен Pullable; обновлены прототипы GunSafe и Holopad; добавлен компонент Label; изменена позиция.
Resources/Prototypes/_Backmen/.../holopad.yml Изменены суффиксы: HolopadCentCommLongRange – на "Centcomm", HolopadCentCommUnlimitedRange – на "CentComm, Operator"; обновлено значение currentLabel для HolopadCentCommEvac.

Sequence Diagram(s)

sequenceDiagram
    participant S as StationGoalPaperSystem
    participant F as FaxMachine
    participant G as Grid
    participant E as EntitySpawner

    S->>F: Запуск SendStationGoal()
    F->>G: Получение grid
    alt grid == null
        F->>S: Пропуск итерации
    else grid != null
        F->>S: Проверка: наибольший или Centcomm?
        S->>F: Отправка факса
        S->>E: Спавн сущностей
        E-->>S: Установка флага wasSent=true
    end
Loading

Poem

Я заяц-кодер, весело скачусь в строках,
Новые зависимости и проверки – как свежий бриз.
Факс летит сквозь условные ветви уверенно,
Сущности оживают после четкого приказа.
Пусть баги бегут, как мыши в темноте,
Я рад переменам, морковка в сердце моей победы!


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added S: Untriaged Changes: Map Can be reviewed or fixed by people who are knowledgeable with mapping. labels Feb 7, 2025
@Rxup Rxup requested a review from KayzelW February 7, 2025 14:20
@github-actions github-actions bot added the size/S label Feb 7, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs (2)

2-2: Удалите неиспользуемый импорт.

Импорт Content.Server.Backmen.Arrivals не используется в текущем файле.

-using Content.Server.Backmen.Arrivals;

117-117: Улучшите читаемость условия проверки сетки.

Сложное условие проверки сетки можно сделать более читаемым, разбив его на отдельные проверки.

-if(!(largestGrid == grid.Value || _centcomm.CentComGrid == largestGrid))
+var isLargestGrid = largestGrid == grid.Value;
+var isCentCommGrid = _centcomm.CentComGrid == largestGrid;
+if (!isLargestGrid && !isCentCommGrid)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9341b8b and 11c63ae.

📒 Files selected for processing (3)
  • Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs (3 hunks)
  • Resources/Maps/centcomm.yml (5 hunks)
  • Resources/Prototypes/_Backmen/Entities/Structures/Machines/holopad.yml (2 hunks)
⏰ Context from checks skipped due to timeout of 300000ms (3)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Test Packaging
🔇 Additional comments (10)
Resources/Prototypes/_Backmen/Entities/Structures/Machines/holopad.yml (3)

13-15: Проверка обновления суффикса для HolopadCentCommLongRange.
В данной сущности суффикс изменён на "Centcomm". Убедитесь, что данное изменение соответствует ожиданиям всей системы и что обработка нового значения не вызывает конфликтов в логике отображения или идентификации объекта.


19-23: Проверка обновления суффикса для HolopadCentCommUnlimitedRange.
Суффикс изменён на "CentComm, Operator", что отражает дополнительную информацию об операторе. Рекомендуется убедиться, что это значение корректно интегрируется с остальной логикой прототипов и не приводит к несоответствиям в работе системы.


47-50: Уточнение для currentLabel у HolopadCentCommEvac.
Изменённое значение currentLabel теперь установлено как "holopad-centomm-evac". Проверьте, что это изменение обеспечивает требуемое форматирование, в частности, если предполагается наличие завершающего символа новой строки, то это условие корректно выполняется.

Resources/Maps/centcomm.yml (5)

21768-21780: Проверка корректности удаления свойств прототипа
В данном хунке удаляются строки, задающие прототипы: первая строка с "proto: ComputerWage" и строка с "proto: ConveyorBelt". Согласно описанию pull request, сущность с uid 207 должна быть повторно добавлена под новым прототипом (в описании упоминается переопределение), поэтому удаление "proto: ComputerWage" требует проверки. Аналогично, убедитесь, что удаление "proto: ConveyorBelt" соответствует новой логике задания сущностей.


23533-23540: Добавление компонента Pullable
Добавлен новый компонент "Pullable" с параметром prevFixedRotation, равным True, для сущности с uid 3746. Изменение соответствует описанию новых требований. Рекомендуется перепроверить, что это изменение совместимо с остальными компонентами и не приводит к конфликтам в физическом поведении объекта.


28316-28322: Проверка обновления прототипа GunSafe
Удаляется строка "proto: GunSafeSubMachineGunVector". Согласно описанию pull request, прототип для GunSafe должен быть обновлён с GunSafeSubMachineGunDrozd на GunSafeSubMachineGunVector. Убедитесь, что удаление данной строки не приводит к тому, что сущность оказывается без необходимого назначения прототипа. Возможно, требуемое значение прототипа должно быть задано в другом месте.


28534-28548: Проверка обновления прототипа Holopad
В этом хунке удаляется строка, задающая "proto: HolopadCentCommUnlimitedRange". Согласно описанию, именно этот прототип должен использоваться, а также должен быть добавлен компонент "Label" с currentLabel: "ЦК - Оператор". Проверьте, что удаление строки прототипа не нарушает логику определения сущности и что конфигурация holopad соответствует требованиям новой функциональности.


34377-34383: Обновление позиции и удаление прототипа RubberStampDenied
Здесь изменяется позиция компонента Transform для uid 7057, что соответствует обновлённой позиции, а также удаляется строка "proto: RubberStampDenied". Убедитесь, что удаление данного прототипа намеренно и что сущность больше не должна использовать его для определения своей логики или внешнего вида.

Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs (2)

111-126: Одобрено: улучшена логика проверки и отправки.

Изменения улучшают логику работы системы:

  • Добавлена проверка на null для сетки
  • Добавлена валидация против сетки CentComm
  • Создание сущностей перенесено после успешной отправки факса

121-124: Добавьте обработку ошибок при создании сущностей.

Создание сущностей может завершиться неудачей, но текущая реализация не обрабатывает возможные ошибки.

Рекомендуется добавить обработку ошибок и логирование:

 foreach (var spawnEnt in goal.Spawns)
 {
-    SpawnAtPosition(spawnEnt, Transform(faxUid).Coordinates);
+    try 
+    {
+        var entity = SpawnAtPosition(spawnEnt, Transform(faxUid).Coordinates);
+        if (entity == null)
+        {
+            Log.Warning($"Failed to spawn entity {spawnEnt} for station goal");
+        }
+    }
+    catch (Exception ex)
+    {
+        Log.Error($"Error spawning entity {spawnEnt} for station goal: {ex}");
+    }
 }

@Rxup Rxup merged commit 8320ea4 into master Feb 8, 2025
16 checks passed
@KayzelW KayzelW deleted the centcom-station-goal branch February 20, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: Map Can be reviewed or fixed by people who are knowledgeable with mapping. S: Untriaged size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants