mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
fix: the master server only starts instances of zones in the ZoneTable
A transfer or private zone request started a world server for whatever map ID it named, and for as many instances as were asked for. A new instance now needs a row in the ZoneTable for its zone, and no more than max_instances (masterconfig.ini, 256 by default, 0 for no limit) run at once. The character select has no row and is always started. A request that gets no instance is logged and dropped. Before, the handlers went on to use the missing instance. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -745,6 +745,10 @@ namespace {
|
||||
return;
|
||||
}
|
||||
const auto& in = Game::im->GetInstance(zoneID, false, zoneClone);
|
||||
if (!in) {
|
||||
LOG("No instance for transfer request %llu to zone %i %i", requestID, zoneID, zoneClone);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& instance : Game::im->GetInstances()) {
|
||||
LOG("Instance: %i/%i/%i -> %i %s", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance == in, instance->GetSysAddr().ToString());
|
||||
@@ -887,6 +891,10 @@ namespace {
|
||||
void OnCreatePrivateZone(const CreatePrivateZone& request, const SystemAddress& sysAddr) {
|
||||
// Passwords were cut to 50 characters when read
|
||||
const auto& newInst = Game::im->CreatePrivateInstance(request.zoneID, request.cloneID, request.password.c_str());
|
||||
if (!newInst) {
|
||||
LOG("No private zone was created for map %i/%i", request.zoneID, request.cloneID);
|
||||
return;
|
||||
}
|
||||
LOG("Creating private zone %i/%i/%i", newInst->GetMapID(), newInst->GetCloneID(), newInst->GetInstanceID());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user