Skip to content

Modernize solutions, improve documentation, and enhance CI workflows - #16

Open
wforney wants to merge 54 commits into
sunduk:masterfrom
wforney:main
Open

Modernize solutions, improve documentation, and enhance CI workflows#16
wforney wants to merge 54 commits into
sunduk:masterfrom
wforney:main

Conversation

@wforney

@wforney wforney commented Jul 26, 2026

Copy link
Copy Markdown

This pull request introduces comprehensive repository-wide improvements to developer experience, automation, and documentation. It establishes clear guidance for agents and contributors, adds CI workflows for build/test/coverage, and ensures protocol and threading invariants are well-documented and enforced. Several configuration and helper files are added for local development, Copilot, and MCP integration. It also adds a basic test project for the sample client.

Repository guidance and conventions

  • Added AGENTS.md, .clinerules, .cursorrules, and CLAUDE.md to define canonical repository instructions, protocol/threading constraints, and agent priorities. These files centralize rules for packet compatibility, threading, protocol IDs, and PR workflow. [1] [2] [3] [4]
  • Added .github/copilot-instructions.md for Copilot-specific build, test, and protocol conventions, and .github/prompts/ with prompt templates for manual testing and protocol-safe changes. [1] [2] [3]

Continuous Integration and PR workflow

  • Introduced .github/workflows/build-test.yml for CI: builds, tests, and collects coverage for both FreeNet.slnx and viruswar_server.slnx on PRs and pushes. Coverage is summarized and commented on PRs.
  • Added a standardized pull request template (.github/PULL_REQUEST_TEMPLATE.md) to guide contributors in documenting changes, testing, and risk.

Local development and configuration

  • Added .vscode/tasks.json for one-click restore, build, and run tasks for main and sample projects.
  • Provided .mcp.json.example and .github/mcp-setup.md for easy Model Context Protocol (MCP) integration and setup. [1] [2]

Testing improvements

  • Added a new test project CSampleClient.Tests with a basic protocol stability test, and updated CSampleClient to .NET 10 and enabled implicit usings. [1] [2] [3]

Other

  • Added .contextkeeper/.git-branches/main.ck for context preservation in compatible tools.

These changes collectively improve onboarding, enforce protocol safety, automate CI, and clarify expectations for all contributors and agents.

wforney and others added 16 commits July 26, 2026 02:17
- Migrate to .slnx and .NET 10

- Enable centralized NuGet package management

- Add per-project test projects using MTP/TUnit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
README.md and TestManual.md were rewritten for improved clarity, structure, and bilingual (English/Korean) explanations. Architecture diagrams were updated and reformatted with centered images and HTML alignment. TestManual.md now provides step-by-step test instructions, tool links, and a sample game screenshot, while removing outdated content. Added main.ck to store development environment window layout and state.
Comment thread FreeNet/CNetworkService.cs Outdated
return;
}

while (e.BytesTransferred > 0 && e.SocketError == SocketError.Success)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This keeps the same semantics as before, but fixes the stack overflow. But it never gets to the try below. Is that intentional or just a logic bomb?

wforney and others added 7 commits July 26, 2026 07:10
Major refactor replacing legacy C-style class names with modern .NET/C# conventions (e.g., UserToken, Packet, NetworkService). All core networking, packet, and session management classes rewritten using modern C# features, improved encapsulation, and clearer APIs. Method and interface names updated to PascalCase. Buffer, queue, and pool management reimplemented for thread safety and clarity. Message resolver and packet serialization logic refactored. All sample and game server code updated to use new types and APIs. Added .editorconfig for consistent style enforcement. All references to old C* types replaced. Improved access modifiers, collection usage, and synchronization. Codebase now aligns with modern C# best practices for maintainability and readability.
Refactored CSampleServer for modern C# conventions and improved encapsulation:
- Made CGameUser internal, applied explicit interface implementation, and renamed fields/methods to C# standards.
- Removed legacy code, unused usings, and redundant comments.
- Converted Program.cs to top-level statements; user management and session creation are now static methods with thread-safe user list.
- Moved and simplified protocol enum under CSampleServer namespace.
- Updated all references to match new structure and naming.
- main.ck now opens CGameUser.cs instead of UserToken.cs.
- Minor formatting and comment improvements throughout.
Refactored client and server code for clarity and modern C# style:
- Renamed CGameUser to GameUser and CRemoteServerPeer to RemoteServerPeer, updating all references.
- Moved RemoteServerPeer to its own file and modernized its implementation.
- Updated client and server Program.cs to use top-level statements and simplified logic.
- Declared protocol enum directly in CSampleClient namespace.
- Modernized method signatures and removed unused usings/comments.
- Updated test and solution metadata for new file names and line numbers.
Major refactor replacing legacy C-style classes with idiomatic C#:
- Renamed all core types to PascalCase and updated to use properties, modern collections, and expression-bodied members.
- Introduced StateManager<T, T2> and MessageDispatcher<T, T2> for improved state and message handling.
- Updated IState/IUserState interfaces and separated room/user state logic into dedicated files.
- Moved protocol enum and logic to protocol.cs with better docs.
- Refactored Vector2 as a struct with operator overloads.
- Updated .editorconfig for modern C# style enforcement.
- Updated tests and entry point to use new types.
- Removed legacy files and added favorites.json for .editorconfig.
This improves maintainability, readability, and aligns with C# best practices.
Refactored codebase for modern C# conventions:
- Used 'var' for obvious types.
- Converted simple methods to expression-bodied members.
- Updated test assertions to discard results with '_ = await ...'.
- Reordered and moved test methods for clarity.
- Removed unused usings and improved formatting.
- Renamed variables for clarity.
No functional changes; all updates are stylistic.
- Added extensive unit tests for FreeNet and VirusWar server: core infra, network service, session lifecycle, and game logic.
- Set logic thread as background for test isolation.
- Improved UserToken.Close() with null checks to prevent NREs.
- Ensure UserToken.ProcessSend always closes on send failure.
- Added InternalsVisibleTo for test assemblies.
- Updated main.ck for active document path change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants