Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. /*
  2. Copyright <SWGEmu>
  3. See file COPYING for copying conditions.*/
  4.  
  5. #ifndef CHARACTERSHEETRESPONSEMESSAGE_H_
  6. #define CHARACTERSHEETRESPONSEMESSAGE_H_
  7.  
  8. #include "engine/service/proto/BaseMessage.h"
  9. #include "server/zone/objects/creature/CreatureObject.h"
  10.  
  11. class CharacterSheetResponseMessage : public BaseMessage {
  12. public:
  13. CharacterSheetResponseMessage(CreatureObject* player) : BaseMessage() {
  14. insertShort(0x0D);
  15. insertInt(0x9B3A17C4); // CRC
  16.  
  17. //We should be passing playerobject into this method, rather than PlayerCreature.
  18. ManagedReference<PlayerObject*> ghost = player->getPlayerObject();
  19.  
  20. insertInt(0); //??
  21. insertInt(0); //??
  22.  
  23. uint64 preDesignatedFacilityOid = ghost->getCloningFacility();
  24. ManagedReference<SceneObject*> cloningFacility = player->getZoneServer()->getObject(preDesignatedFacilityOid);
  25.  
  26. if (cloningFacility != NULL && cloningFacility->getZone() != NULL) {
  27. insertFloat(cloningFacility->getPositionX());
  28. insertFloat(cloningFacility->getPositionZ());
  29. insertFloat(cloningFacility->getPositionY());
  30. insertAscii(cloningFacility->getZone()->getZoneName()); //note: the client ignores the tutorial zone
  31. } else {
  32. insertFloat(0); //Bind Location X
  33. insertFloat(0); //Bind Location Z
  34. insertFloat(0); //Bind Location Y
  35. insertAscii(""); //Bind Planet
  36. }
  37.  
  38. insertFloat(0); //Bank Location X
  39. insertFloat(0); //Bank Location Z
  40. insertFloat(0); //Bank Location Y
  41. insertAscii(ghost->getBankLocation()); //Bank Planet
  42.  
  43. uint64 declaredOidResidence = ghost->getDeclaredResidence();
  44.  
  45. ManagedReference<SceneObject*> declaredResidence = player->getZoneServer()->getObject(declaredOidResidence);
  46.  
  47. if (declaredResidence != NULL && declaredResidence->getZone() != NULL) {
  48. insertFloat(declaredResidence->getPositionX()); //Home Location X
  49. insertFloat(declaredResidence->getPositionZ()); //Home Location Z
  50. insertFloat(declaredResidence->getPositionY()); //Home Location Y
  51. insertAscii(declaredResidence->getZone()->getZoneName()); //Home Planet
  52. } else {
  53. insertFloat(0);
  54. insertFloat(0);
  55. insertFloat(0);
  56. insertAscii("");
  57. }
  58.  
  59. insertUnicode(ghost->getSpouseName()); //Spouse Name
  60. insertInt(ghost->getLotsRemaining()); //Lots Remaining
  61.  
  62. insertInt(player->getFaction()); //Faction CRC (or hashCode?)
  63. insertInt(player->getFactionStatus()); //Faction Status
  64.  
  65. setCompression(true);
  66. }
  67.  
  68. };
  69.  
  70. #endif /*CHARACTERSHEETRESPONSEMESSAGE_H_*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement