WorldUpdate.cpp 670 B

12345678910111213141516171819202122232425262728
  1. #include "WorldUpdate.h"
  2. #include <Text.h>
  3. #include "Registries.h"
  4. WorldUpdateType::WorldUpdateType(int id)
  5. : ReferenceCounter(),
  6. id(id)
  7. {
  8. STATIC_REGISTRY(WorldUpdateType).registerT(this, id);
  9. }
  10. void WorldUpdateType::applyUpdateAndCheck(Framework::StreamReader* zReader)
  11. {
  12. this->applyUpdate(zReader);
  13. int id;
  14. zReader->lese((char*)&id, 4);
  15. if (id != this->id)
  16. {
  17. Framework::Text* t
  18. = new Framework::Text("asynchony after world update of type ");
  19. t->append(this->id);
  20. t->append(". ID received from server was: ");
  21. t->append(id);
  22. throw t->getText();
  23. }
  24. }