feat: マップ設定の自動生成機能およびマップ名を自動で修正する機能の実装#143
Merged
fltuna merged 5 commits intofltuna:mainfrom Jun 25, 2025
Merged
Conversation
fltuna
reviewed
May 21, 2025
Owner
There was a problem hiding this comment.
これに関してはフレームワーク側でUtilを提供しているから、それを使ってくれると嬉しいかも!
Collaborator
Author
There was a problem hiding this comment.
Utilの方はstaticがついててインスタンス化できへん!
解決した
Comment on lines
+78
to
+81
| string configDir = Path.Combine(Plugin.ModuleDirectory, "config"); | ||
| string mapsDir = Path.Combine(configDir, "maps"); | ||
| string oldFilePath = Path.Combine(mapsDir, $"{mapConfig.MapName}.toml"); | ||
| string newFilePath = Path.Combine(mapsDir, $"{mapName}.toml"); |
Owner
There was a problem hiding this comment.
ここのpath、設定ファイルは人によっては$ModuleDir/config/maps.tomlにあったり、$ModuleDir/config/ze_maps/ze_xxxxみたいだったり様々だから、特定のマップ名で保存するとキーの競合が起きてコンフィグロードできなくなるかも
| newMapConfig.ProhibitAdminNomination = defaultMapConfig.ProhibitAdminNomination; | ||
| newMapConfig.DaysAllowed = defaultMapConfig.DaysAllowed ?? new List<DayOfWeek>(); | ||
| newMapConfig.AllowedTimeRanges = defaultMapConfig.AllowedTimeRanges ?? new List<ITimeRange>(); | ||
| newMapConfig.GroupSettingsArray = defaultMapConfig.GroupSettingsArray ?? new List<string> { "default" }; |
| newMapConfig.ProhibitAdminNomination = false; | ||
| newMapConfig.DaysAllowed = new List<DayOfWeek>(); | ||
| newMapConfig.AllowedTimeRanges = new List<ITimeRange>(); | ||
| newMapConfig.GroupSettingsArray = new List<string> { "default" }; |
Comment on lines
+184
to
+188
| Directory.CreateDirectory(configDir); // Ensure directory exists | ||
| // Individual map files are typically stored in a 'maps' subdirectory within 'config' | ||
| string mapsDir = Path.Combine(configDir, "maps"); | ||
| Directory.CreateDirectory(mapsDir); | ||
| string filePath = Path.Combine(mapsDir, $"{validMapName}.toml"); |
Owner
There was a problem hiding this comment.
ここも別のところで少し触れたように、設定ファイルは、人によっては$ModuleDir/config/maps.tomlにあったり、$ModuleDir/config/ze_maps/ze_xxxxみたいだったり様々だから、特定のマップ名で保存するとキーの競合が起きてコンフィグロードできなくなるかも
Collaborator
Author
|
TODO: 先週末が忙しかったので今週末に対応 |
Collaborator
Author
|
ビルド確認済み、ビルド時の警告もないことを確認済み |
Collaborator
Author
|
自鯖で試したら挙動がちょっと怪しいので一旦レビュー下げます |
Collaborator
Author
|
直ったと思うので再度Open |
fltuna
approved these changes
Jun 25, 2025
Owner
fltuna
left a comment
There was a problem hiding this comment.
見た感じ特に問題ないのでマージします! 問題発生したらその都度修正ということで!
This file contains hidden or 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
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.
このPRでは以下のふたつの機能を実装します
プラグインロード時にマップ設定を自動生成する機能
WorkshopCollectionIdsが追加されましたdefault.tomlベースでマップ設定を作ろうとします(なければdefault.tomlを生成するときの値)workshop_map_...のようにフォールバックされた名前をマップ名として使用します(後で手動で直す必要あり)configディレクトリの場合はsynced_workshopmapsというディレクトリに各マップ設定を保存するようにしていますマップスタート時にマップ名を自動修正する機能
Server.MapNameとマップ設定のマップ名が一致しなければ設定のマップ名を修正しようとします