Fix uninitialized fallTime and splineElevation fields of MovementInfo.
Valgrind log:
Conditional jump or move depends on uninitialised value(s)
at 0x5FBEB50: deflate (in /lib/x86_64-linux-gnu/libz.so.1.2.7)
by 0x1269883: UpdateData::Compress(void*, unsigned int*, void*, int) (UpdateData.cpp:85)
by 0x1269BB6: UpdateData::BuildPacket(WorldPacket*) (UpdateData.cpp:133)
by 0x130E9B3: Trinity::VisibleNotifier::SendToSelf() (GridNotifiers.cpp:68)
by 0x117A89D: Player::UpdateVisibilityForPlayer() (Player.cpp:22344)
by 0x117B334: Player::SendInitialPacketsAfterAddToMap() (Player.cpp:22567)
by 0x15A48BC: WorldSession::HandlePlayerLogin(LoginQueryHolder*) (CharacterHandler.cpp:937)
by 0x141D04B: WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1106)
by 0x141994D: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:391)
by 0x14E289C: World::UpdateSessions(unsigned int) (World.cpp:2629)
by 0x14E0613: World::Update(unsigned int) (World.cpp:1986)
by 0x100B37F: WorldRunnable::run() (WorldRunnable.cpp:60)
Uninitialised value was created by a heap allocation
at 0x4C286E7: operator new(unsigned long) (vg_replace_malloc.c:287)
by 0x159E64F: void LoadHelper<Creature>(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > const&, CoordPair<512u>&, GridRefManager<Creature>&, unsigned int&, Map*) (ObjectGridLoader.cpp:94)
by 0x159DECF: ObjectGridLoader::Visit(GridRefManager<Creature>&) (ObjectGridLoader.cpp:150)
by 0x159F092: void VisitorHelper<ObjectGridLoader, Creature>(ObjectGridLoader&, ContainerMapList<Creature>&) (TypeContainerVisitor.h:64)
by 0x159EFF5: void VisitorHelper<ObjectGridLoader, Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > >(ObjectGridLoader&, ContainerMapList<TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > >&) (TypeContainerVisitor.h:70)
Partially revert 167ca565d0 which wrongly used TYPEMASK_UNIT to denote Creatures and Players, so when a Player sent farsight opcode with another Player as target HandleFarSightOpcode() couldn't find the right Unit filtering by typemask TYPEMASK_SEER.
ReactorRunnable::svc() checks the status of WorldSockets while WorldRunnable::run() updates them, causing a race condition.
Helgrind log:
Possible data race during write of size 8 at 0x49961810 by thread #9
Locks held: 1, at address 0x4367A620
at 0x51781F7: ACE_Message_Block::copy(char const*, unsigned long) (Message_Block.inl:372)
by 0x15D048F: WorldSocket::SendPacket(WorldPacket const&) (WorldSocket.cpp:180)
by 0x141C45E: WorldSession::SendPacket(WorldPacket const*) (WorldSession.cpp:223)
by 0x15C49C4: WorldSession::SendAuthResponse(unsigned char, bool, unsigned int) (AuthHandler.cpp:37)
by 0x14DA71C: World::AddSession_(WorldSession*) (World.cpp:278)
by 0x14E601E: World::UpdateSessions(unsigned int) (World.cpp:2617)
by 0x14E3E67: World::Update(unsigned int) (World.cpp:1986)
by 0x100EAFA: WorldRunnable::run() (WorldRunnable.cpp:60)
by 0x163A626: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
by 0x61DAB4F: start_thread (pthread_create.c:304)
This conflicts with a previous read of size 8 by thread #14
Locks held: none
at 0x1008414: ACE_Message_Block::length() const (Message_Block.inl:131)
by 0x15D1207: WorldSocket::Update() (WorldSocket.cpp:448)
by 0x1427CA3: ReactorRunnable::svc() (WorldSocketMgr.cpp:177)
by 0x51CBB16: ACE_Task_Base::svc_run(void*) (Task.cpp:271)
by 0x51CD3BC: ACE_Thread_Adapter::invoke_i() (Thread_Adapter.cpp:161)
by 0x51CD4D4: ACE_Thread_Adapter::invoke() (Thread_Adapter.cpp:96)
by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
by 0x61DAB4F: start_thread (pthread_create.c:304)
Address 0x49961810 is 16 bytes inside a block of size 80 alloc'd
at 0x4C286BB: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:316)
by 0x15D0818: WorldSocket::open(void*) (WorldSocket.cpp:237)
by 0x1429560: ACE_Acceptor<WorldSocket, ACE_SOCK_Acceptor>::activate_svc_handler(WorldSocket*) (Acceptor.cpp:347)
by 0x142916D: ACE_Acceptor<WorldSocket, ACE_SOCK_Acceptor>::handle_input(int) (Acceptor.cpp:429)
by 0x515F48D: ACE_Dev_Poll_Reactor::dispatch_io_event(ACE_Dev_Poll_Reactor::Token_Guard&) (Dev_Poll_Reactor.inl:86)
by 0x5161653: ACE_Dev_Poll_Reactor::handle_events(ACE_Time_Value*) (Dev_Poll_Reactor.cpp:1015)
by 0x51ACCFC: ACE_Reactor::run_reactor_event_loop(ACE_Time_Value&, int (*)(ACE_Reactor*)) (Reactor.cpp:267)
by 0x1427C57: ReactorRunnable::svc() (WorldSocketMgr.cpp:170)
by 0x51CBB16: ACE_Task_Base::svc_run(void*) (Task.cpp:271)
by 0x51CD3BC: ACE_Thread_Adapter::invoke_i() (Thread_Adapter.cpp:161)
by 0x51CD4D4: ACE_Thread_Adapter::invoke() (Thread_Adapter.cpp:96)
by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
Settings within worldserver.conf:
Three settings for secruity level:
0 - None - No change to current system
1 - Email - Always requires the email entered on registration for confirming.
2 - RBAC - Groups applied with the RBAC role always require the email entered on registration for confirming.
RBAC default to every group. Changed some logs to make it more clear what is going on at all.
Emails may now no longer exceed 64 chars. Current email is used as regmail.
On account creation, two emails are saved. Registration email and normal email. Normal email is relevant afterwards. Registration email can be changed by console ONLY.
Includes new commands and changes to existing ones:
.account fulfills several new functions:
* Still prints GM Level.
* If account has permission, it displays the current email. This is not defaulted to any group.
* Security level is displayed. Also displays if user has RBAC perm if RBAC security mode is selected
.account email allows user to change email with sufficient confirmation
.account set sec email allows higher sec with higher sec than account to change the normal email. Registrationemail remains untouched here.
.account set sec regmail allows console to change registration email.
.pinfo now displays the registration and normal mail.
Also fixes .learn all crafts.
Closes#10558
Fix race condition by replacing a static volatile uint32 with proper atomic thread-safe ACE_Atomic_Op<ACE_Thread_Mutex, uint32>, incremented in WorldRunnable::run() at each world loop and read in FreezeDetectorRunnable::run().
Helgrind log:
Possible data race during read of size 4 at 0x2400D54 by thread #12
Locks held: none
at 0x100FEA6: FreezeDetectorRunnable::run() (Master.cpp:106)
by 0x1637892: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
by 0x61DAB4F: start_thread (pthread_create.c:304)
by 0x6C69A7C: clone (clone.S:112)
This conflicts with a previous write of size 4 by thread #9
Locks held: none
at 0x100C23E: WorldRunnable::run() (WorldRunnable.cpp:55)
by 0x1637892: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
by 0x61DAB4F: start_thread (pthread_create.c:304)
by 0x6C69A7C: clone (clone.S:112)