Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ dotnet_diagnostic.SA1640.severity = none # File header must have valid com
dotnet_diagnostic.SA1641.severity = none # File header company name text must match
dotnet_diagnostic.SA1642.severity = none # Constructor summary must begin with standard text
dotnet_diagnostic.SA1643.severity = none # Destructor summary must begin with standard text
dotnet_diagnostic.SA1618.severity = none # Missing documentation for type parameter
dotnet_diagnostic.SA1629.severity = none # Documentation text should end with a period
dotnet_diagnostic.SA1649.severity = none # File name should match first type name

# --- Readability ---
dotnet_diagnostic.SA1101.severity = none # this. 強制 → 本プロジェクトは this. 不使用 (dotnet/runtime 準拠)
Expand All @@ -201,6 +204,7 @@ dotnet_diagnostic.SA1202.severity = none # アクセスレベル順の強
dotnet_diagnostic.SA1204.severity = none # static メンバーを先に → 機能単位グループ化を許容

# --- Spacing (モダン C# との競合) ---
dotnet_diagnostic.SA1000.severity = none # new キーワード後のスペース → target-typed new() と WHITESPACE ルールが競合
dotnet_diagnostic.SA1010.severity = none # 開き角括弧 → C# 12 コレクション式 [1,2,3] で誤検知
dotnet_diagnostic.SA1011.severity = none # 閉じ角括弧 → Nullable 配列 byte[]? で誤検知

Expand Down
57 changes: 57 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,63 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# NuGet(Directory.Packages.props で一元管理)
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
groups:
dotnet-minor:
update-types: ["minor", "patch"]

# Docker — .NET ベースイメージ
- package-ecosystem: "docker"
directory: "/docker/game-server"
schedule:
interval: "weekly"
groups:
dotnet-images:
patterns: ["*"]

- package-ecosystem: "docker"
directory: "/docker/game-server/prod"
schedule:
interval: "weekly"
groups:
dotnet-images:
patterns: ["*"]

- package-ecosystem: "docker"
directory: "/docker/game-realtime"
schedule:
interval: "weekly"
groups:
dotnet-images:
patterns: ["*"]

- package-ecosystem: "docker"
directory: "/docker/game-realtime/prod"
schedule:
interval: "weekly"
groups:
dotnet-images:
patterns: ["*"]

- package-ecosystem: "docker"
directory: "/docker/migrate"
schedule:
interval: "weekly"
groups:
dotnet-images:
patterns: ["*"]

# Docker — Unity Accelerator
- package-ecosystem: "docker"
directory: "/docker/unity-accelerator"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ jobs:
dotnet-format:
name: dotnet format Check
runs-on: ubuntu-latest
# Server/Shared が存在する場合のみ実行
continue-on-error: true
steps:
- name: Checkout repository
Expand Down Expand Up @@ -138,10 +137,10 @@ jobs:
unity-analyze:
name: Unity Analyzer
runs-on: [self-hosted, linux, unity, docker]
continue-on-error: true
# PR 時のみ実行(リソース節約)
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
timeout-minutes: 20
continue-on-error: true

steps:
- name: Checkout repository
Expand Down Expand Up @@ -232,6 +231,7 @@ jobs:
echo "### Critical Issues" >> $GITHUB_STEP_SUMMARY
echo "- UNT0002: Use == operator for null checks on Unity objects" >> $GITHUB_STEP_SUMMARY
grep "error UNT0002" "$log_file" | head -5 >> $GITHUB_STEP_SUMMARY
exit 1
fi

echo "::endgroup::"
Expand Down
6 changes: 3 additions & 3 deletions docker/unity-accelerator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# - ディレクトリ初期化処理
# - パーミッション設定
#
# Note: ベースイメージのパッケージリストが古いため curl インストール不可
# ヘルスチェックは Runner からの接続で代替
# ベースイメージ: https://hub.docker.com/r/unity/accelerator
# ※ unitytechnologies/accelerator は非推奨(2022年以降更新なし)

FROM unitytechnologies/accelerator:latest
FROM unity/accelerator:v1.5.99-g262ce04b

# カスタムエントリポイントをコピー
COPY entrypoint.sh /custom-entrypoint.sh
Expand Down
10 changes: 10 additions & 0 deletions src/Game.Server.Shared/Game.Server.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Google.Apis.Auth" />

<!-- Analyzers -->
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions src/Game.Shared/Runtime/Shared/Dto/AuthDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace Game.Library.Shared.Dto
// ============================================================
// Request DTOs
// ============================================================

