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

add body camera #711

Closed
wants to merge 11 commits into from
Closed

add body camera #711

wants to merge 11 commits into from

Conversation

CrimeMoot
Copy link
Collaborator

@CrimeMoot CrimeMoot commented Dec 16, 2024

Порт боди-камеры с GoobStation

Summary by CodeRabbit

  • Новые функции
    • Добавлены новые элементы локализации для русского языка, включая "Бодикамеры".
    • Расширен инвентарь с добавлением беспроводных камер безопасности для ролей "Детектив" и "Репортер".
    • Введены новые сущности для камер наблюдения и маршрутизаторов в игре, включая ручные камеры.
  • Документация
    • Добавлен новый файл метаданных для текстур, описывающий различные состояния и размеры.

Copy link

coderabbitai bot commented Dec 16, 2024

Обзор

Walkthrough

Это обновление добавляет новые функции, связанные с беспроводными камерами наблюдения. В игру введены два новых типа камер: SurveillanceWirelessCameraBodySecurity и SurveillanceWirelessCameraBody. Камеры могут быть закреплены на шее и используются детективами и репортерами. Также добавлены новые локализационные записи для русского языка, описывающие эти устройства, и обновлены конфигурации инвентаря.

Changes

Файл Изменения
Resources/Locale/ru-RU/_Cats/devices/device-frequency.ftl Добавлены локализационные записи для камер наблюдения
Resources/Prototypes/Catalog/VendingMachines/Inventories/secdrobe.yml Добавлены 5 беспроводных камер наблюдения в инвентарь
Resources/Prototypes/Roles/Jobs/Security/detective.yml Камера добавлена в снаряжение детектива
Resources/Prototypes/Roles/Jobs/Wildcards/reporter.yml Камера добавлена в снаряжение репортера
Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml Добавлена новая частота для камер
Resources/Prototypes/_SpaceCats/Entities/Clothing/Neck/specific.yml Определены новые сущности камер наблюдения
Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml Добавлен новый маршрутизатор камер
Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/meta.json Добавлен метаданные для текстуры

Sequence Diagram

sequenceDiagram
    participant Detective
    participant Camera
    participant Router
    Detective->>Camera: Надевает камеру
    Camera->>Router: Подключается к сети
    Router-->>Camera: Настраивает частоту
    Camera->>Detective: Передает видео
Loading

Possibly related PRs

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.

Copy link

github-actions bot commented Dec 16, 2024

RSI Diff Bot; head commit 532a52e merging into 298b7a9
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi

State Old New Status
equipped-NECK-vox Added
equipped-NECK Added
icon Added
inhand-left Added
inhand-right Added

Edit: diff updated after 532a52e

@github-actions github-actions bot added size/L and removed size/M labels Dec 16, 2024
Copy link

@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: 3

🧹 Nitpick comments (5)
Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml (1)

4-4: Добавьте пустую строку в конец файла

Следуя стандартам YAML, добавьте символ новой строки в конец файла.

  frequency: 1940
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml (1)

9-9: Добавьте пустую строку в конец файла

Следуя стандартам YAML, добавьте символ новой строки в конец файла.

      subnetColor: "#DE20AA"
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 9-9: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/Catalog/VendingMachines/Inventories/secdrobe.yml (1)

13-13: Рекомендуется перегруппировать элементы инвентаря!

Предлагается переместить камеры в более логичную группу предметов. Сейчас элемент SurveillanceWirelessCameraBodySecurity находится между головными уборами и масками, что нарушает логическую структуру инвентаря.

Рекомендуемое изменение:

- SurveillanceWirelessCameraBodySecurity: 5 # Cats
  ClothingMaskNeckGaiterRed: 3
  ClothingHandsGlovesColorBlack: 3

Переместить в группу после ClothingHeadsetSecurity:

  ClothingHeadsetSecurity: 3
+ SurveillanceWirelessCameraBodySecurity: 5 # Cats
  ClothingOuterWinterSec: 2
Resources/Prototypes/_SpaceCats/Entities/Clothing/Neck/specific.yml (2)

4-5: Требуется улучшить описание предмета

Текущее описание "Camera" недостаточно информативно. Необходимо добавить подробное описание функциональности и назначения устройства.

Предлагаемые изменения:

  name: боди-камера безопасности
- description: Camera
+ description: Носимая камера службы безопасности для записи происшествий. Передает изображение в сеть наблюдения станции.

42-51: Исправить форматирование YAML

Необходимо исправить следующие проблемы форматирования:

  1. Добавить пустую строку в конце файла
  2. Исправить отступы в конфигурации

Предлагаемые изменения:

  - type: DeviceNetwork
    deviceNetId: Wired
    receiveFrequencyId: SurveillanceCameraService
-   transmitFrequencyId: SurveillanceCamera
+   transmitFrequencyId: SurveillanceCamera
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 51-51: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 298b7a9 and 23418e7.

