Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. [11:51:34 AM] Pursche: FixLanguageSkills() changes did not help.
  2. [12:06:11 PM] Pursche: Still stating that I don't know the language
  3. [12:06:29 PM] Pursche: It fails here:
  4. [12:06:47 PM] Pursche: if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id))
  5. {
  6. // also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language)
  7. Unit::AuraEffectList const& langAuras = sender->GetAuraEffectsByType(SPELL_AURA_COMPREHEND_LANGUAGE);
  8. bool foundAura = false;
  9. for (Unit::AuraEffectList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i)
  10. {
  11. if ((*i)->GetMiscValue() == int32(lang))
  12. {
  13. foundAura = true;
  14. break;
  15. }
  16. }
  17. if (!foundAura)
  18. {
  19. SendNotification(LANG_NOT_LEARNED_LANGUAGE); // HERE
  20. recvData.rfinish();
  21. return;
  22. }
  23. }
  24. [12:07:02 PM] Pursche: I'm trying this as a temporary fix: if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id) && sender->getORace() == sender->getRace())
  25. [4:37:12 PM] Pursche: Tried it
  26. [4:37:55 PM] Pursche: It kinda worked...
  27. [4:38:06 PM] Pursche: It seems like there is a clientside check and a serverside, the serverside is fixed
  28. [4:38:12 PM] Pursche: I was a gnome, I got turned into a warlock
  29. [4:38:41 PM] Pursche: Immediately on spawning I tried to talk, resulting in this
  30. [4:39:07 PM] Pursche: However, if I go into the language settings and pick Common again, it works:
  31. [4:39:40 PM] Pursche: Here's the code I'm running for it to work
  32. [4:39:44 PM] Pursche: void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
  33. {
  34. uint32 type;
  35. uint32 lang;
  36.  
  37. recvData >> type;
  38. recvData >> lang;
  39.  
  40. // if (sWorld->getBoolConfig(BATTLEGROUND_CROSSFACTION_ENABLED) /*&& lang != LANG_ADDON*/) TODO: Figure out if this is needed in next CFBG
  41. {
  42. switch (type)
  43. {
  44. case CHAT_MSG_BATTLEGROUND:
  45. case CHAT_MSG_BATTLEGROUND_LEADER:
  46. lang = LANG_UNIVERSAL;
  47. default:
  48. break;
  49. }
  50. }
  51.  
  52. Player* sender = GetPlayer();
  53.  
  54. if (sender->getORace() != sender->getRace())
  55. lang = LANG_UNIVERSAL;
  56.  
  57. if (type >= MAX_CHAT_MSG_TYPE)
  58. {
  59. TC_LOG_ERROR("network", "CHAT: Wrong message type received: %u", type);
  60. recvData.rfinish();
  61. return;
  62. }
  63.  
  64. if (lang == LANG_UNIVERSAL && type != CHAT_MSG_AFK && type != CHAT_MSG_DND && sender->getORace() == sender->getRace())
  65. {
  66. TC_LOG_ERROR("entities.player.cheat", "CMSG_MESSAGECHAT: Possible hacking-attempt: %s tried to send a message in universal language", GetPlayerInfo().c_str());
  67. SendNotification(LANG_UNKNOWN_LANGUAGE);
  68. recvData.rfinish();
  69. return;
  70. }
  71. [4:40:06 PM] Pursche: As well as your updated FixLanguageSkills function, but that didn't seem to help. :/
  72. [4:40:18 PM] Pursche: I'm off to bed, please tell me what you think when you see this
  73. [4:42:23 PM] lordpsyan: Where did you place that code? I gotta stop working with 10 scripts at a time lol
  74. [4:43:17 PM] Pursche: That code is at the top of WorldSession::HandleMessagechatOpcode
  75. [4:43:54 PM] Pursche: There is more to the function below what I pasted but it's unchanged
  76. [4:44:49 PM] Pursche: My changes are setting lang to LANG_UNIVERSAL if the player is CF'ed, and changing the last if case I pasted to only apply to non CF'ed players
  77. [4:45:02 PM] lordpsyan: if (spell->HasEffect(SPELL_EFFECT_LANGUAGE))
  78. [4:45:06 PM] lordpsyan: try changing that to
  79. [4:45:16 PM] lordpsyan: if (spell->HasEffect(SPELL_EFFECT_LANGUAGE) || spell->HasEffect(SPELL_AURA_COMPREHEND_LANGUAGE) )
  80. [4:45:25 PM] Pursche: It doesnt matter
  81. [4:45:41 PM] Pursche: The problems I am having in the first printscreen is clientside
  82. [4:45:50 PM] lordpsyan: there has to be an easier way, like ignoring the config settings for universal speaking, just in battlegrounds.
  83. [4:45:55 PM] lordpsyan: yeah
  84. [4:45:59 PM] Pursche: I put a breakpoint in the handleopcode function and it never triggers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement