mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-19 21:11:15 +00:00
Master: Address race condition
Fix a race condition that would overwrite the port of zone 0 with the auth server port or a chat server port which would cause a domino effect of desynced server ports Tested that a sleep(5) in auth still allows a player to connect and login without issues
This commit is contained in:
parent
c6087ce77a
commit
2746683235
@ -581,7 +581,8 @@ void HandlePacket(Packet* packet) {
|
||||
inStream.Read(theirServerType);
|
||||
theirIP = PacketUtils::ReadString(24, packet, false); //24 is the current offset
|
||||
|
||||
if (theirServerType == ServerType::World && !Game::im->IsPortInUse(theirPort)) {
|
||||
if (theirServerType == ServerType::World) {
|
||||
if (!Game::im->IsPortInUse(theirPort)) {
|
||||
Instance* in = new Instance(theirIP, theirPort, theirZoneID, theirInstanceID, 0, 12, 12);
|
||||
|
||||
SystemAddress copy;
|
||||
@ -597,6 +598,7 @@ void HandlePacket(Packet* packet) {
|
||||
instance->SetSysAddr(packet->systemAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (theirServerType == ServerType::Chat) {
|
||||
SystemAddress copy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user