⛔ Files ignored due to path filters (5)
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/equipped-NECK-vox.png is excluded by !**/*.png
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/equipped-NECK.png is excluded by !**/*.png
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/inhand-left.png is excluded by !**/*.png
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/inhand-right.png is excluded by !**/*.png
📒 Files selected for processing (8)
  • Resources/Locale/ru-RU/_Cats/devices/device-frequency.ftl (1 hunks)
  • Resources/Prototypes/Catalog/VendingMachines/Inventories/secdrobe.yml (1 hunks)
  • Resources/Prototypes/Roles/Jobs/Security/detective.yml (1 hunks)
  • Resources/Prototypes/Roles/Jobs/Wildcards/reporter.yml (1 hunks)
  • Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml (1 hunks)
  • Resources/Prototypes/_SpaceCats/Entities/Clothing/Neck/specific.yml (1 hunks)
  • Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml (1 hunks)
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/meta.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Resources/Textures/_SpaceCats/Clothing/Neck/Misc/nopro.rsi/meta.json
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml

[error] 9-9: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_SpaceCats/Entities/Clothing/Neck/specific.yml

[warning] 30-30: wrong indentation: expected 4 but found 6

(indentation)


[error] 51-51: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (6)
Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml (1)

1-4: Проверьте значение частоты на конфликты

Убедитесь, что частота 1940 не конфликтует с другими устройствами в системе.

✅ Verification successful

Частота 1940 безопасна для использования

Анализ показал, что выбранная частота 1940 для камеры наблюдения не конфликтует с другими устройствами в системе. Ближайшие используемые частоты - 1939 и 1984, что обеспечивает достаточный разрыв для предотвращения помех.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for frequency conflicts
rg "frequency: 1940" --type yaml

Length of output: 117


Script:

#!/bin/bash
# Search for all frequency values in yaml files to check for conflicts
rg "frequency: \d+" --type yaml

Length of output: 12395

🧰 Tools
🪛 yamllint (1.35.1)

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Locale/ru-RU/_Cats/devices/device-frequency.ftl (1)

1-5: Локализация выполнена корректно

Переводы логичны и последовательны. Хорошее решение использовать наследование от базового роутера для поддержания единообразия описаний.

Resources/Prototypes/Roles/Jobs/Wildcards/reporter.yml (1)

25-25: Корректное добавление нательной камеры!

Размещение камеры в слоте шеи логично для данного типа устройства и соответствует роли репортера.

Resources/Prototypes/Roles/Jobs/Security/detective.yml (1)

39-39: Логичное добавление защищённой версии камеры!

Использование специальной версии камеры для службы безопасности является обоснованным решением. Размещение в слоте шеи соответствует общей механике нательных камер.

Resources/Prototypes/_SpaceCats/Entities/Clothing/Neck/specific.yml (2)

48-51: Проверить разрешения частот устройства

Необходимо убедиться, что использование SurveillanceCameraService вместо SurveillanceCameraSecurity соответствует требованиям безопасности для обычной боди-камеры.

Давайте проверим конфигурацию частот:

✅ Verification successful

Let me analyze the search results to verify the frequency permissions. I can see that both SurveillanceCameraSecurity and SurveillanceCameraService frequencies are widely used across the codebase, particularly in map configurations. Let me check the device network configuration to understand if there are any specific security restrictions.


Использование частоты SurveillanceCameraService допустимо

Анализ конфигурации показывает, что частота SurveillanceCameraService (1936) является стандартной частотой для камер наблюдения в служебных зонах, наравне с другими специализированными частотами для разных отделов (безопасность - 1932, медицина - 1937, инженерный - 1931 и т.д.). Использование служебной частоты для боди-камеры соответствует её назначению.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск конфигурации частот устройств наблюдения
rg "SurveillanceCamera(Security|Service)" --type yaml

Length of output: 66310


Script:

#!/bin/bash
# Check device network frequency definitions and permissions
cat Resources/Prototypes/Device/devicenet_frequencies.yml

Length of output: 3378

🧰 Tools
🪛 yamllint (1.35.1)

[error] 51-51: no new line character at the end of file

(new-line-at-end-of-file)


1-51: Проверить механизмы контроля доступа

Реализация боди-камер требует тщательной проверки механизмов контроля доступа:

  1. Кто может просматривать записи?
  2. Как защищена передача данных?
  3. Есть ли журналирование доступа?

Давайте проверим связанные системы безопасности:

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 30-30: wrong indentation: expected 4 but found 6

(indentation)


[error] 51-51: no new line character at the end of file

(new-line-at-end-of-file)

Comment on lines 1 to 9
- type: entity
parent: SurveillanceCameraRouterBase
id: SurveillanceCameraRouterHandheld
name: Camerahelds
description:
components:
- type: SurveillanceCameraRouter
subnetFrequency: SurveillanceCameraHandheld
subnetColor: "#DE20AA"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Исправьте опечатку в имени файла

Файл находится в директории с опечаткой: survelliance вместо правильного surveillance.

Необходимо переименовать файл:

- Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml
+ Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/surveillance_camera_routers.yml
🧰 Tools
🪛 yamllint (1.35.1)

[error] 9-9: no new line character at the end of file

(new-line-at-end-of-file)

