WorldUpdate.cpp 596 B

1234567891011121314151617181920212223242526
  1. #include "WorldUpdate.h"
  2. #include "Registries.h"
  3. #include <Text.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 = new Framework::Text("asynchony after world update of type ");
  18. t->append(this->id);
  19. t->append(". ID received from server was: ");
  20. t->append(id);
  21. throw t->getText();
  22. }
  23. }