mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-01 01:17:13 +00:00
fix(ugc): a client back at character select starts its UGC switches afresh
Switching characters keeps the connection (the client sends CHARACTER_LIST_REQUEST to the world it's in), so the per-client UGC state (waiting requests, pending mesh switches, the 3-switches-per-model cap) carried over to the next character. It's now dropped as on a disconnect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@ namespace UgcManifest {
|
|||||||
// clients to served meshes that are due
|
// clients to served meshes that are due
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
// A client left: its waiting requests are dropped
|
// A client left (or went back to character select): its waiting requests and pending switches are dropped
|
||||||
void OnDisconnect(const SystemAddress& sysAddr);
|
void OnDisconnect(const SystemAddress& sysAddr);
|
||||||
|
|
||||||
// The UGC server made these models' meshes (again, with a new checksum): each one placed in this world is sent the
|
// The UGC server made these models' meshes (again, with a new checksum): each one placed in this world is sent the
|
||||||
|
|||||||
@@ -1229,6 +1229,8 @@ namespace {
|
|||||||
auto user = UserManager::Instance()->GetUser(sysAddr);
|
auto user = UserManager::Instance()->GetUser(sysAddr);
|
||||||
if (!user || !user->GetLastUsedChar()) return;
|
if (!user || !user->GetLastUsedChar()) return;
|
||||||
Game::entityManager->DestroyEntity(user->GetLastUsedChar()->GetEntity());
|
Game::entityManager->DestroyEntity(user->GetLastUsedChar()->GetEntity());
|
||||||
|
// Back at character select on the same connection: forget this client's UGC requests and switches
|
||||||
|
UgcManifest::OnDisconnect(sysAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
//This loops prevents users who aren't authenticated to double-request the char list, which
|
//This loops prevents users who aren't authenticated to double-request the char list, which
|
||||||
|
|||||||
Reference in New Issue
Block a user