# reiserfss/infiniteloop architecture

> Architecture diagram of the GitHub repository reiserfss/infiniteloop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reiserfss/infiniteloop
- Repository: https://github.com/reiserfss/infiniteloop

## Overview

InfiniteLoop is a Punishing: Gray Raven private-server emulator targeting the global PC/Steam client. A client reaches the SDK’s account/config endpoints or opens a game TCP session; the game server processes requests, updates persistent player state, and returns responses or pushes. The implementation also covers activities, draws, task/reward claims, guilds, and BigWorld. Edges reflect excerpted calls, SOURCE INDEX references, or README statements; unsampled feature wiring is shown only where documented, and some subsystem boundaries remain approximate.

Main entry points: [`AscNet.GameServer/Session.cs`](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Session.cs) (Client session), [`AscNet.Common/Database/Player.cs`](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Player.cs) (Player state), [`AscNet.GameServer/Game/DrawManager.cs`](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Game/DrawManager.cs) (Draw systems), [`AscNet.SDKServer/SDKServer.cs`](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/SDKServer.cs) (SDK HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDK and accounts"]
  node_sdkserver["SDK HTTP server<br/>[SDKServer.cs]"]
  node_accountapi["Account endpoints"]
  node_kuroapi["Kuro SDK endpoints"]
end

subgraph group_runtime["Game runtime"]
  node_gameserver["Game TCP server<br/>[Server.cs]"]
  node_session["Client session<br/>[Session.cs]"]
  node_packet["Packet codec<br/>[PacketCodec.cs]"]
  node_handlers["Request handlers<br/>[Handlers]"]
end

subgraph group_features["Gameplay systems"]
  node_bigworld["BigWorld engine"]
  node_quest["BigWorld quests"]
  node_activity["Activity schedules"]
  node_draw["Draw systems<br/>[DrawManager.cs]"]
  node_tasks["Tasks and claims<br/>[TaskModule.cs]"]
  node_rewards["Reward processing<br/>[RewardHandler.cs]"]
  node_guild["Guild systems<br/>[GuildModule.cs]"]
end

subgraph group_state["Persistence and data"]
  node_common["Shared database access<br/>[Common.cs]"]
  node_player["Player state<br/>[Player.cs]"]
  node_character["Character state<br/>[Character.cs]"]
  node_inventory["Inventory state<br/>[Inventory.cs]"]
  node_mongo[("MongoDB")]
end

node_client(("Game client"))

node_client -->|"requests SDK"| node_sdkserver
node_client -->|"opens TCP session"| node_gameserver
node_sdkserver -.->|"hosts endpoints"| node_accountapi
node_sdkserver -.->|"hosts endpoints"| node_kuroapi
node_accountapi -->|"loads player"| node_player
node_accountapi -->|"uses shared access"| node_common
node_gameserver -->|"creates session"| node_session
node_session -->|"decodes packets"| node_packet
node_session -->|"dispatches requests"| node_handlers
node_common -->|"connects database"| node_mongo
node_player -->|"uses database"| node_common
node_session -->|"loads and saves"| node_player
node_session -->|"uses character state"| node_character
node_session -->|"uses inventory state"| node_inventory
node_bigworld -->|"uses quest runtime"| node_quest
node_draw -->|"checks schedules"| node_activity
node_draw -->|"persists draw state"| node_player
node_draw -->|"uses roster"| node_character
node_draw -->|"spends and grants"| node_inventory
node_tasks -->|"applies rewards"| node_rewards
node_tasks -.->|"updates progress"| node_player
node_guild -.->|"uses player state"| node_player

click node_sdkserver "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/SDKServer.cs"
click node_accountapi "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/Controllers/AccountController.cs"
click node_kuroapi "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/Controllers/KuroSdkController.cs"
click node_gameserver "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Server.cs"
click node_session "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Session.cs"
click node_packet "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/PacketCodec.cs"
click node_handlers "https://github.com/reiserfss/infiniteloop/tree/master/AscNet.GameServer/Handlers"
click node_bigworld "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/BigWorld/BigWorldModule.Engine.cs"
click node_quest "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/BigWorld/BigWorldQuestRuntime.cs"
click node_activity "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Game/ActivityScheduleService.cs"
click node_draw "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Game/DrawManager.cs"
click node_tasks "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/TaskModule.cs"
click node_rewards "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/RewardHandler.cs"
click node_guild "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/GuildModule.cs"
click node_common "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Common.cs"
click node_player "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Player.cs"
click node_character "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Character.cs"
click node_inventory "https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Inventory.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sdkserver,node_accountapi,node_kuroapi,node_client toneBlue
class node_gameserver,node_session,node_packet,node_handlers toneAmber
class node_bigworld,node_quest,node_activity,node_draw,node_tasks,node_rewards,node_guild toneMint
class node_common,node_player,node_character,node_inventory,node_mongo toneRose
```

## Components

### SDK and accounts

- [SDK HTTP server](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/SDKServer.cs): `AscNet.SDKServer/SDKServer.cs`
- [Account endpoints](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/Controllers/AccountController.cs): `AscNet.SDKServer/Controllers/AccountController.cs`
- [Kuro SDK endpoints](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.SDKServer/Controllers/KuroSdkController.cs): `AscNet.SDKServer/Controllers/KuroSdkController.cs`

### Game runtime

- [Game TCP server](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Server.cs): `AscNet.GameServer/Server.cs`
- [Client session](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Session.cs): `AscNet.GameServer/Session.cs`
- [Packet codec](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/PacketCodec.cs): `AscNet.GameServer/PacketCodec.cs`
- [Request handlers](https://github.com/reiserfss/infiniteloop/tree/master/AscNet.GameServer/Handlers): `AscNet.GameServer/Handlers`

### Gameplay systems

- [BigWorld engine](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/BigWorld/BigWorldModule.Engine.cs): `AscNet.GameServer/Handlers/BigWorld/BigWorldModule.Engine.cs`
- [BigWorld quests](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/BigWorld/BigWorldQuestRuntime.cs): `AscNet.GameServer/Handlers/BigWorld/BigWorldQuestRuntime.cs`
- [Activity schedules](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Game/ActivityScheduleService.cs): `AscNet.GameServer/Game/ActivityScheduleService.cs`
- [Draw systems](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Game/DrawManager.cs): `AscNet.GameServer/Game/DrawManager.cs`
- [Tasks and claims](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/TaskModule.cs): `AscNet.GameServer/Handlers/TaskModule.cs`
- [Reward processing](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/RewardHandler.cs): `AscNet.GameServer/Handlers/RewardHandler.cs`
- [Guild systems](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.GameServer/Handlers/GuildModule.cs): `AscNet.GameServer/Handlers/GuildModule.cs`

### Persistence and data

- [Shared database access](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Common.cs): `AscNet.Common/Common.cs`
- [Player state](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Player.cs): `AscNet.Common/Database/Player.cs`
- [Character state](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Character.cs): `AscNet.Common/Database/Character.cs`
- [Inventory state](https://github.com/reiserfss/infiniteloop/blob/master/AscNet.Common/Database/Inventory.cs): `AscNet.Common/Database/Inventory.cs`
- **MongoDB**

### Other components

- **Game client**

## Connections

- Game client → SDK HTTP server: requests SDK
- Game client → Game TCP server: opens TCP session (evidence: `AscNet.GameServer/Server.cs`)
- SDK HTTP server → Account endpoints: hosts endpoints (evidence: `AscNet.SDKServer/Controllers/AccountController.cs`)
- SDK HTTP server → Kuro SDK endpoints: hosts endpoints (evidence: `AscNet.SDKServer/Controllers/KuroSdkController.cs`)
- Account endpoints → Player state: loads player (evidence: `AscNet.SDKServer/Controllers/AccountController.cs`)
- Account endpoints → Shared database access: uses shared access (evidence: `AscNet.SDKServer/Controllers/AccountController.cs`)
- Game TCP server → Client session: creates session (evidence: `AscNet.GameServer/Server.cs`)
- Client session → Packet codec: decodes packets (evidence: `AscNet.GameServer/Session.cs`)
- Client session → Request handlers: dispatches requests (evidence: `AscNet.GameServer/Session.cs`)
- Shared database access → MongoDB: connects database (evidence: `AscNet.Common/Common.cs`)
- Player state → Shared database access: uses database (evidence: `AscNet.Common/Database/Player.cs`)
- Client session → Player state: loads and saves (evidence: `AscNet.GameServer/Session.cs`)
- Client session → Character state: uses character state (evidence: `AscNet.GameServer/Session.cs`)
- Client session → Inventory state: uses inventory state (evidence: `AscNet.GameServer/Session.cs`)
- BigWorld engine → BigWorld quests: uses quest runtime (evidence: `AscNet.GameServer/Handlers/BigWorld/BigWorldModule.Engine.cs`)
- Draw systems → Activity schedules: checks schedules (evidence: `AscNet.GameServer/Game/DrawManager.cs`)
- Draw systems → Player state: persists draw state (evidence: `AscNet.GameServer/Game/DrawManager.cs`)
- Draw systems → Character state: uses roster (evidence: `AscNet.GameServer/Game/DrawManager.cs`)
- Draw systems → Inventory state: spends and grants (evidence: `AscNet.GameServer/Game/DrawManager.cs`)
- Tasks and claims → Reward processing: applies rewards (evidence: `AscNet.GameServer/Handlers/TaskModule.cs`)
- Tasks and claims → Player state: updates progress (evidence: `AscNet.GameServer/Handlers/TaskModule.cs`)
- Guild systems → Player state: uses player state
