Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 2.61 KB

File metadata and controls

41 lines (33 loc) · 2.61 KB

AGENTS.md — PaimonMultiplier

Build & Run

dotnet build PaimonMultiplier.sln
# Requires .NET 8 SDK. No global.json — any SDK 8.x works.

Run PaimonMultiplier.SDK (port :8888) and PaimonMultiplier.Gameserver (port :22101) together. Optionally run PaimonMultiplier.Proxy (port :8080, MITM) to intercept game traffic.

Architecture

Project Role Entry / Notes
PaimonMultiplier.Proxy MITM proxy on :8080, redirects *.yuanshen.com / *.hoyoverse.com / *.mihoyo.comhttp://127.0.0.1:8888/ Titanium.Web.Proxy
PaimonMultiplier.SDK ASP.NET HTTP server on :8888 — region list, auth/login endpoints Program.cs
PaimonMultiplier.Gameserver Game logic engine — KCP transport on :22101, custom controller routing Program.cs, GameServer.cs
PaimonMultiplier.Common Assets (assets/excel/, assets/binout/, assets/security/), Xor/RSA/MT19937 crypto Shared lib
PaimonMultiplier.Protocol ~590 .proto files, CmdType.cs (~2000+ entries), Retcode.cs (~900+ codes) Google.Protobuf
PaimonMultiplier.Kcp Self-contained KCP reliable-UDP implementation (no NuGet) Transport lib

Dependency flow

Proxy (standalone)
SDK → Common → Protocol
Gameserver → Common, Protocol, Kcp
Common → Protocol

Key Development Facts

  • No database — all player state is in-memory per session (Player.cs:InitDefaultPlayer). Restart = reset.
  • No tests exist. No test projects, no test framework.
  • No CI/CD, no .editorconfig, no code analyzers.
  • Custom controller system[NetController] + [NetCommand(CmdType.Xxx)] attributes, not ASP.NET MVC. NetCommandDispatcher builds a static handler map via reflection + expression trees.
  • Packet wire format: 2-byte HeaderMagic 0x4567 + 2-byte CmdType + 2-byte HeadLength + 4-byte BodyLength + Head + Body + 2-byte TailMagic 0x89AB. Protobuf serialization.
  • In-memory defaults: all avatars unlocked except 10000001 (Kate) and 10000007 (Traveler); default team is Albedo (10000073); skills have no cooldowns (reset immediately); movement handled via ClientActionManager.
  • Code conventions: file-scoped namespaces, nullable enabled, implicit usings, primary constructors, ValueTask for async, internal visibility on most types.
  • Assets location: PaimonMultiplier.Common/assets/ — Excel tables, avatar binout configs, security keys (initial_key.bin, initial_key.ec2b, client_public_key.der).
  • Git remote: https://git.xeondev.com/xeon/PaimonMultiplier (branch master, 8 commits, no tags).