[MessagePackObject]
public class LoginRequest
{
Expand Down Expand Up @@ -97,7 +96,6 @@ public class UpdateUserRequest
// ============================================================
// Response DTOs
// ============================================================

[MessagePackObject]
public class LoginResponse
{
Expand Down
4 changes: 3 additions & 1 deletion src/Game.Shared/Runtime/Shared/Dto/CommonResponseDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ public class ApiErrorResponse
}

[MessagePackObject]
public class EmptyRequest { }
public class EmptyRequest
{
}
}
4 changes: 1 addition & 3 deletions src/Game.Shared/Runtime/Shared/Enums/AudioEnums.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Game.Library.Shared.Enums
{
public enum AudioCategory
Expand Down Expand Up @@ -42,4 +40,4 @@ public enum AudioPlayTag
UIOpen = 9001,
UIClose = 9002,
}
}
}
16 changes: 8 additions & 8 deletions src/Game.Shared/Runtime/Shared/Enums/ChatEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace Game.Library.Shared.Enums
[Flags]
public enum ChatRoomPermissions
{
None = 0,
Join = 1 << 0,
SendMessage = 1 << 1,
Leave = 1 << 2,
Invite = 1 << 3,
Kick = 1 << 4,
Delete = 1 << 5,
None = 0,
Join = 1 << 0,
SendMessage = 1 << 1,
Leave = 1 << 2,
Invite = 1 << 3,
Kick = 1 << 4,
Delete = 1 << 5,
ManageMember = 1 << 6,
ManageRoom = 1 << 7,
ManageRoom = 1 << 7,
}
}
14 changes: 7 additions & 7 deletions src/Game.Shared/Runtime/Shared/StateMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
{
internal interface IState
{
public void Enter()
void Enter()
{
}

public void Update()
void Update()
{
}

// MonoBehavior.FixedUpdate
public void FixedUpdate()
void FixedUpdate()
{
}

// MonoBehavior.LateUpdate
public void LateUpdate()
void LateUpdate()
{
}

public void Exit()
void Exit()
{
}
}

internal interface IStateMachineContext<out TContext>
{
public TContext Context { get; }
TContext Context { get; }
}

/// <summary>
Expand All @@ -42,7 +42,7 @@
public abstract class State<TContext, TEvent> : IState, IStateMachineContext<TContext>
{
/// <summary>所属するステートマシンへの参照</summary>
protected internal StateMachine<TContext, TEvent> StateMachine { get; init; }

Check warning on line 45 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

Non-nullable property 'StateMachine' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

/// <summary>共有コンテキストへのアクセサ</summary>
public TContext Context => StateMachine.Context;
Expand Down Expand Up @@ -77,7 +77,7 @@
{
Waiting, // 遷移リクエストしたが順番待ち、次回Updateで再度リクエスト
Succeeded, // 遷移リクエストが受付られ、次回Updateで処理される
Failed // 遷移テーブルにないリクエスト
Failed // 遷移テーブルにないリクエスト
}

/// <summary>
Expand Down Expand Up @@ -108,7 +108,7 @@

protected virtual bool AllowForceTransition => false;

public StateMachine(TContext context)

Check warning on line 111 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

Non-nullable field '_nextState' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 111 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

Non-nullable field '_currentState' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 111 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Integration Tests

Non-nullable field '_nextState' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 111 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Integration Tests

Non-nullable field '_currentState' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
Context = context;
}
Expand Down Expand Up @@ -296,7 +296,7 @@
// 実行ステートを変更
{
_currentState = _nextState;
_nextState = null;

Check warning on line 299 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

Cannot convert null literal to non-nullable reference type.

Check warning on line 299 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Integration Tests

Cannot convert null literal to non-nullable reference type.
}

try
Expand All @@ -307,7 +307,7 @@
catch (Exception e)
{
_nextState = _currentState;
_currentState = null;

Check warning on line 310 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

Cannot convert null literal to non-nullable reference type.

Check warning on line 310 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Integration Tests

Cannot convert null literal to non-nullable reference type.
_currentPhase = StatePhase.Idle;
throw new InvalidOperationException($"State.Enter() failed in {_currentState?.GetType().Name}: {e.Message}\\n{e.StackTrace}");
}
Expand All @@ -334,7 +334,7 @@
_currentState.Exit();

_currentState = _nextState;
_nextState = null;

Check warning on line 337 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

Cannot convert null literal to non-nullable reference type.

Check warning on line 337 in src/Game.Shared/Runtime/Shared/StateMachine.cs

View workflow job for this annotation

GitHub Actions / Integration Tests

Cannot convert null literal to non-nullable reference type.

_currentPhase = StatePhase.Entering;
_currentState.Enter();
Expand Down
Loading