SD2 update
[12562] Remove not required duplicate indexes

Signed-off-by: Schmoozerd <schmoozerd@cmangos>
[mr2977] usable code from 12560, 12561, 12566, 12567
[mr2978] Use unified GuidSet for players/active objects in map. avoid using mapReference for player update iterations, must be much more safe (but need make same operations in other places). testing. MUST BE DANGEROWS!
[mr2979] Redesign GridStates operations v0.2

includes squashed commit of the following:

commit adacd2c009fec2cb662a3261de1a462f98724a6c
Author: rsa <kris13@bk.ru>
Date:   Sun Sep 29 13:39:15 2013 +0400

    redesign GridState operations, must solve some problems with grid load/unload part 2 (only code simplify).

commit 1345a833fc243db593546dc91b7452a648d11318
Author: rsa <kris13@bk.ru>
Date:   Sun Sep 29 11:28:29 2013 +0400

    redesign GridState operations, must solve some problems with grid load/unload. testing
[mr2980] Finally fix "Mobs are chasing the player too long", close #1375
[mr2891] Use R2 StateMgr instead of MGen
[mr2982] Some movement packet fixes, taking into account client/server connection lag

Picked from TC, where ported from http://sourceforge.net/p/ascentemubackup/code/1637/

Tested, works fine.
[mr2893] Load guild bank's data not on core start, but only on demand

* Significantly speeds up the core start on large servers.
* Used much memory as need (the bank data loads when first guild player clicks on it, and unloads when last guild player out of the game).

This code works about 3 years w/o problems.
Fix compile, close #1409

Add to R2 MovementInfo::GetTime() function
Forgotten WorldSession.cpp in mr2983
[mr2984] Use Sql Statements in groups code and small code style
[mr2985] Group: extends requests about member role
[mr2986] Group: auto change group leader for suitable group member when leader gone

Fix situations, when raid in dungeon, set master loot, and leader gone for some reason.
Now after waiting to reconnecting leader, lead goes to another group member.
[mr2987] Mitigate DoS attacks to authserver

Mitigate DoS attacks to authserver like "Wow Auth Flooder.exe" by allowing a finite number of AUTH_LOGON_CHALLEGE packets in a row from same socket, 3 sounds like a reasonable limit.

Picked from TC, author jackpoz.
SD2 update
[mr2988] use ACE_Atomic_Op values instead of volatile in some WorldThread related variables. Possible solve part of false-freezes (need test). picked from TC, original author jackpos
[mr2989] add lock in WorldSocket, picked from TC, original author jackpos. testing, must solve crushes in WorldSocket::wait
[mr2990] Increment the reference count of m_task in Thread::start() before spawning the actual Thread that will execute the task, otherwise the thread might finish, decRef the task and delete it. picked from TC, original author jackpos. need test
[12563] Get rid of bounding radius in GetNearPoint[2D] and ObjectPosSelector

This changes how ObjectPosSelector is used.
It changes the way how the functions Object::GetNearPoint and Object::GetNearPoint2d behave.

So you need to check all places where these functions are used if they are still used correctly.

Especially check your scripts!