parent: SurveillanceCameraRouterBase
id: SurveillanceCameraRouterHandheld
name: Camerahelds
description:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Добавьте описание для сущности

Поле описания не должно быть пустым. Добавьте соответствующее описание для камеры.

  name: Camerahelds
- description:
+ description: Портативный роутер для управления нательными камерами наблюдения.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description:
description: Портативный роутер для управления нательными камерами наблюдения.

Comment on lines +32 to +40
- type: SpamEmitSound
minInterval: 90
maxInterval: 300
sound:
path: /Audio/Machines/timer.ogg
params:
volume: -8
maxDistance: 10
variation: 0.05
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Настройки звука таймера требуют корректировки

Текущие настройки звука действительно могут быть навязчивыми:

  • Интервал 90-300 секунд слишком частый для таймера, учитывая что это постоянный звук
  • Громкость -8 и дистанция 10 единиц являются стандартными параметрами, но в сочетании с частым интервалом могут раздражать
  • В других найденных конфигурациях SpamEmitSound используются более специфичные звуки (например, CluwneHorn, BikeHorn) с меньшей частотой воспроизведения

Рекомендации:

  • Увеличить минимальный интервал до 180-240 секунд
  • Уменьшить громкость до -10 или -12
  • Уменьшить maxDistance до 8 единиц
🔗 Analysis chain

Проверить настройки звука таймера

Текущие настройки звука могут быть слишком навязчивыми:

  • Интервал 90-300 секунд может быть слишком частым
  • Громкость -8 и дистанция 10 требуют проверки в игре

Предлагаю проверить наличие похожих настроек в других устройствах:


Let me search for other timer sound configurations to compare with.


Let me search for other SpamEmitSound configurations with sound parameters to compare.


Let me fix the search pattern.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск других конфигураций SpamEmitSound для сравнения
rg -A 10 "type: SpamEmitSound" --type yaml

Length of output: 68590


Script:

#!/bin/bash
# Search for timer sound configurations
rg -A 10 "path: .*timer\.ogg" --type yaml

Length of output: 1051


Script:

#!/bin/bash
# Search for SpamEmitSound configurations with sound parameters
rg -A 15 "type: SpamEmitSound\n.*sound:" --type yaml

Length of output: 246


Script:

#!/bin/bash
# Search for SpamEmitSound configurations with sound parameters using multiline mode
rg -U -A 15 'type: SpamEmitSound.*\n.*sound:' --type yaml

Length of output: 2695

Copy link

@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 (3)
Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml (1)

4-4: Добавьте пустую строку в конец файла

Согласно стандартам YAML, файл должен заканчиваться пустой строкой.

  frequency: 1940
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml (2)

1-8: Рассмотрите добавление дополнительных свойств

Для улучшения функциональности и удобства использования, рекомендуется добавить следующие свойства:

  • Вес устройства
  • Размер в инвентаре
  • Спрайты для разных состояний
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraHandheld
+    - type: Item
+      size: 5
+      weight: 2
+    - type: Sprite
+      sprite: Objects/Devices/camera_router.rsi
+      layers:
+        - state: router
+        - state: router_on
+          shader: unshaded
+          visible: false
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 8-8: no new line character at the end of file

(new-line-at-end-of-file)


8-8: Добавьте пустую строку в конец файла

Согласно стандартам YAML, файл должен заканчиваться пустой строкой.

      subnetFrequency: SurveillanceCameraHandheld
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 8-8: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 23418e7 and 532a52e.

📒 Files selected for processing (2)
  • Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml (1 hunks)
  • Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml

[error] 8-8: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
Resources/Prototypes/_SpaceCats/Device/devicenet_frequencies.yml (1)

1-4: Проверьте значение частоты на конфликты

Убедитесь, что частота 1940 не конфликтует с другими устройствами в системе.

✅ Verification successful

Частота 1940 безопасна для использования

Анализ показал, что частота 1940 для боди-камеры не конфликтует с другими устройствами в системе:

  • Ближайшие частоты устройств: 1939 и 1984
  • Нет точных совпадений частоты 1940 с другими устройствами
  • Значение находится в допустимом диапазоне частот, используемом в системе
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential frequency conflicts
rg "frequency: 1940" --type yaml

Length of output: 117


Script:

#!/bin/bash
# Get all frequency values from yaml files to check for conflicts
rg "frequency: \d+" --type yaml

Length of output: 12395

🧰 Tools
🪛 yamllint (1.35.1)

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_SpaceCats/Entities/Structures/Machines/survelliance_camera_routers.yml (2)

1-8: Исправьте опечатку в имени файла

Файл находится в директории с опечаткой: survelliance вместо правильного surveillance.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 8-8: no new line character at the end of file

(new-line-at-end-of-file)


5-5: Добавьте описание для сущности

Поле описания не должно быть пустым. Добавьте соответствующее описание для камеры.

@CrimeMoot
Copy link
Collaborator Author

Не. Имба.

@CrimeMoot CrimeMoot closed this Dec 16, 2024
@CrimeMoot CrimeMoot deleted the bodyacm branch December 16, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant