Skip to content

Commit

Permalink
Merge pull request yvt#848 from Tuupertunut/master
Browse files Browse the repository at this point in the history
Fixed map loading with protocol 0.76.
  • Loading branch information
yvt authored Aug 6, 2020
2 parents 8f21710 + 5a57a5e commit 738c7e5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/Client/NetClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ namespace spades {
PacketTypeWeaponReload = 28, // C2S2P
PacketTypeChangeTeam = 29, // C2S2P
PacketTypeChangeWeapon = 30, // C2S2P
PacketTypeMapCached = 31, // S2C
PacketTypeHandShakeInit = 31, // S2C
PacketTypeHandShakeReturn = 32, // C2S
PacketTypeVersionGet = 33, // S2C
Expand Down Expand Up @@ -1299,6 +1300,16 @@ namespace spades {
} break;
case PacketTypeMapStart: {
// next map!
if (protocolVersion == 4) {
// The AoS 0.76 protocol allows the client to load a map from a local cache
// if possible. After receiving MapStart, the client should respond with
// MapCached to indicate whether the map with a given checksum exists in the
// cache or not. We don't implement a local cache, so we always ask the
// server to send fresh map data.
NetPacketWriter wri(PacketTypeMapCached);
wri.Write((uint8_t)0);
enet_peer_send(peer, 0, wri.CreatePacket());
}
client->SetWorld(NULL);

auto mapSize = reader.ReadInt();
Expand Down

0 comments on commit 738c7e5

Please sign in to comment.