Fix "orbit" semantics. Federation works.

This commit is contained in:
Adam Ierymenko 2017-02-13 16:38:21 -08:00
parent 969e09210d
commit af4e79735c
3 changed files with 24 additions and 5 deletions

View file

@ -455,16 +455,16 @@ bool IncomingPacket::_doOK(const RuntimeEnvironment *RR,const SharedPtr<Peer> &p
// Handle planet or moon updates if present
if ((ptr + 2) <= size()) {
const unsigned int worldLen = at<uint16_t>(ptr); ptr += 2;
if (RR->topology->isUpstream(peer->identity())) {
const unsigned int endOfWorlds = ptr + worldLen;
const unsigned int worldsLen = at<uint16_t>(ptr); ptr += 2;
if (RR->topology->shouldAcceptWorldUpdateFrom(peer->address())) {
const unsigned int endOfWorlds = ptr + worldsLen;
while (ptr < endOfWorlds) {
World w;
ptr += w.deserialize(*this,ptr);
RR->topology->addWorld(w,false);
}
} else {
ptr += worldLen;
ptr += worldsLen;
}
}