Jump to content

kerhong

Members
  • Posts

    11
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

kerhong's Achievements

Member

Member (2/3)

0

Reputation

  1. Windows: CRLF Unix, Linux and OSX: LF Older Apples: CR CRLF was 1st, but it takes twice the space to store compared to LF. Go figure witch is better and should be adopted by all others, because LF is smaller, but CRLF got backward compatibility.
  2. MMORPG server emulating step by step: #1 Do single action over and over again while logging packets #2 Check witch packet got sent same amount of times as you did your action #3 Reverse-engineer packet structure (disassemble client or do similar action so the same opcode gets sent only with slightly different data) #4 Create such feature for your emulator Usually you should start with movement handling and then go in more difficult directions. That's the very very short and simple version
  3. Runic power also should be set to 0 when gates open
  4. Player *player = sObjectMgr.GetPlayer(guid) Returns NULL if player is not online, otherwise returns pointer to player
  5. Server has one 'master loop' that updates all sessions and maps. Update diff is length of single update cycle
  6. Why would you call it 'hack'? Client sends OS data only to authserver, so the operating system detection can't be handled in worldserver The value must be stored in database, because all data from authserver to worldserver is sent this way Storing plain string instead of comparing it to known operating systems and storing some ID of the OS is better, because there could be more possible values other than "Win" and "OSX" The 'if (ch->os[n]) operatingSystem.push_back(ch->os[n]);' part could be done without IFs or in loop, but really checking if byte is zero is faster than pushing 0 in end of string.
  7. http://pastebin.com/HguDsvNn http://pastebin.com/2dgshw6V (this patch also got some comment removals, but they should be ignored as those parts shouldn't be commented out at all) Simple fix for creating needed warden (Windows/Mac), written for TC2, but with small modifications should work for mangos
  8. Not tested but should answer what you ask // Add this in Player.h struct DamageHealData { DamageHealData() : damage(0), healing(0) { } uint32 damage; uint32 healing; }; // Add this to Player class std::map<uint64, DamageHealData*> m_DamagersAndHealers; // Unit::DealDamage if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) ((Player*)pVictim)->DamagedOrHealed(GetGUID(), damage, 0); // Unit::DealHeal if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) ((Player*)pVictim)->DamagedOrHealed(GetGUID(), 0, addhealth); // Unit::ClearInCombat if (GetTypeId() == TYPEID_PLAYER) { Player *p = ((Player*)this); for (std::map<uint64, DamageHealData*>::iterator itr = p->m_DamagersAndHealers.begin(); itr != p->m_DamagersAndHealers.end(); ++itr) delete itr->second; p->m_DamagersAndHealers.clear(); } void Player::DamagedOrHealed(uint64 guid, uint32 damage, uint32 heal) { DamageHealData *data = NULL; if (!data = m_DamagersAndHealers[guid]) m_DamagersAndHealers[guid] = new DamageHealData(); data->damage += damage; data->healing += heal; } // Example for (std::map<uint64, DamageHealData*>::iterator itr = m_DamagersAndHealers.begin(); itr != m_DamagersAndHealers.end(); ++itr) { if (itr->second->damage > itr->second->healing) sLog->outString("Player with GUID %u is damager"); else sLog->outString("Player with GUID %u is healer"); }
  9. All orientation in Mangos is done in radians, 1 radian = 180 degrees Max value of orientation is 2M_PI (3.14*2 = ~6.28) witch alseo equals 0 (2 radians are full cycle) To turn right you need to substract 'value' from current orientation. 30 degrees = M_PI / 6 So the new orientation would be 'o - value' (if the value is given in radians) Also this rule should be followed: 0 < orientation < 2M_PI This should work: if (orientation < 0.0f) orientation += 2.0f * M_PI; else if (orientation > 2* M_PI) orientation -= 2.0f * M_PI; Turning around would be 'o - M_PI' Degrees to radians can be converted with 'radians = degrees * M_PI / 180.0f'
  10. 1. Client sends movement packets with X,Y and Z coordinates, orientation and various movement flags 2. When you want to know ground level at some X and Y coordinate 3. For random movement (npc idle movement, fear, disorient)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use