Commit Graph
100 Commits
Author SHA1 Message Date
linmeideli 7c8c629ea5 Add fault tolerance to GameData messages 2026-08-17 12:12:40 +08:00
linmeideli 68ac3de0bd Relaxation of the Disconnection Threshold 2026-08-17 10:40:44 +08:00
FangkuaiYa ea9547cec6 Revert "Optimize"
This reverts commit a4de6a83d9.
2026-08-17 02:38:20 +08:00
FangkuaiYa a4de6a83d9 Optimize 2026-08-17 01:06:56 +08:00
FangkuaiYa 50a159f8cf Fix player log 2026-08-17 00:12:31 +08:00
FangkuaiYa e956874877 Fix 2026-08-16 22:58:16 +08:00
FangkuaiYa 895e64c820 Remove Ip match 2026-08-16 22:08:04 +08:00
FangkuaiYa 9dd45f35f7 Fix 2026-08-15 13:16:55 +08:00
FangkuaiYa 41b63f653c Fix rejoin spawn timeout without leaving players stuck
- HandleJoinGameNew: clear stale Character so spawn timeout can fire on
  rejoin in host-authority mode.
- CheckLimboPlayers: clear stale Character and start spawn timeout when
  pulling players out of limbo; keep the direct pull-out (not the PR's
  HandleJoinGameNext call, which re-set WaitingForHost and stuck players on
  the wait-for-host screen).
- DespawnPlayerInfoAsync: revert to upstream OwnerId == ServerOwned check to
  stay aligned with official Impostor.
2026-08-15 13:03:23 +08:00
FangkuaiYa bb4da29d7e Merge branch 'main' of https://cdn.gh-proxy.org/https://github.com/Empostor/Empostor 2026-08-15 12:38:55 +08:00
FangkuaiYa dcb307db8e Fix lingering players in lobby under host-authority mode
Align with upstream Impostor: use ConcurrentDictionary for _allObjects,
remove the ServerOwned guard in DespawnPlayerInfoAsync so client-spawned
PlayerInfo is cleaned up, and simplify PlayerRemove / AddClientSafeAsync
lifecycle handling. Fixes players remaining visible after disconnect and
NetId conflicts on rejoin.
2026-08-15 12:38:35 +08:00
linmeideli 62509fa0e0 fix 2026-08-15 12:29:35 +08:00
linmeideli 3e0829e05f reroll 2026-08-15 12:25:03 +08:00
linmeideli b8dc5accd0 a weird issue 2026-08-15 02:47:12 +08:00
Christina bf5329b432 Update index.html 2026-08-14 14:13:53 +08:00
linmeideli 4902120547 Auto publish to tag release 2026-08-14 12:21:33 +08:00
linmeideli f3f50e020d Enhanced this holy Event 2026-08-14 10:14:43 +08:00
linmeideli c086948864 Follow up on updates to Impostor
https://github.com/Impostor/Impostor/pull/738
2026-08-14 09:55:06 +08:00
linmeideli 48dc0da177 Hplp always keep public 2026-08-14 00:08:35 +08:00
FangkuaiYa 22b8a19159 Update URL 2026-08-13 21:30:20 +08:00
FangkuaiYa 48ba15ca09 Port Authentication 2026-08-13 20:53:54 +08:00
FangkuaiYa 715de1002d Add Reactor.Empostor 2026-08-13 11:50:33 +08:00
FangkuaiYa 8772acdc3b Fix +25 red player and friendcode 2026-08-13 11:18:36 +08:00
FangkuaiYa 5a58c630d5 Fix 2026-08-13 00:10:39 +08:00
FangkuaiYa db366e3e1a Change port config 2026-08-12 12:45:18 +08:00
FangkuaiYa 80d666e369 Fix port 2026-08-12 12:30:58 +08:00
FangkuaiYa 2cd2f92d4f New Update (No Test):
## Fix: players keep getting kicked mid-game (auth cache TTL)

**Root cause**: the auth cache (`AuthCacheService`) has a 10-min TTL but `CreatedAt` was only set when the token was created — never refreshed while the player was actually connected. After ~12 min, the cleanup timer would expire the port entry, fire `OnPortExpired` → return the port to the pool → stop the delta UDP listener → the active player got force-disconnected ("Server shutting down" in the logs).

**What I changed**:
- `AuthCacheService`: added a `_confirmedPorts` set + `ConfirmPort()`. Cleanup now **skips confirmed (actively connected) ports** — as long as the player is connected, the port lease is never cleared.
- `ClientManager`: calls `_authCache.ConfirmPort(deltaPort)` right after `_portPool.ConfirmPort()` when the port matches, so an active session is marked confirmed.
- Port is still properly released on disconnect (existing `RemoveByPort` path untouched).

---

## Change: hide the default UDP port, use last delta port as default

**Why**: the well-known default port (my config: 22023) was getting flooded with garbage UDP. So now the server reserves the **last port** of the delta range as the main listener, so the default game socket is never the obvious 22023, and even if the pool is fully allocated, the server still runs.

**What I changed**:
- `ServerConfig`: new option `ReserveLastDeltaPortAsDefault` (default true).
- `PortPoolService`: `DefaultPort` = last delta port (`DeltaPortEnd`) when enabled; pool excludes it.
- `MatchmakerService`: main UDP listener binds to `DefaultPort` instead of `ListenPort`.
- `GamesController`: fallback port in `GetDeltaPort()` uses `DefaultPort`.

---

## Change: Filtaur-style line-speed UDP packet filter

**What I changed**: new `UdpPacketFilter` in Hazel + hooked into `UdpConnectionListener.ProcessData`. It drops junk at line speed before it reaches the game server:
- size check (min/max length),
- send-option byte check (layer-7),
- per-IP connection burst limit + temporary blacklist (default 30 burst / 60s blacklist).

Only applies to **unknown endpoints** (new connection attempts); established connections are never filtered, so in-game traffic is unaffected. This is the "filtaur" idea — force spammers through overhead and drop bad packets fast so they can't overload the server and drop everyone.

---

## Config (config.json)
Added `"ReserveLastDeltaPortAsDefault": true` under `Server`.
2026-08-12 12:15:41 +08:00
linmeideli c6e6214288 Bump 2026-08-03 11:50:30 +08:00
linmeideli 6d5089762f Fix: register BanCommand in DI container 2026-08-02 12:39:50 +08:00
linmeideli 92defb754f Add #end/#ban/#kick host commands, fix admin panel Active Games filter, fix double-title bug, make channel messages visible to all 2026-08-02 12:26:33 +08:00
linmeideli 0190bb854c Fix title in-game name and last connect time 2026-08-01 15:19:01 +08:00
linmeideli 96e809a5b8 fix TitleApiMiddleware DI resolution 2026-08-01 14:57:36 +08:00
linmeideli 3f8a8139fc Add random tag support to Welcome plugin 2026-08-01 14:49:54 +08:00
linmeideli c31cb0244c add missing logo for nuget pack 2026-08-01 00:20:26 +08:00
linmeideli 81e74e7d48 fix lock files 2026-08-01 00:12:53 +08:00
linmeideli e44efc79c2 Enhanced Titles & Welcome Plugins with Anti-Cheat 2026-08-01 00:03:03 +08:00
linmeideli 0a5e3b3173 Support Starlight HPLP 2026-07-09 15:30:27 +08:00
linmeideli 24eb5d3371 Update Webhook 2026-07-09 13:22:26 +08:00
linmeideli 04059279f6 fix Admin Panel 2026-07-04 14:23:23 +08:00
linmeideli 354bc1757d 丨 & Plugin Update 2026-07-04 14:18:51 +08:00
linmeideli 0e70cafd23 Enhanced Log Output Style 2026-07-04 14:14:21 +08:00
linmeideli 6248d3c0cc Admin Client Details Add 2026-07-04 13:41:21 +08:00
linmeideli 7dfcec19cf Change Log out pit style 2026-07-04 12:41:08 +08:00
linmeideli 6ee0a117ce Regular code style 2026-07-04 12:11:26 +08:00
Christina 0c53abb950 Merge pull request #1 from Empostor/fd-fix
Fd fix
2026-07-04 10:56:39 +08:00
FangkuaiYa b4d259688f Modify log format
Thank you for downloading the log from QQ, I don't know where to find it
Thank you for selling NikoCat233 for 180
Thank you for betraying us
2026-06-28 22:56:39 +08:00
FangkuaiYa a575991eaa Change File construction 2026-06-28 22:04:14 +08:00
FangkuaiYa 2ff57d7432 Fix admin ban Ip 2026-06-28 21:55:23 +08:00
FangkuaiYa ca80b42b3f ▎ Dynamic UDP port allocation for TCP/UDP identity matching
▎
  ▎ On HTTP authentication (POST /api/user), the server allocates a unique UDP port from a configurable pool
  ▎ (DeltaPortStart–DeltaPortEnd). The port acts as a nonce — when the client connects via UDP to that specific port,
  ▎ the server matches the connection to the authenticated PUID and FriendCode. This replaces unreliable IP-based
  ▎ matching, especially for players behind NAT/CGNAT.
  ▎
  ▎ - PortPoolService — thread-safe port pool with 5-minute auto-recycle if no connection arrives
  ▎ - IDeltaListenerManager — starts/stops UDP listeners on allocated ports (implemented by Matchmaker)
  ▎ - IFirewallService — UFW / firewalld / noop backends that automatically open/close firewall rules for allocated
  ▎ ports
  ▎ - Falls back to IP-based matching when the pool is exhausted or the feature is disabled (DeltaPortStart: 0)
  ▎ - TokenController returns both Port and Hash (matchmakerToken) to the client in the auth response
2026-06-28 14:51:39 +08:00
linmeideli c3df40c96c Admin 2026-06-27 20:07:10 +08:00