aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--dep/PackageList.txt14
-rw-r--r--dep/acelite/6.1.4_tc_changes.diff407
-rw-r--r--dep/acelite/COPYING2
-rw-r--r--dep/acelite/ChangeLog4346
-rw-r--r--dep/acelite/NEWS183
-rw-r--r--dep/acelite/README2
-rw-r--r--dep/acelite/THANKS40
-rw-r--r--dep/acelite/VERSION2
-rw-r--r--dep/acelite/ace/ACE.cpp132
-rw-r--r--dep/acelite/ace/ACE.h60
-rw-r--r--dep/acelite/ace/ACE.inl4
-rw-r--r--dep/acelite/ace/ACE_crc_ccitt.cpp14
-rw-r--r--dep/acelite/ace/ARGV.cpp8
-rw-r--r--dep/acelite/ace/ARGV.h6
-rw-r--r--dep/acelite/ace/ATM_Stream.inl3
-rw-r--r--dep/acelite/ace/Abstract_Timer_Queue.cpp26
-rw-r--r--dep/acelite/ace/Abstract_Timer_Queue.h230
-rw-r--r--dep/acelite/ace/Acceptor.cpp14
-rw-r--r--dep/acelite/ace/Acceptor.h6
-rw-r--r--dep/acelite/ace/Active_Map_Manager.h4
-rw-r--r--dep/acelite/ace/Arg_Shifter.h6
-rw-r--r--dep/acelite/ace/Argv_Type_Converter.h4
-rw-r--r--dep/acelite/ace/Array_Base.h8
-rw-r--r--dep/acelite/ace/Array_Map.cpp39
-rw-r--r--dep/acelite/ace/Array_Map.h11
-rw-r--r--dep/acelite/ace/Asynch_Acceptor.cpp11
-rw-r--r--dep/acelite/ace/Asynch_IO_Impl.h4
-rw-r--r--dep/acelite/ace/Atomic_Op.h8
-rw-r--r--dep/acelite/ace/Atomic_Op.inl35
-rw-r--r--dep/acelite/ace/Atomic_Op_GCC_T.h5
-rw-r--r--dep/acelite/ace/Atomic_Op_GCC_T.inl10
-rw-r--r--dep/acelite/ace/Atomic_Op_T.h13
-rw-r--r--dep/acelite/ace/Atomic_Op_T.inl19
-rw-r--r--dep/acelite/ace/Auto_Functor.h8
-rw-r--r--dep/acelite/ace/Auto_Functor.inl16
-rw-r--r--dep/acelite/ace/Auto_Ptr.h18
-rw-r--r--dep/acelite/ace/Barrier.h6
-rw-r--r--dep/acelite/ace/Base_Thread_Adapter.cpp8
-rw-r--r--dep/acelite/ace/Base_Thread_Adapter.h28
-rw-r--r--dep/acelite/ace/Basic_Stats.cpp6
-rw-r--r--dep/acelite/ace/Basic_Stats.h11
-rw-r--r--dep/acelite/ace/Basic_Types.cpp135
-rw-r--r--dep/acelite/ace/Basic_Types.h343
-rw-r--r--dep/acelite/ace/Basic_Types.inl954
-rw-r--r--dep/acelite/ace/CDR_Base.cpp2
-rw-r--r--dep/acelite/ace/CDR_Base.h4
-rw-r--r--dep/acelite/ace/CDR_Size.h4
-rw-r--r--dep/acelite/ace/CDR_Stream.cpp243
-rw-r--r--dep/acelite/ace/CDR_Stream.h29
-rw-r--r--dep/acelite/ace/CE_Screen_Output.h4
-rw-r--r--dep/acelite/ace/CMakeLists.txt5
-rw-r--r--dep/acelite/ace/Cache_Map_Manager_T.cpp66
-rw-r--r--dep/acelite/ace/Cached_Connect_Strategy_T.cpp95
-rw-r--r--dep/acelite/ace/Codeset_Registry.h6
-rw-r--r--dep/acelite/ace/Codeset_Registry.inl38
-rw-r--r--dep/acelite/ace/Compression/ACE_Compression_export.h58
-rw-r--r--dep/acelite/ace/Compression/Compressor.cpp63
-rw-r--r--dep/acelite/ace/Compression/Compressor.h137
-rw-r--r--dep/acelite/ace/Compression/Compressor.inl18
-rw-r--r--dep/acelite/ace/Compression/rle/ACE_RLECompression_export.h57
-rw-r--r--dep/acelite/ace/Compression/rle/RLECompressor.cpp158
-rw-r--r--dep/acelite/ace/Compression/rle/RLECompressor.h108
-rw-r--r--dep/acelite/ace/Condition_Attributes.cpp21
-rw-r--r--dep/acelite/ace/Condition_Attributes.h101
-rw-r--r--dep/acelite/ace/Condition_Attributes.inl40
-rw-r--r--dep/acelite/ace/Condition_Recursive_Thread_Mutex.cpp26
-rw-r--r--dep/acelite/ace/Condition_Recursive_Thread_Mutex.h20
-rw-r--r--dep/acelite/ace/Condition_T.cpp19
-rw-r--r--dep/acelite/ace/Condition_T.h23
-rw-r--r--dep/acelite/ace/Condition_Thread_Mutex.cpp64
-rw-r--r--dep/acelite/ace/Condition_Thread_Mutex.h62
-rw-r--r--dep/acelite/ace/Condition_Thread_Mutex.inl22
-rw-r--r--dep/acelite/ace/Configuration.cpp4
-rw-r--r--dep/acelite/ace/Configuration_Import_Export.cpp5
-rw-r--r--dep/acelite/ace/Configuration_Import_Export.h14
-rw-r--r--dep/acelite/ace/Connector.cpp7
-rw-r--r--dep/acelite/ace/Countdown_Time.cpp57
-rw-r--r--dep/acelite/ace/Countdown_Time.h59
-rw-r--r--dep/acelite/ace/Countdown_Time.inl20
-rw-r--r--dep/acelite/ace/Countdown_Time_T.cpp65
-rw-r--r--dep/acelite/ace/Countdown_Time_T.h100
-rw-r--r--dep/acelite/ace/Countdown_Time_T.inl26
-rw-r--r--dep/acelite/ace/DLL.h39
-rw-r--r--dep/acelite/ace/DLL_Manager.cpp16
-rw-r--r--dep/acelite/ace/DLL_Manager.h48
-rw-r--r--dep/acelite/ace/Default_Constants.h4
-rw-r--r--dep/acelite/ace/Dev_Poll_Reactor.cpp59
-rw-r--r--dep/acelite/ace/Dev_Poll_Reactor.h10
-rw-r--r--dep/acelite/ace/Dump.h4
-rw-r--r--dep/acelite/ace/Dynamic_Message_Strategy.h16
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Constraint.cpp655
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Constraint.h416
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Constraint.inl349
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp117
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.h70
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Interpreter.cpp113
-rw-r--r--dep/acelite/ace/ETCL/ETCL_Interpreter.h117
-rw-r--r--dep/acelite/ace/ETCL/ETCL_l.cpp1877
-rw-r--r--dep/acelite/ace/ETCL/ETCL_y.cpp1288
-rw-r--r--dep/acelite/ace/ETCL/ETCL_y.h45
-rw-r--r--dep/acelite/ace/ETCL/ace_etcl_export.h40
-rw-r--r--dep/acelite/ace/ETCL/etcl_parser_export.h40
-rw-r--r--dep/acelite/ace/Env_Value_T.h4
-rw-r--r--dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp99
-rw-r--r--dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h103
-rw-r--r--dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.inl71
-rw-r--r--dep/acelite/ace/FIFO.cpp4
-rw-r--r--dep/acelite/ace/FIFO_Recv_Msg.cpp4
-rw-r--r--dep/acelite/ace/Filecache.cpp3
-rw-r--r--dep/acelite/ace/FlReactor/ACE_FlReactor_export.h58
-rw-r--r--dep/acelite/ace/FlReactor/FlReactor.cpp328
-rw-r--r--dep/acelite/ace/FlReactor/FlReactor.h110
-rw-r--r--dep/acelite/ace/FoxReactor/ACE_FoxReactor_export.h58
-rw-r--r--dep/acelite/ace/FoxReactor/FoxReactor.cpp327
-rw-r--r--dep/acelite/ace/FoxReactor/FoxReactor.h112
-rw-r--r--dep/acelite/ace/Functor.cpp12
-rw-r--r--dep/acelite/ace/Functor.h25
-rw-r--r--dep/acelite/ace/Functor.inl8
-rw-r--r--dep/acelite/ace/Functor_String.h41
-rw-r--r--dep/acelite/ace/Functor_String.inl22
-rw-r--r--dep/acelite/ace/Functor_T.h34
-rw-r--r--dep/acelite/ace/Functor_T.inl23
-rw-r--r--dep/acelite/ace/Future.cpp4
-rw-r--r--dep/acelite/ace/Future_Set.cpp4
-rw-r--r--dep/acelite/ace/Get_Opt.cpp2
-rw-r--r--dep/acelite/ace/Get_Opt.inl3
-rw-r--r--dep/acelite/ace/Global_Macros.h6
-rw-r--r--dep/acelite/ace/Guard_T.cpp3
-rw-r--r--dep/acelite/ace/Guard_T.h14
-rw-r--r--dep/acelite/ace/Guard_T.inl3
-rw-r--r--dep/acelite/ace/Handle_Set.cpp53
-rw-r--r--dep/acelite/ace/Handle_Set.h3
-rw-r--r--dep/acelite/ace/Handle_Set.inl16
-rw-r--r--dep/acelite/ace/Hash_Cache_Map_Manager_T.cpp44
-rw-r--r--dep/acelite/ace/Hash_Cache_Map_Manager_T.h8
-rw-r--r--dep/acelite/ace/Hash_Cache_Map_Manager_T.inl81
-rw-r--r--dep/acelite/ace/Hash_Multi_Map_Manager_T.cpp4
-rw-r--r--dep/acelite/ace/Hash_Multi_Map_Manager_T.inl4
-rw-r--r--dep/acelite/ace/Hashable.cpp4
-rw-r--r--dep/acelite/ace/Hashable.inl4
-rw-r--r--dep/acelite/ace/High_Res_Timer.cpp81
-rw-r--r--dep/acelite/ace/High_Res_Timer.h33
-rw-r--r--dep/acelite/ace/High_Res_Timer.inl74
-rw-r--r--dep/acelite/ace/ICMP_Socket.cpp6
-rw-r--r--dep/acelite/ace/INET_Addr.cpp106
-rw-r--r--dep/acelite/ace/INET_Addr.h6
-rw-r--r--dep/acelite/ace/INET_Addr.inl6
-rw-r--r--dep/acelite/ace/IOStream.cpp4
-rw-r--r--dep/acelite/ace/IOStream.h8
-rw-r--r--dep/acelite/ace/IOStream_T.h6
-rw-r--r--dep/acelite/ace/IO_SAP.cpp4
-rw-r--r--dep/acelite/ace/IO_SAP.inl3
-rw-r--r--dep/acelite/ace/Lib_Find.cpp15
-rw-r--r--dep/acelite/ace/Lib_Find.h8
-rw-r--r--dep/acelite/ace/Local_Name_Space_T.h6
-rw-r--r--dep/acelite/ace/Local_Tokens.h20
-rw-r--r--dep/acelite/ace/Lock.h22
-rw-r--r--dep/acelite/ace/Lock_Adapter_T.cpp13
-rw-r--r--dep/acelite/ace/Lock_Adapter_T.h16
-rw-r--r--dep/acelite/ace/Lock_Adapter_T.inl14
-rw-r--r--dep/acelite/ace/Log_Msg.cpp106
-rw-r--r--dep/acelite/ace/Log_Msg.h14
-rw-r--r--dep/acelite/ace/Log_Msg_UNIX_Syslog.cpp4
-rw-r--r--dep/acelite/ace/Log_Record.cpp34
-rw-r--r--dep/acelite/ace/MEM_Stream.h5
-rw-r--r--dep/acelite/ace/MMAP_Memory_Pool.cpp4
-rw-r--r--dep/acelite/ace/Malloc_T.cpp9
-rw-r--r--dep/acelite/ace/Map_T.h13
-rw-r--r--dep/acelite/ace/Mem_Map.cpp133
-rw-r--r--dep/acelite/ace/Message_Block.cpp146
-rw-r--r--dep/acelite/ace/Message_Block.h28
-rw-r--r--dep/acelite/ace/Message_Queue.h18
-rw-r--r--dep/acelite/ace/Message_Queue_NT.cpp5
-rw-r--r--dep/acelite/ace/Message_Queue_T.cpp819
-rw-r--r--dep/acelite/ace/Message_Queue_T.h108
-rw-r--r--dep/acelite/ace/Message_Queue_Vx.cpp3
-rw-r--r--dep/acelite/ace/Message_Queue_Vx.inl4
-rw-r--r--dep/acelite/ace/Metrics_Cache_T.h4
-rw-r--r--dep/acelite/ace/Module.cpp108
-rw-r--r--dep/acelite/ace/Module.h32
-rw-r--r--dep/acelite/ace/Module.inl50
-rw-r--r--dep/acelite/ace/Monitor_Control/Auto_Update_Starter.cpp35
-rw-r--r--dep/acelite/ace/Monitor_Control/Auto_Update_Starter.h61
-rw-r--r--dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp136
-rw-r--r--dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.h70
-rw-r--r--dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.cpp60
-rw-r--r--dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.h94
-rw-r--r--dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.cpp60
-rw-r--r--dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.h94
-rw-r--r--dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.cpp254
-rw-r--r--dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.h106
-rw-r--r--dep/acelite/ace/Monitor_Control/Constraint_Interpreter.cpp62
-rw-r--r--dep/acelite/ace/Monitor_Control/Constraint_Interpreter.h74
-rw-r--r--dep/acelite/ace/Monitor_Control/Constraint_Visitor.cpp304
-rw-r--r--dep/acelite/ace/Monitor_Control/Constraint_Visitor.h86
-rw-r--r--dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.cpp124
-rw-r--r--dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h70
-rw-r--r--dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.cpp124
-rw-r--r--dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.h76
-rw-r--r--dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.cpp78
-rw-r--r--dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.h80
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Control.h46
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Control_export.h49
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Control_utils.h92
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Group.cpp67
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Group.h72
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Query.cpp82
-rw-r--r--dep/acelite/ace/Monitor_Control/Monitor_Query.h75
-rw-r--r--dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.cpp30
-rw-r--r--dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.h61
-rw-r--r--dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.cpp96
-rw-r--r--dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.h88
-rw-r--r--dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.cpp60
-rw-r--r--dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.h94
-rw-r--r--dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.cpp60
-rw-r--r--dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.h94
-rw-r--r--dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.cpp223
-rw-r--r--dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.h91
-rw-r--r--dep/acelite/ace/Monitor_Control/Windows_Monitor.cpp76
-rw-r--r--dep/acelite/ace/Monitor_Control/Windows_Monitor.h78
-rw-r--r--dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.cpp110
-rw-r--r--dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.h75
-rw-r--r--dep/acelite/ace/Monotonic_Time_Policy.cpp7
-rw-r--r--dep/acelite/ace/Monotonic_Time_Policy.h50
-rw-r--r--dep/acelite/ace/Monotonic_Time_Policy.inl32
-rw-r--r--dep/acelite/ace/NT_Service.h5
-rw-r--r--dep/acelite/ace/Name_Request_Reply.cpp11
-rw-r--r--dep/acelite/ace/Name_Space.h6
-rw-r--r--dep/acelite/ace/Naming_Context.cpp4
-rw-r--r--dep/acelite/ace/Naming_Context.h8
-rw-r--r--dep/acelite/ace/Netlink_Addr.h4
-rw-r--r--dep/acelite/ace/Notification_Queue.h13
-rw-r--r--dep/acelite/ace/Notification_Queue.inl18
-rw-r--r--dep/acelite/ace/Null_Condition.h36
-rw-r--r--dep/acelite/ace/Numeric_Limits.h104
-rw-r--r--dep/acelite/ace/OS.h106
-rw-r--r--dep/acelite/ace/OS_NS_Thread.cpp120
-rw-r--r--dep/acelite/ace/OS_NS_Thread.h27
-rw-r--r--dep/acelite/ace/OS_NS_Thread.inl183
-rw-r--r--dep/acelite/ace/OS_NS_arpa_inet.cpp4
-rw-r--r--dep/acelite/ace/OS_NS_dlfcn.inl17
-rw-r--r--dep/acelite/ace/OS_NS_errno.h6
-rw-r--r--dep/acelite/ace/OS_NS_errno.inl6
-rw-r--r--dep/acelite/ace/OS_NS_math.h24
-rw-r--r--dep/acelite/ace/OS_NS_math.inl3
-rw-r--r--dep/acelite/ace/OS_NS_netdb.cpp198
-rw-r--r--dep/acelite/ace/OS_NS_netdb.h18
-rw-r--r--dep/acelite/ace/OS_NS_netdb.inl20
-rw-r--r--dep/acelite/ace/OS_NS_pwd.h15
-rw-r--r--dep/acelite/ace/OS_NS_pwd.inl82
-rw-r--r--dep/acelite/ace/OS_NS_signal.h8
-rw-r--r--dep/acelite/ace/OS_NS_signal.inl3
-rw-r--r--dep/acelite/ace/OS_NS_stdio.h32
-rw-r--r--dep/acelite/ace/OS_NS_stdlib.cpp28
-rw-r--r--dep/acelite/ace/OS_NS_stdlib.h4
-rw-r--r--dep/acelite/ace/OS_NS_stdlib.inl43
-rw-r--r--dep/acelite/ace/OS_NS_string.cpp7
-rw-r--r--dep/acelite/ace/OS_NS_string.h6
-rw-r--r--dep/acelite/ace/OS_NS_string.inl10
-rw-r--r--dep/acelite/ace/OS_NS_sys_mman.cpp4
-rw-r--r--dep/acelite/ace/OS_NS_sys_mman.inl13
-rw-r--r--dep/acelite/ace/OS_NS_sys_msg.cpp4
-rw-r--r--dep/acelite/ace/OS_NS_sys_select.inl8
-rw-r--r--dep/acelite/ace/OS_NS_sys_shm.h6
-rw-r--r--dep/acelite/ace/OS_NS_sys_socket.cpp123
-rw-r--r--dep/acelite/ace/OS_NS_sys_socket.h20
-rw-r--r--dep/acelite/ace/OS_NS_sys_socket.inl38
-rw-r--r--dep/acelite/ace/OS_NS_sys_time.cpp4
-rw-r--r--dep/acelite/ace/OS_NS_sys_utsname.cpp9
-rw-r--r--dep/acelite/ace/OS_NS_sys_wait.cpp4
-rw-r--r--dep/acelite/ace/OS_NS_sys_wait.inl6
-rw-r--r--dep/acelite/ace/OS_NS_time.cpp64
-rw-r--r--dep/acelite/ace/OS_NS_time.h62
-rw-r--r--dep/acelite/ace/OS_NS_time.inl78
-rw-r--r--dep/acelite/ace/OS_NS_unistd.cpp23
-rw-r--r--dep/acelite/ace/OS_NS_unistd.h9
-rw-r--r--dep/acelite/ace/OS_NS_unistd.inl34
-rw-r--r--dep/acelite/ace/OS_NS_wchar.cpp4
-rw-r--r--dep/acelite/ace/OS_Thread_Adapter.cpp21
-rw-r--r--dep/acelite/ace/OS_Thread_Adapter.h3
-rw-r--r--dep/acelite/ace/Obchunk.cpp4
-rw-r--r--dep/acelite/ace/Object_Manager.cpp39
-rw-r--r--dep/acelite/ace/Object_Manager_Base.cpp5
-rw-r--r--dep/acelite/ace/Ping_Socket.h6
-rw-r--r--dep/acelite/ace/Proactor.cpp102
-rw-r--r--dep/acelite/ace/Proactor.h54
-rw-r--r--dep/acelite/ace/Process.cpp23
-rw-r--r--dep/acelite/ace/Process.h2
-rw-r--r--dep/acelite/ace/Process_Manager.cpp9
-rw-r--r--dep/acelite/ace/Process_Manager.h12
-rw-r--r--dep/acelite/ace/Process_Semaphore.h12
-rw-r--r--dep/acelite/ace/Profile_Timer.cpp6
-rw-r--r--dep/acelite/ace/Profile_Timer.h6
-rw-r--r--dep/acelite/ace/QoS/README10
-rw-r--r--dep/acelite/ace/QtReactor/ACE_QtReactor_export.h58
-rw-r--r--dep/acelite/ace/QtReactor/QtReactor.cpp644
-rw-r--r--dep/acelite/ace/QtReactor/QtReactor.h226
-rw-r--r--dep/acelite/ace/RB_Tree.cpp13
-rw-r--r--dep/acelite/ace/RB_Tree.inl24
-rw-r--r--dep/acelite/ace/README26
-rw-r--r--dep/acelite/ace/RW_Mutex.h12
-rw-r--r--dep/acelite/ace/Reactor.h41
-rw-r--r--dep/acelite/ace/Recursive_Thread_Mutex.h18
-rw-r--r--dep/acelite/ace/Registry_Name_Space.h6
-rw-r--r--dep/acelite/ace/Remote_Name_Space.h8
-rw-r--r--dep/acelite/ace/Remote_Tokens.h4
-rw-r--r--dep/acelite/ace/SOCK_Dgram.cpp10
-rw-r--r--dep/acelite/ace/SOCK_Dgram.h5
-rw-r--r--dep/acelite/ace/SOCK_Dgram_Bcast.cpp4
-rw-r--r--dep/acelite/ace/SOCK_Dgram_Mcast.cpp243
-rw-r--r--dep/acelite/ace/SOCK_Dgram_Mcast.h255
-rw-r--r--dep/acelite/ace/SOCK_Dgram_Mcast.inl14
-rw-r--r--dep/acelite/ace/SOCK_Stream.h7
-rw-r--r--dep/acelite/ace/SPIPE_Acceptor.h4
-rw-r--r--dep/acelite/ace/SPIPE_Stream.inl6
-rw-r--r--dep/acelite/ace/SSL/SSL_Context.cpp10
-rw-r--r--dep/acelite/ace/SSL/SSL_Context.h47
-rw-r--r--dep/acelite/ace/SSL/SSL_Context.inl6
-rw-r--r--dep/acelite/ace/SSL/SSL_Initializer.cpp44
-rw-r--r--dep/acelite/ace/SSL/SSL_Initializer.h52
-rw-r--r--dep/acelite/ace/SString.cpp12
-rw-r--r--dep/acelite/ace/SString.h6
-rw-r--r--dep/acelite/ace/Sample_History.cpp22
-rw-r--r--dep/acelite/ace/Sample_History.h10
-rw-r--r--dep/acelite/ace/Sample_History.inl15
-rw-r--r--dep/acelite/ace/Sched_Params.cpp12
-rw-r--r--dep/acelite/ace/Select_Reactor_Base.cpp8
-rw-r--r--dep/acelite/ace/Select_Reactor_Base.h4
-rw-r--r--dep/acelite/ace/Select_Reactor_T.cpp41
-rw-r--r--dep/acelite/ace/Select_Reactor_T.h16
-rw-r--r--dep/acelite/ace/Select_Reactor_T.inl4
-rw-r--r--dep/acelite/ace/Service_Config.cpp5
-rw-r--r--dep/acelite/ace/Service_Config.h10
-rw-r--r--dep/acelite/ace/Service_Gestalt.cpp2
-rw-r--r--dep/acelite/ace/Service_Object.cpp8
-rw-r--r--dep/acelite/ace/Service_Types.cpp15
-rw-r--r--dep/acelite/ace/Signal.h17
-rw-r--r--dep/acelite/ace/Sock_Connect.cpp114
-rw-r--r--dep/acelite/ace/Stack_Trace.cpp30
-rw-r--r--dep/acelite/ace/Stats.cpp9
-rw-r--r--dep/acelite/ace/Strategies.h33
-rw-r--r--dep/acelite/ace/Strategies_T.cpp15
-rw-r--r--dep/acelite/ace/Stream.cpp271
-rw-r--r--dep/acelite/ace/Stream.h65
-rw-r--r--dep/acelite/ace/Stream.inl38
-rw-r--r--dep/acelite/ace/Stream_Modules.cpp207
-rw-r--r--dep/acelite/ace/Stream_Modules.h20
-rw-r--r--dep/acelite/ace/String_Base.cpp6
-rw-r--r--dep/acelite/ace/String_Base.h2
-rw-r--r--dep/acelite/ace/Svc_Conf.y5
-rw-r--r--dep/acelite/ace/Svc_Conf_y.cpp7
-rw-r--r--dep/acelite/ace/Svc_Handler.cpp5
-rw-r--r--dep/acelite/ace/Synch_Traits.h11
-rw-r--r--dep/acelite/ace/TLI.inl4
-rw-r--r--dep/acelite/ace/TP_Reactor.cpp44
-rw-r--r--dep/acelite/ace/TP_Reactor.h4
-rw-r--r--dep/acelite/ace/TSS_Adapter.cpp9
-rw-r--r--dep/acelite/ace/TSS_Adapter.h5
-rw-r--r--dep/acelite/ace/TSS_T.cpp4
-rw-r--r--dep/acelite/ace/TTY_IO.h4
-rw-r--r--dep/acelite/ace/Task.cpp35
-rw-r--r--dep/acelite/ace/Task_Ex_T.cpp42
-rw-r--r--dep/acelite/ace/Task_Ex_T.h22
-rw-r--r--dep/acelite/ace/Task_Ex_T.inl68
-rw-r--r--dep/acelite/ace/Task_T.cpp43
-rw-r--r--dep/acelite/ace/Task_T.h40
-rw-r--r--dep/acelite/ace/Task_T.inl86
-rw-r--r--dep/acelite/ace/Thread.inl4
-rw-r--r--dep/acelite/ace/Thread_Adapter.cpp18
-rw-r--r--dep/acelite/ace/Thread_Adapter.h3
-rw-r--r--dep/acelite/ace/Thread_Control.cpp7
-rw-r--r--dep/acelite/ace/Thread_Control.h15
-rw-r--r--dep/acelite/ace/Thread_Exit.cpp4
-rw-r--r--dep/acelite/ace/Thread_Hook.cpp7
-rw-r--r--dep/acelite/ace/Thread_Hook.h7
-rw-r--r--dep/acelite/ace/Thread_Manager.cpp58
-rw-r--r--dep/acelite/ace/Thread_Manager.h9
-rw-r--r--dep/acelite/ace/Thread_Mutex.h3
-rw-r--r--dep/acelite/ace/Thread_Semaphore.h4
-rw-r--r--dep/acelite/ace/Throughput_Stats.cpp17
-rw-r--r--dep/acelite/ace/Throughput_Stats.h6
-rw-r--r--dep/acelite/ace/Time_Policy.cpp34
-rw-r--r--dep/acelite/ace/Time_Policy.h172
-rw-r--r--dep/acelite/ace/Time_Policy.inl95
-rw-r--r--dep/acelite/ace/Time_Policy_T.cpp27
-rw-r--r--dep/acelite/ace/Time_Policy_T.h77
-rw-r--r--dep/acelite/ace/Time_Policy_T.inl32
-rw-r--r--dep/acelite/ace/Time_Value.cpp69
-rw-r--r--dep/acelite/ace/Time_Value.h66
-rw-r--r--dep/acelite/ace/Time_Value.inl32
-rw-r--r--dep/acelite/ace/Time_Value_T.cpp52
-rw-r--r--dep/acelite/ace/Time_Value_T.h194
-rw-r--r--dep/acelite/ace/Time_Value_T.inl94
-rw-r--r--dep/acelite/ace/Timeprobe_T.cpp5
-rw-r--r--dep/acelite/ace/Timer_Hash.h16
-rw-r--r--dep/acelite/ace/Timer_Hash_T.cpp174
-rw-r--r--dep/acelite/ace/Timer_Hash_T.h56
-rw-r--r--dep/acelite/ace/Timer_Heap.h13
-rw-r--r--dep/acelite/ace/Timer_Heap_T.cpp192
-rw-r--r--dep/acelite/ace/Timer_Heap_T.h42
-rw-r--r--dep/acelite/ace/Timer_List.h11
-rw-r--r--dep/acelite/ace/Timer_List_T.cpp119
-rw-r--r--dep/acelite/ace/Timer_List_T.h30
-rw-r--r--dep/acelite/ace/Timer_Queue.h6
-rw-r--r--dep/acelite/ace/Timer_Queue_Adapters.cpp13
-rw-r--r--dep/acelite/ace/Timer_Queue_Adapters.inl4
-rw-r--r--dep/acelite/ace/Timer_Queue_Iterator.cpp58
-rw-r--r--dep/acelite/ace/Timer_Queue_Iterator.h200
-rw-r--r--dep/acelite/ace/Timer_Queue_Iterator.inl135
-rw-r--r--dep/acelite/ace/Timer_Queue_T.cpp327
-rw-r--r--dep/acelite/ace/Timer_Queue_T.h436
-rw-r--r--dep/acelite/ace/Timer_Queue_T.inl180
-rw-r--r--dep/acelite/ace/Timer_Queuefwd.h14
-rw-r--r--dep/acelite/ace/Timer_Wheel.h10
-rw-r--r--dep/acelite/ace/Timer_Wheel_T.cpp178
-rw-r--r--dep/acelite/ace/Timer_Wheel_T.h42
-rw-r--r--dep/acelite/ace/TkReactor/ACE_TkReactor_export.h58
-rw-r--r--dep/acelite/ace/TkReactor/TkReactor.cpp438
-rw-r--r--dep/acelite/ace/TkReactor/TkReactor.h136
-rw-r--r--dep/acelite/ace/Token.cpp5
-rw-r--r--dep/acelite/ace/Truncate.h46
-rw-r--r--dep/acelite/ace/UUID.cpp12
-rw-r--r--dep/acelite/ace/Unbounded_Set_Ex.cpp4
-rw-r--r--dep/acelite/ace/Value_Ptr.h27
-rw-r--r--dep/acelite/ace/Version.h10
-rw-r--r--dep/acelite/ace/WFMO_Reactor.cpp25
-rw-r--r--dep/acelite/ace/WFMO_Reactor.h58
-rw-r--r--dep/acelite/ace/WIN32_Asynch_IO.cpp12
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp76
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp10
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp22
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp7
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp98
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/Types.hpp669
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/Types.ipp8
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/Writer.hpp158
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/Writer.ipp10
-rw-r--r--dep/acelite/ace/XML_Utils/XMLSchema/id_map.hpp144
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Error_Handler.cpp77
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Error_Handler.h60
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Helper.h99
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp77
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Schema_Resolver.h110
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Typedefs.cpp8
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Typedefs.h32
-rw-r--r--dep/acelite/ace/XML_Utils/XML_Utils_Export.h58
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/Elements.hpp569
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp182
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp141
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/Parser.hpp64
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/Traversal.hpp265
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/Traversal.tpp195
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/Writer.hpp78
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/XML.hpp490
-rw-r--r--dep/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp588
-rw-r--r--dep/acelite/ace/XML_Utils/XercesString.cpp167
-rw-r--r--dep/acelite/ace/XML_Utils/XercesString.h82
-rw-r--r--dep/acelite/ace/XtReactor/ACE_XtReactor_export.h58
-rw-r--r--dep/acelite/ace/XtReactor/XtReactor.cpp468
-rw-r--r--dep/acelite/ace/XtReactor/XtReactor.h147
-rw-r--r--dep/acelite/ace/ace_wchar.h10
-rw-r--r--dep/acelite/ace/config-WinCE.h6
-rw-r--r--dep/acelite/ace/config-aix-5.x.h3
-rw-r--r--dep/acelite/ace/config-aix-7.h29
-rw-r--r--dep/acelite/ace/config-android.h (renamed from dep/acelite/ace/config-linux-common.h)321
-rw-r--r--dep/acelite/ace/config-cray.h205
-rw-r--r--dep/acelite/ace/config-cxx-common.h86
-rw-r--r--dep/acelite/ace/config-cygwin32.h5
-rw-r--r--dep/acelite/ace/config-doxygen.h119
-rw-r--r--dep/acelite/ace/config-freebsd.h42
-rw-r--r--dep/acelite/ace/config-g++-common.h21
-rw-r--r--dep/acelite/ace/config-ghs-common.h43
-rw-r--r--dep/acelite/ace/config-hpux-11.00.h25
-rw-r--r--dep/acelite/ace/config-irix6.5.x-sgic++.h18
-rw-r--r--dep/acelite/ace/config-irix6.x-common.h254
-rw-r--r--dep/acelite/ace/config-irix6.x-g++.h15
-rw-r--r--dep/acelite/ace/config-irix6.x-sgic++.h36
-rw-r--r--dep/acelite/ace/config-kfreebsd.h12
-rw-r--r--dep/acelite/ace/config-linux.h468
-rw-r--r--dep/acelite/ace/config-lite.h14
-rw-r--r--dep/acelite/ace/config-lynxos.h129
-rw-r--r--dep/acelite/ace/config-macosx-iOS-hardware.h (renamed from dep/acelite/ace/config-macosx-iphone-hardware.h)6
-rw-r--r--dep/acelite/ace/config-macosx-iOS-simulator.h9
-rw-r--r--dep/acelite/ace/config-macosx-iphone-simulator.h9
-rw-r--r--dep/acelite/ace/config-macosx-leopard.h4
-rw-r--r--dep/acelite/ace/config-macosx-lion.h19
-rw-r--r--dep/acelite/ace/config-macosx.h4
-rw-r--r--dep/acelite/ace/config-macros.h14
-rw-r--r--dep/acelite/ace/config-minimal.h39
-rw-r--r--dep/acelite/ace/config-mvs.h124
-rw-r--r--dep/acelite/ace/config-netbsd.h5
-rw-r--r--dep/acelite/ace/config-openbsd.h97
-rw-r--r--dep/acelite/ace/config-openvms.h8
-rw-r--r--dep/acelite/ace/config-qnx-neutrino.h136
-rw-r--r--dep/acelite/ace/config-qnx-rtp-common.h50
-rw-r--r--dep/acelite/ace/config-qnx-rtp-pre62x.h152
-rw-r--r--dep/acelite/ace/config-qnx-rtp.h25
-rw-r--r--dep/acelite/ace/config-qnx.h (renamed from dep/acelite/ace/config-qnx-rtp-62x.h)107
-rw-r--r--dep/acelite/ace/config-rtems.h4
-rw-r--r--dep/acelite/ace/config-sco-5.0.0-nothread.h12
-rw-r--r--dep/acelite/ace/config-sco-5.0.0.h90
-rw-r--r--dep/acelite/ace/config-sunos5.10.h15
-rw-r--r--dep/acelite/ace/config-sunos5.4-g++.h5
-rw-r--r--dep/acelite/ace/config-sunos5.4-sunc++-4.x.h5
-rw-r--r--dep/acelite/ace/config-sunos5.5.h52
-rw-r--r--dep/acelite/ace/config-sunos5.6.h3
-rw-r--r--dep/acelite/ace/config-sunos5.7.h13
-rw-r--r--dep/acelite/ace/config-tandem-nsk-mips-v2.h384
-rw-r--r--dep/acelite/ace/config-tandem-nsk-mips-v3.h454
-rw-r--r--dep/acelite/ace/config-tandem.h189
-rw-r--r--dep/acelite/ace/config-tru64.h151
-rw-r--r--dep/acelite/ace/config-unixware-7.1.0.h406
-rw-r--r--dep/acelite/ace/config-unixware-7.1.0.udk.h457
-rw-r--r--dep/acelite/ace/config-visualage.h20
-rw-r--r--dep/acelite/ace/config-vxworks.h6
-rw-r--r--dep/acelite/ace/config-vxworks6.4.h5
-rw-r--r--dep/acelite/ace/config-vxworks6.8.h10
-rw-r--r--dep/acelite/ace/config-vxworks6.9.h33
-rw-r--r--dep/acelite/ace/config-win32-borland.h172
-rw-r--r--dep/acelite/ace/config-win32-common.h39
-rw-r--r--dep/acelite/ace/config-win32-ghs.h93
-rw-r--r--dep/acelite/ace/config-win32-interix.h6
-rw-r--r--dep/acelite/ace/config-win32-mingw.h30
-rw-r--r--dep/acelite/ace/config-win32-msvc-10.h11
-rw-r--r--dep/acelite/ace/config-win32-msvc-7.h5
-rw-r--r--dep/acelite/ace/config-win32-msvc-8.h13
-rw-r--r--dep/acelite/ace/config-win32-msvc-9.h18
-rw-r--r--dep/acelite/ace/config-win32-msvc.h7
-rw-r--r--dep/acelite/ace/config-win32.h17
-rw-r--r--dep/acelite/ace/config-windows.h5
-rw-r--r--dep/acelite/ace/gethrtime.cpp60
-rw-r--r--dep/acelite/ace/os_include/os_dirent.h6
-rw-r--r--dep/acelite/ace/os_include/os_dlfcn.h41
-rw-r--r--dep/acelite/ace/os_include/os_fcntl.h7
-rw-r--r--dep/acelite/ace/os_include/os_ifaddrs.h43
-rw-r--r--dep/acelite/ace/os_include/os_limits.h9
-rw-r--r--dep/acelite/ace/os_include/os_netdb.h6
-rw-r--r--dep/acelite/ace/os_include/os_pthread.h60
-rw-r--r--dep/acelite/ace/os_include/os_pwd.h10
-rw-r--r--dep/acelite/ace/os_include/os_signal.h16
-rw-r--r--dep/acelite/ace/os_include/os_stdio.h5
-rw-r--r--dep/acelite/ace/os_include/os_stdlib.h10
-rw-r--r--dep/acelite/ace/os_include/os_string.h6
-rw-r--r--dep/acelite/ace/os_include/os_wchar.h10
-rw-r--r--dep/acelite/ace/os_include/sys/os_resource.h13
-rw-r--r--dep/acelite/ace/os_include/sys/os_select.h4
-rw-r--r--dep/acelite/ace/os_include/sys/os_stat.h3
-rw-r--r--dep/acelite/ace/os_include/sys/os_time.h12
-rw-r--r--dep/acelite/ace/os_include/sys/os_types.h14
-rw-r--r--dep/bzip2/LICENSE42
-rw-r--r--dep/bzip2/README215
-rw-r--r--dep/bzip2/blocksort.c4
-rw-r--r--dep/bzip2/bzip2.c2034
-rw-r--r--dep/bzip2/bzip2recover.c514
-rw-r--r--dep/bzip2/bzlib.c4
-rw-r--r--dep/bzip2/bzlib.h4
-rw-r--r--dep/bzip2/bzlib_private.h6
-rw-r--r--dep/bzip2/compress.c4
-rw-r--r--dep/bzip2/crctable.c4
-rw-r--r--dep/bzip2/decompress.c24
-rw-r--r--dep/bzip2/huffman.c4
-rw-r--r--dep/bzip2/randtable.c4
-rw-r--r--dep/g3dlite/G3D-v8.0_extra.diff12
-rw-r--r--dep/g3dlite/include/G3D/AABox.h3
-rw-r--r--dep/g3dlite/include/G3D/Any.h125
-rw-r--r--dep/g3dlite/include/G3D/GMutex.h1
-rw-r--r--dep/g3dlite/include/G3D/PointHashGrid.h6
-rw-r--r--dep/g3dlite/include/G3D/Quat.inl36
-rw-r--r--dep/g3dlite/include/G3D/Sphere.h1
-rw-r--r--dep/g3dlite/include/G3D/Table.h5
-rw-r--r--dep/g3dlite/include/G3D/Vector2.inl18
-rw-r--r--dep/g3dlite/include/G3D/Vector3.inl249
-rw-r--r--dep/g3dlite/include/G3D/Vector4.inl191
-rw-r--r--dep/g3dlite/include/G3D/g3dmath.inl288
-rw-r--r--dep/g3dlite/include/G3D/platform.h4
-rw-r--r--dep/g3dlite/source/AABox.cpp4
-rw-r--r--dep/g3dlite/source/Log.cpp14
-rw-r--r--dep/g3dlite/source/System.cpp95
-rw-r--r--dep/g3dlite/source/TextInput.cpp28
-rw-r--r--dep/gsoap/gsoap.stub1
-rw-r--r--dep/gsoap/soapC.cpp97
-rw-r--r--dep/gsoap/soapH.h11
-rw-r--r--dep/gsoap/soapServer.cpp14
-rw-r--r--dep/gsoap/soapStub.h15
-rw-r--r--dep/gsoap/stdsoap2.cpp1672
-rw-r--r--dep/gsoap/stdsoap2.h248
-rw-r--r--dep/gsoap/tc_upgrades.txt12
-rw-r--r--dep/utf8cpp/utf8/checked.h118
-rw-r--r--dep/utf8cpp/utf8/core.h209
-rw-r--r--dep/utf8cpp/utf8/unchecked.h44
-rw-r--r--dep/zlib/adler32.c68
-rw-r--r--dep/zlib/crc32.c83
-rw-r--r--dep/zlib/crc32.h2
-rw-r--r--dep/zlib/deflate.c259
-rw-r--r--dep/zlib/deflate.h10
-rw-r--r--dep/zlib/gzguts.h87
-rw-r--r--dep/zlib/gzlib.c165
-rw-r--r--dep/zlib/gzread.c418
-rw-r--r--dep/zlib/gzwrite.c146
-rw-r--r--dep/zlib/infback.c14
-rw-r--r--dep/zlib/inffixed.h6
-rw-r--r--dep/zlib/inflate.c90
-rw-r--r--dep/zlib/inftrees.c46
-rw-r--r--dep/zlib/trees.c40
-rw-r--r--dep/zlib/zconf.h196
-rw-r--r--dep/zlib/zlib.h309
-rw-r--r--dep/zlib/zutil.c24
-rw-r--r--dep/zlib/zutil.h98
-rw-r--r--doc/GPL-2.0.txt (renamed from doc/gpl-2.0.txt)0
-rw-r--r--doc/LoggingHOWTO.txt274
-rw-r--r--sql/base/auth_database.sql1
-rw-r--r--sql/base/characters_database.sql45
-rw-r--r--sql/old/3.3.5a/2012_05_19_03_world_version.sql (renamed from sql/updates/world/2012_05_19_03_world_version.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_19_04_world_creature_loot_template.sql (renamed from sql/updates/world/2012_05_19_04_world_creature_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_19_05_world_gameobject_loot_template.sql (renamed from sql/updates/world/2012_05_19_05_world_gameobject_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_19_06_world_gameobject_loot_template.sql (renamed from sql/updates/world/2012_05_19_06_world_gameobject_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_20_00_world_misc.sql (renamed from sql/updates/world/2012_05_20_00_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_20_01_world_spell_bonus_data.sql (renamed from sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_22_00_world_spell_proc_event.sql (renamed from sql/updates/world/2012_05_22_00_world_spell_proc_event.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_22_01_world_creature_loot_template.sql (renamed from sql/updates/world/2012_05_22_01_world_creature_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_23_00_world_creature.sql (renamed from sql/updates/world/2012_05_23_00_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_23_01_world_sai.sql (renamed from sql/updates/world/2012_05_23_01_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_23_02_world_sai.sql (renamed from sql/updates/world/2012_05_23_02_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_23_03_world_gameobject_loot_template.sql (renamed from sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_23_04_world_gameobject.sql (renamed from sql/updates/world/2012_05_23_04_world_gameobject.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_23_05_world_creature.sql (renamed from sql/updates/world/2012_05_23_05_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_24_00_world_creature_misc.sql (renamed from sql/updates/world/2012_05_24_00_world_creature_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_24_01_world_gameobject.sql (renamed from sql/updates/world/2012_05_24_01_world_gameobject.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_25_00_world_sai.sql (renamed from sql/updates/world/2012_05_25_00_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_25_01_world_waypoints.sql (renamed from sql/updates/world/2012_05_25_01_world_waypoints.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_25_02_world_creature_template.sql (renamed from sql/updates/world/2012_05_25_02_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_25_03_world_template.sql (renamed from sql/updates/world/2012_05_25_03_world_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_00_world_scripts.sql (renamed from sql/updates/world/2012_05_26_00_world_scripts.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_01_world_spell_dbc.sql (renamed from sql/updates/world/2012_05_26_01_world_spell_dbc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_02_world_creature_template.sql (renamed from sql/updates/world/2012_05_26_02_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_03_world_page_text.sql (renamed from sql/updates/world/2012_05_26_03_world_page_text.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_04_world_creature_template.sql (renamed from sql/updates/world/2012_05_26_04_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_05_world_creature_template.sql (renamed from sql/updates/world/2012_05_26_05_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_26_06_world_smart_scripts.sql (renamed from sql/updates/world/2012_05_26_06_world_smart_scripts.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_00_world_gameobject_template.sql (renamed from sql/updates/world/2012_05_27_00_world_gameobject_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_01_world_waypoints.sql (renamed from sql/updates/world/2012_05_27_01_world_waypoints.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_02_world_creature.sql (renamed from sql/updates/world/2012_05_27_02_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_03_world_creature.sql (renamed from sql/updates/world/2012_05_27_03_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_04_world_smart_scripts.sql (renamed from sql/updates/world/2012_05_27_04_world_smart_scripts.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_05_world_gameobject.sql (renamed from sql/updates/world/2012_05_27_05_world_gameobject.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_06_world_creature.sql (renamed from sql/updates/world/2012_05_27_06_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_07_world_game_event.sql (renamed from sql/updates/world/2012_05_27_07_world_game_event.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_27_07_world_waypoints.sql (renamed from sql/updates/world/2012_05_27_07_world_waypoints.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_00_world_creature_ai_scripts.sql (renamed from sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_01_world_creature.sql (renamed from sql/updates/world/2012_05_28_01_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_02_world_creature.sql (renamed from sql/updates/world/2012_05_28_02_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_03_world_waypoint_data.sql (renamed from sql/updates/world/2012_05_28_03_world_waypoint_data.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_04_world_creature_template.sql (renamed from sql/updates/world/2012_05_28_04_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_05_world_creature.sql (renamed from sql/updates/world/2012_05_28_05_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_06_world_creature_addon.sql (renamed from sql/updates/world/2012_05_28_06_world_creature_addon.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_06_world_waypoint_data.sql (renamed from sql/updates/world/2012_05_28_06_world_waypoint_data.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_28_07_world_quest_template.sql (renamed from sql/updates/world/2012_05_28_07_world_quest_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_30_00_world_reference_loot_template.sql (renamed from sql/updates/world/2012_05_30_00_world_reference_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_30_01_world_creature_template.sql (renamed from sql/updates/world/2012_05_30_01_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_30_02_world_quest_template.sql (renamed from sql/updates/world/2012_05_30_02_world_quest_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_30_03_world_creature_formation.sql (renamed from sql/updates/world/2012_05_30_03_world_creature_formation.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_30_04_world_gossip.sql (renamed from sql/updates/world/2012_05_30_04_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_30_05_world_gossip.sql (renamed from sql/updates/world/2012_05_30_05_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_00_world_reference_loot_template.sql (renamed from sql/updates/world/2012_05_31_00_world_reference_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_01_world_item_template.sql (renamed from sql/updates/world/2012_05_31_01_world_item_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_01_world_sai.sql (renamed from sql/updates/world/2012_05_31_01_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_02_world_creature_model_info.sql (renamed from sql/updates/world/2012_05_31_02_world_creature_model_info.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_03_world_gameobject_loot_template.sql (renamed from sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_05_world_sai.sql (renamed from sql/updates/world/2012_05_31_05_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_06_world_gameobject.sql (renamed from sql/updates/world/2012_05_31_06_world_gameobject.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_07_world_gossip.sql (renamed from sql/updates/world/2012_05_31_07_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_08_world_gameobject_template.sql (renamed from sql/updates/world/2012_05_31_08_world_gameobject_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_09_world_sai.sql (renamed from sql/updates/world/2012_05_31_09_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_10_world_creature_template.sql (renamed from sql/updates/world/2012_05_31_10_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_11_world_creature.sql (renamed from sql/updates/world/2012_05_31_11_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_05_31_12_world_creature.sql (renamed from sql/updates/world/2012_05_31_12_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_01_00_world_spell_script_names.sql (renamed from sql/updates/world/2012_06_01_00_world_spell_script_names.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_01_01_world_creature_script.sql (renamed from sql/updates/world/2012_06_01_01_world_creature_script.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_01_02_world_misc.sql (renamed from sql/updates/world/2012_06_01_02_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_01_03_world_creature_template.sql (renamed from sql/updates/world/2012_06_01_03_world_creature_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_01_04_world_misc.sql (renamed from sql/updates/world/2012_06_01_04_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_00_world_sai.sql (renamed from sql/updates/world/2012_06_02_00_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_01_world_waypoints.sql (renamed from sql/updates/world/2012_06_02_01_world_waypoints.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_02_world_creature_text.sql (renamed from sql/updates/world/2012_06_02_02_world_creature_text.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_03_world_creature_loot_template_hp.sql (renamed from sql/updates/world/2012_06_02_03_world_creature_loot_template_hp.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_03_world_creature_loot_template_zm.sql (renamed from sql/updates/world/2012_06_02_03_world_creature_loot_template_zm.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_03_world_reference_loot_template.sql (renamed from sql/updates/world/2012_06_02_03_world_reference_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_04_world_reference_loot_template.sql (renamed from sql/updates/world/2012_06_02_04_world_reference_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_05_world_reference_loot_template.sql (renamed from sql/updates/world/2012_06_02_05_world_reference_loot_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_06_world_waypoints.sql (renamed from sql/updates/world/2012_06_02_06_world_waypoints.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_07_world_Misc.sql (renamed from sql/updates/world/2012_06_02_07_world_Misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_08_world_waypoints.sql (renamed from sql/updates/world/2012_06_02_08_world_waypoints.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_02_09_world_creature_transport.sql (renamed from sql/updates/world/2012_06_02_09_world_creature_transport.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_00_world_sai.sql (renamed from sql/updates/world/2012_06_03_00_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_01_world_creature.sql (renamed from sql/updates/world/2012_06_03_01_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_02_world_misc.sql (renamed from sql/updates/world/2012_06_03_02_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_03_world_quest_template.sql (renamed from sql/updates/world/2012_06_03_03_world_quest_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_04_world_misc.sql (renamed from sql/updates/world/2012_06_03_04_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_05_world_creature.sql (renamed from sql/updates/world/2012_06_03_05_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_03_06_world_sai.sql (renamed from sql/updates/world/2012_06_03_06_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_00_world_sai.sql (renamed from sql/updates/world/2012_06_04_00_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_01_world_gossip.sql (renamed from sql/updates/world/2012_06_04_01_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_02_world_gossip.sql (renamed from sql/updates/world/2012_06_04_02_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_03_world_conditions.sql (renamed from sql/updates/world/2012_06_04_03_world_conditions.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_04_world_sai.sql (renamed from sql/updates/world/2012_06_04_04_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_05_world_sai.sql (renamed from sql/updates/world/2012_06_04_05_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_06_world_sai.sql (renamed from sql/updates/world/2012_06_04_06_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_04_07_world_misc.sql (renamed from sql/updates/world/2012_06_04_07_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_05_00_world_sai.sql (renamed from sql/updates/world/2012_06_05_00_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_05_01_world_gossip.sql (renamed from sql/updates/world/2012_06_05_01_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_05_01_world_gossip_sai.sql (renamed from sql/updates/world/2012_06_05_01_world_gossip_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_05_03_world_script.sql (renamed from sql/updates/world/2012_06_05_03_world_script.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_06_00_world_script.sql (renamed from sql/updates/world/2012_06_06_00_world_script.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_06_01_world_sai.sql (renamed from sql/updates/world/2012_06_06_01_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_06_02_world_sai.sql (renamed from sql/updates/world/2012_06_06_02_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_06_03_world_conditions.sql (renamed from sql/updates/world/2012_06_06_03_world_conditions.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_06_04_world_sai.sql (renamed from sql/updates/world/2012_06_06_04_world_sai.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_07_00_characters_respawn.sql (renamed from sql/updates/characters/2012_06_07_00_characters_respawn.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_07_00_world_gossip.sql (renamed from sql/updates/world/2012_06_07_00_world_gossip.sql)2
-rw-r--r--sql/old/3.3.5a/2012_06_07_01_world_gossip.sql (renamed from sql/updates/world/2012_06_07_01_world_gossip.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_07_02_world_item_template.sql (renamed from sql/updates/world/2012_06_07_02_world_item_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_07_03_world_item_template.sql (renamed from sql/updates/world/2012_06_07_03_world_item_template.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_07_04_world_spell_dbc.sql (renamed from sql/updates/world/2012_06_07_04_world_spell_dbc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_07_05_world_misc.sql (renamed from sql/updates/world/2012_06_07_05_world_misc.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_08_00_world_spell_bonus_data.sql (renamed from sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_09_00_world_creature.sql (renamed from sql/updates/world/2012_06_09_00_world_creature.sql)0
-rw-r--r--sql/old/3.3.5a/2012_06_12_00_world_transport.sql (renamed from sql/updates/world/2012_06_12_00_world_transport.sql)24
-rw-r--r--sql/old/3.3.5a/2012_06_13_00_characters_character_equipmentsets.sql22
-rw-r--r--sql/old/3.3.5a/2012_06_13_00_world_creature.sql71
-rw-r--r--sql/old/3.3.5a/2012_06_13_01_world_creature.sql11
-rw-r--r--sql/old/3.3.5a/2012_06_13_02_world_gossip.sql32
-rw-r--r--sql/old/3.3.5a/2012_06_13_03_world_sai.sql70
-rw-r--r--sql/old/3.3.5a/2012_06_14_00_world_spell_linked_spell.sql5
-rw-r--r--sql/old/3.3.5a/2012_06_14_01_world_spell_linked_spell.sql51
-rw-r--r--sql/old/3.3.5a/2012_06_14_02_world_spell_bonus_data.sql102
-rw-r--r--sql/old/3.3.5a/2012_06_14_03_world_spell_bonus_data.sql94
-rw-r--r--sql/old/3.3.5a/2012_06_14_03_world_spell_ranks.sql5
-rw-r--r--sql/old/3.3.5a/2012_06_14_04_world_spell_script_names.sql62
-rw-r--r--sql/old/3.3.5a/2012_06_14_05_world_spelldifficulty_dbc.sql6
-rw-r--r--sql/old/3.3.5a/2012_06_14_06_world_conditions.sql7
-rw-r--r--sql/old/3.3.5a/2012_06_14_07_world_spell_bonus_data.sql3
-rw-r--r--sql/old/3.3.5a/2012_06_14_08_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_06_14_09_world_sai.sql45
-rw-r--r--sql/old/3.3.5a/2012_06_14_10_world_eai.sql2
-rw-r--r--sql/old/3.3.5a/2012_06_14_11_world_sai.sql48
-rw-r--r--sql/old/3.3.5a/2012_06_15_00_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_06_15_01_world_sai.sql32
-rw-r--r--sql/old/3.3.5a/2012_06_15_02_world_sai.sql44
-rw-r--r--sql/old/3.3.5a/2012_06_16_00_world_sai.sql46
-rw-r--r--sql/old/3.3.5a/2012_06_16_01_world_creature.sql6
-rw-r--r--sql/old/3.3.5a/2012_06_17_00_world_creature.sql3
-rw-r--r--sql/old/3.3.5a/2012_06_17_01_world_creature.sql4
-rw-r--r--sql/old/3.3.5a/2012_06_17_02_world_creature.sql9
-rw-r--r--sql/old/3.3.5a/2012_06_18_00_world_creature.sql26
-rw-r--r--sql/old/3.3.5a/2012_06_18_01_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_06_18_02_world_sai.sql41
-rw-r--r--sql/old/3.3.5a/2012_06_18_03_world_sai.sql39
-rw-r--r--sql/old/3.3.5a/2012_06_19_00_world_sai.sql25
-rw-r--r--sql/old/3.3.5a/2012_06_19_01_world_gossip.sql161
-rw-r--r--sql/old/3.3.5a/2012_06_19_02_world_misc.sql98
-rw-r--r--sql/old/3.3.5a/2012_06_20_00_world_gossip.sql132
-rw-r--r--sql/old/3.3.5a/2012_06_20_01_world_sai.sql26
-rw-r--r--sql/old/3.3.5a/2012_06_20_02_world_gossip.sql17
-rw-r--r--sql/old/3.3.5a/2012_06_24_00_world_gossip.sql296
-rw-r--r--sql/old/3.3.5a/2012_06_24_01_world_quest.sql167
-rw-r--r--sql/old/3.3.5a/2012_06_24_02_world_gameobject.sql30
-rw-r--r--sql/old/3.3.5a/2012_06_24_03_world_gameobject.sql28
-rw-r--r--sql/old/3.3.5a/2012_06_24_04_world_gameobject.sql30
-rw-r--r--sql/old/3.3.5a/2012_06_25_00_world_spell_script_names.sql1
-rw-r--r--sql/old/3.3.5a/2012_06_25_01_world_gameobject.sql64
-rw-r--r--sql/old/3.3.5a/2012_06_25_02_world_gameobject.sql85
-rw-r--r--sql/old/3.3.5a/2012_06_26_00_world_sai.sql50
-rw-r--r--sql/old/3.3.5a/2012_06_26_01_world_creature.sql61
-rw-r--r--sql/old/3.3.5a/2012_06_26_02_world_creature_loot_template.sql6
-rw-r--r--sql/old/3.3.5a/2012_06_27_00_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_06_27_01_world_game_graveyard_zone.sql3
-rw-r--r--sql/old/3.3.5a/2012_07_01_00_world_creature_text.sql66
-rw-r--r--sql/old/3.3.5a/2012_07_01_01_achievement_criteria_data.sql6
-rw-r--r--sql/old/3.3.5a/2012_07_02_00_world_creature_onkill_reputation.sql4
-rw-r--r--sql/old/3.3.5a/2012_07_02_01_world_sai.sql7
-rw-r--r--sql/old/3.3.5a/2012_07_02_02_world_sai.sql189
-rw-r--r--sql/old/3.3.5a/2012_07_02_03_world_gossip.sql17
-rw-r--r--sql/old/3.3.5a/2012_07_02_04_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_07_04_00_world_spell_script_names.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_05_00_world_item_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_07_06_00_world_spell_script_names.sql1
-rw-r--r--sql/old/3.3.5a/2012_07_09_00_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_07_12_00_world_version.sql1
-rw-r--r--sql/old/3.3.5a/2012_07_13_00_world_spell_proc_event.sql1
-rw-r--r--sql/old/3.3.5a/2012_07_13_00_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_07_14_00_world_creature_loot_template.sql6
-rw-r--r--sql/old/3.3.5a/2012_07_14_01_world_creature_loot_template.sql33
-rw-r--r--sql/old/3.3.5a/2012_07_16_00_world_creature_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_16_01_world_reference_loot_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_22_00_world_spelldifficulty_dbc.sql1
-rw-r--r--sql/old/3.3.5a/2012_07_22_01_world_conditions.sql10
-rw-r--r--sql/old/3.3.5a/2012_07_22_02_world_creature_loot_template.sql5
-rw-r--r--sql/old/3.3.5a/2012_07_22_03_world_gossip.sql18
-rw-r--r--sql/old/3.3.5a/2012_07_22_04_world_gossip.sql20
-rw-r--r--sql/old/3.3.5a/2012_07_22_05_world_script_texts.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_22_06_world_gossip.sql85
-rw-r--r--sql/old/3.3.5a/2012_07_22_07_world_sai.sql7
-rw-r--r--sql/old/3.3.5a/2012_07_22_08_world_sai.sql16
-rw-r--r--sql/old/3.3.5a/2012_07_22_09_world_creature_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_22_10_world_creature_onkill_rep.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_22_11_world_conditions.sql4
-rw-r--r--sql/old/3.3.5a/2012_07_22_12_world_creature_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_07_22_13_world_conditions.sql3
-rw-r--r--sql/old/3.3.5a/2012_07_22_14_world_gameobject.sql21
-rw-r--r--sql/old/3.3.5a/2012_07_22_15_world_sai.sql27
-rw-r--r--sql/old/3.3.5a/2012_07_29_00_world_factionchange.sql9
-rw-r--r--sql/old/3.3.5a/2012_07_29_01_world_pool_quest.sql34
-rw-r--r--sql/old/3.3.5a/2012_07_29_02_world_sai.sql28
-rw-r--r--sql/old/3.3.5a/2012_07_29_03_world_sai.sql7
-rw-r--r--sql/old/3.3.5a/2012_07_29_04_world_sai.sql17
-rw-r--r--sql/old/3.3.5a/2012_07_29_05_world_sai.sql34
-rw-r--r--sql/old/3.3.5a/2012_07_29_06_world_sai.sql43
-rw-r--r--sql/old/3.3.5a/2012_07_29_07_world_sai.sql4
-rw-r--r--sql/old/3.3.5a/2012_07_29_08_world_sai.sql36
-rw-r--r--sql/old/3.3.5a/2012_07_29_09_world_gossip_menu_option.sql12
-rw-r--r--sql/old/3.3.5a/2012_07_29_10_world_sai.sql23
-rw-r--r--sql/old/3.3.5a/2012_08_01_00_world_sai.sql41
-rw-r--r--sql/old/3.3.5a/2012_08_01_01_world_creature.sql9
-rw-r--r--sql/old/3.3.5a/2012_08_01_02_world_loot.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_02_00_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_04_00_world_disables.sql219
-rw-r--r--sql/old/3.3.5a/2012_08_04_01_world_disables.sql50
-rw-r--r--sql/old/3.3.5a/2012_08_04_02_world_disables.sql23
-rw-r--r--sql/old/3.3.5a/2012_08_04_03_world_disables.sql38
-rw-r--r--sql/old/3.3.5a/2012_08_04_04_world_disables.sql34
-rw-r--r--sql/old/3.3.5a/2012_08_04_05_world_disables.sql28
-rw-r--r--sql/old/3.3.5a/2012_08_04_06_world_quest_template.sql10
-rw-r--r--sql/old/3.3.5a/2012_08_04_07_world_game_event_creature_quest.sql110
-rw-r--r--sql/old/3.3.5a/2012_08_04_08_world_disables.sql65
-rw-r--r--sql/old/3.3.5a/2012_08_04_09_world_disables.sql10
-rw-r--r--sql/old/3.3.5a/2012_08_04_10_world_disables.sql43
-rw-r--r--sql/old/3.3.5a/2012_08_04_11_world_game_event_creature_quest.sql365
-rw-r--r--sql/old/3.3.5a/2012_08_05_00_world_trinity_string.sql5
-rw-r--r--sql/old/3.3.5a/2012_08_05_01_world_command.sql19
-rw-r--r--sql/old/3.3.5a/2012_08_06_00_auth_logs.sql2
-rw-r--r--sql/old/3.3.5a/2012_08_06_00_world_command.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_07_00_characters_characters.sql2
-rw-r--r--sql/old/3.3.5a/2012_08_09_00_world_creature_template.sql6
-rw-r--r--sql/old/3.3.5a/2012_08_09_01_world_sai.sql48
-rw-r--r--sql/old/3.3.5a/2012_08_10_00_world_conditions.sql7
-rw-r--r--sql/old/3.3.5a/2012_08_10_01_world_loot_template.sql25
-rw-r--r--sql/old/3.3.5a/2012_08_10_02_world_script_texts.sql6
-rw-r--r--sql/old/3.3.5a/2012_08_10_03_world_quest_template.sql18
-rw-r--r--sql/old/3.3.5a/2012_08_10_04_world_gossip.sql5
-rw-r--r--sql/old/3.3.5a/2012_08_10_05_world_quest_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_08_10_06_world_creature.sql16
-rw-r--r--sql/old/3.3.5a/2012_08_11_00_world_creature_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_11_01_world_quest_poi.sql60
-rw-r--r--sql/old/3.3.5a/2012_08_12_00_world_conditions.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_12_01_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_12_02_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_13_00_world_creature_text.sql133
-rw-r--r--sql/old/3.3.5a/2012_08_13_01_world_creature.sql10
-rw-r--r--sql/old/3.3.5a/2012_08_14_00_world_creature_text.sql24
-rw-r--r--sql/old/3.3.5a/2012_08_14_01_world_creature_text.sql8
-rw-r--r--sql/old/3.3.5a/2012_08_14_02_world_creature.sql12
-rw-r--r--sql/old/3.3.5a/2012_08_16_00_world_creature_template.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_16_00_world_spell_dbc.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_17_00_world_spell_dbc.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_19_00_world_pickpocketing_loot_template.sql11
-rw-r--r--sql/old/3.3.5a/2012_08_19_01_world_spell_dbc.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_20_00_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_20_01_world_wintergrasp_conditions.sql31
-rw-r--r--sql/old/3.3.5a/2012_08_20_02_world_wintergrasp_creatures.sql64
-rw-r--r--sql/old/3.3.5a/2012_08_20_03_world_wintergrasp_gameobjects.sql86
-rw-r--r--sql/old/3.3.5a/2012_08_20_04_world_wintergrasp_gossips.sql20
-rw-r--r--sql/old/3.3.5a/2012_08_20_05_world_wintergrasp_quests.sql16
-rw-r--r--sql/old/3.3.5a/2012_08_20_06_world_wintergrasp_spells.sql81
-rw-r--r--sql/old/3.3.5a/2012_08_20_07_world_wintergrasp_texts.sql108
-rw-r--r--sql/old/3.3.5a/2012_08_20_08_world_achievement_criteria_data.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_20_09_world_disables.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_21_00_world_spell_proc_event.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_21_01_world_command.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_21_02_world_wintergrasp_conditions.sql23
-rw-r--r--sql/old/3.3.5a/2012_08_23_00_world_wintergrasp_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_23_01_world_wintergrasp_gameobject.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_25_00_world_creature_template.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_25_01_world_creature_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_26_00_world_conditions.sql5
-rw-r--r--sql/old/3.3.5a/2012_08_26_01_world_creature.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_26_02_world_spell_area.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_26_03_world_spell_area.sql3
-rw-r--r--sql/old/3.3.5a/2012_08_27_00_world_creature_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_08_27_00_world_spell_script_name.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_27_01_world_sai.sql13
-rw-r--r--sql/old/3.3.5a/2012_08_27_02_world_creature.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_27_02_world_playercreateinfo_spell.sql9
-rw-r--r--sql/old/3.3.5a/2012_08_27_03_world_gameobject.sql6
-rw-r--r--sql/old/3.3.5a/2012_08_27_04_world_quest_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_27_05_world_sai.sql56
-rw-r--r--sql/old/3.3.5a/2012_08_27_06_world_sai.sql43
-rw-r--r--sql/old/3.3.5a/2012_08_27_07_world_spell_area.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_27_08_world_misc.sql29
-rw-r--r--sql/old/3.3.5a/2012_08_27_09_world_conditions.sql8
-rw-r--r--sql/old/3.3.5a/2012_08_27_10_world_spell_script_names.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_28_00_world_spell_script_name.sql4
-rw-r--r--sql/old/3.3.5a/2012_08_28_01_world_achievement_criteria_data.sql6
-rw-r--r--sql/old/3.3.5a/2012_08_29_00_world_blood_furnace.sql290
-rw-r--r--sql/old/3.3.5a/2012_08_30_00_world_creature_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_08_30_00_world_spell_script_names.sql8
-rw-r--r--sql/old/3.3.5a/2012_08_31_00_world_command.sql14
-rw-r--r--sql/old/3.3.5a/2012_08_31_00_world_sai.sql50
-rw-r--r--sql/old/3.3.5a/2012_09_01_00_world_spell_script_names.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_02_00_world_quest_template.sql49
-rw-r--r--sql/old/3.3.5a/2012_09_02_01_world_sai.sql36
-rw-r--r--sql/old/3.3.5a/2012_09_03_00_world_misc.sql36
-rw-r--r--sql/old/3.3.5a/2012_09_03_01_world_gameobject_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_03_02_world_quest_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_09_07_00_characters_characters.sql2
-rw-r--r--sql/old/3.3.5a/2012_09_07_00_world_spell_bonus_data.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_07_01_world_creature_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_07_02_world_spell_script_names.sql3
-rw-r--r--sql/old/3.3.5a/2012_09_08_00_world_achievement_criteria_data.sql6
-rw-r--r--sql/old/3.3.5a/2012_09_08_01_world_creature_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_08_02_world_achievement_criteria_data.sql10
-rw-r--r--sql/old/3.3.5a/2012_09_09_00_world_command.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_09_01_world_trinity_string.sql3
-rw-r--r--sql/old/3.3.5a/2012_09_09_02_world_spell_script_names.sql10
-rw-r--r--sql/old/3.3.5a/2012_09_09_03_world_spell_bonus_data.sql9
-rw-r--r--sql/old/3.3.5a/2012_09_09_04_world_quest_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_10_00_world_game_event.sql3
-rw-r--r--sql/old/3.3.5a/2012_09_10_01_world_quest_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_10_02_world_creature_text.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_10_03_world_quest_template.sql3
-rw-r--r--sql/old/3.3.5a/2012_09_10_04_world_quest_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_09_10_06_world_creature_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_10_07_world_go_loot_template.sql2
-rw-r--r--sql/old/3.3.5a/2012_09_10_08_world_spell_area.sql5
-rw-r--r--sql/old/3.3.5a/2012_09_10_09_world_creature_involvedrelation.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_10_10_world_gossips.sql111
-rw-r--r--sql/old/3.3.5a/2012_09_10_11_world_event_scripts.sql7
-rw-r--r--sql/old/3.3.5a/2012_09_10_12_world_sai.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_10_13_world_creature_model_info.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_11_00_world_misc.sql11
-rw-r--r--sql/old/3.3.5a/2012_09_12_00_world_misc.sql9
-rw-r--r--sql/old/3.3.5a/2012_09_12_01_world_creature.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_13_00_world_item_template.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_13_01_world_fires_over_skettis.sql91
-rw-r--r--sql/old/3.3.5a/2012_09_13_01_world_ogrila.sql158
-rw-r--r--sql/old/3.3.5a/2012_09_13_01_world_spell_script_name.sql14
-rw-r--r--sql/old/3.3.5a/2012_09_13_01_world_spell_target_position.sql15
-rw-r--r--sql/old/3.3.5a/2012_09_13_02_world_trinity_string.sql12
-rw-r--r--sql/old/3.3.5a/2012_09_14_00_world_creature_template.sql287
-rw-r--r--sql/old/3.3.5a/2012_09_14_00_world_sai.sql1
-rw-r--r--sql/old/3.3.5a/2012_09_14_01_world_creature_loot_template.sql5
-rw-r--r--sql/old/3.3.5a/2012_09_15_00_world_achievement_criteria_data.sql6
-rw-r--r--sql/old/3.3.5a/2012_09_15_00_world_creature_template.sql288
-rw-r--r--sql/old/3.3.5a/2012_09_15_00_world_disables.sql4
-rw-r--r--sql/old/3.3.5a/2012_09_15_01_world_creature_loot_template.sql19
-rw-r--r--sql/updates/world/2012_09_16_00_world_version.sql1
-rw-r--r--sql/updates/world/2012_09_16_01_world_conditions.sql4
-rw-r--r--sql/updates/world/2012_09_16_01_world_creature_loot_template.sql1
-rw-r--r--sql/updates/world/2012_09_16_01_world_creature_template_addon.sql3
-rw-r--r--sql/updates/world/2012_09_16_02_world_fires_over_skettis.sql26
-rw-r--r--sql/updates/world/2012_09_16_03_world_spell_script_names.sql3
-rw-r--r--sql/updates/world/2012_09_17_00_world_spell_bonus_data.sql4
-rw-r--r--sql/updates/world/2012_09_17_01_world_spell_bonus_data.sql3
-rw-r--r--sql/updates/world/2012_09_17_01_world_spell_script_names.sql5
-rw-r--r--sql/updates/world/2012_09_17_02_world_misc.sql320
-rw-r--r--sql/updates/world/2012_09_18_00_world_creature_template.sql4
-rw-r--r--sql/updates/world/2012_09_18_01_world_creature_template.sql7
-rw-r--r--sql/updates/world/2012_09_18_02_world_spell_script_names.sql3
-rw-r--r--sql/updates/world/2012_09_19_00_world_dwarfageddon.sql16
-rw-r--r--sql/updates/world/2012_09_19_00_world_reference_loot_template.sql449
-rw-r--r--sql/updates/world/2012_09_22_00_world_utgarde.sql102
-rw-r--r--sql/updates/world/2012_09_22_01_world_i_was_a_lot_of_things.sql32
-rw-r--r--sql/updates/world/2012_09_22_03_world_game_event.sql2
-rw-r--r--src/server/authserver/Authentication/AuthCodes.cpp48
-rwxr-xr-xsrc/server/authserver/Authentication/AuthCodes.h13
-rwxr-xr-xsrc/server/authserver/Main.cpp87
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.cpp4
-rwxr-xr-xsrc/server/authserver/Server/AuthSocket.cpp195
-rwxr-xr-xsrc/server/authserver/Server/RealmAcceptor.h4
-rwxr-xr-xsrc/server/authserver/Server/RealmSocket.cpp2
-rw-r--r--src/server/authserver/authserver.conf.dist216
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.h5
-rwxr-xr-xsrc/server/collision/Management/IVMapManager.h2
-rw-r--r--src/server/collision/Management/VMapManager2.cpp4
-rw-r--r--src/server/collision/Maps/MapTree.cpp14
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp15
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp14
-rw-r--r--src/server/collision/Models/GameObjectModel.h2
-rwxr-xr-xsrc/server/collision/Models/ModelInstance.h2
-rw-r--r--src/server/collision/Models/WorldModel.cpp2
-rw-r--r--src/server/collision/RegularGrid.h2
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.cpp9
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.h1
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.h7
-rwxr-xr-xsrc/server/game/AI/CoreAI/PassiveAI.h1
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.cpp5
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.cpp2
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.h8
-rwxr-xr-xsrc/server/game/AI/CreatureAI.cpp11
-rwxr-xr-xsrc/server/game/AI/CreatureAI.h8
-rwxr-xr-xsrc/server/game/AI/CreatureAIImpl.h4
-rwxr-xr-xsrc/server/game/AI/CreatureAIRegistry.cpp1
-rwxr-xr-xsrc/server/game/AI/CreatureAISelector.cpp6
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.cpp65
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.h7
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAIMgr.cpp250
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp14
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h20
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp48
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp23
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp61
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp96
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h8
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp188
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h273
-rwxr-xr-xsrc/server/game/Accounts/AccountMgr.h2
-rwxr-xr-xsrc/server/game/Achievements/AchievementMgr.cpp149
-rwxr-xr-xsrc/server/game/Achievements/AchievementMgr.h2
-rwxr-xr-xsrc/server/game/Addons/AddonMgr.cpp8
-rwxr-xr-xsrc/server/game/Addons/AddonMgr.h8
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp164
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.h14
-rw-r--r--src/server/game/Battlefield/Battlefield.cpp1118
-rw-r--r--src/server/game/Battlefield/Battlefield.h430
-rw-r--r--src/server/game/Battlefield/BattlefieldHandler.cpp150
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.cpp140
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.h79
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.cpp1102
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.h1784
-rwxr-xr-xsrc/server/game/Battlegrounds/ArenaTeam.cpp33
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.cpp8
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp104
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.h20
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp52
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundQueue.cpp16
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.cpp36
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.h6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.cpp82
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.h4
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundBE.cpp20
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp15
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundDS.h6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.cpp57
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundIC.cpp23
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundIC.h8
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundNA.cpp16
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRL.cpp17
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRV.cpp15
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRV.h6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.cpp18
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.h15
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundWS.cpp91
-rw-r--r--src/server/game/CMakeLists.txt5
-rw-r--r--src/server/game/Calendar/CalendarMgr.cpp18
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.cpp6
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.h6
-rwxr-xr-xsrc/server/game/Chat/Channels/ChannelMgr.h1
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp373
-rwxr-xr-xsrc/server/game/Chat/Chat.h260
-rwxr-xr-xsrc/server/game/Chat/Commands/Level0.cpp159
-rwxr-xr-xsrc/server/game/Chat/Commands/Level1.cpp763
-rwxr-xr-xsrc/server/game/Chat/Commands/Level2.cpp1170
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp4763
-rwxr-xr-xsrc/server/game/Chat/Commands/TicketCommands.cpp457
-rwxr-xr-xsrc/server/game/Combat/HostileRefManager.h1
-rwxr-xr-xsrc/server/game/Combat/ThreatManager.cpp5
-rwxr-xr-xsrc/server/game/Combat/UnitEvents.h8
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp320
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h5
-rwxr-xr-xsrc/server/game/Conditions/DisableMgr.cpp62
-rwxr-xr-xsrc/server/game/Conditions/DisableMgr.h6
-rwxr-xr-xsrc/server/game/DataStores/DBCEnums.h28
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.cpp14
-rwxr-xr-xsrc/server/game/DataStores/DBCStructure.h8
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp40
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.h2
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp3
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.h2
-rwxr-xr-xsrc/server/game/Entities/Corpse/Corpse.cpp10
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp83
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.h21
-rwxr-xr-xsrc/server/game/Entities/Creature/CreatureGroups.cpp10
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.cpp14
-rwxr-xr-xsrc/server/game/Entities/Creature/TemporarySummon.cpp4
-rwxr-xr-xsrc/server/game/Entities/Creature/TemporarySummon.h2
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.cpp2
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.h2
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp90
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.h2
-rwxr-xr-xsrc/server/game/Entities/Item/Container/Bag.cpp2
-rwxr-xr-xsrc/server/game/Entities/Item/Item.cpp14
-rwxr-xr-xsrc/server/game/Entities/Item/Item.h1
-rwxr-xr-xsrc/server/game/Entities/Item/ItemEnchantmentMgr.cpp10
-rwxr-xr-xsrc/server/game/Entities/Item/ItemPrototype.h7
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp191
-rwxr-xr-xsrc/server/game/Entities/Object/Object.h19
-rwxr-xr-xsrc/server/game/Entities/Object/ObjectDefines.h2
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateData.cpp10
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp1568
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateFieldFlags.h44
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateFields.h20
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateMask.h26
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp59
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.h5
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp692
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h66
-rwxr-xr-xsrc/server/game/Entities/Player/SocialMgr.h16
-rwxr-xr-xsrc/server/game/Entities/Totem/Totem.cpp20
-rwxr-xr-xsrc/server/game/Entities/Totem/Totem.h6
-rwxr-xr-xsrc/server/game/Entities/Transport/Transport.cpp52
-rwxr-xr-xsrc/server/game/Entities/Transport/Transport.h8
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp850
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h153
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp34
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.h14
-rw-r--r--src/server/game/Entities/Vehicle/VehicleDefines.h12
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp217
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.h12
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.cpp2
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.h5
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp1405
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.h26
-rwxr-xr-xsrc/server/game/Grids/GridStates.h2
-rwxr-xr-xsrc/server/game/Grids/NGrid.h8
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.h31
-rwxr-xr-xsrc/server/game/Grids/ObjectGridLoader.cpp2
-rwxr-xr-xsrc/server/game/Groups/Group.cpp252
-rwxr-xr-xsrc/server/game/Groups/Group.h15
-rw-r--r--src/server/game/Groups/GroupMgr.cpp32
-rwxr-xr-xsrc/server/game/Guilds/Guild.cpp58
-rwxr-xr-xsrc/server/game/Guilds/Guild.h14
-rw-r--r--src/server/game/Guilds/GuildMgr.cpp71
-rwxr-xr-xsrc/server/game/Handlers/AddonHandler.cpp43
-rwxr-xr-xsrc/server/game/Handlers/AuctionHouseHandler.cpp33
-rwxr-xr-xsrc/server/game/Handlers/BattleGroundHandler.cpp106
-rwxr-xr-xsrc/server/game/Handlers/CalendarHandler.cpp64
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp100
-rwxr-xr-xsrc/server/game/Handlers/ChatHandler.cpp8
-rwxr-xr-xsrc/server/game/Handlers/CombatHandler.cpp2
-rwxr-xr-xsrc/server/game/Handlers/DuelHandler.cpp4
-rwxr-xr-xsrc/server/game/Handlers/GroupHandler.cpp17
-rwxr-xr-xsrc/server/game/Handlers/ItemHandler.cpp23
-rwxr-xr-xsrc/server/game/Handlers/LootHandler.cpp16
-rwxr-xr-xsrc/server/game/Handlers/MailHandler.cpp65
-rwxr-xr-xsrc/server/game/Handlers/MiscHandler.cpp93
-rwxr-xr-xsrc/server/game/Handlers/MovementHandler.cpp18
-rwxr-xr-xsrc/server/game/Handlers/NPCHandler.cpp2
-rwxr-xr-xsrc/server/game/Handlers/PetHandler.cpp46
-rwxr-xr-xsrc/server/game/Handlers/PetitionsHandler.cpp4
-rwxr-xr-xsrc/server/game/Handlers/QueryHandler.cpp2
-rwxr-xr-xsrc/server/game/Handlers/QuestHandler.cpp22
-rwxr-xr-xsrc/server/game/Handlers/SkillHandler.cpp12
-rwxr-xr-xsrc/server/game/Handlers/SpellHandler.cpp22
-rwxr-xr-xsrc/server/game/Handlers/TradeHandler.cpp12
-rw-r--r--src/server/game/Handlers/VehicleHandler.cpp20
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.cpp16
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp14
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.h19
-rwxr-xr-xsrc/server/game/Loot/LootMgr.cpp190
-rwxr-xr-xsrc/server/game/Loot/LootMgr.h7
-rwxr-xr-xsrc/server/game/Mails/Mail.cpp2
-rwxr-xr-xsrc/server/game/Mails/Mail.h22
-rwxr-xr-xsrc/server/game/Maps/Map.cpp108
-rwxr-xr-xsrc/server/game/Maps/Map.h14
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.cpp4
-rwxr-xr-xsrc/server/game/Maps/MapManager.cpp4
-rwxr-xr-xsrc/server/game/Maps/MapManager.h2
-rwxr-xr-xsrc/server/game/Miscellaneous/Formulas.h2
-rwxr-xr-xsrc/server/game/Miscellaneous/Language.h18
-rwxr-xr-xsrc/server/game/Miscellaneous/SharedDefines.h58
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.cpp74
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.h6
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp9
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp17
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.h3
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp1
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp6
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp11
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.h3
-rw-r--r--src/server/game/Movement/Spline/MoveSplineFlag.h2
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.cpp16
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.h2
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.cpp2
-rw-r--r--src/server/game/Movement/Spline/Spline.h2
-rwxr-xr-xsrc/server/game/Movement/Waypoints/WaypointManager.cpp8
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.cpp8
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.h4
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvPMgr.cpp14
-rwxr-xr-xsrc/server/game/Pools/PoolMgr.cpp85
-rwxr-xr-xsrc/server/game/Quests/QuestDef.cpp5
-rwxr-xr-xsrc/server/game/Quests/QuestDef.h6
-rwxr-xr-xsrc/server/game/Reputation/ReputationMgr.cpp14
-rwxr-xr-xsrc/server/game/Reputation/ReputationMgr.h2
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp102
-rwxr-xr-xsrc/server/game/Scripting/ScriptLoader.cpp32
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.cpp54
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.h4
-rwxr-xr-xsrc/server/game/Scripting/ScriptSystem.cpp56
-rw-r--r--src/server/game/Scripting/ScriptSystem.h1
-rwxr-xr-xsrc/server/game/Server/Protocol/Opcodes.cpp6
-rwxr-xr-xsrc/server/game/Server/Protocol/Opcodes.h10
-rwxr-xr-xsrc/server/game/Server/WorldSession.cpp112
-rwxr-xr-xsrc/server/game/Server/WorldSession.h34
-rwxr-xr-xsrc/server/game/Server/WorldSocket.cpp111
-rw-r--r--src/server/game/Server/WorldSocketAcceptor.h4
-rwxr-xr-xsrc/server/game/Server/WorldSocketMgr.cpp18
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.cpp20
-rwxr-xr-xsrc/server/game/Skills/SkillExtraItems.cpp16
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraDefines.h7
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp329
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp100
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.h2
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp513
-rwxr-xr-xsrc/server/game/Spells/Spell.h10
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp543
-rw-r--r--src/server/game/Spells/SpellInfo.cpp22
-rw-r--r--src/server/game/Spells/SpellInfo.h18
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp380
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.h33
-rwxr-xr-xsrc/server/game/Spells/SpellScript.cpp182
-rwxr-xr-xsrc/server/game/Spells/SpellScript.h79
-rwxr-xr-xsrc/server/game/Texts/CreatureTextMgr.cpp26
-rwxr-xr-xsrc/server/game/Tickets/TicketMgr.cpp47
-rwxr-xr-xsrc/server/game/Tickets/TicketMgr.h10
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.cpp8
-rw-r--r--src/server/game/Tools/PlayerDump.cpp8
-rwxr-xr-xsrc/server/game/Tools/PlayerDump.h2
-rw-r--r--src/server/game/Warden/Warden.cpp8
-rw-r--r--src/server/game/Warden/Warden.h2
-rw-r--r--src/server/game/Warden/WardenCheckMgr.cpp34
-rw-r--r--src/server/game/Warden/WardenMac.cpp14
-rw-r--r--src/server/game/Warden/WardenWin.cpp20
-rwxr-xr-xsrc/server/game/Weather/Weather.cpp6
-rwxr-xr-xsrc/server/game/Weather/Weather.h2
-rwxr-xr-xsrc/server/game/Weather/WeatherMgr.cpp14
-rwxr-xr-xsrc/server/game/World/World.cpp511
-rwxr-xr-xsrc/server/game/World/World.h27
-rw-r--r--src/server/scripts/CMakeLists.txt2
-rw-r--r--src/server/scripts/Commands/CMakeLists.txt27
-rw-r--r--src/server/scripts/Commands/cs_account.cpp22
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp718
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp180
-rw-r--r--src/server/scripts/Commands/cs_cast.cpp310
-rw-r--r--src/server/scripts/Commands/cs_character.cpp924
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp298
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp4
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp371
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp12
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp2
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp199
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp193
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp72
-rw-r--r--src/server/scripts/Commands/cs_list.cpp469
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp1392
-rw-r--r--src/server/scripts/Commands/cs_message.cpp215
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2954
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp23
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp8
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp35
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp291
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp313
-rw-r--r--src/server/scripts/Commands/cs_server.cpp420
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp9
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp509
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp13
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp50
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.h2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp25
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp46
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp140
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp25
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/alterac_mountains.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/arathi_highlands.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/blasted_lands.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/boss_kruul.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/burning_steppes.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/duskwood.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/eversong_woods.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ghostlands.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/hinterlands.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ironforge.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/loch_modan.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/redridge_mountains.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/silvermoon_city.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/silverpine_forest.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/stormwind_city.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/tirisfal_glades.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/undercity.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/western_plaguelands.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/westfall.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/wetlands.cpp13
-rw-r--r--src/server/scripts/Examples/example_commandscript.cpp2
-rw-r--r--src/server/scripts/Examples/example_creature.cpp4
-rw-r--r--src/server/scripts/Examples/example_escort.cpp4
-rw-r--r--src/server/scripts/Examples/example_gossip_codebox.cpp4
-rw-r--r--src/server/scripts/Examples/example_misc.cpp1
-rw-r--r--src/server/scripts/Examples/example_spell.cpp49
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp23
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp11
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp3
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp3
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp113
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp123
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp69
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp157
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp85
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp14
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp29
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h80
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp55
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp11
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp8
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp5
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp8
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp13
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp24
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp4
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp39
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp39
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp58
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp58
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp302
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp107
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h12
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp4
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp5
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp7
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp3
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp3
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp4
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp15
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp4
-rw-r--r--src/server/scripts/Kalimdor/ashenvale.cpp10
-rw-r--r--src/server/scripts/Kalimdor/azshara.cpp6
-rw-r--r--src/server/scripts/Kalimdor/azuremyst_isle.cpp6
-rw-r--r--src/server/scripts/Kalimdor/dustwallow_marsh.cpp102
-rw-r--r--src/server/scripts/Kalimdor/felwood.cpp4
-rw-r--r--src/server/scripts/Kalimdor/moonglade.cpp5
-rw-r--r--src/server/scripts/Kalimdor/silithus.cpp6
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp4
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp3
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp3
-rw-r--r--src/server/scripts/Northrend/CMakeLists.txt1
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp7
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp3
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp3
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp15
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp3
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp19
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp3
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp3
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp4
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp121
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp74
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp47
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp58
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp55
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp27
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp209
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h14
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp3
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp3
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp3
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp4
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp10
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp22
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp19
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp9
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp5
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp5
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp3
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_eck.cpp3
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp3
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp3
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp4
-rw-r--r--src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp3
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp11
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp32
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp38
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp4
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp230
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp30
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp120
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp206
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp15
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp132
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h5
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp129
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp67
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp46
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp47
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp5
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp6
-rw-r--r--src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp6
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp5
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp6
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp76
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp21
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp42
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp86
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp80
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp20
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp18
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp34
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp42
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp24
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp8
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp1
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp126
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp74
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp34
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp5
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp80
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp3
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp8
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp17
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp3
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp3
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp4
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp3
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp3
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_erekem.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_moragg.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.cpp11
-rw-r--r--src/server/scripts/Northrend/borean_tundra.cpp135
-rw-r--r--src/server/scripts/Northrend/crystalsong_forest.cpp3
-rw-r--r--src/server/scripts/Northrend/dalaran.cpp4
-rw-r--r--src/server/scripts/Northrend/dragonblight.cpp67
-rw-r--r--src/server/scripts/Northrend/grizzly_hills.cpp150
-rw-r--r--src/server/scripts/Northrend/howling_fjord.cpp4
-rw-r--r--src/server/scripts/Northrend/icecrown.cpp10
-rw-r--r--src/server/scripts/Northrend/isle_of_conquest.cpp4
-rw-r--r--src/server/scripts/Northrend/sholazar_basin.cpp5
-rw-r--r--src/server/scripts/Northrend/storm_peaks.cpp450
-rw-r--r--src/server/scripts/Northrend/wintergrasp.cpp585
-rw-r--r--src/server/scripts/Northrend/zuldrak.cpp4
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp3
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp11
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.cpp4
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp7
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp7
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp22
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp20
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_supremus.cpp4
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/illidari_council.cpp18
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp5
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp7
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp19
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp3
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp89
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp3
-rw-r--r--src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp13
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp64
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp23
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp227
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp5
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp48
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp7
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp15
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp7
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp3
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp3
-rw-r--r--src/server/scripts/Outland/blades_edge_mountains.cpp10
-rw-r--r--src/server/scripts/Outland/boss_doomlord_kazzak.cpp54
-rw-r--r--src/server/scripts/Outland/boss_doomwalker.cpp3
-rw-r--r--src/server/scripts/Outland/hellfire_peninsula.cpp6
-rw-r--r--src/server/scripts/Outland/nagrand.cpp5
-rw-r--r--src/server/scripts/Outland/netherstorm.cpp6
-rw-r--r--src/server/scripts/Outland/shadowmoon_valley.cpp155
-rw-r--r--src/server/scripts/Outland/shattrath_city.cpp4
-rw-r--r--src/server/scripts/Outland/terokkar_forest.cpp4
-rw-r--r--src/server/scripts/Outland/zangarmarsh.cpp4
-rw-r--r--src/server/scripts/Spells/CMakeLists.txt1
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp56
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp451
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp753
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp7
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp82
-rw-r--r--src/server/scripts/Spells/spell_item.cpp66
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp47
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp199
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp366
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp130
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp334
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp31
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp129
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp206
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp59
-rwxr-xr-xsrc/server/scripts/World/achievement_scripts.cpp52
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp3
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp24
-rwxr-xr-xsrc/server/scripts/World/chat_log.cpp44
-rw-r--r--src/server/scripts/World/go_scripts.cpp29
-rw-r--r--src/server/scripts/World/guards.cpp3
-rw-r--r--src/server/scripts/World/item_scripts.cpp3
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp4
-rw-r--r--src/server/scripts/World/npc_innkeeper.cpp5
-rw-r--r--src/server/scripts/World/npc_professions.cpp6
-rw-r--r--src/server/scripts/World/npc_taxi.cpp4
-rw-r--r--src/server/scripts/World/npcs_special.cpp20
-rw-r--r--src/server/shared/AutoPtr.h6
-rwxr-xr-xsrc/server/shared/Configuration/Config.cpp8
-rwxr-xr-xsrc/server/shared/Configuration/Config.h1
-rw-r--r--src/server/shared/Containers.h6
-rwxr-xr-xsrc/server/shared/Cryptography/ARC4.cpp4
-rwxr-xr-xsrc/server/shared/Cryptography/Authentication/AuthCrypt.h1
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.cpp4
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.h2
-rw-r--r--src/server/shared/Cryptography/WardenKeyGeneration.h42
-rwxr-xr-xsrc/server/shared/DataStores/DBCFileLoader.cpp4
-rwxr-xr-xsrc/server/shared/DataStores/DBCFileLoader.h4
-rwxr-xr-xsrc/server/shared/DataStores/DBCStore.h10
-rwxr-xr-xsrc/server/shared/Database/AdhocStatement.cpp1
-rwxr-xr-xsrc/server/shared/Database/DatabaseWorkerPool.h24
-rwxr-xr-xsrc/server/shared/Database/Field.h24
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.cpp10
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.h2
-rwxr-xr-xsrc/server/shared/Database/Implementation/LoginDatabase.cpp2
-rwxr-xr-xsrc/server/shared/Database/Implementation/LoginDatabase.h2
-rwxr-xr-xsrc/server/shared/Database/Implementation/WorldDatabase.cpp5
-rwxr-xr-xsrc/server/shared/Database/Implementation/WorldDatabase.h5
-rwxr-xr-xsrc/server/shared/Database/MySQLConnection.cpp114
-rwxr-xr-xsrc/server/shared/Database/MySQLConnection.h2
-rwxr-xr-xsrc/server/shared/Database/MySQLThreading.h4
-rwxr-xr-xsrc/server/shared/Database/PreparedStatement.cpp7
-rwxr-xr-xsrc/server/shared/Database/QueryHolder.cpp20
-rwxr-xr-xsrc/server/shared/Database/QueryResult.cpp4
-rwxr-xr-xsrc/server/shared/Database/SQLOperation.h2
-rwxr-xr-xsrc/server/shared/Debugging/Errors.h8
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.cpp11
-rwxr-xr-xsrc/server/shared/Dynamic/TypeContainerFunctions.h4
-rwxr-xr-xsrc/server/shared/Dynamic/TypeContainerVisitor.h2
-rw-r--r--src/server/shared/Logging/Appender.cpp224
-rw-r--r--src/server/shared/Logging/Appender.h156
-rw-r--r--src/server/shared/Logging/AppenderConsole.cpp193
-rw-r--r--src/server/shared/Logging/AppenderConsole.h59
-rw-r--r--src/server/shared/Logging/AppenderDB.cpp55
-rw-r--r--src/server/shared/Logging/AppenderDB.h36
-rw-r--r--src/server/shared/Logging/AppenderFile.cpp74
-rw-r--r--src/server/shared/Logging/AppenderFile.h40
-rwxr-xr-xsrc/server/shared/Logging/Log.cpp1169
-rwxr-xr-xsrc/server/shared/Logging/Log.h209
-rw-r--r--src/server/shared/Logging/LogOperation.cpp31
-rw-r--r--src/server/shared/Logging/LogOperation.h41
-rw-r--r--src/server/shared/Logging/LogWorker.cpp50
-rw-r--r--src/server/shared/Logging/LogWorker.h47
-rw-r--r--src/server/shared/Logging/Logger.cpp84
-rw-r--r--src/server/shared/Logging/Logger.h46
-rwxr-xr-xsrc/server/shared/Packets/ByteBuffer.h115
-rwxr-xr-xsrc/server/shared/Threading/Threading.h2
-rwxr-xr-xsrc/server/shared/Utilities/ServiceWin32.cpp8
-rwxr-xr-xsrc/server/shared/Utilities/Util.cpp4
-rwxr-xr-xsrc/server/shared/Utilities/Util.h53
-rw-r--r--src/server/worldserver/CMakeLists.txt1
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp454
-rwxr-xr-xsrc/server/worldserver/Main.cpp22
-rwxr-xr-xsrc/server/worldserver/Master.cpp88
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp6
-rwxr-xr-xsrc/server/worldserver/RemoteAccess/RASocket.cpp30
-rwxr-xr-xsrc/server/worldserver/TCSoap/TCSoap.cpp6
-rwxr-xr-xsrc/server/worldserver/TCSoap/TCSoap.h2
-rw-r--r--src/server/worldserver/worldserver.conf.dist582
-rw-r--r--src/tools/map_extractor/CMakeLists.txt2
-rw-r--r--src/tools/map_extractor/System.cpp19
-rw-r--r--src/tools/map_extractor/dbcfile.cpp6
-rw-r--r--src/tools/vmap4_extractor/adtfile.cpp42
-rw-r--r--src/tools/vmap4_extractor/dbcfile.cpp5
-rw-r--r--src/tools/vmap4_extractor/model.cpp47
-rw-r--r--src/tools/vmap4_extractor/model.h27
-rw-r--r--src/tools/vmap4_extractor/mpq_libmpq04.h6
-rw-r--r--src/tools/vmap4_extractor/vmapexport.cpp30
-rw-r--r--src/tools/vmap4_extractor/wdtfile.cpp18
-rw-r--r--src/tools/vmap4_extractor/wdtfile.h5
-rw-r--r--src/tools/vmap4_extractor/wmo.cpp39
-rw-r--r--src/tools/vmap4_extractor/wmo.h36
1844 files changed, 74828 insertions, 37305 deletions
diff --git a/README b/README
index f2ae18f6cf5..9f2f9483b81 100644
--- a/README
+++ b/README
@@ -38,9 +38,6 @@ https://github.com/TrinityCore/TrinityCore
For further information on the TrinityCore project, please visit our
project website at http://www.TrinityCore.org
-To get nightly builds of the master branch of TrinityCore, please visit
-http://www.TrinityCore.net
-
Documentation including installation instructions can be found inside
the doc directory.
diff --git a/dep/PackageList.txt b/dep/PackageList.txt
index e5003ec744a..de08e0a461e 100644
--- a/dep/PackageList.txt
+++ b/dep/PackageList.txt
@@ -2,19 +2,19 @@ TrinityCore uses (parts of or in whole) the following opensource software :
ACE (ADAPTIVE Communication Environment)
http://www.cs.wustl.edu/~schmidt/ACE.html
- Version: 5.8.3
+ Version: 6.1.4
bzip2 (a freely available, patent free, high-quality data compressor)
http://www.bzip.org/
- Version: 1.0.5
+ Version: 1.0.6
G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License)
http://g3d.sourceforge.net/
- Version: 8.0-Release
+ Version: 8.01-Release
jemalloc (a general-purpose scalable concurrent malloc-implementation)
http://www.canonware.com/jemalloc/
- Version: 2.2.5
+ Version: 2.1.0
libMPQ (a library for reading MPQ files)
https://libmpq.org/
@@ -30,12 +30,12 @@ SFMT (SIMD-oriented Fast Mersenne Twister)
utf8-cpp (UTF-8 with C++ in a Portable Way)
http://utfcpp.sourceforge.net/
- Version: 2.3
+ Version: 2.3.2
zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library)
http://www.zlib.net/
- Version: 1.2.5
+ Version: 1.2.7
gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings)
http://gsoap2.sourceforge.net/
- Version: 2.8.2
+ Version: 2.8.10
diff --git a/dep/acelite/6.1.4_tc_changes.diff b/dep/acelite/6.1.4_tc_changes.diff
new file mode 100644
index 00000000000..a0caff7ab7d
--- /dev/null
+++ b/dep/acelite/6.1.4_tc_changes.diff
@@ -0,0 +1,407 @@
+diff --git a/dep/acelite/ace/CMakeLists.txt b/dep/acelite/ace/CMakeLists.txt
+new file mode 100644
+index 0000000..acd3d5a
+--- /dev/null
++++ b/dep/acelite/ace/CMakeLists.txt
+@@ -0,0 +1,337 @@
++# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
++#
++# This file is free software; as a special exception the author gives
++# unlimited permission to copy and/or distribute it, with or without
++# modifications, as long as this notice is preserved.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++# NOTE: Do not use glob here, it would include files we don't want
++set(ace_STAT_SRCS
++ PrecompiledHeaders/WinAcePCH.cpp
++ ACE.cpp
++ ACE_crc32.cpp
++ ACE_crc_ccitt.cpp
++ ace_wchar.cpp
++ Activation_Queue.cpp
++ Active_Map_Manager.cpp
++ Addr.cpp
++ Argv_Type_Converter.cpp
++ Assert.cpp
++ Asynch_IO.cpp
++ Asynch_IO_Impl.cpp
++ Asynch_Pseudo_Task.cpp
++ ATM_Acceptor.cpp
++ ATM_Addr.cpp
++ ATM_Connector.cpp
++ ATM_Params.cpp
++ ATM_QoS.cpp
++ ATM_Stream.cpp
++ Atomic_Op.cpp
++ Atomic_Op_Sparc.c
++ Auto_Event.cpp
++ Barrier.cpp
++ Base_Thread_Adapter.cpp
++ Based_Pointer_Repository.cpp
++ Basic_Stats.cpp
++ Basic_Types.cpp
++ Capabilities.cpp
++ CDR_Base.cpp
++ CDR_Size.cpp
++ CDR_Stream.cpp
++ Cleanup.cpp
++ Codecs.cpp
++ Codeset_IBM1047.cpp
++ Codeset_Registry.cpp
++ Codeset_Registry_db.cpp
++ Condition_Recursive_Thread_Mutex.cpp
++ Condition_Thread_Mutex.cpp
++ Configuration.cpp
++ Configuration_Import_Export.cpp
++ Connection_Recycling_Strategy.cpp
++ Containers.cpp
++ Copy_Disabled.cpp
++ Date_Time.cpp
++ DEV.cpp
++ DEV_Addr.cpp
++ DEV_Connector.cpp
++ DEV_IO.cpp
++ Dev_Poll_Reactor.cpp
++ Dirent.cpp
++ Dirent_Selector.cpp
++ DLL.cpp
++ DLL_Manager.cpp
++ Dump.cpp
++ Dynamic.cpp
++ Dynamic_Message_Strategy.cpp
++ Dynamic_Service_Base.cpp
++ Dynamic_Service_Dependency.cpp
++ Encoding_Converter.cpp
++ Encoding_Converter_Factory.cpp
++ Event.cpp
++ Event_Handler.cpp
++ Event_Handler_Handle_Timeout_Upcall.cpp
++ FIFO.cpp
++ FIFO_Recv.cpp
++ FIFO_Recv_Msg.cpp
++ FIFO_Send.cpp
++ FIFO_Send_Msg.cpp
++ FILE.cpp
++ FILE_Addr.cpp
++ FILE_Connector.cpp
++ FILE_IO.cpp
++ File_Lock.cpp
++ Filecache.cpp
++ Flag_Manip.cpp
++ Framework_Component.cpp
++ Functor.cpp
++ Functor_String.cpp
++ Get_Opt.cpp
++ Handle_Ops.cpp
++ Handle_Set.cpp
++ Hashable.cpp
++ High_Res_Timer.cpp
++ ICMP_Socket.cpp
++ INET_Addr.cpp
++ Init_ACE.cpp
++ IO_Cntl_Msg.cpp
++ IO_SAP.cpp
++ IOStream.cpp
++ IPC_SAP.cpp
++ Lib_Find.cpp
++ Local_Memory_Pool.cpp
++ Local_Name_Space.cpp
++ Local_Tokens.cpp
++ Lock.cpp
++ Log_Msg.cpp
++ Log_Msg_Backend.cpp
++ Log_Msg_Callback.cpp
++ Log_Msg_IPC.cpp
++ Log_Msg_NT_Event_Log.cpp
++ Log_Msg_UNIX_Syslog.cpp
++ Log_Record.cpp
++ Logging_Strategy.cpp
++ LSOCK.cpp
++ LSOCK_Acceptor.cpp
++ LSOCK_CODgram.cpp
++ LSOCK_Connector.cpp
++ LSOCK_Dgram.cpp
++ LSOCK_Stream.cpp
++ Malloc.cpp
++ Malloc_Allocator.cpp
++ Manual_Event.cpp
++ MEM_Acceptor.cpp
++ MEM_Addr.cpp
++ MEM_Connector.cpp
++ MEM_IO.cpp
++ Mem_Map.cpp
++ MEM_SAP.cpp
++ MEM_Stream.cpp
++ Message_Block.cpp
++ Message_Queue.cpp
++ Message_Queue_NT.cpp
++ Message_Queue_Vx.cpp
++ Method_Request.cpp
++ MMAP_Memory_Pool.cpp
++ Monitor_Admin.cpp
++ Monitor_Admin_Manager.cpp
++ Monitor_Base.cpp
++ Monitor_Control_Action.cpp
++ Monitor_Control_Types.cpp
++ Monitor_Point_Registry.cpp
++ Monitor_Size.cpp
++ Msg_WFMO_Reactor.cpp
++ Multihomed_INET_Addr.cpp
++ Mutex.cpp
++ Name_Proxy.cpp
++ Name_Request_Reply.cpp
++ Name_Space.cpp
++ Naming_Context.cpp
++ Netlink_Addr.cpp
++ Notification_Queue.cpp
++ Notification_Strategy.cpp
++ NT_Service.cpp
++ Obchunk.cpp
++ Object_Manager.cpp
++ Object_Manager_Base.cpp
++ OS_Errno.cpp
++ OS_Log_Msg_Attributes.cpp
++ OS_main.cpp
++ OS_NS_arpa_inet.cpp
++ OS_NS_ctype.cpp
++ OS_NS_dirent.cpp
++ OS_NS_dlfcn.cpp
++ OS_NS_errno.cpp
++ OS_NS_fcntl.cpp
++ OS_NS_math.cpp
++ OS_NS_netdb.cpp
++ OS_NS_poll.cpp
++ OS_NS_pwd.cpp
++ OS_NS_regex.cpp
++ OS_NS_signal.cpp
++ OS_NS_stdio.cpp
++ OS_NS_stdlib.cpp
++ OS_NS_string.cpp
++ OS_NS_strings.cpp
++ OS_NS_stropts.cpp
++ OS_NS_sys_mman.cpp
++ OS_NS_sys_msg.cpp
++ OS_NS_sys_resource.cpp
++ OS_NS_sys_select.cpp
++ OS_NS_sys_sendfile.cpp
++ OS_NS_sys_shm.cpp
++ OS_NS_sys_socket.cpp
++ OS_NS_sys_stat.cpp
++ OS_NS_sys_time.cpp
++ OS_NS_sys_uio.cpp
++ OS_NS_sys_utsname.cpp
++ OS_NS_sys_wait.cpp
++ OS_NS_Thread.cpp
++ OS_NS_time.cpp
++ OS_NS_unistd.cpp
++ OS_NS_wchar.cpp
++ OS_QoS.cpp
++ OS_Thread_Adapter.cpp
++ OS_TLI.cpp
++ Pagefile_Memory_Pool.cpp
++ Parse_Node.cpp
++ PI_Malloc.cpp
++ Ping_Socket.cpp
++ Pipe.cpp
++ POSIX_Asynch_IO.cpp
++ POSIX_CB_Proactor.cpp
++ POSIX_Proactor.cpp
++ Priority_Reactor.cpp
++ Proactor.cpp
++ Proactor_Impl.cpp
++ Process.cpp
++ Process_Manager.cpp
++ Process_Mutex.cpp
++ Process_Semaphore.cpp
++ Profile_Timer.cpp
++ Reactor.cpp
++ Reactor_Impl.cpp
++ Reactor_Notification_Strategy.cpp
++ Reactor_Timer_Interface.cpp
++ Read_Buffer.cpp
++ Recursive_Thread_Mutex.cpp
++ Recyclable.cpp
++ Registry.cpp
++ Registry_Name_Space.cpp
++ Remote_Name_Space.cpp
++ Remote_Tokens.cpp
++ Rtems_init.c
++ RW_Mutex.cpp
++ RW_Process_Mutex.cpp
++ RW_Thread_Mutex.cpp
++ Sample_History.cpp
++ Sbrk_Memory_Pool.cpp
++ Sched_Params.cpp
++ Select_Reactor_Base.cpp
++ Semaphore.cpp
++ Service_Config.cpp
++ Service_Gestalt.cpp
++ Service_Manager.cpp
++ Service_Object.cpp
++ Service_Repository.cpp
++ Service_Types.cpp
++ Shared_Memory.cpp
++ Shared_Memory_MM.cpp
++ Shared_Memory_Pool.cpp
++ Shared_Memory_SV.cpp
++ Shared_Object.cpp
++ Sig_Adapter.cpp
++ Sig_Handler.cpp
++ Signal.cpp
++ SOCK.cpp
++ SOCK_Acceptor.cpp
++ SOCK_CODgram.cpp
++ Sock_Connect.cpp
++ SOCK_Connector.cpp
++ SOCK_Dgram.cpp
++ SOCK_Dgram_Bcast.cpp
++ SOCK_Dgram_Mcast.cpp
++ SOCK_IO.cpp
++ SOCK_Netlink.cpp
++ SOCK_SEQPACK_Acceptor.cpp
++ SOCK_SEQPACK_Association.cpp
++ SOCK_SEQPACK_Connector.cpp
++ SOCK_Stream.cpp
++ SPIPE.cpp
++ SPIPE_Acceptor.cpp
++ SPIPE_Addr.cpp
++ SPIPE_Connector.cpp
++ SPIPE_Stream.cpp
++ SString.cpp
++ Stack_Trace.cpp
++ Stats.cpp
++ String_Base_Const.cpp
++ SUN_Proactor.cpp
++ SV_Message.cpp
++ SV_Message_Queue.cpp
++ SV_Semaphore_Complex.cpp
++ SV_Semaphore_Simple.cpp
++ SV_Shared_Memory.cpp
++ Svc_Conf_Lexer.cpp
++ Svc_Conf_y.cpp
++ Synch_Options.cpp
++ System_Time.cpp
++ Task.cpp
++ Thread.cpp
++ Thread_Adapter.cpp
++ Thread_Control.cpp
++ Thread_Exit.cpp
++ Thread_Hook.cpp
++ Thread_Manager.cpp
++ Thread_Mutex.cpp
++ Thread_Semaphore.cpp
++ Throughput_Stats.cpp
++ Time_Policy.cpp
++ Time_Value.cpp
++ Timeprobe.cpp
++ TLI.cpp
++ TLI_Acceptor.cpp
++ TLI_Connector.cpp
++ TLI_Stream.cpp
++ Token.cpp
++ Token_Collection.cpp
++ Token_Invariants.cpp
++ Token_Manager.cpp
++ Token_Request_Reply.cpp
++ TP_Reactor.cpp
++ Trace.cpp
++ TSS_Adapter.cpp
++ TTY_IO.cpp
++ UNIX_Addr.cpp
++ UPIPE_Acceptor.cpp
++ UPIPE_Connector.cpp
++ UPIPE_Stream.cpp
++ UTF16_Encoding_Converter.cpp
++ UTF32_Encoding_Converter.cpp
++ UTF8_Encoding_Converter.cpp
++ UUID.cpp
++ WFMO_Reactor.cpp
++ WIN32_Asynch_IO.cpp
++ WIN32_Proactor.cpp
++ XML_Svc_Conf.cpp
++ XTI_ATM_Mcast.cpp
++)
++
++include_directories(
++ ${CMAKE_SOURCE_DIR}/dep/acelite
++ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders
++ ${CMAKE_SOURCE_DIR}/dep/zlib
++)
++
++# Needed for PCH support
++set_source_files_properties(Atomic_Op_Sparc.c Rtems_init.c PROPERTIES LANGUAGE CXX)
++
++add_definitions(-DACE_BUILD_DLL)
++
++add_library(ace SHARED ${ace_STAT_SRCS})
++
++add_native_precompiled_header(ace ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/WinAcePCH)
++
++install(TARGETS ace RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")
+diff --git a/dep/acelite/ace/PrecompiledHeaders/WinAcePCH.cpp b/dep/acelite/ace/PrecompiledHeaders/WinAcePCH.cpp
+new file mode 100644
+index 0000000..139597f
+--- /dev/null
++++ b/dep/acelite/ace/PrecompiledHeaders/WinAcePCH.cpp
+@@ -0,0 +1,2 @@
++
++
+diff --git a/dep/acelite/ace/PrecompiledHeaders/WinAcePCH.h b/dep/acelite/ace/PrecompiledHeaders/WinAcePCH.h
+new file mode 100644
+index 0000000..6ff97bf
+--- /dev/null
++++ b/dep/acelite/ace/PrecompiledHeaders/WinAcePCH.h
+@@ -0,0 +1,17 @@
++
++#ifndef WIN_ACE_PCH
++#define WIN_ACE_PCH
++
++#include "ace/ACE.h"
++
++#include "ace/Synch_Traits.h"
++#include "ace/Svc_Handler.h"
++#include "ace/SOCK_Stream.h"
++#include "ace/SOCK_Acceptor.h"
++#include "ace/Acceptor.h"
++#include "ace/Thread_Mutex.h"
++#include "ace/Guard_T.h"
++#include "ace/Unbounded_Queue.h"
++#include "ace/Message_Block.h"
++
++#endif
+diff --git a/dep/acelite/ace/config-macros.h b/dep/acelite/ace/config-macros.h
+index f18c8e0..32e5894 100644
+--- a/dep/acelite/ace/config-macros.h
++++ b/dep/acelite/ace/config-macros.h
+@@ -21,7 +21,11 @@
+ #ifndef ACE_CONFIG_MACROS_H
+ #define ACE_CONFIG_MACROS_H
+
+-#include "ace/config.h"
++#ifdef _WIN32
++ #include "ace/config-win32.h"
++#else
++ #include "ace/config.h"
++#endif
+
+ #include "ace/Version.h"
+ #include "ace/Versioned_Namespace.h"
+diff --git a/dep/acelite/ace/config-win32-common.h b/dep/acelite/ace/config-win32-common.h
+index 50645a1..098ddbd 100644
+--- a/dep/acelite/ace/config-win32-common.h
++++ b/dep/acelite/ace/config-win32-common.h
+@@ -527,9 +527,9 @@
+ # else
+ # pragma comment(lib, "ws2_32.lib")
+ # pragma comment(lib, "mswsock.lib")
+-# if defined (ACE_HAS_IPV6)
++// # if defined (ACE_HAS_IPV6)
+ # pragma comment(lib, "iphlpapi.lib")
+-# endif
++// # endif
+ # endif /* ACE_HAS_WINCE */
+ # endif /* _MSC_VER */
+
diff --git a/dep/acelite/COPYING b/dep/acelite/COPYING
index 551231de6cf..226708461b9 100644
--- a/dep/acelite/COPYING
+++ b/dep/acelite/COPYING
@@ -8,7 +8,7 @@
(henceforth referred to as "DOC software") are copyrighted by
[5]Douglas C. Schmidt and his [6]research group at [7]Washington
University, [8]University of California, Irvine, and [9]Vanderbilt
- University, Copyright (c) 1993-2009, all rights reserved. Since DOC
+ University, Copyright (c) 1993-2012, all rights reserved. Since DOC
software is open-source, freely available software, you are free to
use, modify, copy, and distribute--perpetually and irrevocably--the
DOC software source code and object code produced from the source, as
diff --git a/dep/acelite/ChangeLog b/dep/acelite/ChangeLog
index ec8c3ded3c5..7381bdcca07 100644
--- a/dep/acelite/ChangeLog
+++ b/dep/acelite/ChangeLog
@@ -1,3017 +1,2587 @@
-Wed Oct 27 12:01:05 CEST 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Aug 29 08:16:04 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ACE version 5.8.3 released.
+ * ACE version 6.1.4 released.
-Tue Oct 26 11:21:35 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Aug 27 20:38:00 UTC 2012 Steve Huston <shuston@riverace.com>
- * bin/diff-builds-and-group-fixed-tests-only.sh:
- Fixed DANCE_ROOT, could cause problems with the test stats email
-
-Mon Oct 25 21:01:02 UTC 2010 Olli Savia <ops@iki.fi>
-
- * NEWS:
- Updated.
-
-Mon Oct 25 14:07:15 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+ * include/makeinclude/platform_linux.GNU: Make CC and CXX setting
+ conditional again. Conditional behavior is relied upon by users.
+ Reverts the following:
+ Tue Mar 1 11:31:55 UTC 2011 Olli Savia <ops@iki.fi>
- * ace/Service_Gestalt.cpp:
- Another fix to error processing behavior. If the result of
- process_directives() was > 0, that value was replaced by the
- result of process_commandline_directives(), which is contrary to
- the expected behavior. Now the result is the sum of these to
- return values, unless either returns -1, then the result is just
- -1.
+Mon Aug 27 09:43:43 UTC 2012 johnny <jwillemsen@remedy.nl>
-Mon Oct 25 06:30:35 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * apps/JAWS/clients/WebSTONE/src/config.cache:
+ * apps/JAWS/clients/WebSTONE/src/config.log:
+ * apps/JAWS/clients/WebSTONE/src/config.status:
+ Removed these files, generated by configure and
+ shouldn't be stored in the repository
- * ace/Atomic_Op_T.h:
- * ace/Auto_IncDec_T.h:
- Doxygen changes
+Fri Aug 24 10:27:22 UTC 2012 johnny <jwillemsen@remedy.nl>
-Sun Oct 24 12:35:28 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * examples/APG/Streams/CommandModule.h:
+ * tests/Service_Config_Stream_Test.cpp:
+ Add ACE_System_Time_Policy as second template argument
+ to ACE_Module, the default template argument doesn't
+ work with clang which seems to be a bug in that
+ compiler
- * ace/Event_Handler.h:
- * ace/Reactor.h:
- * ace/Reactor_Notification_Strategy.h:
- * ace/Read_Buffer.h:
- * ace/Registry_Name_Space.h:
- * ace/Remote_Tokens.h:
- Doxygen changes
+Thu Aug 23 12:33:35 UTC 2012 johnny <johnny@>
-Fri Oct 22 11:19:33 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Condition_Attributes.inl:
+ * ace/config-hpux-11.00.h:
+ Another fix for hpux ia64 v3
- * ace/Reactor.h:
- Doxygen changes
+Thu Aug 23 06:35:20 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Thu Oct 21 11:10:56 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Condition_Attributes.inl:
+ Only check for ACE_LACKS_MONOTONIC_TIME
- * ace/ACE.cpp:
- * ace/FILE_IO.h:
- * ace/Free_List.h:
- * ace/Handle_Set.h:
- * ace/Log_Msg.h:
- * ace/WIN32_Asynch_IO.h:
- Doxygen changes
+ * ace/Monotonic_Time_Policy.inl:
+ Layout change
-Wed Oct 20 18:19:51 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/config-hpux-11.00.h:
+ Added ACE_LACKS_MONOTONIC_TIME
- * bin/fuzz.pl:
- If we just see dollarIddollar we trigger an error, svn:keywords is
- than lacking
+Wed Aug 22 11:50:22 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Oct 20 16:07:09 UTC 2010 Steve Huston <shuston@riverace.com>
+ * ace/config-win32-common.h:
+ Added ACE_LACKS_CLOCK_MONOTONIC and
+ ACE_LACKS_CLOCK_REALTIME
- * ace/Timer_Queue_Adapters.cpp (ACE_Thread_Timer_Queue_Adapter::svc):
- * ace/Timer_Queue_T.cpp (expire):
- Temporarily release and reacquire the mutex around timer dispatch.
- This prevents a deadlock on user code with multiple threads doing
- timer-related operations.
+Wed Aug 22 06:13:12 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Oct 20 09:22:46 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/os_include/sys/os_time.h:
+ Fixed incorrect check in this file
- * bin/MakeProjectCreator/config/global.features:
- Add nddsmonitor as default to 0
+Tue Aug 21 16:55:13 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Oct 20 09:19:25 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/os_include/sys/os_time.h:
+ Introduced new ACE_LACKS_CLOCKID_T which is used to determine whether
+ we need to define clockid_t in ACE. Moved CLOCK_MONOTONIC and
+ CLOCK_REALTIME to file below
- * ace/Log_Msg.h:
+ * ace/os_include/sys/os_types.h:
+ Added CLOCK_MONOTONIC and CLOCK_REALTIME here and introduced new
+ ACE_LACKS_CLOCK_REALTIME and ACE_LACKS_CLOCK_MONOTONIC because on
+ for example HPUX CLOCK_REALTIME is not a define but part of an enum
- * bin/MakeProjectCreator/config/global.features:
+ * ace/config-win32-common.h:
+ Added ACE_LACKS_CLOCKID_T
- * tests/Time_Value_Test.cpp:
+Tue Aug 21 14:38:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
-Tue Oct 19 18:11:57 UTC 2010 Olli Savia <ops@iki.fi>
+ * protocols/ace/INet/SSL_CallbackManager.h:
+ Spelling in comment.
- * ace/Caching_Utility_T.cpp:
- Added missing include.
+Tue Aug 21 12:25:45 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
-Tue Oct 19 09:44:45 UTC 2010 Olli Savia <ops@iki.fi>
+ * ace/SSL/SSL_Context.h:
+ * ace/SSL/SSL_Context.inl:
- * ace/Caching_Utility_T.cpp:
- Use ACE::is_equal() to compare floating point values.
+ Solaris studio compilers amongst others were issuing warnings due to an
+ incorrect type of function pointer (i.e. not extern "C", but standard
+ C++ type) being stored/used of the form:
-Fri Oct 15 10:18:05 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Warning (Anachronism): Formal argument callback of type
+ extern "C" int(*)(int,x509_store_ctx_st*)
+ in call to
+ SSL_CTX_set_verify(ssl_ctx_st*, int, extern "C" int(*)(int,x509_store_ctx_st*))
+ is being passed
+ int(*)(int,x509_store_ctx_st*)
- * tests/Bug_3911_Regression_Test.cpp:
- Fixed warning
+ when the C++ code was providing callback functions to certain C system SSL
+ library calls.
-Thu Oct 14 18:29:35 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Unfortunatly you cannot specify extern "C" linkage anywhere inside a
+ class declaration or inside a function prototype for individual
+ parameters. I.e:
- * tests/run_test.lst:
- * tests/tests.mpc:
- 3911 doesn't work with ace_for_tao
+ class { extern "C" int (*callback_) (int, void *); };
-Thu Oct 14 13:15:00 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ to store an extern "C" function pointer as a data member of the
+ class is illegal, as is:
- * ace/Process.h:
- * ace/Process.cpp:
- Changes to allow to dynamically define the max. number of cmdline args.
- The tao_idl compiler was running out of room in certain instances and
- the static max was very conservative.
+ void function (extern "C" int (*callback) (int, void *);
-Thu Oct 14 09:38:00 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ to declare a function (or a class member) that takes a extern "C"
+ function pointer as a parameter.
- * tests/Bug_3911_Regression_Test.cpp:
- Wchar build fixes.
+ Since we need to specify an extern "C" function pointer as a parameter
+ to be stored in the class and handled by member functions, we are forced
+ to declare a typedef of that extern "C" function pointer outside of the
+ class that we can then use. Unfortunatly you also are not allowed to
+ simply add the extern "C" to the typedef itself, like this:
-Wed Oct 13 08:24:00 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ typedef extern "C" int (*extern_C_callback_t) (int, void *);
- * tests/Bug_3911_Regression_Test.cpp:
- Wchar build fixes.
+ instead you have to place the typedef declaration inside an extern "C"
+ block, thus:
-Wed Oct 13 06:15:00 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ extern "C" {
+ typedef int (*extern_C_callback_t) (int, void *);
+ }
- * ace/Framework_Component.h:
- * ace/Framework_Component.inl:
- * ace/Framework_Component.cpp:
- * ace/Framework_Component_T.h:
- Use ACE_Copy_Disabled, change c-style cast to const cast, use
- sync macros instead of ACE_MT. Thanks to Ranjit Hande
- <hande at avaya dot com> for reporting the c-style cast warnings
+ This then results in the correct call type associated with the
+ function pointer which may then be used inside the function and
+ class declarations to remove these warnings and possiable incorrect
+ call methods undertaken via the STL C functions. A lot of different
+ compilers ignore extern "C" where it is not allowed, the only way
+ I have found to be universally understood is as stated above.
- * tests/Framework_Component_Test.h:
- Layout change
+ * protocols/ace/INet/SSL_CallbackManager.h:
+ * protocols/ace/INet/SSL_CallbackManager.cpp:
-Tue Oct 12 21:12:51 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ Similar problems and interfacing to the changed calling type of the above
+ extern "C" function pointers. NOTE: just declaring a static function for
+ the class is NOT sufficient to obtain the correct extern "C" calling type.
+ We are therefore forced to declare friend functions external to the class
+ (as again we cannot have a extern "C" declaration inside a class even for
+ a static method) to do this job. Since these are extern "C" functions they
+ also of course cannot be overloaded, i.e. they are required to be unique
+ names. They also cannot be non-class static functions to make them private
+ to the cpp file as they need to actually be seen by the class declaration
+ to be made friends and therefore have to be included in the header file.
- * bin/DependencyGenerator/GNUObjectGenerator.pm:
+Tue Aug 21 12:20:43 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- Fixed incorrect Perl regex escaping from my previous commit.
+ * ace/os_include/sys/os_types.h:
+ Fixed HPUX problem
-Tue Oct 12 11:41:00 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Tue Aug 21 02:45:07 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
- * tests/Bug_3911_Regression_Test.cpp:
- Fuzz fixes.
+ * ace/config-macosx-leopard.h:
+ setclock not supported on current macs.
-Tue Oct 12 08:06:00 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Mon Aug 20 18:07:25 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * tests/Bug_3911_Regression_Test.cpp:
- * tests/run_test.lst:
- * tests/tests.mpc:
- Added reproducer test for Bugzilla #3911.
-
-Mon Oct 11 16:31:12 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ * ace/Global_Macros.h:
+ Doxyen fixes
- * bin/DependencyGenerator/GNUObjectGenerator.pm:
+ * bin/valgrind.supp:
+ Added another needed suppression
- If the source file contains '../', remove the directory part from
- the name of the object file (see gnu.mpd:383 OBJS make variable).
+Mon Aug 20 10:03:23 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Mon Oct 11 11:53:43 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * docs/ACE-monotonic-timer.html:
+ Fixed fuzz
- * ace/Dev_Poll_Reactor.cpp:
- * ace/Select_Reactor_T.cpp:
- Fixed problems with threads=0, thanks to Elez <elezsh at gmail dot com>
- for reporting this and providing a patch
+Mon Aug 20 09:03:22 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Oct 8 11:19:44 UTC 2010 Olli Savia <ops@iki.fi>
+ * ace/Module.cpp:
+ Fixed possible memory leak and dead code, uncovered by Coverity scan
- * protocols/ace/RMCast/Flow.cpp:
- Added missing include.
+Mon Aug 20 08:36:46 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Oct 8 08:42:37 UTC 2010 Olli Savia <ops@iki.fi>
+ * docs/ACE-monotonic-timer.html:
+ New document describing the ACE monotonic timer support for conditions,
+ message queues and tasks
- * ace/config-linux-common.h:
- * ace/os_include/os_unistd.h:
- * configure.ac:
- * m4/config_h.m4:
- Removed references to ACE_LACKS_PREAD_PROTOTYPE. It is no
- longer used.
+ * docs/index.html:
+ Added new page, removed link to site that doesn't work anymore
-Fri Oct 8 08:20:04 UTC 2010 Olli Savia <ops@iki.fi>
+Mon Aug 20 08:21:00 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/OS_NS_stdio.inl:
- * ace/README:
- * tests/OS_Test.cpp:
- Removed references to ACE_LACKS_RENAME. It is no
- longer used.
+ * ace/os_include/sys/os_types.h:
+ Define CLOCK_MONOTONIC to 1 when it is not defined, should fix
+ hpux problems
-Fri Oct 8 07:51:46 UTC 2010 Olli Savia <ops@iki.fi>
+Mon Aug 20 07:57:53 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/config-integritySCA.h:
- Removed references to ACE_LACKS_IPC_H. It is no
- longer used.
+ * ace/Condition_Attributes.h:
+ * ace/Condition_Attributes.inl:
+ Added accessor for attributes and removed friend declaration,
+ that hopefully fixes the Sun Studio 11 problems
-Fri Oct 8 07:48:38 UTC 2010 Olli Savia <ops@iki.fi>
+ * ace/Condition_Recursive_Thread_Mutex.cpp:
+ * ace/Condition_T.cpp:
+ * ace/Condition_Thread_Mutex.cpp:
+ Use accessor of the attributes.
- * ace/README:
- Removed references to ACE_LACKS_IOSTREAMS_TOTALLY. It is no
- longer used.
+Sat Aug 18 19:25:38 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/os_include/os_stropts.h:
- Fixed typo.
+ * ace/Null_Condition.h:
+ Fix for single threaded builds
-Fri Oct 8 07:42:26 UTC 2010 Olli Savia <ops@iki.fi>
+Sat Aug 18 19:23:21 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/OS_NS_stdio.h:
- * ace/OS_NS_stdio.inl:
- * ace/README:
- * ace/Svc_Conf_Lexer.cpp:
- Removed references to ACE_LACKS_CLEARERR. It is no
- longer used.
+ * ace/Condition_Attributes.h:
+ Added forward declaration, maybe this fixes solaris 9
-Fri Oct 8 06:58:56 UTC 2010 Olli Savia <ops@iki.fi>
+Fri Aug 17 18:05:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * protocols/ace/RMCast/Flow.cpp:
- * tests/CDR_Array_Test.cpp:
- * tests/CDR_File_Test.cpp:
- * tests/CDR_Test.cpp:
- * tests/Upgradable_RW_Test.cpp:
- Use ACE::is_equal() to compare floating point values.
+ * ace/OS_NS_Thread.inl:
+ Attempt to fix clang warning
-Thu Oct 7 12:34:20 UTC 2010 Olli Savia <ops@iki.fi>
+Fri Aug 17 13:38:05 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * ASNMP/tests/Counter64_Test.cpp:
- * ace/ETCL/ETCL_Constraint.cpp:
- * ace/Monitor_Control/CPU_Load_Monitor.cpp:
- Use ACE::is_equal() to compare floating point values.
+ * ace/Condition_Recursive_Thread_Mutex.h:
+ * ace/Condition_Thread_Mutex.h:
+ * ace/Null_Condition.h:
+ * ace/Synch_Traits.h:
+ Changes to attempt to fix Solaris9 SUNStudio11 problems.
-Tue Oct 5 07:23:19 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Aug 17 12:28:32 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * ACE-INSTALL.html:
- * COPYING:
- Small updates
+ * ace/config-hpux-11.00.h:
+ * ace/config-linux.h:
+ Fixes (hopefully) for non-compliant POSIX platforms.
- * docs/ACE-porting.html:
- Updated links
+Fri Aug 17 11:19:01 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * include/makeinclude/wrapper_macros.GNU:
- Added support for valgrind=1
+ * tests/Monotonic_Message_Queue_Test.cpp:
+ * tests/Monotonic_Task_Test.cpp:
+ Added include files because of compile errors in certain
+ builds.
-Mon Oct 4 19:55:33 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+Fri Aug 17 09:04:50 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * bin/make_release.py:
+ * ace/Message_Queue_T.h:
+ * ace/Message_Queue_T.cpp:
+ * ace/Stream.h:
+ * ace/Stream.cpp:
+ * tests/Bug_4055_Regression_Test.cpp:
+ * tests/Monotonic_Task_Test.cpp:
+ Fixed compile errors for a bunch of crappy compilers
+ like the one on RHEL53 and AIX.
- Updates.
+Thu Aug 16 18:47:59 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Mon Oct 4 12:32:02 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/ace.mpc:
+ * ace/ace_for_tao.mpc:
+ List Time_Value_T files
- * ace/LSOCK_Stream.h:
- Doxygen changes
+Thu Aug 16 13:43:39 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * ace/Makefile.am:
- Removed zapped file
+ * ace/Message_Queue_T.cpp:
+ * ace/Stream.cpp:
+ * ace/Thread_Manager.cpp:
+ * tests/Bug_4055_Regression_Test.cpp:
+ Fixed problems with single threaded builds.
- * include/makeinclude/platform_sunos5_sunc++.GNU:
- Removed SUN_CC_HAS_PVFC_BUG, this got added 8 years ago and is
- used for any SunCC compiler version. If some old SunCC compiler breaks
- we can readd this flag for just that compiler version
+Thu Aug 16 12:44:05 UTC 2012 Martin Corino <mcorino@remedy.nl>
-Fri Oct 1 16:00:51 UTC 2010 William Otte <wotte@zifnab>
+ * ace/Task_T.inl:
+ * ace/Time_Policy_T.inl:
+ Fuzz fixes.
- * COPYING:
+Thu Aug 16 09:43:00 UTC 2012 Simon Massey <sma at prismtech dot com>
- Updated to include DAnCE.
+ * test/Bug_3943_Regression_Test.cpp:
-Fri Oct 1 11:55:23 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Another cast required to remove warning.
- * ace/config-g++-common.h:
- * ace/config-qnx-neutrino.h:
- * ace/config-qnx-rtp-common.h:
- Fixed redefinition warnings
+Thu Aug 16 09:22:31 UTC 2012 Martin Corino <mcorino@remedy.nl>
+ * ace/Condition_Attributes.h:
+ * ace/Condition_Attributes.inl:
+ * ace/Condition_Attributes.cpp:
+ * ace/Condition_Recursive_Thread_Mutex.h:
+ * ace/Condition_Recursive_Thread_Mutex.cpp:
+ * ace/Condition_T.h:
+ * ace/Condition_T.cpp:
+ * ace/Condition_Thread_Mutex.h:
+ * ace/Condition_Thread_Mutex.inl:
+ * ace/Condition_Thread_Mutex.cpp:
+ * ace/Message_Queue.h:
+ * ace/Message_Queue_T.h:
+ * ace/Message_Queue_T.cpp:
+ * ace/Module.h:
+ * ace/Module.inl:
+ * ace/Module.cpp:
+ * ace/Monotonic_Time_Policy.h:
+ * ace/Monotonic_Time_Policy.inl:
+ * ace/Monotonic_Time_Policy.cpp:
+ * ace/Null_Condition.h:
+ * ace/OS_NS_Thread.h:
+ * ace/OS_NS_Thread.inl:
+ * ace/OS_NS_Thread.cpp:
+ * ace/Stream.h:
+ * ace/Stream.inl:
+ * ace/Stream.cpp:
+ * ace/Stream_Modules.h:
+ * ace/Stream_Modules.cpp:
+ * ace/Synch_Traits.h:
+ * ace/Task_Ex_T.h:
+ * ace/Task_Ex_T.inl:
+ * ace/Task_Ex_T.cpp:
+ * ace/Task_T.h:
+ * ace/Task_T.inl:
+ * ace/Task_T.cpp:
+ * ace/Thread_Manager.h:
+ * ace/Thread_Manager.cpp:
+ * ace/Thread_Mutex.h:
+ * ace/Time_Policy.h:
+ * ace/Time_Policy.inl:
+ * ace/Time_Policy.cpp:
+ * ace/Time_Policy_T.h:
+ * ace/Time_Policy_T.inl:
+ * ace/Time_Policy_T.cpp:
+ * ace/Time_Value.h:
+ * ace/Time_Value.cpp:
+ * ace/Time_Value_T.h:
+ * ace/Time_Value_T.inl:
+ * ace/Time_Value_T.cpp:
+ * ace/ace.mpc:
* ace/ace_for_tao.mpc:
- Zapped some files
-
- * ace/config-win32-common.h:
- * ace/config-win32-msvc.h:
- * ace/config-win32.h:
- Cleanup
-
- * ace/config-win32-ghs.h:
- Removed this file.
-
-Thu Sep 30 10:49:38 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/mpc-ace.install:
- Improved
-
- * docs/bczar/bczar.html:
- Added DAnCE to doxygen instructions
+ Added a Monotonic time policy and a Time_Value template
+ supporting time policies. Refactored OS_NS_Thread time
+ calculations to use new time policy aware functionality
+ of time values. Added support for monotonic timers with
+ condition variables in message queues, tasks and related
+ classes. See NEWS file and new regression tests for more
+ details.
+ Full backward compatibility is maintained.
+
+ * tests/Bug_4055_Regression_Test.cpp:
+ Updated to fixed state.
+
+ * tests/Monotonic_Message_Queue_Test.cpp:
+ * tests/Monotonic_Task_Test.cpp:
+ * tests/run_test.lst:
+ * tests/tests.mpc:
+ Added new monotonic timer regression tests.
-Thu Sep 30 08:09:34 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * NEWS:
+ Added detailed update descriptions.
- * ace/IOStream.h:
- * ace/config-g++-common.h:
- * ace/config-hpux-11.00.h:
- * ace/config-linux-common.h:
- * ace/config-mvs.h:
- * ace/config-sunos5.5.h:
- * ace/config-win32-borland.h:
- * ace/config-win32-cegcc.h:
- * ace/config-win32-dmc.h:
- * ace/config-win32-ghs.h:
- * ace/config-win32-mingw.h:
- * ace/config-win32-msvc.h:
- Cleanup, move g++ version defines to config-g++-common.h
+Thu Aug 16 09:24:00 UTC 2012 Simon Massey <sma at prismtech dot com>
-Thu Sep 30 05:45:10 UTC 2010 Marcel Smit <msmit@remedy.nl>
+ * bin/PerlACE/Process_Win32.pm:
+ * bin/PerlACE/ProcessVX_Win32.pm:
- * NEWS:
- * ace/Cache_Map_Manager_T.h:
- * ace/Cache_Map_Manager_T.inl:
- * ace/Cache_Map_Manager_T.cpp:
- * ace/Cached_Connect_Strategy_T.h:
- * ace/Cached_Connect_Strategy_T.cpp:
- * ace/Caching_Strategies_T.h:
- * ace/Caching_Utility_T.cpp:
- * ace/Cleanup_Strategies_T.cpp:
- * ace/Hash_Cache_Map_Manager_T.h:
- * ace/Hash_Cache_Map_Manager_T.cpp:
- * ace/Map_T.h:
- * ace/Map_T.inl:
- * ace/Map_T.cpp:
- * ace/Pair_T.h:
- * ace/Pair_T.inl:
- * examples/Web_Crawler/URL_Visitor.h:
- * tests/Cache_Map_Manager_Test.cpp:
- * tests/Cached_Accept_Conn_Test.h:
- * tests/Cached_Conn_Test.cpp:
- * tests/Map_Manager_Test.cpp:
- Removed ACE_Pair from the ACE library.
+ If we wait for a process to exit, and it does, set the RUNNING status to false.
-Wed Sep 29 14:06:40 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu Aug 16 08:26:12 UTC 2012 Olli Savia <ops@iki.fi>
- * ace/Cache_Map_Manager_T.h:
- * ace/MEM_SAP.h:
- * ace/Metrics_Cache_T.h:
- * ace/Metrics_Cache_T.inl:
- * ace/Metrics_Cache_T.cpp:
- Doxygen changes
+ * tests/tests.mpc:
+ Bug_4055_Regression_Test uses threads.
-Wed Sep 29 12:19:17 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Aug 15 14:10:00 UTC 2012 Simon Massey <sma at prismtech dot com>
- * ace/Caching_Utility_T.h:
- * ace/Caching_Utility_T.cpp:
- Use bool and ACE_Copy_Disabled
+ * test/Bug_3911_Regression_Test.cpp:
+ * test/Bug_3943_Regression_Test.cpp:
- * ace/Malloc_Base.h:
- * ace/Malloc_T.h:
- Typo fixes
+ Some compilers warning against ordering pointers with integers.
-Wed Sep 29 12:08:58 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl>
+Wed Aug 15 11:42:28 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/MakeProjectCreator/config/global.features:
- Add ccm_noevent option, default 0, events in CCM are enabled.
- If set, events in CCM are disabled.
+ * include/makeinclude/platform_linux_clang.GNU:
+ Support for c++0x flag
-Tue Sep 28 18:48:58 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Aug 15 11:29:48 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * apps/JAWS3/jaws3-todo:
- Removed, todo for years now
+ * include/makeinclude/platform_clang_common.GNU:
+ Support for c++0x flag
-Tue Sep 28 18:16:52 UTC 2010 Adam Mitz <mitza@ociweb.com>
+Tue Aug 14 22:22:05 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * performance-tests/TCP/tcp_test.cpp:
+ * ace/config-vxworks6.8.h:
- If the 1st char of the host name is a digit, need to set the IP
- address and port as network byte order since that is what's
- returned from ACE_OS::inet_addr().
+ When building for VxWorks kernel mode, define ACE_LACKS_STD_WSTRING.
-Tue Sep 28 11:34:05 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue Aug 14 06:35:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Asynch_Connector.cpp:
- * ace/Barrier.h:
- * ace/Barrier.cpp:
- * ace/Condition_Thread_Mutex.h:
- * ace/Condition_Thread_Mutex.inl:
- * ace/Containers_T.cpp:
- * ace/Functor.h:
- * ace/Functor.inl:
- * ace/IO_Cntl_Msg.cpp:
- * ace/Intrusive_List.cpp:
- * ace/Local_Tokens.inl:
- * ace/MEM_IO.cpp:
- * ace/MEM_Stream.h:
- * ace/MEM_Stream.inl:
- * ace/Malloc_T.inl:
- * ace/OS_NS_Thread.inl:
- * ace/OS_NS_string.inl:
- * ace/Object_Manager_Base.cpp:
- * ace/POSIX_Proactor.cpp:
- * ace/Ping_Socket.cpp:
- * ace/Signal.inl:
- * ace/Throughput_Stats.h:
- * ace/Throughput_Stats.cpp:
- * ace/Time_Value.cpp:
- * ace/Timer_Hash_T.cpp:
- * ace/Timer_Heap_T.cpp:
- * ace/Vector_T.h:
- * ace/Vector_T.cpp:
- * ace/config-linux-common.h:
- Removed code that was ifdefed out for years now
+ * bin/valgrind.supp:
+ Extended suppression list
-Tue Sep 28 08:31:37 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+Thu Aug 9 07:03:10 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * performance-tests/Misc/test_guard.cpp:
- * tests/ACE_Test.cpp:
- * examples/Reactor/TP_Reactor/client.cpp:
- Fixed compilation errors with missing includes.
+ * docs/bczar/bczar.html:
+ Added packages
-Mon Sep 27 18:04:34 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * include/makeinclude/platform_g++_common.GNU:
+ Use -Wno-deprecated with C++11 due to the heavy usage of auto_ptr
- * ace/ACE.h:
- * ace/Thread.h:
- * ace/Thread_Adapter.h:
- * ace/Thread_Mutex.h:
- Doxygen changes
+ * tests/randomize.h:
+ Doxygen fix
-Mon Sep 27 14:47:47 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Aug 8 22:13:55 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * ace/String_Base.h:
- Doxygen changes
+ * ace/ACE.cpp:
+ * ace/ACE_crc_ccitt.cpp:
+ * ace/Basic_Types.h:
+ * ace/Configuration_Import_Export.cpp:
+ * ace/Handle_Set.inl:
+ * ace/INET_Addr.inl:
+ * ace/Message_Queue_Vx.inl:
+ * ace/Name_Request_Reply.cpp:
+ * ace/OS_NS_stdlib.cpp:
+ * ace/OS_NS_unistd.inl:
+ * ace/Select_Reactor_T.inl:
+ * ace/Service_Config.cpp:
+ * ace/Stack_Trace.cpp:
+ * ace/UUID.cpp:
+ * ace/config-vxworks6.9.h:
+ * include/makeinclude/platform_vxworks6.8.GNU:
+ * include/makeinclude/platform_vxworks6.9.GNU:
- * ace/Svc_Conf_Lexer.cpp:
- Const changes
+ Enable compiling for 64-bit VxWorks 6.9 (x86 RTP static).
- * bin/msvc_static_order.lst:
- Some updates, but this list is very outdated
+Wed Aug 8 15:30:00 UTC 2012 Simon Massey <sma at prismtech dot com>
-Mon Sep 27 14:27:25 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+ * ace/config-linux.h:
- * THANKS:
+ According to man pages Linux uses different (compared to UNIX systems) types
+ for setting IP_MULTICAST_TTL and IPV6_MULTICAST_LOOP / IP_MULTICAST_LOOP
+ in setsockopt/getsockopt.
+ In the current (circa 2012) kernel source however there is an explicit check
+ for IPV6_MULTICAST_LOOP being sizeof(int). Anything else is rejected so it must
+ not be a passed a bool, irrespective of what the man pages (still) say.
+ i.e. #define ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL 1 is wrong.
- Added Matthew Waller <matthewrwaller at gmail dot com>
+ * ace/SOCK_Dgram_Mcast.h:
+ * ace/SOCK_Dgram_Mcast.inl:
-Mon Sep 27 14:08:11 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ Override read/write acessor for the constructor options
+ This class is typically default instantiated in a connection handler templated
+ framework so these cannot be specified on construction.
- * ace/Log_Msg.h:
- * ace/Log_Msg.cpp:
- Fixed compilation with ACE_HAS_DUMP. The later happens because
- ACE_Log_Msg depends on ACE_Atomic_Op and ACE_Atomic_Op needs
- ACE_DEBUG when ACE_HAS_DUMP is defined. This change moves
- include of ace/Atomic_Op.h from header to CPP file and adds
- forward declaration for ACE_Atomic_Op.
+Mon Aug 6 20:54:17 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * ace/Atomic_Op_T.cpp:
- * ace/Guard_T.cpp:
- Removed unnecessary this paramater when doing ACE_END_DUMP.
+ * bin/PerlACE/TestTarget.pm:
- * examples/Misc/test_dump.h:
- * examples/Threads/thread_specific.cpp:
- Fixed logging in these tests.
+ Updated fix from Fri Jul 20 17:37:27 UTC 2012 to work when
+ one of source or destination is a relative path and other is not.
-Mon Sep 27 11:24:02 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+Sat Jul 28 19:22:06 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * examples/C++NPv2/AIO_Client_Logging_Daemon.h:
- Another attempt to fix compile error.
+ * bin/make_release.py:
+ Fixed exclude
-Mon Sep 27 09:42:29 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Jul 27 10:55:51 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/fuzz.pl:
- Enable export file check, use TAO_IDL to generate export files or
- remove the generated by line from the export file itself. Currently
- only for CIAO and DAnCE
+ * etc/ace.doxygen:
+ * etc/ace_inet.doxygen:
+ * etc/ace_qos.doxygen:
+ * etc/ace_rmcast.doxygen:
+ * etc/ace_ssl.doxygen:
+ * etc/acexml.doxygen:
+ Generate UML diagrams, assume stl is buildin
-Sat Sep 25 06:41:39 UTC 2010 Olli Savia <ops@iki.fi>
+Fri Jul 27 08:57:07 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/ACE.h:
- Modified ACE::is_equal() comment once again to make fuzz happy.
+ * etc/ace.doxygen:
+ * etc/ace_inet.doxygen:
+ * etc/ace_qos.doxygen:
+ * etc/ace_rmcast.doxygen:
+ * etc/ace_ssl.doxygen:
+ * etc/acexml.doxygen:
+ Upgraded with doxygen -u
-Fri Sep 24 14:52:44 UTC 2010 Steve Huston <shuston@riverace.com>
+Thu Jul 26 16:22:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Pipe.{h inl cpp}: Added two new methods, close_read() and
- close_write() to close individual pipe handles. Refactored the
- original close() method to use these and factored out the actual
- closing code to a new inlined close_handle() method.
+ * bin/make_release.py:
+ * docs/bczar/bczar.html:
+ Improved instructions
- Thanks to John Lilley <jlilley at datalever dot com> for this
- addition.
+Thu Jul 26 14:40:45 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * NEWS: Added description of the new methods.
+ * docs/bczar/bczar.html:
+ Set all environment variables explicitly before running the doxygen
+ script
-Fri Sep 24 12:41:13 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu Jul 26 10:19:34 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ACE-INSTALL.html:
- Updated Remedy platforms
-
- * ACEXML/parser/parser/Parser.h:
- * ace/Containers_T.h:
- * ace/Containers_T.cpp:
- * ace/OS_NS_string.h:
- * ace/OS_NS_wchar.h:
- * apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/shexp.h:
- Fixed typo
+ * ace/ARGV.h:
+ * ace/Arg_Shifter.h:
+ Doxygen improvements
-Fri Sep 24 12:32:44 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * rpmbuild/ace-tao.spec:
+ Removed ACE_XML_Utils, only compiled when xercesc is enabled
- * ace/Containers_T.h:
- * ace/Containers_T.cpp:
- * ace/OS_NS_string.h:
- * ace/OS_NS_wchar.h:
- Fixed typo
+Thu Jul 26 09:31:19 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Sep 24 12:24:01 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * NEWS:
+ Updated for next release
- * ACE-INSTALL.html:
- Documented vc10, thanks to Paul Carter <pcarter at scires dot com>
- for reporting this.
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ * bin/make_release.py:
+ * docs/Download.html:
+ * docs/bczar/bczar.html:
+ Updated for x.1.3 release
-Fri Sep 24 11:44:06 UTC 2010 Olli Savia <ops@iki.fi>
+ * etc/ace.doxygen:
+ * etc/ace_inet.doxygen:
+ * etc/ace_qos.doxygen:
+ * etc/ace_rmcast.doxygen:
+ * etc/ace_ssl.doxygen:
+ * etc/acexml.doxygen:
+ * etc/index.html:
+ Removed deprecated tag
- * ace/ACE.h:
- Adjusted ACE::is_equal() comment to make fuzz happy.
+Thu Jul 26 09:12:26 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Sep 24 09:35:00 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ * ACE version 6.1.3 released.
- * examples/C++NPv2/AIO_Client_Logging_Daemon.h:
- Removed code that is problematic for GCC 2.95.3 in a crossbuild
- for LynxOS 4.0.
+Fri Jul 20 17:37:27 UTC 2012 Adam Mitz <mitza@ociweb.com>
-Fri Sep 24 07:35:27 UTC 2010 Olli Savia <ops@iki.fi>
+ * ace/config-vxworks6.8.h:
+ * ace/config-vxworks6.9.h:
- * ace/ACE.h:
- Added a simple helper ACE::is_equal() which compares equality of two
- objects without using operator==. This is useful for comparing floating
- point values.
+ Changes to build for VxWorks 6.8 kernel mode.
- * tests/OS_Test.cpp:
- Use ACE::is_equal() instead of local copy.
+ * bin/PerlACE/ProcessVX_Win32.pm:
+ * tests/run_test.lst:
-Thu Sep 23 16:14:12 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ Changes for VxWorks testing.
- * ace/SSL/ssl.mpc:
- * bin/MakeProjectCreator/config/pkgconfig.mpb:
- * bin/MakeProjectCreator/templates/gnu.mpd:
- * bin/ace_install_pkgconfig.pl:
- * include/makeinclude/rules.lib.GNU:
- * include/makeinclude/wrapper_macros.GNU:
+ * bin/PerlACE/TestTarget.pm
- Added support for installing pkg-config (.pc) files as part of the
- gnuace "make install". This includes a refactoring of how the
- shared library version numbers are set internally in the makefiles.
+ Fixed a Perl bug (ne vs. !=).
-Thu Sep 23 12:32:05 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+Wed Jul 18 15:40:05 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * ace/Service_Gestalt.cpp:
- Fixed memory leak. Previously it could happen that svc_queue_ was
- allocated during processing of arguments but was not freed if
- application didn't call process_commandline_directives().
+ * Happy 50th Birthday to me!
- * tests/Network_Adapters_Test.cpp:
- Removed non-ASCII character from the comments.
+Tue Jun 26 21:47:18 UTC 2012 Adam Mitz <mitza@ociweb.com>
-Wed Sep 22 18:42:25 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+ * bin/valgrind.supp:
- * bin/msvc_mpc_auto_compile.pl:
+ Made the suppression for dlopen more generic, so that it
+ can work for different linux/glibc versions.
- Updates for DAnCE.
+Tue Jun 26 13:18:13 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Sep 22 14:17:11 UTC 2010 Marcel Smit <msmit@remedy.nl>
+ * tests/Bug_4055_Regression_Test.cpp:
+ Added commented out way to get the hr time
- * debian/Basic_Logging_Service.sgml:
- * debian/Event_Logging_Service.sgml:
- * debian/Notify_Logging_Service.sgml:
- * debian/RTEvent_Logging_Service.sgml:
- Renamed TAO orb services. See $TAO_ROOT/NEWS for details.
+Mon Jun 25 17:40:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Sep 22 14:06:25 UTC 2010 Marcel Smit <msmit@remedy.nl>
+ * tests/Bug_4055_Regression_Test.cpp:
+ * tests/run_test.lst:
+ * tests/tests.mpc:
+ Added new unit test which currently fails. The ACE condition
+ variables use an absolute timeout. If we for example wait for a
+ timeout 3 seconds in the future and the system time is changed 10
+ seconds back we are really waiting 13 seconds now. The ACE timer
+ queues have support for using a monotonic time source using the
+ time policies but this support is not available for conditions at
+ this moment. When that is added, than in the ACE threading code
+ the monotonic time source can be set on the pthread condition
+ to control that we want to use a monotonic time source.
+
+Mon Jun 25 09:31:34 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Condition_Attributes.h:
+ * ace/Condition_Attributes.inl:
+ * ace/Condition_Attributes.cpp:
+ * ace/Condition_Recursive_Thread_Mutex.h:
+ * ace/Condition_Thread_Mutex.h:
+ * ace/Condition_Thread_Mutex.inl:
+ * ace/ace.mpc:
+ * ace/ace_for_tao.mpc:
+ Moved condition attributes to its own file
- * debian/libtao-orbsvcs-1.8.2.install:
- * debian/libtao-orbsvcs-dev.install:
- * debian/tao-imr.install:
- * debian/tao-naming.install:
- * debian/tao-notify.install:
- * debian/tao-rtevent.install:
- Renamed TAO orb services. See $TAO_ROOT/NEWS for details.
+Fri Jun 22 00:30:11 UTC 2012 James H. Hill <hillj at cs dot iupui dot edu>
-Wed Sep 22 13:58:46 UTC 2010 Marcel Smit <msmit@remedy.nl>
+ * tests/CDR_Test.cpp:
- * debian/tao-concurrency.install:
- * debian/tao-event.install:
- * debian/tao-ft.install:
- * debian/tao-ifr.install:
- * debian/tao-lifecycle.install:
- * debian/tao-load.install:
- * debian/tao-log.install:
- * debian/tao-scheduling.install:
- * debian/tao-time.install:
- * debian/tao-trading.install:
- Renamed TAO orb services. See $TAO_ROOT/NEWS for details.
+ Fixed compilation warnings on CentOS 3.9 and vc9
-Tue Sep 21 08:27:47 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu Jun 21 17:08:55 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ASNMP/agent/main.cpp:
- Fixed compile error
+ * ace/DLL.h:
+ * ace/DLL_Manager.h:
+ * ace/DLL_Manager.cpp:
+ Changed the order that the ACE_DLL_Manager attempts to open a library
+ Foo so that it will try <prefix>Foo<decorator>.<suffix> before
+ Foo<decorator>.<suffix>. This makes library loading using ACE succeed
+ on the first try instead of the fourth on any platform requiring a
+ library prefix, like Linux. For platforms that don't have a prefix
+ it will also succeed on the first time. Thanks to Trent Nadeau
+ <Trent dot Nadeau at ngc dot com> for providing this improvement
-Mon Sep 20 13:24:56 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Jun 20 12:54:29 UTC 2012 James H. Hill <hillj at cs dot iupui dot edu>
- * ASNMP/agent/agent.mpc:
- * ASNMP/agent/main.cpp:
- Enable for wchar, thanks to Christian Freund <freund at wrz dot de>
- for reporting this and providing a patch, fixes bugzilla 3889
+ * tests/CDR_Test.cpp:
- * ace/String_Base.h:
- * apps/JAWS3/http/HTTP_Service_Handler.h:
- * apps/JAWS3/small/SS_Service_Handler.h:
- Fixed typo in comment
+ Fixed error in test execution.
- * ace/config-win32-borland.h:
- Some updates based on QC emails
+Mon Jun 18 20:40:29 UTC 2012 James H. Hill <hillj at cs dot iupui dot edu>
- * debian/libtao-dev.install:
- * debian/mpc-ace.install:
- Fixed paths
+ * ace/CDR_Stream.h:
+ * ace/CDR_Stream.cpp:
+ * tests/CDR_Test.cpp:
-Fri Sep 17 20:14:33 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ Extended ACE_OutputCDR placeholders to support all ACE_CDR
+ simple types.
- * ace/FlReactor/ace_flreactor.mpc:
- * ace/FoxReactor/ace_foxreactor.mpc:
- * ace/QtReactor/ace_qt3reactor.mpc:
- * ace/QtReactor/ace_qt4reactor.mpc:
- * ace/TkReactor/ace_tkreactor.mpc:
- * ace/XtReactor/ace_xtreactor.mpc:
+Mon Jun 18 13:20:32 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- Since these have been moved, the default install_dir isn't what we
- want. Set the install_dir to ace/*Reactor.
+ * bin/auto_run_tests.pl:
+ Use -z for debug mode
-Fri Sep 17 07:51:06 UTC 2010 Marcel Smit <msmit@remedy.nl>
+Mon Jun 18 06:44:11 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/fuzz.pl:
- Added Id check for cdp files.
+ * debian/*:
+ Updated with latest files from debian packaging
-Fri Sep 17 07:16:16 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu Jun 14 14:05:13 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Log_Msg.h:
- * ace/OS_Errno.cpp:
- Layout changes
+ * ace/XML_Utils/XML_Error_Handler.cpp:
+ Only print errors on cerr when we have ACE::debug enabled
- * ace/Malloc_T.h:
- * ace/Malloc_T.cpp:
- * ace/Map_Manager.inl:
- * ace/Map_Manager.cpp:
- Moved some methods inline
+Wed Jun 13 05:57:16 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/OS_NS_signal.cpp:
- Fixed problem with versioned macros
+ * docs/bczar/bczar.html:
+ Added another package
-Thu Sep 16 13:36:51 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Tue Jun 12 17:30:47 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * protocols/ace/INet/ClientRequestHandler.h:
- * protocols/ace/INet/URLBase.h:
- * protocols/ace/INet/HTTP_ClientRequestHandler.h:
- Changes to fix export problems with nested classes with MSVC 9.
+ * bin/make_release.py:
+ Exclude CIAO_*_OpenDDS workspaces for the moment
-Thu Sep 16 09:25:51 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Jun 11 21:45:19 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * ace/ace.mpc:
- Removed Service_Templates.h
+ * NEWS:
+ * ace/config-lite.h:
+ * include/makeinclude/platform_sunos5_sunc++.GNU:
-Thu Sep 16 09:08:39 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Added support for Oracle Solaris Studio 12 Update 3 (SunCC 5.12).
- * protocols/tests/HTBP/Send_Large_Msg/server.cpp:
- * protocols/tests/HTBP/ping/client.cpp:
- Added missing includes
+Mon Jun 11 17:05:36 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Sep 15 12:45:13 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/auto_run_tests.pl:
+ Added option -d to run OpenDDS tests also
- * ace/Auto_Event.h:
- * ace/OS_NS_arpa_inet.inl:
- * ace/OS_NS_arpa_inet.cpp:
- * ace/OS_NS_errno.cpp:
- * ace/OS_NS_fcntl.cpp:
- * ace/OS_NS_math.cpp:
- * ace/OS_NS_pwd.inl:
- * ace/OS_NS_pwd.cpp:
- * ace/OS_NS_regex.inl:
- * ace/OS_NS_regex.cpp:
- * ace/OS_NS_signal.cpp:
- * ace/OS_NS_sys_resource.cpp:
- * ace/OS_NS_sys_wait.inl:
- * ace/OS_NS_wctype.inl:
- * ace/OS_NS_wctype.cpp:
- * ace/config-tandem.h:
- * ace/os_include/os_pthread.h:
- * ace/os_include/os_signal.h:
- * ace/os_include/sys/os_resource.h:
- * ace/os_include/sys/os_socket.h:
- Small cleanup and layout changes
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ Also check OpenDDS lst files
-Wed Sep 15 12:31:07 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu Jun 7 10:13:13 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * protocols/tests/HTBP/Reactor_Tests/server.cpp:
- * protocols/tests/HTBP/Send_Recv_Tests/server.cpp:
- * protocols/tests/HTBP/ping/server.cpp:
- Fixed solaris compile problems
+ * ace/Condition_Thread_Mutex.h:
+ * ace/Dynamic_Message_Strategy.h:
+ * ace/Message_Queue.h:
+ * ace/Metrics_Cache_T.h:
+ Doxygen fixes
-Wed Sep 15 09:33:38 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Jun 6 14:46:53 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/XML_Utils/XSCRT/Traversal.hpp:
+ * ace/XML_Utils/XSCRT/Traversal.tpp:
+ Readded tpp file, shouldn't have been deleted
+
+Wed Jun 6 13:09:02 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/XML_Utils/XMLSchema/Traversal.hpp:
+ * ace/XML_Utils/XMLSchema/Types.hpp:
+ * ace/XML_Utils/XMLSchema/Writer.hpp:
+ * ace/XML_Utils/XSCRT/Elements.hpp:
+ * ace/XML_Utils/XSCRT/Parser.hpp:
+ * ace/XML_Utils/XSCRT/Traversal.hpp:
+ * ace/XML_Utils/XSCRT/Writer.hpp:
+ * ace/XML_Utils/XSCRT/XML.hpp:
+ Removed includes
+
+ * ace/XML_Utils/XMLSchema/Traversal.tpp:
+ * ace/XML_Utils/XMLSchema/Types.tpp:
+ * ace/XML_Utils/XMLSchema/Writer.tpp:
+ * ace/XML_Utils/XSCRT/Elements.tpp:
+ * ace/XML_Utils/XSCRT/Parser.tpp:
+ * ace/XML_Utils/XSCRT/Traversal.tpp:
+ * ace/XML_Utils/XSCRT/Writer.tpp:
+ * ace/XML_Utils/XSCRT/XML.tpp:
+ Removed these files.
- * ace/ace.mpc:
- * ace/ace_for_tao.mpc:
- Zapped removed files
+Wed Jun 6 10:27:33 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * docs/svn/config:
- Added another file type
+ * ace/XML_Utils/XML.mpc:
+ Install fixes
-Wed Sep 15 07:51:33 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Jun 6 08:12:22 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/MakeProjectCreator/templates/gnu.mpd:
- Removed invalid comma, thanks to Frank Preischl
- <Frank dot Preischl at ids dot de> for reporting this and Olli Savia
- for correcting my initial patch
-
-Tue Sep 14 18:18:36 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/ace.mwc:
- No need for a workspace with all projects in it
-
- * ace/ace_ce_dll.cfg:
- Removed this file, ancient and not used
-
-Tue Sep 14 16:42:26 UTC 2010 Adam Mitz <mitza@ociweb.com>
-
- * bin/make_release.py (update_latest_tag):
-
- Fixed a bug with the new DAnCE changes and changed the way it does
- the svn properties edits. This function is still not called, but
- the calls are ready to be un-commented whenever the buildczar or
- release manager can re-enable this.
-
-Tue Sep 14 13:00:44 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/Log_Record.h:
- * ace/Log_Record.inl:
- * ace/Log_Record.cpp:
- Removed deprecated encode/decode methods
-
-Tue Sep 14 12:05:19 UTC 2010 Steve Huston <shuston@riverace.com>
-
- * examples/APG/Logging/Callback-3.h: Replaced use of deprecated
- ACE_Log_Record::encode() with CDR converter.
-
-Tue Sep 14 12:01:01 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/FlReactor/ace_flreactor.mpc:
- * ace/FoxReactor/ace_foxreactor.mpc:
- * ace/QtReactor/ace_qt3reactor.mpc:
- * ace/QtReactor/ace_qt4reactor.mpc:
- * ace/TkReactor/ace_tkreactor.mpc:
- * ace/XtReactor/ace_xtreactor.mpc:
- * ace/ace_flreactor.mpc:
- * ace/ace_foxreactor.mpc:
- * ace/ace_qt3reactor.mpc:
- * ace/ace_qt4reactor.mpc:
- * ace/ace_tkreactor.mpc:
- * ace/ace_xtreactor.mpc:
- Moved these files to the subdirectory they need to be in
-
-Tue Sep 14 11:40:39 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * bin/Array.pl:
- * bin/Array_Helper:
- * bin/Hash_Map_Manager.pl:
- * bin/Hash_Map_Manager_Helper:
- * bin/vxworks_modify.pl:
- Removed these files, very old and will not work at all
-
- * bin/PythonACE:
- * bin/PythonACE/__init__.py:
- * bin/PythonACE/fuzz:
- * bin/PythonACE/fuzz/__init__.py:
- * bin/PythonACE/fuzz/_fuzz.py:
- * bin/PythonACE/fuzz/_generic_handler.py:
- * bin/PythonACE/fuzz/_mailer.py:
- * bin/PythonACE/fuzz/_path.py:
- * bin/PythonACE/fuzz/_singleton.py:
- * bin/PythonACE/fuzz/_types.py:
- * bin/PythonACE/fuzz/_warning_handler.py:
- * bin/PythonACE/fuzz/check_includes.py:
- * bin/PythonACE/fuzz/check_no_tabs.py:
- * bin/PythonACE/fuzz/cpp_inline.py:
- * bin/PythonACE/fuzz/inline.py:
- * bin/PythonACE/fuzz/math_include.py:
- * bin/PythonACE/fuzz/max_filename.py:
- * bin/PythonACE/fuzz/max_project_len.py:
- * bin/PythonACE/fuzz/newline.py:
- * bin/PythonACE/fuzz/no_conflict_markers.py:
- * bin/PythonACE/fuzz/noncvs.py:
- * bin/PythonACE/fuzz/ptr_arith_t.py:
- * bin/PythonACE/fuzz/refcountservantbase.py:
- * bin/PythonACE/fuzz/streams_include.py:
- * bin/PythonACE/fuzz/verify_changelog.py:
- * bin/fuzz.py:
- Deleted, fuzz is still perl, if we need a PythonACE later we can
- easily get this again from svn
-
-Tue Sep 14 11:31:42 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * bin/generate_doxygen.pl:
- * html/index.html:
- Removed ciao config handlers
-
-Tue Sep 14 11:30:18 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * bin/generate_doxygen.pl:
- * html/index.html:
- Removed pss
-
-Tue Sep 14 09:41:06 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/mpc-ace.install:
- Don't use environment variables
-
- * protocols/ace/HTBP/HTBP_Filter.h:
- Added missing includes
-
-Tue Sep 14 09:36:06 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/XML_Utils/XML.mpc:
+ Install fixes
- * bin/make_release.py:
- Updated generation of dsc file
+Fri Jun 1 12:43:48 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * protocols/examples/RMCast/Send_Msg/Sender.cpp:
- * protocols/tests/RMCast/Sender.cpp:
- * tests/Based_Pointer_Test.cpp:
- * tests/SSL/Bug_2912_Regression_Test.cpp:
- Added missing includes
+ * ace/Condition_Thread_Mutex.cpp:
+ * ace/Message_Queue_T.h:
+ * ace/Message_Queue_T.cpp:
+ * ace/Thread_Semaphore.h:
+ * ace/Time_Policy.h:
+ * ace/Timer_Hash_T.h:
+ Doxygen fixes
-Mon Sep 13 18:15:27 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu May 31 14:05:51 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- *:
- Zapped trailing whitespaces using
- find -name \*.h -o -name \*.cpp -name \*.inl | xargs perl -i -pe's/\s+\n/\n/'
+ * rpmbuild/ace-tao.spec:
+ Added new library
+
+Thu May 31 12:31:38 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/XML_Utils/XMLSchema:
+ * ace/XML_Utils/XMLSchema/Traversal.hpp:
+ * ace/XML_Utils/XMLSchema/TypeInfo.hpp:
+ * ace/XML_Utils/XMLSchema/Types.hpp:
+ * ace/XML_Utils/XMLSchema/Writer.hpp:
+ * ace/XML_Utils/XMLSchema/id_map.hpp:
+ * ace/XML_Utils/XSCRT:
+ * ace/XML_Utils/XSCRT/Elements.hpp:
+ * ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp:
+ * ace/XML_Utils/XSCRT/Parser.hpp:
+ * ace/XML_Utils/XSCRT/Traversal.hpp:
+ * ace/XML_Utils/XSCRT/Writer.hpp:
+ * ace/XML_Utils/XSCRT/XML.hpp:
+ * ace/XML_Utils/XSCRT/XMLSchema.hpp:
+ Moved these files from DAnCE to ACE
+
+ * ace/XML_Utils/XSCRT/Elements.ipp:
+ * ace/XML_Utils/XSCRT/Parser.ipp:
+ * ace/XML_Utils/XSCRT/Traversal.ipp:
+ * ace/XML_Utils/XSCRT/Writer.ipp:
+ * ace/XML_Utils/XSCRT/XML.ipp:
+ Removed these files.
-Mon Sep 13 14:04:48 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu May 31 09:12:07 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- Reverted change below, not correct given new info from Adam
+ * ace/XML_Utils:
+ * ace/XML_Utils/XML.mpc:
+ * ace/XML_Utils/XML_Error_Handler.h:
+ * ace/XML_Utils/XML_Helper.h:
+ * ace/XML_Utils/XML_Schema_Resolver.h:
+ * bin/MakeProjectCreator/config/ace_xml_utils.mpb:
+ New ACE_XML_Utils library. This is coming from DAnCe and had to
+ move to ACE because it is now used in more places and soon will
+ also be used by OpenDDS
- Thu Sep 9 11:49:30 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu May 31 07:57:59 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/MakeProjectCreator/templates/gnu.mpd:
- Removed invalid comma, thanks to Frank Preischl
- <Frank dot Preischl at ids dot de> for reporting this
+ * ace/High_Res_Timer.h:
+ * ace/Message_Block.h:
+ Doxygen improvements
- * debian/debian.rules:
- * debian/mpc-ace.install:
- Improved
+ * ace/High_Res_Timer.inl:
+ Use gsf type to prevent overflow
-Mon Sep 13 09:25:22 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * docs/bczar/bczar.html:
+ Added some more packages
- * bin/generate_doxygen.pl:
- Updated for DAnCE move
+Thu May 24 14:35:04 UTC 2012 Steve Huston <shuston@riverace.com>
- * ace/ETCL/ETCL_Constraint.cpp:
- * ace/ETCL/ETCL_l.cpp.diff:
- * ace/ETCL/ETCL_l.cpp:
- * ace/Makefile.am:
- * ace/Thread_Control.inl:
- * ace/ace.mpc:
- * ace/ace_for_tao.mpc:
- * apps/JAWS3/bench/average.cpp:
- * apps/JAWS3/bench/mkfiles.cpp:
- * apps/JAWS3/bench/rqfiles.cpp:
- * apps/JAWS3/http/HTTP_Data.h:
- * apps/JAWS3/http/HTTP_Service_Handler.h:
- * apps/JAWS3/http/HTTP_Service_Handler.cpp:
- * apps/JAWS3/http/HTTP_States.h:
- * apps/JAWS3/jaws3-todo/Reactive_Socket.h:
- * apps/JAWS3/jaws3-todo/Reactive_Socket_Helpers.h:
- * apps/JAWS3/jaws3-todo/Reactive_Socket_Helpers.cpp:
- * apps/JAWS3/jaws3-todo/Socket.h:
- * apps/JAWS3/jaws3/Concurrency_T.h:
- * apps/JAWS3/small/SS_Data.h:
- * apps/JAWS3/small/SS_Service_Handler.h:
- * apps/JAWS3/small/SS_Service_Handler.cpp:
- * apps/JAWS3/small/SS_State_DONE.h:
- * apps/JAWS3/small/SS_State_DONE.cpp:
- * apps/JAWS3/small/SS_State_ERROR.h:
- * apps/JAWS3/small/SS_State_ERROR.cpp:
- * apps/JAWS3/small/SS_State_PARSE.h:
- * apps/JAWS3/small/SS_State_PARSE.cpp:
- * apps/JAWS3/small/SS_State_READ.h:
- * apps/JAWS3/small/SS_State_READ.cpp:
- * apps/JAWS3/small/SS_State_WRITE.h:
- * apps/JAWS3/small/SS_State_WRITE.cpp:
- * apps/JAWS3/small/SS_Templates.cpp:
- * contrib/FaCE/FaCE.h:
- * examples/APG/Svc_Config/HA_Status_Dynamic.h:
- * examples/APG/Svc_Config/HA_Status_Static.h:
- * examples/Reactor/TP_Reactor/client.cpp:
- * examples/Reactor/TP_Reactor/server.cpp:
- * protocols/ace/HTBP/HTBP_Channel.cpp:
- * protocols/ace/HTBP/HTBP_Filter.h:
- * protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp:
- * protocols/ace/HTBP/HTBP_Session.cpp:
- * protocols/ace/TMCast/Group.cpp:
- * protocols/examples/RMCast/Send_Msg/Sender.cpp:
- * protocols/tests/HTBP/Reactor_Tests/client.cpp:
- * protocols/tests/HTBP/Reactor_Tests/server.cpp:
- * protocols/tests/HTBP/Reactor_Tests/test_config.h:
- * protocols/tests/HTBP/Send_Large_Msg/client.cpp:
- * protocols/tests/HTBP/Send_Large_Msg/server.cpp:
- * protocols/tests/HTBP/Send_Recv_Tests/client.cpp:
- * protocols/tests/HTBP/Send_Recv_Tests/server.cpp:
- * protocols/tests/HTBP/ping/client.cpp:
- * protocols/tests/HTBP/ping/server.cpp:
- * protocols/tests/RMCast/Sender.cpp:
- * tests/Based_Pointer_Test.cpp:
- * tests/Bug_2980_Regression_Dll.cpp:
- * tests/SSL/Bug_2912_Regression_Test.cpp:
- Removed include of ace/OS.h, only in a few files we really had
- to add an include of OS_NS_*.h
+ * ace/Cache_Map_Manager_T.cpp (find): Remove extraneous () from
+ 'second' - leftover from ACE_Pair days.
- * ace/OS.h:
- * ace/OS.inl:
- * ace/OS.cpp:
- Removed these files, replaced with OS_NS_* files a long time ago
+ * tests/Cache_Map_Manager_Test.cpp: Add call to the above method.
-Sun Sep 12 19:27:58 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+ * THANKS: Thanks to Milind Pangarkar for the above test, and fix.
- * bin/make_release.py:
+Thu May 24 07:58:53 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- Some updates to handle moved DAnCE package.
+ * ace/High_Res_Timer.h:
+ * ace/config-win32-msvc.h:
+ Documentation updates
-Sun Sep 12 19:22:21 UTC 2010 William Otte <wotte@zifnab>
+ * ace/High_Res_Timer.inl:
+ Layout changes
- * bin/MakeProjectCreator/modules/GNUACEProjectCreator.pm:
- * bin/MakeProjectCreator/templates/:
+ * ace/High_Res_Timer.cpp:
+ Use this
- Added rules to pullin rules.dance.GNU.
+Thu May 24 05:56:27 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Sep 10 16:43:39 UTC 2010 Steve Huston <shuston@riverace.com>
+ * bin/MakeProjectCreator/config/MPC.cfg:
+ Added XSC_ROOT
- * ace/Makefile.am: Removed references to files removed at
- Thu Sep 9 11:14:45 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/valgrind.supp:
+ Simplified this file
-Fri Sep 10 11:07:56 UTC 2010 Marcel Smit <msmit@remedy.nl>
+Mon May 21 18:05:32 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/TSS_T.h:
- Resolved compile issue regarding ACE_Copy_Disabled class.
+ * tests/INTEGRITY.ld:
+ Removed this file.
-Fri Sep 10 07:36:39 UTC 2010 Marcel Smit <msmit@remedy.nl>
+Mon May 21 07:15:10 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Thread_Control.inl:
- Include before versioning macros.
+ * NEWS:
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ * docs/Download.html:
+ * docs/bczar/bczar.html:
+ * etc/index.html:
+ Updated for new release
-Fri Sep 10 07:05:45 UTC 2010 Marcel Smit <msmit@remedy.nl>
+Sat May 19 14:28:57 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Thread_Control.inl:
- Resolved compile error (ACE_OS_TRACE could not be found).
+ * ACE version 6.1.2 released.
-Thu Sep 9 12:53:39 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu May 17 16:16:09 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * ace/Asynch_Acceptor.h:
- * ace/Asynch_Acceptor.cpp:
- * ace/Hash_Multi_Map_Manager_T.h:
- * ace/OS_NS_Thread.h:
- * ace/OS_NS_Thread.cpp:
- * ace/Service_Config.cpp:
- * ace/TSS_T.cpp:
- * ace/Thread.h:
- * ace/Thread.inl:
- * ace/config-macosx-snowleopard.h:
- * ace/config-macosx-tiger.h:
- * ace/config-macosx.h:
- * tests/Hash_Multi_Map_Manager_Test.cpp:
- Removed deprecated methods and arguments
-
- * docs/FAQ:
- * FAQ:
- Moved to docs
-
-Thu Sep 9 11:54:10 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * apps/soreduce/Signature.cpp:
- * tests/TkReactor_Test.cpp:
- Fixed fuzz
+ * ACE-INSTALL.html:
-Thu Sep 9 11:49:30 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Replaced the make flag static_libs with static_libs_only.
+ Using static_libs implies that both static and shared can
+ be built at the same time, which is not true in general.
- * bin/MakeProjectCreator/templates/gnu.mpd:
- Removed invalid comma, thanks to Frank Preischl
- <Frank dot Preischl at ids dot de> for reporting this
+Thu May 17 15:42:36 UTC 2012 Steve Huston <shuston@riverace.com>
-Thu Sep 9 11:14:45 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Reactor.h: Clarified the timeout conditions on
+ run_reactor_event_loop(). Thank you to Mohsin Zaidi for this
+ clarification.
- * Kokyu/Dispatch_Deferrer.h:
+ * THANKS: Added Mohsin Zaidi to the Hall of Fame.
- * ace/Atomic_Op_T.h:
- * ace/Atomic_Op_T.inl:
- * ace/Configuration.h:
- * ace/Configuration.cpp:
- * ace/Default_Constants.h:
- * ace/Hash_Multi_Map_Manager_T.h:
- * ace/Hash_Multi_Map_Manager_T.cpp:
- * ace/Intrusive_List.h:
- * ace/Intrusive_List.inl:
- * ace/Local_Name_Space_T.h:
- * ace/Log_Msg.h:
- * ace/Log_Msg.cpp:
- * ace/MEM_Acceptor.h:
- * ace/MEM_Acceptor.inl:
- * ace/MEM_Connector.h:
- * ace/MEM_Connector.inl:
- * ace/Message_Queue.h:
- * ace/OS.h:
- * ace/OS_Memory.h:
- * ace/OS_TLI.h:
- * ace/Obstack_T.h:
- * ace/Obstack_T.inl:
- * ace/POSIX_Asynch_IO.h:
- * ace/Process_Manager.h:
- * ace/Process_Manager.cpp:
- * ace/Recursive_Thread_Mutex.h:
- * ace/Recursive_Thread_Mutex.cpp:
- * ace/Refcountable_T.h:
- * ace/Strategies_T.h:
- * ace/Strategies_T.inl:
- * ace/Synch.h:
- * ace/Task.h:
- * ace/Task_Ex_T.h:
- * ace/Task_Ex_T.inl:
- * ace/Task_T.h:
- * ace/Task_T.inl:
- * ace/Thread_Control.cpp:
- * ace/Token_Collection.h:
- * ace/Token_Invariants.h:
- * ace/Token_Manager.h:
- * ace/ace_wchar.h:
- * ace/config-macosx-leopard.h:
- * ace/os_include/net/os_if.h:
- * ace/os_include/sys/os_mman.h:
- * apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp:
- * netsvcs/lib/Time_Request_Reply.h:
- * netsvcs/lib/Time_Request_Reply.cpp:
- * tests/Conn_Test.cpp:
- * tests/Dirent_Test.cpp:
- * tests/Svc_Handler_Test.cpp:
- Removed several methods, files, and macros that are marked deprecated
- for several years now.
-
- * ace/Map.h:
- * ace/Method_Object.h:
- * ace/OS_Dirent.h:
- * ace/OS_String.h:
- * ace/Pair.h:
- * ace/Refcountable.h:
- * ace/Service_Templates.h:
- Removed these files.
+Wed May 16 17:41:21 UTC 2012 Steve Huston <shuston@riverace.com>
-Thu Sep 9 09:37:22 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/OS_NS_Thread.cpp (ACE_Thread_ID::to_string): Use string literals
+ for the sprintf formats rather than build them up. Things have
+ simplified to the point we don't need that any longer. Thanks to
+ Rick Ohnemus for providing the patch. Fixes Bugzilla #4021.
- * bin/generate_doxygen.pl:
- Fixed errors
+Wed May 16 06:44:23 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * debian/debian.rules:
- Moving forward with OBS
+ * tests/run_test.lst:
+ * tests/tests.mpc:
+ * tests/Bug_4008_Regression_Test.cpp:
+ Removed bug 4008 test, it was testing incorrect assumptions
-Thu Sep 9 09:29:30 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed May 16 06:42:45 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/CDR_Base.h:
- * ace/CDR_Base.cpp:
- * ace/DEV.h:
- * ace/FILE.h:
- * ace/Global_Macros.h:
- * ace/INET_Addr.inl:
- * ace/Malloc_T.h:
- * ace/Malloc_T.inl:
- * ace/Malloc_T.cpp:
- * ace/SOCK_Dgram_Bcast.cpp:
- * ace/SSL/SSL_SOCK.h:
- * ace/Shared_Memory_Pool.cpp:
- * ace/Sock_Connect.cpp:
- * ace/config-aix-5.x.h:
- * ace/config-doxygen.h:
- * ace/config-g++-common.h:
- * ace/config-hpux-11.00.h:
- * ace/config-icc-common.h:
- * ace/config-integritySCA.h:
- * ace/config-linux-common.h:
- * ace/config-macros.h:
- * ace/config-mvs.h:
- * ace/config-openvms.h:
- * ace/config-suncc-common.h:
- * ace/config-sunos5.5.h:
- * ace/config-sunos5.6.h:
- * ace/config-tandem-nsk-mips-v2.h:
- * ace/config-tandem-nsk-mips-v3.h:
- * ace/config-win32-borland.h:
- * ace/config-win32-dmc.h:
- * ace/config-win32-ghs.h:
- * ace/config-win32-msvc-10.h:
- * ace/config-win32-msvc-7.h:
- * ace/config-win32-msvc-8.h:
- * ace/config-win32-msvc-9.h:
- * examples/IOStream/server/iostream_server.h:
- * examples/IPC_SAP/SOCK_SAP/C-inserver.cpp:
- * examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp:
- * examples/Reactor/Misc/test_event_handler_t.cpp:
+ * ace/Basic_Types.h:
+ * ace/Basic_Types.cpp:
+ * ace/Functor.inl:
+ * ace/High_Res_Timer.inl:
+ * ace/OS_NS_time.h:
+ * ace/OS_NS_time.inl:
* tests/Basic_Types_Test.cpp:
- * tests/Conn_Test.cpp:
- * tests/Message_Queue_Test.cpp:
- * tests/SSL/Thread_Pool_Reactor_SSL_Test.h:
- * tests/SSL/Thread_Pool_Reactor_SSL_Test.cpp:
- Cleanup, all compilers support templated typedefs
+ * tests/Bug_2434_Regression_Test.cpp:
+ * tests/Time_Value_Test.cpp:
+ More cleanup due to removal of NSK
- * ace/config-cray.h:
- * ace/config-cxx-common.h:
- Removed these files, obsolete
+ * ace/Basic_Types.inl:
+ Removed this file.
-Thu Sep 9 09:01:10 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue May 15 18:16:09 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/ACE.cpp:
- * ace/ACE_export.h:
- * ace/ETCL/ETCL_y.cpp:
- * ace/INET_Addr.cpp:
+ * ace/ACE.inl:
+ * ace/Atomic_Op_T.h:
+ * ace/Basic_Types.h:
+ * ace/Basic_Types.inl:
+ * ace/Basic_Types.cpp:
+ * ace/CDR_Base.h:
+ * ace/Functor.h:
+ * ace/Functor.inl:
+ * ace/Handle_Set.cpp:
+ * ace/High_Res_Timer.cpp:
* ace/Log_Msg.cpp:
- * ace/OS.inl:
- * ace/OS_NS_Thread.h:
+ * ace/Numeric_Limits.h:
* ace/OS_NS_Thread.inl:
* ace/OS_NS_Thread.cpp:
- * ace/OS_NS_ctype.cpp:
- * ace/OS_NS_netdb.inl:
- * ace/OS_NS_pwd.inl:
* ace/OS_NS_stdlib.inl:
+ * ace/OS_NS_sys_select.inl:
+ * ace/OS_NS_sys_wait.inl:
+ * ace/OS_NS_time.h:
* ace/OS_NS_time.inl:
- * ace/OS_NS_time.cpp:
- * ace/POSIX_CB_Proactor.cpp:
- * ace/POSIX_Proactor.cpp:
- * ace/config-cxx-common.h:
- * ace/config-doxygen.h:
- * ace/config-integritySCA.h:
- * ace/config-lynxos.h:
- * ace/config-macros.h:
- * ace/config-openvms.h:
- * ace/config-tandem-nsk-mips-v2.h:
- * ace/config-tandem-nsk-mips-v3.h:
- * ace/config-vxworks6.4.h:
- * ace/config-win32-common.h:
+ * ace/OS_NS_unistd.inl:
+ * ace/Profile_Timer.cpp:
+ * ace/Sched_Params.cpp:
+ * ace/Stats.cpp:
+ * ace/Task.cpp:
+ * ace/Throughput_Stats.cpp:
+ * ace/Time_Value.h:
+ * ace/Time_Value.inl:
+ * ace/Truncate.h:
+ * ace/UUID.cpp:
* ace/os_include/os_pthread.h:
- * ace/os_include/os_pwd.h:
- * ace/os_include/os_signal.h:
- * ace/os_include/os_stdlib.h:
- * ace/os_include/os_time.h:
- * ace/os_include/sys/os_types.h:
- Removed Tru64, Irix, Unixware, and SCO support
-
- * debian/debian.rules:
- Improved
-
- * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.h:
- * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.h:
- * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.h:
- * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.h:
- * examples/QOS/Simple/Receiver_QoS_Event_Handler.h:
- * examples/QOS/Simple/Sender_QoS_Event_Handler.h:
- Zapped ACE_RCSID
-
- * ace/config-irix6.5.x-sgic++.h:
- * ace/config-irix6.x-common.h:
- * ace/config-irix6.x-g++.h:
- * ace/config-irix6.x-sgic++.h:
- * ace/config-sco-5.0.0-nothread.h:
- * ace/config-sco-5.0.0.h:
- * ace/config-unixware-7.1.0.h:
- * ace/config-unixware-7.1.0.udk.h:
- * include/makeinclude/platform_irix6.x_common.GNU:
- * include/makeinclude/platform_irix6.x_g++.GNU:
- * include/makeinclude/platform_irix6.x_sgic++.GNU:
- * include/makeinclude/platform_tru64_cxx.GNU:
- * include/makeinclude/platform_tru64_g++.GNU:
- * include/makeinclude/platform_tru64_post.GNU:
- * include/makeinclude/platform_tru64_pre.GNU:
- * include/makeinclude/platform_unixware_g++.GNU:
- Removed the files because Tru64, Irix, Unixware, and SCO support are
- removed now
-
-Wed Sep 8 14:54:45 UTC 2010 William Otte <wotte@zifnab>
-
- * docs/bczar/bczar.html:
+ * performance-tests/Server_Concurrency/Latency_Stats.h:
+ * performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp:
+ * performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp:
+ * performance-tests/UDP/udp_test.cpp:
+ * tests/Atomic_Op_Test.cpp:
+ * tests/Basic_Types_Test.cpp:
+ * tests/CDR_Array_Test.cpp:
+ Removed support for Tandem NSK. That was the last platform that
+ needed the emulated versions of ACE_INT64 and ACE_UINT64, that
+ emulation has now been removed
- Updated documentation for removal of Release makefile.
+ * ace/config-tandem-nsk-mips-v2.h:
+ * ace/config-tandem-nsk-mips-v3.h:
+ Removed these files.
-Wed Sep 8 14:40:57 UTC 2010 William Otte <wotte@zifnab>
+Mon May 14 18:48:14 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * Release:
+ * performance-tests/Server_Concurrency/Latency_Stats.h:
+ Fixed conversion warnings
- Removing obsolete release makefile.
+Sun May 13 17:13:31 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Sep 8 10:57:12 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Sample_History.h:
+ * ace/Sample_History.inl:
+ * ace/Sample_History.cpp:
+ Introduced scale_factor_type traits to handle the fact that the
+ ACE HighResTimer scale factor is now ACE_UINT64
- * debian/ace.dsc:
- * debian/debian.changelog:
- * debian/debian.control:
- * debian/debian.rules:
- * debian/changelog:
- * debian/control:
- * debian/dsc:
- * debian/rules:
- Renamed to the names we use on OBS
+Sun May 13 12:27:03 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Sep 8 09:11:03 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/High_Res_Timer.h:
+ Fixed typo
- * tests/SSL/Bug_2912_Regression_Test.cpp:
- Fixed compile error
+ * ace/Basic_Stats.h:
+ * ace/Basic_Stats.cpp:
+ * ace/Throughput_Stats.h:
+ * ace/Throughput_Stats.cpp:
+ Introduced scale_factor_type traits to handle the fact that the
+ ACE HighResTimer scale factor is now ACE_UINT64
-Wed Sep 8 05:53:24 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Timeprobe_T.cpp:
+ Use correct trait for the scale factor
- * examples/APG/ThreadPools/Futures.cpp:
- Added missing include
+ * performance-tests/RPC/client.cpp:
+ * performance-tests/SCTP/SOCK_SEQPACK_clt.cpp:
+ * performance-tests/SCTP/SOCK_STREAM_clt.cpp:
+ * performance-tests/Server_Concurrency/Latency_Stats.h:
+ * performance-tests/TCP/tcp_test.cpp:
+ Use ACE_High_Res_Timer::global_scale_factor_type
-Tue Sep 7 17:07:58 UTC 2010 Steve Huston <shuston@riverace.com>
+Sat May 12 11:11:45 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Process.h: Noted the affects of handle_inheritance() on Windows.
+ * ace/Time_Value.h:
+ * ace/Time_Value.cpp:
+ None of the windows compilers define ACE_LACKS_LONGLONG_T
-Tue Sep 7 14:23:13 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/High_Res_Timer.h:
+ * ace/High_Res_Timer.inl:
+ * ace/High_Res_Timer.cpp:
+ Integrated patches from bugzilla 3703 increasing the precision
+ of the high resolution timers on windows
- * ace/Message_Queue_T.cpp:
- * examples/APG/ThreadPools/LF_ThreadPool.cpp:
- * examples/APG/ThreadPools/ThreadPool.cpp:
- * examples/APG/ThreadSafety/Mutex.cpp:
- * examples/APG/Threads/Condition_Variables.cpp:
- * protocols/ace/HTBP/HTBP_ID_Requestor.h:
- * protocols/ace/TMCast/Group.cpp:
- * protocols/ace/TMCast/MTQueue.hpp:
- * tests/Bug_3878_Regression_Test.cpp:
- * tests/Upgradable_RW_Test.cpp:
- Fixed compile problems
-
-Tue Sep 7 11:35:04 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Sat May 12 11:03:57 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/fuzz.pl:
- Fix fuzz problem
+ * ASNMP/asnmp/transaction.cpp:
+ * Kokyu/Dispatch_Deferrer.cpp:
+ Compare return value of schedule_timer with -1
-Tue Sep 7 10:52:59 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/OS_NS_time.h:
+ None of the windows compilers define ACE_LACKS_LONGLONG_T
- * Kokyu/DSRT_Direct_Dispatcher_Impl_T.cpp:
- Use ACE_GUARD
+ * bin/PerlACE/TestTarget_WinCE.pm:
+ Typo fix
- * Kokyu/Dispatcher_Task.cpp:
- Initialise pointer with 0
+Sat May 12 11:01:50 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * PROBLEM-REPORT-FORM:
- * VERSION:
- Updated support email addresses
+ * ace/config-win32-common.h:
+ None of the windows compilers define ACE_LACKS_LONGLONG_T
- * ace/ACE.inl:
- Layout changes
+Sat May 12 10:54:24 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/ACE.cpp:
- Layout changes, simplified some ifdef checks
+ * ace/Numeric_Limits.h:
+ Fixed typo
- * ace/Auto_IncDec_T.h:
- * ace/Env_Value_T.h:
- Use ACE_Copy_Disabled
+Fri May 11 17:42:08 UTC 2012 Steve Huston <shuston@riverace.com>
- * ace/Bound_Ptr.inl:
- Documentation updates
+ * ace/Dev_Poll_Reactor.cpp (mask_ops_i): Return -1 if epoll_ctl
+ fails and we don't recover from it. Fixes Bugzilla #4019. Thanks
+ to David Simmonds for this fix.
- * ace/CORBA_macros.h:
- Removed all deprecated macros
+Fri May 4 17:25:53 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Dynamic_Service_Base.cpp:
- Use ACE_GUARD_RETURN
+ * ace/Acceptor.cpp:
+ Fixed incorrect check of the return value of schedule_timer,
+ an error is indicated with -1, not 0. Thanks to Deux deVille
+ <dev2 at weitling dot net> for reporting this
- * ace/Event_Handler_T.h:
- * ace/Event_Handler_T.inl:
- * ace/Event_Handler_T.cpp:
- Removed checks for ACE_HAS_TEMPLATE_TYPEDEFS, I think all compilers
- have this now, let us see if nothing breaks
+Thu May 3 07:15:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/FILE.h:
- Doxygen updates
+ * tests/Bug_3673_Regression_Test.cpp:
+ Fixed typo
- * ace/Future.h:
- * ace/Future.cpp:
- Use mutex defines
+Wed May 2 18:36:25 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Future_Set.h:
- Use ACE_Copy_Disabled
+ * ace/OS_NS_math.h:
+ Fixed compile warning with WinCE
- * ace/Future_Set.cpp:
- Initialise pointer with 0
+Wed May 2 17:08:28 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu>
- * ace/Global_Macros.h:
- Removed checks for ACE_HAS_TEMPLATE_TYPEDEFS, doxygen changes, make it
- possible for users to redefine ACE_GUARD macros
+ * THANKS:
- * ace/Guard_T.h:
- * ace/Guard_T.inl:
- * ace/Guard_T.cpp:
- Doxygen changes, disable ACE_Guard checks for this file
+ Added Markus Manck <Markus dot Manck at Philotech dot de>
- * ace/Hash_Map_Manager_T.h:
- * ace/Hash_Multi_Map_Manager_T.h:
- * ace/Map_Manager.h:
- Update to indicate the usage of ACE_GUARD
+Tue May 1 17:38:13 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/INET_Addr.h:
- Doxygen changes
+ * bin/msvc_mpc_auto_compile.pl:
+ Added -project_root to override $ACE_ROOT as root to search for
+ solutions. This is needed when using this script in a flat directory
+ layout
- * ace/Local_Tokens.h:
- Disable part of this file for ACE_Guard fuzz check
+Tue May 1 12:52:45 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Log_Msg.cpp:
- Use ACE_OS::thr_self
+ * ace/OS_NS_sys_time.cpp:
+ * ace/config-win32-msvc-10.h:
+ * ace/config-win32-msvc-8.h:
+ * ace/config-win32-msvc-9.h:
+ WinCE also has non conformant timeval. When _USE_32BIT_TIME_T is not
+ defined we have to use our workaround in all cases
- * ace/Malloc_T.h:
- Disable part of this file for ACE_Guard fuzz check, doxygen changes
+Tue May 1 11:42:22 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Message_Queue_T.h:
- * ace/Message_Queue_T.cpp:
- * ace/Message_Queue_Vx.h:
- * ace/Message_Queue_Vx.cpp:
- Removed ACE_Guard argument to some methods, not used and now cause
- fuzz to fail
+ * ace/os_include/sys/os_stat.h:
+ Fixed compile error
- * ace/Mutex.h:
- * ace/Mutex.inl:
- Added non const lock(), this fixes bugzilla 3878. Thanks to
- Susan Finster <sfinster at daetwyler-rd dot com> for reporting this
+Tue May 1 10:25:37 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Null_Barrier.h:
- * ace/Null_Condition.h:
- * ace/Null_Mutex.h:
- * ace/Null_Semaphore.h:
- Removed old comments, disable part for ACE_Guard, removed
- ACE_Null_Mutex_Guard
+ * ace/os_include/sys/os_stat.h:
+ Compile fix for WinCE 7
- * ace/OS_NS_Thread.cpp:
- Layout changes, use ACE_Guard
+Tue May 1 07:48:30 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/OS_NS_poll.cpp:
- * ace/OS_NS_sys_select.cpp:
+ * ace/Mem_Map.cpp:
Layout changes
- * ace/OS_NS_sys_socket.inl:
- Comment change
-
- * ace/Read_Buffer.h:
- * ace/Remote_Tokens.h:
- * ace/SOCK.h:
- Doxygen changes
-
- * ace/SOCK_Connector.h:
- * ace/SOCK_Dgram_Mcast.h:
- Doxygen changes
+ * ace/config-win32-msvc-9.h:
+ Removed wince comment
- * ace/SOCK_Connector.cpp:
- Layout and const changes
+Sun Apr 29 19:17:29 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Select_Reactor.h:
- Disable part of this file for ACE_Guard fuzz check
+ * bin/msvc_mpc_auto_compile.pl:
+ More improvements to this script
- * ace/Service_Gestalt.h:
- Use ACE_Copy_Disabled
+Sun Apr 29 19:01:08 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Sig_Handler.cpp:
- Use ACE_GUARD macros
+ * bin/msvc_mpc_auto_compile.pl:
+ Support flat layout
- * ace/Synch_Traits.h:
- Removed ACE_HAS_TEMPLATE_TYPEDEFS checks
+Fri Apr 27 18:43:31 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/TSS_T.h:
- * ace/TSS_T.cpp:
- Use ACE_Copy_Disabled, reworked some code to fix ACE_Guard fuzz
- checks
+ * bin/msvc_mpc_auto_compile.pl:
+ Corrected output messages
- * ace/Task_Ex_T.h:
- Use ACE_Copy_Disabled
-
- * apps/Gateway/Peer/Peer.cpp:
- * apps/JAWS/server/HTTP_Server.cpp:
- * apps/JAWS/server/JAWS_IO.cpp:
- Initialise pointers with 0
-
- * apps/JAWS/server/HTTP_Helpers.cpp:
- Use ACE_GUARD macros
-
- * apps/JAWS2/JAWS/Cache_Hash_T.cpp:
- * apps/JAWS2/JAWS/Cache_Manager_T.cpp:
- * apps/JAWS2/JAWS/Cache_Object.cpp:
- * apps/JAWS2/JAWS/Concurrency.cpp:
- * apps/JAWS2/JAWS/FILE.cpp:
- * apps/JAWS2/JAWS/Jaws_IO.cpp:
- * apps/JAWS2/JAWS/Reaper.cpp:
- * apps/JAWS3/jaws3/FILE.cpp:
- Use ACE_GUARD macros
-
- * apps/gperf/src/Options.cpp:
- Rename of local variable so that we don't need to disable ACE_OS
- fuzz check
+Fri Apr 27 18:40:51 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/fuzz.pl:
- Improved ACE_Guard checks and enable this one by default
+ * ace/OS_NS_time.h:
+ * ace/config-win32-msvc-9.h:
+ First fixes for WinCE 7
- * bin/generate_doxygen.pl:
- Let DANCE use the CIAO version file for the moment
+Wed Apr 25 07:02:16 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/make_release.py:
- Don't create static and wince solutions as part of the release anymore,
- if you use these, generate them by hand in the future. Added vc10
- project files
-
- * examples/APG/Proactor/HA_Proactive_Status.cpp:
- * examples/APG/Reactor/Client.cpp:
- * examples/APG/Reactor/HAStatus.cpp:
- * examples/APG/Streams/Answerer.cpp:
- * examples/APG/Streams/CommandStream.cpp:
- * examples/APG/ThreadManagement/Pool.cpp:
- * examples/APG/ThreadPools/LF_ThreadPool.cpp:
- * examples/APG/ThreadPools/Task_ThreadPool.cpp:
- * examples/APG/ThreadSafety/Semaphore.cpp:
- * examples/APG/Threads/Message_Blocks.cpp:
- * examples/APG/Threads/Message_Queue.cpp:
- * examples/ASX/Message_Queue/bounded_buffer.cpp:
- * examples/ASX/Message_Queue/priority_buffer.cpp:
- * examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp:
- * examples/C++NPv2/AIO_Client_Logging_Daemon.cpp:
- * examples/C++NPv2/display_logfile.cpp:
- * examples/IPC_SAP/UPIPE_SAP/ex1.cpp:
- * examples/Reactor/Misc/test_demuxing.cpp:
- * examples/Reactor/WFMO_Reactor/Talker.cpp:
- * examples/Threads/barrier2.cpp:
- * examples/Threads/thread_pool.cpp:
- Initialise pointers with 0
+ * ace/Get_Opt.cpp:
+ Reverted Wed Apr 18 08:51:31 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * examples/APG/ThreadPools/ThreadPool.cpp:
- Use ACE_Thread_ID to store a print a thread id using ACE_DEBUG, that
- is the only way that is 100% portable
+Tue Apr 24 01:18:27 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * examples/APG/Threads/Guards.cpp:
- Disable ACE_Guard fuzz
+ * ace/String_Base.h (template): Zapped the 'explicit' keywords
+ introduced by the change in
- * examples/Threads/reader_writer.cpp:
- * examples/Threads/recursive_mutex.cpp:
- Use ACE_GUARD macros
+ Tue Apr 17 19:09:30 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * examples/Threads/thread_specific.cpp:
- * examples/Threads/tss1.cpp:
- Removed code not used
+ since it was breaking too much code.
- * include/makeinclude/platform_g++_common.GNU:
- Added CROSS_COMPILE support to this file
+Wed Apr 18 08:51:31 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * include/makeinclude/platform_linux.GNU:
- * include/makeinclude/platform_linux_common.GNU:
- Moved some bits to platform_g++_common.GNU, works with G++ in
- general
+ * ace/String_Base.h:
+ Reverted 'explicit' declaration for single arg constructor for
+ const ACE_TCHAR* as implicit conversion of this arg type to
+ ACE string class is the expected behaviour (similar to the
+ STL std::string).
- * include/makeinclude/platform_qnx_neutrino.GNU:
- * include/makeinclude/platform_qnx_rtp_gcc.GNU:
- Cleanup
+ * ace/Get_Opt.cpp:
+ Introduced explicit ACE_CString constructor call for single
+ arg ACE_TCHAR (not pointer) constructor.
- * netsvcs/lib/Log_Message_Receiver.h:
- * netsvcs/lib/Log_Message_Receiver.cpp:
- Use ACE_GUARD macros
+Wed Apr 18 06:31:56 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * performance-tests/Misc/Misc.mpc:
- Enable test_guard
+ * ace/Future.cpp:
+ Fixed commented out guard. Thanks to Andreas Dröscher
+ <ace at anticat dot ch> for reporting this.
- * performance-tests/Misc/test_guard.cpp:
- Made this compiling again
+Tue Apr 17 19:09:30 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.cpp:
- * performance-tests/TCP/tcp_test.cpp:
- Renamed variable to not need ACE_OS fuzz disable code
-
- * protocols/ace/HTBP/HTBP_ID_Requestor.cpp:
- * protocols/ace/HTBP/HTBP_Session.cpp:
- Use ACE_GUARD macros
-
- * protocols/ace/RMCast/Acknowledge.h:
- * protocols/ace/RMCast/Acknowledge.cpp:
- * protocols/ace/RMCast/Bits.h:
- * protocols/ace/RMCast/Flow.h:
- * protocols/ace/RMCast/Flow.cpp:
- * protocols/ace/RMCast/Fragment.h:
- * protocols/ace/RMCast/Fragment.cpp:
- * protocols/ace/RMCast/Link.h:
- * protocols/ace/RMCast/Link.cpp:
- * protocols/ace/RMCast/Parameters.h:
- * protocols/ace/RMCast/Protocol.h:
- * protocols/ace/RMCast/Protocol.cpp:
- * protocols/ace/RMCast/Reassemble.h:
- * protocols/ace/RMCast/Reassemble.cpp:
- * protocols/ace/RMCast/Retransmit.h:
- * protocols/ace/RMCast/Retransmit.cpp:
- * protocols/ace/RMCast/Simulator.h:
- * protocols/ace/RMCast/Simulator.cpp:
- * protocols/ace/RMCast/Socket.h:
- * protocols/ace/RMCast/Socket.cpp:
- * protocols/ace/RMCast/Stack.h:
- * protocols/ace/RMCast/Stack.cpp:
- * protocols/ace/TMCast/FaultDetector.hpp:
- * protocols/ace/TMCast/Group.cpp:
- * protocols/ace/TMCast/Group.hpp:
- * protocols/ace/TMCast/GroupFwd.hpp:
- * protocols/ace/TMCast/LinkListener.hpp:
- * protocols/ace/TMCast/MTQueue.hpp:
- * protocols/ace/TMCast/MTQueue.cpp:
- * protocols/ace/TMCast/Messaging.hpp:
- * protocols/ace/TMCast/Protocol.hpp:
- * protocols/ace/TMCast/Protocol.cpp:
- * protocols/ace/TMCast/TransactionController.hpp:
- Removed commented out code, Id changes, disable ACE_Guard check
- for this project
+ * ace/String_Base.h: Made the single parameter constructors
+ explicit to avoid problems with implict conversions. Thanks to
+ Adam Rymarczuk <adam dot rymarczuk at suntradingllc dot com> for
+ reporting this.
- * rpmbuild/ace-tao.spec:
- Fixed some problems in this spec file
+Thu Apr 12 11:25:25 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * tests/Aio_Platform_Test.cpp:
- * tests/Basic_Types_Test.cpp:
- * tests/Bug_1576_Regression_Test.cpp:
- * tests/Bug_3532_Regression_Test.cpp:
- * tests/Bug_3673_Regression_Test.cpp:
- * tests/Bug_3709_Regression_Test.cpp:
- * tests/Bug_3744_Regression_Test.cpp:
- * tests/Compiler_Features_03_Test.cpp:
- * tests/Compiler_Features_09_Test.cpp:
- * tests/Compiler_Features_13_Test.cpp:
- * tests/Compiler_Features_14_Test.cpp:
- * tests/Env_Value_Test.cpp:
- * tests/Hash_Map_Bucket_Iterator_Test.cpp:
- * tests/Logging_Strategy_Test.cpp:
- * tests/MT_SOCK_Test.cpp:
- * tests/Pipe_Test.cpp:
- * tests/Priority_Task_Test.cpp:
- * tests/Proactor_UDP_Test.cpp:
- * tests/QtReactor_Test.cpp:
- * tests/Reactor_Notification_Queue_Test.cpp:
- * tests/Reactor_Registration_Test.cpp:
- * tests/Reference_Counted_Event_Handler_Test.cpp:
- * tests/Time_Service_Test.cpp:
- Zapped ACE_RCSID
+ * include/makeinclude/platform_linux_icc.GNU:
+ Added support for c++0x
- * tests/Message_Block_Test.cpp:
- * tests/Multicast_Test_IPV6.cpp:
- Initialise pointer with 0
+Tue Apr 10 20:09:23 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * tests/Reader_Writer_Test.cpp:
- Use ACE_GUARD
+ * ace/Dev_Poll_Reactor.cpp (ACE_Dev_Poll_Reactor::resumable_handler):
+ Changed this method to return 1 instead of 0. Thanks to David
+ Simmonds <david dot simmonds at iggroup dot com> for providing
+ this fix. This fixes bugid 4015.
- * tests/Recursive_Mutex_Test.cpp:
- Disable ACE_Guard fuzz for part of this file
+ Added David to the ACE hall of fame.
- * tests/Bug_3878_Regression_Test.cpp:
- New test for bugzilla 3878
+Tue Apr 10 20:10:06 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * tests/SSL/Bug_2912_Regression_Test.cpp:
- * tests/TP_Reactor_Test.cpp:
- Use ACE_GUARD
+ * bin/MakeProjectCreator/templates/gnu.mpd:
- * tests/Simple_Message_Block_Test.cpp:
- * tests/Svc_Handler_Test.cpp:
- * tests/Thread_Pool_Test.cpp:
- * tests/UPIPE_SAP_Test.cpp:
- Initialise pointers with 0
+ Install the Inline_Files even with inline=0. Many of these files
+ are still needed, especially *_T.inl. This resolves bug #4002.
- * tests/Thread_Mutex_Test.cpp:
- Disable ACE_Guard fuzz
+Mon Apr 9 21:57:39 UTC 2012 Steve Huston <shuston@riverace.com>
- * tests/Upgradable_RW_Test.cpp:
- Use ACE_GUARD
+ * ace/Timer_Queue_T.cpp (calculate_timeout): Lock the mutex before
+ accessing timer queue elements to calculate the timeout. Thanks to
+ Kannan Ramaswamy for this fix.
- * tests/run_test.lst:
- * tests/tests.mpc:
- Added 3878
+Sun Apr 8 14:25:23 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
-Mon Sep 6 09:30:00 UTC 2010 Simon Massey <buildczar at prismtech dot com>
+ * ace/ace.mpc:
- * ace/Acceptor.cpp:
- Due to the way the code was formatted, I mistook a do {} while loop for
- a while loop with my change. I have corrected this.
+ Move ace_wchar.inl to the header section so that it is always
+ installed even when the library is built with inline=0. This is
+ required because ace_wchar is always inlined.
-Mon Sep 6 08:10:00 UTC 2010 Simon Massey <buildczar at prismtech dot com>
+Fri Apr 6 11:58:40 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/ACE.cpp:
- * ace/Acceptor.cpp:
- * ace/SOCK_IO.cpp:
- * ace/SOCK_Dgram.cpp:
- * tests/SOCK_Test.cpp:
- * tests/MT_SOCK_Test.cpp:
- * NEWS:
- Now that release x.8.3. is out, we are attempting to provide the correct
- fix to the original commit by Steve Huston related to handle_ready()
- (Fri Aug 27 19:17:11 UTC 2010 Steve Huston <shuston@riverace.com>)
- and added back the corresponding NEWS entry.
+ * docs/Download.html:
+ Added another rpm
-Sat Sep 04 18:08:03 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Apr 6 10:48:03 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* NEWS:
* bin/diff-builds-and-group-fixed-tests-only.sh:
- * bin/make_release.py:
* docs/Download.html:
+ * docs/bczar/bczar.html:
* etc/index.html:
- Updated because of release
+ Updated for next release
-Sat Sep 04 11:30:18 CEST 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Apr 06 09:03:19 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ACE version 5.8.2 released.
+ * ACE version 6.1.1 released.
-Thu Sep 2 14:46:56 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+Tue Apr 3 22:49:11 UTC 2012 Steve Huston <shuston@riverace.com>
- * ace/Acceptor.cpp:
- * ace/SOCK_IO.cpp:
- * ace/SOCK_Dgram.cpp:
- * ace/ACE.cpp:
- * tests/SOCK_Test.cpp:
- * tests/MT_SOCK_Test.cpp:
- * NEWS:
- Reverted both commits by Steve Huston related to handle_ready()
- and a NEWS entry.
- Wed Sep 1 19:31:24 UTC 2010 Steve Huston <shuston@riverace.com>
- Fri Aug 27 19:17:11 UTC 2010 Steve Huston <shuston@riverace.com>
- This is necessary for a quick release of 1.8.2.
+ * ace/SOCK_Dgram_Mcast.cpp (subscribe_ifs): Set the error code when
+ a Windows API call fails. Also, when calling GetAdaptersAddresses()
+ to both check size and get the info, supply GAA_FLAG_SKIP_MULTICAST
+ as the flag value. This avoids obtaining info for joined multicast
+ addresses, not multicastable interfaces. Without the flag, and if
+ some other process does a join between the size-check call and the
+ info-gathering call, the size will be wrong.
-Wed Sep 1 19:31:24 UTC 2010 Steve Huston <shuston@riverace.com>
+Tue Apr 3 17:01:33 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu>
- * ace/ACE.cpp (handle_ready): Changed the timeout behavior to just
- return 0, no errno, as ACE_OS::poll() and ACE_OS::select() both do.
- This restores historic behavior changed inadvertently at
- Fri Aug 27 19:17:11 UTC 2010 Steve Huston <shuston@riverace.com>
+ * THANKS:
- * ace/SOCK_Dgram.cpp:
- * ace/SOCK_IO.cpp:
- * tests/MT_SOCK_Test.cpp:
- * tests/SOCK_Test.cpp: Re-added the if/switch on return value from
- ACE::handle_read|write_ready() to detect timeout and set errno
- here.
+ Added Thomas Stegemann <Thomas dot Stegemann at materna dot de>.
- These changes were necessary to fix the TAO faults test. Thanks
- to Johnny and Simon for narrowing down the cause and testing
- the fix.
+Tue Apr 3 16:18:35 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
-Wed Sep 1 15:58:47 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ * ace/ACE.cpp (ACE::timestamp): Fixed an "off-by-one" error that
+ caused corruption of timestamps when using
+ ACE_LOG_TIMESTAMP="TIME" env var. Thanks to Andrea Sormanni
+ <andrea dot sormanni at gmail dot com> for reporting this and
+ providing a fix.
- * bin/MakeProjectCreator/templates/gnu.mpd:
+ Added Andrea to the Hall of Fame!
- Changed the short-circuit logic for the .NOTPARALLEL checks to ||
- instead of &&. If any one file is newer, we will have to rebuild.
- Also added a missing foreach for the output files with dependent libs.
+Fri Mar 30 14:33:58 UTC 2012 Steve Huston <shuston@riverace.com>
-Wed Sep 1 09:59:42 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ * examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp: Changed
+ use of ::sscanf_s() to only those platforms with the setting
+ ACE_HAS_TR24731_2005_CRT (VC8 and up).
- * tests/Time_Value_Test.cpp:
- Fixed compile warning on QNX. time_t on QNX is defined as unsigned
- int.
+Fri Mar 30 13:39:25 UTC 2012 Adam Mitz <mitza@ociweb.com>
-Tue Aug 31 16:53:07 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+ * include/makeinclude/platform_win32_msvc.GNU:
- * THANKS:
+ Added iphlpapi to the list of system libraries.
- Added Catherine L. Paquin <catherine dot paquin at ngc dot com>.
+Thu Mar 29 21:50:17 UTC 2012 Adam Mitz <mitza@ociweb.com>
-Tue Aug 31 14:40:17 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ * bin/MakeProjectCreator/templates/gnu.mpd:
- * NEWS:
+ Postbuild steps need a dependency on the executable or library
+ so that parallel make will run them at the right time.
- Updated to proper name of Visual Studio 2010, which may assist
- those searching for it in the NEWS file.
+Wed Mar 28 22:03:45 UTC 2012 Steve Huston <shuston@riverace.com>
-Tue Aug 31 12:56:36 UTC 2010 Steve Huston <shuston@riverace.com>
+ * examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp: Changed
+ the +H handle value scan to know this is a hex value on Windows, but
+ a decimal value on everything else. Thanks to Andy Gokhale for this.
- * NEWS: Added an entry for the change at
- Fri Aug 27 19:17:11 UTC 2010 Steve Huston <shuston@riverace.com>
+Wed Mar 28 21:44:20 UTC 2012 Steve Huston <shuston@riverace.com>
- * ace/README:
- * ace/config-sunos5.6.h:
- * ace/config-sunos5.7.h: Removed all mention of ACE_HAS_LIMITED_SELECT.
+ * tests/Multicast_Test.cpp: Removed the forced set_nic to "lo" for
+ Linux. It's not needed with the changes from:
+ Wed Mar 21 21:57:40 UTC 2012 Steve Huston <shuston@riverace.com>
-Mon Aug 30 18:41:24 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Mar 26 11:27:11 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/ace.mpc:
- Added Obstack.h
+ * include/makeinclude/platform_mingw32.GNU:
+ Added iphlpapi
-Mon Aug 30 16:48:34 UTC 2010 Steve Huston <shuston@riverace.com>
+Sat Mar 24 21:53:13 UTC 2012 Steve Huston <shuston@riverace.com>
- * ace/FIFO.h:
- * ace/FIFO_Recv.h:
- * ace/FIFO_Send.h: Clarified initialization and open behavior.
+ * ace/SOCK_Dgram_Mcast.cpp (subscribe_ifs): For Windows, handle IPv6
+ and IPv4 differently. The make_multicast_ifaddr() call that will end
+ up being made for IPv4 wants the interface's IP address, not name.
-Mon Aug 30 15:33:57 UTC 2010 Steve Huston <shuston@riverace.com>
+ * bin/MakeProjectCreator/config/acedefaults.mpb:
+ * bin/MakeProjectCreator/config/ipv6.mpb: Moved the lit_lib for iphlpapi
+ on Windows from the IPv6 base to acedefaults. SOCK_Dgram_Mcast.cpp
+ uses it for both IPv4 and IPv6 now.
- * ace/Process.h (set_handles): Add a note that passing a socket handle
- with this mechanism does not work on Windows.
+Fri Mar 23 22:06:11 UTC 2012 Steve Huston <shuston@riverace.com>
-Mon Aug 30 10:06:24 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/WIN32_Asynch_IO.cpp: Fixed possible heap corruption in
+ ACE_SOCK_Dgram_Read_Dgram::recv(). Thank you to
+ Dmytro Ovdiienko <dmitriy.ovdienko@gmail.com> for unconvering this.
- * examples/Reactor/Proactor/test_proactor2.cpp:
- * examples/Reactor/Proactor/test_proactor3.cpp:
- * tests/Proactor_Test.cpp:
- * tests/Proactor_Test_IPV6.cpp:
- * tests/Proactor_UDP_Test.cpp:
- ACE_Guard changes
-
-Fri Aug 27 19:17:11 UTC 2010 Steve Huston <shuston@riverace.com>
-
- * ace/ACE.cpp (handle_ready, handle_timed_complete,
- handle_timed_accept): On platforms where poll() is
- available, prefer that to using select() for checking a single
- handle's state and/or waiting for a condition. This preference
- was previously only used if ACE_HAS_LIMITED_SELECT was set. The
- ACE_HAS_LIMITED_SELECT choice is removed, making ACE_HAS_POLL the
- setting that switches this preference. The driving reason for this
- is that if select() is called to detect changes on a handle whose
- values falls outside that which can safely be stored in an fdset,
- the handle-setting macros/functions will set/clear bits outside
- of the fdset. This results in very weird memory changes, often in
- the stack, which are very hard to diagnose. poll()'s operation
- does not suffer from this affect. With the growing use of large
- numbers of handles and use of ACE_Dev_Poll_Reactor on Linux,
- the rate at which this problem was cropping up was increasing.
- Thanks to Olivier Langlois for diagnosing this problem and
- proposing the patch.
-
- (handle_ready): Properly set the poll condition for read and/or
- write. Thanks to kumaran.prem@gmail.com for this fix.
+ * THANKS: Added Dmytro to the Hall of Fame.
- * ace/Acceptor.cpp:
- * ace/SOCK_IO.cpp:
- * ace/SOCK_Dgram.cpp:
- * tests/MT_SOCK_Test.cpp:
- * tests/SOCK_Test.cpp: Replaced use of ACE_OS::select() with
- ACE::handle_ready() and friends.
+Thu Mar 22 16:23:14 UTC 2012 Steve Huston <shuston@riverace.com>
- This all resolves Bugzilla #3606.
+ * ace/SOCK_Dgram_Mcast.h: Corrected the description of conditions
+ under which using OPT_NULLIFACE_ALL works and neatened things up.
-Fri Aug 27 19:10:16 UTC 2010 Brian Johnson <johnsonb@ociweb.com>
+ * tests/Multicast_Test.cpp: Turn on IP_MULTICAST_LOOP all the time.
+ This test requires it and it's not universally the default.
- * bin/MakeProjectCreator/templates/gnu.mpd:
+Thu Mar 22 13:03:46 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- Merging dependent_libs support for gnuace from TAO 1.5a.
- (Bugzilla #3281)
+ * ace/ARGV.cpp:
+ * ace/Acceptor.cpp:
+ * ace/Asynch_Acceptor.cpp:
+ * ace/Cached_Connect_Strategy_T.cpp:
+ * ace/Lib_Find.cpp:
+ * ace/Strategies_T.cpp:
+ * ace/Timer_Heap_T.cpp:
+ Fixed coverity errors
+
+Wed Mar 21 21:57:40 UTC 2012 Steve Huston <shuston@riverace.com>
+
+ * ace/SOCK_Dgram_Mcast.cpp (subscribe_ifs): Expanded the use of
+ code to scan interfaces to be always, not just for IPv6, when
+ subscribing with OPT_NULLIFACE_ALL and no specific interface.
+ Also replaced use of ACE_OS::if_nameindex with getifaddr() when
+ it's available (which was only on Linux anyway) so checks
+ for interface up and multicastable can be made before joining.
+ The code now works for systems with ACE_HAS_GETIFDADDR (incl.
+ Linux, which was my main issue driving this) and Win32. The others
+ end up in the old get_ip_interfaces code which will never work
+ anywhere as far as I can tell because it tries to subscribe to an
+ interface named with the IP address in string form.
+
+ * tests/Multicast_Test.cpp: Removed hack force of interface "lo0"
+ on join(). No need for that with the fix above. For background, this
+ was added at:
+ Thu Jan 21 15:25:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+
+ * ace/Sock_Connect.cpp (get_ip_interfaces_getifaddr): Will no longer
+ return an interface marked 'down'. Partially fixes Bugzilla #1990
+ but other platform-specific changes are needed to resolve it
+ completely.
+
+Sat Mar 17 12:16:15 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Aug 27 18:36:37 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * docs/Download.html:
+ Added link to the mailing lists with an advice for people to subscribe
- * ace/OS_NS_Thread.h:
- * ace/OS_NS_Thread.inl:
- Added assignment operator for ACE_Thread_Id
+Sat Mar 17 12:11:15 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Aug 27 15:01:41 UTC 2010 Steve Huston <shuston@riverace.com>
+ * bin/cleanbuilds.sh:
+ * bin/diff-builds.pl:
+ Updated teststat links
- * Connector.{h cpp} (ACE_NonBlocking_Connect_Handler): Add a
- handle_close() which calls handle_input() if called by the
- ACE_Dev_Poll_Reactor to remove a failed connect. Apparently,
- Linux epoll, at least sometimes, signals EPOLLERR on a failed
- nonblocking connect, unlike the select() case which selects the
- failed fd for read. Thanks to Kannan Ramaswamy <kannan dot
- ramaswamy at cogcap dot com> for this information and fix.
+Wed Mar 14 10:04:06 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * THANKS: Added Kannan to the Hall of Fame.
+ * docs/Download.html:
+ Added link to ORBZone as community site for CORBA/CCM
-Fri Aug 27 14:17:56 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * tests/run_test.lst:
+ Mark 4008 as not fixed
- * ace/Atomic_Op.h:
- Doxygen changes
+Tue Mar 13 11:24:33 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/OS_NS_Thread.cpp:
- Use ACE_GUARD
+ * ace/Service_Gestalt.cpp:
+ Reverted change below, breaks Missing_Svc_Conf_Test test
- * bin/fuzz.pl:
- Added check for ACE_Guard
+Tue Mar 13 09:36:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Aug 27 06:56:11 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Service_Gestalt.cpp:
+ Fixed bugzilla 4008, thanks to Derek Dominish
+ <derek dot dominish at dsto dot defence dot gov dot au> for
+ creating the fix
- * etc/ace.doxygen:
- * etc/acexml.doxygen:
- Fuzz fixes
+Tue Mar 13 09:29:56 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Thu Aug 26 13:20:48 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * tests/Bug_4008_Regression_Test.cpp:
+ * tests/run_test.lst:
+ * tests/tests.mpc:
+ New test for bugzilla 4008. Thanks to Derek Dominish
+ <derek dot dominish at dsto dot defence dot gov dot au> for
+ creating this test
- * bin/diff-builds-and-group-fixed-tests-only.sh:
- Added DANCE_ROOT
+Mon Mar 12 20:22:17 UTC 2012 Adam Mitz <mitza@ociweb.com>
-Thu Aug 26 13:08:56 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * include/makeinclude/rules.local.GNU:
- * netsvcs/servers/servers.mpc:
- Use ace_netsvcs as executable name, this makes more sense when
- we install this file in a target directory
+ Revert this part of Friday's change, with a comment added
+ to describe why this use of 'pwd' is different.
-Thu Aug 26 13:04:06 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Mar 9 20:38:22 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * bin/fuzz.pl:
- Check doxygen files for tabs
+ * include/makeinclude/rules.lib.GNU:
- * etc/ace.doxygen:
- * etc/ace_inet.doxygen:
- * etc/ace_qos.doxygen:
- * etc/ace_rmcast.doxygen:
- * etc/ace_ssl.doxygen:
- * etc/acexml.doxygen:
- * html/index.html:
- Changed documentation subdirectories to make debian packaging easier
+ When creating an archive library, use all object files instead of
+ just modified object files. This fixes a bug that can occur when
+ two different subdirectories have objects files with the same name.
+ The archive dosn't track directory names so "replacing" one changed
+ object could actually be clobbering another one.
-Thu Aug 26 12:30:33 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * include/makeinclude/rules.local.GNU:
- * debian/control:
- Made some fixes for x.8.1
+ Use the $(PWD) make variable for current directory.
-Thu Aug 26 11:54:15 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Mar 7 14:58:07 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/auto_run_tests.pl:
- Extended script to also check for $DANCE_ROOT/bin/dance_tests.lst
+ * docs/Download.html:
+ Added new download link for latest minor with versioned namespaces
-Thu Aug 26 10:20:41 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Wed Mar 7 14:37:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/OS_NS_Thread.cpp:
- Changes implementing the patches from Bugzilla #3653 (with
- changes and some rejects; *no* asserts allowed in ACE).
+ * rpmbuild/ace-tao.spec:
+ Fix for ppc64
-Wed Aug 25 19:58:19 UTC 2010 Steve Huston <shuston@riverace.com>
+Wed Mar 7 13:31:58 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Dev_Poll_Reactor.{h cpp}: Regarding change number 2 at
- Fri Mar 26 14:07:55 UTC 2010 Steve Huston <shuston@riverace.com>
- dispatching notifies in only one thread at a time was 1) wrong
- (TP_Reactor doesn't do this), 2) broke important existing
- applications at a customer site. This has been fixed so that the
- notify dispatch behavior is like ACE_TP_Reactor: when the
- notify handle is signaled, extract one notification, release
- the token, dispatch the notification. Thus, each thread will
- dispatch one notification, and multiple threads can dispatch
- them at the same time if there are multiples.
+ * ace/Base_Thread_Adapter.h:
+ * ace/Base_Thread_Adapter.cpp:
+ * ace/ETCL/ETCL_Constraint.inl:
+ * ace/Module.cpp:
+ * ace/Stream.cpp:
+ * ace/Thread_Manager.h:
+ * ace/Timer_Hash_T.cpp:
+ Fixed coverity errors
- Also fixed an error where it was possible to lose notice of a
- notification. Resolves Bugzilla #3328.
+Wed Mar 7 10:55:28 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Aug 25 09:49:41 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * rpmbuild/ace-tao.spec:
+ Added new libraries
- * ace/Arg_Shifter.h:
- * ace/config-macosx-leopard.h:
- * ace/Guard_T.h:
- * ace/Global_Macros.h:
- Selected changes from patches in Bugzilla 3652.
+Wed Mar 7 10:02:49 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Aug 24 14:21:01 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * NEWS:
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ * docs/Download.html:
+ * docs/bczar/bczar.html:
+ * etc/index.html:
+ Updated for release
- * ace/OS_NS_Thread.h:
- Layout changes
+Wed Mar 07 09:04:40 CET 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/config-win32-common.h:
- Improved MinGW GCC 4.4 support. Thanks to
- Jani Hakala <jani dot j dot hakala at jyu dot fi> for creating the
- patch
+ * ACE version 6.1.0 released.
-Tue Aug 24 14:15:45 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl>
+Sat Mar 3 20:48:15 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Log_Msg.cpp
- * ace/Log_Msg.h
- * tests/Log_Msg_Test.cpp
- Revert changes for logging thread id as argument.
+ * ace/Thread_Manager.cpp:
+ Coverity fix
-Tue Aug 24 12:59:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Sat Mar 3 20:45:30 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * protocols/ace/INet/ClientRequestHandler.h:
- * protocols/ace/INet/URLBase.h:
- * protocols/ace/INet/HTTP_ClientRequestHandler.h:
- Changes to fix export problems with nested classes with MSVC 7/8.
+ * ace/Event_Handler_Handle_Timeout_Upcall.cpp:
+ Coverity fix
-Tue Aug 24 11:29:45 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl>
+Sat Mar 3 20:22:09 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Log_Msg.h:
- * ace/Log_Msg.cpp:
- * tests/Log_Msg_Test.cpp:
- * ChangeLog:
- Add %#t to log a thread id that is coming from user code, as argument .
+ * ace/Compression/rle/RLECompressor.h:
+ Fixed export macro
-Mon Aug 23 19:51:59 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+Fri Mar 2 12:41:21 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * tests/Missing_Svc_Conf_Test.cpp:
+ * ace/Compression/rle/RLECompressor.h:
+ Fixed export macro
- Fix some scoreboard problems.
+Wed Feb 29 16:30:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
-Mon Aug 23 15:05:56 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ * ace/CDR_Stream.cpp:
+ Allow strings to be indirected (required for ValueType RepoIDs).
- * ace/Select_Reactor.h:
+Wed Feb 29 07:25:21 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- vc10 needs an "ACE_Export" declaration on the explicit template
- instantiation of ACE_Select_Reactor.
+ * ace/Handle_Set.cpp:
+ * ace/Select_Reactor_Base.cpp:
+ * ace/Service_Types.cpp:
+ Fixed coverity errors
-Mon Aug 23 13:23:03 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue Feb 28 14:35:36 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/config-kfreebsd.h:
- New config file for kfreebsd
+ * ace/Process.cpp:
+ Fixed coverity error
- * ace/config-win32-common.h:
- Removed commented out defines
+Tue Feb 28 03:27:28 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
-Mon Aug 23 11:57:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ *
+ apps/JAWS3/jaws3/Reactive_IO.cpp (JAWS_IO_Reactive_Transmit::handle_output_source):
+ Check mb == 0 before using it. Thanks to Andrey Karpov <karpov
+ at viva64 dot com> for reporting this.
- * protocols/ace/INet/INet_SSL_Export.h:
- * protocols/ace/INet/HTTPS_Context.h:
- * protocols/ace/INet/HTTPS_SessionFactory.h:
- * protocols/ace/INet/HTTPS_URL.h:
- * protocols/ace/INet/SSL_CallbackManager.h:
- * protocols/ace/INet/SSL_CertificateCallback.h:
- * protocols/ace/INet/SSL_PasswordCallback.h:
- * protocols/ace/INet/SSL_X509Cert.h:
- * protocols/ace/INet/inet_ssl.mpc:
- Changes to fix MSVC 7/8 link errors.
+Tue Feb 28 03:18:56 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
-Mon Aug 23 11:34:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ace/Throughput_Stats.cpp (ACE_Throughput_Stats::sample): Zapped
+ a redundant else statement. Thanks to Andrey Karpov <karpov at
+ viva64 dot com> for reporting this.
- * protocols/ace/INet/HTTPS_URL.h:
- Fixed GCC41 error concerning comma at end of enum list.
+Tue Feb 28 03:15:37 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
-Sat Aug 21 12:53:05 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+ * protocols/ace/INet/URLBase.cpp (ACE): Changed
- * tests/Missing_Svc_Conf_Test.cpp:
+ if (pos > 0 && url_string[pos+1] == '/' && url_string[pos+1] == '/')
- Added a descriptive comment block to the source.
+ to
-Fri Aug 20 13:29:22 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+ if (pos > 0 && url_string[pos+1] == '/' && url_string[pos+2] == '/')
- * ace/Service_Gestalt.cpp:
+ Thanks to Andrey Karpov <karpov at viva64 dot com> for reporting
+ this.
- One more shot at fixing the behavior of the service configurator
- in the face of missing defaulted svc.conf file.
+Mon Feb 27 08:11:06 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * tests/Missing_Svc_Conf_Test.cpp:
- * tests/run_test.lst:
- * tests/tests.mpc:
+ * ace/Compression/rle/RLECompressor.h:
+ Doxygen fix
- Added a proper test to ensure changes to this behavior are caught
- in the future.
+ * ace/Compression/rle/RLECompressor.cpp:
+ Fixed gcc warning
-Fri Aug 20 11:58:20 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Feb 24 09:19:40 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/TSS_T.cpp:
- Updated comment
+ * ace/Compression/Compressor.h:
+ Fixed compile warning
- * include/makeinclude/platform_g++_common.GNU:
- If minimaltoc is set to 1, add -mminimal-toc to compiler flags
+Fri Feb 24 09:14:22 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * include/makeinclude/platform_linux.GNU:
- Removed check for ppc64, if you build for ppc64 and need -mminimal-toc
- add minimaltoc=1 to your platform_macros.GNU file
+ * ace/Compression/Compressor.h:
+ * ace/Compression/Compressor.cpp:
+ * ace/Compression/rle/RLECompressor.h:
+ * ace/Compression/rle/RLECompressor.cpp:
+ Added virtual destructors
-Fri Aug 20 09:52:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Fri Feb 24 08:45:08 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * protocols/ace/INet/inet_ssl.mpb:
- Removed feature subproject config.
+ * ace/Compression/ACE_Compression.mpc:
+ * ace/Compression/rle/ACE_RLECompression.mpc:
+ Fixed id and install problems
- * protocols/ace/INet/inet_ssl.mpc:
- Added sublibrary project I forgot yesterday.
+ * bin/fuzz.pl:
+ Extended check for incorrect id tags
-Thu Aug 19 12:37:14 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Thu Feb 23 08:20:56 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Functor_T.h:
- Doxygen changes
+ * ace/Compression/Compressor.h:
+ * ace/Compression/rle/RLECompressor.h:
+ * bin/MakeProjectCreator/config/ace_compressionlib.mpb:
+ * bin/MakeProjectCreator/config/ace_rlecompressionlib.mpb:
+ Fuzz fixes
- * include/makeinclude/platform_linux.GNU:
- Make it possible to control -mminimal-toc through the
- platform_macros.GNU file using minimaltoc
+Thu Feb 23 07:52:58 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Compression:
+ * ace/Compression/ACE_Compression.mpc:
+ * ace/Compression/ACE_Compression_export.h:
+ * ace/Compression/Compressor.h:
+ * ace/Compression/Compressor.inl:
+ * ace/Compression/Compressor.cpp:
+ * ace/Compression/rle:
+ * ace/Compression/rle/ACE_RLECompression.mpc:
+ * ace/Compression/rle/ACE_RLECompression_export.h:
+ * ace/Compression/rle/RLECompressor.h:
+ * ace/Compression/rle/RLECompressor.cpp:
+ * bin/MakeProjectCreator/config/ace_compressionlib.mpb:
+ * bin/MakeProjectCreator/config/ace_rlecompressionlib.mpb:
+ Added new ACE compression and rle compressor libraries. This code
+ was first part of TAO, but now moved to ACE because it provides
+ a basic run length encoding compressor that makes it possible to
+ compress data without depending on any external library
-Thu Aug 19 12:09:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * docs/bczar/bczar.html:
+ Added package
- * bin/MakeProjectCreator/config/inet.mpb:
- * bin/MakeProjectCreator/config/inetssl.mpb:
- * protocols/ace/INet/inet.mpc:
- * protocols/ace/INet/inet_ssl.mpb:
- Changes to split INet into 2 libraries; regular and SSL.
- Fixes dependencies of DAnCE tools on SSL.
+Tue Feb 21 14:52:02 UTC 2012 Adam Mitz <mitza@ociweb.com>
-Wed Aug 18 09:26:04 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ * ace/OS_NS_Thread.inl:
+ * ace/config-vxworks6.9.h:
- * netsvcs/lib/Client_Logging_Handler.cpp:
- Fixed a compile warning.
+ Fixed errors from fuzz script.
-Tue Aug 17 07:34:31 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl>
+Tue Feb 21 14:37:47 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/CDR_Stream.cpp
- Add Id
+ * PROBLEM-REPORT-FORM:
+ Removed build method question
-Mon Aug 16 22:00:06 UTC 2010 Adam Mitz <mitza@ociweb.com>
+Fri Feb 17 23:10:37 UTC 2012 Adam Mitz <mitza@ociweb.com>
- * examples/Reactor/Misc/Reactor_Misc.mpc:
+ * NEWS:
+ * ace/Message_Queue_T.cpp:
+ * ace/Message_Queue_Vx.cpp:
+ * ace/OS_NS_Thread.inl:
+ * ace/OS_NS_arpa_inet.cpp:
+ * ace/OS_NS_unistd.inl:
+ * ace/Stack_Trace.cpp:
+ * ace/config-vxworks.h:
+ * ace/config-vxworks6.9.h:
+ * ace/os_include/sys/os_types.h:
+ * include/makeinclude/platform_vxworks.GNU:
+ * include/makeinclude/platform_vxworks6.9.GNU:
+ * tests/Bug_3943_Regression_Test.cpp:
- Explicitly list an empty Template_Files so that the *_t.cpp doesn't
- get added to Template_Files.
+ Added support for VxWorks version 6.9.
-Mon Aug 16 12:58:31 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl>
+Tue Feb 14 22:57:00 UTC 2012 William R. Otte <wotte@dre.vanderbilt.edu>
- * ace/Auto_Event.cpp:
- * ace/CDR_Stream.cpp:
- * ace/Cleanup.cpp:
- * ace/Codecs.cpp:
- * ace/DEV_Addr.cpp:
- * ace/Dynamic_Service_Base.cpp:
- * ace/Filecache.cpp:
- * ace/Flag_Manip.cpp:
- * ace/FlReactor/FlReactor.cpp:
- * ace/FoxReactor/FoxReactor.cpp:
- * ace/Handle_Ops.cpp:
- * ace/Hashable.cpp:
+ * ace/ACE.cpp:
+ * ace/Dev_Poll_Reactor.cpp:
+ * ace/Handle_Set.cpp:
+ * ace/High_Res_Timer.h:
+ * ace/High_Res_Timer.cpp:
+ * ace/INET_Addr.h:
* ace/INET_Addr.cpp:
- * ace/Init_ACE.cpp:
- * ace/Local_Tokens.cpp:
- * ace/Logging_Strategy.cpp:
- * ace/Malloc.cpp:
- * ace/MEM_Addr.cpp:
- * ace/Message_Block.cpp:
- * ace/Method_Request.cpp:
- * ace/Multihomed_INET_Addr.cpp:
- * ace/Name_Request_Reply.cpp:
- * ace/OS_NS_string.cpp:
- * ace/OS_Thread_Adapter.cpp:
- * ace/Parse_Node.cpp:
- * ace/Ping_Socket.cpp:
- * ace/POSIX_Asynch_IO.cpp:
- * ace/POSIX_CB_Proactor.cpp:
- * ace/Proactor.cpp:
- * ace/Proactor_Impl.cpp:
- * ace/Process_Manager.cpp:
- * ace/QoS/QoS_Decorator.cpp:
- * ace/QoS/QoS_Manager.cpp:
- * ace/QoS/QoS_Session_Factory.cpp:
- * ace/QoS/QoS_Session_Impl.cpp:
- * ace/QoS/SOCK_Dgram_Mcast_QoS.cpp:
- * ace/Reactor.cpp:
- * ace/Refcountable_T.cpp:
- * ace/Remote_Name_Space.cpp:
- * ace/Select_Reactor_Base.cpp:
- * ace/Service_Config.cpp:
- * ace/Service_Gestalt.cpp:
- * ace/Shared_Memory_SV.cpp:
- * ace/Singleton.cpp:
- * ace/Sock_Connect.cpp:
- * ace/SSL/SSL_Asynch_BIO.cpp:
- * ace/SSL/SSL_Asynch_Stream.cpp:
- * ace/SSL/SSL_Context.cpp:
- * ace/SSL/SSL_SOCK.cpp:
- * ace/SSL/SSL_SOCK_Acceptor.cpp:
- * ace/SSL/SSL_SOCK_Connector.cpp:
- * ace/SSL/SSL_SOCK_Stream.cpp:
- * ace/SString.cpp:
- * ace/Svc_Conf.y
- * ace/Svc_Conf_y.cpp:
- * ace/Task.cpp:
- * ace/Thread_Manager.cpp:
- * ace/Timer_Hash_T.cpp:
- * ace/TkReactor/TkReactor.cpp:
- * ace/Token_Collection.cpp:
- * ace/WIN32_Asynch_IO.cpp:
+ * ace/Monitor_Control/Bytes_Received_Monitor.h:
+ * ace/Monitor_Control/Bytes_Received_Monitor.cpp:
+ * ace/Monitor_Control/Bytes_Sent_Monitor.h:
+ * ace/Monitor_Control/Bytes_Sent_Monitor.cpp:
+ * ace/Monitor_Control/CPU_Load_Monitor.h:
+ * ace/Monitor_Control/CPU_Load_Monitor.cpp:
+ * ace/Monitor_Control/Linux_Network_Interface_Monitor.h:
+ * ace/Monitor_Control/Linux_Network_Interface_Monitor.cpp:
+ * ace/Monitor_Control/Num_Threads_Monitor.h:
+ * ace/Monitor_Control/Num_Threads_Monitor.cpp:
+ * ace/Monitor_Control/Packets_Received_Monitor.h:
+ * ace/Monitor_Control/Packets_Received_Monitor.cpp:
+ * ace/Monitor_Control/Packets_Sent_Monitor.h:
+ * ace/Monitor_Control/Packets_Sent_Monitor.cpp:
+ * ace/OS_NS_netdb.cpp:
+ * ace/OS_NS_sys_socket.h:
+ * ace/OS_NS_sys_socket.inl:
+ * ace/OS_NS_time.inl:
+ * ace/OS_NS_unistd.inl:
+ * ace/SOCK_Dgram.cpp:
+ * ace/SOCK_Dgram_Mcast.cpp:
+ * ace/Select_Reactor_T.cpp:
+ * ace/config-linux.h:
+ * ace/os_include/os_pthread.h:
+ * apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/systems.h:
+ * examples/APG/Signals/SigInfo.cpp:
+ * tests/INET_Addr_Test_IPV6.cpp:
+ * tests/MT_Reference_Counted_Event_Handler_Test.cpp:
+ * tests/Malloc_Test.cpp:
+ * tests/Multicast_Test.cpp:
+ * tests/Naming_Test.cpp:
+ * tests/Proactor_Test.cpp:
+ * tests/Proactor_Test_IPV6.cpp:
+ * tests/Proactor_UDP_Test.cpp:
+ * tests/Process_Test.cpp:
+ * tests/SSL/Bug_2912_Regression_Test.cpp:
+
+ Created a new macro, ACE_LINUX, which replaces all non-standard
+ tests for linux, __linux, and __linux__.
+
+Mon Feb 13 16:38:15 UTC 2012 Adam Mitz <mitza@ociweb.com>
+
+ * include/makeinclude/platform_gnuwin32_common.GNU:
+
+ Set DCCFLAGS and OCCFLAGS to get debug=X and optimize=X to work.
+
+Tue Feb 7 12:56:41 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
* ace/XtReactor/XtReactor.cpp:
- Removed ACE_RCSID
+ Use C++ cast to silence warning
-Thu Aug 12 16:07:55 UTC 2010 Steve Huston <shuston@riverace.com>
+Tue Jan 31 20:19:16 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * configure.ac: Added feature test for ACE_LACKS_STRUCT_LIFNUM.
+ * examples/Web_Crawler/Iterators.cpp:
+ * performance-tests/Misc/context_switch_time.cpp:
+ Fixed gcc 4.7 warning
-Thu Aug 12 08:39:31 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue Jan 31 20:17:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * rpmbuild/ace-tao.spec:
- Fixed problem compiling FC packages on OSB
+ * examples/IPC_SAP/SOCK_SAP/CPP-memclient.cpp:
+ Fixed gcc 4.7 warning
-Wed Aug 11 20:50:37 UTC 2010 Adam Mitz <mitza@ociweb.com>
+Mon Jan 30 09:48:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
- * bin/MakeProjectCreator/templates/gnu.mpd:
+ * ace/Default_Constants.h:
+ Redefined ACE_MAX_UDP_PACKET_SIZE to 65507 bytes. The actual field size
+ sets a theoretical limit of 65,535 bytes (so 65536 was completly wrong)
+ which is composed of 8 byte header +65,527 bytes of data for a UDP datagram.
+ However the practical limit for the data length which is imposed by the
+ underlying IPv4 protocol is only 65,507 bytes (65507 bytes of data +8 bytes
+ UDP header +20 bytes IP header).
- With ARCH set, we need to create the local ARCH directory for the
- executable in case there are no object files that would otherwise
- have required it.
+Fri Jan 27 09:39:57 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Aug 11 13:45:52 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/FlReactor/FlReactor.cpp:
+ Const change
- * ace/config-g++-common.h:
- Only enable GCC builtin atomic op when threads are enabled. Thanks to
- Rafi <rafi dot net at gmail dot com> for reporting this
+ * bin/valgrind.supp:
+ Added another suppress
-Tue Aug 10 17:24:05 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Jan 27 09:01:51 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ACEXML/apps/svcconf/Svcconf.cpp:
- Fixed compile problem
+ * NEWS:
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ * bin/make_release.py:
+ * docs/Download.html:
+ * docs/bczar/bczar.html:
+ * etc/index.html:
+ Updated for next release
-Tue Aug 10 08:55:17 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Fri Jan 27 08:58:54 CET 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Makefile.am:
- Removed zapped file
+ * ACE version 6.0.8 released.
-Mon Aug 9 17:14:27 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+Thu Jan 26 20:38:47 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
- * THANKS:
+ * ace/Condition_T.cpp:
- Added Robert Shectman <shectman at llnl dot gov>
+ In order to allow building with inlining on MacOSX Lion,
+ Condition_T.cpp needs to explicitly include Time_Value.h. In many
+ cases, Time_Value.h was being incidentally included, such as
+ through Atomic_Op_GCC_T.cpp, but that is specifically excluded for
+ Lion builds using the clang compiler.
-Mon Aug 9 16:02:08 UTC 2010 Adam Mitz <mitza@ociweb.com>
+Tue Jan 24 16:44:22 UTC 2012 Chip Jones <jonesc@ociweb.com>
- * include/makeinclude/platform_vxworks6.3.GNU:
- * include/makeinclude/platform_vxworks6.8.GNU:
+ * NEWS:
+ Added information about IDL dependency generation.
- The location of user-mode (RTP) libraries has changed in 6.8.
+Tue Jan 24 15:26:24 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Mon Aug 9 15:14:43 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/MakeProjectCreator/config/conv_lib.mpb:
+ Fixed cleanup bug
- * ACEXML/apps/svcconf/Svcconf_Handler.cpp:
- Zap emulated exception macros
+Tue Jan 24 14:40:00 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/config-macros.h:
- Only define ACE_HAS_EXCEPTIONS when it is not defined yet
+ * bin/fuzz.pl:
+ Can't check mpc files, when they contain gnuace specific stuff they
+ need tabs
-Mon Aug 9 06:38:34 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue Jan 24 14:29:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/config-sunos5.5.h:
- Fixed compile error
+ * bin/fuzz.pl:
+ Fixed problem
-Mon Aug 9 06:35:14 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue Jan 24 13:52:20 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/ace.mpc:
- Removed zapped file
+ * bin/fuzz.pl:
+ Also check mpc files for tabs
+
+Tue Jan 24 13:48:49 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * apps/JAWS2/HTTPU/httpu.mpc:
+ * apps/JAWS2/JAWS/jaws2.mpc:
+ * apps/JAWS3/jaws3/jaws3.mpc:
+ * apps/gperf/tests/gperf_test.mpb:
+ * bin/MakeProjectCreator/config/ace_bzip2.mpb:
+ * bin/MakeProjectCreator/config/ace_fl.mpb:
+ * bin/MakeProjectCreator/config/ace_fox.mpb:
+ * bin/MakeProjectCreator/config/ace_openssl.mpb:
+ * bin/MakeProjectCreator/config/ace_output.mpb:
+ * bin/MakeProjectCreator/config/ace_qt.mpb:
+ * bin/MakeProjectCreator/config/ace_tk.mpb:
+ * bin/MakeProjectCreator/config/ace_x11.mpb:
+ * bin/MakeProjectCreator/config/ace_xt.mpb:
+ * bin/MakeProjectCreator/config/ace_zlib.mpb:
+ * bin/MakeProjectCreator/config/ace_zzip.mpb:
+ * bin/MakeProjectCreator/config/acedefaults.mpb:
+ * bin/MakeProjectCreator/config/conv_lib.mpb:
+ * bin/MakeProjectCreator/config/wxwindows.mpb:
+ * netsvcs/servers/servers.mpc:
+ * performance-tests/Synch-Benchmarks/Base_Test/Synch_Benchmarks_Base_Test.mpc:
+ * performance-tests/Synch-Benchmarks/Perf_Test/Synch_Benchmarks_Perf_Test.mpc:
+ * tests/tests.mpc:
+ Removed left over from automake removal
-Sun Aug 8 23:31:32 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+Tue Jan 24 13:31:49 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/config-macosx-snowleopard.h:
+ * examples/Reactor/WFMO_Reactor/Network_Events.cpp:
+ Fixed gcc warning
- Clang uses ACE_ANY_OPS_USE_NAMESPACE.
+Mon Jan 23 20:21:50 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Aug 6 17:36:45 UTC 2010 Adam Mitz <mitza@ociweb.com>
+ * bin/MakeProjectCreator/templates/gnu.mpd:
+ Fixed support for idl3toxmi and idl3toidl2 flags
+
+Mon Jan 23 12:02:07 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * bin/MakeProjectCreator/templates/gnu.mpd:
+ Added support for idl3toxmi and idl3toidl2 flags
+
+Sun Jan 22 19:41:27 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * examples/Reactor/WFMO_Reactor/APC.cpp:
+ * examples/Reactor/WFMO_Reactor/Abandoned.cpp:
+ * examples/Reactor/WFMO_Reactor/Directory_Changes.cpp:
+ * examples/Reactor/WFMO_Reactor/Handle_Close.cpp:
+ * examples/Reactor/WFMO_Reactor/Network_Events.cpp:
+ * examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp:
+ * examples/Reactor/WFMO_Reactor/Registration.cpp:
+ * examples/Reactor/WFMO_Reactor/Registry_Changes.cpp:
+ * examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp:
+ * examples/Reactor/WFMO_Reactor/Talker.cpp:
+ * examples/Reactor/WFMO_Reactor/Window_Messages.cpp:
+ Fixed GCC 4.6.2 release warnings
+
+Sun Jan 22 12:35:11 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * bin/make_release.py:
+ Use the new MPC -workers option to speedup the release process
+
+Fri Jan 20 19:30:51 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * examples/APG/Processes/Process_Mutex.cpp:
+ Use ACE_TEST_ASSERT instead of ACE_ASSERT to fix warnings in gcc 4.6
+ release builds
+
+Fri Jan 20 19:06:02 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * examples/APG/Containers/Allocator.cpp:
+ * examples/Reactor/Misc/test_timer_queue.cpp:
+ Use ACE_TEST_ASSERT instead of ACE_ASSERT to fix warnings in gcc 4.6
+ release builds
+
+Wed Jan 18 09:02:18 UTC 2012 Martin Corino <mcorino@remedy.nl>
* bin/fuzz.pl:
+ Added suppress option to selectively disable checks.
- Added a "trailing whitespace" check (not enabled by default).
- Added the ability to pass multiple test names on the command line.
- Extend the "too long file name" check to some additional file types.
+Tue Jan 17 17:36:31 UTC 2012 Chip Jones <jonesc@ociweb.com>
-Fri Aug 6 08:39:38 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * include/makeinclude/rules.local.GNU:
+ Fixed 'no filename for -include' warning.
- * protocols/ace/TMCast/TMCast.mpc:
- Removed exceptions as base project
+Mon Jan 16 21:58:44 UTC 2012 Chip Jones <jonesc@ociweb.com>
-Thu Aug 5 16:56:01 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/DependencyGenerator/GNUIDLDependencyWriter.pm:
+ * bin/DependencyGenerator/GNUIDLObjectGenerator.pm:
+ * bin/MakeProjectCreator/config/ace_idl_dependencies.mpb:
- * bin/MakeProjectCreator/config/tmcast.mpb:
- * protocols/tests/RMCast/RMCast.mpc:
- Removed exceptions as base project
+ Added these files to support generation of IDL dependencies
+ for gnuace projects.
-Thu Aug 5 09:00:49 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/MakeProjectCreator/config/acedefaults.mpb:
+ * bin/MakeProjectCreator/config/global.features:
- * ace/ACE.cpp:
- * ace/ACE_crc32.cpp:
- * ace/ACE_crc_ccitt.cpp:
- * ace/ARGV.cpp:
- * ace/ATM_Acceptor.cpp:
- * ace/ATM_Addr.cpp:
- * ace/ATM_Connector.cpp:
- * ace/ATM_Params.cpp:
- * ace/ATM_QoS.cpp:
- * ace/ATM_Stream.cpp:
- * ace/Acceptor.cpp:
- * ace/Activation_Queue.cpp:
- * ace/Active_Map_Manager.cpp:
- * ace/Addr.cpp:
- * ace/Arg_Shifter.cpp:
- * ace/Argv_Type_Converter.cpp:
- * ace/Assert.cpp:
- * ace/Asynch_Acceptor.cpp:
- * ace/Asynch_IO.cpp:
- * ace/Asynch_Pseudo_Task.cpp:
- * ace/Atomic_Op.cpp:
- * ace/Atomic_Op_GCC_T.cpp:
- * ace/Atomic_Op_T.cpp:
- * ace/Auto_Ptr.cpp:
- * ace/Barrier.cpp:
- * ace/Base_Thread_Adapter.cpp:
- * ace/Basic_Stats.cpp:
- * ace/CDR_Base.cpp:
- * ace/Capabilities.cpp:
- * ace/Codeset_IBM1047.cpp:
- * ace/Codeset_Registry.cpp:
- * ace/Condition_Thread_Mutex.cpp:
- * ace/Connection_Recycling_Strategy.cpp:
- * ace/Containers.cpp:
- * ace/Copy_Disabled.cpp:
- * ace/Countdown_Time.cpp:
- * ace/DEV.cpp:
- * ace/DEV_Connector.cpp:
- * ace/DEV_IO.cpp:
- * ace/DLL.cpp:
- * ace/DLL_Manager.cpp:
- * ace/Date_Time.cpp:
- * ace/Dev_Poll_Reactor.cpp:
- * ace/Dirent_Selector.cpp:
- * ace/Dump.cpp:
- * ace/Dynamic.cpp:
- * ace/Dynamic_Message_Strategy.cpp:
- * ace/Dynamic_Service_Dependency.cpp:
- * ace/Event.cpp:
- * ace/Event_Handler.cpp:
- * ace/FIFO.cpp:
- * ace/FIFO_Recv.cpp:
- * ace/FIFO_Recv_Msg.cpp:
- * ace/FIFO_Send.cpp:
- * ace/FIFO_Send_Msg.cpp:
- * ace/FILE.cpp:
- * ace/FILE_Addr.cpp:
- * ace/FILE_Connector.cpp:
- * ace/FILE_IO.cpp:
- * ace/File_Lock.cpp:
- * ace/Framework_Component.cpp:
- * ace/Functor.cpp:
- * ace/Functor_String.cpp:
- * ace/Future.cpp:
- * ace/Get_Opt.cpp:
- * ace/Handle_Set.cpp:
- * ace/High_Res_Timer.cpp:
- * ace/ICMP_Socket.cpp:
- * ace/IOStream.cpp:
- * ace/IO_Cntl_Msg.cpp:
- * ace/IO_SAP.cpp:
- * ace/IPC_SAP.cpp:
- * ace/LSOCK.cpp:
- * ace/LSOCK_Acceptor.cpp:
- * ace/LSOCK_CODgram.cpp:
- * ace/LSOCK_Connector.cpp:
- * ace/LSOCK_Dgram.cpp:
- * ace/LSOCK_Stream.cpp:
- * ace/Lib_Find.cpp:
- * ace/Local_Memory_Pool.cpp:
- * ace/Local_Name_Space.cpp:
- * ace/Lock.cpp:
- * ace/Log_Msg.cpp:
- * ace/Log_Msg_Backend.cpp:
- * ace/Log_Msg_Callback.cpp:
- * ace/Log_Msg_IPC.cpp:
- * ace/Log_Msg_NT_Event_Log.cpp:
- * ace/Log_Record.cpp:
- * ace/MEM_Acceptor.cpp:
- * ace/MEM_Connector.cpp:
- * ace/MEM_IO.cpp:
- * ace/MEM_SAP.cpp:
- * ace/MEM_Stream.cpp:
- * ace/MMAP_Memory_Pool.cpp:
- * ace/Malloc_Allocator.cpp:
- * ace/Manual_Event.cpp:
- * ace/Mem_Map.cpp:
- * ace/Message_Queue.cpp:
- * ace/Message_Queue_NT.cpp:
- * ace/Message_Queue_Vx.cpp:
- * ace/Msg_WFMO_Reactor.cpp:
- * ace/Mutex.cpp:
- * ace/Name_Proxy.cpp:
- * ace/Name_Space.cpp:
- * ace/Naming_Context.cpp:
- * ace/Notification_Strategy.cpp:
- * ace/OS.cpp:
- * ace/OS_Errno.cpp:
- * ace/OS_Log_Msg_Attributes.cpp:
- * ace/OS_NS_Thread.cpp:
- * ace/OS_NS_arpa_inet.cpp:
- * ace/OS_NS_ctype.cpp:
- * ace/OS_NS_dirent.cpp:
- * ace/OS_NS_dlfcn.cpp:
- * ace/OS_NS_errno.cpp:
- * ace/OS_NS_fcntl.cpp:
- * ace/OS_NS_math.cpp:
- * ace/OS_NS_netdb.cpp:
- * ace/OS_NS_poll.cpp:
- * ace/OS_NS_pwd.cpp:
- * ace/OS_NS_regex.cpp:
- * ace/OS_NS_signal.cpp:
- * ace/OS_NS_stdio.cpp:
- * ace/OS_NS_stdlib.cpp:
- * ace/OS_NS_strings.cpp:
- * ace/OS_NS_stropts.cpp:
- * ace/OS_NS_sys_mman.cpp:
- * ace/OS_NS_sys_msg.cpp:
- * ace/OS_NS_sys_resource.cpp:
- * ace/OS_NS_sys_select.cpp:
- * ace/OS_NS_sys_shm.cpp:
- * ace/OS_NS_sys_socket.cpp:
- * ace/OS_NS_sys_stat.cpp:
- * ace/OS_NS_sys_time.cpp:
- * ace/OS_NS_sys_uio.cpp:
- * ace/OS_NS_sys_utsname.cpp:
- * ace/OS_NS_sys_wait.cpp:
- * ace/OS_NS_time.cpp:
- * ace/OS_NS_unistd.cpp:
- * ace/OS_NS_wchar.cpp:
- * ace/OS_NS_wctype.cpp:
- * ace/OS_TLI.cpp:
- * ace/OS_main.cpp:
- * ace/Obchunk.cpp:
- * ace/Object_Manager.cpp:
- * ace/Object_Manager_Base.cpp:
- * ace/PI_Malloc.cpp:
- * ace/Pagefile_Memory_Pool.cpp:
- * ace/Pipe.cpp:
- * ace/Priority_Reactor.cpp:
- * ace/Process.cpp:
- * ace/Process_Mutex.cpp:
- * ace/Process_Semaphore.cpp:
- * ace/Profile_Timer.cpp:
- * ace/RW_Mutex.cpp:
- * ace/RW_Process_Mutex.cpp:
- * ace/RW_Thread_Mutex.cpp:
- * ace/Reactor_Impl.cpp:
- * ace/Reactor_Notification_Strategy.cpp:
- * ace/Reactor_Timer_Interface.cpp:
- * ace/Read_Buffer.cpp:
- * ace/Recursive_Thread_Mutex.cpp:
- * ace/Recyclable.cpp:
- * ace/Registry.cpp:
- * ace/Registry_Name_Space.cpp:
- * ace/Remote_Tokens.cpp:
- * ace/SOCK.cpp:
- * ace/SOCK_Acceptor.cpp:
- * ace/SOCK_CODgram.cpp:
- * ace/SOCK_Connector.cpp:
- * ace/SOCK_Dgram.cpp:
- * ace/SOCK_Dgram_Bcast.cpp:
- * ace/SOCK_Dgram_Mcast.cpp:
- * ace/SOCK_IO.cpp:
- * ace/SOCK_SEQPACK_Acceptor.cpp:
- * ace/SOCK_SEQPACK_Association.cpp:
- * ace/SOCK_SEQPACK_Connector.cpp:
- * ace/SOCK_Stream.cpp:
- * ace/SPIPE.cpp:
- * ace/SPIPE_Acceptor.cpp:
- * ace/SPIPE_Addr.cpp:
- * ace/SPIPE_Connector.cpp:
- * ace/SPIPE_Stream.cpp:
- * ace/SUN_Proactor.cpp:
- * ace/SV_Message.cpp:
- * ace/SV_Message_Queue.cpp:
- * ace/SV_Semaphore_Complex.cpp:
- * ace/SV_Semaphore_Simple.cpp:
- * ace/SV_Shared_Memory.cpp:
- * ace/Sample_History.cpp:
- * ace/Sbrk_Memory_Pool.cpp:
- * ace/Sched_Params.cpp:
- * ace/Select_Reactor_T.cpp:
- * ace/Semaphore.cpp:
- * ace/Service_Manager.cpp:
- * ace/Service_Object.cpp:
- * ace/Service_Repository.cpp:
- * ace/Service_Types.cpp:
- * ace/Shared_Memory.cpp:
- * ace/Shared_Memory_MM.cpp:
- * ace/Shared_Memory_Pool.cpp:
- * ace/Shared_Object.cpp:
- * ace/Sig_Adapter.cpp:
- * ace/Sig_Handler.cpp:
- * ace/Signal.cpp:
- * ace/Stack_Trace.cpp:
- * ace/Stats.cpp:
- * ace/Synch_Options.cpp:
- * ace/System_Time.cpp:
- * ace/TLI.cpp:
- * ace/TLI_Acceptor.cpp:
- * ace/TLI_Connector.cpp:
- * ace/TLI_Stream.cpp:
- * ace/TP_Reactor.cpp:
- * ace/TSS_Adapter.cpp:
- * ace/TTY_IO.cpp:
- * ace/Thread.cpp:
- * ace/Thread_Adapter.cpp:
- * ace/Thread_Control.cpp:
- * ace/Thread_Exit.cpp:
- * ace/Thread_Hook.cpp:
- * ace/Thread_Mutex.cpp:
- * ace/Thread_Semaphore.cpp:
- * ace/Throughput_Stats.cpp:
- * ace/Time_Value.cpp:
- * ace/Timeprobe.cpp:
- * ace/Timer_List_T.cpp:
- * ace/Token.cpp:
- * ace/Token_Invariants.cpp:
- * ace/Token_Manager.cpp:
- * ace/Token_Request_Reply.cpp:
- * ace/Trace.cpp:
- * ace/UNIX_Addr.cpp:
- * ace/UPIPE_Acceptor.cpp:
- * ace/UPIPE_Connector.cpp:
- * ace/UPIPE_Stream.cpp:
- * ace/UUID.cpp:
- * ace/WFMO_Reactor.cpp:
- * ace/WIN32_Proactor.cpp:
- * ace/XTI_ATM_Mcast.cpp:
- * ace/ace_wchar.cpp:
- * ace/gethrtime.cpp:
- Removed ACE_RCSID
+ Added IDL dependency as a feature defaulted to off.
-Thu Aug 5 08:13:51 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/MakeProjectCreator/templates/gnu.mpd:
- * ace/CORBA_macros.h:
- * ace/Global_Macros.h:
- * ace/Vector_T.h:
- * ace/ace_wchar.h:
- * ace/config-cxx-common.h:
- * ace/config-doxygen.h:
- * ace/config-g++-common.h:
- * ace/config-hpux-11.00.h:
- * ace/config-icc-common.h:
- * ace/config-integritySCA.h:
- * ace/config-macros.h:
- * ace/config-netbsd.h:
- * ace/config-openvms.h:
- * ace/config-suncc-common.h:
- * ace/config-sunos5.4-sunc++-4.x.h:
- * ace/config-sunos5.5.h:
- * ace/config-tandem-nsk-mips-v2.h:
- * ace/config-tandem-nsk-mips-v3.h:
- * ace/config-unixware-7.1.0.h:
- * ace/config-unixware-7.1.0.udk.h:
- * ace/config-win32-borland.h:
- * ace/config-win32-dmc.h:
- * ace/config-win32-ghs.h:
- * ace/config-win32-interix.h:
- * ace/config-win32-msvc-10.h:
- * ace/config-win32-msvc-7.h:
- * ace/config-win32-msvc-8.h:
- * ace/config-win32-msvc-9.h:
- * include/makeinclude/platform_aix.GNU:
- * include/makeinclude/platform_aix_g++.GNU:
- * include/makeinclude/platform_aix_ibm.GNU:
- * include/makeinclude/platform_cray.GNU:
- * include/makeinclude/platform_freebsd.GNU:
- * include/makeinclude/platform_gnuwin32_common.GNU:
- * include/makeinclude/platform_hpux_aCC.GNU:
- * include/makeinclude/platform_hpux_gcc.GNU:
- * include/makeinclude/platform_integrity_ghs.GNU:
- * include/makeinclude/platform_irix6.x_common.GNU:
- * include/makeinclude/platform_linux_common.GNU:
- * include/makeinclude/platform_lynxos.GNU:
- * include/makeinclude/platform_macosx.GNU:
- * include/makeinclude/platform_macosx_common.GNU:
- * include/makeinclude/platform_macosx_icc.GNU:
- * include/makeinclude/platform_macosx_panther.GNU:
- * include/makeinclude/platform_netbsd.GNU:
- * include/makeinclude/platform_openbsd.GNU:
- * include/makeinclude/platform_openvms.GNU:
- * include/makeinclude/platform_qnx_rtp_gcc.GNU:
- * include/makeinclude/platform_rtems.x_g++.GNU:
- * include/makeinclude/platform_sunos5_g++.GNU:
- * include/makeinclude/platform_sunos5_sunc++.GNU:
- * include/makeinclude/platform_tandem.GNU:
- * include/makeinclude/platform_tru64_cxx.GNU:
- * include/makeinclude/platform_tru64_g++.GNU:
- * include/makeinclude/platform_unixware_g++.GNU:
- * include/makeinclude/platform_vxworks5.5.x.GNU:
- * include/makeinclude/platform_vxworks6.2.GNU:
- * include/makeinclude/platform_vxworks6.3.GNU:
- * include/makeinclude/platform_win32_dmc.GNU:
- * include/makeinclude/platform_win32_icc.GNU:
- * include/makeinclude/platform_win32_interix.GNU:
+ Modified gnuace template to generate IDL dependency rules.
+
+ * include/makeinclude/rules.common.GNU:
+ * include/makeinclude/rules.local.GNU:
* include/makeinclude/wrapper_macros.GNU:
- * tests/Bug_3673_Regression_Test.cpp:
- * tests/Reactor_Exceptions_Test.cpp:
- * tests/tests.mpc:
- Removed support for non exception builds, ACE_HAS_EXCEPTIONS is
- now always defined
- * rpmbuild/ace-tao.spec:
- Small updates
+ Added depend_idl.local rule.
- * ace/Exception_Macros.h:
- * bin/MakeProjectCreator/config/exceptions.mpb:
- Removed these files.
+ This is a merge of work done in the 'ace-mpc_performance'
+ branch.
-Thu Aug 5 07:40:00 UTC 2010 Build CZar <buildczar at prismtech dot com>
+Mon Jan 16 10:33:37 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * ace/OS_NS_Thread.cpp:
- Add the missing ; to the lines added by the fix below.
- Wed Aug 4 14:16:46 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/config-win32-common.h:
+ * ace/config-win32-mingw.h:
+ Moved MinGW specific block to common because the macros
+ it concerns are tested there already.
-Wed Aug 4 17:21:17 UTC 2010 Chris Cleeland <cleeland@ociweb.com>
+Mon Jan 16 09:01:20 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * bin/MakeProjectCreator/config/crosscompile.mpb:
- Added specific clause for cdt6.
+ * ace/config-win32-mingw.h:
+ Fixed incorrectly placed macro test.
-Wed Aug 4 14:16:46 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Sun Jan 15 19:15:48 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * ace/OS_NS_Thread.cpp:
- Check more internal return values
+ * ace/config-win32-mingw.h:
+ Add some customizations and corrections to support using
+ --std=c++0x with MinGW32.
- * rpmbuild/ace-tao.spec-bugfixonly.patch:
- Removed this file, not needed
+Fri Jan 13 23:25:59 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu>
-Tue Aug 3 12:14:51 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * THANKS:
- * bin/generate_doxygen.pl:
- * html/index.html:
- DAnCE has its own file now and also some documentation got moved
- out of the tao directory
+ Added Michael Frommberger <michael dot frommberger at gmx dot net>
-Sun Aug 1 18:14:03 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Wed Jan 11 20:43:47 UTC 2012 Martin Corino <mcorino@remedy.nl>
- * NEWS:
- * bin/diff-builds-and-group-fixed-tests-only.sh:
- * bin/make_release.py:
- * docs/Download.html:
- * etc/index.html:
- Updated because of release
+ * ace/config-freebsd.h:
+ * ace/config-win32-common.h:
+ * ace/config-win32-mingw.h:
+ * ace/os_include/os_signal.h:
+ Added ACE_LACKS_SIGSET_T to be able to distinguish between the
+ type and the functions being provided or not.
- * debian/*:
- Did rename actions the release script didn't do, have to sort this
- out later
+Wed Jan 11 18:43:50 UTC 2012 Martin Corino <mcorino@remedy.nl>
-Sun Aug 01 11:30:54 CEST 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/config-win32-mingw.h:
+ Fixed typo.
- * ACE version 5.8.1 released.
+Wed Jan 11 15:41:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
-Thu Jul 29 14:41:32 UTC 2010 Steve Huston <shuston@riverace.com>
+ * ace/config-sunos5.10.h:
+ Is supposed to define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII and ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII
+ correctly for this platform. The old logic was "If already defined - redefine, but if not
+ defined don't define" and wrong. The point of providing the definition of these SIZE_T format
+ specifiers is to provide them if they are not set.
- * ace/Process.h (set_handles): Clarify that passing ACE_INVALID_HANDLE
- for any of the handle values will cause a duplicate of the
- corresponding ACE_STDIN/OUT/ERR to be used in the options.
+Wed Jan 11 14:36:43 UTC 2012 Martin Corino <mcorino@remedy.nl>
-Thu Jul 29 10:43:32 UTC 2010 Marcel Smit <msmit@remedy.nl>
+ * ace/config-win32-mingw.h:
+ * ace/os_include/os_signal.h:
+ Changes to support MinGW64 compiler.
- * bin/MakeProjectCreator/config/global.features:
- * bin/MakeProjectCreator/config/inetssl.mpb:
- * protocols/ace/INet/inet_ssl.mpb:
- Created a new feature, inet_ssl. When set, the INet libary
- builds, using SSL. To let the INet libary use SSL, one should
- enable the inet_ssl feature in default.features and add ssl=1 to
- the platform_macos.GNU.
+Mon Jan 9 11:07:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Mon Jul 26 20:26:53 UTC 2010 Steve Huston <shuston@riverace.com>
+ * ace/Netlink_Addr.h:
+ * ace/Notification_Queue.h:
+ Doxygen fixes
- * ace/OS_NS_Thread.h: Note that the cpu_set_size to the get/set
- affinity methods is a byte count.
+ * tests/run_test.lst:
+ Removed several old config labels
-Mon Jul 26 07:02:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Fri Jan 6 11:16:03 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/MakeProjectCreator/config/inet.mpb:
- * protocols/ace/INet/inet.mpc:
- Added avoids += corba_e_compact.
+ * html/Stats/configuration.shtml:
+ * html/Stats/index.shtml:
+ * html/Stats/simple_footprint.shtml:
+ Extended data to be shown and updated links
-Thu Jul 22 04:35:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Fri Jan 6 10:28:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/MakeProjectCreator/config/inet.mpb:
- * protocols/ace/INet/inet.mpc:
- Added avoids += ace_for_tao.
+ * ace/Stream.cpp:
+ Fixed coverity errors
-Wed Jul 21 18:23:32 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
+Wed Jan 4 13:02:12 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Basic_Types.h (ACE_INT8_FORMAT_SPECIFIER): Added the missing
- "_ASCII" to the ACE_INT8_FORMAT_SPECIFIER macro usage. Thanks
- to Andre Kostur <akostur at incognito dot com> for reporting
- this.
+ * bin/generate_compile_stats.sh:
+ Added link for DAnCE
-Wed Jul 21 15:52:32 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+Wed Jan 4 11:45:43 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Service_Gestalt.h:
- * ace/Service_Gestalt.inl:
- * ace/Service_Gestalt.cpp:
+ * html/Stats/index.shtml:
+ Fixed link
- Reverted for_TAO specific change, revised the processing to
- ensure default first, then files, then cmdline directives.
+Wed Jan 4 11:42:13 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Wed Jul 21 03:07:28 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+ * bin/generate_compile_stats.sh:
+ Work with flat layout and added DAnCE
- * ace/Service_Gestalt.h:
- * ace/Service_Gestalt.cpp:
+Wed Jan 4 11:06:50 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- Fix errors in premature committal.
+ * bin/generate_compile_stats.sh:
+ Updated title to include DAnCE
-Wed Jul 21 02:30:45 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+Wed Jan 4 08:50:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Service_Gestalt.h:
- * ace/Service_Gestalt.inl:
- * ace/Service_Gestalt.cpp:
+ * bin/cleanbuilds.sh:
+ * bin/mail_test_stats.sh:
+ Accept date and email as arguments
- Add a specialized open method to be called by TAO. TAO depends
- on a modified order of directive evaluation.
+Tue Jan 3 18:47:23 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Jul 20 18:02:03 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * bin/performance_stats.sh:
+ * bin/topinfo_iorsize_stats.sh:
+ * bin/topinfo_simple_stats.sh:
+ * bin/topinfo_stats.sh:
+ Assume ACE_ROOT is set before running the script, simplified the usage
- * docs/Download.html:
- Fixed some typos, thanks to Thomas Lockhart
- <Thomas dot lockhart at jpl dot nasa dot gov> for reporting this
+Tue Jan 3 18:34:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Jul 20 15:08:49 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+ * bin/valgrind.supp:
+ Added default suppress file that can be used for valgrind when using
+ valgrind for ACE/TAO/CIAO/DAnCE
- * tests/Bug_3319_Regression_Test.cpp:
+ * docs/bczar/bczar.html:
+ Added package
- Fix the test to be consistent with revised service config
- behavior. The test had assumed that ACE_Service_Config::open()
- would return 0 even if svc.conf were not present, but since it
- was setting the ignore_default_svc_conf_file to 0, the restore
- behavior of the service configurator is to fail with ENOENT in
- that case.
+Tue Jan 3 13:51:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Jul 20 08:48:00 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ * bin/performance_stats.sh:
+ Create source directory
- * ace/TSS_T.cpp:
- Fixed a bug in ACE_TSS::ts_get() that only exhibited on
- SunOS/Studio builds. The later configutsyion uses ACE_HAS_THR_C_DEST
- and with that define ts_get() behaved differently. In particular it
- didn't create a ts_obj if tss_adapter was not 0.
+Tue Jan 3 12:52:04 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Jul 20 07:38:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * bin/performance_stats.sh:
+ * bin/topinfo_iorsize_stats.sh:
+ * bin/topinfo_simple_stats.sh:
+ * bin/topinfo_stats.sh:
+ * bin/footprint_stats.sh:
+ Converting them to support a flat layout
- * protocols/ace/INet/SSL_CallbackManager.h:
- Fixed comment typo.
+Tue Jan 3 12:40:43 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Jul 20 05:25:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * html/Stats/detailed_footprint.shtml:
+ * html/Stats/detailed_performance.shtml:
+ * html/Stats/footer.html:
+ * html/Stats/index.shtml:
+ * html/Stats/navigation.html:
+ Updated links, docu, status
- * protocols/ace/INet/HTTP_BasicAuthentication.cpp:
- * protocols/ace/INet/HTTP_BasicAuthentication.h:
- * protocols/ace/INet/HTTP_BasicAuthentication.inl:
- * protocols/ace/INet/inet.mpc:
- Added basic support for HTTP Basic Authentication scheme.
+ * html/Stats/compilation.shtml:
+ Removed this file.
-Tue Jul 20 03:56:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Sat Dec 31 22:12:53 UTC 2011 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * protocols/ace/INet/HTTP_SessionBase.cpp:
- Fixed MSVC 7.1 compile problems.
+ * ace/Timer_Wheel_T.cpp: Changed the call to "delete root" in the
+ destructor to "this->free_node (root)" so the ACE_Timer_Wheel_T
+ will work properly when provided a custom allocator. Thanks to
+ Koh <k_onishi at mtj dot biglobe dot ne dot jp> for reporting
+ this bug and providing a fix.
- * protocols/ace/INet/HTTP_Simple_exec.cpp:
- Fixed compile problems for non-SSL builds.
+Fri Dec 30 10:13:59 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
-Tue Jul 20 03:25:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ace/config-linux.h:
+ Added support for ulibc, thanks to Chong Wuk Pak
+ <chong dot pak at lmco dot com> for providing the patch. This fixes
+ bugzilla 3999
- * bin/MakeProjectCreator/config/inetssl.mpb:
- * protocols/ace/INet/inet_ssl.mpb:
- Fuzz fixes.
+Thu Dec 29 17:29:06 UTC 2011 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
-Mon Jul 19 11:50:59 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ * ace/Mem_Map.cpp (ACE_Mem_Map::map_it): Fixed a missing '('. Thanks to Johnny for reporting this.
- * ace/TSS_T.inl:
- * ace/TSS_T.h:
- * ace/TSS_T.cpp:
- Mostly fixed bug 3539. It doesn't fix a case when main thread
- doesn't own ACE_TSS but still uses it. Fixing the later is not
- straight forward and will require a lot more efforts.
- Also rearranged the code so that it has less duplicates.
+Thu Dec 29 15:14:45 UTC 2011 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * tests/run_test.lst:
- Marked the test as fixed.
+ * ace/Mem_Map.cpp (ACE_Mem_Map::map_it): Further improved the
+ error checking. Thanks to JaeSung Lee <berise at gmail dot
+ com> for suggesting this.
-Mon Jul 19 09:15:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+Tue Dec 27 15:19:56 UTC 2011 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
- * bin/MakeProjectCreator/config/inet.mpb:
- * bin/MakeProjectCreator/config/global.features:
- * protocols/ace/INet/inet.mpc:
- Added new feature 'exclude_inet' to allow builds to
- explicitly exclude building INet.
+ * ace/Mem_Map.cpp (ACE_Mem_Map::map_it): mmap through character
+ device doesn't care about it's size, so map with /dev/* is done
+ with a special case. Thanks to JaeSung Lee <berise at gmail dot
+ com> for reporting this and providing a fix.
+
+Tue Dec 27 11:39:53 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
-Mon Jul 19 08:49:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * NEWS:
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ * docs/Download.html:
+ * docs/bczar/bczar.html:
+ * etc/index.html:
+ Updated for next release
- * protocols/ace/INet/HTTPS_Session.cpp:
- * protocols/ace/INet/HTTPS_Session.h:
- Fixed compile errors byadding version check to disable
- 'relatively' new OpenSSL functionality for builds using
- outdated OpenSSL installations (OpenSSL <= 0.9.8e).
+Tue Dec 27 10:06:28 CET 2011 Johnny Willemsen <jwillemsen@remedy.nl>
-Sat Jul 17 14:06:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ACE version 6.0.7 released.
- * protocols/ace/INet/ClientRequestHandler.h:
- * protocols/ace/INet/URLBase.h:
- Some include shuffling to fix an incomplete type warning
- with MSVC.
+Wed Dec 21 11:25:49 UTC 2011 Marcel Smit <msmit@remedy.nl>
-Sat Jul 17 11:39:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * tests/Task_Wait_Test.cpp:
+ Fixed compile issue on Solaris 10.
- * protocols/ace/INet/inet_ssl.mpb:
- Replaced ace_openssl base project by ssl. Fixes missing
- ACE_SSL lib link errors.
+Wed Dec 21 09:41:54 UTC 2011 Martin Corino <mcorino@remedy.nl>
- * protocols/ace/INet/SSL_CallbackManager.cpp:
- Fixed MSVC compile errors.
-
-Sat Jul 17 10:26:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
-
- * bin/MakeProjectCreator/config/inetssl.mpb:
- * bin/MakeProjectCreator/config/inet.mpb:
- Added feature project for SSL based parts of INet.
- Setting feature ssl=1 will automatically cause correct
- dependencies for SSL to be generated in INet based projects.
-
- * protocols/ace/INet/HTTPS_Context.cpp:
- * protocols/ace/INet/HTTPS_Context.h:
- * protocols/ace/INet/HTTPS_Context.inl:
- * protocols/ace/INet/HTTP_SessionBase.cpp:
- * protocols/ace/INet/HTTP_SessionBase.h:
- * protocols/ace/INet/HTTP_SessionBase.inl:
- * protocols/ace/INet/HTTPS_Session.cpp:
- * protocols/ace/INet/HTTPS_SessionFactory.cpp:
- * protocols/ace/INet/HTTPS_SessionFactory.h:
- * protocols/ace/INet/HTTPS_Session.h:
- * protocols/ace/INet/HTTPS_URL.cpp:
- * protocols/ace/INet/HTTPS_URL.h:
- * protocols/ace/INet/HTTPS_URL.inl:
- * protocols/ace/INet/SSL_CallbackManager.cpp:
- * protocols/ace/INet/SSL_CallbackManager.h:
- * protocols/ace/INet/SSL_CallbackManager.inl:
- * protocols/ace/INet/SSL_CertificateCallback.cpp:
- * protocols/ace/INet/SSL_CertificateCallback.h:
- * protocols/ace/INet/SSL_CertificateCallback.inl:
- * protocols/ace/INet/SSL_PasswordCallback.cpp:
- * protocols/ace/INet/SSL_PasswordCallback.h:
- * protocols/ace/INet/SSL_Proxy_Connector.cpp:
- * protocols/ace/INet/SSL_Proxy_Connector.h:
- * protocols/ace/INet/SSLSock_IOStream.cpp:
- * protocols/ace/INet/SSLSock_IOStream.h:
- * protocols/ace/INet/SSL_X509Cert.cpp:
- * protocols/ace/INet/SSL_X509Cert.h:
- * protocols/ace/INet/SSL_X509Cert.inl:
- New files implementing SSL/HTTPS support.
- Includes support for proxy CONNECT tunneling.
-
- * protocols/ace/INet/inet_ssl.mpb:
- Feature project which will include SSL/HTTPS support
- into INet when MPC feature ssl=1 is set.
-
- * protocols/ace/INet/ClientRequestHandler.cpp:
- * protocols/ace/INet/ClientRequestHandler.h:
- * protocols/ace/INet/ConnectionCache.cpp:
- * protocols/ace/INet/ConnectionCache.h:
- * protocols/ace/INet/FTP_ClientRequestHandler.cpp:
- * protocols/ace/INet/FTP_URL.cpp:
- * protocols/ace/INet/FTP_URL.h:
- * protocols/ace/INet/FTP_URL.inl:
- * protocols/ace/INet/HeaderBase.h:
- * protocols/ace/INet/HTTP_ClientRequestHandler.cpp:
- * protocols/ace/INet/HTTP_ClientRequestHandler.h:
- * protocols/ace/INet/HTTP_ClientRequestHandler.inl:
- * protocols/ace/INet/HTTP_Session.cpp:
- * protocols/ace/INet/HTTP_Session.h:
- * protocols/ace/INet/HTTP_StreamPolicyBase.h:
- * protocols/ace/INet/HTTP_StreamPolicy.h:
- * protocols/ace/INet/HTTP_URL.cpp:
- * protocols/ace/INet/HTTP_URL.h:
- * protocols/ace/INet/HTTP_URL.inl:
- * protocols/ace/INet/inet.mpc:
- * protocols/ace/INet/RequestHandler.h:
- * protocols/ace/INet/StreamHandler.cpp:
- * protocols/ace/INet/StreamInterceptor.h:
- * protocols/ace/INet/URLBase.h:
- Some redesign to accomodate addition of HTTPS.
- Some additional logging.
- Some additional documentation.
-
- * protocols/ace/INet/HTTP_Simple_exec.cpp:
- Extended to include HTTPS support.
-
- * protocols/tests/INet/MT_Get/Main.cpp:
- Added some traces.
-
-Fri Jul 16 22:08:05 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
-
- * ace/Service_Gestalt.h:
- * ace/Service_Gestalt.cpp:
+ * examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp:
- Further refinement of service initialization process. This
- restores the order of processing, and is more explicit about
- handling a defaulted svc.conf.
+ Added timer queue reset on global reactor instance.
-Thu Jul 15 17:53:47 UTC 2010 Phil Mesnier <mesnier_p@ociweb.com>
+Tue Dec 20 15:43:39 UTC 2011 Steve Huston <shuston@riverace.com>
- * ace/Service_Gestalt.cpp:
- * THANKS:
+ * tests/Task_Wait_Test.cpp:
+ * tests/tests.mpc:
+ * tests/run_test.lst:
+ New test program that tests the ACE_Thread_Manager::wait() from a
+ called-back ACE_Task::close() on thread exit.
- Restore pre-gestalt behavior of returning -1 if svc.conf does
- not exist and an ACE_Service_Config::open() is expecting to use
- the default file.
+Tue Dec 20 15:36:24 UTC 2011 Steve Huston <shuston@riverace.com>
- Thanks to Daynesh Mangal (daynesh@gmail.com) for reporting the
- errant behavior.
+ * ace/Thread.inl (disablecancel): Correct size pased to memset.
+ * ace/Thread_Manager.cpp (ACE_Thread_Descriptor::terminate): Don't
+ dereference potentially invalid pointer.
-Thu Jul 15 12:53:53 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Resolves Coverity warnings.
- * etc/ace.doxygen:
- * etc/ace_inet.doxygen:
- * etc/ace_man.doxygen:
- * etc/ace_qos.doxygen:
- * etc/ace_rmcast.doxygen:
- * etc/ace_ssl.doxygen:
- * etc/acexml.doxygen:
- Generate deprecated/todo pages
+Mon Dec 19 19:00:07 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
-Thu Jul 15 12:35:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * docs/bczar/bczar.html:
+ Added another package
- * ace/SSL/SSL_SOCK_Stream.h:
- * ace/SSL/SSL_SOCK_Stream.inl:
- Added two method overloads available in ACE_SOCK_Stream but
- missing from ACE_SSL_SOCK_Stream.
+Mon Dec 19 13:28:16 UTC 2011 Martin Corino <mcorino@remedy.nl>
-Thu Jul 15 09:49:28 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Heap_T.cpp:
+ * ace/Timer_List_T.h:
+ * ace/Timer_List_T.cpp:
+ * ace/Timer_Queue_Adapters.inl:
+ * ace/Timer_Queue_Adapters.cpp:
+ * ace/Timer_Wheel_T.h:
+ * ace/Timer_Wheel_T.cpp:
- * ace/config-doxygen.h:
- Added ACE_HAS_POSITION_INDEPENDENT_POINTERS
+ Added close() method.
-Thu Jul 15 09:29:58 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Dev_Poll_Reactor.cpp:
+ * ace/Proactor.cpp:
+ * ace/Select_Reactor_T.cpp:
+ * ace/WFMO_Reactor.cpp:
- * bin/generate_doxygen.pl:
- * etc/ace_inet.doxygen:
- * html/index.html:
- Added ACE INet library
+ Implemented support for timer queue close ().
-Thu Jul 15 09:11:51 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+ The rationale for these changes is that when using reactors with
+ user defined timer queues the reactor does not delete the timer queue
+ when being deleted itself. Without any other cleanup this created the
+ possibility (as encountered in TAO/tests/Bug_3837_Regression after
+ introduction of the TIME_POLICY changes) of outstanding timer handlers
+ in the queue being triggered and attempting to access the reactor after
+ the reactor has been destroyed.
+ Calling close () for timer queues the reactor does not delete solves
+ this potential problem.
- * ace/config-macosx-snowleopard.h:
- * include/makeinclude/platform_clang_common.GNU:
- * include/makeinclude/platform_macosx_common.GNU:
+Mon Dec 19 12:12:37 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- Preliminary support for clang compiler.
+ * bin/fuzz.pl:
+ Simplified check
-Tue Jul 13 14:39:55 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Dec 19 09:17:33 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * NEWS:
- Updated
+ * ace/ace_for_tao.mpc:
+ Added missing files
-Tue Jul 13 14:33:23 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Sun Dec 18 11:56:00 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/Cached_Connect_Strategy_T.h:
- * ace/Capabilities.h:
- Doxygen fixes
+ * ace/Timer_Queue_T.h:
+ Fixed CentOS warning
-Tue Jul 13 14:20:09 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Sun Dec 18 11:41:56 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * ace/os_include/os_errno.h:
- Fixed problems with msvc 10, , thanks to Max Zhou
- <earthdog at 126.com> for supplying these changes, this fixes
- bugzilla 3873
+ * ace/ace_for_tao.mpc:
+ Removed obsolete file
-Tue Jul 13 11:08:38 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Sun Dec 18 11:35:18 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/MakeProjectCreator/config/vc10nmake.mpb:
- * netsvcs/lib/lib.mpc:
- vc10 support, thanks to Max Zhou <earthdog at 126.com> for
- supplying these changes
+ * bin/generate_compile_stats.sh:
+ Fixed incorrect command
-Mon Jul 12 11:04:58 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Sun Dec 18 10:29:12 UTC 2011 Martin Corino <mcorino@remedy.nl>
- * ace/ACE.cpp:
- * ace/Activation_Queue.h:
- * ace/Active_Map_Manager.h:
- * ace/Dev_Poll_Reactor.h:
- * ace/Dev_Poll_Reactor.inl:
- * ace/Event_Handler.h:
- * ace/Filecache.h:
- * ace/Manual_Event.h:
- * ace/Map_Manager.h:
- * ace/Mem_Map.h:
- * ace/Message_Block.h:
- * ace/OS_Log_Msg_Attributes.h:
- * ace/OS_NS_unistd.h:
- * ace/Object_Manager.h:
- * ace/Recursive_Thread_Mutex.h:
- Layout, const, and doxygen fixes
+ * ace/Abstract_Timer_Queue.h:
-Mon Jul 12 10:11:24 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Added missing abstract method dump().
- * ace/DLL.h:
- * ace/DLL_Manager.h:
- * ace/Dirent.h:
- * ace/Dump_T.h:
- * ace/Event_Handler.h:
- * ace/File_Lock.h:
- * ace/INET_Addr.h:
- * ace/Log_Msg_Callback.h:
- * ace/Log_Record.h:
- * ace/Logging_Strategy.h:
- Fixed set of doxygen warnings
+Fri Dec 16 08:03:07 UTC 2011 Marcel Smit <msmit@remedy.nl>
-Mon Jul 12 08:19:58 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Time_Policy_T.h:
+ No dllimport/export in template classes.
- * ace/Connector.h:
- * ace/Malloc_Base.h:
- * ace/SString.h:
- * ace/Stream.h:
- * ace/Task.h:
- Fixed set of doxygen warnings
+Thu Dec 15 19:45:30 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
-Fri Jul 09 09:35:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ace/Countdown_Time_T.h:
+ No need for an export macro with a C++ template
- * bin/PerlACE/Process_Unix.pm:
- Fix killall() valgrind handling.
+Thu Dec 15 13:22:07 UTC 2011 Marcel Smit <msmit@remedy.nl>
-Thu Jul 08 14:41:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ace/Event_Handler_Handle_Timeout_Upcall.inl:
+ * tests/Timer_Queue_Test.cpp:
+ Fuzz. Removed tab character
- * bin/PerlACE/Process_Unix.pm:
- Fix killall() valgrind handling.
+Thu Dec 15 13:12:39 UTC 2011 Marcel Smit <msmit@remedy.nl>
-Thu Jul 08 07:56:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ace/Event_Handler_Handle_Timeout_Upcall.inl:
+ * ace/Event_Handler_Handle_Timeout_Upcall.cpp:
+ * ace/Proactor.cpp:
+ * ace/Timer_Hash.h:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Heap.h:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Heap_T.cpp:
+ * ace/Timer_List.h:
+ * ace/Timer_List_T.h:
+ * ace/Timer_List_T.cpp:
+ * ace/Timer_Queue_Adapters.cpp:
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_Wheel.h:
+ * ace/Timer_Wheel_T.h:
+ Fuzz. Removed tab character
- * bin/PerlACE/Process_Unix.pm:
- Make killall() recognize and handle valgrind runs correctly.
+Thu Dec 15 12:52:18 UTC 2011 Marcel Smit <msmit@remedy.nl>
-Wed Jul 7 14:53:12 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Abstract_Timer_Queue.cpp:
+ * ace/Event_Handler_Handle_Timeout_Upcall.h:
+ * ace/Timer_Queue_Iterator.h:
+ * ace/Timer_Queue_Iterator.cpp:
+ Fuzz. Added Id-tags.
- * tests/run_test.lst:
- * tests/Bug_3539_Regression_Test.cpp:
- * tests/tests.mpc:
- Added a test for bug 3539 as non-fixed.
+Thu Dec 15 11:00:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
-Wed Jul 7 11:43:16 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Merged timer_policy branch.
- * docs/bczar/bczar.html:
- Extended instructions
+ === start changelog ===
-Tue Jul 6 12:28:43 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Thu Dec 15 09:45:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
- * docs/Download.html:
- CIAO is also online available
+ * NEWS:
-Tue Jul 6 11:29:41 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Added description of new TIME_POLICY features.
- * ace/Message_Queue_T.cpp:
- * ace/Service_Repository.h:
- * ace/Task_T.h:
- Fixed doxygen warnings
+ * tests/Timer_Queue_Test.cpp:
-Tue Jul 6 11:22:08 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Added explicit test of specific TIME_POLICY feature.
- * etc/ace.doxygen:
- Improved doxygen configuration
+ Mon Dec 12 21:28:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
-Tue Jul 6 11:11:06 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Time_Policy.h:
+ * ace/Time_Policy.inl:
+ * ace/Time_Policy_T.h:
+ * ace/Time_Policy_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_Queue_T.h:
+ * tests/Timer_Queue_Test.cpp:
- * etc/ace.doxygen:
- * etc/ace_man.doxygen:
- * etc/ace_qos.doxygen:
- * etc/ace_rmcast.doxygen:
- * etc/ace_ssl.doxygen:
- * etc/acexml.doxygen:
- Reduced the size of the colloboration graphs
+ Added backwards compatibility support.
-Mon Jul 5 15:20:14 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Mon Dec 05 10:26:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
- * rpmbuild/ace-tao.spec:
- Removed some test code
+ * ace/Time_Policy.inl
-Mon Jul 5 14:59:25 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Prevent setting delegate to null pointer.
- * rpmbuild/ace-tao.spec:
- Added missing file, thanks to Anatoli Sakhnik
- <sakhnik at gmail dot com> for reporting this, this should fix
- bugzilla 3870
+ Sun Dec 04 15:40:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
-Mon Jul 05 14:32:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
+ * ace/Countdown_Time.cpp:
+ * ace/Countdown_Time.inl:
- * bin/PerlACE/Process_Unix.pm:
- Fixes problem with killall() function being not selective enough.
+ Renamed to *_T.*
-Mon Jul 5 13:56:57 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Countdown_Time.h
+ * ace/Countdown_Time_T.cpp
+ * ace/Countdown_Time_T.h
+ * ace/Countdown_Time_T.inl
- * etc/ace.doxygen:
- * etc/ace_qos.doxygen:
- * etc/ace_rmcast.doxygen:
- * etc/ace_ssl.doxygen:
- * etc/acexml.doxygen:
- Disable include and included graphs, this should reduce the size
- of the documentation a lot
+ Changed ACE_Countdown_Time to TIME_POLICY based
+ template class ACE_Countdown_Time_T,
+ Created typedef for default template instantiation
+ as ACE_Countdown_Time.
-Mon Jul 5 13:29:23 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Time_Policy.cpp
+ * ace/Time_Policy.h
+ * ace/Time_Policy.inl
+ * ace/Time_Policy_T.cpp
+ * ace/Time_Policy_T.h
+ * ace/Time_Policy_T.inl
- * bin/generate_doxygen.pl:
- Some preparations to move the DAnCE doxygen files to DAnCE
+ Added support for dynamically loadable/shared time
+ policies.
- * docs/bczar/bczar.html:
- Updated release notes, made it possible to generate doxygen on
- a regular system instead of on naboo, the side effect is that the
- doxygen packages on naboo are 350Mb, on FC13 with all latest tools
- they are 1.4GB
+ * ace/ace.mpc
-Mon Jul 5 11:22:09 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Updated for file changes.
- * ace/Select_Reactor_Base.cpp:
- Fixed doxygen warning
+ Fri Dec 02 11:48:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
- * etc/ace.doxygen:
- * etc/ace_man.doxygen:
- * etc/ace_qos.doxygen:
- * etc/ace_rmcast.doxygen:
- * etc/ace_ssl.doxygen:
- * etc/acexml.doxygen:
- Define ACE_INLINE as inline and not as 1
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
-Mon Jul 5 10:56:15 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Reverting set_time_policy() change. Interpretation error.
- * rpmbuild/ace-tao.spec-release.patch:
- Removed this file.
+ Thu Dec 01 17:52:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
-Mon Jul 5 09:11:21 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ * ace/Time_Policy.h:
+ * ace/Time_Policy.inl:
- * docs/Download.html:
- Removed link to very old patches and fixed typo
+ Added ACE_HR_Time_Policy.
+
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
-Mon Jul 5 09:05:43 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+ Replaced set_time_policy() by get_time_policy() since setting
+ the policy is not possible but configuring might be.
+
+ Thu Dec 01 14:05:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
+
+ * ace/Proactor.cpp:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_Queue_T.h:
+
+ Fixed compile errors.
+
+ Thu Dec 01 13:34:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
+
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Wheel_T.h:
+
+ Small cleanup to prevent potential compiler warnings.
+
+ Mon Aug 24 02:27:36 UTC 2009 Carlos O'Ryan <coryan@glamdring>
+
+ * ace/Timer_Queue_T.cpp:
+ Need to release the internal timer queue lock before dispatching
+ calls in expire_single(), otherwise we get nasty deadlocks in
+ the TP_Reactor implementation.
+
+ Thu Jul 2 02:55:09 UTC 2009 Carlos O'Ryan <coryan@glamdring>
+
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ I wanted to use gettimeofday() for the pure virtual function and
+ some other name for the inline function used in the timer queue
+ internals.
+ This is the second and final pass to get that change in. This
+ time, I renamed the internal function to gettimeofday_static(),
+ used the compiler (and grep) to find all uses. Once that
+ compiled I renamed the virtual function from
+ gettimeofday_abstract() to the gettimeofday() function.
+ I know it is convoluted, but it gets the job done without me
+ having to think too much.
+
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Select_Reactor_T.cpp:
+ * ace/Dev_Poll_Reactor.cpp:
+ * ace/Proactor.cpp:
+ * ace/Timer_Queue_Adapters.cpp:
+ * tests/Timer_Queue_Reference_Counting_Test.cpp:
+ * tests/Timer_Queue_Test.cpp:
+ * examples/APG/Timers/Timers.cpp:
+ * examples/APG/Timers/TimerDispatcher.cpp:
+ * examples/C++NPv2/Logging_Event_Handler_Ex.cpp:
+ Fixed users and tests to use the real name for gettimeofday() in
+ ACE_Abstract_Timer_Queue<>
+
+ Wed Jul 1 02:09:44 UTC 2009 Carlos O'Ryan <coryan@glamdring>
+
+ * ace/ace.mpc:
+ * ace/Makefile.am:
+ * ace/Event_Handler_Handle_Timeout_Upcall.h:
+ * ace/Event_Handler_Handle_Timeout_Upcall.inl:
+ * ace/Event_Handler_Handle_Timeout_Upcall.cpp:
+ First I noticed that this class did not depend on the lock type
+ at all, this was fortunate because I wanted to use it in a
+ generic way. So, change the class from a template class to a
+ regular class. That required moving the class to its own file too.
+
+ * ace/Timer_List_T.h:
+ * ace/Timer_List_T.cpp:
+ * ace/Timer_Wheel_T.h:
+ * ace/Timer_Wheel_T.cpp:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Heap_T.cpp:
+ Fixed several inconsistencies across these classes, for example,
+ most of them had typedef as a shorthand for the base class, but
+ the name of this typedef was not consistent.
+ Likewise, not all of the classes made the TIME_POLICY parameter
+ a default template parameter.
+
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ Introduced an intermediate class between Abstract_Timer_Queue<>
+ and Timer_Queue_T<>. This is ugly, but the Proactor "needs" to
+ set a back-pointer from the FUNCTOR to the Proacter instance
+ whenever a timer queue is assigned to the Proactor.
+ This code smells funny. Either the API is wrong (the Proactor
+ should always create the functor with the backpointer,) or the
+ need for the back pointer is suspicious (I think there is a
+ thread in the Proactor that signals timers, but maybe it should
+ be contained in the Upcall object itself?)
+ The more I look here, the uglier the smell.
+
+ * ace/Select_Reactor_T.cpp:
+ * ace/Timer_Queue_Adapters.cpp:
+ * tests/Timer_Queue_Reference_Counting_Test.cpp:
+ * tests/Timer_Queue_Test.cpp:
+ As a temporary measure, I appended "_abstract" to the
+ gettimeofday() function name in Abstract_Timer_Queue<>.
+ Shortly, I will change the Timer_Queue_T<> class to use
+ gettimeofday_non_virtual() or _static() or something similar.
+ Had to make the change in two steps to find all the uses of the
+ original function.
+ There was probably an easier/cleaner way to do this.
+
+ * tests/Timer_Queue_Test.cpp:
+ Take advantage of the new ACE_Abstract_Timer_Queue<> to make the
+ different types of queues more compatible in ths test, including
+ queues with different time source policies.
+
+ * ace/Proactor.h:
+ As with the Reactive version, I noticed that
+ ACE_Proactor_Handle_Timeout_Upcall did not depend on its
+ template parameter, so I changed the class to a non-template
+ version.
+
+ * ace/Proactor.cpp:
+ Instead of making the Proactor a friend of the Timer_Handler
+ task, expose a safe interface to do what the proactor wants to
+ do.
+ The proactor needed access to timer queue internal details to
+ implement schedule(), but the reactor did not... hmmm... well,
+ turns out the Reactor had nicely refactor that work to the
+ upcall functor. So I did the same in the Proactor case.
+
+
+ * ace/Timer_List.h:
+ * ace/Timer_Wheel.h:
+ * ace/Timer_Hash.h:
+ * ace/Timer_Heap.h:
+ Use Event_Handler_Handle_Timeout_Upcall without the template
+ parameter.
+
+ * ace/Abstract_Timer_Queue.h:
+ Remove the setter for getimeofday(), this is implemented by the
+ TIME_POLICY template parameter in Timer_Queue_T<>
+
+ * tests/Reactor_Timer_Test.cpp:
+ * tests/Network_Adapters_Test.cpp:
+ * tests/Proactor_Timer_Test.cpp:
+ Use a different idiom to set the time policy for this test.
+
+ * examples/Timer_Queue/Thread_Timer_Queue_Test.h:
+ * examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h:
+ * examples/APG/Timers/Timers.cpp:
+ * examples/APG/Timers/TimerDispatcher.cpp:
+ * examples/Reactor/Misc/test_timer_queue.cpp:
+ * examples/C++NPv2/Logging_Event_Handler_Ex.cpp:
+ Need an additional #include for ACE_Event_Handler_Handle_Timeout
+ Said class class is no longer a template class, so use it
+ correctly.
+ Changed name of gettimeofday() in timer queue to
+ gettimeofday_abstract() This is a temporary change to find all
+ the uses, will revert again soon.
+
+ * Merged in changes from bug-3607 branch.
+
+ * ace/ace.mpc:
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Abstract_Timer_Queue.cpp:
+ * ace/Timer_Queue_Iterator.h:
+ * ace/Timer_Queue_Iterator.inl:
+ * ace/Timer_Queue_Iterator.cpp:
+ * ace/Timer_Queuefwd.h:
+ * ace/Timer_Queue.h:
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_List_T.h:
+ * ace/Timer_List_T.cpp:
+ * ace/Timer_Wheel_T.h:
+ * ace/Timer_Wheel_T.cpp:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Heap_T.cpp:
+ Heavy refactoring in ACE_Timer_Queue_T class and friends.
+ First, created a template base class (ACE_Abstract_Timer_Queue) that:
+ 1) Only depends on the type held by the timer queue, not to lock
+ or upcall strategy.
+ 2) It is a pure abstract class, i.e., none of its member
+ functions have any implementation.
+ 3) Provides new pure virtual functions to encapsulates some
+ logic that was spread between tests, TP_Reactor and
+ Dev_Poll_Reactor.
+ Then I re-wrote all the standard timer queue objects in terms of
+ this class. In particular, the reactors use only the abstract
+ interface.
+ I also re-factored the Timer_Queue_Iterator to only depend on
+ the type of objects held by the timer queue. The rest of the
+ parameters where not used either.
+ Implement functionality that was spread in Dev_Poll_Reactor,
+ TP_Reactor and a test into expire_single.
+
+ * ace/Proactor.h:
+ * ace/TP_Reactor.cpp:
+ * ace/Dev_Poll_Reactor.cpp:
+ Both classes implemented the logic to dispatch a single timer
+ but release a mutex before the upcall. This was confusing as
+ well as required exposing too much detail about the Timer_Queue
+ classes.
+ The new mechanism is a single function in (expire_single)
+ ACE_Abstract_Timer_Queue<> (implemented in ACE_Timer_Queue_T<>)
+ which receives a command object to encapsulate the mutex release.
+
+ * ace/Functor.h:
+ * ace/Functor.cpp:
+ * ace/Functor_T.h:
+ * ace/Functor_T.inl:
+ Add helper ACE_Command_* objects. One is a no-op, for the test
+ below. The other is a callback that ignores the silly void*
+ argument in the ACE_Command_Base::execute() member function.
+
+ * tests/Timer_Queue_Reference_Counting_Test.cpp:
+ Re-factored test in terms of expire_single()
+
+ Tue Jun 30 01:10:04 UTC 2009 Carlos O'Ryan <coryan@glamdring>
+
+ * This is a temporary commit into the 3707 branch. I realized too
+ late that the changes from 3706 will be needed to make this work.
+
+ * ace/ace.mpc:
+ * ace/Time_Policy.h:
+ * ace/Time_Policy.inl:
+ * ace/Time_Policy.cpp:
+ New classes to encapsulate how "now" is computed in the Timer
+ Queues. This will be an additional template parameter, so the
+ default configuration has zero overhead.
+
+ * ace/Timer_Queuefwd.h:
+ * ace/Timer_List.h:
+ * ace/Timer_List_T.h:
+ * ace/Timer_List_T.cpp:
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_Wheel.h:
+ * ace/Timer_Wheel_T.h:
+ * ace/Timer_Wheel_T.cpp:
+ * ace/Timer_Hash.h:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Heap.h:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Heap_T.cpp:
+ Re-factor timer queue classes to use new TIMER_POLICY
+ parameter.
+
+ * tests/Timer_Queue_Test.cpp:
+ Modify test to use TIMER_POLICY. But here is the rub, the test
+ does not compile because all timer queue types are "different"
+ to each other. I need to introduce the base class from the
+ bug-3706 branch to make things work.
+
+ Sun Jun 28 22:15:47 UTC 2009 Carlos O'Ryan <coryan@glamdring>
+
+ * ace/ace.mpc:
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Abstract_Timer_Queue.cpp:
+ * ace/Timer_Queue_Iterator.h:
+ * ace/Timer_Queue_Iterator.inl:
+ * ace/Timer_Queue_Iterator.cpp:
+ * ace/Timer_Queuefwd.h:
+ * ace/Timer_Queue.h:
+ * ace/Timer_Queue_T.h:
+ * ace/Timer_Queue_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_List_T.h:
+ * ace/Timer_List_T.cpp:
+ * ace/Timer_Wheel_T.h:
+ * ace/Timer_Wheel_T.cpp:
+ * ace/Timer_Hash_T.h:
+ * ace/Timer_Hash_T.cpp:
+ * ace/Timer_Heap_T.h:
+ * ace/Timer_Heap_T.cpp:
+ Heavy refactoring in ACE_Timer_Queue_T class and friends.
+ First, created a template base class (ACE_Abstract_Timer_Queue) that:
+ 1) Only depends on the type held by the timer queue, not to lock
+ or upcall strategy.
+ 2) It is a pure abstract class, i.e., none of its member
+ functions have any implementation.
+ 3) Provides new pure virtual functions to encapsulates some
+ logic that was spread between tests, TP_Reactor and
+ Dev_Poll_Reactor.
+ Then I re-wrote all the standard timer queue objects in terms of
+ this class. In particular, the reactors use only the abstract
+ interface.
+ I also re-factored the Timer_Queue_Iterator to only depend on
+ the type of objects held by the timer queue. The rest of the
+ parameters where not used either.
+ Implement functionality that was spread in Dev_Poll_Reactor,
+ TP_Reactor and a test into expire_single.
+
+ * ace/Proactor.h:
+ * ace/TP_Reactor.cpp:
+ * ace/Dev_Poll_Reactor.cpp:
+ Both classes implemented the logic to dispatch a single timer
+ but release a mutex before the upcall. This was confusing as
+ well as required exposing too much detail about the Timer_Queue
+ classes.
+ The new mechanism is a single function in (expire_single)
+ ACE_Abstract_Timer_Queue<> (implemented in ACE_Timer_Queue_T<>)
+ which receives a command object to encapsulate the mutex release.
+
+ * ace/Functor.h:
+ * ace/Functor.cpp:
+ * ace/Functor_T.h:
+ * ace/Functor_T.inl:
+ Add helper ACE_Command_* objects. One is a no-op, for the test
+ below. The other is a callback that ignores the silly void*
+ argument in the ACE_Command_Base::execute() member function.
+
+ * tests/Timer_Queue_Reference_Counting_Test.cpp:
+ Re-factored test in terms of expire_single()
+
+ === end changelog ===
+
+Wed Dec 14 16:09:22 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * docs/Download.html:
- Updated filenames in text
+ * bin/auto_run_tests.pl:
+ Fixed DANCE_ROOT
-Mon Jul 5 08:57:09 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Dec 12 19:04:55 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * docs/Download.html:
- Update latest minor release to x.8.0
+ * bin/MakeProjectCreator/config/vc11.features:
+ * bin/MakeProjectCreator/config/vc11nmake.mpb:
+ New files for vc11
-Mon Jul 5 08:19:17 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Dec 12 07:33:25 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * bin/diff-builds-and-group-fixed-tests-only.sh:
- Updated for x.8.0
+ === start changelog ===
- * bin/generate_rel_manpages:
- Remove restriction to run on naboo, removed doxygen check, updated
- error message
+ Fri Dec 9 10:41:02 UTC 2011 Marcel Smit <msmit@remedy.nl>
- * docs/Download.html:
- Updated to x.8.0
+ * docs/svn/config:
+ Subversion should ignore *_svnt_T.*.
- * etc/ace.doxygen:
+ === end changelog ===
+
+Mon Dec 5 22:23:25 UTC 2011 Steve Huston <shuston@riverace.com>
+
+ * ace/DLL.h:
+ * ace/DLL_Manager.h: Corrected and expanded the descriptions of how
+ DLL/library names are handled, decorated, and located.
+
+Mon Dec 5 20:16:51 UTC 2011 Steve Huston <shuston@riverace.com>
+
+ * ace/Atomic_Op.{h inl}:
+ * ace/Atomic_Op_T.{h inl}:
+ * ace/Atomic_Op_GCC_T.{h inl}:
+ Added new method TYPE exchange (TYPE newval) which exchanges the
+ ACE_Atomic_Op's value with the specified new value. Thanks to John
+ Lilley for contributing this addition.
+
+ * tests/Atomic_Op_Test.cpp: Added test for exchange().
+
+ * NEWS: Added description of the new exchange() method.
+
+Mon Dec 5 12:27:54 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/TTY_IO.h:
+ Doxygen fix
+
+ * ace/config-linux.h:
Layout changes
- * etc/index.html:
- Added 5.8
+ * tests/Cached_Accept_Conn_Test.h:
+ * tests/Cached_Accept_Conn_Test.cpp:
+ * tests/MEM_Stream_Test.cpp:
+ * tests/QtReactor_Test.cpp:
+ Layout changes and removed some ACE_UNUSED_ARG usage
- * rpmbuild/ace-tao.spec:
- Changed version numbers to x.8.0 and added new ACE INet library
+Mon Dec 5 11:25:31 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * bin/cleanbuilds.sh:
+ * bin/mail_test_stats.sh:
+ Extended our daily test stats with another email, the failing tests
+ for today excluding the not fixed ones
+
+Mon Dec 5 08:35:54 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * docs/Download.html:
+ Release has vc9/vc10
-Sun Jul 04 18:57:33 CEST 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+Mon Dec 5 08:22:11 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
- * ACE version 5.8 released.
+ * bin/diff-builds-and-group-fixed-tests-only.sh:
+ * docs/Download.html:
+ * etc/index.html:
+ Made 6.0.6 publicly available
+
+ * docs/bczar/bczar.html:
+ Updated for next release and added wget step to get subversion config
+ file to make sure we checkout using commit timestamps
Local Variables:
mode: change-log
diff --git a/dep/acelite/NEWS b/dep/acelite/NEWS
index d648b09c237..cf60110b536 100644
--- a/dep/acelite/NEWS
+++ b/dep/acelite/NEWS
@@ -1,3 +1,186 @@
+USER VISIBLE CHANGES BETWEEN ACE-6.1.3 and ACE-6.1.4
+====================================================
+
+. Added a new ACE_Time_Value derived template class (Time_Value_T.h):
+
+ template <class TIME_POLICY> class ACE_Time_Value_T
+
+ This template class overloads 4 new virtual methods from
+ the ACE_Time_Value base class to provide time policy aware
+ time values:
+ to_relative_time ()
+ to_absolute_time ()
+ now ()
+ duplicate ()
+
+. Updated time policy classes to return ACE_Time_Value_T<> instantiations
+ for the corresponding time policy instead of 'common' time values.
+
+. Added new ACE_Monotonic_Time_Policy (Monotonic_Time_Policy.h).
+ This class provides a monotonic time source for supported
+ platforms (Windows and POSIX platforms providing the required
+ clock_gettime() time source; currently verified for Windows and
+ Linux)
+
+. Updated OS_NS_Thread to use the new time policy support in ACE_Time_Value
+ for (relative) time calculations and added new ACE_OS::condattr_setclock ()
+ method.
+
+. Added TIME_POLICY support to ACE_Condition_Attributes to allow for
+ monotonic timer support for ACE_Condition.
+
+. Added TIME_POLICY support to ACE_Message_Queue-s, ACE_Task-s and
+ related classes to enable support for monotonic timers in the timed
+ wait methods (ACE_Condition based). See docs/ACE-monotonic-timer.html
+ for how to use this.
+
+. Added two new regression tests:
+ Monotonic_Task_Test
+ Monotonic_Message_Queue_Test
+ and updated the Bug_4055_Regression_Test to a fixed state.
+
+USER VISIBLE CHANGES BETWEEN ACE-6.1.2 and ACE-6.1.3
+====================================================
+
+. Added support for Oracle Solaris Studio 12 Update 3 (SunCC 5.12)
+
+. Added new XML_Utils library which comes from DAnCE but is now also used
+ by OpenDDS
+
+USER VISIBLE CHANGES BETWEEN ACE-6.1.1 and ACE-6.1.2
+====================================================
+
+. Added compile time support for Windows CE 7, no runtime testing has
+ been performed
+
+. The High Res Timer global scale factor on Windows is now 64bit, see bugzilla
+ 3703 for the background of this. If you use the gsf in your code, use the
+ new ACE_High_Res_Timer::global_scale_factor_type type trait to not get
+ any conversion warnings
+
+. Removed Tandem NSK v2/v3 support which resulted in cleanup throughout all
+ code. The emulations for ACE_INT64/ACE_UINT64 have been removed because no
+ platform is using them anymore
+
+USER VISIBLE CHANGES BETWEEN ACE-6.1.0 and ACE-6.1.1
+====================================================
+
+. Minor bug fixes
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.8 and ACE-6.1.0
+====================================================
+
+. Added compilation support for VxWorks 6.9, no runtime
+ testing has been performed
+
+. Added ACE Run-length encoding compressor
+
+. Fixed several Coverity reported issues
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.7 and ACE-6.0.8
+====================================================
+
+. Added support for MPC's new feature that creates dependency files for IDL
+ files when generating '-type gnuace' projects. Turned off by default, it
+ can be enabled in a features file or on the command line with
+ '-features ace_idl_dependencies=1'.
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.6 and ACE-6.0.7
+====================================================
+
+. Added a new method to ACE_Atomic_Op<LOCK, TYPE>, TYPE exchange (TYPE newval)
+ which does an atomic exchange of the new value with ACE_Atomic_Op's value
+ and returns the old value. The tests/Atomic_Op_Test.cpp test program has a
+ test case that exemplifies its usage; see the Exchange_Tester class.
+
+. Added a new feature to timer queue templates classes: TIME_POLICY.
+ This feature is specified through a new template argument and provides the
+ timer queue with a policy for a timer (time of day) value. This feature is
+ intended to replace (in time) the gettimeofday setter method which has been
+ marked @deprecated. For now backwards compatibility is guaranteed.
+ The TIME_POLICY feature provides flexibility with regards to providing a timer
+ source to the timer queues as well as the possibility for a fully optimized
+ calling path.
+ A number of standard time policies are provided in ace/Time_Policy.h.
+ The tests/Timer_Queue_Test.cpp has been updated to reflect and exemplify these
+ changes.
+
+. Added the TIME_POLICY feature also to countdown time class which has now
+ become a template (ace/Countdown_Time_T.h)
+
+. Initial support for Microsoft Visual Studio 11
+
+. Increased overall code quality by using Coverity and Klocwork
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.5 and ACE-6.0.6
+====================================================
+
+. Removed autoconf support, only traditional way of
+ compilation is shipped from now
+
+. Add support for RHEL 6.1 64bit
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.4 and ACE-6.0.5
+====================================================
+
+. Improved support for Android and added the ability to run all ACE/TAO tests
+ automatically using the Android emulator
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.3 and ACE-6.0.4
+====================================================
+
+. Removed support for C++ Builder
+
+. Added support for building with the Android NDK, at least r5c. This
+ is currently available for linux host platforms.
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.2 and ACE-6.0.3
+====================================================
+
+. Added support for GCC 4.6
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.1 and ACE-6.0.2
+====================================================
+
+. The ACE_wrappers/ace/OS.h file has been restored in order to ensure
+ build-time compatibility with older ACE versions. Its use will still
+ cause your build to incur more processing time than using the needed
+ ace/OS_NS_*.h files; however, you should be able to build OS.h-including
+ code without needing to replace it with OS_NS_* includes.
+
+. Improved and simplified QNX support
+
+. Changed rand_r() and getpwnam_r() to conform Single UNIX Specification.
+
+. Fixed performance of send_v on windows when individual iovec elements
+ are particularly large.
+
+USER VISIBLE CHANGES BETWEEN ACE-6.0.0 and ACE-6.0.1
+====================================================
+
+. Added support for MinGW with GCC 4.5
+
+USER VISIBLE CHANGES BETWEEN ACE-5.8.3 and ACE-6.0.0
+====================================================
+
+. Changed the string format produced by ACE::timestamp() from the ctime
+ format "Day Mon dd hh:mm:ss yyyy" to ISO-8601 yyyy-mm-dd hh:mm:ss.mmmmmm.
+ This makes the time easier to collate and removes any dependence on locale.
+ The change affects the output from ACE_Log_Msg's %D format and both VERBOSE
+ and VERBOSE_LIGHT timestamps in addition to application-made direct calls
+ to ACE::timestamp().
+
+. Removed GCC < 3 support
+
+. A new build system hook was added for users to include site-private rules
+ in a build. If a file named "rules.private.GNU" in located in any build
+ directory it will get included from
+ $ACE_ROOT/include/makeinclude/rules.local.GNU. The "private_rules_file"
+ make variable can be set to override the name and/or location of the file.
+ If no such rules file exists, its absence is silently ignored. This
+ facility can be used, for example, to integrate a specialized code checker
+ into the build process.
+
USER VISIBLE CHANGES BETWEEN ACE-5.8.2 and ACE-5.8.3
====================================================
diff --git a/dep/acelite/README b/dep/acelite/README
index 1b46d7fd6f4..35198116bf5 100644
--- a/dep/acelite/README
+++ b/dep/acelite/README
@@ -1,3 +1,5 @@
+$Id: README 94611 2011-10-06 11:54:28Z msmit $
+
This document is also available at the following URL:
http://www.cs.wustl.edu/~schmidt/ACE.html
diff --git a/dep/acelite/THANKS b/dep/acelite/THANKS
index a23b239e6b2..dd9480b47f8 100644
--- a/dep/acelite/THANKS
+++ b/dep/acelite/THANKS
@@ -1,8 +1,8 @@
ACKNOWLEDGEMENTS
-ACE and TAO have been deeply influenced and improved by the following
-members of my research group at Washington University in St. Louis, the
-University of California at Irvine, and Vanderbilt University in Nashville.
+ACE, TAO, CIAO, and DAnCE have been deeply influenced and improved by the
+following members of my research group at Washington University in St. Louis,
+the University of California at Irvine, and Vanderbilt University in Nashville.
Everett Anderson <eea1 at cec dot wustl dot edu>
Alexander Babu Arulanthu <alex at cs dot wustl dot edu>
@@ -75,7 +75,7 @@ Torben Worm <tworm at cs dot wustl dot edu>
Ming Xiong <xiongm at isis dot vanderbilt dot edu>
I would also like to thank all the following people who have also
-contributed to ACE and TAO over the years:
+contributed to ACE, TAO, CIAO, and DAnCE over the years:
Paul Stephenson <pstephenson at objectspace dot com>
Olaf Kruger <okruger at cssc-melb dot tansu dot com dot au>
@@ -411,7 +411,7 @@ Andrew Harbick <aharbick at opentext dot com>
Pavel Motuzenko <p_motuzenko at hotmail dot com>
Ross J. Lillie <lillie at rsch dot comm dot mot dot com>
Sam Hauer <shauer at nmo dot gtegsc dot com>
-Frank J. Hodum <fhodum at dctd dot saic dot com>
+Frank J. Hodum <FRANK.J.HODUM at saic dot com>
David Miron <dxm at crapper dot dsto dot defence dot gov dot au>
Anton van Straaten <anton at appsolutions dot com>
Joe Covalesky <joe at nowsol dot com>
@@ -2339,6 +2339,36 @@ Matthew Waller <matthewrwaller at gmail dot com>
Elez <elezsh at gmail dot com>
Ranjit Hande <hande at avaya dot com>
Van Vuong <vanvuong1 at us dot ibm dot com>
+Mark <markg85 at gmail dot com>
+Wendsomde Yameogo <wendsomde at yameogo dot com>
+Shi John <John dot Shi at acxiom dot com>
+Helmut Böing
+Andrew Hill <lists at thefrog dot net>
+Henk Jan Priester <hjpriester at gmail dot com>
+Glenn Zickert <gzickert at comcast dot net>
+Chris Galli <christian dot galli at gmail dot com>
+Laura Autón García <darklulu+ace at gmail dot com>
+Jonathan Saxton <jsaxton at appsecinc dot com>
+Remko Duppen <remko dot duppen at syntel dot nl>
+Paul Fitzpatrick <paul at robotrebuilt dot com>
+Chad Beaulac <chad dot beaulac at objectivesolutions dot com>
+Jochen Meier <gesammeltimusenet2009 at arcor dot de>
+Thomas Pauli <thomas dot pauli at tu-dortmund dot de>
+Qiao Zhiqiang <qiaozhiqiang at leadcoretech dot com>
+JaeSung Lee <berise at gmail dot com>
+Chong Wuk Pak <chong dot pak at lmco dot com>
+Michael Frommberger <michael dot frommberger at gmx dot net>
+Andrey Karpov <karpov at viva64 dot com>
+Dmytro Ovdiienko <dmitriy dot ovdienko at gmail.com>
+Andrea Sormanni <andrea dot sormanni at gmail dot com>
+Thomas Stegemann <Thomas dot Stegemann at materna dot de>
+David Simmonds <david dot simmonds at iggroup dot com>
+Andreas Dröscher <ace at anticat dot ch>
+Markus Manck <Markus dot Manck at Philotech dot de>
+Deux deVille <dev2 at weitling dot net>
+Mohsin Zaidi <mohsinrzaidi at gmail dot com>
+Milind Pangarkar <Milind dot Pangarkar at amdocs dot com>
+Ali Akbar Zarezadeh <akzare at cs dot uni-potsdam dot de>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson in the early 1990's. Paul devised the recursive Makefile
diff --git a/dep/acelite/VERSION b/dep/acelite/VERSION
index 594af04e592..144300e4267 100644
--- a/dep/acelite/VERSION
+++ b/dep/acelite/VERSION
@@ -1,4 +1,4 @@
-This is ACE version 5.8.3, released Wed Oct 27 12:01:05 CEST 2010
+This is ACE version 6.1.4, released Wed Aug 29 08:16:04 CEST 2012
If you have any problems with or questions about ACE, please send
e-mail to the ACE mailing list (ace-bugs@list.isis.vanderbilt.edu),
diff --git a/dep/acelite/ace/ACE.cpp b/dep/acelite/ace/ACE.cpp
index 433b5e3e788..a965eff09f6 100644
--- a/dep/acelite/ace/ACE.cpp
+++ b/dep/acelite/ace/ACE.cpp
@@ -1,4 +1,4 @@
-// $Id: ACE.cpp 92298 2010-10-21 11:15:17Z johnnyw $
+// $Id: ACE.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/ACE.h"
@@ -25,10 +25,6 @@
#include "ace/OS_TLI.h"
#include "ace/Truncate.h"
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
-extern "C" int maxFiles;
-#endif /* ACE_VXWORKS */
-
#if !defined (__ACE_INLINE__)
#include "ace/ACE.inl"
#endif /* __ACE_INLINE__ */
@@ -68,7 +64,7 @@ ACE::out_of_handles (int error)
#elif defined (HPUX)
// On HPUX, we need to check for EADDRNOTAVAIL also.
error == EADDRNOTAVAIL ||
-#elif defined (linux)
+#elif defined (ACE_LINUX)
// On linux, we need to check for ENOENT also.
error == ENOENT ||
// For RedHat5.2, need to check for EINVAL too.
@@ -2308,7 +2304,7 @@ ACE::format_hexdump (const char *buffer,
ACE_TEXT (" "));
++obuf;
}
- textver[j] = ACE_OS::ace_isprint (c) ? c : '.';
+ textver[j] = ACE_OS::ace_isprint (c) ? c : u_char ('.');
}
textver[j] = 0;
@@ -2340,7 +2336,7 @@ ACE::format_hexdump (const char *buffer,
ACE_TEXT (" "));
++obuf;
}
- textver[i] = ACE_OS::ace_isprint (c) ? c : '.';
+ textver[i] = ACE_OS::ace_isprint (c) ? c : u_char ('.');
}
for (i = size % 16; i < 16; i++)
@@ -2371,7 +2367,8 @@ ACE::format_hexdump (const char *buffer,
// Returns the current timestamp in the form
// "hour:minute:second:microsecond." The month, day, and year are
-// also stored in the beginning of the date_and_time array.
+// also stored in the beginning of the date_and_time array
+// using ISO-8601 format.
ACE_TCHAR *
ACE::timestamp (ACE_TCHAR date_and_time[],
@@ -2386,7 +2383,10 @@ ACE::timestamp (ACE_TCHAR date_and_time[],
// Returns the given timestamp in the form
// "hour:minute:second:microsecond." The month, day, and year are
-// also stored in the beginning of the date_and_time array.
+// also stored in the beginning of the date_and_time array
+// using ISO-8601 format.
+// 012345678901234567890123456
+// 2010-12-02 12:56:00.123456<nul>
ACE_TCHAR *
ACE::timestamp (const ACE_Time_Value& time_value,
@@ -2396,92 +2396,32 @@ ACE::timestamp (const ACE_Time_Value& time_value,
{
//ACE_TRACE ("ACE::timestamp");
- if (date_and_timelen < 35)
+ // This magic number is from the formatting statement
+ // farther down this routine.
+ if (date_and_timelen < 27)
{
errno = EINVAL;
return 0;
}
-#if defined (WIN32)
- if (time_value == ACE_Time_Value::zero)
- {
- // Emulate Unix. Win32 does NOT support all the UNIX versions
- // below, so DO we need this ifdef.
- static const ACE_TCHAR *day_of_week_name[] =
- {
- ACE_TEXT ("Sun"),
- ACE_TEXT ("Mon"),
- ACE_TEXT ("Tue"),
- ACE_TEXT ("Wed"),
- ACE_TEXT ("Thu"),
- ACE_TEXT ("Fri"),
- ACE_TEXT ("Sat")
- };
-
- static const ACE_TCHAR *month_name[] =
- {
- ACE_TEXT ("Jan"),
- ACE_TEXT ("Feb"),
- ACE_TEXT ("Mar"),
- ACE_TEXT ("Apr"),
- ACE_TEXT ("May"),
- ACE_TEXT ("Jun"),
- ACE_TEXT ("Jul"),
- ACE_TEXT ("Aug"),
- ACE_TEXT ("Sep"),
- ACE_TEXT ("Oct"),
- ACE_TEXT ("Nov"),
- ACE_TEXT ("Dec")
- };
-
- SYSTEMTIME local;
- ::GetLocalTime (&local);
-
- ACE_OS::sprintf (date_and_time,
- ACE_TEXT ("%3s %3s %2d %04d %02d:%02d:%02d.%06d"),
- day_of_week_name[local.wDayOfWeek],
- month_name[local.wMonth - 1],
- (int) local.wDay,
- (int) local.wYear,
- (int) local.wHour,
- (int) local.wMinute,
- (int) local.wSecond,
- (int) (local.wMilliseconds * 1000));
- return &date_and_time[15 + (return_pointer_to_first_digit != 0)];
- }
-#endif /* WIN32 */
- ACE_TCHAR timebuf[26]; // This magic number is based on the ctime(3c) man page.
ACE_Time_Value cur_time =
(time_value == ACE_Time_Value::zero) ?
ACE_Time_Value (ACE_OS::gettimeofday ()) : time_value;
time_t secs = cur_time.sec ();
-
- ACE_OS::ctime_r (&secs,
- timebuf,
- sizeof timebuf / sizeof (ACE_TCHAR));
- // date_and_timelen > sizeof timebuf!
- ACE_OS::strsncpy (date_and_time,
- timebuf,
- date_and_timelen);
- ACE_TCHAR yeartmp[5];
- ACE_OS::strsncpy (yeartmp,
- &date_and_time[20],
- 5);
- ACE_TCHAR timetmp[9];
- ACE_OS::strsncpy (timetmp,
- &date_and_time[11],
- 9);
- ACE_OS::sprintf (&date_and_time[11],
-# if defined (ACE_USES_WCHAR)
- ACE_TEXT ("%ls %ls.%06ld"),
-# else
- ACE_TEXT ("%s %s.%06ld"),
-# endif /* ACE_USES_WCHAR */
- yeartmp,
- timetmp,
- cur_time.usec ());
- date_and_time[33] = '\0';
- return &date_and_time[15 + (return_pointer_to_first_digit != 0)];
+ struct tm tms;
+ ACE_OS::localtime_r (&secs, &tms);
+ ACE_OS::snprintf (date_and_time,
+ date_and_timelen,
+ ACE_TEXT ("%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d.%06ld"),
+ tms.tm_year + 1900,
+ tms.tm_mon + 1,
+ tms.tm_mday,
+ tms.tm_hour,
+ tms.tm_min,
+ tms.tm_sec,
+ static_cast<long> (cur_time.usec()));
+ date_and_time[date_and_timelen - 1] = '\0';
+ return &date_and_time[10 + (return_pointer_to_first_digit != 0)];
}
// This function rounds the request to a multiple of the page size.
@@ -2866,9 +2806,7 @@ ACE::max_handles (void)
#endif /* RLIMIT_NOFILE && !ACE_LACKS_RLIMIT */
#if defined (_SC_OPEN_MAX)
- return ACE_OS::sysconf (_SC_OPEN_MAX);
-#elif defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
- return maxFiles;
+ return static_cast<int> (ACE_OS::sysconf (_SC_OPEN_MAX));
#elif defined (FD_SETSIZE)
return FD_SETSIZE;
#else
@@ -2915,7 +2853,7 @@ ACE::set_handle_limit (int new_limit,
#if !defined (ACE_LACKS_RLIMIT) && defined (RLIMIT_NOFILE)
rl.rlim_cur = new_limit;
return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl);
-#elif defined (ACE_LACKS_RLIMIT_NOFILE)
+#elif !defined (RLIMIT_NOFILE)
return 0;
#else
// Must return EINVAL errno.
@@ -3342,10 +3280,7 @@ ACE::strnew (const char *s)
ACE_NEW_RETURN (t,
char [ACE_OS::strlen (s) + 1],
0);
- if (t == 0)
- return 0;
- else
- return ACE_OS::strcpy (t, s);
+ return ACE_OS::strcpy (t, s);
}
#if defined (ACE_HAS_WCHAR)
@@ -3358,10 +3293,7 @@ ACE::strnew (const wchar_t *s)
ACE_NEW_RETURN (t,
wchar_t[ACE_OS::strlen (s) + 1],
0);
- if (t == 0)
- return 0;
- else
- return ACE_OS::strcpy (t, s);
+ return ACE_OS::strcpy (t, s);
}
#endif /* ACE_HAS_WCHAR */
@@ -3400,7 +3332,7 @@ namespace
// characters are allowed as the range endpoints. These characters
// are the same values in both signed and unsigned chars so we
// don't have to account for any "pathological cases."
- for (char range = p[-1] + 1; range <= p[1]; ++range)
+ for (char range = static_cast<char> (p[-1] + 1); range <= p[1]; ++range)
{
if (equal_char (s, range, case_sensitive))
{
diff --git a/dep/acelite/ace/ACE.h b/dep/acelite/ace/ACE.h
index 04b39a85652..58eb1f68947 100644
--- a/dep/acelite/ace/ACE.h
+++ b/dep/acelite/ace/ACE.h
@@ -4,7 +4,7 @@
/**
* @file ACE.h
*
- * $Id: ACE.h 92060 2010-09-27 18:08:48Z johnnyw $
+ * $Id: ACE.h 93276 2011-02-04 20:03:53Z olli $
*
* This file contains value added ACE functions that extend the
* behavior of the UNIX and Win32 OS calls.
@@ -474,15 +474,23 @@ namespace ACE
ACE_DIRECTORY_SEPARATOR_CHAR);
/**
- * Returns the given timestamp in the form
- * "hour:minute:second:microsecond." The month, day, and year are
- * also stored in the beginning of the @a date_and_time array, which
- * is a user-supplied array of size @a time_len> @c ACE_TCHARs.
- * Returns 0 if unsuccessful, else returns pointer to beginning of the
- * "time" portion of @a date_and_time. If @a
- * return_pointer_to_first_digit is 0 then return a pointer to the
- * space before the time, else return a pointer to the beginning of
- * the time portion.
+ * Translate the given timestamp to ISO-8601 format.
+ *
+ * @param time_value ACE_Time_Value to format. This is assumed to be
+ * an absolute time value.
+ * @param date_and_time Array to hold the timestamp.
+ * @param time_len Size of @a date_and_time in ACE_TCHARs.
+ * Must be greater than or equal to 27.
+ * @param return_pointer_to_first_digit If true, returned pointer value
+ * is to the first time digit, else to the space
+ * prior to the first time digit. See Return Values.
+ *
+ * @retval 0 if unsuccessful, with errno set. If @a time_len is less than
+ * 27 errno will be EINVAL.
+ * @retval If successful, pointer to beginning of the "time" portion of
+ * @a date_and_time. If @a return_pointer_to_first_digit is false
+ * the pointer is actually to the space before the time, else
+ * the pointer is to the first time digit.
*/
extern ACE_Export ACE_TCHAR *timestamp (const ACE_Time_Value& time_value,
ACE_TCHAR date_and_time[],
@@ -490,15 +498,21 @@ namespace ACE
bool return_pointer_to_first_digit = false);
/**
- * Returns the current timestamp in the form
- * "hour:minute:second:microsecond." The month, day, and year are
- * also stored in the beginning of the @a date_and_time array, which
- * is a user-supplied array of size @a time_len> @c ACE_TCHARs.
- * Returns 0 if unsuccessful, else returns pointer to beginning of the
- * "time" portion of @a date_and_time. If @a
- * return_pointer_to_first_digit is 0 then return a pointer to the
- * space before the time, else return a pointer to the beginning of
- * the time portion.
+ * Translate the current time to ISO-8601 timestamp format.
+ *
+ * @param date_and_time Array to hold the timestamp.
+ * @param time_len Size of @a date_and_time in ACE_TCHARs.
+ * Must be greater than or equal to 27.
+ * @param return_pointer_to_first_digit If true, returned pointer value
+ * is to the first time digit, else to the space
+ * prior to the first time digit. See Return Values.
+ *
+ * @retval 0 if unsuccessful, with errno set. If @a time_len is less than
+ * 27 errno will be EINVAL.
+ * @retval If successful, pointer to beginning of the "time" portion of
+ * @a date_and_time. If @a return_pointer_to_first_digit is false
+ * the pointer is actually to the space before the time, else
+ * the pointer is to the first time digit.
*/
extern ACE_Export ACE_TCHAR *timestamp (ACE_TCHAR date_and_time[],
size_t time_len,
@@ -650,6 +664,14 @@ namespace ACE
return !((a < b) || (a > b));
}
+ /// Helper to avoid comparing floating point values with !=
+ /// (uses < and > operators).
+ template <typename T>
+ bool is_inequal (const T& a, const T& b)
+ {
+ return !is_equal (a, b);
+ }
+
/// Hex conversion utility.
extern ACE_Export ACE_TCHAR nibble2hex (u_int n);
diff --git a/dep/acelite/ace/ACE.inl b/dep/acelite/ace/ACE.inl
index e36e4f01f7b..95f45ee99d3 100644
--- a/dep/acelite/ace/ACE.inl
+++ b/dep/acelite/ace/ACE.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: ACE.inl 91813 2010-09-17 07:52:52Z johnnyw $
+// $Id: ACE.inl 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_Thread.h"
@@ -230,7 +230,7 @@ ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
ACE_INLINE ssize_t
ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
{
-#if defined (ACE_WIN32) || defined (ACE_OPENVMS) || defined (ACE_TANDEM_T1248_PTHREADS)
+#if defined (ACE_WIN32) || defined (ACE_OPENVMS)
return ACE_OS::recv (handle, (char *) buf, len);
#else
return ACE_OS::read (handle, (char *) buf, len);
diff --git a/dep/acelite/ace/ACE_crc_ccitt.cpp b/dep/acelite/ace/ACE_crc_ccitt.cpp
index 7dfefa5c69d..c1455d79171 100644
--- a/dep/acelite/ace/ACE_crc_ccitt.cpp
+++ b/dep/acelite/ace/ACE_crc_ccitt.cpp
@@ -1,4 +1,4 @@
-// $Id: ACE_crc_ccitt.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: ACE_crc_ccitt.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/ACE.h"
@@ -65,7 +65,7 @@ namespace
/*****************************************************************/
}
-#define COMPUTE(var, ch) (var) = (crc_table[(var ^ ch) & 0xFF] ^ (var >> 8))
+#define COMPUTE(var, ch) (var) = static_cast<ACE_UINT16> (crc_table[(var ^ ch) & 0xFF] ^ (var >> 8))
// Open versioned namespace, if enabled by the user.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -82,13 +82,13 @@ ACE::crc_ccitt (const char *string)
COMPUTE (crc, *p);
}
- return ~crc;
+ return static_cast<ACE_UINT16> (~crc);
}
ACE_UINT16
ACE::crc_ccitt (const void *buffer, size_t len, ACE_UINT16 crc)
{
- crc = ~crc;
+ crc = static_cast<ACE_UINT16> (~crc);
for (const char *p = (const char *) buffer,
*e = (const char *) buffer + len;
@@ -98,13 +98,13 @@ ACE::crc_ccitt (const void *buffer, size_t len, ACE_UINT16 crc)
COMPUTE (crc, *p);
}
- return ~crc;
+ return static_cast<ACE_UINT16> (~crc);
}
ACE_UINT16
ACE::crc_ccitt (const iovec *iov, int len, ACE_UINT16 crc)
{
- crc = ~crc;
+ crc = static_cast<ACE_UINT16> (~crc);
for (int i = 0; i < len; ++i)
{
@@ -115,7 +115,7 @@ ACE::crc_ccitt (const iovec *iov, int len, ACE_UINT16 crc)
COMPUTE (crc, *p);
}
- return ~crc;
+ return static_cast<ACE_UINT16> (~crc);
}
// Close versioned namespace, if enabled by the user.
diff --git a/dep/acelite/ace/ARGV.cpp b/dep/acelite/ace/ARGV.cpp
index 3b46459fe5b..e64c5d8696f 100644
--- a/dep/acelite/ace/ARGV.cpp
+++ b/dep/acelite/ace/ARGV.cpp
@@ -1,4 +1,4 @@
-// $Id: ARGV.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: ARGV.cpp 95630 2012-03-22 13:04:47Z johnnyw $
#ifndef ACE_ARGV_CPP
#define ACE_ARGV_CPP
@@ -167,6 +167,7 @@ ACE_ARGV_T<CHAR_TYPE>::ACE_ARGV_T (CHAR_TYPE *first_argv[],
CHAR_TYPE *first_buf = 0;
CHAR_TYPE *second_buf = 0;
+ size_t buf_len = 1;
// convert the first argv to a string
if (first_argv != 0 && first_argv[0] != 0)
@@ -175,6 +176,7 @@ ACE_ARGV_T<CHAR_TYPE>::ACE_ARGV_T (CHAR_TYPE *first_argv[],
first_buf,
substitute_env_args,
quote_args);
+ buf_len += ACE_OS::strlen (first_buf);
}
// convert the second argv to a string
@@ -184,14 +186,12 @@ ACE_ARGV_T<CHAR_TYPE>::ACE_ARGV_T (CHAR_TYPE *first_argv[],
second_buf,
substitute_env_args,
quote_args);
+ buf_len += ACE_OS::strlen (second_buf);
}
// Add the number of arguments in both the argvs.
this->argc_ = first_argc + second_argc;
- size_t buf_len =
- ACE_OS::strlen (first_buf) + ACE_OS::strlen (second_buf) + 1;
-
// Allocate memory to the lenght of the combined argv string.
ACE_NEW (this->buf_,
CHAR_TYPE[buf_len + 1]);
diff --git a/dep/acelite/ace/ARGV.h b/dep/acelite/ace/ARGV.h
index 66e71810a95..1c291bd6eda 100644
--- a/dep/acelite/ace/ARGV.h
+++ b/dep/acelite/ace/ARGV.h
@@ -4,7 +4,7 @@
/**
* @file ARGV.h
*
- * $Id: ARGV.h 81156 2008-03-30 20:56:47Z iliyan $
+ * $Id: ARGV.h 95972 2012-07-26 10:20:42Z johnnyw $
*
* @author Doug Schmidt <schmidt@cs.wustl.edu>
* @author Everett Anderson <eea1@cs.wustl.edu>
@@ -206,8 +206,8 @@ public:
*
* @param index Index to the desired element.
*
- * @retval Pointer to the indexed string.
- * @retval 0 if @a index is out of bounds.
+ * @retval Pointer to the indexed string.
+ * @retval 0 if @a index is out of bounds.
*/
const CHAR_TYPE *operator[] (size_t index);
diff --git a/dep/acelite/ace/ATM_Stream.inl b/dep/acelite/ace/ATM_Stream.inl
index 007e25832a5..94de09004d4 100644
--- a/dep/acelite/ace/ATM_Stream.inl
+++ b/dep/acelite/ace/ATM_Stream.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: ATM_Stream.inl 84262 2009-01-29 10:34:33Z johnnyw $
+// $Id: ATM_Stream.inl 92474 2010-11-02 13:29:39Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Abstract_Timer_Queue.cpp b/dep/acelite/ace/Abstract_Timer_Queue.cpp
new file mode 100644
index 00000000000..3207733b24e
--- /dev/null
+++ b/dep/acelite/ace/Abstract_Timer_Queue.cpp
@@ -0,0 +1,26 @@
+//$Id: Abstract_Timer_Queue.cpp 95334 2011-12-15 12:52:50Z msmit $
+
+#ifndef ACE_ABSTRACT_TIMER_QUEUE_CPP
+#define ACE_ABSTRACT_TIMER_QUEUE_CPP
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Abstract_Timer_Queue.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Even though the destructor is pure virtual you must provide an
+// implementation. Most people know this, but sometimes we all
+// forget, and we might be tempted to remove this code.
+template<typename TYPE>
+ACE_Abstract_Timer_Queue<TYPE>::
+~ACE_Abstract_Timer_Queue ()
+{
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_ABSTRACT_TIMER_QUEUE_CPP */
diff --git a/dep/acelite/ace/Abstract_Timer_Queue.h b/dep/acelite/ace/Abstract_Timer_Queue.h
new file mode 100644
index 00000000000..ddb8abf7f15
--- /dev/null
+++ b/dep/acelite/ace/Abstract_Timer_Queue.h
@@ -0,0 +1,230 @@
+//$Id: Abstract_Timer_Queue.h 95368 2011-12-19 13:38:49Z mcorino $
+
+#ifndef ACE_ABSTRACT_TIMER_QUEUE_H
+#define ACE_ABSTRACT_TIMER_QUEUE_H
+
+#include /**/ "ace/pre.h"
+/**
+ * @file Abstract_Timer_Queue.h
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ *
+ * Based on classes and files developed by Doug Schmidt, Darrell
+ * Brunsch, Irfan Pyarali and a cast of thousands.
+ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declares
+class ACE_Time_Value;
+class ACE_Command_Base;
+template<typename TYPE> class ACE_Timer_Queue_Iterator_T;
+template<typename TYPE> class ACE_Timer_Node_T;
+
+/**
+ * @class ACE_Abstract_Timer_Queue
+ *
+ * @brief Base class for all timer queues of a single type.
+ *
+ * This is a base class for all the timer queues, regardless of
+ * locking strategy, upcall mechanism, internal implementation, etc.
+ * The class was motivated by bug 3706:
+ * http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=3706
+ * In short, the Reactor (and potentially other classes) want to refer
+ * to timer queues regardless of the implementation internals.
+ */
+template<typename TYPE>
+class ACE_Abstract_Timer_Queue
+{
+public:
+ /// Destructor
+ virtual ~ACE_Abstract_Timer_Queue (void) = 0;
+
+ /// True if queue is empty, else false.
+ virtual bool is_empty (void) const = 0;
+
+ /// Returns the time of the earlier node in the Timer_Queue. Must
+ /// be called on a non-empty queue.
+ virtual const ACE_Time_Value &earliest_time (void) const = 0;
+
+ /**
+ * Schedule @a type that will expire at @a future_time, which is
+ * specified in absolute time. If it expires then @a act is passed
+ * in as the value to the <functor>. If @a interval is != to
+ * ACE_Time_Value::zero then it is used to reschedule the @a type
+ * automatically, using relative time to the current <gettimeofday>.
+ * This method returns a <timer_id> that uniquely identifies the the
+ * @a type entry in an internal list. This <timer_id> can be used to
+ * cancel the timer before it expires. The cancellation ensures
+ * that <timer_ids> are unique up to values of greater than 2
+ * billion timers. As long as timers don't stay around longer than
+ * this there should be no problems with accidentally deleting the
+ * wrong timer. Returns -1 on failure (which is guaranteed never to
+ * be a valid <timer_id>).
+ */
+ virtual long schedule (const TYPE &type,
+ const void *act,
+ const ACE_Time_Value &future_time,
+ const ACE_Time_Value &interval = ACE_Time_Value::zero) = 0;
+
+ /**
+ * Run the <functor> for all timers whose values are <= @a current_time.
+ * This does not account for <timer_skew>. Returns the number of
+ * timers canceled.
+ */
+ virtual int expire (const ACE_Time_Value &current_time) = 0;
+
+ /**
+ * Run the <functor> for all timers whose values are <=
+ * <ACE_OS::gettimeofday>. Also accounts for <timer_skew>.
+ *
+ * Depending on the resolution of the underlying OS the system calls
+ * like select()/poll() might return at time different than that is
+ * specified in the timeout. Suppose the OS guarantees a resolution of t ms.
+ * The timeline will look like
+ *
+ * A B
+ * | |
+ * V V
+ * |-------------|-------------|-------------|-------------|
+ * t t t t t
+ *
+ *
+ * If you specify a timeout value of A, then the timeout will not occur
+ * at A but at the next interval of the timer, which is later than
+ * that is expected. Similarly, if your timeout value is equal to B,
+ * then the timeout will occur at interval after B. Now depending upon the
+ * resolution of your timeouts and the accuracy of the timeouts
+ * needed for your application, you should set the value of
+ * <timer_skew>. In the above case, if you want the timeout A to fire
+ * no later than A, then you should specify your <timer_skew> to be
+ * A % t.
+ *
+ * The timeout value should be specified via the macro ACE_TIMER_SKEW
+ * in your config.h file. The default value is zero.
+ *
+ * Things get interesting if the t before the timeout value B is zero
+ * i.e your timeout is less than the interval. In that case, you are
+ * almost sure of not getting the desired timeout behaviour. Maybe you
+ * should look for a better OS :-)
+ *
+ * Returns the number of timers canceled.
+ */
+ virtual int expire (void) = 0;
+
+ /**
+ * A couple of classes using Timer_Queues need to dispatch a single
+ * event at a time. But before they dispatch the event they need to
+ * release a lock, signal other threads, etc.
+ *
+ * This member function should be used in that case. The additional
+ * operations to be called just before dispatching the event, and
+ * only if an event will be dispatched, are encapsulated in the
+ * ACE_Command_Base object.
+ */
+ virtual int expire_single(ACE_Command_Base & pre_dispatch_command) = 0;
+
+ /**
+ * Resets the interval of the timer represented by @a timer_id to
+ * @a interval, which is specified in relative time to the current
+ * <gettimeofday>. If @a interval is equal to
+ * ACE_Time_Value::zero, the timer will become a non-rescheduling
+ * timer. Returns 0 if successful, -1 if not.
+ */
+ virtual int reset_interval (long timer_id,
+ const ACE_Time_Value &interval) = 0;
+
+ /**
+ * Cancel all timer associated with @a type. If
+ * @a dont_call_handle_close is 0 then the <functor> will be invoked,
+ * which typically invokes the <handle_close> hook. Returns number
+ * of timers cancelled.
+ */
+ virtual int cancel (const TYPE &type,
+ int dont_call_handle_close = 1) = 0;
+
+ /**
+ * Cancel the single timer that matches the @a timer_id value (which
+ * was returned from the <schedule> method). If act is non-NULL
+ * then it will be set to point to the ``magic cookie'' argument
+ * passed in when the timer was registered. This makes it possible
+ * to free up the memory and avoid memory leaks. If
+ * @a dont_call_handle_close is 0 then the <functor> will be invoked,
+ * which typically calls the <handle_close> hook. Returns 1 if
+ * cancellation succeeded and 0 if the @a timer_id wasn't found.
+ */
+ virtual int cancel (long timer_id,
+ const void **act = 0,
+ int dont_call_handle_close = 1) = 0;
+
+ /**
+ * Close timer queue. Cancels all timers.
+ */
+ virtual int close (void) = 0;
+
+ /**
+ * Returns the current time of day. This method allows different
+ * implementations of the timer queue to use special high resolution
+ * timers.
+ */
+ virtual ACE_Time_Value gettimeofday (void) = 0;
+
+ /**
+ * Allows applications to control how the timer queue gets the time
+ * of day.
+ * @deprecated Use TIME_POLICY support instead. See Timer_Queue_T.h
+ */
+ virtual void gettimeofday (ACE_Time_Value (*gettimeofday)(void)) = 0;
+
+ /// Determine the next event to timeout. Returns @a max if there are
+ /// no pending timers or if all pending timers are longer than max.
+ /// This method acquires a lock internally since it modifies internal state.
+ virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max) = 0;
+
+ /**
+ * Determine the next event to timeout. Returns @a max if there are
+ * no pending timers or if all pending timers are longer than max.
+ * <the_timeout> should be a pointer to storage for the timeout value,
+ * and this value is also returned. This method does not acquire a
+ * lock internally since it doesn't modify internal state. If you
+ * need to call this method when the queue is being modified
+ * concurrently, however, you should make sure to acquire the <mutex()>
+ * externally before making the call.
+ */
+ virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max,
+ ACE_Time_Value *the_timeout) = 0;
+
+ /**
+ * Return the current time, using the right time policy and any
+ * timer skew defined in derived classes.
+ */
+ virtual ACE_Time_Value current_time() = 0;
+
+ /// Type of Iterator.
+ typedef ACE_Timer_Queue_Iterator_T<TYPE> ITERATOR;
+
+ /// Returns a pointer to this ACE_Timer_Queue's iterator.
+ virtual ITERATOR & iter (void) = 0;
+
+ /// Removes the earliest node from the queue and returns it
+ virtual ACE_Timer_Node_T<TYPE> *remove_first (void) = 0;
+
+ /// Reads the earliest node from the queue and returns it.
+ virtual ACE_Timer_Node_T<TYPE> *get_first (void) = 0;
+
+ /// Dump the state of a object.
+ virtual void dump (void) const = 0;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "ace/Abstract_Timer_Queue.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Abstract_Timer_Queue.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_ABSTRACT_TIMER_QUEUE_H */
diff --git a/dep/acelite/ace/Acceptor.cpp b/dep/acelite/ace/Acceptor.cpp
index 236a35ba803..72bebfd78c4 100644
--- a/dep/acelite/ace/Acceptor.cpp
+++ b/dep/acelite/ace/Acceptor.cpp
@@ -1,4 +1,4 @@
-// $Id: Acceptor.cpp 91623 2010-09-06 09:30:59Z sma $
+// $Id: Acceptor.cpp 95730 2012-05-04 17:28:19Z johnnyw $
#ifndef ACE_ACCEPTOR_CPP
#define ACE_ACCEPTOR_CPP
@@ -900,7 +900,10 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Oneshot_Acceptor (void)
- : delete_concurrency_strategy_ (false)
+ : svc_handler_ (0),
+ restart_ (false),
+ concurrency_strategy_ (0),
+ delete_concurrency_strategy_ (false)
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Oneshot_Acceptor");
this->reactor (0);
@@ -911,7 +914,10 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Oneshot_Acceptor
(const ACE_PEER_ACCEPTOR_ADDR &local_addr,
ACE_Reactor *reactor,
ACE_Concurrency_Strategy<SVC_HANDLER> *cs)
- : delete_concurrency_strategy_ (false)
+ : svc_handler_ (0),
+ restart_ (false),
+ concurrency_strategy_ (0),
+ delete_concurrency_strategy_ (false)
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Oneshot_Acceptor");
if (this->open (local_addr, reactor, cs) == -1)
@@ -1010,7 +1016,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::register_handler
if (tv != 0
&& this->reactor ()->schedule_timer (this,
synch_options.arg (),
- *tv) == 0)
+ *tv) == -1)
return -1;
else
return this->reactor ()->register_handler
diff --git a/dep/acelite/ace/Acceptor.h b/dep/acelite/ace/Acceptor.h
index 64cf488b9d4..fdd00d5a04d 100644
--- a/dep/acelite/ace/Acceptor.h
+++ b/dep/acelite/ace/Acceptor.h
@@ -4,7 +4,7 @@
/**
* @file Acceptor.h
*
- * $Id: Acceptor.h 88800 2010-02-01 23:18:34Z shuston $
+ * $Id: Acceptor.h 93624 2011-03-22 21:14:05Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -193,9 +193,9 @@ protected:
virtual int accept_svc_handler (SVC_HANDLER *svc_handler);
/**
- * Bridge method for activating a {svc_handler} with the appropriate
+ * Bridge method for activating a @a svc_handler with the appropriate
* concurrency strategy. The default behavior of this method is to
- * activate the SVC_HANDLER by calling its {open} method (which
+ * activate the SVC_HANDLER by calling its open() method (which
* allows the SVC_HANDLER to define its own concurrency strategy).
* However, subclasses can override this strategy to do more
* sophisticated concurrency activations (such as making the
diff --git a/dep/acelite/ace/Active_Map_Manager.h b/dep/acelite/ace/Active_Map_Manager.h
index a6c167e5f88..7bade46aa5b 100644
--- a/dep/acelite/ace/Active_Map_Manager.h
+++ b/dep/acelite/ace/Active_Map_Manager.h
@@ -4,7 +4,7 @@
/**
* @file Active_Map_Manager.h
*
- * $Id: Active_Map_Manager.h 91066 2010-07-12 11:05:04Z johnnyw $
+ * $Id: Active_Map_Manager.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Irfan Pyarali
*/
@@ -68,7 +68,7 @@ public:
void decode (const void *data);
/// Encode state of the active key into @a data. @a data must be as
- /// big as the value returned from <size>.
+ /// big as the value returned from size().
void encode (void *data) const;
/// Compare keys.
diff --git a/dep/acelite/ace/Arg_Shifter.h b/dep/acelite/ace/Arg_Shifter.h
index 57cd2b0f56c..123a70560cf 100644
--- a/dep/acelite/ace/Arg_Shifter.h
+++ b/dep/acelite/ace/Arg_Shifter.h
@@ -4,7 +4,7 @@
/**
* @file Arg_Shifter.h
*
- * $Id: Arg_Shifter.h 91459 2010-08-25 09:51:01Z mcorino $
+ * $Id: Arg_Shifter.h 95972 2012-07-26 10:20:42Z johnnyw $
*
* @author Seth Widoff
*/
@@ -211,10 +211,10 @@ private:
/// The index of <argv_> in which we'll stick the next known
/// argument.
- int front_;
- /* This is not really the "front" at all. It's the point after
+ /** This is not really the "front" at all. It's the point after
* which the unknown arguments end and at which the known arguments begin.
*/
+ int front_;
};
typedef ACE_Arg_Shifter_T<ACE_TCHAR> ACE_Arg_Shifter;
diff --git a/dep/acelite/ace/Argv_Type_Converter.h b/dep/acelite/ace/Argv_Type_Converter.h
index d41d839b671..0cf62fa089e 100644
--- a/dep/acelite/ace/Argv_Type_Converter.h
+++ b/dep/acelite/ace/Argv_Type_Converter.h
@@ -4,7 +4,7 @@
/**
* @file Argv_Type_Converter.h
*
- * $Id: Argv_Type_Converter.h 83891 2008-11-28 11:01:50Z johnnyw $
+ * $Id: Argv_Type_Converter.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Si Mong Park <spark@ociweb.com>
*/
@@ -78,7 +78,7 @@ private:
/// argv list.
void align_wchar_with_char (void);
- /// Clean up removed (comsumed) argv entries and reset the pass flags.
+ /// Clean up removed (consumed) argv entries and reset the pass flags.
void cleanup (void);
#endif // ACE_USES_WCHAR
diff --git a/dep/acelite/ace/Array_Base.h b/dep/acelite/ace/Array_Base.h
index 0d6620a6ca6..9276bf6ee38 100644
--- a/dep/acelite/ace/Array_Base.h
+++ b/dep/acelite/ace/Array_Base.h
@@ -4,7 +4,7 @@
/**
* @file Array_Base.h
*
- * $Id: Array_Base.h 84477 2009-02-16 13:30:38Z johnnyw $
+ * $Id: Array_Base.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -67,21 +67,21 @@ public:
ACE_Array_Base (size_type size = 0,
ACE_Allocator * the_allocator = 0);
- /// Dynamically initialize the entire array to the <default_value>.
+ /// Dynamically initialize the entire array to the @a default_value.
ACE_Array_Base (size_type size,
T const & default_value,
ACE_Allocator * the_allocator = 0);
/**
* The copy constructor performs initialization by making an exact
- * copy of the contents of parameter <s>, i.e., *this == s will
+ * copy of the contents of parameter @a s, i.e., *this == s will
* return true.
*/
ACE_Array_Base (ACE_Array_Base<T> const & s);
/**
* Assignment operator performs an assignment by making an exact
- * copy of the contents of parameter <s>, i.e., *this == s will
+ * copy of the contents of parameter @a s, i.e., *this == s will
* return true. Note that if the <max_size_> of <array_> is >= than
* <s.max_size_> we can copy it without reallocating. However, if
* <max_size_> is < <s.max_size_> we must delete the <array_>,
diff --git a/dep/acelite/ace/Array_Map.cpp b/dep/acelite/ace/Array_Map.cpp
index 5530a8b54b6..25b4e24579c 100644
--- a/dep/acelite/ace/Array_Map.cpp
+++ b/dep/acelite/ace/Array_Map.cpp
@@ -1,4 +1,4 @@
-// $Id: Array_Map.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Array_Map.cpp 92386 2010-10-28 07:44:37Z johnnyw $
#ifndef ACE_ARRAY_MAP_CPP
#define ACE_ARRAY_MAP_CPP
@@ -15,7 +15,6 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
template<typename Key, typename Value, class EqualTo>
template<typename InputIterator>
ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map (InputIterator f,
@@ -34,26 +33,6 @@ ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map (InputIterator f,
// for (InputIterator i = f; i != l; ++i, ++n)
// *n = *i;
}
-#else
-template<typename Key, typename Value, class EqualTo>
-ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map (
- typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator f,
- typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator l)
- : size_ (l - f)
- , capacity_ (size_)
- , nodes_ (size_ == 0 ? 0 : new value_type[size_])
-{
- (void) std::copy (f,
- l,
- ACE_make_checked_array_iterator (this->begin (),
- this->size_));
-
-// iterator n = this->begin ();
-
-// for (const_iterator i = f; i != l; ++i, ++n)
-// *n = *i;
-}
-#endif /* !ACE_LACKS_MEMBER_TEMPLATES */
template<typename Key, typename Value, class EqualTo>
ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map (
@@ -119,7 +98,6 @@ ACE_Array_Map<Key, Value, EqualTo>::insert (
return std::make_pair (i, inserted);
}
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
template<typename Key, typename Value, class EqualTo>
template<typename InputIterator>
void
@@ -132,21 +110,6 @@ ACE_Array_Map<Key, Value, EqualTo>::insert (InputIterator f, InputIterator l)
(void) this->insert (*i);
}
}
-#else
-template<typename Key, typename Value, class EqualTo>
-void
-ACE_Array_Map<Key, Value, EqualTo>::insert (
- typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator f,
- typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator l)
-{
- this->grow (l - f); // Preallocate storage.
-
- for (const_iterator i = f; i != l; ++i)
- {
- (void) this->insert (*i);
- }
-}
-#endif /* ACE_LACKS_MEMBER_TEMPLATES */
template<typename Key, typename Value, class EqualTo>
void
diff --git a/dep/acelite/ace/Array_Map.h b/dep/acelite/ace/Array_Map.h
index 1515ea45529..0bd3b1ffeda 100644
--- a/dep/acelite/ace/Array_Map.h
+++ b/dep/acelite/ace/Array_Map.h
@@ -4,7 +4,7 @@
/**
* @file Array_Map.h
*
- * $Id: Array_Map.h 84136 2009-01-12 11:01:17Z johnnyw $
+ * $Id: Array_Map.h 92386 2010-10-28 07:44:37Z johnnyw $
*
* Light weight array-based map with fast iteration but linear
* (i.e. O(n)) search times. STL-style interface is exposed.
@@ -110,12 +110,8 @@ public:
*/
ACE_Array_Map (size_type s = 0);
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
template<typename InputIterator>
ACE_Array_Map (InputIterator f, InputIterator l);
-#else
- ACE_Array_Map (const_iterator f, const_iterator l);
-#endif /* !ACE_LACKS_MEMBER_TEMPLATES */
ACE_Array_Map (ACE_Array_Map const & map);
ACE_Array_Map & operator= (ACE_Array_Map const & map);
@@ -181,14 +177,9 @@ public:
*/
std::pair<iterator, bool> insert (value_type const & x);
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
/// Insert range of elements into map.
template<typename InputIterator>
void insert (InputIterator f, InputIterator l);
-#else
- /// Insert range of elements into map.
- void insert (const_iterator f, const_iterator l);
-#endif /* ACE_LACKS_MEMBER_TEMPLATES */
/// Remove element at position @a pos from the map.
void erase (iterator pos);
diff --git a/dep/acelite/ace/Asynch_Acceptor.cpp b/dep/acelite/ace/Asynch_Acceptor.cpp
index 56af2f14056..916b250b7af 100644
--- a/dep/acelite/ace/Asynch_Acceptor.cpp
+++ b/dep/acelite/ace/Asynch_Acceptor.cpp
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: Asynch_Acceptor.cpp 91693 2010-09-09 12:57:54Z johnnyw $
+// $Id: Asynch_Acceptor.cpp 95630 2012-03-22 13:04:47Z johnnyw $
#ifndef ACE_ASYNCH_ACCEPTOR_C
#define ACE_ASYNCH_ACCEPTOR_C
@@ -30,7 +30,8 @@ ACE_Asynch_Acceptor<HANDLER>::ACE_Asynch_Acceptor (void)
pass_addresses_ (false),
validate_new_connection_ (false),
reissue_accept_ (1),
- bytes_to_read_ (0)
+ bytes_to_read_ (0),
+ addr_family_ (0)
{
}
@@ -297,8 +298,10 @@ ACE_Asynch_Acceptor<HANDLER>::handle_accept (const ACE_Asynch_Accept::Result &re
// If no errors
if (!error)
{
- // Update the Proactor.
- new_handler->proactor (this->proactor ());
+ // Update the Proactor unless make_handler() or constructed handler
+ // set up its own.
+ if (new_handler->proactor () == 0)
+ new_handler->proactor (this->proactor ());
// Pass the addresses
if (this->pass_addresses_)
diff --git a/dep/acelite/ace/Asynch_IO_Impl.h b/dep/acelite/ace/Asynch_IO_Impl.h
index 06eb5c10a87..e820529dfb5 100644
--- a/dep/acelite/ace/Asynch_IO_Impl.h
+++ b/dep/acelite/ace/Asynch_IO_Impl.h
@@ -4,7 +4,7 @@
/**
* @file Asynch_IO_Impl.h
*
- * $Id: Asynch_IO_Impl.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Asynch_IO_Impl.h 93359 2011-02-11 11:33:12Z mcorino $
*
*
* This class contains asbtract base classes for all the concrete
@@ -81,7 +81,7 @@ public:
/**
* POSIX4 real-time signal number to be used for the
- * operation. <signal_number> ranges from SIGRTMIN to SIGRTMAX. By
+ * operation. signal_number ranges from SIGRTMIN to SIGRTMAX. By
* default, SIGRTMIN is used to issue <aio_> calls. This is a no-op
* on non-POSIX4 systems and returns 0.
*/
diff --git a/dep/acelite/ace/Atomic_Op.h b/dep/acelite/ace/Atomic_Op.h
index 4dee35e6efb..e2f477fbbc7 100644
--- a/dep/acelite/ace/Atomic_Op.h
+++ b/dep/acelite/ace/Atomic_Op.h
@@ -4,7 +4,7 @@
/**
* @file Atomic_Op.h
*
- * $Id: Atomic_Op.h 91523 2010-08-27 14:18:02Z johnnyw $
+ * $Id: Atomic_Op.h 95225 2011-12-05 20:25:15Z shuston $
*
* @author Douglas C. Schmidt <schmidt@uci.edu>
*/
@@ -124,6 +124,9 @@ public:
/// Atomically assign <rhs> to @c value_.
ACE_Atomic_Op<ACE_Thread_Mutex, long> &operator= (const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs);
+ /// Exchange value with @a newval.
+ long exchange (long newval);
+
/// Explicitly return @c value_.
long value (void) const;
@@ -221,6 +224,9 @@ public:
/// Atomically assign <rhs> to @c value_.
ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long> &operator= (const ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long> &rhs);
+ /// Exchange value with @a newval.
+ unsigned long exchange (unsigned long newval);
+
/// Explicitly return @c value_.
unsigned long value (void) const;
diff --git a/dep/acelite/ace/Atomic_Op.inl b/dep/acelite/ace/Atomic_Op.inl
index 564017aec62..e1f1ca21143 100644
--- a/dep/acelite/ace/Atomic_Op.inl
+++ b/dep/acelite/ace/Atomic_Op.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: Atomic_Op.inl 91813 2010-09-17 07:52:52Z johnnyw $
+// $Id: Atomic_Op.inl 95225 2011-12-05 20:25:15Z shuston $
#if defined (ACE_HAS_INTRINSIC_INTERLOCKED)
# include "ace/os_include/os_intrin.h"
@@ -190,6 +189,22 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (
}
ACE_INLINE long
+ACE_Atomic_Op<ACE_Thread_Mutex, long>::exchange (long newval)
+{
+#if defined (ACE_HAS_INTRINSIC_INTERLOCKED)
+ return ::_InterlockedExchange (const_cast<long *> (&this->value_), newval);
+#elif defined (WIN32)
+ return ::InterlockedExchange (const_cast<long *> (&this->value_), newval);
+#elif defined (ACE_HAS_VXATOMICLIB)
+ return ::vxAtomicSet (reinterpret_cast <atomic_t*>(const_cast<long *> (&this->value_)), newval);
+#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB)
+ return ::atomic_swap_ulong (reinterpret_cast<volatile unsigned long*>(&this->value_), newval);
+#else /* WIN32 */
+ return (*exchange_fn_) (&this->value_, newval);
+#endif /* WIN32 */
+}
+
+ACE_INLINE long
ACE_Atomic_Op<ACE_Thread_Mutex, long>::value (void) const
{
return this->value_;
@@ -374,6 +389,22 @@ ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long>::operator= (
}
ACE_INLINE unsigned long
+ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long>::exchange (unsigned long newval)
+{
+#if defined (ACE_HAS_INTRINSIC_INTERLOCKED)
+ return ::_InterlockedExchange (const_cast<long *> (reinterpret_cast<volatile long*> (&this->value_)), newval);
+#elif defined (WIN32)
+ return ::InterlockedExchange (const_cast<long *> (reinterpret_cast<volatile long*> (&this->value_)), newval);
+#elif defined (ACE_HAS_VXATOMICLIB)
+ return ::vxAtomicSet (reinterpret_cast <atomic_t*>(const_cast<long *> (reinterpret_cast<volatile long*> (&this->value_))), newval);
+#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB)
+ return ::atomic_swap_ulong (&this->value_, newval);
+#else /* WIN32 */
+ return (*exchange_fn_) (reinterpret_cast<volatile long *> (&this->value_), newval);
+#endif /* WIN32 */
+}
+
+ACE_INLINE unsigned long
ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long>::value (void) const
{
return this->value_;
diff --git a/dep/acelite/ace/Atomic_Op_GCC_T.h b/dep/acelite/ace/Atomic_Op_GCC_T.h
index 92bc771dda6..f980f7f022e 100644
--- a/dep/acelite/ace/Atomic_Op_GCC_T.h
+++ b/dep/acelite/ace/Atomic_Op_GCC_T.h
@@ -4,7 +4,7 @@
/**
* @file Atomic_Op_GCC_T.h
*
- * $Id: Atomic_Op_GCC_T.h 89339 2010-03-05 12:20:47Z johnnyw $
+ * $Id: Atomic_Op_GCC_T.h 95225 2011-12-05 20:25:15Z shuston $
*
* @author Johnny Willemsen <jwillemsen@remedy.nl
*/
@@ -74,6 +74,9 @@ public:
/// Atomically check if @c value_ less than rhs.
bool operator< (T rhs) const;
+ /// Exchange value with @a newval.
+ T exchange (T newval);
+
/// Explicitly return @c value_.
T value (void) const;
diff --git a/dep/acelite/ace/Atomic_Op_GCC_T.inl b/dep/acelite/ace/Atomic_Op_GCC_T.inl
index c6fe027022b..9559e1ec6e4 100644
--- a/dep/acelite/ace/Atomic_Op_GCC_T.inl
+++ b/dep/acelite/ace/Atomic_Op_GCC_T.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: Atomic_Op_GCC_T.inl 89391 2010-03-08 13:53:30Z johnnyw $
+// $Id: Atomic_Op_GCC_T.inl 95225 2011-12-05 20:25:15Z shuston $
#if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1)
@@ -131,6 +130,13 @@ ACE_Atomic_Op_GCC<T>::operator= (
template <typename T>
ACE_INLINE T
+ACE_Atomic_Op_GCC<T>::exchange (T newval)
+{
+ return __sync_val_compare_and_swap (&this->value_, this->value_, newval);
+}
+
+template <typename T>
+ACE_INLINE T
ACE_Atomic_Op_GCC<T>::value (void) const
{
return this->value_;
diff --git a/dep/acelite/ace/Atomic_Op_T.h b/dep/acelite/ace/Atomic_Op_T.h
index 7a20049ced8..944c0454c38 100644
--- a/dep/acelite/ace/Atomic_Op_T.h
+++ b/dep/acelite/ace/Atomic_Op_T.h
@@ -4,7 +4,7 @@
/**
* @file Atomic_Op_T.h
*
- * $Id: Atomic_Op_T.h 92353 2010-10-25 06:34:35Z johnnyw $
+ * $Id: Atomic_Op_T.h 95761 2012-05-15 18:23:04Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@uci.edu>
*/
@@ -88,22 +88,17 @@ struct ACE_Type_Traits<unsigned long>
typedef unsigned long parameter_type;
};
-#ifndef ACE_LACKS_LONGLONG_T
template<>
struct ACE_Type_Traits<long long>
{
typedef long long parameter_type;
};
-#endif /* !ACE_LACKS_LONGLONG_T */
-#if !defined (ACE_LACKS_LONGLONG_T) \
- && !defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
template<>
struct ACE_Type_Traits<unsigned long long>
{
typedef unsigned long long parameter_type;
};
-#endif /* !ACE_LACKS_LONGLONG_T && !ACE_LACKS_UNSIGNEDLONGLONG_T */
template<>
struct ACE_Type_Traits<float>
@@ -207,6 +202,9 @@ public:
ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &operator= (
ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> const & rhs);
+ /// Exchange value with @a newval.
+ TYPE exchange (TYPE newval);
+
/// Explicitly return @c value_.
TYPE value (void) const;
@@ -318,6 +316,9 @@ public:
/// Atomically check if @c value_ less than @a rhs.
bool operator< (arg_type rhs) const;
+ /// Exchange value with @a newval.
+ TYPE exchange (TYPE newval);
+
/// Explicitly return @c value_.
TYPE value (void) const;
diff --git a/dep/acelite/ace/Atomic_Op_T.inl b/dep/acelite/ace/Atomic_Op_T.inl
index 71ce1c1e267..87e6b55d7be 100644
--- a/dep/acelite/ace/Atomic_Op_T.inl
+++ b/dep/acelite/ace/Atomic_Op_T.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Atomic_Op_T.inl 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: Atomic_Op_T.inl 95225 2011-12-05 20:25:15Z shuston $
#include "ace/Guard_T.h"
@@ -154,6 +154,16 @@ ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator= (
template <class ACE_LOCK, class TYPE>
ACE_INLINE TYPE
+ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::exchange (TYPE newval)
+{
+ // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::exchange");
+ ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_);
+ std::swap (this->value_, newval);
+ return newval;
+}
+
+template <class ACE_LOCK, class TYPE>
+ACE_INLINE TYPE
ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::value (void) const
{
// ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::value");
@@ -308,6 +318,13 @@ ACE_Atomic_Op<ACE_LOCK, TYPE>::operator< (
template <class ACE_LOCK, class TYPE>
ACE_INLINE TYPE
+ACE_Atomic_Op<ACE_LOCK, TYPE>::exchange (TYPE newval)
+{
+ return this->impl_.exchange (newval);
+}
+
+template <class ACE_LOCK, class TYPE>
+ACE_INLINE TYPE
ACE_Atomic_Op<ACE_LOCK, TYPE>::value (void) const
{
return this->impl_.value ();
diff --git a/dep/acelite/ace/Auto_Functor.h b/dep/acelite/ace/Auto_Functor.h
index 2c2b81eb265..393a11c73bc 100644
--- a/dep/acelite/ace/Auto_Functor.h
+++ b/dep/acelite/ace/Auto_Functor.h
@@ -3,7 +3,7 @@
/**
* @file Auto_Functor.h
*
- * $Id: Auto_Functor.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Auto_Functor.h 92386 2010-10-28 07:44:37Z johnnyw $
*
* @author Carlos O'Ryan <coryan@atdesk.com>
*/
@@ -69,13 +69,11 @@ public:
Auto_Functor<X,Functor>& operator= (Auto_Functor & rhs); // throw()
-#if !defined(ACE_LACKS_MEMBER_TEMPLATES)
template<typename Y>
Auto_Functor(Auto_Functor<Y,Functor>& rhs); // throw()
template<typename Y>
Auto_Functor<X,Functor>& operator= (Auto_Functor<Y,Functor>& rhs); // throw()
-#endif /* ACE_LACKS_MEMBER_TEMPLATES */
~Auto_Functor(); // throw()
@@ -97,13 +95,9 @@ public:
Auto_Functor<X,Functor> & operator=(Auto_Functor_Ref<X,Functor> rhs); // throw()
-#if !defined(ACE_LACKS_MEMBER_TEMPLATES)
template<typename Y> operator Auto_Functor_Ref<Y,Functor>(); // throw()
template<typename Y> operator Auto_Functor<Y,Functor>(); // throw()
-#else
- operator Auto_Functor_Ref<X,Functor>(); // throw()
-#endif /* ACE_LACKS_MEMBER_TEMPLATES */
private:
X * p_;
diff --git a/dep/acelite/ace/Auto_Functor.inl b/dep/acelite/ace/Auto_Functor.inl
index d4cb2cc0473..5e714e01410 100644
--- a/dep/acelite/ace/Auto_Functor.inl
+++ b/dep/acelite/ace/Auto_Functor.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Auto_Functor.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Auto_Functor.inl 92386 2010-10-28 07:44:37Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -35,7 +35,6 @@ ACE_Utils::Auto_Functor<X,Functor>:: operator=(Auto_Functor & rhs)
return *this;
}
-#if !defined(ACE_LACKS_MEMBER_TEMPLATES)
template<typename X, typename Functor> template<typename Y> ACE_INLINE
ACE_Utils::Auto_Functor<X,Functor>::Auto_Functor(Auto_Functor<Y,Functor>& rhs)
: p_(rhs.release())
@@ -50,7 +49,6 @@ ACE_Utils::Auto_Functor<X,Functor>::operator=(Auto_Functor<Y,Functor>& rhs)
reset(rhs.release());
return *this;
}
-#endif /* ACE_LACKS_MEMBER_TEMPLATES */
template<typename X, typename Functor> ACE_INLINE X &
ACE_Utils::Auto_Functor<X,Functor>::operator*() const
@@ -107,8 +105,6 @@ ACE_Utils::Auto_Functor<X,Functor>::operator=(Auto_Functor_Ref<X,Functor> rhs)
return *this;
}
-#if !defined(ACE_LACKS_MEMBER_TEMPLATES)
-
template<typename X, typename Functor> template<typename Y> ACE_INLINE
ACE_Utils::Auto_Functor<X,Functor>::operator ACE_Utils::Auto_Functor_Ref<Y,Functor>()
{
@@ -121,14 +117,4 @@ ACE_Utils::Auto_Functor<X,Functor>::operator ACE_Utils::Auto_Functor<Y,Functor>(
return ACE_Utils::Auto_Functor<Y,Functor>(release(), f_);
}
-#else
-
-template<typename X, typename Functor>ACE_INLINE
-ACE_Utils::Auto_Functor<X,Functor>::operator ACE_Utils::Auto_Functor_Ref<X,Functor>()
-{
- return ACE_Utils::Auto_Functor_Ref<X,Functor>(release(), f_);
-}
-
-#endif /* ACE_LACKS_MEMBER_TEMPLATES */
-
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Auto_Ptr.h b/dep/acelite/ace/Auto_Ptr.h
index 3183019aceb..e9468a73bc7 100644
--- a/dep/acelite/ace/Auto_Ptr.h
+++ b/dep/acelite/ace/Auto_Ptr.h
@@ -4,7 +4,7 @@
/**
* @file Auto_Ptr.h
*
- * $Id: Auto_Ptr.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Auto_Ptr.h 92580 2010-11-15 09:48:02Z johnnyw $
*
* @author Doug Schmidt <schmidt@uci.edu>
* @author Irfan Pyarali <irfan@cs.wustl.edu>
@@ -106,9 +106,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @brief Implements the draft C++ standard auto_ptr abstraction.
- * This version can be used instead of auto_ptr<T>, and obviates
- * the need for the ACE_AUTO_PTR_RESET macro on platforms like
- * VC6 where the auto_ptr<T> is broken.
+ * This version can be used instead of auto_ptr<T>
*/
template <typename X>
class ACE_Auto_Ptr : public ACE_Auto_Basic_Ptr <X>
@@ -209,18 +207,6 @@ ACE_auto_ptr_reset (AUTO_PTR_TYPE & ap,
ACE_END_VERSIONED_NAMESPACE_DECL
-// Some platforms have an older version of auto_ptr
-// support, which lacks reset, and cannot be disabled
-// easily. Portability to these platforms requires
-// use of the following ACE_AUTO_PTR_RESET macro.
-//
-// The TYPE macro parameter is no longer necessary but we leave it
-// around for backward compatibility. This is also the reason why the
-// ACE_auto_ptr_reset function template is not called
-// ACE_AUTO_PTR_RESET.
-# define ACE_AUTO_PTR_RESET(AUTOPTR,NEWPTR,TYPE) \
- ACE_auto_ptr_reset (AUTOPTR, NEWPTR);
-
#if defined (__ACE_INLINE__)
#include "ace/Auto_Ptr.inl"
#endif /* __ACE_INLINE__ */
diff --git a/dep/acelite/ace/Barrier.h b/dep/acelite/ace/Barrier.h
index 84d7b6492ff..e1e3815e190 100644
--- a/dep/acelite/ace/Barrier.h
+++ b/dep/acelite/ace/Barrier.h
@@ -4,7 +4,7 @@
/**
* @file Barrier.h
*
- * $Id: Barrier.h 92069 2010-09-28 11:38:59Z johnnyw $
+ * $Id: Barrier.h 93359 2011-02-11 11:33:12Z mcorino $
*
* Moved from Synch.h.
*
@@ -101,7 +101,7 @@ public:
const ACE_TCHAR *name = 0,
void *arg = 0);
- /// Default dtor.
+ /// Default destructor.
~ACE_Barrier (void);
/// Block the caller until all @c count threads have called @c wait and
@@ -170,7 +170,7 @@ public:
/// Create a Thread_Barrier, passing in the optional @a name.
ACE_Thread_Barrier (unsigned int count, const ACE_TCHAR *name = 0);
- /// Default dtor.
+ /// Default destructor.
~ACE_Thread_Barrier (void);
/// Dump the state of an object.
diff --git a/dep/acelite/ace/Base_Thread_Adapter.cpp b/dep/acelite/ace/Base_Thread_Adapter.cpp
index fd2629f1608..4b7b6a84c08 100644
--- a/dep/acelite/ace/Base_Thread_Adapter.cpp
+++ b/dep/acelite/ace/Base_Thread_Adapter.cpp
@@ -1,4 +1,4 @@
-// $Id: Base_Thread_Adapter.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Base_Thread_Adapter.cpp 95595 2012-03-07 13:33:25Z johnnyw $
#include "ace/Base_Thread_Adapter.h"
@@ -29,12 +29,14 @@ ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter (
, ACE_SEH_EXCEPT_HANDLER selector
, ACE_SEH_EXCEPT_HANDLER handler
#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , long cancel_flags
)
: user_func_ (user_func)
, arg_ (arg)
, entry_point_ (entry_point)
, thr_desc_ (td)
, ctx_ (ACE_Service_Config::current())
+ , flags_ (cancel_flags)
{
ACE_OS_TRACE ("ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter");
@@ -83,6 +85,10 @@ ACE_Base_Thread_Adapter::sync_log_msg (const ACE_TCHAR *prg)
(*ACE_Base_Thread_Adapter::sync_log_msg_hook_) (prg);
}
+ACE_OS_Thread_Descriptor::~ACE_OS_Thread_Descriptor (void)
+{
+}
+
ACE_OS_Thread_Descriptor *
ACE_Base_Thread_Adapter::thr_desc_log_msg (void)
{
diff --git a/dep/acelite/ace/Base_Thread_Adapter.h b/dep/acelite/ace/Base_Thread_Adapter.h
index b36d18e4f13..2075e9122ad 100644
--- a/dep/acelite/ace/Base_Thread_Adapter.h
+++ b/dep/acelite/ace/Base_Thread_Adapter.h
@@ -4,7 +4,7 @@
/**
* @file Base_Thread_Adapter.h
*
- * $Id: Base_Thread_Adapter.h 81239 2008-04-04 22:28:48Z iliyan $
+ * $Id: Base_Thread_Adapter.h 95595 2012-03-07 13:33:25Z johnnyw $
*
* @author Nanbor Wang <nanbor@cs.wustl.edu>
*/
@@ -33,9 +33,8 @@
# define ACE_THREAD_ADAPTER_NAME ace_thread_adapter
#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */
-// Run the thread entry point for the ACE_Thread_Adapter. This must
-// be an extern "C" to make certain compilers happy...
-
+/// Run the thread entry point for the ACE_Thread_Adapter. This must
+/// be an extern "C" to make certain compilers happy...
extern "C" ACE_Export ACE_THR_FUNC_RETURN ACE_THREAD_ADAPTER_NAME (void *args);
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -44,7 +43,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* @class ACE_OS_Thread_Descriptor
*
* @brief Parent class of all ACE_Thread_Descriptor classes.
- * =
+ *
* Container for ACE_Thread_Descriptor members that are
* used in ACE_OS.
*/
@@ -54,6 +53,8 @@ public:
/// Get the thread creation flags.
long flags (void) const;
+ virtual ~ACE_OS_Thread_Descriptor (void);
+
protected:
/// For use by ACE_Thread_Descriptor.
ACE_OS_Thread_Descriptor (long flags = 0);
@@ -61,17 +62,14 @@ protected:
/**
* Keeps track of whether this thread was created "detached" or not.
* If a thread is *not* created detached then if someone calls
- * <ACE_Thread_Manager::wait>, we need to join with that thread (and
+ * ACE_Thread_Manager::wait(), we need to join with that thread (and
* close down the handle).
*/
long flags_;
};
-
-
class ACE_Service_Gestalt;
-
/**
* @class ACE_Base_Thread_Adapter
*
@@ -126,6 +124,7 @@ protected:
, ACE_SEH_EXCEPT_HANDLER selector = 0
, ACE_SEH_EXCEPT_HANDLER handler = 0
# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , long cancel_flags = 0
);
/// Inherit the logging features if the parent thread has an
/// ACE_Log_Msg.
@@ -162,8 +161,8 @@ protected:
/**
* Optional thread descriptor. Passing this pointer in will force
- * the spawned thread to cache this location in <Log_Msg> and wait
- * until <Thread_Manager> fills in all information in thread
+ * the spawned thread to cache this location in Log_Msg and wait
+ * until Thread_Manager fills in all information in thread
* descriptor.
*/
ACE_OS_Thread_Descriptor *thr_desc_;
@@ -171,7 +170,7 @@ protected:
/// The ACE_Log_Msg attributes.
ACE_OS_Log_Msg_Attributes log_msg_attributes_;
- /// That is usefull for gprof, define itimerval
+ /// That is useful for gprof, define itimerval
#ifdef ACE_USES_GPROF
struct itimerval itimer_;
#endif // ACE_USES_GPROF
@@ -179,6 +178,11 @@ protected:
/// Keep a reference to the configuration context that spawns the
/// thread so the child can inherit it.
ACE_Service_Gestalt * const ctx_;
+
+ /// Pass through the thread-creation flags that can only be acted on by
+ /// the spawned thread. Currently this is only the cancellation-related
+ /// flags.
+ long flags_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Basic_Stats.cpp b/dep/acelite/ace/Basic_Stats.cpp
index ae663abe221..93c4c0bdde8 100644
--- a/dep/acelite/ace/Basic_Stats.cpp
+++ b/dep/acelite/ace/Basic_Stats.cpp
@@ -1,4 +1,4 @@
-// $Id: Basic_Stats.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Basic_Stats.cpp 95743 2012-05-13 12:29:28Z johnnyw $
#include "ace/Basic_Stats.h"
#include "ace/Log_Msg.h"
@@ -42,7 +42,9 @@ ACE_Basic_Stats::accumulate (const ACE_Basic_Stats &rhs)
}
void
-ACE_Basic_Stats::dump_results (const ACE_TCHAR *msg, ACE_UINT32 sf) const
+ACE_Basic_Stats::dump_results (
+ const ACE_TCHAR *msg,
+ ACE_Basic_Stats::scale_factor_type sf) const
{
#ifndef ACE_NLOGGING
if (this->samples_count () == 0u)
diff --git a/dep/acelite/ace/Basic_Stats.h b/dep/acelite/ace/Basic_Stats.h
index bff1ff29f65..eb6c393b904 100644
--- a/dep/acelite/ace/Basic_Stats.h
+++ b/dep/acelite/ace/Basic_Stats.h
@@ -3,13 +3,12 @@
/**
* @file Basic_Stats.h
*
- * $Id: Basic_Stats.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Basic_Stats.h 95743 2012-05-13 12:29:28Z johnnyw $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
//=============================================================================
-
#ifndef ACE_BASIC_STATS_H
#define ACE_BASIC_STATS_H
#include /**/ "ace/pre.h"
@@ -32,6 +31,12 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Basic_Stats
{
public:
+#if !defined (ACE_WIN32)
+ typedef ACE_UINT32 scale_factor_type;
+#else
+ typedef ACE_UINT64 scale_factor_type;
+#endif
+
/// Constructor
/**
* The number of samples is pre-allocated, and cannot changes once
@@ -56,7 +61,7 @@ public:
* presented in microseconds.
*/
void dump_results (const ACE_TCHAR *msg,
- ACE_UINT32 scale_factor) const;
+ scale_factor_type scale_factor) const;
/// The number of samples
ACE_UINT32 samples_count_;
diff --git a/dep/acelite/ace/Basic_Types.cpp b/dep/acelite/ace/Basic_Types.cpp
index 6c161098f8d..c915dabee17 100644
--- a/dep/acelite/ace/Basic_Types.cpp
+++ b/dep/acelite/ace/Basic_Types.cpp
@@ -1,136 +1,3 @@
-// $Id: Basic_Types.cpp 91366 2010-08-16 12:42:35Z mhengstmengel $
+// $Id: Basic_Types.cpp 95763 2012-05-16 06:43:51Z johnnyw $
#include "ace/Basic_Types.h"
-
-#if !defined (__ACE_INLINE__)
-# include "ace/Basic_Types.inl"
-#endif /* ! __ACE_INLINE__ */
-
-
-#if defined (ACE_LACKS_LONGLONG_T) && !defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-# include "ace/Log_Msg.h"
-# include "ace/OS_NS_stdio.h"
-# include "ace/OS_NS_string.h"
-# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
-// FUZZ: disable check_for_streams_include
-# include "ace/streams.h"
-# endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-void
-ACE_U_LongLong::output (FILE *file) const
-{
- if (h_ () > 0)
- ACE_OS::fprintf (file, "0x%lx%0*lx", h_ (), 2 * sizeof l_ (), l_ ());
- else
- ACE_OS::fprintf (file, "0x%lx", l_ ());
-}
-
-
-ACE_TCHAR *
-ACE_U_LongLong::as_string (ACE_TCHAR *output,
- unsigned int base,
- unsigned int uppercase) const
-{
- if (*this == 0)
- {
- ACE_OS::strcpy(output, "0");
- }
- else
- {
- switch(base)
- {
- case 8:
- {
- unsigned int index = 0;
- int bshift = 31;
- while(bshift >= 1)
- {
- unsigned int sval = (this->h_ () >> bshift) & 7;
- if (sval > 0 || index != 0)
- {
- output[index] = sval + '0';
- ++index;
- }
- bshift -= 3;
- }
- bshift = 30;
- while(bshift >= 0)
- {
- unsigned int sval = (this->l_ () >> bshift) & 7;
- // Combine the last bit of hi with the first 3-bit digit
- if (bshift == 30)
- {
- sval |= (this->h_ () & 1) << 2;
- }
- if (sval > 0 || index != 0)
- {
- output[index] = sval + '0';
- ++index;
- }
- bshift -= 3;
- }
- output[index] = '\0';
- break;
- }
- case 10:
- {
- ACE_OS::sprintf(output, "%.0f", *this / 1.0);
- break;
- }
- case 16:
- {
- if (this->h_ () != 0)
- {
- ACE_OS::sprintf(output,
- (uppercase ? "%lX%0*lX" : "%lx%0*lx"),
- this->h_ (), 2 * sizeof this->l_ (),
- this->l_ ());
- }
- else
- {
- ACE_OS::sprintf(output,
- (uppercase ? "%lX" : "%lx"), this->l_ ());
-
- }
- break;
- }
- default:
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Unsupported base = %u\n"), base));
- output[0] = '\0';
- }
- }
- }
-
- return output;
-}
-
-
-# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
-ostream&
-operator<< (ostream& os, const ACE_U_LongLong& ll)
-{
-#ifdef __TANDEM && (__CPLUSPLUS_VERSION >= 3)
- unsigned long flags = os.flags();
-#else
- unsigned long flags = os.setf(0);
-#endif
- char buffer[32];
-
- if ((flags & ios::oct) != 0)
- os << ll.as_string (buffer, 8);
- else if ((flags & ios::hex) != 0)
- os << ll.as_string (buffer, 16, (flags & ios::uppercase));
- else
- os << ll.as_string (buffer);
- return os;
-}
-# endif
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-#endif /* ACE_LACKS_LONGLONG_T */
-
diff --git a/dep/acelite/ace/Basic_Types.h b/dep/acelite/ace/Basic_Types.h
index bc467fafb5c..fc275ee314b 100644
--- a/dep/acelite/ace/Basic_Types.h
+++ b/dep/acelite/ace/Basic_Types.h
@@ -4,7 +4,7 @@
/**
* @file Basic_Types.h
*
- * $Id: Basic_Types.h 91161 2010-07-21 18:25:12Z schmidt $
+ * $Id: Basic_Types.h 96017 2012-08-08 22:18:09Z mitza $
*
* @author David L. Levine
*
@@ -25,7 +25,6 @@
* - ACE_SIZEOF_LONG_DOUBLE
*
* Wrappers for built-in types of specific sizes:
- * - ACE_USHORT16 (For backward compatibility. Use ACE_UINT16 instead.)
* - ACE_INT8
* - ACE_UINT8
* - ACE_INT16
@@ -33,13 +32,10 @@
* - ACE_INT32
* - ACE_UINT32
* - ACE_UINT64
- * (@note ACE_INT64 is partly defined, there is no ACE_LongLong for
- * platforms that don't have a native 8-byte integer type.)
+ * - ACE_INT64
*
* Byte-order (endian-ness) determination:
* ACE_BYTE_ORDER, to either ACE_BIG_ENDIAN or ACE_LITTLE_ENDIAN
- *
- *
*/
//=============================================================================
@@ -60,10 +56,6 @@
# include "ace/os_include/os_stdlib.h" // Other types
# include "ace/os_include/os_stddef.h" // Get ptrdiff_t - see further comments below
-# if defined(ACE_LACKS_LONGLONG_T)
-# include "ace/os_include/os_stdio.h" // For long long emulation
-# endif /* ACE_LACKS_LONGLONG_T */
-
# include "ace/os_include/sys/os_types.h"
# if !defined (ACE_LACKS_SYS_PARAM_H)
@@ -100,15 +92,11 @@ typedef ACE::If_Then_Else<
ACE::If_Then_Else<
(sizeof (void*) == sizeof (signed long)),
signed long,
-#ifdef ACE_LACKS_LONGLONG_T
- void /* Unknown. Force an invalid type */
-#else
ACE::If_Then_Else<
(sizeof (void*) == sizeof (signed long long)),
signed long long,
void /* Unknown. Force an invalid type */
>::result_type
-#endif /* ACE_LACKS_LONGLONG_T */
>::result_type
>::result_type intptr_t;
@@ -118,15 +106,11 @@ typedef ACE::If_Then_Else<
ACE::If_Then_Else<
(sizeof (void*) == sizeof (unsigned long)),
unsigned long,
-#ifdef ACE_LACKS_UNSIGNEDLONGLONG_T
- void /* Unknown. Force an invalid type */
-#else
ACE::If_Then_Else<
(sizeof (void*) == sizeof (unsigned long long)),
unsigned long long,
void /* Unknown. Force an invalid type */
>::result_type
-#endif /* ACE_LACKS_UNSIGNEDLONGLONG_T */
>::result_type
>::result_type uintptr_t;
@@ -195,9 +179,7 @@ typedef ACE::If_Then_Else<
// The number of bytes in a long long.
# if !defined (ACE_SIZEOF_LONG_LONG)
-# if defined (ACE_LACKS_LONGLONG_T)
-# define ACE_SIZEOF_LONG_LONG 8
-# elif defined (ULLONG_MAX)
+# if defined (ULLONG_MAX)
# if ((ULLONG_MAX) == 4294967295ULL)
# define ACE_SIZEOF_LONG_LONG 4
# elif ((ULLONG_MAX) == 18446744073709551615ULL)
@@ -299,7 +281,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
typedef int64_t ACE_INT64;
#elif ACE_SIZEOF_LONG == 8
typedef long ACE_INT64;
-#elif !defined (ACE_LACKS_LONGLONG_T) && ACE_SIZEOF_LONG_LONG == 8
+#elif ACE_SIZEOF_LONG_LONG == 8
# ifdef __GNUC__
// Silence g++ "-pedantic" warnings regarding use of "long long"
// type.
@@ -308,29 +290,22 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
typedef long long ACE_INT64;
#endif /* defined (ACE_INT64_TYPE) */
-#if !(defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T))
-/* See matching #if around ACE_U_LongLong class declaration below */
-
-# if defined (ACE_UINT64_TYPE)
+#if defined (ACE_UINT64_TYPE)
typedef ACE_UINT64_TYPE ACE_UINT64;
-# elif defined (ACE_HAS_UINT64_T)
+#elif defined (ACE_HAS_UINT64_T)
typedef uint64_t ACE_UINT64;
-# elif ACE_SIZEOF_LONG == 8
+#elif ACE_SIZEOF_LONG == 8
typedef unsigned long ACE_UINT64;
-# elif ACE_SIZEOF_LONG_LONG == 8
+#elif ACE_SIZEOF_LONG_LONG == 8
# ifdef __GNUC__
// Silence g++ "-pedantic" warnings regarding use of "long long"
// type.
__extension__
# endif /* __GNUC__ */
typedef unsigned long long ACE_UINT64;
-# endif /* defined (ACE_UINT64_TYPE) */
-#endif /* !(ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T) */
+#endif /* defined (ACE_UINT64_TYPE) */
-
-typedef ACE_UINT16 ACE_USHORT16; // @@ Backward compatibility.
-
-// Define a generic byte for use in codecs
+/// Define a generic byte for use in codecs
typedef unsigned char ACE_Byte;
// Define a pseudo wide character type when wchar is not supported so we
@@ -428,240 +403,11 @@ ACE_END_VERSIONED_NAMESPACE_DECL
# define ACE_NTOHS(x) x
# endif /* ACE_LITTLE_ENDIAN */
-#if defined (ACE_LACKS_LONGLONG_T)
- // This throws away the high 32 bits. It's very unlikely that a
- // pointer will be more than 32 bits wide if the platform does not
- // support 64-bit integers.
-# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \
- reinterpret_cast<PTR_TYPE> (L.lo ())
-#elif defined (ACE_OPENVMS) && (!defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64))
# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \
- reinterpret_cast<PTR_TYPE> (static_cast<int> (L))
-#else /* ! ACE_LACKS_LONGLONG_T */
-# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \
- reinterpret_cast<PTR_TYPE> (static_cast<intptr_t> (L))
-#endif /* ! ACE_LACKS_LONGLONG_T */
-
-// If the platform lacks an unsigned long long, define one.
-#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-// Forward declaration for streams
-# include "ace/iosfwd.h"
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-/**
- * @class ACE_U_LongLong
- *
- * @brief Unsigned long long for platforms that don't have one.
- *
- * Provide our own unsigned long long. This is intended to be
- * use with ACE_High_Res_Timer, so the division operator assumes
- * that the quotient fits into a u_long.
- * Please note that the constructor takes (optionally) two values.
- * The high one contributes 0x100000000 times its value. So,
- * for example, (0, 2) is _not_ 20000000000, but instead
- * 0x200000000. To emphasize this, the default values are expressed
- * in hex, and output () dumps the value in hex.
- */
- class ACE_Export ACE_U_LongLong
- {
- public:
- // = Initialization and termination methods.
-#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- ACE_U_LongLong (const long long value = 0x0);
-#else
- ACE_U_LongLong (const ACE_UINT32 lo = 0x0, const ACE_UINT32 hi = 0x0);
-#endif
- ACE_U_LongLong (const ACE_U_LongLong &);
- ACE_U_LongLong &operator= (const ACE_U_LongLong &);
- ACE_U_LongLong &operator= (const ACE_INT32 &);
- ACE_U_LongLong &operator= (const ACE_UINT32 &);
- ~ACE_U_LongLong (void);
-
- // = Overloaded relation operators.
- bool operator== (const ACE_U_LongLong &) const;
- bool operator== (const ACE_UINT32) const;
- bool operator!= (const ACE_U_LongLong &) const;
- bool operator!= (const ACE_UINT32) const;
- bool operator< (const ACE_U_LongLong &) const;
- bool operator< (const ACE_UINT32) const;
- bool operator<= (const ACE_U_LongLong &) const;
- bool operator<= (const ACE_UINT32) const;
- bool operator> (const ACE_U_LongLong &) const;
- bool operator> (const ACE_UINT32) const;
- bool operator>= (const ACE_U_LongLong &) const;
- bool operator>= (const ACE_UINT32) const;
-
- ACE_U_LongLong operator+ (const ACE_U_LongLong &) const;
- ACE_U_LongLong operator+ (const ACE_UINT32) const;
- ACE_U_LongLong operator- (const ACE_U_LongLong &) const;
- ACE_U_LongLong operator- (const ACE_UINT32) const;
- ACE_U_LongLong operator* (const ACE_UINT32) const;
- ACE_U_LongLong &operator*= (const ACE_UINT32);
-
- ACE_U_LongLong operator<< (const unsigned int) const;
- ACE_U_LongLong &operator<<= (const unsigned int);
- ACE_U_LongLong operator>> (const unsigned int) const;
- ACE_U_LongLong &operator>>= (const unsigned int);
-
- double operator/ (const double) const;
-
- ACE_U_LongLong &operator+= (const ACE_U_LongLong &);
- ACE_U_LongLong &operator+= (const ACE_UINT32);
- ACE_U_LongLong &operator-= (const ACE_U_LongLong &);
- ACE_U_LongLong &operator-= (const ACE_UINT32);
- ACE_U_LongLong &operator++ ();
- ACE_U_LongLong &operator-- ();
- const ACE_U_LongLong operator++ (int);
- const ACE_U_LongLong operator-- (int);
- ACE_U_LongLong &operator|= (const ACE_U_LongLong);
- ACE_U_LongLong &operator|= (const ACE_UINT32);
- ACE_U_LongLong &operator&= (const ACE_U_LongLong);
- ACE_U_LongLong &operator&= (const ACE_UINT32);
-
- // Note that the following take ACE_UINT32 arguments. These are
- // typical use cases, and easy to implement. But, they limit the
- // return values to 32 bits as well. There are no checks for
- // overflow.
- ACE_UINT32 operator/ (const ACE_UINT32) const;
- ACE_UINT32 operator% (const ACE_UINT32) const;
-
- // The following only operate on the lower 32 bits (they take only
- // 32 bit arguments).
- ACE_UINT32 operator| (const ACE_INT32) const;
- ACE_UINT32 operator& (const ACE_INT32) const;
-
- // The following operators convert their arguments to
- // ACE_UINT32. So, there may be information loss if they are
- // used.
- ACE_U_LongLong operator* (const ACE_INT32) const;
- ACE_U_LongLong &operator*= (const ACE_INT32);
- ACE_UINT32 operator/ (const ACE_INT32) const;
-# if ACE_SIZEOF_INT == 4
- ACE_UINT32 operator/ (const unsigned long) const;
- ACE_UINT32 operator/ (const long) const;
-# else /* ACE_SIZEOF_INT != 4 */
- ACE_UINT32 operator/ (const unsigned int) const;
- ACE_UINT32 operator/ (const int) const;
-# endif /* ACE_SIZEOF_INT != 4 */
-
- // = Helper methods.
- /// Outputs the value to the FILE, in hex.
- void output (FILE * = stdout) const;
-
- ACE_TCHAR *as_string (ACE_TCHAR *string,
- unsigned int base = 10,
- unsigned int uppercase = 0) const;
-
- ACE_UINT32 hi (void) const;
- ACE_UINT32 lo (void) const;
-
- void hi (const ACE_UINT32 hi);
- void lo (const ACE_UINT32 lo);
-
-#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- long long to_int64 (void) const;
-# endif
-
- private:
-
-#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- long long data_;
-#else
- public:
- struct ace_hi_lo_correct_endian
- {
-# if defined (ACE_BIG_ENDIAN)
- /// High 32 bits.
- ACE_UINT32 hi_;
- /// Low 32 bits.
- ACE_UINT32 lo_;
-
-# else
-
- /// Low 32 bits.
- ACE_UINT32 lo_;
- /// High 32 bits.
- ACE_UINT32 hi_;
-# endif /* ! ACE_BIG_ENDIAN */
- };
- private:
- union
- {
- struct ace_hi_lo_correct_endian data_;
-
- /// To ensure alignment on 8-byte boundary.
- double for_alignment_;
- };
-
- // @note the following four accessors are inlined here in
- // order to minimize the extent of the data_ struct. It's
- // only used here; the .i and .cpp files use the accessors.
-
- /// Internal utility function to hide access through struct.
- const ACE_UINT32 &h_ () const { return data_.hi_; }
-
- /// Internal utility function to hide access through struct.
- ACE_UINT32 &h_ () { return data_.hi_; }
-
- /// Internal utility function to hide access through struct.
- const ACE_UINT32 &l_ () const { return data_.lo_; }
-
- /// Internal utility function to hide access through struct.
- ACE_UINT32 &l_ () { return data_.lo_; }
-
- // @note the above four accessors are inlined here in
- // order to minimize the extent of the data_ struct. It's
- // only used here; the .inl and .cpp files use the accessors.
-
- /// These functions are used to implement multiplication.
- ACE_UINT32 ul_shift (ACE_UINT32 a,
- ACE_UINT32 c_in,
- ACE_UINT32 *c_out) const;
- ACE_U_LongLong ull_shift (ACE_U_LongLong a,
- ACE_UINT32 c_in,
- ACE_UINT32 *c_out) const;
- ACE_U_LongLong ull_add (ACE_U_LongLong a,
- ACE_U_LongLong b,
- ACE_UINT32 *carry) const;
- ACE_U_LongLong ull_mult (ACE_U_LongLong a,
- ACE_UINT32 b,
- ACE_UINT32 *carry) const;
-#endif // ACE_LACKS_UNSIGNEDLONGLONG_T
- };
-
- typedef ACE_U_LongLong ACE_UINT64;
-
-#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
- ostream &operator<< (ostream &, const ACE_U_LongLong &);
-#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-# endif /* ACE_LACKS_LONGLONG_T */
+ reinterpret_cast<PTR_TYPE> (static_cast<intptr_t> (L))
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-// Conversions from ACE_UINT64 to ACE_UINT32. ACE_CU64_TO_CU32 should
-// be used on const ACE_UINT64's.
-# if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-inline ACE_UINT32
-ACE_U64_TO_U32 (ACE_U_LongLong const & n)
-{
- /**
- * @note We could add a cast operator to ACE_U_LongLong but that may
- * cause more problems than it solves. Force users to perform
- * an explicit cast via ACE_{C}U64_TO_{C}U32.
- */
- return n.lo ();
-}
-
-inline ACE_UINT32
-ACE_CU64_TO_CU32 (ACE_U_LongLong const & n)
-{
- return ACE_U64_TO_U32 (n);
-}
-# else /* ! ACE_LACKS_LONGLONG_T */
inline ACE_UINT32
ACE_U64_TO_U32 (ACE_UINT64 n)
{
@@ -673,32 +419,24 @@ ACE_CU64_TO_CU32 (ACE_UINT64 n)
{
return static_cast<ACE_UINT32> (n);
}
-# endif /* ! ACE_LACKS_LONGLONG_T */
ACE_END_VERSIONED_NAMESPACE_DECL
-// 64-bit literals require special marking on some platforms.
-# if defined (ACE_LACKS_LONGLONG_T)
- // Can only specify 32-bit arguments.
-# define ACE_UINT64_LITERAL(n) n ## UL
- // This one won't really work, but it'll keep
- // some compilers happy until we have better support
-# define ACE_INT64_LITERAL(n) n ## L
-# elif defined (ACE_WIN32)
-# if defined (__MINGW32__)
-# define ACE_UINT64_LITERAL(n) n ## ull
-# define ACE_INT64_LITERAL(n) n ## ll
-# else
-# define ACE_UINT64_LITERAL(n) n ## ui64
-# define ACE_INT64_LITERAL(n) n ## i64
-# endif /* defined (__MINGW32__) */
-# elif defined (__TANDEM)
+#if defined (ACE_WIN32)
+# if defined (__MINGW32__)
+# define ACE_UINT64_LITERAL(n) n ## ull
+# define ACE_INT64_LITERAL(n) n ## ll
+# else
+# define ACE_UINT64_LITERAL(n) n ## ui64
+# define ACE_INT64_LITERAL(n) n ## i64
+# endif /* defined (__MINGW32__) */
+#elif defined (__TANDEM)
# define ACE_UINT64_LITERAL(n) n ## LL
# define ACE_INT64_LITERAL(n) n ## LL
-# else /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */
+#else /* ! ACE_WIN32 */
# define ACE_UINT64_LITERAL(n) n ## ull
# define ACE_INT64_LITERAL(n) n ## ll
-# endif /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */
+#endif /* ! ACE_WIN32*/
#if !defined (ACE_INT8_FORMAT_SPECIFIER_ASCII)
# if defined (PRId8)
@@ -839,6 +577,8 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#if !defined (ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII)
# if defined (ACE_WIN64)
# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%I64d"
+# elif defined (_WRS_CONFIG_LP64)
+# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld"
# else
# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%d"
# endif /* ACE_WIN64 */
@@ -851,6 +591,8 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#if !defined (ACE_SIZE_T_FORMAT_SPECIFIER_ASCII)
# if defined (ACE_WIN64)
# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%I64u"
+# elif defined (_WRS_CONFIG_LP64)
+# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu"
# else
# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%u"
# endif /* ACE_WIN64 */
@@ -862,16 +604,11 @@ ACE_END_VERSIONED_NAMESPACE_DECL
// Cast from UINT64 to a double requires an intermediate cast to INT64
// on some platforms.
-# if defined (ACE_LACKS_LONGLONG_T)
- // Only use the low 32 bits.
-# define ACE_UINT64_DBLCAST_ADAPTER(n) ACE_U64_TO_U32 (n)
-# elif defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-# define ACE_UINT64_DBLCAST_ADAPTER(n) ((n).to_int64 ())
-# elif defined (ACE_WIN32)
-# define ACE_UINT64_DBLCAST_ADAPTER(n) static_cast<__int64> (n)
-# else /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */
-# define ACE_UINT64_DBLCAST_ADAPTER(n) (n)
-# endif /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */
+#if defined (ACE_WIN32)
+# define ACE_UINT64_DBLCAST_ADAPTER(n) static_cast<__int64> (n)
+#else /* ! ACE_WIN32 && */
+# define ACE_UINT64_DBLCAST_ADAPTER(n) (n)
+#endif /* ! ACE_WIN32 && */
// The number of bytes in a float.
@@ -934,19 +671,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#define ACE_UINT32_MAX 0xFFFFFFFF
#define ACE_INT64_MAX ACE_INT64_LITERAL(0x7FFFFFFFFFFFFFFF)
#define ACE_INT64_MIN -(ACE_INT64_MAX)-1
-
-#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-// ACE_U_LongLong's constructor accepts a "long long" in this
-// case. Set it to ACE_U_LongLong (-1) since the bit pattern for long
-// long (-1) is the same as the maximum unsigned long long value.
-# define ACE_UINT64_MAX ACE_U_LongLong (ACE_INT64_LITERAL (0xFFFFFFFFFFFFFFFF))
-#elif defined (ACE_LACKS_LONGLONG_T)
-// ACE_U_LongLong's constructor accepts an ACE_UINT32 low and high
-// pair of parameters.
-# define ACE_UINT64_MAX ACE_U_LongLong (0xFFFFFFFFu, 0xFFFFFFFFu)
-#else
-# define ACE_UINT64_MAX ACE_UINT64_LITERAL (0xFFFFFFFFFFFFFFFF)
-#endif /* ACE_LACKS_UNSIGNEDLONGLONG_T */
+#define ACE_UINT64_MAX ACE_UINT64_LITERAL (0xFFFFFFFFFFFFFFFF)
// These use ANSI/IEEE format.
#define ACE_FLT_MAX 3.402823466e+38F
@@ -954,9 +679,5 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#define ACE_DBL_MAX 1.7976931348623158e+308
#define ACE_DBL_MIN 2.2250738585072014e-308
-# if defined (__ACE_INLINE__)
-# include "ace/Basic_Types.inl"
-# endif /* __ACE_INLINE__ */
-
# include /**/ "ace/post.h"
#endif /* ACE_BASIC_TYPES_H */
diff --git a/dep/acelite/ace/Basic_Types.inl b/dep/acelite/ace/Basic_Types.inl
deleted file mode 100644
index c6f0013d45e..00000000000
--- a/dep/acelite/ace/Basic_Types.inl
+++ /dev/null
@@ -1,954 +0,0 @@
-// -*- C++ -*-
-//
-// $Id: Basic_Types.inl 80826 2008-03-04 14:51:23Z wotte $
-
-# if !defined (ACE_LACKS_LONGLONG_T) && defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-// Implementation for ACE_U_LongLong when we have signed long long
-// but no unsigned long long.
-
-ACE_INLINE
-ACE_U_LongLong::ACE_U_LongLong (const long long value)
- : data_ (value)
-{
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::hi (void) const
-{
- return (data_ >> 32) & 0xFFFFFFFF;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::lo (void) const
-{
- return data_ & 0xFFFFFFFF;
-}
-
-ACE_INLINE void
-ACE_U_LongLong::hi (const ACE_UINT32 hi)
-{
- data_ = hi;
- data_ <<= 32;
-}
-
-ACE_INLINE void
-ACE_U_LongLong::lo (const ACE_UINT32 lo)
-{
- data_ = lo;
-}
-
-ACE_INLINE long long
-ACE_U_LongLong::to_int64 (void) const
-{
- return data_;
-}
-
-ACE_INLINE
-ACE_U_LongLong::~ACE_U_LongLong (void)
-{
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator== (const ACE_U_LongLong &n) const
-{
- return data_ == n.data_;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator== (const ACE_UINT32 n) const
-{
- return data_ == n;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator!= (const ACE_U_LongLong &n) const
-{
- return ! (*this == n);
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator!= (const ACE_UINT32 n) const
-{
- return ! (*this == n);
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator< (const ACE_U_LongLong &n) const
-{
- if (data_ > 0)
- if (n.data_ > 0)
- return data_ < n.data_;
- else
- return true;
- else
- if (n.data_ > 0)
- return false;
- else
- return data_ < n.data_;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator< (const ACE_UINT32 n) const
-{
- return operator< (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator<= (const ACE_U_LongLong &n) const
-{
- if (data_ == n.data_) return true;
-
- return data_ < n.data_;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator<= (const ACE_UINT32 n) const
-{
- return operator<= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator> (const ACE_U_LongLong &n) const
-{
- if (data_ > 0)
- if (n.data_ > 0)
- return data_ > n.data_;
- else
- return false;
- else
- if (n.data_ > 0)
- return true;
- else
- return data_ > n.data_;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator> (const ACE_UINT32 n) const
-{
- return operator> (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator>= (const ACE_U_LongLong &n) const
-{
- if (data_ == n.data_) return true;
-
- return data_ > n.data_;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator>= (const ACE_UINT32 n) const
-{
- return operator>= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE
-ACE_U_LongLong::ACE_U_LongLong (const ACE_U_LongLong &n)
- : data_ (n.data_)
-{
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator= (const ACE_U_LongLong &n)
-{
- data_ = n.data_;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator= (const ACE_INT32 &rhs)
-{
- if (rhs >= 0)
- {
- data_ = rhs;
- data_ &= 0xFFFFFFFF;
- }
- else
- {
- // We do not handle the case where a negative 32 bit integer is
- // assigned to this representation of a 64 bit unsigned integer.
- // The "undefined behavior" behavior performed by this
- // implementation is to simply set all bits to zero.
- data_ = 0;
- }
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator= (const ACE_UINT32 &rhs)
-{
- data_ = rhs;
-
- return *this;
-}
-
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const
-{
- return data_ + n.data_;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator+ (const ACE_UINT32 n) const
-{
- return operator+ (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator- (const ACE_U_LongLong &n) const
-{
- return data_ - n.data_;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator- (const ACE_UINT32 n) const
-{
- return operator- (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator<< (const u_int n) const
-{
- return data_ << n;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator<<= (const u_int n)
-{
- data_ <<= n;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator>> (const u_int n) const
-{
- return data_ >> n;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator>>= (const u_int n)
-{
- data_ >>= n;
-
- return *this;
-}
-
-ACE_INLINE double
-ACE_U_LongLong::operator/ (const double n) const
-{
- return data_ / n;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator+= (const ACE_U_LongLong &n)
-{
- data_ += n.data_;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator+= (const ACE_UINT32 n)
-{
- return operator+= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator* (const ACE_UINT32 n) const
-{
- return data_ * n;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator*= (const ACE_UINT32 n)
-{
- data_ *= n;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator-= (const ACE_U_LongLong &n)
-{
- data_ -= n.data_;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator-= (const ACE_UINT32 n)
-{
- return operator-= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator++ ()
-{
- ++data_;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator-- ()
-{
- --data_;
-
- return *this;
-}
-
-ACE_INLINE const ACE_U_LongLong
-ACE_U_LongLong::operator++ (int)
-{
- // Post-increment operator should always be implemented in terms of
- // the pre-increment operator to enforce consistent semantics.
- ACE_U_LongLong temp (*this);
- ++*this;
- return temp;
-}
-
-ACE_INLINE const ACE_U_LongLong
-ACE_U_LongLong::operator-- (int)
-{
- // Post-decrement operator should always be implemented in terms of
- // the pre-decrement operator to enforce consistent semantics.
- ACE_U_LongLong temp (*this);
- --*this;
- return temp;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator|= (const ACE_U_LongLong n)
-{
- data_ |= n.data_;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator|= (const ACE_UINT32 n)
-{
- return operator|= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator&= (const ACE_U_LongLong n)
-{
- data_ &= n.data_;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator&= (const ACE_UINT32 n)
-{
- return operator&= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const ACE_UINT32 n) const
-{
- return data_ / n;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator% (const ACE_UINT32 n) const
-{
- return data_ % n;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator| (const ACE_INT32 n) const
-{
- return data_ | n;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator& (const ACE_INT32 n) const
-{
- return data_ & n;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator* (const ACE_INT32 n) const
-{
- return operator* ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator*= (const ACE_INT32 n)
-{
- return operator*= ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const ACE_INT32 n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-#if ACE_SIZEOF_INT == 4
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const u_long n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const long n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-#else /* ACE_SIZEOF_INT != 4 */
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const u_int n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const int n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-#endif
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-#elif defined (ACE_LACKS_LONGLONG_T)
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-ACE_INLINE
-ACE_U_LongLong::ACE_U_LongLong (const ACE_UINT32 lo, const ACE_UINT32 hi)
-{
- h_ () = hi;
- l_ () = lo;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::hi (void) const
-{
- return h_ ();
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::lo (void) const
-{
- return l_ ();
-}
-
-ACE_INLINE void
-ACE_U_LongLong::hi (const ACE_UINT32 hi)
-{
- h_ () = hi;
-}
-
-ACE_INLINE void
-ACE_U_LongLong::lo (const ACE_UINT32 lo)
-{
- l_ () = lo;
-}
-
-ACE_INLINE
-ACE_U_LongLong::~ACE_U_LongLong (void)
-{
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator== (const ACE_U_LongLong &n) const
-{
- return h_ () == n.h_ () && l_ () == n.l_ ();
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator== (const ACE_UINT32 n) const
-{
- return h_ () == 0 && l_ () == n;
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator!= (const ACE_U_LongLong &n) const
-{
- return ! (*this == n);
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator!= (const ACE_UINT32 n) const
-{
- return ! (*this == n);
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator< (const ACE_U_LongLong &n) const
-{
- return h_ () < n.h_ () ? 1
- : h_ () > n.h_ () ? 0
- : l_ () < n.l_ ();
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator< (const ACE_UINT32 n) const
-{
- return operator< (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator<= (const ACE_U_LongLong &n) const
-{
- return h_ () < n.h_ () ? 1
- : h_ () > n.h_ () ? 0
- : l_ () <= n.l_ ();
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator<= (const ACE_UINT32 n) const
-{
- return operator<= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator> (const ACE_U_LongLong &n) const
-{
- return h_ () > n.h_ () ? 1
- : h_ () < n.h_ () ? 0
- : l_ () > n.l_ ();
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator> (const ACE_UINT32 n) const
-{
- return operator> (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator>= (const ACE_U_LongLong &n) const
-{
- return h_ () > n.h_ () ? 1
- : h_ () < n.h_ () ? 0
- : l_ () >= n.l_ ();
-}
-
-ACE_INLINE bool
-ACE_U_LongLong::operator>= (const ACE_UINT32 n) const
-{
- return operator>= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE
-ACE_U_LongLong::ACE_U_LongLong (const ACE_U_LongLong &n)
-{
- h_ () = n.h_ ();
- l_ () = n.l_ ();
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator= (const ACE_U_LongLong &n)
-{
- h_ () = n.h_ ();
- l_ () = n.l_ ();
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator= (const ACE_INT32 &rhs)
-{
- if (rhs >= 0)
- {
- l_ () = static_cast<ACE_UINT32> (rhs);
- h_ () = 0;
- }
- else
- {
- // We do not handle the case where a negative 32 bit integer is
- // assigned to this representation of a 64 bit unsigned integer.
- // The "undefined behavior" behavior performed by this
- // implementation is to simply set all bits to zero.
- l_ () = 0;
- h_ () = 0;
- }
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator= (const ACE_UINT32 &rhs)
-{
- l_ () = rhs;
- h_ () = 0;
-
- return *this;
-}
-
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const
-{
- ACE_U_LongLong ret (l_ () + n.l_ (), h_ () + n.h_ ());
- if (ret.l_ () < n.l_ ()) /* carry */ ++ret.h_ ();
-
- return ret;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator+ (const ACE_UINT32 n) const
-{
- return operator+ (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator- (const ACE_U_LongLong &n) const
-{
- ACE_U_LongLong ret (l_ () - n.l_ (), h_ () - n.h_ ());
- if (l_ () < n.l_ ()) /* borrow */ --ret.h_ ();
-
- return ret;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator- (const ACE_UINT32 n) const
-{
- return operator- (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator<< (const u_int n) const
-{
- const ACE_UINT32 carry_mask = l_ () >> (32 - n);
- ACE_U_LongLong ret (n < 32 ? l_ () << n : 0,
- n < 32 ? (h_ () << n) | carry_mask : carry_mask);
-
- return ret;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator<<= (const u_int n)
-{
- const ACE_UINT32 carry_mask = l_ () >> (32 - n);
- h_ () = n < 32 ? (h_ () << n) | carry_mask : carry_mask;
-
- // g++ 2.7.2.3/Solaris 2.5.1 doesn't modify l_ () if shifted by 32.
- l_ () = n < 32 ? l_ () << n : 0;
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator>> (const u_int n) const
-{
- const ACE_UINT32 carry_mask = h_ () << (32 - n);
- ACE_U_LongLong ret (n < 32 ? (l_ () >> n) | carry_mask : 0,
- n < 32 ? h_ () >> n : 0);
-
- return ret;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator>>= (const u_int n)
-{
- const ACE_UINT32 carry_mask = h_ () << (32 - n);
- l_ () = n < 32 ? (l_ () >> n) | carry_mask : carry_mask;
- h_ () = n < 32 ? h_ () >> n : 0;
-
- return *this;
-}
-
-ACE_INLINE double
-ACE_U_LongLong::operator/ (const double n) const
-{
- // See the derivation above in operator/ (const ACE_UINT32).
-
- return ((double) 0xffffffffu - n + 1.0) / n * h_ () +
- (double) h_ () + (double) l_ () / n;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator+= (const ACE_U_LongLong &n)
-{
- h_ () += n.h_ ();
- l_ () += n.l_ ();
- if (l_ () < n.l_ ()) /* carry */ ++h_ ();
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator+= (const ACE_UINT32 n)
-{
- return operator+= (static_cast<const ACE_U_LongLong> (n));
-}
-
-#define ACE_HIGHBIT (~(~0UL >> 1))
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::ul_shift (ACE_UINT32 a, ACE_UINT32 c_in, ACE_UINT32 *c_out) const
-{
- const ACE_UINT32 b = (a << 1) | c_in;
- *c_out = (*c_out << 1) + ((a & ACE_HIGHBIT) > 0);
-
- return b;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::ull_shift (ACE_U_LongLong a,
- ACE_UINT32 c_in,
- ACE_UINT32 *c_out) const
-{
- ACE_U_LongLong b;
-
- b.l_ () = (a.l_ () << 1) | c_in;
- c_in = ((a.l_ () & ACE_HIGHBIT) > 0);
- b.h_ () = (a.h_ () << 1) | c_in;
- *c_out = (*c_out << 1) + ((a.h_ () & ACE_HIGHBIT) > 0);
-
- return b;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::ull_add (ACE_U_LongLong a, ACE_U_LongLong b, ACE_UINT32 *carry) const
-{
- ACE_U_LongLong r (0, 0);
- ACE_UINT32 c1, c2, c3, c4;
-
- c1 = a.l_ () % 2;
- c2 = b.l_ () % 2;
- c3 = 0;
-
- r.l_ () = a.l_ ()/2 + b.l_ ()/2 + (c1+c2)/2;
- r.l_ () = ul_shift (r.l_ (), (c1+c2)%2, &c3);
-
- c1 = a.h_ () % 2;
- c2 = b.h_ () % 2;
- c4 = 0;
-
- r.h_ () = a.h_ ()/2 + b.h_ ()/2 + (c1+c2+c3)/2;
- r.h_ () = ul_shift (r.h_ (), (c1+c2+c3)%2, &c4);
-
- *carry = c4;
-
- return r;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::ull_mult (ACE_U_LongLong a, ACE_UINT32 b, ACE_UINT32 *carry) const
-{
- register ACE_UINT32 mask = ACE_HIGHBIT;
- const ACE_U_LongLong zero (0, 0);
- ACE_U_LongLong accum (0, 0);
- ACE_UINT32 c;
-
- *carry = 0;
- if (b > 0)
- do
- {
- accum = ull_shift (accum, 0U, carry);
- if (b & mask)
- accum = ull_add (accum, a, &c);
- else
- accum = ull_add (accum, zero, &c);
- *carry += c;
- mask >>= 1;
- }
- while (mask > 0);
-
- return accum;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator* (const ACE_UINT32 n) const
-{
- ACE_UINT32 carry; // will throw the carry away
-
- return ull_mult (*this, n, &carry);
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator*= (const ACE_UINT32 n)
-{
- ACE_UINT32 carry; // will throw the carry away
-
- return *this = ull_mult (*this, n, &carry);
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator-= (const ACE_U_LongLong &n)
-{
- h_ () -= n.h_ ();
- if (l_ () < n.l_ ()) /* borrow */ --h_ ();
- l_ () -= n.l_ ();
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator-= (const ACE_UINT32 n)
-{
- return operator-= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator++ ()
-{
- ++l_ ();
- if (l_ () == 0) /* carry */ ++h_ ();
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator-- ()
-{
- if (l_ () == 0) /* borrow */ --h_ ();
- --l_ ();
-
- return *this;
-}
-
-ACE_INLINE const ACE_U_LongLong
-ACE_U_LongLong::operator++ (int)
-{
- // Post-increment operator should always be implemented in terms of
- // the pre-increment operator to enforce consistent semantics.
- ACE_U_LongLong temp (*this);
- ++*this;
- return temp;
-}
-
-ACE_INLINE const ACE_U_LongLong
-ACE_U_LongLong::operator-- (int)
-{
- // Post-decrement operator should always be implemented in terms of
- // the pre-decrement operator to enforce consistent semantics.
- ACE_U_LongLong temp (*this);
- --*this;
- return temp;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator|= (const ACE_U_LongLong n)
-{
- l_ () |= n.l_ ();
- h_ () |= n.h_ ();
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator|= (const ACE_UINT32 n)
-{
- return operator|= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator&= (const ACE_U_LongLong n)
-{
- l_ () &= n.l_ ();
- h_ () &= n.h_ ();
-
- return *this;
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator&= (const ACE_UINT32 n)
-{
- return operator&= (static_cast<const ACE_U_LongLong> (n));
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const ACE_UINT32 n) const
-{
- // This takes advantage of the fact that the return type has only 32
- // bits. Replace 0x100000000 with 0xffffffff + 1 because the former
- // has 33 bits.
- // Quotient = (0x100000000u * hi_ + lo_) / n
- // = ((0x100000000u - n + n) * hi_ + lo_) / n
- // = ((0x100000000u - n) / n * hi_ + hi_ * n / n + lo_ / n
- // = (0x100000000u - n) / n * hi_ + hi_ + lo_ / n
- // = (0xffffffffu - n + 1) / n * hi_ + hi_ + lo_ / n
-
- return (0xffffffffu - n + 1) / n * h_ () + h_ () + l_ () / n;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator% (const ACE_UINT32 n) const
-{
- // Because the argument is an ACE_UINT32, the result can never be
- // bigger than 32 bits. Replace 0x100000000 with 0xffffffff + 1
- // because the former has 33 bits.
- // Mod = (0x100000000u * hi_ + lo_) % n
- // = (0x100000000u % n * hi_ + lo_ % n) % n
- // = ((0x100000000u - n) % n * hi_ + lo_ % n) % n
- // = ((0xffffffffu - n + 1) % n * hi_ + lo_ % n) % n
-
- return ((0xffffffff - n + 1) % n * h_ () + l_ () % n) % n;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator| (const ACE_INT32 n) const
-{
- return l_ () | n;
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator& (const ACE_INT32 n) const
-{
- return l_ () & n;
-}
-
-ACE_INLINE ACE_U_LongLong
-ACE_U_LongLong::operator* (const ACE_INT32 n) const
-{
- return operator* ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_U_LongLong &
-ACE_U_LongLong::operator*= (const ACE_INT32 n)
-{
- return operator*= ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const ACE_INT32 n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-#if ACE_SIZEOF_INT == 4
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const u_long n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const long n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-#else /* ACE_SIZEOF_INT != 4 */
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const u_int n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-
-ACE_INLINE ACE_UINT32
-ACE_U_LongLong::operator/ (const int n) const
-{
- return operator/ ((ACE_UINT32) n);
-}
-#endif /* ACE_SIZEOF_INT != 4 */
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-#endif /* ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */
diff --git a/dep/acelite/ace/CDR_Base.cpp b/dep/acelite/ace/CDR_Base.cpp
index 0acf651d4d1..04e87f65c94 100644
--- a/dep/acelite/ace/CDR_Base.cpp
+++ b/dep/acelite/ace/CDR_Base.cpp
@@ -1,4 +1,4 @@
-// $Id: CDR_Base.cpp 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: CDR_Base.cpp 94251 2011-06-22 18:03:25Z parsons $
#include "ace/CDR_Base.h"
diff --git a/dep/acelite/ace/CDR_Base.h b/dep/acelite/ace/CDR_Base.h
index 66a6d885710..f324152253f 100644
--- a/dep/acelite/ace/CDR_Base.h
+++ b/dep/acelite/ace/CDR_Base.h
@@ -4,7 +4,7 @@
/**
* @file CDR_Base.h
*
- * $Id: CDR_Base.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: CDR_Base.h 95761 2012-05-15 18:23:04Z johnnyw $
*
* ACE Common Data Representation (CDR) basic types.
*
@@ -213,7 +213,7 @@ public:
typedef long LongLong;
# elif defined(__TANDEM)
typedef long long LongLong;
-# elif ACE_SIZEOF_LONG_LONG == 8 && !defined (ACE_LACKS_LONGLONG_T)
+# elif ACE_SIZEOF_LONG_LONG == 8
# if defined (sun) && !defined (ACE_LACKS_U_LONGLONG_T)
// sun #defines u_longlong_t, maybe other platforms do also.
// Use it, at least with g++, so that its -pedantic doesn't
diff --git a/dep/acelite/ace/CDR_Size.h b/dep/acelite/ace/CDR_Size.h
index a0b3c462ca8..ccf45324929 100644
--- a/dep/acelite/ace/CDR_Size.h
+++ b/dep/acelite/ace/CDR_Size.h
@@ -4,7 +4,7 @@
/**
* @file CDR_Size.h
*
- * $Id: CDR_Size.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: CDR_Size.h 93359 2011-02-11 11:33:12Z mcorino $
*
*
* ACE Common Data Representation (CDR) size-calculating stream.
@@ -13,7 +13,7 @@
* The current implementation assumes that the host has 1-byte,
* 2-byte and 4-byte integral types, and that it has single
* precision and double precision IEEE floats.
- * Those assumptions are pretty good these days, with Crays beign
+ * Those assumptions are pretty good these days, with Crays being
* the only known exception.
*
*
diff --git a/dep/acelite/ace/CDR_Stream.cpp b/dep/acelite/ace/CDR_Stream.cpp
index cc58132ca82..0d674324f68 100644
--- a/dep/acelite/ace/CDR_Stream.cpp
+++ b/dep/acelite/ace/CDR_Stream.cpp
@@ -1,4 +1,4 @@
-// $Id: CDR_Stream.cpp 91373 2010-08-17 07:35:27Z mhengstmengel $
+// $Id: CDR_Stream.cpp 95896 2012-06-18 20:42:07Z hillj $
#include "ace/CDR_Stream.h"
#include "ace/SString.h"
@@ -723,6 +723,72 @@ ACE_OutputCDR::write_short_placeholder (void)
return buf;
}
+char *
+ACE_OutputCDR::write_boolean_placeholder (void)
+{
+ char *buf = 0;
+ if (this->adjust (ACE_CDR::OCTET_SIZE, buf) == 0)
+ *reinterpret_cast<ACE_CDR::Boolean*> (buf) = 0;
+ else
+ buf = 0;
+ return buf;
+}
+
+char *
+ACE_OutputCDR::write_char_placeholder (void)
+{
+ char *buf = 0;
+ if (this->adjust (ACE_CDR::OCTET_SIZE, buf) == 0)
+ *reinterpret_cast<ACE_CDR::Char*> (buf) = 0;
+ else
+ buf = 0;
+ return buf;
+}
+
+char *
+ACE_OutputCDR::write_octet_placeholder (void)
+{
+ char *buf = 0;
+ if (this->adjust (ACE_CDR::OCTET_SIZE, buf) == 0)
+ *reinterpret_cast<ACE_CDR::Octet*> (buf) = 0;
+ else
+ buf = 0;
+ return buf;
+}
+
+char *
+ACE_OutputCDR::write_longlong_placeholder (void)
+{
+ char *buf = 0;
+ if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0)
+ *reinterpret_cast<ACE_CDR::ULongLong*> (buf) = 0;
+ else
+ buf = 0;
+ return buf;
+}
+
+char *
+ACE_OutputCDR::write_float_placeholder (void)
+{
+ char *buf = 0;
+ if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0)
+ *reinterpret_cast<ACE_CDR::ULong*> (buf) = 0;
+ else
+ buf = 0;
+ return buf;
+}
+
+char *
+ACE_OutputCDR::write_double_placeholder (void)
+{
+ char *buf = 0;
+ if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0)
+ *reinterpret_cast<ACE_CDR::ULongLong*> (buf) = 0;
+ else
+ buf = 0;
+ return buf;
+}
+
ACE_CDR::Boolean
ACE_OutputCDR::replace (ACE_CDR::Long x, char* loc)
{
@@ -745,6 +811,27 @@ ACE_OutputCDR::replace (ACE_CDR::Long x, char* loc)
return true;
}
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::ULong x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<ACE_CDR::ULong*> (loc) = x;
+#else
+ if (!this->do_byte_swap_)
+ {
+ *reinterpret_cast<ACE_CDR::ULong *> (loc) = x;
+ }
+ else
+ {
+ ACE_CDR::swap_4 (reinterpret_cast<const char*> (&x), loc);
+ }
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+
+ return true;
+}
ACE_CDR::Boolean
ACE_OutputCDR::replace (ACE_CDR::Short x, char* loc)
@@ -768,6 +855,148 @@ ACE_OutputCDR::replace (ACE_CDR::Short x, char* loc)
return true;
}
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::UShort x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<ACE_CDR::UShort*> (loc) = x;
+#else
+ if (!this->do_byte_swap_)
+ {
+ *reinterpret_cast<ACE_CDR::UShort *> (loc) = x;
+ }
+ else
+ {
+ ACE_CDR::swap_2 (reinterpret_cast<const char*> (&x), loc);
+ }
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::Boolean x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+ *reinterpret_cast<ACE_CDR::Boolean*> (loc) = x;
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::Char x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+ *reinterpret_cast<ACE_CDR::Char*> (loc) = x;
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::Octet x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+ *reinterpret_cast<ACE_CDR::Octet*> (loc) = x;
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::LongLong x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<ACE_CDR::LongLong*> (loc) = x;
+#else
+ if (!this->do_byte_swap_)
+ {
+ *reinterpret_cast<ACE_CDR::LongLong*> (loc) = x;
+ }
+ else
+ {
+ ACE_CDR::swap_8 (reinterpret_cast<const char*> (&x), loc);
+ }
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::ULongLong x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<ACE_CDR::ULongLong*> (loc) = x;
+#else
+ if (!this->do_byte_swap_)
+ {
+ *reinterpret_cast<ACE_CDR::ULongLong*> (loc) = x;
+ }
+ else
+ {
+ ACE_CDR::swap_8 (reinterpret_cast<const char*> (&x), loc);
+ }
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::Float x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<ACE_CDR::Float*> (loc) = x;
+#else
+ if (!this->do_byte_swap_)
+ {
+ *reinterpret_cast<ACE_CDR::Float*> (loc) = x;
+ }
+ else
+ {
+ ACE_CDR::swap_4 (reinterpret_cast<const char*> (&x), loc);
+ }
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+
+ return true;
+}
+
+ACE_CDR::Boolean
+ACE_OutputCDR::replace (ACE_CDR::Double x, char* loc)
+{
+ if (this->find (loc) == 0)
+ return false;
+
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<ACE_CDR::Double*> (loc) = x;
+#else
+ if (!this->do_byte_swap_)
+ {
+ *reinterpret_cast<ACE_CDR::Double*> (loc) = x;
+ }
+ else
+ {
+ ACE_CDR::swap_8 (reinterpret_cast<const char*> (&x), loc);
+ }
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+
+ return true;
+}
int
ACE_OutputCDR::consolidate (void)
@@ -1682,7 +1911,17 @@ ACE_InputCDR::skip_string (void)
ACE_CDR::ULong len = 0;
if (this->read_ulong (len))
{
- if (this->rd_ptr () + len <= this->wr_ptr ())
+ if (static_cast<ACE_CDR::ULong> (~0u) == len)
+ {
+ // Indirection, next Long in stream is signed offset to actual
+ // string location (backwards in same stream from here).
+ ACE_CDR::Long offset = 0;
+ if (this->read_long (offset))
+ {
+ return true;
+ }
+ }
+ else if (this->rd_ptr () + len <= this->wr_ptr ())
{
this->rd_ptr (len);
return true;
diff --git a/dep/acelite/ace/CDR_Stream.h b/dep/acelite/ace/CDR_Stream.h
index 0a200dc56dd..256560dea7e 100644
--- a/dep/acelite/ace/CDR_Stream.h
+++ b/dep/acelite/ace/CDR_Stream.h
@@ -4,7 +4,7 @@
/**
* @file CDR_Stream.h
*
- * $Id: CDR_Stream.h 84527 2009-02-19 14:01:42Z johnnyw $
+ * $Id: CDR_Stream.h 95896 2012-06-18 20:42:07Z hillj $
*
* ACE Common Data Representation (CDR) marshaling and demarshaling
* classes.
@@ -318,6 +318,12 @@ public:
*/
char* write_long_placeholder (void);
char* write_short_placeholder (void);
+ char* write_boolean_placeholder (void);
+ char* write_char_placeholder (void);
+ char* write_longlong_placeholder (void);
+ char* write_octet_placeholder (void);
+ char* write_float_placeholder (void);
+ char* write_double_placeholder (void);
/**
* Writes a new value into a specific location. This is commonly
@@ -336,7 +342,16 @@ public:
* @sa write_long_placeholder(), write_short_placeholder ()
*/
ACE_CDR::Boolean replace (ACE_CDR::Long x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::ULong x, char* loc);
ACE_CDR::Boolean replace (ACE_CDR::Short x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::UShort x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::Boolean x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::Char x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::LongLong x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::ULongLong x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::Octet x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::Float x, char* loc);
+ ACE_CDR::Boolean replace (ACE_CDR::Double x, char* loc);
//@}
/**
@@ -1224,7 +1239,7 @@ protected:
const ACE_CDR::ULong *x);
/// Efficiently read @a length elements of size @a size each from
- /// <input> into <x>; the data must be aligned to <align>.
+ /// @a input into @a x; the data must be aligned to @a align.
ACE_CDR::Boolean read_array (ACE_InputCDR& input,
void* x,
size_t size,
@@ -1232,9 +1247,9 @@ protected:
ACE_CDR::ULong length);
/**
- * Efficiently write @a length elements of size @a size from <x> into
- * <output>. Before inserting the elements enough padding is added
- * to ensure that the elements will be aligned to <align> in the
+ * Efficiently write @a length elements of size @a size from @a x into
+ * @a output. Before inserting the elements enough padding is added
+ * to ensure that the elements will be aligned to @a align in the
* stream.
*/
ACE_CDR::Boolean write_array (ACE_OutputCDR& output,
@@ -1244,10 +1259,10 @@ protected:
ACE_CDR::ULong length);
/**
- * Exposes the stream implementation of <adjust>, this is useful in
+ * Exposes the stream implementation of @a adjust, this is useful in
* many cases to minimize memory allocations during marshaling.
* On success @a buf will contain a contiguous area in the CDR stream
- * that can hold @a size bytes aligned to <align>.
+ * that can hold @a size bytes aligned to @a align.
* Results
*/
int adjust (ACE_OutputCDR& out,
diff --git a/dep/acelite/ace/CE_Screen_Output.h b/dep/acelite/ace/CE_Screen_Output.h
index ba2bc7c02b5..62d4deaa042 100644
--- a/dep/acelite/ace/CE_Screen_Output.h
+++ b/dep/acelite/ace/CE_Screen_Output.h
@@ -4,7 +4,7 @@
/**
* @file CE_Screen_Output.h
*
- * $Id: CE_Screen_Output.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: CE_Screen_Output.h 94271 2011-06-23 14:52:31Z johnnyw $
*
* @author Si Mong Park <spark@ociweb.com>
*/
@@ -39,7 +39,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
*
* This class allows standard text output to be displayed on
* text window for Windows CE. Generally, all ACE output will
- * go through under CE if and only if user uses WindozeCE
+ * go through under CE if and only if user uses Windows CE
* implementation by using main_ce instead of main.
* Also, for the easier debugging purpose, object pointer of
* this class can be gotten from ACE_Log_Msg::msg_callback()
diff --git a/dep/acelite/ace/CMakeLists.txt b/dep/acelite/ace/CMakeLists.txt
index 6b5d3d84b40..a0a590e0c30 100644
--- a/dep/acelite/ace/CMakeLists.txt
+++ b/dep/acelite/ace/CMakeLists.txt
@@ -46,6 +46,7 @@ set(ace_STAT_SRCS
Codeset_IBM1047.cpp
Codeset_Registry.cpp
Codeset_Registry_db.cpp
+ Condition_Attributes.cpp
Condition_Recursive_Thread_Mutex.cpp
Condition_Thread_Mutex.cpp
Configuration.cpp
@@ -53,7 +54,6 @@ set(ace_STAT_SRCS
Connection_Recycling_Strategy.cpp
Containers.cpp
Copy_Disabled.cpp
- Countdown_Time.cpp
Date_Time.cpp
DEV.cpp
DEV_Addr.cpp
@@ -73,6 +73,7 @@ set(ace_STAT_SRCS
Encoding_Converter_Factory.cpp
Event.cpp
Event_Handler.cpp
+ Event_Handler_Handle_Timeout_Upcall.cpp
FIFO.cpp
FIFO_Recv.cpp
FIFO_Recv_Msg.cpp
@@ -89,7 +90,6 @@ set(ace_STAT_SRCS
Functor.cpp
Functor_String.cpp
Get_Opt.cpp
- gethrtime.cpp
Handle_Ops.cpp
Handle_Set.cpp
Hashable.cpp
@@ -289,6 +289,7 @@ set(ace_STAT_SRCS
Thread_Mutex.cpp
Thread_Semaphore.cpp
Throughput_Stats.cpp
+ Time_Policy.cpp
Time_Value.cpp
Timeprobe.cpp
TLI.cpp
diff --git a/dep/acelite/ace/Cache_Map_Manager_T.cpp b/dep/acelite/ace/Cache_Map_Manager_T.cpp
index 4fb5b93cac8..1527bce646b 100644
--- a/dep/acelite/ace/Cache_Map_Manager_T.cpp
+++ b/dep/acelite/ace/Cache_Map_Manager_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Cache_Map_Manager_T.cpp 92097 2010-09-30 05:41:49Z msmit $
+// $Id: Cache_Map_Manager_T.cpp 95790 2012-05-24 15:06:21Z shuston $
#ifndef ACE_CACHE_MAP_MANAGER_T_CPP
#define ACE_CACHE_MAP_MANAGER_T_CPP
@@ -24,11 +24,8 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Iterator)
ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Reverse_Iterator)
-#define ACE_T1 class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES
-#define ACE_T2 KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES
-
-template <ACE_T1>
-ACE_Cache_Map_Manager<ACE_T2>::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s,
size_t size,
ACE_Allocator *alloc)
: caching_strategy_ (caching_s)
@@ -40,28 +37,28 @@ ACE_Cache_Map_Manager<ACE_T2>::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_
}
-template <ACE_T1>
-ACE_Cache_Map_Manager<ACE_T2>::~ACE_Cache_Map_Manager (void)
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::~ACE_Cache_Map_Manager (void)
{
this->close ();
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::open (size_t length,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::open (size_t length,
ACE_Allocator *alloc)
{
return this->map_.open (length,
alloc);
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::close (void)
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::close (void)
{
return this->map_.close ();
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::bind (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::bind (const KEY &key,
const VALUE &value)
{
// Insert an entry which has the <key> and the <cache_value> which
@@ -96,8 +93,8 @@ ACE_Cache_Map_Manager<ACE_T2>::bind (const KEY &key,
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::rebind (const KEY &key,
const VALUE &value)
{
CACHE_VALUE cache_value (value,
@@ -133,8 +130,8 @@ ACE_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::rebind (const KEY &key,
const VALUE &value,
VALUE &old_value)
{
@@ -180,8 +177,8 @@ ACE_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
return rebind_result;
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::rebind (const KEY &key,
const VALUE &value,
KEY &old_key,
VALUE &old_value)
@@ -229,8 +226,8 @@ ACE_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
return rebind_result;
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::trybind (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::trybind (const KEY &key,
VALUE &value)
{
CACHE_VALUE cache_value (value,
@@ -271,8 +268,8 @@ ACE_Cache_Map_Manager<ACE_T2>::trybind (const KEY &key,
return trybind_result;
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::find (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::find (const KEY &key,
VALUE &value)
{
// Lookup the key and populate the <value>.
@@ -310,8 +307,8 @@ ACE_Cache_Map_Manager<ACE_T2>::find (const KEY &key,
return find_result;
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::find (const KEY &key)
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::find (const KEY &key)
{
// Lookup the key and populate the <value>.
CACHE_VALUE cache_value;
@@ -323,7 +320,7 @@ ACE_Cache_Map_Manager<ACE_T2>::find (const KEY &key)
{
int result = this->caching_strategy_.notify_find (find_result,
- cache_value.second ());
+ cache_value.second);
// Unless the find and notification operations go thru, this
// method is not successful.
@@ -348,8 +345,8 @@ ACE_Cache_Map_Manager<ACE_T2>::find (const KEY &key)
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::unbind (const KEY &key)
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::unbind (const KEY &key)
{
// Remove the entry from the cache.
CACHE_VALUE cache_value;
@@ -371,8 +368,8 @@ ACE_Cache_Map_Manager<ACE_T2>::unbind (const KEY &key)
return unbind_result;
}
-template <ACE_T1> int
-ACE_Cache_Map_Manager<ACE_T2>::unbind (const KEY &key,
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::unbind (const KEY &key,
VALUE &value)
{
// Remove the entry from the cache.
@@ -397,8 +394,8 @@ ACE_Cache_Map_Manager<ACE_T2>::unbind (const KEY &key,
return unbind_result;
}
-template <ACE_T1> void
-ACE_Cache_Map_Manager<ACE_T2>::dump (void) const
+template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> void
+ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
this->map_.dump ();
@@ -407,9 +404,6 @@ ACE_Cache_Map_Manager<ACE_T2>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-#undef ACE_T1
-#undef ACE_T2
-
template <class KEY, class VALUE, class IMPLEMENTATION, class CACHING_STRATEGY, class ATTRIBUTES>
ACE_Cache_Map_Iterator<KEY, VALUE, IMPLEMENTATION, CACHING_STRATEGY, ATTRIBUTES>::~ACE_Cache_Map_Iterator (void)
{
diff --git a/dep/acelite/ace/Cached_Connect_Strategy_T.cpp b/dep/acelite/ace/Cached_Connect_Strategy_T.cpp
index 738155a5784..a6f8acc77a0 100644
--- a/dep/acelite/ace/Cached_Connect_Strategy_T.cpp
+++ b/dep/acelite/ace/Cached_Connect_Strategy_T.cpp
@@ -1,4 +1,4 @@
-//$Id: Cached_Connect_Strategy_T.cpp 92097 2010-09-30 05:41:49Z msmit $
+//$Id: Cached_Connect_Strategy_T.cpp 95630 2012-03-22 13:04:47Z johnnyw $
#ifndef ACE_CACHED_CONNECT_STRATEGY_T_CPP
#define ACE_CACHED_CONNECT_STRATEGY_T_CPP
@@ -15,13 +15,10 @@
#include "ace/Thread_Manager.h"
#include "ace/WFMO_Reactor.h"
-#define ACE_T1 class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX
-#define ACE_T2 SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_T1>
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::ACE_Cached_Connect_Strategy_Ex
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::ACE_Cached_Connect_Strategy_Ex
(CACHING_STRATEGY &caching_s,
ACE_Creation_Strategy<SVC_HANDLER> *cre_s,
ACE_Concurrency_Strategy<SVC_HANDLER> *con_s,
@@ -34,18 +31,18 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::ACE_Cached_Connect_Strategy_Ex
if (this->open (cre_s, con_s, rec_s) == -1)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
- ACE_TEXT ("ACE_Cached_Connect_Strategy_Ex<ACE_T2>\n")));
+ ACE_TEXT ("ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>\n")));
}
-template <ACE_T1>
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::~ACE_Cached_Connect_Strategy_Ex (void)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::~ACE_Cached_Connect_Strategy_Ex (void)
{
cleanup ();
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::check_hint_i
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::check_hint_i
(SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout,
@@ -134,8 +131,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::check_hint_i
return 0;
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::find_or_create_svc_handler_i
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::find_or_create_svc_handler_i
(SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout,
@@ -250,8 +247,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::find_or_create_svc_handler_i
return 0;
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cached_connect (SVC_HANDLER *&sh,
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::cached_connect (SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout,
const ACE_PEER_CONNECTOR_ADDR &local_addr,
@@ -312,8 +309,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cached_connect (SVC_HANDLER *&sh,
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::connect_svc_handler_i
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::connect_svc_handler_i
(SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout,
@@ -361,16 +358,19 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::connect_svc_handler_i
entry->ext_id_.increment ();
}
- // For all successful cases: mark the <svc_handler> in the cache
- // as being <in_use>. Therefore recyclable is BUSY.
- entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY);
+ if (entry)
+ {
+ // For all successful cases: mark the <svc_handler> in the cache
+ // as being <in_use>. Therefore recyclable is BUSY.
+ entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY);
+ }
return 0;
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cache_i (const void *recycling_act)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::cache_i (const void *recycling_act)
{
// The wonders and perils of ACT
CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act;
@@ -382,8 +382,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cache_i (const void *recycling_act)
return 0;
}
-template<ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::recycle_state_i (const void *recycling_act,
+template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::recycle_state_i (const void *recycling_act,
ACE_Recyclable_State new_state)
{
// The wonders and perils of ACT
@@ -396,8 +396,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::recycle_state_i (const void *recycling_a
return 0;
}
-template<ACE_T1> ACE_Recyclable_State
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::recycle_state_i (const void *recycling_act) const
+template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> ACE_Recyclable_State
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::recycle_state_i (const void *recycling_act) const
{
// The wonders and perils of ACT
CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act;
@@ -407,8 +407,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::recycle_state_i (const void *recycling_a
return entry->ext_id_.recycle_state ();
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::purge_i (const void *recycling_act)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::purge_i (const void *recycling_act)
{
// The wonders and perils of ACT
CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act;
@@ -417,8 +417,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::purge_i (const void *recycling_act)
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::mark_as_closed_i (const void *recycling_act)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::mark_as_closed_i (const void *recycling_act)
{
// The wonders and perils of ACT
CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act;
@@ -429,8 +429,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::mark_as_closed_i (const void *recycling_
return 0;
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cleanup_hint_i (const void *recycling_act,
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::cleanup_hint_i (const void *recycling_act,
void **act_holder)
{
// Reset the <*act_holder> in the confines and protection of the
@@ -457,20 +457,20 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cleanup_hint_i (const void *recycling_ac
return 0;
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::purge_connections (void)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::purge_connections (void)
{
return this->connection_cache_.purge ();
}
-template <ACE_T1> CACHING_STRATEGY &
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::caching_strategy (void)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> CACHING_STRATEGY &
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::caching_strategy (void)
{
return this->connection_cache_.caching_strategy ();
}
-template <ACE_T1> int
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr,
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> int
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr,
ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, std::pair<SVC_HANDLER *, ATTRIBUTES> > *&entry)
{
typedef ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDRESS,
@@ -522,8 +522,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::find (ACE_Refcounted_Hash_Recyclable<ACE
return -1;
}
-template <ACE_T1> void
-ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cleanup (void)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> void
+ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::cleanup (void)
{
// Excluded other threads from changing the cache while we cleanup
ACE_GUARD (MUTEX, ace_mon, *this->lock_);
@@ -560,8 +560,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cleanup (void)
ACE_ALLOC_HOOK_DEFINE(ACE_Cached_Connect_Strategy_Ex)
/////////////////////////////////////////////////////////////////////////
-template <ACE_T1>
-ACE_Bounded_Cached_Connect_Strategy<ACE_T2>::ACE_Bounded_Cached_Connect_Strategy
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
+ACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::ACE_Bounded_Cached_Connect_Strategy
(size_t max_size,
CACHING_STRATEGY &caching_s,
ACE_Creation_Strategy<SVC_HANDLER> *cre_s,
@@ -574,14 +574,14 @@ ACE_Bounded_Cached_Connect_Strategy<ACE_T2>::ACE_Bounded_Cached_Connect_Strategy
{
}
-template <ACE_T1>
-ACE_Bounded_Cached_Connect_Strategy<ACE_T2>::~ACE_Bounded_Cached_Connect_Strategy(void)
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
+ACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::~ACE_Bounded_Cached_Connect_Strategy(void)
{
}
-template <ACE_T1>
+template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
int
-ACE_Bounded_Cached_Connect_Strategy<ACE_T2>::find_or_create_svc_handler_i
+ACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::find_or_create_svc_handler_i
(SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout,
@@ -727,7 +727,4 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Cached_Connect_Strategy)
ACE_END_VERSIONED_NAMESPACE_DECL
-#undef ACE_T1
-#undef ACE_T2
-
#endif /* ACE_CACHED_CONNECT_STRATEGY_T_CPP */
diff --git a/dep/acelite/ace/Codeset_Registry.h b/dep/acelite/ace/Codeset_Registry.h
index e72c435f82b..28bd629add0 100644
--- a/dep/acelite/ace/Codeset_Registry.h
+++ b/dep/acelite/ace/Codeset_Registry.h
@@ -3,7 +3,7 @@
/**
* @file Codeset_Registry.h
*
- * $Id: Codeset_Registry.h 81348 2008-04-14 09:00:32Z johnnyw $
+ * $Id: Codeset_Registry.h 93651 2011-03-28 08:49:11Z johnnyw $
*
* ACE wrapper around access functions for the OSF's DCE codeset registry
* access functions
@@ -33,10 +33,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#if defined (ACE_HAS_DCE_CODESET_REGISTRY)
-#include /**/ <dce/rpc.h>
-#endif /* ACE_HAS_DCE_CODESET_REGISTRY */
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Codeset_Registry
diff --git a/dep/acelite/ace/Codeset_Registry.inl b/dep/acelite/ace/Codeset_Registry.inl
index 4419cf5e7fc..a8348180009 100644
--- a/dep/acelite/ace/Codeset_Registry.inl
+++ b/dep/acelite/ace/Codeset_Registry.inl
@@ -3,7 +3,7 @@
/**
* @file Codeset_Registry.inl
*
- * $Id: Codeset_Registry.inl 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Codeset_Registry.inl 93651 2011-03-28 08:49:11Z johnnyw $
*
* ACE wrapper around access functions for the OSF's DCE codeset registry
* access functions - the inline functions either call the system supplied
@@ -23,20 +23,10 @@ ACE_Codeset_Registry::locale_to_registry(const ACE_CString &locale,
ACE_CDR::UShort *num_sets,
ACE_CDR::UShort **char_sets)
{
-#if defined (ACE_HAS_DCE_CODESET_REGISTRY)
- error_status_t result;
- dce_cs_loc_to_rgy (locale.c_str(),
- &codeset_id,
- num_sets,
- char_sets,
- &result);
- return (result == dce_cs_c_ok) ? 1 : 0;
-#else
return ACE_Codeset_Registry::locale_to_registry_i (locale,
codeset_id,
num_sets,
char_sets);
-#endif /* ACE_HAS_DCE_CODESET_REGISTRY */
}
// based on a registry value, find the locale string and optional codeset
@@ -48,23 +38,10 @@ ACE_Codeset_Registry::registry_to_locale(ACE_CDR::ULong codeset_id,
ACE_CDR::UShort *num_sets,
ACE_CDR::UShort **char_sets)
{
-#if defined (ACE_HAS_DCE_CODESET_REGISTRY)
- error_status_t result;
- char *buffer;
- dce_cs_rgy_to_loc (codeset_id,
- &buffer,
- num_sets,
- char_sets,
- &result);
- locale.set(buffer); // does a copy :-(
- free (buffer);
- return (result == dce_cs_c_ok) ? 1 : 0;
-#else
return ACE_Codeset_Registry::registry_to_locale_i (codeset_id,
locale,
num_sets,
char_sets);
-#endif /* ACE_HAS_DCE_CODESET_REGISTRY */
}
// Tell if two codesets are compatible. This wraps the
@@ -74,13 +51,7 @@ int
ACE_Codeset_Registry::is_compatible (ACE_CDR::ULong codeset_id,
ACE_CDR::ULong other)
{
-#if defined (ACE_HAS_DCE_CODESET_REGISTRY)
- error_status_t result;
- rpc_cs_char_set_compat_check(codeset_id,other,&result);
- return (result == rpc_s_ok) ? 1 : 0;
-#else
return ACE_Codeset_Registry::is_compatible_i (codeset_id,other);
-#endif /* ACE_HAS_DCE_CODESET_REGISTRY */
}
// Return the max number of bytes required to represent a single character.
@@ -89,14 +60,7 @@ ACE_INLINE
ACE_CDR::Short
ACE_Codeset_Registry::get_max_bytes (ACE_CDR::ULong codeset_id)
{
-#if defined (ACE_HAS_DCE_CODESET_REGISTRY)
- error_status_t result;
- short max_bytes;
- rpc_rgy_get_max_bytes(codeset_id,&max_bytes,&result);
- return (result == rpc_s_ok) ? (short)max_bytes : 0;
-#else
return ACE_Codeset_Registry::get_max_bytes_i (codeset_id);
-#endif /* ACE_HAS_DCE_CODESET_REGISTRY */
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Compression/ACE_Compression_export.h b/dep/acelite/ace/Compression/ACE_Compression_export.h
new file mode 100644
index 00000000000..119e14b16ea
--- /dev/null
+++ b/dep/acelite/ace/Compression/ACE_Compression_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: ACE_Compression_export.h 95545 2012-02-23 07:57:08Z johnnyw $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl ACE_Compression
+// ------------------------------
+#ifndef ACE_COMPRESSION_EXPORT_H
+#define ACE_COMPRESSION_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_COMPRESSION_HAS_DLL)
+# define ACE_COMPRESSION_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_COMPRESSION_HAS_DLL */
+
+#if !defined (ACE_COMPRESSION_HAS_DLL)
+# define ACE_COMPRESSION_HAS_DLL 1
+#endif /* ! ACE_COMPRESSION_HAS_DLL */
+
+#if defined (ACE_COMPRESSION_HAS_DLL) && (ACE_COMPRESSION_HAS_DLL == 1)
+# if defined (ACE_COMPRESSION_BUILD_DLL)
+# define ACE_Compression_Export ACE_Proper_Export_Flag
+# define ACE_COMPRESSION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_COMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_COMPRESSION_BUILD_DLL */
+# define ACE_Compression_Export ACE_Proper_Import_Flag
+# define ACE_COMPRESSION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_COMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_COMPRESSION_BUILD_DLL */
+#else /* ACE_COMPRESSION_HAS_DLL == 1 */
+# define ACE_Compression_Export
+# define ACE_COMPRESSION_SINGLETON_DECLARATION(T)
+# define ACE_COMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_COMPRESSION_HAS_DLL == 1 */
+
+// Set ACE_COMPRESSION_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_COMPRESSION_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_COMPRESSION_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_COMPRESSION_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_COMPRESSION_NTRACE */
+
+#if (ACE_COMPRESSION_NTRACE == 1)
+# define ACE_COMPRESSION_TRACE(X)
+#else /* (ACE_COMPRESSION_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_COMPRESSION_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_COMPRESSION_NTRACE == 1) */
+
+#endif /* ACE_COMPRESSION_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/Compression/Compressor.cpp b/dep/acelite/ace/Compression/Compressor.cpp
new file mode 100644
index 00000000000..86d1a1f3dd2
--- /dev/null
+++ b/dep/acelite/ace/Compression/Compressor.cpp
@@ -0,0 +1,63 @@
+// $Id: Compressor.cpp 95556 2012-02-24 09:14:51Z johnnyw $
+
+#include "Compressor.h"
+
+#if !defined (__ACE_INLINE__)
+#include "Compressor.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Compressor::ACE_Compressor( ACE_CompressorId compressor_id,
+ ACE_UINT32 compression_level )
+ : compressor_id_ (compressor_id)
+ , compression_level_ (compression_level)
+ , compressed_bytes_ (0)
+ , uncompressed_bytes_ (0)
+{}
+
+ACE_Compressor::~ACE_Compressor ()
+{
+}
+
+ACE_UINT64
+ACE_Compressor::compressed_bytes(void) const
+{
+ ACE_GUARD_RETURN( ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0 );
+ return this->compressed_bytes_;
+}
+
+ACE_UINT64
+ACE_Compressor::uncompressed_bytes(void) const
+{
+ ACE_GUARD_RETURN( ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0 );
+ return this->uncompressed_bytes_;
+}
+
+void
+ACE_Compressor::reset_stats(void)
+{
+ ACE_GUARD( ACE_SYNCH_MUTEX, ace_mon, this->mutex_ );
+ this->compressed_bytes_ = 0;
+ this->uncompressed_bytes_ = 0;
+}
+
+void
+ACE_Compressor::update_stats(ACE_UINT64 uncompressed_bytes, ACE_UINT64 compressed_bytes)
+{
+ ACE_GUARD( ACE_SYNCH_MUTEX, ace_mon, this->mutex_ );
+ this->compressed_bytes_ += compressed_bytes;
+ this->uncompressed_bytes_ += uncompressed_bytes;
+}
+
+float
+ACE_Compressor::compression_ratio(void) const
+{
+ ACE_GUARD_RETURN( ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0.0f );
+ if (this->uncompressed_bytes_ > 0) {
+ return static_cast<float>(this->compressed_bytes_) / this->uncompressed_bytes_;
+ }
+ return 0.0f;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Compression/Compressor.h b/dep/acelite/ace/Compression/Compressor.h
new file mode 100644
index 00000000000..eb71167a5e0
--- /dev/null
+++ b/dep/acelite/ace/Compression/Compressor.h
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Compressor.h
+ *
+ * $Id: Compressor.h
+ *
+ * @author ACE version by
+ * @author Derek Dominish <derek.dominish@dsto.defence.gov.au>
+ */
+//=============================================================================
+
+#ifndef ACE_COMPRESSOR_H
+#define ACE_COMPRESSOR_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ACE_Compression_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Guard_T.h"
+#include "ace/Thread_Mutex.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Copy_Disabled.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * CompressorId from OMG Compression::CompressorId
+ * see $(TAO_ROOT)/tao/Compression.pidl
+ */
+enum ACE_CompressorId
+{
+ ACE_COMPRESSORID_NONE = 0,
+ ACE_COMPRESSORID_GZIP = 1,
+ ACE_COMPRESSORID_PKZIP = 2,
+ ACE_COMPRESSORID_BZIP2 = 3,
+ ACE_COMPRESSORID_ZLIB = 4,
+ ACE_COMPRESSORID_LZMA = 5,
+ ACE_COMPRESSORID_LZO = 6,
+ ACE_COMPRESSORID_RZIP = 7,
+ ACE_COMPRESSORID_7X = 8,
+ ACE_COMPRESSORID_XAR = 9,
+ ACE_COMPRESSORID_RLE = 10
+};
+
+class ACE_Compression_Export ACE_Compressor : private ACE_Copy_Disabled
+{
+public:
+
+ ACE_CompressorId get_compressor_id(void) const;
+
+ ACE_UINT32 get_compression_level(void) const;
+
+ /**
+ * Compress the @a in_ptr buffer for @a in_len into the
+ * @a dest_ptr buffer with a maximum @a max_out_len. If the
+ * @a max_out_len is exhausted through the compress process
+ * then a value of -1 will be returned from the function,
+ * otherwise the return value will indicate the resultant
+ * @a out_ptr compressed buffer length.
+ *
+ * NOTE: it is advisable that the @max_out_len be slightly
+ * larger of the input @a in_len (i.e. x 1.1F) to cater
+ * for the possibility that a reduced compressed length
+ * is not possible.
+ */
+ virtual ACE_UINT64 compress( const void *in_ptr,
+ ACE_UINT64 in_len,
+ void *out_ptr,
+ ACE_UINT64 max_out_len ) = 0;
+
+ /**
+ * DeCompress the @a in_ptr buffer for @a in_len into the
+ * @a out_ptr buffer with a maximum @a max_out_len. If the
+ * @a max_out_len is exhausted during decompression
+ * then a value of -1 will be returned from the function,
+ * otherwise the return value will indicate the resultant
+ * @a out_ptr decompressed buffer length.
+ */
+ virtual ACE_UINT64 decompress( const void *in_ptr,
+ ACE_UINT64 in_len,
+ void *out_ptr,
+ ACE_UINT64 max_out_len ) = 0;
+
+ /**
+ * Return the current compressed bytes statistics counter.
+ */
+ virtual ACE_UINT64 compressed_bytes(void) const;
+
+ /**
+ * Return the current uncompressed bytes statistics counter.
+ */
+ virtual ACE_UINT64 uncompressed_bytes(void) const;
+
+ /**
+ * Return the current compression ratio statistics.
+ */
+ virtual float compression_ratio(void) const;
+
+ /**
+ * Reset the statistics to zero.
+ */
+ virtual void reset_stats(void);
+
+ virtual ~ACE_Compressor (void);
+
+protected:
+ ACE_Compressor(ACE_CompressorId compressor_id,
+ ACE_UINT32 compression_level = 0); // Must be inherited.
+
+ virtual void update_stats( ACE_UINT64 uncompressed_bytes,
+ ACE_UINT64 compressed_bytes );
+
+private:
+ ACE_CompressorId compressor_id_;
+ ACE_UINT32 compression_level_;
+
+ // Ensure we can lock with imutability (i.e. const)
+ mutable ACE_SYNCH_MUTEX mutex_;
+
+ ACE_UINT64 compressed_bytes_;
+ ACE_UINT64 uncompressed_bytes_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "Compressor.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif // ACE_COMPRESSOR_H
diff --git a/dep/acelite/ace/Compression/Compressor.inl b/dep/acelite/ace/Compression/Compressor.inl
new file mode 100644
index 00000000000..b9809018e41
--- /dev/null
+++ b/dep/acelite/ace/Compression/Compressor.inl
@@ -0,0 +1,18 @@
+// -*- C++ -*-
+// $Id: Compressor.inl 95545 2012-02-23 07:57:08Z johnnyw $
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE ACE_CompressorId
+ACE_Compressor::get_compressor_id(void) const
+{
+ return this->compressor_id_;
+}
+
+ACE_INLINE ACE_UINT32
+ACE_Compressor::get_compression_level(void) const
+{
+ return this->compression_level_;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Compression/rle/ACE_RLECompression_export.h b/dep/acelite/ace/Compression/rle/ACE_RLECompression_export.h
new file mode 100644
index 00000000000..f0364580879
--- /dev/null
+++ b/dep/acelite/ace/Compression/rle/ACE_RLECompression_export.h
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+// $Id: ACE_RLECompression_export.h 95545 2012-02-23 07:57:08Z johnnyw $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl ACE_RLECompression
+// ------------------------------
+#ifndef ACE_RLECOMPRESSION_EXPORT_H
+#define ACE_RLECOMPRESSION_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_RLECOMPRESSION_HAS_DLL)
+# define ACE_RLECOMPRESSION_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_RLECOMPRESSION_HAS_DLL */
+
+#if !defined (ACE_RLECOMPRESSION_HAS_DLL)
+# define ACE_RLECOMPRESSION_HAS_DLL 1
+#endif /* ! ACE_RLECOMPRESSION_HAS_DLL */
+
+#if defined (ACE_RLECOMPRESSION_HAS_DLL) && (ACE_RLECOMPRESSION_HAS_DLL == 1)
+# if defined (ACE_RLECOMPRESSION_BUILD_DLL)
+# define ACE_RLECompression_Export ACE_Proper_Export_Flag
+# define ACE_RLECOMPRESSION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_RLECOMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_RLECOMPRESSION_BUILD_DLL */
+# define ACE_RLECompression_Export ACE_Proper_Import_Flag
+# define ACE_RLECOMPRESSION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_RLECOMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_RLECOMPRESSION_BUILD_DLL */
+#else /* ACE_RLECOMPRESSION_HAS_DLL == 1 */
+# define ACE_RLECompression_Export
+# define ACE_RLECOMPRESSION_SINGLETON_DECLARATION(T)
+# define ACE_RLECOMPRESSION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_RLECOMPRESSION_HAS_DLL == 1 */
+
+// Set ACE_RLECOMPRESSION_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_RLECOMPRESSION_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_RLECOMPRESSION_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_RLECOMPRESSION_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_RLECOMPRESSION_NTRACE */
+
+#if (ACE_RLECOMPRESSION_NTRACE == 1)
+# define ACE_RLECOMPRESSION_TRACE(X)
+#else /* (ACE_RLECOMPRESSION_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_RLECOMPRESSION_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_RLECOMPRESSION_NTRACE == 1) */
+
+#endif /* ACE_RLECOMPRESSION_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/Compression/rle/RLECompressor.cpp b/dep/acelite/ace/Compression/rle/RLECompressor.cpp
new file mode 100644
index 00000000000..423d8a0f0ac
--- /dev/null
+++ b/dep/acelite/ace/Compression/rle/RLECompressor.cpp
@@ -0,0 +1,158 @@
+// $Id: RLECompressor.cpp 95560 2012-02-27 08:11:54Z johnnyw $
+
+#include "RLECompressor.h"
+#include "ace/OS_NS_string.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_RLECompressor::ACE_RLECompressor(void)
+ : ACE_Compressor(ACE_COMPRESSORID_RLE)
+{
+}
+
+ACE_RLECompressor::~ACE_RLECompressor(void)
+{
+}
+
+ACE_UINT64
+ACE_RLECompressor::compress( const void *in_ptr,
+ ACE_UINT64 in_len,
+ void *out_ptr,
+ ACE_UINT64 max_out_len )
+{
+ const ACE_UINT8 *in_p = static_cast<const ACE_UINT8*>(in_ptr);
+ ACE_UINT8 *out_p = static_cast<ACE_UINT8*>(out_ptr);
+
+ ACE_UINT64 src_len = in_len; // Save for stats
+ ACE_UINT64 out_len = 0;
+ ACE_UINT64 out_index = 0;
+ ACE_UINT64 out_base = 0;
+
+ ACE_UINT32 run_count = 0;
+ ACE_UINT32 dup_count = 0;
+
+ bool run_code = false;
+
+ ACE_UINT8 nxt_byte, cur_byte;
+
+ if (in_p && out_p) while (in_len-- > 0) {
+
+ if (run_code) switch (run_count) {
+
+ default:
+
+ out_p[out_index = out_base] = ACE_UINT8(run_count++ | 0x80);
+ out_p[++out_index] = cur_byte = *in_p++;
+
+ if (in_len ? cur_byte == (nxt_byte = *in_p) : true) {
+ continue;
+ }
+
+ // Fall Through
+
+ case 128:
+
+ if (++out_index >= max_out_len) {
+ return ACE_UINT64(-1); // Output Exhausted
+ } else if (in_len == 0) {
+ continue;
+ }
+
+ run_code = false;
+ out_p[out_base = out_index] = 0;
+ dup_count = run_count = 0;
+ continue;
+ }
+
+ switch (run_count) {
+
+ case 128:
+
+ if (++out_index >= max_out_len) {
+ return ACE_UINT64(-1); // Output Exhausted
+ }
+ out_p[out_base = out_index] = 0;
+ dup_count = run_count = 0;
+
+ // Fall Through
+
+ default :
+
+ cur_byte = *in_p++;
+
+ if (in_len > 0) {
+ if (cur_byte == (nxt_byte = *in_p)) {
+ if (dup_count++ == 1) {
+ if (run_count >= dup_count) {
+ out_p[out_base] = static_cast<ACE_UINT8>(run_count - dup_count);
+ out_base += run_count;
+ }
+ run_code = true;
+ run_count = dup_count - 1;
+ dup_count = 0;
+ out_p[out_index = out_base] = static_cast<ACE_UINT8>(run_count++ | 0x80);
+ break;
+ }
+ } else dup_count = 0;
+ }
+ out_p[out_base] = char(run_count++);
+ break;
+ }
+
+ if (++out_index >= max_out_len) {
+ return ACE_UINT64(-1); // Output Exhausted
+ }
+
+ out_p[out_index] = cur_byte;
+ }
+
+ out_len = ++out_index; // Update our output length
+
+ this->update_stats(src_len, out_len);
+
+ return out_len;
+}
+
+// Decompress using Run Length Encoding (RLE)
+ACE_UINT64
+ACE_RLECompressor::decompress( const void *in_ptr,
+ ACE_UINT64 in_len,
+ void *out_ptr,
+ ACE_UINT64 max_out_len )
+{
+ ACE_UINT64 out_len = 0;
+
+ const ACE_UINT8 *in_p = static_cast<const ACE_UINT8*>(in_ptr);
+ ACE_UINT8 *out_p = static_cast<ACE_UINT8*>(out_ptr);
+
+ if (in_p && out_p) while(in_len-- > 0) {
+
+ ACE_UINT8 cur_byte = *in_p++;
+ ACE_UINT32 cpy_len = ACE_UINT32((cur_byte & 0x7F) + 1);
+
+ if (cpy_len > max_out_len) {
+ return ACE_UINT64(-1); // Output Exhausted
+ } else if ((cur_byte & 0x80) != 0) { // compressed
+ if (in_len-- > 0) {
+ ACE_OS::memset(out_p, *in_p++, cpy_len);
+ } else {
+ return ACE_UINT64(-1); // Output Exhausted
+ }
+ } else if (in_len >= cpy_len) {
+ ACE_OS::memcpy(out_p, in_p, cpy_len);
+ in_p += cpy_len;
+ in_len -= cpy_len;
+ } else {
+ return ACE_UINT64(-1); // Output Exhausted
+ }
+
+ out_p += cpy_len;
+ max_out_len -= cpy_len;
+ out_len += cpy_len;
+ }
+
+ return out_len;
+}
+
+// Close versioned namespace, if enabled by the user.
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Compression/rle/RLECompressor.h b/dep/acelite/ace/Compression/rle/RLECompressor.h
new file mode 100644
index 00000000000..7371d22bf50
--- /dev/null
+++ b/dep/acelite/ace/Compression/rle/RLECompressor.h
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file RLECompressor.h
+ *
+ * $Id: RLECompressor.h
+ *
+ * @author TAO version by
+ * @author Derek Dominish <derek.dominish@dsto.defence.gov.au>
+ * @author ACE version by
+ * @author Derek Dominish <derek.dominish@dsto.defence.gov.au>
+ *
+ * Run-length encoding (RLE) is a very simple form of data compression
+ * in which runs of data (that is, sequences in which the same data value
+ * occurs in many consecutive data elements) are stored as a single data
+ * value and count, rather than as the original run. This is most useful
+ * on data that contains many such runs: for example, simple graphic
+ * images such as icons, line drawings, and animations. It is not useful
+ * with files that don't have many runs as it could slightly increase the
+ * output size.
+ * ALGORITHM: This algorithm is an optimized version of the traditional
+ * RLE algorithm in that it behaves better with very few runs.
+ *
+ * With a run of a character where that run is >= 3 this is
+ * replaced with the repeat indicator 0X80 and then the repeat count OR'd
+ * over this ident. This repeat count is therefore has a maximum value
+ * of 127 (0x7F) which is to be interpreted as the next character repeated
+ * another 'repeat count' times (i.e. a maximum of 128 characters can be
+ * represented in any single dupal). if the repeat ident is not present
+ * then the count is to be interpreted as a copy of the next repeat count
+ * characters + 1.
+ *
+ * EXAMPLE: the following arbitary string of 67 bytes:-
+ * WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
+ * will produce (as a HEXDUMP) of 14 bytes
+ * 8B 57 00 42 8B 57 82 42 97 57 00 42 8D 57 .W.B.W.B.W.B.W
+ */
+//=============================================================================
+
+#ifndef ACE_RLECOMPRESSOR_H
+#define ACE_RLECOMPRESSOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ACE_RLECompression_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Compression/Compressor.h"
+#include "ace/Singleton.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ACE_RLECompression_Export ACE_RLECompressor : public ACE_Compressor
+{
+public:
+ /**
+ * Default constructor. Should use instance() to get global instance.
+ */
+ ACE_RLECompressor(void);
+
+ virtual ~ACE_RLECompressor(void);
+
+ /**
+ * Compress the @a in_ptr buffer for @a in_len into the
+ * @a dest_ptr buffer with a maximum @a max_out_len using
+ * the Run Length Ecoding (RLE) algorithm. If the
+ * @a max_out_len is exhausted through the compress process
+ * then a value of -1 will be returned from the function,
+ * otherwise the return value will indicate the resultant
+ * @a out_ptr compressed buffer length.
+ *
+ * @note It is advisable that the @max_out_len be slightly
+ * larger of the input @a in_len (i.e. x 1.1F) to cater
+ * for the possibility that a reduced compressed length
+ * is not possible.
+ */
+ virtual ACE_UINT64 compress( const void *in_ptr,
+ ACE_UINT64 in_len,
+ void *out_ptr,
+ ACE_UINT64 max_out_len );
+
+ /**
+ * DeCompress the @a in_ptr buffer for @a in_len into the
+ * @a out_ptr buffer with a maximum @a max_out_len using
+ * the Run Length Ecoding (RLE) algorithm. If the
+ * @a max_out_len is exhausted during decompression
+ * then a value of -1 will be returned from the function,
+ * otherwise the return value will indicate the resultant
+ * @a out_ptr decompressed buffer length.
+ */
+ virtual ACE_UINT64 decompress( const void *in_ptr,
+ ACE_UINT64 in_len,
+ void *out_ptr,
+ ACE_UINT64 max_out_len );
+};
+
+ACE_RLECOMPRESSION_SINGLETON_DECLARE(ACE_Singleton, ACE_RLECompressor, ACE_SYNCH_MUTEX);
+
+typedef class ACE_Singleton<ACE_RLECompressor, ACE_SYNCH_MUTEX> ACE_RLECompression;
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // ACE_RLECOMPRESSOR_H
diff --git a/dep/acelite/ace/Condition_Attributes.cpp b/dep/acelite/ace/Condition_Attributes.cpp
new file mode 100644
index 00000000000..49a02635ba8
--- /dev/null
+++ b/dep/acelite/ace/Condition_Attributes.cpp
@@ -0,0 +1,21 @@
+/* -*- C++ -*- */
+/**
+ * @file Condition_Attributes.cpp
+ *
+ * $Id: Condition_Attributes.cpp 96061 2012-08-16 09:36:07Z mcorino $
+ *
+ * Originally in Synch.cpp
+ *
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+
+#include "ace/Condition_Thread_Mutex.h"
+#include "ace/Condition_Attributes.h"
+
+#if defined (ACE_HAS_THREADS)
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Condition_Attributes.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* ACE_HAS_THREADS */
diff --git a/dep/acelite/ace/Condition_Attributes.h b/dep/acelite/ace/Condition_Attributes.h
new file mode 100644
index 00000000000..0d53b273285
--- /dev/null
+++ b/dep/acelite/ace/Condition_Attributes.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+//==========================================================================
+/**
+ * @file Condition_Attributes.h
+ *
+ * $Id: Condition_Attributes.h 96077 2012-08-20 08:13:23Z johnnyw $
+ *
+ * Moved from Synch.h.
+ *
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//==========================================================================
+
+#ifndef ACE_CONDITION_ATTRIBUTES_H
+#define ACE_CONDITION_ATTRIBUTES_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/OS_NS_Thread.h"
+
+#if defined (ACE_HAS_THREADS)
+
+// ACE platform supports some form of threading.
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ACE_Export ACE_Condition_Attributes
+{
+public:
+ /// Constructor
+ ACE_Condition_Attributes (int type = ACE_DEFAULT_SYNCH_TYPE);
+
+ /// Destructor
+ ~ACE_Condition_Attributes (void);
+
+ /// Accessor for retrieving the current attributes
+ const ACE_condattr_t& attributes (void) const;
+
+protected:
+ /// The attributes
+ ACE_condattr_t attributes_;
+
+private:
+ // = Prevent assignment and initialization.
+ void operator= (const ACE_Condition_Attributes &);
+ ACE_Condition_Attributes (const ACE_Condition_Attributes &);
+};
+
+template <class TIME_POLICY>
+class ACE_Condition_Attributes_T : public ACE_Condition_Attributes
+{
+public:
+ /// Constructor
+ ACE_Condition_Attributes_T (int type = ACE_DEFAULT_SYNCH_TYPE)
+ : ACE_Condition_Attributes (type)
+ {}
+
+ /// Destructor
+ ~ACE_Condition_Attributes_T (void) {}
+
+private:
+ // = Prevent assignment and initialization.
+ void operator= (const ACE_Condition_Attributes_T<TIME_POLICY> &);
+ ACE_Condition_Attributes_T (const ACE_Condition_Attributes_T<TIME_POLICY> &);
+};
+
+class ACE_Monotonic_Time_Policy;
+
+template <>
+class ACE_Export ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy>
+ : public ACE_Condition_Attributes
+{
+public:
+ /// Constructor
+ ACE_Condition_Attributes_T (int type = ACE_DEFAULT_SYNCH_TYPE);
+
+ /// Destructor
+ ~ACE_Condition_Attributes_T (void);
+
+private:
+ // = Prevent assignment and initialization.
+ void operator= (const ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> &);
+ ACE_Condition_Attributes_T (const ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> &);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/Condition_Attributes.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* !ACE_HAS_THREADS */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_CONDITION_ATTRIBUTES_H */
diff --git a/dep/acelite/ace/Condition_Attributes.inl b/dep/acelite/ace/Condition_Attributes.inl
new file mode 100644
index 00000000000..12afde24c80
--- /dev/null
+++ b/dep/acelite/ace/Condition_Attributes.inl
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+//
+// $Id: Condition_Attributes.inl 96096 2012-08-23 12:34:02Z johnnyw $
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+ACE_Condition_Attributes::ACE_Condition_Attributes (int type)
+{
+ (void) ACE_OS::condattr_init (this->attributes_, type);
+}
+
+ACE_INLINE
+ACE_Condition_Attributes::~ACE_Condition_Attributes (void)
+{
+ ACE_OS::condattr_destroy (this->attributes_);
+}
+
+ACE_INLINE
+const ACE_condattr_t&
+ACE_Condition_Attributes::attributes (void) const
+{
+ return this->attributes_;
+}
+
+ACE_INLINE
+ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy>::ACE_Condition_Attributes_T (int type)
+ : ACE_Condition_Attributes (type)
+{
+#if (defined (_POSIX_MONOTONIC_CLOCK) && !defined (ACE_LACKS_MONOTONIC_TIME)) || defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
+ (void) ACE_OS::condattr_setclock (this->attributes_, CLOCK_MONOTONIC);
+#endif
+}
+
+ACE_INLINE
+ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy>::~ACE_Condition_Attributes_T (void)
+{
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Condition_Recursive_Thread_Mutex.cpp b/dep/acelite/ace/Condition_Recursive_Thread_Mutex.cpp
index 1f357589f55..74922b65c5d 100644
--- a/dep/acelite/ace/Condition_Recursive_Thread_Mutex.cpp
+++ b/dep/acelite/ace/Condition_Recursive_Thread_Mutex.cpp
@@ -3,7 +3,7 @@
/**
* @file Condition_Recursive_Thread_Mutex.cpp
*
- * $Id: Condition_Recursive_Thread_Mutex.cpp 89127 2010-02-22 19:58:18Z schmidt $
+ * $Id: Condition_Recursive_Thread_Mutex.cpp 96077 2012-08-20 08:13:23Z johnnyw $
*
* Originally in Synch.cpp
*
@@ -14,9 +14,7 @@
#if defined (ACE_HAS_THREADS)
-#if defined (ACE_HAS_DUMP)
-# include "ace/Log_Msg.h"
-#endif /* ACE_HAS_DUMP */
+#include "ace/Log_Msg.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -49,7 +47,19 @@ ACE_Condition<ACE_Recursive_Thread_Mutex>::~ACE_Condition (void)
ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition (ACE_Recursive_Thread_Mutex &m)
: mutex_ (m)
{
- ACE_OS::cond_init (&this->cond_);
+ if (ACE_OS::cond_init (&this->cond_) != 0)
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"),
+ ACE_TEXT ("ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition<ACE_Recursive_Thread_Mutex>")));
+}
+
+ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition (ACE_Recursive_Thread_Mutex &m,
+ const ACE_Condition_Attributes &attributes)
+ : mutex_ (m)
+{
+ if (ACE_OS::cond_init (&this->cond_,
+ const_cast<ACE_condattr_t &> (attributes.attributes ())) != 0)
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"),
+ ACE_TEXT ("ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition<ACE_Recursive_Thread_Mutex>")));
}
int
@@ -118,12 +128,6 @@ ACE_Condition<ACE_Recursive_Thread_Mutex>::mutex (void)
return this->mutex_;
}
-ACE_Condition_Recursive_Thread_Mutex::ACE_Condition_Recursive_Thread_Mutex (
- ACE_Recursive_Thread_Mutex &m) :
- ACE_Condition<ACE_Recursive_Thread_Mutex> (m)
-{
-}
-
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_HAS_THREADS */
diff --git a/dep/acelite/ace/Condition_Recursive_Thread_Mutex.h b/dep/acelite/ace/Condition_Recursive_Thread_Mutex.h
index ac3177da8c8..a313a7f7b6e 100644
--- a/dep/acelite/ace/Condition_Recursive_Thread_Mutex.h
+++ b/dep/acelite/ace/Condition_Recursive_Thread_Mutex.h
@@ -4,7 +4,7 @@
/**
* @file Condition_Recursive_Thread_Mutex.h
*
- * $Id: Condition_Recursive_Thread_Mutex.h 86731 2009-09-17 12:23:48Z johnnyw $
+ * $Id: Condition_Recursive_Thread_Mutex.h 96073 2012-08-17 13:39:55Z mcorino $
*
* Moved from Synch.h.
*
@@ -26,11 +26,11 @@
# include "ace/Null_Condition.h"
#else /* ACE_HAS_THREADS */
#include "ace/Recursive_Thread_Mutex.h"
+#include "ace/Condition_Attributes.h"
+#include "ace/Condition_T.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class ACE_LOCK> class ACE_Condition;
-
/**
* @brief ACE_Condition template specialization written using
* @a ACE_Recursive_Thread_Mutex. This allows threads to block until
@@ -43,6 +43,10 @@ public:
/// Initialize the condition variable with a recursive mutex.
ACE_Condition (ACE_Recursive_Thread_Mutex &m);
+ /// Initialize the condition variable.
+ ACE_Condition (ACE_Recursive_Thread_Mutex &m,
+ const ACE_Condition_Attributes &attributes);
+
/// Implicitly destroy the condition variable.
~ACE_Condition (void);
@@ -65,7 +69,7 @@ public:
* Block on condition or until absolute time-of-day has passed. If
* abstime == 0 use "blocking" wait() semantics on the recursive @a mutex
* passed as a parameter (this is useful if you need to store the
- * <Condition> in shared memory). Else, if <abstime> != 0 and the
+ * <Condition> in shared memory). Else, if @a abstime != 0 and the
* call times out before the condition is signaled <wait> returns -1
* and sets errno to ETIME.
*/
@@ -100,13 +104,7 @@ private:
};
-class ACE_Export ACE_Condition_Recursive_Thread_Mutex
- : public ACE_Condition<ACE_Recursive_Thread_Mutex>
-{
-public:
- /// Initialize the condition variable with a recursive mutex.
- ACE_Condition_Recursive_Thread_Mutex (ACE_Recursive_Thread_Mutex &m);
-};
+typedef ACE_Condition<ACE_Recursive_Thread_Mutex> ACE_Condition_Recursive_Thread_Mutex;
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Condition_T.cpp b/dep/acelite/ace/Condition_T.cpp
index ae75d9ff359..4b5e32d09f9 100644
--- a/dep/acelite/ace/Condition_T.cpp
+++ b/dep/acelite/ace/Condition_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Condition_T.cpp 89127 2010-02-22 19:58:18Z schmidt $
+// $Id: Condition_T.cpp 96077 2012-08-20 08:13:23Z johnnyw $
#ifndef ACE_CONDITION_T_CPP
#define ACE_CONDITION_T_CPP
@@ -15,6 +15,7 @@
#if !defined (__ACE_INLINE__)
#include "ace/Condition_T.inl"
+#include "ace/Time_Value.h"
#endif /* __ACE_INLINE__ */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -72,6 +73,22 @@ ACE_Condition<MUTEX>::ACE_Condition (MUTEX &m,
}
template <class MUTEX>
+ACE_Condition<MUTEX>::ACE_Condition (MUTEX &m,
+ const ACE_Condition_Attributes &attributes,
+ const ACE_TCHAR *name,
+ void *arg)
+ : mutex_ (m)
+{
+// ACE_TRACE ("ACE_Condition<MUTEX>::ACE_Condition<MUTEX>");
+ if (ACE_OS::cond_init (&this->cond_,
+ const_cast<ACE_condattr_t &> (attributes.attributes ()),
+ name, arg) != 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("ACE_Condition::ACE_Condition")));
+}
+
+template <class MUTEX>
ACE_Condition<MUTEX>::~ACE_Condition (void)
{
// ACE_TRACE ("ACE_Condition<MUTEX>::~ACE_Condition");
diff --git a/dep/acelite/ace/Condition_T.h b/dep/acelite/ace/Condition_T.h
index 936ce821777..cbae002d7a2 100644
--- a/dep/acelite/ace/Condition_T.h
+++ b/dep/acelite/ace/Condition_T.h
@@ -4,7 +4,7 @@
/**
* @file Condition_T.h
*
- * $Id: Condition_T.h 81462 2008-04-28 11:39:40Z johnnyw $
+ * $Id: Condition_T.h 96061 2012-08-16 09:36:07Z mcorino $
*
* Moved from Synch.h.
*
@@ -18,7 +18,7 @@
#include /**/ "ace/pre.h"
#include "ace/OS_NS_Thread.h"
-#include "ace/Lock.h"
+#include "ace/Condition_Attributes.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -37,8 +37,8 @@ class ACE_Time_Value;
* until shared data changes state.
*
* A condition variable enables threads to atomically block and
- * test the condition under the protection of a mutual exclu-
- * sion lock (mutex) until the condition is satisfied. That is,
+ * test the condition under the protection of a mutual exclusion
+ * lock (mutex) until the condition is satisfied. That is,
* the mutex must have been held by the thread before calling
* wait or signal on the condition. If the condition is false,
* a thread blocks on a condition variable and atomically
@@ -54,11 +54,16 @@ template <class MUTEX>
class ACE_Condition
{
public:
- // = Initialiation and termination methods.
/// Initialize the condition variable.
ACE_Condition (MUTEX &m, int type = USYNC_THREAD,
const ACE_TCHAR *name = 0, void *arg = 0);
+ /// Initialize the condition variable.
+ ACE_Condition (MUTEX &m,
+ const ACE_Condition_Attributes &attributes,
+ const ACE_TCHAR *name = 0,
+ void *arg = 0);
+
/// Implicitly destroy the condition variable.
~ACE_Condition (void);
@@ -67,7 +72,7 @@ public:
* Block on condition, or until absolute time-of-day has passed. If
* @a abstime == 0 use "blocking" <wait> semantics. Else, if @a abstime
* != 0 and the call times out before the condition is signaled
- * <wait> returns -1 and sets errno to ETIME.
+ * wait() returns -1 and sets errno to ETIME.
*/
int wait (const ACE_Time_Value *abstime);
@@ -76,10 +81,10 @@ public:
/**
* Block on condition or until absolute time-of-day has passed. If
- * abstime == 0 use "blocking" wait() semantics on the <mutex>
+ * @a abstime == 0 use "blocking" wait() semantics on the @a mutex
* passed as a parameter (this is useful if you need to store the
- * <Condition> in shared memory). Else, if <abstime> != 0 and the
- * call times out before the condition is signaled <wait> returns -1
+ * <Condition> in shared memory). Else, if @a abstime != 0 and the
+ * call times out before the condition is signaled wait() returns -1
* and sets errno to ETIME.
*/
int wait (MUTEX &mutex, const ACE_Time_Value *abstime = 0);
diff --git a/dep/acelite/ace/Condition_Thread_Mutex.cpp b/dep/acelite/ace/Condition_Thread_Mutex.cpp
index 88e99702d0f..c3fcd7936b0 100644
--- a/dep/acelite/ace/Condition_Thread_Mutex.cpp
+++ b/dep/acelite/ace/Condition_Thread_Mutex.cpp
@@ -2,7 +2,7 @@
/**
* @file Condition_Thread_Mutex.cpp
*
- * $Id: Condition_Thread_Mutex.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+ * $Id: Condition_Thread_Mutex.cpp 96077 2012-08-20 08:13:23Z johnnyw $
*
* Originally in Synch.cpp
*
@@ -19,17 +19,15 @@
#include "ace/Log_Msg.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-ACE_ALLOC_HOOK_DEFINE(ACE_Condition_Thread_Mutex)
+ACE_ALLOC_HOOK_DEFINE(ACE_Condition<ACE_Thread_Mutex>)
void
-ACE_Condition_Thread_Mutex::dump (void) const
+ACE_Condition<ACE_Thread_Mutex>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::dump");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n")));
@@ -42,40 +40,40 @@ ACE_Condition_Thread_Mutex::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m,
- const ACE_TCHAR *name,
- void *arg)
+ACE_Condition<ACE_Thread_Mutex>::ACE_Condition (ACE_Thread_Mutex &m,
+ const ACE_TCHAR *name,
+ void *arg)
: mutex_ (m),
removed_ (false)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::ACE_Condition<ACE_Thread_Mutex>");
if (ACE_OS::cond_init (&this->cond_,
(short) USYNC_THREAD,
name,
arg) != 0)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
- ACE_TEXT ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex")));
+ ACE_TEXT ("ACE_Condition<ACE_Thread_Mutex>::ACE_Condition<ACE_Thread_Mutex>")));
}
-ACE_Condition_Thread_Mutex::
-ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m,
- ACE_Condition_Attributes &attributes,
- const ACE_TCHAR *name,
- void *arg)
+ACE_Condition<ACE_Thread_Mutex>::ACE_Condition (ACE_Thread_Mutex &m,
+ const ACE_Condition_Attributes &attributes,
+ const ACE_TCHAR *name,
+ void *arg)
: mutex_ (m),
removed_ (false)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex");
- if (ACE_OS::cond_init (&this->cond_, attributes.attributes_,
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::ACE_Condition<ACE_Thread_Mutex>");
+ if (ACE_OS::cond_init (&this->cond_,
+ const_cast<ACE_condattr_t &> (attributes.attributes ()),
name, arg) != 0)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"),
- ACE_TEXT ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex")));
+ ACE_TEXT ("ACE_Condition<ACE_Thread_Mutex>::ACE_Condition<ACE_Thread_Mutex>")));
}
-ACE_Condition_Thread_Mutex::~ACE_Condition_Thread_Mutex (void)
+ACE_Condition<ACE_Thread_Mutex>::~ACE_Condition (void)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::~ACE_Condition_Thread_Mutex");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::~ACE_Condition<ACE_Thread_Mutex>");
this->remove ();
}
@@ -84,40 +82,40 @@ ACE_Condition_Thread_Mutex::~ACE_Condition_Thread_Mutex (void)
// <abstime> using the <cond_timedwait> function.
int
-ACE_Condition_Thread_Mutex::wait (void)
+ACE_Condition<ACE_Thread_Mutex>::wait (void)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait");
- return ACE_OS::cond_wait (&this->cond_, &this->mutex_.lock_);
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::wait");
+ return ACE_OS::cond_wait (&this->cond_, &this->mutex_.lock ());
}
int
-ACE_Condition_Thread_Mutex::wait (ACE_Thread_Mutex &mutex,
+ACE_Condition<ACE_Thread_Mutex>::wait (ACE_Thread_Mutex &mutex,
const ACE_Time_Value *abstime)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::wait");
return ACE_OS::cond_timedwait (&this->cond_,
- &mutex.lock_,
+ &mutex.lock (),
const_cast <ACE_Time_Value *> (abstime));
}
int
-ACE_Condition_Thread_Mutex::wait (const ACE_Time_Value *abstime)
+ACE_Condition<ACE_Thread_Mutex>::wait (const ACE_Time_Value *abstime)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::wait");
return this->wait (this->mutex_, abstime);
}
int
-ACE_Condition_Thread_Mutex::signal (void)
+ACE_Condition<ACE_Thread_Mutex>::signal (void)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::signal");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::signal");
return ACE_OS::cond_signal (&this->cond_);
}
int
-ACE_Condition_Thread_Mutex::broadcast (void)
+ACE_Condition<ACE_Thread_Mutex>::broadcast (void)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::broadcast");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::broadcast");
return ACE_OS::cond_broadcast (&this->cond_);
}
diff --git a/dep/acelite/ace/Condition_Thread_Mutex.h b/dep/acelite/ace/Condition_Thread_Mutex.h
index 1ba866d2eb0..f39829cfe71 100644
--- a/dep/acelite/ace/Condition_Thread_Mutex.h
+++ b/dep/acelite/ace/Condition_Thread_Mutex.h
@@ -4,7 +4,7 @@
/**
* @file Condition_Thread_Mutex.h
*
- * $Id: Condition_Thread_Mutex.h 92069 2010-09-28 11:38:59Z johnnyw $
+ * $Id: Condition_Thread_Mutex.h 96073 2012-08-17 13:39:55Z mcorino $
*
* Moved from Synch.h.
*
@@ -28,37 +28,17 @@
// ACE platform supports some form of threading.
#include "ace/Thread_Mutex.h"
+#include "ace/Condition_Attributes.h"
+#include "ace/Condition_T.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Time_Value;
-class ACE_Export ACE_Condition_Attributes
-{
-public:
- /// Constructor
- ACE_Condition_Attributes (int type = ACE_DEFAULT_SYNCH_TYPE);
-
- /// Destructor
- ~ACE_Condition_Attributes (void);
-
-private:
- friend class ACE_Condition_Thread_Mutex;
-
- /// The attributes
- ACE_condattr_t attributes_;
-
-private:
- // = Prevent assignment and initialization.
- void operator= (const ACE_Condition_Attributes &);
- ACE_Condition_Attributes (const ACE_Condition_Attributes &);
-};
-
/**
- * @class ACE_Condition_Thread_Mutex
- *
- * @brief ACE_Condition variable wrapper written using ACE_Mutexes This
- * allows threads to block until shared data changes state.
+ * @brief ACE_Condition template specialization written using
+ * ACE_Mutexes. This allows threads to block until shared data
+ * changes state.
* A condition variable enables threads to atomically block and
* test the condition under the protection of a mutual exclu-
* sion lock (mutex) until the condition is satisfied. That is,
@@ -70,26 +50,24 @@ private:
* up waiting threads by signaling the associated condition
* variable. The waiting threads, upon awakening, reacquire the
* mutex and re-evaluate the condition.
- *
- * This should be an instantiation of ACE_Condition but problems
- * with compilers precludes this...
*/
-class ACE_Export ACE_Condition_Thread_Mutex
+template <>
+class ACE_Export ACE_Condition<ACE_Thread_Mutex>
{
public:
/// Initialize the condition variable.
- ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m,
- const ACE_TCHAR *name = 0,
- void *arg = 0);
+ ACE_Condition (ACE_Thread_Mutex &m,
+ const ACE_TCHAR *name = 0,
+ void *arg = 0);
/// Initialize the condition variable.
- ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m,
- ACE_Condition_Attributes &attributes,
- const ACE_TCHAR *name = 0,
- void *arg = 0);
+ ACE_Condition (ACE_Thread_Mutex &m,
+ const ACE_Condition_Attributes &attributes,
+ const ACE_TCHAR *name = 0,
+ void *arg = 0);
/// Implicitly destroy the condition variable.
- ~ACE_Condition_Thread_Mutex (void);
+ ~ACE_Condition (void);
/**
* Explicitly destroy the condition variable. Note that only one
@@ -111,7 +89,7 @@ public:
/**
* Block on condition or until absolute time-of-day has passed. If
- * abstime == 0 use "blocking" wait() semantics on the <mutex>
+ * abstime == 0 use "blocking" wait() semantics on the @a mutex
* passed as a parameter (this is useful if you need to store the
* <Condition> in shared memory). Else, if @a abstime != 0 and the
* call times out before the condition is signaled <wait> returns -1
@@ -150,10 +128,12 @@ protected:
private:
// = Prevent assignment and initialization.
- void operator= (const ACE_Condition_Thread_Mutex &);
- ACE_Condition_Thread_Mutex (const ACE_Condition_Thread_Mutex &);
+ void operator= (const ACE_Condition<ACE_Thread_Mutex> &);
+ ACE_Condition (const ACE_Condition<ACE_Thread_Mutex> &);
};
+typedef ACE_Condition<ACE_Thread_Mutex> ACE_Condition_Thread_Mutex;
+
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
diff --git a/dep/acelite/ace/Condition_Thread_Mutex.inl b/dep/acelite/ace/Condition_Thread_Mutex.inl
index 712a8be0251..76cbc82ea82 100644
--- a/dep/acelite/ace/Condition_Thread_Mutex.inl
+++ b/dep/acelite/ace/Condition_Thread_Mutex.inl
@@ -1,25 +1,13 @@
// -*- C++ -*-
//
-// $Id: Condition_Thread_Mutex.inl 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: Condition_Thread_Mutex.inl 96061 2012-08-16 09:36:07Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-ACE_INLINE
-ACE_Condition_Attributes::ACE_Condition_Attributes (int type)
-{
- (void) ACE_OS::condattr_init (this->attributes_, type);
-}
-
-ACE_INLINE
-ACE_Condition_Attributes::~ACE_Condition_Attributes (void)
-{
- ACE_OS::condattr_destroy (this->attributes_);
-}
-
ACE_INLINE int
-ACE_Condition_Thread_Mutex::remove (void)
+ACE_Condition<ACE_Thread_Mutex>::remove (void)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::remove");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::remove");
// <cond_destroy> is called in a loop if the condition variable is
// BUSY. This avoids a condition where a condition is signaled and
@@ -44,9 +32,9 @@ ACE_Condition_Thread_Mutex::remove (void)
}
ACE_INLINE ACE_Thread_Mutex &
-ACE_Condition_Thread_Mutex::mutex (void)
+ACE_Condition<ACE_Thread_Mutex>::mutex (void)
{
-// ACE_TRACE ("ACE_Condition_Thread_Mutex::mutex");
+// ACE_TRACE ("ACE_Condition<ACE_Thread_Mutex>::mutex");
return this->mutex_;
}
diff --git a/dep/acelite/ace/Configuration.cpp b/dep/acelite/ace/Configuration.cpp
index 4e0a1749e92..85bbf1ca0c0 100644
--- a/dep/acelite/ace/Configuration.cpp
+++ b/dep/acelite/ace/Configuration.cpp
@@ -1,4 +1,4 @@
-// $Id: Configuration.cpp 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: Configuration.cpp 92828 2010-12-08 09:38:57Z mcorino $
#include "ace/Configuration.h"
#include "ace/Auto_Ptr.h"
#include "ace/SString.h"
@@ -1632,7 +1632,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key
// Now remove subkey from parent key
ACE_Configuration_ExtId SubSExtId (sub_section);
- SUBSECTION_HASH::ENTRY* subsection_entry;
+ SUBSECTION_HASH::ENTRY* subsection_entry = 0;
if (((SUBSECTION_HASH*)ParentIntId.section_hash_map_)->
find (SubSExtId, subsection_entry))
return -1;
diff --git a/dep/acelite/ace/Configuration_Import_Export.cpp b/dep/acelite/ace/Configuration_Import_Export.cpp
index ae489f05dfa..15d869b8a09 100644
--- a/dep/acelite/ace/Configuration_Import_Export.cpp
+++ b/dep/acelite/ace/Configuration_Import_Export.cpp
@@ -1,4 +1,4 @@
-// $Id: Configuration_Import_Export.cpp 84565 2009-02-23 08:20:39Z johnnyw $
+// $Id: Configuration_Import_Export.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/Configuration_Import_Export.h"
#include "ace/OS_Errno.h"
@@ -138,7 +138,8 @@ ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename)
// number type
ACE_TCHAR* endptr = 0;
unsigned long value = ACE_OS::strtoul (end + 6, &endptr, 16);
- if (config_.set_integer_value (section, name, value))
+ if (config_.set_integer_value (section, name,
+ static_cast<u_int> (value)))
{
ACE_OS::fclose (in);
delete [] buffer;
diff --git a/dep/acelite/ace/Configuration_Import_Export.h b/dep/acelite/ace/Configuration_Import_Export.h
index e93544bee29..9995d095d83 100644
--- a/dep/acelite/ace/Configuration_Import_Export.h
+++ b/dep/acelite/ace/Configuration_Import_Export.h
@@ -4,7 +4,7 @@
/**
* @file Configuration_Import_Export.h
*
- * $Id: Configuration_Import_Export.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Configuration_Import_Export.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Jerry D. Odenwelder Jr. <jerry.o@mindspring.com>
* Chris Hafey <chris@stentorsoft.com>
@@ -83,12 +83,12 @@ private:
* using the Win32 Registry file export format. This format looks like
* [Section]
* "key"="String Data"
- * "key"=dword: numeric data in hexidecimal format
+ * "key"=dword: numeric data in hexadecimal format
* "key"=hex: binary data
*
* @todo
* - Add dynamic buffer when importing. currently it will not allow
- * importing of values greater than a fixed ammount (4096 bytes)
+ * importing of values greater than a fixed amount (4096 bytes)
*
*/
class ACE_Export ACE_Registry_ImpExp : public ACE_Config_ImpExp_Base
@@ -101,7 +101,7 @@ public:
virtual ~ACE_Registry_ImpExp (void);
/**
- * Imports the configuration database from filename.
+ * Imports the configuration database from @a filename.
* No existing data is removed.
*/
virtual int import_config (const ACE_TCHAR* filename);
@@ -149,7 +149,7 @@ private:
* Justification = left_justified
*
* The caller can then retrieve the string with the regular
- * <get_string_value> function and convert the string to the
+ * get_string_value() function and convert the string to the
* desired data type.
*
* @todo
@@ -157,7 +157,7 @@ private:
* - Strings with embedded quotes " cause the import to fail
* - Importing/exporting for values in the root section does not work
* - Add dynamic buffer when importing. currently it will not allow
- * importing of values greater than a fixed ammount (4096 bytes)
+ * importing of values greater than a fixed amount (4096 bytes)
*/
class ACE_Export ACE_Ini_ImpExp : public ACE_Config_ImpExp_Base
{
@@ -173,7 +173,7 @@ public:
virtual ~ACE_Ini_ImpExp (void);
/**
- * Imports the configuration database from filename.
+ * Imports the configuration database from @a filename.
* No existing data is removed.
*/
virtual int import_config (const ACE_TCHAR* filename);
diff --git a/dep/acelite/ace/Connector.cpp b/dep/acelite/ace/Connector.cpp
index 3a1edfc881a..a8399608ce5 100644
--- a/dep/acelite/ace/Connector.cpp
+++ b/dep/acelite/ace/Connector.cpp
@@ -1,4 +1,4 @@
-// $Id: Connector.cpp 91527 2010-08-27 15:03:31Z shuston $
+// $Id: Connector.cpp 93433 2011-02-23 10:34:01Z vzykov $
#ifndef ACE_CONNECTOR_CPP
#define ACE_CONNECTOR_CPP
@@ -829,7 +829,7 @@ ACE_Strategy_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::open
else if (this->creation_strategy_ == 0)
{
ACE_NEW_RETURN (this->creation_strategy_,
- CREATION_STRATEGY,
+ CREATION_STRATEGY (0, r),
-1);
this->delete_creation_strategy_ = true;
}
@@ -887,7 +887,8 @@ ACE_Strategy_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Strategy_Connecto
ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> *conn_s,
ACE_Concurrency_Strategy<SVC_HANDLER> *con_s,
int flags)
- : creation_strategy_ (0),
+ : base_type (reactor),
+ creation_strategy_ (0),
delete_creation_strategy_ (false),
connect_strategy_ (0),
delete_connect_strategy_ (false),
diff --git a/dep/acelite/ace/Countdown_Time.cpp b/dep/acelite/ace/Countdown_Time.cpp
deleted file mode 100644
index c964ab1138a..00000000000
--- a/dep/acelite/ace/Countdown_Time.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// $Id: Countdown_Time.cpp 91287 2010-08-05 10:30:49Z johnnyw $
-
-#include "ace/Countdown_Time.h"
-#include "ace/OS_NS_sys_time.h"
-
-#if !defined (__ACE_INLINE__)
-#include "ace/Countdown_Time.inl"
-#endif /* __ACE_INLINE__ */
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-ACE_Countdown_Time::ACE_Countdown_Time (ACE_Time_Value *max_wait_time)
- : max_wait_time_ (max_wait_time),
- stopped_ (false)
-{
- this->start ();
-}
-
-ACE_Countdown_Time::~ACE_Countdown_Time (void)
-{
- this->stop ();
-}
-
-void
-ACE_Countdown_Time::start (void)
-{
- if (this->max_wait_time_ != 0)
- {
- this->start_time_ = ACE_OS::gettimeofday ();
- this->stopped_ = false;
- }
-}
-
-void
-ACE_Countdown_Time::stop (void)
-{
- if (this->max_wait_time_ != 0 && !this->stopped_)
- {
- ACE_Time_Value const elapsed_time =
- ACE_OS::gettimeofday () - this->start_time_;
-
- if (elapsed_time >= ACE_Time_Value::zero &&
- *this->max_wait_time_ > elapsed_time)
- {
- *this->max_wait_time_ -= elapsed_time;
- }
- else
- {
- // Used all of timeout.
- *this->max_wait_time_ = ACE_Time_Value::zero;
- // errno = ETIME;
- }
- this->stopped_ = true;
- }
-}
-
-ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Countdown_Time.h b/dep/acelite/ace/Countdown_Time.h
index b9c9a467f62..b63228d606f 100644
--- a/dep/acelite/ace/Countdown_Time.h
+++ b/dep/acelite/ace/Countdown_Time.h
@@ -4,9 +4,10 @@
/**
* @file Countdown_Time.h
*
- * $Id: Countdown_Time.h 85365 2009-05-18 08:27:42Z johnnyw $
+ * $Id: Countdown_Time.h 95332 2011-12-15 11:09:41Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ * @author Irfan Pyarali <irfan@cs.wustl.edu>
*/
//=============================================================================
@@ -15,67 +16,21 @@
#include /**/ "ace/pre.h"
-#include /**/ "ace/ACE_export.h"
-
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/Time_Value.h"
-#include "ace/Copy_Disabled.h"
+#include "ace/Countdown_Time_T.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-/**
- * @class ACE_Countdown_Time
- *
- * @brief Keeps track of the amount of elapsed time.
- *
- * This class has a side-effect on the @c max_wait_time -- every
- * time the stop() method is called the @c max_wait_time is
- * updated.
- */
-class ACE_Export ACE_Countdown_Time : private ACE_Copy_Disabled
-{
-public:
- /// Cache the @a max_wait_time and call @c start().
- ACE_Countdown_Time (ACE_Time_Value *max_wait_time);
-
- /// Destructor, makes sure the max_wait_time that got passed as pointer
- /// to the constructor is updated with the time elapsed.
- ~ACE_Countdown_Time (void);
-
- /// Cache the current time and enter a start state.
- void start (void);
-
- /// Subtract the elapsed time from max_wait_time_ and enter a stopped
- /// state.
- void stop (void);
-
- /// Calls stop and then start. max_wait_time_ is modified by the
- /// call to stop.
- void update (void);
-
- /// Returns true if we've already been stopped, else false.
- bool stopped (void) const;
-
-private:
- /// Maximum time we were willing to wait.
- ACE_Time_Value *max_wait_time_;
-
- /// Beginning of the start time.
- ACE_Time_Value start_time_;
-
- /// Keeps track of whether we've already been stopped.
- bool stopped_;
-};
+// The following typedef is here for ease of use and backward
+// compatibility.
+typedef ACE_Countdown_Time_T<ACE_Default_Time_Policy>
+ ACE_Countdown_Time;
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
-#if defined (__ACE_INLINE__)
-#include "ace/Countdown_Time.inl"
-#endif /* __ACE_INLINE__ */
-
#endif /* ACE_COUNTDOWN_TIME_H */
diff --git a/dep/acelite/ace/Countdown_Time.inl b/dep/acelite/ace/Countdown_Time.inl
deleted file mode 100644
index 4a9eb8e0e43..00000000000
--- a/dep/acelite/ace/Countdown_Time.inl
+++ /dev/null
@@ -1,20 +0,0 @@
-// -*- C++ -*-
-//
-// $Id: Countdown_Time.inl 85368 2009-05-18 10:23:19Z johnnyw $
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-ACE_INLINE bool
-ACE_Countdown_Time::stopped (void) const
-{
- return stopped_;
-}
-
-ACE_INLINE void
-ACE_Countdown_Time::update (void)
-{
- this->stop ();
- this->start ();
-}
-
-ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Countdown_Time_T.cpp b/dep/acelite/ace/Countdown_Time_T.cpp
new file mode 100644
index 00000000000..fd9a466625f
--- /dev/null
+++ b/dep/acelite/ace/Countdown_Time_T.cpp
@@ -0,0 +1,65 @@
+// $Id: Countdown_Time_T.cpp 95332 2011-12-15 11:09:41Z mcorino $
+
+#ifndef ACE_COUNTDOWN_TIME_T_CPP
+#define ACE_COUNTDOWN_TIME_T_CPP
+
+#include "ace/Countdown_Time_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Countdown_Time_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename TIME_POLICY> ACE_INLINE
+ACE_Countdown_Time_T<TIME_POLICY>::ACE_Countdown_Time_T (ACE_Time_Value *max_wait_time,
+ TIME_POLICY const & time_policy)
+ : time_policy_ (time_policy),
+ max_wait_time_ (max_wait_time),
+ stopped_ (false)
+{
+ this->start ();
+}
+
+template <typename TIME_POLICY> ACE_INLINE
+ACE_Countdown_Time_T<TIME_POLICY>::~ACE_Countdown_Time_T (void)
+{
+ this->stop ();
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
+ACE_Countdown_Time_T<TIME_POLICY>::start (void)
+{
+ if (this->max_wait_time_ != 0)
+ {
+ this->start_time_ = this->time_policy_ ();
+ this->stopped_ = false;
+ }
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
+ACE_Countdown_Time_T<TIME_POLICY>::stop (void)
+{
+ if (this->max_wait_time_ != 0 && !this->stopped_)
+ {
+ ACE_Time_Value const elapsed_time =
+ this->time_policy_ () - this->start_time_;
+
+ if (elapsed_time >= ACE_Time_Value::zero &&
+ *this->max_wait_time_ > elapsed_time)
+ {
+ *this->max_wait_time_ -= elapsed_time;
+ }
+ else
+ {
+ // Used all of timeout.
+ *this->max_wait_time_ = ACE_Time_Value::zero;
+ // errno = ETIME;
+ }
+ this->stopped_ = true;
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_COUNTDOWN_TIME_T_CPP */
diff --git a/dep/acelite/ace/Countdown_Time_T.h b/dep/acelite/ace/Countdown_Time_T.h
new file mode 100644
index 00000000000..74de8f27e1c
--- /dev/null
+++ b/dep/acelite/ace/Countdown_Time_T.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Countdown_Time_T.h
+ *
+ * $Id: Countdown_Time_T.h 95345 2011-12-15 19:46:06Z johnnyw $
+ *
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef ACE_COUNTDOWN_TIME_T_H
+#define ACE_COUNTDOWN_TIME_T_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Time_Value.h"
+#include "ace/Time_Policy.h"
+#include "ace/Copy_Disabled.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Countdown_Time
+ *
+ * @brief Keeps track of the amount of elapsed time.
+ *
+ * This class has a side-effect on the @c max_wait_time -- every
+ * time the stop() method is called the @c max_wait_time is
+ * updated.
+ */
+template <typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Countdown_Time_T : private ACE_Copy_Disabled
+{
+public:
+ /// Cache the @a max_wait_time and call @c start().
+ ACE_Countdown_Time_T (ACE_Time_Value *max_wait_time,
+ TIME_POLICY const & time_policy = TIME_POLICY());
+
+ /// Destructor, makes sure the max_wait_time that got passed as pointer
+ /// to the constructor is updated with the time elapsed.
+ ~ACE_Countdown_Time_T (void);
+
+ /// Cache the current time and enter a start state.
+ void start (void);
+
+ /// Subtract the elapsed time from max_wait_time_ and enter a stopped
+ /// state.
+ void stop (void);
+
+ /// Calls stop and then start. max_wait_time_ is modified by the
+ /// call to stop.
+ void update (void);
+
+ /// Returns true if we've already been stopped, else false.
+ bool stopped (void) const;
+
+ /// Allows applications to control how the timer queue gets the time
+ /// of day.
+ void set_time_policy(TIME_POLICY const & time_policy);
+
+private:
+ /// The policy to return the current time of day
+ TIME_POLICY time_policy_;
+
+ /// Maximum time we were willing to wait.
+ ACE_Time_Value *max_wait_time_;
+
+ /// Beginning of the start time.
+ ACE_Time_Value start_time_;
+
+ /// Keeps track of whether we've already been stopped.
+ bool stopped_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#if defined (__ACE_INLINE__)
+#include "ace/Countdown_Time_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "ace/Countdown_Time_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Countdown_Time_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+
+#endif /* ACE_COUNTDOWN_TIME_T_H */
diff --git a/dep/acelite/ace/Countdown_Time_T.inl b/dep/acelite/ace/Countdown_Time_T.inl
new file mode 100644
index 00000000000..3d6e7a2f73d
--- /dev/null
+++ b/dep/acelite/ace/Countdown_Time_T.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id: Countdown_Time_T.inl 95332 2011-12-15 11:09:41Z mcorino $
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename TIME_POLICY> ACE_INLINE bool
+ACE_Countdown_Time_T<TIME_POLICY>::stopped (void) const
+{
+ return stopped_;
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
+ACE_Countdown_Time_T<TIME_POLICY>::update (void)
+{
+ this->stop ();
+ this->start ();
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
+ACE_Countdown_Time_T<TIME_POLICY>::set_time_policy(TIME_POLICY const & time_policy)
+{
+ this->time_policy_ = time_policy;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/DLL.h b/dep/acelite/ace/DLL.h
index 20d333db81a..4b1251eb704 100644
--- a/dep/acelite/ace/DLL.h
+++ b/dep/acelite/ace/DLL.h
@@ -4,7 +4,7 @@
/**
* @file DLL.h
*
- * $Id: DLL.h 91064 2010-07-12 10:11:24Z johnnyw $
+ * $Id: DLL.h 95913 2012-06-21 17:14:36Z johnnyw $
*
* @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
*/
@@ -88,24 +88,37 @@ public:
/**
* This method opens and dynamically links a specified DLL.
- * @param dll_name The filename or path of the DLL to load.
- * If a filename is given to @c open(), the @c ACE::ldfind() is used
- * to locate DLLs via the following algorithms: (1) DLL filename
- * expansion: @c ACE::ldfind() determines the name of the DLL by
- * adding the appropriate prefix and suffix, e.g., it adds the @c lib
- * prefix and @c .so suffix for Solaris and the @c .dll suffix for
- * Windows and (2) DLL search path: @c ACE::ldfind() will also search
- * for the designated DLL using the platform's DLL search path
- * environment variable, e.g., it searches for DLLs using @c
- * LD_LIBRARY_PATH on many UNIX systems and @c PATH on Windows.
+ * @param dll_name The filename or path of the DLL to load. ACE will
+ * attempt to apply the platform's standard library/DLL prefixes
+ * and suffixes, allowing a simple, unadorned name to be passed
+ * regardless of platform. The set of name transforms is listed
+ * below. A @i decorator is a platform's name designator for a debug
+ * vs release build. For example, on Windows it is usually "d".
+ * @li Prefix + name + decorator + suffix
+ * @li Prefix + name + suffix
+ * @li Name + decorator + suffix
+ * @li Name + suffix
+ * @li Name
+ * Note that the transforms with @i decorator will be avoided if
+ * ACE is built with the @c ACE_DISABLE_DEBUG_DLL_CHECK config macro.
+ *
+ * @Note There is another mode for locating library/DLL files that
+ * was used in old versions of ACE. The alternate method builds
+ * more combinations of pathname by combining the names transforms
+ * above with locations listed in the platform's standard "path"
+ * locations (e.g., @c LD_LIBRARY_PATH). It can be enabled by building
+ * ACE with the @c ACE_MUST_HELP_DLOPEN_SEARCH_PATH config macro.
+ * Use of this option is discouraged since it avoids the standard
+ * platform search options and security mechanisms.
+ *
* @param open_mode Flags to alter the actions taken when loading the DLL.
* The possible values are:
* @li @c RTLD_LAZY (this the default): loads identifier symbols but
* not the symbols for functions, which are loaded dynamically
- * on-demand.
+ * on demand.
* @li @c RTLD_NOW: performs all necessary relocations when
* @a dll_name is first loaded
- * @li RTLD_GLOBAL: makes symbols available for relocation
+ * @li @c RTLD_GLOBAL: makes symbols available for relocation
* processing of any other DLLs.
* @param close_handle_on_destruction Indicates whether or not the
* close() method will be called to close an open DLL when this
diff --git a/dep/acelite/ace/DLL_Manager.cpp b/dep/acelite/ace/DLL_Manager.cpp
index 23e6f85520a..ebba7d64add 100644
--- a/dep/acelite/ace/DLL_Manager.cpp
+++ b/dep/acelite/ace/DLL_Manager.cpp
@@ -1,4 +1,4 @@
-// $Id: DLL_Manager.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: DLL_Manager.cpp 95913 2012-06-21 17:14:36Z johnnyw $
#include "ace/DLL_Manager.h"
@@ -415,10 +415,10 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name,
// 3. Build the combinations to try for this platform.
// Try these combinations:
- // - name with decorator and platform's suffix appended (if not supplied)
- // - name with platform's suffix appended (if not supplied)
// - name with platform's dll prefix (if it has one) and suffix
// - name with platform's dll prefix, decorator, and suffix.
+ // - name with decorator and platform's suffix appended (if not supplied)
+ // - name with platform's suffix appended (if not supplied)
// - name as originally given
// We first try to find the file using the decorator so that when a
// filename with and without decorator is used, we get the file with
@@ -443,10 +443,10 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name,
size_t const j = try_names.size ();
switch (i)
{
- case 0: // Name + decorator + suffix
- case 1: // Name + suffix
- case 2: // Prefix + name + decorator + suffix
- case 3: // Prefix + name + suffix
+ case 0: // Prefix + name + decorator + suffix
+ case 1: // Prefix + name + suffix
+ case 2: // Name + decorator + suffix
+ case 3: // Name + suffix
if (
base_suffix.length () > 0
#if !(defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK))
@@ -455,7 +455,7 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name,
)
break;
try_this = base_dir;
- if (i > 1)
+ if (i < 2)
try_this += prefix;
try_this += base_file;
if (base_suffix.length () > 0)
diff --git a/dep/acelite/ace/DLL_Manager.h b/dep/acelite/ace/DLL_Manager.h
index 716e3299557..71d8f13c579 100644
--- a/dep/acelite/ace/DLL_Manager.h
+++ b/dep/acelite/ace/DLL_Manager.h
@@ -4,7 +4,7 @@
/**
* @file DLL_Manager.h
*
- * $Id: DLL_Manager.h 91064 2010-07-12 10:11:24Z johnnyw $
+ * $Id: DLL_Manager.h 95913 2012-06-21 17:14:36Z johnnyw $
*
* @author Don Hinton <dhinton@ieee.org>
*/
@@ -68,14 +68,44 @@ public:
const ACE_TCHAR *dll_name () const;
/**
- * This method opens and dynamically links @a dll_name. The default
- * mode is @c RTLD_LAZY, which loads identifier symbols but not the
- * symbols for functions, which are loaded dynamically on-demand.
- * Other supported modes include: @c RTLD_NOW, which performs all
- * necessary relocations when @a dll_name is first loaded and
- * @c RTLD_GLOBAL, which makes symbols available for relocation
- * processing of any other DLLs. Returns -1 on failure and 0 on
- * success.
+ * This method opens and dynamically links a library/DLL.
+ * @param dll_name The filename or path of the DLL to load. ACE will
+ * attempt to apply the platform's standard library/DLL prefixes
+ * and suffixes, allowing a simple, unadorned name to be passed
+ * regardless of platform. The set of name transforms is listed
+ * below. A @i decorator is a platform's name designator for a debug
+ * vs release build. For example, on Windows it is usually "d".
+ * @li Prefix + name + decorator + suffix
+ * @li Prefix + name + suffix
+ * @li Name + decorator + suffix
+ * @li Name + suffix
+ * @li Name
+ * Note that the transforms with @i decorator will be avoided if
+ * ACE is built with the @c ACE_DISABLE_DEBUG_DLL_CHECK config macro.
+ *
+ * @Note There is another mode for locating library/DLL files that
+ * was used in old versions of ACE. The alternate method builds
+ * more combinations of pathname by combining the names transforms
+ * above with locations listed in the platform's standard "path"
+ * locations (e.g., @c LD_LIBRARY_PATH). It can be enabled by building
+ * ACE with the @c ACE_MUST_HELP_DLOPEN_SEARCH_PATH config macro.
+ * Use of this option is discouraged since it avoids the standard
+ * platform search options and security mechanisms.
+ *
+ * @param open_mode Flags to alter the actions taken when loading the DLL.
+ * The possible values are:
+ * @li @c RTLD_LAZY (this the default): loads identifier symbols but
+ * not the symbols for functions, which are loaded dynamically
+ * on demand.
+ * @li @c RTLD_NOW: performs all necessary relocations when
+ * @a dll_name is first loaded
+ * @li @c RTLD_GLOBAL: makes symbols available for relocation
+ * processing of any other DLLs.
+ * @param handle If a value other than @c ACE_INVALID_HANDLE is supplied,
+ * this object is assigned the specified handle instead of attempting
+ * to open the specified @a dll_name.
+ * @retval -1 On failure
+ * @retval 0 On success.
*/
int open (const ACE_TCHAR *dll_name,
int open_mode,
diff --git a/dep/acelite/ace/Default_Constants.h b/dep/acelite/ace/Default_Constants.h
index c21c776eaa4..c15b7f9f40b 100644
--- a/dep/acelite/ace/Default_Constants.h
+++ b/dep/acelite/ace/Default_Constants.h
@@ -4,7 +4,7 @@
/**
* @file Default_Constants.h
*
- * $Id: Default_Constants.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Default_Constants.h 95517 2012-01-30 10:05:01Z sma $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -392,7 +392,7 @@
/// Max udp packet size
#if !defined (ACE_MAX_UDP_PACKET_SIZE)
-#define ACE_MAX_UDP_PACKET_SIZE 65536
+#define ACE_MAX_UDP_PACKET_SIZE 65507
#endif
/**
diff --git a/dep/acelite/ace/Dev_Poll_Reactor.cpp b/dep/acelite/ace/Dev_Poll_Reactor.cpp
index 5f18064ecbe..011fe7883a2 100644
--- a/dep/acelite/ace/Dev_Poll_Reactor.cpp
+++ b/dep/acelite/ace/Dev_Poll_Reactor.cpp
@@ -1,4 +1,4 @@
-// $Id: Dev_Poll_Reactor.cpp 92199 2010-10-11 11:58:35Z johnnyw $
+// $Id: Dev_Poll_Reactor.cpp 95738 2012-05-11 19:16:53Z shuston $
#include "ace/OS_NS_errno.h"
#include "ace/Dev_Poll_Reactor.h"
@@ -12,13 +12,13 @@
# include "ace/OS_NS_stropts.h"
# if defined (ACE_HAS_DEV_POLL)
-# if defined (linux)
+# if defined (ACE_LINUX)
# include /**/ <linux/devpoll.h>
# elif defined (HPUX_VERS) && HPUX_VERS < 1123
# include /**/ <devpoll.h>
# else
# include /**/ <sys/devpoll.h>
-# endif /* linux */
+# endif /* ACE_LINUX */
# endif /* ACE_HAS_DEV_POLL */
#if !defined (__ACE_INLINE__)
@@ -39,6 +39,7 @@
#include "ace/Guard_T.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_sys_time.h"
+#include "ace/Functor_T.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -801,12 +802,13 @@ ACE_Dev_Poll_Reactor::timer_queue (ACE_Timer_Queue *tq)
{
if (this->delete_timer_queue_)
delete this->timer_queue_;
+ else if (this->timer_queue_)
+ this->timer_queue_->close ();
this->timer_queue_ = tq;
this->delete_timer_queue_ = false;
return 0;
-
}
ACE_Timer_Queue *
@@ -858,6 +860,11 @@ ACE_Dev_Poll_Reactor::close (void)
this->timer_queue_ = 0;
this->delete_timer_queue_ = false;
}
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ this->timer_queue_ = 0;
+ }
if (this->notify_handler_ != 0)
this->notify_handler_->close ();
@@ -1007,7 +1014,10 @@ ACE_Dev_Poll_Reactor::handle_events (ACE_Time_Value *max_wait_time)
return result;
if (this->deactivated_)
- return -1;
+ {
+ errno = ESHUTDOWN;
+ return -1;
+ }
// Update the countdown to reflect time waiting for the mutex.
ACE_MT (countdown.update ());
@@ -1087,37 +1097,10 @@ ACE_Dev_Poll_Reactor::dispatch (Token_Guard &guard)
int
ACE_Dev_Poll_Reactor::dispatch_timer_handler (Token_Guard &guard)
{
- if (this->timer_queue_->is_empty ())
- return 0; // Empty timer queue so cannot have any expired timers.
-
- // Get the current time
- ACE_Time_Value cur_time (this->timer_queue_->gettimeofday () +
- this->timer_queue_->timer_skew ());
-
- // Look for a node in the timer queue whose timer <= the present
- // time.
- ACE_Timer_Node_Dispatch_Info info;
- if (this->timer_queue_->dispatch_info (cur_time, info))
- {
- const void *upcall_act = 0;
+ typedef ACE_Member_Function_Command<Token_Guard> Guard_Release;
- // Preinvoke (handles refcount if needed, etc.)
- this->timer_queue_->preinvoke (info, cur_time, upcall_act);
-
- // Release the token before expiration upcall.
- guard.release_token ();
-
- // call the functor
- this->timer_queue_->upcall (info, cur_time);
-
- // Postinvoke (undo refcount if needed, etc.)
- this->timer_queue_->postinvoke (info, cur_time, upcall_act);
-
- // We have dispatched a timer
- return 1;
- }
-
- return 0;
+ Guard_Release release(guard, &Token_Guard::release_token);
+ return this->timer_queue_->expire_single(release);
}
#if 0
@@ -1950,7 +1933,7 @@ ACE_Dev_Poll_Reactor::resumable_handler (void)
{
// @@ Is this correct?
- return 0;
+ return 1;
}
bool
@@ -2395,8 +2378,8 @@ ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle,
// If a handle is closed, epoll removes it from the poll set
// automatically - we may not know about it yet. If that's the
// case, a mod operation will fail with ENOENT. Retry it as
- // an add.
- if (op == EPOLL_CTL_MOD && errno == ENOENT &&
+ // an add. If it's any other failure, just fail outright.
+ if (op != EPOLL_CTL_MOD || errno != ENOENT ||
::epoll_ctl (this->poll_fd_, EPOLL_CTL_ADD, handle, &epev) == -1)
return -1;
}
diff --git a/dep/acelite/ace/Dev_Poll_Reactor.h b/dep/acelite/ace/Dev_Poll_Reactor.h
index 00ae4c21801..b77d8b16a10 100644
--- a/dep/acelite/ace/Dev_Poll_Reactor.h
+++ b/dep/acelite/ace/Dev_Poll_Reactor.h
@@ -4,7 +4,7 @@
/**
* @file Dev_Poll_Reactor.h
*
- * $Id: Dev_Poll_Reactor.h 91462 2010-08-25 20:29:17Z shuston $
+ * $Id: Dev_Poll_Reactor.h 94549 2011-10-03 06:31:27Z johnnyw $
*
* @c /dev/poll (or Linux @c sys_epoll) based Reactor implementation.
*
@@ -563,7 +563,7 @@ public:
ACE_Event_Handler *event_handler,
ACE_Reactor_Mask mask);
- /// Register @a event_handler> with all the @a handles> in the @c
+ /// Register @a event_handler with all the @a handles in the @c
/// Handle_Set.
virtual int register_handler (const ACE_Handle_Set &handles,
ACE_Event_Handler *event_handler,
@@ -815,7 +815,7 @@ public:
/// Wake up all threads waiting in the event loop.
virtual void wakeup_all_threads (void);
- /// Transfers ownership of Reactor_Impl to the new_owner.
+ /// Transfers ownership of Reactor_Impl to the @a new_owner.
/**
* @note There is no need to set the owner of the event loop for the
* ACE_Dev_Poll_Reactor. Multiple threads may invoke the
@@ -828,7 +828,7 @@ public:
/**
* @note There is no need to set the owner of the event loop for the
* ACE_Dev_Poll_Reactor. Multiple threads may invoke the
- * event loop simulataneously. As such, this method is a
+ * event loop simultaneously. As such, this method is a
* no-op.
*/
virtual int owner (ACE_thread_t *owner);
@@ -1123,7 +1123,7 @@ protected:
/// 2) wait quietly for the token, not waking another thread. This
/// is appropriate for cases where a thread wants to wait for and
/// dispatch an event, not causing an existing waiter to relinquish the
- /// token, and also queueing up behind other threads waiting to modify
+ /// token, and also queuing up behind other threads waiting to modify
/// event records.
int acquire_quietly (ACE_Time_Value *max_wait = 0);
diff --git a/dep/acelite/ace/Dump.h b/dep/acelite/ace/Dump.h
index 4ccd64adb95..fc1eca06dcd 100644
--- a/dep/acelite/ace/Dump.h
+++ b/dep/acelite/ace/Dump.h
@@ -4,7 +4,7 @@
/**
* @file Dump.h
*
- * $Id: Dump.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Dump.h 94034 2011-05-09 19:11:03Z johnnyw $
*
*
* A prototype mechanism that allow all ACE objects to be registered
@@ -149,7 +149,7 @@ private:
/// and we'll have to check for that).
const ACE_Dumpable_Ptr dumper_;
- Tuple (void) : dumper_(0) {}
+ Tuple (void) : this_ (0), dumper_(0) {}
};
/// Singleton instance of this class.
diff --git a/dep/acelite/ace/Dynamic_Message_Strategy.h b/dep/acelite/ace/Dynamic_Message_Strategy.h
index 090ad3a8f82..5ff102ef6ce 100644
--- a/dep/acelite/ace/Dynamic_Message_Strategy.h
+++ b/dep/acelite/ace/Dynamic_Message_Strategy.h
@@ -4,7 +4,7 @@
/**
* @file Dynamic_Message_Strategy.h
*
- * $Id: Dynamic_Message_Strategy.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Dynamic_Message_Strategy.h 95839 2012-06-07 10:13:33Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -43,17 +43,15 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* priority field of 10 bits. This corresponds to the initial
* values of the static class members. To provide a different
* partitioning, assign a different set of values to the static
- * class memebers before using the static member functions.
+ * class members before using the static member functions.
*/
class ACE_Export ACE_Dynamic_Message_Strategy
{
public:
- // = Message priority status
-
- // Values are defined as bit flags so that status combinations may
- // be specified easily.
-
+ /// Message priority status
+ /// Values are defined as bit flags so that status combinations may
+ /// be specified easily.
enum Priority_Status
{
/// Message can still make its deadline
@@ -154,13 +152,13 @@ protected:
class ACE_Export ACE_Deadline_Message_Strategy : public ACE_Dynamic_Message_Strategy
{
public:
- /// Ctor, with all arguments defaulted.
+ /// Constructor with all arguments defaulted.
ACE_Deadline_Message_Strategy (unsigned long static_bit_field_mask = 0x3FFUL, // 2^(10) - 1
unsigned long static_bit_field_shift = 10, // 10 low order bits
unsigned long dynamic_priority_max = 0x3FFFFFUL, // 2^(22)-1
unsigned long dynamic_priority_offset = 0x200000UL); // 2^(22-1)
- /// Virtual dtor.
+ /// Virtual destructor.
virtual ~ACE_Deadline_Message_Strategy (void);
/// Dynamic priority conversion function based on time to deadline.
diff --git a/dep/acelite/ace/ETCL/ETCL_Constraint.cpp b/dep/acelite/ace/ETCL/ETCL_Constraint.cpp
new file mode 100644
index 00000000000..638f7c50984
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Constraint.cpp
@@ -0,0 +1,655 @@
+// -*- C++ -*-
+// $Id: ETCL_Constraint.cpp 92173 2010-10-07 12:36:17Z olli $
+
+#include "ace/ACE.h"
+
+#include "ace/ETCL/ETCL_Constraint.h"
+#include "ace/ETCL/ETCL_Constraint_Visitor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "ace/ETCL/ETCL_Constraint.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ETCL_Constraint::ETCL_Constraint (void)
+{
+}
+
+ETCL_Constraint::~ETCL_Constraint (void)
+{
+}
+
+int
+ETCL_Constraint::accept (ETCL_Constraint_Visitor * /* visitor */)
+{
+ return 0;
+}
+
+// ****************************************************************
+
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (
+ const ETCL_Literal_Constraint & lit
+ )
+ : ETCL_Constraint(),
+ type_ (ACE_ETCL_UNKNOWN)
+{
+ this->copy (lit);
+}
+
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (
+ ACE_CDR::ULong uinteger) : type_ (ACE_ETCL_UNSIGNED)
+{
+ this->op_.uinteger_ = uinteger;
+}
+
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (
+ ACE_CDR::Long integer) : type_ (ACE_ETCL_SIGNED)
+{
+ this->op_.integer_ = integer;
+}
+
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (
+ ACE_CDR::Boolean boolean
+ )
+ : type_ (ACE_ETCL_BOOLEAN)
+{
+ this->op_.bool_ = boolean;
+}
+
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (
+ ACE_CDR::Double doub) : type_ (ACE_ETCL_DOUBLE)
+{
+ this->op_.double_ = doub;
+}
+
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (
+ const char* str) : type_ (ACE_ETCL_STRING)
+{
+ this->op_.str_ = ACE::strnew (str);
+}
+
+ETCL_Literal_Constraint::~ETCL_Literal_Constraint (void)
+{
+ if (this->type_ == ACE_ETCL_STRING)
+ {
+ ACE::strdelete (this->op_.str_);
+ }
+}
+
+int
+ETCL_Literal_Constraint::accept (ETCL_Constraint_Visitor* visitor)
+{
+ return visitor->visit_literal (this);
+}
+
+Literal_Type
+ETCL_Literal_Constraint::expr_type (void) const
+{
+ return this->type_;
+}
+
+void
+ETCL_Literal_Constraint::operator= (const ETCL_Literal_Constraint& co)
+{
+ this->copy (co);
+}
+
+ETCL_Literal_Constraint::operator ACE_CDR::Boolean (void) const
+{
+ return (this->type_ == ACE_ETCL_BOOLEAN) ? this->op_.bool_ : false;
+}
+
+ETCL_Literal_Constraint::operator ACE_CDR::ULong (void) const
+{
+ switch (this->type_)
+ {
+ case ACE_ETCL_UNSIGNED:
+ return this->op_.uinteger_;
+ case ACE_ETCL_SIGNED:
+ case ACE_ETCL_INTEGER:
+ return
+ (this->op_.integer_ > 0) ? (ACE_CDR::ULong) this->op_.integer_ : 0;
+ case ACE_ETCL_DOUBLE:
+ return
+ (this->op_.double_ > 0) ?
+ ((this->op_.double_ > ACE_UINT32_MAX) ?
+ ACE_UINT32_MAX :
+ (ACE_CDR::ULong) this->op_.double_)
+ : 0;
+ default:
+ return 0;
+ }
+}
+
+ETCL_Literal_Constraint::operator ACE_CDR::Long (void) const
+{
+ switch (this->type_)
+ {
+ case ACE_ETCL_SIGNED:
+ case ACE_ETCL_INTEGER:
+ return this->op_.integer_;
+ case ACE_ETCL_UNSIGNED:
+ return
+ (this->op_.uinteger_ > (ACE_CDR::ULong) ACE_INT32_MAX) ?
+ ACE_INT32_MAX : (ACE_CDR::Long) this->op_.uinteger_;
+ case ACE_ETCL_DOUBLE:
+ return
+ (this->op_.double_ > 0) ?
+ ((this->op_.double_ > ACE_INT32_MAX) ?
+ ACE_INT32_MAX :
+ (ACE_CDR::Long) this->op_.double_) :
+ ((this->op_.double_ < ACE_INT32_MIN) ?
+ ACE_INT32_MIN :
+ (ACE_CDR::Long) this->op_.double_);
+ default:
+ return 0;
+ }
+}
+
+ETCL_Literal_Constraint::operator ACE_CDR::Double (void) const
+{
+ switch (this->type_)
+ {
+ case ACE_ETCL_DOUBLE:
+ return this->op_.double_;
+ case ACE_ETCL_SIGNED:
+ case ACE_ETCL_INTEGER:
+ return (ACE_CDR::Double) this->op_.integer_;
+ case ACE_ETCL_UNSIGNED:
+ return (ACE_CDR::Double) this->op_.uinteger_;
+ default:
+ return 0.0;
+ }
+}
+
+ETCL_Literal_Constraint::operator const char* (void) const
+{
+ switch (this->type_)
+ {
+ case ACE_ETCL_STRING:
+ return this->op_.str_;
+ default:
+ return 0;
+ }
+}
+
+bool
+ETCL_Literal_Constraint::operator== (const ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) == 0);
+ break;
+ case ACE_ETCL_DOUBLE:
+ return_value = ACE::is_equal ((ACE_CDR::Double) *this, (ACE_CDR::Double) rhs);
+ break;
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ return_value = (ACE_CDR::Long) *this == (ACE_CDR::Long) rhs;
+ break;
+ case ACE_ETCL_UNSIGNED:
+ return_value = (ACE_CDR::ULong) *this == (ACE_CDR::ULong) rhs;
+ break;
+ case ACE_ETCL_BOOLEAN:
+ return_value = (ACE_CDR::Boolean) *this == (ACE_CDR::Boolean) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+ETCL_Literal_Constraint::operator< (const ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) < 0);
+ break;
+ case ACE_ETCL_DOUBLE:
+ return_value = (ACE_CDR::Double) *this < (ACE_CDR::Double) rhs;
+ break;
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ return_value = (ACE_CDR::Long) *this < (ACE_CDR::Long) rhs;
+ break;
+ case ACE_ETCL_UNSIGNED:
+ return_value = (ACE_CDR::ULong) *this < (ACE_CDR::ULong) rhs;
+ break;
+ case ACE_ETCL_BOOLEAN:
+ return_value = (ACE_CDR::Boolean) *this < (ACE_CDR::Boolean) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+ETCL_Literal_Constraint::operator> (const ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) > 0);
+ break;
+ case ACE_ETCL_DOUBLE:
+ return_value = (ACE_CDR::Double) *this > (ACE_CDR::Double) rhs;
+ break;
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ return_value = (ACE_CDR::Long) *this > (ACE_CDR::Long) rhs;
+ break;
+ case ACE_ETCL_UNSIGNED:
+ return_value = (ACE_CDR::ULong) *this > (ACE_CDR::ULong) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+ETCL_Literal_Constraint
+ETCL_Literal_Constraint::operator+ (const ETCL_Literal_Constraint & rhs)
+{
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_DOUBLE:
+ {
+ ACE_CDR::Double result = (ACE_CDR::Double) *this + (ACE_CDR::Double) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Double) result);
+ }
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ {
+ ACE_CDR::Long result = (ACE_CDR::Long) *this + (ACE_CDR::Long) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) result);
+ }
+ case ACE_ETCL_UNSIGNED:
+ {
+ ACE_CDR::ULong result = (ACE_CDR::ULong) *this + (ACE_CDR::ULong) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::ULong) result);
+ }
+ default:
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) 0);
+ }
+}
+
+ETCL_Literal_Constraint
+ETCL_Literal_Constraint::operator- (const ETCL_Literal_Constraint & rhs)
+{
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_DOUBLE:
+ {
+ ACE_CDR::Double result = (ACE_CDR::Double) *this - (ACE_CDR::Double) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Double) result);
+ }
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ {
+ ACE_CDR::Long result = (ACE_CDR::Long) *this - (ACE_CDR::Long) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) result);
+ }
+ case ACE_ETCL_UNSIGNED:
+ {
+ ACE_CDR::ULong result = (ACE_CDR::ULong) *this - (ACE_CDR::ULong) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::ULong) result);
+ }
+ default:
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) 0);
+ }
+}
+
+ETCL_Literal_Constraint
+ETCL_Literal_Constraint::operator* (const ETCL_Literal_Constraint & rhs)
+{
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_DOUBLE:
+ {
+ ACE_CDR::Double result = (ACE_CDR::Double) *this * (ACE_CDR::Double) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Double) result);
+ }
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ {
+ ACE_CDR::Long result = (ACE_CDR::Long) *this * (ACE_CDR::Long) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) result);
+ }
+ case ACE_ETCL_UNSIGNED:
+ {
+ ACE_CDR::ULong result = (ACE_CDR::ULong) *this * (ACE_CDR::ULong) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::ULong) result);
+ }
+ default:
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) 0);
+ }
+}
+
+ETCL_Literal_Constraint
+ETCL_Literal_Constraint::operator/ (const ETCL_Literal_Constraint & rhs)
+{
+ Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case ACE_ETCL_DOUBLE:
+ {
+ if (ACE::is_equal ((ACE_CDR::Double) rhs, 0.0))
+ return ETCL_Literal_Constraint ((ACE_CDR::Double) 0.0);
+
+ ACE_CDR::Double result = (ACE_CDR::Double) *this / (ACE_CDR::Double) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Double) result);
+ }
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ {
+ if ((ACE_CDR::Long) rhs == 0)
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) 0);
+
+ ACE_CDR::Long result = (ACE_CDR::Long) *this / (ACE_CDR::Long) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) result);
+ }
+ case ACE_ETCL_UNSIGNED:
+ {
+ if ((ACE_CDR::ULong) rhs == 0)
+ return ETCL_Literal_Constraint ((ACE_CDR::ULong) 0);
+
+ ACE_CDR::ULong result = (ACE_CDR::ULong) *this / (ACE_CDR::ULong) rhs;
+ return ETCL_Literal_Constraint ((ACE_CDR::ULong) result);
+ }
+ default:
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) 0);
+ }
+}
+
+ETCL_Literal_Constraint
+ETCL_Literal_Constraint::operator- (void)
+{
+ switch (this->type_)
+ {
+ case ACE_ETCL_DOUBLE:
+ return ETCL_Literal_Constraint (- this->op_.double_);
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ return ETCL_Literal_Constraint (- this->op_.integer_);
+ case ACE_ETCL_UNSIGNED:
+ return ETCL_Literal_Constraint (- (ACE_CDR::Long) this->op_.uinteger_);
+ default:
+ return ETCL_Literal_Constraint ((ACE_CDR::Long) 0);
+ }
+}
+
+Literal_Type
+ETCL_Literal_Constraint::widest_type (const ETCL_Literal_Constraint & rhs)
+{
+ Literal_Type rhs_type = rhs.expr_type ();
+ Literal_Type return_value = rhs_type;
+
+ if (rhs_type != this->type_)
+ {
+ if (rhs_type > this->type_)
+ {
+ return_value = rhs_type;
+ }
+ else
+ {
+ return_value = this->type_;
+ }
+ }
+
+ return return_value;
+}
+
+void
+ETCL_Literal_Constraint::copy (const ETCL_Literal_Constraint &lit)
+{
+ if (this->type_ == ACE_ETCL_STRING)
+ {
+ ACE::strdelete (this->op_.str_);
+ }
+
+ this->type_ = lit.type_;
+
+ switch (this->type_)
+ {
+ case ACE_ETCL_STRING:
+ this->op_.str_ = ACE::strnew (lit.op_.str_);
+ break;
+ case ACE_ETCL_DOUBLE:
+ this->op_.double_ = lit.op_.double_;
+ break;
+ case ACE_ETCL_UNSIGNED:
+ this->op_.uinteger_ = lit.op_.uinteger_;
+ break;
+ case ACE_ETCL_INTEGER:
+ case ACE_ETCL_SIGNED:
+ this->op_.integer_ = lit.op_.integer_;
+ break;
+ case ACE_ETCL_BOOLEAN:
+ this->op_.bool_ = lit.op_.bool_;
+ break;
+ default:
+ this->type_ = ACE_ETCL_UNKNOWN;
+ break;
+ }
+}
+
+// ****************************************************************
+
+int
+ETCL_Identifier::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_identifier (this);
+}
+
+// ****************************************************************
+
+ETCL_Union_Value::~ETCL_Union_Value (void)
+{
+ delete this->string_;
+ delete this->integer_;
+}
+
+int
+ETCL_Union_Value::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_union_value (this);
+}
+
+// ****************************************************************
+
+ETCL_Union_Pos::~ETCL_Union_Pos (void)
+{
+ delete this->component_;
+ delete this->union_value_;
+}
+
+int
+ETCL_Union_Pos::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_union_pos (this);
+}
+
+// ****************************************************************
+
+ETCL_Component_Pos::~ETCL_Component_Pos (void)
+{
+ delete this->component_;
+ delete this->integer_;
+}
+
+int
+ETCL_Component_Pos::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component_pos (this);
+}
+
+// ****************************************************************
+
+ETCL_Component_Assoc::~ETCL_Component_Assoc (void)
+{
+ delete this->component_;
+ delete this->identifier_;
+}
+
+int
+ETCL_Component_Assoc::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component_assoc (this);
+}
+
+// ****************************************************************
+
+ETCL_Component_Array::~ETCL_Component_Array (void)
+{
+ delete this->component_;
+ delete this->integer_;
+}
+
+int
+ETCL_Component_Array::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component_array (this);
+}
+
+// ****************************************************************
+
+ETCL_Special::~ETCL_Special (void)
+{}
+
+int
+ETCL_Special::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_special (this);
+}
+
+// ****************************************************************
+
+ETCL_Component::~ETCL_Component (void)
+{
+ delete this->component_;
+ delete this->identifier_;
+}
+
+int
+ETCL_Component::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component (this);
+}
+
+// ****************************************************************
+
+ETCL_Dot::~ETCL_Dot (void)
+{
+ delete this->component_;
+}
+
+int
+ETCL_Dot::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_dot (this);
+}
+
+// ****************************************************************
+
+ETCL_Eval::~ETCL_Eval (void)
+{
+ delete this->component_;
+}
+
+int
+ETCL_Eval::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_eval (this);
+}
+
+// ****************************************************************
+
+ETCL_Default::~ETCL_Default (void)
+{
+ delete this->component_;
+}
+
+int
+ETCL_Default::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_default (this);
+}
+
+// ****************************************************************
+
+ETCL_Exist::~ETCL_Exist (void)
+{
+ delete this->component_;
+}
+
+int
+ETCL_Exist::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_exist (this);
+}
+
+// ****************************************************************
+
+ETCL_Unary_Expr::~ETCL_Unary_Expr (void)
+{
+ delete this->subexpr_;
+}
+
+int
+ETCL_Unary_Expr::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_unary_expr (this);
+}
+
+// ****************************************************************
+
+ETCL_Binary_Expr::~ETCL_Binary_Expr (void)
+{
+ delete this->lhs_;
+ delete this->rhs_;
+}
+
+int
+ETCL_Binary_Expr::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_binary_expr (this);
+}
+
+// ****************************************************************
+
+ETCL_Preference::~ETCL_Preference (void)
+{
+ delete this->subexpr_;
+}
+
+int
+ETCL_Preference::accept (ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_preference (this);
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/ETCL/ETCL_Constraint.h b/dep/acelite/ace/ETCL/ETCL_Constraint.h
new file mode 100644
index 00000000000..0762d190880
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Constraint.h
@@ -0,0 +1,416 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ETCL_Constraint.h
+ *
+ * $Id: ETCL_Constraint.h 94030 2011-05-08 17:58:47Z johnnyw $
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Jeff Parsons (j.parsons@vanderbilt.edu)
+ */
+//=============================================================================
+
+#ifndef ACE_ETCL_CONSTRAINT_H
+#define ACE_ETCL_CONSTRAINT_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/CDR_Base.h"
+
+#include "ace/ETCL/ace_etcl_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef unsigned long Literal_Type;
+
+class ETCL_Constraint_Visitor;
+
+class ACE_ETCL_Export ETCL_Constraint
+{
+public:
+ /// Constructor and destructor
+ ETCL_Constraint (void);
+ virtual ~ETCL_Constraint (void);
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+protected:
+ enum
+ {
+ ACE_ETCL_STRING,
+ ACE_ETCL_DOUBLE,
+ ACE_ETCL_UNSIGNED,
+ ACE_ETCL_SIGNED,
+ ACE_ETCL_INTEGER,
+ ACE_ETCL_BOOLEAN,
+ ACE_ETCL_COMPONENT,
+ ACE_ETCL_UNKNOWN
+ };
+};
+
+// ****************************************************************
+
+class ACE_ETCL_Export ETCL_Literal_Constraint
+ : public ETCL_Constraint
+{
+public:
+ ETCL_Literal_Constraint (void);
+
+ // = Constructors for each of the various types of literals.
+
+ explicit ETCL_Literal_Constraint (ACE_CDR::ULong uinteger);
+ explicit ETCL_Literal_Constraint (ACE_CDR::Long integer);
+ explicit ETCL_Literal_Constraint (ACE_CDR::Boolean boolean);
+ explicit ETCL_Literal_Constraint (ACE_CDR::Double doub);
+ explicit ETCL_Literal_Constraint (const char* str);
+
+ /// Copy constructor
+ ETCL_Literal_Constraint (const ETCL_Literal_Constraint& lit);
+
+ /// Destructor.
+ virtual ~ETCL_Literal_Constraint(void);
+
+ /// Visitor accept method.
+ virtual int accept (ETCL_Constraint_Visitor* visitor);
+
+ Literal_Type expr_type (void) const;
+
+ /// Assignment operator.
+ void operator= (const ETCL_Literal_Constraint& co);
+
+ // Conversion routines.
+ operator ACE_CDR::Boolean (void) const;
+ operator ACE_CDR::ULong (void) const;
+ operator ACE_CDR::Long (void) const;
+ operator ACE_CDR::Double (void) const;
+ operator const char* (void) const;
+
+ // Return the type represented by this MysteryOperand.
+
+ // = Boolean operators.
+
+ bool
+ operator< (const ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator<= (const ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator> (const ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator>= (const ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator== (const ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator!= (const ETCL_Literal_Constraint& rhs);
+
+ // = Arithmetic operators.
+
+ ETCL_Literal_Constraint
+ operator+ (const ETCL_Literal_Constraint& rhs);
+
+ ETCL_Literal_Constraint
+ operator- (const ETCL_Literal_Constraint& rhs);
+
+ ETCL_Literal_Constraint
+ operator* (const ETCL_Literal_Constraint& rhs);
+
+ ETCL_Literal_Constraint
+ operator/ (const ETCL_Literal_Constraint& rhs);
+
+ // Unary minus.
+ ETCL_Literal_Constraint
+ operator- (void);
+
+ /// Ensure both operands are of the same simple numeric type.
+ virtual Literal_Type
+ widest_type (const ETCL_Literal_Constraint& rhs);
+
+protected:
+ /// Private copy method.
+ void copy (const ETCL_Literal_Constraint& co);
+
+ /// Union of the possible literal types.
+ union
+ {
+ char* str_;
+ ACE_CDR::ULong uinteger_;
+ ACE_CDR::Long integer_;
+ ACE_CDR::Boolean bool_;
+ ACE_CDR::Double double_;
+ } op_;
+
+ /// The actual types of the ETCL_Literal_Constraint.
+ Literal_Type type_;
+};
+
+// ****************************************************************
+
+class ACE_ETCL_Export ETCL_Identifier : public ETCL_Constraint
+{
+public:
+ ETCL_Identifier (const char *value);
+
+ /// Get the value
+ const char *value (void) const;
+
+ // = The Constraint methods.
+ int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ /// The value
+ ACE_CString string_;
+};
+
+// ****************************************************************
+
+class ACE_ETCL_Export ETCL_Union_Value : public ETCL_Constraint
+{
+public:
+ ETCL_Union_Value (int sign,
+ ETCL_Constraint *integer);
+ explicit ETCL_Union_Value (ETCL_Constraint *string = 0);
+ virtual ~ETCL_Union_Value (void);
+
+ int sign (void) const;
+ ETCL_Literal_Constraint *integer (void) const;
+ ETCL_Literal_Constraint *string (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ int sign_;
+ ETCL_Literal_Constraint *integer_;
+ ETCL_Literal_Constraint *string_;
+};
+
+class ACE_ETCL_Export ETCL_Union_Pos : public ETCL_Constraint
+{
+public:
+ ETCL_Union_Pos (ETCL_Constraint *union_value = 0,
+ ETCL_Constraint *component = 0);
+ virtual ~ETCL_Union_Pos (void);
+
+ ETCL_Union_Value *union_value (void) const;
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Union_Value *union_value_;
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Component_Pos : public ETCL_Constraint
+{
+public:
+ ETCL_Component_Pos (ETCL_Constraint *integer = 0,
+ ETCL_Constraint *component = 0);
+ virtual ~ETCL_Component_Pos (void);
+
+ ETCL_Literal_Constraint *integer (void) const;
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Literal_Constraint *integer_;
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Component_Assoc : public ETCL_Constraint
+{
+public:
+ ETCL_Component_Assoc (ETCL_Constraint *identifier = 0,
+ ETCL_Constraint *component = 0);
+ virtual ~ETCL_Component_Assoc (void);
+
+ ETCL_Identifier *identifier (void) const;
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Identifier *identifier_;
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Component_Array : public ETCL_Constraint
+{
+public:
+ ETCL_Component_Array (ETCL_Constraint *integer = 0,
+ ETCL_Constraint *component = 0);
+ virtual ~ETCL_Component_Array (void);
+
+ ETCL_Literal_Constraint *integer (void) const;
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Literal_Constraint *integer_;
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Special : public ETCL_Constraint
+{
+public:
+ ETCL_Special (void);
+ ETCL_Special (int type);
+ virtual ~ETCL_Special (void);
+
+ int type (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+};
+
+class ACE_ETCL_Export ETCL_Component : public ETCL_Constraint
+{
+public:
+ ETCL_Component (ETCL_Constraint *identifier = 0,
+ ETCL_Constraint *component = 0);
+ virtual ~ETCL_Component (void);
+
+ ETCL_Identifier *identifier (void) const;
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Identifier *identifier_;
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Dot : public ETCL_Constraint
+{
+public:
+ explicit ETCL_Dot (ETCL_Constraint *component = 0);
+ virtual ~ETCL_Dot (void);
+
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Eval : public ETCL_Constraint
+{
+public:
+ explicit ETCL_Eval (ETCL_Constraint *component = 0);
+ virtual ~ETCL_Eval (void);
+
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Default : public ETCL_Constraint
+{
+public:
+ explicit ETCL_Default (ETCL_Constraint *component = 0);
+ virtual ~ETCL_Default (void);
+
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Exist : public ETCL_Constraint
+{
+public:
+ explicit ETCL_Exist (ETCL_Constraint *component = 0);
+ virtual ~ETCL_Exist (void);
+
+ ETCL_Constraint *component (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ ETCL_Constraint *component_;
+};
+
+class ACE_ETCL_Export ETCL_Unary_Expr : public ETCL_Constraint
+{
+public:
+ ETCL_Unary_Expr (int type,
+ ETCL_Constraint *subexpr);
+ virtual ~ETCL_Unary_Expr (void);
+
+ int type (void) const;
+ ETCL_Constraint *subexpr (void) const;
+
+ int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+ ETCL_Constraint *subexpr_;
+};
+
+class ACE_ETCL_Export ETCL_Binary_Expr : public ETCL_Constraint
+{
+public:
+ ETCL_Binary_Expr (int type,
+ ETCL_Constraint *lhs,
+ ETCL_Constraint *rhs);
+ virtual ~ETCL_Binary_Expr (void);
+
+ int type (void) const;
+ ETCL_Constraint *rhs (void) const;
+ ETCL_Constraint *lhs (void) const;
+
+ int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+ ETCL_Constraint *lhs_;
+ ETCL_Constraint *rhs_;
+};
+
+class ACE_ETCL_Export ETCL_Preference : public ETCL_Constraint
+{
+public:
+ ETCL_Preference (void);
+ ETCL_Preference (int type,
+ ETCL_Constraint *subexpr = 0);
+ virtual ~ETCL_Preference (void);
+
+ int type (void) const;
+ ETCL_Constraint *subexpr (void) const;
+
+ virtual int accept (ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+ ETCL_Constraint *subexpr_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/ETCL/ETCL_Constraint.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif // ACE_ETCL_CONSTRAINT_H
diff --git a/dep/acelite/ace/ETCL/ETCL_Constraint.inl b/dep/acelite/ace/ETCL/ETCL_Constraint.inl
new file mode 100644
index 00000000000..a56cf39aa46
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Constraint.inl
@@ -0,0 +1,349 @@
+// -*- C++ -*-
+// $Id: ETCL_Constraint.inl 95595 2012-03-07 13:33:25Z johnnyw $
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Literal_Constraint::ETCL_Literal_Constraint (void)
+ : type_ (ACE_ETCL_UNKNOWN)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Identifier::ETCL_Identifier (const char *value)
+ : string_ (value)
+{
+}
+
+ACE_INLINE const char *
+ETCL_Identifier::value (void) const
+{
+ return this->string_.c_str ();
+}
+
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Union_Value::ETCL_Union_Value (int sign,
+ ETCL_Constraint *integer)
+ : sign_ (sign),
+ string_ (0)
+{
+ this->integer_ =
+ dynamic_cast<ETCL_Literal_Constraint*> (integer);
+}
+
+ACE_INLINE
+ETCL_Union_Value::ETCL_Union_Value (ETCL_Constraint *string)
+ : sign_ (0),
+ integer_ (0)
+{
+ this->string_ =
+ dynamic_cast<ETCL_Literal_Constraint*> (string);
+}
+
+ACE_INLINE int
+ETCL_Union_Value::sign (void) const
+{
+ return this->sign_;
+}
+
+ACE_INLINE ETCL_Literal_Constraint *
+ETCL_Union_Value::integer (void) const
+{
+ return this->integer_;
+}
+
+ACE_INLINE ETCL_Literal_Constraint *
+ETCL_Union_Value::string (void) const
+{
+ return this->string_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Union_Pos::ETCL_Union_Pos (ETCL_Constraint *union_value,
+ ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->union_value_ =
+ dynamic_cast<ETCL_Union_Value*> (union_value);
+}
+
+ACE_INLINE ETCL_Union_Value *
+ETCL_Union_Pos::union_value (void) const
+{
+ return this->union_value_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Union_Pos::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Component_Pos::ETCL_Component_Pos (
+ ETCL_Constraint *integer,
+ ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->integer_ =
+ dynamic_cast<ETCL_Literal_Constraint*> (integer);
+}
+
+ACE_INLINE ETCL_Literal_Constraint *
+ETCL_Component_Pos::integer (void) const
+{
+ return this->integer_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Component_Pos::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Component_Assoc::ETCL_Component_Assoc (
+ ETCL_Constraint *identifier,
+ ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->identifier_ =
+ dynamic_cast<ETCL_Identifier*> (identifier);
+}
+
+ACE_INLINE ETCL_Identifier *
+ETCL_Component_Assoc::identifier (void) const
+{
+ return this->identifier_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Component_Assoc::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Component_Array::ETCL_Component_Array (
+ ETCL_Constraint *integer,
+ ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->integer_ =
+ dynamic_cast<ETCL_Literal_Constraint*> (integer);
+}
+
+ACE_INLINE ETCL_Literal_Constraint *
+ETCL_Component_Array::integer (void) const
+{
+ return this->integer_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Component_Array::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Special::ETCL_Special (void)
+ : type_ (0)
+{}
+
+ACE_INLINE
+ETCL_Special::ETCL_Special (int type)
+ : type_ (type)
+{}
+
+ACE_INLINE int
+ETCL_Special::type (void) const
+{
+ return this->type_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Component::ETCL_Component (ETCL_Constraint *identifier,
+ ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->identifier_ =
+ dynamic_cast<ETCL_Identifier*> (identifier);
+}
+
+ACE_INLINE ETCL_Identifier *
+ETCL_Component::identifier (void) const
+{
+ return this->identifier_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Component::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Dot::ETCL_Dot (ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Dot::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Eval::ETCL_Eval (ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Eval::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Default::ETCL_Default (ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Default::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Exist::ETCL_Exist (ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Exist::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Unary_Expr::ETCL_Unary_Expr (int type,
+ ETCL_Constraint *subexpr)
+ : type_ (type),
+ subexpr_ (subexpr)
+{}
+
+ACE_INLINE int
+ETCL_Unary_Expr::type (void) const
+{
+ return this->type_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Unary_Expr::subexpr (void) const
+{
+ return this->subexpr_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Binary_Expr::ETCL_Binary_Expr (int type,
+ ETCL_Constraint *lhs,
+ ETCL_Constraint *rhs)
+ : type_ (type),
+ lhs_ (lhs),
+ rhs_ (rhs)
+{}
+
+ACE_INLINE int
+ETCL_Binary_Expr::type (void) const
+{
+ return this->type_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Binary_Expr::rhs (void) const
+{
+ return this->rhs_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Binary_Expr::lhs (void) const
+{
+ return this->lhs_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+ETCL_Preference::ETCL_Preference (void)
+{}
+
+ACE_INLINE
+ETCL_Preference::ETCL_Preference (int type,
+ ETCL_Constraint *subexpr)
+ : type_ (type),
+ subexpr_ (subexpr)
+{}
+
+ACE_INLINE int
+ETCL_Preference::type (void) const
+{
+ return this->type_;
+}
+
+ACE_INLINE ETCL_Constraint *
+ETCL_Preference::subexpr (void) const
+{
+ return this->subexpr_;
+}
+
+ACE_INLINE bool
+ETCL_Literal_Constraint::operator!= (const ETCL_Literal_Constraint & rhs)
+{
+ return !(*this == rhs);
+}
+
+ACE_INLINE bool
+ETCL_Literal_Constraint::operator<= (const ETCL_Literal_Constraint & rhs)
+{
+ return !(*this > rhs);
+}
+
+ACE_INLINE bool
+ETCL_Literal_Constraint::operator>= (const ETCL_Literal_Constraint & rhs)
+{
+ return !(*this < rhs);
+}
diff --git a/dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp b/dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp
new file mode 100644
index 00000000000..66dbd8d09b8
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.cpp
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file ETCL_Constraint_Visitor.cpp
+ *
+ * $Id: ETCL_Constraint_Visitor.cpp 81653 2008-05-08 21:08:49Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#include "ace/ETCL/ETCL_Constraint_Visitor.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ETCL_Constraint_Visitor::~ETCL_Constraint_Visitor (void)
+{
+}
+
+int
+ETCL_Constraint_Visitor::visit_literal (ETCL_Literal_Constraint *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_identifier (ETCL_Identifier *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_union_value (ETCL_Union_Value *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_union_pos (ETCL_Union_Pos *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_component_pos (ETCL_Component_Pos *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_component_assoc (ETCL_Component_Assoc *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_component_array (ETCL_Component_Array *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_special (ETCL_Special *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_component (ETCL_Component *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_dot (ETCL_Dot *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_eval (ETCL_Eval *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_default (ETCL_Default *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_exist (ETCL_Exist *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_unary_expr (ETCL_Unary_Expr *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_binary_expr (ETCL_Binary_Expr *)
+{
+ return 0;
+}
+
+int
+ETCL_Constraint_Visitor::visit_preference (ETCL_Preference *)
+{
+ return 0;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.h b/dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.h
new file mode 100644
index 00000000000..2337f60e8c4
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Constraint_Visitor.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file ETCL_Constraint_Visitor.h
+ *
+ * $Id: ETCL_Constraint_Visitor.h 81653 2008-05-08 21:08:49Z parsons $
+ *
+ * @author Carlos O'Ryan <coryan@cs.wustl.edu>
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef ACE_ETCL_CONSTRAINT_VISITOR_H
+#define ACE_ETCL_CONSTRAINT_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/ETCL/ace_etcl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ETCL_Literal_Constraint;
+class ETCL_Identifier;
+class ETCL_Union_Value;
+class ETCL_Union_Pos;
+class ETCL_Component_Pos;
+class ETCL_Component_Assoc;
+class ETCL_Component_Array;
+class ETCL_Special;
+class ETCL_Component;
+class ETCL_Dot;
+class ETCL_Eval;
+class ETCL_Default;
+class ETCL_Exist;
+class ETCL_Unary_Expr;
+class ETCL_Binary_Expr;
+class ETCL_Preference;
+
+class ACE_ETCL_Export ETCL_Constraint_Visitor
+{
+public:
+ virtual ~ETCL_Constraint_Visitor (void);
+
+ virtual int visit_literal (ETCL_Literal_Constraint *);
+ virtual int visit_identifier (ETCL_Identifier *);
+ virtual int visit_union_value (ETCL_Union_Value *);
+ virtual int visit_union_pos (ETCL_Union_Pos *);
+ virtual int visit_component_pos (ETCL_Component_Pos *);
+ virtual int visit_component_assoc (ETCL_Component_Assoc *);
+ virtual int visit_component_array (ETCL_Component_Array *);
+ virtual int visit_special (ETCL_Special *);
+ virtual int visit_component (ETCL_Component *);
+ virtual int visit_dot (ETCL_Dot *);
+ virtual int visit_eval (ETCL_Eval *);
+ virtual int visit_default (ETCL_Default *);
+ virtual int visit_exist (ETCL_Exist *);
+ virtual int visit_unary_expr (ETCL_Unary_Expr *);
+ virtual int visit_binary_expr (ETCL_Binary_Expr *);
+ virtual int visit_preference (ETCL_Preference *);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // ACE_ETCL_CONSTRAINT_VISITOR_H
diff --git a/dep/acelite/ace/ETCL/ETCL_Interpreter.cpp b/dep/acelite/ace/ETCL/ETCL_Interpreter.cpp
new file mode 100644
index 00000000000..727bd264672
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Interpreter.cpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+// $Id: ETCL_Interpreter.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#include "ace/Guard_T.h"
+#include "ace/Truncate.h"
+
+#include "ace/ETCL/ETCL_Interpreter.h"
+#include "ace/ETCL/ETCL_Constraint.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ETCL_Parser_Export ACE_SYNCH_MUTEX ETCL_Interpreter::parserMutex__;
+
+ETCL_Interpreter::ETCL_Interpreter (void)
+ : root_ (0)
+{
+}
+
+ETCL_Interpreter::~ETCL_Interpreter (void)
+{
+ delete this->root_;
+}
+
+int
+ETCL_Interpreter::build_tree (const char* constraints)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX,
+ guard,
+ ETCL_Interpreter::parserMutex__,
+ -1);
+
+ Lex_String_Input::reset ((char*)constraints);
+
+ yyval.constraint = 0;
+ int return_value = ::yyparse ();
+
+ if (return_value == 0 && yyval.constraint != 0)
+ {
+ this->root_ = yyval.constraint;
+ }
+ else
+ {
+ this->root_ = 0;
+ }
+
+ return return_value;
+}
+
+int
+ETCL_Interpreter::is_empty_string (const char* str)
+{
+ int return_value = 0;
+
+ if (str != 0)
+ {
+ int i = 0;
+
+ while (str[i] != '\0')
+ {
+ if (str[i] != ' ')
+ {
+ break;
+ }
+
+ ++i;
+ }
+
+ if (str[i] == '\0')
+ {
+ return_value = 1;
+ }
+ }
+
+ return return_value;
+}
+
+char* Lex_String_Input::string_ = 0;
+char* Lex_String_Input::current_ = 0;
+char* Lex_String_Input::end_ = 0;
+
+// Routine to have Lex read its input from the constraint string.
+
+int
+Lex_String_Input::copy_into (char* buf,
+ int max_size)
+{
+ int const chars_left =
+ ACE_Utils::truncate_cast<int> (
+ Lex_String_Input::end_ - Lex_String_Input::current_);
+
+ int const n = max_size > chars_left ? chars_left : max_size;
+
+ if (n > 0)
+ {
+ ACE_OS::memcpy (buf,
+ Lex_String_Input::current_,
+ n);
+ Lex_String_Input::current_ += n;
+ }
+
+ return n;
+}
+
+void
+Lex_String_Input::reset (char* input_string)
+{
+ Lex_String_Input::string_ = input_string;
+ Lex_String_Input::current_ = input_string;
+ Lex_String_Input::end_ =
+ input_string + ACE_OS::strlen (Lex_String_Input::string_);
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/ETCL/ETCL_Interpreter.h b/dep/acelite/ace/ETCL/ETCL_Interpreter.h
new file mode 100644
index 00000000000..8553c9b3309
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_Interpreter.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ETCL_Interpreter.h
+ *
+ * $Id: ETCL_Interpreter.h 82434 2008-07-28 11:40:36Z johnnyw $
+ *
+ * @author Jeff Parsons <parsons@cs.wustl.edu> based on previous work by
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef ETCL_INTERPRETER_H
+#define ETCL_INTERPRETER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Thread_Mutex.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Synch_Traits.h"
+
+#include "etcl_parser_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ETCL_Constraint;
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ETCL_Interpreter
+ *
+ * @brief ETCL_Interpreter is the superclass for all ETCL interpreters.
+ * Its build tree method invokes the yacc parser to parse a constraint
+ * or preference string.
+ */
+class ETCL_Parser_Export ETCL_Interpreter
+{
+protected:
+ // = Initialization and termination methods.
+ /// Constructor.
+ ETCL_Interpreter (void);
+
+ /// Destructor.
+ virtual ~ETCL_Interpreter (void);
+
+ /// Using the Yacc generated parser, construct an expression tree
+ /// representing @a constraints from the tokens returned by it.
+ int build_tree (const char* constraints);
+
+ static int is_empty_string (const char* str);
+
+ /// The root of the expression tree, not equal to null if build_tree
+ /// successfully builds a tree from the constraints.
+ ETCL_Constraint* root_;
+private:
+ /// This mutex protects the <build_tree> method from reentrance.
+ static ACE_SYNCH_MUTEX parserMutex__;
+};
+
+
+// Functions we need for parsing.
+extern int yyparse (void);
+extern void yyrestart (FILE*);
+extern int yylex (void);
+
+// Have yylex read from the constraint string, not from stdin.
+#undef YY_INPUT
+#define YY_INPUT(b, r, ms) (r = Lex_String_Input::copy_into(b, ms))
+
+/**
+ * @class Lex_String_Input
+ *
+ * @brief Have Lex read from a string and not from stdin. Essentially,
+ * the interpreter needs to call yylex() until EOF, and call
+ * TAO_Lex_String_Input::reset() with the new string, prior to
+ * calling yyparse.
+ */
+class Lex_String_Input
+{
+public:
+ /// Reset the lex input.
+ static void reset (char* input_string);
+
+ /// Method lex will call to read from the input string.
+ static int copy_into (char* buf, int max_size);
+
+private:
+
+ /// Pointers to keep track of the input string.
+ static char* string_;
+ static char* current_;
+ static char* end_;
+};
+
+/// The union used by lex and bison to build the Abstract Syntax Tree.
+typedef union
+{
+ ACE_VERSIONED_NAMESPACE_NAME::ETCL_Constraint* constraint;
+} YYSTYPE;
+
+extern YYSTYPE yylval;
+extern YYSTYPE yyval;
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // ETCL_INTERPRETER_H
diff --git a/dep/acelite/ace/ETCL/ETCL_l.cpp b/dep/acelite/ace/ETCL/ETCL_l.cpp
new file mode 100644
index 00000000000..ed985de0035
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_l.cpp
@@ -0,0 +1,1877 @@
+
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+#include "ace/ETCL/ETCL_Constraint.h"
+
+#ifdef __cplusplus
+
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_stdio.h"
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+{
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 41
+#define YY_END_OF_BUFFER 42
+static yyconst short int yy_accept[118] =
+ { 0,
+ 0, 0, 42, 40, 39, 41, 40, 24, 40, 22,
+ 23, 14, 12, 13, 25, 15, 35, 16, 40, 18,
+ 38, 38, 38, 31, 40, 32, 40, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 11, 21, 0,
+ 37, 0, 36, 0, 35, 17, 20, 19, 38, 38,
+ 38, 38, 27, 0, 0, 0, 38, 38, 38, 38,
+ 10, 38, 38, 38, 9, 38, 38, 0, 0, 38,
+ 38, 38, 0, 0, 0, 8, 38, 38, 38, 2,
+ 1, 7, 38, 38, 0, 36, 38, 33, 0, 0,
+ 0, 38, 38, 38, 38, 5, 34, 0, 0, 0,
+
+ 38, 6, 3, 38, 0, 0, 0, 38, 4, 30,
+ 0, 0, 26, 0, 28, 29, 0
+ } ;
+
+static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 4, 1, 1, 5, 1, 1, 6, 7,
+ 8, 9, 10, 1, 11, 12, 13, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
+ 16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
+ 19, 19, 19, 19, 19, 22, 19, 19, 19, 19,
+ 19, 23, 24, 25, 26, 19, 19, 19, 19, 19,
+ 27, 28, 29, 1, 30, 1, 31, 19, 19, 32,
+
+ 33, 34, 35, 36, 37, 19, 19, 38, 39, 40,
+ 41, 42, 19, 43, 44, 45, 46, 19, 47, 48,
+ 49, 19, 1, 1, 1, 50, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst int yy_meta[51] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 2, 1, 1, 1, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 1, 1, 1, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 1
+ } ;
+
+static yyconst short int yy_base[122] =
+ { 0,
+ 0, 0, 146, 147, 147, 147, 129, 147, 45, 147,
+ 147, 147, 147, 147, 130, 147, 40, 127, 126, 125,
+ 0, 122, 116, 147, 0, 147, 21, 98, 104, 88,
+ 98, 94, 24, 92, 89, 100, 93, 147, 147, 50,
+ 147, 51, 48, 115, 46, 147, 147, 147, 0, 106,
+ 101, 0, 147, 93, 92, 75, 91, 88, 84, 77,
+ 0, 71, 78, 72, 0, 76, 70, 57, 60, 90,
+ 93, 0, 72, 69, 68, 0, 78, 64, 63, 0,
+ 0, 0, 74, 69, 90, 89, 82, 0, 66, 59,
+ 66, 52, 52, 51, 54, 0, 0, 49, 49, 54,
+
+ 45, 0, 0, 43, 44, 47, 39, 30, 0, 147,
+ 35, 37, 0, 35, 147, 147, 147, 85, 87, 62,
+ 89
+ } ;
+
+static yyconst short int yy_def[122] =
+ { 0,
+ 117, 1, 117, 117, 117, 117, 117, 117, 118, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 119, 119, 119, 117, 120, 117, 117, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 117, 117, 118,
+ 117, 117, 117, 117, 117, 117, 117, 117, 119, 119,
+ 119, 121, 117, 117, 117, 117, 119, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 118, 117, 119,
+ 119, 121, 117, 117, 117, 119, 119, 119, 119, 119,
+ 119, 119, 119, 119, 117, 117, 119, 119, 117, 117,
+ 117, 119, 119, 119, 119, 119, 119, 117, 117, 117,
+
+ 119, 119, 119, 119, 117, 117, 117, 119, 119, 117,
+ 117, 117, 119, 117, 117, 117, 0, 117, 117, 117,
+ 117
+ } ;
+
+static yyconst short int yy_nxt[198] =
+ { 0,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 21, 21,
+ 22, 21, 21, 21, 23, 21, 24, 25, 26, 27,
+ 28, 29, 30, 31, 21, 21, 32, 21, 33, 34,
+ 35, 21, 36, 21, 21, 21, 37, 21, 21, 38,
+ 41, 44, 53, 45, 62, 41, 68, 44, 54, 45,
+ 63, 43, 41, 55, 52, 56, 116, 69, 115, 85,
+ 85, 114, 42, 86, 113, 112, 111, 42, 68, 110,
+ 69, 109, 108, 107, 42, 40, 40, 40, 49, 49,
+ 72, 72, 106, 105, 104, 103, 102, 101, 100, 99,
+
+ 98, 97, 86, 86, 96, 95, 94, 93, 92, 91,
+ 90, 89, 88, 87, 84, 83, 82, 81, 80, 79,
+ 78, 77, 76, 75, 74, 73, 71, 70, 43, 67,
+ 66, 65, 64, 61, 60, 59, 58, 57, 51, 50,
+ 48, 47, 46, 43, 39, 117, 3, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117
+
+ } ;
+
+static yyconst short int yy_chk[198] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 9, 17, 27, 17, 33, 40, 42, 45, 27, 45,
+ 33, 43, 68, 27, 120, 27, 114, 43, 112, 69,
+ 69, 111, 9, 69, 108, 107, 106, 40, 42, 105,
+ 43, 104, 101, 100, 68, 118, 118, 118, 119, 119,
+ 121, 121, 99, 98, 95, 94, 93, 92, 91, 90,
+
+ 89, 87, 86, 85, 84, 83, 79, 78, 77, 75,
+ 74, 73, 71, 70, 67, 66, 64, 63, 62, 60,
+ 59, 58, 57, 56, 55, 54, 51, 50, 44, 37,
+ 36, 35, 34, 32, 31, 30, 29, 28, 23, 22,
+ 20, 19, 18, 15, 7, 3, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117
+
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#define INITIAL 0
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+//=============================================================================
+/**
+ * @file ETCL_l.cpp
+ *
+ * $Id: ETCL_l.cpp 93651 2011-03-28 08:49:11Z johnnyw $
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu> based on previous work by Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#include "ace/ETCL/ETCL_Interpreter.h"
+#include "ace/ETCL/ETCL_y.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static const char* extract_string(char*);
+//static const char * extract_string(char*);
+
+#define YY_LEX_DEBUG
+
+#ifdef CONSTRAINT_DEBUG
+#define YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
+#endif /* CONSTRAINT_DEBUG */
+
+//#define YY_DECL int ETCL_yylex (ETCL_YYSTYPE *lvalp, void* state)
+
+#define YY_BREAK
+#define YY_NO_UNPUT
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+//FUZZ: disable check_for_lack_ACE_OS
+#ifndef ETCL_ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ETCL_ECHO { size_t __dum_ret = fwrite( yytext, yyleng, 1, yyout ); (void) __dum_ret; }
+#endif
+ //FUZZ: enable check_for_lack_ACE_OS
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = ACE_OS::getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = ACE_OS::fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp = 0;
+ register char *yy_bp = 0;
+ register int yy_act;
+
+//#line 50 "ETCL/ETCL.ll"
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 118 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 147 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+//#line 52 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_MIN; }
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+//#line 53 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_MAX; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+//#line 54 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_FIRST; }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+//#line 55 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_RANDOM; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+//#line 56 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_WITH; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+//#line 57 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_EXIST; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+//#line 58 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_NOT; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+//#line 59 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_AND; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+//#line 60 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_OR; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+//#line 61 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_IN; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+//#line 62 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_TWIDDLE; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+//#line 63 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_PLUS; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+//#line 64 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_MINUS; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+//#line 65 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_MULT; }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+//#line 66 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_DIV; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+//#line 67 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_LT; }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+//#line 68 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_LE; }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+//#line 69 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_GT; }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+//#line 70 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_GE; }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+//#line 71 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_EQ; }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+//#line 72 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_NE; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+//#line 73 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_LPAREN; }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+//#line 74 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_RPAREN; }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+//#line 75 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_DOLLAR; }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+//#line 76 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_DOT; }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+//#line 77 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_DEFAULT; }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+//#line 78 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_DISCRIMINANT; }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+//#line 79 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_TYPE_ID; }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+//#line 80 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_REPOS_ID; }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+//#line 81 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_LENGTH; }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+//#line 82 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_LBRA; }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+//#line 83 "ETCL/ETCL.ll"
+{ YY_LEX_DEBUG; return ETCL_RBRA; }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+//#line 84 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new ETCL_Literal_Constraint ((ACE_CDR::Boolean) 1);
+ YY_LEX_DEBUG; return ETCL_BOOLEAN;
+ }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+//#line 89 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new ETCL_Literal_Constraint ((ACE_CDR::Boolean) 0);
+ YY_LEX_DEBUG; return ETCL_BOOLEAN;
+ }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+//#line 94 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
+ YY_LEX_DEBUG; return ETCL_INTEGER;
+ }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+//#line 99 "ETCL/ETCL.ll"
+{
+ double v;
+ sscanf (yytext, "%lf", &v);
+ yylval.constraint =
+ new ETCL_Literal_Constraint (v);
+ YY_LEX_DEBUG; return ETCL_FLOAT;
+ }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+//#line 106 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new ETCL_Literal_Constraint (extract_string(yytext));
+ YY_LEX_DEBUG; return ETCL_STRING;
+ }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+//#line 111 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new ETCL_Identifier (yytext);
+ YY_LEX_DEBUG; return ETCL_IDENT;
+ }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+//#line 116 "ETCL/ETCL.ll"
+{
+ YY_LEX_DEBUG; break; // Ignore
+ }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+//#line 119 "ETCL/ETCL.ll"
+{
+ YY_LEX_DEBUG; break; // @@ TODO
+ }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+//#line 122 "ETCL/ETCL.ll"
+ETCL_ECHO;
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between yy_current_buffer and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 118 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 118 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 117);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+#if 0
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+#endif /* ifndef YY_NO_UNPUT */
+#endif /* 0 */
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yy_c_buf_p - yytext_ptr;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart( yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ return EOF;
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+
+ return c;
+ }
+
+void yyflush_current_buffer (void)
+{
+ YY_FLUSH_BUFFER;
+}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+#if defined (ACE_HAS_WINCE)
+ // Mimic the behavior as WinCE does not have isatty().
+ if ((file != 0) && (file == ACE_OS::fileno(file))) {
+ b->yy_is_interactive = 1;
+ }
+ else {
+ b->yy_is_interactive = 0;
+ }
+#else
+ b->yy_is_interactive = file ? (ACE_OS::isatty( ACE_OS::fileno(file) ) > 0) : 0;
+#endif // ACE_HAS_WINCE
+
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) ACE_OS::fprintf( stderr, "%s\n", msg );
+ ACE_OS::exit( YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) ACE_OS::malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+ {
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) ACE_OS::realloc( (char *) ptr, size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ ACE_OS::free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+//#line 122 "ETCL/ETCL.ll"
+
+
+const char*
+extract_string(char* str)
+{
+ char *t = str;
+ for (char * i = str + 1; *i != '\''; ++i, ++t)
+ {
+ if (*i == '\\')
+ {
+ ++i;
+ if (*i == 0)
+ return 0;
+ else if (*i == 't')
+ *t = '\t';
+ else if (*i == 'n')
+ *t = '\n';
+ else if (*i == '\\')
+ *t = '\\';
+ else
+ *t = *i;
+ continue;
+ }
+
+ *t = *i;
+ }
+
+ *t = '\0';
+ return str;
+}
+
+int
+yywrap (void)
+{
+ return 1;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/ETCL/ETCL_y.cpp b/dep/acelite/ace/ETCL/ETCL_y.cpp
new file mode 100644
index 00000000000..880b6300d6a
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_y.cpp
@@ -0,0 +1,1288 @@
+
+/* A Bison parser, made from ETCL/ETCL.yy
+ by GNU Bison version 1.28 */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define ETCL_GT 257
+#define ETCL_GE 258
+#define ETCL_LT 259
+#define ETCL_LE 260
+#define ETCL_EQ 261
+#define ETCL_NE 262
+#define ETCL_EXIST 263
+#define ETCL_DEFAULT 264
+#define ETCL_AND 265
+#define ETCL_OR 266
+#define ETCL_NOT 267
+#define ETCL_IN 268
+#define ETCL_TWIDDLE 269
+#define ETCL_BOOLEAN 270
+#define ETCL_PLUS 271
+#define ETCL_MINUS 272
+#define ETCL_MULT 273
+#define ETCL_DIV 274
+#define ETCL_UMINUS 275
+#define ETCL_INTEGER 276
+#define ETCL_FLOAT 277
+#define ETCL_STRING 278
+#define ETCL_RPAREN 279
+#define ETCL_LPAREN 280
+#define ETCL_RBRA 281
+#define ETCL_LBRA 282
+#define ETCL_IDENT 283
+#define ETCL_UNSIGNED 284
+#define ETCL_SIGNED 285
+#define ETCL_DOUBLE 286
+#define ETCL_CONSTRAINT 287
+#define ETCL_COMPONENT 288
+#define ETCL_WITH 289
+#define ETCL_MAX 290
+#define ETCL_MIN 291
+#define ETCL_FIRST 292
+#define ETCL_RANDOM 293
+#define ETCL_DOLLAR 294
+#define ETCL_DOT 295
+#define ETCL_DISCRIMINANT 296
+#define ETCL_LENGTH 297
+#define ETCL_TYPE_ID 298
+#define ETCL_REPOS_ID 299
+
+
+//=============================================================================
+/**
+ * @file ETCL_y.cpp
+ *
+ * $Id: ETCL_y.cpp 93651 2011-03-28 08:49:11Z johnnyw $
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu> based on previous work by Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#include "ace/ETCL/ETCL_y.h"
+#include "ace/ETCL/ETCL_Constraint.h"
+#include "ace/ETCL/ETCL_Interpreter.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern int yylex (void);
+extern void yyflush_current_buffer (void);
+
+static void yyerror (const char *)
+{
+ // @@ TODO
+ // Ignore error messages
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include <stdio.h>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define YYFINAL 114
+#define YYFLAG -32768
+#define YYNTBASE 46
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 299 ? yytranslate[x] : 65)
+
+static const char yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45
+};
+
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 7, 10, 13, 15, 17, 21, 23,
+ 27, 29, 33, 37, 41, 45, 49, 53, 55, 59,
+ 64, 66, 70, 72, 76, 80, 82, 86, 90, 92,
+ 95, 97, 101, 103, 106, 109, 111, 114, 117, 119,
+ 121, 124, 128, 132, 135, 137, 138, 141, 144, 146,
+ 148, 149, 152, 154, 156, 159, 161, 163, 165, 167,
+ 169, 171, 176, 181, 184, 189, 190, 192, 195, 198
+};
+
+static const short yyrhs[] = { 48,
+ 0, 47, 0, 37, 48, 0, 36, 48, 0, 35,
+ 48, 0, 38, 0, 39, 0, 48, 12, 49, 0,
+ 49, 0, 49, 11, 50, 0, 50, 0, 51, 7,
+ 51, 0, 51, 8, 51, 0, 51, 3, 51, 0,
+ 51, 4, 51, 0, 51, 5, 51, 0, 51, 6,
+ 51, 0, 51, 0, 52, 14, 57, 0, 52, 14,
+ 40, 57, 0, 52, 0, 53, 15, 53, 0, 53,
+ 0, 53, 17, 54, 0, 53, 18, 54, 0, 54,
+ 0, 54, 19, 55, 0, 54, 20, 55, 0, 55,
+ 0, 13, 56, 0, 56, 0, 26, 48, 25, 0,
+ 22, 0, 17, 22, 0, 18, 22, 0, 23, 0,
+ 17, 23, 0, 18, 23, 0, 24, 0, 16, 0,
+ 9, 29, 0, 9, 40, 57, 0, 10, 40, 57,
+ 0, 40, 57, 0, 29, 0, 0, 41, 59, 0,
+ 29, 58, 0, 60, 0, 61, 0, 0, 41, 59,
+ 0, 60, 0, 61, 0, 29, 58, 0, 43, 0,
+ 42, 0, 44, 0, 45, 0, 62, 0, 63, 0,
+ 28, 22, 27, 58, 0, 26, 29, 25, 58, 0,
+ 22, 58, 0, 26, 64, 25, 58, 0, 0, 22,
+ 0, 17, 22, 0, 18, 22, 0, 24, 0
+};
+
+#endif
+
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 92, 93, 96, 98, 100, 102, 104, 108, 110, 113,
+ 115, 118, 120, 122, 124, 126, 128, 130, 133, 135,
+ 137, 140, 142, 145, 147, 149, 152, 154, 156, 159,
+ 161, 164, 166, 168, 170, 172, 174, 176, 178, 180,
+ 182, 184, 186, 188, 190, 194, 196, 199, 202, 203,
+ 206, 208, 211, 212, 215, 217, 219, 221, 223, 225,
+ 226, 229, 233, 237, 241, 245, 247, 249, 251, 253
+};
+#endif
+
+
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","ETCL_GT",
+"ETCL_GE","ETCL_LT","ETCL_LE","ETCL_EQ","ETCL_NE","ETCL_EXIST",
+"ETCL_DEFAULT","ETCL_AND","ETCL_OR","ETCL_NOT","ETCL_IN",
+"ETCL_TWIDDLE","ETCL_BOOLEAN","ETCL_PLUS","ETCL_MINUS","ETCL_MULT",
+"ETCL_DIV","ETCL_UMINUS","ETCL_INTEGER","ETCL_FLOAT","ETCL_STRING",
+"ETCL_RPAREN","ETCL_LPAREN","ETCL_RBRA","ETCL_LBRA","ETCL_IDENT",
+"ETCL_UNSIGNED","ETCL_SIGNED","ETCL_DOUBLE","ETCL_CONSTRAINT",
+"ETCL_COMPONENT","ETCL_WITH","ETCL_MAX","ETCL_MIN","ETCL_FIRST",
+"ETCL_RANDOM","ETCL_DOLLAR","ETCL_DOT","ETCL_DISCRIMINANT","ETCL_LENGTH",
+"ETCL_TYPE_ID","ETCL_REPOS_ID","constraint","preference","bool_or","bool_and",
+"bool_compare","expr_in","expr_twiddle","expr","term","factor_not","factor",
+"component","component_ext","component_dot","component_array","component_assoc",
+"component_pos","union_pos","union_val", 0
+};
+#endif
+
+static const short yyr1[] = { 0,
+ 46, 46, 47, 47, 47, 47, 47, 48, 48, 49,
+ 49, 50, 50, 50, 50, 50, 50, 50, 51, 51,
+ 51, 52, 52, 53, 53, 53, 54, 54, 54, 55,
+ 55, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 57, 57, 57, 57, 57,
+ 58, 58, 58, 58, 59, 59, 59, 59, 59, 59,
+ 59, 60, 61, 62, 63, 64, 64, 64, 64, 64
+};
+
+static const short yyr2[] = { 0,
+ 1, 1, 2, 2, 2, 1, 1, 3, 1, 3,
+ 1, 3, 3, 3, 3, 3, 3, 1, 3, 4,
+ 1, 3, 1, 3, 3, 1, 3, 3, 1, 2,
+ 1, 3, 1, 2, 2, 1, 2, 2, 1, 1,
+ 2, 3, 3, 2, 1, 0, 2, 2, 1, 1,
+ 0, 2, 1, 1, 2, 1, 1, 1, 1, 1,
+ 1, 4, 4, 2, 4, 0, 1, 2, 2, 1
+};
+
+static const short yydefact[] = { 0,
+ 0, 0, 0, 40, 0, 0, 33, 36, 39, 0,
+ 45, 0, 0, 0, 6, 7, 46, 2, 1, 9,
+ 11, 18, 21, 23, 26, 29, 31, 41, 46, 46,
+ 30, 34, 37, 35, 38, 0, 5, 4, 3, 0,
+ 0, 51, 0, 44, 49, 50, 0, 0, 0, 0,
+ 0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
+ 42, 43, 32, 0, 0, 0, 48, 53, 54, 51,
+ 66, 51, 57, 56, 58, 59, 47, 60, 61, 8,
+ 10, 14, 15, 16, 17, 12, 13, 46, 19, 22,
+ 24, 25, 27, 28, 51, 51, 52, 64, 0, 0,
+ 67, 70, 0, 55, 20, 63, 62, 68, 69, 51,
+ 65, 0, 0, 0
+};
+
+static const short yydefgoto[] = { 112,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 44, 67, 77, 68, 69, 78, 79, 103
+};
+
+static const short yypact[] = { 41,
+ -13, -39, 94,-32768, 38, 46,-32768,-32768,-32768, 73,
+-32768, 73, 73, 73,-32768,-32768, -9,-32768, -6, 7,
+-32768, 121, -5, 19, 55,-32768,-32768,-32768, -9, -9,
+-32768,-32768,-32768,-32768,-32768, 21, -6, -6, -6, 6,
+ 25, -2, -1,-32768,-32768,-32768, 73, 73, 73, 73,
+ 73, 73, 73, 73, -18, 73, 73, 73, 73, 73,
+-32768,-32768,-32768, 27, 29, -1,-32768,-32768,-32768, -2,
+ 31, -2,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 7,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, -9,-32768, 67,
+ 55, 55,-32768,-32768, -2, -2,-32768,-32768, 44, 50,
+-32768,-32768, 69,-32768,-32768,-32768,-32768,-32768,-32768, -2,
+-32768, 98, 100,-32768
+};
+
+static const short yypgoto[] = {-32768,
+-32768, 95, 54, 58, 86,-32768, 59, 30, 33, 111,
+ -26, -65, 53, -17, -15,-32768,-32768,-32768
+};
+
+
+#define YYLAST 140
+
+
+static const short yytable[] = { 45,
+ 30, 46, 61, 62, 98, 47, 104, 40, 55, 41,
+ 42, 45, 45, 46, 46, 28, 40, 48, 41, 42,
+ 70, 88, 43, 40, 71, 41, 29, 72, 89, 106,
+ 107, 43, 47, 56, 64, 57, 58, 45, 66, 46,
+ 73, 74, 75, 76, 111, 63, 65, 99, 100, 1,
+ 2, 95, 101, 3, 102, 96, 4, 5, 6, 32,
+ 33, 105, 7, 8, 9, 108, 10, 34, 35, 11,
+ 45, 109, 46, 59, 60, 12, 13, 14, 15, 16,
+ 17, 1, 2, 57, 58, 3, 91, 92, 4, 5,
+ 6, 93, 94, 110, 7, 8, 9, 113, 10, 114,
+ 80, 11, 1, 2, 36, 81, 37, 38, 39, 4,
+ 5, 6, 17, 31, 90, 7, 8, 9, 97, 10,
+ 0, 0, 11, 49, 50, 51, 52, 53, 54, 0,
+ 0, 0, 0, 17, 82, 83, 84, 85, 86, 87
+};
+
+static const short yycheck[] = { 17,
+ 40, 17, 29, 30, 70, 12, 72, 26, 14, 28,
+ 29, 29, 30, 29, 30, 29, 26, 11, 28, 29,
+ 22, 40, 41, 26, 26, 28, 40, 29, 55, 95,
+ 96, 41, 12, 15, 29, 17, 18, 55, 41, 55,
+ 42, 43, 44, 45, 110, 25, 22, 17, 18, 9,
+ 10, 25, 22, 13, 24, 27, 16, 17, 18, 22,
+ 23, 88, 22, 23, 24, 22, 26, 22, 23, 29,
+ 88, 22, 88, 19, 20, 35, 36, 37, 38, 39,
+ 40, 9, 10, 17, 18, 13, 57, 58, 16, 17,
+ 18, 59, 60, 25, 22, 23, 24, 0, 26, 0,
+ 47, 29, 9, 10, 10, 48, 12, 13, 14, 16,
+ 17, 18, 40, 3, 56, 22, 23, 24, 66, 26,
+ -1, -1, 29, 3, 4, 5, 6, 7, 8, -1,
+ -1, -1, -1, 40, 49, 50, 51, 52, 53, 54
+};
+/* -*-C-*- Note some compilers choke on comments on `//#line' lines. */
+//#line 3 "/pkg/gnu/share/bison.simple"
+/* This file comes from bison-1.28. */
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
+#include <alloca.h>
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include <malloc.h>
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval, &yylloc)
+#endif
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
+#endif
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, unsigned int count)
+{
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+//#line 217 "/pkg/gnu/share/bison.simple"
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
+int yyparse (void);
+#endif
+#endif
+
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ ACE_OS::free (yyss);
+ ACE_OS::free (yyvs);
+#ifdef YYLSP_NEEDED
+ ACE_OS::free (yyls);
+#endif
+ }
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ ACE_OS::fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ ACE_OS::fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ ACE_OS::fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ ACE_OS::fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ ACE_OS::fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 3:
+//#line 97 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Preference (ETCL_MIN, yyvsp[0].constraint); ;
+ break;}
+case 4:
+//#line 99 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Preference (ETCL_MAX, yyvsp[0].constraint); ;
+ break;}
+case 5:
+//#line 101 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Preference (ETCL_WITH, yyvsp[0].constraint); ;
+ break;}
+case 6:
+//#line 103 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Preference (ETCL_FIRST); ;
+ break;}
+case 7:
+//#line 105 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Preference (ETCL_RANDOM); ;
+ break;}
+case 8:
+//#line 109 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_OR, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 10:
+//#line 114 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_AND, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 12:
+//#line 119 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_EQ, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 13:
+//#line 121 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_NE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 14:
+//#line 123 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_GT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 15:
+//#line 125 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_GE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 16:
+//#line 127 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_LT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 17:
+//#line 129 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_LE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 19:
+//#line 134 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_IN, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 20:
+//#line 136 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_IN, yyvsp[-3].constraint, yyvsp[0].constraint); ;
+ break;}
+case 22:
+//#line 141 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_TWIDDLE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 24:
+//#line 146 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_PLUS, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 25:
+//#line 148 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_MINUS, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 27:
+//#line 153 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_MULT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 28:
+//#line 155 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Binary_Expr (ETCL_DIV, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 30:
+//#line 160 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Unary_Expr (ETCL_NOT, yyvsp[0].constraint); ;
+ break;}
+case 32:
+//#line 165 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[-1].constraint; ;
+ break;}
+case 33:
+//#line 167 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 34:
+//#line 169 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Unary_Expr (ETCL_PLUS, yyvsp[0].constraint); ;
+ break;}
+case 35:
+//#line 171 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Unary_Expr (ETCL_MINUS, yyvsp[0].constraint); ;
+ break;}
+case 36:
+//#line 173 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 37:
+//#line 175 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Unary_Expr (ETCL_PLUS, yyvsp[0].constraint); ;
+ break;}
+case 38:
+//#line 177 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Unary_Expr (ETCL_MINUS, yyvsp[0].constraint); ;
+ break;}
+case 39:
+//#line 179 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 40:
+//#line 181 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 41:
+//#line 183 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Exist (yyvsp[0].constraint); ;
+ break;}
+case 42:
+//#line 185 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Exist (yyvsp[0].constraint); ;
+ break;}
+case 43:
+//#line 187 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Default (yyvsp[0].constraint); ;
+ break;}
+case 44:
+//#line 189 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Eval (yyvsp[0].constraint); ;
+ break;}
+case 45:
+//#line 191 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 46:
+//#line 195 "ETCL/ETCL.yy"
+{ yyval.constraint = 0; ;
+ break;}
+case 47:
+//#line 197 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Dot (yyvsp[0].constraint); ;
+ break;}
+case 48:
+//#line 200 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+case 51:
+//#line 207 "ETCL/ETCL.yy"
+{ yyval.constraint = 0; ;
+ break;}
+case 52:
+//#line 209 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Dot (yyvsp[0].constraint); ;
+ break;}
+case 55:
+//#line 216 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+case 56:
+//#line 218 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Special (ETCL_LENGTH); ;
+ break;}
+case 57:
+//#line 220 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Special (ETCL_DISCRIMINANT); ;
+ break;}
+case 58:
+//#line 222 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Special (ETCL_TYPE_ID); ;
+ break;}
+case 59:
+//#line 224 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Special (ETCL_REPOS_ID); ;
+ break;}
+case 62:
+//#line 230 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Component_Array (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 63:
+//#line 234 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Component_Assoc (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 64:
+//#line 238 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Component_Pos (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+case 65:
+//#line 242 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Union_Pos (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 66:
+//#line 246 "ETCL/ETCL.yy"
+{ yyval.constraint = 0; ;
+ break;}
+case 67:
+//#line 248 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Union_Value (+1, yyvsp[0].constraint); ;
+ break;}
+case 68:
+//#line 250 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Union_Value (+1, yyvsp[0].constraint); ;
+ break;}
+case 69:
+//#line 252 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Union_Value (-1, yyvsp[0].constraint); ;
+ break;}
+case 70:
+//#line 254 "ETCL/ETCL.yy"
+{ yyval.constraint = new ETCL_Union_Value (yyvsp[0].constraint); ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+//#line 543 "/pkg/gnu/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ ACE_OS::fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ ACE_OS::fprintf (stderr, " %d", *++ssp1);
+ ACE_OS::fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += ACE_OS::strlen(yytname[x]) + 15, count++;
+ msg = (char *) ACE_OS::malloc(size + 15);
+ if (msg != 0)
+ {
+ ACE_OS::strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ ACE_OS::strcat(msg, count == 0 ? ", expecting `" : " or `");
+ ACE_OS::strcat(msg, yytname[x]);
+ ACE_OS::strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ ACE_OS::free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ ACE_OS::fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ ACE_OS::fprintf (stderr, " %d", *++ssp1);
+ ACE_OS::fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ ACE_OS::fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ ACE_OS::free (yyss);
+ ACE_OS::free (yyvs);
+#ifdef YYLSP_NEEDED
+ ACE_OS::free (yyls);
+#endif
+ }
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+
+ /* Flush out yy_current_buffer before next parse. Since there is
+ no error recovery, the buffer could still contain tokens from this
+ parse. */
+ yyflush_current_buffer();
+
+ if (yyfree_stacks)
+ {
+ ACE_OS::free (yyss);
+ ACE_OS::free (yyvs);
+#ifdef YYLSP_NEEDED
+ ACE_OS::free (yyls);
+#endif
+ }
+ return 1;
+}
+//#line 257 "ETCL/ETCL.yy"
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/ETCL/ETCL_y.h b/dep/acelite/ace/ETCL/ETCL_y.h
new file mode 100644
index 00000000000..577296e9ee2
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ETCL_y.h
@@ -0,0 +1,45 @@
+// $Id: ETCL_y.h 81458 2008-04-28 11:31:49Z johnnyw $
+#define ETCL_GT 257
+#define ETCL_GE 258
+#define ETCL_LT 259
+#define ETCL_LE 260
+#define ETCL_EQ 261
+#define ETCL_NE 262
+#define ETCL_EXIST 263
+#define ETCL_DEFAULT 264
+#define ETCL_AND 265
+#define ETCL_OR 266
+#define ETCL_NOT 267
+#define ETCL_IN 268
+#define ETCL_TWIDDLE 269
+#define ETCL_BOOLEAN 270
+#define ETCL_PLUS 271
+#define ETCL_MINUS 272
+#define ETCL_MULT 273
+#define ETCL_DIV 274
+#define ETCL_UMINUS 275
+#define ETCL_INTEGER 276
+#define ETCL_FLOAT 277
+#define ETCL_STRING 278
+#define ETCL_RPAREN 279
+#define ETCL_LPAREN 280
+#define ETCL_RBRA 281
+#define ETCL_LBRA 282
+#define ETCL_IDENT 283
+#define ETCL_UNSIGNED 284
+#define ETCL_SIGNED 285
+#define ETCL_DOUBLE 286
+#define ETCL_CONSTRAINT 287
+#define ETCL_COMPONENT 288
+#define ETCL_WITH 289
+#define ETCL_MAX 290
+#define ETCL_MIN 291
+#define ETCL_FIRST 292
+#define ETCL_RANDOM 293
+#define ETCL_DOLLAR 294
+#define ETCL_DOT 295
+#define ETCL_DISCRIMINANT 296
+#define ETCL_LENGTH 297
+#define ETCL_TYPE_ID 298
+#define ETCL_REPOS_ID 299
+
diff --git a/dep/acelite/ace/ETCL/ace_etcl_export.h b/dep/acelite/ace/ETCL/ace_etcl_export.h
new file mode 100644
index 00000000000..561d99f85be
--- /dev/null
+++ b/dep/acelite/ace/ETCL/ace_etcl_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id: ace_etcl_export.h 81458 2008-04-28 11:31:49Z johnnyw $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef ACE_ETCL_EXPORT_H
+#define ACE_ETCL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS)
+# if !defined (ACE_ETCL_HAS_DLL)
+# define ACE_ETCL_HAS_DLL 0
+# endif /* ! ACE_ETCL_HAS_DLL */
+#else
+# if !defined (ACE_ETCL_HAS_DLL)
+# define ACE_ETCL_HAS_DLL 1
+# endif /* ! ACE_ETCL_HAS_DLL */
+#endif
+
+#if defined (ACE_ETCL_HAS_DLL) && (ACE_ETCL_HAS_DLL == 1)
+# if defined (ACE_ETCL_BUILD_DLL)
+# define ACE_ETCL_Export ACE_Proper_Export_Flag
+# define ACE_ETCL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_ETCL_BUILD_DLL */
+# define ACE_ETCL_Export ACE_Proper_Import_Flag
+# define ACE_ETCL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_ETCL_BUILD_DLL */
+#else /* ACE_ETCL_HAS_DLL == 1 */
+# define ACE_ETCL_Export
+# define ACE_ETCL_SINGLETON_DECLARATION(T)
+# define ACE_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_ETCL_HAS_DLL == 1 */
+
+#endif /* ACE_ETCL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/ETCL/etcl_parser_export.h b/dep/acelite/ace/ETCL/etcl_parser_export.h
new file mode 100644
index 00000000000..678d25b466a
--- /dev/null
+++ b/dep/acelite/ace/ETCL/etcl_parser_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id: etcl_parser_export.h 81640 2008-05-07 19:04:11Z parsons $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef ETCL_PARSER_EXPORT_H
+#define ETCL_PARSER_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS)
+# if !defined (ETCL_PARSER_HAS_DLL)
+# define ETCL_PARSER_HAS_DLL 0
+# endif /* ! ETCL_PARSER_HAS_DLL */
+#else
+# if !defined (ETCL_PARSER_HAS_DLL)
+# define ETCL_PARSER_HAS_DLL 1
+# endif /* ! ETCL_PARSER_HAS_DLL */
+#endif
+
+#if defined (ETCL_PARSER_HAS_DLL) && (ETCL_PARSER_HAS_DLL == 1)
+# if defined (ETCL_PARSER_BUILD_DLL)
+# define ETCL_Parser_Export ACE_Proper_Export_Flag
+# define ETCL_PARSER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ETCL_PARSER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ETCL_PARSER_BUILD_DLL */
+# define ETCL_Parser_Export ACE_Proper_Import_Flag
+# define ETCL_PARSER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ETCL_PARSER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ETCL_PARSER_BUILD_DLL */
+#else /* ETCL_PARSER_HAS_DLL == 1 */
+# define ETCL_Parser_Export
+# define ETCL_PARSER_SINGLETON_DECLARATION(T)
+# define ETCL_PARSER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ETCL_PARSER_HAS_DLL == 1 */
+
+#endif /* ETCL_PARSER_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/Env_Value_T.h b/dep/acelite/ace/Env_Value_T.h
index c8b459b26c2..412baf935ed 100644
--- a/dep/acelite/ace/Env_Value_T.h
+++ b/dep/acelite/ace/Env_Value_T.h
@@ -4,7 +4,7 @@
/**
* @file Env_Value_T.h
*
- * $Id: Env_Value_T.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Env_Value_T.h 92712 2010-11-25 12:22:13Z johnnyw $
*
* Template to encapsulate getting a value from an environment variable
* and using a supplied default value if not in the environment.
@@ -45,7 +45,7 @@ public:
/**
* Default constructor which isn't bound to a specific environment
* variable name or a default value. Before being useful it must
- * <open>'d.
+ * open()'d.
*/
ACE_Env_Value (void);
diff --git a/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp b/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp
new file mode 100644
index 00000000000..b16679a11ec
--- /dev/null
+++ b/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.cpp
@@ -0,0 +1,99 @@
+// $Id: Event_Handler_Handle_Timeout_Upcall.cpp 95586 2012-03-03 20:45:57Z johnnyw $
+
+#include "ace/Event_Handler_Handle_Timeout_Upcall.h"
+#include "ace/Reactor_Timer_Interface.h"
+#include "ace/Abstract_Timer_Queue.h"
+
+#if !defined(__ACE_INLINE__)
+# include "ace/Event_Handler_Handle_Timeout_Upcall.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Event_Handler_Handle_Timeout_Upcall::
+ACE_Event_Handler_Handle_Timeout_Upcall (void) :
+ requires_reference_counting_ (0)
+{
+}
+
+ACE_Event_Handler_Handle_Timeout_Upcall::
+~ACE_Event_Handler_Handle_Timeout_Upcall (void)
+{
+}
+
+int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+timeout (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *event_handler,
+ const void *act,
+ int recurring_timer,
+ const ACE_Time_Value &cur_time)
+{
+ int requires_reference_counting = 0;
+
+ if (!recurring_timer)
+ {
+ requires_reference_counting =
+ event_handler->reference_counting_policy ().value () ==
+ ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
+ }
+
+ // Upcall to the <handler>s handle_timeout method.
+ if (event_handler->handle_timeout (cur_time, act) == -1)
+ {
+ if (event_handler->reactor_timer_interface ())
+ event_handler->reactor_timer_interface ()->cancel_timer (event_handler, 0);
+ else
+ timer_queue.cancel (event_handler, 0); // 0 means "call handle_close()".
+ }
+
+ if (!recurring_timer &&
+ requires_reference_counting)
+ {
+ event_handler->remove_reference ();
+ }
+
+ return 0;
+}
+
+int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+cancel_type (ACE_Timer_Queue &,
+ ACE_Event_Handler *event_handler,
+ int dont_call,
+ int &requires_reference_counting)
+{
+ requires_reference_counting =
+ event_handler->reference_counting_policy ().value () ==
+ ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
+
+ // Upcall to the <handler>s handle_close method
+ if (dont_call == 0)
+ event_handler->handle_close (ACE_INVALID_HANDLE,
+ ACE_Event_Handler::TIMER_MASK);
+
+ return 0;
+}
+
+int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+deletion (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *event_handler,
+ const void *)
+{
+ int requires_reference_counting = 0;
+
+ this->cancel_type (timer_queue,
+ event_handler,
+ 0,
+ requires_reference_counting);
+
+ this->cancel_timer (timer_queue,
+ event_handler,
+ 0,
+ requires_reference_counting);
+
+ return 0;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h b/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h
new file mode 100644
index 00000000000..0ce4a4dd9ca
--- /dev/null
+++ b/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.h
@@ -0,0 +1,103 @@
+//$Id: Event_Handler_Handle_Timeout_Upcall.h 95334 2011-12-15 12:52:50Z msmit $
+
+#ifndef ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H
+#define ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H
+
+#include /**/ "ace/pre.h"
+
+/**
+ * @file Event_Handler_Handle_Timeout_Upcall.h
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ *
+ * Based on classes and files developed by Doug Schmidt, Darrell
+ * Brunsch, Irfan Pyarali and a cast of thousands.
+ */
+
+#include "ace/Timer_Queuefwd.h"
+#include "ace/Copy_Disabled.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ACE_Time_Value;
+
+/**
+ * @class ACE_Event_Handler_Handle_Timeout_Upcall
+ *
+ * @brief Functor for Timer_Queues.
+ *
+ * This class implements the functor required by the Timer
+ * Queue to call <handle_timeout> on ACE_Event_Handlers.
+ */
+class ACE_Export ACE_Event_Handler_Handle_Timeout_Upcall
+ : private ACE_Copy_Disabled
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ ACE_Event_Handler_Handle_Timeout_Upcall (void);
+
+ /// Destructor.
+ ~ACE_Event_Handler_Handle_Timeout_Upcall (void);
+
+ /// This method is called when a timer is registered.
+ int registration (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ const void *arg);
+
+ /// This method is called before the timer expires.
+ int preinvoke (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ const void *arg,
+ int recurring_timer,
+ const ACE_Time_Value &cur_time,
+ const void *&upcall_act);
+
+ /// This method is called when the timer expires.
+ int timeout (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ const void *arg,
+ int recurring_timer,
+ const ACE_Time_Value &cur_time);
+
+ /// This method is called after the timer expires.
+ int postinvoke (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ const void *arg,
+ int recurring_timer,
+ const ACE_Time_Value &cur_time,
+ const void *upcall_act);
+
+ /// This method is called when a handler is cancelled
+ int cancel_type (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ int dont_call,
+ int &requires_reference_counting);
+
+ /// This method is called when a timer is cancelled
+ int cancel_timer (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ int dont_call,
+ int requires_reference_counting);
+
+ /// This method is called when the timer queue is destroyed and
+ /// the timer is still contained in it
+ int deletion (ACE_Timer_Queue &timer_queue,
+ ACE_Event_Handler *handler,
+ const void *arg);
+
+private:
+
+ /// Flag indicating that reference counting is required for this
+ /// event handler upcall.
+ int requires_reference_counting_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+# include "ace/Event_Handler_Handle_Timeout_Upcall.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H */
diff --git a/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.inl b/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.inl
new file mode 100644
index 00000000000..f52a7206c47
--- /dev/null
+++ b/dep/acelite/ace/Event_Handler_Handle_Timeout_Upcall.inl
@@ -0,0 +1,71 @@
+// $Id: Event_Handler_Handle_Timeout_Upcall.inl 95336 2011-12-15 13:22:33Z msmit $
+
+#include "ace/Event_Handler.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+registration (ACE_Timer_Queue &,
+ ACE_Event_Handler *event_handler,
+ const void *)
+{
+ event_handler->add_reference ();
+ return 0;
+}
+
+ACE_INLINE int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+preinvoke (ACE_Timer_Queue &,
+ ACE_Event_Handler *event_handler,
+ const void *,
+ int,
+ const ACE_Time_Value &,
+ const void * & upcall_act)
+{
+ bool const requires_reference_counting =
+ event_handler->reference_counting_policy ().value () ==
+ ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
+
+ if (requires_reference_counting)
+ {
+ event_handler->add_reference ();
+
+ upcall_act = &this->requires_reference_counting_;
+ }
+
+ return 0;
+}
+
+ACE_INLINE int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+postinvoke (ACE_Timer_Queue & /* timer_queue */,
+ ACE_Event_Handler *event_handler,
+ const void * /* timer_act */,
+ int /* recurring_timer */,
+ const ACE_Time_Value & /* cur_time */,
+ const void *upcall_act)
+{
+ if (upcall_act == &this->requires_reference_counting_)
+ {
+ event_handler->remove_reference ();
+ }
+
+ return 0;
+}
+
+ACE_INLINE int
+ACE_Event_Handler_Handle_Timeout_Upcall::
+cancel_timer (ACE_Timer_Queue &,
+ ACE_Event_Handler *event_handler,
+ int,
+ int requires_reference_counting)
+{
+ if (requires_reference_counting)
+ event_handler->remove_reference ();
+
+ return 0;
+}
+
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/FIFO.cpp b/dep/acelite/ace/FIFO.cpp
index b564a26c6b6..a4d7ba1d0b9 100644
--- a/dep/acelite/ace/FIFO.cpp
+++ b/dep/acelite/ace/FIFO.cpp
@@ -1,4 +1,4 @@
-// $Id: FIFO.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: FIFO.cpp 94034 2011-05-09 19:11:03Z johnnyw $
#include "ace/FIFO.h"
@@ -12,8 +12,6 @@
#include "ace/OS_NS_sys_stat.h"
#include "ace/OS_NS_fcntl.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_FIFO)
diff --git a/dep/acelite/ace/FIFO_Recv_Msg.cpp b/dep/acelite/ace/FIFO_Recv_Msg.cpp
index b8580ae317c..9d041d558cc 100644
--- a/dep/acelite/ace/FIFO_Recv_Msg.cpp
+++ b/dep/acelite/ace/FIFO_Recv_Msg.cpp
@@ -1,4 +1,4 @@
-// $Id: FIFO_Recv_Msg.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: FIFO_Recv_Msg.cpp 93359 2011-02-11 11:33:12Z mcorino $
#include "ace/FIFO_Recv_Msg.h"
@@ -8,8 +8,6 @@
#include "ace/FIFO_Recv_Msg.inl"
#endif /* __ACE_INLINE__ */
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Recv_Msg)
diff --git a/dep/acelite/ace/Filecache.cpp b/dep/acelite/ace/Filecache.cpp
index 7a9615bb59d..65e548c75ec 100644
--- a/dep/acelite/ace/Filecache.cpp
+++ b/dep/acelite/ace/Filecache.cpp
@@ -1,4 +1,4 @@
-// $Id: Filecache.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Filecache.cpp 94034 2011-05-09 19:11:03Z johnnyw $
#include "ace/Filecache.h"
#include "ace/Object_Manager.h"
@@ -164,6 +164,7 @@ template <>
ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next,
ACE_Filecache_Hash_Entry *prev)
: ext_id_ (0),
+ int_id_ (0),
next_ (next),
prev_ (prev)
{
diff --git a/dep/acelite/ace/FlReactor/ACE_FlReactor_export.h b/dep/acelite/ace/FlReactor/ACE_FlReactor_export.h
new file mode 100644
index 00000000000..282adb6494d
--- /dev/null
+++ b/dep/acelite/ace/FlReactor/ACE_FlReactor_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: ACE_FlReactor_export.h 80826 2008-03-04 14:51:23Z wotte $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s ACE_FlReactor
+// ------------------------------
+#ifndef ACE_FLREACTOR_EXPORT_H
+#define ACE_FLREACTOR_EXPORT_H
+
+#include /**/ "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_FLREACTOR_HAS_DLL)
+# define ACE_FLREACTOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_FLREACTOR_HAS_DLL */
+
+#if !defined (ACE_FLREACTOR_HAS_DLL)
+# define ACE_FLREACTOR_HAS_DLL 1
+#endif /* ! ACE_FLREACTOR_HAS_DLL */
+
+#if defined (ACE_FLREACTOR_HAS_DLL) && (ACE_FLREACTOR_HAS_DLL == 1)
+# if defined (ACE_FLREACTOR_BUILD_DLL)
+# define ACE_FlReactor_Export ACE_Proper_Export_Flag
+# define ACE_FLREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_FLREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_FLREACTOR_BUILD_DLL */
+# define ACE_FlReactor_Export ACE_Proper_Import_Flag
+# define ACE_FLREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_FLREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_FLREACTOR_BUILD_DLL */
+#else /* ACE_FLREACTOR_HAS_DLL == 1 */
+# define ACE_FlReactor_Export
+# define ACE_FLREACTOR_SINGLETON_DECLARATION(T)
+# define ACE_FLREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_FLREACTOR_HAS_DLL == 1 */
+
+// Set ACE_FLREACTOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_FLREACTOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_FLREACTOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_FLREACTOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_FLREACTOR_NTRACE */
+
+#if (ACE_FLREACTOR_NTRACE == 1)
+# define ACE_FLREACTOR_TRACE(X)
+#else /* (ACE_FLREACTOR_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_FLREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_FLREACTOR_NTRACE == 1) */
+
+#endif /* ACE_FLREACTOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/FlReactor/FlReactor.cpp b/dep/acelite/ace/FlReactor/FlReactor.cpp
new file mode 100644
index 00000000000..4cab9c9df78
--- /dev/null
+++ b/dep/acelite/ace/FlReactor/FlReactor.cpp
@@ -0,0 +1,328 @@
+// $Id: FlReactor.cpp 95511 2012-01-27 09:40:38Z johnnyw $
+
+#include "ace/FlReactor/FlReactor.h"
+
+#include /**/ <FL/Fl.H>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_ALLOC_HOOK_DEFINE (ACE_FlReactor)
+
+// Must be called with lock held
+ACE_FlReactor::ACE_FlReactor (size_t size,
+ bool restart,
+ ACE_Sig_Handler *h)
+ : ACE_Select_Reactor (size, restart, h)
+{
+ // When the ACE_Select_Reactor is constructed it creates the notify
+ // pipe and registers it with the register_handler_i() method. The
+ // FlReactor overloads this method BUT because the
+ // register_handler_i occurs when constructing the base class
+ // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i()
+ // is called not the FlReactor register_handler_i(). This means
+ // that the notify pipe is registered with the ACE_Select_Reactor
+ // event handling code not the FlReactor and so notfications don't
+ // work. To get around this we simply close and re-opened the
+ // notification handler in the constructor of the FlReactor.
+
+#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+ this->notify_handler_->close ();
+ this->notify_handler_->open (this, 0);
+#endif /* ACE_MT_SAFE */
+}
+
+ACE_FlReactor::~ACE_FlReactor (void)
+{
+}
+
+// This is just the <wait_for_multiple_events> from ace/Reactor.cpp
+// but we use the Fl functions to wait for an event, not <select>
+
+int
+ACE_FlReactor::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set,
+ ACE_Time_Value *max_wait_time)
+{
+ ACE_TRACE ("ACE_FlReactor::wait_for_multiple_events");
+ int nfound;
+
+ do
+ {
+ max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time);
+
+ size_t width = this->handler_rep_.max_handlep1 ();
+ handle_set.rd_mask_ = this->wait_set_.rd_mask_;
+ handle_set.wr_mask_ = this->wait_set_.wr_mask_;
+ handle_set.ex_mask_ = this->wait_set_.ex_mask_;
+
+ // Check to make sure our handle's are all usable.
+ ACE_Select_Reactor_Handle_Set temp_set = handle_set;
+
+ ACE_Time_Value zero = ACE_Time_Value::zero;
+ if (ACE_OS::select (width,
+ temp_set.rd_mask_,
+ temp_set.wr_mask_,
+ temp_set.ex_mask_,
+ &zero) == -1)
+ return -1; // Bad file arguments...
+
+ // Instead of waiting using <select>, just use the Fl mechanism
+ // to wait for one or more events...
+
+ // Wait for something to happen.
+ double t = 0;
+ if (max_wait_time != 0)
+ t = max_wait_time->sec () + max_wait_time->usec () / 1000000.0F;
+
+ while (t > 0) {
+ t = Fl::wait (t);
+ }
+
+ // Reset the width, in case it changed during the upcalls.
+ width = this->handler_rep_.max_handlep1 ();
+
+ // Now actually read the result needed by the <Select_Reactor>
+ // using <select>.
+ zero = ACE_Time_Value::zero;
+ nfound = ACE_OS::select (width,
+ handle_set.rd_mask_,
+ handle_set.wr_mask_,
+ handle_set.ex_mask_,
+ &zero);
+
+ } while (nfound == -1 && this->handle_error () > 0);
+
+ if (nfound > 0)
+ {
+#if !defined (ACE_WIN32)
+ handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ());
+#endif /* ACE_WIN32 */
+ }
+ return nfound; // Timed out or input available
+}
+
+void
+ACE_FlReactor::fl_io_proc (int fd, void* reactor)
+{
+ ACE_FlReactor *self = static_cast<ACE_FlReactor *> (reactor);
+ ACE_HANDLE handle = (ACE_HANDLE)fd; //reinterpret_cast<ACE_HANDLE> (fd);
+
+ // my copy isn't const.
+ ACE_Time_Value zero = ACE_Time_Value::zero;
+
+ ACE_Select_Reactor_Handle_Set wait_set;
+
+ // Deal with one file event.
+
+ // - read which kind of event
+ if (self->wait_set_.rd_mask_.is_set (handle))
+ wait_set.rd_mask_.set_bit (handle);
+ if (self->wait_set_.wr_mask_.is_set (handle))
+ wait_set.wr_mask_.set_bit (handle);
+ if (self->wait_set_.ex_mask_.is_set (handle))
+ wait_set.ex_mask_.set_bit (handle);
+
+ int result = ACE_OS::select (fd + 1,
+ wait_set.rd_mask_,
+ wait_set.wr_mask_,
+ wait_set.ex_mask_, &zero);
+
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+
+ // - Use only that one file event (removes events for other files).
+ if (result > 0)
+ {
+ if (wait_set.rd_mask_.is_set (handle))
+ dispatch_set.rd_mask_.set_bit (handle);
+ if (wait_set.wr_mask_.is_set (handle))
+ dispatch_set.wr_mask_.set_bit (handle);
+ if (wait_set.ex_mask_.is_set (handle))
+ dispatch_set.ex_mask_.set_bit (handle);
+
+ self->dispatch (1, dispatch_set);
+ }
+}
+
+void
+ACE_FlReactor::fl_timeout_proc (void* reactor)
+{
+ ACE_FlReactor *self = static_cast<ACE_FlReactor *> (reactor);
+
+ // Deal with any timer events
+ ACE_Select_Reactor_Handle_Set handle_set;
+ self->dispatch (0, handle_set);
+ self->reset_timeout ();
+}
+
+
+int
+ACE_FlReactor::register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_FlReactor::register_handler_i");
+
+ int result = ACE_Select_Reactor::register_handler_i (handle,
+ handler, mask);
+ if (result == -1)
+ return -1;
+
+ int condition = 0;
+
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, FL_READ);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, FL_WRITE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_SET_BITS (condition, FL_EXCEPT);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK))
+ ACE_SET_BITS (condition, FL_READ);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK))
+ {
+ ACE_SET_BITS (condition, FL_WRITE); // connected, you may write
+ ACE_SET_BITS (condition, FL_READ); // connected, you have data/err
+ }
+
+ if (condition != 0)
+ {
+ Fl::add_fd ((int)handle, // reinterpret_cast<int> (handle),
+ ACE_FlReactor::fl_io_proc,
+ this);
+ }
+ return 0;
+}
+
+int
+ACE_FlReactor::register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::register_handler_i (handles,
+ handler,
+ mask);
+}
+
+int
+ACE_FlReactor::remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_FlReactor::remove_handler_i");
+
+ // In the registration phase we registered first with
+ // ACE_Select_Reactor and then with X. Now we are now doing things
+ // in reverse order.
+
+ // First clean up the corresponding X11Input.
+ Fl::remove_fd ((int)handle); // reinterpret_cast<int> (handle);
+
+ // Now let the reactor do its work.
+ return ACE_Select_Reactor::remove_handler_i (handle,
+ mask);
+}
+
+int
+ACE_FlReactor::remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::remove_handler_i (handles,
+ mask);
+}
+
+// The following function ensures there's an Fl timeout for the first
+// timeout in the Reactor's Timer_Queue.
+
+void
+ACE_FlReactor::reset_timeout (void)
+{
+ ACE_Time_Value *max_wait_time =
+ this->timer_queue_->calculate_timeout (0);
+
+ if (max_wait_time != 0)
+ {
+ float t = max_wait_time->sec ()
+ + max_wait_time->usec () / 1000000.0F;
+ Fl::add_timeout (t,
+ ACE_FlReactor::fl_timeout_proc,
+ this);
+ }
+}
+
+int
+ACE_FlReactor::reset_timer_interval
+ (long timer_id,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_FlReactor::reset_timer_interval");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ int const result =
+ ACE_Select_Reactor::reset_timer_interval (timer_id,
+ interval);
+
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+long
+ACE_FlReactor::schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_FlReactor::schedule_timer");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ long result = ACE_Select_Reactor::schedule_timer (event_handler,
+ arg,
+ delay,
+ interval);
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+int
+ACE_FlReactor::cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_FlReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (handler,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+int
+ACE_FlReactor::cancel_timer (long timer_id,
+ const void **arg,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_FlReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (timer_id,
+ arg,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/FlReactor/FlReactor.h b/dep/acelite/ace/FlReactor/FlReactor.h
new file mode 100644
index 00000000000..6f67de88cb1
--- /dev/null
+++ b/dep/acelite/ace/FlReactor/FlReactor.h
@@ -0,0 +1,110 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file FlReactor.h
+ *
+ * $Id: FlReactor.h 82723 2008-09-16 09:35:44Z johnnyw $
+ *
+ * @author Carlos O'Ryan <coryan@cs.wustl.edu>
+ * @author Based in part in the ACE_XtReactor implementation by
+ * @author Eric C. Newton's <ecn@clark.net>
+ * @author Kirill Rybaltchenko <Kirill.Rybaltchenko@cern.ch>
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef ACE_FLREACTOR_H
+#define ACE_FLREACTOR_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/FlReactor/ACE_FlReactor_export.h"
+#include "ace/Select_Reactor.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_FlReactor
+ *
+ * @brief A Reactor implementation that uses the Fast-Light (FL) toolkit
+ * for event demultiplexing. This will let us integrate the FL
+ * toolkit with ACE and/or TAO.
+ *
+ * As many other GUI toolkits FL supports a minimal set of
+ * callbacks to handle event demultiplexing, namely simple methods
+ * to add file descriptors to the event demuxing set or timeout
+ * events. This class adapts this simple mechanisms so they are
+ * compatible with ACE's Reactor.
+ */
+class ACE_FlReactor_Export ACE_FlReactor : public ACE_Select_Reactor
+{
+
+public:
+ // = Initialization and termination methods.
+ ACE_FlReactor (size_t size = DEFAULT_SIZE,
+ bool restart = false,
+ ACE_Sig_Handler * = 0);
+ virtual ~ACE_FlReactor (void);
+
+ // = Timer operations.
+ virtual long schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval);
+ virtual int reset_timer_interval (long timer_id,
+ const ACE_Time_Value &interval);
+ virtual int cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close = 1);
+ virtual int cancel_timer (long timer_id,
+ const void **arg = 0,
+ int dont_call_handle_close = 1);
+
+protected:
+ // = Register timers/handles with Fl.
+ /// Register a single @a handler.
+ virtual int register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Register a set of <handlers>.
+ virtual int register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Remove the <handler> associated with this @a handle.
+ virtual int remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask);
+
+ /// Remove a set of <handles>.
+ virtual int remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask);
+
+ /// Wait for events to occur.
+ virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
+ ACE_Time_Value *);
+
+private:
+ /// This method ensures there's an Fl timeout for the first timeout
+ /// in the Reactor's Timer_Queue.
+ void reset_timeout (void);
+
+ // = Integrate with the FL callback function mechanism.
+ static void fl_io_proc (int fd, void*);
+ static void fl_timeout_proc (void*);
+
+ /// Deny access since member-wise won't work...
+ ACE_FlReactor (const ACE_FlReactor &);
+ ACE_FlReactor &operator = (const ACE_FlReactor &);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ACE_FLREACTOR_H */
diff --git a/dep/acelite/ace/FoxReactor/ACE_FoxReactor_export.h b/dep/acelite/ace/FoxReactor/ACE_FoxReactor_export.h
new file mode 100644
index 00000000000..641be964c46
--- /dev/null
+++ b/dep/acelite/ace/FoxReactor/ACE_FoxReactor_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: ACE_FoxReactor_export.h 80826 2008-03-04 14:51:23Z wotte $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s ACE_FoxReactor
+// ------------------------------
+#ifndef ACE_FOXREACTOR_EXPORT_H
+#define ACE_FOXREACTOR_EXPORT_H
+
+#include /**/ "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_FOXREACTOR_HAS_DLL)
+# define ACE_FOXREACTOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_FOXREACTOR_HAS_DLL */
+
+#if !defined (ACE_FOXREACTOR_HAS_DLL)
+# define ACE_FOXREACTOR_HAS_DLL 1
+#endif /* ! ACE_FOXREACTOR_HAS_DLL */
+
+#if defined (ACE_FOXREACTOR_HAS_DLL) && (ACE_FOXREACTOR_HAS_DLL == 1)
+# if defined (ACE_FOXREACTOR_BUILD_DLL)
+# define ACE_FoxReactor_Export ACE_Proper_Export_Flag
+# define ACE_FOXREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_FOXREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_FOXREACTOR_BUILD_DLL */
+# define ACE_FoxReactor_Export ACE_Proper_Import_Flag
+# define ACE_FOXREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_FOXREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_FOXREACTOR_BUILD_DLL */
+#else /* ACE_FOXREACTOR_HAS_DLL == 1 */
+# define ACE_FoxReactor_Export
+# define ACE_FOXREACTOR_SINGLETON_DECLARATION(T)
+# define ACE_FOXREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_FOXREACTOR_HAS_DLL == 1 */
+
+// Set ACE_FOXREACTOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_FOXREACTOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_FOXREACTOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_FOXREACTOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_FOXREACTOR_NTRACE */
+
+#if (ACE_FOXREACTOR_NTRACE == 1)
+# define ACE_FOXREACTOR_TRACE(X)
+#else /* (ACE_FOXREACTOR_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_FOXREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_FOXREACTOR_NTRACE == 1) */
+
+#endif /* ACE_FOXREACTOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/FoxReactor/FoxReactor.cpp b/dep/acelite/ace/FoxReactor/FoxReactor.cpp
new file mode 100644
index 00000000000..61b59a16c71
--- /dev/null
+++ b/dep/acelite/ace/FoxReactor/FoxReactor.cpp
@@ -0,0 +1,327 @@
+// $Id: FoxReactor.cpp 93117 2011-01-20 12:11:28Z mcorino $
+
+#include "ace/FoxReactor/FoxReactor.h"
+
+FXDEFMAP(ACE_FoxReactor) ACE_FoxReactorMap[]={
+ FXMAPFUNCS(SEL_IO_READ,0,MAXKEY,ACE_FoxReactor::onFileEvents),
+ FXMAPFUNCS(SEL_IO_WRITE,0,MAXKEY,ACE_FoxReactor::onFileEvents),
+ FXMAPFUNCS(SEL_IO_EXCEPT,0,MAXKEY,ACE_FoxReactor::onFileEvents),
+ FXMAPFUNCS(SEL_TIMEOUT,0,MAXKEY,ACE_FoxReactor::onTimerEvents),
+};
+
+FXIMPLEMENT(ACE_FoxReactor,FXObject,ACE_FoxReactorMap,ARRAYNUMBER(ACE_FoxReactorMap))
+
+ACE_ALLOC_HOOK_DEFINE (ACE_FoxReactor)
+
+// Must be called with lock held
+ACE_FoxReactor::ACE_FoxReactor (FXApp* a,
+ size_t size,
+ bool restart,
+ ACE_Sig_Handler *h)
+ : ACE_Select_Reactor (size, restart, h), fxapp(a)
+{
+ // When the ACE_Select_Reactor is constructed it creates the notify
+ // pipe and registers it with the register_handler_i() method. The
+ // FoxReactor overloads this method BUT because the
+ // register_handler_i occurs when constructing the base class
+ // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i()
+ // is called not the FoxReactor register_handler_i(). This means
+ // that the notify pipe is registered with the ACE_Select_Reactor
+ // event handling code not the FoxReactor and so notfications don't
+ // work. To get around this we simply close and re-opened the
+ // notification handler in the constructor of the FoxReactor.
+
+#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+ this->notify_handler_->close ();
+ this->notify_handler_->open (this, 0);
+#endif /* ACE_MT_SAFE */
+}
+
+ACE_FoxReactor::~ACE_FoxReactor (void)
+{
+}
+
+void ACE_FoxReactor::fxapplication(FXApp *a)
+{
+ fxapp=a;
+}
+
+// This is just the <wait_for_multiple_events> from ace/Reactor.cpp
+// but we use the Fox functions to wait for an event, not <select>
+
+int
+ACE_FoxReactor::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set,
+ ACE_Time_Value *max_wait_time)
+{
+ ACE_TRACE( "ACE_FoxReactor::wait_for_multiple_events" );
+
+ int nfound = 0;
+ do
+ {
+ max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time);
+ size_t width = this->handler_rep_.max_handlep1 ();
+ handle_set.rd_mask_ = this->wait_set_.rd_mask_;
+ handle_set.wr_mask_ = this->wait_set_.wr_mask_;
+ handle_set.ex_mask_ = this->wait_set_.ex_mask_;
+
+ nfound = FoxWaitForMultipleEvents (width,
+ handle_set,
+ max_wait_time);
+
+ } while( nfound == -1 && this->handle_error () > 0 );
+
+ if (nfound > 0)
+ {
+#if !defined (ACE_WIN32)
+ handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ());
+#endif /* ACE_WIN32 */
+ }
+
+ return nfound;
+ // Timed out or input available
+}
+
+int
+ACE_FoxReactor::FoxWaitForMultipleEvents (int width,
+ ACE_Select_Reactor_Handle_Set &wait_set,
+ ACE_Time_Value */*max_wait_time*/)
+{
+ // Check to make sure our handle's are all usable.
+ ACE_Select_Reactor_Handle_Set temp_set = wait_set;
+
+ if (ACE_OS::select (width,
+ temp_set.rd_mask_,
+ temp_set.wr_mask_,
+ temp_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero ) == -1)
+ return -1; // Bad file arguments...
+
+ // Qt processing.
+ this->fxapp->runOneEvent () ;
+
+ // Reset the width, in case it changed during the upcalls.
+ width = handler_rep_.max_handlep1 ();
+
+ // Now actually read the result needed by the <Select_Reactor> using
+ // <select>.
+ return ACE_OS::select(width,
+ wait_set.rd_mask_,
+ wait_set.wr_mask_,
+ wait_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero);
+}
+
+
+long ACE_FoxReactor::onFileEvents(FXObject* /* ob */, FXSelector se, void* handle){
+ FXSelector sel=FXSELTYPE(se);
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+ bool f=false;
+ if(sel==SEL_IO_READ){
+ dispatch_set.rd_mask_.set_bit(ACE_HANDLE(reinterpret_cast<FXival>(handle)));
+ f=true;
+ }
+ else
+ if(sel==SEL_IO_WRITE){
+ dispatch_set.wr_mask_.set_bit(ACE_HANDLE(reinterpret_cast<FXival>(handle)));
+ f=true;
+ }
+ else
+ if(sel==SEL_IO_EXCEPT){
+ dispatch_set.ex_mask_.set_bit(ACE_HANDLE(reinterpret_cast<FXival>(handle)));
+ f=true;
+ };
+ if(f) dispatch (1, dispatch_set);
+
+ return 1;
+}
+
+long ACE_FoxReactor::onTimerEvents(FXObject* /* ob */, FXSelector /* sel */, void* /* handle */)
+{
+ // Deal with any timer events
+ ACE_Select_Reactor_Handle_Set handle_set;
+ this->dispatch (0, handle_set );
+
+ // Set next timeout signal
+ this->reset_timeout ();
+
+ return 0;
+}
+
+int
+ACE_FoxReactor::register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_FoxReactor::register_handler_i");
+
+ int const result = ACE_Select_Reactor::register_handler_i (handle,
+ handler, mask);
+ if (result == -1)
+ return -1;
+
+ unsigned long condition = 0;
+
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_READ);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_WRITE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_EXCEPT);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_READ);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK))
+ {
+ ACE_SET_BITS (condition, FX::INPUT_WRITE); // connected, you may write
+ ACE_SET_BITS (condition, FX::INPUT_READ); // connected, you have data/err
+ }
+
+ if (condition != 0)
+ {
+ fxapp->addInput(handle, condition, this, 0);
+ }
+ return 0;
+}
+
+int
+ACE_FoxReactor::register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::register_handler_i (handles, handler, mask);
+}
+
+int
+ACE_FoxReactor::remove_handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_FoxReactor::remove_handler_i");
+
+ // In the registration phase we registered first with
+ // ACE_Select_Reactor and then with X. Now we are now doing things
+ // in reverse order.
+
+ int condition = 0;
+
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_READ);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_WRITE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_EXCEPT);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK))
+ ACE_SET_BITS (condition, FX::INPUT_READ);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK))
+ {
+ ACE_SET_BITS (condition, FX::INPUT_WRITE); // connected, you may write
+ ACE_SET_BITS (condition, FX::INPUT_READ); // connected, you have data/err
+ }
+
+ // First clean up the corresponding X11Input.
+ fxapp->removeInput ((int)handle,condition); // ACE_reinterpret_cast(int,handle));
+
+ // Now let the reactor do its work.
+ return ACE_Select_Reactor::remove_handler_i (handle, mask);
+}
+
+int
+ACE_FoxReactor::remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::remove_handler_i (handles, mask);
+}
+
+// The following function ensures there's an Fox timeout for the first
+// timeout in the Reactor's Timer_Queue.
+
+void
+ACE_FoxReactor::reset_timeout (void)
+{
+ ACE_Time_Value *max_wait_time =
+ this->timer_queue_->calculate_timeout (0);
+
+ if (max_wait_time != 0)
+ {
+ float t = max_wait_time->sec () +
+ max_wait_time->usec () / 1000000.0F;
+ fxapp->addTimeout (this, 0, t*1000);
+ }
+}
+
+int
+ACE_FoxReactor::reset_timer_interval
+ (long timer_id,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_FoxReactor::reset_timer_interval");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ int const result =
+ ACE_Select_Reactor::reset_timer_interval (timer_id,
+ interval);
+
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+long
+ACE_FoxReactor::schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_FoxReactor::schedule_timer");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ long result = ACE_Select_Reactor::schedule_timer (event_handler,
+ arg,
+ delay,
+ interval);
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+int
+ACE_FoxReactor::cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_FoxReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (handler,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+int
+ACE_FoxReactor::cancel_timer (long timer_id,
+ const void **arg,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_FoxReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (timer_id,
+ arg,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
diff --git a/dep/acelite/ace/FoxReactor/FoxReactor.h b/dep/acelite/ace/FoxReactor/FoxReactor.h
new file mode 100644
index 00000000000..e284441e555
--- /dev/null
+++ b/dep/acelite/ace/FoxReactor/FoxReactor.h
@@ -0,0 +1,112 @@
+/* -*- C-*- */
+
+//=============================================================================
+/**
+ * @file FoxReactor.h
+ *
+ * $Id: FoxReactor.h 93117 2011-01-20 12:11:28Z mcorino $
+ *
+ * @author Dmitriy Nikitinskiy <nick@bel.ru>
+ * @author Based in part in the ACE_XtReactor implementation by
+ * @author Eric C. Newton's <ecn@clark.net>
+ * @author Kirill Rybaltchenko <Kirill.Rybaltchenko@cern.ch>
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef ACE_FOXREACTOR_H
+#define ACE_FOXREACTOR_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Select_Reactor.h"
+#include "ace/FoxReactor/ACE_FoxReactor_export.h"
+
+#include <fx.h>
+
+/**
+ * @class ACE_FoxReactor
+ *
+ * @brief A Reactor implementation that uses the FOX toolkit (www.fox-toolkit.org)
+ * for event demultiplexing. This will let us integrate the FOX
+ * toolkit with ACE and/or TAO.
+ *
+ */
+class ACE_FoxReactor_Export ACE_FoxReactor : public FXObject, public ACE_Select_Reactor
+{
+ FXDECLARE(ACE_FoxReactor)
+public:
+ // = Initialization and termination methods.
+ ACE_FoxReactor (FXApp* a=0,
+ size_t size = DEFAULT_SIZE,
+ bool restart = false,
+ ACE_Sig_Handler * = 0);
+ virtual ~ACE_FoxReactor (void);
+
+ void fxapplication(FXApp* a);
+
+ // = Timer operations.
+ virtual long schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval);
+ virtual int reset_timer_interval (long timer_id,
+ const ACE_Time_Value &interval);
+ virtual int cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close = 1);
+ virtual int cancel_timer (long timer_id,
+ const void **arg = 0,
+ int dont_call_handle_close = 1);
+
+ // = Integrate with the Fox callback function mechanism.
+ long onFileEvents (FXObject*, FXSelector, void*);
+ long onTimerEvents (FXObject*, FXSelector, void*);
+
+
+protected:
+ // = Register timers/handles with Fox.
+ /// Register a single @a handler.
+ virtual int register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Register a set of <handlers>.
+ virtual int register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Remove the <handler> associated with this @a handle.
+ virtual int remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask);
+
+ /// Remove a set of <handles>.
+ virtual int remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask);
+
+ /// Wait for events to occur.
+ virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
+ ACE_Time_Value *);
+
+ int FoxWaitForMultipleEvents (int,ACE_Select_Reactor_Handle_Set &,ACE_Time_Value *);
+
+private:
+ /// This method ensures there's an Fox timeout for the first timeout
+ /// in the Reactor's Timer_Queue.
+ void reset_timeout (void);
+
+ FXApp *fxapp;
+
+ /// Deny access since member-wise won't work...
+ ACE_FoxReactor (const ACE_FoxReactor &);
+ ACE_FoxReactor &operator = (const ACE_FoxReactor &);
+};
+
+#include /**/ "ace/post.h"
+#endif /* ACE_FOXREACTOR_H */
+
diff --git a/dep/acelite/ace/Functor.cpp b/dep/acelite/ace/Functor.cpp
index 4f12670e83e..09e80a587a9 100644
--- a/dep/acelite/ace/Functor.cpp
+++ b/dep/acelite/ace/Functor.cpp
@@ -3,7 +3,7 @@
/**
* @file Functor.cpp
*
- * $Id: Functor.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+ * $Id: Functor.cpp 95332 2011-12-15 11:09:41Z mcorino $
*
* Non-inlinable method definitions for non-templatized classes
* and template specializations implementing the GOF Command Pattern,
@@ -40,4 +40,14 @@ ACE_Command_Base::~ACE_Command_Base (void)
{
}
+ACE_Noop_Command::ACE_Noop_Command()
+{
+}
+
+int
+ACE_Noop_Command::execute(void*)
+{
+ return 0;
+}
+
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Functor.h b/dep/acelite/ace/Functor.h
index cb01630e2fc..0241dc7d8fe 100644
--- a/dep/acelite/ace/Functor.h
+++ b/dep/acelite/ace/Functor.h
@@ -4,7 +4,7 @@
/**
* @file Functor.h
*
- * $Id: Functor.h 92069 2010-09-28 11:38:59Z johnnyw $
+ * $Id: Functor.h 95761 2012-05-15 18:23:04Z johnnyw $
*
* Non-templatized classes and class template specializations for
* implementing function objects that are used in various places
@@ -77,6 +77,23 @@ public:
virtual int execute (void *arg = 0) = 0;
};
+/**
+ * @class ACE_Noop_Command
+ *
+ * Implements a ACE_Command_Base with an empty execute() body.
+ */
+
+class ACE_Export ACE_Noop_Command
+ : public ACE_Command_Base
+{
+public:
+ /// Constructor
+ ACE_Noop_Command();
+
+ /// Implement the empty execute() member function
+ virtual int execute(void*);
+};
+
////////////////////////////////////////////////////////////
// STL-style Functor Classes and Template Specializations //
////////////////////////////////////////////////////////////
@@ -187,7 +204,7 @@ public:
unsigned long operator () (unsigned long t) const;
};
-#if !defined (ACE_LACKS_LONGLONG_T) && (ACE_SIZEOF_LONG < 8)
+#if (ACE_SIZEOF_LONG < 8)
/**
* @brief Function object for hashing a signed 64-bit number
*/
@@ -198,10 +215,8 @@ public:
/// Simply returns t
unsigned long operator () (ACE_INT64 t) const;
};
-#endif /* !ACE_LACKS_LONGLONG_T && ACE_SIZEOF_LONG < 8 */
+#endif /* ACE_SIZEOF_LONG < 8 */
-// We can do this even if ACE_LACKS_UNSIGNEDLONGLONG_T because there's an
-// emulation for it in ACE_U_LongLong.
#if (ACE_SIZEOF_LONG < 8)
/**
* @brief Function object for hashing an unsigned 64-bit number
diff --git a/dep/acelite/ace/Functor.inl b/dep/acelite/ace/Functor.inl
index 46fb002178f..0c4777c48ea 100644
--- a/dep/acelite/ace/Functor.inl
+++ b/dep/acelite/ace/Functor.inl
@@ -4,7 +4,7 @@
/**
* @file Functor.inl
*
- * $Id: Functor.inl 92069 2010-09-28 11:38:59Z johnnyw $
+ * $Id: Functor.inl 95763 2012-05-16 06:43:51Z johnnyw $
*
* Inlinable method definitions for non-templatized classes
* and template specializations implementing the GOF Command Pattern,
@@ -108,13 +108,13 @@ ACE_Hash<unsigned long>::operator () (unsigned long t) const
}
// This #if needs to match the one in Functor.h
-#if !defined (ACE_LACKS_LONGLONG_T) && (ACE_SIZEOF_LONG < 8)
+#if (ACE_SIZEOF_LONG < 8)
ACE_INLINE unsigned long
ACE_Hash<ACE_INT64>::operator () (ACE_INT64 t) const
{
return static_cast<unsigned long> (t);
}
-#endif /* !ACE_LACKS_LONGLONG_T && ACE_SIZEOF_LONG < 8 */
+#endif /* ACE_SIZEOF_LONG < 8 */
#if (ACE_SIZEOF_LONG < 8)
ACE_INLINE unsigned long
@@ -126,7 +126,7 @@ ACE_Hash<ACE_UINT64>::operator () (const ACE_UINT64 &t) const
return static_cast<unsigned long> (t);
#endif /* ACE_SIZEOF_LONG */
}
-#endif /* !ACE_LACKS_UNSIGNEDLONGLONG_T */
+#endif /* ACE_SIZEOF_LONG < 8 */
ACE_INLINE unsigned long
ACE_Hash<const char *>::operator () (const char *t) const
diff --git a/dep/acelite/ace/Functor_String.h b/dep/acelite/ace/Functor_String.h
index 2adf561a65f..4a2abb512f0 100644
--- a/dep/acelite/ace/Functor_String.h
+++ b/dep/acelite/ace/Functor_String.h
@@ -4,7 +4,7 @@
/**
* @file Functor_String.h
*
- * $Id: Functor_String.h 86698 2009-09-13 15:58:17Z johnnyw $
+ * $Id: Functor_String.h 93411 2011-02-18 22:21:16Z hillj $
*
* Class template specializations for ACE_*String types implementing
* function objects that are used in various places in ATC. They
@@ -25,6 +25,7 @@
#include /**/ "ace/ACE_export.h"
#include "ace/SStringfwd.h"
+#include <string>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -77,6 +78,44 @@ public:
const ACE_CString &rhs) const;
};
+/**
+ * @brief Function object for determining whether two std::strings are
+ * equal.
+ */
+template<>
+class ACE_Export ACE_Equal_To<std::string>
+{
+public:
+ int operator () (const std::string &lhs,
+ const std::string &rhs) const;
+};
+
+
+/**
+ * @brief Function object for hashing a std::string
+ */
+template<>
+class ACE_Export ACE_Hash<std::string>
+{
+public:
+ /// Calls ACE::hash_pjw
+ unsigned long operator () (const std::string &lhs) const;
+};
+
+
+/**
+ * @brief Function object for determining whether the first const string
+ * is less than the second const string.
+ */
+template<>
+class ACE_Export ACE_Less_Than<std::string>
+{
+public:
+ /// Simply calls std::string::compare
+ int operator () (const std::string &lhs,
+ const std::string &rhs) const;
+};
+
#if defined (ACE_USES_WCHAR)
diff --git a/dep/acelite/ace/Functor_String.inl b/dep/acelite/ace/Functor_String.inl
index bdac96386f8..045cd05f780 100644
--- a/dep/acelite/ace/Functor_String.inl
+++ b/dep/acelite/ace/Functor_String.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Functor_String.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Functor_String.inl 93411 2011-02-18 22:21:16Z hillj $
#include "ace/ACE.h"
#include "ace/String_Base.h"
@@ -28,6 +28,26 @@ ACE_Less_Than<ACE_CString>::operator () (const ACE_CString &lhs,
return (lhs < rhs);
}
+ACE_INLINE unsigned long
+ACE_Hash<std::string>::operator () (const std::string &t) const
+{
+ return ACE::hash_pjw (t.c_str (), t.length ());
+}
+
+
+ACE_INLINE int
+ACE_Equal_To<std::string>::operator () (const std::string &lhs,
+ const std::string &rhs) const
+{
+ return lhs == rhs;
+}
+
+ACE_INLINE int
+ACE_Less_Than<std::string>::operator () (const std::string &lhs,
+ const std::string &rhs) const
+{
+ return (lhs < rhs);
+}
#if defined (ACE_USES_WCHAR)
ACE_INLINE unsigned long
diff --git a/dep/acelite/ace/Functor_T.h b/dep/acelite/ace/Functor_T.h
index ff087d2019e..6dfbbcff6b1 100644
--- a/dep/acelite/ace/Functor_T.h
+++ b/dep/acelite/ace/Functor_T.h
@@ -4,7 +4,7 @@
/**
* @file Functor_T.h
*
- * $Id: Functor_T.h 91396 2010-08-19 12:37:24Z johnnyw $
+ * $Id: Functor_T.h 95332 2011-12-15 11:09:41Z mcorino $
*
* Templatized classes for implementing function objects that are
* used in various places in ACE. There are currently two major
@@ -79,6 +79,38 @@ private:
ACTION action_;
};
+/**
+ * @class ACE_Member_Function_Command
+ *
+ * @brief Defines a class template that allows us to invoke a member
+ * function using the GoF command style callback.
+ *
+ */
+template <class RECEIVER>
+class ACE_Member_Function_Command : public ACE_Command_Base
+{
+public:
+ typedef void (RECEIVER::*PTMF)(void);
+
+ /// Con Constructor: sets the <receiver_> of the Command to recvr, and the
+ /// <action_> of the Command to <action>.
+ ACE_Member_Function_Command (RECEIVER &recvr, PTMF ptmf);
+
+ /// Virtual destructor.
+ virtual ~ACE_Member_Function_Command (void);
+
+ /// Invokes the method <action_> from the object <receiver_>. The
+ /// parameter is ignored
+ virtual int execute (void *);
+
+private:
+ /// Object where the method resides.
+ RECEIVER &receiver_;
+
+ /// Method that is going to be invoked.
+ PTMF ptmf_;
+};
+
/////////////////////////////////
// STL-style Functor Templates //
/////////////////////////////////
diff --git a/dep/acelite/ace/Functor_T.inl b/dep/acelite/ace/Functor_T.inl
index 35cfed5b798..1b303210cad 100644
--- a/dep/acelite/ace/Functor_T.inl
+++ b/dep/acelite/ace/Functor_T.inl
@@ -1,9 +1,30 @@
// -*- C++ -*-
//
-// $Id: Functor_T.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Functor_T.inl 95332 2011-12-15 11:09:41Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+template<class RECEIVER> ACE_INLINE
+ACE_Member_Function_Command<RECEIVER>::
+ACE_Member_Function_Command (RECEIVER &recvr, PTMF ptmf)
+ : receiver_(recvr)
+ , ptmf_(ptmf)
+{
+}
+
+template<class RECEIVER> ACE_INLINE
+ACE_Member_Function_Command<RECEIVER>::
+~ACE_Member_Function_Command (void)
+{
+}
+
+template<class RECEIVER> ACE_INLINE int
+ACE_Member_Function_Command<RECEIVER>::execute (void *)
+{
+ (this->receiver_.*ptmf_)();
+ return 0;
+}
+
template <class TYPE> ACE_INLINE unsigned long
ACE_Hash<TYPE>::operator () (const TYPE &t) const
{
diff --git a/dep/acelite/ace/Future.cpp b/dep/acelite/ace/Future.cpp
index 5ebb550a68c..6544c118582 100644
--- a/dep/acelite/ace/Future.cpp
+++ b/dep/acelite/ace/Future.cpp
@@ -1,4 +1,4 @@
- // $Id: Future.cpp 91626 2010-09-07 10:59:20Z johnnyw $
+ // $Id: Future.cpp 95706 2012-04-18 06:42:16Z johnnyw $
#ifndef ACE_FUTURE_CPP
#define ACE_FUTURE_CPP
@@ -98,7 +98,7 @@ ACE_Future_Rep<T>::attach (ACE_Future_Rep<T>*& rep)
{
ACE_ASSERT (rep != 0);
// Use value_ready_mutex_ for both condition and ref count management
-// ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, r_mon, rep->value_ready_mutex_, 0);
+ ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, r_mon, rep->value_ready_mutex_, 0);
++rep->ref_count_;
return rep;
}
diff --git a/dep/acelite/ace/Future_Set.cpp b/dep/acelite/ace/Future_Set.cpp
index 986ce948c34..1ba1fd6be66 100644
--- a/dep/acelite/ace/Future_Set.cpp
+++ b/dep/acelite/ace/Future_Set.cpp
@@ -1,4 +1,4 @@
-// $Id: Future_Set.cpp 91626 2010-09-07 10:59:20Z johnnyw $
+// $Id: Future_Set.cpp 92900 2010-12-17 14:45:11Z mcorino $
#ifndef ACE_FUTURE_SET_CPP
#define ACE_FUTURE_SET_CPP
@@ -117,7 +117,7 @@ ACE_Future_Set<T>::next_readable (ACE_Future<T> &future,
return 0;
// Remove the hash map entry with the specified future rep from our map.
- FUTURE_HOLDER *future_holder;
+ FUTURE_HOLDER *future_holder = 0;
if (this->future_map_.find (future_rep,
future_holder) != -1)
{
diff --git a/dep/acelite/ace/Get_Opt.cpp b/dep/acelite/ace/Get_Opt.cpp
index 5953abe1810..90355f91a1b 100644
--- a/dep/acelite/ace/Get_Opt.cpp
+++ b/dep/acelite/ace/Get_Opt.cpp
@@ -1,4 +1,4 @@
-// $Id: Get_Opt.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Get_Opt.cpp 95710 2012-04-25 07:02:50Z johnnyw $
#include "ace/Get_Opt.h"
diff --git a/dep/acelite/ace/Get_Opt.inl b/dep/acelite/ace/Get_Opt.inl
index e307fb5e400..1f915184716 100644
--- a/dep/acelite/ace/Get_Opt.inl
+++ b/dep/acelite/ace/Get_Opt.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: Get_Opt.inl 81840 2008-06-05 13:46:45Z sma $
+// $Id: Get_Opt.inl 93736 2011-04-05 12:38:35Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Global_Macros.h b/dep/acelite/ace/Global_Macros.h
index bce0544e1a6..b18a5482e52 100644
--- a/dep/acelite/ace/Global_Macros.h
+++ b/dep/acelite/ace/Global_Macros.h
@@ -4,7 +4,7 @@
/**
* @file Global_Macros.h
*
- * $Id: Global_Macros.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: Global_Macros.h 96084 2012-08-20 18:07:57Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -166,7 +166,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL
/* Using ACE_UNEXPECTED_RETURNS is ill-advised because, in many cases,
* it fails to inform callers of the error condition.
- * It exists mainly to provide back-compatibility with old, dangerous,
+ * It exists mainly to provide back-compatibility with old, dangegrous,
* incorrect behavior.
* Code that previously used ACE_GUARD() or ACE_GUARD_RETURN() to return
* upon failure to acquire a lock can now use:
@@ -905,7 +905,7 @@ ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (AC
} while (0)
#endif /* defined ACE_LACKS_ARRAY_PLACEMENT_NEW */
-// This is being placed here temporarily to help stablelize the builds, but will
+// This is being placed here temporarily to help stabilize the builds, but will
// be moved out along with the above macros as part of the subsetting. dhinton
#if !defined (ACE_LACKS_NEW_H)
# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB)
diff --git a/dep/acelite/ace/Guard_T.cpp b/dep/acelite/ace/Guard_T.cpp
index 90321c6ac4e..25c31ce0379 100644
--- a/dep/acelite/ace/Guard_T.cpp
+++ b/dep/acelite/ace/Guard_T.cpp
@@ -1,10 +1,9 @@
-// $Id: Guard_T.cpp 92052 2010-09-27 14:20:22Z vzykov $
+// $Id: Guard_T.cpp 93736 2011-04-05 12:38:35Z johnnyw $
#ifndef ACE_GUARD_T_CPP
#define ACE_GUARD_T_CPP
// FUZZ: disable check_for_ACE_Guard
-
#include "ace/Guard_T.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
diff --git a/dep/acelite/ace/Guard_T.h b/dep/acelite/ace/Guard_T.h
index 5120d3f7a57..da06e1573f4 100644
--- a/dep/acelite/ace/Guard_T.h
+++ b/dep/acelite/ace/Guard_T.h
@@ -4,7 +4,7 @@
/**
* @file Guard_T.h
*
- * $Id: Guard_T.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Guard_T.h 93792 2011-04-07 11:48:50Z mcorino $
*
* Moved from Synch.h.
*
@@ -36,9 +36,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* function... It performs automatic acquisition and release of
* a parameterized synchronization object ACE_LOCK.
*
- * The <ACE_LOCK> class given as an actual parameter must provide, at
- * the very least the <acquire>, <tryacquire>, <release>, and
- * <remove> methods.
+ * The ACE_LOCK class given as an actual parameter must provide, at
+ * the very least the acquire(), tryacquire(), release(), and
+ * remove() methods.
*
* @warning A successfully constructed ACE_Guard does NOT mean that the
* lock was acquired! It is the caller's responsibility, after
@@ -72,11 +72,11 @@ public:
ACE_Guard (ACE_LOCK &l);
/// Implicitly and automatically acquire (or try to acquire) the
- /// lock. If @a block is non-0 then <acquire> the <ACE_LOCK>, else
- /// <tryacquire> it.
+ /// lock. If @a block is non-0 then acquire() the ACE_LOCK, else
+ /// tryacquire() it.
ACE_Guard (ACE_LOCK &l, bool block);
- /// Initialise the guard without implicitly acquiring the lock. The
+ /// Initialize the guard without implicitly acquiring the lock. The
/// @a become_owner parameter indicates whether the guard should release
/// the lock implicitly on destruction. The @a block parameter is
/// ignored and is used here to disambiguate with the preceding
diff --git a/dep/acelite/ace/Guard_T.inl b/dep/acelite/ace/Guard_T.inl
index 9c313a0fa2c..34b2b777f66 100644
--- a/dep/acelite/ace/Guard_T.inl
+++ b/dep/acelite/ace/Guard_T.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: Guard_T.inl 91626 2010-09-07 10:59:20Z johnnyw $
+// $Id: Guard_T.inl 93736 2011-04-05 12:38:35Z johnnyw $
// FUZZ: disable check_for_ACE_Guard
diff --git a/dep/acelite/ace/Handle_Set.cpp b/dep/acelite/ace/Handle_Set.cpp
index ba64fb3443f..4c9b6b56017 100644
--- a/dep/acelite/ace/Handle_Set.cpp
+++ b/dep/acelite/ace/Handle_Set.cpp
@@ -1,5 +1,5 @@
// Handle_Set.cpp
-// $Id: Handle_Set.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Handle_Set.cpp 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/Handle_Set.h"
@@ -9,8 +9,6 @@
#include "ace/OS_NS_string.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Handle_Set)
@@ -24,12 +22,12 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Handle_Set)
# define ACE_MSB_MASK (~((fd_mask) 1 << (NFDBITS - 1)))
#endif /* ! ACE_WIN32 */
-#if defined (linux) && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !defined (_XOPEN_SOURCE)
+#if defined (ACE_LINUX) && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !defined (_XOPEN_SOURCE)
// XPG4.2 requires the fds_bits member name, so it is not enabled by
// default on Linux/glibc-2.1.x systems. Instead use "__fds_bits."
// Ugly, but "what are you going to do?" 8-)
#define fds_bits __fds_bits
-#endif /* linux && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !_XOPEN_SOURCE */
+#endif /* ACE_LINUX && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !_XOPEN_SOURCE */
void
ACE_Handle_Set::dump (void) const
@@ -226,24 +224,11 @@ ACE_Handle_Set::set_max (ACE_HANDLE current_max)
maskp[i] == 0;
i--)
continue;
-#if defined (ACE_TANDEM_NSK_BIT_ORDER)
- // bits are in reverse order, MSB (sign bit) = bit 0.
- this->max_handle_ = ACE_MULT_BY_WORDSIZE (i);
- for (fd_mask val = maskp[i];
- (val & ACE_MSB_MASK) != 0;
- val = (val << 1))
- ++this->max_handle_;
-#elif 1 /* !defined(ACE_HAS_BIG_FD_SET) */
this->max_handle_ = ACE_MULT_BY_WORDSIZE (i);
for (fd_mask val = maskp[i];
(val & ~1) != 0; // This obscure code is needed since "bit 0" is in location 1...
val = (val >> 1) & ACE_MSB_MASK)
++this->max_handle_;
-#else
- register u_long val = this->mask_.fds_bits[i];
- this->max_handle_ = ACE_MULT_BY_WORDSIZE (i)
- + ACE_Handle_Set::bitpos(val & ~(val - 1));
-#endif /* 1 */
}
// Do some sanity checking...
@@ -312,12 +297,7 @@ ACE_Handle_Set_Iterator::operator () (void)
// Increment the iterator and advance to the next bit in this
// word.
this->handle_index_++;
-#if defined (ACE_TANDEM_NSK_BIT_ORDER)
- // bits are in reverse order, MSB (sign bit) = bit 0.
- this->word_val_ = (this->word_val_ << 1);
-# else
this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK;
-# endif /* ACE_TANDEM_NSK_BIT_ORDER */
// If we've examined all the bits in this word, we'll go onto
// the next word.
@@ -353,19 +333,10 @@ ACE_Handle_Set_Iterator::operator () (void)
// bit enabled, keeping track of which <handle_index> this
// represents (this information is used by subsequent calls to
// <operator()>).
-
-#if defined (ACE_TANDEM_NSK_BIT_ORDER)
- // bits are in reverse order, MSB (sign bit) = bit 0.
- for (;
- this->word_val_ > 0;
- this->word_val_ = (this->word_val_ << 1))
- this->handle_index_++;
-# else
for (;
ACE_BIT_DISABLED (this->word_val_, 1);
this->handle_index_++)
this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK;
-# endif /* ACE_TANDEM_NSK_BIT_ORDER */
return result;
}
@@ -435,6 +406,7 @@ ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator (const ACE_Handle_Set &hs)
handle_index_ (0),
word_num_ (-1)
#elif defined (ACE_HAS_BIG_FD_SET)
+ handle_index_ (0),
oldlsb_ (0),
word_max_ (hs.max_handle_ == ACE_INVALID_HANDLE
? 0
@@ -466,19 +438,11 @@ ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator (const ACE_Handle_Set &hs)
// Loop until we get <word_val_> to have its least significant bit
// enabled, keeping track of which <handle_index> this represents
// (this information is used by <operator()>).
-#if defined (ACE_TANDEM_NSK_BIT_ORDER)
- // bits are in reverse order, MSB (sign bit) = bit 0.
- for (this->word_val_ = maskp[this->word_num_];
- this->word_val_ > 0;
- this->word_val_ = (this->word_val_ << 1))
- this->handle_index_++;
-# else
for (this->word_val_ = maskp[this->word_num_];
ACE_BIT_DISABLED (this->word_val_, 1)
&& this->handle_index_ < maxhandlep1;
this->handle_index_++)
this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK;
-# endif /* ACE_TANDEM_NSK_BIT_ORDER */
#elif !defined (ACE_WIN32) && defined (ACE_HAS_BIG_FD_SET)
if (this->word_max_==0)
{
@@ -494,7 +458,6 @@ ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator (const ACE_Handle_Set &hs)
#endif /* !ACE_WIN32 && !ACE_HAS_BIG_FD_SET */
}
-
void
ACE_Handle_Set_Iterator::reset_state (void)
{
@@ -534,19 +497,11 @@ ACE_Handle_Set_Iterator::reset_state (void)
// Loop until we get <word_val_> to have its least significant bit
// enabled, keeping track of which <handle_index> this represents
// (this information is used by <operator()>).
-#if defined (ACE_TANDEM_NSK_BIT_ORDER)
- // bits are in reverse order, MSB (sign bit) = bit 0.
- for (this->word_val_ = maskp[this->word_num_];
- this->word_val_ > 0;
- this->word_val_ = (this->word_val_ << 1))
- this->handle_index_++;
-# else
for (this->word_val_ = maskp[this->word_num_];
ACE_BIT_DISABLED (this->word_val_, 1)
&& this->handle_index_ < maxhandlep1;
this->handle_index_++)
this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK;
-# endif /* ACE_TANDEM_NSK_BIT_ORDER */
#elif !defined (ACE_WIN32) && defined (ACE_HAS_BIG_FD_SET)
if (this->word_max_==0)
{
diff --git a/dep/acelite/ace/Handle_Set.h b/dep/acelite/ace/Handle_Set.h
index 0de5c98ea4f..97b3042a6a1 100644
--- a/dep/acelite/ace/Handle_Set.h
+++ b/dep/acelite/ace/Handle_Set.h
@@ -4,7 +4,7 @@
/**
* @file Handle_Set.h
*
- * $Id: Handle_Set.h 92298 2010-10-21 11:15:17Z johnnyw $
+ * $Id: Handle_Set.h 93736 2011-04-05 12:38:35Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -58,7 +58,6 @@ public:
MAXSIZE = ACE_DEFAULT_SELECT_REACTOR_SIZE
};
- // = Initialization methods.
/// Constructor, initializes the bitmask to all 0s.
ACE_Handle_Set (void);
diff --git a/dep/acelite/ace/Handle_Set.inl b/dep/acelite/ace/Handle_Set.inl
index 7e669d4fd2d..fd401caa628 100644
--- a/dep/acelite/ace/Handle_Set.inl
+++ b/dep/acelite/ace/Handle_Set.inl
@@ -1,21 +1,9 @@
// -*- C++ -*-
//
-// $Id: Handle_Set.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Handle_Set.inl 96017 2012-08-08 22:18:09Z mitza $
#include "ace/Log_Msg.h"
-// todo: This should be cleaned up a bit.
-// memset for FD_ZERO on OpenBSD and Solaris w/ gcc 2.95.3
-#include "ace/os_include/os_string.h"
-
-// FreeBSD 4.8-RC? for bzero() used by FD_ZERO
-#include "ace/os_include/os_strings.h"
-
-// IRIX5 defines bzero() in this odd file... used by FD_ZERO
-#if defined (ACE_HAS_BSTRING)
-# include /**/ <bstring.h>
-#endif /* ACE_HAS_BSTRING */
-
// AIX defines bzero() in this odd file... used by FD_ZERO
#if defined (ACE_HAS_STRINGS)
# include "ace/os_include/os_strings.h"
@@ -87,6 +75,8 @@ ACE_Handle_Set::is_set (ACE_HANDLE handle) const
#elif defined (ACE_HAS_NONCONST_FD_ISSET)
return FD_ISSET (handle,
const_cast<fd_set*> (&this->mask_));
+#elif defined (ACE_VXWORKS) && ACE_VXWORKS >= 0x690
+ return static_cast<int> (FD_ISSET (handle, &this->mask_));
#else
return FD_ISSET (handle,
&this->mask_);
diff --git a/dep/acelite/ace/Hash_Cache_Map_Manager_T.cpp b/dep/acelite/ace/Hash_Cache_Map_Manager_T.cpp
index ad333543ade..19478977569 100644
--- a/dep/acelite/ace/Hash_Cache_Map_Manager_T.cpp
+++ b/dep/acelite/ace/Hash_Cache_Map_Manager_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Hash_Cache_Map_Manager_T.cpp 92097 2010-09-30 05:41:49Z msmit $
+// $Id: Hash_Cache_Map_Manager_T.cpp 93359 2011-02-11 11:33:12Z mcorino $
#ifndef ACE_HASH_CACHE_MAP_MANAGER_T_CPP
#define ACE_HASH_CACHE_MAP_MANAGER_T_CPP
@@ -17,11 +17,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Hash_Cache_Map_Manager)
-#define ACE_T1 class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES
-#define ACE_T2 KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES
-
-template <ACE_T1>
-ACE_Hash_Cache_Map_Manager<ACE_T2>::ACE_Hash_Cache_Map_Manager (CACHING_STRATEGY &caching_s,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::ACE_Hash_Cache_Map_Manager (CACHING_STRATEGY &caching_s,
size_t size,
ACE_Allocator *alloc)
: ACE_HCMM_BASE (caching_s,
@@ -30,13 +27,13 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::ACE_Hash_Cache_Map_Manager (CACHING_STRATEGY
{
}
-template <ACE_T1>
-ACE_Hash_Cache_Map_Manager<ACE_T2>::~ACE_Hash_Cache_Map_Manager (void)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::~ACE_Hash_Cache_Map_Manager (void)
{
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::bind (const KEY &key,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::bind (const KEY &key,
const VALUE &value,
CACHE_ENTRY *&entry)
{
@@ -71,8 +68,8 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::bind (const KEY &key,
return bind_result;
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::rebind (const KEY &key,
const VALUE &value,
CACHE_ENTRY *&entry)
{
@@ -109,8 +106,8 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
return rebind_result;
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::trybind (const KEY &key,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::trybind (const KEY &key,
VALUE &value,
CACHE_ENTRY *&entry)
{
@@ -152,8 +149,8 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::trybind (const KEY &key,
return trybind_result;
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::find (const KEY &key,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::find (const KEY &key,
CACHE_ENTRY *&entry)
{
// Lookup the key and populate the <value>.
@@ -178,8 +175,8 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::find (const KEY &key,
return find_result;
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::find (const KEY &key,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::find (const KEY &key,
VALUE &value)
{
CACHE_ENTRY *entry = 0;
@@ -195,8 +192,8 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::find (const KEY &key,
return result;
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::find (const KEY &key)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::find (const KEY &key)
{
CACHE_ENTRY *entry = 0;
@@ -204,8 +201,8 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::find (const KEY &key)
entry);
}
-template <ACE_T1> int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::unbind (CACHE_ENTRY *entry)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::unbind (CACHE_ENTRY *entry)
{
// Remove the entry from the cache.
int unbind_result = this->map_.unbind (entry);
@@ -226,7 +223,4 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::unbind (CACHE_ENTRY *entry)
ACE_END_VERSIONED_NAMESPACE_DECL
-#undef ACE_T1
-#undef ACE_T2
-
#endif /* ACE_HASH_CACHE_MAP_MANAGER_T_CPP */
diff --git a/dep/acelite/ace/Hash_Cache_Map_Manager_T.h b/dep/acelite/ace/Hash_Cache_Map_Manager_T.h
index 0bc64a5a9ed..e1fc4d77317 100644
--- a/dep/acelite/ace/Hash_Cache_Map_Manager_T.h
+++ b/dep/acelite/ace/Hash_Cache_Map_Manager_T.h
@@ -4,7 +4,7 @@
/**
* @file Hash_Cache_Map_Manager_T.h
*
- * $Id: Hash_Cache_Map_Manager_T.h 92097 2010-09-30 05:41:49Z msmit $
+ * $Id: Hash_Cache_Map_Manager_T.h 93366 2011-02-11 19:30:35Z johnnyw $
*
* @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
*/
@@ -39,9 +39,6 @@ class ACE_Allocator;
CACHING_STRATEGY, \
ATTRIBUTES>
-// For linkers that cant grok long names.
-#define ACE_Hash_Cache_Map_Manager AHCMM
-
/**
* @class ACE_Hash_Cache_Map_Manager
*
@@ -58,7 +55,7 @@ class ACE_Allocator;
* Hash_Cache_Map_Manager provides extra functionality on top
* of the Cache_Map_Manager.
* No locking mechanism provided since locking at this level
- * isnt efficient. Locking has to be provided by the
+ * isn't efficient. Locking has to be provided by the
* application.
*/
template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
@@ -189,7 +186,6 @@ class ACE_Hash_Cache_Map_Manager : public ACE_CACHE_MAP_MANAGER
int unbind (CACHE_ENTRY *entry);
protected:
-
/// Base class.
typedef ACE_CACHE_MAP_MANAGER ACE_HCMM_BASE;
};
diff --git a/dep/acelite/ace/Hash_Cache_Map_Manager_T.inl b/dep/acelite/ace/Hash_Cache_Map_Manager_T.inl
index f097bb7e073..8c4bb122360 100644
--- a/dep/acelite/ace/Hash_Cache_Map_Manager_T.inl
+++ b/dep/acelite/ace/Hash_Cache_Map_Manager_T.inl
@@ -1,43 +1,43 @@
// -*- C++ -*-
-//
-// $Id: Hash_Cache_Map_Manager_T.inl 80826 2008-03-04 14:51:23Z wotte $
-
-#define ACE_T1 class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES
-#define ACE_T2 KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES
+// $Id: Hash_Cache_Map_Manager_T.inl 93359 2011-02-11 11:33:12Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::bind (const KEY &key,
- const VALUE &value)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::bind (
+ const KEY &key,
+ const VALUE &value)
{
- return ACE_HCMM_BASE::bind (key,
- value);
+ return ACE_HCMM_BASE::bind (key, value);
}
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
- const VALUE &value)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::rebind (
+ const KEY &key,
+ const VALUE &value)
{
- return ACE_HCMM_BASE::rebind (key,
- value);
+ return ACE_HCMM_BASE::rebind (key, value);
}
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
- const VALUE &value,
- VALUE &old_value)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::rebind (
+ const KEY &key,
+ const VALUE &value,
+ VALUE &old_value)
{
- return ACE_HCMM_BASE::rebind (key,
- value,
- old_value);
+ return ACE_HCMM_BASE::rebind (key, value, old_value);
}
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
- const VALUE &value,
- KEY &old_key,
- VALUE &old_value)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::rebind (
+ const KEY &key,
+ const VALUE &value,
+ KEY &old_key,
+ VALUE &old_value)
{
return ACE_HCMM_BASE::rebind (key,
value,
@@ -45,29 +45,28 @@ ACE_Hash_Cache_Map_Manager<ACE_T2>::rebind (const KEY &key,
old_value);
}
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::trybind (const KEY &key,
- VALUE &value)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::trybind (
+ const KEY &key,
+ VALUE &value)
{
- return ACE_HCMM_BASE::trybind (key,
- value);
+ return ACE_HCMM_BASE::trybind (key, value);
}
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::unbind (const KEY &key)
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::unbind (const KEY &key)
{
return ACE_HCMM_BASE::unbind (key);
}
-template <ACE_T1> ACE_INLINE int
-ACE_Hash_Cache_Map_Manager<ACE_T2>::unbind (const KEY &key,
+template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES>
+ACE_INLINE int
+ACE_Hash_Cache_Map_Manager<KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES>::unbind (const KEY &key,
VALUE &value)
{
- return ACE_HCMM_BASE::unbind (key,
- value);
+ return ACE_HCMM_BASE::unbind (key, value);
}
ACE_END_VERSIONED_NAMESPACE_DECL
-
-#undef ACE_T1
-#undef ACE_T2
diff --git a/dep/acelite/ace/Hash_Multi_Map_Manager_T.cpp b/dep/acelite/ace/Hash_Multi_Map_Manager_T.cpp
index db79e018793..195e8ac03c2 100644
--- a/dep/acelite/ace/Hash_Multi_Map_Manager_T.cpp
+++ b/dep/acelite/ace/Hash_Multi_Map_Manager_T.cpp
@@ -3,13 +3,12 @@
/**
* @file Hash_Multi_Map_Manager_T.cpp
*
- * $Id: Hash_Multi_Map_Manager_T.cpp 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Hash_Multi_Map_Manager_T.cpp 93736 2011-04-05 12:38:35Z johnnyw $
*
* @author Shanshan Jiang <shanshan.jiang@vanderbilt.edu>
*/
//=============================================================================
-
#ifndef ACE_Hash_Multi_Map_Manager_T_CPP
#define ACE_Hash_Multi_Map_Manager_T_CPP
@@ -27,7 +26,6 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
template <class EXT_ID, class INT_ID>
ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Multi_Map_Entry (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *next,
ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *prev)
diff --git a/dep/acelite/ace/Hash_Multi_Map_Manager_T.inl b/dep/acelite/ace/Hash_Multi_Map_Manager_T.inl
index b6c353c2153..5bf8371ec99 100644
--- a/dep/acelite/ace/Hash_Multi_Map_Manager_T.inl
+++ b/dep/acelite/ace/Hash_Multi_Map_Manager_T.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Hash_Multi_Map_Manager_T.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Hash_Multi_Map_Manager_T.inl 94520 2011-09-22 14:55:20Z johnnyw $
#include "ace/Guard_T.h"
@@ -91,7 +91,7 @@ template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class
ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::bind_i (const EXT_ID &ext_id,
const INT_ID &int_id)
{
- ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp;
+ ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp = 0;
return this->bind_i (ext_id, int_id, temp);
}
diff --git a/dep/acelite/ace/Hashable.cpp b/dep/acelite/ace/Hashable.cpp
index 75dc809dc0d..24b2407242f 100644
--- a/dep/acelite/ace/Hashable.cpp
+++ b/dep/acelite/ace/Hashable.cpp
@@ -1,4 +1,4 @@
-//$Id: Hashable.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+//$Id: Hashable.cpp 93736 2011-04-05 12:38:35Z johnnyw $
#include "ace/Hashable.h"
@@ -6,8 +6,6 @@
#include "ace/Hashable.inl"
#endif /* __ACE_INLINE __ */
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Hashable::~ACE_Hashable (void)
diff --git a/dep/acelite/ace/Hashable.inl b/dep/acelite/ace/Hashable.inl
index 352b7794eb9..1fb6956cfed 100644
--- a/dep/acelite/ace/Hashable.inl
+++ b/dep/acelite/ace/Hashable.inl
@@ -1,7 +1,5 @@
// -*- C++ -*-
-//
-// $Id: Hashable.inl 80826 2008-03-04 14:51:23Z wotte $
-
+// $Id: Hashable.inl 93736 2011-04-05 12:38:35Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/High_Res_Timer.cpp b/dep/acelite/ace/High_Res_Timer.cpp
index 4bc380c591d..81f8415aaa9 100644
--- a/dep/acelite/ace/High_Res_Timer.cpp
+++ b/dep/acelite/ace/High_Res_Timer.cpp
@@ -1,4 +1,4 @@
-// $Id: High_Res_Timer.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: High_Res_Timer.cpp 95788 2012-05-24 07:59:51Z johnnyw $
// Be very carefull before changing the calculations inside
// ACE_High_Res_Timer. The precision matters and we are using integer
@@ -22,8 +22,6 @@
#include "ace/OS_NS_stdlib.h"
#include "ace/Truncate.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_High_Res_Timer)
@@ -43,11 +41,11 @@ ACE_END_VERSIONED_NAMESPACE_DECL
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
- // Initialize the global_scale_factor_ to 1. The first
- // ACE_High_Res_Timer instance construction will override this
- // value.
- /* static */
- ACE_UINT32 ACE_High_Res_Timer::global_scale_factor_ = 1u;
+/// Initialize the global_scale_factor_ to 1. The first
+/// ACE_High_Res_Timer instance construction will override this
+/// value.
+/* static */
+ACE_High_Res_Timer::global_scale_factor_type ACE_High_Res_Timer::global_scale_factor_ = 1u;
ACE_END_VERSIONED_NAMESPACE_DECL
@@ -69,13 +67,12 @@ ACE_END_VERSIONED_NAMESPACE_DECL
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-// This is used to tell if the global_scale_factor_ has been
-// set, and if high resolution timers are supported.
+/// This is used to tell if the global_scale_factor_ has been
+/// set, and if high resolution timers are supported.
/* static */
int ACE_High_Res_Timer::global_scale_factor_status_ = 0;
-
-#if defined (linux)
+#if defined (ACE_LINUX)
// Determine the apparent CPU clock speed from /proc/cpuinfo
ACE_UINT32
ACE_High_Res_Timer::get_cpuinfo (void)
@@ -188,9 +185,10 @@ ACE_High_Res_Timer::get_cpuinfo (void)
return scale_factor;
}
-#endif /* linux */
+#endif /* ACE_LINUX */
-ACE_UINT32
+
+ACE_High_Res_Timer::global_scale_factor_type
ACE_High_Res_Timer::global_scale_factor (void)
{
#if (defined (ACE_WIN32) || defined (ACE_HAS_POWERPC_TIMER) || \
@@ -211,30 +209,23 @@ ACE_High_Res_Timer::global_scale_factor (void)
if (ACE_High_Res_Timer::global_scale_factor_status_ == 0)
{
# if defined (ACE_WIN32)
+ // This a higher-precision version, specific for Windows systems
LARGE_INTEGER freq;
if (::QueryPerformanceFrequency (&freq))
- {
- // We have a high-res timer
-# if defined (ACE_LACKS_LONGLONG_T)
- ACE_UINT64 uint64_freq(freq.u.LowPart, (ACE_UINT32) freq.u.HighPart);
- ACE_High_Res_Timer::global_scale_factor
- (uint64_freq / (ACE_UINT32) ACE_ONE_SECOND_IN_USECS);
-# else
- ACE_High_Res_Timer::global_scale_factor
- (static_cast<unsigned int> (freq.QuadPart / ACE_HR_SCALE_CONVERSION));
-# endif // (ACE_LACKS_LONGLONG_T)
+ {
+ ACE_High_Res_Timer::global_scale_factor(freq.QuadPart);
ACE_High_Res_Timer::global_scale_factor_status_ = 1;
- }
+ }
else
+ {
// High-Res timers not supported
ACE_High_Res_Timer::global_scale_factor_status_ = -1;
-
+ }
return ACE_High_Res_Timer::global_scale_factor_;
-
-# elif defined (linux)
+# elif defined (ACE_LINUX)
ACE_High_Res_Timer::global_scale_factor (ACE_High_Res_Timer::get_cpuinfo ());
-# endif /* ! ACE_WIN32 && ! (linux && __alpha__) */
+# endif /* ! ACE_WIN32 && ! (ACE_LINUX && __alpha__) */
# if !defined (ACE_WIN32)
if (ACE_High_Res_Timer::global_scale_factor_ <= 1u)
@@ -314,17 +305,6 @@ ACE_High_Res_Timer::dump (void) const
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nglobal_scale_factor_: %u\n"),
global_scale_factor ()));
-#if defined (ACE_LACKS_LONGLONG_T)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT (":\nstart_.hi (): %8x; start_.lo (): %8x;\n")
- ACE_TEXT ("end_.hi (): %8x; end_.lo (): %8x;\n")
- ACE_TEXT ("total_.hi (): %8x; total_.lo (): %8x;\n")
- ACE_TEXT ("start_incr_.hi () %8x; start_incr_.lo (): %8x;\n"),
- start_.hi (), start_.lo (),
- end_.hi (), end_.lo (),
- total_.hi (), total_.lo (),
- start_incr_.hi (), start_incr_.lo ()));
-#else /* ! ACE_LACKS_LONGLONG_T */
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT (":\nstart_.hi (): %8x; start_.lo (): %8x;\n")
ACE_TEXT ("end_.hi (): %8x; end_.lo (): %8x;\n")
@@ -338,7 +318,6 @@ ACE_High_Res_Timer::dump (void) const
static_cast<ACE_UINT32> (total_ & 0xfffffffful),
static_cast<ACE_UINT32> (start_incr_ >> 32),
static_cast<ACE_UINT32> (start_incr_ & 0xfffffffful)));
-#endif /* ! ACE_LACKS_LONGLONG_T */
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}
@@ -357,7 +336,7 @@ ACE_High_Res_Timer::reset (void)
void
ACE_High_Res_Timer::elapsed_time (ACE_Time_Value &tv) const
{
- hrtime_to_tv (tv,
+ this->hrtime_to_tv (tv,
ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_));
}
@@ -394,12 +373,13 @@ ACE_High_Res_Timer::elapsed_time (struct timespec &elapsed_time) const
void
ACE_High_Res_Timer::elapsed_time_incr (ACE_Time_Value &tv) const
{
- hrtime_to_tv (tv, total_);
+ this->hrtime_to_tv (tv, total_);
}
void
ACE_High_Res_Timer::elapsed_time (ACE_hrtime_t &nanoseconds) const
{
+#if !defined (ACE_WIN32)
// Please do _not_ rearrange this equation. It is carefully
// designed and tested to avoid overflow on machines that don't have
// native 64-bit ints. In particular, division can be a problem.
@@ -410,16 +390,29 @@ ACE_High_Res_Timer::elapsed_time (ACE_hrtime_t &nanoseconds) const
nanoseconds = nanoseconds >> 10;
// Right shift is implemented for non native 64-bit ints
// operator/ only for a 32 bit result !
+#else
+ // This a higher-precision version, specific for Windows systems
+ nanoseconds =
+ (ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_) * ACE_HR_SCALE_CONVERSION * 1000u) /
+ ACE_High_Res_Timer::global_scale_factor ();
+#endif
}
void
ACE_High_Res_Timer::elapsed_time_incr (ACE_hrtime_t &nanoseconds) const
{
+#if !defined (ACE_WIN32)
// Same as above.
nanoseconds = this->total_
- * (1024000u / ACE_High_Res_Timer::global_scale_factor ());
+ * (1024000u / ACE_High_Res_Timer::global_scale_factor ());
// Caution - Borland has a problem with >>=, so resist the temptation.
nanoseconds = nanoseconds >> 10;
+#else
+ // This a higher-precision version, specific for Windows systems
+ nanoseconds =
+ this->total_ * 1000000000u /
+ ACE_High_Res_Timer::global_scale_factor ();
+#endif
}
void
diff --git a/dep/acelite/ace/High_Res_Timer.h b/dep/acelite/ace/High_Res_Timer.h
index 3716597e5cd..d01149bce87 100644
--- a/dep/acelite/ace/High_Res_Timer.h
+++ b/dep/acelite/ace/High_Res_Timer.h
@@ -4,7 +4,7 @@
/**
* @file High_Res_Timer.h
*
- * $Id: High_Res_Timer.h 89483 2010-03-15 09:48:01Z johnnyw $
+ * $Id: High_Res_Timer.h 95798 2012-05-31 07:58:55Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -52,7 +52,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* units/second. Because it's possible that the units/second
* changes in the future, it's recommended to use it instead
* of a "hard coded" solution.
- * Dependend on the platform and used class members, there's a
+ * Dependent on the platform and used class members, there's a
* maximum elapsed period before overflow (which is not checked).
* Look at the documentation with some members functions.
* On some (most?) implementations it's not recommended to measure
@@ -74,8 +74,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* ACE_hrtime_t values. Those methods do _not_ check for overflow!
* @note Gabe <begeddov@proaxis.com> raises this issue regarding
* <ACE_OS::gethrtime>: on multi-processors, the processor that
- * you query for your <timer.stop> value might not be the one
- * you queried for <timer.start>. Its not clear how much
+ * you query for your @c timer.stop() value might not be the one
+ * you queried for @c timer.start(). Its not clear how much
* divergence there would be, if any.
* This issue is not mentioned in the Solaris 2.5.1 gethrtime
* man page.
@@ -100,7 +100,11 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_High_Res_Timer
{
public:
- // = Initialization method.
+#if !defined (ACE_WIN32)
+ typedef ACE_UINT32 global_scale_factor_type;
+#else
+ typedef ACE_UINT64 global_scale_factor_type;
+#endif
/**
* global_scale_factor_ is set to @a gsf. All High_Res_Timers use
@@ -112,13 +116,13 @@ public:
* not be set. Careful, a <scale_factor> of 0 will cause division
* by zero exceptions.
* Depending on the platform its units are 1/microsecond or
- * 1/millisecond. Use <ACE_HR_SCALE_CONVERSION> inside calculations
+ * 1/millisecond. Use @c ACE_HR_SCALE_CONVERSION inside calculations
* instead a hardcoded value.
*/
- static void global_scale_factor (ACE_UINT32 gsf);
+ static void global_scale_factor (global_scale_factor_type gsf);
/// Returns the global_scale_factor.
- static ACE_UINT32 global_scale_factor (void);
+ static global_scale_factor_type global_scale_factor (void);
#ifndef ACE_HR_SCALE_CONVERSION
# define ACE_HR_SCALE_CONVERSION (ACE_ONE_SECOND_IN_USECS)
@@ -164,11 +168,6 @@ public:
void stop (const ACE_OS::ACE_HRTimer_Op = ACE_OS::ACE_HRTIMER_GETTIME);
/// Set @a tv to the number of microseconds elapsed.
- /**
- * Could overflow within hours on windows with emulated 64 bit int's
- * and a fast counter. VC++ and Borland normaly use __int64 and
- * so normaly don't have this problem.
- */
void elapsed_time (ACE_Time_Value &tv) const;
/// Set @a nanoseconds to the number of nanoseconds elapsed.
@@ -200,7 +199,7 @@ public:
/// to start_incr and stop_incr.
void elapsed_time_incr (ACE_Time_Value &tv) const;
- /// Set <nsec> to the number of nanoseconds elapsed between all calls
+ /// Set @a nanoseconds to the number of nanoseconds elapsed between all calls
/// to start_incr and stop_incr.
void elapsed_time_incr (ACE_hrtime_t &nanoseconds) const;
@@ -249,14 +248,14 @@ public:
static void hrtime_to_tv (ACE_Time_Value &tv,
const ACE_hrtime_t hrt);
-#if defined (linux)
+#if defined (ACE_LINUX)
/**
* This is used to find out the Mhz of the machine for the scale
* factor. If there are any problems getting it, we just return 1
* (the default).
*/
static ACE_UINT32 get_cpuinfo (void);
-#endif /* defined (linux) */
+#endif /* defined (ACE_LINUX) */
private:
/**
@@ -289,7 +288,7 @@ private:
/// Converts ticks to microseconds. That is, ticks /
/// global_scale_factor_ == microseconds.
- static ACE_UINT32 global_scale_factor_;
+ static global_scale_factor_type global_scale_factor_;
/**
* Indicates the status of the global scale factor,
diff --git a/dep/acelite/ace/High_Res_Timer.inl b/dep/acelite/ace/High_Res_Timer.inl
index 06241dc0dfc..c22c47cc3f3 100644
--- a/dep/acelite/ace/High_Res_Timer.inl
+++ b/dep/acelite/ace/High_Res_Timer.inl
@@ -1,6 +1,5 @@
// -*- C++ -*- */
-//
-// $Id: High_Res_Timer.inl 89483 2010-03-15 09:48:01Z johnnyw $
+// $Id: High_Res_Timer.inl 95798 2012-05-31 07:58:55Z johnnyw $
#include "ace/Global_Macros.h"
@@ -10,32 +9,40 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-// Be very careful before changing the calculations inside
-// ACE_High_Res_Timer. The precision matters and we are using integer
-// calculations not floating point. Also look closely at the emulated 64
-// bit int class (inside Basic_Types{h,i,cpp} before changing
-// anything. It's operator/ only returns 32 bits not 64 bits, among
-// other things.
-
+/// Be very careful before changing the calculations inside
+/// ACE_High_Res_Timer. The precision matters and we are using integer
+/// calculations not floating point.
ACE_INLINE void
ACE_High_Res_Timer::hrtime_to_tv (ACE_Time_Value &tv,
const ACE_hrtime_t hrt)
{
- // The following are based on the units of global_scale_factor_
- // being 1/microsecond. Therefore, dividing by it converts
- // clock ticks to microseconds.
- tv.sec ((long) (hrt / (ACE_UINT32) ACE_HR_SCALE_CONVERSION /
+#if !defined (ACE_WIN32)
+ // The following are based on the units of global_scale_factor_
+ // being 1/microsecond. Therefore, dividing by it converts
+ // clock ticks to microseconds.
+ tv.sec ((time_t) (hrt / (ACE_UINT32) ACE_HR_SCALE_CONVERSION /
global_scale_factor ()));
- // Calculate usec in a manner that's compatible with ACE_U_LongLong.
- // hrt = (tv.sec * ACE_ONE_SECOND_IN_USECS + tv.usec) * global_scale_factor_
- // tv.usec = hrt / global_scale_factor_ - tv.sec * ACE_ONE_SECOND_IN_USECS
- // That first term will be lossy, so factor out global_scale_factor_:
- // tv.usec = (hrt - tv.sec * ACE_ONE_SECOND_IN_USECS * global_scale_factor_)/
- // global_scale_factor
- ACE_hrtime_t tmp = tv.sec ();
- tmp *= ((ACE_UINT32) ACE_HR_SCALE_CONVERSION * global_scale_factor ());
- tv.usec ((long) ((hrt - tmp) / global_scale_factor ()));
+ // hrt = (tv.sec * ACE_ONE_SECOND_IN_USECS + tv.usec) * global_scale_factor_
+ // tv.usec = hrt / global_scale_factor_ - tv.sec * ACE_ONE_SECOND_IN_USECS
+ // That first term will be lossy, so factor out global_scale_factor_:
+ // tv.usec = (hrt - tv.sec * ACE_ONE_SECOND_IN_USECS * global_scale_factor_)/
+ // global_scale_factor
+ ACE_hrtime_t tmp = tv.sec ();
+ tmp *= ((ACE_UINT32) ACE_HR_SCALE_CONVERSION * global_scale_factor ());
+ tv.usec ((suseconds_t) ((hrt - tmp) / global_scale_factor ()));
+#else
+ // This a higher-precision version, specific for Windows systems
+ // The following are based on the units of global_scale_factor_
+ // being 1/microsecond. Therefore, dividing by it converts
+ // clock ticks to microseconds.
+ tv.sec ((time_t) (hrt / global_scale_factor () ));
+
+ // Calculate usec, first calculate the seconds in hrtime
+ ACE_High_Res_Timer::global_scale_factor_type tmp = tv.sec ();
+ tmp *= global_scale_factor ();
+ tv.usec ((suseconds_t) ((hrt - tmp) * ACE_HR_SCALE_CONVERSION / global_scale_factor ()));
+#endif
}
@@ -57,13 +64,12 @@ ACE_High_Res_Timer::gettimeofday (const ACE_OS::ACE_HRTimer_Op op)
return tv;
}
-
-// Get the current high res timer as the time of day. This is intended
-// to be used for a gettimeofday replacement in ACE_Timer_Queue and
-// derived classes so the timers will bebased on high res timers rather
-// than wall clock time. It uses the ACE_High_Res_Timer::gettimeofday
-// function, which is deprecated. If it gets removed, please move the
-// code down here, intact.
+/// Get the current high res timer as the time of day. This is intended
+/// to be used for a gettimeofday replacement in ACE_Timer_Queue and
+/// derived classes so the timers will be based on high res timers rather
+/// than wall clock time. It uses the ACE_High_Res_Timer::gettimeofday
+/// function, which is deprecated. If it gets removed, please move the
+/// code down here, intact.
ACE_INLINE ACE_Time_Value
ACE_High_Res_Timer::gettimeofday_hr (void)
{
@@ -139,13 +145,21 @@ ACE_High_Res_Timer::stop_incr (const ACE_OS::ACE_HRTimer_Op op)
ACE_INLINE void
ACE_High_Res_Timer::elapsed_microseconds (ACE_hrtime_t &usecs) const
{
+
+#if !defined (ACE_WIN32)
ACE_hrtime_t elapsed = ACE_High_Res_Timer::elapsed_hrtime (this->end_,
this->start_);
usecs = (ACE_hrtime_t) (elapsed / global_scale_factor ());
+#else
+ usecs = (ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_) *
+ ACE_HR_SCALE_CONVERSION) /
+ global_scale_factor ();
+#endif
}
ACE_INLINE void
-ACE_High_Res_Timer::global_scale_factor (ACE_UINT32 gsf)
+ACE_High_Res_Timer::global_scale_factor (
+ ACE_High_Res_Timer::global_scale_factor_type gsf)
{
global_scale_factor_ = gsf;
}
diff --git a/dep/acelite/ace/ICMP_Socket.cpp b/dep/acelite/ace/ICMP_Socket.cpp
index 5247dc4b83a..04ac2611d75 100644
--- a/dep/acelite/ace/ICMP_Socket.cpp
+++ b/dep/acelite/ace/ICMP_Socket.cpp
@@ -1,4 +1,4 @@
-// $Id: ICMP_Socket.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: ICMP_Socket.cpp 93560 2011-03-16 13:54:49Z johnnyw $
#include "ace/ICMP_Socket.h"
@@ -85,9 +85,9 @@ ACE_ICMP_Socket::open (ACE_Addr const & local,
// Check if icmp protocol is supported on this host
int proto_number = -1;
- protoent *proto;
+ protoent *proto = 0;
- if (! (proto = getprotobyname ("icmp")))
+ if (! (proto = ACE_OS::getprotobyname ("icmp")))
{
ACE_ERROR_RETURN
((LM_ERROR,
diff --git a/dep/acelite/ace/INET_Addr.cpp b/dep/acelite/ace/INET_Addr.cpp
index 6dba7150f93..a41b0e4406f 100644
--- a/dep/acelite/ace/INET_Addr.cpp
+++ b/dep/acelite/ace/INET_Addr.cpp
@@ -1,4 +1,4 @@
-// $Id: INET_Addr.cpp 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: INET_Addr.cpp 95533 2012-02-14 22:59:17Z wotte $
// Defines the Internet domain address family address format.
@@ -334,48 +334,67 @@ ACE_INET_Addr::set (u_short port_number,
sizeof this->inet_addr_);
#if defined (ACE_HAS_IPV6)
- struct addrinfo hints;
- struct addrinfo *res = 0;
- int error = 0;
- ACE_OS::memset (&hints, 0, sizeof (hints));
-# if defined (ACE_USES_IPV4_IPV6_MIGRATION)
- if (address_family == AF_UNSPEC && !ACE::ipv6_enabled())
+ // Let the IPv4 case fall through to the non-IPv6-capable section.
+ // We don't need the additional getaddrinfo() capability and the Linux
+ // getaddrinfo() is substantially slower than gethostbyname() w/
+ // large vlans.
+# if defined (ACE_USES_IPV4_IPV6_MIGRATION)
+ if (address_family == AF_UNSPEC && !ACE::ipv6_enabled ())
address_family = AF_INET;
-# endif /* ACE_USES_IPV4_IPV6_MIGRATION */
- if (address_family == AF_UNSPEC || address_family == AF_INET6)
+# endif /* ACE_USES_IPV4_IPV6_MIGRATION */
+ if (address_family != AF_INET)
{
- hints.ai_family = AF_INET6;
- error = ::getaddrinfo (host_name, 0, &hints, &res);
- if (error)
+# if defined (ACE_HAS_GETHOSTBYNAME2)
+ hostent hentry;
+ hostent *hp;
+ ACE_HOSTENT_DATA buf;
+ int h_error = 0; // Not the same as errno!
+
+ if (0 == ::gethostbyname2_r (host_name, AF_INET6, &hentry,
+ buf, sizeof(buf), &hp, &h_error))
{
- if (address_family == AF_INET6)
+ if (hp != 0)
{
- if (res)
- ::freeaddrinfo(res);
- errno = error;
- return -1;
+ struct sockaddr_in6 v6;
+ ACE_OS::memset (&v6, 0, sizeof (v6));
+ v6.sin6_family = AF_INET6;
+ (void) ACE_OS::memcpy ((void *) &v6.sin6_addr,
+ hp->h_addr,
+ hp->h_length);
+ this->set_type (hp->h_addrtype);
+ this->set_addr (&v6, hp->h_length);
+ this->set_port_number (port_number, encode);
+ return 0;
}
- address_family = AF_INET;
}
- }
- if (address_family == AF_INET)
- {
- hints.ai_family = AF_INET;
- error = ::getaddrinfo (host_name, 0, &hints, &res);
- if (error)
+ errno = h_error;
+ if (address_family == AF_INET6)
+ return -1;
+# else
+ struct addrinfo hints;
+ struct addrinfo *res = 0;
+ int error = 0;
+ ACE_OS::memset (&hints, 0, sizeof (hints));
+ hints.ai_family = AF_INET6;
+ if ((error = ::getaddrinfo (host_name, 0, &hints, &res)) == 0)
+ {
+ this->set_type (res->ai_family);
+ this->set_addr (res->ai_addr, res->ai_addrlen);
+ this->set_port_number (port_number, encode);
+ ::freeaddrinfo (res);
+ return 0;
+ }
+ if (address_family == AF_INET6)
{
if (res)
::freeaddrinfo(res);
errno = error;
return -1;
}
+# endif /* ACE_HAS_GETHOSTBYNAME2 */
+ // Let AF_UNSPEC try again w/ IPv4.
}
- this->set_type (res->ai_family);
- this->set_addr (res->ai_addr, res->ai_addrlen);
- this->set_port_number (port_number, encode);
- ::freeaddrinfo (res);
- return 0;
-#else /* ACE_HAS_IPV6 */
+#endif /* ACE_HAS_IPV6 */
// IPv6 not supported... insure the family is set to IPv4
address_family = AF_INET;
@@ -392,9 +411,6 @@ ACE_INET_Addr::set (u_short port_number,
encode);
else
{
-# if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME)
- hostent *hp = ACE_OS::gethostbyname (host_name);
-# else
hostent hentry;
ACE_HOSTENT_DATA buf;
int h_error = 0; // Not the same as errno!
@@ -403,7 +419,6 @@ ACE_INET_Addr::set (u_short port_number,
buf, &h_error);
if (hp == 0)
errno = h_error;
-# endif /* ACE_VXWORKS */
if (hp == 0)
{
@@ -419,7 +434,6 @@ ACE_INET_Addr::set (u_short port_number,
encode);
}
}
-#endif /* ACE_HAS_IPV6 */
}
// Helper function to get a port number from a port name.
@@ -839,19 +853,6 @@ ACE_INET_Addr::get_host_name_i (char hostname[], size_t len) const
}
else
{
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR)
- ACE_UNUSED_ARG (len);
- int error =
- ::hostGetByAddr ((int) this->inet_addr_.in4_.sin_addr.s_addr,
- hostname);
- if (error == OK)
- return 0;
- else
- {
- errno = error;
- return -1;
- }
-#else
void* addr = this->ip_addr_pointer ();
int size = this->ip_addr_size ();
int type = this->get_type ();
@@ -901,7 +902,6 @@ ACE_INET_Addr::get_host_name_i (char hostname[], size_t len) const
ACE_OS::strcpy (hostname, hp->h_name);
return 0;
-#endif /* ACE_VXWORKS */
}
}
@@ -1008,7 +1008,7 @@ int ACE_INET_Addr::set_address (const char *ip_addr,
}
-#if (defined (__linux__) || defined (ACE_WIN32)) && defined (ACE_HAS_IPV6)
+#if (defined (ACE_LINUX) || defined (ACE_WIN32)) && defined (ACE_HAS_IPV6)
int
ACE_INET_Addr::set_interface (const char *intf_name)
{
@@ -1016,7 +1016,7 @@ ACE_INET_Addr::set_interface (const char *intf_name)
(IN6_IS_ADDR_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr) ||
IN6_IS_ADDR_MC_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr)))
{
-#if defined (__linux__)
+#if defined (ACE_LINUX)
this->inet_addr_.in6_.sin6_scope_id =
ACE_OS::if_nametoindex (intf_name);
#else
@@ -1033,7 +1033,7 @@ ACE_INET_Addr::set_interface (const char *intf_name)
return 0;
}
-#endif /* __linux && ACE_HAS_IPV6 */
+#endif /* ACE_LINUX && ACE_HAS_IPV6 */
const char *
ACE_INET_Addr::get_host_addr (char *dst, int size) const
@@ -1070,7 +1070,7 @@ ACE_INET_Addr::get_host_addr (char *dst, int size) const
&this->inet_addr_.in6_.sin6_addr,
dst,
size);
-#if defined (__linux__)
+#if defined (ACE_LINUX)
if ((IN6_IS_ADDR_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr) ||
IN6_IS_ADDR_MC_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr)) &&
this->inet_addr_.in6_.sin6_scope_id != 0)
diff --git a/dep/acelite/ace/INET_Addr.h b/dep/acelite/ace/INET_Addr.h
index fcd26d0de2f..3272a96a566 100644
--- a/dep/acelite/ace/INET_Addr.h
+++ b/dep/acelite/ace/INET_Addr.h
@@ -4,7 +4,7 @@
/**
* @file INET_Addr.h
*
- * $Id: INET_Addr.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: INET_Addr.h 95533 2012-02-14 22:59:17Z wotte $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -250,13 +250,13 @@ public:
int encode = 1,
int map = 0);
-#if (defined (__linux__) || defined (ACE_WIN32)) && defined (ACE_HAS_IPV6)
+#if (defined (ACE_LINUX) || defined (ACE_WIN32)) && defined (ACE_HAS_IPV6)
/**
* Sets the interface that should be used for this address. This only has
* an effect when the address is link local, otherwise it does nothing.
*/
int set_interface (const char *intf_name);
-#endif /* (__linux__ || ACE_WIN32) && ACE_HAS_IPV6 */
+#endif /* (ACE_LINUX || ACE_WIN32) && ACE_HAS_IPV6 */
/// Return the port number, converting it into host byte-order.
u_short get_port_number (void) const;
diff --git a/dep/acelite/ace/INET_Addr.inl b/dep/acelite/ace/INET_Addr.inl
index 06460cb7857..eb3923185a2 100644
--- a/dep/acelite/ace/INET_Addr.inl
+++ b/dep/acelite/ace/INET_Addr.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: INET_Addr.inl 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: INET_Addr.inl 96017 2012-08-08 22:18:09Z mitza $
#include "ace/OS_NS_string.h"
@@ -87,7 +87,11 @@ ACE_INET_Addr::get_port_number (void) const
else
return ACE_NTOHS (this->inet_addr_.in6_.sin6_port);
#else
+# if defined (ACE_VXWORKS) && ACE_VXWORKS >= 0x690
+ return static_cast<u_short> (ACE_NTOHS (this->inet_addr_.in4_.sin_port));
+# else
return ACE_NTOHS (this->inet_addr_.in4_.sin_port);
+# endif
#endif /* ACE_HAS_IPV6 */
}
diff --git a/dep/acelite/ace/IOStream.cpp b/dep/acelite/ace/IOStream.cpp
index 99065091a4c..59d0191f49f 100644
--- a/dep/acelite/ace/IOStream.cpp
+++ b/dep/acelite/ace/IOStream.cpp
@@ -1,12 +1,10 @@
-// $Id: IOStream.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: IOStream.cpp 93359 2011-02-11 11:33:12Z mcorino $
#ifndef ACE_IOSTREAM_CPP
#define ACE_IOSTREAM_CPP
#include "ace/IOStream.h"
-
-
#if !defined (ACE_LACKS_ACE_IOSTREAM)
# include "ace/OS_NS_errno.h"
diff --git a/dep/acelite/ace/IOStream.h b/dep/acelite/ace/IOStream.h
index de154cd1b10..97bbc23b712 100644
--- a/dep/acelite/ace/IOStream.h
+++ b/dep/acelite/ace/IOStream.h
@@ -4,7 +4,7 @@
/**
* @file IOStream.h
*
- * $Id: IOStream.h 92102 2010-09-30 08:14:15Z johnnyw $
+ * $Id: IOStream.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author James CE Johnson <jcej@lads.com>
* @author Jim Crossley <jim@lads.com>
@@ -156,7 +156,7 @@ class ACE_Export ACE_Streambuf : public streambuf
public:
/**
- * If the default allocation strategey were used the common buffer
+ * If the default allocation strategy were used the common buffer
* would be deleted when the object destructs. Since we are
* providing separate read/write buffers, it is up to us to manage
* their memory.
@@ -274,11 +274,11 @@ protected:
*/
int syncin (void);
- /// syncout is called when the output needs to be flushed. This is
+ /// syncout() is called when the output needs to be flushed. This is
/// easily done by calling the peer's send_n function.
int syncout (void);
- /// flushbuf is the worker of syncout. It is a separate function
+ /// flushbuf() is the worker of syncout. It is a separate function
/// because it gets used sometimes in different context.
int flushbuf (void);
diff --git a/dep/acelite/ace/IOStream_T.h b/dep/acelite/ace/IOStream_T.h
index 286f1a714d5..6a6cda5703e 100644
--- a/dep/acelite/ace/IOStream_T.h
+++ b/dep/acelite/ace/IOStream_T.h
@@ -4,7 +4,7 @@
/**
* @file IOStream_T.h
*
- * $Id: IOStream_T.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: IOStream_T.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author James CE Johnson <jcej@lads.com>
* @author Jim Crossley <jim@lads.com>
@@ -116,7 +116,7 @@ public:
u_int streambuf_size = ACE_STREAMBUF_SIZE);
/**
- * The default constructor. This will initiailze your STREAM and
+ * The default constructor. This will initialize your STREAM and
* then setup the iostream baseclass to use a custom streambuf based
* on STREAM.
*/
@@ -126,7 +126,7 @@ public:
/// to the <iostream> base class;
virtual ~ACE_IOStream (void);
- /// The only ambituity in the multiple inheritance is the <close>
+ /// The only ambiguity in the multiple inheritance is the <close>
/// function.
virtual int close (void);
diff --git a/dep/acelite/ace/IO_SAP.cpp b/dep/acelite/ace/IO_SAP.cpp
index 139eb50b3c5..d4bca8c88a1 100644
--- a/dep/acelite/ace/IO_SAP.cpp
+++ b/dep/acelite/ace/IO_SAP.cpp
@@ -1,4 +1,4 @@
-// $Id: IO_SAP.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: IO_SAP.cpp 93736 2011-04-05 12:38:35Z johnnyw $
#include "ace/IO_SAP.h"
@@ -12,8 +12,6 @@
#include "ace/IO_SAP.inl"
#endif /* __ACE_INLINE__ */
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_IO_SAP)
diff --git a/dep/acelite/ace/IO_SAP.inl b/dep/acelite/ace/IO_SAP.inl
index 78b2ee31fc0..4c3182fa609 100644
--- a/dep/acelite/ace/IO_SAP.inl
+++ b/dep/acelite/ace/IO_SAP.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: IO_SAP.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: IO_SAP.inl 93736 2011-04-05 12:38:35Z johnnyw $
#include "ace/OS_NS_stropts.h"
diff --git a/dep/acelite/ace/Lib_Find.cpp b/dep/acelite/ace/Lib_Find.cpp
index c5a0610f065..6c63df21b55 100644
--- a/dep/acelite/ace/Lib_Find.cpp
+++ b/dep/acelite/ace/Lib_Find.cpp
@@ -1,4 +1,4 @@
-// $Id: Lib_Find.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Lib_Find.cpp 95630 2012-03-22 13:04:47Z johnnyw $
#include "ace/Lib_Find.h"
#include "ace/Log_Msg.h"
@@ -608,7 +608,13 @@ ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len)
const char *tmpdir = ACE_OS::getenv ("TMPDIR");
if (tmpdir == 0)
- tmpdir = "/tmp";
+ {
+#if defined (ACE_DEFAULT_TEMP_DIR)
+ tmpdir = ACE_DEFAULT_TEMP_DIR;
+#else
+ tmpdir = "/tmp";
+#endif
+ }
size_t len = ACE_OS::strlen (tmpdir);
@@ -653,7 +659,10 @@ ACE::open_temp_file (const ACE_TCHAR *name, int mode, int perm)
// Unlink it so that the file will be removed automatically when the
// process goes away.
if (ACE_OS::unlink (name) == -1)
- return ACE_INVALID_HANDLE;
+ {
+ ACE_OS::close (handle);
+ return ACE_INVALID_HANDLE;
+ }
else
// Return the handle.
return handle;
diff --git a/dep/acelite/ace/Lib_Find.h b/dep/acelite/ace/Lib_Find.h
index 133b83ffb7b..1ed2d8e72bc 100644
--- a/dep/acelite/ace/Lib_Find.h
+++ b/dep/acelite/ace/Lib_Find.h
@@ -7,7 +7,7 @@
* All the static function calls needed to search and open shared
* libraries.
*
- * $Id: Lib_Find.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Lib_Find.h 93359 2011-02-11 11:33:12Z mcorino $
*/
//=============================================================================
@@ -101,10 +101,10 @@ namespace ACE
extern ACE_Export size_t strrepl (char *s, char search, char replace);
/**
- * Splits string <s> into pieces separated by the string <token>.
- * <next_start> is an opaque cookie handed back by the call to store
+ * Splits string @a s into pieces separated by the string @a token.
+ * @a next_start is an opaque cookie handed back by the call to store
* its state for the next invocation, thus making it re-entrant.
- * This operates very similar to Perl's <split> function except that
+ * This operates very similar to Perl's @c split function except that
* it returns pieces one at a time instead of into an array.
*/
extern ACE_Export char *strsplit_r (char *s,
diff --git a/dep/acelite/ace/Local_Name_Space_T.h b/dep/acelite/ace/Local_Name_Space_T.h
index 56b445b4de8..33f9acc7602 100644
--- a/dep/acelite/ace/Local_Name_Space_T.h
+++ b/dep/acelite/ace/Local_Name_Space_T.h
@@ -4,7 +4,7 @@
/**
* @file Local_Name_Space_T.h
*
- * $Id: Local_Name_Space_T.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Local_Name_Space_T.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Prashant Jain <pjain@cs.wustl.edu>
* @author Irfan Pyarali <irfan@wuerl.wustl.edu> and
@@ -135,13 +135,13 @@ public:
/**
* Overwrite the value or type of an existing name in a
* ACE_Local_Name_Space or bind a new name to the context, if it
- * didn't exist yet. (Wide charcter strings interface).
+ * didn't exist yet. (Wide character strings interface).
*/
virtual int rebind (const ACE_NS_WString &name,
const ACE_NS_WString &value,
const char *type = "");
- /// Delete a name from a ACE_Local_Name_Space (Wide charcter strings
+ /// Delete a name from a ACE_Local_Name_Space (Wide character strings
/// Interface).
virtual int unbind (const ACE_NS_WString &name);
virtual int unbind_i (const ACE_NS_WString &name);
diff --git a/dep/acelite/ace/Local_Tokens.h b/dep/acelite/ace/Local_Tokens.h
index a555370364a..72e528bfd79 100644
--- a/dep/acelite/ace/Local_Tokens.h
+++ b/dep/acelite/ace/Local_Tokens.h
@@ -4,7 +4,7 @@
/**
* @file Local_Tokens.h
*
- * $Id: Local_Tokens.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Local_Tokens.h 93792 2011-04-07 11:48:50Z mcorino $
*
* @author Karl-Heinz Dorn <kdorn@erlh.siemens.de>
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
@@ -408,13 +408,13 @@ public:
typedef ACE_Unbounded_Stack<ACE_TPQ_Entry *> OWNER_STACK;
/// Returns a stack of the current owners. Returns -1 on error, 0 on
- /// success. If <id> is non-zero, returns 1 if id is an owner.
+ /// success. If @a id is non-zero, returns 1 if id is an owner.
virtual int owners (OWNER_STACK &o, const ACE_TCHAR *id) = 0;
- /// Returns 1 if <id> is waiting for this token. 0 otherwise.
+ /// Returns 1 if @a id is waiting for this token. 0 otherwise.
virtual int is_waiting_for (const ACE_TCHAR *id) = 0;
- /// Returns 1 if <id> is an owner of this token. 0 otherwise.
+ /// Returns 1 if @a id is an owner of this token. 0 otherwise.
virtual int is_owner (const ACE_TCHAR *id) = 0;
/// Return the queue of waiters.
@@ -562,13 +562,13 @@ public:
virtual int type (void) const;
/// Returns a stack of the current owners. Returns -1 on error, 0 on
- /// success. If <id> is non-zero, returns 1 if id is an owner.
+ /// success. If @a id is non-zero, returns 1 if id is an owner.
virtual int owners (OWNER_STACK &o, const ACE_TCHAR *id);
- /// Returns 1 if <id> is waiting for this token. 0 otherwise.
+ /// Returns 1 if @a id is waiting for this token. 0 otherwise.
virtual int is_waiting_for (const ACE_TCHAR *id);
- /// Returns 1 if <id> is an owner of this token. 0 otherwise.
+ /// Returns 1 if @a id is an owner of this token. 0 otherwise.
virtual int is_owner (const ACE_TCHAR *id);
private:
@@ -660,13 +660,13 @@ public:
virtual int type (void) const;
/// Returns a stack of the current owners. Returns -1 on error, 0 on
- /// success. If <id> is non-zero, returns 1 if id is an owner.
+ /// success. If @a id is non-zero, returns 1 if id is an owner.
virtual int owners (OWNER_STACK &o, const ACE_TCHAR *id);
- /// Returns 1 if <id> is waiting for this token. 0 otherwise.
+ /// Returns 1 if @a id is waiting for this token. 0 otherwise.
virtual int is_waiting_for (const ACE_TCHAR *id);
- /// Returns 1 if <id> is an owner of this token. 0 otherwise.
+ /// Returns 1 if @a id is an owner of this token. 0 otherwise.
virtual int is_owner (const ACE_TCHAR *id);
protected:
diff --git a/dep/acelite/ace/Lock.h b/dep/acelite/ace/Lock.h
index 36f99939b56..cbf41306df3 100644
--- a/dep/acelite/ace/Lock.h
+++ b/dep/acelite/ace/Lock.h
@@ -4,7 +4,7 @@
/**
* @file Lock.h
*
- * $Id: Lock.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Lock.h 93792 2011-04-07 11:48:50Z mcorino $
*
* Moved from Synch.h.
*
@@ -43,7 +43,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Lock
{
public:
- /// CE needs a default ctor here.
+ /// CE needs a default constructor here.
ACE_Lock (void);
/// Noop virtual destructor
@@ -73,20 +73,20 @@ public:
/**
* Block until the thread acquires a read lock. If the locking
* mechanism doesn't support read locks then this just calls
- * <acquire>. Returns -1 on failure.
+ * acquire(). Returns -1 on failure.
*/
virtual int acquire_read (void) = 0;
/**
* Block until the thread acquires a write lock. If the locking
* mechanism doesn't support read locks then this just calls
- * <acquire>. Returns -1 on failure.
+ * acquire(). Returns -1 on failure.
*/
virtual int acquire_write (void) = 0;
/**
* Conditionally acquire a read lock. If the locking mechanism
- * doesn't support read locks then this just calls <acquire>.
+ * doesn't support read locks then this just calls acquire().
* Returns -1 on failure. If we "failed" because someone else
* already had the lock, @c errno is set to @c EBUSY.
*/
@@ -94,7 +94,7 @@ public:
/**
* Conditionally acquire a write lock. If the locking mechanism
- * doesn't support read locks then this just calls <acquire>.
+ * doesn't support read locks then this just calls acquire().
* Returns -1 on failure. If we "failed" because someone else
* already had the lock, @c errno is set to @c EBUSY.
*/
@@ -103,7 +103,7 @@ public:
/**
* Conditionally try to upgrade a lock held for read to a write lock.
* If the locking mechanism doesn't support read locks then this just
- * calls <acquire>. Returns 0 on success, -1 on failure.
+ * calls acquire(). Returns 0 on success, -1 on failure.
*/
virtual int tryacquire_write_upgrade (void) = 0;
};
@@ -118,13 +118,13 @@ public:
* However, it defers our decision of what kind of lock to use
* to the run time and delegates all locking operations to the actual
* lock. Users must define a constructor in their subclass to
- * initialize <lock_>.
+ * initialize @c lock_.
*/
class ACE_Export ACE_Adaptive_Lock : public ACE_Lock
{
public:
/// You must also override the destructor function to match with how
- /// you construct the underneath <lock_>.
+ /// you construct the underneath @c lock_.
virtual ~ACE_Adaptive_Lock (void);
// = Lock/unlock operations.
@@ -142,8 +142,8 @@ public:
protected:
/**
- * Create and initialize create the actual lcok used in the class.
- * The default constructor simply set the <lock_> to 0 (null). You
+ * Create and initialize create the actual lock used in the class.
+ * The default constructor simply set the @c lock_ to 0 (null). You
* must overwrite this method for this class to work.
*/
ACE_Adaptive_Lock (void);
diff --git a/dep/acelite/ace/Lock_Adapter_T.cpp b/dep/acelite/ace/Lock_Adapter_T.cpp
index fbe43afd217..abe6190866d 100644
--- a/dep/acelite/ace/Lock_Adapter_T.cpp
+++ b/dep/acelite/ace/Lock_Adapter_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Lock_Adapter_T.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Lock_Adapter_T.cpp 93359 2011-02-11 11:33:12Z mcorino $
#ifndef ACE_LOCK_ADAPTER_T_CPP
#define ACE_LOCK_ADAPTER_T_CPP
@@ -16,17 +16,6 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-// This constructor isn't inlined, because SunPRO C++ 4.2 + patch
-// 104631-07 has trouble compiling TAO with it inline.
-template <class ACE_LOCKING_MECHANISM>
-ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_Lock_Adapter (void)
- : lock_ (0),
- delete_lock_ (true)
-{
- ACE_NEW (this->lock_,
- ACE_LOCKING_MECHANISM);
-}
-
template <class ACE_LOCKING_MECHANISM>
ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::~ACE_Lock_Adapter (void)
{
diff --git a/dep/acelite/ace/Lock_Adapter_T.h b/dep/acelite/ace/Lock_Adapter_T.h
index 2fe38302ed4..3785d7a2d39 100644
--- a/dep/acelite/ace/Lock_Adapter_T.h
+++ b/dep/acelite/ace/Lock_Adapter_T.h
@@ -4,7 +4,7 @@
/**
* @file Lock_Adapter_T.h
*
- * $Id: Lock_Adapter_T.h 84481 2009-02-17 10:58:31Z johnnyw $
+ * $Id: Lock_Adapter_T.h 93359 2011-02-11 11:33:12Z mcorino $
*
* Moved from Synch.h.
*
@@ -28,7 +28,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* @class ACE_Lock_Adapter
*
* @brief This is an adapter that allows applications to transparently
- * combine the <ACE_Lock> abstract base class (which contains
+ * combine the ACE_Lock abstract base class (which contains
* pure virtual methods) with any of the other concrete ACE
* synchronization classes (e.g., ACE_Mutex, ACE_Semaphore,
* ACE_RW_Mutex, etc.).
@@ -50,7 +50,7 @@ public:
/// created internally.
ACE_Lock_Adapter (void);
- /// Destructor. If <lock_> was not passed in by the user, it will be
+ /// Destructor. If @c lock_ was not passed in by the user, it will be
/// deleted.
virtual ~ACE_Lock_Adapter (void);
@@ -67,29 +67,29 @@ public:
/**
* Block until the thread acquires a read lock. If the locking
* mechanism doesn't support read locks then this just calls
- * <acquire>.
+ * acquire().
*/
virtual int acquire_read (void);
/**
* Block until the thread acquires a write lock. If the locking
* mechanism doesn't support read locks then this just calls
- * <acquire>.
+ * acquire().
*/
virtual int acquire_write (void);
/// Conditionally acquire a read lock. If the locking mechanism
- /// doesn't support read locks then this just calls <acquire>.
+ /// doesn't support read locks then this just calls acquire().
virtual int tryacquire_read (void);
/// Conditionally acquire a write lock. If the locking mechanism
- /// doesn't support read locks then this just calls <acquire>.
+ /// doesn't support read locks then this just calls acquire().
virtual int tryacquire_write (void);
/**
* Conditionally try to upgrade a lock held for read to a write lock.
* If the locking mechanism doesn't support read locks then this just
- * calls <acquire>. Returns 0 on success, -1 on failure.
+ * calls acquire(). Returns 0 on success, -1 on failure.
*/
virtual int tryacquire_write_upgrade (void);
diff --git a/dep/acelite/ace/Lock_Adapter_T.inl b/dep/acelite/ace/Lock_Adapter_T.inl
index ff102b59d4a..4ffaf6cb69b 100644
--- a/dep/acelite/ace/Lock_Adapter_T.inl
+++ b/dep/acelite/ace/Lock_Adapter_T.inl
@@ -1,6 +1,8 @@
// -*- C++ -*-
//
-// $Id: Lock_Adapter_T.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Lock_Adapter_T.inl 93385 2011-02-14 20:21:20Z mitza $
+
+#include "ace/OS_Memory.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -13,4 +15,14 @@ ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_Lock_Adapter (
{
}
+template <class ACE_LOCKING_MECHANISM>
+ACE_INLINE
+ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_Lock_Adapter (void)
+ : lock_ (0),
+ delete_lock_ (true)
+{
+ ACE_NEW (this->lock_,
+ ACE_LOCKING_MECHANISM);
+}
+
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Log_Msg.cpp b/dep/acelite/ace/Log_Msg.cpp
index 3df89332aea..676236b72ca 100644
--- a/dep/acelite/ace/Log_Msg.cpp
+++ b/dep/acelite/ace/Log_Msg.cpp
@@ -1,4 +1,4 @@
-// $Id: Log_Msg.cpp 92052 2010-09-27 14:20:22Z vzykov $
+// $Id: Log_Msg.cpp 95761 2012-05-15 18:23:04Z johnnyw $
// We need this to get the status of ACE_NTRACE...
#include "ace/config-all.h"
@@ -57,16 +57,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Log_Msg)
# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \
defined (ACE_HAS_TSS_EMULATION)
-#if defined (ACE_MVS)
- static ACE_thread_key_t the_log_msg_tss_key =
- #if !defined(_LP64)
- { '\0','\0','\0','\0' };
- #else
- { '\0','\0','\0','\0','\0','\0','\0','\0' };
- #endif
-#else
- static ACE_thread_key_t the_log_msg_tss_key = 0;
-#endif /* defined (ACE_MVS) */
+static ACE_thread_key_t the_log_msg_tss_key = 0;
ACE_thread_key_t *log_msg_tss_key (void)
{
@@ -1051,27 +1042,30 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
}
if (timestamp_ > 0)
- {
- ACE_TCHAR day_and_time[35];
- const ACE_TCHAR *s = 0;
- if (timestamp_ == 1)
- {
- // Print just the time
- s = ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR), 1);
- }
- else
- {
- // Print time and date
- ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR));
- s = day_and_time;
- }
-
- for (; bspace > 1 && (*bp = *s) != '\0'; ++s, --bspace)
- ++bp;
-
- *bp++ = '|';
- --bspace;
- }
+ {
+ ACE_TCHAR day_and_time[27];
+ const ACE_TCHAR *s = 0;
+ if (timestamp_ == 1)
+ {
+ // Print just the time
+ s = ACE::timestamp (day_and_time,
+ sizeof (day_and_time) / sizeof (ACE_TCHAR),
+ true);
+ }
+ else
+ {
+ // Print time and date
+ ACE::timestamp (day_and_time,
+ sizeof (day_and_time) / sizeof (ACE_TCHAR));
+ s = day_and_time;
+ }
+
+ for (; bspace > 1 && (*bp = *s) != '\0'; ++s, --bspace)
+ ++bp;
+
+ *bp++ = '|';
+ --bspace;
+ }
while (*format_str != '\0' && bspace > 0)
{
@@ -1106,7 +1100,8 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
const ACE_TCHAR *abort_str = ACE_TEXT ("Aborting...");
const ACE_TCHAR *start_format = format_str;
ACE_TCHAR format[128]; // Converted format string
- ACE_TCHAR *fp; // Current format pointer
+ ACE_OS::memset (format, '\0', 128); // Set this string to known values.
+ ACE_TCHAR *fp = 0; // Current format pointer
int wp = 0; // Width/precision extracted from args
bool done = false;
bool skip_nul_locate = false;
@@ -1647,21 +1642,23 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
}
case 'D': // Format the timestamp in format:
- // Weekday Month day year hour:minute:sec.usec
+ // yyyy-mm-dd hour:minute:sec.usec
+ // This is a maximum of 27 characters
+ // including terminator.
{
- ACE_TCHAR day_and_time[35];
+ ACE_TCHAR day_and_time[27];
// Did we find the flag indicating a time value argument
if (format[1] == ACE_TEXT('#'))
{
ACE_Time_Value* time_value = va_arg (argp, ACE_Time_Value*);
ACE::timestamp (*time_value,
day_and_time,
- sizeof day_and_time / sizeof (ACE_TCHAR));
+ sizeof (day_and_time) / sizeof (ACE_TCHAR));
}
else
{
ACE::timestamp (day_and_time,
- sizeof day_and_time / sizeof (ACE_TCHAR));
+ sizeof (day_and_time) / sizeof (ACE_TCHAR));
}
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
ACE_OS::strcpy (fp, ACE_TEXT ("ls"));
@@ -1678,9 +1675,9 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
}
case 'T': // Format the timestamp in
- // hour:minute:sec:usec format.
+ // hour:minute:sec.usec format.
{
- ACE_TCHAR day_and_time[35];
+ ACE_TCHAR day_and_time[27];
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
ACE_OS::strcpy (fp, ACE_TEXT ("ls"));
#else
@@ -1733,15 +1730,6 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
ACE_hthread_t t_id;
ACE_OS::thr_self (t_id);
-# if defined (ACE_MVS) || defined (ACE_TANDEM_T1248_PTHREADS)
- // MVS's pthread_t is a struct... yuck. So use the ACE 5.0
- // code for it.
- ACE_OS::strcpy (fp, ACE_TEXT ("u"));
- if (can_check)
- this_len = ACE_OS::snprintf (bp, bspace, format, t_id);
- else
- this_len = ACE_OS::sprintf (bp, format, t_id);
-# else
// Yes, this is an ugly C-style cast, but the correct
// C++ cast is different depending on whether the t_id
// is an integral type or a pointer type. FreeBSD uses
@@ -1754,7 +1742,6 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
else
this_len = ACE_OS::sprintf
(bp, format, (unsigned long)t_id);
-# endif /* ACE_MWS || ACE_TANDEM_T1248_PTHREADS */
#endif /* ACE_WIN32 */
ACE_UPDATE_COUNT (bspace, this_len);
@@ -1981,21 +1968,6 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
break;
case 'Q':
-#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- {
- // This relies on the ACE_U_LongLong storage layout.
- ACE_UINT32 hi = va_arg (argp, ACE_UINT32);
- ACE_UINT32 lo = va_arg (argp, ACE_UINT32);
- if (hi > 0)
- this_len = ACE_OS::sprintf (bp,
- "0x%lx%0*lx",
- hi,
- 2 * sizeof lo,
- lo);
- else
- this_len = ACE_OS::sprintf (bp, "0x%lx", lo);
- }
-#else /* ! ACE_LACKS_LONGLONG_T */
{
const ACE_TCHAR *fmt = ACE_UINT64_FORMAT_SPECIFIER;
ACE_OS::strcpy (fp, &fmt[1]); // Skip leading %
@@ -2008,15 +1980,10 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
format,
va_arg (argp, ACE_UINT64));
}
-#endif /* ! ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */
ACE_UPDATE_COUNT (bspace, this_len);
break;
case 'q':
- #if defined (ACE_LACKS_LONGLONG_T)
- // No implementation available yet, no ACE_INT64 emulation
- // available yet
- #else /* ! ACE_LACKS_LONGLONG_T */
{
const ACE_TCHAR *fmt = ACE_INT64_FORMAT_SPECIFIER;
ACE_OS::strcpy (fp, &fmt[1]); // Skip leading %
@@ -2029,7 +1996,6 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
format,
va_arg (argp, ACE_INT64));
}
- #endif /* ! ACE_LACKS_LONGLONG_T */
ACE_UPDATE_COUNT (bspace, this_len);
break;
diff --git a/dep/acelite/ace/Log_Msg.h b/dep/acelite/ace/Log_Msg.h
index 28b00325dc7..28d5944937f 100644
--- a/dep/acelite/ace/Log_Msg.h
+++ b/dep/acelite/ace/Log_Msg.h
@@ -4,7 +4,7 @@
/**
* @file Log_Msg.h
*
- * $Id: Log_Msg.h 92298 2010-10-21 11:15:17Z johnnyw $
+ * $Id: Log_Msg.h 95128 2011-11-27 21:22:15Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -556,16 +556,16 @@ public:
size_t size,
const ACE_TCHAR *text = 0);
- static void init_hook (ACE_OS_Log_Msg_Attributes &attributes
-# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
- , ACE_SEH_EXCEPT_HANDLER selector = 0
- , ACE_SEH_EXCEPT_HANDLER handler = 0
-# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
/**
* Init hook, create a Log_Msg_Attribute object, initialize its
* attributes from the TSS Log_Msg and save the object in the
* @a attributes argument
*/
+ static void init_hook (ACE_OS_Log_Msg_Attributes &attributes
+# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
+ , ACE_SEH_EXCEPT_HANDLER selector = 0
+ , ACE_SEH_EXCEPT_HANDLER handler = 0
+# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
);
/**
@@ -633,7 +633,7 @@ private:
/**
* If we're running in the context of an ACE_Thread_Manager this
* will point to the thread descriptor adapter which holds the
- * thread descriptor of the thread. This can be used to repidly
+ * thread descriptor of the thread. This can be used to rapidly
* access all thread data kept in ACE_Thread_Descriptor.
*/
ACE_Thread_Descriptor *thr_desc_;
diff --git a/dep/acelite/ace/Log_Msg_UNIX_Syslog.cpp b/dep/acelite/ace/Log_Msg_UNIX_Syslog.cpp
index 50e78754653..ae4e307ec0e 100644
--- a/dep/acelite/ace/Log_Msg_UNIX_Syslog.cpp
+++ b/dep/acelite/ace/Log_Msg_UNIX_Syslog.cpp
@@ -1,4 +1,4 @@
-// $Id: Log_Msg_UNIX_Syslog.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Log_Msg_UNIX_Syslog.cpp 92791 2010-12-04 16:25:22Z shuston $
#include "ace/config-all.h"
@@ -110,7 +110,7 @@ ACE_Log_Msg_UNIX_Syslog::log (ACE_Log_Record &log_record)
if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::VERBOSE)
|| ACE_BIT_ENABLED (flags, ACE_Log_Msg::VERBOSE_LITE))
{
- ACE_TCHAR date_and_time[35];
+ ACE_TCHAR date_and_time[27];
if (0 == ACE::timestamp (date_and_time, sizeof (date_and_time), 1))
ACE_OS::strcpy (date_and_time, ACE_TEXT ("<time error>"));
const ACE_TCHAR *prio_name =
diff --git a/dep/acelite/ace/Log_Record.cpp b/dep/acelite/ace/Log_Record.cpp
index cea333a5c1e..b626533b517 100644
--- a/dep/acelite/ace/Log_Record.cpp
+++ b/dep/acelite/ace/Log_Record.cpp
@@ -1,11 +1,10 @@
-// $Id: Log_Record.cpp 91764 2010-09-14 13:04:37Z johnnyw $
+// $Id: Log_Record.cpp 92791 2010-12-04 16:25:22Z shuston $
#include "ace/Log_Record.h"
#include "ace/Log_Msg.h"
#include "ace/ACE.h"
#include "ace/OS_NS_stdio.h"
-#include "ace/OS_NS_time.h"
#include "ace/CDR_Stream.h"
#include "ace/Auto_Ptr.h"
#include "ace/Truncate.h"
@@ -214,18 +213,16 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
u_long verbose_flag,
ACE_TCHAR *verbose_msg)
{
- /* 0123456789012345678901234 */
- /* Oct 18 14:25:36.000 1989<nul> */
- ACE_TCHAR timestamp[26]; // Only used by VERBOSE and VERBOSE_LITE.
+ /* 012345678901234567890123456 */
+ /* yyyy-mm-dd hh:mm:ss.mmmmmm<nul> */
+ ACE_TCHAR timestamp[27]; // Only used by VERBOSE and VERBOSE_LITE.
// The sprintf format needs to be different for Windows and POSIX
// in the wide-char case.
#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
- const ACE_TCHAR *time_fmt = ACE_TEXT ("%s.%03ld %s");
const ACE_TCHAR *verbose_fmt = ACE_TEXT ("%s@%s@%u@%s@%s");
const ACE_TCHAR *verbose_lite_fmt = ACE_TEXT ("%s@%s@%s");
#else
- const ACE_TCHAR *time_fmt = ACE_TEXT ("%ls.%03ld %ls");
const ACE_TCHAR *verbose_fmt = ACE_TEXT ("%ls@%ls@%u@%ls@%ls");
const ACE_TCHAR *verbose_lite_fmt = ACE_TEXT ("%ls@%ls@%ls");
#endif
@@ -235,23 +232,16 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
|| ACE_BIT_ENABLED (verbose_flag,
ACE_Log_Msg::VERBOSE_LITE))
{
- time_t const now = this->secs_;
- ACE_TCHAR ctp[26]; // 26 is a magic number...
-
- if (ACE_OS::ctime_r (&now, ctp, sizeof ctp / sizeof (ACE_TCHAR)) == 0)
+ ACE_Time_Value reftime (this->secs_, this->usecs_);
+ if (0 == ACE::timestamp (reftime,
+ timestamp,
+ sizeof (timestamp) / sizeof (ACE_TCHAR)))
return -1;
- /* 01234567890123456789012345 */
- /* Wed Oct 18 14:25:36 1989n0 */
-
- ctp[19] = '\0'; // NUL-terminate after the time.
- ctp[24] = '\0'; // NUL-terminate after the date.
-
- ACE_OS::sprintf (timestamp,
- time_fmt,
- ctp + 4,
- ((long) this->usecs_) / 1000,
- ctp + 20);
+ // Historical timestamp in VERBOSE[_LITE] used 3 places for partial sec.
+ // 012345678901234567890123456
+ // 1989-10-18 14:25:36.123<nul>
+ timestamp[23] = '\0';
}
if (ACE_BIT_ENABLED (verbose_flag,
diff --git a/dep/acelite/ace/MEM_Stream.h b/dep/acelite/ace/MEM_Stream.h
index 63ad2736a4d..6f0d3616070 100644
--- a/dep/acelite/ace/MEM_Stream.h
+++ b/dep/acelite/ace/MEM_Stream.h
@@ -4,7 +4,7 @@
/**
* @file MEM_Stream.h
*
- * $Id: MEM_Stream.h 92069 2010-09-28 11:38:59Z johnnyw $
+ * $Id: MEM_Stream.h 94448 2011-09-08 08:20:29Z johnnyw $
*
* @author Nanbor Wang <nanbor@cs.wustl.edu>
*/
@@ -13,8 +13,11 @@
#ifndef ACE_MEM_STREAM_H
#define ACE_MEM_STREAM_H
+
#include /**/ "ace/pre.h"
+#include /**/ "ace/ACE_export.h"
+
#include "ace/MEM_IO.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
diff --git a/dep/acelite/ace/MMAP_Memory_Pool.cpp b/dep/acelite/ace/MMAP_Memory_Pool.cpp
index 82556a8327a..f1a65100700 100644
--- a/dep/acelite/ace/MMAP_Memory_Pool.cpp
+++ b/dep/acelite/ace/MMAP_Memory_Pool.cpp
@@ -1,4 +1,4 @@
-// $Id: MMAP_Memory_Pool.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: MMAP_Memory_Pool.cpp 93974 2011-04-22 07:26:59Z msmit $
// MMAP_Memory_Pool.cpp
#include "ace/MMAP_Memory_Pool.h"
@@ -372,7 +372,7 @@ ACE_MMAP_Memory_Pool::init_acquire (size_t nbytes,
void *result = this->acquire (nbytes, rounded_bytes);
// After the first time, reset the flag so that subsequent calls
// will use MAP_FIXED
- if (use_fixed_addr_ == ACE_MMAP_Memory_Pool_Options::FIRSTCALL_FIXED)
+ if (this->use_fixed_addr_ == ACE_MMAP_Memory_Pool_Options::FIRSTCALL_FIXED)
{
ACE_SET_BITS (flags_, MAP_FIXED);
}
diff --git a/dep/acelite/ace/Malloc_T.cpp b/dep/acelite/ace/Malloc_T.cpp
index 88b456d66e2..be56870f342 100644
--- a/dep/acelite/ace/Malloc_T.cpp
+++ b/dep/acelite/ace/Malloc_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Malloc_T.cpp 91809 2010-09-17 07:20:41Z johnnyw $
+// $Id: Malloc_T.cpp 94341 2011-07-22 12:33:43Z schmidt $
#ifndef ACE_MALLOC_T_CPP
#define ACE_MALLOC_T_CPP
@@ -105,16 +105,17 @@ ACE_Dynamic_Cached_Allocator<ACE_LOCK>::ACE_Dynamic_Cached_Allocator
(size_t n_chunks, size_t chunk_size)
: pool_ (0),
free_list_ (ACE_PURE_FREE_LIST),
- chunk_size_(chunk_size)
+ chunk_size_ (chunk_size)
{
+ ACE_ASSERT (chunk_size > 0);
chunk_size = ACE_MALLOC_ROUNDUP (chunk_size, ACE_MALLOC_ALIGN);
- ACE_NEW (this->pool_, char[n_chunks * chunk_size_]);
+ ACE_NEW (this->pool_, char[n_chunks * chunk_size]);
for (size_t c = 0;
c < n_chunks;
c++)
{
- void* placement = this->pool_ + c * chunk_size_;
+ void *placement = this->pool_ + c * chunk_size;
this->free_list_.add (new (placement) ACE_Cached_Mem_Pool_Node<char>);
}
diff --git a/dep/acelite/ace/Map_T.h b/dep/acelite/ace/Map_T.h
index bb5965a76d3..5eeecc007bf 100644
--- a/dep/acelite/ace/Map_T.h
+++ b/dep/acelite/ace/Map_T.h
@@ -4,7 +4,7 @@
/**
* @file Map_T.h
*
- * $Id: Map_T.h 92097 2010-09-30 05:41:49Z msmit $
+ * $Id: Map_T.h 93792 2011-04-07 11:48:50Z mcorino $
*
* @author Irfan Pyarali <irfan@cs.wustl.edu>
*/
@@ -851,11 +851,11 @@ public:
/// Close down and release dynamically allocated resources.
virtual ~ACE_Active_Map_Manager_Adapter (void);
- /// Initialize a <Map> with size @a length.
+ /// Initialize a Map with size @a length.
virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE,
ACE_Allocator *alloc = 0);
- /// Close down a <Map> and release dynamically allocated resources.
+ /// Close down a Map and release dynamically allocated resources.
virtual int close (void);
/**
@@ -870,11 +870,10 @@ public:
/**
* Add @a key / @a value pair to the map. @a key is an "inout" parameter
* and maybe modified/extended by the map to add additional
- * information. To recover original key, call the <recover_key>
+ * information. To recover original key, call the recover_key()
* method.
*/
- virtual int bind_modify_key (const VALUE &value,
- KEY &key);
+ virtual int bind_modify_key (const VALUE &value, KEY &key);
/**
* Produce a key and return it through @a key which is an "out"
@@ -910,7 +909,7 @@ public:
virtual int bind_create_key (const VALUE &value);
/// Recovers the original key potentially modified by the map during
- /// <bind_modify_key>.
+ /// bind_modify_key().
virtual int recover_key (const KEY &modified_key,
KEY &original_key);
diff --git a/dep/acelite/ace/Mem_Map.cpp b/dep/acelite/ace/Mem_Map.cpp
index baf9ce36189..c4e689ec842 100644
--- a/dep/acelite/ace/Mem_Map.cpp
+++ b/dep/acelite/ace/Mem_Map.cpp
@@ -1,8 +1,9 @@
-// $Id: Mem_Map.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Mem_Map.cpp 95716 2012-05-01 07:49:04Z johnnyw $
// Defines the member functions for the memory mapping facility.
#include "ace/Mem_Map.h"
+
#if !defined (__ACE_INLINE__)
#include "ace/Mem_Map.inl"
#endif /* __ACE_INLINE__ */
@@ -13,13 +14,10 @@
#include "ace/Log_Msg.h"
#include "ace/Truncate.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Mem_Map)
-
void
ACE_Mem_Map::dump (void) const
{
@@ -79,68 +77,95 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle,
this->base_addr_ = addr;
this->handle_ = handle;
- // Get the current filesize
- ACE_OFF_T const current_file_length = ACE_OS::filesize (this->handle_);
-
- // Flag to indicate if we need to extend the back store
- bool extend_backing_store = false;
-
- // File length requested by user
- ACE_OFF_T requested_file_length = 0;
+ // mmap through character device doens't care about it's size
+ // So map with /dev/* is done with a special case.
+ ACE_stat current_file_type;
+ int result = ACE_OS::fstat (this->handle_, &current_file_type);
- // Check <length_request>
- if (length_request == static_cast<size_t> (-1))
+ if (result == -1)
{
- // Set length to file_request or size_t max.
- this->length_ = ACE_Utils::truncate_cast<size_t> (current_file_length - offset);
+ // Something wrong found, bail out.
+ return -1;
}
- else
+ else if ((current_file_type.st_mode & S_IFMT) == S_IFCHR)
{
- // Make sure that we have not been asked to do the impossible.
- if (static_cast<ACE_UINT64> (length_request)
- + static_cast<ACE_UINT64> (offset)
- > static_cast<ACE_UINT64> (ACE_Numeric_Limits<ACE_OFF_T>::max ()))
- return -1;
-
- // File length implicitly requested by user
- requested_file_length = static_cast<ACE_OFF_T> (length_request) + offset;
-
- // Check to see if we need to extend the backing store
- if (requested_file_length > current_file_length)
- {
- // If the length of the mapped region is less than the
- // length of the file then we force a complete new remapping
- // by setting the descriptor to ACE_INVALID_HANDLE (closing
- // down the descriptor if necessary).
- this->close_filemapping_handle ();
-
- // Remember to extend the backing store
- extend_backing_store = true;
- }
-
// Set length to length_request
this->length_ = length_request;
}
-
- // Check if we need to extend the backing store.
- if (extend_backing_store)
+ else if ((current_file_type.st_mode & S_IFMT) == S_IFREG)
{
- // Remember than write increases the size by one.
- ACE_OFF_T null_byte_position = 0;
- if (requested_file_length > 0)
+ // Get the current filesize
+ ACE_OFF_T const current_file_length = ACE_OS::filesize (this->handle_);
+
+ // Flag to indicate if we need to extend the back store
+ bool extend_backing_store = false;
+
+ // File length requested by user
+ ACE_OFF_T requested_file_length = 0;
+
+ // Check <length_request>
+ if (length_request == static_cast<size_t> (-1))
{
- // This will make the file size <requested_file_length>
- null_byte_position = requested_file_length - 1;
+ // Set length to file_request or size_t max.
+ this->length_ = ACE_Utils::truncate_cast<size_t> (current_file_length - offset);
+#if defined (ACE_MMAP_NO_ZERO)
+ if (this->length_ == 0)
+ {
+ this->length_ = ACE_OS::getpagesize ();
+ }
+#endif /* ACE_MMAP_NO_ZERO */
+ }
+ else
+ {
+ // Make sure that we have not been asked to do the impossible.
+ if (static_cast<ACE_UINT64> (length_request)
+ + static_cast<ACE_UINT64> (offset)
+ > static_cast<ACE_UINT64> (ACE_Numeric_Limits<ACE_OFF_T>::max ()))
+ return -1;
+
+ // File length implicitly requested by user
+ requested_file_length = static_cast<ACE_OFF_T> (length_request) + offset;
+
+ // Check to see if we need to extend the backing store
+ if (requested_file_length > current_file_length)
+ {
+ // If the length of the mapped region is less than the
+ // length of the file then we force a complete new remapping
+ // by setting the descriptor to ACE_INVALID_HANDLE (closing
+ // down the descriptor if necessary).
+ this->close_filemapping_handle ();
+
+ // Remember to extend the backing store
+ extend_backing_store = true;
+ }
+
+ // Set length to length_request
+ this->length_ = length_request;
}
- if (ACE_OS::pwrite (this->handle_,
- "",
- 1,
- null_byte_position) == -1)
- return -1;
- }
+ // Check if we need to extend the backing store.
+ if (extend_backing_store)
+ {
+ // Remember than write increases the size by one.
+ ACE_OFF_T null_byte_position = 0;
+ if (requested_file_length > 0)
+ {
+ // This will make the file size <requested_file_length>
+ null_byte_position = requested_file_length - 1;
+ }
+
+ if (ACE_OS::pwrite (this->handle_,
+ "",
+ 1,
+ null_byte_position) == -1)
+ return -1;
+ }
+ }
+ else
+ // Unmappable file type.
+ return -1;
- this->base_addr_ = ACE_OS::mmap (this->base_addr_,
+ this->base_addr_ = ACE_OS::mmap (this->base_addr_,
this->length_,
prot,
share,
diff --git a/dep/acelite/ace/Message_Block.cpp b/dep/acelite/ace/Message_Block.cpp
index 0265fa11f1c..3ce71d6c5ca 100644
--- a/dep/acelite/ace/Message_Block.cpp
+++ b/dep/acelite/ace/Message_Block.cpp
@@ -1,4 +1,4 @@
-// $Id: Message_Block.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Message_Block.cpp 94516 2011-09-21 14:51:23Z johnnyw $
#include "ace/Message_Block.h"
#if !defined (__ACE_INLINE__)
@@ -1173,80 +1173,88 @@ ACE_Message_Block::clone (Message_Flags mask) const
{
ACE_TRACE ("ACE_Message_Block::clone");
- // Get a pointer to a "cloned" <ACE_Data_Block> (will copy the
- // values rather than increment the reference count).
- ACE_Data_Block *db = this->data_block ()->clone (mask);
+ const ACE_Message_Block *old_message_block = this;
+ ACE_Message_Block *new_message_block = 0;
+ ACE_Message_Block *new_previous_message_block = 0;
+ ACE_Message_Block *new_root_message_block = 0;
- if (db == 0)
- return 0;
-
- ACE_Message_Block *nb = 0;
-
- if(message_block_allocator_ == 0)
- {
- ACE_NEW_RETURN (nb,
- ACE_Message_Block (0, // size
- ACE_Message_Type (0), // type
- 0, // cont
- 0, // data
- 0, // allocator
- 0, // locking strategy
- 0, // flags
- this->priority_, // priority
- ACE_EXECUTION_TIME, // execution time
- ACE_DEADLINE_TIME, // absolute time to deadline
- // Get a pointer to a
- // "duplicated" <ACE_Data_Block>
- // (will simply increment the
- // reference count).
- db,
- db->data_block_allocator (),
- this->message_block_allocator_),
- 0);
- }
- else
+ do
{
- // This is the ACE_NEW_MALLOC macro with the return check removed.
- // We need to do it this way because if it fails we need to release
- // the cloned data block that was created above. If we used
- // ACE_NEW_MALLOC_RETURN, there would be a memory leak because the
- // above db pointer would be left dangling.
- nb = static_cast<ACE_Message_Block*> (message_block_allocator_->malloc (sizeof (ACE_Message_Block)));
- if(nb != 0)
- new (nb) ACE_Message_Block (0, // size
- ACE_Message_Type (0), // type
- 0, // cont
- 0, // data
- 0, // allocator
- 0, // locking strategy
- 0, // flags
- this->priority_, // priority
- ACE_EXECUTION_TIME, // execution time
- ACE_DEADLINE_TIME, // absolute time to deadline
- db,
- db->data_block_allocator (),
- this->message_block_allocator_);
- }
+ // Get a pointer to a "cloned"<ACE_Data_Block> (will copy the
+ // values rather than increment the reference count).
+ ACE_Data_Block *db = old_message_block->data_block ()->clone (mask);
- if (nb == 0)
- {
- db->release ();
- return 0;
- }
+ if (db == 0)
+ return 0;
- // Set the read and write pointers in the new <Message_Block> to the
- // same relative offset as in the existing <Message_Block>.
- nb->rd_ptr (this->rd_ptr_);
- nb->wr_ptr (this->wr_ptr_);
+ if(old_message_block->message_block_allocator_ == 0)
+ {
+ ACE_NEW_RETURN (new_message_block,
+ ACE_Message_Block (0, // size
+ ACE_Message_Type (0), // type
+ 0, // cont
+ 0, // data
+ 0, // allocator
+ 0, // locking strategy
+ 0, // flags
+ old_message_block->priority_, // priority
+ ACE_EXECUTION_TIME, // execution time
+ ACE_DEADLINE_TIME, // absolute time to deadline
+ // Get a pointer to a
+ // "duplicated"<ACE_Data_Block>
+ // (will simply increment the
+ // reference count).
+ db,
+ db->data_block_allocator (),
+ old_message_block->message_block_allocator_),
+ 0);
+ }
+ else
+ {
+ // This is the ACE_NEW_MALLOC macro with the return check removed.
+ // We need to do it this way because if it fails we need to release
+ // the cloned data block that was created above. If we used
+ // ACE_NEW_MALLOC_RETURN, there would be a memory leak because the
+ // above db pointer would be left dangling.
+ new_message_block = static_cast<ACE_Message_Block*> (message_block_allocator_->malloc (sizeof (ACE_Message_Block)));
+ if (new_message_block != 0)
+ new (new_message_block) ACE_Message_Block (0, // size
+ ACE_Message_Type (0), // type
+ 0, // cont
+ 0, // data
+ 0, // allocator
+ 0, // locking strategy
+ 0, // flags
+ old_message_block->priority_, // priority
+ ACE_EXECUTION_TIME, // execution time
+ ACE_DEADLINE_TIME, // absolute time to deadline
+ db,
+ db->data_block_allocator (),
+ old_message_block->message_block_allocator_);
+ }
- // Clone all the continuation messages if necessary.
- if (this->cont () != 0
- && (nb->cont_ = this->cont ()->clone (mask)) == 0)
- {
- nb->release ();
- return 0;
+ if (new_message_block == 0)
+ {
+ db->release ();
+ return 0;
+ }
+
+ // Set the read and write pointers in the new <Message_Block> to the
+ // same relative offset as in the existing <Message_Block>.
+ new_message_block->rd_ptr (old_message_block->rd_ptr_);
+ new_message_block->wr_ptr (old_message_block->wr_ptr_);
+ // save the root message block to return
+ if (new_root_message_block == 0)
+ new_root_message_block = new_message_block;
+ if (new_previous_message_block != 0)
+ // we're a continuation of the previous block, add ourself to its chain
+ new_previous_message_block->cont_ = new_message_block;
+ new_previous_message_block = new_message_block;
+ old_message_block = old_message_block->cont ();
}
- return nb;
+ while (old_message_block != 0);
+
+ return new_root_message_block;
}
// This is private.
diff --git a/dep/acelite/ace/Message_Block.h b/dep/acelite/ace/Message_Block.h
index 0e8c4bfd643..516f6fd42d1 100644
--- a/dep/acelite/ace/Message_Block.h
+++ b/dep/acelite/ace/Message_Block.h
@@ -4,7 +4,7 @@
/**
* @file Message_Block.h
*
- * $Id: Message_Block.h 91066 2010-07-12 11:05:04Z johnnyw $
+ * $Id: Message_Block.h 95798 2012-05-31 07:58:55Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -204,7 +204,7 @@ public:
/**
* Create a Message Block that assumes it has ownership of @a data,
- * but in reality it doesnt (i.e., cannot delete it since it didn't
+ * but in reality it doesn't (i.e., cannot delete it since it didn't
* malloc it!). Note that the @c size of the Message_Block will
* be @a size, but the @a length will be 0 until <wr_ptr> is set.
*/
@@ -276,8 +276,8 @@ public:
// = Data Block flag accessors and mutators.
/// Bitwise-or the @a more_flags into the existing message flags and
/// return the new value.
- /* @todo: I think the following set of methods could not be used at
- * all. May be they are useless. Let us have it so that we dont
+ /** @todo I think the following set of methods could not be used at
+ * all. May be they are useless. Let us have it so that we don't
* mess up memory management of the Message_Block. Somebody correct
* me if I am totally totally wrong..
*/
@@ -319,9 +319,9 @@ public:
/**
* Return a "shallow" copy that increments our reference count by 1.
- * This is similar to CORBA's <_duplicate> method, which is useful
+ * This is similar to CORBA's _duplicate() method, which is useful
* if you want to eliminate lots of checks for NULL @a mb pointers
- * before calling <_duplicate> on them.
+ * before calling _duplicate() on them.
*/
static ACE_Message_Block *duplicate (const ACE_Message_Block *mb);
@@ -355,10 +355,10 @@ public:
virtual ACE_Message_Block *release (void);
/**
- * This behaves like the non-static method <release>, except that it
- * checks if @a mb is 0. This is similar to <CORBA::release>, which
+ * This behaves like the non-static method release(), except that it
+ * checks if @a mb is 0. This is similar to CORBA::release(), which
* is useful if you want to eliminate lots of checks for NULL
- * pointers before calling <release> on them. Returns @a mb.
+ * pointers before calling release() on them. Returns @a mb.
*/
static ACE_Message_Block *release (ACE_Message_Block *mb);
@@ -717,7 +717,7 @@ public:
*/
char *mark (void) const;
- // = Message size is the total amount of space alloted.
+ // = Message size is the total amount of space allotred.
/// Get the total amount of allotted space in the message. The amount of
/// allotted space may be less than allocated space.
@@ -762,11 +762,11 @@ public:
ACE_Data_Block *release (ACE_Lock *lock = 0);
// = Message flag accessors and mutators.
- /// Bitwise-or the <more_flags> into the existing message flags and
+ /// Bitwise-or the @a more_flags into the existing message flags and
/// return the new value.
ACE_Message_Block::Message_Flags set_flags (ACE_Message_Block::Message_Flags more_flags);
- /// Clear the message flag bits specified in <less_flags> and return
+ /// Clear the message flag bits specified in @a less_flags and return
/// the new value.
ACE_Message_Block::Message_Flags clr_flags (ACE_Message_Block::Message_Flags less_flags);
@@ -803,7 +803,7 @@ protected:
* Decrease the reference count, but don't delete the object.
* Returns 0 if the object should be removed.
* If @a lock is equal to the locking strategy then we assume that
- * the lock is beign held by the current thread; this is used to
+ * the lock is being held by the current thread; this is used to
* release all the data blocks in a chain while holding a single
* lock.
*/
@@ -843,7 +843,7 @@ protected:
/**
* Reference count for this ACE_Data_Block, which is used to avoid
- * deep copies (i.e., <clone>). Note that this pointer value is
+ * deep copies (i.e., clone()). Note that this pointer value is
* shared by all owners of the <Data_Block>'s data, i.e., all the
* ACE_Message_Blocks.
*/
diff --git a/dep/acelite/ace/Message_Queue.h b/dep/acelite/ace/Message_Queue.h
index eca4a37606c..2a70a1046a9 100644
--- a/dep/acelite/ace/Message_Queue.h
+++ b/dep/acelite/ace/Message_Queue.h
@@ -4,7 +4,7 @@
/**
* @file Message_Queue.h
*
- * $Id: Message_Queue.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Message_Queue.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -26,14 +26,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decls.
class ACE_Notification_Strategy;
-template <ACE_SYNCH_DECL> class ACE_Message_Queue_Iterator;
-template <ACE_SYNCH_DECL> class ACE_Message_Queue_Reverse_Iterator;
+template <ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Message_Queue_Iterator;
+template <ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Message_Queue_Reverse_Iterator;
/**
* @class ACE_Message_Queue_Base
*
* @brief Base class for ACE_Message_Queue, which is the central
- * queueing facility for messages in the ACE framework.
+ * queuing facility for messages in the ACE framework.
*
* For all the ACE_Time_Value pointer parameters the caller will
* block until action is possible if @a timeout == 0. Otherwise, it
@@ -90,7 +90,7 @@ public:
* that @a timeout uses <{absolute}> time rather than <{relative}>
* time. If the @a timeout elapses without receiving a message -1 is
* returned and @c errno is set to @c EWOULDBLOCK. If the queue is
- * deactivated -1 is returned and @c errno is set to <ESHUTDOWN>.
+ * deactivated -1 is returned and @c errno is set to @c ESHUTDOWN.
* Otherwise, returns -1 on failure, else the number of items still
* on the queue.
*/
@@ -101,8 +101,8 @@ public:
* Enqueue a <ACE_Message_Block *> into the tail of the queue.
* Returns number of items in queue if the call succeeds or -1
* otherwise. These calls return -1 when queue is closed,
- * deactivated (in which case @c errno == <ESHUTDOWN>), when a signal
- * occurs (in which case @c errno == <EINTR>, or if the time
+ * deactivated (in which case @c errno == @c ESHUTDOWN), when a signal
+ * occurs (in which case @c errno == @c EINTR, or if the time
* specified in timeout elapses (in which case @c errno ==
* @c EWOULDBLOCK).
*/
@@ -115,8 +115,8 @@ public:
* Dequeue and return the <ACE_Message_Block *> at the head of the
* queue. Returns number of items in queue if the call succeeds or
* -1 otherwise. These calls return -1 when queue is closed,
- * deactivated (in which case @c errno == <ESHUTDOWN>), when a signal
- * occurs (in which case @c errno == <EINTR>, or if the time
+ * deactivated (in which case @c errno == @c ESHUTDOWN), when a signal
+ * occurs (in which case @c errno == @c EINTR, or if the time
* specified in timeout elapses (in which case @c errno ==
* @c EWOULDBLOCK).
*/
diff --git a/dep/acelite/ace/Message_Queue_NT.cpp b/dep/acelite/ace/Message_Queue_NT.cpp
index 085282e2039..385af2c1b9b 100644
--- a/dep/acelite/ace/Message_Queue_NT.cpp
+++ b/dep/acelite/ace/Message_Queue_NT.cpp
@@ -1,4 +1,4 @@
-// $Id: Message_Queue_NT.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Message_Queue_NT.cpp 92900 2010-12-17 14:45:11Z mcorino $
#include "ace/Message_Queue.h"
#include "ace/Message_Queue_NT.h"
@@ -29,10 +29,13 @@ ACE_Message_Queue_NT::open (DWORD max_threads)
{
ACE_TRACE ("ACE_Message_Queue_NT::open");
this->max_cthrs_ = max_threads;
+ this->state_ = ACE_Message_Queue_Base::ACTIVATED;
this->completion_port_ = ::CreateIoCompletionPort (ACE_INVALID_HANDLE,
0,
ACE_Message_Queue_Base::ACTIVATED,
max_threads);
+ if (this->completion_port_ == 0)
+ this->state_ = ACE_Message_Queue_Base::DEACTIVATED;
return (this->completion_port_ == 0 ? -1 : 0);
}
diff --git a/dep/acelite/ace/Message_Queue_T.cpp b/dep/acelite/ace/Message_Queue_T.cpp
index 922c5ab83d6..710df2c43da 100644
--- a/dep/acelite/ace/Message_Queue_T.cpp
+++ b/dep/acelite/ace/Message_Queue_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Message_Queue_T.cpp 91633 2010-09-07 14:27:13Z johnnyw $
+// $Id: Message_Queue_T.cpp 96070 2012-08-17 09:07:16Z mcorino $
#ifndef ACE_MESSAGE_QUEUE_T_CPP
#define ACE_MESSAGE_QUEUE_T_CPP
@@ -6,6 +6,7 @@
// #include Message_Queue.h instead of Message_Queue_T.h to avoid
// circular include problems.
#include "ace/Message_Queue.h"
+#include "ace/Message_Queue_Vx.h"
#include "ace/Log_Msg.h"
#include "ace/OS_NS_sys_time.h"
@@ -19,6 +20,7 @@
#include "ace/Notification_Strategy.h"
#include "ace/Truncate.h"
+#include "ace/Condition_Attributes.h"
#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
#include "ace/OS_NS_stdio.h"
@@ -33,93 +35,93 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Dynamic_Message_Queue)
ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Ex)
ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Ex_N)
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dump (void) const
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dump");
this->queue_.dump ();
#endif /* ACE_HAS_DUMP */
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes (size_t new_value)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_bytes (size_t new_value)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_bytes");
this->queue_.message_bytes (new_value);
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length (size_t new_value)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_length (size_t new_value)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_length");
this->queue_.message_length (new_value);
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex (size_t high_water_mark,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue_Ex (size_t high_water_mark,
size_t low_water_mark,
ACE_Notification_Strategy *ns)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue_Ex");
if (this->queue_.open (high_water_mark, low_water_mark, ns) == -1)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_Message_Queue_Ex")));
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::~ACE_Message_Queue_Ex (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::~ACE_Message_Queue_Ex (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::~ACE_Message_Queue_Ex");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::~ACE_Message_Queue_Ex");
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::open (size_t hwm,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::open (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::open");
return this->queue_.open (hwm, lwm, ns);
}
// Clean up the queue if we have not already done so!
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::close (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::close (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::close");
return this->queue_.close ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::flush (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::flush (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::flush");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::flush");
return this->queue_.flush ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::flush_i (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::flush_i (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::flush_i");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::flush_i");
return this->queue_.flush_i ();
}
// Take a look at the first item without removing it.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::peek_dequeue_head (ACE_MESSAGE_TYPE *&first_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::peek_dequeue_head (ACE_MESSAGE_TYPE *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::peek_dequeue_head");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::peek_dequeue_head");
ACE_Message_Block *mb = 0;
@@ -131,18 +133,18 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::peek_dequeue_head (ACE_ME
return cur_count;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head (ACE_MESSAGE_TYPE *new_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_head (ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_head");
ACE_Message_Block *mb = 0;
ACE_NEW_RETURN (mb,
ACE_Message_Block ((char *) new_item,
sizeof (*new_item),
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY),
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::DEFAULT_PRIORITY),
-1);
int const result = this->queue_.enqueue_head (mb, timeout);
@@ -156,21 +158,21 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head (ACE_MESSAGE
// accordance with its <msg_priority> (0 is lowest priority). Returns
// -1 on failure, else the number of items still on the queue.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue (ACE_MESSAGE_TYPE *new_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue (ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue");
return this->enqueue_prio (new_item, timeout);
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_prio (ACE_MESSAGE_TYPE *new_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_prio (ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout,
unsigned long priority)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_prio");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_prio");
ACE_Message_Block *mb = 0;
@@ -188,18 +190,18 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_prio (ACE_MESSAGE
return result;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_deadline (ACE_MESSAGE_TYPE *new_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_deadline (ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_deadline");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_deadline");
ACE_Message_Block *mb = 0;
ACE_NEW_RETURN (mb,
ACE_Message_Block ((char *) new_item,
sizeof (*new_item),
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY ),
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::DEFAULT_PRIORITY ),
-1);
int const result = this->queue_.enqueue_deadline (mb, timeout);
@@ -213,18 +215,18 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_deadline (ACE_MES
// Block indefinitely waiting for an item to arrive,
// does not ignore alerts (e.g., signals).
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail (ACE_MESSAGE_TYPE *new_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail (ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail");
ACE_Message_Block *mb = 0;
ACE_NEW_RETURN (mb,
ACE_Message_Block ((char *) new_item,
sizeof (*new_item),
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY),
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::DEFAULT_PRIORITY),
-1);
int const result = this->queue_.enqueue_tail (mb, timeout);
@@ -238,11 +240,11 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail (ACE_MESSAGE
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_head (ACE_MESSAGE_TYPE *&first_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_head (ACE_MESSAGE_TYPE *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_head");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_head");
ACE_Message_Block *mb = 0;
@@ -263,11 +265,11 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_head (ACE_MESSAGE
// block indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_prio (ACE_MESSAGE_TYPE *&dequeued,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_prio (ACE_MESSAGE_TYPE *&dequeued,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_prio");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_prio");
ACE_Message_Block *mb = 0;
@@ -288,11 +290,11 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_prio (ACE_MESSAGE
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_tail (ACE_MESSAGE_TYPE *&dequeued,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_tail (ACE_MESSAGE_TYPE *&dequeued,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_tail");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_tail");
ACE_Message_Block *mb = 0;
@@ -313,11 +315,11 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_tail (ACE_MESSAGE
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_deadline (ACE_MESSAGE_TYPE *&dequeued,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_deadline (ACE_MESSAGE_TYPE *&dequeued,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_deadline");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue_deadline");
ACE_Message_Block *mb = 0;
@@ -334,24 +336,24 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_deadline (ACE_MES
return cur_count;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notify (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::notify (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notify");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::notify");
return this->queue_.notify ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::
-ACE_Message_Queue_Ex_Iterator (ACE_Message_Queue_Ex <ACE_MESSAGE_TYPE, ACE_SYNCH_USE> & queue)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::
+ACE_Message_Queue_Ex_Iterator (ACE_Message_Queue_Ex <ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> & queue)
: iter_ (queue.queue_)
{
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::
next (ACE_MESSAGE_TYPE *&entry)
{
ACE_Message_Block * mb = 0;
@@ -363,36 +365,36 @@ next (ACE_MESSAGE_TYPE *&entry)
return retval;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::done (void) const
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::done (void) const
{
return this->iter_.done ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::advance (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::advance (void)
{
return this->iter_.advance ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dump (void) const
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
this->iter_.dump ();
}
ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Ex_Iterator)
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::
-ACE_Message_Queue_Ex_Reverse_Iterator (ACE_Message_Queue_Ex <ACE_MESSAGE_TYPE, ACE_SYNCH_USE> & queue)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::
+ACE_Message_Queue_Ex_Reverse_Iterator (ACE_Message_Queue_Ex <ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> & queue)
: iter_ (queue.queue_)
{
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::
next (ACE_MESSAGE_TYPE *&entry)
{
ACE_Message_Block * mb = 0;
@@ -404,50 +406,50 @@ next (ACE_MESSAGE_TYPE *&entry)
return retval;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::done (void) const
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::done (void) const
{
return this->iter_.done ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::advance (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::advance (void)
{
return this->iter_.advance ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dump (void) const
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
this->iter_.dump ();
}
ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Ex_Reverse_Iterator)
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex_N
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue_Ex_N
(size_t high_water_mark,
size_t low_water_mark,
ACE_Notification_Strategy *ns):
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> (high_water_mark,
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> (high_water_mark,
low_water_mark,
ns)
{
- ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex_N");
+ ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue_Ex_N");
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::~ACE_Message_Queue_Ex_N (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::~ACE_Message_Queue_Ex_N (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::~ACE_Message_Queue_Ex_N");
+ ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::~ACE_Message_Queue_Ex_N");
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_head
(ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head");
+ ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_head");
// Create a chained ACE_Message_Blocks wrappers around the 'chained'
// ACE_MESSAGE_TYPES.
@@ -466,12 +468,12 @@ ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head
return result;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail
(ACE_MESSAGE_TYPE *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail");
+ ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail");
// Create a chained ACE_Message_Blocks wrappers around the 'chained'
// ACE_MESSAGE_TYPES.
@@ -490,11 +492,11 @@ ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail
return result;
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_Message_Block *
-ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::wrap_with_mbs_i
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> ACE_Message_Block *
+ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::wrap_with_mbs_i
(ACE_MESSAGE_TYPE *new_item)
{
- ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::wrap_with_mbs_i");
+ ACE_TRACE ("ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::wrap_with_mbs_i");
// We need to keep a reference to the head of the chain
ACE_Message_Block *mb_head = 0;
@@ -502,7 +504,7 @@ ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::wrap_with_mbs_i
ACE_NEW_RETURN (mb_head,
ACE_Message_Block ((char *) new_item,
sizeof (*new_item),
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY),
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::DEFAULT_PRIORITY),
0);
// mb_tail will point to the last ACE_Message_Block
@@ -515,7 +517,7 @@ ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::wrap_with_mbs_i
ACE_NEW_NORETURN (mb_temp,
ACE_Message_Block ((char *) pobj,
sizeof (*pobj),
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY));
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::DEFAULT_PRIORITY));
if (mb_temp == 0)
{
mb_head->release ();
@@ -532,162 +534,176 @@ ACE_Message_Queue_Ex_N<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::wrap_with_mbs_i
ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Reverse_Iterator)
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue (ACE_MESSAGE_TYPE *&first_item,
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue (ACE_MESSAGE_TYPE *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::dequeue");
return this->dequeue_head (first_item, timeout);
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_Notification_Strategy *
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> ACE_Notification_Strategy *
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::notification_strategy (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::notification_strategy");
return this->queue_.notification_strategy ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy (ACE_Notification_Strategy *s)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::notification_strategy (ACE_Notification_Strategy *s)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::notification_strategy");
this->queue_.notification_strategy (s);
}
// Check if queue is empty (holds locks).
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> bool
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_empty (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> bool
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::is_empty (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_empty");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::is_empty");
return this->queue_.is_empty ();
}
// Check if queue is full (holds locks).
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> bool
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_full (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> bool
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::is_full (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::is_full");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::is_full");
return this->queue_.is_full ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> size_t
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::high_water_mark (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::high_water_mark");
return this->queue_.high_water_mark ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark (size_t hwm)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::high_water_mark (size_t hwm)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::high_water_mark");
this->queue_.high_water_mark (hwm);
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> size_t
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::low_water_mark (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::low_water_mark");
return this->queue_.low_water_mark ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> void
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark (size_t lwm)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::low_water_mark (size_t lwm)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::low_water_mark");
this->queue_.low_water_mark (lwm);
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> size_t
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_bytes (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_bytes");
return this->queue_.message_bytes ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> size_t
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_length (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_length");
return this->queue_.message_length ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> size_t
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_count (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_count (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_count");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::message_count");
return this->queue_.message_count ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::deactivate (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::deactivate");
return this->queue_.deactivate ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::activate (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::activate (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::activate");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::activate");
return this->queue_.activate ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::pulse (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::pulse (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::pulse");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::pulse");
return this->queue_.pulse ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivated (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::deactivated (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivated");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::deactivated");
return this->queue_.deactivated ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> int
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::state (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::state (void)
{
- ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::state");
+ ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::state");
return this->queue_.state ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_SYNCH_MUTEX_T &
-ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::lock (void)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> ACE_SYNCH_MUTEX_T &
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::lock (void)
{
return this->queue_.lock ();
}
-template <ACE_SYNCH_DECL>
-ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &q)
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY>
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::gettimeofday ()
+{
+ return this->queue_.gettimeofday ();
+}
+
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY>
+void
+ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>::set_time_policy (TIME_POLICY const & rhs)
+{
+ this->queue_.set_time_policy (rhs);
+}
+
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_USE, TIME_POLICY> &q)
: queue_ (q),
curr_ (q.head_)
{
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::next (ACE_Message_Block *&entry)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>::next (ACE_Message_Block *&entry)
{
ACE_READ_GUARD_RETURN (ACE_SYNCH_MUTEX_T, m, this->queue_.lock_, -1)
@@ -700,16 +716,16 @@ ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::next (ACE_Message_Block *&entry)
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::done (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>::done (void) const
{
ACE_READ_GUARD_RETURN (ACE_SYNCH_MUTEX_T, m, this->queue_.lock_, -1)
return this->curr_ == 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::advance (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>::advance (void)
{
ACE_READ_GUARD_RETURN (ACE_SYNCH_MUTEX_T, m, this->queue_.lock_, -1)
@@ -718,8 +734,8 @@ ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::advance (void)
return this->curr_ != 0;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
#endif /* ACE_HAS_DUMP */
@@ -727,15 +743,15 @@ ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::dump (void) const
ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Iterator)
-template <ACE_SYNCH_DECL>
-ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &q)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_USE, TIME_POLICY> &q)
: queue_ (q),
curr_ (queue_.tail_)
{
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::next (ACE_Message_Block *&entry)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>::next (ACE_Message_Block *&entry)
{
ACE_READ_GUARD_RETURN (ACE_SYNCH_MUTEX_T, m, this->queue_.lock_, -1)
@@ -748,16 +764,16 @@ ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::next (ACE_Message_Block *&ent
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::done (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>::done (void) const
{
ACE_READ_GUARD_RETURN (ACE_SYNCH_MUTEX_T, m, this->queue_.lock_, -1)
return this->curr_ == 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::advance (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>::advance (void)
{
ACE_READ_GUARD_RETURN (ACE_SYNCH_MUTEX_T, m, this->queue_.lock_, -1)
@@ -766,61 +782,61 @@ ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::advance (void)
return this->curr_ != 0;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
#endif /* ACE_HAS_DUMP */
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue (ACE_Message_Block *&first_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue (ACE_Message_Block *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue");
return this->dequeue_head (first_item, timeout);
}
-template <ACE_SYNCH_DECL> ACE_Notification_Strategy *
-ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_Notification_Strategy *
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::notification_strategy (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::notification_strategy");
return this->notification_strategy_;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy (ACE_Notification_Strategy *s)
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::notification_strategy (ACE_Notification_Strategy *s)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::notification_strategy");
this->notification_strategy_ = s;
}
// Check if queue is empty (does not hold locks).
-template <ACE_SYNCH_DECL> bool
-ACE_Message_Queue<ACE_SYNCH_USE>::is_empty_i (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> bool
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_empty_i (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_empty_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_empty_i");
return this->tail_ == 0;
}
// Check if queue is full (does not hold locks).
-template <ACE_SYNCH_DECL> bool
-ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> bool
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_full_i (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_full_i");
return this->cur_bytes_ >= this->high_water_mark_;
}
// Check if queue is empty (holds locks).
-template <ACE_SYNCH_DECL> bool
-ACE_Message_Queue<ACE_SYNCH_USE>::is_empty (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> bool
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_empty (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_empty");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_empty");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, false);
return this->is_empty_i ();
@@ -828,132 +844,146 @@ ACE_Message_Queue<ACE_SYNCH_USE>::is_empty (void)
// Check if queue is full (holds locks).
-template <ACE_SYNCH_DECL> bool
-ACE_Message_Queue<ACE_SYNCH_USE>::is_full (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> bool
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_full (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::is_full");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, false);
return this->is_full_i ();
}
-template <ACE_SYNCH_DECL> size_t
-ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::high_water_mark (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::high_water_mark");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
return this->high_water_mark_;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark (size_t hwm)
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::high_water_mark (size_t hwm)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::high_water_mark");
ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_);
this->high_water_mark_ = hwm;
}
-template <ACE_SYNCH_DECL> size_t
-ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::low_water_mark (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::low_water_mark");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
return this->low_water_mark_;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark (size_t lwm)
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::low_water_mark (size_t lwm)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::low_water_mark");
ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_);
this->low_water_mark_ = lwm;
}
-template <ACE_SYNCH_DECL> size_t
-ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_bytes (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_bytes");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
return this->cur_bytes_;
}
-template <ACE_SYNCH_DECL> size_t
-ACE_Message_Queue<ACE_SYNCH_USE>::message_length (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_length (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_length");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_length");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
return this->cur_length_;
}
-template <ACE_SYNCH_DECL> size_t
-ACE_Message_Queue<ACE_SYNCH_USE>::message_count (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> size_t
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_count (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_count");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_count");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0);
return this->cur_count_;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::deactivate ()
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::deactivate ()
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::deactivate");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
return this->deactivate_i (0); // Not a pulse
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::activate (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::activate (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::activate");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::activate");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
return this->activate_i ();
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::pulse ()
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::pulse ()
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::pulse");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::pulse");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
return this->deactivate_i (1); // Just a pulse
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::deactivated (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::deactivated (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivated");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::deactivated");
return this->state_ == ACE_Message_Queue_Base::DEACTIVATED;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::state (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::state (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::state");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::state");
return this->state_;
}
-template <ACE_SYNCH_DECL> ACE_SYNCH_MUTEX_T &
-ACE_Message_Queue<ACE_SYNCH_USE>::lock (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_SYNCH_MUTEX_T &
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::lock (void)
{
return this->lock_;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY>
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::gettimeofday (void) const
+{
+ return this->time_policy_ ();
+}
+
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::set_time_policy (TIME_POLICY const & rhs)
+{
+ this->time_policy_ = rhs;
+}
+
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
switch (this->state_)
{
@@ -993,32 +1023,37 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes (size_t new_value)
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_bytes (size_t new_value)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_bytes");
ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_);
this->cur_bytes_ = new_value;
}
-template <ACE_SYNCH_DECL> void
-ACE_Message_Queue<ACE_SYNCH_USE>::message_length (size_t new_value)
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_length (size_t new_value)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_length");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::message_length");
ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_);
this->cur_length_ = new_value;
}
-template <ACE_SYNCH_DECL>
-ACE_Message_Queue<ACE_SYNCH_USE>::ACE_Message_Queue (size_t hwm,
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns)
+#if defined (ACE_HAS_THREADS)
+ : not_empty_cond_ (lock_, cond_attr_)
+ , not_full_cond_ (lock_, cond_attr_)
+#else
: not_empty_cond_ (lock_)
, not_full_cond_ (lock_)
+#endif
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::ACE_Message_Queue");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue");
if (this->open (hwm, lwm, ns) == -1)
ACE_ERROR ((LM_ERROR,
@@ -1047,10 +1082,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::ACE_Message_Queue (size_t hwm,
#endif /* ACE_HAS_MONITOR_POINTS==1 */
}
-template <ACE_SYNCH_DECL>
-ACE_Message_Queue<ACE_SYNCH_USE>::~ACE_Message_Queue (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Message_Queue (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::~ACE_Message_Queue");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Message_Queue");
if (this->head_ != 0 && this->close () == -1)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("close")));
@@ -1061,8 +1096,8 @@ ACE_Message_Queue<ACE_SYNCH_USE>::~ACE_Message_Queue (void)
#endif /* ACE_HAS_MONITOR_POINTS==1 */
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::flush_i (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::flush_i (void)
{
int number_flushed = 0;
@@ -1104,12 +1139,12 @@ ACE_Message_Queue<ACE_SYNCH_USE>::flush_i (void)
// once for the same queue, we're in bigger trouble than just
// concurrency control!
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::open (size_t hwm,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::open (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::open");
this->high_water_mark_ = hwm;
this->low_water_mark_ = lwm;
this->state_ = ACE_Message_Queue_Base::ACTIVATED;
@@ -1125,10 +1160,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::open (size_t hwm,
// Implementation of the public deactivate() method
// (assumes locks are held).
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i (int pulse)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::deactivate_i (int pulse)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::deactivate_i");
int const previous_state = this->state_;
if (previous_state != ACE_Message_Queue_Base::DEACTIVATED)
@@ -1146,19 +1181,19 @@ ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i (int pulse)
return previous_state;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::activate_i (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::activate_i (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::activate_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::activate_i");
int const previous_state = this->state_;
this->state_ = ACE_Message_Queue_Base::ACTIVATED;
return previous_state;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::flush (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::flush (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::flush");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::flush");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
// Free up the remaining messages on the queue.
@@ -1167,10 +1202,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::flush (void)
// Clean up the queue if we have not already done so!
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::close (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::close (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::close");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
// There's no need to check the return value of deactivate_i() since
@@ -1181,16 +1216,16 @@ ACE_Message_Queue<ACE_SYNCH_USE>::close (void)
return this->flush_i ();
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::signal_enqueue_waiters (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::signal_enqueue_waiters (void)
{
if (this->not_full_cond_.signal () != 0)
return -1;
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::signal_dequeue_waiters (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::signal_dequeue_waiters (void)
{
// Tell any blocked threads that the queue has a new item!
if (this->not_empty_cond_.signal () != 0)
@@ -1201,10 +1236,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::signal_dequeue_waiters (void)
// Actually put the node at the end (no locking so must be called with
// locks held).
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail_i (ACE_Message_Block *new_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail_i (ACE_Message_Block *new_item)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail_i");
if (new_item == 0)
return -1;
@@ -1252,10 +1287,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail_i (ACE_Message_Block *new_item)
// Actually put the node(s) at the head (no locking)
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head_i (ACE_Message_Block *new_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_head_i (ACE_Message_Block *new_item)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_head_i");
if (new_item == 0)
return -1;
@@ -1297,10 +1332,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head_i (ACE_Message_Block *new_item)
// Actually put the node at its proper position relative to its
// priority.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_i (ACE_Message_Block *new_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_i (ACE_Message_Block *new_item)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_i");
if (new_item == 0)
return -1;
@@ -1368,11 +1403,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_i (ACE_Message_Block *new_item)
// Actually put the node at its proper position relative to its
// deadline time.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_deadline_i (ACE_Message_Block *new_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_deadline_i (ACE_Message_Block *new_item)
{
#if defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_deadline_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_deadline_i");
if (new_item == 0)
return -1;
@@ -1439,14 +1474,14 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_deadline_i (ACE_Message_Block *new_ite
// called with locks held). This method assumes that the queue has at
// least one item in it when it is called.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head_i (ACE_Message_Block *&first_item)
{
if (this->head_ ==0)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Attempting to dequeue from empty queue")),
-1);
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head_i");
first_item = this->head_;
this->head_ = this->head_->next ();
@@ -1490,10 +1525,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item
// method assumes that the queue has at least one item in it when it
// is called.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio_i (ACE_Message_Block *&dequeued)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_prio_i (ACE_Message_Block *&dequeued)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_prio_i");
if (this->head_ == 0)
return -1;
@@ -1565,14 +1600,14 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio_i (ACE_Message_Block *&dequeued)
// called with locks held). This method assumes that the queue has at
// least one item in it when it is called.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail_i (ACE_Message_Block *&dequeued)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_tail_i (ACE_Message_Block *&dequeued)
{
if (this->head_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Attempting to dequeue from empty queue")),
-1);
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_tail_i");
dequeued = this->tail_;
if (this->tail_->prev () == 0)
{
@@ -1614,15 +1649,15 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail_i (ACE_Message_Block *&dequeued)
// (no locking, so must be called with locks held). This method assumes
// that the queue has at least one item in it when it is called.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline_i (ACE_Message_Block *&dequeued)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_deadline_i (ACE_Message_Block *&dequeued)
{
#if defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
if (this->head_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Attempting to dequeue from empty queue")),
-1);
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline_i");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_deadline_i");
// Find the last message enqueued with the lowest deadline time
ACE_Message_Block* chosen = 0;
@@ -1684,11 +1719,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline_i (ACE_Message_Block *&dequeu
// Take a look at the first item without removing it.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (ACE_Message_Block *&first_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::peek_dequeue_head (ACE_Message_Block *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::peek_dequeue_head");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)
@@ -1698,7 +1733,6 @@ ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (ACE_Message_Block *&first_i
}
// Wait for at least one item to become available.
-
if (this->wait_not_empty_cond (timeout) == -1)
return -1;
@@ -1706,8 +1740,8 @@ ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (ACE_Message_Block *&first_i
return ACE_Utils::truncate_cast<int> (this->cur_count_);
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_full_cond (ACE_Time_Value *timeout)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::wait_not_full_cond (ACE_Time_Value *timeout)
{
int result = 0;
@@ -1732,8 +1766,8 @@ ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_full_cond (ACE_Time_Value *timeout)
return result;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_empty_cond (ACE_Time_Value *timeout)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::wait_not_empty_cond (ACE_Time_Value *timeout)
{
int result = 0;
@@ -1761,11 +1795,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_empty_cond (ACE_Time_Value *timeout)
// Block indefinitely waiting for an item to arrive, does not ignore
// alerts (e.g., signals).
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_head (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_head");
int queue_count = 0;
ACE_Notification_Strategy *notifier = 0;
{
@@ -1799,11 +1833,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head (ACE_Message_Block *new_item,
// accordance with its <msg_priority> (0 is lowest priority). Returns
// -1 on failure, else the number of items still on the queue.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_prio (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_prio (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_prio");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_prio");
int queue_count = 0;
ACE_Notification_Strategy *notifier = 0;
{
@@ -1837,11 +1871,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_prio (ACE_Message_Block *new_item,
// accordance with its <msg_deadline_time>. Returns
// -1 on failure, else the number of items still on the queue.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_deadline (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_deadline (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_deadline");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_deadline");
int queue_count = 0;
ACE_Notification_Strategy *notifier = 0;
{
@@ -1871,22 +1905,22 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_deadline (ACE_Message_Block *new_item,
return queue_count;
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue");
return this->enqueue_prio (new_item, timeout);
}
// Block indefinitely waiting for an item to arrive,
// does not ignore alerts (e.g., signals).
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail");
int queue_count = 0;
ACE_Notification_Strategy *notifier = 0;
{
@@ -1920,11 +1954,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail (ACE_Message_Block *new_item,
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head (ACE_Message_Block *&first_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head (ACE_Message_Block *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)
@@ -1943,11 +1977,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head (ACE_Message_Block *&first_item,
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio (ACE_Message_Block *&dequeued,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_prio (ACE_Message_Block *&dequeued,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_prio");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)
@@ -1966,11 +2000,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio (ACE_Message_Block *&dequeued,
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail (ACE_Message_Block *&dequeued,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_tail (ACE_Message_Block *&dequeued,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_tail");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)
@@ -1989,11 +2023,11 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail (ACE_Message_Block *&dequeued,
// indefinitely (or until an alert occurs). Otherwise, block for upto
// the amount of time specified by timeout.
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline (ACE_Message_Block *&dequeued,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_deadline (ACE_Message_Block *&dequeued,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_deadline");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)
@@ -2008,10 +2042,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline (ACE_Message_Block *&dequeued
return this->dequeue_deadline_i (dequeued);
}
-template <ACE_SYNCH_DECL> int
-ACE_Message_Queue<ACE_SYNCH_USE>::notify (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::notify (void)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notify");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::notify");
// By default, don't do anything.
if (this->notification_strategy_ == 0)
@@ -2021,12 +2055,12 @@ ACE_Message_Queue<ACE_SYNCH_USE>::notify (void)
}
// = Initialization and termination methods.
-template <ACE_SYNCH_DECL>
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::ACE_Dynamic_Message_Queue (ACE_Dynamic_Message_Strategy & message_strategy,
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::ACE_Dynamic_Message_Queue (ACE_Dynamic_Message_Strategy & message_strategy,
size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns)
- : ACE_Message_Queue<ACE_SYNCH_USE> (hwm, lwm, ns),
+ : ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> (hwm, lwm, ns),
pending_head_ (0),
pending_tail_ (0),
late_head_ (0),
@@ -2042,14 +2076,14 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::ACE_Dynamic_Message_Queue (ACE_Dynamic
// dtor: free message strategy and let base class dtor do the rest.
-template <ACE_SYNCH_DECL>
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::~ACE_Dynamic_Message_Queue (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Dynamic_Message_Queue (void)
{
delete &this->message_strategy_;
}
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::remove_messages (ACE_Message_Block *&list_head,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::remove_messages (ACE_Message_Block *&list_head,
ACE_Message_Block *&list_tail,
u_int status_flags)
{
@@ -2188,11 +2222,11 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::remove_messages (ACE_Message_Block *&l
// messages are returned in priority order, from head to tail, as of
// the time this method was called.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dequeue_head (ACE_Message_Block *&first_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head (ACE_Message_Block *&first_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dequeue_head");
+ ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
@@ -2228,15 +2262,15 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dequeue_head (ACE_Message_Block *&firs
// Dequeue and return the <ACE_Message_Block *> at the (logical) head
// of the queue.
-template <ACE_SYNCH_DECL> void
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Message_Queue<ACE_SYNCH_USE> (base class):\n")));
- this->ACE_Message_Queue<ACE_SYNCH_USE>::dump ();
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> (base class):\n")));
+ this->ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dump ();
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("pending_head_ = %u\n")
@@ -2260,10 +2294,10 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dump (void) const
}
// dump the state of the queue
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_i (ACE_Message_Block *new_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_i (ACE_Message_Block *new_item)
{
- ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_i");
+ ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_i");
if (new_item == 0)
{
@@ -2415,8 +2449,8 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_i (ACE_Message_Block *new_item
// Message Queue constructor to update the priorities of all enqueued
// messages.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::sublist_enqueue_i (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::sublist_enqueue_i (ACE_Message_Block *new_item,
const ACE_Time_Value &current_time,
ACE_Message_Block *&sublist_head,
ACE_Message_Block *&sublist_tail,
@@ -2484,10 +2518,10 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::sublist_enqueue_i (ACE_Message_Block *
// Enqueue a message in priority order within a given priority status
// sublist.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head_i (ACE_Message_Block *&first_item)
{
- ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i");
+ ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::dequeue_head_i");
int result = 0;
int last_in_subqueue = 0;
@@ -2615,8 +2649,8 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&fi
// is empty from the beyond late portion, or if that is empty just
// sets the passed pointer to zero and returns -1.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_queue (const ACE_Time_Value &current_time)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::refresh_queue (const ACE_Time_Value &current_time)
{
int result;
@@ -2631,8 +2665,8 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_queue (const ACE_Time_Value &c
// Refresh the queue using the strategy specific priority status
// function.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_pending_queue (const ACE_Time_Value &current_time)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::refresh_pending_queue (const ACE_Time_Value &current_time)
{
ACE_Dynamic_Message_Strategy::Priority_Status current_status;
@@ -2754,8 +2788,8 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_pending_queue (const ACE_Time_
// Refresh the pending queue using the strategy specific priority
// status function.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_late_queue (const ACE_Time_Value &current_time)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::refresh_late_queue (const ACE_Time_Value &current_time)
{
ACE_Dynamic_Message_Strategy::Priority_Status current_status;
@@ -2839,22 +2873,22 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_late_queue (const ACE_Time_Val
// Refresh the late queue using the strategy specific priority status
// function.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (ACE_Message_Block *&first_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::peek_dequeue_head (ACE_Message_Block *&first_item,
ACE_Time_Value *timeout)
{
- return ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (first_item,
+ return ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::peek_dequeue_head (first_item,
timeout);
}
// Private method to hide public base class method: just calls base
// class method.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_tail (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_tail");
+ ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_tail");
return this->enqueue_prio (new_item, timeout);
}
@@ -2863,11 +2897,11 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_tail (ACE_Message_Block *new_i
// where it was placed after the queue is refreshed prior to the next
// enqueue or dequeue operation.
-template <ACE_SYNCH_DECL> int
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_head (ACE_Message_Block *new_item,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_head (ACE_Message_Block *new_item,
ACE_Time_Value *timeout)
{
- ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_head");
+ ACE_TRACE ("ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::enqueue_head");
return this->enqueue_prio (new_item, timeout);
}
@@ -2876,25 +2910,26 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::enqueue_head (ACE_Message_Block *new_i
// where it was placed after the queue is refreshed prior to the next
// enqueue or dequeue operation.
-template <ACE_SYNCH_DECL>
-ACE_Message_Queue<ACE_SYNCH_USE> *
-ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_static_message_queue (size_t hwm,
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Message_Queue_Factory<ACE_SYNCH_USE, TIME_POLICY>::create_static_message_queue (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns)
{
- ACE_Message_Queue<ACE_SYNCH_USE> *tmp = 0;
+ typedef ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> QUEUE_TYPE;
+ QUEUE_TYPE *tmp = 0;
ACE_NEW_RETURN (tmp,
- ACE_Message_Queue<ACE_SYNCH_USE> (hwm, lwm, ns),
+ QUEUE_TYPE (hwm, lwm, ns),
0);
return tmp;
}
// Factory method for a statically prioritized ACE_Message_Queue.
-template <ACE_SYNCH_DECL>
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> *
-ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_deadline_message_queue (size_t hwm,
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Message_Queue_Factory<ACE_SYNCH_USE, TIME_POLICY>::create_deadline_message_queue (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns,
u_long static_bit_field_mask,
@@ -2911,9 +2946,10 @@ ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_deadline_message_queue (size_t
dynamic_priority_offset),
0);
- ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> *tmp = 0;
+ typedef ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> QUEUE_TYPE;
+ QUEUE_TYPE *tmp = 0;
ACE_NEW_RETURN (tmp,
- ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> (*adms, hwm, lwm, ns),
+ QUEUE_TYPE (*adms, hwm, lwm, ns),
0);
return tmp;
}
@@ -2921,9 +2957,9 @@ ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_deadline_message_queue (size_t
// Factory method for a dynamically prioritized (by time to deadline)
// ACE_Dynamic_Message_Queue.
-template <ACE_SYNCH_DECL>
-ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> *
-ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_laxity_message_queue (size_t hwm,
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Message_Queue_Factory<ACE_SYNCH_USE, TIME_POLICY>::create_laxity_message_queue (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns,
u_long static_bit_field_mask,
@@ -2940,9 +2976,10 @@ ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_laxity_message_queue (size_t hw
dynamic_priority_offset),
0);
- ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> *tmp = 0;
+ typedef ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> QUEUE_TYPE;
+ QUEUE_TYPE *tmp = 0;
ACE_NEW_RETURN (tmp,
- ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> (*alms, hwm, lwm, ns),
+ QUEUE_TYPE (*alms, hwm, lwm, ns),
0);
return tmp;
}
@@ -2953,9 +2990,9 @@ ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_laxity_message_queue (size_t hw
#if defined (ACE_VXWORKS)
// factory method for a wrapped VxWorks message queue
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY>
ACE_Message_Queue_Vx *
-ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_Vx_message_queue (size_t max_messages,
+ACE_Message_Queue_Factory<ACE_SYNCH_USE, TIME_POLICY>::create_Vx_message_queue (size_t max_messages,
size_t max_message_length,
ACE_Notification_Strategy *ns)
{
@@ -2970,9 +3007,9 @@ ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_Vx_message_queue (size_t max_me
#if defined (ACE_HAS_WIN32_OVERLAPPED_IO)
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY>
ACE_Message_Queue_NT *
-ACE_Message_Queue_Factory<ACE_SYNCH_USE>::create_NT_message_queue (size_t max_threads)
+ACE_Message_Queue_Factory<ACE_SYNCH_USE, TIME_POLICY>::create_NT_message_queue (size_t max_threads)
{
ACE_Message_Queue_NT *tmp = 0;
diff --git a/dep/acelite/ace/Message_Queue_T.h b/dep/acelite/ace/Message_Queue_T.h
index 73e4626766c..52024907a15 100644
--- a/dep/acelite/ace/Message_Queue_T.h
+++ b/dep/acelite/ace/Message_Queue_T.h
@@ -4,7 +4,7 @@
/**
* @file Message_Queue_T.h
*
- * $Id: Message_Queue_T.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Message_Queue_T.h 96070 2012-08-17 09:07:16Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -19,6 +19,11 @@
#include "ace/Dynamic_Message_Strategy.h"
#include "ace/Synch_Traits.h"
#include "ace/Guard_T.h"
+#include "ace/Time_Policy.h"
+#include "ace/Time_Value_T.h"
+#if defined (ACE_HAS_THREADS)
+# include "ace/Condition_Attributes.h"
+#endif
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -47,11 +52,11 @@ namespace ACE
/**
* @class ACE_Message_Queue
*
- * @brief A message queueing facility with parameterized synchronization
+ * @brief A message queuing facility with parameterized synchronization
* capability. ACE_Message_Queue is modeled after the queueing facilities
* in System V STREAMs.
*
- * ACE_Message_Queue is the primary queueing facility for
+ * ACE_Message_Queue is the primary queuing facility for
* messages in the ACE framework. It's one template argument parameterizes
* the queue's synchronization. The argument specifies a synchronization
* strategy. The two main strategies available for ACE_SYNCH_DECL are:
@@ -61,17 +66,17 @@ namespace ACE
* All data passing through ACE_Message_Queue is in the form of
* ACE_Message_Block objects. @sa ACE_Message_Block.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue : public ACE_Message_Queue_Base
{
public:
- friend class ACE_Message_Queue_Iterator<ACE_SYNCH_USE>;
- friend class ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>;
+ friend class ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>;
+ friend class ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>;
// = Traits
- typedef ACE_Message_Queue_Iterator<ACE_SYNCH_USE>
+ typedef ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY>
ITERATOR;
- typedef ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>
+ typedef ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY>
REVERSE_ITERATOR;
/**
@@ -482,6 +487,14 @@ public:
/// Returns a reference to the lock used by the ACE_Message_Queue.
virtual ACE_SYNCH_MUTEX_T &lock (void);
+ /// Get the current time of day according to the queue's TIME_POLICY.
+ /// Allows users to initialize timeout values using correct time policy.
+ ACE_Time_Value_T<TIME_POLICY> gettimeofday (void) const;
+
+ /// Allows applications to control how the timer queue gets the time
+ /// of day.
+ void set_time_policy (TIME_POLICY const & time_policy);
+
/// Dump the state of an object.
virtual void dump (void) const;
@@ -596,12 +609,23 @@ protected:
/// Protect queue from concurrent access.
ACE_SYNCH_MUTEX_T lock_;
+#if defined (ACE_HAS_THREADS)
+ /// Attributes to initialize conditions with.
+ /* We only need this because some crappy compilers can't
+ properly handle initializing the conditions with
+ temporary objects. */
+ ACE_Condition_Attributes_T<TIME_POLICY> cond_attr_;
+#endif
+
/// Used to make threads sleep until the queue is no longer empty.
ACE_SYNCH_CONDITION_T not_empty_cond_;
/// Used to make threads sleep until the queue is no longer full.
ACE_SYNCH_CONDITION_T not_full_cond_;
+ /// The policy to return the current time of day
+ TIME_POLICY time_policy_;
+
/// Sends the size of the queue whenever it changes.
#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
ACE::Monitor_Control::Size_Monitor *monitor_;
@@ -623,12 +647,12 @@ typedef ACE_Message_Queue<ACE_SYNCH> ACE_DEFAULT_MESSAGE_QUEUE_TYPE;
*
* @brief Iterator for the ACE_Message_Queue.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue_Iterator
{
public:
// = Initialization method.
- ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &queue);
+ ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_USE, TIME_POLICY> &queue);
// = Iteration methods.
/// Pass back the @a entry that hasn't been seen in the queue.
@@ -650,7 +674,7 @@ public:
private:
/// Message_Queue we are iterating over.
- ACE_Message_Queue <ACE_SYNCH_USE> &queue_;
+ ACE_Message_Queue <ACE_SYNCH_USE, TIME_POLICY> &queue_;
/// Keeps track of how far we've advanced...
ACE_Message_Block *curr_;
@@ -661,12 +685,12 @@ private:
*
* @brief Reverse Iterator for the ACE_Message_Queue.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue_Reverse_Iterator
{
public:
// = Initialization method.
- ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &queue);
+ ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_USE, TIME_POLICY> &queue);
// = Iteration methods.
/// Pass back the @a entry that hasn't been seen in the queue.
@@ -688,7 +712,7 @@ public:
private:
/// Message_Queue we are iterating over.
- ACE_Message_Queue <ACE_SYNCH_USE> &queue_;
+ ACE_Message_Queue <ACE_SYNCH_USE, TIME_POLICY> &queue_;
/// Keeps track of how far we've advanced...
ACE_Message_Block *curr_;
@@ -761,8 +785,8 @@ private:
* ensure the correct semantics, but that is not a
* very stable or portable approach (discouraged).
*/
-template <ACE_SYNCH_DECL>
-class ACE_Dynamic_Message_Queue : public ACE_Message_Queue<ACE_SYNCH_USE>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
+class ACE_Dynamic_Message_Queue : public ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>
{
public:
// = Initialization and termination methods.
@@ -883,8 +907,8 @@ protected:
private:
// = Disallow public access to these operations.
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> &))
- ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Message_Queue (const ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> &))
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> &))
+ ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Message_Queue (const ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> &))
// provide definitions for these (just call base class method),
// but make them private so they're not accessible outside the class
@@ -909,18 +933,18 @@ private:
* any of these factory methods is only responsible for
* ensuring destruction of the message queue itself.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue_Factory
{
public:
/// Factory method for a statically prioritized ACE_Message_Queue
- static ACE_Message_Queue<ACE_SYNCH_USE> *
+ static ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
create_static_message_queue (size_t hwm = ACE_Message_Queue_Base::DEFAULT_HWM,
size_t lwm = ACE_Message_Queue_Base::DEFAULT_LWM,
ACE_Notification_Strategy * = 0);
/// Factory method for a dynamically prioritized (by time to deadline) ACE_Dynamic_Message_Queue
- static ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> *
+ static ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
create_deadline_message_queue (size_t hwm = ACE_Message_Queue_Base::DEFAULT_HWM,
size_t lwm = ACE_Message_Queue_Base::DEFAULT_LWM,
ACE_Notification_Strategy * = 0,
@@ -930,7 +954,7 @@ public:
u_long dynamic_priority_offset = 0x200000UL); // 2^(22-1)
/// Factory method for a dynamically prioritized (by laxity) ACE_Dynamic_Message_Queue
- static ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> *
+ static ACE_Dynamic_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
create_laxity_message_queue (size_t hwm = ACE_Message_Queue_Base::DEFAULT_HWM,
size_t lwm = ACE_Message_Queue_Base::DEFAULT_LWM,
ACE_Notification_Strategy * = 0,
@@ -959,8 +983,8 @@ public:
};
// Forward decls.
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> class ACE_Message_Queue_Ex_Iterator;
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> class ACE_Message_Queue_Ex_Reverse_Iterator;
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Message_Queue_Ex_Iterator;
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Message_Queue_Ex_Reverse_Iterator;
/**
* @class ACE_Message_Queue_Ex
@@ -979,7 +1003,7 @@ template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> class ACE_Message_Queue_Ex_Rev
* -# ACE_MT_SYNCH: all operations are thread-safe
* -# ACE_NULL_SYNCH: no synchronization and no locking overhead
*/
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue_Ex
{
public:
@@ -990,13 +1014,13 @@ public:
DEFAULT_PRIORITY = 0
};
- friend class ACE_Message_Queue_Ex_Iterator <ACE_MESSAGE_TYPE, ACE_SYNCH_USE>;
- friend class ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>;
+ friend class ACE_Message_Queue_Ex_Iterator <ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>;
+ friend class ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>;
// = Traits
- typedef ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>
+ typedef ACE_Message_Queue_Ex_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>
ITERATOR;
- typedef ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>
+ typedef ACE_Message_Queue_Ex_Reverse_Iterator<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>
REVERSE_ITERATOR;
/**
@@ -1365,6 +1389,14 @@ public:
/// Returns a reference to the lock used by the ACE_Message_Queue_Ex.
virtual ACE_SYNCH_MUTEX_T &lock (void);
+ /// Get the current time of day according to the queue's TIME_POLICY.
+ /// Allows users to initialize timeout
+ ACE_Time_Value_T<TIME_POLICY> gettimeofday ();
+
+ /// Allows applications to control how the timer queue gets the time
+ /// of day.
+ void set_time_policy (TIME_POLICY const & time_policy);
+
/// Dump the state of an object.
virtual void dump (void) const;
@@ -1373,7 +1405,7 @@ public:
protected:
/// Implement this via an ACE_Message_Queue.
- ACE_Message_Queue<ACE_SYNCH_USE> queue_;
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> queue_;
};
/**
@@ -1381,12 +1413,12 @@ protected:
*
* @brief Iterator for the ACE_Message_Queue_Ex.
*/
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue_Ex_Iterator
{
public:
// = Initialization method.
- ACE_Message_Queue_Ex_Iterator (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> & queue);
+ ACE_Message_Queue_Ex_Iterator (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> & queue);
// = Iteration methods.
/// Pass back the @a entry that hasn't been seen in the queue.
@@ -1408,7 +1440,7 @@ public:
private:
/// Implement this via the ACE_Message_Queue_Iterator
- ACE_Message_Queue_Iterator<ACE_SYNCH_USE> iter_;
+ ACE_Message_Queue_Iterator<ACE_SYNCH_USE, TIME_POLICY> iter_;
};
/**
@@ -1416,12 +1448,12 @@ private:
*
* @brief Reverse iterator for the ACE_Message_Queue_Ex.
*/
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Message_Queue_Ex_Reverse_Iterator
{
public:
// = Initialization method.
- ACE_Message_Queue_Ex_Reverse_Iterator (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> & queue);
+ ACE_Message_Queue_Ex_Reverse_Iterator (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> & queue);
// = Iteration methods.
/// Pass back the @a entry that hasn't been seen in the queue.
@@ -1443,7 +1475,7 @@ public:
private:
/// Implement this via the ACE_Message_Queue_Reverse_Iterator
- ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE> iter_;
+ ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE, TIME_POLICY> iter_;
};
/**
@@ -1464,8 +1496,8 @@ private:
* ACE_Message_Queue_Ex_N uses this method to run through
* all the incoming messages and enqueue them in one call.
*/
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
-class ACE_Message_Queue_Ex_N : public ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
+class ACE_Message_Queue_Ex_N : public ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>
{
public:
// = Initialization and termination methods.
diff --git a/dep/acelite/ace/Message_Queue_Vx.cpp b/dep/acelite/ace/Message_Queue_Vx.cpp
index 0c680b0353e..a42b1fe6599 100644
--- a/dep/acelite/ace/Message_Queue_Vx.cpp
+++ b/dep/acelite/ace/Message_Queue_Vx.cpp
@@ -1,5 +1,6 @@
-// $Id: Message_Queue_Vx.cpp 91626 2010-09-07 10:59:20Z johnnyw $
+// $Id: Message_Queue_Vx.cpp 95534 2012-02-17 23:19:33Z mitza $
+#include "ace/Message_Queue.h"
#include "ace/Message_Queue_Vx.h"
#include "ace/Log_Msg.h"
diff --git a/dep/acelite/ace/Message_Queue_Vx.inl b/dep/acelite/ace/Message_Queue_Vx.inl
index b295e958c92..03bcc36ee5b 100644
--- a/dep/acelite/ace/Message_Queue_Vx.inl
+++ b/dep/acelite/ace/Message_Queue_Vx.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Message_Queue_Vx.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Message_Queue_Vx.inl 96017 2012-08-08 22:18:09Z mitza $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -11,7 +11,7 @@ ACE_INLINE MSG_Q_ID
ACE_Message_Queue_Vx::msgq (void)
{
// Hijack the tail_ field to store the MSG_Q_ID.
- return reinterpret_cast<MSG_Q_ID> (tail_);
+ return static_cast<MSG_Q_ID> (reinterpret_cast<long> (tail_));
}
#endif /* ACE_VXWORKS */
diff --git a/dep/acelite/ace/Metrics_Cache_T.h b/dep/acelite/ace/Metrics_Cache_T.h
index 5cf438a13a0..05aac1a86cf 100644
--- a/dep/acelite/ace/Metrics_Cache_T.h
+++ b/dep/acelite/ace/Metrics_Cache_T.h
@@ -4,7 +4,7 @@
/**
* @file Metrics_Cache_T.h
*
- * $Id: Metrics_Cache_T.h 92090 2010-09-29 14:10:45Z johnnyw $
+ * $Id: Metrics_Cache_T.h 95839 2012-06-07 10:13:33Z johnnyw $
*
* @author Chris Gill <cdgill@cse.wustl.edu>
*/
@@ -55,7 +55,7 @@ public:
typedef ACE_METRICS_TIMEPROBE_TYPE* ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE;
typedef char* ACE_METRICS_NAME_BASED_PTR_TYPE;
- // Enumerated timeprobe event types.
+ /// Enumerated timeprobe event types.
enum event_id
{
WORK_START = 0,
diff --git a/dep/acelite/ace/Module.cpp b/dep/acelite/ace/Module.cpp
index 286270a9b55..376ed83670d 100644
--- a/dep/acelite/ace/Module.cpp
+++ b/dep/acelite/ace/Module.cpp
@@ -1,4 +1,4 @@
-// $Id: Module.cpp 84068 2008-12-24 18:32:05Z shuston $
+// $Id: Module.cpp 96080 2012-08-20 09:04:14Z johnnyw $
#ifndef ACE_MODULE_CPP
#define ACE_MODULE_CPP
@@ -19,19 +19,19 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Module)
-template <ACE_SYNCH_DECL> void
-ACE_Module<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::dump");
#endif /* ACE_HAS_DUMP */
}
-template <ACE_SYNCH_DECL> void
-ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q,
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::writer (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q,
int flags /* = M_DELETE_WRITER */)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::writer");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::writer");
// Close and maybe delete old writer
this->close_i (1, flags);
@@ -49,11 +49,11 @@ ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q,
ACE_SET_BITS (flags_, (flags & M_DELETE_WRITER));
}
-template <ACE_SYNCH_DECL> void
-ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q,
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::reader (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q,
int flags /* = M_DELETE_READER */)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::reader");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::reader");
// Close and maybe delete old writer
this->close_i (0, flags);
@@ -73,23 +73,23 @@ ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q,
// Link this ACE_Module on top of ACE_Module M.
-template <ACE_SYNCH_DECL> void
-ACE_Module<ACE_SYNCH_USE>::link (ACE_Module<ACE_SYNCH_USE> *m)
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::link (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *m)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::link");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::link");
this->next (m);
this->writer ()->next (m->writer ());
m->reader ()->next (this->reader ());
}
-template <ACE_SYNCH_DECL> int
-ACE_Module<ACE_SYNCH_USE>::open (const ACE_TCHAR *module_name,
- ACE_Task<ACE_SYNCH_USE> *writer_q,
- ACE_Task<ACE_SYNCH_USE> *reader_q,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::open (const ACE_TCHAR *module_name,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *writer_q,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *reader_q,
void *arg,
int flags /* = M_DELETE */)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::open");
this->name (module_name);
this->arg_ = arg;
@@ -102,27 +102,21 @@ ACE_Module<ACE_SYNCH_USE>::open (const ACE_TCHAR *module_name,
if (writer_q == 0)
{
- ACE_NEW_RETURN (writer_q,
- ACE_Thru_Task<ACE_SYNCH_USE>,
- -1);
+ typedef ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY> TASK_TYPE;
+ ACE_NEW_NORETURN (writer_q,
+ TASK_TYPE);
ACE_SET_BITS (flags, M_DELETE_WRITER);
}
if (reader_q == 0)
{
- ACE_NEW_RETURN (reader_q,
- ACE_Thru_Task<ACE_SYNCH_USE>,
- -1);
+ typedef ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY> TASK_TYPE;
+ ACE_NEW_NORETURN (reader_q,
+ TASK_TYPE);
ACE_SET_BITS (flags, M_DELETE_READER);
}
- this->reader (reader_q);
- this->writer (writer_q);
-
- // Save the flags
- this->flags_ = flags;
-
- // Make sure that the memory is allocated before proceding.
+ // Make sure that the memory is allocated before proceeding.
if (writer_q == 0 || reader_q == 0)
{
// These calls will delete writer_q and/or reader_q, if
@@ -134,6 +128,12 @@ ACE_Module<ACE_SYNCH_USE>::open (const ACE_TCHAR *module_name,
return -1;
}
+ this->reader (reader_q);
+ this->writer (writer_q);
+
+ // Save the flags
+ this->flags_ = flags;
+
// Setup back pointers (this must come last, after we've made sure
// there's memory allocated here.
reader_q->mod_ = this;
@@ -144,10 +144,10 @@ ACE_Module<ACE_SYNCH_USE>::open (const ACE_TCHAR *module_name,
// Set and get pointer to sibling ACE_Task in ACE_Module.
-template <ACE_SYNCH_DECL> ACE_Task<ACE_SYNCH_USE> *
-ACE_Module<ACE_SYNCH_USE>::sibling (ACE_Task<ACE_SYNCH_USE> *orig)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::sibling (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *orig)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::sibling");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::sibling");
if (this->q_pair_[0] == orig)
return this->q_pair_[1];
else if (this->q_pair_[1] == orig)
@@ -156,36 +156,38 @@ ACE_Module<ACE_SYNCH_USE>::sibling (ACE_Task<ACE_SYNCH_USE> *orig)
return 0;
}
-template <ACE_SYNCH_DECL>
-ACE_Module<ACE_SYNCH_USE>::ACE_Module (void)
- : flags_ (M_FLAGS_NOT_SET)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::ACE_Module (void)
+ : next_ (0)
+ , arg_ (0)
+ , flags_ (M_FLAGS_NOT_SET)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::ACE_Module");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::ACE_Module");
this->name (ACE_TEXT ("<unknown>"));
// Do nothing...
this->q_pair_[0] = 0;
this->q_pair_[1] = 0;
}
-template <ACE_SYNCH_DECL>
-ACE_Module<ACE_SYNCH_USE>::~ACE_Module (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Module (void)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::~ACE_Module");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Module");
// Only close down if we haven't already done so.
if (this->reader () || this->writer ())
this->close ();
}
-template <ACE_SYNCH_DECL>
-ACE_Module<ACE_SYNCH_USE>::ACE_Module (const ACE_TCHAR *module_name,
- ACE_Task<ACE_SYNCH_USE> *writer_q,
- ACE_Task<ACE_SYNCH_USE> *reader_q,
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::ACE_Module (const ACE_TCHAR *module_name,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *writer_q,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *reader_q,
void *args,
int flags /* = M_DELETE */)
: flags_ (M_FLAGS_NOT_SET)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::ACE_Module");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::ACE_Module");
this->q_pair_[0] = 0;
this->q_pair_[1] = 0;
@@ -196,10 +198,10 @@ ACE_Module<ACE_SYNCH_USE>::ACE_Module (const ACE_TCHAR *module_name,
ACE_TEXT ("ACE_Module")));
}
-template <ACE_SYNCH_DECL> int
-ACE_Module<ACE_SYNCH_USE>::close (int flags /* = M_DELETE_NONE */)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::close (int flags /* = M_DELETE_NONE */)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::close");
int result = 0;
@@ -217,18 +219,18 @@ ACE_Module<ACE_SYNCH_USE>::close (int flags /* = M_DELETE_NONE */)
return result;
}
-template <ACE_SYNCH_DECL> int
-ACE_Module<ACE_SYNCH_USE>::close_i (int which,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::close_i (int which,
int flags)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::close_i");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::close_i");
if (this->q_pair_[which] == 0)
return 0;
// Copy task pointer to prevent problems when ACE_Task::close
// changes the task pointer
- ACE_Task<ACE_SYNCH_USE> *task = this->q_pair_[which];
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *task = this->q_pair_[which];
// Change so that close doesn't get called again from the task base.
diff --git a/dep/acelite/ace/Module.h b/dep/acelite/ace/Module.h
index a7e4575e5f3..b015ec3e4c6 100644
--- a/dep/acelite/ace/Module.h
+++ b/dep/acelite/ace/Module.h
@@ -4,7 +4,7 @@
/**
* @file Module.h
*
- * $Id: Module.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Module.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -74,7 +74,7 @@ public:
* general, you shouldn't subclass from this class, but instead
* subclass from the ACE_Task.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Module : public ACE_Module_Base
{
public:
@@ -88,8 +88,8 @@ public:
/// Create an initialized module with @a module_name as its identity
/// and @a reader and @a writer as its tasks.
ACE_Module (const ACE_TCHAR *module_name,
- ACE_Task<ACE_SYNCH_USE> *writer = 0,
- ACE_Task<ACE_SYNCH_USE> *reader = 0,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *writer = 0,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *reader = 0,
void *args = 0,
int flags = M_DELETE);
@@ -101,8 +101,8 @@ public:
* <ACE_Task::module_closed>.
*/
int open (const ACE_TCHAR *module_name,
- ACE_Task<ACE_SYNCH_USE> *writer = 0,
- ACE_Task<ACE_SYNCH_USE> *reader = 0,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *writer = 0,
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *reader = 0,
void *a = 0,
int flags = M_DELETE);
@@ -117,7 +117,7 @@ public:
// = ACE_Task manipulation routines
/// Get the writer task.
- ACE_Task<ACE_SYNCH_USE> *writer (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *writer (void);
/**
* Set the writer task. @a flags can be used to indicate that the
@@ -126,10 +126,10 @@ public:
* also be deleted, depending on the old flags_ value. Should not
* be called from within <ACE_Task::module_closed>.
*/
- void writer (ACE_Task<ACE_SYNCH_USE> *q, int flags = M_DELETE_WRITER);
+ void writer (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q, int flags = M_DELETE_WRITER);
/// Get the reader task.
- ACE_Task<ACE_SYNCH_USE> *reader (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *reader (void);
/**
* Set the reader task. @a flags can be used to indicate that the
@@ -138,10 +138,10 @@ public:
* also be deleted, depending on the old flags_ value. Should not
* be called from within <ACE_Task::module_closed>.
*/
- void reader (ACE_Task<ACE_SYNCH_USE> *q, int flags = M_DELETE_READER);
+ void reader (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q, int flags = M_DELETE_READER);
/// Set and get pointer to sibling ACE_Task in an ACE_Module
- ACE_Task<ACE_SYNCH_USE> *sibling (ACE_Task<ACE_SYNCH_USE> *orig);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *sibling (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *orig);
// = Identify the module
/// Get the module name.
@@ -158,13 +158,13 @@ public:
void arg (void *);
/// Link to other modules in the ustream stack
- void link (ACE_Module<ACE_SYNCH_USE> *m);
+ void link (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *m);
/// Get the next pointer to the module above in the stream.
- ACE_Module<ACE_SYNCH_USE> *next (void);
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *next (void);
/// Set the next pointer to the module above in the stream.
- void next (ACE_Module<ACE_SYNCH_USE> *m);
+ void next (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *m);
/// Dump the state of an object.
void dump (void) const;
@@ -179,13 +179,13 @@ private:
/// Pair of Tasks that form the "read-side" and "write-side" of the
/// ACE_Module partitioning.
- ACE_Task<ACE_SYNCH_USE> *q_pair_[2];
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q_pair_[2];
/// Name of the ACE_Module.
ACE_TCHAR name_[MAXPATHLEN + 1];
/// Next ACE_Module in the stack.
- ACE_Module<ACE_SYNCH_USE> *next_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *next_;
/// Argument passed through to the reader and writer task when they
/// are opened.
diff --git a/dep/acelite/ace/Module.inl b/dep/acelite/ace/Module.inl
index 62e4929a24b..3081bed3925 100644
--- a/dep/acelite/ace/Module.inl
+++ b/dep/acelite/ace/Module.inl
@@ -1,64 +1,64 @@
// -*- C++ -*-
//
-// $Id: Module.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Module.inl 96061 2012-08-16 09:36:07Z mcorino $
#include "ace/OS_NS_string.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_SYNCH_DECL> ACE_INLINE void *
-ACE_Module<ACE_SYNCH_USE>::arg (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void *
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::arg (void) const
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::arg");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::arg");
return this->arg_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE void
-ACE_Module<ACE_SYNCH_USE>::arg (void *a)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::arg (void *a)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::arg");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::arg");
this->arg_ = a;
}
-template <ACE_SYNCH_DECL> ACE_INLINE const ACE_TCHAR *
-ACE_Module<ACE_SYNCH_USE>::name (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE const ACE_TCHAR *
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::name (void) const
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::name");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::name");
return this->name_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE void
-ACE_Module<ACE_SYNCH_USE>::name (const ACE_TCHAR *n)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::name (const ACE_TCHAR *n)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::name");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::name");
ACE_OS::strsncpy (this->name_, n, MAXPATHLEN);
}
-template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> *
-ACE_Module<ACE_SYNCH_USE>::writer (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::writer (void)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::writer");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::writer");
return this->q_pair_[1];
}
-template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> *
-ACE_Module<ACE_SYNCH_USE>::reader (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::reader (void)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::reader");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::reader");
return this->q_pair_[0];
}
-template <ACE_SYNCH_DECL> ACE_INLINE ACE_Module<ACE_SYNCH_USE> *
-ACE_Module<ACE_SYNCH_USE>::next (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::next (void)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::next");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::next");
return this->next_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE void
-ACE_Module<ACE_SYNCH_USE>::next (ACE_Module<ACE_SYNCH_USE> *m)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
+ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::next (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *m)
{
- ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::next");
+ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::next");
this->next_ = m;
}
diff --git a/dep/acelite/ace/Monitor_Control/Auto_Update_Starter.cpp b/dep/acelite/ace/Monitor_Control/Auto_Update_Starter.cpp
new file mode 100644
index 00000000000..5c4b02d794b
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Auto_Update_Starter.cpp
@@ -0,0 +1,35 @@
+// $Id: Auto_Update_Starter.cpp 86518 2009-08-18 12:30:56Z olli $
+
+#include "ace/Monitor_Control/Auto_Update_Starter.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Reactor.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Monitor_Admin_Manager.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ int
+ Auto_Update_Starter::svc (void)
+ {
+ MC_ADMINMANAGER* mgr =
+ ACE_Dynamic_Service<MC_ADMINMANAGER>::instance ("MC_ADMINMANAGER");
+
+ /// We want the thread in which the event loop is started to
+ /// own the reactor, otherwise the handle_timeout() calls
+ /// aren't triggerd.
+ mgr->admin ().reactor ()->owner (ACE_Thread::self ());
+
+ return mgr->admin ().reactor ()->run_reactor_event_loop ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Auto_Update_Starter.h b/dep/acelite/ace/Monitor_Control/Auto_Update_Starter.h
new file mode 100644
index 00000000000..7201410161a
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Auto_Update_Starter.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Auto_Update_Starter.h
+ *
+ * $Id: Auto_Update_Starter.h 85297 2009-05-07 01:40:41Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef AUTO_UPDATE_STARTER_H
+#define AUTO_UPDATE_STARTER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Auto_Update_Starter
+ *
+ * @brief Starts reactor event loop that handles registered timers.
+ *
+ * For all the monitors that are periodically updated, the reactor
+ * event loop that calls their associated registered timers must
+ * be started in a separate thread so the rest of the application
+ * isn't blocked. A very simple class inheriting from ACE_Task_Base
+ * and overriding the svc() method suffices.
+ */
+ class MONITOR_CONTROL_Export Auto_Update_Starter : public ACE_Task_Base
+ {
+ public:
+ int svc (void);
+ };
+ }
+}
+
+typedef ACE::Monitor_Control::Auto_Update_Starter STARTER;
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // AUTO_UPDATE_STARTER_H
diff --git a/dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp b/dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp
new file mode 100644
index 00000000000..97467dfd90d
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.cpp
@@ -0,0 +1,136 @@
+// $Id: BSD_Network_Interface_Monitor.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#include "ace/Monitor_Control/BSD_Network_Interface_Monitor.h"
+
+#if defined (__NetBSD__) || defined (__OpenBSD__)
+
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <ifaddrs.h>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ BSD_Network_Interface_Monitor::BSD_Network_Interface_Monitor (
+ const ACE_TCHAR *lookup_str)
+ : value_ (0UL),
+ start_ (0UL),
+ lookup_str_ (lookup_str)
+ {
+ this->init();
+ }
+
+ void
+ BSD_Network_Interface_Monitor::update_i (void)
+ {
+ this->fetch(this->value_);
+ this->value_ -= this->start_;
+ }
+
+ void
+ BSD_Network_Interface_Monitor::clear_impl (void)
+ {
+ this->init();
+ }
+
+ void
+ BSD_Network_Interface_Monitor::init (void)
+ {
+ this->fetch(this->start_);
+ this->value_ = 0UL;
+ }
+
+ void
+ BSD_Network_Interface_Monitor::fetch (ACE_UINT64& value) const
+ {
+ ACE_UINT64 count = 0;
+ int fd = socket (AF_INET, SOCK_DGRAM, 0);
+
+ if (fd == -1)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("socket failed\n")));
+ return;
+ }
+
+ struct ifaddrs *ifa, *ifap;
+
+ if (getifaddrs (&ifap) < 0)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("getifaddrs failed\n")));
+ close (fd);
+ return;
+ }
+
+ char *p = 0;
+
+ for (ifa = ifap; ifa != 0; ifa = ifa->ifa_next)
+ {
+ if (p && strcmp (p, ifa->ifa_name) == 0)
+ {
+ continue;
+ }
+
+ p = ifa->ifa_name;
+
+#if defined (__OpenBSD__)
+ struct ifreq ifdr;
+#else
+ struct ifdatareq ifdr;
+#endif
+ memset (&ifdr, 0, sizeof (ifdr));
+
+#if defined (__OpenBSD__)
+ struct if_data if_data;
+ ifdr.ifr_data = reinterpret_cast<caddr_t> (&if_data);
+ strncpy (ifdr.ifr_name, ifa->ifa_name, IFNAMSIZ-1);
+#else
+ strncpy (ifdr.ifdr_name, ifa->ifa_name, sizeof (ifdr));
+#endif
+ if (ioctl (fd, SIOCGIFDATA, &ifdr) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("SIOCGIFDATA failed\n")));
+ }
+
+#if defined (__OpenBSD__)
+ struct if_data * const ifi = &if_data;
+#else
+ struct if_data * const ifi = &ifdr.ifdr_data;
+#endif
+
+ if (this->lookup_str_ == "ibytes")
+ {
+ count += ifi->ifi_ibytes;
+ }
+ else if (this->lookup_str_ == "ipackets")
+ {
+ count += ifi->ifi_ipackets;
+ }
+ else if (this->lookup_str_ == "obytes")
+ {
+ count += ifi->ifi_obytes;
+ }
+ else if (this->lookup_str_ == "opackets")
+ {
+ count += ifi->ifi_opackets;
+ }
+ }
+
+ freeifaddrs (ifap);
+ close (fd);
+
+ value = count;
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (__NetBSD__) || defined (__OpenBSD__) */
diff --git a/dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.h b/dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.h
new file mode 100644
index 00000000000..df4ab5d7102
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/BSD_Network_Interface_Monitor.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file BSD_Network_Interface_Monitor.h
+ *
+ * $Id: BSD_Network_Interface_Monitor.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef BSD_NETWORK_INTERFACE_MONITOR_H
+#define BSD_NETWORK_INTERFACE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+#if defined (__NetBSD__) || defined (__OpenBSD__)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class BSD_Network_Interface_Monitor
+ *
+ * @brief Mixin class for network interface monitors compiled on
+ * xxxBSD machines.
+ */
+ class MONITOR_CONTROL_Export BSD_Network_Interface_Monitor
+ {
+ protected:
+ BSD_Network_Interface_Monitor (const ACE_TCHAR *lookup_str);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ ACE_UINT64 value_;
+
+ private:
+ void init (void);
+ void fetch (ACE_UINT64& value) const;
+
+ ACE_UINT64 start_;
+ ACE_CString lookup_str_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (__NetBSD__) || defined (__OpenBSD__) */
+
+#include /**/ "ace/post.h"
+
+#endif // BSD_NETWORK_INTERFACE_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.cpp
new file mode 100644
index 00000000000..a1ef6b6e3b3
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.cpp
@@ -0,0 +1,60 @@
+// $Id: Bytes_Received_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/Bytes_Received_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* Bytes_Received_Monitor::default_name_ =
+ "OS/Network/BytesReceived";
+
+ Bytes_Received_Monitor::Bytes_Received_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Multi_Instance_Monitor (
+ ACE_TEXT ("\\Network Interface(*)\\Bytes Received/sec"))
+#elif defined (ACE_LINUX) || defined (AIX)
+ , Linux_Network_Interface_Monitor (
+ " %*[^:]: %lu %*u %*u %*u %*u %*u %*u %*u %*u %*u")
+ /// Scan format for /proc/net/dev
+#elif defined (ACE_HAS_KSTAT)
+ , Solaris_Network_Interface_Monitor (ACE_TEXT ("rbytes"))
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , BSD_Network_Interface_Monitor (ACE_TEXT ("ibytes"))
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , FreeBSD_Network_Interface_Monitor (ACE_TEXT ("ibytes"))
+#endif
+ {}
+
+ void
+ Bytes_Received_Monitor::update (void)
+ {
+ this->update_i ();
+
+ /// On some platforms, value_ is an ACE_UINT64.
+ this->receive (static_cast<double> (this->value_));
+ }
+
+ const char*
+ Bytes_Received_Monitor::default_name (void)
+ {
+ return Bytes_Received_Monitor::default_name_;
+ }
+
+ void
+ Bytes_Received_Monitor::clear_i (void)
+ {
+ this->clear_impl ();
+ this->Monitor_Base::clear_i ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.h b/dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.h
new file mode 100644
index 00000000000..1490293c0cb
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Bytes_Received_Monitor.h
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Bytes_Received_Monitor.h
+ *
+ * $Id: Bytes_Received_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef BYTES_RECEIVED_MONITOR_H
+#define BYTES_RECEIVED_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Multi_Instance_Monitor.h"
+#elif defined (ACE_LINUX) || defined (AIX)
+#include "ace/Monitor_Control/Linux_Network_Interface_Monitor.h"
+#elif defined (ACE_HAS_KSTAT)
+#include "ace/Monitor_Control/Solaris_Network_Interface_Monitor.h"
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+#include "ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h"
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+#include "ace/Monitor_Control/BSD_Network_Interface_Monitor.h"
+#else
+#include "ace/Monitor_Control/Null_Network_Interface_Monitor.h"
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Bytes_Received_Monitor
+ *
+ * @brief Monitors total bytes received over all network interfaces.
+ */
+ class MONITOR_CONTROL_Export Bytes_Received_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Multi_Instance_Monitor
+#elif defined (ACE_LINUX) || defined (AIX)
+ , public Linux_Network_Interface_Monitor
+#elif defined (ACE_HAS_KSTAT)
+ , public Solaris_Network_Interface_Monitor
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , public BSD_Network_Interface_Monitor
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , public FreeBSD_Network_Interface_Monitor
+#else
+ , public Null_Network_Interface_Monitor
+#endif
+ {
+ public:
+ Bytes_Received_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ private:
+ static const char* default_name_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // BYTES_RECEIVED_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.cpp
new file mode 100644
index 00000000000..03e8f6f4ffc
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.cpp
@@ -0,0 +1,60 @@
+// $Id: Bytes_Sent_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/Bytes_Sent_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* Bytes_Sent_Monitor::default_name_ =
+ "OS/Network/BytesSent";
+
+ Bytes_Sent_Monitor::Bytes_Sent_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Multi_Instance_Monitor (
+ ACE_TEXT ("\\Network Interface(*)\\Bytes Sent/sec"))
+#elif defined (ACE_LINUX) || defined (AIX)
+ , Linux_Network_Interface_Monitor (
+ " %*[^:]: %*u %*u %*u %*u %*u %*u %*u %*u %lu %*u")
+ /// Scan format for /proc/net/dev
+#elif defined (ACE_HAS_KSTAT)
+ , Solaris_Network_Interface_Monitor (ACE_TEXT ("obytes"))
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , FreeBSD_Network_Interface_Monitor (ACE_TEXT ("obytes"))
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , BSD_Network_Interface_Monitor (ACE_TEXT ("obytes"))
+#endif
+ {}
+
+ void
+ Bytes_Sent_Monitor::update (void)
+ {
+ this->update_i ();
+
+ /// On some platforms, value_ is an ACE_UINT64.
+ this->receive (static_cast<double> (this->value_));
+ }
+
+ const char*
+ Bytes_Sent_Monitor::default_name (void)
+ {
+ return Bytes_Sent_Monitor::default_name_;
+ }
+
+ void
+ Bytes_Sent_Monitor::clear_i (void)
+ {
+ this->clear_impl ();
+ this->Monitor_Base::clear_i ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.h b/dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.h
new file mode 100644
index 00000000000..8023195c355
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Bytes_Sent_Monitor.h
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Bytes_Sent_Monitor.h
+ *
+ * $Id: Bytes_Sent_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef BYTES_SENT_MONITOR_H
+#define BYTES_SENT_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Multi_Instance_Monitor.h"
+#elif defined (ACE_LINUX) || defined (AIX)
+#include "ace/Monitor_Control/Linux_Network_Interface_Monitor.h"
+#elif defined (ACE_HAS_KSTAT)
+#include "ace/Monitor_Control/Solaris_Network_Interface_Monitor.h"
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+#include "ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h"
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+#include "ace/Monitor_Control/BSD_Network_Interface_Monitor.h"
+#else
+#include "ace/Monitor_Control/Null_Network_Interface_Monitor.h"
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Bytes_Sent_Monitor
+ *
+ * @brief Monitors total bytes sent over all network interfaces.
+ */
+ class MONITOR_CONTROL_Export Bytes_Sent_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Multi_Instance_Monitor
+#elif defined (ACE_LINUX) || defined (AIX)
+ , public Linux_Network_Interface_Monitor
+#elif defined (ACE_HAS_KSTAT)
+ , public Solaris_Network_Interface_Monitor
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , public BSD_Network_Interface_Monitor
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , public FreeBSD_Network_Interface_Monitor
+#else
+ , public Null_Network_Interface_Monitor
+#endif
+ {
+ public:
+ Bytes_Sent_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ private:
+ static const char* default_name_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // BYTESSENTMONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.cpp b/dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.cpp
new file mode 100644
index 00000000000..5e016777c01
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.cpp
@@ -0,0 +1,254 @@
+// $Id: CPU_Load_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/CPU_Load_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_KSTAT)
+#include <sys/sysinfo.h>
+#endif
+
+#if defined (ACE_LINUX)
+#include "ace/OS_NS_stdio.h"
+#endif
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* CPU_Load_Monitor::default_name_ =
+ "OS/Processor/CPULoad";
+
+ CPU_Load_Monitor::CPU_Load_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Monitor (ACE_TEXT("\\Processor(_Total)\\% Processor Time"))
+#endif
+#if defined (ACE_LINUX) || defined (ACE_HAS_KSTAT)
+ , user_ (0)
+ , wait_ (0)
+ , kernel_ (0)
+ , idle_ (0)
+ , prev_idle_ (0)
+ , prev_total_ (0.0)
+#endif
+#if defined (ACE_LINUX)
+ , file_ptr_ (0)
+#elif defined (ACE_HAS_KSTAT)
+ , kstats_ (0)
+ , kstat_ (0)
+ , kstat_id_ (0)
+#endif
+ {
+ this->init ();
+ }
+
+ void
+ CPU_Load_Monitor::update (void)
+ {
+#if defined (ACE_HAS_WIN32_PDH)
+ this->update_i ();
+ this->receive (this->value_);
+#elif defined (ACE_LINUX)
+ this->access_proc_stat (&this->idle_);
+#elif defined (ACE_HAS_KSTAT)
+ this->access_kstats (&this->idle_);
+#endif
+
+#if defined (ACE_LINUX) || defined (ACE_HAS_KSTAT)
+ double delta_idle = this->idle_ - this->prev_idle_;
+ double total =
+ this->user_ + this->wait_ + this->kernel_ + this->idle_;
+ double delta_total = total - this->prev_total_;
+
+ if (ACE::is_equal (delta_total, 0.0))
+ {
+ /// The system hasn't updated /proc/stat since the last call
+ /// to update(), we must avoid dividing by 0.
+ return;
+ }
+
+ double percent_cpu_load = 100.0 - (delta_idle / delta_total * 100.0);
+
+ /// Stores value and timestamp with thread-safety.
+ this->receive (percent_cpu_load);
+
+ this->prev_idle_ = this->idle_;
+ this->prev_total_ = total;
+#endif
+ }
+
+ const char*
+ CPU_Load_Monitor::default_name (void)
+ {
+ return CPU_Load_Monitor::default_name_;
+ }
+
+ void
+ CPU_Load_Monitor::clear_i (void)
+ {
+#if defined (ACE_HAS_WIN32_PDH)
+ this->clear_impl ();
+#endif
+
+ this->init ();
+ this->Monitor_Base::clear_i ();
+ }
+
+ void
+ CPU_Load_Monitor::init (void)
+ {
+#if defined (ACE_LINUX)
+ /// All data in this file are stored as running 'jiffy' totals, so we
+ /// get values here in the constructor to subtract for the difference
+ /// in subsequent calls.
+ this->access_proc_stat (&this->prev_idle_);
+
+ this->prev_total_ =
+ this->user_ + this->wait_ + this->kernel_ + this->prev_idle_;
+#elif defined (ACE_HAS_KSTAT)
+ /// Stored similarly to Linux, in a system file.
+ this->access_kstats (&this->prev_idle_);
+
+ this->prev_total_ =
+ this->user_ + this->wait_ + this->kernel_ + this->prev_idle_;
+#endif
+ }
+
+#if defined (ACE_LINUX)
+ void
+ CPU_Load_Monitor::access_proc_stat (unsigned long *which_idle)
+ {
+ this->file_ptr_ = ACE_OS::fopen (ACE_TEXT ("/proc/stat"),
+ ACE_TEXT ("r"));
+
+ if (this->file_ptr_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("CPU load - opening /proc/stat failed\n")));
+ return;
+ }
+
+ char *item = 0;
+ char *arg = 0;
+
+ while ((ACE_OS::fgets (buf_, sizeof (buf_), file_ptr_)) != 0)
+ {
+ item = ACE_OS::strtok (this->buf_, " \t\n");
+ arg = ACE_OS::strtok (0, "\n");
+
+ if (item == 0 || arg == 0)
+ {
+ continue;
+ }
+
+ if (ACE_OS::strcmp (item, "cpu") == 0)
+ {
+ sscanf (arg,
+ "%lu %lu %lu %lu",
+ &this->user_,
+ &this->wait_,
+ &this->kernel_,
+ which_idle);
+ break;
+ }
+ }
+
+ ACE_OS::fclose (this->file_ptr_);
+ }
+#endif
+
+#if defined (ACE_HAS_KSTAT)
+ void
+ CPU_Load_Monitor::access_kstats (unsigned long *which_idle)
+ {
+ this->kstats_ = kstat_open ();
+
+ if (this->kstats_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("opening kstats file failed\n")));
+ return;
+ }
+
+ this->kstat_id_ = this->kstats_->kc_chain_id;
+
+ while (true)
+ {
+ this->kernel_ = 0UL;
+ this->wait_ = 0UL;
+ this->user_ = 0UL;
+ (*which_idle) = 0UL;
+
+ /// Unlike Linux's "/proc/stat", there is no entry for total CPU
+ /// stats, so we have to sum them manually.
+ for (this->kstat_ = this->kstats_->kc_chain;
+ this->kstat_ != 0;
+ this->kstat_ = this->kstat_->ks_next)
+ {
+ int result = ACE_OS::strncmp (this->kstat_->ks_name,
+ "cpu_stat",
+ ACE_OS::strlen ("cpu_stat"));
+
+ if (result == 0)
+ {
+ /// Because the kstat chain can change dynamically,
+ /// watch the chain ID and restart the walk if the ID
+ /// differs from what we saw during the walk. The restart
+ /// is done by breaking from the cycle with kstat_ not 0.
+
+ kid_t kstat_id = kstat_read (this->kstats_, this->kstat_, 0);
+
+ if (kstat_id != this->kstat_id_)
+ {
+ break;
+ }
+
+ cpu_stat_t &kstat_cpu =
+ *((cpu_stat_t *) this->kstat_->ks_data);
+
+ this->kernel_ += kstat_cpu.cpu_sysinfo.cpu[CPU_KERNEL];
+ this->wait_ += kstat_cpu.cpu_sysinfo.cpu[CPU_WAIT];
+ this->user_ += kstat_cpu.cpu_sysinfo.cpu[CPU_USER];
+ (*which_idle) += kstat_cpu.cpu_sysinfo.cpu[CPU_IDLE];
+ }
+ }
+
+ if (this->kstat_ != 0)
+ {
+ /// The ID changed underneath us, so get the new one and
+ /// start again.
+ this->kstat_id_ = kstat_chain_update (this->kstats_);
+
+ if (! this->kstat_id_ > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("kstat chain update ")
+ ACE_TEXT ("returned null id\n")));
+ return;
+ }
+ }
+ else
+ {
+ /// Clean run, exit the WHILE loop.
+ break;
+ }
+ }
+
+ int status = kstat_close (this->kstats_);
+
+ if (status != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("closing kstats file failed\n")));
+ }
+ }
+#endif
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.h b/dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.h
new file mode 100644
index 00000000000..6481a1a66b4
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/CPU_Load_Monitor.h
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CPU_Load_Monitor.h
+ *
+ * $Id: CPU_Load_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef CPU_LOAD_MONITOR_H
+#define CPU_LOAD_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Monitor.h"
+#elif defined (ACE_HAS_KSTAT)
+#include "ace/os_include/os_kstat.h"
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class CPU_Load_Monitor
+ *
+ * @brief Monitors percentage CPU utilization.
+ */
+ class MONITOR_CONTROL_Export CPU_Load_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Monitor
+#endif
+ {
+ public:
+ CPU_Load_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ /// Common code to the constructor and to clear_i().
+ void init (void);
+
+ private:
+#if defined (ACE_LINUX)
+ void access_proc_stat (unsigned long *which_idle);
+#endif
+
+#if defined (ACE_HAS_KSTAT)
+ void access_kstats (unsigned long *which_idle);
+#endif
+
+ private:
+ static const char* default_name_;
+
+ /// Common to Linux and Solaris implementations.
+#if defined (ACE_LINUX) || defined (ACE_HAS_KSTAT)
+ unsigned long user_;
+ unsigned long wait_;
+ unsigned long kernel_;
+ unsigned long idle_;
+ unsigned long prev_idle_;
+ double prev_total_;
+#endif
+#if defined (ACE_LINUX)
+ FILE *file_ptr_;
+ char buf_[1024];
+#elif defined (ACE_HAS_KSTAT)
+ kstat_ctl_t *kstats_;
+ kstat_t *kstat_;
+ kid_t kstat_id_;
+#endif
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // CPU_LOAD_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Constraint_Interpreter.cpp b/dep/acelite/ace/Monitor_Control/Constraint_Interpreter.cpp
new file mode 100644
index 00000000000..18916522538
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Constraint_Interpreter.cpp
@@ -0,0 +1,62 @@
+// $Id: Constraint_Interpreter.cpp 86518 2009-08-18 12:30:56Z olli $
+
+#include "ace/Monitor_Control/Constraint_Interpreter.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Log_Msg.h"
+
+#include "ace/ETCL/ETCL_Constraint.h"
+
+#include "ace/Monitor_Control/Constraint_Visitor.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Constraint_Interpreter::Constraint_Interpreter (void)
+ {
+ }
+
+ Constraint_Interpreter::~Constraint_Interpreter (void)
+ {
+ }
+
+ int
+ Constraint_Interpreter::build_tree (const char *constraints)
+ {
+ if (ETCL_Interpreter::is_empty_string (constraints))
+ {
+ /// Root is deleted in the interpreter's destructor.
+ ACE_NEW_RETURN (this->root_,
+ ETCL_Literal_Constraint (true),
+ -1);
+ }
+ else
+ {
+ /// root_ is set in this base class call.
+ if (ETCL_Interpreter::build_tree (constraints) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Constraint_Interpreter::build_tree() - "
+ "ETCL_Interpreter::build_tree() failed\n"),
+ -1);
+ }
+ }
+
+ return 0;
+ }
+
+ ACE_CDR::Boolean
+ Constraint_Interpreter::evaluate (Constraint_Visitor &evaluator)
+ {
+ return evaluator.evaluate_constraint (this->root_);
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Constraint_Interpreter.h b/dep/acelite/ace/Monitor_Control/Constraint_Interpreter.h
new file mode 100644
index 00000000000..e75981980fe
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Constraint_Interpreter.h
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Constraint_Interpreter.h
+ *
+ * $Id: Constraint_Interpreter.h 81753 2008-05-21 19:02:47Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef CONSTRAINT_INTERPRETER_H
+#define CONSTRAINT_INTERPRETER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/CDR_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/ETCL/ETCL_Interpreter.h"
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ class Constraint_Visitor;
+
+ /**
+ * @class Constraint_Interpreter
+ *
+ * @brief "ETCL" Interpreter for MonitorControl constraints,
+ specialized to encapsulate MonitorControl-specific
+ knowledge of types and visitors.
+ */
+ class MONITOR_CONTROL_Export Constraint_Interpreter
+ : public ETCL_Interpreter
+ {
+ public:
+ Constraint_Interpreter (void);
+
+ virtual ~Constraint_Interpreter (void);
+
+ /**
+ * This method builds an expression tree representing the
+ * constraint specified in <constraints>, and returns -1 with
+ * an error message if the constraint given has syntax errors or
+ * semantic errors, such as mismatched types.
+ */
+ int build_tree (const char* constraints);
+
+ /// Returns true if the constraint is evaluated successfully by
+ /// the evaluator.
+ ACE_CDR::Boolean evaluate (Constraint_Visitor &evaluator);
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif /* CONSTRAINT_INTERPRETER_H */
diff --git a/dep/acelite/ace/Monitor_Control/Constraint_Visitor.cpp b/dep/acelite/ace/Monitor_Control/Constraint_Visitor.cpp
new file mode 100644
index 00000000000..d37ad53cc49
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Constraint_Visitor.cpp
@@ -0,0 +1,304 @@
+// $Id: Constraint_Visitor.cpp 86518 2009-08-18 12:30:56Z olli $
+
+#include "ace/Monitor_Control/Constraint_Visitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/ETCL/ETCL_y.h"
+#include "ace/ETCL/ETCL_Constraint.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Constraint_Visitor::Constraint_Visitor (
+ const Monitor_Control_Types::Data& data)
+ : data_ (data)
+ {}
+
+ Constraint_Visitor::~Constraint_Visitor (void)
+ {}
+
+ ACE_CDR::Boolean
+ Constraint_Visitor::evaluate_constraint (ETCL_Constraint *root)
+ {
+ ACE_CDR::Boolean result = false;
+ this->queue_.reset ();
+
+ // Evaluate the constraint in root_;
+ if (root != 0)
+ {
+ if (root->accept (this) == 0 && !this->queue_.is_empty ())
+ {
+ ETCL_Literal_Constraint top;
+ this->queue_.dequeue_head (top);
+ result = (ACE_CDR::Boolean) top;
+ }
+ }
+
+ // If a property couldn't be evaluated we must return FALSE.
+ return result;
+ }
+
+ int
+ Constraint_Visitor::visit_literal (ETCL_Literal_Constraint *constraint)
+ {
+ this->queue_.enqueue_head (*constraint);
+ return 0;
+ }
+
+ int
+ Constraint_Visitor::visit_identifier (ETCL_Identifier *ident)
+ {
+ /// TODO - check for strings related to other identifiers
+ /// relevant in MonitorControl, for example the data timestamp.
+ if (ACE_OS::strcmp (ident->value (), "value") == 0)
+ {
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (this->data_.value_));
+
+ return 0;
+ }
+
+ return -1;
+ }
+
+ int
+ Constraint_Visitor::visit_unary_expr (ETCL_Unary_Expr *unary_expr)
+ {
+ ETCL_Constraint *subexpression = unary_expr->subexpr ();
+
+ /// Call to accept() puts the subexpression's evaluation on our queue.
+ if (subexpression->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint subexpr_result;
+ ACE_CDR::Boolean result = 0;
+ int op_type = unary_expr->type ();
+
+ switch (op_type)
+ {
+ case ETCL_NOT:
+ this->queue_.dequeue_head (subexpr_result);
+ result = ! (ACE_CDR::Boolean) subexpr_result;
+ this->queue_.enqueue_head (ETCL_Literal_Constraint (result));
+ return 0;
+ case ETCL_MINUS:
+ /// The leading '-' was parsed separately, so we have to pull
+ /// the literal constraint off the queue, apply the class' own
+ /// unary minus operator, and put it back.
+ this->queue_.dequeue_head (subexpr_result);
+ this->queue_.enqueue_head (-subexpr_result);
+ return 0;
+ case ETCL_PLUS:
+ /// Leave the literal constraint on the queue. The leading
+ /// '+' was just syntactic sugar - no action is necessary.
+ return 0;
+ default:
+ /// The parser should never construct a ETCL_Unary_Constraint
+ /// behind any operators except the above three.
+ return -1;
+ }
+ }
+
+ return -1;
+ }
+
+ int
+ Constraint_Visitor::visit_binary_expr (ETCL_Binary_Expr *binary_expr)
+ {
+ int bin_op_type = binary_expr->type ();
+
+ switch (bin_op_type)
+ {
+ case ETCL_OR:
+ return this->visit_or (binary_expr);
+ case ETCL_AND:
+ return this->visit_and (binary_expr);
+ case ETCL_LT:
+ case ETCL_LE:
+ case ETCL_GT:
+ case ETCL_GE:
+ case ETCL_EQ:
+ case ETCL_NE:
+ case ETCL_PLUS:
+ case ETCL_MINUS:
+ case ETCL_MULT:
+ case ETCL_DIV:
+ return this->visit_binary_op (binary_expr, bin_op_type);
+ /// These last two are not supported in non_CORBA ETCL.
+ case ETCL_TWIDDLE:
+ case ETCL_IN:
+ default:
+ return -1;
+ }
+ }
+
+ int
+ Constraint_Visitor::visit_or (ETCL_Binary_Expr *binary)
+ {
+ int return_value = -1;
+ ACE_CDR::Boolean result = false;
+ ETCL_Constraint *lhs = binary->lhs ();
+
+ /// Call to accept() puts the lhs (or its evaluation) on our queue.
+ if (lhs->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint lhs_result;
+ this->queue_.dequeue_head (lhs_result);
+ result = (ACE_CDR::Boolean) lhs_result;
+
+ /// Short-circuiting OR.
+ if (!result)
+ {
+ ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint rhs_result;
+ this->queue_.dequeue_head (rhs_result);
+ result = (ACE_CDR::Boolean) rhs_result;
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+
+ if (return_value == 0)
+ {
+ this->queue_.enqueue_head (ETCL_Literal_Constraint (result));
+ }
+
+ return return_value;
+ }
+
+ int
+ Constraint_Visitor::visit_and (ETCL_Binary_Expr *binary)
+ {
+ int return_value = -1;
+ ACE_CDR::Boolean result = false;
+ ETCL_Constraint *lhs = binary->lhs ();
+
+ /// Call to accept() puts the lhs (or its evaluation) on our queue.
+ if (lhs->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint lhs_result;
+ this->queue_.dequeue_head (lhs_result);
+ result = (ACE_CDR::Boolean) lhs_result;
+
+ /// Short-circuiting AND.
+ if (result == true)
+ {
+ ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint rhs_result;
+ this->queue_.dequeue_head (rhs_result);
+ result = (ACE_CDR::Boolean) rhs_result;
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+
+ if (return_value == 0)
+ {
+ this->queue_.enqueue_head (ETCL_Literal_Constraint (result));
+ }
+
+ return return_value;
+ }
+
+ int
+ Constraint_Visitor::visit_binary_op (ETCL_Binary_Expr *binary,
+ int op_type)
+ {
+ int return_value = -1;
+ ETCL_Constraint *lhs = binary->lhs ();
+ ACE_CDR::Boolean result = false;
+
+ /// Perform an operation on the results of evaluating the left and
+ /// right branches of this subtree. The evaluations go on our queue.
+ if (lhs->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint left_operand;
+ this->queue_.dequeue_head (left_operand);
+ ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ ETCL_Literal_Constraint right_operand;
+ this->queue_.dequeue_head (right_operand);
+ return_value = 0;
+
+ switch (op_type)
+ {
+ case ETCL_LT:
+ result = left_operand < right_operand;
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (result));
+ break;
+ case ETCL_LE:
+ result = left_operand <= right_operand;
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (result));
+ break;
+ case ETCL_GT:
+ result = left_operand > right_operand;
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (result));
+ break;
+ case ETCL_GE:
+ result = left_operand >= right_operand;
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (result));
+ break;
+ case ETCL_EQ:
+ result = left_operand == right_operand;
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (result));
+ break;
+ case ETCL_NE:
+ result = left_operand != right_operand;
+ this->queue_.enqueue_head (
+ ETCL_Literal_Constraint (result));
+ break;
+ case ETCL_PLUS:
+ this->queue_.enqueue_head (
+ left_operand + right_operand);
+ break;
+ case ETCL_MINUS:
+ this->queue_.enqueue_head (
+ left_operand - right_operand);
+ break;
+ case ETCL_MULT:
+ this->queue_.enqueue_head (
+ left_operand * right_operand);
+ break;
+ case ETCL_DIV:
+ this->queue_.enqueue_head (
+ left_operand / right_operand);
+ break;
+ default:
+ return_value = -1;
+ break;
+ }
+ }
+ }
+
+ return return_value;
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Constraint_Visitor.h b/dep/acelite/ace/Monitor_Control/Constraint_Visitor.h
new file mode 100644
index 00000000000..582ee1ab129
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Constraint_Visitor.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Constraint_Visitor.h
+ *
+ * $Id: Constraint_Visitor.h 86518 2009-08-18 12:30:56Z olli $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef CONSTRAINT_VISITOR_H
+#define CONSTRAINT_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/CDR_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Monitor_Control_Types.h"
+
+#include "ace/ETCL/ETCL_Constraint.h"
+#include "ace/ETCL/ETCL_Constraint_Visitor.h"
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ETCL_Literal_Constraint;
+class ETCL_Identifier;
+class ETCL_Unary_Expr;
+class ETCL_Binary_Expr;
+class ETCL_Constraint;
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Constraint_Visitor
+ *
+ * @brief Backend for the non-CORBA ETCL frontend, specific to
+ * MonitorControl and supporting only basic types not
+ specific to CORBA.
+ */
+ class MONITOR_CONTROL_Export Constraint_Visitor
+ : public ETCL_Constraint_Visitor
+ {
+ public:
+ Constraint_Visitor (const Monitor_Control_Types::Data& data);
+ virtual ~Constraint_Visitor (void);
+
+ ACE_CDR::Boolean evaluate_constraint (ETCL_Constraint *root);
+
+ virtual int visit_literal (ETCL_Literal_Constraint *);
+ virtual int visit_identifier (ETCL_Identifier *);
+ virtual int visit_unary_expr (ETCL_Unary_Expr *);
+ virtual int visit_binary_expr (ETCL_Binary_Expr *);
+
+ private:
+ /// Sub-methods for visit_binary_expr().
+ int visit_or (ETCL_Binary_Expr *);
+ int visit_and (ETCL_Binary_Expr *);
+ int visit_binary_op (ETCL_Binary_Expr *binary_expr,
+ int op_type);
+
+ private:
+ const Monitor_Control_Types::Data& data_;
+ ACE_Unbounded_Queue<ETCL_Literal_Constraint> queue_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // CONSTRAINT_VISITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.cpp b/dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.cpp
new file mode 100644
index 00000000000..87a3cffdd8a
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.cpp
@@ -0,0 +1,124 @@
+// $Id: FreeBSD_Network_Interface_Monitor.cpp 86518 2009-08-18 12:30:56Z olli $
+
+#include "ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h"
+
+#if defined (__FreeBSD__) || defined (__Lynx__)
+
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/time.h>
+#include <net/if.h>
+#include <net/if_mib.h>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ FreeBSD_Network_Interface_Monitor::FreeBSD_Network_Interface_Monitor (
+ const ACE_TCHAR *lookup_str)
+ : value_ (0UL),
+ start_ (0UL),
+ lookup_str_ (lookup_str)
+ {
+ this->init();
+ }
+
+ void
+ FreeBSD_Network_Interface_Monitor::update_i (void)
+ {
+ this->fetch(this->value_);
+ this->value_ -= this->start_;
+ }
+
+ void
+ FreeBSD_Network_Interface_Monitor::clear_impl (void)
+ {
+ this->init();
+ }
+
+ void
+ FreeBSD_Network_Interface_Monitor::init (void)
+ {
+ this->fetch(this->start_);
+ this->value_ = 0UL;
+ }
+
+ void
+ FreeBSD_Network_Interface_Monitor::fetch (ACE_UINT64& value) const
+ {
+ ACE_UINT64 count = 0;
+
+ int req_name[5];
+ int ifcount;
+ size_t ifcount_len = sizeof(ifcount);
+
+ req_name[0] = CTL_NET;
+ req_name[1] = PF_LINK;
+ req_name[2] = NETLINK_GENERIC;
+ req_name[3] = IFMIB_SYSTEM;
+ req_name[4] = IFMIB_IFCOUNT;
+
+ if (::sysctl(req_name, 5, &ifcount, &ifcount_len, (void *)0, 0) == -1)
+ {
+ ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) %p\n"),
+ ACE_TEXT("sysctl failed")));
+
+ return;
+ }
+
+ for (int i = 1; i <= ifcount; i++)
+ {
+ int name[6];
+ struct ifmibdata ifmd;
+ size_t len = sizeof(ifmd);
+
+ name[0] = CTL_NET;
+ name[1] = PF_LINK;
+ name[2] = NETLINK_GENERIC;
+ name[3] = IFMIB_IFDATA;
+ name[4] = i;
+ name[5] = IFDATA_GENERAL;
+
+ if(::sysctl(name, 6, &ifmd, &len, (void *)0, 0) == -1)
+ {
+ ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) %p\n"),
+ ACE_TEXT("sysctl failed")));
+
+ break;
+ }
+
+ struct if_data * const ifi = &ifmd.ifmd_data;
+
+ if(this->lookup_str_ == "ibytes")
+ {
+ count += ifi->ifi_ibytes;
+ }
+ else if(this->lookup_str_ == "ipackets")
+ {
+ count += ifi->ifi_ipackets;
+ }
+ else if(this->lookup_str_ == "obytes")
+ {
+ count += ifi->ifi_obytes;
+ }
+ else if(this->lookup_str_ == "opackets")
+ {
+ count += ifi->ifi_opackets;
+ }
+
+ } // for
+
+ value = count;
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (__FreeBSD__) || defined (__Lynx__) */
diff --git a/dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h b/dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h
new file mode 100644
index 00000000000..b820b3b0e64
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FreeBSD_Network_Interface_Monitor.h
+ *
+ * $Id: FreeBSD_Network_Interface_Monitor.h 86518 2009-08-18 12:30:56Z olli $
+ *
+ * @author Boyan Kasarov
+ */
+//=============================================================================
+
+#ifndef FREEBSD_NETWORK_INTERFACE_MONITOR_H
+#define FREEBSD_NETWORK_INTERFACE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+#if defined (__FreeBSD__) || defined (__Lynx__)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class FreeBSD_Network_Interface_Monitor
+ *
+ * @brief Mixin class for network interface monitors compiled on
+ * FreeBSD machines.
+ */
+ class MONITOR_CONTROL_Export FreeBSD_Network_Interface_Monitor
+ {
+ protected:
+ FreeBSD_Network_Interface_Monitor (const ACE_TCHAR *lookup_str);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ ACE_UINT64 value_;
+
+ private:
+ void init (void);
+ void fetch (ACE_UINT64& value) const;
+
+ ACE_UINT64 start_;
+ ACE_CString lookup_str_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (__FreeBSD__) || defined (__Lynx__) */
+
+#include /**/ "ace/post.h"
+
+#endif // FREEBSD_NETWORK_INTERFACE_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.cpp
new file mode 100644
index 00000000000..ffcdc054d06
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.cpp
@@ -0,0 +1,124 @@
+// $Id: Linux_Network_Interface_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/Linux_Network_Interface_Monitor.h"
+
+#if defined (ACE_LINUX) || defined (AIX)
+
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Linux_Network_Interface_Monitor::Linux_Network_Interface_Monitor (
+ const char *scan_format)
+ : value_ (0UL),
+ start_ (0UL),
+ scan_format_ (scan_format)
+ {
+ this->init ();
+ }
+
+ void
+ Linux_Network_Interface_Monitor::update_i (void)
+ {
+ char buf[1024];
+ FILE* fp = ACE_OS::fopen (ACE_TEXT ("/proc/net/dev"),
+ ACE_TEXT ("r"));
+
+ if (fp == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("bytes sent - opening ")
+ ACE_TEXT ("/proc/net/dev failed\n")));
+ return;
+ }
+
+ /// Ignore the first 2 lines of the file, which are file
+ /// and column headers.
+ void* dummy = ACE_OS::fgets (buf, sizeof (buf), fp);
+ ACE_UNUSED_ARG (dummy);
+ dummy = ACE_OS::fgets (buf, sizeof (buf), fp);
+ ACE_UNUSED_ARG (dummy);
+
+ unsigned long iface_value = 0UL;
+ ACE_UINT32 iface_index = 0UL;
+ ACE_UINT64 total_value = 0UL;
+
+ while (ACE_OS::fgets (buf, sizeof (buf), fp) != 0)
+ {
+ sscanf (buf, this->scan_format_.c_str (), &iface_value);
+
+ /// If the monitor runs long enough, the system counters will
+ /// wrap around, the statement below is an attempt to correct
+ /// for that.
+ this->value_array_[iface_index] +=
+ iface_value
+ - static_cast<unsigned long> (this->value_array_[iface_index]);
+ total_value += this->value_array_[iface_index];
+
+ ++iface_index;
+ }
+
+ this->value_ = total_value - this->start_;
+ (void) ACE_OS::fclose (fp);
+ }
+
+ void
+ Linux_Network_Interface_Monitor::clear_impl (void)
+ {
+ this->init ();
+ }
+
+ void
+ Linux_Network_Interface_Monitor::init (void)
+ {
+ for (unsigned long i = 0UL; i < MAX_INTERFACES; ++i)
+ {
+ this->value_array_[i] = 0UL;
+ }
+
+ /// Read the file once to get a base value that we can subtract
+ /// from subsequent readings to get bytes sent since we started
+ /// monitoring.
+ char buf[1024];
+ FILE* fp = ACE_OS::fopen (ACE_TEXT ("/proc/net/dev"),
+ ACE_TEXT ("r"));
+
+ if (fp == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("bytes sent - opening ")
+ ACE_TEXT ("/proc/net/dev failed\n")));
+ return;
+ }
+
+ /// Ignore the first 2 lines of the file, which are file
+ /// and column headers.
+ void* dummy = ACE_OS::fgets (buf, sizeof (buf), fp);
+ ACE_UNUSED_ARG (dummy);
+ dummy = ACE_OS::fgets (buf, sizeof (buf), fp);
+ ACE_UNUSED_ARG (dummy);
+
+ unsigned long iface_value = 0UL;
+ ACE_UINT32 iface_index = 0UL;
+
+ while (ACE_OS::fgets (buf, sizeof (buf), fp) != 0)
+ {
+ sscanf (buf, this->scan_format_.c_str (), &iface_value);
+ this->start_ += iface_value;
+
+ ++iface_index;
+ }
+
+ (void) ACE_OS::fclose (fp);
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_LINUX) || defined (AIX) */
diff --git a/dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.h b/dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.h
new file mode 100644
index 00000000000..b2e5226008d
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Linux_Network_Interface_Monitor.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Linux_Network_Interface_Monitor.h
+ *
+ * $Id: Linux_Network_Interface_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef LINUX_NETWORK_INTERFACE_MONITOR_H
+#define LINUX_NETWORK_INTERFACE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+#if defined (ACE_LINUX) || defined (AIX)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Linux_Network_Interface_Monitor
+ *
+ * @brief Mixin class for network interface monitors compiled on
+ * Linux machines.
+ */
+ class MONITOR_CONTROL_Export Linux_Network_Interface_Monitor
+ {
+ protected:
+ /// The Linux system file /proc/net/dev stores a wealth of
+ /// network information about the system. To get the specific
+ /// value we want to monitor, we just vary the scan format string.
+ Linux_Network_Interface_Monitor (const char *scan_format);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ ACE_UINT64 value_;
+
+ private:
+ /// Common code.
+ void init (void);
+
+ private:
+ static const unsigned long MAX_INTERFACES = 10UL;
+ ACE_UINT64 value_array_[MAX_INTERFACES];
+ ACE_UINT64 start_;
+ ACE_CString scan_format_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_LINUX) || defined (AIX) */
+
+#include /**/ "ace/post.h"
+
+#endif // LINUX_NETWORK_INTERFACE_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.cpp
new file mode 100644
index 00000000000..cc8a2c769a3
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.cpp
@@ -0,0 +1,78 @@
+// $Id: Memory_Usage_Monitor.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#if defined (ACE_HAS_KSTAT)
+#include <sys/sysinfo.h>
+#endif
+
+#include "ace/Monitor_Control/Memory_Usage_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* Memory_Usage_Monitor::default_name_ =
+ "OS/Memory/TotalUsage";
+
+ Memory_Usage_Monitor::Memory_Usage_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Monitor (ACE_TEXT ("\\Memory\\% Committed Bytes In Use"))
+#endif
+ {
+ }
+
+ void
+ Memory_Usage_Monitor::update (void)
+ {
+#if defined (ACE_HAS_WIN32_PDH)
+ this->update_i ();
+ this->receive (this->value_);
+#elif defined (ACE_HAS_LINUX_SYSINFO)
+ if (::sysinfo (&this->sysinfo_) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Memory usage - sysinfo() failed\n")));
+ return;
+ }
+
+ double used_ram = this->sysinfo_.totalram - this->sysinfo_.freeram;
+ double percent_mem_usage = used_ram / this->sysinfo_.totalram * 100.0;
+
+ this->receive (percent_mem_usage);
+#elif defined (ACE_HAS_KSTAT)
+ unsigned long page_size = sysconf (_SC_PAGE_SIZE);
+ unsigned long total = sysconf (_SC_PHYS_PAGES) * page_size;
+ unsigned long free = sysconf (_SC_AVPHYS_PAGES) * page_size;
+
+ double used = total - free;
+ double percent_mem_usage = used / total * 100.0;
+
+ this->receive (percent_mem_usage);
+#endif
+ }
+
+ const char*
+ Memory_Usage_Monitor::default_name (void)
+ {
+ return Memory_Usage_Monitor::default_name_;
+ }
+
+ void
+ Memory_Usage_Monitor::clear_i (void)
+ {
+#if defined (ACE_HAS_WIN32_PDH)
+ this->clear_impl ();
+#endif
+
+ this->Monitor_Base::clear_i ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.h b/dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.h
new file mode 100644
index 00000000000..7da7f531ff8
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Memory_Usage_Monitor.h
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Memory_Usage_Monitor.h
+ *
+ * $Id: Memory_Usage_Monitor.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef MEMORY_USAGE_MONITOR_H
+#define MEMORY_USAGE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Monitor.h"
+#elif defined (ACE_HAS_LINUX_SYSINFO)
+#include "ace/os_include/sys/os_sysinfo.h"
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Memory_Usage_Monitor
+ *
+ * @brief Monitor percentage of total available memory used.
+ */
+ class MONITOR_CONTROL_Export Memory_Usage_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Monitor
+#endif
+ {
+ public:
+ Memory_Usage_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ private:
+ static const char* default_name_;
+
+#if defined (ACE_HAS_LINUX_SYSINFO)
+ struct sysinfo sysinfo_;
+#endif
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // MEMORY_USAGE_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Control.h b/dep/acelite/ace/Monitor_Control/Monitor_Control.h
new file mode 100644
index 00000000000..482e0662a8b
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Control.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Monitor_Control.h
+ *
+ * $Id: Monitor_Control.h 81753 2008-05-21 19:02:47Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef MONITOR_CONTROL_H
+#define MONITOR_CONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Point_Registry.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Monitor_Admin_Manager.h"
+
+#include "ace/Monitor_Control/CPU_Load_Monitor.h"
+#include "ace/Monitor_Control/Memory_Usage_Monitor.h"
+#include "ace/Monitor_Control/Num_Threads_Monitor.h"
+#include "ace/Monitor_Control/Bytes_Sent_Monitor.h"
+#include "ace/Monitor_Control/Packets_Sent_Monitor.h"
+#include "ace/Monitor_Control/Bytes_Received_Monitor.h"
+#include "ace/Monitor_Control/Packets_Received_Monitor.h"
+#include "ace/Monitor_Control/Monitor_Group.h"
+#include "ace/Monitor_Control/Monitor_Query.h"
+#include "ace/Monitor_Control/Monitor_Control_utils.h"
+
+static int
+ACE_Requires_MC_Initializer = MC_ADMINMANAGER::Initializer ();
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // MONITOR_CONTROL_H
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Control_export.h b/dep/acelite/ace/Monitor_Control/Monitor_Control_export.h
new file mode 100644
index 00000000000..2cae021033e
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Control_export.h
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Monitor_Control_export.h
+ *
+ * $Id: Monitor_Control_export.h 81753 2008-05-21 19:02:47Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef MONITOR_CONTROL_EXPORT_H
+#define MONITOR_CONTROL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS)
+# if !defined (MONITOR_CONTROL_HAS_DLL)
+# define MONITOR_CONTROL_HAS_DLL 0
+# endif /* ! MONITOR_CONTROL_HAS_DLL */
+#else
+# if !defined (MONITOR_CONTROL_HAS_DLL)
+# define MONITOR_CONTROL_HAS_DLL 1
+# endif /* ! MONITOR_CONTROL_HAS_DLL */
+#endif /* ACE_AS_STATIC_LIB */
+
+#if defined (MONITOR_CONTROL_HAS_DLL) && (MONITOR_CONTROL_HAS_DLL == 1)
+# if defined (MONITOR_CONTROL_BUILD_DLL)
+# define MONITOR_CONTROL_Export ACE_Proper_Export_Flag
+# define MONITOR_CONTROL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define MONITOR_CONTROL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* MONITOR_CONTROL_BUILD_DLL */
+# define MONITOR_CONTROL_Export ACE_Proper_Import_Flag
+# define MONITOR_CONTROL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define MONITOR_CONTROL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* MONITOR_CONTROL_BUILD_DLL */
+#else /* MONITOR_CONTROL_HAS_DLL == 1 */
+# define MONITOR_CONTROL_Export
+# define MONITOR_CONTROL_SINGLETON_DECLARATION(T)
+# define MONITOR_CONTROL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* MONITOR_CONTROL_HAS_DLL == 1 */
+
+#endif /* MONITOR_CONTROL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Control_utils.h b/dep/acelite/ace/Monitor_Control/Monitor_Control_utils.h
new file mode 100644
index 00000000000..d0d21c0f5a9
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Control_utils.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Monitor_Control_utils.h
+ *
+ * $Id: Monitor_Control_utils.h 81753 2008-05-21 19:02:47Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef MONITOR_CONTROL_UTILS_H
+#define MONITOR_CONTROL_UTILS_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Service_Config.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Reactor.h"
+
+#include "ace/Monitor_Control/Auto_Update_Starter.h"
+
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::CPU_Load_Monitor
+ CPU_LOAD_MONITOR;
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::Memory_Usage_Monitor
+ MEMORY_USAGE_MONITOR;
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::Num_Threads_Monitor
+ NUM_THREADS_MONITOR;
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::Bytes_Sent_Monitor
+ BYTES_SENT_MONITOR;
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::Packets_Sent_Monitor
+ PACKETS_SENT_MONITOR;
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::Bytes_Received_Monitor
+ BYTES_RECEIVED_MONITOR;
+typedef ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control::Packets_Received_Monitor
+ PACKETS_RECEIVED_MONITOR;
+
+using namespace ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control;
+
+template<typename OS_MP_TYPE>
+Monitor_Base*
+create_os_monitor (const char* name = 0,
+ ACE_Time_Value period = ACE_Time_Value::zero)
+{
+ Monitor_Base* retval = 0;
+
+ ACE_VERSIONED_NAMESPACE_NAME::MC_ADMINMANAGER *mgr =
+ ACE_VERSIONED_NAMESPACE_NAME::ACE_Dynamic_Service<
+ ACE_VERSIONED_NAMESPACE_NAME::MC_ADMINMANAGER>::instance (
+ "MC_ADMINMANAGER");
+
+ const char* working_name =
+ (name == 0 ? OS_MP_TYPE::default_name () : name);
+
+ retval = mgr->admin ().monitor_point (working_name);
+
+ if (retval == 0)
+ {
+ ACE_NEW_RETURN (retval, OS_MP_TYPE (working_name), 0);
+ (void) mgr->admin ().monitor_point (retval, period);
+ }
+
+ return retval;
+}
+
+#define START_PERIODIC_MONITORS \
+ ACE_VERSIONED_NAMESPACE_NAME::STARTER starter; \
+ starter.activate ()
+
+#define STOP_PERIODIC_MONITORS \
+ ACE_VERSIONED_NAMESPACE_NAME::ACE_Dynamic_Service< \
+ ACE_VERSIONED_NAMESPACE_NAME::MC_ADMINMANAGER>::instance ( \
+ "MC_ADMINMANAGER")->admin ().reactor ()->end_reactor_event_loop (); \
+ ACE_VERSIONED_NAMESPACE_NAME::ACE_Thread_Manager::instance ()->wait ()
+
+#define ADD_PERIODIC_QUERY(HANDLER,QUERY,INTERVAL_SEC) \
+ ACE_VERSIONED_NAMESPACE_NAME::ACE_Dynamic_Service< \
+ ACE_VERSIONED_NAMESPACE_NAME::MC_ADMINMANAGER>::instance ( \
+ "MC_ADMINMANAGER")->admin ().auto_query (HANDLER, QUERY, INTERVAL_SEC)
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // MONITOR_CONTROL_UTILS_H
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Group.cpp b/dep/acelite/ace/Monitor_Control/Monitor_Group.cpp
new file mode 100644
index 00000000000..1d6a497654a
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Group.cpp
@@ -0,0 +1,67 @@
+// $Id: Monitor_Group.cpp 93390 2011-02-15 14:44:58Z johnnyw $
+
+#include "ace/Monitor_Control/Monitor_Group.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Monitor_Group::Monitor_Group (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_GROUP)
+ {}
+
+ void
+ Monitor_Group::add_member (Monitor_Base* member)
+ {
+ this->members_.enqueue_tail (member);
+ }
+
+ void
+ Monitor_Group::update (void)
+ {
+ for (MEMBERS_ITERATOR i (this->members_); !i.done (); i.advance ())
+ {
+ Monitor_Base **member;
+ i.next (member);
+ (*member)->update ();
+ }
+ }
+
+ void
+ Monitor_Group::receive (double /* data */)
+ {
+ /// No-op, should always call update().
+ }
+
+ void
+ Monitor_Group::receive (size_t /* data */)
+ {
+ /// No-op, should always call update().
+ }
+
+ void
+ Monitor_Group::receive (const Monitor_Control_Types::NameList& /* data */)
+ {
+ /// No-op, should always call update().
+ }
+
+ void
+ Monitor_Group::clear (void)
+ {
+ for (MEMBERS_ITERATOR i (this->members_); !i.done (); i.advance ())
+ {
+ Monitor_Base **member = 0;
+ i.next (member);
+ (*member)->clear ();
+ }
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Group.h b/dep/acelite/ace/Monitor_Control/Monitor_Group.h
new file mode 100644
index 00000000000..99eb7d6753e
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Group.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Monitor_Group.h
+ *
+ * $Id: Monitor_Group.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef MONITOR_GROUP_H
+#define MONITOR_GROUP_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Monitor_Group
+ *
+ * @brief Updates and/or clears a group of monitors with a single call.
+ */
+ class MONITOR_CONTROL_Export Monitor_Group : public Monitor_Base
+ {
+ public:
+ Monitor_Group (const char* name);
+
+ void add_member (Monitor_Base* member);
+
+ virtual void update (void);
+
+ /// These are overridden to be no-ops.
+ virtual void receive (double data);
+ virtual void receive (size_t data);
+ virtual void receive (const Monitor_Control_Types::NameList& data);
+
+ virtual void clear (void);
+
+ private:
+ typedef ACE_Unbounded_Queue<Monitor_Base *>
+ MEMBERS;
+ typedef ACE_Unbounded_Queue_Const_Iterator<Monitor_Base *>
+ MEMBERS_ITERATOR;
+
+ MEMBERS members_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // MONITOR_GROUP_H
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Query.cpp b/dep/acelite/ace/Monitor_Control/Monitor_Query.cpp
new file mode 100644
index 00000000000..f37b3290f24
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Query.cpp
@@ -0,0 +1,82 @@
+// $Id: Monitor_Query.cpp 86518 2009-08-18 12:30:56Z olli $
+
+#include "ace/Monitor_Point_Registry.h"
+#include "ace/Monitor_Base.h"
+#include "ace/Monitor_Control_Action.h"
+
+#include "ace/Monitor_Control/Monitor_Query.h"
+#include "ace/Monitor_Control/Constraint_Interpreter.h"
+#include "ace/Monitor_Control/Constraint_Visitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ int
+ Monitor_Point_Auto_Query::handle_timeout (
+ const ACE_Time_Value& /* current */,
+ const void* monitor_query)
+ {
+ const Monitor_Query* const_mq =
+ reinterpret_cast<const Monitor_Query*> (monitor_query);
+
+ Monitor_Query* mq = const_cast<Monitor_Query*> (const_mq);
+
+ mq->query ();
+
+ return 0;
+ }
+
+ //=========================================================
+
+ Monitor_Query::Monitor_Query (const char* monitor_name)
+ : monitor_ (0)
+ {
+ ACE_CString name_str (monitor_name, 0, false);
+ this->monitor_ = Monitor_Point_Registry::instance ()->get (name_str);
+
+ if (this->monitor_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Monitor_Query - monitor lookup failed\n"));
+ }
+ }
+
+ void
+ Monitor_Query::query (void)
+ {
+ if (this->monitor_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Monitor_Query::query - null monitor\n"));
+ return;
+ }
+
+ Monitor_Base::CONSTRAINTS& list = this->monitor_->constraints ();
+
+ for (Monitor_Base::CONSTRAINT_ITERATOR i (list.begin ());
+ i != list.end ();
+ ++i)
+ {
+ Constraint_Interpreter interpreter;
+ interpreter.build_tree (i->second.expr.fast_rep ());
+
+ Monitor_Control_Types::Data data (this->monitor_->type ());
+ this->monitor_->retrieve (data);
+ Constraint_Visitor visitor (data);
+ bool satisfied = interpreter.evaluate (visitor);
+
+ if (satisfied && i->second.control_action != 0)
+ {
+ i->second.control_action->execute ();
+ }
+ }
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Monitor_Query.h b/dep/acelite/ace/Monitor_Control/Monitor_Query.h
new file mode 100644
index 00000000000..4f841bee372
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Monitor_Query.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Monitor_Query.h
+ *
+ * $Id: Monitor_Query.h 81753 2008-05-21 19:02:47Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef MONITOR_QUERY_H
+#define MONITOR_QUERY_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Event_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Monitor_Point_Auto_Query
+ *
+ * @brief Automates periodic querying of monitor point classes.
+ *
+ */
+ class MONITOR_CONTROL_Export Monitor_Point_Auto_Query
+ : public ACE_Event_Handler
+ {
+ public:
+ /// Override of ACE base class method.
+ virtual int handle_timeout (const ACE_Time_Value& current,
+ const void* monitor_query);
+ };
+
+ /**
+ * @class Monitor_Query
+ *
+ * @brief Handles queries for a specific monitor point, and
+ * evaluates its constraint(s) with each query.
+ *
+ */
+ class MONITOR_CONTROL_Export Monitor_Query
+ {
+ public:
+ Monitor_Query (const char* monitor_name);
+
+ void query (void);
+
+ private:
+ Monitor_Base* monitor_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // MONITOR_QUERY_H
diff --git a/dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.cpp
new file mode 100644
index 00000000000..6c902514086
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.cpp
@@ -0,0 +1,30 @@
+// $Id: Null_Network_Interface_Monitor.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#include "ace/Monitor_Control/Null_Network_Interface_Monitor.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Null_Network_Interface_Monitor::Null_Network_Interface_Monitor (void)
+ : value_ (0UL)
+ {
+ }
+
+ void
+ Null_Network_Interface_Monitor::update_i (void)
+ {
+ /// No-op.
+ }
+
+ void
+ Null_Network_Interface_Monitor::clear_impl (void)
+ {
+ /// No-op.
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.h b/dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.h
new file mode 100644
index 00000000000..9fa24196966
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Null_Network_Interface_Monitor.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Null_Network_Interface_Monitor.h
+ *
+ * $Id: Null_Network_Interface_Monitor.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef NULL_NETWORK_INTERFACE_MONITOR_H
+#define NULL_NETWORK_INTERFACE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Basic_Types.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Null_Network_Interface_Monitor
+ *
+ * @brief Mixin class for network interface monitors compiled on
+ * platforms without any native OS monitor support, or on
+ a platform with such support when the platform-specific
+ OS monitor flag is not set.
+ */
+ class MONITOR_CONTROL_Export Null_Network_Interface_Monitor
+ {
+ protected:
+ Null_Network_Interface_Monitor (void);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ ACE_UINT64 value_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // NULL_NETWORK_INTERFACE_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.cpp
new file mode 100644
index 00000000000..8d21e7e45a5
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.cpp
@@ -0,0 +1,96 @@
+// $Id: Num_Threads_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/Num_Threads_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_LINUX)
+#include "ace/OS_NS_stdio.h"
+#endif
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* Num_Threads_Monitor::default_name_ =
+ "OS/System/NumThreads";
+
+ Num_Threads_Monitor::Num_Threads_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Monitor (ACE_TEXT ("\\System\\Threads"))
+#elif defined (ACE_LINUX)
+ , file_ptr_ (0)
+ , nthreads_ (0UL)
+#endif
+ {
+ }
+
+ void
+ Num_Threads_Monitor::update (void)
+ {
+#if defined (ACE_HAS_WIN32_PDH)
+ this->update_i ();
+ this->receive (this->value_);
+#elif defined (ACE_LINUX)
+ this->file_ptr_ = ACE_OS::fopen (ACE_TEXT ("/proc/self/status"),
+ ACE_TEXT ("r"));
+
+ if (this->file_ptr_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Num threads - opening ")
+ ACE_TEXT ("/proc/self/status failed\n")));
+ return;
+ }
+
+ char *item = 0;
+ char *arg = 0;
+
+ while ((ACE_OS::fgets (buf_, sizeof (buf_), file_ptr_)) != 0)
+ {
+ item = ACE_OS::strtok (this->buf_, " \t\n");
+ arg = ACE_OS::strtok (0, "\n");
+
+ if (item == 0 || arg == 0)
+ {
+ continue;
+ }
+
+ if (ACE_OS::strcmp (item, "Threads:") == 0)
+ {
+ sscanf (arg, "%lu", &this->nthreads_);
+ break;
+ }
+ }
+
+ /// Stores value and timestamp with thread-safety.
+ this->receive (static_cast<double> (this->nthreads_));
+
+ ACE_OS::fclose (this->file_ptr_);
+#endif
+ }
+
+ const char*
+ Num_Threads_Monitor::default_name (void)
+ {
+ return Num_Threads_Monitor::default_name_;
+ }
+
+ void
+ Num_Threads_Monitor::clear_i (void)
+ {
+#if defined (ACE_HAS_WIN32_PDH)
+ this->clear_impl ();
+#endif
+
+ this->Monitor_Base::clear_i ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.h b/dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.h
new file mode 100644
index 00000000000..094df0b47e7
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Num_Threads_Monitor.h
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Num_Threads_Monitor.h
+ *
+ * $Id: Num_Threads_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef NUM_THREADS_MONITOR_H
+#define NUM_THREADS_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Monitor.h"
+#elif defined (ACE_HAS_KSTAT)
+/// There is apparently no way to query the number of threads on the
+/// Solaris platform. The only benchmark I've seen had to put hooks
+/// in the thread creation functions to keep track of the highest
+/// thread ID, then check all the IDs less than that to see if the
+/// threads still exist. Since we don't have that option in this
+/// framework, which is to be used by existing applications, this
+/// particular OS monitor is left unimplemented on Solaris.
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Num_Threads_Monitor
+ *
+ * @brief Monitor total number of threads in the system.
+ */
+ class MONITOR_CONTROL_Export Num_Threads_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Monitor
+#endif
+ {
+ public:
+ Num_Threads_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ private:
+ static const char* default_name_;
+
+#if defined (ACE_LINUX)
+ FILE *file_ptr_;
+ char buf_[1024];
+ unsigned long nthreads_;
+#endif
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // NUM_THREADS_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.cpp
new file mode 100644
index 00000000000..960f32bda2e
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.cpp
@@ -0,0 +1,60 @@
+// $Id: Packets_Received_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/Packets_Received_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* Packets_Received_Monitor::default_name_ =
+ "OS/Network/PacketsReceived";
+
+ Packets_Received_Monitor::Packets_Received_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Multi_Instance_Monitor (
+ ACE_TEXT ("\\Network Interface(*)\\Packets Received/sec"))
+#elif defined (ACE_LINUX) || defined (AIX)
+ , Linux_Network_Interface_Monitor (
+ " %*[^:]: %*u %lu %*u %*u %*u %*u %*u %*u %*u %*u")
+ /// Scan format for /proc/net/dev
+#elif defined (ACE_HAS_KSTAT)
+ , Solaris_Network_Interface_Monitor (ACE_TEXT ("ipackets"))
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , FreeBSD_Network_Interface_Monitor (ACE_TEXT ("ipackets"))
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , BSD_Network_Interface_Monitor (ACE_TEXT ("ipackets"))
+#endif
+ {}
+
+ void
+ Packets_Received_Monitor::update (void)
+ {
+ this->update_i ();
+
+ /// On some platforms, value_ is an ACE_UINT64.
+ this->receive (static_cast<double> (this->value_));
+ }
+
+ const char*
+ Packets_Received_Monitor::default_name (void)
+ {
+ return Packets_Received_Monitor::default_name_;
+ }
+
+ void
+ Packets_Received_Monitor::clear_i (void)
+ {
+ this->clear_impl ();
+ this->Monitor_Base::clear_i ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.h b/dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.h
new file mode 100644
index 00000000000..64aeef971a0
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Packets_Received_Monitor.h
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Packets_Received_Monitor.h
+ *
+ * $Id: Packets_Received_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef PACKETS_RECEIVED_MONITOR_H
+#define PACKETS_RECEIVED_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Multi_Instance_Monitor.h"
+#elif defined (ACE_LINUX) || defined (AIX)
+#include "ace/Monitor_Control/Linux_Network_Interface_Monitor.h"
+#elif defined (ACE_HAS_KSTAT)
+#include "ace/Monitor_Control/Solaris_Network_Interface_Monitor.h"
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+#include "ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h"
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+#include "ace/Monitor_Control/BSD_Network_Interface_Monitor.h"
+#else
+#include "ace/Monitor_Control/Null_Network_Interface_Monitor.h"
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Packets_Received_Monitor
+ *
+ * @brief Monitors total packets received over all network interfaces.
+ */
+ class MONITOR_CONTROL_Export Packets_Received_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Multi_Instance_Monitor
+#elif defined (ACE_LINUX) || defined (AIX)
+ , public Linux_Network_Interface_Monitor
+#elif defined (ACE_HAS_KSTAT)
+ , public Solaris_Network_Interface_Monitor
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , public BSD_Network_Interface_Monitor
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , public FreeBSD_Network_Interface_Monitor
+#else
+ , public Null_Network_Interface_Monitor
+#endif
+ {
+ public:
+ Packets_Received_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ private:
+ static const char* default_name_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // PACKETS_RECEIVED_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.cpp
new file mode 100644
index 00000000000..0e6ead400ad
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.cpp
@@ -0,0 +1,60 @@
+// $Id: Packets_Sent_Monitor.cpp 95533 2012-02-14 22:59:17Z wotte $
+
+#include "ace/Monitor_Control/Packets_Sent_Monitor.h"
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ const char* Packets_Sent_Monitor::default_name_ =
+ "OS/Network/PacketsSent";
+
+ Packets_Sent_Monitor::Packets_Sent_Monitor (const char* name)
+ : Monitor_Base (name, Monitor_Control_Types::MC_NUMBER)
+#if defined (ACE_HAS_WIN32_PDH)
+ , Windows_Multi_Instance_Monitor (
+ ACE_TEXT ("\\Network Interface(*)\\Packets Sent/sec"))
+#elif defined (ACE_LINUX) || defined (AIX)
+ , Linux_Network_Interface_Monitor (
+ " %*[^:]: %*u %*u %*u %*u %*u %*u %*u %*u %*u %lu")
+ /// Scan format for /proc/net/dev
+#elif defined (ACE_HAS_KSTAT)
+ , Solaris_Network_Interface_Monitor (ACE_TEXT ("opackets"))
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , BSD_Network_Interface_Monitor (ACE_TEXT ("opackets"))
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , FreeBSD_Network_Interface_Monitor (ACE_TEXT ("opackets"))
+#endif
+ {}
+
+ void
+ Packets_Sent_Monitor::update (void)
+ {
+ this->update_i ();
+
+ /// On some platforms, value_ is an ACE_UINT64.
+ this->receive (static_cast<double> (this->value_));
+ }
+
+ const char*
+ Packets_Sent_Monitor::default_name (void)
+ {
+ return Packets_Sent_Monitor::default_name_;
+ }
+
+ void
+ Packets_Sent_Monitor::clear_i (void)
+ {
+ this->clear_impl ();
+ this->Monitor_Base::clear_i ();
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
diff --git a/dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.h b/dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.h
new file mode 100644
index 00000000000..bccea8f896e
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Packets_Sent_Monitor.h
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Packets_Sent_Monitor.h
+ *
+ * $Id: Packets_Sent_Monitor.h 95533 2012-02-14 22:59:17Z wotte $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef PACKETS_SENT_MONITOR_H
+#define PACKETS_SENT_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Monitor_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
+
+#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
+#include "ace/Monitor_Control/Windows_Multi_Instance_Monitor.h"
+#elif defined (ACE_LINUX) || defined (AIX)
+#include "ace/Monitor_Control/Linux_Network_Interface_Monitor.h"
+#elif defined (ACE_HAS_KSTAT)
+#include "ace/Monitor_Control/Solaris_Network_Interface_Monitor.h"
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+#include "ace/Monitor_Control/FreeBSD_Network_Interface_Monitor.h"
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+#include "ace/Monitor_Control/BSD_Network_Interface_Monitor.h"
+#else
+#include "ace/Monitor_Control/Null_Network_Interface_Monitor.h"
+#endif
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Packets_Sent_Monitor
+ *
+ * @brief Monitors total packets sent over all network interfaces.
+ */
+ class MONITOR_CONTROL_Export Packets_Sent_Monitor
+ : public Monitor_Base
+#if defined (ACE_HAS_WIN32_PDH)
+ , public Windows_Multi_Instance_Monitor
+#elif defined (ACE_LINUX) || defined (AIX)
+ , public Linux_Network_Interface_Monitor
+#elif defined (ACE_HAS_KSTAT)
+ , public Solaris_Network_Interface_Monitor
+#elif defined (__NetBSD__) || defined (__OpenBSD__)
+ , public BSD_Network_Interface_Monitor
+#elif defined (__FreeBSD__) || defined (__Lynx__)
+ , public FreeBSD_Network_Interface_Monitor
+#else
+ , public Null_Network_Interface_Monitor
+#endif
+ {
+ public:
+ Packets_Sent_Monitor (const char* name);
+
+ /// Implementation of the pure virtual method.
+ virtual void update (void);
+
+ /// Stores the default name, used if none is supplied by the user.
+ static const char* default_name (void);
+
+ private:
+ /// Overridden reset, calls platform-specific reset.
+ virtual void clear_i (void);
+
+ private:
+ static const char* default_name_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
+
+#include /**/ "ace/post.h"
+
+#endif // PACKETS_SENT_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.cpp
new file mode 100644
index 00000000000..63ec6b74739
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.cpp
@@ -0,0 +1,223 @@
+// $Id: Solaris_Network_Interface_Monitor.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#include "ace/Monitor_Control/Solaris_Network_Interface_Monitor.h"
+
+#if defined (ACE_HAS_KSTAT)
+
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Solaris_Network_Interface_Monitor::Solaris_Network_Interface_Monitor (
+ const ACE_TCHAR *lookup_str)
+ : value_ (0UL),
+ start_ (0UL),
+ lookup_str_ (lookup_str)
+ {
+ this->init ();
+ }
+
+ void
+ Solaris_Network_Interface_Monitor::update_i (void)
+ {
+ this->access_kstats (this->value_);
+ this->value_ -= this->start_;
+ }
+
+ void
+ Solaris_Network_Interface_Monitor::clear_impl (void)
+ {
+ this->init ();
+ }
+
+ void
+ Solaris_Network_Interface_Monitor::init (void)
+ {
+ unsigned long i;
+
+ for (i = 0UL; i < MAX_LO_INTERFACES; ++i)
+ {
+ this->value_array_lo_[i] = 0UL;
+ }
+
+ for (i = 0UL; i < MAX_HME_INTERFACES; ++i)
+ {
+ this->value_array_hme_[i] = 0UL;
+ }
+
+ this->access_kstats (this->start_);
+ }
+
+ void
+ Solaris_Network_Interface_Monitor::access_kstats (
+ ACE_UINT64 &which_member)
+ {
+ this->kstats_ = kstat_open ();
+
+ if (this->kstats_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("opening kstats file failed\n")));
+ return;
+ }
+
+ this->kstat_id_ = this->kstats_->kc_chain_id;
+ int status = 0;
+
+ while (true)
+ {
+ /// We have to sum the network interfaces manually.
+ for (this->kstat_ = this->kstats_->kc_chain;
+ this->kstat_ != 0;
+ this->kstat_ = this->kstat_->ks_next)
+ {
+ if (ACE_OS::strcmp (this->kstat_->ks_class, "net") != 0)
+ {
+ continue;
+ }
+
+ unsigned long ks_instance = this->kstat_->ks_instance;
+
+ if (ACE_OS::strcmp (this->kstat_->ks_module, "lo") == 0)
+ {
+ /// Interfaces 'lo' have only packet counters.
+ if (this->lookup_str_ == ACE_TEXT ("obytes")
+ || this->lookup_str_ == ACE_TEXT ("rbytes"))
+ {
+ continue;
+ }
+
+ status = this->check_ks_module (ks_instance,
+ MAX_LO_INTERFACES,
+ "MAX_LO_INTERFACES",
+ this->value_array_lo_,
+ which_member);
+
+ if (status == -1)
+ {
+ /// Unrecoverable error, diagnostic already output.
+ (void) kstat_close (this->kstats_);
+ return;
+ }
+ else if (status == 1)
+ {
+ /// The kstat_id changed underneath us, start over.
+ break;
+ }
+ }
+ else if (ACE_OS::strcmp (this->kstat_->ks_module, "hme") == 0
+ || ACE_OS::strcmp (this->kstat_->ks_module, "bge") == 0)
+ {
+ status = this->check_ks_module (ks_instance,
+ MAX_HME_INTERFACES,
+ "MAX_HME_INTERFACES",
+ this->value_array_hme_,
+ which_member);
+
+ if (status == -1)
+ {
+ /// Unrecoverable error, diagnostic already output.
+ (void) kstat_close (this->kstats_);
+ return;
+ }
+ else if (status == 1)
+ {
+ /// The kstat_id changed underneath us, start over.
+ break;
+ }
+ }
+ }
+
+ if (this->kstat_)
+ {
+ this->kstat_id_ = kstat_chain_update (this->kstats_);
+
+ if (! this->kstat_id_ > 0)
+ {
+ ACE_ERROR ((LM_ERROR, "kstat is is not > 0.\n"));
+ break;
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ status = kstat_close (this->kstats_);
+
+ if (status != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("closing kstats file failed\n")));
+ }
+ }
+
+ int
+ Solaris_Network_Interface_Monitor::check_ks_module (
+ const unsigned long ks_instance,
+ const unsigned long which_max,
+ const char *max_str,
+ ACE_UINT64 *value_array,
+ ACE_UINT64 &which_member)
+ {
+ if (! (ks_instance < which_max))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s exceeded.\n",
+ max_str),
+ -1);
+ }
+
+ /// Because the kstat chain can change dynamically,
+ /// watch the chain ID and restart the walk if the ID
+ /// differs from what we saw during the walk. The restart
+ /// is done by breaking from the cycle with kstat_ not 0.
+
+ kid_t kstat_id =
+ kstat_read (this->kstats_, this->kstat_, 0);
+
+ if (kstat_id != this->kstat_id_)
+ {
+ /// This return value restarts the walk as described above.
+ return 1;
+ }
+
+ kstat_named_t *value =
+ (kstat_named_t *) kstat_data_lookup (
+ this->kstat_,
+ ACE_TEXT_ALWAYS_CHAR (this->lookup_str_.rep ()));
+
+ if (value == 0)
+ {
+ /// Just return and let the calling FOR loop advance.
+ return 0;
+ }
+
+ if (value->data_type != KSTAT_DATA_UINT32)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Wrong data type.\n"),
+ -1);
+ }
+
+ /// Guard against overflow.
+ value_array[ks_instance] +=
+ value->value.ui32
+ - static_cast<ACE_UINT32> (value_array[ks_instance]);
+
+ which_member += value_array[ks_instance];
+
+ return 0;
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_HAS_KSTAT) */
diff --git a/dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.h b/dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.h
new file mode 100644
index 00000000000..98ce5a67d2c
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Solaris_Network_Interface_Monitor.h
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Solaris_Network_Interface_Monitor.h
+ *
+ * $Id: Solaris_Network_Interface_Monitor.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef SOLARIS_NETWORK_INTERFACE_MONITOR_H
+#define SOLARIS_NETWORK_INTERFACE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+#if defined (ACE_HAS_KSTAT)
+
+#include "ace/os_include/os_kstat.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Solaris_Network_Interface_Monitor
+ *
+ * @brief Mixin class for network interface monitors compiled on
+ * Solaris machines.
+ */
+ class MONITOR_CONTROL_Export Solaris_Network_Interface_Monitor
+ {
+ protected:
+ /// The kstat interface can access a wealth of
+ /// network information about the system. To get the specific
+ /// value we want to monitor, we just vary the lookup string.
+ Solaris_Network_Interface_Monitor (const ACE_TCHAR *lookup_str);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ ACE_UINT64 value_;
+
+ private:
+ /// Common code.
+
+ void init (void);
+ void access_kstats (ACE_UINT64 &which_member);
+ int check_ks_module (const unsigned long ks_instance,
+ const unsigned long which_max,
+ const char *max_str,
+ ACE_UINT64 *value_array,
+ ACE_UINT64 &which_member);
+
+
+ private:
+ static const unsigned long MAX_LO_INTERFACES = 5UL;
+ static const unsigned long MAX_HME_INTERFACES = 10UL;
+ ACE_UINT64 value_array_lo_[MAX_LO_INTERFACES];
+ ACE_UINT64 value_array_hme_[MAX_HME_INTERFACES];
+ ACE_UINT64 start_;
+ ACE_TString lookup_str_;
+ kstat_ctl_t *kstats_;
+ kstat_t *kstat_;
+ kid_t kstat_id_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_HAS_KSTAT) */
+
+#include /**/ "ace/post.h"
+
+#endif // SOLARIS_NETWORK_INTERFACE_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Windows_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Windows_Monitor.cpp
new file mode 100644
index 00000000000..a3883ece639
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Windows_Monitor.cpp
@@ -0,0 +1,76 @@
+// $Id: Windows_Monitor.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#include "ace/Monitor_Control/Windows_Monitor.h"
+
+#if defined (ACE_HAS_WIN32_PDH)
+
+#include "ace/Log_Msg.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Windows_Monitor::Windows_Monitor (const ACE_TCHAR *path)
+ : value_ (0.0)
+ , path_ (path)
+ , query_ (0)
+ , counter_ (0)
+ , status_ (ERROR_SUCCESS)
+ {
+ this->init ();
+ }
+
+ void
+ Windows_Monitor::update_i (void)
+ {
+ PdhCollectQueryData (this->query_);
+ PDH_FMT_COUNTERVALUE pdh_value;
+
+ PdhGetFormattedCounterValue (this->counter_,
+ PDH_FMT_DOUBLE,
+ 0,
+ &pdh_value);
+
+ this->value_ = pdh_value.doubleValue;
+ }
+
+ void
+ Windows_Monitor::clear_impl (void)
+ {
+ this->init ();
+ }
+
+ void
+ Windows_Monitor::init (void)
+ {
+ /// Create a query and a counter here so it doesn't have
+ /// to be done with each update.
+
+ this->status_ = ACE_TEXT_PdhOpenQuery (0, 0, &this->query_);
+
+ if (ERROR_SUCCESS != this->status_)
+ {
+ ACE_ERROR ((LM_DEBUG, ACE_TEXT ("PdhOpenQuery failed\n")));
+ }
+
+ this->status_ =
+ ACE_TEXT_PdhAddCounter (this->query_,
+ this->path_.c_str (),
+ 0,
+ &this->counter_);
+
+ if (ERROR_SUCCESS != this->status_)
+ {
+ ACE_ERROR ((LM_DEBUG,
+ ACE_TEXT ("PdhAddCounter %s failed\n"),
+ this->path_.c_str ()));
+ }
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_HAS_WIN32_PDH) */
diff --git a/dep/acelite/ace/Monitor_Control/Windows_Monitor.h b/dep/acelite/ace/Monitor_Control/Windows_Monitor.h
new file mode 100644
index 00000000000..cd39d81fedf
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Windows_Monitor.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Windows_Monitor.h
+ *
+ * $Id: Windows_Monitor.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef WINDOWS_MONITOR_H
+#define WINDOWS_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/os_include/os_pdh.h"
+
+#include "ace/Monitor_Control/Monitor_Control_export.h"
+
+#if defined (ACE_HAS_WIN32_PDH)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Windows_Monitor
+ *
+ * @brief Mixin class for concrete monitors compiled on Windows machines.
+ */
+ class MONITOR_CONTROL_Export Windows_Monitor
+ {
+ friend class Windows_Multi_Instance_Monitor;
+
+ protected:
+ Windows_Monitor (const ACE_TCHAR *path);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ double value_;
+
+ private:
+ /// Code common to constructor and clear_impl().
+ void init (void);
+
+ /// Make these persistent as members so they don't have to be
+ /// created & destroyed with each update.
+ private:
+ ACE_TString path_;
+ HQUERY query_;
+ HCOUNTER counter_;
+ PDH_STATUS status_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* defined (ACE_HAS_WIN32_PDH) */
+
+#endif // WINDOWS_MONITOR_H
diff --git a/dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.cpp b/dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.cpp
new file mode 100644
index 00000000000..c5492640981
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.cpp
@@ -0,0 +1,110 @@
+// $Id: Windows_Multi_Instance_Monitor.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+
+#include "ace/Monitor_Control/Windows_Multi_Instance_Monitor.h"
+
+#if defined (ACE_HAS_WIN32_PDH)
+
+#include "ace/Log_Msg.h"
+#include "ace/SString.h"
+#include "ace/os_include/os_pdhmsg.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ Windows_Multi_Instance_Monitor::Windows_Multi_Instance_Monitor (
+ const ACE_TCHAR *wildcard_path)
+ : value_ (0.0)
+ , instances_ (0)
+ , n_instances_ (0)
+ , status_ (ERROR_SUCCESS)
+ {
+ /// Create a string which is a concatentation of the path
+ /// name of each 'instance' we need to monitor.
+
+ DWORD paths_size = 4096;
+ ACE_LPSTR paths = (ACE_LPSTR) GlobalAlloc (GPTR, paths_size);
+
+ this->status_ = ACE_TEXT_PdhExpandCounterPath (wildcard_path,
+ paths,
+ &paths_size);
+
+ if (PDH_MORE_DATA == static_cast<DWORD> (this->status_))
+ {
+ ++paths_size;
+ GlobalFree (paths);
+ paths = (ACE_LPSTR) GlobalAlloc (GPTR, paths_size);
+
+ this->status_ = ACE_TEXT_PdhExpandCounterPath (wildcard_path,
+ paths,
+ &paths_size);
+ }
+
+ if (PDH_CSTATUS_VALID_DATA != static_cast<DWORD> (this->status_))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%s: PdhExpandCounterPath failed\n"),
+ wildcard_path));
+ }
+
+ ACE_LPSTR path = paths;
+
+ /// Create a regular Windows monitor for each path name.
+ while (*path != 0)
+ {
+ Windows_Monitor *instance = new Windows_Monitor (path);
+ this->instances_.enqueue_tail (instance);
+ path += ACE_OS::strlen (path) + 1;
+ }
+
+ GlobalFree (paths);
+ }
+
+ Windows_Multi_Instance_Monitor::~Windows_Multi_Instance_Monitor (void)
+ {
+ Windows_Monitor *instance = 0;
+
+ /// Destroy the single instance monitors created in the constructor.
+ while (this->instances_.dequeue_head (instance) == 0)
+ {
+ delete instance;
+ }
+ }
+
+ void
+ Windows_Multi_Instance_Monitor::update_i (void)
+ {
+ Windows_Monitor **current_instance = 0;
+
+ /// Sum the values of each single instance monitor.
+ for (INSTANCES_ITERATOR i (this->instances_); !i.done (); i.advance ())
+ {
+ i.next (current_instance);
+
+ (*current_instance)->update_i ();
+
+ this->value_ += (*current_instance)->value_;
+ }
+ }
+
+ void
+ Windows_Multi_Instance_Monitor::clear_impl (void)
+ {
+ Windows_Monitor **current_instance = 0;
+
+ /// Sum the values of each single instance monitor.
+ for (INSTANCES_ITERATOR i (this->instances_); !i.done (); i.advance ())
+ {
+ i.next (current_instance);
+
+ (*current_instance)->clear_impl ();
+ }
+ }
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_HAS_WIN32_PDH) */
diff --git a/dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.h b/dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.h
new file mode 100644
index 00000000000..ec4e17a4a41
--- /dev/null
+++ b/dep/acelite/ace/Monitor_Control/Windows_Multi_Instance_Monitor.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Windows_Multi_Instance_Monitor.h
+ *
+ * $Id: Windows_Multi_Instance_Monitor.h 82115 2008-06-20 20:43:13Z parsons $
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef WINDOWS_MULTI_INSTANCE_MONITOR_H
+#define WINDOWS_MULTI_INSTANCE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Unbounded_Queue.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Monitor_Control/Windows_Monitor.h"
+
+#if defined (ACE_HAS_WIN32_PDH)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE
+{
+ namespace Monitor_Control
+ {
+ /**
+ * @class Windows_Multi_Instance_Monitor
+ *
+ * @brief Mixin class for concrete monitors compiled on Windows machines
+ * where the Performance Data Helper object of interest has more
+ * than once instance, for example multiple CPUs or network cards.
+ */
+ class MONITOR_CONTROL_Export Windows_Multi_Instance_Monitor
+ {
+ protected:
+ Windows_Multi_Instance_Monitor (const ACE_TCHAR *wildcard_path);
+ virtual ~Windows_Multi_Instance_Monitor (void);
+
+ /// Platform-specific implementation.
+ void update_i (void);
+
+ /// Platform-specific reset.
+ void clear_impl (void);
+
+ protected:
+ double value_;
+
+ private:
+ typedef ACE_Unbounded_Queue<Windows_Monitor *>
+ INSTANCES;
+ typedef ACE_Unbounded_Queue_Const_Iterator<Windows_Monitor *>
+ INSTANCES_ITERATOR;
+
+ INSTANCES instances_;
+ DWORD n_instances_;
+ PDH_STATUS status_;
+ };
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* defined (ACE_HAS_WIN32_PDH) */
+
+#endif // WINDOWS_MULTI_INSTANCE_MONITOR_H
diff --git a/dep/acelite/ace/Monotonic_Time_Policy.cpp b/dep/acelite/ace/Monotonic_Time_Policy.cpp
new file mode 100644
index 00000000000..3965c1bee48
--- /dev/null
+++ b/dep/acelite/ace/Monotonic_Time_Policy.cpp
@@ -0,0 +1,7 @@
+// $Id: Monotonic_Time_Policy.cpp 96061 2012-08-16 09:36:07Z mcorino $
+
+#include "ace/Monotonic_Time_Policy.h"
+
+#if !defined(__ACE_INLINE__)
+# include "ace/Monotonic_Time_Policy.inl"
+#endif /* __ACE_INLINE__ */
diff --git a/dep/acelite/ace/Monotonic_Time_Policy.h b/dep/acelite/ace/Monotonic_Time_Policy.h
new file mode 100644
index 00000000000..a9615c98eb8
--- /dev/null
+++ b/dep/acelite/ace/Monotonic_Time_Policy.h
@@ -0,0 +1,50 @@
+#ifndef ACE_MONOTONIC_TIME_POLICY_H
+#define ACE_MONOTONIC_TIME_POLICY_H
+// -*- C++ -*-
+/**
+ * @file Monotonic_Time_Policy.h
+ *
+ * $Id: Monotonic_Time_Policy.h 96061 2012-08-16 09:36:07Z mcorino $
+ *
+ * @author Martin Corino <mcorino@remedy.nl>
+ */
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#include /**/ "ace/Time_Value_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Monotonic_Time_Policy
+ *
+ * @brief Implement a monotonic time policy for ACE.
+ *
+ * This class implements support for returning monotonic time values
+ * on platforms that support that.
+ * If a platform does not support monotonic time the policy returns
+ * ACE_Time_Value::zero.
+ */
+class ACE_Export ACE_Monotonic_Time_Policy
+{
+public:
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_Monotonic_Time_Policy> operator() () const;
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/Monotonic_Time_Policy.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_MONOTONIC_TIME_POLICY_H */
diff --git a/dep/acelite/ace/Monotonic_Time_Policy.inl b/dep/acelite/ace/Monotonic_Time_Policy.inl
new file mode 100644
index 00000000000..e6f0b3df4f6
--- /dev/null
+++ b/dep/acelite/ace/Monotonic_Time_Policy.inl
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// $Id: Monotonic_Time_Policy.inl 96095 2012-08-23 06:36:25Z johnnyw $
+
+#include "ace/OS_NS_sys_time.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE ACE_Time_Value_T<ACE_Monotonic_Time_Policy>
+ACE_Monotonic_Time_Policy::operator()() const
+{
+# if defined (ACE_WIN32)
+ return ACE_Time_Value_T<ACE_Monotonic_Time_Policy> (ACE_High_Res_Timer::gettimeofday_hr ());
+#elif (defined (_POSIX_MONOTONIC_CLOCK) && !defined (ACE_LACKS_MONOTONIC_TIME)) || defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
+ struct timespec ts;
+
+ if (ACE_OS::clock_gettime (CLOCK_MONOTONIC, &ts) == 0)
+ return ACE_Time_Value_T<ACE_Monotonic_Time_Policy>(ts);
+ else
+ return ACE_Time_Value_T<ACE_Monotonic_Time_Policy> (ACE_Time_Value::zero);
+#else
+ return ACE_Time_Value_T<ACE_Monotonic_Time_Policy> (ACE_Time_Value::zero);
+#endif
+}
+
+ACE_INLINE void
+ACE_Monotonic_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/NT_Service.h b/dep/acelite/ace/NT_Service.h
index 0e1e0a16a84..f602021e418 100644
--- a/dep/acelite/ace/NT_Service.h
+++ b/dep/acelite/ace/NT_Service.h
@@ -4,7 +4,7 @@
/**
* @file NT_Service.h
*
- * $Id: NT_Service.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: NT_Service.h 93117 2011-01-20 12:11:28Z mcorino $
*
* @author Steve Huston <shuston@riverace.com>
*/
@@ -415,7 +415,8 @@ extern VOID WINAPI ace_nt_svc_main_##SVCNAME (DWORD dwArgc, \
ACE_TCHAR **lpszArgv);
#define ACE_NT_SERVICE_ENTRY(SVCDESC, SVCNAME) \
- { SVCDESC, &ace_nt_svc_main_##SVCNAME }
+ { const_cast<ACE_TCHAR*> (SVCDESC), \
+ &ace_nt_svc_main_##SVCNAME }
#define ACE_NT_SERVICE_RUN(SVCNAME, SVCINSTANCE, RET) \
ACE_TEXT_SERVICE_TABLE_ENTRY _ace_nt_svc_table[2] = \
diff --git a/dep/acelite/ace/Name_Request_Reply.cpp b/dep/acelite/ace/Name_Request_Reply.cpp
index 2d57818f97f..40ef90ccb2f 100644
--- a/dep/acelite/ace/Name_Request_Reply.cpp
+++ b/dep/acelite/ace/Name_Request_Reply.cpp
@@ -1,4 +1,4 @@
-// $Id: Name_Request_Reply.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Name_Request_Reply.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/Name_Request_Reply.h"
#include "ace/Basic_Types.h"
@@ -48,7 +48,8 @@ ACE_Name_Request::ACE_Name_Request (
this->block_forever (0);
// Keep track of how long client is willing to wait.
this->transfer_.sec_timeout_ = timeout->sec ();
- this->transfer_.usec_timeout_ = timeout->usec ();
+ this->transfer_.usec_timeout_ =
+ static_cast<ACE_UINT32> (timeout->usec ());
}
// Set up pointers and copy name value and type into request.
@@ -195,7 +196,7 @@ ACE_Name_Request::timeout (const ACE_Time_Value timeout)
{
ACE_TRACE ("ACE_Name_Request::timeout");
this->transfer_.sec_timeout_ = timeout.sec ();
- this->transfer_.usec_timeout_ = timeout.usec ();
+ this->transfer_.usec_timeout_ = static_cast<ACE_UINT32> (timeout.usec ());
}
// = Set/get the name
@@ -270,7 +271,7 @@ ACE_Name_Request::encode (void *&buf)
for (size_t i = 0; i < nv_data_len; i++)
this->transfer_.data_[i] =
- ACE_HTONS (this->transfer_.data_[i]);
+ static_cast<ACE_WCHAR_T> (ACE_HTONS (this->transfer_.data_[i]));
buf = (void *) &this->transfer_;
this->transfer_.block_forever_ = ACE_HTONL (this->transfer_.block_forever_);
@@ -314,7 +315,7 @@ ACE_Name_Request::decode (void)
for (size_t i = 0; i < nv_data_len; i++)
this->transfer_.data_[i] =
- ACE_NTOHS (this->transfer_.data_[i]);
+ static_cast<ACE_WCHAR_T> (ACE_NTOHS (this->transfer_.data_[i]));
this->name_ = this->transfer_.data_;
this->value_ = &this->name_[this->transfer_.name_len_ / sizeof (ACE_WCHAR_T)];
diff --git a/dep/acelite/ace/Name_Space.h b/dep/acelite/ace/Name_Space.h
index 93b57bd9cf9..66396644a29 100644
--- a/dep/acelite/ace/Name_Space.h
+++ b/dep/acelite/ace/Name_Space.h
@@ -4,7 +4,7 @@
/**
* @file Name_Space.h
*
- * $Id: Name_Space.h 84834 2009-03-16 12:28:51Z johnnyw $
+ * $Id: Name_Space.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Prashant Jain <pjain@cse.wustl.edu>
*/
@@ -99,13 +99,13 @@ public:
/**
* Overwrite the value or type of an existing name in a
* ACE_Name_Space or bind a new name to the context, if it didn't
- * exist yet. (Wide charcter strings interface).
+ * exist yet. (Wide character strings interface).
*/
virtual int rebind (const ACE_NS_WString &name_in,
const ACE_NS_WString &value_in,
const char *type_in = "") = 0;
- /// Delete a name from a ACE_Name_Space (Wide charcter strings
+ /// Delete a name from a ACE_Name_Space (Wide character strings
/// Interface).
virtual int unbind (const ACE_NS_WString &name_in) = 0;
diff --git a/dep/acelite/ace/Naming_Context.cpp b/dep/acelite/ace/Naming_Context.cpp
index 4bf312e8ad8..bca3b9b87d9 100644
--- a/dep/acelite/ace/Naming_Context.cpp
+++ b/dep/acelite/ace/Naming_Context.cpp
@@ -1,4 +1,4 @@
-// $Id: Naming_Context.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Naming_Context.cpp 93539 2011-03-13 09:40:44Z vzykov $
#include "ace/Get_Opt.h"
#include "ace/Naming_Context.h"
@@ -626,7 +626,7 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[])
"\t[-b base address]\n"
"\t[-v] (verbose)\n"
"\t[-r] (use Win32 Registry)\n",
- argv[0]);
+ ACE_TEXT_ALWAYS_CHAR (argv[0]));
/* NOTREACHED */
break;
}
diff --git a/dep/acelite/ace/Naming_Context.h b/dep/acelite/ace/Naming_Context.h
index ffc0252eda7..15a20a6bfa2 100644
--- a/dep/acelite/ace/Naming_Context.h
+++ b/dep/acelite/ace/Naming_Context.h
@@ -4,7 +4,7 @@
/**
* @file Naming_Context.h
*
- * $Id: Naming_Context.h 84160 2009-01-14 14:13:58Z johnnyw $
+ * $Id: Naming_Context.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Gerhard Lenzer
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
@@ -126,7 +126,7 @@ public:
/**
* Overwrite the value or type of an existing name in a
* ACE_Naming_Context or bind a new name to the context, if it
- * didn't exist yet. (Wide charcter strings interface).
+ * didn't exist yet. (Wide character strings interface).
*/
int rebind (const ACE_NS_WString &name_in,
const ACE_NS_WString &value_in,
@@ -135,13 +135,13 @@ public:
/**
* Overwrite the value or type of an existing name in a
* ACE_Naming_Context or bind a new name to the context, if it
- * didn't exist yet. ( charcter strings interface)
+ * didn't exist yet. ( character strings interface)
*/
int rebind (const char *name_in,
const char *value_in,
const char *type_in = "");
- /// Delete a name from a ACE_Naming_Context (Wide charcter strings
+ /// Delete a name from a ACE_Naming_Context (Wide character strings
/// Interface).
int unbind (const ACE_NS_WString &name_in);
diff --git a/dep/acelite/ace/Netlink_Addr.h b/dep/acelite/ace/Netlink_Addr.h
index b596068c517..87f0653da99 100644
--- a/dep/acelite/ace/Netlink_Addr.h
+++ b/dep/acelite/ace/Netlink_Addr.h
@@ -1,10 +1,8 @@
-// $Id: Netlink_Addr.h 80826 2008-03-04 14:51:23Z wotte $
-
//=============================================================================
/**
* @file Netlink_Addr.h
*
- * $Id: Netlink_Addr.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Netlink_Addr.h 95425 2012-01-09 11:09:43Z johnnyw $
*
* @author Robert Iakobashvilli <coroberti@gmail.com>
* @author Raz Ben Yehuda <raziebe@gmail.com>
diff --git a/dep/acelite/ace/Notification_Queue.h b/dep/acelite/ace/Notification_Queue.h
index a9ad1ad245b..d312e0cd2c7 100644
--- a/dep/acelite/ace/Notification_Queue.h
+++ b/dep/acelite/ace/Notification_Queue.h
@@ -1,15 +1,16 @@
-#ifndef ACE_NOTIFICATION_QUEUE_H
-#define ACE_NOTIFICATION_QUEUE_H
-
-#include /**/ "ace/pre.h"
-
/**
* @file Notification_Queue.h
*
- * $Id: Notification_Queue.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Notification_Queue.h 95425 2012-01-09 11:09:43Z johnnyw $
*
* @author Carlos O'Ryan <coryan@atdesk.com>
*/
+
+#ifndef ACE_NOTIFICATION_QUEUE_H
+#define ACE_NOTIFICATION_QUEUE_H
+
+#include /**/ "ace/pre.h"
+
#include "ace/Copy_Disabled.h"
#include "ace/Event_Handler.h"
#include "ace/Intrusive_List.h"
diff --git a/dep/acelite/ace/Notification_Queue.inl b/dep/acelite/ace/Notification_Queue.inl
index d3579d272cf..999dd831e87 100644
--- a/dep/acelite/ace/Notification_Queue.inl
+++ b/dep/acelite/ace/Notification_Queue.inl
@@ -1,4 +1,4 @@
-// $Id: Notification_Queue.inl 81315 2008-04-10 07:14:15Z johnnyw $
+// $Id: Notification_Queue.inl 94385 2011-08-10 12:19:36Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -10,29 +10,26 @@ ACE_Notification_Queue_Node()
}
ACE_INLINE void
-ACE_Notification_Queue_Node::
-set(ACE_Notification_Buffer const & rhs)
+ACE_Notification_Queue_Node::set(ACE_Notification_Buffer const & rhs)
{
contents_ = rhs;
}
ACE_INLINE ACE_Notification_Buffer const &
-ACE_Notification_Queue_Node::
-get() const
+ACE_Notification_Queue_Node::get() const
{
return contents_;
}
ACE_INLINE bool
-ACE_Notification_Queue_Node::
-matches_for_purging(ACE_Event_Handler * eh) const
+ACE_Notification_Queue_Node::matches_for_purging(ACE_Event_Handler * eh) const
{
return (0 != get().eh_) && (0 == eh || eh == get().eh_);
}
ACE_INLINE bool
-ACE_Notification_Queue_Node::
-mask_disables_all_notifications(ACE_Reactor_Mask mask)
+ACE_Notification_Queue_Node::mask_disables_all_notifications(
+ ACE_Reactor_Mask mask)
{
// the existing notification mask is left with nothing when applying
// the mask
@@ -40,8 +37,7 @@ mask_disables_all_notifications(ACE_Reactor_Mask mask)
}
ACE_INLINE void
-ACE_Notification_Queue_Node::
-clear_mask(ACE_Reactor_Mask mask)
+ACE_Notification_Queue_Node::clear_mask(ACE_Reactor_Mask mask)
{
ACE_CLR_BITS(contents_.mask_, mask);
}
diff --git a/dep/acelite/ace/Null_Condition.h b/dep/acelite/ace/Null_Condition.h
index 5f6277d1146..9a1e47ec093 100644
--- a/dep/acelite/ace/Null_Condition.h
+++ b/dep/acelite/ace/Null_Condition.h
@@ -4,7 +4,7 @@
/**
* @file Null_Condition.h
*
- * $Id: Null_Condition.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Null_Condition.h 96076 2012-08-18 19:26:00Z johnnyw $
*
* Moved from Synch.h.
*
@@ -17,6 +17,7 @@
#include /**/ "ace/pre.h"
#include "ace/Null_Mutex.h"
+#include "ace/Condition_T.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -27,23 +28,30 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Time_Value;
+class ACE_Condition_Attributes;
+template <class MUTEX> class ACE_Condition;
/**
- * @class ACE_Null_Condition
- *
- * @brief Implement a do nothing ACE_Condition variable wrapper,
- * i.e., all methods are no ops. This class is necessary since
- * some C++ compilers are *very* lame...
+ * @brief ACE_Condition template specialization written using
+ * ACE_Null_Mutexes. Implements a do nothing ACE_Condition
+ * specialization, i.e., all methods are no ops.
*/
-class ACE_Null_Condition
+template <>
+class ACE_Condition<ACE_Null_Mutex>
{
public:
- ACE_Null_Condition (const ACE_Null_Mutex &m,
- const ACE_TCHAR * = 0,
- void * = 0)
+ ACE_Condition (const ACE_Null_Mutex &m,
+ const ACE_TCHAR * = 0,
+ void * = 0)
: mutex_ ((ACE_Null_Mutex &) m) {}
- ~ACE_Null_Condition (void) {}
+ ACE_Condition (const ACE_Null_Mutex &m,
+ const ACE_Condition_Attributes &,
+ const ACE_TCHAR * = 0,
+ void * = 0)
+ : mutex_ ((ACE_Null_Mutex &) m) {}
+
+ ~ACE_Condition (void) {}
/// Returns 0.
int remove (void) {return 0;}
@@ -73,10 +81,12 @@ protected:
private:
// = Prevent assignment and initialization.
- void operator= (const ACE_Null_Condition &);
- ACE_Null_Condition (const ACE_Null_Condition &);
+ void operator= (const ACE_Condition<ACE_Null_Mutex> &);
+ ACE_Condition (const ACE_Condition<ACE_Null_Mutex> &);
};
+typedef ACE_Condition<ACE_Null_Mutex> ACE_Null_Condition;
+
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
diff --git a/dep/acelite/ace/Numeric_Limits.h b/dep/acelite/ace/Numeric_Limits.h
index 0a1d5f2e8c3..c8ab7c2ff7b 100644
--- a/dep/acelite/ace/Numeric_Limits.h
+++ b/dep/acelite/ace/Numeric_Limits.h
@@ -4,7 +4,7 @@
/**
* @file Numeric_Limits.h
*
- * $Id: Numeric_Limits.h 85057 2009-04-08 10:59:58Z msmit $
+ * $Id: Numeric_Limits.h 95761 2012-05-15 18:23:04Z johnnyw $
*
* Traits containing basic integer limits. Useful for template-based
* code on platforms that lack @c std::numeric_limits<>.
@@ -44,7 +44,7 @@
//
// Ideally, we could prevent those macros from being defined by
// defining the Windows-specific NOMINMAX symbol before any Windows
-// headers are included, preferrably on the command line. However,
+// headers are included, preferably on the command line. However,
// that would probably break some applications.
//
// @@ Why isn't this a problem with MSVC++ and Borland builds?
@@ -52,11 +52,6 @@
# undef max
# endif /* __MINGW32__ */
-# if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-// For ACE_U_LongLong.
-# include "ace/Basic_Types.h"
-# endif /* ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */
-
# include <limits>
#endif /* ACE_LACKS_NUMERIC_LIMITS */
@@ -112,34 +107,32 @@ struct ACE_Export ACE_Numeric_Limits<signed long>
static signed long max (void) { return LONG_MAX; }
};
-// #ifndef ACE_LACKS_LONGLONG_T
-// template<>
-// struct ACE_Export ACE_Numeric_Limits<signed long long>
-// {
-// #if defined (LLONG_MIN)
-// # define ACE_LLONG_MIN LLONG_MIN
-// #elif defined (LONG_LONG_MIN)
-// # define ACE_LLONG_MIN LONG_LONG_MIN
-// #elif defined (LONGLONG_MIN)
-// # define ACE_LLONG_MIN LONGLONG_MIN
-// #else
-// # error Unable to determine minimum signed long long value.
-// #endif /* LLONG_MIN */
-
-// #if defined (LLONG_MAX)
-// # define ACE_LLONG_MAX LLONG_MAX
-// #elif defined (LONG_LONG_MAX)
-// # define ACE_LLONG_MAX LONG_LONG_MAX
-// #elif defined (LONGLONG_MAX)
-// # define ACE_LLONG_MAX LONGLONG_MAX
-// #else
-// # error Unable to determine maximum signed long long value.
-// #endif /* LLONG_MAX */
-
-// static signed long long min (void) { return ACE_LLONG_MIN; }
-// static signed long long max (void) { return ACE_LLONG_MAX; }
-// };
-// #endif /* !ACE_LACKS_LONGLONG_T */
+template<>
+struct ACE_Export ACE_Numeric_Limits<signed long long>
+{
+#if defined (LLONG_MIN)
+# define ACE_LLONG_MIN LLONG_MIN
+#elif defined (LONG_LONG_MIN)
+# define ACE_LLONG_MIN LONG_LONG_MIN
+#elif defined (LONGLONG_MIN)
+# define ACE_LLONG_MIN LONGLONG_MIN
+#else
+# error Unable to determine minimum signed long long value.
+#endif /* LLONG_MIN */
+
+#if defined (LLONG_MAX)
+# define ACE_LLONG_MAX LLONG_MAX
+#elif defined (LONG_LONG_MAX)
+# define ACE_LLONG_MAX LONG_LONG_MAX
+#elif defined (LONGLONG_MAX)
+# define ACE_LLONG_MAX LONGLONG_MAX
+#else
+# error Unable to determine maximum signed long long value.
+#endif /* LLONG_MAX */
+
+ static signed long long min (void) { return ACE_LLONG_MIN; }
+ static signed long long max (void) { return ACE_LLONG_MAX; }
+};
// ------------------------------------------
// Unsigned integers
@@ -171,23 +164,21 @@ struct ACE_Export ACE_Numeric_Limits<unsigned long>
static unsigned long max (void) { return ULONG_MAX; }
};
-// #ifndef ACE_LACKS_LONGLONG_T
-// template<>
-// struct ACE_Export ACE_Numeric_Limits<unsigned long long>
-// {
-// static unsigned long long min (void) { return 0; }
-// static unsigned long long max (void)
-// {
-// # if defined (ULLONG_MAX)
-// return ULLONG_MAX;
-// # elif defined (ULONGLONG_MAX)
-// return ULONGLONG_MAX;
-// # else
-// # error Unable to determine maximum unsigned long long value.
-// # endif /* ULLONG_MAX */
-// }
-// };
-// #endif /* !ACE_LACKS_LONGLONG_T */
+template<>
+struct ACE_Export ACE_Numeric_Limits<unsigned long long>
+{
+ static unsigned long long min (void) { return 0; }
+ static unsigned long long max (void)
+ {
+# if defined (ULLONG_MAX)
+ return ULLONG_MAX;
+# elif defined (ULONGLONG_MAX)
+ return ULONGLONG_MAX;
+# else
+# error Unable to determine maximum unsigned long long value.
+# endif /* ULLONG_MAX */
+ }
+};
// ------------------------------------------
// Floating point types
@@ -254,15 +245,6 @@ struct ACE_Numeric_Limits<ULONGLONG>
#endif /* ACE_LACKS_NUMERIC_LIMITS */
-#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-template<>
-struct ACE_Numeric_Limits<ACE_U_LongLong>
-{
- static ACE_U_LongLong min (void) { return ACE_U_LongLong (); /* 0 */ }
- static ACE_U_LongLong max (void) { return ACE_UINT64_MAX; }
-};
-#endif /* ACE_LACKS_LONGLONG_T || defined ACE_LACKS_UNSIGNEDLONGLONG_T */
-
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
diff --git a/dep/acelite/ace/OS.h b/dep/acelite/ace/OS.h
new file mode 100644
index 00000000000..1d52d2faaa3
--- /dev/null
+++ b/dep/acelite/ace/OS.h
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file OS.h
+ *
+ * $Id: OS.h 95319 2011-12-13 14:54:44Z mhengstmengel $
+ *
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ * @author Jesper S. M|ller<stophph@diku.dk>
+ * @author and a cast of thousands...
+ */
+//=============================================================================
+
+#ifndef ACE_OS_H
+#define ACE_OS_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @namespace ACE_OS
+ *
+ * @brief This namespace defines an OS independent programming API that
+ * shields developers from nonportable aspects of writing
+ * efficient system programs on Win32, POSIX and other versions
+ * of UNIX, and various real-time operating systems.
+ *
+ * This namespace encapsulates the differences between various OS
+ * platforms. When porting ACE to a new platform, this class is
+ * the place to focus on. Once this file is ported to a new
+ * platform, pretty much everything else comes for "free." See
+ * <www.cs.wustl.edu/~schmidt/ACE_wrappers/etc/ACE-porting.html>
+ * for instructions on porting ACE. Please see the README file
+ * in this directory for complete information on the meaning of
+ * the various macros.
+ */
+namespace ACE_OS
+{
+ // = A set of wrappers for miscellaneous operations.
+} /* namespace ACE_OS */
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if !defined (DO_NOT_INCLUDE_OS_H)
+#include "ace/Cleanup.h"
+#include "ace/Object_Manager_Base.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_arpa_inet.h"
+#include "ace/OS_NS_ctype.h"
+#include "ace/OS_NS_dirent.h"
+#include "ace/OS_NS_dlfcn.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_fcntl.h"
+#include "ace/OS_NS_math.h"
+#include "ace/OS_NS_netdb.h"
+#include "ace/OS_NS_poll.h"
+#include "ace/OS_NS_pwd.h"
+#include "ace/OS_NS_regex.h"
+#include "ace/OS_NS_signal.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_stdlib.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_stropts.h"
+#include "ace/OS_NS_sys_mman.h"
+#include "ace/OS_NS_sys_msg.h"
+#include "ace/OS_NS_sys_resource.h"
+#include "ace/OS_NS_sys_select.h"
+#include "ace/OS_NS_sys_shm.h"
+#include "ace/OS_NS_sys_socket.h"
+#include "ace/OS_NS_sys_stat.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/OS_NS_sys_uio.h"
+#include "ace/OS_NS_sys_utsname.h"
+#include "ace/OS_NS_sys_wait.h"
+#include "ace/OS_NS_Thread.h"
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_wchar.h"
+
+// Include the split up ACE_OS classes
+#include "ace/OS_Memory.h"
+#include "ace/OS_TLI.h"
+#include "ace/OS_Errno.h"
+
+// Here are all ACE-specific default constants, needed throughout ACE
+// and its applications. The values can be over written by user
+// specific values in config.h files.
+#include "ace/Default_Constants.h"
+
+// Here are all ACE-specific global declarations needed throughout
+// ACE.
+#include "ace/Global_Macros.h"
+
+#endif /* DO_NOT_INCLUDE_OS_H */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_OS_H */
diff --git a/dep/acelite/ace/OS_NS_Thread.cpp b/dep/acelite/ace/OS_NS_Thread.cpp
index c424e3f5795..8e36eb9e4f7 100644
--- a/dep/acelite/ace/OS_NS_Thread.cpp
+++ b/dep/acelite/ace/OS_NS_Thread.cpp
@@ -1,4 +1,4 @@
-// $Id: OS_NS_Thread.cpp 91693 2010-09-09 12:57:54Z johnnyw $
+// $Id: OS_NS_Thread.cpp 96061 2012-08-16 09:36:07Z mcorino $
#include "ace/OS_NS_Thread.h"
@@ -18,7 +18,7 @@
// This is necessary to work around nasty problems with MVS C++.
#include "ace/Auto_Ptr.h"
#include "ace/Thread_Mutex.h"
-#include "ace/Condition_T.h"
+#include "ace/Condition_Thread_Mutex.h"
#include "ace/Guard_T.h"
extern "C" void
@@ -50,34 +50,18 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
void
ACE_Thread_ID::to_string (char *thr_string) const
{
- char format[128]; // Converted format string
- char *fp = 0; // Current format pointer
- fp = format;
- *fp++ = '%'; // Copy in the %
-
#if defined (ACE_WIN32)
- ACE_OS::strcpy (fp, "u");
- ACE_OS::sprintf (thr_string,
- format,
+ ACE_OS::sprintf (thr_string, "%u",
static_cast <unsigned> (this->thread_id_));
#else
-# if defined (ACE_MVS) || defined (ACE_TANDEM_T1248_PTHREADS)
- // MVS's pthread_t is a struct... yuck. So use the ACE 5.0
- // code for it.
- ACE_OS::strcpy (fp, "u");
- ACE_OS::sprintf (thr_string, format, thread_handle_);
-# else
- // Yes, this is an ugly C-style cast, but the
- // correct C++ cast is different depending on
- // whether the t_id is an integral type or a pointer
- // type. FreeBSD uses a pointer type, but doesn't
- // have a _np function to get an integral type, like
- // the OSes above.
- ACE_OS::strcpy (fp, "lu");
- ACE_OS::sprintf (thr_string,
- format,
- (unsigned long) thread_handle_);
-# endif /* ACE_MVS || ACE_TANDEM_T1248_PTHREADS */
+ // Yes, this is an ugly C-style cast, but the
+ // correct C++ cast is different depending on
+ // whether the t_id is an integral type or a pointer
+ // type. FreeBSD uses a pointer type, but doesn't
+ // have a _np function to get an integral type like
+ // other OSes, so use the bigger hammer.
+ ACE_OS::sprintf (thr_string, "%lu",
+ (unsigned long) thread_handle_);
#endif /* ACE_WIN32 */
}
@@ -232,13 +216,7 @@ ACE_TSS_Emulation::next_key (ACE_thread_key_t &key)
// Loop through all possible keys and check whether a key is free
for ( ;counter < ACE_TSS_THREAD_KEYS_MAX; counter++)
{
- ACE_thread_key_t localkey;
-# if defined (ACE_HAS_NONSCALAR_THREAD_KEY_T)
- ACE_OS::memset (&localkey, 0, sizeof (ACE_thread_key_t));
- ACE_OS::memcpy (&localkey, &counter_, sizeof (u_int));
-# else
- localkey = counter;
-# endif /* ACE_HAS_NONSCALAR_THREAD_KEY_T */
+ ACE_thread_key_t localkey = counter;
// If the key is not set as used, we can give out this key, if not
// we have to search further
if (tss_keys_used_->is_set(localkey) == 0)
@@ -397,20 +375,6 @@ ACE_TSS_Info::ACE_TSS_Info (void)
ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info");
}
-# if defined (ACE_HAS_NONSCALAR_THREAD_KEY_T)
-static inline bool operator== (const ACE_thread_key_t &lhs,
- const ACE_thread_key_t &rhs)
-{
- return ! ACE_OS::memcmp (&lhs, &rhs, sizeof (ACE_thread_key_t));
-}
-
-static inline bool operator!= (const ACE_thread_key_t &lhs,
- const ACE_thread_key_t &rhs)
-{
- return ! (lhs == rhs);
-}
-# endif /* ACE_HAS_NONSCALAR_THREAD_KEY_T */
-
// Check for equality.
bool
ACE_TSS_Info::operator== (const ACE_TSS_Info &info) const
@@ -466,9 +430,8 @@ ACE_TSS_Keys::find (const u_int key, u_int &word, u_int &bit)
int
ACE_TSS_Keys::test_and_set (const ACE_thread_key_t key)
{
- ACE_KEY_INDEX (key_index, key);
u_int word, bit;
- find (key_index, word, bit);
+ find (key, word, bit);
if (ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit))
{
@@ -484,9 +447,8 @@ ACE_TSS_Keys::test_and_set (const ACE_thread_key_t key)
int
ACE_TSS_Keys::test_and_clear (const ACE_thread_key_t key)
{
- ACE_KEY_INDEX (key_index, key);
u_int word, bit;
- find (key_index, word, bit);
+ find (key, word, bit);
if (word < ACE_WORDS && ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit))
{
@@ -502,9 +464,8 @@ ACE_TSS_Keys::test_and_clear (const ACE_thread_key_t key)
int
ACE_TSS_Keys::is_set (const ACE_thread_key_t key) const
{
- ACE_KEY_INDEX (key_index, key);
u_int word, bit;
- find (key_index, word, bit);
+ find (key, word, bit);
return word < ACE_WORDS ? ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit) : 0;
}
@@ -627,7 +588,7 @@ private:
static unsigned int reference_count_;
static ACE_TSS_Cleanup * instance_;
static ACE_Thread_Mutex* mutex_;
- static ACE_Thread_Condition<ACE_Thread_Mutex>* condition_;
+ static ACE_Condition_Thread_Mutex* condition_;
private:
ACE_TSS_Cleanup * ptr_;
@@ -650,7 +611,7 @@ TSS_Cleanup_Instance::TSS_Cleanup_Instance (Purpose purpose)
if (mutex_ == 0)
{
ACE_NEW (mutex_, ACE_Thread_Mutex ());
- ACE_NEW (condition_, ACE_Thread_Condition<ACE_Thread_Mutex> (*mutex_));
+ ACE_NEW (condition_, ACE_Condition_Thread_Mutex (*mutex_));
}
ACE_GUARD (ACE_Thread_Mutex, m, *mutex_);
@@ -750,7 +711,7 @@ TSS_Cleanup_Instance::operator ->()
unsigned int TSS_Cleanup_Instance::reference_count_ = 0;
ACE_TSS_Cleanup * TSS_Cleanup_Instance::instance_ = 0;
ACE_Thread_Mutex* TSS_Cleanup_Instance::mutex_ = 0;
-ACE_Thread_Condition<ACE_Thread_Mutex>* TSS_Cleanup_Instance::condition_ = 0;
+ACE_Condition_Thread_Mutex* TSS_Cleanup_Instance::condition_ = 0;
ACE_TSS_Cleanup::~ACE_TSS_Cleanup (void)
{
@@ -810,7 +771,7 @@ ACE_TSS_Cleanup::thread_exit (void)
}
// remove the in_use bit vector last
- ACE_KEY_INDEX (use_index, this->in_use_);
+ u_int use_index = this->in_use_;
ACE_TSS_Info & info = this->table_[use_index];
destructor[d_count] = 0;
tss_obj[d_count] = 0;
@@ -852,7 +813,7 @@ ACE_TSS_Cleanup::insert (ACE_thread_key_t key,
ACE_OS_TRACE ("ACE_TSS_Cleanup::insert");
ACE_TSS_CLEANUP_GUARD
- ACE_KEY_INDEX (key_index, key);
+ u_int key_index = key;
ACE_ASSERT (key_index < ACE_DEFAULT_THREAD_KEYS);
if (key_index < ACE_DEFAULT_THREAD_KEYS)
{
@@ -873,7 +834,7 @@ ACE_TSS_Cleanup::free_key (ACE_thread_key_t key)
{
ACE_OS_TRACE ("ACE_TSS_Cleanup::free_key");
ACE_TSS_CLEANUP_GUARD
- ACE_KEY_INDEX (key_index, key);
+ u_int key_index = key;
if (key_index < ACE_DEFAULT_THREAD_KEYS)
{
return remove_key (this->table_ [key_index]);
@@ -923,7 +884,7 @@ ACE_TSS_Cleanup::thread_detach_key (ACE_thread_key_t key)
{
ACE_TSS_CLEANUP_GUARD
- ACE_KEY_INDEX (key_index, key);
+ u_int key_index = key;
ACE_ASSERT (key_index < sizeof(this->table_)/sizeof(this->table_[0])
&& this->table_[key_index].key_ == key);
ACE_TSS_Info &info = this->table_ [key_index];
@@ -979,7 +940,7 @@ ACE_TSS_Cleanup::thread_use_key (ACE_thread_key_t key)
ACE_TSS_CLEANUP_GUARD
// Retrieve the key's ACE_TSS_Info and increment its thread_count_.
- ACE_KEY_INDEX (key_index, key);
+ u_int key_index = key;
ACE_TSS_Info &key_info = this->table_ [key_index];
ACE_ASSERT (key_info.key_in_use ());
@@ -1450,7 +1411,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv,
// Note that we must convert between absolute time (which is
// passed as a parameter) and relative time (which is what
// WaitForSingleObjects() expects).
- ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout->to_relative_time ();
// Watchout for situations where a context switch has caused the
// current time to be > the timeout.
@@ -1623,7 +1584,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv,
int msec_timeout = 0;
int result = 0;
- ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout->to_relative_time ();
// Watchout for situations where a context switch has caused the
// current time to be > the timeout.
if (relative_time > ACE_Time_Value::zero)
@@ -1652,7 +1613,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv,
// Note that we must convert between absolute time (which is
// passed as a parameter) and relative time (which is what
// WaitForSingleObjects() expects).
- ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout->to_relative_time ();
// Watchout for situations where a context switch has caused the
// current time to be > the timeout.
@@ -2184,7 +2145,7 @@ ACE_OS::mutex_lock (ACE_mutex_t *m,
// Note that we must convert between absolute time (which is passed
// as a parameter) and relative time (which is what the system call
// expects).
- ACE_Time_Value relative_time (timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout.to_relative_time ();
switch (m->type_)
{
@@ -2218,7 +2179,7 @@ ACE_OS::mutex_lock (ACE_mutex_t *m,
// Note that we must convert between absolute time (which is passed
// as a parameter) and relative time (which is what the system call
// expects).
- ACE_Time_Value relative_time (timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout.to_relative_time ();
int ticks_per_sec = ::sysClkRateGet ();
@@ -3055,7 +3016,7 @@ ACE_OS::event_timedwait (ACE_event_t *event,
{
// Time is given in absolute time, we should use
// gettimeofday() to calculate relative time
- ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout->to_relative_time ();
// Watchout for situations where a context switch has caused
// the current time to be > the timeout. Thanks to Norbert
@@ -3116,7 +3077,7 @@ ACE_OS::event_timedwait (ACE_event_t *event,
// cond_timewait() expects absolute time, check
// <use_absolute_time> flag.
if (use_absolute_time == 0)
- absolute_timeout += ACE_OS::gettimeofday ();
+ absolute_timeout = timeout->to_absolute_time ();
while (event->eventdata_->is_signaled_ == 0 &&
event->eventdata_->auto_event_signaled_ == false)
@@ -3533,7 +3494,7 @@ ACE_OS::sched_params (const ACE_Sched_Params &sched_params,
#if defined (ACE_HAS_STHREADS)
return ACE_OS::set_scheduling_params (sched_params, id);
#elif defined (ACE_HAS_PTHREADS) && \
- (!defined (ACE_LACKS_SETSCHED) || defined (ACE_TANDEM_T1248_PTHREADS) || \
+ (!defined (ACE_LACKS_SETSCHED) || \
defined (ACE_HAS_PTHREAD_SCHEDPARAM))
if (sched_params.quantum () != ACE_Time_Value::zero)
{
@@ -3552,15 +3513,15 @@ ACE_OS::sched_params (const ACE_Sched_Params &sched_params,
if (sched_params.scope () == ACE_SCOPE_PROCESS)
{
-# if defined(ACE_TANDEM_T1248_PTHREADS) || defined (ACE_HAS_PTHREAD_SCHEDPARAM)
+# if defined (ACE_HAS_PTHREAD_SCHEDPARAM)
ACE_UNUSED_ARG (id);
ACE_NOTSUP_RETURN (-1);
-# else /* ! ACE_TANDEM_T1248_PTHREADS */
+# else /* !ACE_HAS_PTHREAD_SCHEDPARAM */
int result = ::sched_setscheduler (id == ACE_SELF ? 0 : id,
sched_params.policy (),
&param) == -1 ? -1 : 0;
return result;
-# endif /* ! ACE_TANDEM_T1248_PTHREADS */
+# endif /* !ACE_HAS_PTHREAD_SCHEDPARAM */
}
else if (sched_params.scope () == ACE_SCOPE_THREAD)
{
@@ -3858,12 +3819,14 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
ACE_OS_Thread_Adapter (func, args,
(ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME,
ACE_OS_Object_Manager::seh_except_selector(),
- ACE_OS_Object_Manager::seh_except_handler()),
+ ACE_OS_Object_Manager::seh_except_handler(),
+ flags),
-1);
#else
ACE_NEW_RETURN (thread_args,
ACE_OS_Thread_Adapter (func, args,
- (ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME),
+ (ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME,
+ flags),
-1);
#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
@@ -3873,9 +3836,8 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
auto_ptr <ACE_Base_Thread_Adapter> auto_thread_args;
if (thread_adapter == 0)
- ACE_AUTO_PTR_RESET (auto_thread_args,
- thread_args,
- ACE_Base_Thread_Adapter);
+ ACE_auto_ptr_reset (auto_thread_args,
+ thread_args);
#if defined (ACE_HAS_THREADS)
@@ -4104,6 +4066,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
}
}
+# if !defined (ACE_LACKS_SETINHERITSCHED)
// *** Set scheduling explicit or inherited
if (ACE_BIT_ENABLED (flags, THR_INHERIT_SCHED)
|| ACE_BIT_ENABLED (flags, THR_EXPLICIT_SCHED))
@@ -4117,6 +4080,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
return -1;
}
}
+# endif /* ACE_LACKS_SETINHERITSCHED */
# else /* ACE_LACKS_SETSCHED */
ACE_UNUSED_ARG (priority);
# endif /* ACE_LACKS_SETSCHED */
diff --git a/dep/acelite/ace/OS_NS_Thread.h b/dep/acelite/ace/OS_NS_Thread.h
index 4145210889b..ee73b5bd3c1 100644
--- a/dep/acelite/ace/OS_NS_Thread.h
+++ b/dep/acelite/ace/OS_NS_Thread.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_Thread.h
*
- * $Id: OS_NS_Thread.h 91693 2010-09-09 12:57:54Z johnnyw $
+ * $Id: OS_NS_Thread.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -1023,23 +1023,12 @@ private:
# endif /* defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) */
-// Support non-scalar thread keys, such as with some POSIX
-// implementations, e.g., MVS.
-# if defined (ACE_HAS_NONSCALAR_THREAD_KEY_T)
-# define ACE_KEY_INDEX(OBJ,KEY) \
- u_int OBJ; \
- ACE_OS::memcpy (&OBJ, &KEY, sizeof (u_int))
-# else
-# define ACE_KEY_INDEX(OBJ,KEY) u_int OBJ = KEY
-# endif /* ACE_HAS_NONSCALAR_THREAD_KEY_T */
-
ACE_END_VERSIONED_NAMESPACE_DECL
#if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1)
# define ACE_MUTEX_LOCK_CLEANUP_ADAPTER_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ace_mutex_lock_cleanup_adapter)
#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */
-
# if defined (ACE_HAS_THR_C_FUNC)
// This is necessary to work around nasty problems with MVS C++.
extern "C" ACE_Export void ACE_MUTEX_LOCK_CLEANUP_ADAPTER_NAME (void *args);
@@ -1099,6 +1088,10 @@ namespace ACE_OS {
ACE_NAMESPACE_INLINE_FUNCTION
int condattr_destroy (ACE_condattr_t &attributes);
+ ACE_NAMESPACE_INLINE_FUNCTION
+ int condattr_setclock(ACE_condattr_t &attributes,
+ clockid_t clock_id);
+
#if defined (ACE_LACKS_COND_T)
extern ACE_Export
#else
@@ -1288,7 +1281,7 @@ namespace ACE_OS {
const ACE_Time_Value &timeout);
/**
- * If <timeout> == 0, calls <ACE_OS::mutex_lock(m)>. Otherwise,
+ * If @a timeout == 0, calls <ACE_OS::mutex_lock(m)>. Otherwise,
* this method attempts to acquire a lock, but gives up if the lock
* has not been acquired by the given time, in which case it returns
* -1 with an @c ETIME errno on platforms that actually support timed
@@ -1312,7 +1305,7 @@ namespace ACE_OS {
int mutex_trylock (ACE_mutex_t *m);
/// This method is only implemented for Win32. For abandoned
- /// mutexes, <abandoned> is set to 1 and 0 is returned.
+ /// mutexes, @a abandoned is set to 1 and 0 is returned.
extern ACE_Export
int mutex_trylock (ACE_mutex_t *m,
int &abandoned);
@@ -1410,7 +1403,7 @@ namespace ACE_OS {
int sched_params (const ACE_Sched_Params &, ACE_id_t id = ACE_SELF);
//@}
- /// Find the schedling class ID that corresponds to the class name.
+ /// Find the scheduling class ID that corresponds to the class name.
extern ACE_Export
int scheduling_class (const char *class_name, ACE_id_t &);
@@ -1509,7 +1502,7 @@ namespace ACE_OS {
ACE_NAMESPACE_INLINE_FUNCTION
int thr_continue (ACE_hthread_t target_thread);
- /*
+ /**
* Creates a new thread having @a flags attributes and running @a func
* with @a args (if @a thread_adapter is non-0 then @a func and @a args
* are ignored and are obtained from @a thread_adapter). @a thr_id
@@ -1684,9 +1677,11 @@ namespace ACE_OS {
ACE_NAMESPACE_INLINE_FUNCTION
const char* thr_name (void);
+ /// State is THR_CANCEL_ENABLE or THR_CANCEL_DISABLE
ACE_NAMESPACE_INLINE_FUNCTION
int thr_setcancelstate (int new_state, int *old_state);
+ /// Type is THR_CANCEL_DEFERRED or THR_CANCEL_ASYNCHRONOUS
ACE_NAMESPACE_INLINE_FUNCTION
int thr_setcanceltype (int new_type, int *old_type);
diff --git a/dep/acelite/ace/OS_NS_Thread.inl b/dep/acelite/ace/OS_NS_Thread.inl
index a921e6907b6..460e80f2a04 100644
--- a/dep/acelite/ace/OS_NS_Thread.inl
+++ b/dep/acelite/ace/OS_NS_Thread.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_Thread.inl 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: OS_NS_Thread.inl 96074 2012-08-17 18:06:56Z johnnyw $
#include "ace/OS_NS_macros.h"
// for timespec_t, perhaps move it to os_time.h
@@ -45,7 +45,11 @@ void **&
ACE_TSS_Emulation::tss_base ()
{
# if defined (ACE_HAS_VXTHREADS)
+ #if (ACE_VXWORKS <= 0x680)
int &spare = taskIdCurrent->ACE_VXWORKS_SPARE;
+ #else // VxWorks 6.9 updated datatype (WIND00241209) see taskLib.h
+ long &spare = taskIdCurrent->ACE_VXWORKS_SPARE;
+ #endif
return reinterpret_cast <void **&> (spare);
# else
// Uh oh.
@@ -58,8 +62,7 @@ ACE_INLINE
ACE_TSS_Emulation::ACE_TSS_DESTRUCTOR
ACE_TSS_Emulation::tss_destructor (const ACE_thread_key_t key)
{
- ACE_KEY_INDEX (key_index, key);
- return tss_destructor_ [key_index];
+ return tss_destructor_ [key];
}
ACE_INLINE
@@ -67,16 +70,13 @@ void
ACE_TSS_Emulation::tss_destructor (const ACE_thread_key_t key,
ACE_TSS_DESTRUCTOR destructor)
{
- ACE_KEY_INDEX (key_index, key);
- tss_destructor_ [key_index] = destructor;
+ tss_destructor_ [key] = destructor;
}
ACE_INLINE
void *&
ACE_TSS_Emulation::ts_object (const ACE_thread_key_t key)
{
- ACE_KEY_INDEX (key_index, key);
-
# if defined (ACE_HAS_VXTHREADS)
/* If someone wants tss_base make sure they get one. This
gets used if someone spawns a VxWorks task directly, not
@@ -97,7 +97,7 @@ ACE_TSS_Emulation::ts_object (const ACE_thread_key_t key)
}
# endif /* ACE_HAS_VXTHREADS */
- return tss_base ()[key_index];
+ return tss_base ()[key];
}
#endif /* ACE_HAS_TSS_EMULATION */
@@ -124,7 +124,7 @@ ACE_OS::thr_equal (ACE_thread_t t1, ACE_thread_t t2)
ACE_INLINE int
ACE_OS::condattr_destroy (ACE_condattr_t &attributes)
{
-#if defined (ACE_HAS_THREADS)
+#if defined (ACE_HAS_THREADS) && !defined (ACE_LACKS_CONDATTR)
# if defined (ACE_HAS_PTHREADS)
pthread_condattr_destroy (&attributes);
# else
@@ -145,23 +145,30 @@ ACE_OS::condattr_init (ACE_condattr_t &attributes, int type)
# if defined (ACE_HAS_PTHREADS)
int result = -1;
-# if defined (ACE_PTHREAD_CONDATTR_T_INITIALIZE)
- /* Tests show that VxWorks 6.x pthread lib does not only
- * require zeroing of mutex/condition objects to function correctly
- * but also of the attribute objects.
- */
- ACE_OS::memset (&attributes, 0, sizeof (attributes));
-# endif
+# if !defined (ACE_LACKS_CONDATTR)
+# if defined (ACE_PTHREAD_CONDATTR_T_INITIALIZE)
+ /* Tests show that VxWorks 6.x pthread lib does not only
+ * require zeroing of mutex/condition objects to function correctly
+ * but also of the attribute objects.
+ */
+ ACE_OS::memset (&attributes, 0, sizeof (attributes));
+# endif
if (
ACE_ADAPT_RETVAL (pthread_condattr_init (&attributes), result) == 0
-# if defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)
+# if defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)
&& ACE_ADAPT_RETVAL (pthread_condattr_setpshared (&attributes, type),
result) == 0
-# endif /* _POSIX_THREAD_PROCESS_SHARED && ! ACE_LACKS_CONDATTR_PSHARED */
+# endif /* _POSIX_THREAD_PROCESS_SHARED && ! ACE_LACKS_CONDATTR_PSHARED */
)
+# else
+ if (type == USYNC_THREAD)
+# endif /* !ACE_LACKS_CONDATTR */
result = 0;
else
- result = -1; // ACE_ADAPT_RETVAL used it for intermediate status
+ {
+ ACE_UNUSED_ARG (attributes);
+ result = -1; // ACE_ADAPT_RETVAL used it for intermediate status
+ }
return result;
# else
@@ -176,6 +183,36 @@ ACE_OS::condattr_init (ACE_condattr_t &attributes, int type)
# endif /* ACE_HAS_THREADS */
}
+ACE_INLINE int
+ACE_OS::condattr_setclock (ACE_condattr_t &attributes, clockid_t clock_id)
+{
+# if defined (ACE_HAS_THREADS)
+# if defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_CONDATTR)
+ int result = -1;
+
+# if defined (_POSIX_CLOCK_SELECTION) && !defined (ACE_LACKS_CONDATTR_SETCLOCK)
+ ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_condattr_setclock (&attributes, clock_id),
+ result),
+ int, -1);
+# else
+ ACE_UNUSED_ARG (clock_id);
+ ACE_UNUSED_ARG (attributes);
+# endif /* _POSIX_CLOCK_SELECTION) && !ACE_LACKS_CONDATTR_SETCLOCK */
+
+ return result;
+# else
+ ACE_UNUSED_ARG (clock_id);
+ ACE_UNUSED_ARG (attributes);
+ ACE_NOTSUP_RETURN (-1);
+# endif /* ACE_HAS_PTHREADS && !ACE_LACKS_CONDATTR */
+
+# else
+ ACE_UNUSED_ARG (clock_id);
+ ACE_UNUSED_ARG (attributes);
+ ACE_NOTSUP_RETURN (-1);
+# endif /* ACE_HAS_THREADS */
+}
+
#if !defined (ACE_LACKS_COND_T)
// NOTE: The ACE_OS::cond_* functions for Unix platforms are defined
// here because the ACE_OS::sema_* functions below need them.
@@ -383,7 +420,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv,
int msec_timeout = 0;
if (timeout != 0)
{
- ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = timeout->to_relative_time ();
// Watchout for situations where a context switch has caused the
// current time to be > the timeout.
if (relative_time > ACE_Time_Value::zero)
@@ -2146,7 +2183,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
{
result = ACE_OS::sema_trywait (s);
if (result == -1 && errno == EAGAIN)
- expired = ACE_OS::gettimeofday () > tv;
+ expired = (tv.to_relative_time () <= ACE_Time_Value::zero);
else
expired = false;
@@ -2169,7 +2206,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
error = ETIME;
# if defined (ACE_LACKS_COND_TIMEDWAIT_RESET)
- tv = ACE_OS::gettimeofday ();
+ tv = tv.now ();
# endif /* ACE_LACKS_COND_TIMEDWAIT_RESET */
}
@@ -2184,13 +2221,10 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
# endif /* ACE_HAS_POSIX_SEM_TIMEOUT */
# elif defined (ACE_USES_FIFO_SEM)
int rc;
- ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ACE_Time_Value timeout = tv.to_relative_time ();
- while (tv > now)
+ while (timeout > ACE_Time_Value::zero)
{
- ACE_Time_Value timeout = tv;
- timeout -= now;
-
ACE_Handle_Set fds_;
fds_.set_bit (s->fd_[0]);
@@ -2210,7 +2244,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// we were woken for input but someone beat us to it
// so we wait again if there is still time
- now = ACE_OS::gettimeofday ();
+ timeout = tv.to_relative_time ();
}
// make sure errno is set right
@@ -2253,7 +2287,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
if (result == 0)
{
# if defined (ACE_LACKS_COND_TIMEDWAIT_RESET)
- tv = ACE_OS::gettimeofday ();
+ tv = tv.now ();
# endif /* ACE_LACKS_COND_TIMEDWAIT_RESET */
--s->count_;
}
@@ -2273,7 +2307,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// Note that we must convert between absolute time (which is
// passed as a parameter) and relative time (which is what
// <WaitForSingleObjects> expects).
- ACE_Time_Value relative_time (tv - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = tv.to_relative_time ();
// Watchout for situations where a context switch has caused the
// current time to be > the timeout.
@@ -2286,7 +2320,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
switch (::WaitForSingleObject (*s, msec_timeout))
{
case WAIT_OBJECT_0:
- tv = ACE_OS::gettimeofday (); // Update time to when acquired
+ tv = tv.now (); // Update time to when acquired
return 0;
case WAIT_TIMEOUT:
errno = ETIME;
@@ -2308,10 +2342,9 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// as a shortcut for "now", which works on non-Windows because 0 is
// always earlier than now. However, the need to convert to relative time
// means we need to watch out for this case.
- ACE_Time_Value end_time = tv;
- if (tv == ACE_Time_Value::zero)
- end_time = ACE_OS::gettimeofday ();
- ACE_Time_Value relative_time = end_time - ACE_OS::gettimeofday ();
+ ACE_Time_Value relative_time (ACE_Time_Value::zero);
+ if (tv != ACE_Time_Value::zero)
+ relative_time = tv.to_relative_time ();
int result = -1;
// While we are not timeout yet. >= 0 will let this go through once
@@ -2343,7 +2376,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// Only return when we successfully get the semaphore.
if (result == 0)
{
- tv = ACE_OS::gettimeofday (); // Update to time acquired
+ tv = tv.now (); // Update to time acquired
return 0;
}
break;
@@ -2362,7 +2395,8 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// Haven't been able to get the semaphore yet, update the
// timeout value to reflect the remaining time we want to wait.
- relative_time = end_time - ACE_OS::gettimeofday ();
+ // in case of tv == 0 relative_time will now be < 0 and we will be out of time
+ relative_time = tv.to_relative_time ();
}
// We have timed out.
@@ -2373,7 +2407,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// Note that we must convert between absolute time (which is
// passed as a parameter) and relative time (which is what
// the system call expects).
- ACE_Time_Value relative_time (tv - ACE_OS::gettimeofday ());
+ ACE_Time_Value relative_time = tv.to_relative_time ();
int ticks_per_sec = ::sysClkRateGet ();
@@ -2391,7 +2425,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
}
else
{
- tv = ACE_OS::gettimeofday (); // Update to time acquired
+ tv = tv.now (); // Update to time acquired
return 0;
}
# endif /* ACE_HAS_STHREADS */
@@ -2504,10 +2538,7 @@ ACE_OS::sigwait (sigset_t *sset, int *sig)
// Cygwin has sigwait definition, but it is not implemented
ACE_UNUSED_ARG (sset);
ACE_NOTSUP_RETURN (-1);
-# elif defined (ACE_TANDEM_T1248_PTHREADS)
- errno = ::spt_sigwait (sset, sig);
- return errno == 0 ? *sig : -1;
-# else /* this is draft 7 or std */
+# else /* this is std */
errno = ::sigwait (sset, sig);
return errno == 0 ? *sig : -1;
# endif /* CYGWIN32 */
@@ -2988,10 +3019,35 @@ ACE_OS::thr_setcancelstate (int new_state, int *old_state)
#if defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_PTHREAD_CANCEL)
int result;
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_setcancelstate (new_state,
- old_state),
- result),
- int, -1);
+ int local_new, local_old;
+ switch (new_state)
+ {
+ case THR_CANCEL_ENABLE:
+ local_new = PTHREAD_CANCEL_ENABLE;
+ break;
+ case THR_CANCEL_DISABLE:
+ local_new = PTHREAD_CANCEL_DISABLE;
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+ ACE_OSCALL (ACE_ADAPT_RETVAL (pthread_setcancelstate (local_new,
+ &local_old),
+ result),
+ int, -1, result);
+ if (result == -1)
+ return -1;
+ switch (local_old)
+ {
+ case PTHREAD_CANCEL_ENABLE:
+ *old_state = THR_CANCEL_ENABLE;
+ break;
+ case PTHREAD_CANCEL_DISABLE:
+ *old_state = THR_CANCEL_DISABLE;
+ break;
+ }
+ return result;
# elif defined (ACE_HAS_STHREADS)
ACE_UNUSED_ARG (new_state);
ACE_UNUSED_ARG (old_state);
@@ -3019,10 +3075,35 @@ ACE_OS::thr_setcanceltype (int new_type, int *old_type)
#if defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_PTHREAD_CANCEL)
int result;
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_setcanceltype (new_type,
- old_type),
- result),
- int, -1);
+ int local_new, local_old;
+ switch (new_type)
+ {
+ case THR_CANCEL_DEFERRED:
+ local_new = PTHREAD_CANCEL_DEFERRED;
+ break;
+ case THR_CANCEL_ASYNCHRONOUS:
+ local_new = PTHREAD_CANCEL_ASYNCHRONOUS;
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+ ACE_OSCALL (ACE_ADAPT_RETVAL (pthread_setcanceltype (local_new,
+ &local_old),
+ result),
+ int, -1, result);
+ if (result == -1)
+ return -1;
+ switch (local_old)
+ {
+ case PTHREAD_CANCEL_DEFERRED:
+ *old_type = THR_CANCEL_DEFERRED;
+ break;
+ case PTHREAD_CANCEL_ASYNCHRONOUS:
+ *old_type = THR_CANCEL_ASYNCHRONOUS;
+ break;
+ }
+ return result;
# else /* Could be ACE_HAS_PTHREADS && ACE_LACKS_PTHREAD_CANCEL */
ACE_UNUSED_ARG (new_type);
ACE_UNUSED_ARG (old_type);
diff --git a/dep/acelite/ace/OS_NS_arpa_inet.cpp b/dep/acelite/ace/OS_NS_arpa_inet.cpp
index 537051cc1df..d585cc69ec9 100644
--- a/dep/acelite/ace/OS_NS_arpa_inet.cpp
+++ b/dep/acelite/ace/OS_NS_arpa_inet.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// $Id: OS_NS_arpa_inet.cpp 91781 2010-09-15 12:49:15Z johnnyw $
+// $Id: OS_NS_arpa_inet.cpp 95534 2012-02-17 23:19:33Z mitza $
#include "ace/OS_NS_arpa_inet.h"
@@ -34,7 +34,7 @@ ACE_OS::inet_aton (const char *host_name, struct in_addr *addr)
addr->s_addr = ip_addr; // Network byte ordered
return 1;
}
-#elif defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x680)
+#elif defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x690)
// inet_aton() returns OK (0) on success and ERROR (-1) on failure.
// Must reset errno first. Refer to WindRiver SPR# 34949, SPR# 36026
::errnoSet(0);
diff --git a/dep/acelite/ace/OS_NS_dlfcn.inl b/dep/acelite/ace/OS_NS_dlfcn.inl
index 14960008dd1..522166befe2 100644
--- a/dep/acelite/ace/OS_NS_dlfcn.inl
+++ b/dep/acelite/ace/OS_NS_dlfcn.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_dlfcn.inl 85341 2009-05-14 11:07:37Z johnnyw $
+// $Id: OS_NS_dlfcn.inl 92474 2010-11-02 13:29:39Z johnnyw $
#include "ace/OS_NS_macros.h"
#include "ace/OS_NS_errno.h"
@@ -40,11 +40,7 @@ ACE_OS::dlclose (ACE_SHLIB_HANDLE handle)
if (ptr != 0)
(*((int (*)(void)) ptr)) (); // Call _fini hook explicitly.
# endif /* ACE_HAS_AUTOMATIC_INIT_FINI */
-#if defined (_M_UNIX)
- ACE_OSCALL_RETURN (::_dlclose (handle), int, -1);
-#else /* _MUNIX */
- ACE_OSCALL_RETURN (::dlclose (handle), int, -1);
-#endif /* _M_UNIX */
+ ACE_OSCALL_RETURN (::dlclose (handle), int, -1);
#elif defined (ACE_WIN32)
ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::FreeLibrary (handle), ace_result_), int, -1);
#elif defined (__hpux)
@@ -79,11 +75,7 @@ ACE_OS::dlerror (void)
ACE_OS_TRACE ("ACE_OS::dlerror");
# if defined (ACE_HAS_SVR4_DYNAMIC_LINKING)
const char *err = 0;
-# if defined(_M_UNIX)
- ACE_OSCALL (::_dlerror (), const char *, 0, err);
-# else /* _M_UNIX */
ACE_OSCALL (::dlerror (), const char *, 0, err);
-# endif /* _M_UNIX */
if (err == 0)
return 0;
# if defined (ACE_USES_WCHAR)
@@ -128,9 +120,6 @@ ACE_OS::dlopen (const ACE_TCHAR *fname,
# if defined (ACE_HAS_SGIDLADD)
ACE_OSCALL
(::sgidladd (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle);
-# elif defined (_M_UNIX)
- ACE_OSCALL
- (::_dlopen (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle);
# else
ACE_OSCALL
(::dlopen (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle);
@@ -244,8 +233,6 @@ ACE_OS::dlsym (ACE_SHLIB_HANDLE handle,
ACE_OSCALL (::dlsym (handle, asm_symbolname), void *, 0, ace_result);
delete [] asm_symbolname;
return ace_result;
-# elif defined (_M_UNIX)
- ACE_OSCALL_RETURN (::_dlsym (handle, symbolname), void *, 0);
# else
ACE_OSCALL_RETURN (::dlsym (handle, symbolname), void *, 0);
# endif /* ACE_USES_ASM_SYMBOL_IN_DLSYM */
diff --git a/dep/acelite/ace/OS_NS_errno.h b/dep/acelite/ace/OS_NS_errno.h
index 22e3d006d06..36c3e94b21c 100644
--- a/dep/acelite/ace/OS_NS_errno.h
+++ b/dep/acelite/ace/OS_NS_errno.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_errno.h
*
- * $Id: OS_NS_errno.h 85321 2009-05-12 08:31:31Z johnnyw $
+ * $Id: OS_NS_errno.h 94454 2011-09-08 17:36:56Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -84,7 +84,9 @@ private:
# define ACE_ERRNO_TYPE ACE_CE_Errno
# define ACE_ERRNO_GET ACE_CE_Errno::instance ()->operator int()
#else
-# define ACE_ERRNO_TYPE int
+# if !defined (ACE_ERRNO_TYPE)
+# define ACE_ERRNO_TYPE int
+# endif /* !ACE_ERRNO_TYPE */
# define ACE_ERRNO_GET errno
#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */
diff --git a/dep/acelite/ace/OS_NS_errno.inl b/dep/acelite/ace/OS_NS_errno.inl
index 3795eec54a7..3a3ec6c5403 100644
--- a/dep/acelite/ace/OS_NS_errno.inl
+++ b/dep/acelite/ace/OS_NS_errno.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_errno.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: OS_NS_errno.inl 94454 2011-09-08 17:36:56Z johnnyw $
#include "ace/config-all.h" /* Need ACE_TRACE */
@@ -17,8 +17,8 @@ ACE_OS::last_error (void)
// C++ socket wrapper facades. On Windows, some things that would
// use errno on UNIX require ::GetLastError(), so this method tries
// to shield the rest of ACE from having to know about this.
- int lerror = ::GetLastError ();
- int lerrno = errno;
+ int const lerror = ::GetLastError ();
+ int const lerrno = errno;
return lerrno == 0 ? lerror : lerrno;
#else
return errno;
diff --git a/dep/acelite/ace/OS_NS_math.h b/dep/acelite/ace/OS_NS_math.h
index 9ba3b6632ad..210554eede6 100644
--- a/dep/acelite/ace/OS_NS_math.h
+++ b/dep/acelite/ace/OS_NS_math.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_math.h
*
- * $Id: OS_NS_math.h 89470 2010-03-12 12:12:12Z olli $
+ * $Id: OS_NS_math.h 95724 2012-05-03 06:43:31Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -89,18 +89,40 @@ namespace ACE_OS
{
/// This method computes the largest integral value not greater than x.
template <typename T>
+ inline
T floor (T x)
{
return ACE_STD_NAMESPACE::floor (x);
}
+#if defined (ACE_HAS_WINCE)
+ /// Windows CE has an intrinsic floor for float
+ template <>
+ inline
+ float floor (float x)
+ {
+ return ACE_STD_NAMESPACE::floorf (x);
+ }
+#endif
+
/// This method computes the smallest integral value not less than x.
template <typename T>
+ inline
T ceil (T x)
{
return ACE_STD_NAMESPACE::ceil (x);
}
+#if defined (ACE_HAS_WINCE)
+ /// Windows CE has an intrinsic ceil for float
+ template <>
+ inline
+ float ceil (float x)
+ {
+ return ACE_STD_NAMESPACE::ceilf (x);
+ }
+#endif
+
/// This method computes the base-2 logarithm of x.
ACE_NAMESPACE_INLINE_FUNCTION
double log2 (double x);
diff --git a/dep/acelite/ace/OS_NS_math.inl b/dep/acelite/ace/OS_NS_math.inl
index e66dc496e5d..76a50caa47f 100644
--- a/dep/acelite/ace/OS_NS_math.inl
+++ b/dep/acelite/ace/OS_NS_math.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: OS_NS_math.inl 89470 2010-03-12 12:12:12Z olli $
+// $Id: OS_NS_math.inl 93622 2011-03-22 15:45:57Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/OS_NS_netdb.cpp b/dep/acelite/ace/OS_NS_netdb.cpp
index b615df1387d..6de2b74e580 100644
--- a/dep/acelite/ace/OS_NS_netdb.cpp
+++ b/dep/acelite/ace/OS_NS_netdb.cpp
@@ -1,10 +1,8 @@
// -*- C++ -*-
-// $Id: OS_NS_netdb.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_netdb.cpp 95533 2012-02-14 22:59:17Z wotte $
#include "ace/OS_NS_netdb.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_netdb.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
@@ -17,196 +15,6 @@
#include "ace/OS_NS_stropts.h"
#include "ace/OS_NS_sys_socket.h"
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR)
-
-struct hostent *
-ACE_OS::gethostbyaddr (const char *addr, int length, int type)
-{
- ACE_OS_TRACE ("ACE_OS::gethostbyaddr");
-
- if (length != 4 || type != AF_INET)
- {
- errno = EINVAL;
- return 0;
- }
-
- // not thread safe!
- static hostent ret;
- static char name [MAXNAMELEN + 1];
- static char *hostaddr[2];
- static char *aliases[1];
-
- if (::hostGetByAddr (*(int *) addr, name) != 0)
- {
- // errno will have been set to S_hostLib_UNKNOWN_HOST.
- return 0;
- }
-
- // Might not be official: just echo input arg.
- hostaddr[0] = (char *) addr;
- hostaddr[1] = 0;
- aliases[0] = 0;
-
- ret.h_name = name;
- ret.h_addrtype = AF_INET;
- ret.h_length = 4; // VxWorks 5.2/3 doesn't define IP_ADDR_LEN;
- ret.h_addr_list = hostaddr;
- ret.h_aliases = aliases;
-
- return &ret;
-}
-
-#endif /* ACE_VXWORKS && ACE_LACKS_GETHOSTBYADDR */
-
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR)
-
-struct hostent *
-ACE_OS::gethostbyaddr_r (const char *addr, int length, int type,
- hostent *result, ACE_HOSTENT_DATA buffer,
- int *h_errnop)
-{
- ACE_OS_TRACE ("ACE_OS::gethostbyaddr_r");
- if (length != 4 || type != AF_INET)
- {
- errno = EINVAL;
- return 0;
- }
-
- if (ACE_OS::netdb_acquire ())
- return 0;
- else
- {
- // buffer layout:
- // buffer[0-3]: h_addr_list[0], the first (and only) addr.
- // buffer[4-7]: h_addr_list[1], the null terminator for the h_addr_list.
- // buffer[8]: the name of the host, null terminated.
-
- // Call ::hostGetByAddr (), which puts the (one) hostname into
- // buffer.
- if (::hostGetByAddr (*(int *) addr, &buffer[8]) == 0)
- {
- // Store the return values in result.
- result->h_name = &buffer[8]; // null-terminated host name
- result->h_addrtype = AF_INET;
- result->h_length = 4; // VxWorks 5.2/3 doesn't define IP_ADDR_LEN.
-
- result->h_addr_list = (char **) buffer;
- // Might not be official: just echo input arg.
- result->h_addr_list[0] = (char *) addr;
- // Null-terminate the list of addresses.
- result->h_addr_list[1] = 0;
- // And no aliases, so null-terminate h_aliases.
- result->h_aliases = &result->h_addr_list[1];
- }
- else
- {
- // errno will have been set to S_hostLib_UNKNOWN_HOST.
- result = 0;
- }
- }
-
- ACE_OS::netdb_release ();
- *h_errnop = errno;
- return result;
-}
-
-#endif /* ACE_VXWORKS && ACE_LACKS_GETHOSTBYADDR */
-
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME)
-
-struct hostent *
-ACE_OS::gethostbyname (const char *name)
-{
- ACE_OS_TRACE ("ACE_OS::gethostbyname");
-
- // not thread safe!
- static hostent ret;
- static int first_addr;
- static char *hostaddr[2];
- static char *aliases[1];
-
- if (0 == name || '\0' == name[0])
- return 0;
-
- ACE_OSCALL (::hostGetByName (const_cast <char *> (name)), int, -1, first_addr);
- if (first_addr == -1)
- return 0;
-
- hostaddr[0] = (char *) &first_addr;
- hostaddr[1] = 0;
- aliases[0] = 0;
-
- // Might not be official: just echo input arg.
- ret.h_name = (char *) name;
- ret.h_addrtype = AF_INET;
- ret.h_length = 4; // VxWorks 5.2/3 doesn't define IP_ADDR_LEN;
- ret.h_addr_list = hostaddr;
- ret.h_aliases = aliases;
-
- return &ret;
-}
-
-#endif /* ACE_VXWORKS && ACE_LACKS_GETHOSTBYNAME */
-
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME)
-
-struct hostent *
-ACE_OS::gethostbyname_r (const char *name, hostent *result,
- ACE_HOSTENT_DATA buffer,
- int *h_errnop)
-{
- ACE_OS_TRACE ("ACE_OS::gethostbyname_r");
-
- if (0 == name || '\0' == name[0])
- return 0;
-
- if (ACE_OS::netdb_acquire ())
- return 0;
- else
- {
- int addr;
- ACE_OSCALL (::hostGetByName (const_cast <char *> (name)), int, -1, addr);
-
- if (addr == -1)
- {
- // errno will have been set to S_hostLib_UNKNOWN_HOST
- result = 0;
- }
- else
- {
- // Might not be official: just echo input arg.
- result->h_name = (char *) name;
- result->h_addrtype = AF_INET;
- result->h_length = 4; // VxWorks 5.2/3 doesn't define IP_ADDR_LEN;
-
- // buffer layout:
- // buffer[0-3]: h_addr_list[0], pointer to the addr.
- // buffer[4-7]: h_addr_list[1], null terminator for the h_addr_list.
- // buffer[8-11]: the first (and only) addr.
-
- // Store the address list in buffer.
- result->h_addr_list = (char **) buffer;
- // Store the actual address _after_ the address list.
- result->h_addr_list[0] = (char *) &result->h_addr_list[2];
- result->h_addr_list[2] = (char *) addr;
- // Null-terminate the list of addresses.
- result->h_addr_list[1] = 0;
- // And no aliases, so null-terminate h_aliases.
- result->h_aliases = &result->h_addr_list[1];
- }
- }
-
- ACE_OS::netdb_release ();
- *h_errnop = errno;
- return result;
-}
-
-#endif /* ACE_VXWORKS && ACE_LACKS_GETHOSTBYNAME*/
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
// Include if_arp so that getmacaddr can use the
// arp structure.
#if defined (sun)
@@ -356,7 +164,7 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node)
return 0;
-#elif defined (linux) && !defined (ACE_LACKS_NETWORKING)
+#elif defined (ACE_LINUX) && !defined (ACE_LACKS_NETWORKING)
struct ifreq ifr;
@@ -385,7 +193,7 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node)
return 0;
-#elif defined (ACE_HAS_IPHONE) || defined (ACE_HAS_MAC_OSX)
+#elif defined (ACE_HAS_SIOCGIFCONF)
const long BUFFERSIZE = 4000;
char buffer[BUFFERSIZE];
diff --git a/dep/acelite/ace/OS_NS_netdb.h b/dep/acelite/ace/OS_NS_netdb.h
index 0c6bdf43556..63f2bafc7ea 100644
--- a/dep/acelite/ace/OS_NS_netdb.h
+++ b/dep/acelite/ace/OS_NS_netdb.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_netdb.h
*
- * $Id: OS_NS_netdb.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: OS_NS_netdb.h 93597 2011-03-21 12:54:52Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -38,20 +38,12 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_OS
{
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR)
- extern ACE_Export
-#else
ACE_NAMESPACE_INLINE_FUNCTION
-#endif /* ACE_VXWORKS */
struct hostent *gethostbyaddr (const char *addr,
int length,
int type);
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR)
- extern ACE_Export
-#else
ACE_NAMESPACE_INLINE_FUNCTION
-#endif /* ACE_VXWORKS */
struct hostent *gethostbyaddr_r (const char *addr,
int length,
int type,
@@ -59,18 +51,10 @@ namespace ACE_OS
ACE_HOSTENT_DATA buffer,
int *h_errnop);
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME)
- extern ACE_Export
-#else
ACE_NAMESPACE_INLINE_FUNCTION
-#endif /* ACE_VXWORKS */
struct hostent *gethostbyname (const char *name);
-#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME)
- extern ACE_Export
-#else
ACE_NAMESPACE_INLINE_FUNCTION
-#endif /* ACE_VXWORKS */
struct hostent *gethostbyname_r (const char *name,
struct hostent *result,
ACE_HOSTENT_DATA buffer,
diff --git a/dep/acelite/ace/OS_NS_netdb.inl b/dep/acelite/ace/OS_NS_netdb.inl
index 0888c72f934..2db9779a348 100644
--- a/dep/acelite/ace/OS_NS_netdb.inl
+++ b/dep/acelite/ace/OS_NS_netdb.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_netdb.inl 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: OS_NS_netdb.inl 93597 2011-03-21 12:54:52Z johnnyw $
#include "ace/OS_NS_macros.h"
#include "ace/OS_NS_string.h"
@@ -42,8 +42,6 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-#if !(defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR))
-
ACE_INLINE struct hostent *
ACE_OS::gethostbyaddr (const char *addr, int length, int type)
{
@@ -86,10 +84,6 @@ ACE_OS::gethostbyaddr (const char *addr, int length, int type)
# endif /* !ACE_LACKS_GETHOSTBYADDR */
}
-#endif
-
-#if !(defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR))
-
ACE_INLINE struct hostent *
ACE_OS::gethostbyaddr_r (const char *addr,
int length,
@@ -143,6 +137,7 @@ ACE_OS::gethostbyaddr_r (const char *addr,
else
return (struct hostent *) 0;
# elif defined (ACE_VXWORKS)
+ ACE_UNUSED_ARG (h_errnop);
// VxWorks 6.x has a threadsafe gethostbyaddr() which returns a heap-allocated
// data structure which needs to be freed with hostentFree()
//FUZZ: disable check_for_lack_ACE_OS
@@ -233,10 +228,6 @@ ACE_OS::gethostbyaddr_r (const char *addr,
# endif /* ACE_LACKS_GETHOSTBYADDR_R */
}
-#endif
-
-#if !(defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME))
-
ACE_INLINE struct hostent *
ACE_OS::gethostbyname (const char *name)
{
@@ -273,10 +264,6 @@ ACE_OS::gethostbyname (const char *name)
# endif /* !ACE_LACKS_GETHOSTBYNAME */
}
-#endif
-
-#if !(defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME))
-
ACE_INLINE struct hostent *
ACE_OS::gethostbyname_r (const char *name,
struct hostent *result,
@@ -333,6 +320,7 @@ ACE_OS::gethostbyname_r (const char *name,
else
return (struct hostent *) 0;
# elif defined (ACE_VXWORKS)
+ ACE_UNUSED_ARG (h_errnop);
// VxWorks 6.x has a threadsafe gethostbyname() which returns a heap-allocated
// data structure which needs to be freed with hostentFree()
//FUZZ: disable check_for_lack_ACE_OS
@@ -423,8 +411,6 @@ ACE_OS::gethostbyname_r (const char *name,
# endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) */
}
-#endif
-
ACE_INLINE struct hostent *
ACE_OS::getipnodebyaddr (const void *src, size_t len, int family)
{
diff --git a/dep/acelite/ace/OS_NS_pwd.h b/dep/acelite/ace/OS_NS_pwd.h
index f32c247d224..ffbf7180b58 100644
--- a/dep/acelite/ace/OS_NS_pwd.h
+++ b/dep/acelite/ace/OS_NS_pwd.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_pwd.h
*
- * $Id: OS_NS_pwd.h 87270 2009-10-29 21:47:47Z olli $
+ * $Id: OS_NS_pwd.h 93597 2011-03-21 12:54:52Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -39,8 +39,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_OS
{
-
-
//@{ @name A set of wrappers for password routines.
ACE_NAMESPACE_INLINE_FUNCTION
@@ -53,14 +51,15 @@ namespace ACE_OS
struct passwd *getpwnam (const char *user);
ACE_NAMESPACE_INLINE_FUNCTION
- struct passwd *getpwnam_r (const char *name,
- struct passwd *pwent,
- char *buffer,
- int buflen);
+ int getpwnam_r (const char *name,
+ struct passwd *pwd,
+ char *buffer,
+ size_t bufsize,
+ struct passwd **result);
+
ACE_NAMESPACE_INLINE_FUNCTION
void setpwent (void);
//@}
-
} /* namespace ACE_OS */
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/OS_NS_pwd.inl b/dep/acelite/ace/OS_NS_pwd.inl
index 6fcb076fd8b..396ea0af064 100644
--- a/dep/acelite/ace/OS_NS_pwd.inl
+++ b/dep/acelite/ace/OS_NS_pwd.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_pwd.inl 91781 2010-09-15 12:49:15Z johnnyw $
+// $Id: OS_NS_pwd.inl 93563 2011-03-16 14:33:48Z olli $
#include "ace/OS_NS_errno.h"
@@ -37,71 +37,31 @@ ACE_OS::getpwnam (const char *name)
#endif /* ACE_LACKS_PWD_FUNCTIONS */
}
-ACE_INLINE struct passwd *
-ACE_OS::getpwnam_r (const char *name, struct passwd *pwent,
- char *buffer, int buflen)
+ACE_INLINE int
+ACE_OS::getpwnam_r (const char *name,
+ struct passwd *pwd,
+ char *buffer,
+ size_t bufsize,
+ struct passwd **result)
{
-#if defined (ACE_HAS_POSIX_GETPWNAM_R)
- struct passwd *result = 0;
-
- int const status = ::getpwnam_r (name, pwent, buffer, buflen, &result);
-
- if (status != 0)
- {
- errno = status;
- result = 0;
- }
- return result;
-#elif !defined (ACE_LACKS_PWD_FUNCTIONS)
-# if defined (ACE_HAS_REENTRANT_FUNCTIONS)
-# if !defined (ACE_LACKS_PWD_REENTRANT_FUNCTIONS)
-# if defined (ACE_HAS_PTHREADS) && \
- !defined (ACE_HAS_STHREADS) || \
- defined (HPUX_11)
- struct passwd *result = 0;
- int status;
- // VAC++ doesn't correctly grok the ::getpwnam_r - the function is redefined
- // in pwd.h, and that redefinition is used here
-# if defined (__IBMCPP__) && (__IBMCPP__ >= 400) /* VAC++ 4 */
- status = _posix_getpwnam_r (name, pwent, buffer, buflen, &result);
-# else
- status = ::getpwnam_r (name, pwent, buffer, buflen, &result);
-# endif /* __IBMCPP__ && (__IBMCPP__ >= 400) */
- if (status != 0)
- {
- errno = status;
- result = 0;
- }
- return result;
-# elif defined (AIX)
- if (::getpwnam_r (name, pwent, buffer, buflen) == -1)
- return 0;
- else
- return pwent;
-# else
- return ::getpwnam_r (name, pwent, buffer, buflen);
-# endif /* ACE_HAS_PTHREADS */
-# else
+#if defined (ACE_LACKS_PWD_FUNCTIONS)
ACE_UNUSED_ARG (name);
- ACE_UNUSED_ARG (pwent);
+ ACE_UNUSED_ARG (pwd);
ACE_UNUSED_ARG (buffer);
- ACE_UNUSED_ARG (buflen);
+ ACE_UNUSED_ARG (bufsize);
+ ACE_UNUSED_ARG (result);
ACE_NOTSUP_RETURN (0);
-# endif /* ! ACE_LACKS_PWD_REENTRANT_FUNCTIONS */
-# else
- ACE_UNUSED_ARG (name);
- ACE_UNUSED_ARG (pwent);
- ACE_UNUSED_ARG (buffer);
- ACE_UNUSED_ARG (buflen);
- ACE_NOTSUP_RETURN (0);
-# endif /* ACE_HAS_REENTRANT_FUNCTIONS */
+#elif defined (ACE_HAS_LYNXOS4_GETPWNAM_R)
+ if (::getpwnam_r (pwd, const_cast<char*>(name), buffer, bufsize) == -1)
+ {
+ *result = 0;
+ return -1;
+ }
+ *result = pwd;
+ return 0;
#else
- ACE_UNUSED_ARG (name);
- ACE_UNUSED_ARG (pwent);
- ACE_UNUSED_ARG (buffer);
- ACE_UNUSED_ARG (buflen);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_POSIX_GETPWNAM_R */
+ return ::getpwnam_r (name, pwd, buffer, bufsize, result);
+#endif /* ACE_LACKS_PWD_FUNCTIONS */
}
ACE_INLINE void
diff --git a/dep/acelite/ace/OS_NS_signal.h b/dep/acelite/ace/OS_NS_signal.h
index 8dc02c10ab2..123011f1eaf 100644
--- a/dep/acelite/ace/OS_NS_signal.h
+++ b/dep/acelite/ace/OS_NS_signal.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_signal.h
*
- * $Id: OS_NS_signal.h 87097 2009-10-14 14:42:24Z olli $
+ * $Id: OS_NS_signal.h 93481 2011-03-04 14:59:09Z olli $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -33,10 +33,10 @@
#endif
#define ACE_EXPORT_MACRO ACE_Export
-#if defined (__Lynx__)
-// LynxOS defines pthread_sigmask() in pthread.h
+#if defined (__Lynx__) || defined (__OpenBSD__)
+// LynxOS and OpenBSD define pthread_sigmask() in pthread.h
# include "ace/os_include/os_pthread.h"
-#endif /* __Lynx__ */
+#endif /* __Lynx__ || OpenBSD */
/*
* We inline and undef some functions that may be implemented
diff --git a/dep/acelite/ace/OS_NS_signal.inl b/dep/acelite/ace/OS_NS_signal.inl
index d6f6494e118..43046245f3b 100644
--- a/dep/acelite/ace/OS_NS_signal.inl
+++ b/dep/acelite/ace/OS_NS_signal.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: OS_NS_signal.inl 87480 2009-11-11 11:38:15Z olli $
+// $Id: OS_NS_signal.inl 93651 2011-03-28 08:49:11Z johnnyw $
#include "ace/OS_NS_macros.h"
#include "ace/OS_NS_errno.h"
diff --git a/dep/acelite/ace/OS_NS_stdio.h b/dep/acelite/ace/OS_NS_stdio.h
index bf120229c28..bbb30ca82e8 100644
--- a/dep/acelite/ace/OS_NS_stdio.h
+++ b/dep/acelite/ace/OS_NS_stdio.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_stdio.h
*
- * $Id: OS_NS_stdio.h 92178 2010-10-08 07:44:20Z olli $
+ * $Id: OS_NS_stdio.h 93500 2011-03-07 16:19:27Z vzykov $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -220,7 +220,8 @@ namespace ACE_OS {
//@}
extern ACE_Export
- int asprintf (char **bufp, const char* format, ...);
+ int asprintf (char **bufp, const char* format, ...)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 2, 3);
# if defined (ACE_HAS_WCHAR)
extern ACE_Export
@@ -371,7 +372,8 @@ namespace ACE_OS {
#endif /* ACE_WIN32 */
extern ACE_Export
- int fprintf (FILE *fp, const char *format, ...);
+ int fprintf (FILE *fp, const char *format, ...)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 2, 3);
# if defined (ACE_HAS_WCHAR)
extern ACE_Export
@@ -437,7 +439,8 @@ namespace ACE_OS {
#endif /* ACE_HAS_WCHAR */
extern ACE_Export
- int printf (const char *format, ...);
+ int printf (const char *format, ...)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 1, 2);
#if defined (ACE_HAS_WCHAR)
extern ACE_Export
@@ -468,7 +471,8 @@ namespace ACE_OS {
void rewind (FILE *fp);
extern ACE_Export
- int snprintf (char *buf, size_t maxlen, const char *format, ...);
+ int snprintf (char *buf, size_t maxlen, const char *format, ...)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 3, 4);
# if defined (ACE_HAS_WCHAR)
extern ACE_Export
@@ -476,7 +480,8 @@ namespace ACE_OS {
# endif /* ACE_HAS_WCHAR */
extern ACE_Export
- int sprintf (char *buf, const char *format, ...);
+ int sprintf (char *buf, const char *format, ...)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 2, 3);
# if defined (ACE_HAS_WCHAR)
extern ACE_Export
@@ -494,19 +499,24 @@ namespace ACE_OS {
#endif /* ACE_HAS_WCHAR */
ACE_NAMESPACE_INLINE_FUNCTION
- int vasprintf (char **bufp, const char *format, va_list argptr);
+ int vasprintf (char **bufp, const char *format, va_list argptr)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 2, 0);
ACE_NAMESPACE_INLINE_FUNCTION
- int vprintf (const char *format, va_list argptr);
+ int vprintf (const char *format, va_list argptr)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 1, 0);
ACE_NAMESPACE_INLINE_FUNCTION
- int vfprintf (FILE *fp, const char *format, va_list argptr);
+ int vfprintf (FILE *fp, const char *format, va_list argptr)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 2, 0);
ACE_NAMESPACE_INLINE_FUNCTION
- int vsprintf (char *buffer, const char *format, va_list argptr);
+ int vsprintf (char *buffer, const char *format, va_list argptr)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 2, 0);
ACE_NAMESPACE_INLINE_FUNCTION
- int vsnprintf (char *buffer, size_t maxlen, const char *format, va_list argptr);
+ int vsnprintf (char *buffer, size_t maxlen, const char *format, va_list argptr)
+ ACE_GCC_FORMAT_ATTRIBUTE (printf, 3, 0);
# if defined (ACE_HAS_WCHAR)
ACE_NAMESPACE_INLINE_FUNCTION
diff --git a/dep/acelite/ace/OS_NS_stdlib.cpp b/dep/acelite/ace/OS_NS_stdlib.cpp
index 92430d0c84d..c9ce0fe66ea 100644
--- a/dep/acelite/ace/OS_NS_stdlib.cpp
+++ b/dep/acelite/ace/OS_NS_stdlib.cpp
@@ -1,4 +1,4 @@
-// $Id: OS_NS_stdlib.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_stdlib.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/OS_NS_stdlib.h"
@@ -259,13 +259,13 @@ ACE_OS::itow_emulation (int value, wchar_t *string, int radix)
// Now reverse the string to get the correct result
while (e > b)
- {
- wchar_t temp = *e;
- *e = *b;
- *b = temp;
- ++b;
- --e;
- }
+ {
+ wchar_t temp = *e;
+ *e = *b;
+ *b = temp;
+ ++b;
+ --e;
+ }
return string;
}
@@ -842,7 +842,7 @@ ACE_OS::strtoll_emulation (const char *nptr,
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
@@ -910,7 +910,7 @@ ACE_OS::wcstoll_emulation (const wchar_t *nptr,
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
@@ -978,7 +978,7 @@ ACE_OS::strtoull_emulation (const char *nptr,
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else
{
@@ -1048,7 +1048,7 @@ ACE_OS::wcstoull_emulation (const wchar_t *nptr,
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else
{
@@ -1108,7 +1108,7 @@ ACE_OS::mkstemp_emulation (ACE_TCHAR * s)
// ACE_thread_t may be a char* (returned by ACE_OS::thr_self()) so
// we need to use a C-style cast as a catch-all in order to use a
// static_cast<> to an integral type.
- ACE_RANDR_TYPE seed = static_cast<ACE_RANDR_TYPE> (msec);
+ unsigned int seed = static_cast<unsigned int> (msec);
// We only care about UTF-8 / ASCII characters in generated
// filenames. A UTF-16 or UTF-32 character could potentially cause
@@ -1148,7 +1148,7 @@ ACE_OS::mkstemp_emulation (ACE_TCHAR * s)
// selection to work for EBCDIC, as well.
do
{
- r = static_cast<ACE_TCHAR> (coefficient * ACE_OS::rand_r (seed));
+ r = static_cast<ACE_TCHAR> (coefficient * ACE_OS::rand_r (&seed));
}
while (!ACE_OS::ace_isalnum (r));
diff --git a/dep/acelite/ace/OS_NS_stdlib.h b/dep/acelite/ace/OS_NS_stdlib.h
index 28e11a96be5..4a35fe9d8e0 100644
--- a/dep/acelite/ace/OS_NS_stdlib.h
+++ b/dep/acelite/ace/OS_NS_stdlib.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_stdlib.h
*
- * $Id: OS_NS_stdlib.h 88493 2010-01-12 19:17:42Z olli $
+ * $Id: OS_NS_stdlib.h 93571 2011-03-17 07:37:11Z olli $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -272,7 +272,7 @@ namespace ACE_OS {
int rand (void);
ACE_NAMESPACE_INLINE_FUNCTION
- int rand_r (ACE_RANDR_TYPE &seed);
+ int rand_r (unsigned int *seed);
extern ACE_Export
void *realloc (void *, size_t);
diff --git a/dep/acelite/ace/OS_NS_stdlib.inl b/dep/acelite/ace/OS_NS_stdlib.inl
index 97d04e8d855..65e005f9bb7 100644
--- a/dep/acelite/ace/OS_NS_stdlib.inl
+++ b/dep/acelite/ace/OS_NS_stdlib.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_stdlib.inl 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: OS_NS_stdlib.inl 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/config-all.h" /* Need ACE_TRACE */
#include "ace/Object_Manager_Base.h"
@@ -35,12 +35,11 @@ ACE_OS::_exit (int status)
ACE_INLINE void
ACE_OS::abort (void)
{
-#if !defined (ACE_HAS_WINCE)
+#if !defined (ACE_LACKS_ABORT)
::abort ();
#else
- // @@ CE doesn't support abort?
exit (1);
-#endif /* !ACE_HAS_WINCE */
+#endif /* !ACE_LACKS_ABORT */
}
ACE_INLINE int
@@ -403,45 +402,25 @@ ACE_OS::rand (void)
ACE_OSCALL_RETURN (::rand (), int, -1);
}
-#if !defined (ACE_WIN32)
-
-ACE_INLINE int
-ACE_OS::rand_r (ACE_RANDR_TYPE &seed)
-{
- ACE_OS_TRACE ("ACE_OS::rand_r");
-# if defined (ACE_HAS_REENTRANT_FUNCTIONS) && \
- !defined (ACE_LACKS_RAND_REENTRANT_FUNCTIONS)
-# if defined (ACE_HAS_BROKEN_RANDR)
- ACE_OSCALL_RETURN (::rand_r (seed), int, -1);
-# else
- ACE_OSCALL_RETURN (::rand_r (&seed), int, -1);
-# endif /* ACE_HAS_BROKEN_RANDR */
-# else
- ACE_UNUSED_ARG (seed);
- ACE_OSCALL_RETURN (::rand (), int, -1);
-# endif /* ACE_HAS_REENTRANT_FUNCTIONS */
-}
-
-#else /* ACE_WIN32 */
-
ACE_INLINE int
-ACE_OS::rand_r (ACE_RANDR_TYPE& seed)
+ACE_OS::rand_r (unsigned int *seed)
{
ACE_OS_TRACE ("ACE_OS::rand_r");
-
- long new_seed = (long) (seed);
+#if defined (ACE_LACKS_RAND_R)
+ long new_seed = (long) *seed;
if (new_seed == 0)
new_seed = 0x12345987;
long temp = new_seed / 127773;
new_seed = 16807 * (new_seed - temp * 127773) - 2836 * temp;
if (new_seed < 0)
new_seed += 2147483647;
- (seed) = (unsigned int)new_seed;
+ *seed = (unsigned int)new_seed;
return (int) (new_seed & RAND_MAX);
+#else
+ return ::rand_r (seed);
+# endif /* ACE_LACKS_RAND_R */
}
-#endif /* !ACE_WIN32 */
-
# if !defined (ACE_LACKS_REALPATH)
ACE_INLINE char *
ACE_OS::realpath (const char *file_name,
@@ -612,8 +591,6 @@ ACE_OS::system (const ACE_TCHAR *s)
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
ACE_OSCALL_RETURN (::_wsystem (s), int, -1);
-#elif defined (ACE_TANDEM_T1248_PTHREADS)
- ACE_OSCALL_RETURN (::spt_system (s), int, -1);
#else
ACE_OSCALL_RETURN (::system (ACE_TEXT_ALWAYS_CHAR (s)), int, -1);
#endif /* ACE_LACKS_SYSTEM */
diff --git a/dep/acelite/ace/OS_NS_string.cpp b/dep/acelite/ace/OS_NS_string.cpp
index 93e112d60c8..067bb1c66a3 100644
--- a/dep/acelite/ace/OS_NS_string.cpp
+++ b/dep/acelite/ace/OS_NS_string.cpp
@@ -1,4 +1,4 @@
-// $Id: OS_NS_string.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: OS_NS_string.cpp 93549 2011-03-15 19:50:24Z olli $
#include "ace/ACE.h"
#include "ace/OS_NS_string.h"
@@ -368,8 +368,7 @@ ACE_OS::strsncpy (ACE_WCHAR_T *dst, const ACE_WCHAR_T *src, size_t maxlen)
return dst;
}
-#if (!defined (ACE_HAS_REENTRANT_FUNCTIONS) || defined (ACE_LACKS_STRTOK_R)) \
- && !defined (ACE_HAS_TR24731_2005_CRT)
+#if defined (ACE_LACKS_STRTOK_R)
char *
ACE_OS::strtok_r_emulation (char *s, const char *tokens, char **lasts)
{
@@ -390,7 +389,7 @@ ACE_OS::strtok_r_emulation (char *s, const char *tokens, char **lasts)
*lasts = s + l_sub;
return s ;
}
-#endif /* !ACE_HAS_REENTRANT_FUNCTIONS */
+#endif /* ACE_LACKS_STRTOK_R */
# if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSTOK)
wchar_t*
diff --git a/dep/acelite/ace/OS_NS_string.h b/dep/acelite/ace/OS_NS_string.h
index 54da02a8ba8..d881d7f738f 100644
--- a/dep/acelite/ace/OS_NS_string.h
+++ b/dep/acelite/ace/OS_NS_string.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_string.h
*
- * $Id: OS_NS_string.h 91995 2010-09-24 12:45:24Z johnnyw $
+ * $Id: OS_NS_string.h 93549 2011-03-15 19:50:24Z olli $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -449,11 +449,11 @@ namespace ACE_OS {
wchar_t *strtok_r (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts);
#endif // ACE_HAS_WCHAR
-#if !defined (ACE_HAS_REENTRANT_FUNCTIONS) || defined (ACE_LACKS_STRTOK_R)
+#if defined (ACE_LACKS_STRTOK_R)
/// Emulated strtok_r.
extern ACE_Export
char *strtok_r_emulation (char *s, const char *tokens, char **lasts);
-#endif /* !ACE_HAS_REENTRANT_FUNCTIONS */
+#endif /* ACE_LACKS_STRTOK_R */
# if defined (ACE_HAS_WCHAR) && defined(ACE_LACKS_WCSTOK)
/// Emulated strtok_r (wchar_t version).
diff --git a/dep/acelite/ace/OS_NS_string.inl b/dep/acelite/ace/OS_NS_string.inl
index 52ade6993fa..e12a6d22524 100644
--- a/dep/acelite/ace/OS_NS_string.inl
+++ b/dep/acelite/ace/OS_NS_string.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_string.inl 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: OS_NS_string.inl 93549 2011-03-15 19:50:24Z olli $
// OS_NS_wchar.h is only needed to get the emulation methods.
// Perhaps they should be moved. dhinton
@@ -526,11 +526,11 @@ ACE_OS::strtok_r (char *s, const char *tokens, char **lasts)
{
#if defined (ACE_HAS_TR24731_2005_CRT)
return strtok_s (s, tokens, lasts);
-#elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (ACE_LACKS_STRTOK_R)
- return ::strtok_r (s, tokens, lasts);
-#else
+#elif defined (ACE_LACKS_STRTOK_R)
return ACE_OS::strtok_r_emulation (s, tokens, lasts);
-#endif /* (ACE_HAS_REENTRANT_FUNCTIONS) */
+#else
+ return ::strtok_r (s, tokens, lasts);
+#endif /* ACE_HAS_TR24731_2005_CRT */
}
#if defined (ACE_HAS_WCHAR)
diff --git a/dep/acelite/ace/OS_NS_sys_mman.cpp b/dep/acelite/ace/OS_NS_sys_mman.cpp
index 340511eb020..8f80280e983 100644
--- a/dep/acelite/ace/OS_NS_sys_mman.cpp
+++ b/dep/acelite/ace/OS_NS_sys_mman.cpp
@@ -1,9 +1,7 @@
-// $Id: OS_NS_sys_mman.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_sys_mman.cpp 92837 2010-12-08 17:31:02Z johnnyw $
#include "ace/OS_NS_sys_mman.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_sys_mman.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
diff --git a/dep/acelite/ace/OS_NS_sys_mman.inl b/dep/acelite/ace/OS_NS_sys_mman.inl
index fb8a9a0b657..2e9460b5036 100644
--- a/dep/acelite/ace/OS_NS_sys_mman.inl
+++ b/dep/acelite/ace/OS_NS_sys_mman.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_sys_mman.inl 85429 2009-05-25 09:53:48Z johnnyw $
+// $Id: OS_NS_sys_mman.inl 92464 2010-11-01 14:58:30Z mitza $
#include "ace/OS_NS_fcntl.h"
#include "ace/OS_NS_unistd.h"
@@ -102,11 +102,18 @@ ACE_OS::mmap (void *addr,
&sa_buffer,
&sd_buffer);
+# ifdef ACE_WIN64
+ const DWORD len_low = static_cast<DWORD>(len),
+ len_high = static_cast<DWORD>(len >> 32);
+# else
+ const DWORD len_low = len, len_high = 0;
+# endif
+
*file_mapping = ACE_TEXT_CreateFileMapping (file_handle,
attr,
prot,
- 0,
- (file_handle == ACE_INVALID_HANDLE) ? len : 0,
+ (file_handle == ACE_INVALID_HANDLE) ? len_high : 0,
+ (file_handle == ACE_INVALID_HANDLE) ? len_low : 0,
file_mapping_name);
}
diff --git a/dep/acelite/ace/OS_NS_sys_msg.cpp b/dep/acelite/ace/OS_NS_sys_msg.cpp
index d59e47e7c00..789c32a4731 100644
--- a/dep/acelite/ace/OS_NS_sys_msg.cpp
+++ b/dep/acelite/ace/OS_NS_sys_msg.cpp
@@ -1,9 +1,7 @@
-// $Id: OS_NS_sys_msg.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_sys_msg.cpp 92837 2010-12-08 17:31:02Z johnnyw $
#include "ace/OS_NS_sys_msg.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_sys_msg.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
diff --git a/dep/acelite/ace/OS_NS_sys_select.inl b/dep/acelite/ace/OS_NS_sys_select.inl
index e58c6166ed5..ef1d4bed72e 100644
--- a/dep/acelite/ace/OS_NS_sys_select.inl
+++ b/dep/acelite/ace/OS_NS_sys_select.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_sys_select.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: OS_NS_sys_select.inl 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/OS_NS_errno.h"
#include "ace/OS_NS_macros.h"
@@ -38,9 +38,6 @@ ACE_OS::select (int width,
ACE_UNUSED_ARG (efds);
ACE_UNUSED_ARG (timeout);
ACE_NOTSUP_RETURN (-1);
-#elif defined(ACE_TANDEM_T1248_PTHREADS)
- ACE_SOCKCALL_RETURN (::spt_select (width, rfds, wfds, efds, timep),
- int, -1);
#else
ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, timep),
int, -1);
@@ -67,9 +64,6 @@ ACE_OS::select (int width,
ACE_UNUSED_ARG (efds);
ACE_UNUSED_ARG (timeout);
ACE_NOTSUP_RETURN (-1);
-#elif defined(ACE_TANDEM_T1248_PTHREADS)
- ACE_SOCKCALL_RETURN (::spt_select (width, rfds, wfds, efds, ___ACE_TIMEOUT),
- int, -1);
#else
ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, ___ACE_TIMEOUT),
int, -1);
diff --git a/dep/acelite/ace/OS_NS_sys_shm.h b/dep/acelite/ace/OS_NS_sys_shm.h
index 9f34b482bc9..5edb851171a 100644
--- a/dep/acelite/ace/OS_NS_sys_shm.h
+++ b/dep/acelite/ace/OS_NS_sys_shm.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_sys_shm.h
*
- * $Id: OS_NS_sys_shm.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: OS_NS_sys_shm.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_OS
{
-
//@{ @name A set of wrappers for System V shared memory.
ACE_NAMESPACE_INLINE_FUNCTION
void *shmat (int int_id,
@@ -56,8 +55,7 @@ namespace ACE_OS
int shmget (key_t key,
size_t size,
int flags);
- ///@}
-
+ //@}
} /* namespace ACE_OS */
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/OS_NS_sys_socket.cpp b/dep/acelite/ace/OS_NS_sys_socket.cpp
index 3ce26a82490..8e64d6635ca 100644
--- a/dep/acelite/ace/OS_NS_sys_socket.cpp
+++ b/dep/acelite/ace/OS_NS_sys_socket.cpp
@@ -1,4 +1,4 @@
-// $Id: OS_NS_sys_socket.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_sys_socket.cpp 93822 2011-04-08 21:56:45Z mesnier_p $
#include "ace/OS_NS_sys_socket.h"
@@ -8,6 +8,8 @@
# include "ace/OS_NS_sys_socket.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
+#include "ace/Containers_T.h"
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if defined (ACE_WIN32)
@@ -156,4 +158,123 @@ ACE_OS::socket_fini (void)
return 0;
}
+ssize_t
+ACE_OS::sendv_partial_i (ACE_HANDLE handle,
+ const iovec *buffers,
+ int n)
+{
+ // the divide and conquer logic should remain consistent
+ // with send_partial_i
+#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
+ DWORD bytes_sent = 0;
+ int result = 1;
+ int simulated_n = n;
+ ACE_UINT64 buffer_size = 0;
+ ACE_Array<iovec> iovec_array(simulated_n);
+ int i = 0;
+ for ( ; i < simulated_n; ++i)
+ {
+ iovec_array[i].iov_base = buffers[i].iov_base;
+ iovec_array[i].iov_len = buffers[i].iov_len;
+ buffer_size += buffers[i].iov_len;
+ }
+ // keep dividing the current buffer_size in half and then
+ // attempt to send the modified iovec buffer until some
+ // data is sent, or we get an errno that is not ENOBUFS
+ while (true)
+ {
+ ACE_UINT64 remove_size = buffer_size / 2;
+ buffer_size -= remove_size;
+ for (i = simulated_n - 1; (i >= 0) && (remove_size > 0); --i)
+ {
+ // if the buffer division splits an iovec, we need
+ // to set its iov_len properly
+ if (iovec_array[i].iov_len > remove_size)
+ {
+ iovec_array[i].iov_len -= static_cast<u_long>(remove_size);
+ break;
+ }
+ remove_size -= iovec_array[i].iov_len;
+ }
+
+ simulated_n = i + 1;
+
+ result = ::WSASend ((SOCKET) handle,
+ (WSABUF *) &(iovec_array[0]),
+ simulated_n,
+ &bytes_sent,
+ 0,
+ 0,
+ 0);
+ if (result != SOCKET_ERROR)
+ break;
+
+ ACE_OS::set_errno_to_wsa_last_error ();
+ // if ENOBUFS is received, we apply a divide and
+ // conquer strategy, but if bytes are sent we
+ // cannot guarantee this is the same behavior
+ if ((errno != ENOBUFS) ||
+ (bytes_sent != 0))
+ {
+ return -1;
+ }
+ }
+
+ return (ssize_t) bytes_sent;
+# else
+ ACE_UNUSED_ARG (handle);
+ ACE_UNUSED_ARG (buffers);
+ ACE_UNUSED_ARG (n);
+
+ return -1;
+# endif /* ACE_HAS_WINSOCK2 */
+}
+
+ssize_t
+ACE_OS::send_partial_i (ACE_HANDLE handle,
+ const char *buf,
+ size_t len,
+ int flags)
+{
+ // the divide and conquer logic should remain consistent
+ // with sendv_partial_i
+#if !defined (ACE_LACKS_SEND) && defined (ACE_WIN32)
+ DWORD bytes_sent = 0;
+ ssize_t result = 1;
+ // keep dividing the current buffer_size in half and then
+ // attempt to send the modified buffer until some data is
+ // sent, or we get an errno that is not ENOBUFS
+ while (true)
+ {
+ len -= len / 2;
+
+ result = (ssize_t) ::send ((SOCKET) handle,
+ buf,
+ static_cast<int> (len),
+ flags);
+ if (result != SOCKET_ERROR)
+ break;
+
+ ACE_OS::set_errno_to_wsa_last_error ();
+ // if ENOBUFS is received, we apply a divide and
+ // conquer strategy, but if bytes are sent we
+ // cannot guarantee this is the same behavior
+ if ((errno != ENOBUFS) ||
+ (bytes_sent != 0))
+ {
+ return -1;
+ }
+ }
+
+ return result;
+# else
+ ACE_UNUSED_ARG (handle);
+ ACE_UNUSED_ARG (buf);
+ ACE_UNUSED_ARG (len);
+ ACE_UNUSED_ARG (flags);
+
+ return -1;
+# endif /* ACE_LACKS_SEND && ACE_WIN32 */
+}
+
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/OS_NS_sys_socket.h b/dep/acelite/ace/OS_NS_sys_socket.h
index fc5d8901cfe..860de8dfb92 100644
--- a/dep/acelite/ace/OS_NS_sys_socket.h
+++ b/dep/acelite/ace/OS_NS_sys_socket.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_sys_socket.h
*
- * $Id: OS_NS_sys_socket.h 85110 2009-04-20 09:18:43Z msmit $
+ * $Id: OS_NS_sys_socket.h 95533 2012-02-14 22:59:17Z wotte $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -192,6 +192,14 @@ namespace ACE_OS
size_t len,
int flags = 0);
+ /// internal function used by send when an ENOBUFS condition
+ /// requires a buffer to do a partial send
+ extern ACE_Export
+ ssize_t send_partial_i (ACE_HANDLE handle,
+ const char *buf,
+ size_t len,
+ int flags);
+
ACE_NAMESPACE_INLINE_FUNCTION
ssize_t sendmsg (ACE_HANDLE handle,
const struct msghdr *msg,
@@ -221,6 +229,12 @@ namespace ACE_OS
const iovec *iov,
int iovcnt);
+ /// internal function used by sendv when an ENOBUFS condition
+ /// requires a buffer to do a partial send
+ extern ACE_Export
+ ssize_t sendv_partial_i (ACE_HANDLE handle,
+ const iovec *iov,
+ int iovcnt);
/// Manipulate the options associated with a socket.
ACE_NAMESPACE_INLINE_FUNCTION
@@ -234,7 +248,7 @@ namespace ACE_OS
int shutdown (ACE_HANDLE handle,
int how);
-#if defined (__linux__) && defined (ACE_HAS_IPV6)
+#if defined (ACE_LINUX) && defined (ACE_HAS_IPV6)
ACE_NAMESPACE_INLINE_FUNCTION
unsigned int if_nametoindex (const char *ifname);
@@ -246,7 +260,7 @@ namespace ACE_OS
ACE_NAMESPACE_INLINE_FUNCTION
void if_freenameindex (struct if_nameindex *ptr);
-#endif /* __linux__ && ACE_HAS_IPV6 */
+#endif /* ACE_LINUX && ACE_HAS_IPV6 */
/// Initialize WinSock before first use (e.g., when a DLL is first
/// loaded or the first use of a socket() call.
diff --git a/dep/acelite/ace/OS_NS_sys_socket.inl b/dep/acelite/ace/OS_NS_sys_socket.inl
index f55ead2c3d7..c4ca358207c 100644
--- a/dep/acelite/ace/OS_NS_sys_socket.inl
+++ b/dep/acelite/ace/OS_NS_sys_socket.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_sys_socket.inl 91626 2010-09-07 10:59:20Z johnnyw $
+// $Id: OS_NS_sys_socket.inl 95533 2012-02-14 22:59:17Z wotte $
#include "ace/OS_NS_errno.h"
#include "ace/OS_NS_macros.h"
@@ -572,10 +572,21 @@ ACE_OS::send (ACE_HANDLE handle, const char *buf, size_t len, int flags)
ACE_UNUSED_ARG (flags);
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_WIN32)
- ACE_SOCKCALL_RETURN (::send ((ACE_SOCKET) handle,
- buf,
- static_cast<int> (len),
- flags), ssize_t, -1);
+ ssize_t result = ::send ((ACE_SOCKET) handle,
+ buf,
+ static_cast<int> (len),
+ flags);
+ if (result == -1)
+ {
+ ACE_OS::set_errno_to_wsa_last_error();
+ if (errno != ENOBUFS)
+ return -1;
+
+ ACE_SOCKCALL_RETURN(send_partial_i(handle, buf, len, flags), ssize_t, -1);
+ }
+ else
+ return result;
+
#else
ssize_t const ace_result_ = ::send ((ACE_SOCKET) handle, buf, len, flags);
@@ -761,7 +772,18 @@ ACE_OS::sendv (ACE_HANDLE handle,
if (result == SOCKET_ERROR)
{
ACE_OS::set_errno_to_wsa_last_error ();
- return -1;
+ if ((errno != ENOBUFS) ||
+ (bytes_sent != 0))
+ {
+ return -1;
+ }
+ result = sendv_partial_i(handle, buffers, n);
+ if (result == SOCKET_ERROR)
+ {
+ ACE_OS::set_errno_to_wsa_last_error ();
+ return -1;
+ }
+ bytes_sent = static_cast<DWORD>(result);
}
# else
for (int i = 0; i < n; ++i)
@@ -965,7 +987,7 @@ ACE_OS::socketpair (int domain, int type,
#endif /* ACE_LACKS_SOCKETPAIR */
}
-#if defined (__linux__) && defined (ACE_HAS_IPV6)
+#if defined (ACE_LINUX) && defined (ACE_HAS_IPV6)
ACE_INLINE unsigned int
ACE_OS::if_nametoindex (const char *ifname)
{
@@ -994,6 +1016,6 @@ ACE_OS::if_freenameindex (struct if_nameindex *ptr)
if (ptr != 0)
::if_freenameindex (ptr);
}
-#endif /* __linux__ && ACE_HAS_IPV6 */
+#endif /* ACE_LINUX && ACE_HAS_IPV6 */
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/OS_NS_sys_time.cpp b/dep/acelite/ace/OS_NS_sys_time.cpp
index d47c4ba1d23..39a5858829b 100644
--- a/dep/acelite/ace/OS_NS_sys_time.cpp
+++ b/dep/acelite/ace/OS_NS_sys_time.cpp
@@ -1,9 +1,7 @@
-// $Id: OS_NS_sys_time.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_sys_time.cpp 95719 2012-05-01 12:54:01Z johnnyw $
#include "ace/OS_NS_sys_time.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_sys_time.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
diff --git a/dep/acelite/ace/OS_NS_sys_utsname.cpp b/dep/acelite/ace/OS_NS_sys_utsname.cpp
index b6dc6d31c05..f9efec38df5 100644
--- a/dep/acelite/ace/OS_NS_sys_utsname.cpp
+++ b/dep/acelite/ace/OS_NS_sys_utsname.cpp
@@ -1,9 +1,6 @@
-// $Id: OS_NS_sys_utsname.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_sys_utsname.cpp 93543 2011-03-14 08:25:46Z johnnyw $
#include "ace/OS_NS_sys_utsname.h"
-
-
-
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_unistd.h"
@@ -81,11 +78,7 @@ ACE_OS::uname (ACE_utsname *name)
char processor[bufsize] = "Unknown";
char subtype[bufsize] = "Unknown";
-# if defined (ghs)
- WORD arch = sinfo.u.s.wProcessorArchitecture;
-# else
WORD arch = sinfo.wProcessorArchitecture;
-# endif
switch (arch)
{
diff --git a/dep/acelite/ace/OS_NS_sys_wait.cpp b/dep/acelite/ace/OS_NS_sys_wait.cpp
index 148d778e40b..fbb2608b321 100644
--- a/dep/acelite/ace/OS_NS_sys_wait.cpp
+++ b/dep/acelite/ace/OS_NS_sys_wait.cpp
@@ -1,9 +1,7 @@
-// $Id: OS_NS_sys_wait.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_sys_wait.cpp 92712 2010-11-25 12:22:13Z johnnyw $
#include "ace/OS_NS_sys_wait.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_sys_wait.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
diff --git a/dep/acelite/ace/OS_NS_sys_wait.inl b/dep/acelite/ace/OS_NS_sys_wait.inl
index 02333b409a1..7ae954e0e85 100644
--- a/dep/acelite/ace/OS_NS_sys_wait.inl
+++ b/dep/acelite/ace/OS_NS_sys_wait.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_sys_wait.inl 91781 2010-09-15 12:49:15Z johnnyw $
+// $Id: OS_NS_sys_wait.inl 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/OS_NS_errno.h"
#include "ace/Global_Macros.h"
@@ -76,10 +76,6 @@ ACE_OS::waitpid (pid_t pid,
if (handle == 0)
::CloseHandle (phandle);
return result;
-#elif defined(ACE_TANDEM_T1248_PTHREADS)
- ACE_UNUSED_ARG (handle);
- ACE_OSCALL_RETURN (::spt_waitpid (pid, status, wait_options),
- pid_t, -1);
#else
ACE_UNUSED_ARG (handle);
ACE_OSCALL_RETURN (::waitpid (pid, status, wait_options),
diff --git a/dep/acelite/ace/OS_NS_time.cpp b/dep/acelite/ace/OS_NS_time.cpp
index 2e7aedf23b1..836e257675f 100644
--- a/dep/acelite/ace/OS_NS_time.cpp
+++ b/dep/acelite/ace/OS_NS_time.cpp
@@ -1,9 +1,7 @@
-// $Id: OS_NS_time.cpp 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: OS_NS_time.cpp 93561 2011-03-16 14:02:24Z olli $
#include "ace/OS_NS_time.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_time.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
@@ -225,24 +223,9 @@ struct tm *
ACE_OS::localtime_r (const time_t *t, struct tm *res)
{
ACE_OS_TRACE ("ACE_OS::localtime_r");
-#if defined (ACE_HAS_REENTRANT_FUNCTIONS)
- ACE_OSCALL_RETURN (::localtime_r (t, res), struct tm *, 0);
-#elif defined (ACE_HAS_TR24731_2005_CRT)
+#if defined (ACE_HAS_TR24731_2005_CRT)
ACE_SECURECRTCALL (localtime_s (res, t), struct tm *, 0, res);
return res;
-#elif !defined (ACE_HAS_WINCE)
- ACE_OS_GUARD
-
- ACE_UNUSED_ARG (res);
- struct tm * res_ptr = 0;
- ACE_OSCALL (::localtime (t), struct tm *, 0, res_ptr);
- if (res_ptr == 0)
- return 0;
- else
- {
- *res = *res_ptr;
- return res;
- }
#elif defined (ACE_HAS_WINCE)
// This is really stupid, converting FILETIME to timeval back and
// forth. It assumes FILETIME and DWORDLONG are the same structure
@@ -292,13 +275,22 @@ ACE_OS::localtime_r (const time_t *t, struct tm *res)
res->tm_year = res->tm_year - 1900;
return res;
-#else
- // @@ Same as ACE_OS::localtime (), you need to implement it
- // yourself.
- ACE_UNUSED_ARG (t);
+#elif defined (ACE_LACKS_LOCALTIME_R)
+ ACE_OS_GUARD
+
ACE_UNUSED_ARG (res);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_REENTRANT_FUNCTIONS */
+ struct tm * res_ptr = 0;
+ ACE_OSCALL (::localtime (t), struct tm *, 0, res_ptr);
+ if (res_ptr == 0)
+ return 0;
+ else
+ {
+ *res = *res_ptr;
+ return res;
+ }
+#else
+ ACE_OSCALL_RETURN (::localtime_r (t, res), struct tm *, 0);
+#endif /* ACE_HAS_TR24731_2005_CRT */
}
time_t
@@ -329,28 +321,6 @@ ACE_OS::mktime (struct tm *t)
# endif /* ACE_HAS_WINCE */
}
-#if defined (ACE_HAS_POWERPC_TIMER) && defined (ghs)
-void
-ACE_OS::readPPCTimeBase (u_long &most, u_long &least)
-{
- ACE_OS_TRACE ("ACE_OS::readPPCTimeBase");
-
- // This function can't be inline because it depends on the arguments
- // being in particular registers (r3 and r4), in conformance with the
- // EABI standard. It would be nice if we knew how to put the variable
- // names directly into the assembler instructions . . .
- asm("aclock:");
- asm("mftb r5,TBU");
- asm("mftb r6,TBL");
- asm("mftb r7,TBU");
- asm("cmpw r5,r7");
- asm("bne aclock");
-
- asm("stw r5, 0(r3)");
- asm("stw r6, 0(r4)");
-}
-#endif /* ACE_HAS_POWERPC_TIMER && ghs */
-
#if defined (ACE_LACKS_STRPTIME)
char *
ACE_OS::strptime_emulation (const char *buf, const char *format, struct tm *tm)
diff --git a/dep/acelite/ace/OS_NS_time.h b/dep/acelite/ace/OS_NS_time.h
index dc22f0a0cbd..078dd9a6948 100644
--- a/dep/acelite/ace/OS_NS_time.h
+++ b/dep/acelite/ace/OS_NS_time.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_time.h
*
- * $Id: OS_NS_time.h 87260 2009-10-29 14:00:43Z olli $
+ * $Id: OS_NS_time.h 95763 2012-05-16 06:43:51Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -94,11 +94,11 @@ inline long ace_timezone()
#if !defined (ACE_LACKS_DIFFTIME)
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) \
+# if defined (_WIN32_WCE) && ((_WIN32_WCE >= 0x600) && (_WIN32_WCE <= 0x700)) && !defined (_USE_32BIT_TIME_T) \
&& defined (_MSC_VER)
- // The WinCE 6.0 SDK ships with a diff_time that uses __time32_t as type
+ // The WinCE 6.0/7.0 SDK ships with a diff_time that uses __time32_t as type
// not time_t. This resolves in compilation warnings because time_t
- // can be 64bit. Disable at this momemt the warning for just this method
+ // can be 64bit. Disable at this moment the warning for just this method
// else we get two compile warnings on each source file that includes
// this file.
# pragma warning (push)
@@ -117,42 +117,32 @@ inline double ace_difftime(time_t t1, time_t t0)
{
return difftime (t1, t0);
}
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) \
+# if defined (_WIN32_WCE) && ((_WIN32_WCE >= 0x600) && (_WIN32_WCE <= 0x700)) && !defined (_USE_32BIT_TIME_T) \
&& defined (_MSC_VER)
# pragma warning (pop)
# endif
#endif /* !ACE_LACKS_DIFFTIME */
# if defined (ACE_WIN32)
-# if !defined (ACE_LACKS_LONGLONG_T)
// 64-bit quad-word definitions.
typedef unsigned __int64 ACE_QWORD;
typedef unsigned __int64 ACE_hrtime_t;
inline ACE_QWORD ACE_MAKE_QWORD (DWORD lo, DWORD hi) { return ACE_QWORD (lo) | (ACE_QWORD (hi) << 32); }
inline DWORD ACE_LOW_DWORD (ACE_QWORD q) { return (DWORD) q; }
inline DWORD ACE_HIGH_DWORD (ACE_QWORD q) { return (DWORD) (q >> 32); }
-# else
-// Can't find ANY place that ACE_QWORD is used, but hrtime_t is.
-typedef ACE_UINT64 ACE_hrtime_t;
-# endif // ACE_LACKS_LONGLONG_T
# elif defined (_TNS_R_TARGET)
typedef long long ACE_hrtime_t;
# else /* !ACE_WIN32 */
-# if defined (ACE_HAS_HI_RES_TIMER) && !defined (ACE_LACKS_LONGLONG_T)
+# if defined (ACE_HAS_HI_RES_TIMER)
/* hrtime_t is defined on systems (Suns) with ACE_HAS_HI_RES_TIMER */
typedef hrtime_t ACE_hrtime_t;
-# else /* ! ACE_HAS_HI_RES_TIMER || ACE_LACKS_LONGLONG_T */
+# else /* ! ACE_HAS_HI_RES_TIMER */
typedef ACE_UINT64 ACE_hrtime_t;
-# endif /* ! ACE_HAS_HI_RES_TIMER || ACE_LACKS_LONGLONG_T */
+# endif /* ! ACE_HAS_HI_RES_TIMER */
# endif /* ACE_WIN32 */
-# if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
-# define ACE_HRTIME_CONVERSION(VAL) ACE_U64_TO_U32(VAL)
-# define ACE_HRTIME_TO_U64(VAL) ACE_U_LongLong(VAL)
-# else
-# define ACE_HRTIME_CONVERSION(VAL) (VAL)
-# define ACE_HRTIME_TO_U64(VAL) (VAL)
-# endif
+#define ACE_HRTIME_CONVERSION(VAL) (VAL)
+#define ACE_HRTIME_TO_U64(VAL) (VAL)
namespace ACE_OS
{
@@ -216,6 +206,29 @@ namespace ACE_OS
struct tm *localtime_r (const time_t *clock,
struct tm *res);
+#if defined (ACE_USES_ULONG_FOR_STAT_TIME)
+ ACE_NAMESPACE_INLINE_FUNCTION
+ ACE_TCHAR *ctime (const unsigned long *t);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
+ ACE_TCHAR *ctime_r (const unsigned long *clock, ACE_TCHAR *buf, int buflen);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
+ struct tm *gmtime (const unsigned long *clock);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
+ struct tm *gmtime_r (const unsigned long *clock,
+ struct tm *res);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
+ struct tm *localtime (const unsigned long *clock);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
+ struct tm *localtime_r (const unsigned long *clock,
+ struct tm *res);
+#endif
+
+
// Get the current time.
extern ACE_Export
time_t mktime (struct tm *timeptr);
@@ -224,17 +237,12 @@ namespace ACE_OS
int nanosleep (const struct timespec *requested,
struct timespec *remaining = 0);
-# if defined (ACE_HAS_POWERPC_TIMER) && defined (ghs)
- extern ACE_Export
- void readPPCTimeBase (u_long &most,
- u_long &least);
-# endif /* ACE_HAS_POWERPC_TIMER && ghs */
-
ACE_NAMESPACE_INLINE_FUNCTION
size_t strftime (char *s,
size_t maxsize,
const char *format,
- const struct tm *timeptr);
+ const struct tm *timeptr)
+ ACE_GCC_FORMAT_ATTRIBUTE (strftime, 3, 0);
/**
* strptime wrapper. Note that the struct @a tm will always be set to
diff --git a/dep/acelite/ace/OS_NS_time.inl b/dep/acelite/ace/OS_NS_time.inl
index c89fba5accb..0d99bb88028 100644
--- a/dep/acelite/ace/OS_NS_time.inl
+++ b/dep/acelite/ace/OS_NS_time.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_time.inl 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: OS_NS_time.inl 95763 2012-05-16 06:43:51Z johnnyw $
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_errno.h"
@@ -199,6 +199,48 @@ ACE_OS::ctime_r (const time_t *t, ACE_TCHAR *buf, int buflen)
}
#endif /* !ACE_HAS_WINCE */
+#if defined (ACE_USES_ULONG_FOR_STAT_TIME)
+ACE_INLINE ACE_TCHAR *
+ACE_OS::ctime (const unsigned long *t)
+{
+ return ACE_OS::ctime (reinterpret_cast<const time_t *>(t));
+}
+
+ACE_INLINE ACE_TCHAR *
+ACE_OS::ctime_r (const unsigned long *clock, ACE_TCHAR *buf, int buflen)
+{
+ return ACE_OS::ctime_r (reinterpret_cast<const time_t *>(clock), buf, buflen);
+}
+
+ACE_INLINE struct tm *
+ACE_OS::gmtime (const unsigned long *clock)
+{
+ return ACE_OS::gmtime (reinterpret_cast<const time_t *>(clock));
+}
+
+ACE_INLINE struct tm *
+ACE_OS::gmtime_r (const unsigned long *clock,
+ struct tm *res)
+{
+ return ACE_OS::gmtime_r (reinterpret_cast<const time_t *>(clock), res);
+}
+
+ACE_INLINE struct tm *
+ACE_OS::localtime (const unsigned long *clock)
+{
+ return ACE_OS::localtime (reinterpret_cast<const time_t *>(clock));
+}
+
+ACE_INLINE struct tm *
+ACE_OS::localtime_r (const unsigned long *clock,
+ struct tm *res)
+{
+ return ACE_OS::localtime_r (reinterpret_cast<const time_t *>(clock), res);
+}
+
+
+#endif
+
#if !defined (ACE_LACKS_DIFFTIME)
ACE_INLINE double
ACE_OS::difftime (time_t t1, time_t t0)
@@ -207,10 +249,6 @@ ACE_OS::difftime (time_t t1, time_t t0)
}
#endif /* ! ACE_LACKS_DIFFTIME */
-#if defined (ghs) && defined (ACE_HAS_PENTIUM) && !defined (ACE_WIN32)
- extern "C" ACE_hrtime_t ACE_GETHRTIME_NAME ();
-#endif /* ghs && ACE_HAS_PENTIUM */
-
ACE_INLINE ACE_hrtime_t
ACE_OS::gethrtime (const ACE_HRTimer_Op op)
{
@@ -232,24 +270,14 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
::QueryPerformanceCounter (&freq);
-# if defined (ACE_LACKS_LONGLONG_T)
- ACE_UINT64 uint64_freq (freq.u.LowPart,
- static_cast<unsigned int> (freq.u.HighPart));
- return uint64_freq;
-# else
return freq.QuadPart;
-# endif //ACE_LACKS_LONGLONG_T
#elif defined (ghs) && defined (ACE_HAS_PENTIUM)
ACE_UNUSED_ARG (op);
// Use .obj/gethrtime.o, which was compiled with g++.
return ACE_GETHRTIME_NAME ();
#elif (defined (__GNUG__) || defined (__INTEL_COMPILER)) && !defined(ACE_VXWORKS) && defined (ACE_HAS_PENTIUM)
ACE_UNUSED_ARG (op);
-# if defined (ACE_LACKS_LONGLONG_T)
- double now;
-# else /* ! ACE_LACKS_LONGLONG_T */
ACE_hrtime_t now;
-# endif /* ! ACE_LACKS_LONGLONG_T */
#if defined (__amd64__) || defined (__x86_64__)
// Read the high res tick counter into 32 bit int variables "eax" and
@@ -263,18 +291,8 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
asm volatile ("rdtsc" : "=A" (now) : : "memory");
#endif
-# if defined (ACE_LACKS_LONGLONG_T)
- ACE_UINT32 least, most;
- ACE_OS::memcpy (&least, &now, sizeof (ACE_UINT32));
- ACE_OS::memcpy (&most, (u_char *) &now + sizeof (ACE_UINT32),
- sizeof (ACE_UINT32));
-
- ACE_hrtime_t ret (least, most);
- return ret;
-# else /* ! ACE_LACKS_LONGLONG_T */
return now;
-# endif /* ! ACE_LACKS_LONGLONG_T */
-#elif defined (linux) && defined (ACE_HAS_ALPHA_TIMER)
+#elif defined (ACE_LINUX) && defined (ACE_HAS_ALPHA_TIMER)
// NOTE: alphas only have a 32 bit tick (cycle) counter. The rpcc
// instruction actually reads 64 bits, but the high 32 bits are
// implementation-specific. Linux and Digital Unix, for example,
@@ -310,11 +328,7 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
} while (most != scratch);
#endif
-#if defined (ACE_LACKS_LONGLONG_T)
- return ACE_U_LongLong (least, most);
-#else /* ! ACE_LACKS_LONGLONG_T */
return 0x100000000llu * most + least;
-#endif /* ! ACE_LACKS_LONGLONG_T */
#elif defined (ACE_HAS_CLOCK_GETTIME)
// e.g., VxWorks (besides POWERPC && GreenHills) . . .
@@ -330,7 +344,6 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
&ts);
// Carefully create the return value to avoid arithmetic overflow
- // if ACE_hrtime_t is ACE_U_LongLong.
return static_cast<ACE_hrtime_t> (ts.tv_sec) *
ACE_U_ONE_SECOND_IN_NSECS + static_cast<ACE_hrtime_t> (ts.tv_nsec);
#else
@@ -338,7 +351,6 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
ACE_Time_Value const now = ACE_OS::gettimeofday ();
// Carefully create the return value to avoid arithmetic overflow
- // if ACE_hrtime_t is ACE_U_LongLong.
return (static_cast<ACE_hrtime_t> (now.sec ()) * (ACE_UINT32) 1000000 +
static_cast<ACE_hrtime_t> (now.usec ())) * (ACE_UINT32) 1000;
#endif /* ACE_HAS_HI_RES_TIMER */
@@ -467,7 +479,7 @@ ACE_OS::timezone (void)
{
return ::ace_timezone ();
}
-#endif /* linux */
+#endif /* ACE_LINUX */
ACE_INLINE void
ACE_OS::tzset (void)
diff --git a/dep/acelite/ace/OS_NS_unistd.cpp b/dep/acelite/ace/OS_NS_unistd.cpp
index 66ff09f5c3d..1d2b56a358d 100644
--- a/dep/acelite/ace/OS_NS_unistd.cpp
+++ b/dep/acelite/ace/OS_NS_unistd.cpp
@@ -1,4 +1,4 @@
-// $Id: OS_NS_unistd.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_unistd.cpp 94448 2011-09-08 08:20:29Z johnnyw $
#include "ace/OS_NS_unistd.h"
@@ -22,22 +22,6 @@
# include "cpuset.h"
#endif /* ACE_HAS_VXCPULIB */
-#if defined (ACE_NEEDS_FTRUNCATE)
-extern "C" int
-ftruncate (ACE_HANDLE handle, long len)
-{
- struct flock fl;
- fl.l_whence = 0;
- fl.l_len = 0;
- fl.l_start = len;
- fl.l_type = F_WRLCK;
-
- return ACE_OS::fcntl (handle, F_FREESP, reinterpret_cast <long> (&fl));
-}
-#endif /* ACE_NEEDS_FTRUNCATE */
-
-/*****************************************************************************/
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
int
@@ -723,8 +707,11 @@ ACE_OS::pwrite (ACE_HANDLE handle,
return (ssize_t) bytes_written;
# else /* ACE_WIN32 */
-
+# if defined (ACE_HAS_NON_CONST_PWRITE)
+ return ::pwrite (handle, const_cast<void*> (buf), nbytes, offset);
+# else
return ::pwrite (handle, buf, nbytes, offset);
+# endif
# endif /* ACE_WIN32 */
# else /* ACE_HAS_P_READ_WRITE */
diff --git a/dep/acelite/ace/OS_NS_unistd.h b/dep/acelite/ace/OS_NS_unistd.h
index 489dc8e43e7..298e124175a 100644
--- a/dep/acelite/ace/OS_NS_unistd.h
+++ b/dep/acelite/ace/OS_NS_unistd.h
@@ -4,7 +4,7 @@
/**
* @file OS_NS_unistd.h
*
- * $Id: OS_NS_unistd.h 91066 2010-07-12 11:05:04Z johnnyw $
+ * $Id: OS_NS_unistd.h 92712 2010-11-25 12:22:13Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -31,18 +31,11 @@
#include "ace/os_include/os_unistd.h"
#include "ace/os_include/os_stdio.h"
-
#if defined (ACE_EXPORT_MACRO)
# undef ACE_EXPORT_MACRO
#endif
#define ACE_EXPORT_MACRO ACE_Export
-// This should go in os_unistd.h, but since we don't yet implement any code
-// at that level, we put it here. It used to be in OS.i.
-#if defined (ACE_NEEDS_FTRUNCATE)
-extern "C" ACE_Export int ftruncate (ACE_HANDLE handle, long len);
-#endif /* ACE_NEEDS_FTRUNCATE */
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_OS
diff --git a/dep/acelite/ace/OS_NS_unistd.inl b/dep/acelite/ace/OS_NS_unistd.inl
index 8de371fdb9a..cf23b832225 100644
--- a/dep/acelite/ace/OS_NS_unistd.inl
+++ b/dep/acelite/ace/OS_NS_unistd.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: OS_NS_unistd.inl 88515 2010-01-13 08:47:38Z johnnyw $
+// $Id: OS_NS_unistd.inl 96017 2012-08-08 22:18:09Z mitza $
#include "ace/OS_NS_sys_utsname.h"
#include "ace/OS_NS_string.h"
@@ -23,7 +23,7 @@
# include "ace/os_include/os_unistd.h"
#endif /* ACE_HAS_ACCESS_EMULATION */
-#if defined (ACE_VXWORKS) && (((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x680)) || defined (ACE_HAS_VXWORKS551_MEDUSA))
+#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x690)
# if defined (__RTP__)
# include "ace/os_include/os_strings.h"
# else
@@ -274,7 +274,7 @@ ACE_OS::execv (const char *path,
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_WIN32)
-# if defined (__BORLANDC__) /* VSB */
+# if defined (__BORLANDC__)
return ::execv (path, argv);
# elif defined (__MINGW32__)
return ::_execv (path, (char *const *) argv);
@@ -304,7 +304,7 @@ ACE_OS::execve (const char *path,
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_WIN32)
-# if defined (__BORLANDC__) /* VSB */
+# if defined (__BORLANDC__)
return ::execve (path, argv, envp);
# elif defined (__MINGW32__)
return ::_execve (path, (char *const *) argv, (char *const *) envp);
@@ -332,7 +332,7 @@ ACE_OS::execvp (const char *file,
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_WIN32)
-# if defined (__BORLANDC__) /* VSB */
+# if defined (__BORLANDC__)
return ::execvp (file, argv);
# elif defined (__MINGW32__)
return ::_execvp (file, (char *const *) argv);
@@ -478,7 +478,7 @@ ACE_OS::getpgid (pid_t pid)
#if defined (ACE_LACKS_GETPGID)
ACE_UNUSED_ARG (pid);
ACE_NOTSUP_RETURN (-1);
-#elif defined (linux) && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 0
+#elif defined (ACE_LINUX) && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 0
// getpgid() is from SVR4, which appears to be the reason why GLIBC
// doesn't enable its prototype by default.
// Rather than create our own extern prototype, just use the one
@@ -763,7 +763,6 @@ ACE_OS::read (ACE_HANDLE handle, void *buf, size_t len,
ACE_OVERLAPPED *overlapped)
{
ACE_OS_TRACE ("ACE_OS::read");
- overlapped = overlapped;
#if defined (ACE_WIN32)
DWORD ok_len;
DWORD short_len = static_cast<DWORD> (len);
@@ -772,6 +771,7 @@ ACE_OS::read (ACE_HANDLE handle, void *buf, size_t len,
else
ACE_FAIL_RETURN (-1);
#else
+ ACE_UNUSED_ARG (overlapped);
return ACE_OS::read (handle, buf, len);
#endif /* ACE_WIN32 */
}
@@ -955,13 +955,9 @@ ACE_OS::sleep (const ACE_Time_Value &tv)
// Copy the timeval, because this platform doesn't declare the timeval
// as a pointer to const.
timeval tv_copy = tv;
-# if defined(ACE_TANDEM_T1248_PTHREADS)
- ACE_OSCALL_RETURN (::spt_select (0, 0, 0, 0, &tv_copy), int, -1);
-# else
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_OSCALL_RETURN (::select (0, 0, 0, 0, &tv_copy), int, -1);
- //FUZZ: enable check_for_lack_ACE_OS
-# endif
+ //FUZZ: disable check_for_lack_ACE_OS
+ ACE_OSCALL_RETURN (::select (0, 0, 0, 0, &tv_copy), int, -1);
+ //FUZZ: enable check_for_lack_ACE_OS
# else /* ! ACE_HAS_NONCONST_SELECT_TIMEVAL */
const timeval *tvp = tv;
//FUZZ: disable check_for_lack_ACE_OS
@@ -1114,7 +1110,11 @@ ACE_OS::ualarm (useconds_t usecs, useconds_t interval)
return ::ualarm (usecs, interval);
#elif !defined (ACE_LACKS_UNIX_SIGNALS)
ACE_UNUSED_ARG (interval);
+# if defined (ACE_VXWORKS) && ACE_VXWORKS >= 0x690 && defined (_WRS_CONFIG_LP64)
+ return ::alarm (static_cast<unsigned int> (usecs * ACE_ONE_SECOND_IN_USECS));
+# else
return ::alarm (usecs * ACE_ONE_SECOND_IN_USECS);
+#endif
#else
ACE_UNUSED_ARG (usecs);
ACE_UNUSED_ARG (interval);
@@ -1135,7 +1135,11 @@ ACE_OS::ualarm (const ACE_Time_Value &tv,
return ::ualarm (usecs, interval);
#elif !defined (ACE_LACKS_UNIX_SIGNALS)
ACE_UNUSED_ARG (tv_interval);
+# if defined (ACE_VXWORKS) && ACE_VXWORKS >= 0x690 && defined (_WRS_CONFIG_LP64)
+ return ::alarm (static_cast<unsigned int> (tv.sec ()));
+# else
return ::alarm (tv.sec ());
+# endif
#else
ACE_UNUSED_ARG (tv_interval);
ACE_UNUSED_ARG (tv);
@@ -1209,7 +1213,6 @@ ACE_OS::write (ACE_HANDLE handle,
ACE_OVERLAPPED *overlapped)
{
ACE_OS_TRACE ("ACE_OS::write");
- overlapped = overlapped;
#if defined (ACE_WIN32)
DWORD bytes_written; // This is set to 0 byte WriteFile.
@@ -1219,6 +1222,7 @@ ACE_OS::write (ACE_HANDLE handle,
else
ACE_FAIL_RETURN (-1);
#else
+ ACE_UNUSED_ARG (overlapped);
return ACE_OS::write (handle, buf, nbyte);
#endif /* ACE_WIN32 */
}
diff --git a/dep/acelite/ace/OS_NS_wchar.cpp b/dep/acelite/ace/OS_NS_wchar.cpp
index b0a5075ac9c..9592a385456 100644
--- a/dep/acelite/ace/OS_NS_wchar.cpp
+++ b/dep/acelite/ace/OS_NS_wchar.cpp
@@ -1,9 +1,7 @@
-// $Id: OS_NS_wchar.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: OS_NS_wchar.cpp 92712 2010-11-25 12:22:13Z johnnyw $
#include "ace/OS_NS_wchar.h"
-
-
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_wchar.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
diff --git a/dep/acelite/ace/OS_Thread_Adapter.cpp b/dep/acelite/ace/OS_Thread_Adapter.cpp
index e5bf95b239b..17713e6f655 100644
--- a/dep/acelite/ace/OS_Thread_Adapter.cpp
+++ b/dep/acelite/ace/OS_Thread_Adapter.cpp
@@ -1,4 +1,4 @@
-// $Id: OS_Thread_Adapter.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: OS_Thread_Adapter.cpp 92682 2010-11-23 23:41:19Z shuston $
#include "ace/OS_Thread_Adapter.h"
@@ -17,13 +17,15 @@ ACE_OS_Thread_Adapter::ACE_OS_Thread_Adapter (
, ACE_SEH_EXCEPT_HANDLER selector
, ACE_SEH_EXCEPT_HANDLER handler
# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , long cancel_flags
)
: ACE_Base_Thread_Adapter (user_func, arg, entry_point
-# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
, 0
+# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
, selector
, handler
# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , cancel_flags
)
{
}
@@ -44,6 +46,9 @@ ACE_OS_Thread_Adapter::invoke (void)
reinterpret_cast<ACE_THR_FUNC_INTERNAL> (this->user_func_);
void *arg = this->arg_;
+ // Pick up the cancel-related flags before deleting this.
+ long cancel_flags = this->flags_;
+
// Delete ourselves since we don't need <this> anymore. Make sure
// not to access <this> anywhere below this point.
delete this;
@@ -65,6 +70,18 @@ ACE_OS_Thread_Adapter::invoke (void)
#endif /* ACE_NEEDS_LWP_PRIO_SET */
+ if (cancel_flags != 0)
+ {
+ // If both flags are set, ignore this.
+ int old = 0;
+ int val = cancel_flags & (THR_CANCEL_ENABLE | THR_CANCEL_DISABLE);
+ if (val == THR_CANCEL_ENABLE || val == THR_CANCEL_DISABLE)
+ ACE_OS::thr_setcancelstate (val, &old);
+ val = cancel_flags & (THR_CANCEL_DEFERRED | THR_CANCEL_ASYNCHRONOUS);
+ if (val == THR_CANCEL_DEFERRED || val == THR_CANCEL_ASYNCHRONOUS)
+ ACE_OS::thr_setcanceltype (val, &old);
+ }
+
ACE_THR_FUNC_RETURN status = 0;
ACE_SEH_TRY
diff --git a/dep/acelite/ace/OS_Thread_Adapter.h b/dep/acelite/ace/OS_Thread_Adapter.h
index 4dc3cee0911..401a3df9ce2 100644
--- a/dep/acelite/ace/OS_Thread_Adapter.h
+++ b/dep/acelite/ace/OS_Thread_Adapter.h
@@ -4,7 +4,7 @@
/**
* @file OS_Thread_Adapter.h
*
- * $Id: OS_Thread_Adapter.h 85341 2009-05-14 11:07:37Z johnnyw $
+ * $Id: OS_Thread_Adapter.h 92682 2010-11-23 23:41:19Z shuston $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
@@ -50,6 +50,7 @@ public:
, ACE_SEH_EXCEPT_HANDLER selector = 0
, ACE_SEH_EXCEPT_HANDLER handler = 0
# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , long cancel_flags = 0
);
/**
diff --git a/dep/acelite/ace/Obchunk.cpp b/dep/acelite/ace/Obchunk.cpp
index 50ac21fa0da..98b33e5244f 100644
--- a/dep/acelite/ace/Obchunk.cpp
+++ b/dep/acelite/ace/Obchunk.cpp
@@ -1,4 +1,4 @@
-// $Id: Obchunk.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Obchunk.cpp 92580 2010-11-15 09:48:02Z johnnyw $
#include "ace/Obchunk.h"
@@ -6,8 +6,6 @@
#include "ace/Obchunk.inl"
#endif /* __ACE_INLINE__ */
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Obchunk)
diff --git a/dep/acelite/ace/Object_Manager.cpp b/dep/acelite/ace/Object_Manager.cpp
index 3966fd31261..92ef37f4fa0 100644
--- a/dep/acelite/ace/Object_Manager.cpp
+++ b/dep/acelite/ace/Object_Manager.cpp
@@ -1,4 +1,4 @@
-// $Id: Object_Manager.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Object_Manager.cpp 93159 2011-01-25 10:52:44Z mcorino $
#include "ace/Object_Manager.h"
#if !defined (ACE_LACKS_ACE_TOKEN)
@@ -30,13 +30,9 @@
#include "ace/Null_Mutex.h"
#include "ace/Mutex.h"
#include "ace/RW_Thread_Mutex.h"
-#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \
- defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) \
- && (_MSC_VER >= 1400) // VC++ 8.0 and above.
+#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && !defined (ACE_HAS_WINCE)
#include "ace/OS_NS_stdlib.h"
-#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE && (_MSC_VER >= 1400)
-
-
+#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS
#if ! defined (ACE_APPLICATION_PREALLOCATED_OBJECT_DEFINITIONS)
# define ACE_APPLICATION_PREALLOCATED_OBJECT_DEFINITIONS
@@ -58,15 +54,13 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Note the following fix was derived from that proposed by Jochen Kalmbach
// http://blog.kalmbachnet.de/?postid=75
-#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \
- defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && \
- (_MSC_VER >= 1400) && defined (_M_IX86)
+#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && !defined (ACE_HAS_WINCE)
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI ACEdisableSetUnhandledExceptionFilter (
- LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
+ LPTOP_LEVEL_EXCEPTION_FILTER /*lpTopLevelExceptionFilter*/)
{
return 0;
}
-#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE && (_MSC_VER >= 1400) && _M_IX86
+#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS
// Singleton pointer.
ACE_Object_Manager *ACE_Object_Manager::instance_ = 0;
@@ -260,14 +254,13 @@ ACE_Object_Manager::init (void)
}
# endif /* ACE_HAS_TSS_EMULATION */
-#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \
- defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
-#if defined (_DEBUG) && (defined (_MSC_VER) || defined (__INTEL_COMPILER))
+#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && !defined (ACE_HAS_WINCE)
+#if defined (_DEBUG) && (defined (_MSC_VER) || defined (__INTEL_COMPILER) || defined (__MINGW32__))
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
-#endif /* _DEBUG && _MSC_VER || __INTEL_COMPILER */
+#endif /* _DEBUG && _MSC_VER || __INTEL_COMPILER || __MINGW32__ */
// The system does not display the critical-error-handler message box
SetErrorMode(SEM_FAILCRITICALERRORS);
@@ -275,10 +268,10 @@ ACE_Object_Manager::init (void)
// And this will catch all unhandled exceptions.
SetUnhandledExceptionFilter (&ACE_UnhandledExceptionFilter);
-# if (_MSC_VER >= 1400) // VC++ 8.0 and above.
+# if (_MSC_VER >= 1400) // VC++ 8.0 and above
// And this will stop the abort system call from being treated as a crash
_set_abort_behavior( 0, _CALL_REPORTFAULT);
-
+# endif
// Note the following fix was derived from that proposed by Jochen Kalmbach
// http://blog.kalmbachnet.de/?postid=75
// See also:
@@ -293,18 +286,22 @@ ACE_Object_Manager::init (void)
// from calling SetUnhandledExceptionFilter() after we have done so above.
// NOTE this only works for intel based windows builds.
+# if (_MSC_VER >= 1400) \
+ || (__MINGW32_MAJOR_VERSION > 3) || \
+ ((__MINGW32_MAJOR_VERSION == 3) && \
+ (__MINGW32_MINOR_VERSION >= 15)) // VC++ 8.0 and above || MingW32 >= 3.15
# ifdef _M_IX86
HMODULE hKernel32 = ACE_TEXT_LoadLibrary (ACE_TEXT ("kernel32.dll"));
if (hKernel32)
{
void *pOrgEntry =
- GetProcAddress (hKernel32, "SetUnhandledExceptionFilter");
+ reinterpret_cast<void*> (GetProcAddress (hKernel32, "SetUnhandledExceptionFilter"));
if (pOrgEntry)
{
unsigned char newJump[ 100 ];
DWORD dwOrgEntryAddr = reinterpret_cast<DWORD> (pOrgEntry);
dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far
- void *pNewFunc = &ACEdisableSetUnhandledExceptionFilter;
+ void *pNewFunc = reinterpret_cast<void*> (&ACEdisableSetUnhandledExceptionFilter);
DWORD dwNewEntryAddr = reinterpret_cast<DWORD> (pNewFunc);
DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr;
@@ -321,7 +318,7 @@ ACE_Object_Manager::init (void)
}
# endif // _M_IX86
# endif // (_MSC_VER >= 1400) // VC++ 8.0 and above.
-#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE */
+#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS */
# if !defined (ACE_LACKS_ACE_SVCCONF)
diff --git a/dep/acelite/ace/Object_Manager_Base.cpp b/dep/acelite/ace/Object_Manager_Base.cpp
index fbc5864a93c..e62b0567658 100644
--- a/dep/acelite/ace/Object_Manager_Base.cpp
+++ b/dep/acelite/ace/Object_Manager_Base.cpp
@@ -1,9 +1,6 @@
-// $Id: Object_Manager_Base.cpp 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: Object_Manager_Base.cpp 92580 2010-11-15 09:48:02Z johnnyw $
#include "ace/Object_Manager_Base.h"
-
-
-
#include "ace/OS_Memory.h"
#include "ace/OS_NS_Thread.h"
#include "ace/OS_NS_sys_socket.h"
diff --git a/dep/acelite/ace/Ping_Socket.h b/dep/acelite/ace/Ping_Socket.h
index 213f37fbd47..b063681ddce 100644
--- a/dep/acelite/ace/Ping_Socket.h
+++ b/dep/acelite/ace/Ping_Socket.h
@@ -4,7 +4,7 @@
/**
* @file Ping_Socket.h
*
- * $Id: Ping_Socket.h 81737 2008-05-20 09:46:39Z johnnyw $
+ * $Id: Ping_Socket.h 93597 2011-03-21 12:54:52Z johnnyw $
*
* @author Robert S. Iakobashvili <coroberti@gmail.com> <coroberti@walla.co.il>
* @author Gonzalo A. Diethelm <gonzalo.diethelm@aditiva.com>
@@ -60,7 +60,7 @@ public:
int protocol = IPPROTO_ICMP,
int reuse_addr = 0);
- /// @a toConnect = 1 - makes connect to remote address
+ /// @a to_connect = true - makes connect to remote address
int send_echo_check (ACE_INET_Addr & remote_addr,
bool to_connect = false);
@@ -68,7 +68,7 @@ public:
/// sending @c ICMP_ECHO.
int process_incoming_dgram (char * ptr, ssize_t len);
- /// @a toConnect = 1 - makes connect to remote address
+ /// @a to_connect = true - makes connect to remote address
int make_echo_check (ACE_INET_Addr & remote_addr,
bool to_connect = false,
ACE_Time_Value const * timeout = &time_default_);
diff --git a/dep/acelite/ace/Proactor.cpp b/dep/acelite/ace/Proactor.cpp
index 983b8eabb7d..dffacd2184d 100644
--- a/dep/acelite/ace/Proactor.cpp
+++ b/dep/acelite/ace/Proactor.cpp
@@ -1,4 +1,4 @@
-// $Id: Proactor.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Proactor.cpp 95368 2011-12-19 13:38:49Z mcorino $
#include "ace/config-lite.h"
#include "ace/Proactor.h"
@@ -58,11 +58,6 @@ bool ACE_Proactor::delete_proactor_ = false;
*/
class ACE_Proactor_Timer_Handler : public ACE_Task<ACE_NULL_SYNCH>
{
-
- /// Proactor has special privileges
- /// Access needed to: timer_event_
- friend class ACE_Proactor;
-
public:
/// Constructor.
ACE_Proactor_Timer_Handler (ACE_Proactor &proactor);
@@ -75,6 +70,11 @@ public:
/// <destroy> does. <destroy> make sure the thread exits properly.
int destroy (void);
+ /// Proactor calls this to refresh the timer event thread, to wake
+ /// up the thread from a sleep. This is needed to make the thread
+ /// recompute its sleep time after changes to the timer queue.
+ int signal (void);
+
protected:
/// Run by a daemon thread to handle deferred processing. In other
/// words, this method will do the waiting on the earliest timer and
@@ -100,6 +100,12 @@ ACE_Proactor_Timer_Handler::ACE_Proactor_Timer_Handler (ACE_Proactor &proactor)
ACE_Proactor_Timer_Handler::~ACE_Proactor_Timer_Handler (void)
{
+ this->destroy();
+}
+
+int
+ACE_Proactor_Timer_Handler::destroy (void)
+{
// Mark for closing down.
this->shutting_down_ = 1;
@@ -108,6 +114,13 @@ ACE_Proactor_Timer_Handler::~ACE_Proactor_Timer_Handler (void)
// Wait for the Timer Handler thread to exit.
this->wait ();
+ return 0;
+}
+
+int
+ACE_Proactor_Timer_Handler::signal (void)
+{
+ return this->timer_event_.signal ();
}
int
@@ -127,7 +140,8 @@ ACE_Proactor_Timer_Handler::svc (void)
// Get current time from timer queue since we don't know
// which <gettimeofday> was used.
- ACE_Time_Value cur_time = this->proactor_.timer_queue ()->gettimeofday ();
+ ACE_Time_Value cur_time =
+ this->proactor_.timer_queue ()->gettimeofday ();
// Compare absolute time with curent time received from the
// timer queue.
@@ -172,15 +186,16 @@ ACE_Proactor_Handle_Timeout_Upcall::ACE_Proactor_Handle_Timeout_Upcall (void)
}
int
-ACE_Proactor_Handle_Timeout_Upcall::registration (TIMER_QUEUE &,
- ACE_Handler *,
+ACE_Proactor_Handle_Timeout_Upcall::registration (ACE_Proactor_Timer_Queue &,
+ ACE_Handler * handler,
const void *)
{
+ handler->proactor(proactor_);
return 0;
}
int
-ACE_Proactor_Handle_Timeout_Upcall::preinvoke (TIMER_QUEUE &,
+ACE_Proactor_Handle_Timeout_Upcall::preinvoke (ACE_Proactor_Timer_Queue &,
ACE_Handler *,
const void *,
int,
@@ -191,7 +206,7 @@ ACE_Proactor_Handle_Timeout_Upcall::preinvoke (TIMER_QUEUE &,
}
int
-ACE_Proactor_Handle_Timeout_Upcall::postinvoke (TIMER_QUEUE &,
+ACE_Proactor_Handle_Timeout_Upcall::postinvoke (ACE_Proactor_Timer_Queue &,
ACE_Handler *,
const void *,
int,
@@ -202,7 +217,7 @@ ACE_Proactor_Handle_Timeout_Upcall::postinvoke (TIMER_QUEUE &,
}
int
-ACE_Proactor_Handle_Timeout_Upcall::timeout (TIMER_QUEUE &,
+ACE_Proactor_Handle_Timeout_Upcall::timeout (ACE_Proactor_Timer_Queue &,
ACE_Handler *handler,
const void *act,
int,
@@ -248,7 +263,7 @@ ACE_Proactor_Handle_Timeout_Upcall::timeout (TIMER_QUEUE &,
}
int
-ACE_Proactor_Handle_Timeout_Upcall::cancel_type (TIMER_QUEUE &,
+ACE_Proactor_Handle_Timeout_Upcall::cancel_type (ACE_Proactor_Timer_Queue &,
ACE_Handler *,
int,
int &)
@@ -258,7 +273,7 @@ ACE_Proactor_Handle_Timeout_Upcall::cancel_type (TIMER_QUEUE &,
}
int
-ACE_Proactor_Handle_Timeout_Upcall::cancel_timer (TIMER_QUEUE &,
+ACE_Proactor_Handle_Timeout_Upcall::cancel_timer (ACE_Proactor_Timer_Queue &,
ACE_Handler *,
int,
int)
@@ -268,7 +283,7 @@ ACE_Proactor_Handle_Timeout_Upcall::cancel_timer (TIMER_QUEUE &,
}
int
-ACE_Proactor_Handle_Timeout_Upcall::deletion (TIMER_QUEUE &,
+ACE_Proactor_Handle_Timeout_Upcall::deletion (ACE_Proactor_Timer_Queue &,
ACE_Handler *,
const void *)
{
@@ -295,7 +310,7 @@ ACE_Proactor_Handle_Timeout_Upcall::proactor (ACE_Proactor &proactor)
ACE_Proactor::ACE_Proactor (ACE_Proactor_Impl *implementation,
bool delete_implementation,
- TIMER_QUEUE *tq)
+ ACE_Proactor_Timer_Queue *tq)
: implementation_ (0),
delete_implementation_ (delete_implementation),
timer_handler_ (0),
@@ -623,6 +638,11 @@ ACE_Proactor::close (void)
this->timer_queue_ = 0;
this->delete_timer_queue_ = 0;
}
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ this->timer_queue_ = 0;
+ }
return 0;
}
@@ -666,42 +686,15 @@ ACE_Proactor::schedule_timer (ACE_Handler &handler,
// absolute time.
ACE_Time_Value absolute_time =
this->timer_queue_->gettimeofday () + time;
-
- // Only one guy goes in here at a time
- ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX,
- ace_mon,
- this->timer_queue_->mutex (),
- -1));
-
- // Remember the old proactor.
- ACE_Proactor *old_proactor = handler.proactor ();
-
- // Assign *this* Proactor to the handler.
- handler.proactor (this);
-
- // Schedule the timer
long result = this->timer_queue_->schedule (&handler,
act,
absolute_time,
interval);
if (result != -1)
{
- // no failures: check to see if we are the earliest time
- if (this->timer_queue_->earliest_time () == absolute_time)
-
- // wake up the timer thread
- if (this->timer_handler_->timer_event_.signal () == -1)
- {
- // Cancel timer
- this->timer_queue_->cancel (result);
- result = -1;
- }
- }
-
- if (result == -1)
- {
- // Reset the old proactor in case of failures.
- handler.proactor (old_proactor);
+ // Signal the timer thread to make sure that new events are
+ // dispatched and the sleep time is updated.
+ (void) this->timer_handler_->signal ();
}
return result;
@@ -765,14 +758,14 @@ ACE_Proactor::number_of_threads (size_t threads)
this->implementation ()->number_of_threads (threads);
}
-ACE_Proactor::TIMER_QUEUE *
+ACE_Proactor_Timer_Queue *
ACE_Proactor::timer_queue (void) const
{
return this->timer_queue_;
}
void
-ACE_Proactor::timer_queue (TIMER_QUEUE *tq)
+ACE_Proactor::timer_queue (ACE_Proactor_Timer_Queue *tq)
{
// Cleanup old timer queue.
if (this->delete_timer_queue_)
@@ -780,6 +773,10 @@ ACE_Proactor::timer_queue (TIMER_QUEUE *tq)
delete this->timer_queue_;
this->delete_timer_queue_ = 0;
}
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ }
// New timer queue.
if (tq == 0)
@@ -795,7 +792,14 @@ ACE_Proactor::timer_queue (TIMER_QUEUE *tq)
}
// Set the proactor in the timer queue's functor
- this->timer_queue_->upcall_functor ().proactor (*this);
+ typedef ACE_Timer_Queue_Upcall_Base<ACE_Handler*,ACE_Proactor_Handle_Timeout_Upcall> TQ_Base;
+
+ TQ_Base * tqb = dynamic_cast<TQ_Base*> (this->timer_queue_);
+
+ if (tqb != 0)
+ {
+ tqb->upcall_functor ().proactor (*this);
+ }
}
ACE_HANDLE
diff --git a/dep/acelite/ace/Proactor.h b/dep/acelite/ace/Proactor.h
index 6b3f34f358f..4288aef6b76 100644
--- a/dep/acelite/ace/Proactor.h
+++ b/dep/acelite/ace/Proactor.h
@@ -4,7 +4,7 @@
/**
* @file Proactor.h
*
- * $Id: Proactor.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Proactor.h 95332 2011-12-15 11:09:41Z mcorino $
*
* @author Irfan Pyarali <irfan@cs.wustl.edu>
* @author Tim Harrison <harrison@cs.wustl.edu>
@@ -43,6 +43,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Proactor_Impl;
class ACE_Proactor_Timer_Handler;
+/// Type def for the timer queue.
+typedef ACE_Abstract_Timer_Queue<ACE_Handler *> ACE_Proactor_Timer_Queue;
+
/**
* @class ACE_Proactor_Handle_Timeout_Upcall
*
@@ -51,15 +54,8 @@ class ACE_Proactor_Timer_Handler;
* This class implements the functor required by the Timer
* Queue to call <handle_timeout> on ACE_Handlers.
*/
-class ACE_Proactor_Handle_Timeout_Upcall
+class ACE_Export ACE_Proactor_Handle_Timeout_Upcall
{
-
- /// Type def for the timer queue.
- typedef ACE_Timer_Queue_T<ACE_Handler *,
- ACE_Proactor_Handle_Timeout_Upcall,
- ACE_SYNCH_RECURSIVE_MUTEX>
- TIMER_QUEUE;
-
/// The main Proactor class has special permissions.
friend class ACE_Proactor;
@@ -68,12 +64,12 @@ public:
ACE_Proactor_Handle_Timeout_Upcall (void);
/// This method is called when a timer is registered.
- int registration (TIMER_QUEUE &timer_queue,
+ int registration (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
const void *arg);
/// This method is called before the timer expires.
- int preinvoke (TIMER_QUEUE &timer_queue,
+ int preinvoke (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
const void *arg,
int recurring_timer,
@@ -81,14 +77,14 @@ public:
const void *&upcall_act);
/// This method is called when the timer expires.
- int timeout (TIMER_QUEUE &timer_queue,
+ int timeout (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
const void *arg,
int recurring_timer,
const ACE_Time_Value &cur_time);
/// This method is called after the timer expires.
- int postinvoke (TIMER_QUEUE &timer_queue,
+ int postinvoke (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
const void *arg,
int recurring_timer,
@@ -96,20 +92,20 @@ public:
const void *upcall_act);
/// This method is called when a handler is canceled.
- int cancel_type (TIMER_QUEUE &timer_queue,
+ int cancel_type (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
int dont_call_handle_close,
int &requires_reference_counting);
/// This method is called when a timer is canceled.
- int cancel_timer (TIMER_QUEUE &timer_queue,
+ int cancel_timer (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
int dont_call_handle_close,
int requires_reference_counting);
/// This method is called when the timer queue is destroyed and the
/// timer is still contained in it.
- int deletion (TIMER_QUEUE &timer_queue,
+ int deletion (ACE_Proactor_Timer_Queue &timer_queue,
ACE_Handler *handler,
const void *arg);
@@ -135,10 +131,8 @@ class ACE_Export ACE_Proactor
{
// = Here are the private typedefs that the ACE_Proactor uses.
- typedef ACE_Timer_Queue_Iterator_T<ACE_Handler *,
- ACE_Proactor_Handle_Timeout_Upcall,
- ACE_SYNCH_RECURSIVE_MUTEX>
- TIMER_QUEUE_ITERATOR;
+ typedef ACE_Timer_Queue_Iterator_T<ACE_Handler *>
+ TIMER_QUEUE_ITERATOR;
typedef ACE_Timer_List_T<ACE_Handler *,
ACE_Proactor_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX>
@@ -171,12 +165,6 @@ class ACE_Export ACE_Proactor
friend class ACE_Proactor_Timer_Handler;
public:
- /// Public type.
- typedef ACE_Timer_Queue_T<ACE_Handler *,
- ACE_Proactor_Handle_Timeout_Upcall,
- ACE_SYNCH_RECURSIVE_MUTEX>
- TIMER_QUEUE;
-
/**
* Constructor. If @a implementation is 0, the correct implementation
* object will be created. @a delete_implementation flag determines
@@ -185,7 +173,7 @@ public:
*/
ACE_Proactor (ACE_Proactor_Impl *implementation = 0,
bool delete_implementation = false,
- TIMER_QUEUE *tq = 0);
+ ACE_Proactor_Timer_Queue *tq = 0);
/// Destruction.
~ACE_Proactor (void);
@@ -323,8 +311,8 @@ public:
const void *act,
const ACE_Time_Value &interval);
- // Same as above except @a interval it is used to reschedule the
- // @a handler automatically.
+ /// Same as above except @a interval it is used to reschedule the
+ /// @a handler automatically.
/// This combines the above two methods into one. Mostly for backward
/// compatibility.
@@ -357,7 +345,7 @@ public:
* @param wait_time the time to wait for an event to occur. This is
* a relative time. On successful return, the time is updated to
* reflect the amount of time spent waiting for event(s) to occur.
- * @return Returns 0 if no events occur before the wait_time expires.
+ * @return Returns 0 if no events occur before the @a wait_time expires.
* Returns 1 when a completion is dispatched. On error, returns -1
* and sets errno accordingly.
*/
@@ -383,10 +371,10 @@ public:
void number_of_threads (size_t threads);
/// Get timer queue.
- TIMER_QUEUE *timer_queue (void) const;
+ ACE_Proactor_Timer_Queue *timer_queue (void) const;
/// Set timer queue.
- void timer_queue (TIMER_QUEUE *timer_queue);
+ void timer_queue (ACE_Proactor_Timer_Queue *timer_queue);
/**
* Get the event handle.
@@ -614,7 +602,7 @@ protected:
ACE_Thread_Manager thr_mgr_;
/// Timer Queue.
- TIMER_QUEUE *timer_queue_;
+ ACE_Proactor_Timer_Queue *timer_queue_;
/// Flag on whether to delete the timer queue.
int delete_timer_queue_;
diff --git a/dep/acelite/ace/Process.cpp b/dep/acelite/ace/Process.cpp
index 5198023592e..22a49a4a97c 100644
--- a/dep/acelite/ace/Process.cpp
+++ b/dep/acelite/ace/Process.cpp
@@ -1,4 +1,4 @@
-// $Id: Process.cpp 92218 2010-10-14 13:18:15Z mcorino $
+// $Id: Process.cpp 95567 2012-02-28 14:36:02Z johnnyw $
#include "ace/Process.h"
@@ -24,13 +24,11 @@
#include "ace/Vector_T.h"
#include "ace/Tokenizer_T.h"
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS > 0x600) && defined (__RTP__)
+#if defined (ACE_VXWORKS) && defined (__RTP__)
# include <rtpLib.h>
# include <taskLib.h>
#endif
-
-
// This function acts as a signal handler for SIGCHLD. We don't really want
// to do anything with the signal - it's just needed to interrupt a sleep.
// See wait() for more info.
@@ -255,7 +253,7 @@ ACE_Process::spawn (ACE_Process_Options &options)
}
return this->child_id_;
-#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS > 0x600)) && defined (__RTP__)
+#elif defined (ACE_VXWORKS) && defined (__RTP__)
if (ACE_BIT_ENABLED (options.creation_flags (),
ACE_Process_Options::NO_EXEC))
ACE_NOTSUP_RETURN (ACE_INVALID_PID);
@@ -519,13 +517,7 @@ ACE_Process::spawn (ACE_Process_Options &options)
}
else
{
-# if defined (ghs)
- // GreenHills 1.8.8 (for VxWorks 5.3.x) can't compile this
- // code. Processes aren't supported on VxWorks anyways.
- ACE_NOTSUP_RETURN (ACE_INVALID_PID);
-# else
result = ACE_OS::execve (procname, procargv, procenv);
-# endif /* ghs */
}
if (result == -1)
{
@@ -624,7 +616,7 @@ ACE_Process::wait (const ACE_Time_Value &tv,
# if defined (ACE_VXWORKS)
{
pid_t retv;
- while ( (retv = this->wait (status)) == ACE_INVALID_PID && errno == EINTR ) ;
+ while ((retv = this->wait (status)) == ACE_INVALID_PID && errno == EINTR);
return retv;
}
# else
@@ -1231,7 +1223,10 @@ ACE_Process_Options::command_line (const ACE_TCHAR *format, ...)
va_start (argp, format);
if (command_line_buf_len_ < 1)
- return -1;
+ {
+ va_end (argp);
+ return -1;
+ }
#if !defined (ACE_LACKS_VSNPRINTF) || defined (ACE_HAS_TRIO)
// vsnprintf the format and args into command_line_buf__.
@@ -1325,7 +1320,7 @@ ACE_Process_Options::command_line_argv (void)
do
command_line_argv_[x] = parser.next ();
while (command_line_argv_[x] != 0
- // substract one for the ending zero.
+ // subtract one for the ending zero.
&& ++x < max_command_line_args_ - 1);
command_line_argv_[x] = 0;
diff --git a/dep/acelite/ace/Process.h b/dep/acelite/ace/Process.h
index 61a3802ecc6..ba5f7018581 100644
--- a/dep/acelite/ace/Process.h
+++ b/dep/acelite/ace/Process.h
@@ -4,7 +4,7 @@
/**
* @file Process.h
*
- * $Id: Process.h 92218 2010-10-14 13:18:15Z mcorino $
+ * $Id: Process.h 93506 2011-03-09 10:42:51Z vzykov $
*
* @author Tim Harrison <harrison@cs.wustl.edu>
*/
diff --git a/dep/acelite/ace/Process_Manager.cpp b/dep/acelite/ace/Process_Manager.cpp
index e9be7773a8b..7687e1ed839 100644
--- a/dep/acelite/ace/Process_Manager.cpp
+++ b/dep/acelite/ace/Process_Manager.cpp
@@ -1,4 +1,4 @@
-// $Id: Process_Manager.cpp 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: Process_Manager.cpp 94454 2011-09-08 17:36:56Z johnnyw $
// Process_Manager.cpp
#include "ace/Process_Manager.h"
@@ -347,8 +347,7 @@ ACE_Process_Manager::handle_signal (int,
#if defined (ACE_WIN32)
ACE_HANDLE proc = si->si_handle_;
ACE_exitcode status = 0;
- BOOL result = ::GetExitCodeProcess (proc,
- &status);
+ BOOL result = ::GetExitCodeProcess (proc, &status);
if (result)
{
if (status != STILL_ACTIVE)
@@ -843,7 +842,7 @@ ACE_Process_Manager::wait (pid_t pid,
// WAIT_OBJECT_0 is a pointless comparison because
// WAIT_OBJECT_0 is zero and DWORD is unsigned long, so this
// test is skipped for Green Hills. Same for mingw.
-# if defined (ghs) || defined (__MINGW32__) || defined (_MSC_VER)
+# if defined (__MINGW32__) || defined (_MSC_VER)
ACE_ASSERT (result < WAIT_OBJECT_0 + this->current_count_);
# else
ACE_ASSERT (result >= WAIT_OBJECT_0
@@ -917,7 +916,7 @@ ACE_Process_Manager::wait (pid_t pid,
for (ACE_Countdown_Time time_left (&tmo); ; time_left.update ())
{
pid = ACE_OS::waitpid (-1, status, WNOHANG);
-# if defined (ACE_VXWORKS) && (ACE_VXWORKS >= 0x600)
+# if defined (ACE_VXWORKS)
if (pid > 0 || (pid == ACE_INVALID_PID && errno != EINTR))
# else
if (pid > 0 || pid == ACE_INVALID_PID)
diff --git a/dep/acelite/ace/Process_Manager.h b/dep/acelite/ace/Process_Manager.h
index 3956c18d0b6..2f50e761882 100644
--- a/dep/acelite/ace/Process_Manager.h
+++ b/dep/acelite/ace/Process_Manager.h
@@ -4,7 +4,7 @@
/**
* @file Process_Manager.h
*
- * $Id: Process_Manager.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Process_Manager.h 92489 2010-11-05 00:33:37Z shuston $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -210,6 +210,9 @@ public:
*
* @note This call is potentially dangerous to use since the process
* being terminated may not have a chance to cleanup before it shuts down.
+ * The process's entry is also not removed from this class's process
+ * table. Calling either wait() or remove() after terminate() is
+ * advisable.
*
* @retval 0 on success and -1 on failure.
*/
@@ -290,10 +293,9 @@ public:
/**
* Remove process @a pid from the ACE_Process_Manager's internal records.
- * This is called automatically by the reap() method after it successfully
- * reaps a process. It's also possible to call this method
- * directly from a signal handler, but don't call both reap() and
- * remove()!
+ * This is called automatically by the wait() method if the waited process
+ * exits. This method can also be called after calling terminate() if
+ * there's no need to wait() for the terminated process.
*/
int remove (pid_t pid);
diff --git a/dep/acelite/ace/Process_Semaphore.h b/dep/acelite/ace/Process_Semaphore.h
index ea614bf691c..fddaf8aecda 100644
--- a/dep/acelite/ace/Process_Semaphore.h
+++ b/dep/acelite/ace/Process_Semaphore.h
@@ -4,7 +4,7 @@
/**
* @file Process_Semaphore.h
*
- * $Id: Process_Semaphore.h 86731 2009-09-17 12:23:48Z johnnyw $
+ * $Id: Process_Semaphore.h 93359 2011-02-11 11:33:12Z mcorino $
*
* Wrapper for Dijkstra style general semaphores that work
* across processes.
@@ -71,14 +71,14 @@ public:
int release (void);
/**
- * Acquire semaphore ownership. This calls <acquire> and is only
+ * Acquire semaphore ownership. This calls acquire() and is only
* here to make the ACE_Process_Semaphore interface consistent
* with the other synchronization APIs.
*/
int acquire_read (void);
/**
- * Acquire semaphore ownership. This calls <acquire> and is only
+ * Acquire semaphore ownership. This calls acquire() and is only
* here to make the ACE_Process_Semaphore interface consistent
* with the other synchronization APIs.
*/
@@ -86,7 +86,7 @@ public:
/**
* Conditionally acquire semaphore (i.e., won't block). This calls
- * <tryacquire> and is only here to make the ACE_Process_Semaphore
+ * tryacquire() and is only here to make the ACE_Process_Semaphore
* interface consistent with the other synchronization APIs.
* Returns -1 on failure. If we "failed" because someone else
* already had the lock, @c errno is set to @c EBUSY.
@@ -95,7 +95,7 @@ public:
/**
* Conditionally acquire semaphore (i.e., won't block). This calls
- * <tryacquire> and is only here to make the ACE_Process_Semaphore
+ * tryacquire() and is only here to make the ACE_Process_Semaphore
* interface consistent with the other synchronization APIs.
* Returns -1 on failure. If we "failed" because someone else
* already had the lock, @c errno is set to @c EBUSY.
@@ -138,7 +138,7 @@ template <class T> class ACE_Malloc_Lock_Adapter_T;
* @brief Template specialization of ACE_Malloc_Lock_Adapter_T for
* ACE_Process_Semaphore.
*
- * This is needed since the ctor for ACE_Process_Semaphore doesn't match
+ * This is needed since the constructor for ACE_Process_Semaphore doesn't match
* the standard form used by other lock strategy classes.
*/
template<>
diff --git a/dep/acelite/ace/Profile_Timer.cpp b/dep/acelite/ace/Profile_Timer.cpp
index 767638a5411..013d40e08c3 100644
--- a/dep/acelite/ace/Profile_Timer.cpp
+++ b/dep/acelite/ace/Profile_Timer.cpp
@@ -1,4 +1,4 @@
-// $Id: Profile_Timer.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Profile_Timer.cpp 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/Profile_Timer.h"
@@ -308,11 +308,7 @@ ACE_Profile_Timer::elapsed_time (ACE_Elapsed_Time &et)
ACE_hrtime_t delta_t; // nanoseconds
timer_.elapsed_time (delta_t);
-# if defined (ACE_LACKS_LONGLONG_T)
- et.real_time = delta_t / (double) ACE_ONE_SECOND_IN_NSECS;
-# else
et.real_time = (__int64) delta_t / (double) ACE_ONE_SECOND_IN_NSECS;
-# endif /* ACE_LACKS_LONGLONG_T */
# if defined (ACE_HAS_GETRUSAGE)
ACE_Time_Value atv = ACE_Time_Value (this->end_usage_.ru_utime)
- ACE_Time_Value (this->begin_usage_.ru_utime);
diff --git a/dep/acelite/ace/Profile_Timer.h b/dep/acelite/ace/Profile_Timer.h
index 247c2796ff1..e21c397969b 100644
--- a/dep/acelite/ace/Profile_Timer.h
+++ b/dep/acelite/ace/Profile_Timer.h
@@ -4,7 +4,7 @@
/**
* @file Profile_Timer.h
*
- * $Id: Profile_Timer.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Profile_Timer.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -101,14 +101,14 @@ private:
ACE_Profile_Timer::Rusage last_usage_;
#if defined (ACE_HAS_PRUSAGE_T)
- /// Substract two timestructs and store their difference.
+ /// Subtract two timestructs and store their difference.
void subtract (timespec_t &tdiff, timespec_t &t0, timespec_t &t1);
/// I/O handle for /proc file system.
ACE_HANDLE proc_handle_;
#elif defined (ACE_HAS_GETRUSAGE)
- /// Substract two timestructs and store their difference.
+ /// Subtract two timestructs and store their difference.
void subtract (timeval &tdiff,
timeval &t0,
timeval &t1);
diff --git a/dep/acelite/ace/QoS/README b/dep/acelite/ace/QoS/README
index ce7fac62937..e7f533c8187 100644
--- a/dep/acelite/ace/QoS/README
+++ b/dep/acelite/ace/QoS/README
@@ -1,4 +1,4 @@
-$Id: README 80826 2008-03-04 14:51:23Z wotte $
+$Id: README 94641 2011-10-06 15:06:16Z johnnyw $
ACE QoS API (AQoSA)
===================
@@ -13,7 +13,7 @@ AQoSA makes use of the GQOS API under Windows 2000. The minimum
requirements are:
1. June98 Platform SDK or later.
-2. Link with ws2_32.lib
+2. Link with ws2_32.lib
More information about GQOS is available from the MSDN website:
http://msdn.microsoft.com/msdn-files/026/002/258/Search.asp
@@ -35,9 +35,9 @@ PLATFORM_RAPI_CPPFLAGS += -I[path to RAPI header files]
PLATFORM_RAPI_LIBS += -lrsvp
PLATFORM_RAPI_LDFLAGS += -L[path to RAPI library files]
-1. Compile AQoSA with
-
- make rapi=1
+1. Compile AQoSA with
+
+ make rapi=1
More information about RAPI can be found at:
diff --git a/dep/acelite/ace/QtReactor/ACE_QtReactor_export.h b/dep/acelite/ace/QtReactor/ACE_QtReactor_export.h
new file mode 100644
index 00000000000..29494c9213f
--- /dev/null
+++ b/dep/acelite/ace/QtReactor/ACE_QtReactor_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: ACE_QtReactor_export.h 80826 2008-03-04 14:51:23Z wotte $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s ACE_QtReactor
+// ------------------------------
+#ifndef ACE_QTREACTOR_EXPORT_H
+#define ACE_QTREACTOR_EXPORT_H
+
+#include /**/ "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_QTREACTOR_HAS_DLL)
+# define ACE_QTREACTOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_QTREACTOR_HAS_DLL */
+
+#if !defined (ACE_QTREACTOR_HAS_DLL)
+# define ACE_QTREACTOR_HAS_DLL 1
+#endif /* ! ACE_QTREACTOR_HAS_DLL */
+
+#if defined (ACE_QTREACTOR_HAS_DLL) && (ACE_QTREACTOR_HAS_DLL == 1)
+# if defined (ACE_QTREACTOR_BUILD_DLL)
+# define ACE_QtReactor_Export ACE_Proper_Export_Flag
+# define ACE_QTREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_QTREACTOR_BUILD_DLL */
+# define ACE_QtReactor_Export ACE_Proper_Import_Flag
+# define ACE_QTREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_QTREACTOR_BUILD_DLL */
+#else /* ACE_QTREACTOR_HAS_DLL == 1 */
+# define ACE_QtReactor_Export
+# define ACE_QTREACTOR_SINGLETON_DECLARATION(T)
+# define ACE_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_QTREACTOR_HAS_DLL == 1 */
+
+// Set ACE_QTREACTOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_QTREACTOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_QTREACTOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_QTREACTOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_QTREACTOR_NTRACE */
+
+#if (ACE_QTREACTOR_NTRACE == 1)
+# define ACE_QTREACTOR_TRACE(X)
+#else /* (ACE_QTREACTOR_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_QTREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_QTREACTOR_NTRACE == 1) */
+
+#endif /* ACE_QTREACTOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/QtReactor/QtReactor.cpp b/dep/acelite/ace/QtReactor/QtReactor.cpp
new file mode 100644
index 00000000000..eb0dc70b651
--- /dev/null
+++ b/dep/acelite/ace/QtReactor/QtReactor.cpp
@@ -0,0 +1,644 @@
+//$Id: QtReactor.cpp 82723 2008-09-16 09:35:44Z johnnyw $
+
+#include "ace/QtReactor/QtReactor.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_ALLOC_HOOK_DEFINE (ACE_QtReactor)
+
+// Must be called with lock held
+
+ACE_QtReactor::ACE_QtReactor (QApplication *qapp ,
+ ACE_Sig_Handler *sh,
+ ACE_Timer_Queue *tq,
+ int disable_notify_pipe,
+ ACE_Reactor_Notify *notify,
+ bool mask_signals,
+ int s_queue ):
+ ACE_Select_Reactor( sh, tq, disable_notify_pipe,
+ notify, mask_signals, s_queue),
+ qapp_(qapp),
+ qtime_ (0)
+{
+ reopen_notification_pipe();
+}
+
+// Must be called with lock held
+ACE_QtReactor::ACE_QtReactor (size_t size,
+ QApplication *qapp,
+ bool restart,
+ ACE_Sig_Handler *sh,
+ ACE_Timer_Queue *tq,
+ int disable_notify_pipe,
+ ACE_Reactor_Notify *notify,
+ bool mask_signals,
+ int s_queue):
+ ACE_Select_Reactor( size, restart, sh, tq,
+ disable_notify_pipe, notify, mask_signals,
+ s_queue ),
+ qapp_(qapp),
+ qtime_ (0)
+
+{
+ reopen_notification_pipe();
+}
+
+void ACE_QtReactor::reopen_notification_pipe( void)
+{
+ // When the ACE_Select_Reactor is constructed it creates the notify
+ // pipe and registers it with the register_handler_i() method. The
+ // QtReactor overloads this method BUT because the
+ // register_handler_i occurs when constructing the base class
+ // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i()
+ // is called not the QtReactor register_handler_i(). This means
+ // that the notify pipe is registered with the ACE_Select_Reactor
+ // event handling code not the QtReactor and so notfications don't
+ // work. To get around this we simply close and re-opened the
+ // notification handler in the constructor of the QtReactor.
+
+#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+ if ( initialized_ )
+ {
+ this->notify_handler_->close ();
+
+ // Patch for MS Windows: close and open doesn't clear the read
+ // fd_set, so reset it manually
+ this->wait_set_.rd_mask_.reset ();
+
+ this->notify_handler_->open (this, 0);
+ }
+#endif /* ACE_MT_SAFE */
+}
+
+ACE_QtReactor::~ACE_QtReactor (void)
+{
+ // iterate over QSocketNotifiers for read and release them
+ MAP::ITERATOR iter = this->read_notifier_.begin ();
+ MAP::ITERATOR iterEnd = this->read_notifier_.end ();
+ while( iter != iterEnd )
+ {
+ MAP::ENTRY &entry = *iter;
+ // QOBject destructor notifies qapplication (hopefully) on delete
+ delete entry.int_id_;
+ ++iter;
+ }
+
+ // iterate over QSocketNotifiers for write and release them
+ this->write_notifier_.begin ();
+ this->write_notifier_.end ();
+ while( iter != iterEnd )
+ {
+ MAP::ENTRY &entry = *iter;
+ // QOBject destructor notifies qapplication (hopefully) on delete
+ delete entry.int_id_;
+ ++iter;
+ }
+
+ // iterate over QSocketNotifiers for exceptions and release them
+ this->exception_notifier_.begin ();
+ this->exception_notifier_.end ();
+ while( iter != iterEnd )
+ {
+ MAP::ENTRY &entry = *iter;
+ // QOBject destructor notifies qapplication (hopefully) on delete
+ delete entry.int_id_;
+ ++iter;
+ }
+
+ // QOBject destructor notifies qapplication (hopefully) on delete
+ delete qtime_;
+}
+
+void
+ACE_QtReactor::qapplication (QApplication *qapp)
+{
+ // reparent QSocketNotifiers and QTimer
+ qapp_ = qapp ;
+}
+
+void
+ACE_QtReactor::timeout_event (void)
+{
+ // Deal with any timer events
+ ACE_Select_Reactor_Handle_Set handle_set;
+ this->dispatch (0, handle_set );
+
+ // Set next timeout signal
+ this->reset_timeout ();
+}
+
+void
+ACE_QtReactor::read_event (int p_handle)
+{
+ ACE_TRACE ("ACE_QtReactor::read_event");
+
+ ACE_HANDLE handle = ACE_HANDLE( p_handle );
+
+#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
+ // disable socket notifier to clear pending events
+ QSocketNotifier *qsock_notifier = 0;
+ if ( ( this->read_notifier_.find( handle,
+ qsock_notifier) != -1) )
+ qsock_notifier->setEnabled( false );
+#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
+
+ // The core of read event handling
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+
+ dispatch_set.rd_mask_.set_bit ( handle );
+ this->dispatch (1, dispatch_set);
+
+#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
+ // enable socket notifier according to current mask
+ ACE_Reactor_Mask mask = 0;
+ mask = mask_ops( handle, mask, ACE_Reactor::GET_MASK );
+ if ( -1 != mask )
+ set_enable_flag_by_mask ( 1, handle, mask);
+#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
+}
+
+void
+ACE_QtReactor::write_event (int p_handle)
+{
+ ACE_TRACE ("ACE_QtReactor::write_event");
+
+ ACE_HANDLE handle = ACE_HANDLE( p_handle );
+
+#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
+ // disable socket notifier to clear pending events
+ QSocketNotifier *qsock_notifier = 0;
+ if ( ( this->write_notifier_.find( handle, qsock_notifier) != -1) )
+ qsock_notifier->setEnabled( false );
+#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
+
+ // The core of write event handling
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+
+ dispatch_set.wr_mask_.set_bit( handle );
+ this->dispatch (1, dispatch_set);
+
+#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
+ // enable socket notifier according to current mask
+ ACE_Reactor_Mask mask = 0;
+ mask = mask_ops( handle, mask, ACE_Reactor::GET_MASK );
+ if ( -1 != mask )
+ set_enable_flag_by_mask ( 1, handle, mask);
+#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
+}
+
+void
+ACE_QtReactor::exception_event (int p_handle)
+{
+ ACE_TRACE ("ACE_QtReactor::exception_event");
+
+ ACE_HANDLE handle = ACE_HANDLE( p_handle );
+
+
+#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
+ // disable socket notifier to clear pending events
+ QSocketNotifier *qsock_notifier = 0;
+ if ( ( this->exception_notifier_.find( handle, qsock_notifier) != -1) )
+ qsock_notifier->setEnabled( false );
+#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
+
+ // The core of exception event handling
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+
+ dispatch_set.ex_mask_.set_bit( handle );
+ dispatch (1, dispatch_set);
+
+#ifdef ACE_QTREACTOR_CLEAR_PENDING_EVENTS
+ // enable socket notifier according to current mask
+ ACE_Reactor_Mask mask = 0;
+ mask = mask_ops( handle, mask, ACE_Reactor::GET_MASK );
+ if ( -1 != mask )
+ set_enable_flag_by_mask ( 1, handle, mask);
+#endif /* ACE_QTREACTOR_CLEAR_PENDING_EVENTS */
+}
+
+int
+ACE_QtReactor::set_enable_flag_by_mask (int flag_value,
+ ACE_HANDLE handle,
+ ACE_Reactor_Mask mask)
+{
+ QSocketNotifier *qs_not;
+
+ if (ACE_BIT_ENABLED(mask, ACE_Event_Handler::READ_MASK) ||
+ ACE_BIT_ENABLED( mask, ACE_Event_Handler::ACCEPT_MASK))
+ {
+ // Find the current notifier
+ qs_not = 0;
+ if ((this->read_notifier_.find (handle, qs_not) == -1))
+ return -1;
+
+ qs_not->setEnabled (flag_value);
+ }
+
+ if (ACE_BIT_ENABLED( mask, ACE_Event_Handler::WRITE_MASK) ||
+ ACE_BIT_ENABLED( mask, ACE_Event_Handler::ACCEPT_MASK) ||
+ ACE_BIT_ENABLED( mask, ACE_Event_Handler::CONNECT_MASK))
+ {
+ qs_not = 0;
+ if ((this->write_notifier_.find (handle, qs_not) == -1))
+ return -1;
+
+ qs_not->setEnabled (flag_value);
+ }
+
+ if (ACE_BIT_ENABLED( mask,
+ ACE_Event_Handler::EXCEPT_MASK))
+ {
+ qs_not = 0;
+ if ((this->exception_notifier_.find (handle, qs_not) == -1))
+ return -1;
+
+ qs_not->setEnabled (flag_value);
+ }
+
+ return 0;
+}
+
+int
+ACE_QtReactor::bit_ops (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask,
+ ACE_Select_Reactor_Handle_Set &handle_set,
+ int ops)
+{
+ int result;
+ ACE_Select_Reactor_Handle_Set preserved_handle_set = handle_set;
+
+ // Call regular bit_ops
+ if ((result = ACE_Select_Reactor::bit_ops (handle, mask, handle_set, ops)) == -1)
+ return -1;
+
+ // disable or enable the notifiers based on handle_set and mask
+ int enableFlag = -1;
+ if (&handle_set == &this->suspend_set_)
+ enableFlag = 0;
+ else if (&handle_set == &this->wait_set_)
+ enableFlag = 1;
+ else
+ // We have no work to do here, so just return
+ return result;
+
+ switch (ops)
+ {
+ case ACE_Reactor::SET_MASK:
+ case ACE_Reactor::ADD_MASK:
+ // Enable or disable notifiers based on the specified masks
+ if (this->set_enable_flag_by_mask (enableFlag, handle, mask) == -1)
+ {
+ // We can't just return -1 here because we'll have half-changed things.
+ // So, we need to restore the old handle_set, then return -1.
+ handle_set = preserved_handle_set;
+ return -1;
+ }
+ break;
+
+ case ACE_Reactor::CLR_MASK:
+ if (this->set_enable_flag_by_mask (!enableFlag, handle, mask) == -1)
+ {
+ handle_set = preserved_handle_set;
+ return -1;
+ }
+ break;
+
+ default:
+ // we take no action for any other operations
+ break;
+ }
+
+ return result;
+}
+
+void
+ACE_QtReactor::create_notifiers_for_handle (ACE_HANDLE handle)
+{
+ QSocketNotifier *qsock_notifier = 0;
+
+ // if there is already a read socket notifier for this handle, do nothing
+ // otherwise create read notifier
+ if ( ( this->read_notifier_.find (handle,
+ qsock_notifier) == -1) )
+ {
+ ACE_NEW (qsock_notifier,
+ QSocketNotifier (int(handle), QSocketNotifier::Read, this));
+ this->read_notifier_.bind (handle,
+ qsock_notifier);
+ QObject::connect (qsock_notifier,
+ SIGNAL (activated (int)),
+ this,
+ SLOT (read_event (int))) ;
+ // disable; it will be enabled by the regular register_handler_i if
+ // necessary
+ qsock_notifier->setEnabled (0);
+ }
+
+ qsock_notifier = 0;
+
+
+ // if there is already a write socket notifier for this handle, do nothing
+ // otherwise create read notifier
+ if ((this->write_notifier_.find (handle,
+ qsock_notifier) == -1))
+ {
+ ACE_NEW (qsock_notifier,
+ QSocketNotifier (int(handle), QSocketNotifier::Write, this));
+
+ this->write_notifier_.bind (handle,
+ qsock_notifier);
+
+ QObject::connect (qsock_notifier,
+ SIGNAL (activated (int)),
+ this,
+ SLOT (write_event (int)));
+ // disable; it will be enabled by the regular register_handler_i if
+ // necessary
+ qsock_notifier->setEnabled (0);
+ }
+
+
+ qsock_notifier = 0;
+
+ // if there is already a write socket notifier for this handle, do nothing
+ // otherwise create read notifier
+ if ((this->exception_notifier_.find (handle,
+ qsock_notifier) == -1))
+ {
+
+ ACE_NEW (qsock_notifier,
+ QSocketNotifier (int(handle), QSocketNotifier::Exception, this));
+
+ this->exception_notifier_.bind (handle,
+ qsock_notifier);
+
+ QObject::connect (qsock_notifier,
+ SIGNAL (activated (int)),
+ this,
+ SLOT (exception_event (int))) ;
+ // disable; it will be enabled by the regular register_handler_i if
+ // necessary
+ qsock_notifier->setEnabled (0);
+ }
+}
+
+void
+ACE_QtReactor::destroy_notifiers_for_handle (ACE_HANDLE handle)
+{
+ QSocketNotifier *qsock_notifier = 0;
+
+ // Looks for the handle in the maps and removes them.
+
+ if ((this->read_notifier_.find (handle,
+ qsock_notifier) != -1))
+ {
+ this->read_notifier_.unbind (handle,
+ qsock_notifier);
+ delete qsock_notifier;
+ }
+
+ if ((this->write_notifier_.find (handle,
+ qsock_notifier) != -1))
+ {
+ this->write_notifier_.unbind (handle,
+ qsock_notifier);
+ delete qsock_notifier;
+ }
+
+
+ if ((this->exception_notifier_.find (handle,
+ qsock_notifier) != -1))
+ {
+ this->exception_notifier_.unbind (handle,
+ qsock_notifier);
+ delete qsock_notifier;
+ }
+}
+
+int
+ACE_QtReactor::register_handler_i (ACE_HANDLE handle ,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_QtReactor::register_handler_i");
+
+ this->create_notifiers_for_handle (handle);
+
+ int result;
+ if ((result = ACE_Select_Reactor::register_handler_i(handle,
+ handler,
+ mask ))
+ == -1)
+ {
+ // destroy notifiers only when there is no handler for handle
+ if ( !ACE_Select_Reactor::find_handler( handle ) )
+ this->destroy_notifiers_for_handle (handle);
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+ACE_QtReactor::register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::register_handler_i(handles,
+ handler,
+ mask);
+}
+
+int ACE_QtReactor::remove_handler_i (ACE_HANDLE handle ,
+ ACE_Reactor_Mask mask )
+{
+ ACE_TRACE ("ACE_QtReactor::remove_handler_i");
+
+ int result = ACE_Select_Reactor::remove_handler_i (handle, mask);
+ // destroy notifiers only when there is no handler for handle
+ if ( !ACE_Select_Reactor::find_handler( handle ) )
+ this->destroy_notifiers_for_handle (handle);
+ return result;
+}
+
+
+int
+ACE_QtReactor::remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::remove_handler_i (handles,
+ mask);
+}
+
+// The following functions ensure that there is an Qt timeout for the
+// first timeout in the Reactor's Timer_Queue.
+
+void
+ACE_QtReactor::reset_timeout (void)
+{
+ if (this->qtime_ != 0)
+ {
+ delete this->qtime_;
+ this->qtime_ = 0;
+ }
+
+ ACE_Time_Value *max_wait_time =
+ this->timer_queue_->calculate_timeout (0) ;
+
+ if (max_wait_time)
+ {
+ ACE_NEW (this->qtime_,
+ QTimer);
+
+ QObject::connect (qtime_,
+ SIGNAL (timeout ()),
+ this,
+ SLOT (timeout_event ()));
+
+#if QT_VERSION >= 0x040000
+ qtime_->setSingleShot (1);
+ qtime_->start(max_wait_time->msec());
+#else
+ qtime_->start(max_wait_time->msec(), 1);
+#endif
+ }
+
+}
+
+
+long
+ACE_QtReactor::schedule_timer (ACE_Event_Handler *handler,
+ const void *arg,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_QtReactor::schedule_timer");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token,
+ ace_mon,
+ this->token_,
+ -1));
+
+ long result;
+ if ((result = ACE_Select_Reactor::schedule_timer(handler,
+ arg,
+ delay_time,
+ interval)) == -1 )
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+int
+ACE_QtReactor::cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_QtReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (handler,
+ dont_call_handle_close ) == -1 )
+ return -1 ;
+ else
+ {
+ this->reset_timeout( ) ;
+ return 0 ;
+ }
+}
+
+int ACE_QtReactor::cancel_timer (long timer_id,
+ const void **arg,
+ int dont_call_handle_close )
+{
+ ACE_TRACE ("ACE_QtReactor::cancel_timer") ;
+
+ if (ACE_Select_Reactor::cancel_timer (timer_id,
+ arg,
+ dont_call_handle_close ) == -1 )
+ return -1 ;
+ else
+ {
+ this->reset_timeout( ) ;
+ return 0 ;
+ }
+}
+
+// mbrudka: who needs QtWaitForMultipleEvents? It seems it's cargo load now!
+int
+ACE_QtReactor::QtWaitForMultipleEvents (int width,
+ ACE_Select_Reactor_Handle_Set &wait_set,
+ ACE_Time_Value * /*max_wait_time*/)
+{
+ // Keep a copy of the wait set in case the wait_set be changed
+ // between the two select calls in this function. It could happen
+ // while waiting for an event, another event is handled and dispatched
+ // which changes the dispatch_set_/wait_set.
+ ACE_Select_Reactor_Handle_Set orig_wait_set = wait_set;
+
+ // Check to make sure our handle's are all usable.
+ ACE_Select_Reactor_Handle_Set temp_set = wait_set;
+
+ if (ACE_OS::select (width,
+ temp_set.rd_mask_,
+ temp_set.wr_mask_,
+ temp_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero ) == -1)
+ return -1; // Bad file arguments...
+
+ // Qt processing.
+#if QT_VERSION >= 0x040000
+ this->qapp_->processEvents();
+#else
+ this->qapp_->processOneEvent ();
+#endif
+
+ // Reset the width, in case it changed during the upcalls.
+ width = handler_rep_.max_handlep1 ();
+
+ // Now actually read the result needed by the <Select_Reactor> using
+ // <select>.
+ return ACE_OS::select(width,
+ orig_wait_set.rd_mask_,
+ orig_wait_set.wr_mask_,
+ orig_wait_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero);
+}
+
+// mbrudka: who needs wait_for_multiple_events? It seems it's cargo load now!
+int
+ACE_QtReactor::wait_for_multiple_events (
+ ACE_Select_Reactor_Handle_Set &handle_set,
+ ACE_Time_Value *max_wait_time)
+{
+ ACE_TRACE ("ACE_QtReactor::wait_for_multiple_events");
+
+ int nfound = 0;
+ do
+ {
+ max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time);
+ size_t width = this->handler_rep_.max_handlep1 ();
+ handle_set.rd_mask_ = this->wait_set_.rd_mask_;
+ handle_set.wr_mask_ = this->wait_set_.wr_mask_;
+ handle_set.ex_mask_ = this->wait_set_.ex_mask_;
+
+ nfound = QtWaitForMultipleEvents (width,
+ handle_set,
+ max_wait_time);
+
+ } while( nfound == -1 && this->handle_error () > 0 );
+
+ if (nfound > 0)
+ {
+#if !defined (ACE_WIN32)
+ handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ());
+#endif /* ACE_WIN32 */
+ }
+
+ return nfound;
+ // Timed out or input available
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/QtReactor/QtReactor.h b/dep/acelite/ace/QtReactor/QtReactor.h
new file mode 100644
index 00000000000..72fe6d984e4
--- /dev/null
+++ b/dep/acelite/ace/QtReactor/QtReactor.h
@@ -0,0 +1,226 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file QtReactor.h
+ *
+ * $Id: QtReactor.h 94053 2011-05-11 13:44:41Z mhengstmengel $
+ *
+ * @author Hamish Friedlander <ullexco@wave.co.nz>
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef ACE_QTREACTOR_H
+#define ACE_QTREACTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/QtReactor/ACE_QtReactor_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Select_Reactor.h"
+#include "ace/Map_Manager.h"
+
+#if defined (ACE_HAS_QT4)
+# include "QtCore/qglobal.h"
+#endif
+
+// QT toolkit specific includes.
+#include /**/ <QtGui/QApplication>
+#include /**/ <QtCore/QObject>
+#include /**/ <QtCore/QSocketNotifier>
+#include /**/ <QtCore/QTimer>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_QtReactor
+ *
+ * @brief An object-oriented event demultiplexor and event handler
+ * dispatcher that uses the Qt Library. This class declaration
+ * also uses the extension facilities provided by the Qt. So,
+ * readers of the class declaration should not be upset with
+ * the appearence of the Keywords like Q_OBJECT, private slots
+ * etc. They are specific to Qt which uses these as a call back
+ * methods implementation mechanism.
+ *
+ * \note Marek Brudka <mbrudka@elka.pw.edu.pl>: ACE_QtReactor was
+ * quickly bugfixed to meet ACE 5.4.2 (6.0.0?) deadline.
+ * While it passes QtReactor_Test now, there is a great
+ * room for improvements as the implementation is rather inefficient
+ * and obfuscated
+ * To be more specific:
+ * - reset_timeout always creates and removes qtimer after each
+ * timeout event! Obviously, for fast triggering timers this may
+ * lead to excessive memory management.
+ * - create/destroy_notifiers_for_handle may also be reworked to
+ * establish more clean relations between handles and QSocketNotifiers.
+ * - read/write_exception_event disable now SocketNotifier for a while
+ * to clear pending events. The cost of this operation is high: two hash
+ * acces in ACE and at least two next ones in Qt. This makes QtReator slow,
+ * but how clear pending events another way ?
+ * - there is qapplication() mutator, which sets new qapplication for
+ * QtReactor. This mutator violates implicit assumption about the
+ * relations between QTimer and QSocketNotifiers and QApplication for
+ * this reactor, namely one may expect that after qapplication(), none
+ * of QtReactor artifacts is bound to old qapplication. That's not true
+ * now, as QTimer and QSocketNotifiers are not reparent to new
+ * QApplication. As a result, the sequence:
+ * QApplication *old_qapp = new QApplication(..);
+ * QtReactor qreactor( old_qapp);
+ * // .. register handlers, schedule_timers etc
+ * QApplication *new_qapp = new QApplication(..);
+ * qreactor.qpplication( new_qapp );
+ * delete old_qapp;
+ * almost always leads to problems and memory violation, because
+ * QSocketNotifiers are released by old_qapp. Therefore QtReactor
+ * should not be reparent now by setting new qapplication.
+ * - the lifecycle of Qt objects in ACE contects is rather mysterious
+ * and should be made more explicit.
+ * - valgrind reports a small memory leak in QtReactor_Test, though as for now
+ * it is not clear if the leak is introduced by QtReactor, or rather incorrect
+ * memory management in QtReactor_Test.
+ */
+class ACE_QtReactor_Export ACE_QtReactor
+ : public QObject,
+ public ACE_Select_Reactor
+{
+
+ Q_OBJECT
+
+public:
+ /** \brief Constructor follows @ACE_Select_Reactor
+ \param QApplication *qapp, qapplication which runs events loop
+ */
+ ACE_QtReactor (QApplication *qapp = 0,
+ ACE_Sig_Handler * = 0,
+ ACE_Timer_Queue * = 0,
+ int disable_notify_pipe = 0,
+ ACE_Reactor_Notify *notify = 0,
+ bool mask_signals = true,
+ int s_queue = ACE_SELECT_TOKEN::FIFO);
+
+ /** \brief Constructor follows @ACE_Select_Reactor
+ \param QApplication *qapp, qapplication which runs events loop
+ */
+ ACE_QtReactor (size_t size,
+ QApplication *qapp = 0,
+ bool restart = false,
+ ACE_Sig_Handler * = 0,
+ ACE_Timer_Queue * = 0,
+ int disable_notify_pipe = 0,
+ ACE_Reactor_Notify *notify = 0,
+ bool mask_signals = true,
+ int s_queue = ACE_SELECT_TOKEN::FIFO);
+
+ virtual ~ACE_QtReactor (void);
+
+ void qapplication (QApplication *qapp);
+
+ // = Timer operations.
+ virtual long schedule_timer (ACE_Event_Handler *handler,
+ const void *arg,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval);
+
+ virtual int cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close = 1);
+
+ virtual int cancel_timer (long timer_id,
+ const void **arg = 0,
+ int dont_call_handle_close = 1);
+
+protected:
+
+ // = Register timers/handles with Qt
+
+ /// Register a single @a handler.
+ virtual int register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Register a set of <handlers> with Qt.
+ virtual int register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+
+ /// Remove the <handler> associated with this @a handle.
+ virtual int remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask);
+
+ /// Remove a set of <handles>.
+ virtual int remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask mask);
+
+ /// Wait for events to occur.
+ virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set,
+ ACE_Time_Value *max_wait_time);
+
+ virtual int QtWaitForMultipleEvents (int width,
+ ACE_Select_Reactor_Handle_Set &wait_set,
+ ACE_Time_Value *max_wait_time);
+
+ virtual int bit_ops (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask,
+ ACE_Select_Reactor_Handle_Set &handle_set,
+ int ops);
+
+ int set_enable_flag_by_mask (int flag_value, ACE_HANDLE handle, ACE_Reactor_Mask mask);
+ void create_notifiers_for_handle (ACE_HANDLE handle);
+ void destroy_notifiers_for_handle (ACE_HANDLE handle);
+
+ // Wait for Qt events to occur
+
+ /// Some Qt stuff that we need to have
+ QApplication *qapp_ ;
+
+ /// Typedef of a map.
+ typedef ACE_Map_Manager<ACE_HANDLE, QSocketNotifier *, ACE_Null_Mutex> MAP;
+
+ /// A notifier for a read
+ MAP read_notifier_;
+
+ /// A write notifier
+ MAP write_notifier_;
+
+ /// An exception notifier
+ MAP exception_notifier_;
+
+ /// The timer class that would provide timer-sgnals & single-shot timers
+ QTimer *qtime_ ;
+
+private:
+ /// This method ensures there's an Qt timeout for the first timeout
+ /// in the Reactor's Timer_Queue.
+ void reset_timeout (void);
+ /// reopens notification pipe to create SocketNotifier for it
+ void reopen_notification_pipe(void);
+ /// Deny access since member-wise won't work...
+ ACE_QtReactor (const ACE_QtReactor &);
+ ACE_QtReactor &operator= (const ACE_QtReactor &);
+
+private slots:
+
+ // These are all part of the communication mechanism adopted in Qt.
+ /// Dispatch a Read Event
+ void read_event (int FD);
+
+ /// Dispatch a Write Event
+ void write_event (int FD);
+
+ /// Dispatch an exception event
+ void exception_event (int FD);
+
+ /// Dispatch a timeout event
+ void timeout_event (void);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ACE_QTREACTOR_H */
diff --git a/dep/acelite/ace/RB_Tree.cpp b/dep/acelite/ace/RB_Tree.cpp
index 0a6c8a08c8d..e9953b3ac68 100644
--- a/dep/acelite/ace/RB_Tree.cpp
+++ b/dep/acelite/ace/RB_Tree.cpp
@@ -1,4 +1,4 @@
-// $Id: RB_Tree.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+// $Id: RB_Tree.cpp 94171 2011-06-09 01:49:08Z schmidt $
#ifndef ACE_RB_TREE_CPP
#define ACE_RB_TREE_CPP
@@ -49,8 +49,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (ACE_Allocator
: root_ (0),
current_size_ (0)
{
- ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::"
- "ACE_RB_Tree (ACE_Allocator *alloc)");
+ ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (ACE_Allocator *alloc)");
allocator_ = alloc;
if (this->open (alloc) == -1)
ACE_ERROR ((LM_ERROR,
@@ -64,8 +63,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (const ACE_RB_T
: root_ (0),
current_size_ (0)
{
- ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::"
- "ACE_RB_Tree (const ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> &rbt)");
+ ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (const ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> &rbt)");
ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_);
allocator_ = rbt.allocator_;
@@ -85,6 +83,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (
ACE_Allocator *alloc
)
{
+ ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (void *, ACE_Allocator *)");
+
if (location != this)
{
this->root_ = 0;
@@ -728,8 +728,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i (const EXT_ID &k,
const INT_ID &t,
ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)
{
- ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i (const EXT_ID &k, const INT_ID &t, "
- "ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
+ ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i");
// Find the closest matching node, if there is one.
RB_SearchResult result = LEFT;
diff --git a/dep/acelite/ace/RB_Tree.inl b/dep/acelite/ace/RB_Tree.inl
index 7de889abf5b..6f085fd624e 100644
--- a/dep/acelite/ace/RB_Tree.inl
+++ b/dep/acelite/ace/RB_Tree.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: RB_Tree.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: RB_Tree.inl 94310 2011-07-09 19:10:06Z schmidt $
#include "ace/Guard_T.h"
#include "ace/Malloc_Base.h"
@@ -194,8 +194,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::bind (const EXT_ID &ext_id,
const INT_ID &int_id,
ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)
{
- ACE_TRACE ("ACE_RB_Tree::bind (const EXT_ID &ext_id, const INT_ID &int_id, "
- "ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
+ ACE_TRACE ("ACE_RB_Tree::bind (const EXT_ID &ext_id, const INT_ID &int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
return this->insert_i (ext_id, int_id, entry);
@@ -238,8 +237,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::trybind (const EXT_ID &ext_
INT_ID &int_id,
ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)
{
- ACE_TRACE ("ACE_RB_Tree::trybind (const EXT_ID &ext_id, INT_ID &int_id, "
- "ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
+ ACE_TRACE ("ACE_RB_Tree::trybind (const EXT_ID &ext_id, INT_ID &int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
int result = this->insert_i (ext_id, int_id, entry);
@@ -290,8 +288,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i
const INT_ID &int_id,
ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)
{
- ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id, "
- "ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
+ ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
int result = this->insert_i (ext_id, int_id, entry);
@@ -318,8 +315,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i
const INT_ID &int_id,
INT_ID &old_int_id)
{
- ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, "
- "const INT_ID &int_id, INT_ID &old_int_id)");
+ ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
ACE_RB_Tree_Node<EXT_ID, INT_ID> *entry;
@@ -347,8 +343,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i
INT_ID &old_int_id,
ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)
{
- ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id,"
- "INT_ID &old_int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
+ ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id,INT_ID &old_int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
int result = this->insert_i (ext_id, int_id, entry);
@@ -380,8 +375,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i
EXT_ID &old_ext_id,
INT_ID &old_int_id)
{
- ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id,"
- "EXT_ID &old_ext_id, INT_ID &old_int_id)");
+ ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id,EXT_ID &old_ext_id, INT_ID &old_int_id)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
ACE_RB_Tree_Node<EXT_ID, INT_ID> *entry;
@@ -411,9 +405,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i
INT_ID &old_int_id,
ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)
{
- ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id, "
- "EXT_ID &old_ext_id, INT_ID &old_int_id, "
- "ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
+ ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)");
ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
int result = this->insert_i (ext_id, int_id, entry);
diff --git a/dep/acelite/ace/README b/dep/acelite/ace/README
index 6afb534a2bf..56321ab2aa4 100644
--- a/dep/acelite/ace/README
+++ b/dep/acelite/ace/README
@@ -1,4 +1,4 @@
-// $Id: README 92182 2010-10-08 08:21:27Z olli $
+// $Id: README 93588 2011-03-18 05:18:06Z olli $
ACE Portability Macros
----------------------
@@ -173,8 +173,6 @@ ACE_HAS_NONRECURSIVE_MUTEXES In addition to recursive mutexes,
platform has non-recursive ones also.
ACE_HAS_RECV_TIMEDWAIT Platform has the MIT pthreads
APIs for
-ACE_HAS_RECVFROM_TIMEDWAIT timed send/recv operations
-ACE_HAS_RECVMSG_TIMEDWAIT
ACE_HAS_RLIMIT_RESOURCE_ENUM Platform has enum instead of
int for first argument to
::{get,set}rlimit (). The
@@ -201,19 +199,12 @@ ACE_SCANDIR_CMP_USES_CONST_VOIDPTR The OS's scandir() comparator function
const void*).
ACE_SCANDIR_SEL_LACKS_CONST The OS's scandir() selector function
is int (*selector)(ACE_DIRENT*)
-ACE_HAS_SEND_TIMEDWAIT
-ACE_HAS_SENDTO_TIMEDWAIT
-ACE_HAS_SENDMSG_TIMEDWAIT
ACE_HAS_STDARG_THR_DEST Platform has void (*)(...)
prototype for
pthread_key_create()
destructor (e.g., LynxOS).
ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS Platform/compiler supports
Win32 structural exceptions
-ACE_HAS_READ_TIMEDWAIT
-ACE_HAS_READV_TIMEDWAIT
-ACE_HAS_WRITE_TIMEDWAIT
-ACE_HAS_WRITEV_TIMEDWAIT
ACE_HAS_4_4BSD_SENDMSG_RECVMSG Platform has BSD 4.4
sendmsg()/recvmsg() APIs.
ACE_HAS_P_READ_WRITE Platform has pread() and
@@ -261,9 +252,6 @@ ACE_HAS_BROKEN_NESTED_TEMPLATES MSVC has trouble with defining
structs and classes
ACE_HAS_BROKEN_POSIX_TIME Platform defines struct
timespec in <sys/timers.h>
-ACE_HAS_BROKEN_RANDR OS/compiler's header files are
- inconsistent with libC
- definition of rand_r().
ACE_HAS_BROKEN_T_ERROR Compiler/platform has the wrong
prototype for t_error(), i.e.,
t_error(char *) rather than
@@ -353,8 +341,6 @@ ACE_USES_IPV4_IPV6_MIGRATION Enable IPv6 support in ACE on
turned on by default.
ACE_HAS_IPV6_V6ONLY Platform supports the IPPROTO_IPV6
level IPV6_V6ONLY socket option.
-ACE_HAS_IRIX62_THREADS Platform supports the very odd
- IRIX 6.2 threads...
ACE_HAS_NONSTATIC_OBJECT_MANAGER Causes the ACE_Object_Manager
instance to be created in main
(int, char *[]), instead of as
@@ -482,12 +468,6 @@ ACE_HAS_PTHREADS Platform supports POSIX
one. Also may need some
ACE_HAS_... thing for
extensions.
-ACE_HAS_PTHREADS_DRAFT4 Platform's 'Pthreads' is .4a draft 4
-ACE_HAS_PTHREADS_DRAFT6 Platform's 'Pthreads' is .4a draft 6
-ACE_HAS_PTHREADS_DRAFT7 Platform's 'Pthreads' is .1c draft 7
-ACE_HAS_PTHREADS_STD Platform supports POSIX.1c-1995 threads
- (This is the final standard
- Pthreads).
ACE_HAS_PTHREADS_UNIX98_EXT Platform has the UNIX98 extensions to
Pthreads (rwlocks)
ACE_HAS_PTHREAD_ATTR_SETCREATESUSPEND_NP Platform has
@@ -694,9 +674,6 @@ ACE_HAS_UCONTEXT_T Platform supports ucontext_t
ACE_HAS_UNION_WAIT The wait() system call takes a
(union wait *) rather than int
*
-ACE_HAS_UNIXWARE_SVR4_SIGNAL_T Has inconsistent SVR4 signal
- stuff, but not the same as the
- other platforms
ACE_HAS_VALGRIND Running with valgrind
ACE_HAS_VERBOSE_NOTSUP Prints out console message in
ACE_NOTSUP. Useful for
@@ -969,7 +946,6 @@ ACE_LACKS_PWD_REENTRANT_FUNCTIONS Platform lacks getpwnam_r()
ACE_LACKS_QSORT Compiler/platform lacks the
standard C library qsort()
function
-ACE_LACKS_RAND_REENTRANT_FUNCTIONS Platform lacks rand_r()
ACE_LACKS_READLINK Platform lacks the readlink() function.
ACE_LACKS_READV Platform doesn't define readv,
so use our own
diff --git a/dep/acelite/ace/RW_Mutex.h b/dep/acelite/ace/RW_Mutex.h
index aaaabdc0b96..99ba4c0d3fc 100644
--- a/dep/acelite/ace/RW_Mutex.h
+++ b/dep/acelite/ace/RW_Mutex.h
@@ -4,7 +4,7 @@
/**
* @file RW_Mutex.h
*
- * $Id: RW_Mutex.h 83934 2008-12-01 13:47:06Z johnnyw $
+ * $Id: RW_Mutex.h 93359 2011-02-11 11:33:12Z mcorino $
*
* Moved from Synch.h.
*
@@ -92,7 +92,7 @@ public:
/**
* Note, for interface uniformity with other synchronization
- * wrappers we include the <tryacquire> method. This is implemented
+ * wrappers we include the tryacquire() method. This is implemented
* as a write-lock to be safe... Returns -1 on failure. If we
* "failed" because someone else already had the lock, @c errno is
* set to @c EBUSY.
@@ -115,11 +115,11 @@ protected:
/// Readers/writer lock.
ACE_rwlock_t lock_;
- /// Keeps track of whether <remove> has been called yet to avoid
- /// multiple <remove> calls, e.g., explicitly and implicitly in the
- /// destructor. This flag isn't protected by a lock, so make sure
+ /// Keeps track of whether remove() has been called yet to avoid
+ /// multiple remove() calls, e.g., explicitly and implicitly in the
+ /// destructor. This flag isn't protected by a lock, so make sure
/// that you don't have multiple threads simultaneously calling
- /// <remove> on the same object, which is a bad idea anyway...
+ /// remove() on the same object, which is a bad idea anyway...
bool removed_;
private:
diff --git a/dep/acelite/ace/Reactor.h b/dep/acelite/ace/Reactor.h
index 6198b4ebcfc..57d2ec7ea91 100644
--- a/dep/acelite/ace/Reactor.h
+++ b/dep/acelite/ace/Reactor.h
@@ -4,7 +4,7 @@
/**
* @file Reactor.h
*
- * $Id: Reactor.h 92345 2010-10-24 12:39:33Z johnnyw $
+ * $Id: Reactor.h 95774 2012-05-17 15:45:58Z shuston $
*
* @author Irfan Pyarali <irfan@cs.wustl.edu>
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
@@ -110,11 +110,11 @@ public:
// i.e., the one returned from ACE_Reactor::instance().
/**
* Run the event loop until the
- * <ACE_Reactor::handle_events/ACE_Reactor::alertable_handle_events>
+ * ACE_Reactor::handle_events()/ACE_Reactor::alertable_handle_events()
* method returns -1 or the end_event_loop() method is invoked.
* Note that this method can only be used by the singleton
* ACE_Reactor::instance(). Thus, to run another reactor use
- * <ACE_Reactor::run_reactor_event_loop>.
+ * ACE_Reactor::run_reactor_event_loop().
*
* @deprecated Use ACE_Reactor::instance()->run_reactor_event_loop() instead
*/
@@ -178,18 +178,23 @@ public:
// These methods work with an instance of a reactor.
/**
- * Run the event loop until the
- * ACE_Reactor::handle_events()/ACE_Reactor::alertable_handle_events()
- * method returns -1 or the end_reactor_event_loop() method is invoked.
+ * Run the event loop until the ACE_Reactor::handle_events() or
+ * ACE_Reactor::alertable_handle_events() method returns -1 or
+ * the end_reactor_event_loop() method is invoked.
*/
int run_reactor_event_loop (REACTOR_EVENT_HOOK = 0);
int run_alertable_reactor_event_loop (REACTOR_EVENT_HOOK = 0);
/**
* Run the event loop until the ACE_Reactor::handle_events() or
- * <ACE_Reactor::alertable_handle_events> methods returns -1, the
+ * ACE_Reactor::alertable_handle_events() method returns -1, the
* end_reactor_event_loop() method is invoked, or the ACE_Time_Value
- * expires.
+ * expires while the underlying event demultiplexer is waiting for
+ * events.
+ * Note that it is possible for events to continuously be available,
+ * avoiding the need to wait for events. In this situation the timeout
+ * value will not have an opportunity to expire until the next time
+ * the underlying event demultiplexer waits for events.
*/
int run_reactor_event_loop (ACE_Time_Value &tv,
REACTOR_EVENT_HOOK = 0);
@@ -559,13 +564,19 @@ public:
* @see cancel_timer()
* @see reset_timer_interval()
*
- * @param event_handler Event handler to schedule on reactor
- * @param arg Argument passed to the handle_timeout() method of
- * event_handler
- * @param delay Time interval after which the timer will expire
- * @param interval Time interval after which the timer will be automatically
- * rescheduled
- * @return -1 on failure, a timer_id value on success
+ * @param event_handler Event handler to schedule on reactor. The handler's
+ * handle_timeout() method will be called when this
+ * scheduled timer expires.
+ * @param arg Argument passed to the handle_timeout() method of
+ * event_handler.
+ * @param delay Time interval after which the timer will expire.
+ * @param interval Time interval for which the timer will be
+ * automatically rescheduled if the handle_timeout()
+ * callback does not return a value less than 0.
+ *
+ * @retval timer id, on success. The id can be used to
+ * cancel or reschedule this timer.
+ * @retval -1 on failure, with errno set.
*/
virtual long schedule_timer (ACE_Event_Handler *event_handler,
const void *arg,
diff --git a/dep/acelite/ace/Recursive_Thread_Mutex.h b/dep/acelite/ace/Recursive_Thread_Mutex.h
index 6ddd04bd6bf..240d9ce60a0 100644
--- a/dep/acelite/ace/Recursive_Thread_Mutex.h
+++ b/dep/acelite/ace/Recursive_Thread_Mutex.h
@@ -4,7 +4,7 @@
/**
* @file Recursive_Thread_Mutex.h
*
- * $Id: Recursive_Thread_Mutex.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Recursive_Thread_Mutex.h 93359 2011-02-11 11:33:12Z mcorino $
*
* Moved from Synch.h.
*
@@ -72,7 +72,7 @@ public:
int acquire (ACE_Time_Value &tv);
/**
- * If @a tv == 0 the call <acquire()> directly. Otherwise, Block the
+ * If @a tv == 0 the call acquire() directly. Otherwise, Block the
* thread until we acquire the mutex or until @a tv times out, in
* which case -1 is returned with @c errno == @c ETIME. Note that
* <*tv> is assumed to be in "absolute" rather than "relative" time.
@@ -89,14 +89,14 @@ public:
int tryacquire (void);
/**
- * Acquire mutex ownership. This calls <acquire> and is only
+ * Acquire mutex ownership. This calls acquire() and is only
* here to make the ACE_Recusive_Thread_Mutex interface consistent
* with the other synchronization APIs.
*/
int acquire_read (void);
/**
- * Acquire mutex ownership. This calls <acquire> and is only
+ * Acquire mutex ownership. This calls acquire() and is only
* here to make the ACE_Recusive_Thread_Mutex interface consistent
* with the other synchronization APIs.
*/
@@ -104,7 +104,7 @@ public:
/**
* Conditionally acquire mutex (i.e., won't block). This calls
- * <tryacquire> and is only here to make the
+ * tryacquire() and is only here to make the
* ACE_Recusive_Thread_Mutex interface consistent with the other
* synchronization APIs. Returns -1 on failure. If we "failed"
* because someone else already had the lock, @c errno is set to
@@ -114,7 +114,7 @@ public:
/**
* Conditionally acquire mutex (i.e., won't block). This calls
- * <tryacquire> and is only here to make the
+ * tryacquire() and is only here to make the
* ACE_Recusive_Thread_Mutex interface consistent with the other
* synchronization APIs. Returns -1 on failure. If we "failed"
* because someone else already had the lock, @c errno is set to
@@ -169,11 +169,11 @@ protected:
/// Recursive mutex.
ACE_recursive_thread_mutex_t lock_;
- /// Keeps track of whether <remove> has been called yet to avoid
- /// multiple <remove> calls, e.g., explicitly and implicitly in the
+ /// Keeps track of whether remove() has been called yet to avoid
+ /// multiple remove() calls, e.g., explicitly and implicitly in the
/// destructor. This flag isn't protected by a lock, so make sure
/// that you don't have multiple threads simultaneously calling
- /// <remove> on the same object, which is a bad idea anyway...
+ /// remove() on the same object, which is a bad idea anyway...
bool removed_;
private:
diff --git a/dep/acelite/ace/Registry_Name_Space.h b/dep/acelite/ace/Registry_Name_Space.h
index eb9f77587f6..289e61039fa 100644
--- a/dep/acelite/ace/Registry_Name_Space.h
+++ b/dep/acelite/ace/Registry_Name_Space.h
@@ -4,7 +4,7 @@
/**
* @file Registry_Name_Space.h
*
- * $Id: Registry_Name_Space.h 92345 2010-10-24 12:39:33Z johnnyw $
+ * $Id: Registry_Name_Space.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Irfan Pyarali (irfan@cs.wustl.edu)
*/
@@ -67,13 +67,13 @@ public:
/**
* Overwrite the value or type of an existing name in a
* ACE_Name_Space or bind a new name to the context, if it didn't
- * exist yet. (Wide charcter strings interface).
+ * exist yet. (Wide character strings interface).
*/
int rebind (const ACE_NS_WString &name_in,
const ACE_NS_WString &value_in,
const char *type_in = "");
- /// Delete a name from a ACE_Name_Space (Wide charcter strings
+ /// Delete a name from a ACE_Name_Space (Wide character strings
/// Interface).
int unbind (const ACE_NS_WString &name_in);
diff --git a/dep/acelite/ace/Remote_Name_Space.h b/dep/acelite/ace/Remote_Name_Space.h
index 683f36c7963..73c9272f07d 100644
--- a/dep/acelite/ace/Remote_Name_Space.h
+++ b/dep/acelite/ace/Remote_Name_Space.h
@@ -4,7 +4,7 @@
/**
* @file Remote_Name_Space.h
*
- * $Id: Remote_Name_Space.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Remote_Name_Space.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Prashant Jain
*/
@@ -77,18 +77,18 @@ public:
/**
* Overwrite the value or type of an existing name in a
* ACE_Remote_Name_Space or bind a new name to the context, if it
- * didn't exist yet. (Wide charcter strings interface).
+ * didn't exist yet. (Wide character strings interface).
*/
virtual int rebind (const ACE_NS_WString &name_in,
const ACE_NS_WString &value_in,
const char *type_in = "");
- /// Delete a name from a ACE_Remote_Name_Space (Wide charcter strings
+ /// Delete a name from a ACE_Remote_Name_Space (Wide character strings
/// Interface).
virtual int unbind (const ACE_NS_WString &name_in);
/// Get value and type of a given name binding (Wide chars). The
- /// caller is responsible for deleting both <value_out> and <type_out>!
+ /// caller is responsible for deleting both @a value_out and @a type_out!
virtual int resolve (const ACE_NS_WString &name_in,
ACE_NS_WString &value_out,
char *&type_out);
diff --git a/dep/acelite/ace/Remote_Tokens.h b/dep/acelite/ace/Remote_Tokens.h
index 3c9ed94f561..3d09f7f2fc4 100644
--- a/dep/acelite/ace/Remote_Tokens.h
+++ b/dep/acelite/ace/Remote_Tokens.h
@@ -4,7 +4,7 @@
/**
* @file Remote_Tokens.h
*
- * $Id: Remote_Tokens.h 92345 2010-10-24 12:39:33Z johnnyw $
+ * $Id: Remote_Tokens.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Douglas C. Schmidt (schmidt@cs.wustl.edu)
* @author Tim Harrison (harrison@cs.wustl.edu)
@@ -42,7 +42,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* distributed token operations. It is similar to the
* ACE_Token_Proxy.
* @todo
- * Distributed sleep_hooks have not been implemented. <owner_id>
+ * Distributed sleep_hooks have not been implemented. <owner_id>
* is not implemented.
*/
class ACE_Export ACE_Remote_Token_Proxy : public ACE_Token_Proxy
diff --git a/dep/acelite/ace/SOCK_Dgram.cpp b/dep/acelite/ace/SOCK_Dgram.cpp
index 0530584b059..3706d780ad5 100644
--- a/dep/acelite/ace/SOCK_Dgram.cpp
+++ b/dep/acelite/ace/SOCK_Dgram.cpp
@@ -1,4 +1,4 @@
-// $Id: SOCK_Dgram.cpp 91622 2010-09-06 08:26:30Z sma $
+// $Id: SOCK_Dgram.cpp 95533 2012-02-14 22:59:17Z wotte $
#include "ace/SOCK_Dgram.h"
@@ -320,7 +320,7 @@ ACE_SOCK_Dgram::send (const iovec iov[],
// Determine the total length of all the buffers in <iov>.
for (i = 0; i < n; i++)
-#if ! (defined(__BORLANDC__) || defined(linux) || defined(ACE_HAS_RTEMS))
+#if ! (defined(__BORLANDC__) || defined(ACE_LINUX) || defined(ACE_HAS_RTEMS))
// The iov_len is unsigned on Linux, RTEMS and with Borland. If we go
// ahead and try the if, it will emit a warning.
if (iov[i].iov_len < 0)
@@ -369,7 +369,7 @@ ACE_SOCK_Dgram::recv (iovec iov[],
int i;
for (i = 0; i < n; i++)
-#if ! (defined(__BORLANDC__) || defined(linux) || defined(ACE_HAS_RTEMS))
+#if ! (defined(__BORLANDC__) || defined(ACE_LINUX) || defined(ACE_HAS_RTEMS))
// The iov_len is unsigned on Linux, RTEMS and with Borland. If we go
// ahead and try the if, it will emit a warning.
if (iov[i].iov_len < 0)
@@ -596,7 +596,7 @@ ACE_SOCK_Dgram::make_multicast_ifaddr6 (ipv6_mreq *ret_mreq,
0,
sizeof (lmreq));
-#if defined(__linux__)
+#if defined(ACE_LINUX)
if (net_if != 0)
{
lmreq.ipv6mr_interface = ACE_OS::if_nametoindex (ACE_TEXT_ALWAYS_CHAR(net_if));
@@ -674,6 +674,6 @@ ACE_SOCK_Dgram::make_multicast_ifaddr6 (ipv6_mreq *ret_mreq,
return 0;
}
-#endif /* __linux__ && ACE_HAS_IPV6 */
+#endif /* ACE_LINUX && ACE_HAS_IPV6 */
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/SOCK_Dgram.h b/dep/acelite/ace/SOCK_Dgram.h
index c26c5ff2c35..3a8eba63da7 100644
--- a/dep/acelite/ace/SOCK_Dgram.h
+++ b/dep/acelite/ace/SOCK_Dgram.h
@@ -4,7 +4,7 @@
/**
* @file SOCK_Dgram.h
*
- * $Id: SOCK_Dgram.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: SOCK_Dgram.h 92580 2010-11-15 09:48:02Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -206,8 +206,7 @@ public:
protected:
/// Open is shared by this and by <LSOCK_Dgram>.
- int shared_open (const ACE_Addr &local,
- int protocol_family);
+ int shared_open (const ACE_Addr &local, int protocol_family);
/// Create a multicast addr/if pair, in format useful for system calls.
/// If mreq param is NULL, just verify the passed addr/interface specs.
diff --git a/dep/acelite/ace/SOCK_Dgram_Bcast.cpp b/dep/acelite/ace/SOCK_Dgram_Bcast.cpp
index fec4c39a259..f6226665e25 100644
--- a/dep/acelite/ace/SOCK_Dgram_Bcast.cpp
+++ b/dep/acelite/ace/SOCK_Dgram_Bcast.cpp
@@ -1,4 +1,4 @@
-// $Id: SOCK_Dgram_Bcast.cpp 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: SOCK_Dgram_Bcast.cpp 93359 2011-02-11 11:33:12Z mcorino $
#include "ace/SOCK_Dgram_Bcast.h"
@@ -181,7 +181,7 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name)
// Silently skip link interfaces
if (ifr->ifr_addr.sa_family == AF_LINK)
continue;
-#endif /* __QNX__ */
+#endif /* __QNX__ || ACE_VXWORKS */
// Compare host ip address with interface ip address.
if (host_name)
{
diff --git a/dep/acelite/ace/SOCK_Dgram_Mcast.cpp b/dep/acelite/ace/SOCK_Dgram_Mcast.cpp
index 5f31771b0f1..91167e0ac14 100644
--- a/dep/acelite/ace/SOCK_Dgram_Mcast.cpp
+++ b/dep/acelite/ace/SOCK_Dgram_Mcast.cpp
@@ -1,4 +1,4 @@
-// $Id: SOCK_Dgram_Mcast.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: SOCK_Dgram_Mcast.cpp 95679 2012-04-03 22:55:46Z shuston $
#include "ace/SOCK_Dgram_Mcast.h"
@@ -8,14 +8,22 @@
#include "ace/os_include/net/os_if.h"
#include "ace/os_include/arpa/os_inet.h"
-#if defined (__linux__) && defined (ACE_HAS_IPV6)
+#if defined (ACE_LINUX) && defined (ACE_HAS_IPV6)
#include "ace/OS_NS_sys_socket.h"
#endif
-#if defined (ACE_HAS_IPV6) && defined (ACE_WIN32)
+#if defined (ACE_WIN32)
#include /**/ <iphlpapi.h>
#endif
+#if defined (ACE_HAS_GETIFADDRS)
+# if defined (ACE_VXWORKS)
+# include /**/ <net/ifaddrs.h>
+# else
+# include /**/ <ifaddrs.h>
+# endif /*ACE_VXWORKS */
+#endif /* ACE_HAS_GETIFADDRS */
+
#if !defined (__ACE_INLINE__)
#include "ace/SOCK_Dgram_Mcast.inl"
#endif /* __ACE_INLINE__ */
@@ -253,135 +261,135 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
if (ACE_BIT_ENABLED (this->opts_, OPT_NULLIFACE_ALL)
&& net_if == 0)
{
-#if defined (ACE_HAS_IPV6)
- if (mcast_addr.get_type () == AF_INET6)
- {
- size_t nr_subscribed = 0;
-# if defined(__linux__)
- struct if_nameindex *intf;
-
- intf = ACE_OS::if_nameindex ();
-
- if (intf == 0)
- return -1;
-
- int index = 0;
- while (intf[index].if_index != 0 || intf[index].if_name != 0)
- {
- if (this->join (mcast_addr, reuse_addr,
- ACE_TEXT_CHAR_TO_TCHAR(intf[index].if_name)) == 0)
- ++nr_subscribed;
-
- ++index;
- }
+ int family = mcast_addr.get_type ();
+ size_t nr_subscribed = 0;
- ACE_OS::if_freenameindex (intf);
+#if defined (ACE_HAS_GETIFADDRS)
-# elif defined (ACE_WIN32)
+ // Take advantage of the BSD getifaddrs function that simplifies
+ // access to connected interfaces.
+ struct ifaddrs *ifap = 0;
+ struct ifaddrs *p_if = 0;
- IP_ADAPTER_ADDRESSES tmp_addrs;
- // Initial call to determine actual memory size needed
- DWORD dwRetVal;
- ULONG bufLen = 0;
- if ((dwRetVal = ::GetAdaptersAddresses (AF_INET6,
- 0,
- 0,
- &tmp_addrs,
- &bufLen)) != ERROR_BUFFER_OVERFLOW)
- return -1; // With output bufferlength 0 this can't be right.
+ if (::getifaddrs (&ifap) != 0)
+ return -1;
- // Get required output buffer and retrieve info for real.
- PIP_ADAPTER_ADDRESSES pAddrs;
- char *buf;
- ACE_NEW_RETURN (buf,
- char[bufLen],
- -1);
- pAddrs = reinterpret_cast<PIP_ADAPTER_ADDRESSES> (buf);
- if ((dwRetVal = ::GetAdaptersAddresses (AF_INET6,
- 0,
- 0,
- pAddrs,
- &bufLen)) != NO_ERROR)
+ // Not every interface is for IP, and not all are up and multicast.
+ for (p_if = ifap;
+ p_if != 0;
+ p_if = p_if->ifa_next)
+ {
+ // Some OSes can return interfaces with no ifa_addr if the
+ // interface has no assigned address.
+ // If there is an address but it's not the family we want, ignore it.
+ if (p_if->ifa_addr == 0 || p_if->ifa_addr->sa_family != family)
+ continue;
+
+ // Check to see if it's up and supports multicast.
+ unsigned int wanted = IFF_UP | IFF_MULTICAST;
+ if ((p_if->ifa_flags & wanted) != wanted)
+ continue;
+
+ // Sometimes the kernel returns 0.0.0.0 as the interface
+ // address, skip those...
+ if (p_if->ifa_addr->sa_family == PF_INET)
{
- delete[] buf; // clean up
- return -1;
- }
+ struct sockaddr_in *addr =
+ reinterpret_cast<sockaddr_in *> (p_if->ifa_addr);
- while (pAddrs)
+ if (addr->sin_addr.s_addr == INADDR_ANY)
+ continue;
+ }
+# if defined (ACE_HAS_IPV6)
+ else if (p_if->ifa_addr->sa_family == AF_INET6)
{
- if (this->join (mcast_addr, reuse_addr,
- ACE_TEXT_CHAR_TO_TCHAR(pAddrs->AdapterName)) == 0)
- ++nr_subscribed;
+ struct sockaddr_in6 *addr =
+ reinterpret_cast<sockaddr_in6 *> (p_if->ifa_addr);
- pAddrs = pAddrs->Next;
+ // Skip the ANY address
+ if (IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr))
+ continue;
}
+# endif /* ACE_HAS_IPV6 */
- delete[] buf; // clean up
+ // Ok, now join on this interface.
+ if (this->join (mcast_addr,
+ reuse_addr,
+ ACE_TEXT_CHAR_TO_TCHAR(p_if->ifa_name)) == 0)
+ ++nr_subscribed;
+ }
-# endif /* ACE_WIN32 */
+ ::freeifaddrs (ifap);
- if (nr_subscribed == 0)
- {
- errno = ENODEV;
- return -1;
- }
+# elif defined (ACE_WIN32)
- return 1;
- }
- else
+ IP_ADAPTER_ADDRESSES tmp_addrs;
+ // Initial call to determine actual memory size needed
+ DWORD dwRetVal;
+ ULONG bufLen = 0;
+ // Note... GetAdaptersAddresses returns different bufLen values depending
+ // on how many multicast joins there are on the system. To avoid this,
+ // specify that we don't want to know about multicast addresses. This
+ // does not avoid multicastable interfaces and makes the size-check
+ // more reliable across varying conditions.
+ DWORD flags = GAA_FLAG_SKIP_MULTICAST;
+ if ((dwRetVal = ::GetAdaptersAddresses (family,
+ flags,
+ 0,
+ &tmp_addrs,
+ &bufLen)) != ERROR_BUFFER_OVERFLOW)
{
- // Subscribe on all local multicast-capable network interfaces, by
- // doing recursive calls with specific interfaces.
-
- ACE_INET_Addr *if_addrs = 0;
- size_t if_cnt;
+ errno = dwRetVal;
+ return -1; // With output bufferlength 0 this can't be right.
+ }
- if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0)
- return -1;
+ // Get required output buffer and retrieve info for real.
+ PIP_ADAPTER_ADDRESSES pAddrs;
+ char *buf;
+ ACE_NEW_RETURN (buf,
+ char[bufLen],
+ -1);
+ pAddrs = reinterpret_cast<PIP_ADAPTER_ADDRESSES> (buf);
+ if ((dwRetVal = ::GetAdaptersAddresses (family,
+ flags,
+ 0,
+ pAddrs,
+ &bufLen)) != NO_ERROR)
+ {
+ delete[] buf; // clean up
+ errno = dwRetVal;
+ return -1;
+ }
- size_t nr_subscribed = 0;
+ for (; pAddrs; pAddrs = pAddrs->Next)
+ {
+ if (pAddrs->OperStatus != IfOperStatusUp)
+ continue;
- if (if_cnt < 2)
+ // The ACE_SOCK_Dgram::make_multicast_ifaddr (IPv4), called by join(),
+ // can only deal with a dotted-decimal address, not an interface name.
+ if (family == AF_INET)
{
- if (this->join (mcast_addr,
- reuse_addr,
- ACE_TEXT ("0.0.0.0")) == 0)
+ ACE_INET_Addr intf_addr ((sockaddr_in*)(pAddrs->FirstUnicastAddress->Address.lpSockaddr),
+ pAddrs->FirstUnicastAddress->Address.iSockaddrLength);
+ char intf_addr_str[INET_ADDRSTRLEN];
+ intf_addr.get_host_addr (intf_addr_str, sizeof (intf_addr_str));
+ if (this->join (mcast_addr, reuse_addr,
+ ACE_TEXT_CHAR_TO_TCHAR(intf_addr_str)) == 0)
++nr_subscribed;
}
else
{
- // Iterate through all the interfaces, figure out which ones
- // offer multicast service, and subscribe to them.
- while (if_cnt > 0)
- {
- --if_cnt;
-
- // Convert to 0-based for indexing, next loop check.
- if (if_addrs[if_cnt].get_type () != AF_INET || if_addrs[if_cnt].is_loopback ())
- continue;
- char addr_buf[INET6_ADDRSTRLEN];
- if (this->join (mcast_addr,
- reuse_addr,
- ACE_TEXT_CHAR_TO_TCHAR
- (if_addrs[if_cnt].get_host_addr (addr_buf, INET6_ADDRSTRLEN))) == 0)
- ++nr_subscribed;
- }
+ if (this->join (mcast_addr, reuse_addr,
+ ACE_TEXT_CHAR_TO_TCHAR(pAddrs->AdapterName)) == 0)
+ ++nr_subscribed;
}
+ }
- delete [] if_addrs;
+ delete[] buf; // clean up
- if (nr_subscribed == 0)
- {
- errno = ENODEV;
- return -1;
- }
+# else
- // 1 indicates a "short-circuit" return. This handles the
- // recursive behavior of checking all the interfaces.
- return 1;
-
- }
-#else
// Subscribe on all local multicast-capable network interfaces, by
// doing recursive calls with specific interfaces.
@@ -391,8 +399,6 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0)
return -1;
- size_t nr_subscribed = 0;
-
if (if_cnt < 2)
{
if (this->join (mcast_addr,
@@ -409,7 +415,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
--if_cnt;
// Convert to 0-based for indexing, next loop check.
- if (if_addrs[if_cnt].is_loopback ())
+ if (if_addrs[if_cnt].get_type () != family || if_addrs[if_cnt].is_loopback ())
continue;
char addr_buf[INET6_ADDRSTRLEN];
if (this->join (mcast_addr,
@@ -422,18 +428,19 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
delete [] if_addrs;
+# endif /* ACE_WIN32 */
+
if (nr_subscribed == 0)
{
errno = ENODEV;
return -1;
}
- // 1 indicates a "short-circuit" return. This handles the
- // recursive behavior of checking all the interfaces.
return 1;
-#endif /* ACE_HAS_IPV6 */
}
+ // Subscribe on a specific interface, or on the default interface.
+
#if defined (ACE_HAS_IPV6)
if (mcast_addr.get_type () == AF_INET6)
{
@@ -441,6 +448,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
return -1;
}
else
+#endif /* ACE_HAS_IPV6 - Fall into IPv4-only case */
{
// Validate passed multicast addr and iface specifications.
if (this->make_multicast_ifaddr (0,
@@ -448,13 +456,6 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
net_if) == -1)
return -1;
}
-#else
- // Validate passed multicast addr and iface specifications.
- if (this->make_multicast_ifaddr (0,
- mcast_addr,
- net_if) == -1)
- return -1;
-#endif /* ACE_HAS_IPV6 */
return 0;
@@ -552,7 +553,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_i (const ACE_INET_Addr &mcast_addr,
ip_mreq mreq;
#if defined (ACE_HAS_IPV6)
ipv6_mreq mreq6;
-#endif /* __linux__ && ACE_HAS_IPV6 */
+#endif /* ACE_LINUX && ACE_HAS_IPV6 */
// Open the socket IFF this is the first ::subscribe and ::open
// was not explicitly invoked.
@@ -616,7 +617,7 @@ ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr,
if (mcast_addr.get_type () == AF_INET6)
{
size_t nr_unsubscribed = 0;
-# if defined(__linux__)
+# if defined(ACE_LINUX)
struct if_nameindex *intf;
diff --git a/dep/acelite/ace/SOCK_Dgram_Mcast.h b/dep/acelite/ace/SOCK_Dgram_Mcast.h
index 7c42e46e78a..a2e7def0fe6 100644
--- a/dep/acelite/ace/SOCK_Dgram_Mcast.h
+++ b/dep/acelite/ace/SOCK_Dgram_Mcast.h
@@ -4,7 +4,7 @@
/**
* @file SOCK_Dgram_Mcast.h
*
- * $Id: SOCK_Dgram_Mcast.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: SOCK_Dgram_Mcast.h 96014 2012-08-08 15:30:01Z sma $
*
* @author Irfan Pyrali <irfan@cs.wustl.edu>
* @author Tim Harrison <harrison@cs.wustl.edu>
@@ -46,50 +46,56 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
*
* Supports multiple simultaneous subscriptions, unsubscription from one or
* all subscriptions, and independent send/recv address and interface
- * specifications. Template parameters and/or ctor arguments determine
- * per-instance optional functionality.
+ * specifications. Constructor arguments determine per-instance optional
+ * functionality.
*
- * Note that multicast semantics and implementation details are _very_
+ * Note that multicast semantics and implementation details are @i very
* environment-specific; this class is just a wrapper around the underlying
* implementation and does not try to normalize the concept of multicast
* communications.
*
* Usage Notes:
- * - Send and Recv addresses and network interfaces, but not port#, are
- * independent. While this instance is open, 1 send interface (and a default
- * send address) is in effect and 0, 1, or multiple recv addresses/interfaces
- * are in effect.
- * - The first <open>/<subscribe> invocation defines the network interface
+ * - Send and receive addresses and network interfaces, but not port number,
+ * are independent. While this instance is open, one send interface (and a
+ * default send address) is in effect and 0, 1, or multiple receive
+ * addresses/interfaces are in effect.
+ * - The first open()/subscribe() invocation defines the network interface
* and default address used for all sends by this instance, defines the
- * port# and optionally the multicast address bound to the underlying
- * socket, and defines the (one) port# that is used for all subscribes
- * (subsequent subscribes must pass the same port# or '0').
+ * port number and optionally the multicast address bound to the underlying
+ * socket, and defines the (one) port number that is used for all subscribes
+ * (subsequent subscribes must pass the same port number or 0).
* - The default loopback state is not explicitly set; the environment will
- * determine the default state. Note that some environments (e.g. some Win32)
- * do not allow the default to be changed, and that the semantics of
- * loopback control are environment dependent (e.g. sender vs receiver
- * control).
+ * determine the default state. Note that some environments (e.g. some
+ * Windows versions) do not allow the default to be changed, and that the
+ * semantics of loopback control are environment dependent (e.g. sender vs.
+ * receiver control).
* - In general, due to multicast design and implementation quirks/bugs, it is
* difficult to tell which address a received message was sent to or which
* interface it was received on (even if only one subscription is active).
- * However; there are filtering options that can be applied, to narrow it
+ * However, there are filtering options that can be applied, to narrow it
* down considerably.
*
- * Interface specification notes (for <subscribe> and <unsubscribe>):
- * - If net_if == 0, the null_iface_opt option determines whether only the
- * system "default" interface or all interfaces is affected. Specifying
- * "all" interfaces is supported only for environments for which
- * <ACE_Sock_Connect::get_ip_interfaces> is properly implemented.
+ * Interface specification notes (for subscribe() and unsubscribe()):
+ * - If @a net_if == 0, the @c OPT_NULLIFACE_ALL and @c OPT_NULLIFACE_ONE
+ * options determine whether only the system default interface
+ * (if @c OPT_NULLIFACE_ONE is set) or all interfaces (if
+ * @c OPT_NULLIFACE_ALL is set) is affected. Specifying all interfaces
+ * functions correctly only on:
+ * + Windows
+ * + Platforms with the ACE_HAS_GETIFADDRS config setting (includes Linux)
+ * + Platforms which accept the IP address as an interface
+ * name/specification
+ * + Systems with only one non-loopback interface.
+ * Other platforms require additional supporting code.
* - Multiple subscriptions for the same address but different interfaces is
* normally supported, but re-subscription to an address/interface that is
* already subscribed is normally not allowed.
- * - The <net_if> interface specification syntax is environment-specific.
+ * - The @a net_if interface specification syntax is environment-specific.
* UNIX systems will normally use device specifications such as "le0" or
* "elxl1", while other systems will use the IP address of the interface.
* Some platforms, such as pSoS, support only cardinal numbers as network
* interface specifications; for these platforms, just give these numbers in
- * alphanumeric form and <subscribe> will convert them into numbers via
- * ACE_OS::atoi().
+ * string form and join() will convert them into numbers.
*/
class ACE_Export ACE_SOCK_Dgram_Mcast : public ACE_SOCK_Dgram
{
@@ -99,78 +105,88 @@ public:
* @brief Option parameters.
*
* These control per-instance optional functionality. They are set via
- * optional constructor arguments.
+ * an optional constructor argument.
+ *
* @note Certain option values are not valid for all environments (see
* comments in source file for environment-specific restrictions). Default
* values are always valid values for the compilation environment.
*/
enum options
{
- // Define whether a specific (multicast) address (in addition to the port#)
- // is bound to the socket.
- // Notes:
- // - Effect of doing this is stack/environment dependent, but in most
- // environments can be used to filter out unwanted unicast, broadcast, and
- // (other) multicast messages sent to the same port#.
- // - Some IP stacks (e.g. some Win32) do not support binding multicast
- // addresses. Using this option will always cause an <open> error.
- // - It's not strictly possible for user code to do this level of filtering
- // w/out the bind; some environments support ways to determine which address
- // a message was sent _to_, but this class interface does not support access
- // to that info.
- // - The address (and port#) passed to <open> (or the first <subscribe>, if
- // <open> is not explicitly invoked) is the one that is bound.
- //
+ /* Define whether a specific multicast address (in addition to the port
+ * number) is bound to the socket.
+ * @note:
+ * - Effect of doing this is stack/environment dependent, but in most
+ * environments can be used to filter out unwanted unicast, broadcast,
+ * and (other) multicast messages sent to the same port number.
+ * - Some IP stacks (e.g. some Windows) do not support binding multicast
+ * addresses. Using this option will always cause an open() error.
+ * - It's not strictly possible for user code to do this level of filtering
+ * without the bind; some environments support ways to determine which
+ * address a message was sent to, but this class interface does not
+ * support access to that information.
+ * - The address (and port number) passed to open() (or the first
+ * join(), if open() is not explicitly invoked) is the one that is bound.
+ */
+
/// Disable address bind. (Bind only port.)
- // Note that this might seem odd, but we need a way to distinquish between
- // default behavior, which might or might not be to bind, and explicitely
- // choosing to bind or not to bind--which "is the question." ;-)
+ /// @note This might seem odd, but we need a way to distinguish between
+ /// default behavior, which might or might not be to bind, and explicitly
+ /// choosing to bind or not to bind--which "is the question." ;-)
OPT_BINDADDR_NO = 0,
/// Enable address bind. (Bind port and address.)
OPT_BINDADDR_YES = 1,
/// Default value for BINDADDR option. (Environment-dependent.)
#if defined (ACE_LACKS_PERFECT_MULTICAST_FILTERING) \
&& (ACE_LACKS_PERFECT_MULTICAST_FILTERING == 1)
- // Platforms that don't support perfect filtering. Note that perfect
- // filtering only really applies to multicast traffic, not unicast
- // or broadcast.
+ /// Platforms that don't support perfect filtering. Note that perfect
+ /// filtering only really applies to multicast traffic, not unicast
+ /// or broadcast.
DEFOPT_BINDADDR = OPT_BINDADDR_YES,
# else
- // At least some Win32 OS's can not bind mcast addr, so disable it.
- // General-purpose default behavior is 'disabled', since effect is
- // environment-specific and side-effects might be surprising.
+ /// At least some Win32 OS's can not bind mcast addr, so disable it.
+ /// General-purpose default behavior is 'disabled', since effect is
+ /// environment-specific and side-effects might be surprising.
DEFOPT_BINDADDR = OPT_BINDADDR_NO,
#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING = 1) */
- //
- /// Define the interpretation of 'NULL' as a recv interface specification.
- // If the interface part of a multicast address specification is NULL, it
- // will be interpreted to mean either "the default interface" or "all
- // interfaces", depending on the setting of this option.
- // Notes:
- // - The 'nulliface_all' option can not be used in environments which do
- // not fully support the <ACE_Sock_Connect::get_ip_interfaces> method
- // (e.g. non-Windows).
- // If it is, using NULL for iface will _always_ fail.
- // - The default behavior in most IP stacks is to use the 'default' interface,
- // where 'default' has rather ad-hoc semantics.
- // - This applies only to receives, not sends (which always use only one
- // interface; NULL means use the "system default" interface).
- // Supported values:
+
+ /*
+ * Define the interpretation of NULL as a join interface specification.
+ * If the interface part of a multicast address specification is NULL, it
+ * will be interpreted to mean either "the default interface" or "all
+ * interfaces", depending on the setting of this option.
+ * @note
+ * - The @c OPT_NULLIFACE_ALL option can be used only in the following
+ * environments:
+ * + Windows
+ * + Platforms with the ACE_HAS_GETIFADDRS config setting (includes
+ * Linux)
+ * + Platforms which accept the IP address as an interface
+ * name/specification and for which
+ * ACE_Sock_Connect::get_ip_interfaces() is fully implemented
+ * + Systems with only one non-loopback interface.
+ * Other platforms require additional supporting code.
+ * - The default behavior in most IP stacks is to use the default
+ * interface where "default" has rather ad-hoc semantics.
+ * - This applies only to receives, not sends (which always use only one
+ * interface; NULL means use the "system default" interface).
+ */
+ /// Supported values:
/// If (net_if==NULL), use default interface.
- // Note that this might seem odd, but we need a way to distinquish between
- // default behavior, which might or might not be to bind, and explicitely
- // choosing to bind or not to bind--which "is the question." ;-)
+ /// @note This might seem odd, but we need a way to distinguish between
+ /// default behavior, which might or might not be to bind, and explicitly
+ /// choosing to bind or not to bind--which "is the question." ;-)
OPT_NULLIFACE_ONE = 0,
/// If (net_if==NULL), use all mcast interfaces.
OPT_NULLIFACE_ALL = 2,
/// Default value for NULLIFACE option. (Environment-dependent.)
#ifdef ACE_WIN32
- // This is the (ad-hoc) legacy behavior for Win32/WinSock.
- // Notice: Older version of WinSock/MSVC may not get all multicast-capable
- // interfaces (e.g. PPP interfaces).
+ /// This is the (ad-hoc) legacy behavior for Win32/WinSock.
+ /// @note Older version of WinSock/MSVC may not get all multicast-capable
+ /// interfaces (e.g. PPP interfaces).
DEFOPT_NULLIFACE = OPT_NULLIFACE_ALL,
#else
- // General-purpose default behavior (as per legacy behavior).
+ /// General-purpose default behavior (as per legacy behavior).
DEFOPT_NULLIFACE = OPT_NULLIFACE_ONE,
#endif /* ACE_WIN32 */
/// All default options.
@@ -179,48 +195,53 @@ public:
// = Initialization routines.
- /// Ctor - Create an unitialized instance and define per-instance optional
+ /// Create an unitialized instance and define per-instance optional
/// functionality.
/**
- * You must invoke <open> or <subscribe>, to create/bind a socket and define
+ * You must invoke open() or join(), to create/bind a socket and define
* operational parameters, before performing any I/O with this instance.
*/
ACE_SOCK_Dgram_Mcast (options opts = DEFOPTS);
- /// Dtor - Release all resources and implicitly or explicitly unsubscribe
+ /// Release all resources and implicitly or explicitly unsubscribe
/// from all currently subscribed groups.
/**
- * The OPT_DTORUNSUB_YES_ option defines whether an explicit <unsusbcribe> is
+ * The OPT_DTORUNSUB_YES_ option defines whether an explicit unsubscribe() is
* done by the destructor. If not, most systems will automatically
* unsubscribe upon the close of the socket.
*/
~ACE_SOCK_Dgram_Mcast (void);
- /// Explicitly open/bind the socket and define the network interface
- /// and default multicast address used for sending messages.
/**
+ * Explicitly open/bind the socket and define the network interface
+ * and default multicast address used for sending messages.
+ *
* This method is optional; if not explicitly invoked, it is invoked by
- * the first <subscribe>, using the subscribed address/port# and network
+ * the first join(), using the subscribed address/port number and network
* interface parameters.
- * The @a mcast_addr parameter defines the default send address/port# and
- * also the port# and, if the OPT_BINDADDR_YES option is used,
- * the multicast address that is bound to this socket.
- * If the <send_net_if> parameter != 0, it defines the network interface
- * used for all sends by this instance, otherwise the system "default"
- * interface is used. (The <send_net_if> parameter is ignored if this
- * feature is not supported by the environment.)
- * The port# in <mcast_addr> may be 0, in which case a system-assigned
- * (ephemeral) port# is used for sending and receiving.
- * If @a reuse_addr != 0, the SO_REUSEADDR option and, if it is supported,
- * the SO_REUSEPORT option are enabled.
*
- * Returns: -1 if the call fails. Failure can occur due to problems with
- * the address, port#, and/or interface parameters or during system open()
+ * @param mcast_addr Defines the default send address/port number and,
+ * if the @c OPT_BINDADDR_YES option is used, the multicast address
+ * that is bound to this socket. The port number in @a mcast_addr
+ * may be 0, in which case a system-assigned (ephemeral) port number
+ * is used for sending and receiving.
+ *
+ * @param net_if If @a net_if is not 0, it defines the network interface
+ * used for all sends by this instance, otherwise the system default
+ * interface is used. (The @a net_if parameter is ignored if this
+ * feature is not supported by the environment.)
+ *
+ * @param reuse_addr If @a reuse_addr is not 0, the @c SO_REUSEADDR option
+ * and, if it is supported, the SO_REUSEPORT option are enabled.
+ *
+ * @retval 0 on success
+ * @retval -1 if the call fails. Failure can occur due to problems with
+ * the address, port, and/or interface parameters or during system open()
* or socket option processing.
*/
- int open (const ACE_INET_Addr &mcast_addr, // Bound & sendto address.
- const ACE_TCHAR *net_if = 0, // Net interface for sends.
- int reuse_addr = 1); // Reuse addr/port sock opt.
+ int open (const ACE_INET_Addr &mcast_addr,
+ const ACE_TCHAR *net_if = 0,
+ int reuse_addr = 1);
// = Multicast group subscribe/unsubscribe routines.
@@ -228,27 +249,27 @@ public:
/// supported).
/**
* The given group is joined on the specified interface. If option
- * OPT_NULLIFACE_ALL is used and <net_if> is = 0, the group is joined on
+ * OPT_NULLIFACE_ALL is used and @a net_if is = 0, the group is joined on
* all multicast capable interfaces (IFF supported). Multiple subscriptions
* to various address and interface combinations are supported and tracked.
- * If this is the first invocation of <subscribe>, and <open> was not
- * previously invoked, <open> will be invoked using <mcast_addr> for binding
- * the socket and <net_if> as the interface for <send>.
+ * If this is the first invocation of subscribe(), and open() was not
+ * previously invoked, open() will be invoked using @a mcast_addr for binding
+ * the socket and @a net_if as the interface for send().
*
* Returns: -1 if the call fails. Failure can occur due to problems with
* the address, port#, and/or interface parameters or during the subscription
- * attempt. Once bind() has been invoked (by the first <open> or
- * <subscribe>), returns errno of ENXIO if the port# is not 0 and does not
+ * attempt. Once bind() has been invoked (by the first open() or
+ * subscribe()), returns errno of ENXIO if the port# is not 0 and does not
* match the bound port#, or if OPT_BINDADDR_YES option is used
* and the address does not match the bound address. Returns errno of
* ENODEV if the addr/port#/interface parameters appeared valid, but no
* subscription(s) succeeded. An error is unconditionally returned if
- * option OPT_NULLIFACE_ALL is used, <net_if> is NULL, and
- * <ACE_Sock_Connect::get_ip_interfaces> is not implemented in this
+ * option OPT_NULLIFACE_ALL is used, @a net_if is NULL, and
+ * ACE_Sock_Connect::get_ip_interfaces() is not implemented in this
* environment.
*
* Note that the optional @a reuse_addr parameter does not apply to
- * subscriptions; it is only used if <open> is implicitly invoked (see above).
+ * subscriptions; it is only used if open() is implicitly invoked (see above).
*
* Uses the mcast_addr to determine protocol_family, and protocol which
* we always pass as 0 anyway.
@@ -262,15 +283,15 @@ public:
/// supported).
/**
* The specified group/interface combination is unsubscribed. If option
- * OPT_NULLIFACE_ALL is used and <net_if> is = 0, the group is unsubscribed
+ * OPT_NULLIFACE_ALL is used and @a net_if is = 0, the group is unsubscribed
* from all interfaces (IFF supported).
*
* Returns: -1 if the unsubscribe failed. Most environments will return -1
* if there was no active subscription for this address/interface combination.
* An error is unconditionally returned if option OPT_NULLIFACE_ALL is used,
- * <net_if> is = 0, and <ACE_Sock_Connect::get_ip_interfaces> is not
- * implemented in this environment (_even if_ the <subscribe> specifies a
- * non- NULL <net_if>).
+ * @a net_if is = 0, and ACE_Sock_Connect::get_ip_interfaces() is not
+ * implemented in this environment (_even if_ the subscribe() specifies a
+ * non- NULL @a net_if).
*
* leave() replaces unsubscribe() and uses mcast_addr to determine
* protocol_family, and protocol which we always pass as 0 anyway.
@@ -281,13 +302,13 @@ public:
// = Data transfer routines.
/// Send @a n bytes in @a buf, using the multicast address and network interface
- /// defined by the first <open> or <subscribe>.
+ /// defined by the first open() or subscribe().
ssize_t send (const void *buf,
size_t n,
int flags = 0) const;
- /// Send @a n <iovecs>, using the multicast address and network interface
- /// defined by the first <open> or <subscribe>.
+ /// Send @a n iovecs, using the multicast address and network interface
+ /// defined by the first open() or subscribe().
ssize_t send (const iovec iov[],
int n,
int flags = 0) const;
@@ -318,6 +339,14 @@ public:
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
+ /// Override write acessor for the constructor options (@see enum options above)
+ /// This class is typically default instantiated in a connection handler templated
+ /// framework so these cannot be specified on construction.
+ void opts (int opts);
+
+ /// Read acessor for the constructor options (@see enum options above)
+ int opts () const;
+
private:
/// Subscribe to a multicast address on one or more network interface(s).
@@ -356,9 +385,9 @@ private:
/// Per-instance options..
int opts_;
- /// Multicast address to which local <send> methods send datagrams.
+ /// Multicast address to which local send() methods send datagrams.
ACE_INET_Addr send_addr_;
- /// Network interface to which all <send> methods send multicast datagrams.
+ /// Network interface to which all send() methods send multicast datagrams.
ACE_TCHAR *send_net_if_;
#if defined (ACE_SOCK_DGRAM_MCAST_DUMPABLE)
diff --git a/dep/acelite/ace/SOCK_Dgram_Mcast.inl b/dep/acelite/ace/SOCK_Dgram_Mcast.inl
index 75457d32d92..d5f1ecbd17d 100644
--- a/dep/acelite/ace/SOCK_Dgram_Mcast.inl
+++ b/dep/acelite/ace/SOCK_Dgram_Mcast.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: SOCK_Dgram_Mcast.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: SOCK_Dgram_Mcast.inl 96014 2012-08-08 15:30:01Z sma $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -49,4 +49,16 @@ ACE_SOCK_Dgram_Mcast::send (const iovec iov[],
flags);
}
+ACE_INLINE void
+ACE_SOCK_Dgram_Mcast::opts (int opts)
+{
+ this->opts_ = opts;
+}
+
+ACE_INLINE int
+ACE_SOCK_Dgram_Mcast::opts () const
+{
+ return this->opts_;
+}
+
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/SOCK_Stream.h b/dep/acelite/ace/SOCK_Stream.h
index a96d7e664ef..97dc8f70858 100644
--- a/dep/acelite/ace/SOCK_Stream.h
+++ b/dep/acelite/ace/SOCK_Stream.h
@@ -4,7 +4,7 @@
/**
* @file SOCK_Stream.h
*
- * $Id: SOCK_Stream.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: SOCK_Stream.h 92956 2010-12-29 16:12:31Z shuston $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -78,7 +78,10 @@ public:
* wait indefinitely or until an error occurs for the
* specified number of bytes to be transferred.
* To avoid any waiting, specify a timeout value with
- * 0 seconds.
+ * 0 seconds. Note that the timeout period restarts on
+ * each retried operation issued; therefore, an operation
+ * that requires multiples retries may take longer than the
+ * specified timeout to complete.
* @param bytes_transferred If non-0, points to a location which receives
* the total number of bytes transferred before the method
* returns, even if it's less than the number requested.
diff --git a/dep/acelite/ace/SPIPE_Acceptor.h b/dep/acelite/ace/SPIPE_Acceptor.h
index 84529c76582..a804670d061 100644
--- a/dep/acelite/ace/SPIPE_Acceptor.h
+++ b/dep/acelite/ace/SPIPE_Acceptor.h
@@ -4,7 +4,7 @@
/**
* @file SPIPE_Acceptor.h
*
- * $Id: SPIPE_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $
+ * $Id: SPIPE_Acceptor.h 94007 2011-04-27 09:01:45Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Prashant Jain <pjain@cs.wustl.edu>
@@ -148,7 +148,7 @@ private:
DWORD pipe_mode_;
// On Windows, the handle maintained in the ACE_IPC_SAP class is the
- // event handle from event_. The pipe handle is useless for telling
+ // event handle from event. The pipe handle is useless for telling
// when a pipe connect is done/ready, and it changes on each pipe
// acceptance, quite unlike other acceptor-type classes in ACE.
// This allows the get_handle()-obtained handle to be used for
diff --git a/dep/acelite/ace/SPIPE_Stream.inl b/dep/acelite/ace/SPIPE_Stream.inl
index d490f88f145..0aa53269079 100644
--- a/dep/acelite/ace/SPIPE_Stream.inl
+++ b/dep/acelite/ace/SPIPE_Stream.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: SPIPE_Stream.inl 88707 2010-01-25 18:49:25Z johnnyw $
+// $Id: SPIPE_Stream.inl 93061 2011-01-12 21:06:07Z wotte $
#include "ace/OS_NS_sys_uio.h"
#include "ace/OS_NS_errno.h"
@@ -139,7 +139,7 @@ ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const
}
return 0;
#else
- handle = handle;
+ ACE_UNUSED_ARG (handle);
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
@@ -195,7 +195,7 @@ ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const
}
return 0;
#else
- handle = handle;
+ ACE_UNUSED_ARG (handle);
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
diff --git a/dep/acelite/ace/SSL/SSL_Context.cpp b/dep/acelite/ace/SSL/SSL_Context.cpp
index 992cdeff921..c6cf6adcdf8 100644
--- a/dep/acelite/ace/SSL/SSL_Context.cpp
+++ b/dep/acelite/ace/SSL/SSL_Context.cpp
@@ -1,4 +1,4 @@
-// $Id: SSL_Context.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: SSL_Context.cpp 93497 2011-03-07 09:43:36Z vzykov $
#include "SSL_Context.h"
#include "sslconf.h"
@@ -202,9 +202,6 @@ ACE_SSL_Context::ssl_library_fini (void)
--ssl_library_init_count;
if (ssl_library_init_count == 0)
{
- // Explicitly close the singleton
- ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::close();
-
::ERR_free_strings ();
::EVP_cleanup ();
@@ -216,7 +213,6 @@ ACE_SSL_Context::ssl_library_fini (void)
delete [] this->locks_;
this->locks_ = 0;
-
#endif /* ACE_HAS_THREADS */
}
}
@@ -645,8 +641,8 @@ ACE_SSL_Context::dh_params (const char *file_name,
#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
-template ACE_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX> *
- ACE_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::singleton_;
+template ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX> *
+ ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::singleton_;
#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/dep/acelite/ace/SSL/SSL_Context.h b/dep/acelite/ace/SSL/SSL_Context.h
index 003d6042c5b..4ad127557a1 100644
--- a/dep/acelite/ace/SSL/SSL_Context.h
+++ b/dep/acelite/ace/SSL/SSL_Context.h
@@ -1,17 +1,15 @@
// -*- C++ -*-
-
//=============================================================================
/**
* @file SSL_Context.h
*
- * $Id: SSL_Context.h 83916 2008-11-28 16:32:21Z johnnyw $
+ * $Id: SSL_Context.h 96087 2012-08-21 12:26:44Z sma $
*
* @author Carlos O'Ryan <coryan@ece.uci.edu>
* @author Ossama Othman <ossama@dre.vanderbilt.edu>
*/
//=============================================================================
-
#ifndef ACE_SSL_CONTEXT_H
#define ACE_SSL_CONTEXT_H
@@ -31,13 +29,11 @@
#include <openssl/ssl.h>
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_SSL_Export ACE_SSL_Data_File
{
public:
-
/// Default constructor
ACE_SSL_Data_File (void);
@@ -52,7 +48,6 @@ public:
int type (void) const;
private:
-
/// The file name
ACE_CString file_name_;
@@ -62,6 +57,34 @@ private:
// ****************************************************************
+// NOTE: Solaris studio compilers amongst others will issue warnings if the
+// the correct type of function pointer (i.e. extern "C" ) is not stored/used
+// of the form:
+// Warning (Anachronism): Formal argument callback of type
+// extern "C" int(*)(int,x509_store_ctx_st*) in call to
+// SSL_CTX_set_verify(ssl_ctx_st*, int, extern "C" int(*)(int,x509_store_ctx_st*))
+// is being passed int(*)(int,x509_store_ctx_st*)
+// when C library routines are passed CallBack functions pointers that are
+// actually C++ functions.
+//
+// Unfortunatly you can not specify extern "C" linkage anywhere inside a class
+// declaration or inside a function prototype for individual parameters. I.e:
+// class { extern "C" int (*callback_) (int, void *); };
+// to store a function pointer as a data member of the class is illegal as is:
+// void function (extern "C" int (*callback) (int, void *);
+// to declare function (or a class member) that takes a extern "C" function
+// pointer as a parameter.
+//
+// Since we need an extern "C" function pointer as a parameter to be stored
+// in the class and handled by member functions, we are forced to declare
+// a typedef of that extern "C" function pointer that we can then use.
+// Again unfortunatly you also are not allowed to simply add the extern "C"
+// to the typedef itself, instead you have to place the typedef declaration
+// inside an extern "C" block, thus:
+
+extern "C" {
+ typedef int (*extern_C_CallBackVerify_t) (int, X509_STORE_CTX *);
+}
/**
* @class ACE_SSL_Context
@@ -75,7 +98,6 @@ private:
class ACE_SSL_Export ACE_SSL_Context
{
public:
-
#ifdef ACE_HAS_THREADS
typedef ACE_SYNCH_MUTEX lock_type;
#endif /* ACE_HAS_THREADS */
@@ -235,7 +257,6 @@ public:
*/
int have_trusted_ca (void) const;
-
/**
* @todo Complete this documentation where elipses(...) are used
*
@@ -284,8 +305,8 @@ public:
* inherited by all the ACE_SSL objects created using the context.
* It can be overriden on a per-ACE_SSL object.
*/
- void default_verify_callback (int (*callback) (int, X509_STORE_CTX *));
- int (*default_verify_callback(void) const) (int,X509_STORE_CTX *);
+ void default_verify_callback (extern_C_CallBackVerify_t);
+ extern_C_CallBackVerify_t default_verify_callback (void) const;
/**
* @name OpenSSL Random Number Generator Seed Related Methods
@@ -339,7 +360,6 @@ public:
//@}
private:
-
/// Verify if the context has been initialized or not.
void check_context (void);
@@ -354,7 +374,6 @@ private:
//@}
private:
-
/// The SSL_CTX structure
SSL_CTX *context_;
@@ -370,7 +389,7 @@ private:
int default_verify_mode_;
/// The default verify callback.
- int (*default_verify_callback_)(int, X509_STORE_CTX *);
+ extern_C_CallBackVerify_t default_verify_callback_;
/// count of successful CA load attempts
int have_ca_;
@@ -380,7 +399,6 @@ private:
/// application is multithreaded.
static lock_type * locks_;
#endif /* ACE_HAS_THREADS */
-
};
ACE_END_VERSIONED_NAMESPACE_DECL
@@ -390,5 +408,4 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
-
#endif /* ACE_SSL_CONTEXT_H */
diff --git a/dep/acelite/ace/SSL/SSL_Context.inl b/dep/acelite/ace/SSL/SSL_Context.inl
index 7ecb3e0627e..65370672a8e 100644
--- a/dep/acelite/ace/SSL/SSL_Context.inl
+++ b/dep/acelite/ace/SSL/SSL_Context.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: SSL_Context.inl 83916 2008-11-28 16:32:21Z johnnyw $
+// $Id: SSL_Context.inl 96087 2012-08-21 12:26:44Z sma $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -100,12 +100,12 @@ ACE_SSL_Context::default_verify_mode (void) const
}
ACE_INLINE void
-ACE_SSL_Context::default_verify_callback (int (*callback) (int, X509_STORE_CTX*))
+ACE_SSL_Context::default_verify_callback (extern_C_CallBackVerify_t callback)
{
this->default_verify_callback_ = callback;
}
-ACE_INLINE int (*ACE_SSL_Context::default_verify_callback(void) const)(int,X509_STORE_CTX *)
+ACE_INLINE extern_C_CallBackVerify_t ACE_SSL_Context::default_verify_callback(void) const
{
return this->default_verify_callback_;
}
diff --git a/dep/acelite/ace/SSL/SSL_Initializer.cpp b/dep/acelite/ace/SSL/SSL_Initializer.cpp
new file mode 100644
index 00000000000..4903e60815c
--- /dev/null
+++ b/dep/acelite/ace/SSL/SSL_Initializer.cpp
@@ -0,0 +1,44 @@
+// $Id: SSL_Initializer.cpp 93497 2011-03-07 09:43:36Z vzykov $
+
+#include "SSL_Initializer.h"
+#include "SSL_Context.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+ACE_SSL_Initializer::static_init (void)
+{
+ ACE_Service_Config::process_directive (ace_svc_desc_ACE_SSL_Initializer);
+ return 0;
+}
+
+int
+ACE_SSL_Initializer::init (int, ACE_TCHAR *[])
+{
+ // Initialize ACE_SSL_Context singleton.
+ ACE_SSL_Context * ssl_ctx = ACE_SSL_Context::instance ();
+ ACE_ASSERT (ssl_ctx != 0);
+ ACE_UNUSED_ARG (ssl_ctx);
+
+ return 0;
+}
+
+int
+ACE_SSL_Initializer::fini (void)
+{
+ // Explicitly close the ACE_SSL_Context singleton.
+ ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::close();
+
+ return 0;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (ACE_SSL_Initializer,
+ ACE_TEXT ("ACE_SSL_Initializer"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (ACE_SSL_Initializer),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (ACE_SSL, ACE_SSL_Initializer)
diff --git a/dep/acelite/ace/SSL/SSL_Initializer.h b/dep/acelite/ace/SSL/SSL_Initializer.h
new file mode 100644
index 00000000000..1d15a73159c
--- /dev/null
+++ b/dep/acelite/ace/SSL/SSL_Initializer.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSL_Initializer.h
+ *
+ * $Id: SSL_Initializer.h 93497 2011-03-07 09:43:36Z vzykov $
+ *
+ * @author Vladimir Zykov <vz@prismtech.com>
+ */
+//=============================================================================
+
+#ifndef ACE_SSL_INITIALIZER_H
+#define ACE_SSL_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "SSL_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Config.h"
+#include "ace/Service_Object.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ACE_SSL_Export ACE_SSL_Initializer
+ : public ACE_Service_Object
+{
+public:
+ /// Used to force the initialization of ACE_SSL.
+ static int static_init (void);
+
+ /// Create ACE_SSL_Context singleton.
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ /// Do cleanup of SSL library.
+ virtual int fini (void);
+};
+
+static int ACE_Force_ACE_SSL_Initializer = ACE_SSL_Initializer::static_init ();
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (ACE_SSL_Initializer)
+ACE_FACTORY_DECLARE (ACE_SSL, ACE_SSL_Initializer)
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_SSL_INITIALIZER_H */
diff --git a/dep/acelite/ace/SString.cpp b/dep/acelite/ace/SString.cpp
index 5a087e3e0a9..db66850fda4 100644
--- a/dep/acelite/ace/SString.cpp
+++ b/dep/acelite/ace/SString.cpp
@@ -1,4 +1,4 @@
-// $Id: SString.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: SString.cpp 92580 2010-11-15 09:48:02Z johnnyw $
#include "ace/Malloc_T.h"
#include "ace/OS_Memory.h"
@@ -79,7 +79,7 @@ ACE_NS_WString::char_rep (void) const
}
}
-ACE_USHORT16 *
+ACE_UINT16 *
ACE_NS_WString::ushort_rep (void) const
{
ACE_TRACE ("ACE_NS_WString::ushort_rep");
@@ -87,16 +87,16 @@ ACE_NS_WString::ushort_rep (void) const
return 0;
else
{
- ACE_USHORT16 *t = 0;
+ ACE_UINT16 *t = 0;
ACE_NEW_RETURN (t,
- ACE_USHORT16[this->len_ + 1],
+ ACE_UINT16[this->len_ + 1],
0);
for (size_type i = 0; i < this->len_; ++i)
// Note that this cast may lose data if wide chars are
// actually used!
- t[i] = (ACE_USHORT16)this->rep_[i];
+ t[i] = (ACE_UINT16)this->rep_[i];
t[this->len_] = 0;
return t;
@@ -125,7 +125,7 @@ ACE_NS_WString::ACE_NS_WString (const char *s,
}
#if defined (ACE_WSTRING_HAS_USHORT_SUPPORT)
-ACE_NS_WString::ACE_NS_WString (const ACE_USHORT16 *s,
+ACE_NS_WString::ACE_NS_WString (const ACE_UINT16 *s,
size_type len,
ACE_Allocator *alloc)
: ACE_WString (alloc)
diff --git a/dep/acelite/ace/SString.h b/dep/acelite/ace/SString.h
index e7ff8ea7872..3c5f9957be7 100644
--- a/dep/acelite/ace/SString.h
+++ b/dep/acelite/ace/SString.h
@@ -4,7 +4,7 @@
/**
* @file SString.h
*
- * $Id: SString.h 91058 2010-07-12 08:20:09Z johnnyw $
+ * $Id: SString.h 92580 2010-11-15 09:48:02Z johnnyw $
*
* @author Douglas C. Schmidt (schmidt@cs.wustl.edu)
*/
@@ -75,7 +75,7 @@ public:
#if defined (ACE_WSTRING_HAS_USHORT_SUPPORT)
/// Constructor that takes in a ushort16 string (mainly used by the
/// ACE Name_Space classes)
- ACE_NS_WString (const ACE_USHORT16 *s,
+ ACE_NS_WString (const ACE_UINT16 *s,
size_type len,
ACE_Allocator *alloc = 0);
#endif /* ACE_WSTRING_HAS_USHORT_SUPPORT */
@@ -102,7 +102,7 @@ public:
/// Transform into a copy of a USHORT16 representation (caller must
/// delete). Note, behavior is undefined when sizeof (wchar_t) != 2.
- ACE_USHORT16 *ushort_rep (void) const;
+ ACE_UINT16 *ushort_rep (void) const;
};
ACE_Export
diff --git a/dep/acelite/ace/Sample_History.cpp b/dep/acelite/ace/Sample_History.cpp
index 78a7558703f..5c9e24417d3 100644
--- a/dep/acelite/ace/Sample_History.cpp
+++ b/dep/acelite/ace/Sample_History.cpp
@@ -1,4 +1,4 @@
-// $Id: Sample_History.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Sample_History.cpp 95747 2012-05-13 17:14:12Z johnnyw $
#include "ace/Sample_History.h"
@@ -10,9 +10,6 @@
#include "ace/Log_Msg.h"
#include "ace/OS_Memory.h"
-
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Sample_History::ACE_Sample_History (size_t max_samples)
@@ -27,21 +24,10 @@ ACE_Sample_History::~ACE_Sample_History (void)
delete[] this->samples_;
}
-size_t
-ACE_Sample_History::max_samples (void) const
-{
- return this->max_samples_;
-}
-
-size_t
-ACE_Sample_History::sample_count (void) const
-{
- return this->sample_count_;
-}
-
void
-ACE_Sample_History::dump_samples (const ACE_TCHAR *msg,
- ACE_UINT32 scale_factor) const
+ACE_Sample_History::dump_samples (
+ const ACE_TCHAR *msg,
+ ACE_Sample_History::scale_factor_type scale_factor) const
{
#ifndef ACE_NLOGGING
for (size_t i = 0; i != this->sample_count_; ++i)
diff --git a/dep/acelite/ace/Sample_History.h b/dep/acelite/ace/Sample_History.h
index 730deea4fab..c31c5692360 100644
--- a/dep/acelite/ace/Sample_History.h
+++ b/dep/acelite/ace/Sample_History.h
@@ -4,7 +4,7 @@
/**
* @file Sample_History.h
*
- * $Id: Sample_History.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Sample_History.h 95747 2012-05-13 17:14:12Z johnnyw $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
@@ -34,6 +34,12 @@ class ACE_Basic_Stats;
class ACE_Export ACE_Sample_History
{
public:
+#if !defined (ACE_WIN32)
+ typedef ACE_UINT32 scale_factor_type;
+#else
+ typedef ACE_UINT64 scale_factor_type;
+#endif
+
/// Constructor
/**
* The number of samples is pre-allocated, and cannot changes once
@@ -62,7 +68,7 @@ public:
* message.
*/
void dump_samples (const ACE_TCHAR *msg,
- ACE_UINT32 scale_factor) const;
+ scale_factor_type scale_factor) const;
/// Collect the summary for all the samples
void collect_basic_stats (ACE_Basic_Stats &) const;
diff --git a/dep/acelite/ace/Sample_History.inl b/dep/acelite/ace/Sample_History.inl
index 9945bfe14ec..8d7d7c9b5f7 100644
--- a/dep/acelite/ace/Sample_History.inl
+++ b/dep/acelite/ace/Sample_History.inl
@@ -1,6 +1,5 @@
// -*- C++ -*-
-//
-// $Id: Sample_History.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Sample_History.inl 95747 2012-05-13 17:14:12Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -23,4 +22,16 @@ ACE_Sample_History::get_sample (size_t i) const
return this->samples_[i];
}
+ACE_INLINE size_t
+ACE_Sample_History::max_samples (void) const
+{
+ return this->max_samples_;
+}
+
+ACE_INLINE size_t
+ACE_Sample_History::sample_count (void) const
+{
+ return this->sample_count_;
+}
+
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Sched_Params.cpp b/dep/acelite/ace/Sched_Params.cpp
index 5002f52a797..8aee95bfc58 100644
--- a/dep/acelite/ace/Sched_Params.cpp
+++ b/dep/acelite/ace/Sched_Params.cpp
@@ -3,7 +3,7 @@
/**
* @file Sched_Params.cpp
*
- * $Id: Sched_Params.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+ * $Id: Sched_Params.cpp 95761 2012-05-15 18:23:04Z johnnyw $
*
* @author David Levine
*/
@@ -84,9 +84,7 @@ ACE_Sched_Params::priority_min (const Policy policy,
}
}
#elif defined(ACE_HAS_PTHREADS) && \
- (!defined(ACE_LACKS_SETSCHED) || defined (ACE_TANDEM_T1248_PTHREADS) || \
- defined (ACE_HAS_PTHREAD_SCHEDPARAM))
-
+ (!defined(ACE_LACKS_SETSCHED))
switch (scope)
{
case ACE_SCOPE_THREAD:
@@ -192,7 +190,7 @@ ACE_Sched_Params::priority_max (const Policy policy,
}
}
#elif defined(ACE_HAS_PTHREADS) && \
- (!defined(ACE_LACKS_SETSCHED) || defined (ACE_TANDEM_T1248_PTHREADS) || \
+ (!defined(ACE_LACKS_SETSCHED) || \
defined (ACE_HAS_PTHREAD_SCHEDPARAM))
switch (scope)
@@ -274,7 +272,7 @@ ACE_Sched_Params::next_priority (const Policy policy,
return priority; // unknown priority: should never get here
}
#elif defined(ACE_HAS_THREADS) && \
- (!defined(ACE_LACKS_SETSCHED) || defined (ACE_TANDEM_T1248_PTHREADS) || \
+ (!defined(ACE_LACKS_SETSCHED) || \
defined (ACE_HAS_PTHREAD_SCHEDPARAM))
// including STHREADS, and PTHREADS
int const max = priority_max (policy, scope);
@@ -318,7 +316,7 @@ ACE_Sched_Params::previous_priority (const Policy policy,
return priority; // unknown priority: should never get here
}
#elif defined(ACE_HAS_THREADS) && \
- (!defined(ACE_LACKS_SETSCHED) || defined (ACE_TANDEM_T1248_PTHREADS) || \
+ (!defined(ACE_LACKS_SETSCHED) || \
defined (ACE_HAS_PTHREAD_SCHEDPARAM))
// including STHREADS and PTHREADS
int const min = priority_min (policy, scope);
diff --git a/dep/acelite/ace/Select_Reactor_Base.cpp b/dep/acelite/ace/Select_Reactor_Base.cpp
index 2165d6e16c2..d160c5c122e 100644
--- a/dep/acelite/ace/Select_Reactor_Base.cpp
+++ b/dep/acelite/ace/Select_Reactor_Base.cpp
@@ -1,4 +1,4 @@
-// $Id: Select_Reactor_Base.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Select_Reactor_Base.cpp 95574 2012-02-29 07:26:08Z johnnyw $
#include "ace/Select_Reactor_Base.h"
#include "ace/Reactor.h"
@@ -530,7 +530,8 @@ ACE_Select_Reactor_Handler_Repository::dump (void) const
ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_Handler_Repository_Iterator)
ACE_Select_Reactor_Notify::ACE_Select_Reactor_Notify (void)
- : max_notify_iterations_ (-1)
+ : select_reactor_ (0)
+ , max_notify_iterations_ (-1)
{
}
@@ -599,8 +600,7 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r,
if (disable_notify_pipe == 0)
{
- this->select_reactor_ =
- dynamic_cast<ACE_Select_Reactor_Impl *> (r);
+ this->select_reactor_ = dynamic_cast<ACE_Select_Reactor_Impl *> (r);
if (select_reactor_ == 0)
{
diff --git a/dep/acelite/ace/Select_Reactor_Base.h b/dep/acelite/ace/Select_Reactor_Base.h
index 7902791624b..851fea0d662 100644
--- a/dep/acelite/ace/Select_Reactor_Base.h
+++ b/dep/acelite/ace/Select_Reactor_Base.h
@@ -4,7 +4,7 @@
/**
* @file Select_Reactor_Base.h
*
- * $Id: Select_Reactor_Base.h 87252 2009-10-28 20:03:48Z cleeland $
+ * $Id: Select_Reactor_Base.h 93792 2011-04-07 11:48:50Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -92,7 +92,6 @@ public:
class ACE_Event_Tuple
{
public:
-
/// Default constructor.
ACE_Event_Tuple (void);
@@ -106,7 +105,6 @@ public:
bool operator!= (const ACE_Event_Tuple &rhs) const;
public:
-
/// Handle.
ACE_HANDLE handle_;
diff --git a/dep/acelite/ace/Select_Reactor_T.cpp b/dep/acelite/ace/Select_Reactor_T.cpp
index b70b2d427c3..fde3ea3fcd1 100644
--- a/dep/acelite/ace/Select_Reactor_T.cpp
+++ b/dep/acelite/ace/Select_Reactor_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Select_Reactor_T.cpp 92201 2010-10-11 19:07:59Z johnnyw $
+// $Id: Select_Reactor_T.cpp 95533 2012-02-14 22:59:17Z wotte $
#ifndef ACE_SELECT_REACTOR_T_CPP
#define ACE_SELECT_REACTOR_T_CPP
@@ -461,7 +461,14 @@ template <class ACE_SELECT_REACTOR_TOKEN> int
ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::timer_queue
(ACE_Timer_Queue *tq)
{
- delete this->timer_queue_;
+ if (this->delete_timer_queue_)
+ {
+ delete this->timer_queue_;
+ }
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ }
this->timer_queue_ = tq;
this->delete_timer_queue_ = false;
return 0;
@@ -495,6 +502,9 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T
// determine the size at run-time by checking the process file
// descriptor limit on platforms that support this feature.
+ // reset the errno so that subsequent checks are valid
+ errno = 0;
+
// There is no need to deallocate resources from previous open()
// call since the open() method deallocates any resources prior
// to exiting if an error was encountered.
@@ -573,6 +583,11 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::close (void)
this->timer_queue_ = 0;
this->delete_timer_queue_ = false;
}
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ this->timer_queue_ = 0;
+ }
if (this->notify_handler_ != 0)
this->notify_handler_->close ();
@@ -764,14 +779,14 @@ template <class ACE_SELECT_REACTOR_TOKEN> int
ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_error (void)
{
ACE_TRACE ("ACE_Select_Reactor_T::handle_error");
-#if defined (linux) && defined (ERESTARTNOHAND)
+#if defined (ACE_LINUX) && defined (ERESTARTNOHAND)
int const error = errno; // Avoid multiple TSS accesses.
if (error == EINTR || error == ERESTARTNOHAND)
return this->restart_;
#else
if (errno == EINTR)
return this->restart_;
-#endif /* linux && ERESTARTNOHAND */
+#endif /* ACE_LINUX && ERESTARTNOHAND */
#if defined (__MVS__) || defined (ACE_WIN32) || defined (ACE_VXWORKS)
// On MVS Open Edition and Win32, there can be a number of failure
// codes on a bad socket, so check_handles on anything other than
@@ -1402,15 +1417,25 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events
ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1);
- if (ACE_OS::thr_equal (ACE_Thread::self (),
- this->owner_) == 0 || this->deactivated_)
- return -1;
+ if (ACE_OS::thr_equal (ACE_Thread::self (), this->owner_) == 0)
+ {
+ errno = EACCES;
+ return -1;
+ }
+ if (this->deactivated_)
+ {
+ errno = ESHUTDOWN;
+ return -1;
+ }
// Update the countdown to reflect time waiting for the mutex.
countdown.update ();
#else
if (this->deactivated_)
- return -1;
+ {
+ errno = ESHUTDOWN;
+ return -1;
+ }
#endif /* ACE_MT_SAFE */
return this->handle_events_i (max_wait_time);
diff --git a/dep/acelite/ace/Select_Reactor_T.h b/dep/acelite/ace/Select_Reactor_T.h
index 9e7411ef985..a9737c1e872 100644
--- a/dep/acelite/ace/Select_Reactor_T.h
+++ b/dep/acelite/ace/Select_Reactor_T.h
@@ -4,7 +4,7 @@
/**
* @file Select_Reactor_T.h
*
- * $Id: Select_Reactor_T.h 86495 2009-08-13 19:35:25Z johnnyw $
+ * $Id: Select_Reactor_T.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -60,7 +60,7 @@ public:
/// If @a disable_notify_pipe is non-0 then the reactor will
/// not create a notification pipe, which will save two I/O handles
- /// but will elide the <notify()> feature. If @a mask_signals is
+ /// but will elide the notify() feature. If @a mask_signals is
/// true the reactor is "signal-safe" when dispatching handlers to
/// signal events, whereas if @a mask_signals is false the reactor will
/// be more efficient, but not signal-safe (which may be perfectly
@@ -106,7 +106,7 @@ public:
* timer queue, respectively. If @arg disable_notify_pipe is non-0 the
* notification pipe is not created, thereby saving two I/O handles.
*
- * @note On Unix platforms, the maximum_number_of_handles parameter
+ * @note On Unix platforms, the @a maximum_number_of_handles parameter
* should be as large as the maximum number of file
* descriptors allowed for a given process. This is necessary
* since a file descriptor is used to directly index the array
@@ -148,6 +148,7 @@ public:
*/
virtual int work_pending (const ACE_Time_Value &max_wait_time = ACE_Time_Value::zero);
+ //@{
/**
* This event loop driver that blocks for @a max_wait_time before
* returning. It will return earlier if timer events, I/O events,
@@ -165,12 +166,14 @@ public:
* that were dispatched, 0 if the @a max_wait_time elapsed without
* dispatching any handlers, or -1 if something goes wrong.
*
- * Current <alertable_handle_events> is identical to
- * <handle_events>.
+ * Current alertable_handle_events() is identical to
+ * handle_events().
*/
virtual int handle_events (ACE_Time_Value *max_wait_time = 0);
virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0);
+ //@}
+ //@{
/**
* This method is just like the one above, except the
* @a max_wait_time value is a reference and can therefore never be
@@ -181,6 +184,7 @@ public:
*/
virtual int handle_events (ACE_Time_Value &max_wait_time);
virtual int alertable_handle_events (ACE_Time_Value &max_wait_time);
+ //@}
// = Event handling control.
@@ -599,7 +603,7 @@ protected:
virtual int any_ready (ACE_Select_Reactor_Handle_Set &handle_set);
/// Implement the <any_ready> method, assuming that the Sig_Guard is
- /// beign held
+ /// being held
virtual int any_ready_i (ACE_Select_Reactor_Handle_Set &handle_set);
/// Take corrective action when errors occur.
diff --git a/dep/acelite/ace/Select_Reactor_T.inl b/dep/acelite/ace/Select_Reactor_T.inl
index 30c8cbc6b7d..54542427f79 100644
--- a/dep/acelite/ace/Select_Reactor_T.inl
+++ b/dep/acelite/ace/Select_Reactor_T.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Select_Reactor_T.inl 82723 2008-09-16 09:35:44Z johnnyw $
+// $Id: Select_Reactor_T.inl 96017 2012-08-08 22:18:09Z mitza $
#include "ace/Reactor.h"
#include "ace/Signal.h"
@@ -221,7 +221,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::deactivate (int do_stop)
ACE_MT (ACE_GUARD (ACE_SELECT_REACTOR_TOKEN,
ace_mon,
this->token_));
- this->deactivated_ = do_stop;
+ this->deactivated_ = static_cast<sig_atomic_t> (do_stop);
}
this->wakeup_all_threads ();
diff --git a/dep/acelite/ace/Service_Config.cpp b/dep/acelite/ace/Service_Config.cpp
index d63f46c1b86..9149e98e43d 100644
--- a/dep/acelite/ace/Service_Config.cpp
+++ b/dep/acelite/ace/Service_Config.cpp
@@ -1,4 +1,4 @@
-// $Id: Service_Config.cpp 91693 2010-09-09 12:57:54Z johnnyw $
+// $Id: Service_Config.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/Service_Config.h"
@@ -601,7 +601,8 @@ void
ACE_Service_Config::reconfig_occurred (int config_occurred)
{
ACE_TRACE ("ACE_Service_Config::reconfig_occurred");
- ACE_Service_Config::reconfig_occurred_ = config_occurred;
+ ACE_Service_Config::reconfig_occurred_ =
+ static_cast<sig_atomic_t> (config_occurred);
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Service_Config.h b/dep/acelite/ace/Service_Config.h
index 5269d8f367e..56be51fde10 100644
--- a/dep/acelite/ace/Service_Config.h
+++ b/dep/acelite/ace/Service_Config.h
@@ -4,7 +4,7 @@
/**
* @file Service_Config.h
*
- * $Id: Service_Config.h 89501 2010-03-17 08:59:56Z vzykov $
+ * $Id: Service_Config.h 94385 2011-08-10 12:19:36Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -159,8 +159,8 @@ template<>
class ACE_Export ACE_Threading_Helper<ACE_Thread_Mutex>
{
public:
- ACE_Threading_Helper ();
- ~ACE_Threading_Helper ();
+ ACE_Threading_Helper (void);
+ ~ACE_Threading_Helper (void);
void set (void*);
void* get (void);
@@ -178,8 +178,8 @@ template<>
class ACE_Export ACE_Threading_Helper<ACE_Null_Mutex>
{
public:
- ACE_Threading_Helper ();
- ~ACE_Threading_Helper ();
+ ACE_Threading_Helper (void);
+ ~ACE_Threading_Helper (void);
void set (void*);
void* get (void);
diff --git a/dep/acelite/ace/Service_Gestalt.cpp b/dep/acelite/ace/Service_Gestalt.cpp
index 29e2804b4b6..f177260ca4b 100644
--- a/dep/acelite/ace/Service_Gestalt.cpp
+++ b/dep/acelite/ace/Service_Gestalt.cpp
@@ -1,4 +1,4 @@
-// $Id: Service_Gestalt.cpp 92357 2010-10-25 14:11:44Z mesnier_p $
+// $Id: Service_Gestalt.cpp 95610 2012-03-13 11:26:31Z johnnyw $
#include "ace/Svc_Conf.h"
#include "ace/Get_Opt.h"
diff --git a/dep/acelite/ace/Service_Object.cpp b/dep/acelite/ace/Service_Object.cpp
index 912fa39532c..4a9ace4029e 100644
--- a/dep/acelite/ace/Service_Object.cpp
+++ b/dep/acelite/ace/Service_Object.cpp
@@ -1,4 +1,4 @@
-// $Id: Service_Object.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Service_Object.cpp 93539 2011-03-13 09:40:44Z vzykov $
#include "ace/config-all.h"
@@ -36,9 +36,9 @@ ACE_Service_Type::dump (void) const
// the generated C++ code.
ACE_OS::fprintf(stderr,
"// [ST] dump, this=%p, name=%s, type=%p, so=%p, active=%d\n",
- this,
- this->name_,
- this->type_,
+ static_cast<void const *> (this),
+ ACE_TEXT_ALWAYS_CHAR (this->name_),
+ static_cast<void const *> (this->type_),
(this->type_ != 0) ? this->type_->object () : 0,
this->active_);
diff --git a/dep/acelite/ace/Service_Types.cpp b/dep/acelite/ace/Service_Types.cpp
index b3f7d098054..b743536b304 100644
--- a/dep/acelite/ace/Service_Types.cpp
+++ b/dep/acelite/ace/Service_Types.cpp
@@ -1,4 +1,4 @@
-// $Id: Service_Types.cpp 91813 2010-09-17 07:52:52Z johnnyw $
+// $Id: Service_Types.cpp 95676 2012-04-03 16:32:27Z schmidt $
#include "ace/Service_Types.h"
@@ -165,6 +165,7 @@ ACE_Module_Type::ACE_Module_Type (void *m,
u_int f,
int stype)
: ACE_Service_Type_Impl (m, m_name, f, 0, stype)
+ , link_ (0)
{
ACE_TRACE ("ACE_Module_Type::ACE_Module_Type");
}
@@ -181,12 +182,12 @@ ACE_Module_Type::init (int argc, ACE_TCHAR *argv[]) const
void *obj = this->object ();
MT_Module *mod = (MT_Module *) obj;
//
- // Change the Module's name to what's in the svc.conf file.
- // We must do this so the names match up so everything shuts
- // down properly during the call to ACE_Stream_Type::fini
- // which calls MT_Stream::remove([name]) for all the modules.
- // If the calls to remove fail, we end up with a double delete
- // during shutdown. Bugzilla #3847
+ // Change the Module's name to what's in the svc.conf file. We must
+ // do this so the names match up so everything shuts down properly
+ // during the call to ACE_Stream_Type::fini which calls
+ // MT_Stream::remove([name]) for all the modules. If the calls to
+ // remove fail, we end up with a double delete during
+ // shutdown. Bugzilla #3847
//
mod->name (this->name_);
MT_Task *reader = mod->reader ();
diff --git a/dep/acelite/ace/Signal.h b/dep/acelite/ace/Signal.h
index 736d62e5c08..5dc26ff7146 100644
--- a/dep/acelite/ace/Signal.h
+++ b/dep/acelite/ace/Signal.h
@@ -4,7 +4,7 @@
/**
* @file Signal.h
*
- * $Id: Signal.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Signal.h 94454 2011-09-08 17:36:56Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -45,7 +45,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Sig_Set
{
public:
- // = Initialization and termination methods.
/// Initialize <sigset_> with @a sigset. If @a sigset == 0 then fill
/// the set.
ACE_Sig_Set (sigset_t *sigset);
@@ -136,18 +135,6 @@ public:
const ACE_Sig_Set &sigmask,
int flags = 0);
-
- // @@ The next two methods have a parameter as "signalss". Please do
- // not change the argument name as "signals". This causes the
- // following problem as reported by
- // <James.Briggs@dsto.defence.gov.au>.
-
- // In the file Signal.h two of the functions have and argument name
- // of signals. signals is a Qt macro (to do with their meta object
- // stuff.
- // We could as well have it as "signal", but I am nost sure whether
- // that would cause a problem with something else - Bala <bala@cs>
-
/**
* Assigns the various fields of a @c sigaction struct and registers
* the @a handler to process all @a signalss via the @c sigaction
@@ -236,7 +223,7 @@ class ACE_Export ACE_Sig_Guard
public:
// = Initialization and termination methods.
/// This is kind of conditional Guard, needed when guard should be
- /// activated only when a spcific condition met. When condition ==
+ /// activated only when a specific condition met. When condition ==
/// true (default), Guard is activated
ACE_Sig_Guard (ACE_Sig_Set *mask = 0, bool condition = true);
diff --git a/dep/acelite/ace/Sock_Connect.cpp b/dep/acelite/ace/Sock_Connect.cpp
index ce2a17d2bf5..77c5e4af93f 100644
--- a/dep/acelite/ace/Sock_Connect.cpp
+++ b/dep/acelite/ace/Sock_Connect.cpp
@@ -1,4 +1,4 @@
-// $Id: Sock_Connect.cpp 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: Sock_Connect.cpp 95628 2012-03-21 22:10:02Z shuston $
#include "ace/Sock_Connect.h"
#include "ace/INET_Addr.h"
@@ -29,33 +29,16 @@
# endif /* _AIX */
#endif /* ACE_HAS_IPV6 */
-# if defined (ACE_HAS_GETIFADDRS)
-# if defined (ACE_VXWORKS)
-# include /**/ <net/ifaddrs.h>
-# else
-# include /**/ <ifaddrs.h>
-# endif /*ACE_VXWORKS */
-# endif /* ACE_HAS_GETIFADDRS */
-
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x600)
-#include /**/ <inetLib.h>
-#include /**/ <netinet/in_var.h>
-#if defined (ACE_HAS_IPV6)
-#include /**/ <ifLib.h>
-extern "C" {
- extern struct in_ifaddr* in_ifaddr;
- extern LIST_HEAD(in_ifaddrhashhead, in_ifaddr) *in_ifaddrhashtbl;
-}
-#endif /* ACE_HAS_IPV6 */
-#include "ace/OS_NS_stdio.h"
-#endif /* ACE_VXWORKS < 0x600 */
+#if defined (ACE_HAS_GETIFADDRS)
+# include "ace/os_include/os_ifaddrs.h"
+#endif /* ACE_HAS_GETIFADDRS */
-#if defined (ACE_VXWORKS) && ((ACE_VXWORKS >= 0x630) && (ACE_VXWORKS <= 0x670)) && defined (__RTP__) && defined (ACE_HAS_IPV6)
+#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670) && defined (__RTP__) && defined (ACE_HAS_IPV6)
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
const struct in6_addr in6addr_nodelocal_allnodes = IN6ADDR_NODELOCAL_ALLNODES_INIT;
const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_INIT;
const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
-#endif /* ACE_VXWORKS >= 0x630 && <= 0x670 && __RTP__ && ACE_HAS_IPV6 */
+#endif /* ACE_VXWORKS <= 0x670 && __RTP__ && ACE_HAS_IPV6 */
#if defined (ACE_HAS_WINCE)
#include /**/ <iphlpapi.h>
@@ -146,17 +129,6 @@ namespace
# define SA_FAMILY sa_family
#endif /* ACE_HAS_IPV6 */
-// This is a hack to work around a problem with Visual Age C++ 5 and 6 on AIX.
-// Without this, the compiler auto-instantiates the ACE_Auto_Array_Ptr for
-// ifreq (contained in this module) but only adds the #include for <net/if.h>
-// and not the one for <sys/socket.h> which is also needed. Although we
-// don't need the template defined here, it makes the compiler pull in
-// <sys/socket.h> and the build runs clean.
-#if defined (AIX) && defined (__IBMCPP__) && (__IBMCPP__ >= 500) && (__IBMCPP__ < 700)
-static ACE_Auto_Array_Ptr<sockaddr> force_compiler_to_include_socket_h;
-#endif /* AIX && __IBMCPP__ >= 500 */
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Bind socket to an unused port.
@@ -805,8 +777,14 @@ get_ip_interfaces_getifaddrs (size_t &count,
p_if != 0;
p_if = p_if->ifa_next)
{
- if (p_if->ifa_addr &&
- p_if->ifa_addr->sa_family == AF_INET)
+ if (p_if->ifa_addr == 0)
+ continue;
+
+ // Check to see if it's up.
+ if ((p_if->ifa_flags & IFF_UP) != IFF_UP)
+ continue;
+
+ if (p_if->ifa_addr->sa_family == AF_INET)
{
struct sockaddr_in *addr =
reinterpret_cast<sockaddr_in *> (p_if->ifa_addr);
@@ -822,8 +800,7 @@ get_ip_interfaces_getifaddrs (size_t &count,
}
}
# if defined (ACE_HAS_IPV6)
- else if (p_if->ifa_addr &&
- p_if->ifa_addr->sa_family == AF_INET6)
+ else if (p_if->ifa_addr->sa_family == AF_INET6)
{
struct sockaddr_in6 *addr =
reinterpret_cast<sockaddr_in6 *> (p_if->ifa_addr);
@@ -1094,64 +1071,7 @@ get_ip_interfaces_aix (size_t &count,
return 0;
}
-#elif defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x600) && !defined (ACE_HAS_VXWORKS551_MEDUSA)
-int
-get_ip_interfaces_vxworks_lt600 (size_t &count,
- ACE_INET_Addr *&addrs)
-{
- count = 0;
- // Loop through each address structure
-
-# if defined (ACE_HAS_IPV6) && defined (TAILQ_ENTRY)
-# define ia_next ia_link.tqe_next
-# endif /* TAILQ_ENTRY */
-
- for (struct in_ifaddr* ia = in_ifaddr; ia != 0; ia = ia->ia_next)
- {
- ++count;
- }
-
- // Now create and initialize output array.
- ACE_NEW_RETURN (addrs,
- ACE_INET_Addr[count],
- -1); // caller must free
- count = 0;
- for (struct in_ifaddr* ia = in_ifaddr; ia != 0; ia = ia->ia_next)
- {
- struct ifnet* ifp = ia->ia_ifa.ifa_ifp;
- if (ifp != 0)
- {
- // Get the current interface name
- char interface[64];
- ACE_OS::sprintf(interface, "%s%d", ifp->if_name, ifp->if_unit);
-
- // Get the address for the current interface
- char address [INET_ADDR_LEN];
- STATUS status = ifAddrGet(interface, address);
-
- if (status == OK)
- {
- // Concatenate a ':' at the end. This is because in
- // ACE_INET_Addr::string_to_addr, the ip_address is
- // obtained using ':' as the delimiter. Since, using
- // ifAddrGet(), we just get the IP address, I am adding
- // a ":" to get with the general case.
- ACE_OS::strcat (address, ":");
- addrs[count].set (address);
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("ACE::get_ip_interface failed\n")
- ACE_TEXT ("Couldnt get the IP Address\n")),
- -1);
- }
- ++count;
- }
- }
- return 0;
-}
-#endif // ACE_WIN32 || ACE_HAS_GETIFADDRS || __hpux || _AIX || ACE_VXWORKS < 0x600
+#endif // ACE_WIN32 || ACE_HAS_GETIFADDRS || __hpux || _AIX
// return an array of all configured IP interfaces on this host, count
@@ -1174,8 +1094,6 @@ ACE::get_ip_interfaces (size_t &count, ACE_INET_Addr *&addrs)
return get_ip_interfaces_hpux (count, addrs);
#elif defined (_AIX)
return get_ip_interfaces_aix (count, addrs);
-#elif defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x600) && !defined (ACE_HAS_VXWORKS551_MEDUSA)
- return get_ip_interfaces_vxworks_lt600 (count, addrs);
#elif (defined (__unix) || defined (__unix__) || defined (ACE_OPENVMS) || (defined (ACE_VXWORKS) && !defined (ACE_HAS_GETIFADDRS)) || defined (ACE_HAS_RTEMS)) && !defined (ACE_LACKS_NETWORKING)
// COMMON (SVR4 and BSD) UNIX CODE
diff --git a/dep/acelite/ace/Stack_Trace.cpp b/dep/acelite/ace/Stack_Trace.cpp
index 6c04e192886..353be81067b 100644
--- a/dep/acelite/ace/Stack_Trace.cpp
+++ b/dep/acelite/ace/Stack_Trace.cpp
@@ -2,7 +2,7 @@
/**
* @file Stack_Trace.cpp
*
- * $Id: Stack_Trace.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+ * $Id: Stack_Trace.cpp 96017 2012-08-08 22:18:09Z mitza $
*
* @brief Encapsulate string representation of stack trace.
*
@@ -197,7 +197,7 @@ ACE_Stack_Trace::generate_trace (ssize_t starting_frame_offset,
// See memEdrLib.c in VxWorks RTP sources for an example of stack tracing.
-static STATUS ace_vx_rtp_pc_validate (INSTR *pc, TRC_OS_CTX *pOsCtx)
+static STATUS ace_vx_rtp_pc_validate (INSTR *pc, TRC_OS_CTX *)
{
return ALIGNED (pc, sizeof (INSTR)) ? OK : ERROR;
}
@@ -222,7 +222,12 @@ ACE_Stack_Trace::generate_trace (ssize_t starting_frame_offset,
TRC_OS_CTX osCtx;
osCtx.stackBase = desc.td_pStackBase;
osCtx.stackEnd = desc.td_pStackEnd;
+#if (ACE_VXWORKS < 0x690)
osCtx.pcValidateRtn = reinterpret_cast<FUNCPTR> (ace_vx_rtp_pc_validate);
+#else
+ // reinterpret_cast causes an error
+ osCtx.pcValidateRtn = ace_vx_rtp_pc_validate;
+#endif
char *fp = _WRS_FRAMEP_FROM_JMP_BUF (regs);
INSTR *pc = _WRS_RET_PC_FROM_JMP_BUF (regs);
@@ -250,8 +255,19 @@ ACE_Stack_Trace::generate_trace (ssize_t starting_frame_offset,
const char *fnName = "(no symbols)";
static const int N_ARGS = 12;
- int buf[N_ARGS];
- int *pArgs = 0;
+#if (ACE_VXWORKS < 0x690)
+# define ACE_VX_USR_ARG_T int
+# define ACE_VX_ARG_FORMAT "%x"
+#else
+# define ACE_VX_USR_ARG_T _Vx_usr_arg_t
+# ifdef _WRS_CONFIG_LP64
+# define ACE_VX_ARG_FORMAT "%lx"
+# else
+# define ACE_VX_ARG_FORMAT "%x"
+# endif
+#endif
+ ACE_VX_USR_ARG_T buf[N_ARGS];
+ ACE_VX_USR_ARG_T *pArgs = 0;
int numArgs =
trcLibFuncs.lvlArgsGet (prevPc, prevFn, prevFp,
buf, N_ARGS, &pArgs);
@@ -262,7 +278,7 @@ ACE_Stack_Trace::generate_trace (ssize_t starting_frame_offset,
size_t len = ACE_OS::strlen (this->buf_);
size_t space = SYMBUFSIZ - len - 1;
char *cursor = this->buf_ + len;
- size_t written = ACE_OS::snprintf (cursor, space, "%x %s",
+ size_t written = ACE_OS::snprintf (cursor, space, "%p %s",
prevFn, fnName);
cursor += written;
space -= written;
@@ -272,7 +288,9 @@ ACE_Stack_Trace::generate_trace (ssize_t starting_frame_offset,
{
if (arg == 0) *cursor++ = '(', --space;
written = ACE_OS::snprintf (cursor, space,
- (arg < numArgs - 1) ? "%x, " : "%x",
+ (arg < numArgs - 1) ?
+ ACE_VX_ARG_FORMAT ", " :
+ ACE_VX_ARG_FORMAT,
pArgs[arg]);
cursor += written;
space -= written;
diff --git a/dep/acelite/ace/Stats.cpp b/dep/acelite/ace/Stats.cpp
index 856d0e04db5..04bba5e86b1 100644
--- a/dep/acelite/ace/Stats.cpp
+++ b/dep/acelite/ace/Stats.cpp
@@ -1,4 +1,4 @@
-// $Id: Stats.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Stats.cpp 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/Stats.h"
@@ -68,15 +68,8 @@ ACE_Stats::mean (ACE_Stats_Value &m,
{
if (number_of_samples_ > 0)
{
-#if defined ACE_LACKS_LONGLONG_T
- // If ACE_LACKS_LONGLONG_T, then ACE_UINT64 is a user-defined class.
- // To prevent having to construct a static of that class, declare it
- // on the stack, and construct it, in each function that needs it.
- const ACE_U_LongLong ACE_STATS_INTERNAL_OFFSET (0, 8);
-#else /* ! ACE_LACKS_LONGLONG_T */
const ACE_UINT64 ACE_STATS_INTERNAL_OFFSET =
ACE_UINT64_LITERAL (0x100000000);
-#endif /* ! ACE_LACKS_LONGLONG_T */
ACE_UINT64 sum = ACE_STATS_INTERNAL_OFFSET;
ACE_Unbounded_Queue_Iterator<ACE_INT32> i (samples_);
diff --git a/dep/acelite/ace/Strategies.h b/dep/acelite/ace/Strategies.h
deleted file mode 100644
index 484ffa9a510..00000000000
--- a/dep/acelite/ace/Strategies.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file Strategies.h
- *
- * $Id: Strategies.h 80826 2008-03-04 14:51:23Z wotte $
- *
- * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
- */
-//=============================================================================
-
-#ifndef ACE_STRATEGIES_H
-#define ACE_STRATEGIES_H
-#include /**/ "ace/pre.h"
-
-#include /**/ "ace/config-all.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-/// Place holder for backward compatibility..
-#include "ace/Connection_Recycling_Strategy.h"
-#include "ace/Hashable.h"
-#include "ace/Notification_Strategy.h"
-#include "ace/Reactor_Notification_Strategy.h"
-#include "ace/Recyclable.h"
-#include "ace/Refcountable.h"
-
-
-#include /**/ "ace/post.h"
-#endif /*ACE_STRATEGIES_H*/
diff --git a/dep/acelite/ace/Strategies_T.cpp b/dep/acelite/ace/Strategies_T.cpp
index fbbc1a5bc93..28d786489ad 100644
--- a/dep/acelite/ace/Strategies_T.cpp
+++ b/dep/acelite/ace/Strategies_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Strategies_T.cpp 89510 2010-03-17 12:21:14Z vzykov $
+// $Id: Strategies_T.cpp 95630 2012-03-22 13:04:47Z johnnyw $
#ifndef ACE_STRATEGIES_T_CPP
#define ACE_STRATEGIES_T_CPP
@@ -1011,12 +1011,15 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::connect_s
return result;
}
- // For all successful cases: mark the <svc_handler> in the cache
- // as being <in_use>. Therefore recyclable is BUSY.
- entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY);
+ if (entry)
+ {
+ // For all successful cases: mark the <svc_handler> in the cache
+ // as being <in_use>. Therefore recyclable is BUSY.
+ entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY);
- // And increment the refcount
- entry->ext_id_.increment ();
+ // And increment the refcount
+ entry->ext_id_.increment ();
+ }
return 0;
}
diff --git a/dep/acelite/ace/Stream.cpp b/dep/acelite/ace/Stream.cpp
index 4d7a893a2fe..6f30f863661 100644
--- a/dep/acelite/ace/Stream.cpp
+++ b/dep/acelite/ace/Stream.cpp
@@ -1,5 +1,5 @@
// Stream.cpp
-// $Id: Stream.cpp 90072 2010-05-04 21:34:39Z cbeaulac $
+// $Id: Stream.cpp 96070 2012-08-17 09:07:16Z mcorino $
#ifndef ACE_STREAM_CPP
#define ACE_STREAM_CPP
@@ -25,14 +25,14 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Stream)
// Give some idea of what the heck is going on in a stream!
-template <ACE_SYNCH_DECL> void
-ACE_Stream<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("-------- module links --------\n")));
- for (ACE_Module<ACE_SYNCH_USE> *mp = this->stream_head_;
+ for (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mp = this->stream_head_;
;
mp = mp->next ())
{
@@ -43,7 +43,7 @@ ACE_Stream<ACE_SYNCH_USE>::dump (void) const
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("-------- writer links --------\n")));
- ACE_Task<ACE_SYNCH_USE> *tp;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *tp;
for (tp = this->stream_head_->writer ();
;
@@ -72,10 +72,10 @@ ACE_Stream<ACE_SYNCH_USE>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::push (ACE_Module<ACE_SYNCH_USE> *new_top)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::push (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *new_top)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::push");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::push");
if (this->push_module (new_top,
this->stream_head_->next (),
this->stream_head_) == -1)
@@ -84,27 +84,27 @@ ACE_Stream<ACE_SYNCH_USE>::push (ACE_Module<ACE_SYNCH_USE> *new_top)
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::put (ACE_Message_Block *mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::put");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::put");
return this->stream_head_->writer ()->put (mb, tv);
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::get (ACE_Message_Block *&mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::get (ACE_Message_Block *&mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::get");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::get");
return this->stream_head_->reader ()->getq (mb, tv);
}
// Return the "top" ACE_Module in a ACE_Stream, skipping over the
// stream_head.
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::top (ACE_Module<ACE_SYNCH_USE> *&m)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::top (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *&m)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::top");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::top");
if (this->stream_head_->next () == this->stream_tail_)
return -1;
else
@@ -114,18 +114,18 @@ ACE_Stream<ACE_SYNCH_USE>::top (ACE_Module<ACE_SYNCH_USE> *&m)
}
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::insert (const ACE_TCHAR *prev_name,
- ACE_Module<ACE_SYNCH_USE> *mod)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::insert (const ACE_TCHAR *prev_name,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::insert");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::insert");
- for (ACE_Module<ACE_SYNCH_USE> *prev_mod = this->stream_head_;
+ for (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *prev_mod = this->stream_head_;
prev_mod != 0;
prev_mod = prev_mod->next ())
if (ACE_OS::strcmp (prev_mod->name (), prev_name) == 0)
{
- ACE_Module<ACE_SYNCH_USE> *next_mod = prev_mod->next ();
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *next_mod = prev_mod->next ();
// We can't insert a module below <stream_tail_>.
if (next_mod == 0)
@@ -146,20 +146,20 @@ ACE_Stream<ACE_SYNCH_USE>::insert (const ACE_TCHAR *prev_name,
return -1;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::replace (const ACE_TCHAR *replace_name,
- ACE_Module<ACE_SYNCH_USE> *mod,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::replace (const ACE_TCHAR *replace_name,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod,
int flags)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::replace");
- ACE_Module<ACE_SYNCH_USE> *prev_mod = 0;
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::replace");
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *prev_mod = 0;
- for (ACE_Module<ACE_SYNCH_USE> *rep_mod = this->stream_head_;
+ for (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *rep_mod = this->stream_head_;
rep_mod != 0;
rep_mod = rep_mod->next ())
if (ACE_OS::strcmp (rep_mod->name (), replace_name) == 0)
{
- ACE_Module<ACE_SYNCH_USE> *next_mod = rep_mod->next ();
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *next_mod = rep_mod->next ();
if (next_mod)
mod->link (next_mod);
@@ -184,7 +184,7 @@ ACE_Stream<ACE_SYNCH_USE>::replace (const ACE_TCHAR *replace_name,
if (mod->writer ()->open (mod->arg ()) == -1)
return -1;
- if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE)
+ if (flags != ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::M_DELETE_NONE)
{
rep_mod->close (flags);
delete rep_mod;
@@ -201,17 +201,17 @@ ACE_Stream<ACE_SYNCH_USE>::replace (const ACE_TCHAR *replace_name,
// Remove the "top" ACE_Module in a ACE_Stream, skipping over the
// stream_head.
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::pop (int flags)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::pop (int flags)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::pop");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::pop");
if (this->stream_head_->next () == this->stream_tail_)
return -1;
else
{
// Skip over the ACE_Stream head.
- ACE_Module<ACE_SYNCH_USE> *top_mod = this->stream_head_->next ();
- ACE_Module<ACE_SYNCH_USE> *new_top = top_mod->next ();
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *top_mod = this->stream_head_->next ();
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *new_top = top_mod->next ();
this->stream_head_->next (new_top);
@@ -220,7 +220,7 @@ ACE_Stream<ACE_SYNCH_USE>::pop (int flags)
top_mod->close (flags);
// Don't delete the Module unless the flags request this.
- if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE)
+ if (flags != ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::M_DELETE_NONE)
delete top_mod;
this->stream_head_->writer ()->next (new_top->writer ());
@@ -232,14 +232,14 @@ ACE_Stream<ACE_SYNCH_USE>::pop (int flags)
// Remove a named ACE_Module from an arbitrary place in the
// ACE_Stream.
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::remove (const ACE_TCHAR *name,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::remove (const ACE_TCHAR *name,
int flags)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::remove");
- ACE_Module<ACE_SYNCH_USE> *prev = 0;
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::remove");
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *prev = 0;
- for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_;
+ for (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod = this->stream_head_;
mod != 0;
mod = mod->next ())
{
@@ -247,7 +247,7 @@ ACE_Stream<ACE_SYNCH_USE>::remove (const ACE_TCHAR *name,
if (ACE::debug ())
{
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ACE_Stream::remove comparing existing module :%s: with :%s:\n"),
+ ACE_TEXT ("ACE_Stream::remove - comparing existing module :%s: with :%s:\n"),
mod->name (),
name));
}
@@ -260,11 +260,13 @@ ACE_Stream<ACE_SYNCH_USE>::remove (const ACE_TCHAR *name,
else
prev->link (mod->next ());
+ // Close down the module.
+ mod->close (flags);
+
// Don't delete the Module unless the flags request this.
- if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE)
+ if (flags != ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::M_DELETE_NONE)
{
- // Close down the module and release the memory.
- mod->close (flags);
+ // Release the memory.
delete mod;
}
@@ -278,11 +280,11 @@ ACE_Stream<ACE_SYNCH_USE>::remove (const ACE_TCHAR *name,
return -1;
}
-template <ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE> *
-ACE_Stream<ACE_SYNCH_USE>::find (const ACE_TCHAR *name)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::find (const ACE_TCHAR *name)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::find");
- for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_;
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::find");
+ for (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod = this->stream_head_;
mod != 0;
mod = mod->next ())
if (ACE_OS::strcmp (mod->name (), name) == 0)
@@ -293,16 +295,16 @@ ACE_Stream<ACE_SYNCH_USE>::find (const ACE_TCHAR *name)
// Actually push a module onto the stack...
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top,
- ACE_Module<ACE_SYNCH_USE> *current_top,
- ACE_Module<ACE_SYNCH_USE> *head)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::push_module (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *new_top,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *current_top,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *head)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::push_module");
- ACE_Task<ACE_SYNCH_USE> *nt_reader = new_top->reader ();
- ACE_Task<ACE_SYNCH_USE> *nt_writer = new_top->writer ();
- ACE_Task<ACE_SYNCH_USE> *ct_reader = 0;
- ACE_Task<ACE_SYNCH_USE> *ct_writer = 0;
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::push_module");
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *nt_reader = new_top->reader ();
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *nt_writer = new_top->writer ();
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *ct_reader = 0;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *ct_writer = 0;
if (current_top)
{
@@ -331,47 +333,45 @@ ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top,
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::open (void *a,
- ACE_Module<ACE_SYNCH_USE> *head,
- ACE_Module<ACE_SYNCH_USE> *tail)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::open (void *a,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *head,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *tail)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::open");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
- ACE_Task<ACE_SYNCH_USE> *h1 = 0, *h2 = 0;
- ACE_Task<ACE_SYNCH_USE> *t1 = 0, *t2 = 0;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *h1 = 0, *h2 = 0;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *t1 = 0, *t2 = 0;
if (head == 0)
{
- ACE_NEW_RETURN (h1,
- ACE_Stream_Head<ACE_SYNCH_USE>,
- -1);
- ACE_NEW_RETURN (h2,
- ACE_Stream_Head<ACE_SYNCH_USE>,
- -1);
- ACE_NEW_RETURN (head,
- ACE_Module<ACE_SYNCH_USE> (ACE_TEXT ("ACE_Stream_Head"),
- h1, h2,
- a,
- M_DELETE),
- -1);
+ typedef ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY> STREAM_HEAD_TYPE;
+ ACE_NEW_NORETURN (h1,
+ STREAM_HEAD_TYPE);
+ ACE_NEW_NORETURN (h2,
+ STREAM_HEAD_TYPE);
+ typedef ACE_Module<ACE_SYNCH_USE, TIME_POLICY> MODULE_TYPE;
+ ACE_NEW_NORETURN (head,
+ MODULE_TYPE (ACE_TEXT ("ACE_Stream_Head"),
+ h1, h2,
+ a,
+ M_DELETE));
}
if (tail == 0)
{
- ACE_NEW_RETURN (t1,
- ACE_Stream_Tail<ACE_SYNCH_USE>,
- -1);
- ACE_NEW_RETURN (t2,
- ACE_Stream_Tail<ACE_SYNCH_USE>,
- -1);
- ACE_NEW_RETURN (tail,
- ACE_Module<ACE_SYNCH_USE> (ACE_TEXT ("ACE_Stream_Tail"),
- t1, t2,
- a,
- M_DELETE),
- -1);
+ typedef ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY> STREAM_TAIL_TYPE;
+ ACE_NEW_NORETURN (t1,
+ STREAM_TAIL_TYPE);
+ ACE_NEW_NORETURN (t2,
+ STREAM_TAIL_TYPE);
+ typedef ACE_Module<ACE_SYNCH_USE, TIME_POLICY> MODULE_TYPE;
+ ACE_NEW_NORETURN (tail,
+ MODULE_TYPE (ACE_TEXT ("ACE_Stream_Tail"),
+ t1, t2,
+ a,
+ M_DELETE));
}
// Make sure *all* the allocation succeeded!
@@ -401,10 +401,10 @@ ACE_Stream<ACE_SYNCH_USE>::open (void *a,
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::close (int flags)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::close (int flags)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::close");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
if (this->stream_head_ != 0
@@ -441,14 +441,14 @@ ACE_Stream<ACE_SYNCH_USE>::close (int flags)
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
void *a)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::control");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::control");
ACE_IO_Cntl_Msg ioc (cmd);
- ACE_Message_Block *db;
+ ACE_Message_Block *db = 0;
// Try to create a data block that contains the user-supplied data.
ACE_NEW_RETURN (db,
@@ -462,12 +462,11 @@ ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
// field.
ACE_Message_Block *cb = 0;
- ACE_NEW_RETURN (cb,
- ACE_Message_Block (sizeof ioc,
- ACE_Message_Block::MB_IOCTL,
- db,
- (char *) &ioc),
- -1);
+ ACE_NEW_NORETURN (cb,
+ ACE_Message_Block (sizeof ioc,
+ ACE_Message_Block::MB_IOCTL,
+ db,
+ (char *) &ioc));
// @@ Michael: The old semantic assumed that cb returns == 0
// if no memory was available. We will now return immediately
// without release (errno is set to ENOMEM by the macro).
@@ -501,15 +500,15 @@ ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
// on the fact that the Stream head and Stream tail are non-NULL...
// This must be called with locks held.
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::link_i (ACE_Stream<ACE_SYNCH_USE> &us)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::link_i (ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> &us)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::link_i");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::link_i");
this->linked_us_ = &us;
// Make sure the other side is also linked to us!
us.linked_us_ = this;
- ACE_Module<ACE_SYNCH_USE> *my_tail = this->stream_head_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *my_tail = this->stream_head_;
if (my_tail == 0)
return -1;
@@ -518,7 +517,7 @@ ACE_Stream<ACE_SYNCH_USE>::link_i (ACE_Stream<ACE_SYNCH_USE> &us)
while (my_tail->next () != this->stream_tail_)
my_tail = my_tail->next ();
- ACE_Module<ACE_SYNCH_USE> *other_tail = us.stream_head_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *other_tail = us.stream_head_;
if (other_tail == 0)
return -1;
@@ -533,10 +532,10 @@ ACE_Stream<ACE_SYNCH_USE>::link_i (ACE_Stream<ACE_SYNCH_USE> &us)
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::link (ACE_Stream<ACE_SYNCH_USE> &us)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::link (ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> &us)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::link");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::link");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
@@ -545,16 +544,16 @@ ACE_Stream<ACE_SYNCH_USE>::link (ACE_Stream<ACE_SYNCH_USE> &us)
// Must be called with locks held...
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::unlink_i (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::unlink_i (void)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::unlink_i");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::unlink_i");
// Only try to unlink if we are in fact still linked!
if (this->linked_us_ != 0)
{
- ACE_Module<ACE_SYNCH_USE> *my_tail = this->stream_head_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *my_tail = this->stream_head_;
// Only relink if we still exist!
if (my_tail)
@@ -567,7 +566,7 @@ ACE_Stream<ACE_SYNCH_USE>::unlink_i (void)
my_tail->writer ()->next (this->stream_tail_->writer ());
}
- ACE_Module<ACE_SYNCH_USE> *other_tail =
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *other_tail =
this->linked_us_->stream_head_;
// Only fiddle with the other side if it in fact still remains.
@@ -590,42 +589,48 @@ ACE_Stream<ACE_SYNCH_USE>::unlink_i (void)
return -1;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream<ACE_SYNCH_USE>::unlink (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::unlink (void)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::unlink");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::unlink");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1);
return this->unlink_i ();
}
-template <ACE_SYNCH_DECL>
-ACE_Stream<ACE_SYNCH_USE>::ACE_Stream (void * a,
- ACE_Module<ACE_SYNCH_USE> *head,
- ACE_Module<ACE_SYNCH_USE> *tail)
- : linked_us_ (0),
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream (void * a,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *head,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *tail)
+ : stream_head_ (0),
+ stream_tail_ (0),
+ linked_us_ (0),
+#if defined (ACE_HAS_THREADS)
+ final_close_ (lock_, cond_attr_)
+#else
final_close_ (lock_)
+#endif
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::ACE_Stream");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream");
if (this->open (a, head, tail) == -1)
ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("ACE_Stream<ACE_SYNCH_USE>::open (%s, %s)\n"),
+ ACE_TEXT ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::open (%s, %s)\n"),
head->name (), tail->name ()));
}
-template <ACE_SYNCH_DECL>
-ACE_Stream<ACE_SYNCH_USE>::~ACE_Stream (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Stream (void)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::~ACE_Stream");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Stream");
if (this->stream_head_ != 0)
this->close ();
}
-template <ACE_SYNCH_DECL>
-ACE_Stream_Iterator<ACE_SYNCH_USE>::ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE> &sr)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> &sr)
: next_ (sr.stream_head_)
{
- ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::ACE_Stream_Iterator");
+ ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream_Iterator");
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Stream.h b/dep/acelite/ace/Stream.h
index 9172485c132..a9dc401f046 100644
--- a/dep/acelite/ace/Stream.h
+++ b/dep/acelite/ace/Stream.h
@@ -4,7 +4,7 @@
/**
* @file Stream.h
*
- * $Id: Stream.h 91058 2010-07-12 08:20:09Z johnnyw $
+ * $Id: Stream.h 96070 2012-08-17 09:07:16Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@uci.edu>
*/
@@ -24,11 +24,14 @@
#include "ace/IO_Cntl_Msg.h"
#include "ace/Message_Block.h"
#include "ace/Module.h"
+#if defined (ACE_HAS_THREADS)
+# include "ace/Condition_Attributes.h"
+#endif
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decls.
-template<ACE_SYNCH_DECL> class ACE_Stream_Iterator;
+template<ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Stream_Iterator;
class ACE_Time_Value;
/**
@@ -45,11 +48,11 @@ class ACE_Time_Value;
* won't be overridden properly unless you call it in a subclass
* destructor.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Stream
{
public:
- friend class ACE_Stream_Iterator<ACE_SYNCH_USE>;
+ friend class ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>;
enum
{
@@ -66,8 +69,8 @@ public:
* @a arg is the value past in to the <open> methods of the tasks.
*/
ACE_Stream (void *arg = 0,
- ACE_Module<ACE_SYNCH_USE> *head = 0,
- ACE_Module<ACE_SYNCH_USE> *tail = 0);
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *head = 0,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *tail = 0);
/**
* Create a Stream consisting of @a head and @a tail as the Stream
@@ -76,8 +79,8 @@ public:
* @a arg is the value past in to the @c open() methods of the tasks.
*/
virtual int open (void *arg,
- ACE_Module<ACE_SYNCH_USE> *head = 0,
- ACE_Module<ACE_SYNCH_USE> *tail = 0);
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *head = 0,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *tail = 0);
/// Close down the stream and release all the resources.
virtual int close (int flags = M_DELETE);
@@ -90,7 +93,7 @@ public:
/// Add a new module @a mod right below the Stream head. The
/// @c open() hook methods of the @c ACE_Tasks in this ACE_Module
/// are invoked to initialize the tasks.
- virtual int push (ACE_Module<ACE_SYNCH_USE> *mod);
+ virtual int push (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod);
/// Remove the @a mod right below the Stream head and close it down.
// The <close()> hook methods of the <ACE_Tasks> in this ACE_Module
@@ -99,15 +102,15 @@ public:
/// Return the top module on the stream (right below the stream
/// head).
- virtual int top (ACE_Module<ACE_SYNCH_USE> *&mod);
+ virtual int top (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *&mod);
/// Insert a new module @a mod below the named module @a prev_name.
virtual int insert (const ACE_TCHAR *prev_name,
- ACE_Module<ACE_SYNCH_USE> *mod);
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod);
/// Replace the named module @a replace_name with a new module @a mod.
virtual int replace (const ACE_TCHAR *replace_name,
- ACE_Module<ACE_SYNCH_USE> *mod,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod,
int flags = M_DELETE);
/// Remove the named module @a mod from the stream. This bypasses the
@@ -116,16 +119,16 @@ public:
int flags = M_DELETE);
/// Return current stream head.
- virtual ACE_Module<ACE_SYNCH_USE> *head (void);
+ virtual ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *head (void);
/// Return current stream tail.
- virtual ACE_Module<ACE_SYNCH_USE> *tail (void);
+ virtual ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *tail (void);
/// Find a particular ACE_Module.
- virtual ACE_Module<ACE_SYNCH_USE> *find (const ACE_TCHAR *mod);
+ virtual ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *find (const ACE_TCHAR *mod);
/// Create a pipe between two Streams.
- virtual int link (ACE_Stream<ACE_SYNCH_USE> &);
+ virtual int link (ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> &);
/// Remove a pipe formed between two Streams.
virtual int unlink (void);
@@ -168,26 +171,34 @@ private:
/// Actually perform the linking of two Streams (must be called with
/// locks held).
- int link_i (ACE_Stream<ACE_SYNCH_USE> &);
+ int link_i (ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> &);
/// Must a new module onto the Stream.
- int push_module (ACE_Module<ACE_SYNCH_USE> *,
- ACE_Module<ACE_SYNCH_USE> * = 0,
- ACE_Module<ACE_SYNCH_USE> * = 0);
+ int push_module (ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> * = 0,
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> * = 0);
/// Pointer to the head of the stream.
- ACE_Module<ACE_SYNCH_USE> *stream_head_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *stream_head_;
/// Pointer to the tail of the stream.
- ACE_Module<ACE_SYNCH_USE> *stream_tail_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *stream_tail_;
/// Pointer to an adjoining linked stream.
- ACE_Stream<ACE_SYNCH_USE> *linked_us_;
+ ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> *linked_us_;
// = Synchronization objects used for thread-safe streams.
/// Protect the stream against race conditions.
ACE_SYNCH_MUTEX_T lock_;
+#if defined (ACE_HAS_THREADS)
+ /// Attributes to initialize condition with.
+ /* We only need this because some crappy compilers can't
+ properly handle initializing the conditions with
+ temporary objects. */
+ ACE_Condition_Attributes_T<TIME_POLICY> cond_attr_;
+#endif
+
/// Use to tell all threads waiting on the close that we are done.
ACE_SYNCH_CONDITION_T final_close_;
};
@@ -197,18 +208,18 @@ private:
*
* @brief Iterate through an ACE_Stream.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Stream_Iterator
{
public:
// = Initialization method.
- ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE> &sr);
+ ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE, TIME_POLICY> &sr);
// = Iteration methods.
/// Pass back the @a next_item that hasn't been seen in the set.
/// Returns 0 when all items have been seen, else 1.
- int next (const ACE_Module<ACE_SYNCH_USE> *&next_item);
+ int next (const ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *&next_item);
/// Returns 1 when all items have been seen, else 0.
int done (void) const;
@@ -219,7 +230,7 @@ public:
private:
/// Next ACE_Module that we haven't yet seen.
- ACE_Module<ACE_SYNCH_USE> *next_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *next_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Stream.inl b/dep/acelite/ace/Stream.inl
index 6263d431147..b1bd92a609f 100644
--- a/dep/acelite/ace/Stream.inl
+++ b/dep/acelite/ace/Stream.inl
@@ -1,49 +1,49 @@
// -*- C++ -*-
//
-// $Id: Stream.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Stream.inl 96061 2012-08-16 09:36:07Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_SYNCH_DECL> ACE_INLINE ACE_Module<ACE_SYNCH_USE> *
-ACE_Stream<ACE_SYNCH_USE>::head (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::head (void)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::head");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::head");
return this->stream_head_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE ACE_Module<ACE_SYNCH_USE> *
-ACE_Stream<ACE_SYNCH_USE>::tail (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::tail (void)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::tail");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::tail");
return this->stream_tail_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Stream<ACE_SYNCH_USE>::wait (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::wait (void)
{
- ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::wait");
+ ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::wait");
return this->final_close_.wait ();
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Stream_Iterator<ACE_SYNCH_USE>::next (const ACE_Module<ACE_SYNCH_USE> *&mod)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::next (const ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *&mod)
{
- ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::next");
+ ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::next");
mod = this->next_;
return this->next_ != 0;
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Stream_Iterator<ACE_SYNCH_USE>::done (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::done (void) const
{
- ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::done");
+ ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::done");
return this->next_ == 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Iterator<ACE_SYNCH_USE>::advance (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::advance (void)
{
- ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::advance");
+ ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE, TIME_POLICY>::advance");
this->next_ = this->next_->next ();
return this->next_ != 0;
}
diff --git a/dep/acelite/ace/Stream_Modules.cpp b/dep/acelite/ace/Stream_Modules.cpp
index 8d11e5da1da..a071aa19f1d 100644
--- a/dep/acelite/ace/Stream_Modules.cpp
+++ b/dep/acelite/ace/Stream_Modules.cpp
@@ -1,4 +1,4 @@
-// $Id: Stream_Modules.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Stream_Modules.cpp 96061 2012-08-16 09:36:07Z mcorino $
#ifndef ACE_STREAM_MODULES_CPP
#define ACE_STREAM_MODULES_CPP
@@ -15,53 +15,53 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Head)
-template <ACE_SYNCH_DECL>
-ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream_Head (void)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream_Head");
}
-template <ACE_SYNCH_DECL>
-ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Stream_Head (void)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Stream_Head");
}
-template <ACE_SYNCH_DECL> void
-ACE_Stream_Head<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::dump");
#endif /* ACE_HAS_DUMP */
}
// ACE_Module that act as the head and tail of a Stream.
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::open (void *)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::open (void *)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::open");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::close (u_long)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::close (u_long)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::close");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::svc (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::svc (void)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::svc");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::svc");
return -1;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::control (ACE_Message_Block *mb)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::control (ACE_Message_Block *mb)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::control");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::control");
ACE_IO_Cntl_Msg *ioc = (ACE_IO_Cntl_Msg *) mb->rd_ptr ();
ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd;
@@ -80,10 +80,10 @@ ACE_Stream_Head<ACE_SYNCH_USE>::control (ACE_Message_Block *mb)
// Performs canonical flushing at the ACE_Stream Head.
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::canonical_flush (ACE_Message_Block *mb)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::canonical_flush");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::canonical_flush");
char *cp = mb->rd_ptr ();
if (ACE_BIT_ENABLED (*cp, ACE_Task_Flags::ACE_FLUSHR))
@@ -99,11 +99,11 @@ ACE_Stream_Head<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb)
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::put (ACE_Message_Block *mb,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::put (ACE_Message_Block *mb,
ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::put");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::put");
int res = 0;
if (mb->msg_type () == ACE_Message_Block::MB_IOCTL
@@ -126,17 +126,17 @@ ACE_Stream_Head<ACE_SYNCH_USE>::put (ACE_Message_Block *mb,
}
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::init (int, ACE_TCHAR *[])
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::init (int, ACE_TCHAR *[])
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::init");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::init");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::info (ACE_TCHAR **strp, size_t length) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::info (ACE_TCHAR **strp, size_t length) const
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::info");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::info");
const ACE_TCHAR *name = this->name ();
if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0)
@@ -146,60 +146,60 @@ ACE_Stream_Head<ACE_SYNCH_USE>::info (ACE_TCHAR **strp, size_t length) const
return static_cast<int> (ACE_OS::strlen (name));
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Head<ACE_SYNCH_USE>::fini (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::fini (void)
{
- ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::fini");
+ ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE, TIME_POLICY>::fini");
return 0;
}
ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Tail)
-template <ACE_SYNCH_DECL>
-ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream_Tail (void)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream_Tail");
}
-template <ACE_SYNCH_DECL>
-ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Stream_Tail (void)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Stream_Tail");
}
-template <ACE_SYNCH_DECL> void
-ACE_Stream_Tail<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::dump");
#endif /* ACE_HAS_DUMP */
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::open (void *)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::open (void *)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::open");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::close (u_long)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::close (u_long)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::close");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::svc (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::svc (void)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::svc");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::svc");
return -1;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::control (ACE_Message_Block *mb)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::control (ACE_Message_Block *mb)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::control");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::control");
ACE_IO_Cntl_Msg *ioc = (ACE_IO_Cntl_Msg *) mb->rd_ptr ();
ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd;
@@ -217,16 +217,17 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::control (ACE_Message_Block *mb)
}
default:
mb->msg_type (ACE_Message_Block::MB_IOCNAK);
+ break;
}
return this->reply (mb);
}
// Perform flush algorithm as though we were the driver.
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::canonical_flush (ACE_Message_Block *mb)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::canonical_flush");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::canonical_flush");
char *cp = mb->rd_ptr ();
if (ACE_BIT_ENABLED (*cp, ACE_Task_Flags::ACE_FLUSHW))
@@ -246,11 +247,11 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb)
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::put (ACE_Message_Block *mb,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::put (ACE_Message_Block *mb,
ACE_Time_Value *)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::put");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::put");
if (this->is_writer ())
{
@@ -269,17 +270,17 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::put (ACE_Message_Block *mb,
return -1;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::init (int, ACE_TCHAR *[])
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::init (int, ACE_TCHAR *[])
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::init");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::init");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::info (ACE_TCHAR **strp, size_t length) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::info (ACE_TCHAR **strp, size_t length) const
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::info");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::info");
const ACE_TCHAR *name = this->name ();
if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0)
@@ -289,76 +290,76 @@ ACE_Stream_Tail<ACE_SYNCH_USE>::info (ACE_TCHAR **strp, size_t length) const
return static_cast<int> (ACE_OS::strlen (name));
}
-template <ACE_SYNCH_DECL> int
-ACE_Stream_Tail<ACE_SYNCH_USE>::fini (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::fini (void)
{
- ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::fini");
+ ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE, TIME_POLICY>::fini");
return 0;
}
ACE_ALLOC_HOOK_DEFINE(ACE_Thru_Task)
-template <ACE_SYNCH_DECL>
-ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::ACE_Thru_Task (void)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::ACE_Thru_Task");
}
-template <ACE_SYNCH_DECL>
-ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Thru_Task (void)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Thru_Task");
}
-template <ACE_SYNCH_DECL> void
-ACE_Thru_Task<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::dump");
#endif /* ACE_HAS_DUMP */
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::open (void *)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::open (void *)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::open");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::open");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::close (u_long)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::close (u_long)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::close");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::close");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::svc (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::svc (void)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::svc");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::svc");
return -1;
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::put (ACE_Message_Block *msg,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::put (ACE_Message_Block *msg,
ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::put");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::put");
return this->put_next (msg, tv);
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::init (int, ACE_TCHAR *[])
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::init (int, ACE_TCHAR *[])
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::init");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::init");
return 0;
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::info (ACE_TCHAR **strp,
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::info (ACE_TCHAR **strp,
size_t length) const
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::info");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::info");
const ACE_TCHAR *name = this->name ();
if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0)
@@ -368,10 +369,10 @@ ACE_Thru_Task<ACE_SYNCH_USE>::info (ACE_TCHAR **strp,
return static_cast<int> (ACE_OS::strlen (name));
}
-template <ACE_SYNCH_DECL> int
-ACE_Thru_Task<ACE_SYNCH_USE>::fini (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> int
+ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::fini (void)
{
- ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::fini");
+ ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE, TIME_POLICY>::fini");
return 0;
}
diff --git a/dep/acelite/ace/Stream_Modules.h b/dep/acelite/ace/Stream_Modules.h
index 5bbc072ad4c..008bdecd52f 100644
--- a/dep/acelite/ace/Stream_Modules.h
+++ b/dep/acelite/ace/Stream_Modules.h
@@ -4,7 +4,7 @@
/**
* @file Stream_Modules.h
*
- * $Id: Stream_Modules.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Stream_Modules.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -47,15 +47,15 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* stream.
* - Writer: The block is passed to the next module in the stream.
*/
-template <ACE_SYNCH_DECL>
-class ACE_Stream_Head : public ACE_Task<ACE_SYNCH_USE>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
+class ACE_Stream_Head : public ACE_Task<ACE_SYNCH_USE, TIME_POLICY>
{
public:
/// Construction
ACE_Stream_Head (void);
/// Destruction
- ~ACE_Stream_Head (void);
+ virtual ~ACE_Stream_Head (void);
// = ACE_Task hooks
virtual int open (void *a = 0);
@@ -85,15 +85,15 @@ private:
*
* @brief Standard module that acts as the head of a stream.
*/
-template <ACE_SYNCH_DECL>
-class ACE_Stream_Tail : public ACE_Task<ACE_SYNCH_USE>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
+class ACE_Stream_Tail : public ACE_Task<ACE_SYNCH_USE, TIME_POLICY>
{
public:
/// Construction
ACE_Stream_Tail (void);
/// Destruction
- ~ACE_Stream_Tail (void);
+ virtual ~ACE_Stream_Tail (void);
// = ACE_Task hooks
virtual int open (void *a = 0);
@@ -124,15 +124,15 @@ private:
* @brief Standard module that acts as a "no op", simply passing on all
* data to its adjacent neighbor.
*/
-template <ACE_SYNCH_DECL>
-class ACE_Thru_Task : public ACE_Task<ACE_SYNCH_USE>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
+class ACE_Thru_Task : public ACE_Task<ACE_SYNCH_USE, TIME_POLICY>
{
public:
/// Construction
ACE_Thru_Task (void);
/// Destruction
- ~ACE_Thru_Task (void);
+ virtual ~ACE_Thru_Task (void);
// = ACE_Task hooks
virtual int open (void *a = 0);
diff --git a/dep/acelite/ace/String_Base.cpp b/dep/acelite/ace/String_Base.cpp
index 8438cc6e59d..2373c578204 100644
--- a/dep/acelite/ace/String_Base.cpp
+++ b/dep/acelite/ace/String_Base.cpp
@@ -1,4 +1,4 @@
-// $Id: String_Base.cpp 88793 2010-02-01 17:50:34Z cleeland $
+// $Id: String_Base.cpp 93238 2011-02-01 14:30:38Z shuston $
#ifndef ACE_STRING_BASE_CPP
#define ACE_STRING_BASE_CPP
@@ -655,7 +655,9 @@ ACE_String_Base<ACE_CHAR_T>::operator+= (const ACE_CHAR_T c)
{
ACE_TRACE ("ACE_String_Base<ACE_CHAR_T>::operator+=(const ACE_CHAR_T)");
const size_type slen = 1;
- return this->append (&c, slen);
+ // This temp is silly but it quiets an optimizer warning in IBM XL C++ 10.
+ ACE_String_Base<ACE_CHAR_T>& r = this->append (&c, slen);
+ return r;
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/String_Base.h b/dep/acelite/ace/String_Base.h
index 128fe76a2b6..b02d786725a 100644
--- a/dep/acelite/ace/String_Base.h
+++ b/dep/acelite/ace/String_Base.h
@@ -4,7 +4,7 @@
/**
* @file String_Base.h
*
- * $Id: String_Base.h 92057 2010-09-27 14:52:00Z johnnyw $
+ * $Id: String_Base.h 95709 2012-04-24 01:19:24Z schmidt $
*
* @author Douglas C. Schmidt (schmidt@cs.wustl.edu)
* @author Nanbor Wang <nanbor@cs.wustl.edu>
diff --git a/dep/acelite/ace/Svc_Conf.y b/dep/acelite/ace/Svc_Conf.y
index 8ddc6a8d3a7..ec3ed5c06c1 100644
--- a/dep/acelite/ace/Svc_Conf.y
+++ b/dep/acelite/ace/Svc_Conf.y
@@ -1,5 +1,5 @@
%{
-// $Id: Svc_Conf.y 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Svc_Conf.y 94034 2011-05-09 19:11:03Z johnnyw $
#include "ace/Svc_Conf.h"
@@ -331,11 +331,10 @@ ace_get_module (ACE_Service_Type const * sr,
ACE_TCHAR const * svc_name,
int & yyerrno)
{
- ACE_Service_Type_Impl const * const type = sr->type ();
ACE_Stream_Type const * const st =
(sr == 0
? 0
- : dynamic_cast<ACE_Stream_Type const *> (type));
+ : dynamic_cast<ACE_Stream_Type const *> (sr->type ()));
ACE_Module_Type const * const mt = (st == 0 ? 0 : st->find (svc_name));
if (sr == 0 || st == 0 || mt == 0)
diff --git a/dep/acelite/ace/Svc_Conf_y.cpp b/dep/acelite/ace/Svc_Conf_y.cpp
index e14286699cd..8aa656ff39f 100644
--- a/dep/acelite/ace/Svc_Conf_y.cpp
+++ b/dep/acelite/ace/Svc_Conf_y.cpp
@@ -1,4 +1,4 @@
-// $Id: Svc_Conf_y.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Svc_Conf_y.cpp 94034 2011-05-09 19:11:03Z johnnyw $
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
@@ -105,7 +105,7 @@
/* Copy the first part of user declarations. */
-// $Id: Svc_Conf_y.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Svc_Conf_y.cpp 94034 2011-05-09 19:11:03Z johnnyw $
#include "ace/Svc_Conf.h"
@@ -1955,11 +1955,10 @@ ace_get_module (ACE_Service_Type const * sr,
ACE_TCHAR const * svc_name,
int & ace_yyerrno)
{
- ACE_Service_Type_Impl const * const type = sr->type ();
ACE_Stream_Type const * const st =
(sr == 0
? 0
- : dynamic_cast<ACE_Stream_Type const *> (type));
+ : dynamic_cast<ACE_Stream_Type const *> (sr->type ()));
ACE_Module_Type const * const mt = (st == 0 ? 0 : st->find (svc_name));
if (sr == 0 || st == 0 || mt == 0)
diff --git a/dep/acelite/ace/Svc_Handler.cpp b/dep/acelite/ace/Svc_Handler.cpp
index a4f22c98ce4..565d96c5c34 100644
--- a/dep/acelite/ace/Svc_Handler.cpp
+++ b/dep/acelite/ace/Svc_Handler.cpp
@@ -1,4 +1,4 @@
-// $Id: Svc_Handler.cpp 89432 2010-03-10 10:34:51Z vzykov $
+// $Id: Svc_Handler.cpp 94310 2011-07-09 19:10:06Z schmidt $
#ifndef ACE_SVC_HANDLER_CPP
#define ACE_SVC_HANDLER_CPP
@@ -95,8 +95,7 @@ template <PR_ST_1, ACE_SYNCH_DECL> void
ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::operator delete (void *p,
const ACE_nothrow_t&) throw()
{
- ACE_TRACE
- ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::operator delete(nothrow)");
+ ACE_TRACE("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::operator delete(nothrow)");
::delete [] static_cast <char *> (p);
}
#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */
diff --git a/dep/acelite/ace/Synch_Traits.h b/dep/acelite/ace/Synch_Traits.h
index 785b9fd0eec..a841039a223 100644
--- a/dep/acelite/ace/Synch_Traits.h
+++ b/dep/acelite/ace/Synch_Traits.h
@@ -4,7 +4,7 @@
/**
* @file Synch_Traits.h
*
- * $Id: Synch_Traits.h 91626 2010-09-07 10:59:20Z johnnyw $
+ * $Id: Synch_Traits.h 96073 2012-08-17 13:39:55Z mcorino $
*
* Moved from Synch.h.
*
@@ -27,17 +27,19 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decl
class ACE_Null_Mutex;
-class ACE_Null_Condition;
class ACE_Null_Semaphore;
class ACE_Null_Mutex;
class ACE_Thread_Mutex;
class ACE_Process_Mutex;
class ACE_Recursive_Thread_Mutex;
class ACE_RW_Thread_Mutex;
-class ACE_Condition_Thread_Mutex;
-class ACE_Condition_Recursive_Thread_Mutex;
class ACE_Thread_Semaphore;
+template <class MUTEX> class ACE_Condition;
+typedef ACE_Condition<ACE_Null_Mutex> ACE_Null_Condition;
+typedef ACE_Condition<ACE_Thread_Mutex> ACE_Condition_Thread_Mutex;
+typedef ACE_Condition<ACE_Recursive_Thread_Mutex> ACE_Condition_Recursive_Thread_Mutex;
+
/**
* @class ACE_NULL_SYNCH
*
@@ -62,7 +64,6 @@ public:
#if defined (ACE_HAS_THREADS)
class ACE_Process_Mutex;
-class ACE_Condition_Recursive_Thread_Mutex;
/**
* @class ACE_MT_SYNCH
diff --git a/dep/acelite/ace/TLI.inl b/dep/acelite/ace/TLI.inl
index 001d8c65292..1d7e196b198 100644
--- a/dep/acelite/ace/TLI.inl
+++ b/dep/acelite/ace/TLI.inl
@@ -1,10 +1,8 @@
// -*- C++ -*-
-//
-// $Id: TLI.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: TLI.inl 93359 2011-02-11 11:33:12Z mcorino $
#include "ace/TLI.h"
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE
diff --git a/dep/acelite/ace/TP_Reactor.cpp b/dep/acelite/ace/TP_Reactor.cpp
index 683dfd58622..70998e60497 100644
--- a/dep/acelite/ace/TP_Reactor.cpp
+++ b/dep/acelite/ace/TP_Reactor.cpp
@@ -1,10 +1,11 @@
-// $Id: TP_Reactor.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: TP_Reactor.cpp 95332 2011-12-15 11:09:41Z mcorino $
#include "ace/TP_Reactor.h"
#include "ace/Thread.h"
#include "ace/Timer_Queue.h"
#include "ace/Sig_Handler.h"
#include "ace/Log_Msg.h"
+#include "ace/Functor_T.h"
#include "ace/OS_NS_sys_time.h"
#if !defined (__ACE_INLINE__)
@@ -161,7 +162,10 @@ ACE_TP_Reactor::handle_events (ACE_Time_Value *max_wait_time)
// After getting the lock just just for deactivation..
if (this->deactivated_)
- return -1;
+ {
+ errno = ESHUTDOWN;
+ return -1;
+ }
// Update the countdown to reflect time waiting for the token.
countdown.update ();
@@ -303,40 +307,10 @@ int
ACE_TP_Reactor::handle_timer_events (int & /*event_count*/,
ACE_TP_Token_Guard &guard)
{
- if (this->timer_queue_ == 0 || this->timer_queue_->is_empty())
- { // Empty timer queue so cannot have any expired timers.
- return 0;
- }
-
- // Get the current time
- ACE_Time_Value cur_time (this->timer_queue_->gettimeofday () +
- this->timer_queue_->timer_skew ());
-
- // Look for a node in the timer queue whose timer <= the present
- // time.
- ACE_Timer_Node_Dispatch_Info info;
-
- if (this->timer_queue_->dispatch_info (cur_time, info))
- {
- const void *upcall_act = 0;
+ typedef ACE_Member_Function_Command<ACE_TP_Token_Guard> Guard_Release;
- // Preinvoke.
- this->timer_queue_->preinvoke (info, cur_time, upcall_act);
-
- // Release the token before dispatching notifies...
- guard.release_token ();
-
- // call the functor
- this->timer_queue_->upcall (info, cur_time);
-
- // Postinvoke
- this->timer_queue_->postinvoke (info, cur_time, upcall_act);
-
- // We have dispatched a timer
- return 1;
- }
-
- return 0;
+ Guard_Release release(guard, &ACE_TP_Token_Guard::release_token);
+ return this->timer_queue_->expire_single(release);
}
int
diff --git a/dep/acelite/ace/TP_Reactor.h b/dep/acelite/ace/TP_Reactor.h
index 33e00c2e57f..965b6dfcc91 100644
--- a/dep/acelite/ace/TP_Reactor.h
+++ b/dep/acelite/ace/TP_Reactor.h
@@ -4,7 +4,7 @@
/**
* @file TP_Reactor.h
*
- * $Id: TP_Reactor.h 82723 2008-09-16 09:35:44Z johnnyw $
+ * $Id: TP_Reactor.h 94454 2011-09-08 17:36:56Z johnnyw $
*
* The ACE_TP_Reactor (aka, Thread Pool Reactor) uses the
* Leader/Followers pattern to demultiplex events among a pool of
@@ -131,7 +131,7 @@ private:
/// Flag that indicate whether the thread that created this object
/// owns the token or not. A value of false indicates that this class
- /// hasnt got the token (and hence the thread) and a value of true
+ /// hasn't got the token (and hence the thread) and a value of true
/// vice-versa.
bool owner_;
diff --git a/dep/acelite/ace/TSS_Adapter.cpp b/dep/acelite/ace/TSS_Adapter.cpp
index 748ad1c13e6..e51ca303511 100644
--- a/dep/acelite/ace/TSS_Adapter.cpp
+++ b/dep/acelite/ace/TSS_Adapter.cpp
@@ -1,7 +1,7 @@
/**
* @file TSS_Adapter.cpp
*
- * $Id: TSS_Adapter.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+ * $Id: TSS_Adapter.cpp 93792 2011-04-07 11:48:50Z mcorino $
*
* Originally in Synch.cpp
*
@@ -10,30 +10,25 @@
#include "ace/TSS_Adapter.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_TSS_Adapter::ACE_TSS_Adapter (void *object, ACE_THR_DEST f)
: ts_obj_ (object),
func_ (f)
{
- // ACE_TRACE ("ACE_TSS_Adapter::ACE_TSS_Adapter");
}
void
ACE_TSS_Adapter::cleanup (void)
{
- // ACE_TRACE ("ACE_TSS_Adapter::cleanup");
(*this->func_)(this->ts_obj_); // call cleanup routine for ts_obj_
}
ACE_END_VERSIONED_NAMESPACE_DECL
-extern "C" void
+extern "C" ACE_Export void
ACE_TSS_C_cleanup (void *object)
{
- // ACE_TRACE ("ACE_TSS_C_cleanup");
if (object != 0)
{
ACE_TSS_Adapter * const tss_adapter = (ACE_TSS_Adapter *) object;
diff --git a/dep/acelite/ace/TSS_Adapter.h b/dep/acelite/ace/TSS_Adapter.h
index b8ff85e3210..b806422365f 100644
--- a/dep/acelite/ace/TSS_Adapter.h
+++ b/dep/acelite/ace/TSS_Adapter.h
@@ -4,7 +4,7 @@
/**
* @file TSS_Adapter.h
*
- * $Id: TSS_Adapter.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: TSS_Adapter.h 93792 2011-04-07 11:48:50Z mcorino $
*
* Originally in Synch.h
*
@@ -30,8 +30,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* @brief This class encapsulates a TSS object and its associated
* C++ destructor function. It is used by the ACE_TSS...
* methods (in Synch_T.cpp) in order to allow an extern
- * "C" cleanup routine to be used. Needed by the "frigging"
- * MVS C++ compiler.
+ * "C" cleanup routine to be used.
*
* Objects of this class are stored in thread specific
* storage. ts_obj_ points to the "real" object and
diff --git a/dep/acelite/ace/TSS_T.cpp b/dep/acelite/ace/TSS_T.cpp
index 9cc112f3ec7..8c6f30e1116 100644
--- a/dep/acelite/ace/TSS_T.cpp
+++ b/dep/acelite/ace/TSS_T.cpp
@@ -1,4 +1,4 @@
-// $Id: TSS_T.cpp 91693 2010-09-09 12:57:54Z johnnyw $
+// $Id: TSS_T.cpp 93792 2011-04-07 11:48:50Z mcorino $
#ifndef ACE_TSS_T_CPP
#define ACE_TSS_T_CPP
@@ -28,7 +28,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_TSS)
#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
# if defined (ACE_HAS_THR_C_DEST)
-extern "C" void ACE_TSS_C_cleanup (void *);
+extern "C" ACE_Export void ACE_TSS_C_cleanup (void *);
# endif /* ACE_HAS_THR_C_DEST */
#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) */
diff --git a/dep/acelite/ace/TTY_IO.h b/dep/acelite/ace/TTY_IO.h
index 1029966e56c..39de5f8d236 100644
--- a/dep/acelite/ace/TTY_IO.h
+++ b/dep/acelite/ace/TTY_IO.h
@@ -4,7 +4,7 @@
/**
* @file TTY_IO.h
*
- * $Id: TTY_IO.h 82271 2008-07-09 09:23:03Z olli $
+ * $Id: TTY_IO.h 95212 2011-12-05 12:29:55Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@uci.edu>
*/
@@ -46,7 +46,7 @@ public:
{
Serial_Params (void);
- /** Specifies the baudrate at which the communnication port operates. */
+ /** Specifies the baudrate at which the communication port operates. */
int baudrate;
/** Specifies the minimum number of bytes in input buffer before XON char
is sent. Negative value indicates that default value should
diff --git a/dep/acelite/ace/Task.cpp b/dep/acelite/ace/Task.cpp
index c570fc0dc89..1d159ad84b7 100644
--- a/dep/acelite/ace/Task.cpp
+++ b/dep/acelite/ace/Task.cpp
@@ -1,4 +1,4 @@
-// $Id: Task.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Task.cpp 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/Task.h"
#include "ace/Module.h"
@@ -15,21 +15,15 @@ ACE_Task_Base::ACE_Task_Base (ACE_Thread_Manager *thr_man)
thr_mgr_ (thr_man),
flags_ (0),
grp_id_ (-1)
-#if !(defined (ACE_MVS) || defined(__TANDEM))
,last_thread_id_ (0)
-#endif /* !defined (ACE_MVS) */
{
-#if (defined (ACE_MVS) || defined(__TANDEM))
- ACE_OS::memset( &this->last_thread_id_, '\0', sizeof( this->last_thread_id_ ));
-#endif /* defined (ACE_MVS) */
}
ACE_Task_Base::~ACE_Task_Base (void)
{
}
-// Default ACE_Task service routine
-
+/// Default ACE_Task service routine
int
ACE_Task_Base::svc (void)
{
@@ -37,8 +31,7 @@ ACE_Task_Base::svc (void)
return 0;
}
-// Default ACE_Task open routine
-
+/// Default ACE_Task open routine
int
ACE_Task_Base::open (void *)
{
@@ -46,8 +39,7 @@ ACE_Task_Base::open (void *)
return 0;
}
-// Default ACE_Task close routine
-
+/// Default ACE_Task close routine
int
ACE_Task_Base::close (u_long)
{
@@ -55,17 +47,15 @@ ACE_Task_Base::close (u_long)
return 0;
}
-// Forward the call to close() so that existing applications don't
-// break.
-
+/// Forward the call to close() so that existing applications don't
+/// break.
int
ACE_Task_Base::module_closed (void)
{
return this->close (1);
}
-// Default ACE_Task put routine.
-
+/// Default ACE_Task put routine.
int
ACE_Task_Base::put (ACE_Message_Block *, ACE_Time_Value *)
{
@@ -73,8 +63,7 @@ ACE_Task_Base::put (ACE_Message_Block *, ACE_Time_Value *)
return 0;
}
-// Wait for all threads running in a task to exit.
-
+/// Wait for all threads running in a task to exit.
int
ACE_Task_Base::wait (void)
{
@@ -88,7 +77,7 @@ ACE_Task_Base::wait (void)
return 0;
}
-// Suspend a task.
+/// Suspend a task.
int
ACE_Task_Base::suspend (void)
{
@@ -100,7 +89,7 @@ ACE_Task_Base::suspend (void)
return 0;
}
-// Resume a suspended task.
+/// Resume a suspended task.
int
ACE_Task_Base::resume (void)
{
@@ -195,11 +184,11 @@ ACE_Task_Base::activate (long flags,
if (this->grp_id_ == -1)
this->grp_id_ = grp_spawned;
-#if defined (ACE_MVS) || defined(__TANDEM)
+#if defined(ACE_TANDEM_T1248_PTHREADS)
ACE_OS::memcpy( &this->last_thread_id_, '\0', sizeof(this->last_thread_id_));
#else
this->last_thread_id_ = 0; // Reset to prevent inadvertant match on ID
-#endif /* defined (ACE_MVS) */
+#endif /* defined (ACE_TANDEM_T1248_PTHREADS) */
return 0;
diff --git a/dep/acelite/ace/Task_Ex_T.cpp b/dep/acelite/ace/Task_Ex_T.cpp
index de97e5ba6b4..bcc0ff0bed3 100644
--- a/dep/acelite/ace/Task_Ex_T.cpp
+++ b/dep/acelite/ace/Task_Ex_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Task_Ex_T.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Task_Ex_T.cpp 96061 2012-08-16 09:36:07Z mcorino $
#ifndef ACE_TASK_EX_T_CPP
#define ACE_TASK_EX_T_CPP
@@ -19,11 +19,11 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> void
-ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::dump (void) const
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> void
+ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::dump");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_mgr_ = %x"), this->thr_mgr_));
this->msg_queue_->dump ();
@@ -44,31 +44,31 @@ ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::dump (void) const
// If the user doesn't supply a ACE_Message_Queue_Ex pointer then we'll
// allocate one dynamically. Otherwise, we'll use the one they give.
-template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE>
-ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::ACE_Task_Ex (ACE_Thread_Manager *thr_man,
- ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> *mq)
+template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY>
+ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::ACE_Task_Ex (ACE_Thread_Manager *thr_man,
+ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> *mq)
: ACE_Task_Base (thr_man),
msg_queue_ (0),
delete_msg_queue_ (false),
mod_ (0),
next_ (0)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::ACE_Task_Ex");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::ACE_Task_Ex");
if (mq == 0)
{
ACE_NEW (mq,
- (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>));
+ (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY>));
this->delete_msg_queue_ = true;
}
this->msg_queue_ = mq;
}
-template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE>
-ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::~ACE_Task_Ex (void)
+template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY>
+ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::~ACE_Task_Ex (void)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::~ACE_Task_Ex");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::~ACE_Task_Ex");
if (this->delete_msg_queue_)
delete this->msg_queue_;
@@ -77,10 +77,10 @@ ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::~ACE_Task_Ex (void)
this->delete_msg_queue_ = false;
}
-template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_Task<ACE_SYNCH_USE> *
-ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::sibling (void)
+template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::sibling (void)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::sibling");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::sibling");
/// @todo FIXME Need to impl ACE_Moudle to support ACE_Task as well.
/// Now always return 0 for sibling
return 0;
@@ -92,20 +92,20 @@ ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::sibling (void)
*/
}
-template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> const ACE_TCHAR *
-ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::name (void) const
+template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> const ACE_TCHAR *
+ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::name (void) const
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::name");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::name");
if (this->mod_ == 0)
return 0;
else
return this->mod_->name ();
}
-template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_Module<ACE_SYNCH_USE> *
-ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::module (void) const
+template<ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::module (void) const
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::module");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE, TIME_POLICY>::module");
return this->mod_;
}
diff --git a/dep/acelite/ace/Task_Ex_T.h b/dep/acelite/ace/Task_Ex_T.h
index 70a97247b04..04eadb794e3 100644
--- a/dep/acelite/ace/Task_Ex_T.h
+++ b/dep/acelite/ace/Task_Ex_T.h
@@ -4,7 +4,7 @@
/**
* @file Task_Ex_T.h
*
- * $Id: Task_Ex_T.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Task_Ex_T.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Kobi Cohen-Arazi <kobi-co@barak-online.net>
*/
@@ -26,7 +26,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decls...
-template <ACE_SYNCH_DECL> class ACE_Module;
+template <ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Module;
/**
* @class ACE_Task_Ex
@@ -57,14 +57,14 @@ template <ACE_SYNCH_DECL> class ACE_Module;
* When User (and legacy code) write ACE_Task<ACE_MT_SYNCH>, specialized ACE_Task
* code is in action.
*/
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE>
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Task_Ex : public ACE_Task_Base,
private ACE_Copy_Disabled
{
public:
- friend class ACE_Module<ACE_SYNCH_USE>;
+ friend class ACE_Module<ACE_SYNCH_USE, TIME_POLICY>;
friend class ACE_Module_Type;
- typedef ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> MESSAGE_QUEUE_EX;
+ typedef ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> MESSAGE_QUEUE_EX;
// = Initialization/termination methods.
/**
@@ -133,16 +133,16 @@ public: // Should be protected:
// = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream).
/// Get next Task pointer.
- ACE_Task<ACE_SYNCH_USE> *next (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *next (void);
/// Set next Task pointer.
- void next (ACE_Task<ACE_SYNCH_USE> *);
+ void next (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *);
/// Alwasy return 0. @todo FIXME
- ACE_Task<ACE_SYNCH_USE> *sibling (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *sibling (void);
/// Return the Task's Module if there is one, else returns 0.
- ACE_Module<ACE_SYNCH_USE> *module (void) const;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *module (void) const;
/**
* Flush the task's queue, i.e., free all of the enqueued
@@ -164,10 +164,10 @@ public: // Should be protected:
bool delete_msg_queue_;
/// Back-pointer to the enclosing module.
- ACE_Module<ACE_SYNCH_USE> *mod_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod_;
/// Pointer to adjacent ACE_Task.
- ACE_Task<ACE_SYNCH_USE> *next_;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *next_;
/// Dump the state of an object.
void dump (void) const;
diff --git a/dep/acelite/ace/Task_Ex_T.inl b/dep/acelite/ace/Task_Ex_T.inl
index 9b5c864c6ad..543e107efac 100644
--- a/dep/acelite/ace/Task_Ex_T.inl
+++ b/dep/acelite/ace/Task_Ex_T.inl
@@ -1,55 +1,55 @@
// -*- C++ -*-
//
-// $Id: Task_Ex_T.inl 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: Task_Ex_T.inl 96061 2012-08-16 09:36:07Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE void
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE void
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
size_t wm_size)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::water_marks");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::water_marks");
if (cmd == ACE_IO_Cntl_Msg::SET_LWM)
this->msg_queue_->low_water_mark (wm_size);
else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */
this->msg_queue_->high_water_mark (wm_size);
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::getq (ACE_MESSAGE_TYPE *&mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE int
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::getq (ACE_MESSAGE_TYPE *&mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::getq");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::getq");
return this->msg_queue_->dequeue_head (mb, tv);
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::putq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE int
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::putq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::putq");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::putq");
return this->msg_queue_->enqueue_tail (mb, tv);
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::ungetq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE int
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::ungetq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::ungetq");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::ungetq");
return this->msg_queue_->enqueue_head (mb, tv);
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::flush (u_long flag)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE int
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::flush (u_long flag)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::flush");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::flush");
if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL))
return this->msg_queue_ != 0 && this->msg_queue_->close ();
else
return -1; // Note, need to be more careful about what we free...
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE void
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> *mq)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE void
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::msg_queue (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> *mq)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::msg_queue");
if (this->delete_msg_queue_)
{
delete this->msg_queue_;
@@ -58,44 +58,44 @@ ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue (ACE_Message_Queue_Ex<ACE
this->msg_queue_ = mq;
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> *
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue (void)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::msg_queue (void)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::msg_queue");
return this->msg_queue_;
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::reply (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE int
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::reply (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::reply");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::reply");
ACE_UNUSED_ARG (mb);
ACE_UNUSED_ARG (tv);
return -1 ; // this->sibling ()->put_next (mb, tv);
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE ACE_Task<ACE_SYNCH_USE> *
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next (void)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::next (void)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::next");
return this->next_;
}
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE void
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next (ACE_Task<ACE_SYNCH_USE> *q)
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE void
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::next (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::next");
this->next_ = q;
}
// Transfer msg to the next ACE_Task_Ex.
-template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
-ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::put_next (
+template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE, class TIME_POLICY> ACE_INLINE int
+ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::put_next (
ACE_MESSAGE_TYPE * /* msg */,
ACE_Time_Value * /* tv */)
{
- ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::put_next");
+ ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE, TIME_POLICY>::put_next");
return -1; // this->next_ == 0 ? -1 : this->next_->put (msg, tv);
}
diff --git a/dep/acelite/ace/Task_T.cpp b/dep/acelite/ace/Task_T.cpp
index 08b36f82f08..e2481ae2bc6 100644
--- a/dep/acelite/ace/Task_T.cpp
+++ b/dep/acelite/ace/Task_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Task_T.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Task_T.cpp 96061 2012-08-16 09:36:07Z mcorino $
#ifndef ACE_TASK_T_CPP
#define ACE_TASK_T_CPP
@@ -18,11 +18,11 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_SYNCH_DECL> void
-ACE_Task<ACE_SYNCH_USE>::dump (void) const
+template <ACE_SYNCH_DECL, class TIME_POLICY> void
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::dump");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_mgr_ = %x"), this->thr_mgr_));
this->msg_queue_->dump ();
@@ -43,31 +43,32 @@ ACE_Task<ACE_SYNCH_USE>::dump (void) const
// If the user doesn't supply a ACE_Message_Queue pointer then we'll
// allocate one dynamically. Otherwise, we'll use the one they give.
-template<ACE_SYNCH_DECL>
-ACE_Task<ACE_SYNCH_USE>::ACE_Task (ACE_Thread_Manager *thr_man,
- ACE_Message_Queue<ACE_SYNCH_USE> *mq)
+template<ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::ACE_Task (ACE_Thread_Manager *thr_man,
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *mq)
: ACE_Task_Base (thr_man),
msg_queue_ (0),
delete_msg_queue_ (false),
mod_ (0),
next_ (0)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::ACE_Task");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::ACE_Task");
if (mq == 0)
{
+ typedef ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> QUEUE_TYPE;
ACE_NEW (mq,
- ACE_Message_Queue<ACE_SYNCH_USE>);
+ QUEUE_TYPE);
this->delete_msg_queue_ = true;
}
this->msg_queue_ = mq;
}
-template<ACE_SYNCH_DECL>
-ACE_Task<ACE_SYNCH_USE>::~ACE_Task (void)
+template<ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Task (void)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::~ACE_Task");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::~ACE_Task");
if (this->delete_msg_queue_)
delete this->msg_queue_;
@@ -76,30 +77,30 @@ ACE_Task<ACE_SYNCH_USE>::~ACE_Task (void)
this->delete_msg_queue_ = false;
}
-template<ACE_SYNCH_DECL> ACE_Task<ACE_SYNCH_USE> *
-ACE_Task<ACE_SYNCH_USE>::sibling (void)
+template<ACE_SYNCH_DECL, class TIME_POLICY> ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::sibling (void)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::sibling");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::sibling");
if (this->mod_ == 0)
return 0;
else
return this->mod_->sibling (this);
}
-template<ACE_SYNCH_DECL> const ACE_TCHAR *
-ACE_Task<ACE_SYNCH_USE>::name (void) const
+template<ACE_SYNCH_DECL, class TIME_POLICY> const ACE_TCHAR *
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::name (void) const
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::name");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::name");
if (this->mod_ == 0)
return 0;
else
return this->mod_->name ();
}
-template<ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE> *
-ACE_Task<ACE_SYNCH_USE>::module (void) const
+template<ACE_SYNCH_DECL, class TIME_POLICY> ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::module (void) const
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::module");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::module");
return this->mod_;
}
diff --git a/dep/acelite/ace/Task_T.h b/dep/acelite/ace/Task_T.h
index 1946f45cfe5..9b0cd9e2c6f 100644
--- a/dep/acelite/ace/Task_T.h
+++ b/dep/acelite/ace/Task_T.h
@@ -4,7 +4,7 @@
/**
* @file Task_T.h
*
- * $Id: Task_T.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Task_T.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -27,7 +27,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decls...
-template <ACE_SYNCH_DECL> class ACE_Module;
+template <ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Module;
/**
* @class ACE_Task
@@ -38,11 +38,11 @@ template <ACE_SYNCH_DECL> class ACE_Module;
* This class serves as the basis for passive and active objects
* in ACE.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Task : public ACE_Task_Base
{
public:
- friend class ACE_Module<ACE_SYNCH_USE>;
+ friend class ACE_Module<ACE_SYNCH_USE, TIME_POLICY>;
friend class ACE_Module_Type;
// = Initialization/termination methods.
@@ -53,16 +53,24 @@ public:
* one passed as a parameter.
*/
ACE_Task (ACE_Thread_Manager *thr_mgr = 0,
- ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0);
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *mq = 0);
/// Destructor.
virtual ~ACE_Task (void);
/// Gets the message queue associated with this task.
- ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue (void);
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *msg_queue (void);
/// Sets the message queue associated with this task.
- void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *);
+ void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *);
+
+ /// Get the current time of day according to the queue's TIME_POLICY.
+ /// Allows users to initialize timeout values using correct time policy.
+ ACE_Time_Value_T<TIME_POLICY> gettimeofday (void) const;
+
+ /// Allows applications to control how the timer queue gets the time
+ /// of day.
+ void set_time_policy (TIME_POLICY const & time_policy);
public: // Should be protected:
// = Message queue manipulation methods.
@@ -118,17 +126,17 @@ public: // Should be protected:
// = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream).
/// Get next Task pointer.
- ACE_Task<ACE_SYNCH_USE> *next (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *next (void);
/// Set next Task pointer.
- void next (ACE_Task<ACE_SYNCH_USE> *);
+ void next (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *);
/// Return the Task's sibling if there's one associated with the
/// Task's Module, else returns 0.
- ACE_Task<ACE_SYNCH_USE> *sibling (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *sibling (void);
/// Return the Task's Module if there is one, else returns 0.
- ACE_Module<ACE_SYNCH_USE> *module (void) const;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *module (void) const;
/**
* Flush the task's queue, i.e., free all of the enqueued
@@ -144,16 +152,16 @@ public: // Should be protected:
void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t);
/// Queue of messages on the ACE_Task..
- ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue_;
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *msg_queue_;
/// true if should delete Message_Queue, false otherwise.
bool delete_msg_queue_;
/// Back-pointer to the enclosing module.
- ACE_Module<ACE_SYNCH_USE> *mod_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod_;
/// Pointer to adjacent ACE_Task.
- ACE_Task<ACE_SYNCH_USE> *next_;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *next_;
/// Dump the state of an object.
void dump (void) const;
@@ -164,8 +172,8 @@ public: // Should be protected:
private:
// = Disallow these operations.
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task<ACE_SYNCH_USE> &))
- ACE_UNIMPLEMENTED_FUNC (ACE_Task (const ACE_Task<ACE_SYNCH_USE> &))
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task<ACE_SYNCH_USE, TIME_POLICY> &))
+ ACE_UNIMPLEMENTED_FUNC (ACE_Task (const ACE_Task<ACE_SYNCH_USE, TIME_POLICY> &))
};
#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
diff --git a/dep/acelite/ace/Task_T.inl b/dep/acelite/ace/Task_T.inl
index 5eda4c2bf90..34ad25b0c6b 100644
--- a/dep/acelite/ace/Task_T.inl
+++ b/dep/acelite/ace/Task_T.inl
@@ -1,55 +1,55 @@
// -*- C++ -*-
//
-// $Id: Task_T.inl 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: Task_T.inl 96066 2012-08-16 12:45:46Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <ACE_SYNCH_DECL> ACE_INLINE void
-ACE_Task<ACE_SYNCH_USE>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
size_t wm_size)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::water_marks");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::water_marks");
if (cmd == ACE_IO_Cntl_Msg::SET_LWM)
this->msg_queue_->low_water_mark (wm_size);
else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */
this->msg_queue_->high_water_mark (wm_size);
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Task<ACE_SYNCH_USE>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::getq");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::getq");
return this->msg_queue_->dequeue_head (mb, tv);
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Task<ACE_SYNCH_USE>::putq (ACE_Message_Block *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::putq (ACE_Message_Block *mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::putq");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::putq");
return this->msg_queue_->enqueue_tail (mb, tv);
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Task<ACE_SYNCH_USE>::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::ungetq");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::ungetq");
return this->msg_queue_->enqueue_head (mb, tv);
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Task<ACE_SYNCH_USE>::flush (u_long flag)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::flush (u_long flag)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::flush");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::flush");
if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL))
return this->msg_queue_ != 0 && this->msg_queue_->close ();
else
return -1; // Note, need to be more careful about what we free...
}
-template <ACE_SYNCH_DECL> ACE_INLINE void
-ACE_Task<ACE_SYNCH_USE>::msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *mq)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue (ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *mq)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::msg_queue");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue");
if (this->delete_msg_queue_)
{
delete this->msg_queue_;
@@ -58,40 +58,58 @@ ACE_Task<ACE_SYNCH_USE>::msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *mq)
this->msg_queue_ = mq;
}
-template <ACE_SYNCH_DECL> ACE_Message_Queue<ACE_SYNCH_USE> *
-ACE_Task<ACE_SYNCH_USE>::msg_queue (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue (void)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::msg_queue");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue");
return this->msg_queue_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Task<ACE_SYNCH_USE>::reply (ACE_Message_Block *mb, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY>
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::gettimeofday (void) const
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::reply");
+ if (this->msg_queue_ != 0)
+ return this->msg_queue_->gettimeofday ();
+
+ return ACE_Time_Value_T<TIME_POLICY> (ACE_Time_Value::zero);
+}
+
+template <ACE_SYNCH_DECL, class TIME_POLICY>
+void
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::set_time_policy (TIME_POLICY const & rhs)
+{
+ if (this->msg_queue_ != 0)
+ this->msg_queue_->set_time_policy (rhs);
+}
+
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::reply (ACE_Message_Block *mb, ACE_Time_Value *tv)
+{
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::reply");
return this->sibling ()->put_next (mb, tv);
}
-template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> *
-ACE_Task<ACE_SYNCH_USE>::next (void)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next (void)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::next");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next");
return this->next_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE void
-ACE_Task<ACE_SYNCH_USE>::next (ACE_Task<ACE_SYNCH_USE> *q)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::next");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next");
this->next_ = q;
}
// Transfer msg to the next ACE_Task.
-template <ACE_SYNCH_DECL> ACE_INLINE int
-ACE_Task<ACE_SYNCH_USE>::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv)
+template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
+ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::put_next");
+ ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::put_next");
return this->next_ == 0 ? -1 : this->next_->put (msg, tv);
}
diff --git a/dep/acelite/ace/Thread.inl b/dep/acelite/ace/Thread.inl
index b1fd120a261..5e08bd34d7e 100644
--- a/dep/acelite/ace/Thread.inl
+++ b/dep/acelite/ace/Thread.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Thread.inl 91693 2010-09-09 12:57:54Z johnnyw $
+// $Id: Thread.inl 95376 2011-12-20 15:39:02Z shuston $
#include "ace/OS_NS_string.h"
@@ -171,7 +171,7 @@ ACE_Thread::disablecancel (struct cancel_state *old_state)
{
ACE_OS::memset (old_state,
0,
- sizeof (old_state));
+ sizeof (*old_state));
old_state->cancelstate = old_cstate;
}
diff --git a/dep/acelite/ace/Thread_Adapter.cpp b/dep/acelite/ace/Thread_Adapter.cpp
index 754691857a0..0afb322e731 100644
--- a/dep/acelite/ace/Thread_Adapter.cpp
+++ b/dep/acelite/ace/Thread_Adapter.cpp
@@ -1,4 +1,4 @@
-// $Id: Thread_Adapter.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Thread_Adapter.cpp 92682 2010-11-23 23:41:19Z shuston $
#include "ace/Thread_Adapter.h"
#include "ace/Thread_Manager.h"
@@ -22,6 +22,7 @@ ACE_Thread_Adapter::ACE_Thread_Adapter (ACE_THR_FUNC user_func,
, ACE_SEH_EXCEPT_HANDLER selector,
ACE_SEH_EXCEPT_HANDLER handler
#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , long cancel_flags
)
: ACE_Base_Thread_Adapter (
user_func
@@ -32,6 +33,7 @@ ACE_Thread_Adapter::ACE_Thread_Adapter (ACE_THR_FUNC user_func,
, selector
, handler
#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , cancel_flags
)
, thr_mgr_ (tm)
{
@@ -105,6 +107,9 @@ ACE_Thread_Adapter::invoke_i (void)
ACE_OS_Thread_Descriptor *thr_desc = this->thr_desc_;
#endif /* ACE_WIN32 && ACE_HAS_MFC && (ACE_HAS_MFC != 0) */
+ // Pick up the cancel-related flags before deleting this.
+ long cancel_flags = this->flags_;
+
// Delete ourselves since we don't need <this> anymore. Make sure
// not to access <this> anywhere below this point.
delete this;
@@ -125,6 +130,17 @@ ACE_Thread_Adapter::invoke_i (void)
ACE_OS::thr_setprio (prio);
#endif /* ACE_NEEDS_LWP_PRIO_SET */
+ if (cancel_flags != 0)
+ {
+ // If both flags are set, ignore this.
+ int old = 0;
+ int val = cancel_flags & (THR_CANCEL_ENABLE | THR_CANCEL_DISABLE);
+ if (val == THR_CANCEL_ENABLE || val == THR_CANCEL_DISABLE)
+ ACE_OS::thr_setcancelstate (val, &old);
+ val = cancel_flags & (THR_CANCEL_DEFERRED | THR_CANCEL_ASYNCHRONOUS);
+ if (val == THR_CANCEL_DEFERRED || val == THR_CANCEL_ASYNCHRONOUS)
+ ACE_OS::thr_setcanceltype (val, &old);
+ }
ACE_THR_FUNC_RETURN status = 0;
diff --git a/dep/acelite/ace/Thread_Adapter.h b/dep/acelite/ace/Thread_Adapter.h
index d7ab4056de4..6880e2cb2cd 100644
--- a/dep/acelite/ace/Thread_Adapter.h
+++ b/dep/acelite/ace/Thread_Adapter.h
@@ -4,7 +4,7 @@
/**
* @file Thread_Adapter.h
*
- * $Id: Thread_Adapter.h 92060 2010-09-27 18:08:48Z johnnyw $
+ * $Id: Thread_Adapter.h 92682 2010-11-23 23:41:19Z shuston $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
@@ -56,6 +56,7 @@ public:
, ACE_SEH_EXCEPT_HANDLER selector = 0,
ACE_SEH_EXCEPT_HANDLER handler = 0
# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+ , long cancel_flags = 0
);
/**
diff --git a/dep/acelite/ace/Thread_Control.cpp b/dep/acelite/ace/Thread_Control.cpp
index 2f38849e339..4046c07eef7 100644
--- a/dep/acelite/ace/Thread_Control.cpp
+++ b/dep/acelite/ace/Thread_Control.cpp
@@ -1,4 +1,4 @@
-// $Id: Thread_Control.cpp 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: Thread_Control.cpp 94054 2011-05-11 18:28:20Z johnnyw $
#include "ace/Thread_Control.h"
#include "ace/Thread_Manager.h"
@@ -18,7 +18,7 @@ ACE_Thread_Control::dump (void) const
}
int
-ACE_Thread_Control::insert (ACE_Thread_Manager *tm, int insert)
+ACE_Thread_Control::insert (ACE_Thread_Manager *tm, bool insert)
{
ACE_OS_TRACE ("ACE_Thread_Control::insert");
@@ -33,7 +33,6 @@ ACE_Thread_Control::insert (ACE_Thread_Manager *tm, int insert)
}
// Initialize the thread controller.
-
ACE_Thread_Control::ACE_Thread_Control (ACE_Thread_Manager *t,
int insert)
: tm_ (t),
@@ -50,7 +49,6 @@ ACE_Thread_Control::ACE_Thread_Control (ACE_Thread_Manager *t,
}
// Automatically kill thread on exit.
-
ACE_Thread_Control::~ACE_Thread_Control (void)
{
ACE_OS_TRACE ("ACE_Thread_Control::~ACE_Thread_Control");
@@ -63,7 +61,6 @@ ACE_Thread_Control::~ACE_Thread_Control (void)
}
// Exit from thread (but clean up first).
-
ACE_THR_FUNC_RETURN
ACE_Thread_Control::exit (ACE_THR_FUNC_RETURN exit_status, int do_thr_exit)
{
diff --git a/dep/acelite/ace/Thread_Control.h b/dep/acelite/ace/Thread_Control.h
index 3eb5185c84c..392eb7a62e0 100644
--- a/dep/acelite/ace/Thread_Control.h
+++ b/dep/acelite/ace/Thread_Control.h
@@ -4,13 +4,12 @@
/**
* @file Thread_Control.h
*
- * $Id: Thread_Control.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Thread_Control.h 94054 2011-05-11 18:28:20Z johnnyw $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
//=============================================================================
-
#ifndef ACE_THREAD_CONTROL_H
#define ACE_THREAD_CONTROL_H
#include /**/ "ace/pre.h"
@@ -48,7 +47,7 @@ public:
ACE_Thread_Control (ACE_Thread_Manager *tm = 0,
int insert = 0);
- /// Remove the thread from its associated <Thread_Manager> and exit
+ /// Remove the thread from its associated Thread_Manager and exit
/// the thread if <do_thr_exit> is enabled.
~ACE_Thread_Control (void);
@@ -57,15 +56,15 @@ public:
ACE_THR_FUNC_RETURN exit (ACE_THR_FUNC_RETURN status,
int do_thr_exit);
- /// Store the <Thread_Manager> and use it to register ourselves for
+ /// Store the Thread_Manager and use it to register ourselves for
/// correct shutdown.
- int insert (ACE_Thread_Manager *tm, int insert = 0);
+ int insert (ACE_Thread_Manager *tm, bool insert = false);
- /// Returns the current <Thread_Manager>.
+ /// Returns the current Thread_Manager.
ACE_Thread_Manager *thr_mgr (void);
- /// Atomically set a new <Thread_Manager> and return the old
- /// <Thread_Manager>.
+ /// Atomically set a new Thread_Manager and return the old
+ /// Thread_Manager.
ACE_Thread_Manager *thr_mgr (ACE_Thread_Manager *);
/// Set the exit status (and return existing status).
diff --git a/dep/acelite/ace/Thread_Exit.cpp b/dep/acelite/ace/Thread_Exit.cpp
index b85d48d1701..8f6484093ad 100644
--- a/dep/acelite/ace/Thread_Exit.cpp
+++ b/dep/acelite/ace/Thread_Exit.cpp
@@ -1,12 +1,10 @@
-// $Id: Thread_Exit.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Thread_Exit.cpp 92580 2010-11-15 09:48:02Z johnnyw $
#include "ace/Thread_Exit.h"
#include "ace/Managed_Object.h"
#include "ace/Thread_Manager.h"
#include "ace/Guard_T.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
bool ACE_Thread_Exit::is_constructed_ = false;
diff --git a/dep/acelite/ace/Thread_Hook.cpp b/dep/acelite/ace/Thread_Hook.cpp
index 1121e4b44ae..03b2fd74cdb 100644
--- a/dep/acelite/ace/Thread_Hook.cpp
+++ b/dep/acelite/ace/Thread_Hook.cpp
@@ -1,10 +1,8 @@
-// $Id: Thread_Hook.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Thread_Hook.cpp 94054 2011-05-11 18:28:20Z johnnyw $
#include "ace/Thread_Hook.h"
#include "ace/Object_Manager_Base.h"
-
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Thread_Hook::~ACE_Thread_Hook ()
@@ -12,8 +10,7 @@ ACE_Thread_Hook::~ACE_Thread_Hook ()
}
ACE_THR_FUNC_RETURN
-ACE_Thread_Hook::start (ACE_THR_FUNC func,
- void *arg)
+ACE_Thread_Hook::start (ACE_THR_FUNC func, void *arg)
{
return (func) (arg);
}
diff --git a/dep/acelite/ace/Thread_Hook.h b/dep/acelite/ace/Thread_Hook.h
index 7bc3bcce492..df0d0293cc4 100644
--- a/dep/acelite/ace/Thread_Hook.h
+++ b/dep/acelite/ace/Thread_Hook.h
@@ -4,13 +4,12 @@
/**
* @file Thread_Hook.h
*
- * $Id: Thread_Hook.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Thread_Hook.h 94054 2011-05-11 18:28:20Z johnnyw $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
//=============================================================================
-
#ifndef ACE_THREAD_HOOK_H
#define ACE_THREAD_HOOK_H
#include /**/ "ace/pre.h"
@@ -34,9 +33,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
*/
class ACE_Export ACE_Thread_Hook
{
-
public:
-
/// Destructor.
virtual ~ACE_Thread_Hook (void);
@@ -51,7 +48,7 @@ public:
virtual ACE_THR_FUNC_RETURN start (ACE_THR_FUNC func,
void *arg);
- /// sets the system wide thread hook, returns the previous thread
+ /// Sets the system wide thread hook, returns the previous thread
/// hook or 0 if none is set.
static ACE_Thread_Hook *thread_hook (ACE_Thread_Hook *hook);
diff --git a/dep/acelite/ace/Thread_Manager.cpp b/dep/acelite/ace/Thread_Manager.cpp
index 587636b6776..f26c7adbde9 100644
--- a/dep/acelite/ace/Thread_Manager.cpp
+++ b/dep/acelite/ace/Thread_Manager.cpp
@@ -1,4 +1,4 @@
-// $Id: Thread_Manager.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: Thread_Manager.cpp 96067 2012-08-16 13:45:10Z mcorino $
#include "ace/TSS_T.h"
#include "ace/Thread_Manager.h"
@@ -188,9 +188,16 @@ ACE_Thread_Descriptor::terminate ()
}
#endif /* !ACE_HAS_VXTHREADS */
- // Remove thread descriptor from the table.
+ // Remove thread descriptor from the table. 'this' is invalid
+ // upon return.
if (this->tm_ != 0)
- tm_->remove_thr (this, close_handle);
+ {
+ // remove_thr makes use of 'this' invalid on return.
+ // Code below will free log_msg, so clear our pointer
+ // now - it's already been saved in log_msg.
+ this->log_msg_ = 0;
+ tm_->remove_thr (this, close_handle);
+ }
}
// Check if we need delete ACE_Log_Msg instance
@@ -203,9 +210,6 @@ ACE_Thread_Descriptor::terminate ()
}
else
{
- // Thread_Descriptor is the owner of the Log_Msg instance!!
- // deleted.
- this->log_msg_ = 0;
delete log_msg;
}
}
@@ -257,6 +261,7 @@ ACE_Thread_Descriptor::dump (void) const
ACE_Thread_Descriptor::ACE_Thread_Descriptor (void)
: log_msg_ (0),
at_exit_list_ (0),
+ tm_ (0),
terminated_ (false)
{
ACE_TRACE ("ACE_Thread_Descriptor::ACE_Thread_Descriptor");
@@ -369,6 +374,25 @@ ACE_Thread_Manager::ACE_Thread_Manager (size_t prealloc,
ACE_TRACE ("ACE_Thread_Manager::ACE_Thread_Manager");
}
+ACE_Thread_Manager::ACE_Thread_Manager (const ACE_Condition_Attributes &attributes,
+ size_t prealloc,
+ size_t lwm,
+ size_t inc,
+ size_t hwm)
+ : grp_id_ (1),
+ automatic_wait_ (1)
+#if defined (ACE_HAS_THREADS)
+ , zero_cond_ (lock_, attributes)
+#endif /* ACE_HAS_THREADS */
+ , thread_desc_freelist_ (ACE_FREE_LIST_WITH_POOL,
+ prealloc, lwm, hwm, inc)
+{
+#if !defined (ACE_HAS_THREADS)
+ ACE_UNUSED_ARG (attributes);
+#endif /* ACE_HAS_THREADS */
+ ACE_TRACE ("ACE_Thread_Manager::ACE_Thread_Manager");
+}
+
#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS)
ACE_Thread_Manager *
ACE_Thread_Manager::instance (void)
@@ -525,10 +549,11 @@ ace_thread_manager_adapter (void *args)
exit_hook.thr_mgr (thread_args->thr_mgr ());
// Invoke the user-supplied function with the args.
- void *status = thread_args->invoke ();
+ ACE_THR_FUNC_RETURN status = thread_args->invoke ();
delete static_cast<ACE_Base_Thread_Adapter *> (thread_args);
- return status;
+
+ return reinterpret_cast<void *> (status);
}
#endif
@@ -571,7 +596,8 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func,
this,
new_thr_desc.get (),
ACE_OS_Object_Manager::seh_except_selector(),
- ACE_OS_Object_Manager::seh_except_handler()),
+ ACE_OS_Object_Manager::seh_except_handler(),
+ flags),
-1);
# else
ACE_NEW_RETURN (thread_args,
@@ -579,7 +605,8 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func,
args,
(ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME,
this,
- new_thr_desc.get ()),
+ new_thr_desc.get (),
+ flags),
-1);
# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
auto_ptr <ACE_Base_Thread_Adapter> auto_thread_args (static_cast<ACE_Base_Thread_Adapter *> (thread_args));
@@ -1600,13 +1627,16 @@ ACE_Thread_Manager::wait (const ACE_Time_Value *timeout,
{
ACE_TRACE ("ACE_Thread_Manager::wait");
- ACE_Time_Value local_timeout;
+ ACE_Auto_Ptr<ACE_Time_Value> local_timeout;
// Check to see if we're using absolute time or not.
if (use_absolute_time == false && timeout != 0)
{
- local_timeout = *timeout;
- local_timeout += ACE_OS::gettimeofday ();
- timeout = &local_timeout;
+ // create time value duplicate (preserves time policy)
+ local_timeout.reset (timeout->duplicate ());
+ // convert time value to absolute time
+ (*local_timeout) = local_timeout->to_absolute_time ();
+ // replace original time by abs time duplicate
+ timeout = local_timeout.get ();
}
#if !defined (ACE_HAS_VXTHREADS)
diff --git a/dep/acelite/ace/Thread_Manager.h b/dep/acelite/ace/Thread_Manager.h
index 650287277d7..59d81fd1981 100644
--- a/dep/acelite/ace/Thread_Manager.h
+++ b/dep/acelite/ace/Thread_Manager.h
@@ -4,7 +4,7 @@
/**
* @file Thread_Manager.h
*
- * $Id: Thread_Manager.h 83956 2008-12-03 07:57:38Z johnnyw $
+ * $Id: Thread_Manager.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -174,7 +174,7 @@ class ACE_Export ACE_Thread_Descriptor_Base : public ACE_OS_Thread_Descriptor
friend class ACE_Double_Linked_List_Iterator<ACE_Thread_Descriptor>;
public:
ACE_Thread_Descriptor_Base (void);
- ~ACE_Thread_Descriptor_Base (void);
+ virtual ~ACE_Thread_Descriptor_Base (void);
// = We need the following operators to make Borland happy.
@@ -437,6 +437,11 @@ public:
size_t lwm = ACE_DEFAULT_THREAD_MANAGER_LWM,
size_t inc = ACE_DEFAULT_THREAD_MANAGER_INC,
size_t hwm = ACE_DEFAULT_THREAD_MANAGER_HWM);
+ ACE_Thread_Manager (const ACE_Condition_Attributes &attributes,
+ size_t preaolloc = ACE_DEFAULT_THREAD_MANAGER_PREALLOC,
+ size_t lwm = ACE_DEFAULT_THREAD_MANAGER_LWM,
+ size_t inc = ACE_DEFAULT_THREAD_MANAGER_INC,
+ size_t hwm = ACE_DEFAULT_THREAD_MANAGER_HWM);
~ACE_Thread_Manager (void);
#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS)
diff --git a/dep/acelite/ace/Thread_Mutex.h b/dep/acelite/ace/Thread_Mutex.h
index 7bda270e5d3..71fff2db17b 100644
--- a/dep/acelite/ace/Thread_Mutex.h
+++ b/dep/acelite/ace/Thread_Mutex.h
@@ -4,7 +4,7 @@
/**
* @file Thread_Mutex.h
*
- * $Id: Thread_Mutex.h 92060 2010-09-27 18:08:48Z johnnyw $
+ * $Id: Thread_Mutex.h 96061 2012-08-16 09:36:07Z mcorino $
*
* Moved from Synch.h.
*
@@ -49,7 +49,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
*/
class ACE_Export ACE_Thread_Mutex
{
- friend class ACE_Condition_Thread_Mutex;
public:
/// Constructor.
ACE_Thread_Mutex (const ACE_TCHAR *name = 0,
diff --git a/dep/acelite/ace/Thread_Semaphore.h b/dep/acelite/ace/Thread_Semaphore.h
index d7013d9c3f2..c9843a919ad 100644
--- a/dep/acelite/ace/Thread_Semaphore.h
+++ b/dep/acelite/ace/Thread_Semaphore.h
@@ -4,7 +4,7 @@
/**
* @file Thread_Semaphore.h
*
- * $Id: Thread_Semaphore.h 86731 2009-09-17 12:23:48Z johnnyw $
+ * $Id: Thread_Semaphore.h 95807 2012-06-01 12:44:19Z johnnyw $
*
* Moved from Synch.h.
*
@@ -47,7 +47,7 @@ public:
void * = 0,
int max = 0x7FFFFFFF);
- /// Default dtor.
+ /// Default destructor.
~ACE_Thread_Semaphore (void);
/// Dump the state of an object.
diff --git a/dep/acelite/ace/Throughput_Stats.cpp b/dep/acelite/ace/Throughput_Stats.cpp
index 87a63c715ef..f8e27fba837 100644
--- a/dep/acelite/ace/Throughput_Stats.cpp
+++ b/dep/acelite/ace/Throughput_Stats.cpp
@@ -1,4 +1,4 @@
-// $Id: Throughput_Stats.cpp 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: Throughput_Stats.cpp 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/Throughput_Stats.h"
@@ -25,10 +25,6 @@ ACE_Throughput_Stats::sample (ACE_UINT64 throughput,
if (this->samples_count () == 1u)
{
- this->throughput_last_ = throughput;
- }
- else
- {
this->throughput_last_ = throughput;
}
}
@@ -53,7 +49,7 @@ ACE_Throughput_Stats::accumulate (const ACE_Throughput_Stats &rhs)
void
ACE_Throughput_Stats::dump_results (const ACE_TCHAR* msg,
- ACE_UINT32 sf)
+ ACE_Basic_Stats::scale_factor_type sf)
{
if (this->samples_count () == 0u)
{
@@ -71,20 +67,13 @@ ACE_Throughput_Stats::dump_results (const ACE_TCHAR* msg,
void
ACE_Throughput_Stats::dump_throughput (const ACE_TCHAR *msg,
- ACE_UINT32 sf,
+ ACE_Basic_Stats::scale_factor_type sf,
ACE_UINT64 elapsed_time,
ACE_UINT32 samples_count)
{
#ifndef ACE_NLOGGING
double seconds =
-# if defined ACE_LACKS_LONGLONG_T
- elapsed_time / sf;
-#elif defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER (
- ACE_U_LongLong(elapsed_time / sf)));
-# else /* ! ACE_LACKS_LONGLONG_T */
static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER (elapsed_time / sf));
-# endif /* ! ACE_LACKS_LONGLONG_T */
seconds /= ACE_HR_SCALE_CONVERSION;
const double t_avg = samples_count / seconds;
diff --git a/dep/acelite/ace/Throughput_Stats.h b/dep/acelite/ace/Throughput_Stats.h
index f9a97122aae..0911e8d4b8d 100644
--- a/dep/acelite/ace/Throughput_Stats.h
+++ b/dep/acelite/ace/Throughput_Stats.h
@@ -4,7 +4,7 @@
/**
* @file Throughput_Stats.h
*
- * $Id: Throughput_Stats.h 92069 2010-09-28 11:38:59Z johnnyw $
+ * $Id: Throughput_Stats.h 95743 2012-05-13 12:29:28Z johnnyw $
*
* @author David L. Levine
*/
@@ -55,11 +55,11 @@ public:
void accumulate (const ACE_Throughput_Stats &throughput);
/// Print down the stats
- void dump_results (const ACE_TCHAR* msg, ACE_UINT32 scale_factor);
+ void dump_results (const ACE_TCHAR* msg, scale_factor_type scale_factor);
/// Dump the average throughput stats.
static void dump_throughput (const ACE_TCHAR *msg,
- ACE_UINT32 scale_factor,
+ scale_factor_type scale_factor,
ACE_UINT64 elapsed_time,
ACE_UINT32 samples_count);
private:
diff --git a/dep/acelite/ace/Time_Policy.cpp b/dep/acelite/ace/Time_Policy.cpp
new file mode 100644
index 00000000000..c44daa7fe96
--- /dev/null
+++ b/dep/acelite/ace/Time_Policy.cpp
@@ -0,0 +1,34 @@
+// $Id: Time_Policy.cpp 96061 2012-08-16 09:36:07Z mcorino $
+
+#include "ace/Time_Policy.h"
+
+#if !defined(__ACE_INLINE__)
+# include "ace/Time_Policy.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Dynamic_Time_Policy_Base::~ACE_Dynamic_Time_Policy_Base ()
+{
+}
+
+
+class NULL_Time_Policy : public ACE_Dynamic_Time_Policy_Base
+{
+protected:
+ virtual ACE_Time_Value_T<ACE_Delegating_Time_Policy> gettimeofday () const;
+};
+
+ACE_Time_Value_T<ACE_Delegating_Time_Policy> NULL_Time_Policy::gettimeofday () const
+{
+ return ACE_Time_Value_T<ACE_Delegating_Time_Policy> (ACE_Time_Value::zero);
+}
+
+static NULL_Time_Policy null_policy_;
+
+ACE_Delegating_Time_Policy::ACE_Delegating_Time_Policy (ACE_Dynamic_Time_Policy_Base const * delegate)
+ : delegate_ (delegate != 0 ? delegate : &null_policy_)
+{
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Time_Policy.h b/dep/acelite/ace/Time_Policy.h
new file mode 100644
index 00000000000..a94dd9591c7
--- /dev/null
+++ b/dep/acelite/ace/Time_Policy.h
@@ -0,0 +1,172 @@
+#ifndef ACE_TIME_POLICY_H
+#define ACE_TIME_POLICY_H
+// -*- C++ -*-
+/**
+ * @file Time_Policy.h
+ *
+ * $Id: Time_Policy.h 96061 2012-08-16 09:36:07Z mcorino $
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ * @author Martin Corino <mcorino@remedy.nl>
+ */
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#include /**/ "ace/Time_Value_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_System_Time_Policy
+ *
+ * @brief Implement the system time policy for ACE.
+ *
+ * The most common time policy is to simply use
+ * ACE_OS::gettimeofday(), this class implements that policy, i.e., it
+ * simply calls that function.
+ */
+class ACE_Export ACE_System_Time_Policy
+{
+public:
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_System_Time_Policy> operator() () const;
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+};
+
+/**
+ * @class ACE_HR_Time_Policy
+ *
+ * @brief Implement a time policy based on the ACE Highres timer.
+ *
+ */
+class ACE_Export ACE_HR_Time_Policy
+{
+public:
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_HR_Time_Policy> operator() () const;
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+};
+
+/**
+ * @class ACE_FPointer_Timer_Policy
+ *
+ * @brief Implement a time policy based on a function pointer.
+ *
+ * This time policy allows dynamic changes to the source of time by
+ * using a function pointer.
+ */
+class ACE_Export ACE_FPointer_Time_Policy
+{
+public:
+ /**
+ * @brief Default constructor uses ACE_OS::gettimeofday()
+ *
+ * ACE_T requires a default constructor that leaves the
+ * policy in a functional state. Therefore, a null pointer would
+ * not be desirable, in other words, we need a non-trivial default
+ * constructor.
+ */
+ ACE_FPointer_Time_Policy();
+
+ /**
+ * @typedef FPtr
+ *
+ * Short-hand for the right type of pointer to function.
+ */
+ typedef ACE_Time_Value (*FPtr)();
+
+ /**
+ * @brief Constructor from a pointer to function.
+ *
+ * Construct from a pointer to function.
+ */
+ ACE_FPointer_Time_Policy(FPtr f);
+
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_FPointer_Time_Policy> operator()() const;
+
+ /// Satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+private:
+ FPtr function_;
+};
+
+class ACE_Dynamic_Time_Policy_Base; // forward decl
+
+/**
+ * @class ACE_Delegating_Time_Policy
+ *
+ * @brief Implement a time policy that delegates to a dynamic
+ * time policy.
+ */
+class ACE_Export ACE_Delegating_Time_Policy
+{
+public:
+ ACE_Delegating_Time_Policy (ACE_Dynamic_Time_Policy_Base const * delegate = 0);
+
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_Delegating_Time_Policy> operator()() const;
+
+ /// Set delegate
+ void set_delegate (ACE_Dynamic_Time_Policy_Base const * delegate);
+
+ /// Copy policy
+ ACE_Delegating_Time_Policy& operator =(ACE_Delegating_Time_Policy const & pol);
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+private:
+ ACE_Dynamic_Time_Policy_Base const * delegate_;
+};
+
+/**
+ * @class ACE_Dynamic_Time_Policy_base
+ *
+ * @brief Abstract base class for dynamically loaded and/or shared
+ * time policies.
+ *
+ */
+class ACE_Export ACE_Dynamic_Time_Policy_Base
+{
+public:
+ virtual ~ACE_Dynamic_Time_Policy_Base ();
+
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_Delegating_Time_Policy> operator()() const;
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+protected:
+ /// Return the current time according to policy implementation.
+ virtual ACE_Time_Value_T<ACE_Delegating_Time_Policy> gettimeofday () const = 0;
+};
+
+/// Temporarily, for backwards compatibility reasons, this will
+/// be the default time policy. In time to be replaced by
+/// ACE_System_Time_Policy.
+typedef ACE_FPointer_Time_Policy ACE_Default_Time_Policy;
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class ACE_Export ACE_Time_Value_T<ACE_System_Time_Policy>;
+template class ACE_Export ACE_Time_Value_T<ACE_HR_Time_Policy>;
+template class ACE_Export ACE_Time_Value_T<ACE_FPointer_Time_Policy>;
+template class ACE_Export ACE_Time_Value_T<ACE_Delegating_Time_Policy>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/Time_Policy.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_TIME_POLICY_H */
diff --git a/dep/acelite/ace/Time_Policy.inl b/dep/acelite/ace/Time_Policy.inl
new file mode 100644
index 00000000000..b59a0f675d2
--- /dev/null
+++ b/dep/acelite/ace/Time_Policy.inl
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+//
+// $Id: Time_Policy.inl 96061 2012-08-16 09:36:07Z mcorino $
+
+#include "ace/OS_NS_sys_time.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE ACE_Time_Value_T<ACE_System_Time_Policy>
+ACE_System_Time_Policy::operator()() const
+{
+ return ACE_Time_Value_T<ACE_System_Time_Policy> (ACE_OS::gettimeofday());
+}
+
+ACE_INLINE void
+ACE_System_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+ACE_INLINE ACE_Time_Value_T<ACE_HR_Time_Policy>
+ACE_HR_Time_Policy::operator()() const
+{
+ return ACE_Time_Value_T<ACE_HR_Time_Policy> (ACE_High_Res_Timer::gettimeofday_hr ());
+}
+
+ACE_INLINE void
+ACE_HR_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+ACE_INLINE
+ACE_FPointer_Time_Policy::ACE_FPointer_Time_Policy()
+ : function_(ACE_OS::gettimeofday)
+{
+}
+
+ACE_INLINE
+ACE_FPointer_Time_Policy::
+ACE_FPointer_Time_Policy(ACE_FPointer_Time_Policy::FPtr f)
+ : function_(f)
+{
+}
+
+ACE_INLINE ACE_Time_Value_T<ACE_FPointer_Time_Policy>
+ACE_FPointer_Time_Policy::operator()() const
+{
+ return ACE_Time_Value_T<ACE_FPointer_Time_Policy> ((*this->function_)(), *this);
+}
+
+ACE_INLINE void
+ACE_FPointer_Time_Policy::set_gettimeofday (ACE_Time_Value (*f)(void))
+{
+ this->function_ = f;
+}
+
+ACE_INLINE ACE_Time_Value_T<ACE_Delegating_Time_Policy>
+ACE_Dynamic_Time_Policy_Base::operator()() const
+{
+ return this->gettimeofday ();
+}
+
+ACE_INLINE void
+ACE_Dynamic_Time_Policy_Base::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+ACE_INLINE ACE_Time_Value_T<ACE_Delegating_Time_Policy>
+ACE_Delegating_Time_Policy::operator()() const
+{
+ return (*this->delegate_) ();
+}
+
+ACE_INLINE void
+ACE_Delegating_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+ACE_INLINE void
+ACE_Delegating_Time_Policy::set_delegate (ACE_Dynamic_Time_Policy_Base const * delegate)
+{
+ if (delegate != 0)
+ {
+ this->delegate_ = delegate;
+ }
+}
+
+ACE_INLINE ACE_Delegating_Time_Policy&
+ACE_Delegating_Time_Policy::operator =(ACE_Delegating_Time_Policy const & pol)
+{
+ this->delegate_ = pol.delegate_;
+ return *this;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Time_Policy_T.cpp b/dep/acelite/ace/Time_Policy_T.cpp
new file mode 100644
index 00000000000..6845131aa21
--- /dev/null
+++ b/dep/acelite/ace/Time_Policy_T.cpp
@@ -0,0 +1,27 @@
+// $Id: Time_Policy_T.cpp 96061 2012-08-16 09:36:07Z mcorino $
+
+#ifndef ACE_TIME_POLICY_T_CPP
+#define ACE_TIME_POLICY_T_CPP
+
+#include "ace/Time_Policy_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Time_Policy_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename TIME_POLICY>
+ACE_Time_Policy_T<TIME_POLICY>::~ACE_Time_Policy_T ()
+{
+}
+
+template <typename TIME_POLICY> ACE_Time_Value_T<ACE_Delegating_Time_Policy>
+ACE_Time_Policy_T<TIME_POLICY>::gettimeofday () const
+{
+ return ACE_Time_Value_T<ACE_Delegating_Time_Policy> (this->time_policy_ (), ACE_Delegating_Time_Policy (this));
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_TIME_POLICY_T_CPP */
diff --git a/dep/acelite/ace/Time_Policy_T.h b/dep/acelite/ace/Time_Policy_T.h
new file mode 100644
index 00000000000..bde0c5c45bc
--- /dev/null
+++ b/dep/acelite/ace/Time_Policy_T.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Time_Policy_T.h
+ *
+ * $Id: Time_Policy_T.h 96061 2012-08-16 09:36:07Z mcorino $
+ *
+ * @author Martin Corino <mcorino@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef ACE_TIME_POLICY_T_H
+#define ACE_TIME_POLICY_T_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Time_Policy.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Time_Policy_T
+ *
+ * @brief Template class implementing a dynamic time policy based on
+ * another time policy
+ *
+ */
+template <typename TIME_POLICY>
+class ACE_Time_Policy_T : public ACE_Dynamic_Time_Policy_Base
+{
+public:
+ ACE_Time_Policy_T (TIME_POLICY const & time_policy = TIME_POLICY());
+ virtual ~ACE_Time_Policy_T ();
+
+ /// Return the current time according to this policy
+ ACE_Time_Value_T<ACE_Delegating_Time_Policy> operator()() const;
+
+ /// Allows applications to control how the timer queue gets the time
+ /// of day.
+ void set_time_policy(TIME_POLICY const & time_policy);
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+protected:
+ /// Return the current time according to policy implementation.
+ virtual ACE_Time_Value_T<ACE_Delegating_Time_Policy> gettimeofday () const;
+
+private:
+ /// The policy to return the current time of day
+ TIME_POLICY time_policy_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#if defined (__ACE_INLINE__)
+#include "ace/Time_Policy_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "ace/Time_Policy_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Time_Policy_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+
+#endif /* ACE_TIME_POLICY_T_H */
diff --git a/dep/acelite/ace/Time_Policy_T.inl b/dep/acelite/ace/Time_Policy_T.inl
new file mode 100644
index 00000000000..23a07813a6c
--- /dev/null
+++ b/dep/acelite/ace/Time_Policy_T.inl
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// $Id: Time_Policy_T.inl 96066 2012-08-16 12:45:46Z mcorino $
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename TIME_POLICY>
+ACE_INLINE
+ACE_Time_Policy_T<TIME_POLICY>::ACE_Time_Policy_T (TIME_POLICY const & time_policy)
+ : time_policy_ (time_policy)
+{
+}
+
+template <typename TIME_POLICY>
+ACE_INLINE ACE_Time_Value_T<ACE_Delegating_Time_Policy>
+ACE_Time_Policy_T<TIME_POLICY>::operator() () const
+{
+ return this->gettimeofday ();
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
+ACE_Time_Policy_T<TIME_POLICY>::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
+ACE_Time_Policy_T<TIME_POLICY>::set_time_policy(TIME_POLICY const & time_policy)
+{
+ this->time_policy_ = time_policy;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Time_Value.cpp b/dep/acelite/ace/Time_Value.cpp
index 045df4d4e66..0b13cdedac9 100644
--- a/dep/acelite/ace/Time_Value.cpp
+++ b/dep/acelite/ace/Time_Value.cpp
@@ -1,4 +1,4 @@
-// $Id: Time_Value.cpp 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: Time_Value.cpp 96061 2012-08-16 09:36:07Z mcorino $
#include "ace/Time_Value.h"
@@ -9,6 +9,7 @@
#include "ace/Numeric_Limits.h"
#include "ace/If_Then_Else.h"
#include "ace/OS_NS_math.h"
+#include "ace/Time_Policy.h"
#ifdef ACE_HAS_CPP98_IOSTREAMS
#include <ostream>
@@ -33,6 +34,9 @@ const ACE_Time_Value ACE_Time_Value::max_time (
ACE_ALLOC_HOOK_DEFINE (ACE_Time_Value)
+ACE_Time_Value::~ACE_Time_Value()
+{}
+
/// Increment microseconds (the only reason this is here is to allow
/// the use of ACE_Atomic_Op with ACE_Time_Value).
ACE_Time_Value
@@ -81,13 +85,8 @@ ACE_Time_Value::operator -- (void)
///
/// In the beginning (Jan. 1, 1601), there was no time and no computer.
/// And Bill said: "Let there be time," and there was time....
-# if defined (ACE_LACKS_LONGLONG_T)
-const ACE_U_LongLong ACE_Time_Value::FILETIME_to_timval_skew =
-ACE_U_LongLong (0xd53e8000, 0x19db1de);
-# else
const DWORDLONG ACE_Time_Value::FILETIME_to_timval_skew =
ACE_INT64_LITERAL (0x19db1ded53e8000);
-# endif
/// Initializes the ACE_Time_Value object from a Win32 FILETIME
ACE_Time_Value::ACE_Time_Value (const FILETIME &file_time)
@@ -98,15 +97,7 @@ ACE_Time_Value::ACE_Time_Value (const FILETIME &file_time)
void ACE_Time_Value::set (const FILETIME &file_time)
{
- // Initializes the ACE_Time_Value object from a Win32 FILETIME
-#if defined (ACE_LACKS_LONGLONG_T)
- ACE_U_LongLong LL_100ns(file_time.dwLowDateTime, file_time.dwHighDateTime);
- LL_100ns -= ACE_Time_Value::FILETIME_to_timval_skew;
- // Convert 100ns units to seconds;
- this->tv_.tv_sec = (long) (LL_100ns / ((double) (10000 * 1000)));
- // Convert remainder to microseconds;
- this->tv_.tv_usec = (suseconds_t)((LL_100ns % ((ACE_UINT32)(10000 * 1000))) / 10);
-#else
+ // Initializes the ACE_Time_Value object from a Win32 FILETIME
// Don't use a struct initializer, gcc don't like it.
ULARGE_INTEGER _100ns;
_100ns.LowPart = file_time.dwLowDateTime;
@@ -115,10 +106,10 @@ void ACE_Time_Value::set (const FILETIME &file_time)
_100ns.QuadPart -= ACE_Time_Value::FILETIME_to_timval_skew;
// Convert 100ns units to seconds;
- this->tv_.tv_sec = (long) (_100ns.QuadPart / (10000 * 1000));
+ this->tv_.tv_sec = (time_t) (_100ns.QuadPart / (10000 * 1000));
// Convert remainder to microseconds;
this->tv_.tv_usec = (suseconds_t) ((_100ns.QuadPart % (10000 * 1000)) / 10);
-#endif // ACE_LACKS_LONGLONG_T
+
this->normalize ();
}
@@ -128,15 +119,6 @@ ACE_Time_Value::operator FILETIME () const
FILETIME file_time;
// ACE_OS_TRACE ("ACE_Time_Value::operator FILETIME");
-#if defined (ACE_LACKS_LONGLONG_T)
- ACE_U_LongLong LL_sec(this->tv_.tv_sec);
- ACE_U_LongLong LL_usec(this->tv_.tv_usec);
- ACE_U_LongLong LL_100ns = LL_sec * (ACE_UINT32)(10000 * 1000) +
- LL_usec * (ACE_UINT32)10 +
- ACE_Time_Value::FILETIME_to_timval_skew;
- file_time.dwLowDateTime = LL_100ns.lo();
- file_time.dwHighDateTime = LL_100ns.hi();
-#else
ULARGE_INTEGER _100ns;
_100ns.QuadPart = (((DWORDLONG) this->tv_.tv_sec * (10000 * 1000) +
this->tv_.tv_usec * 10) +
@@ -144,13 +126,40 @@ ACE_Time_Value::operator FILETIME () const
file_time.dwLowDateTime = _100ns.LowPart;
file_time.dwHighDateTime = _100ns.HighPart;
-#endif //ACE_LACKS_LONGLONG_T
return file_time;
}
-
#endif /* ACE_WIN32 */
+ACE_Time_Value
+ACE_Time_Value::now () const
+{
+ ACE_System_Time_Policy systp;
+ return systp ();
+}
+
+ACE_Time_Value
+ACE_Time_Value::to_relative_time () const
+{
+ ACE_System_Time_Policy systp;
+ return (*this) - systp ();
+}
+
+ACE_Time_Value
+ACE_Time_Value::to_absolute_time () const
+{
+ ACE_System_Time_Policy systp;
+ return (*this) + systp ();
+}
+
+ACE_Time_Value *
+ACE_Time_Value::duplicate () const
+{
+ ACE_Time_Value * tmp = 0;
+ ACE_NEW_RETURN (tmp, ACE_Time_Value (*this), 0);
+ return tmp;
+}
+
void
ACE_Time_Value::dump (void) const
{
@@ -213,13 +222,13 @@ ACE_Time_Value::normalize (bool saturate)
this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
}
// tv_sec in qnxnto is unsigned
-#if !defined ( __QNXNTO__)
+#if !defined ( __QNX__)
else if (this->tv_.tv_sec < 0 && this->tv_.tv_usec > 0)
{
++this->tv_.tv_sec;
this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS;
}
-#endif /* __QNXNTO__ */
+#endif /* __QNX__ */
}
diff --git a/dep/acelite/ace/Time_Value.h b/dep/acelite/ace/Time_Value.h
index f92c8c7f7f5..522b1e0b0ae 100644
--- a/dep/acelite/ace/Time_Value.h
+++ b/dep/acelite/ace/Time_Value.h
@@ -4,7 +4,7 @@
/**
* @file Time_Value.h
*
- * $Id: Time_Value.h 90683 2010-06-17 22:07:42Z shuston $
+ * $Id: Time_Value.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -35,17 +35,7 @@ suseconds_t const ACE_ONE_SECOND_IN_USECS = 1000000;
// needed to determine if iostreams are present
#include "ace/iosfwd.h"
-// This forward declaration is needed by the set() and FILETIME() functions
-#if defined (ACE_LACKS_LONGLONG_T)
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-class ACE_Export ACE_U_LongLong;
-ACE_END_VERSIONED_NAMESPACE_DECL
-#endif /* ACE_LACKS_LONGLONG_T */
-
-// -------------------------------------------------------------------
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
/**
* @class ACE_Time_Value
@@ -90,6 +80,9 @@ public:
/// Construct the ACE_Time_Value object from a timespec_t.
explicit ACE_Time_Value (const timespec_t &t);
+ /// Destructor
+ virtual ~ACE_Time_Value ();
+
# if defined (ACE_WIN32)
/// Construct the ACE_Time_Value object from a Win32 FILETIME
explicit ACE_Time_Value (const FILETIME &ft);
@@ -250,7 +243,7 @@ public:
/// Subtract @a tv to this.
ACE_Time_Value &operator -= (const ACE_Time_Value &tv);
- /// Substract @a tv to this.
+ /// Subtract @a tv to this.
ACE_Time_Value &operator -= (time_t tv);
/**
@@ -330,6 +323,51 @@ public:
double d);
//@}
+ /// Get current time of day.
+ /**
+ * @return Time value representing current time of day.
+ *
+ * @note This method is overloaded in the time policy based template
+ * instantiations derived from this class. Allows for time policy
+ * aware time values.
+ */
+ virtual ACE_Time_Value now () const;
+
+ /// Converts absolute time value to time value relative to current time of day.
+ /**
+ * @return Relative time value.
+ *
+ * @note This method is overloaded in the time policy based template
+ * instantiations derived from this class. Allows for time policy
+ * aware time values.
+ * The developer is responsible for making sure this is an absolute
+ * time value compatible with the active time policy (which is system
+ * time for the base class).
+ */
+ virtual ACE_Time_Value to_relative_time () const;
+
+ /// Converts relative time value to absolute time value based on current time of day.
+ /**
+ * @return Absolute time value.
+ *
+ * @note This method is overloaded in the time policy based template
+ * instantiations derived from this class. Allows for time policy
+ * aware time values.
+ * The developer is responsible for making sure this is a relative
+ * time value. Current time of day is determined based on time policy
+ * (which is system time for the base class).
+ */
+ virtual ACE_Time_Value to_absolute_time () const;
+
+ /// Duplicates this time value (incl. time policy).
+ /**
+ * @return Dynamically allocated time value copy.
+ *
+ * @note The caller is responsible for freeing the copy when it's not needed
+ * anymore.
+ */
+ virtual ACE_Time_Value * duplicate () const;
+
/// Dump is a no-op.
/**
* The dump() method is a no-op. It's here for backwards compatibility
@@ -341,11 +379,7 @@ public:
# if defined (ACE_WIN32)
/// Const time difference between FILETIME and POSIX time.
-# if defined (ACE_LACKS_LONGLONG_T)
- static const ACE_U_LongLong FILETIME_to_timval_skew;
-# else
static const DWORDLONG FILETIME_to_timval_skew;
-# endif // ACE_LACKS_LONGLONG_T
# endif /* ACE_WIN32 */
private:
diff --git a/dep/acelite/ace/Time_Value.inl b/dep/acelite/ace/Time_Value.inl
index 8f7bf23d837..c0a16c1b50c 100644
--- a/dep/acelite/ace/Time_Value.inl
+++ b/dep/acelite/ace/Time_Value.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Time_Value.inl 90689 2010-06-18 11:14:47Z shuston $
+// $Id: Time_Value.inl 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/Truncate.h"
@@ -58,23 +58,11 @@ ACE_INLINE void
ACE_Time_Value::set (time_t sec, suseconds_t usec)
{
// ACE_OS_TRACE ("ACE_Time_Value::set");
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) && defined (_MSC_VER)
- // The WinCE 6.0 SDK ships with a timeval tv_sec member that uses long as type
- // not time_t. This resolves in compilation warnings because time_t
- // can be 64bit. Disable at this momemt the warning for just this method
- // else we get a compile warnings each time this inline file is included
- // this file.
-# pragma warning (push)
-# pragma warning (disable: 4244)
-# endif
this->tv_.tv_sec = sec;
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) && defined (_MSC_VER)
-# pragma warning (pop)
-# endif
this->tv_.tv_usec = usec;
-#if __GNUC__
- if (__builtin_constant_p(sec) &&
- __builtin_constant_p(usec) &&
+#if __GNUC__ && !(__GNUC__ == 3 && __GNUC_MINOR__ == 4)
+ if ((__builtin_constant_p(sec) &
+ __builtin_constant_p(usec)) &&
(sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS))
return;
#endif
@@ -85,7 +73,7 @@ ACE_INLINE void
ACE_Time_Value::set (double d)
{
// ACE_OS_TRACE ("ACE_Time_Value::set");
- long l = (long) d;
+ time_t l = (time_t) d;
this->tv_.tv_sec = l;
this->tv_.tv_usec = (suseconds_t) ((d - (double) l) * ACE_ONE_SECOND_IN_USECS + .5);
this->normalize ();
@@ -131,7 +119,7 @@ ACE_INLINE void
ACE_Time_Value::sec (time_t sec)
{
// ACE_OS_TRACE ("ACE_Time_Value::sec");
- this->tv_.tv_sec = ACE_Utils::truncate_cast<long> (sec);
+ this->tv_.tv_sec = sec;
}
/// Converts from Time_Value format into milli-seconds format.
@@ -222,15 +210,7 @@ ACE_INLINE void
ACE_Time_Value::to_usec (ACE_UINT64 & usec) const
{
// ACE_OS_TRACE ("ACE_Time_Value::to_usec");
-
-#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- usec = ACE_U_LongLong (static_cast<long long> (this->tv_.tv_sec));
-#elif defined (ACE_LACKS_LONGLONG_T)
- // No native 64-bit type, meaning time_t is most likely 32 bits.
- usec = ACE_U_LongLong (this->tv_.tv_sec);
-#else
usec = static_cast<ACE_UINT64> (this->tv_.tv_sec);
-#endif /* ACE_LACKS_LONGLONG_T */
usec *= 1000000;
usec += this->tv_.tv_usec;
}
diff --git a/dep/acelite/ace/Time_Value_T.cpp b/dep/acelite/ace/Time_Value_T.cpp
new file mode 100644
index 00000000000..e7fdec98762
--- /dev/null
+++ b/dep/acelite/ace/Time_Value_T.cpp
@@ -0,0 +1,52 @@
+// $Id: Time_Value_T.cpp 96061 2012-08-16 09:36:07Z mcorino $
+
+#ifndef ACE_TIME_VALUE_T_CPP
+#define ACE_TIME_VALUE_T_CPP
+
+#include "ace/Time_Value_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Time_Value_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/OS_Memory.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TIME_POLICY>
+ACE_Time_Value
+ACE_Time_Value_T<TIME_POLICY>::now () const
+{
+ return this->time_policy_ ();
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value
+ACE_Time_Value_T<TIME_POLICY>::to_relative_time () const
+{
+ return (*this) - this->time_policy_ ();
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value
+ACE_Time_Value_T<TIME_POLICY>::to_absolute_time () const
+{
+ return (*this) + this->time_policy_ ();
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value *
+ACE_Time_Value_T<TIME_POLICY>::duplicate () const
+{
+ ACE_Time_Value_T<TIME_POLICY> * tmp = 0;
+ ACE_NEW_RETURN (tmp, ACE_Time_Value_T<TIME_POLICY> (*this), 0);
+ return tmp;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_TIME_VALUE_T_CPP */
diff --git a/dep/acelite/ace/Time_Value_T.h b/dep/acelite/ace/Time_Value_T.h
new file mode 100644
index 00000000000..615d5820a50
--- /dev/null
+++ b/dep/acelite/ace/Time_Value_T.h
@@ -0,0 +1,194 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Time_Value_T.h
+ *
+ * $Id: Time_Value_T.h 96061 2012-08-16 09:36:07Z mcorino $
+ *
+ * @author Martin Corino <mcorino@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef ACE_TIME_VALUE_T_H
+#define ACE_TIME_VALUE_T_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Time_Value.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Time_Value
+ *
+ * @brief Operations on "timeval" structures, which express time in
+ * seconds (secs) and microseconds (usecs).
+ *
+ * This class centralizes all the time related processing in
+ * ACE. These time values are typically used in conjunction with OS
+ * mechanisms like <select>, <poll>, or <cond_timedwait>.
+ */
+template <class TIME_POLICY>
+class ACE_Time_Value_T : public ACE_Time_Value
+{
+public:
+ typedef TIME_POLICY time_policy_t;
+
+ // = Initialization methods.
+
+ /// Default Constructor.
+ ACE_Time_Value_T (void) {}
+
+ /// Constructor.
+ explicit ACE_Time_Value_T (time_t sec, suseconds_t usec = 0)
+ : ACE_Time_Value (sec, usec) {}
+
+ // = Methods for converting to/from various time formats.
+
+ /// Construct the ACE_Time_Value from a timeval.
+ explicit ACE_Time_Value_T (const struct timeval &t)
+ : ACE_Time_Value (t) {}
+
+ /// Construct the ACE_Time_Value object from a timespec_t.
+ explicit ACE_Time_Value_T (const timespec_t &t)
+ : ACE_Time_Value (t) {}
+
+ /// Construct from ACE_Time_Value_T<TIME_POLICY>
+ ACE_Time_Value_T(const ACE_Time_Value_T<TIME_POLICY>& tv)
+ : ACE_Time_Value (tv),
+ time_policy_ (tv.time_policy_)
+ {}
+
+ /// Construct from ACE_Time_Value
+ explicit ACE_Time_Value_T(const ACE_Time_Value& tv,
+ const TIME_POLICY& tp = TIME_POLICY ())
+ : ACE_Time_Value (tv),
+ time_policy_ (tp)
+ {}
+
+ /// Destructor
+ virtual ~ACE_Time_Value_T () {}
+
+ /// Add @a tv to this.
+ ACE_Time_Value_T<TIME_POLICY> &operator += (const ACE_Time_Value &tv);
+
+ /// Add @a tv to this.
+ ACE_Time_Value_T<TIME_POLICY> &operator += (time_t tv);
+
+ /// Assign @ tv to this
+ ACE_Time_Value_T<TIME_POLICY> &operator = (const ACE_Time_Value_T<TIME_POLICY> &tv);
+
+ /// Assign @ tv to this
+ ACE_Time_Value_T<TIME_POLICY> &operator = (const ACE_Time_Value &tv);
+
+ /// Assign @ tv to this
+ ACE_Time_Value_T<TIME_POLICY> &operator = (time_t tv);
+
+ /// Subtract @a tv to this.
+ ACE_Time_Value_T<TIME_POLICY> &operator -= (const ACE_Time_Value &tv);
+
+ /// Subtract @a tv to this.
+ ACE_Time_Value_T<TIME_POLICY> &operator -= (time_t tv);
+
+ /**
+ \brief Multiply the time value by the @a d factor.
+ \note The result of the operator is valid for results from range
+ < (ACE_INT32_MIN, -999999), (ACE_INT32_MAX, 999999) >. Result
+ outside this range are saturated to a limit.
+ */
+ ACE_Time_Value_T<TIME_POLICY> &operator *= (double d);
+
+ /// Increment microseconds as postfix.
+ /**
+ * @note The only reason this is here is to allow the use of ACE_Atomic_Op
+ * with ACE_Time_Value.
+ */
+ ACE_Time_Value_T<TIME_POLICY> operator++ (int);
+
+ /// Increment microseconds as prefix.
+ /**
+ * @note The only reason this is here is to allow the use of ACE_Atomic_Op
+ * with ACE_Time_Value.
+ */
+ ACE_Time_Value_T<TIME_POLICY> &operator++ (void);
+
+ /// Decrement microseconds as postfix.
+ /**
+ * @note The only reason this is here is to allow the use of ACE_Atomic_Op
+ * with ACE_Time_Value.
+ */
+ ACE_Time_Value_T<TIME_POLICY> operator-- (int);
+
+ /// Decrement microseconds as prefix.
+ /**
+ * @note The only reason this is here is to allow the use of ACE_Atomic_Op
+ * with ACE_Time_Value.
+ */
+ ACE_Time_Value_T<TIME_POLICY> &operator-- (void);
+
+ /// Get current time of day according to time policy.
+ /**
+ * @return Time value representing current time of day according to time policy.
+ */
+ virtual ACE_Time_Value now () const;
+
+ /// Converts absolute time value to time value relative to current time of day.
+ /**
+ * @return Relative time value.
+ *
+ * @note This method uses it's time_policy_ member to get the current
+ * time of day.
+ * The developer is responsible for making sure this is an absolute
+ * time value compatible with the active time policy.
+ * Note that the returned time value has no notion of the time policy
+ * on which it is based anymore.
+ */
+ virtual ACE_Time_Value to_relative_time () const;
+
+ /// Converts relative time value to absolute time value based on current time of day.
+ /**
+ * @return Absolute time value.
+ *
+ * @note This method uses it's time_policy_ member to get the current
+ * time of day.
+ * The developer is responsible for making sure this is a relative
+ * time value.
+ * Note that the returned time value has no notion of the time policy
+ * on which it is based anymore.
+ */
+ virtual ACE_Time_Value to_absolute_time () const;
+
+ /// Duplicates this time value (incl. time policy).
+ /**
+ * @return Dynamically allocated time value copy.
+ *
+ * @note The caller is responsible for freeing the copy when it's not needed
+ * anymore.
+ */
+ virtual ACE_Time_Value * duplicate () const;
+
+private:
+ TIME_POLICY time_policy_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/Time_Value_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "ace/Time_Value_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Time_Value_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_TIME_VALUE_T_H */
diff --git a/dep/acelite/ace/Time_Value_T.inl b/dep/acelite/ace/Time_Value_T.inl
new file mode 100644
index 00000000000..e74f16b9194
--- /dev/null
+++ b/dep/acelite/ace/Time_Value_T.inl
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+//
+// $Id: Time_Value_T.inl 96061 2012-08-16 09:36:07Z mcorino $
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator += (const ACE_Time_Value &tv)
+{
+ this->ACE_Time_Value::operator +=(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator += (time_t tv)
+{
+ this->ACE_Time_Value::operator +=(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator = (const ACE_Time_Value_T<TIME_POLICY> &tv)
+{
+ this->time_policy_ = tv.time_policy_;
+ this->ACE_Time_Value::operator =(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator = (const ACE_Time_Value &tv)
+{
+ this->ACE_Time_Value::operator =(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator = (time_t tv)
+{
+ this->ACE_Time_Value::operator =(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator -= (const ACE_Time_Value &tv)
+{
+ this->ACE_Time_Value::operator -=(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator -= (time_t tv)
+{
+ this->ACE_Time_Value::operator -=(tv);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator *= (double d)
+{
+ this->ACE_Time_Value::operator *=(d);
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> ACE_Time_Value_T<TIME_POLICY>::operator++ (int)
+{
+ ACE_Time_Value_T<TIME_POLICY> tv (*this);
+ ++*this;
+ return tv;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator++ (void)
+{
+ this->ACE_Time_Value::operator ++();
+ return *this;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> ACE_Time_Value_T<TIME_POLICY>::operator-- (int)
+{
+ ACE_Time_Value_T<TIME_POLICY> tv (*this);
+ --*this;
+ return tv;
+}
+
+template <class TIME_POLICY>
+ACE_Time_Value_T<TIME_POLICY> &ACE_Time_Value_T<TIME_POLICY>::operator-- (void)
+{
+ this->ACE_Time_Value::operator --();
+ return *this;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timeprobe_T.cpp b/dep/acelite/ace/Timeprobe_T.cpp
index d23b7b8b869..f440c7edab0 100644
--- a/dep/acelite/ace/Timeprobe_T.cpp
+++ b/dep/acelite/ace/Timeprobe_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Timeprobe_T.cpp 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Timeprobe_T.cpp 95743 2012-05-13 12:29:28Z johnnyw $
#ifndef ACE_TIMEPROBE_T_CPP
#define ACE_TIMEPROBE_T_CPP
@@ -250,7 +250,8 @@ ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::print_times (void)
"thread",
"usec"));
- double gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_High_Res_Timer::global_scale_factor_type gsf =
+ ACE_High_Res_Timer::global_scale_factor ();
u_long i, j;
// First element
diff --git a/dep/acelite/ace/Timer_Hash.h b/dep/acelite/ace/Timer_Hash.h
index b381419da44..3d786a1a2d1 100644
--- a/dep/acelite/ace/Timer_Hash.h
+++ b/dep/acelite/ace/Timer_Hash.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Hash.h
*
- * $Id: Timer_Hash.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_Hash.h 95335 2011-12-15 13:13:17Z msmit $
*
* @author Darrell Brunsch <brunsch@cs.wustl.edu>
*/
@@ -16,6 +16,7 @@
#include /**/ "ace/pre.h"
#include "ace/Timer_Hash_T.h"
+#include "ace/Event_Handler_Handle_Timeout_Upcall.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -29,7 +30,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// The following typedef are here for ease of use
typedef ACE_Timer_Hash_Upcall <ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX>
ACE_Hash_Upcall;
@@ -45,26 +46,27 @@ typedef ACE_Timer_Heap_T <ACE_Event_Handler *,
typedef ACE_Timer_Hash_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX,
ACE_Hash_Timer_List>
ACE_Timer_Hash;
typedef ACE_Timer_Hash_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX,
- ACE_Hash_Timer_List>
+ ACE_Hash_Timer_List,
+ ACE_Default_Time_Policy>
ACE_Timer_Hash_Iterator;
typedef ACE_Timer_Hash_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX,
ACE_Hash_Timer_Heap>
ACE_Timer_Hash_Heap;
typedef ACE_Timer_Hash_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX,
ACE_Hash_Timer_Heap>
ACE_Timer_Hash_Heap_Iterator;
diff --git a/dep/acelite/ace/Timer_Hash_T.cpp b/dep/acelite/ace/Timer_Hash_T.cpp
index 3bc82b8a194..55bbdb86d53 100644
--- a/dep/acelite/ace/Timer_Hash_T.cpp
+++ b/dep/acelite/ace/Timer_Hash_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Timer_Hash_T.cpp 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: Timer_Hash_T.cpp 95595 2012-03-07 13:33:25Z johnnyw $
#ifndef ACE_TIMER_HASH_T_CPP
#define ACE_TIMER_HASH_T_CPP
@@ -20,8 +20,13 @@ class Hash_Token
{
public:
// This constructor is required by ACE_Locked_Free_List::alloc.
- Hash_Token (void)
- {}
+ Hash_Token (void) :
+ act_ (0),
+ pos_ (0),
+ orig_id_ (0),
+ next_ (0)
+ {
+ }
Hash_Token<TYPE> *get_next (void)
{
@@ -171,18 +176,24 @@ ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>::deletion (
return result;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_Iterator_T (ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET> &hash)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
+ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::ACE_Timer_Hash_Iterator_T (Hash & hash)
: timer_hash_ (hash)
{
this->first ();
// Nothing
}
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
+ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::~ACE_Timer_Hash_Iterator_T ()
+{
+ // Nothing
+}
+
// Positions the iterator at the first node in the timing hash table
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> void
-ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> void
+ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::first (void)
{
for (this->position_ = 0;
this->position_ < this->timer_hash_.table_size_;
@@ -204,8 +215,8 @@ ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::first (void)
// Positions the iterator at the next node in the bucket or goes to the next
// bucket
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> void
-ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::next (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> void
+ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::next (void)
{
if (this->isdone ())
return;
@@ -235,17 +246,17 @@ ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::next (void)
// Returns true when we are at the end (when bucket_item_ == 0)
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> bool
-ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::isdone (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> bool
+ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::isdone (void) const
{
return this->iter_ == 0;
}
// Returns the node at the current position in the sequence
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::item (void)
+ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::item (void)
{
if (this->isdone ())
return 0;
@@ -253,9 +264,9 @@ ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::item (void)
return this->iter_->item ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::iter (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
+ACE_Timer_Queue_Iterator_T<TYPE> &
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::iter (void)
{
this->iterator_->first ();
return *this->iterator_;
@@ -263,12 +274,13 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::iter (void)
// Create an empty queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_T (
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::ACE_Timer_Hash_T (
size_t table_size,
FUNCTOR *upcall_functor,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
- : ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> (upcall_functor, freelist),
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist,
+ TIME_POLICY const & time_policy)
+ : Base_Timer_Queue (upcall_functor, freelist, time_policy),
size_ (0),
table_size_ (table_size),
table_functor_ (this),
@@ -283,16 +295,14 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_T (
ACE_NEW (table_,
BUCKET *[table_size]);
- this->gettimeofday (ACE_OS::gettimeofday);
-
for (size_t i = 0;
i < table_size;
++i)
{
ACE_NEW (this->table_[i],
BUCKET (&this->table_functor_,
- this->free_list_));
- this->table_[i]->gettimeofday (ACE_OS::gettimeofday);
+ this->free_list_,
+ time_policy));
}
ACE_NEW (iterator_,
@@ -300,11 +310,12 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_T (
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_T (
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::ACE_Timer_Hash_T (
FUNCTOR *upcall_functor,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
- : ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> (upcall_functor, freelist),
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist,
+ TIME_POLICY const & time_policy)
+ : Base_Timer_Queue (upcall_functor, freelist, time_policy),
size_ (0),
table_size_ (ACE_DEFAULT_TIMER_HASH_TABLE_SIZE),
table_functor_ (this),
@@ -319,17 +330,14 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_T (
ACE_NEW (table_,
BUCKET *[ACE_DEFAULT_TIMER_HASH_TABLE_SIZE]);
-
- this->gettimeofday (ACE_OS::gettimeofday);
-
for (size_t i = 0;
i < this->table_size_;
++i)
{
ACE_NEW (this->table_[i],
BUCKET (&this->table_functor_,
- this->free_list_));
- this->table_[i]->gettimeofday (ACE_OS::gettimeofday);
+ this->free_list_,
+ time_policy));
}
ACE_NEW (iterator_,
@@ -338,26 +346,49 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::ACE_Timer_Hash_T (
// Remove all remaining items in the Queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::~ACE_Timer_Hash_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::~ACE_Timer_Hash_T (void)
{
ACE_TRACE ("ACE_Timer_Hash_T::~ACE_Timer_Hash_T");
ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_));
delete iterator_;
+ this->close ();
+
for (size_t i = 0;
i < this->table_size_;
++i)
delete this->table_[i];
+
delete [] this->table_;
}
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> int
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::close (void)
+{
+ ACE_TRACE ("ACE_Timer_Hash_T::close");
+ ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));
+
+ // Remove all remaining items from the queue.
+ while (!this->is_empty())
+ {
+ ACE_Timer_Node_T<TYPE>* n = this->remove_first();
+ this->upcall_functor ().deletion (*this,
+ n->get_type(),
+ n->get_act());
+ this->free_node (n);
+ }
+
+ // leave the rest to destructor
+ return 0;
+}
+
// Checks if queue is empty.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> bool
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::is_empty (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> bool
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::is_empty (void) const
{
ACE_TRACE ("ACE_Timer_Hash_T::is_empty");
return this->table_[this->earliest_position_]->is_empty ();
@@ -365,16 +396,16 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::is_empty (void) const
// Returns earliest time in a non-empty bucket
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
const ACE_Time_Value &
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::earliest_time (void) const
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::earliest_time (void) const
{
ACE_TRACE ("ACE_Timer_Hash_T::earliest_time");
return this->table_[this->earliest_position_]->earliest_time ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> void
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::dump (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> void
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Timer_Hash_T::dump");
@@ -394,9 +425,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::dump (void) const
// Reschedule a periodic timer. This function must be called with the
// mutex lock held.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
void
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::reschedule (
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::reschedule (
ACE_Timer_Node_T<TYPE> *expired)
{
ACE_TRACE ("ACE_Timer_Hash_T::reschedule");
@@ -423,7 +454,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::reschedule (
// then here schedule <expired> for deletion. Don't call
// this->free_node() because that will invalidate <h>
// and that's what user have as timer_id.
- ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK>::free_node (expired);
+ Base_Timer_Queue::free_node (expired);
if (this->table_[this->earliest_position_]->is_empty ()
|| this->table_[h->pos_]->earliest_time ()
@@ -434,9 +465,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::reschedule (
// Insert a new handler that expires at time future_time; if interval
// is > 0, the handler will be reinvoked periodically.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
long
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::schedule_i (
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::schedule_i (
const TYPE &type,
const void *act,
const ACE_Time_Value &future_time,
@@ -489,9 +520,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::schedule_i (
// Locate and update the inteval on the timer_id
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
int
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::reset_interval (
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::reset_interval (
long timer_id,
const ACE_Time_Value & interval)
{
@@ -526,9 +557,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::reset_interval (
// Locate and remove the single <ACE_Event_Handler> with a value of
// @a timer_id from the correct table timer queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
int
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (long timer_id,
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::cancel (long timer_id,
const void **act,
int dont_call)
{
@@ -596,9 +627,9 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (long timer_id,
// Locate and remove all values of <type> from the timer queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
int
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (const TYPE &type,
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::cancel (const TYPE &type,
int dont_call)
{
ACE_TRACE ("ACE_Timer_Hash_T::cancel");
@@ -618,9 +649,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (const TYPE &type,
i < this->table_size_;
++i)
{
- ACE_Timer_Queue_Iterator_T<TYPE,
- ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>,
- ACE_Null_Mutex> &iter =
+ ACE_Timer_Queue_Iterator_T<TYPE> & iter =
this->table_[i]->iter ();
for (iter.first ();
@@ -680,8 +709,8 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::cancel (const TYPE &type,
// Removes the earliest node and finds the new earliest position
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::remove_first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::remove_first (void)
{
if (this->is_empty ())
return 0;
@@ -698,8 +727,8 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::remove_first (void)
// Finds a new earliest position
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> void
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::find_new_earliest (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> void
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::find_new_earliest (void)
{
for (size_t i = 0; i < this->table_size_; ++i)
if (!this->table_[i]->is_empty ())
@@ -711,8 +740,8 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::find_new_earliest (void)
// Returns the earliest node without removing it
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::get_first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::get_first (void)
{
ACE_TRACE ("ACE_Timer_Hash_T::get_first");
@@ -722,23 +751,22 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::get_first (void)
return this->table_[this->earliest_position_]->get_first ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> void
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::free_node (ACE_Timer_Node_T<TYPE> *node)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> void
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::free_node (ACE_Timer_Node_T<TYPE> *node)
{
- ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK>::free_node (node);
+ Base_Timer_Queue::free_node (node);
Hash_Token<TYPE> *h =
reinterpret_cast<Hash_Token<TYPE> *> (const_cast<void *> (node->get_act ()));
this->token_list_.add (h);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> int
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::dispatch_info_i (const ACE_Time_Value &cur_time,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> int
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::dispatch_info_i (const ACE_Time_Value &cur_time,
ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
{
int const result =
- ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK>::dispatch_info_i (cur_time,
- info);
+ Base_Timer_Queue::dispatch_info_i (cur_time, info);
if (result == 1)
{
@@ -753,16 +781,16 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::dispatch_info_i (const ACE_Ti
// Dummy version of expire to get rid of warnings in Sun CC 4.2
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> int
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::expire ()
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> int
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::expire ()
{
- return ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK>::expire();
+ return Base_Timer_Queue::expire();
}
// Specialized expire for Timer Hash
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> int
-ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::expire (const ACE_Time_Value &cur_time)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY> int
+ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>::expire (const ACE_Time_Value &cur_time)
{
ACE_TRACE ("ACE_Timer_Hash_T::expire");
diff --git a/dep/acelite/ace/Timer_Hash_T.h b/dep/acelite/ace/Timer_Hash_T.h
index b04e7cfbcf3..d634536e54e 100644
--- a/dep/acelite/ace/Timer_Hash_T.h
+++ b/dep/acelite/ace/Timer_Hash_T.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Hash_T.h
*
- * $Id: Timer_Hash_T.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_Hash_T.h 95807 2012-06-01 12:44:19Z johnnyw $
*
* @author Darrell Brunsch <brunsch@cs.wustl.edu>
*/
@@ -25,7 +25,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward declaration.
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY>
class ACE_Timer_Hash_T;
template <typename TYPE>
class Hash_Token;
@@ -40,6 +40,7 @@ class Hash_Token;
*/
template <class TYPE, class FUNCTOR, class ACE_LOCK>
class ACE_Timer_Hash_Upcall
+ : private ACE_Copy_Disabled
{
public:
typedef ACE_Timer_Queue_T<ACE_Event_Handler *,
@@ -103,10 +104,6 @@ public:
private:
/// Timer Queue to do the calling up to
ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> *timer_hash_;
-
- // = Don't allow these operations for now.
- ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Hash_Upcall (const ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK> &))
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK> &))
};
/**
@@ -118,12 +115,15 @@ private:
* node of a timer queue. Be aware that it doesn't transverse
* in the order of timeout values.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-class ACE_Timer_Hash_Iterator_T : public ACE_Timer_Queue_Iterator_T <TYPE, FUNCTOR, ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Timer_Hash_Iterator_T : public ACE_Timer_Queue_Iterator_T <TYPE>
{
public:
/// Constructor.
- ACE_Timer_Hash_Iterator_T (ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET> &);
+ typedef ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY> Hash;
+ ACE_Timer_Hash_Iterator_T (Hash &);
+
+ virtual ~ACE_Timer_Hash_Iterator_T ();
/// Positions the iterator at the earliest node in the Timer Queue
virtual void first (void);
@@ -139,13 +139,13 @@ public:
protected:
/// Pointer to the ACE_Timer_Hash that we are iterating over.
- ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET> &timer_hash_;
+ Hash & timer_hash_;
/// Current position in <timer_hash_>'s table
size_t position_;
/// Current iterator used on <position>'s bucket
- ACE_Timer_Queue_Iterator_T<TYPE, ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK>, ACE_Null_Mutex> *iter_;
+ ACE_Timer_Queue_Iterator_T<TYPE> *iter_;
};
/**
@@ -156,21 +156,23 @@ protected:
*
* This implementation uses a hash table of BUCKETs. The hash
* is based on the time_value of the event. Unlike other Timer
- * Queues, ACE_Timer_Hash does not expire events in order.
+ * Queues, ACE_Timer_Hash does not expire events in strict order,
+ * i.e., all events are expired after their deadline. But two events
+ * may expired out of order as defined by their deadlines.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET>
-class ACE_Timer_Hash_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Timer_Hash_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>
{
public:
/// Type of iterator
- typedef ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>
+ typedef ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>
HASH_ITERATOR;
/// Iterator is a friend
- friend class ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>;
+ friend class ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET, TIME_POLICY>;
/// Type inherited from
- typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> INHERITED;
+ typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Base_Timer_Queue;
// = Initialization and termination methods.
/**
@@ -181,7 +183,8 @@ public:
*/
ACE_Timer_Hash_T (size_t table_size,
FUNCTOR *upcall_functor = 0,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0);
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/**
* Default constructor. @a upcall_functor is the instance of the
@@ -190,7 +193,9 @@ public:
* timer nodes. If 0, then a default freelist will be created. The default
* size will be ACE_DEFAULT_TIMERS and there will be no preallocation.
*/
- ACE_Timer_Hash_T (FUNCTOR *upcall_functor = 0, ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0);
+ ACE_Timer_Hash_T (FUNCTOR *upcall_functor = 0,
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/// Destructor
virtual ~ACE_Timer_Hash_T (void);
@@ -238,8 +243,13 @@ public:
int dont_call_handle_close = 1);
/**
+ * Destroy timer queue. Cancels all timers.
+ */
+ virtual int close (void);
+
+ /**
* Run the <functor> for all timers whose values are <=
- * <ACE_OS::gettimeofday>. Also accounts for <timer_skew>. Returns
+ * gettimeofday. Also accounts for <timer_skew>. Returns
* the number of timers canceled.
*/
virtual int expire (void);
@@ -252,7 +262,7 @@ public:
virtual int expire (const ACE_Time_Value &current_time);
/// Returns a pointer to this ACE_Timer_Queue's iterator.
- virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &iter (void);
+ virtual ACE_Timer_Queue_Iterator_T<TYPE> &iter (void);
/// Removes the earliest node from the queue and returns it
virtual ACE_Timer_Node_T<TYPE> *remove_first (void);
@@ -314,8 +324,8 @@ private:
HASH_ITERATOR *iterator_;
#if defined (ACE_WIN64)
- // Part of a hack... see comments in schedule().
- // This is, essentially, the upper 32 bits of a 64-bit pointer on Win64.
+ /// Part of a hack... see comments in schedule().
+ /// This is, essentially, the upper 32 bits of a 64-bit pointer on Win64.
ptrdiff_t pointer_base_;
#endif
diff --git a/dep/acelite/ace/Timer_Heap.h b/dep/acelite/ace/Timer_Heap.h
index 7dec5ec22b4..742aed8ff66 100644
--- a/dep/acelite/ace/Timer_Heap.h
+++ b/dep/acelite/ace/Timer_Heap.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Heap.h
*
- * $Id: Timer_Heap.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_Heap.h 95335 2011-12-15 13:13:17Z msmit $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -15,6 +15,7 @@
#include /**/ "ace/pre.h"
#include "ace/Timer_Heap_T.h"
+#include "ace/Event_Handler_Handle_Timeout_Upcall.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -26,15 +27,21 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// compatibility.
typedef ACE_Timer_Heap_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX>
ACE_Timer_Heap;
typedef ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX>
ACE_Timer_Heap_Iterator;
+typedef ACE_Timer_Heap_T<ACE_Event_Handler *,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
+ ACE_SYNCH_RECURSIVE_MUTEX,
+ ACE_FPointer_Time_Policy>
+ ACE_Timer_Heap_Variable_Time_Source;
+
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
diff --git a/dep/acelite/ace/Timer_Heap_T.cpp b/dep/acelite/ace/Timer_Heap_T.cpp
index 1343915030c..93ce1341746 100644
--- a/dep/acelite/ace/Timer_Heap_T.cpp
+++ b/dep/acelite/ace/Timer_Heap_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Timer_Heap_T.cpp 92069 2010-09-28 11:38:59Z johnnyw $
+// $Id: Timer_Heap_T.cpp 95630 2012-03-22 13:04:47Z johnnyw $
#ifndef ACE_TIMER_HEAP_T_CPP
#define ACE_TIMER_HEAP_T_CPP
@@ -39,34 +39,34 @@ ACE_HEAP_LCHILD (size_t X)
// Constructor that takes in an <ACE_Timer_Heap_T> to iterate over.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_Iterator_T (
- ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &heap)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_Heap_Iterator_T (
+ Heap & heap)
: timer_heap_ (heap)
{
ACE_TRACE ("ACE_Timer_Heap_Iterator_T::ACE_Timer_Heap_Iterator");
this->first ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Heap_Iterator_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::~ACE_Timer_Heap_Iterator_T (void)
{
}
// Positions the iterator at the first node in the heap array
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void)
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::first (void)
{
this->position_ = 0;
}
// Positions the iterator at the next node in the heap array
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::next (void)
{
if (this->position_ != this->timer_heap_.cur_size_)
++this->position_;
@@ -74,16 +74,16 @@ ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
// Returns true the <position_> is at the end of the heap array
-template <class TYPE, class FUNCTOR, class ACE_LOCK> bool
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> bool
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::isdone (void) const
{
return this->position_ == this->timer_heap_.cur_size_;
}
// Returns the node at the current position in the heap or 0 if at the end
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::item (void)
{
if (this->position_ != this->timer_heap_.cur_size_)
return this->timer_heap_.heap_[this->position_];
@@ -95,13 +95,16 @@ ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item (void)
// Since timer IDs are assigned by first incrementing the timer_ids_curr_
// value, the first ID assigned will be 1 (just as in the previous design).
// When it's time to wrap, the next ID given out will be 0.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_T (
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_Heap_T (
size_t size,
bool preallocated,
FUNCTOR *upcall_functor,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
- : ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK> (upcall_functor, freelist),
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist,
+ TIME_POLICY const & time_policy)
+ : Base_Time_Policy (upcall_functor,
+ freelist,
+ time_policy),
max_size_ (size),
cur_size_ (0),
cur_limbo_ (0),
@@ -162,11 +165,14 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_T (
// Since timer IDs are assigned by first incrementing the timer_ids_curr_
// value, the first ID assigned will be 1 (just as in the previous design).
// When it's time to wrap, the next ID given out will be 0.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_T (
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_Heap_T (
FUNCTOR *upcall_functor,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
- : ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK> (upcall_functor, freelist),
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist,
+ TIME_POLICY const & time_policy)
+ : Base_Time_Policy (upcall_functor,
+ freelist,
+ time_policy),
max_size_ (ACE_DEFAULT_TIMERS),
cur_size_ (0),
cur_limbo_ (0),
@@ -199,13 +205,36 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_T (
HEAP_ITERATOR (*this));
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Heap_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::~ACE_Timer_Heap_T (void)
{
ACE_TRACE ("ACE_Timer_Heap_T::~ACE_Timer_Heap_T");
delete iterator_;
+ this->close ();
+
+ delete [] this->heap_;
+ delete [] this->timer_ids_;
+
+ // clean up any preallocated timer nodes
+ if (preallocated_nodes_ != 0)
+ {
+ ACE_Unbounded_Set_Iterator<ACE_Timer_Node_T<TYPE> *>
+ set_iterator (this->preallocated_node_set_);
+
+ for (ACE_Timer_Node_T<TYPE> **entry = 0;
+ set_iterator.next (entry) !=0;
+ set_iterator.advance ())
+ delete [] *entry;
+ }
+}
+
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::close (void)
+{
+ ACE_TRACE ("ACE_Timer_Heap_T::close");
+
size_t current_size =
this->cur_size_;
@@ -222,25 +251,13 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Heap_T (void)
this->upcall_functor ().deletion (*this, eh, act);
}
- delete [] this->heap_;
- delete [] this->timer_ids_;
-
- // clean up any preallocated timer nodes
- if (preallocated_nodes_ != 0)
- {
- ACE_Unbounded_Set_Iterator<ACE_Timer_Node_T<TYPE> *>
- set_iterator (this->preallocated_node_set_);
-
- for (ACE_Timer_Node_T<TYPE> **entry = 0;
- set_iterator.next (entry) !=0;
- set_iterator.advance ())
- delete [] *entry;
- }
+ // leave the rest to the destructor
+ return 0;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
long
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::pop_freelist (void)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::pop_freelist (void)
{
ACE_TRACE ("ACE_Timer_Heap_T::pop_freelist");
@@ -271,9 +288,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::pop_freelist (void)
return static_cast<long> (this->timer_ids_curr_);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::push_freelist (long old_id)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::push_freelist (long old_id)
{
ACE_TRACE ("ACE_Timer_Heap_T::push_freelist");
@@ -296,9 +313,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::push_freelist (long old_id)
return;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
long
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::timer_id (void)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::timer_id (void)
{
ACE_TRACE ("ACE_Timer_Heap_T::timer_id");
@@ -308,17 +325,17 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::timer_id (void)
// Checks if queue is empty.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
bool
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::is_empty (void) const
{
ACE_TRACE ("ACE_Timer_Heap_T::is_empty");
return this->cur_size_ == 0;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Queue_Iterator_T<TYPE> &
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::iter (void)
{
this->iterator_->first ();
return *this->iterator_;
@@ -326,16 +343,16 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
// Returns earliest time in a non-empty queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> const ACE_Time_Value &
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> const ACE_Time_Value &
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::earliest_time (void) const
{
ACE_TRACE ("ACE_Timer_Heap_T::earliest_time");
return this->heap_[0]->get_timer_value ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Timer_Heap_T::dump");
@@ -371,9 +388,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::copy (
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::copy (
size_t slot,
ACE_Timer_Node_T<TYPE> *moved_node)
{
@@ -392,9 +409,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::copy (
// this function must call either free_node (to reclaim the timer ID
// and the timer node memory, as well as decrement the size of the queue)
// or reschedule (to reinsert the node in the heap at a new time).
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove (size_t slot)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::remove (size_t slot)
{
ACE_Timer_Node_T<TYPE> *removed_node =
this->heap_[slot];
@@ -437,8 +454,8 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove (size_t slot)
return removed_node;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_down (
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reheap_down (
ACE_Timer_Node_T<TYPE> *moved_node,
size_t slot,
size_t child)
@@ -471,9 +488,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_down (
this->copy (slot, moved_node);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_up (
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reheap_up (
ACE_Timer_Node_T<TYPE> *moved_node,
size_t slot,
size_t parent)
@@ -501,9 +518,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_up (
moved_node);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::insert (
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::insert (
ACE_Timer_Node_T<TYPE> *new_node)
{
if (this->cur_size_ + this->cur_limbo_ + 2 >= this->max_size_)
@@ -515,9 +532,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::insert (
this->cur_size_++;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::grow_heap (void)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::grow_heap (void)
{
// All the containers will double in size from max_size_.
size_t new_size = this->max_size_ * 2;
@@ -597,9 +614,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::grow_heap (void)
// Reschedule a periodic timer. This function must be called with the
// mutex lock held.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reschedule (
ACE_Timer_Node_T<TYPE> *expired)
{
ACE_TRACE ("ACE_Timer_Heap_T::reschedule");
@@ -614,9 +631,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (
this->insert (expired);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::alloc_node (void)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::alloc_node (void)
{
ACE_Timer_Node_T<TYPE> *temp = 0;
@@ -633,16 +650,19 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::alloc_node (void)
temp = this->preallocated_nodes_freelist_;
- // Remove the first element from the freelist.
- this->preallocated_nodes_freelist_ =
- this->preallocated_nodes_freelist_->get_next ();
+ if (this->preallocated_nodes_freelist_)
+ {
+ // Remove the first element from the freelist.
+ this->preallocated_nodes_freelist_ =
+ this->preallocated_nodes_freelist_->get_next ();
+ }
}
return temp;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
void
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::free_node (
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::free_node (
ACE_Timer_Node_T<TYPE> *node)
{
// Return this timer id to the freelist.
@@ -661,9 +681,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::free_node (
// Insert a new timer that expires at time future_time; if interval is
// > 0, the handler will be reinvoked periodically.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
long
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::schedule_i (
const TYPE &type,
const void *act,
const ACE_Time_Value &future_time,
@@ -699,9 +719,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (
// Locate and remove the single timer with a value of @a timer_id from
// the timer queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
int
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel (long timer_id,
const void **act,
int dont_call)
{
@@ -756,9 +776,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
// Locate and update the inteval on the timer_id
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
int
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reset_interval (long timer_id,
const ACE_Time_Value &interval)
{
ACE_TRACE ("ACE_Timer_Heap_T::reset_interval");
@@ -792,9 +812,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
// Locate and remove all values of @a type from the timer queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
int
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type,
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel (const TYPE &type,
int dont_call)
{
ACE_TRACE ("ACE_Timer_Heap_T::cancel");
@@ -849,9 +869,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type,
// Returns the earliest node or returns 0 if the heap is empty.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T <TYPE> *
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::remove_first (void)
{
ACE_TRACE ("ACE_Timer_Heap_T::remove_first");
@@ -861,9 +881,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void)
return this->remove (0);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T <TYPE> *
-ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::get_first (void)
+ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::get_first (void)
{
ACE_TRACE ("ACE_Timer_Heap_T::get_first");
diff --git a/dep/acelite/ace/Timer_Heap_T.h b/dep/acelite/ace/Timer_Heap_T.h
index d6a6221aeed..147d633fd23 100644
--- a/dep/acelite/ace/Timer_Heap_T.h
+++ b/dep/acelite/ace/Timer_Heap_T.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Heap_T.h
*
- * $Id: Timer_Heap_T.h 84619 2009-02-26 12:26:16Z johnnyw $
+ * $Id: Timer_Heap_T.h 95368 2011-12-19 13:38:49Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -26,7 +26,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward declaration
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
class ACE_Timer_Heap_T;
/**
@@ -38,15 +38,16 @@ class ACE_Timer_Heap_T;
* node of a timer queue. Be aware that it doesn't transverse
* in the order of timeout values.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-class ACE_Timer_Heap_Iterator_T : public ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Timer_Heap_Iterator_T : public ACE_Timer_Queue_Iterator_T<TYPE>
{
public:
+ typedef ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Heap;
/// Constructor.
- ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &);
+ ACE_Timer_Heap_Iterator_T (Heap &);
/// Destructor.
- ~ACE_Timer_Heap_Iterator_T (void);
+ virtual ~ACE_Timer_Heap_Iterator_T (void);
/// Positions the iterator at the earliest node in the Timer Queue
virtual void first (void);
@@ -62,7 +63,7 @@ public:
protected:
/// Pointer to the ACE_Timer_Heap that we are iterating over.
- ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &timer_heap_;
+ Heap & timer_heap_;
/// Position in the array where the iterator is at
size_t position_;
@@ -82,14 +83,14 @@ protected:
* dynamic memory allocation, which is important for real-time
* systems.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-class ACE_Timer_Heap_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Timer_Heap_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>
{
public:
- typedef ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> HEAP_ITERATOR;
- friend class ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>;
+ typedef ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> HEAP_ITERATOR;
+ friend class ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>;
- typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> INHERITED;
+ typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Base_Time_Policy;
// = Initialization and termination methods.
/**
@@ -109,7 +110,8 @@ public:
ACE_Timer_Heap_T (size_t size,
bool preallocated = false,
FUNCTOR *upcall_functor = 0,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0);
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/**
* Default constructor. @c upcall_functor is the instance of the
@@ -119,7 +121,8 @@ public:
* size will be ACE_DEFAULT_TIMERS and there will be no preallocation.
*/
ACE_Timer_Heap_T (FUNCTOR *upcall_functor = 0,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0);
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/// Destructor.
virtual ~ACE_Timer_Heap_T (void);
@@ -162,8 +165,13 @@ public:
const void **act = 0,
int dont_call_handle_close = 1);
+ /**
+ * Destroy timer queue. Cancels all timers.
+ */
+ virtual int close (void);
+
/// Returns a pointer to this ACE_Timer_Queue's iterator.
- virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &iter (void);
+ virtual ACE_Timer_Queue_Iterator_T<TYPE> &iter (void);
/**
* Removes the earliest node from the queue and returns it. Note that
@@ -318,10 +326,6 @@ private:
/// Set of pointers to the arrays of preallocated timer nodes.
/// Used to delete the allocated memory when required.
ACE_Unbounded_Set<ACE_Timer_Node_T<TYPE> *> preallocated_node_set_;
-
- // = Don't allow these operations for now.
- ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Heap_T (const ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &))
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &))
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_List.h b/dep/acelite/ace/Timer_List.h
index f2d9cc2a458..5dff92a56b0 100644
--- a/dep/acelite/ace/Timer_List.h
+++ b/dep/acelite/ace/Timer_List.h
@@ -4,7 +4,7 @@
/**
* @file Timer_List.h
*
- * $Id: Timer_List.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_List.h 95335 2011-12-15 13:13:17Z msmit $
*
* @author Doug Schmidt
*/
@@ -16,6 +16,7 @@
#include /**/ "ace/pre.h"
#include "ace/Timer_List_T.h"
+#include "ace/Event_Handler_Handle_Timeout_Upcall.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -25,15 +26,15 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// The following typedefs are here for ease of use and backward
// compatibility.
-
typedef ACE_Timer_List_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX>
ACE_Timer_List;
typedef ACE_Timer_List_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
- ACE_SYNCH_RECURSIVE_MUTEX>
+ ACE_Event_Handler_Handle_Timeout_Upcall,
+ ACE_SYNCH_RECURSIVE_MUTEX,
+ ACE_Default_Time_Policy>
ACE_Timer_List_Iterator;
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_List_T.cpp b/dep/acelite/ace/Timer_List_T.cpp
index 3e4ba78f521..d45b71e0098 100644
--- a/dep/acelite/ace/Timer_List_T.cpp
+++ b/dep/acelite/ace/Timer_List_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Timer_List_T.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Timer_List_T.cpp 95368 2011-12-19 13:38:49Z mcorino $
#ifndef ACE_TIMER_LIST_T_C
#define ACE_TIMER_LIST_T_C
@@ -15,30 +15,30 @@
// Default Constructor
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_List_Iterator_T (List& lst)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_List_Iterator_T (List& lst)
: list_ (lst)
{
this->first();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_List_Iterator_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::~ACE_Timer_List_Iterator_T (void)
{
}
// Positions the iterator at the node right after the dummy node
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::first (void)
{
this->current_node_ = this->list_.get_first();
}
// Positions the iterator at the next node in the Timer Queue
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::next (void)
{
// Make sure that if we are at the end, we don't wrap around
if (! this->isdone())
@@ -49,16 +49,16 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
// Returns true when we are at <head_>
-template <class TYPE, class FUNCTOR, class ACE_LOCK> bool
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> bool
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::isdone (void) const
{
return this->current_node_ == 0;
}
// Returns the node at <position_> or 0 if we are at the end
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::item (void)
{
if (! this->isdone())
return this->current_node_;
@@ -70,8 +70,8 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item (void)
// Return our instance of the iterator
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Queue_Iterator_T<TYPE> &
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::iter (void)
{
this->iterator_->first ();
return *this->iterator_;
@@ -79,9 +79,11 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
// Create an empty list.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_List_T (FUNCTOR* uf, FreeList* fl)
- : Base(uf, fl)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_List_T (FUNCTOR* uf,
+ FreeList* fl,
+ TIME_POLICY const & time_policy)
+ : Base_Timer_Queue (uf, fl, time_policy)
, head_ (new ACE_Timer_Node_T<TYPE>)
, id_counter_ (0)
{
@@ -96,8 +98,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_List_T (FUNCTOR* uf, FreeLi
// Checks if list is empty.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> bool
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> bool
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::is_empty (void) const
{
ACE_TRACE ("ACE_Timer_List_T::is_empty");
return this->get_first_i() == 0;
@@ -106,8 +108,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const
// Returns earliest time in a non-empty list.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> const ACE_Time_Value &
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> const ACE_Time_Value &
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::earliest_time (void) const
{
ACE_TRACE ("ACE_Timer_List_T::earliest_time");
ACE_Timer_Node_T<TYPE>* first = this->get_first_i();
@@ -119,14 +121,27 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const
// Remove all remaining items in the list.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_List_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::~ACE_Timer_List_T (void)
{
ACE_TRACE ("ACE_Timer_List_T::~ACE_Timer_List_T");
ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_));
delete iterator_;
+ this->close ();
+
+ // delete the dummy node
+ delete this->head_;
+}
+
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::close (void)
+{
+ ACE_TRACE ("ACE_Timer_List_T::close");
+ ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));
+
+ // Remove all remaining items in the list.
if (!this->is_empty())
{
for (ACE_Timer_Node_T<TYPE>* n = this->get_first();
@@ -146,12 +161,12 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_List_T (void)
}
}
- // delete the dummy node
- delete this->head_;
+ // Leave rest to destructor
+ return 0;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Timer_List_T::dump");
@@ -175,8 +190,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
// Reschedule a periodic timer. This function must be called with the
// lock held.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE>* n)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reschedule (ACE_Timer_Node_T<TYPE>* n)
{
ACE_TRACE ("ACE_Timer_List_T::reschedule");
this->schedule_i(n, n->get_timer_value());
@@ -186,8 +201,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE>* n
// Insert a new handler that expires at time future_time; if interval
// is > 0, the handler will be reinvoked periodically.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> long
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (const TYPE &type,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> long
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::schedule_i (const TYPE &type,
const void *act,
const ACE_Time_Value &future_time,
const ACE_Time_Value &interval)
@@ -213,8 +228,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (const TYPE &type,
}
/// The shared scheduling functionality between schedule() and reschedule()
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (ACE_Timer_Node_T<TYPE>* n,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::schedule_i (ACE_Timer_Node_T<TYPE>* n,
const ACE_Time_Value& expire)
{
if (this->is_empty()) {
@@ -240,9 +255,9 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (ACE_Timer_Node_T<TYPE>* n
p->set_next(n);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE>*
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::find_node (long timer_id) const
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::find_node (long timer_id) const
{
ACE_Timer_Node_T<TYPE>* n = this->get_first_i();
if (n == 0)
@@ -257,8 +272,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::find_node (long timer_id) const
}
// Locate and update the inteval on the timer_id
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reset_interval (long timer_id,
const ACE_Time_Value &interval)
{
ACE_TRACE ("ACE_Timer_List_T::reset_interval");
@@ -273,8 +288,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
// Locate and remove the single <ACE_Event_Handler> with a value of
// @a timer_id from the timer queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel (long timer_id,
const void **act,
int skip_close)
{
@@ -310,8 +325,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
}
// Locate and remove all values of <handler> from the timer queue.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type, int skip_close)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel (const TYPE &type, int skip_close)
{
ACE_TRACE ("ACE_Timer_List_T::cancel");
@@ -365,8 +380,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type, int skip_cl
return num_canceled;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::unlink (ACE_Timer_Node_T<TYPE>* n)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::unlink (ACE_Timer_Node_T<TYPE>* n)
{
n->get_prev()->set_next(n->get_next());
n->get_next()->set_prev(n->get_prev());
@@ -375,23 +390,23 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::unlink (ACE_Timer_Node_T<TYPE>* n)
}
/// Shared subset of the two cancel() methods.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel_i (ACE_Timer_Node_T<TYPE>* n)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel_i (ACE_Timer_Node_T<TYPE>* n)
{
this->unlink (n);
this->free_node (n);
}
// Reads the first node on the list and returns it.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::get_first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::get_first (void)
{
ACE_TRACE ("ACE_Timer_List_T::get_first");
return this->get_first_i();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::get_first_i (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::get_first_i (void) const
{
ACE_TRACE ("ACE_Timer_List_T::get_first_i");
ACE_Timer_Node_T<TYPE>* first = this->head_->get_next();
@@ -403,8 +418,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::get_first_i (void) const
// Removes the first node on the list and returns it.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::remove_first (void)
{
ACE_TRACE ("ACE_Timer_List_T::remove_first");
ACE_Timer_Node_T<TYPE>* first = this->get_first();
diff --git a/dep/acelite/ace/Timer_List_T.h b/dep/acelite/ace/Timer_List_T.h
index cabd47aeaf0..918ba2cb9f3 100644
--- a/dep/acelite/ace/Timer_List_T.h
+++ b/dep/acelite/ace/Timer_List_T.h
@@ -4,7 +4,7 @@
/**
* @file Timer_List_T.h
*
- * $Id: Timer_List_T.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_List_T.h 95368 2011-12-19 13:38:49Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -21,7 +21,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
// Forward declaration.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
class ACE_Timer_List_T;
/**
@@ -32,12 +32,12 @@ class ACE_Timer_List_T;
* This is a generic iterator that can be used to visit every
* node of a timer queue.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
class ACE_Timer_List_Iterator_T
-: public ACE_Timer_Queue_Iterator_T <TYPE, FUNCTOR, ACE_LOCK>
+: public ACE_Timer_Queue_Iterator_T <TYPE>
{
public:
- typedef ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK> List;
+ typedef ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> List;
/// Constructor.
ACE_Timer_List_Iterator_T (List& lst);
@@ -81,19 +81,19 @@ protected:
* ACE_Timer_Heap will perform substantially faster than the
* ACE_Timer_List.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-class ACE_Timer_List_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Timer_List_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>
{
public:
/// Type of iterator
- typedef ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> Iterator;
+ typedef ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Iterator;
/// Iterator is a friend
- friend class ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>;
+ friend class ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>;
typedef ACE_Timer_Node_T<TYPE> Node;
/// Type inherited from
- typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> Base;
+ typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Base_Timer_Queue;
typedef ACE_Free_List<Node> FreeList;
// = Initialization and termination methods.
@@ -103,7 +103,8 @@ public:
* default FUNCTOR will be created. @a freelist is the freelist of
* timer nodes. If 0, then a default freelist will be created.
*/
- ACE_Timer_List_T (FUNCTOR* upcall_functor = 0, FreeList* freelist = 0);
+ ACE_Timer_List_T (FUNCTOR* upcall_functor = 0, FreeList* freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/// Destructor
virtual ~ACE_Timer_List_T (void);
@@ -146,8 +147,13 @@ public:
const void** act = 0,
int dont_call_handle_close = 1);
+ /**
+ * Destroy timer queue. Cancels all timers.
+ */
+ virtual int close (void);
+
/// Returns a pointer to this ACE_Timer_Queue's iterator.
- virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>& iter (void);
+ virtual ACE_Timer_Queue_Iterator_T<TYPE>& iter (void);
/// Removes the earliest node from the queue and returns it
virtual ACE_Timer_Node_T<TYPE>* remove_first (void);
diff --git a/dep/acelite/ace/Timer_Queue.h b/dep/acelite/ace/Timer_Queue.h
index 4644aa1b43d..13ec4fc826a 100644
--- a/dep/acelite/ace/Timer_Queue.h
+++ b/dep/acelite/ace/Timer_Queue.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Queue.h
*
- * $Id: Timer_Queue.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_Queue.h 95332 2011-12-15 11:09:41Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Irfan Pyarali <irfan@cs.wustl.edu>
@@ -40,9 +40,7 @@ typedef ACE_Timer_Node_Dispatch_Info_T<ACE_Event_Handler *>
typedef ACE_Timer_Node_T<ACE_Event_Handler *>
ACE_Timer_Node;
-typedef ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
- ACE_SYNCH_RECURSIVE_MUTEX>
+typedef ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *>
ACE_Timer_Queue_Iterator;
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_Queue_Adapters.cpp b/dep/acelite/ace/Timer_Queue_Adapters.cpp
index 190d11c4f08..e4e2337395e 100644
--- a/dep/acelite/ace/Timer_Queue_Adapters.cpp
+++ b/dep/acelite/ace/Timer_Queue_Adapters.cpp
@@ -1,4 +1,4 @@
-// $Id: Timer_Queue_Adapters.cpp 92285 2010-10-20 16:34:57Z shuston $
+// $Id: Timer_Queue_Adapters.cpp 95368 2011-12-19 13:38:49Z mcorino $
#ifndef ACE_TIMER_QUEUE_ADAPTERS_CPP
#define ACE_TIMER_QUEUE_ADAPTERS_CPP
@@ -182,6 +182,11 @@ ACE_Thread_Timer_Queue_Adapter<TQ, TYPE>::~ACE_Thread_Timer_Queue_Adapter (void)
this->timer_queue_ = 0;
this->delete_timer_queue_ = false;
}
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ this->timer_queue_ = 0;
+ }
}
template<class TQ, class TYPE> ACE_SYNCH_RECURSIVE_MUTEX &
@@ -264,8 +269,10 @@ ACE_Thread_Timer_Queue_Adapter<TQ, TYPE>::svc (void)
{
// Compute the remaining time, being careful not to sleep
// for "negative" amounts of time.
- ACE_Time_Value const tv_curr = this->timer_queue_->gettimeofday ();
- ACE_Time_Value const tv_earl = this->timer_queue_->earliest_time ();
+ ACE_Time_Value const tv_curr =
+ this->timer_queue_->gettimeofday ();
+ ACE_Time_Value const tv_earl =
+ this->timer_queue_->earliest_time ();
if (tv_earl > tv_curr)
{
diff --git a/dep/acelite/ace/Timer_Queue_Adapters.inl b/dep/acelite/ace/Timer_Queue_Adapters.inl
index d73ef024246..c6a7690303e 100644
--- a/dep/acelite/ace/Timer_Queue_Adapters.inl
+++ b/dep/acelite/ace/Timer_Queue_Adapters.inl
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: Timer_Queue_Adapters.inl 89482 2010-03-15 07:58:50Z johnnyw $
+// $Id: Timer_Queue_Adapters.inl 95368 2011-12-19 13:38:49Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -15,6 +15,8 @@ ACE_Thread_Timer_Queue_Adapter<TQ, TYPE>::timer_queue (TQ *tq)
{
if (this->delete_timer_queue_)
delete this->timer_queue_;
+ else if (this->timer_queue_)
+ this->timer_queue_->close ();
this->timer_queue_ = tq;
this->delete_timer_queue_ = false;
return 0;
diff --git a/dep/acelite/ace/Timer_Queue_Iterator.cpp b/dep/acelite/ace/Timer_Queue_Iterator.cpp
new file mode 100644
index 00000000000..cc95cbdcbe1
--- /dev/null
+++ b/dep/acelite/ace/Timer_Queue_Iterator.cpp
@@ -0,0 +1,58 @@
+//$Id: Timer_Queue_Iterator.cpp 95334 2011-12-15 12:52:50Z msmit $
+
+#ifndef ACE_TIMER_QUEUE_ITERATOR_CPP
+#define ACE_TIMER_QUEUE_ITERATOR_CPP
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Timer_Queue_Iterator.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TYPE> void
+ACE_Timer_Node_T<TYPE>::dump (void) const
+{
+#if defined (ACE_HAS_DUMP)
+ ACE_TRACE ("ACE_Timer_Node_T::dump");
+ ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nact_ = %x"), this->act_));
+ this->timer_value_.dump ();
+ this->interval_.dump ();
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nprev_ = %x"), this->prev_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %x"), this->next_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d\n"), this->timer_id_));
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+#endif /* ACE_HAS_DUMP */
+}
+
+template <class TYPE>
+ACE_Timer_Node_T<TYPE>::ACE_Timer_Node_T (void)
+{
+ ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T");
+}
+
+template <class TYPE>
+ACE_Timer_Node_T<TYPE>::~ACE_Timer_Node_T (void)
+{
+ ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T");
+}
+
+template <class TYPE>
+ACE_Timer_Queue_Iterator_T<TYPE>::ACE_Timer_Queue_Iterator_T (void)
+{
+}
+
+template <class TYPE>
+ACE_Timer_Queue_Iterator_T<TYPE>::~ACE_Timer_Queue_Iterator_T (void)
+{
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_TIMER_QUEUE_ITERATOR_CPP */
diff --git a/dep/acelite/ace/Timer_Queue_Iterator.h b/dep/acelite/ace/Timer_Queue_Iterator.h
new file mode 100644
index 00000000000..56433e4b3dc
--- /dev/null
+++ b/dep/acelite/ace/Timer_Queue_Iterator.h
@@ -0,0 +1,200 @@
+//$Id: Timer_Queue_Iterator.h 95334 2011-12-15 12:52:50Z msmit $
+
+#ifndef ACE_TIMER_QUEUE_ITERATOR_H
+#define ACE_TIMER_QUEUE_ITERATOR_H
+
+#include /**/ "ace/pre.h"
+
+/**
+ * @file Timer_Queue_Iterator.h
+ *
+ * Re-factored from Timer_Queue_T.h
+ */
+
+#include "ace/Time_Value.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Timer_Node_Dispatch_Info_T
+ *
+ * @brief Maintains generated dispatch information for Timer nodes.
+ *
+ */
+template <class TYPE>
+class ACE_Timer_Node_Dispatch_Info_T
+{
+public:
+ /// The type of object held in the queue
+ TYPE type_;
+
+ /// Asynchronous completion token associated with the timer.
+ const void *act_;
+
+ /// Flag to check if the timer is recurring.
+ int recurring_timer_;
+};
+
+/**
+ * @class ACE_Timer_Node_T
+ *
+ * @brief Maintains the state associated with a Timer entry.
+ */
+template <class TYPE>
+class ACE_Timer_Node_T
+{
+public:
+ /// Default constructor
+ ACE_Timer_Node_T (void);
+
+ /// Destructor
+ ~ACE_Timer_Node_T (void);
+
+ /// Useful typedef ..
+ typedef ACE_Timer_Node_Dispatch_Info_T <TYPE> DISPATCH_INFO;
+
+ /// Singly linked list
+ void set (const TYPE &type,
+ const void *a,
+ const ACE_Time_Value &t,
+ const ACE_Time_Value &i,
+ ACE_Timer_Node_T<TYPE> *n,
+ long timer_id);
+
+ /// Doubly linked list version
+ void set (const TYPE &type,
+ const void *a,
+ const ACE_Time_Value &t,
+ const ACE_Time_Value &i,
+ ACE_Timer_Node_T<TYPE> *p,
+ ACE_Timer_Node_T<TYPE> *n,
+ long timer_id);
+
+ // = Accessors
+
+ /// Get the type.
+ TYPE &get_type (void);
+
+ /// Set the type.
+ void set_type (TYPE &type);
+
+ /// Get the asynchronous completion token.
+ const void *get_act (void);
+
+ /// Set the asynchronous completion token.
+ void set_act (void *act);
+
+ /// Get the timer value.
+ const ACE_Time_Value &get_timer_value (void) const;
+
+ /// Set the timer value.
+ void set_timer_value (const ACE_Time_Value &timer_value);
+
+ /// Get the timer interval.
+ const ACE_Time_Value &get_interval (void) const;
+
+ /// Set the timer interval.
+ void set_interval (const ACE_Time_Value &interval);
+
+ /// Get the previous pointer.
+ ACE_Timer_Node_T<TYPE> *get_prev (void);
+
+ /// Set the previous pointer.
+ void set_prev (ACE_Timer_Node_T<TYPE> *prev);
+
+ /// Get the next pointer.
+ ACE_Timer_Node_T<TYPE> *get_next (void);
+
+ /// Set the next pointer.
+ void set_next (ACE_Timer_Node_T<TYPE> *next);
+
+ /// Get the timer_id.
+ long get_timer_id (void) const;
+
+ /// Set the timer_id.
+ void set_timer_id (long timer_id);
+
+ /// Get the dispatch info. The dispatch information is got
+ /// through <info>. This form helps us in preventing allocation and
+ /// deleting data along the criticl path.
+ /// @@TODO: We may want to have a copying version too, so that our
+ /// interface will be complete..
+ void get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T <TYPE> &info);
+
+ /// Dump the state of an TYPE.
+ void dump (void) const;
+
+private:
+ /// Type of object stored in the Queue
+ TYPE type_;
+
+ /// Asynchronous completion token associated with the timer.
+ const void *act_;
+
+ /// Time until the timer expires.
+ ACE_Time_Value timer_value_;
+
+ /// If this is a periodic timer this holds the time until the next
+ /// timeout.
+ ACE_Time_Value interval_;
+
+ /// Pointer to previous timer.
+ ACE_Timer_Node_T<TYPE> *prev_;
+
+ /// Pointer to next timer.
+ ACE_Timer_Node_T<TYPE> *next_;
+
+ /// Id of this timer (used to cancel timers before they expire).
+ long timer_id_;
+};
+
+/**
+ * @class ACE_Timer_Queue_Iterator_T
+ *
+ * @brief Generic interface for iterating over a subclass of
+ * ACE_Timer_Queue.
+ *
+ * This is a generic iterator that can be used to visit every
+ * node of a timer queue. Be aware that it isn't guaranteed
+ * that the transversal will be in order of timeout values.
+ */
+template <class TYPE>
+class ACE_Timer_Queue_Iterator_T
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ ACE_Timer_Queue_Iterator_T (void);
+
+ /// Destructor.
+ virtual ~ACE_Timer_Queue_Iterator_T (void);
+
+ /// Positions the iterator at the earliest node in the Timer Queue
+ virtual void first (void) = 0;
+
+ /// Positions the iterator at the next node in the Timer Queue
+ virtual void next (void) = 0;
+
+ /// Returns true when there are no more nodes in the sequence
+ virtual bool isdone (void) const = 0;
+
+ /// Returns the node at the current position in the sequence
+ virtual ACE_Timer_Node_T<TYPE> *item (void) = 0;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/Timer_Queue_Iterator.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "ace/Timer_Queue_Iterator.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Timer_Queue_Iterator.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_TIMER_QUEUE_ITERATOR_H */
diff --git a/dep/acelite/ace/Timer_Queue_Iterator.inl b/dep/acelite/ace/Timer_Queue_Iterator.inl
new file mode 100644
index 00000000000..90fa4687bbd
--- /dev/null
+++ b/dep/acelite/ace/Timer_Queue_Iterator.inl
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+//
+// $Id: Timer_Queue_Iterator.inl 95332 2011-12-15 11:09:41Z mcorino $
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
+ const void *a,
+ const ACE_Time_Value &t,
+ const ACE_Time_Value &i,
+ ACE_Timer_Node_T<TYPE> *n,
+ long timer_id)
+{
+ this->type_ = type;
+ this->act_ = a;
+ this->timer_value_ = t;
+ this->interval_ = i;
+ this->next_ = n;
+ this->timer_id_ = timer_id;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
+ const void *a,
+ const ACE_Time_Value &t,
+ const ACE_Time_Value &i,
+ ACE_Timer_Node_T<TYPE> *p,
+ ACE_Timer_Node_T<TYPE> *n,
+ long timer_id)
+{
+ this->type_ = type;
+ this->act_ = a;
+ this->timer_value_ = t;
+ this->interval_ = i;
+ this->prev_ = p;
+ this->next_ = n;
+ this->timer_id_ = timer_id;
+}
+
+template <class TYPE> ACE_INLINE TYPE &
+ACE_Timer_Node_T<TYPE>::get_type (void)
+{
+ return this->type_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_type (TYPE &type)
+{
+ this->type_ = type;
+}
+
+template <class TYPE> ACE_INLINE const void *
+ACE_Timer_Node_T<TYPE>::get_act (void)
+{
+ return this->act_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_act (void *act)
+{
+ this->act_ = act;
+}
+
+template <class TYPE> ACE_INLINE const ACE_Time_Value &
+ACE_Timer_Node_T<TYPE>::get_timer_value (void) const
+{
+ return this->timer_value_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_timer_value (const ACE_Time_Value &timer_value)
+{
+ this->timer_value_ = timer_value;
+}
+
+template <class TYPE> ACE_INLINE const ACE_Time_Value &
+ACE_Timer_Node_T<TYPE>::get_interval (void) const
+{
+ return this->interval_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_interval (const ACE_Time_Value &interval)
+{
+ this->interval_ = interval;
+}
+
+template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Node_T<TYPE>::get_prev (void)
+{
+ return this->prev_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_prev (ACE_Timer_Node_T<TYPE> *prev)
+{
+ this->prev_ = prev;
+}
+
+template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Node_T<TYPE>::get_next (void)
+{
+ return this->next_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_next (ACE_Timer_Node_T<TYPE> *next)
+{
+ this->next_ = next;
+}
+
+template <class TYPE> ACE_INLINE long
+ACE_Timer_Node_T<TYPE>::get_timer_id (void) const
+{
+ return this->timer_id_;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::set_timer_id (long timer_id)
+{
+ this->timer_id_ = timer_id;
+}
+
+template <class TYPE> ACE_INLINE void
+ACE_Timer_Node_T<TYPE>::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
+{
+ // Yes, do a copy
+ info.type_ = this->type_;
+ info.act_ = this->act_;
+ info.recurring_timer_ =
+ this->interval_ > ACE_Time_Value::zero;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_Queue_T.cpp b/dep/acelite/ace/Timer_Queue_T.cpp
index 838d4422bcf..eafb4a24498 100644
--- a/dep/acelite/ace/Timer_Queue_T.cpp
+++ b/dep/acelite/ace/Timer_Queue_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Timer_Queue_T.cpp 92285 2010-10-20 16:34:57Z shuston $
+// $Id: Timer_Queue_T.cpp 95690 2012-04-09 22:00:03Z shuston $
#ifndef ACE_TIMER_QUEUE_T_CPP
#define ACE_TIMER_QUEUE_T_CPP
@@ -16,11 +16,11 @@
#include "ace/Timer_Queue_T.h"
#include "ace/Guard_T.h"
-#include "ace/Log_Msg.h"
-#include "ace/Reactor_Timer_Interface.h"
#include "ace/Reverse_Lock_T.h"
+#include "ace/Log_Msg.h"
#include "ace/Null_Mutex.h"
#include "ace/OS_NS_sys_time.h"
+#include "ace/Functor.h"
#if !defined (__ACE_INLINE__)
#include "ace/Timer_Queue_T.inl"
@@ -35,46 +35,47 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
# define ACE_TIMER_SKEW 0
#endif /* ACE_TIMER_SKEW */
-template <class TYPE> void
-ACE_Timer_Node_T<TYPE>::dump (void) const
+template <class TYPE, class FUNCTOR> ACE_INLINE
+ACE_Timer_Queue_Upcall_Base<TYPE, FUNCTOR>::ACE_Timer_Queue_Upcall_Base (FUNCTOR * upcall_functor)
+ : ACE_Abstract_Timer_Queue<TYPE>()
+ , ACE_Copy_Disabled()
+ , upcall_functor_(upcall_functor)
+ , delete_upcall_functor_ (upcall_functor == 0)
{
-#if defined (ACE_HAS_DUMP)
- ACE_TRACE ("ACE_Timer_Node_T::dump");
- ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nact_ = %x"), this->act_));
- this->timer_value_.dump ();
- this->interval_.dump ();
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nprev_ = %x"), this->prev_));
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %x"), this->next_));
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d\n"), this->timer_id_));
- ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
-#endif /* ACE_HAS_DUMP */
-}
+ ACE_TRACE ("ACE_Timer_Queue_Upcall_Base::ACE_Timer_Queue_Upcall_Base");
-template <class TYPE>
-ACE_Timer_Node_T<TYPE>::ACE_Timer_Node_T (void)
-{
- ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T");
+ if (upcall_functor != 0)
+ {
+ return;
+ }
+
+ ACE_NEW (upcall_functor_, FUNCTOR);
}
-template <class TYPE>
-ACE_Timer_Node_T<TYPE>::~ACE_Timer_Node_T (void)
+template <class TYPE, class FUNCTOR> ACE_INLINE
+ACE_Timer_Queue_Upcall_Base<TYPE, FUNCTOR>::~ACE_Timer_Queue_Upcall_Base ()
{
- ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T");
+ ACE_TRACE ("ACE_Timer_Queue_Upcall_Base::~ACE_Timer_Queue_Upcall_Base");
+ if (this->delete_upcall_functor_)
+ {
+ delete this->upcall_functor_;
+ }
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_Iterator_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Time_Value
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::gettimeofday()
{
+ return this->gettimeofday_static();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Queue_Iterator_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::gettimeofday (ACE_Time_Value (*gettimeofday)(void))
{
+ this->time_policy_.set_gettimeofday (gettimeofday);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Time_Value *
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *max_wait_time)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Time_Value *
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::calculate_timeout (ACE_Time_Value *max_wait_time)
{
ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout");
ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, max_wait_time));
@@ -84,7 +85,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m
return max_wait_time;
else
{
- ACE_Time_Value const cur_time = this->gettimeofday ();
+ ACE_Time_Value const cur_time = this->gettimeofday_static ();
if (this->earliest_time () > cur_time)
{
@@ -110,8 +111,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m
}
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Time_Value *
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *max_wait_time,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Time_Value *
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::calculate_timeout (ACE_Time_Value *max_wait_time,
ACE_Time_Value *the_timeout)
{
ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout");
@@ -119,6 +120,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m
if (the_timeout == 0)
return 0;
+ ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, max_wait_time));
+
if (this->is_empty ())
{
// Nothing on the Timer_Queue, so use whatever the caller gave us.
@@ -129,7 +132,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m
}
else
{
- ACE_Time_Value cur_time = this->gettimeofday ();
+ ACE_Time_Value cur_time = this->gettimeofday_static ();
if (this->earliest_time () > cur_time)
{
@@ -153,8 +156,16 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m
return the_timeout;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Time_Value
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::current_time()
+{
+ ACE_Time_Value tv = this->gettimeofday_static ();
+ tv += this->timer_skew();
+ return tv;
+}
+
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Timer_Queue_T::dump");
@@ -165,11 +176,12 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_T (FUNCTOR *upcall_functor,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
- : gettimeofday_ (ACE_OS::gettimeofday),
- delete_upcall_functor_ (upcall_functor == 0),
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_Queue_T (FUNCTOR *upcall_functor,
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist,
+ TIME_POLICY const & time_policy)
+ : ACE_Timer_Queue_Upcall_Base<TYPE,FUNCTOR>(upcall_functor),
+ time_policy_ (time_policy),
delete_free_list_ (freelist == 0),
timer_skew_ (0, ACE_TIMER_SKEW)
{
@@ -180,47 +192,38 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Queue_T (FUNCTOR *upcall_f
(ACE_Locked_Free_List<ACE_Timer_Node_T<TYPE>,ACE_Null_Mutex>));
else
free_list_ = freelist;
-
- if (!upcall_functor)
- ACE_NEW (upcall_functor_,
- FUNCTOR);
- else
- upcall_functor_ = upcall_functor;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Queue_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::~ACE_Timer_Queue_T (void)
{
ACE_TRACE ("ACE_Timer_Queue_T::~ACE_Timer_Queue_T");
- // Cleanup the functor and free_list on the way out
- if (this->delete_upcall_functor_)
- delete this->upcall_functor_;
-
+ // Cleanup the free_list on the way out
if (this->delete_free_list_)
delete this->free_list_;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::alloc_node (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::alloc_node (void)
{
return this->free_list_->remove ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::free_node (ACE_Timer_Node_T<TYPE> *node)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::free_node (ACE_Timer_Node_T<TYPE> *node)
{
this->free_list_->add (node);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_LOCK &
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::mutex (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_LOCK &
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::mutex (void)
{
return this->mutex_;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> long
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::schedule (const TYPE &type,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> long
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::schedule (const TYPE &type,
const void *act,
const ACE_Time_Value &future_time,
const ACE_Time_Value &interval)
@@ -249,8 +252,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::schedule (const TYPE &type,
// Run the <handle_timeout> method for all Timers whose values are <=
// <cur_time>.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value &cur_time)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::expire (const ACE_Time_Value &cur_time)
{
ACE_TRACE ("ACE_Timer_Queue_T::expire");
ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));
@@ -287,8 +290,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value &cur_ti
return number_of_timers_expired;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::recompute_next_abs_interval_time
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::recompute_next_abs_interval_time
(ACE_Timer_Node_T<TYPE> *expired,
const ACE_Time_Value &cur_time)
{
@@ -347,8 +350,52 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::recompute_next_abs_interval_time
}
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info_i (const ACE_Time_Value &cur_time,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::expire_single (
+ ACE_Command_Base & pre_dispatch_command)
+{
+ ACE_TRACE ("ACE_Timer_Queue_T::expire_single");
+ ACE_Timer_Node_Dispatch_Info_T<TYPE> info;
+ ACE_Time_Value cur_time;
+ {
+ // Create a scope for the lock ...
+ ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));
+
+ if (this->is_empty ())
+ return 0;
+
+ // Get the current time
+ cur_time = this->gettimeofday_static () + this->timer_skew ();
+
+ // Look for a node in the timer queue whose timer <= the present
+ // time.
+ if (!this->dispatch_info_i (cur_time, info))
+ {
+ return 0;
+ }
+ }
+ // We do not need the lock anymore, all these operations take place
+ // with local variables.
+ const void *upcall_act = 0;
+
+ // Preinvoke (handles refcount if needed, etc.)
+ this->preinvoke (info, cur_time, upcall_act);
+
+ // Release the token before expiration upcall.
+ pre_dispatch_command.execute();
+
+ // call the functor
+ this->upcall (info, cur_time);
+
+ // Postinvoke (undo refcount if needed, etc.)
+ this->postinvoke (info, cur_time, upcall_act);
+
+ // We have dispatched a timer
+ return 1;
+}
+
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::dispatch_info_i (const ACE_Time_Value &cur_time,
ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
{
ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info_i");
@@ -388,155 +435,13 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info_i (const ACE_Time_Valu
return 0;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::return_node (ACE_Timer_Node_T<TYPE> *node)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::return_node (ACE_Timer_Node_T<TYPE> *node)
{
ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_));
this->free_node (node);
}
-
-template <class ACE_LOCK>
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::ACE_Event_Handler_Handle_Timeout_Upcall (void)
-{
-}
-
-template <class ACE_LOCK>
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::~ACE_Event_Handler_Handle_Timeout_Upcall (void)
-{
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::registration (TIMER_QUEUE &,
- ACE_Event_Handler *event_handler,
- const void *)
-{
- event_handler->add_reference ();
- return 0;
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::preinvoke (TIMER_QUEUE & /* timer_queue */,
- ACE_Event_Handler *event_handler,
- const void * /* timer_act */,
- int /* recurring_timer */,
- const ACE_Time_Value & /* cur_time */,
- const void *&upcall_act)
-{
- bool const requires_reference_counting =
- event_handler->reference_counting_policy ().value () ==
- ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
-
- if (requires_reference_counting)
- {
- event_handler->add_reference ();
-
- upcall_act = &this->requires_reference_counting_;
- }
-
- return 0;
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::postinvoke (TIMER_QUEUE & /* timer_queue */,
- ACE_Event_Handler *event_handler,
- const void * /* timer_act */,
- int /* recurring_timer */,
- const ACE_Time_Value & /* cur_time */,
- const void *upcall_act)
-{
- if (upcall_act == &this->requires_reference_counting_)
- {
- event_handler->remove_reference ();
- }
-
- return 0;
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::timeout (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *event_handler,
- const void *act,
- int recurring_timer,
- const ACE_Time_Value &cur_time)
-{
- int requires_reference_counting = 0;
-
- if (!recurring_timer)
- {
- requires_reference_counting =
- event_handler->reference_counting_policy ().value () ==
- ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
- }
-
- // Upcall to the <handler>s handle_timeout method.
- if (event_handler->handle_timeout (cur_time, act) == -1)
- {
- if (event_handler->reactor_timer_interface ())
- event_handler->reactor_timer_interface ()->cancel_timer (event_handler, 0);
- else
- timer_queue.cancel (event_handler, 0); // 0 means "call handle_close()".
- }
-
- if (!recurring_timer &&
- requires_reference_counting)
- {
- event_handler->remove_reference ();
- }
-
- return 0;
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::cancel_type (TIMER_QUEUE &,
- ACE_Event_Handler *event_handler,
- int dont_call,
- int &requires_reference_counting)
-{
- requires_reference_counting =
- event_handler->reference_counting_policy ().value () ==
- ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
-
- // Upcall to the <handler>s handle_close method
- if (dont_call == 0)
- event_handler->handle_close (ACE_INVALID_HANDLE,
- ACE_Event_Handler::TIMER_MASK);
-
- return 0;
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::cancel_timer (TIMER_QUEUE &,
- ACE_Event_Handler *event_handler,
- int,
- int requires_reference_counting)
-{
- if (requires_reference_counting)
- event_handler->remove_reference ();
-
- return 0;
-}
-
-template <class ACE_LOCK> int
-ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::deletion (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *event_handler,
- const void *)
-{
- int requires_reference_counting = 0;
-
- this->cancel_type (timer_queue,
- event_handler,
- 0,
- requires_reference_counting);
-
- this->cancel_timer (timer_queue,
- event_handler,
- 0,
- requires_reference_counting);
-
- return 0;
-}
-
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_TIMER_QUEUE_T_CPP */
diff --git a/dep/acelite/ace/Timer_Queue_T.h b/dep/acelite/ace/Timer_Queue_T.h
index 5e316e1e04b..ffd0a3726ed 100644
--- a/dep/acelite/ace/Timer_Queue_T.h
+++ b/dep/acelite/ace/Timer_Queue_T.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Queue_T.h
*
- * $Id: Timer_Queue_T.h 89254 2010-02-25 22:10:39Z cleeland $
+ * $Id: Timer_Queue_T.h 95362 2011-12-18 11:56:24Z johnnyw $
*
* @author Doug Schmidt <schmidt@cs.wustl.edu>
* @author Irfan Pyarali <irfan@cs.wustl.edu> and
@@ -22,176 +22,43 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/Event_Handler.h"
#include "ace/Time_Value.h"
+#include "ace/Abstract_Timer_Queue.h"
+#include "ace/Timer_Queue_Iterator.h"
+#include "ace/Time_Policy.h"
+#include "ace/Copy_Disabled.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
- * @class ACE_Timer_Node_Dispatch_Info_T
+ * @class ACE_Timer_Queue_Upcall_Base
*
- * @brief Maintains generated dispatch information for Timer nodes.
- *
- */
-template <class TYPE>
-class ACE_Timer_Node_Dispatch_Info_T
-{
-public:
- /// The type of object held in the queue
- TYPE type_;
-
- /// Asynchronous completion token associated with the timer.
- const void *act_;
-
- /// Flag to check if the timer is recurring.
- int recurring_timer_;
-};
-
-/**
- * @class ACE_Timer_Node_T
- *
- * @brief Maintains the state associated with a Timer entry.
+ * Common base class for all timer queues with the same time source
+ * policy. This is really motivated by a single use-case in the code,
+ * namely the ACE_Proactor needs to set a backpointer in the upcall
+ * functor.
*/
-template <class TYPE>
-class ACE_Timer_Node_T
+template<typename TYPE, typename FUNCTOR>
+class ACE_Timer_Queue_Upcall_Base
+ : public ACE_Abstract_Timer_Queue<TYPE>
+ , private ACE_Copy_Disabled
{
public:
- /// Default constructor
- ACE_Timer_Node_T (void);
+ // Constructor
+ explicit ACE_Timer_Queue_Upcall_Base(FUNCTOR * upcall_functor = 0);
/// Destructor
- ~ACE_Timer_Node_T (void);
-
- /// Useful typedef ..
- typedef ACE_Timer_Node_Dispatch_Info_T <TYPE> DISPATCH_INFO;
-
- /// Singly linked list
- void set (const TYPE &type,
- const void *a,
- const ACE_Time_Value &t,
- const ACE_Time_Value &i,
- ACE_Timer_Node_T<TYPE> *n,
- long timer_id);
-
- /// Doubly linked list version
- void set (const TYPE &type,
- const void *a,
- const ACE_Time_Value &t,
- const ACE_Time_Value &i,
- ACE_Timer_Node_T<TYPE> *p,
- ACE_Timer_Node_T<TYPE> *n,
- long timer_id);
-
- // = Accessors
-
- /// Get the type.
- TYPE &get_type (void);
-
- /// Set the type.
- void set_type (TYPE &type);
-
- /// Get the asynchronous completion token.
- const void *get_act (void);
-
- /// Set the asynchronous completion token.
- void set_act (void *act);
-
- /// Get the timer value.
- const ACE_Time_Value &get_timer_value (void) const;
-
- /// Set the timer value.
- void set_timer_value (const ACE_Time_Value &timer_value);
-
- /// Get the timer interval.
- const ACE_Time_Value &get_interval (void) const;
-
- /// Set the timer interval.
- void set_interval (const ACE_Time_Value &interval);
-
- /// Get the previous pointer.
- ACE_Timer_Node_T<TYPE> *get_prev (void);
-
- /// Set the previous pointer.
- void set_prev (ACE_Timer_Node_T<TYPE> *prev);
-
- /// Get the next pointer.
- ACE_Timer_Node_T<TYPE> *get_next (void);
-
- /// Set the next pointer.
- void set_next (ACE_Timer_Node_T<TYPE> *next);
-
- /// Get the timer_id.
- long get_timer_id (void) const;
-
- /// Set the timer_id.
- void set_timer_id (long timer_id);
+ virtual ~ACE_Timer_Queue_Upcall_Base (void);
- /// Get the dispatch info. The dispatch information is got
- /// through <info>. This form helps us in preventing allocation and
- /// deleting data along the criticl path.
- /// @@TODO: We may want to have a copying version too, so that our
- /// interface will be complete..
- void get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T <TYPE> &info);
-
- /// Dump the state of an TYPE.
- void dump (void) const;
-
-private:
- /// Type of object stored in the Queue
- TYPE type_;
-
- /// Asynchronous completion token associated with the timer.
- const void *act_;
-
- /// Time until the timer expires.
- ACE_Time_Value timer_value_;
-
- /// If this is a periodic timer this holds the time until the next
- /// timeout.
- ACE_Time_Value interval_;
-
- /// Pointer to previous timer.
- ACE_Timer_Node_T<TYPE> *prev_;
-
- /// Pointer to next timer.
- ACE_Timer_Node_T<TYPE> *next_;
-
- /// Id of this timer (used to cancel timers before they expire).
- long timer_id_;
-};
-
-/**
- * @class ACE_Timer_Queue_Iterator_T
- *
- * @brief Generic interface for iterating over a subclass of
- * ACE_Timer_Queue.
- *
- * This is a generic iterator that can be used to visit every
- * node of a timer queue. Be aware that it isn't guaranteed
- * that the transversal will be in order of timeout values.
- */
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-class ACE_Timer_Queue_Iterator_T
-{
-public:
- // = Initialization and termination methods.
- /// Constructor.
- ACE_Timer_Queue_Iterator_T (void);
-
- /// Destructor.
- virtual ~ACE_Timer_Queue_Iterator_T (void);
-
- /// Positions the iterator at the earliest node in the Timer Queue
- virtual void first (void) = 0;
-
- /// Positions the iterator at the next node in the Timer Queue
- virtual void next (void) = 0;
+ /// Accessor to the upcall functor
+ FUNCTOR & upcall_functor (void);
- /// Returns true when there are no more nodes in the sequence
- virtual bool isdone (void) const = 0;
+protected:
+ /// Upcall functor
+ FUNCTOR *upcall_functor_;
- /// Returns the node at the current position in the sequence
- virtual ACE_Timer_Node_T<TYPE> *item (void) = 0;
+ /// To delete or not to delete is the question?
+ bool const delete_upcall_functor_;
};
/**
@@ -203,13 +70,11 @@ public:
* implementing specialized policies such as ACE_Timer_List
* and ACE_Timer_Heap.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
class ACE_Timer_Queue_T
+ : public ACE_Timer_Queue_Upcall_Base<TYPE,FUNCTOR>
{
public:
- /// Type of Iterator.
- typedef ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> ITERATOR;
-
// = Initialization and termination methods.
/**
* Default constructor. @a upcall_functor is the instance of the
@@ -218,78 +83,31 @@ public:
* timer nodes. If 0, then a default freelist will be created.
*/
ACE_Timer_Queue_T (FUNCTOR *upcall_functor = 0,
- ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0);
+ ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/// Destructor - make virtual for proper destruction of inherited
/// classes.
virtual ~ACE_Timer_Queue_T (void);
- /// True if queue is empty, else false.
- virtual bool is_empty (void) const = 0;
-
- /// Returns the time of the earlier node in the Timer_Queue. Must
- /// be called on a non-empty queue.
- virtual const ACE_Time_Value &earliest_time (void) const = 0;
-
/**
- * Schedule @a type that will expire at @a future_time, which is
- * specified in absolute time. If it expires then @a act is passed
- * in as the value to the <functor>. If @a interval is != to
- * ACE_Time_Value::zero then it is used to reschedule the @a type
- * automatically, using relative time to the current <gettimeofday>.
- * This method returns a <timer_id> that uniquely identifies the the
- * @a type entry in an internal list. This <timer_id> can be used to
- * cancel the timer before it expires. The cancellation ensures
- * that <timer_ids> are unique up to values of greater than 2
- * billion timers. As long as timers don't stay around longer than
- * this there should be no problems with accidentally deleting the
- * wrong timer. Returns -1 on failure (which is guaranteed never to
- * be a valid <timer_id>).
+ * Implement ACE_Abstract_Timer_Queue<TYPE>::schedule () with the right
+ * locking strategy.
*/
virtual long schedule (const TYPE &type,
const void *act,
const ACE_Time_Value &future_time,
const ACE_Time_Value &interval = ACE_Time_Value::zero);
+ //@{
/**
- * Resets the interval of the timer represented by @a timer_id to
- * @a interval, which is specified in relative time to the current
- * <gettimeofday>. If @a interval is equal to
- * ACE_Time_Value::zero, the timer will become a non-rescheduling
- * timer. Returns 0 if successful, -1 if not.
- */
- virtual int reset_interval (long timer_id,
- const ACE_Time_Value &interval) = 0;
-
- /**
- * Cancel all timer associated with @a type. If
- * @a dont_call_handle_close is 0 then the <functor> will be invoked,
- * which typically invokes the <handle_close> hook. Returns number
- * of timers cancelled.
- */
- virtual int cancel (const TYPE &type,
- int dont_call_handle_close = 1) = 0;
-
- /**
- * Cancel the single timer that matches the @a timer_id value (which
- * was returned from the <schedule> method). If act is non-NULL
- * then it will be set to point to the ``magic cookie'' argument
- * passed in when the timer was registered. This makes it possible
- * to free up the memory and avoid memory leaks. If
- * @a dont_call_handle_close is 0 then the <functor> will be invoked,
- * which typically calls the <handle_close> hook. Returns 1 if
- * cancellation succeeded and 0 if the @a timer_id wasn't found.
- */
- virtual int cancel (long timer_id,
- const void **act = 0,
- int dont_call_handle_close = 1) = 0;
-
- /**
- * Run the <functor> for all timers whose values are <= @a current_time.
- * This does not account for <timer_skew>. Returns the number of
- * timers canceled.
+ * Implement ACE_Abstract_Timer_Queue<TYPE>::expire () with the right
+ * locking strategy.
*/
virtual int expire (const ACE_Time_Value &current_time);
+ virtual int expire (void);
+ virtual int expire_single(ACE_Command_Base & pre_dispatch_command);
+ //@}
/**
* Get the dispatch information for a timer whose value is <= @a current_time.
@@ -300,73 +118,46 @@ public:
virtual int dispatch_info (const ACE_Time_Value &current_time,
ACE_Timer_Node_Dispatch_Info_T<TYPE> &info);
+
+
+ //@{
/**
- * Run the <functor> for all timers whose values are <=
- * <ACE_OS::gettimeofday>. Also accounts for <timer_skew>.
- *
- * Depending on the resolution of the underlying OS the system calls
- * like select()/poll() might return at time different than that is
- * specified in the timeout. Suppose the OS guarantees a resolution of t ms.
- * The timeline will look like
- *
- * A B
- * | |
- * V V
- * |-------------|-------------|-------------|-------------|
- * t t t t t
- *
- *
- * If you specify a timeout value of A, then the timeout will not occur
- * at A but at the next interval of the timer, which is later than
- * that is expected. Similarly, if your timeout value is equal to B,
- * then the timeout will occur at interval after B. Now depending upon the
- * resolution of your timeouts and the accuracy of the timeouts
- * needed for your application, you should set the value of
- * <timer_skew>. In the above case, if you want the timeout A to fire
- * no later than A, then you should specify your <timer_skew> to be
- * A % t.
- *
- * The timeout value should be specified via the macro ACE_TIMER_SKEW
- * in your config.h file. The default value is zero.
- *
- * Things get interesting if the t before the timeout value B is zero
- * i.e your timeout is less than the interval. In that case, you are
- * almost sure of not getting the desired timeout behaviour. Maybe you
- * should look for a better OS :-)
- *
- * Returns the number of timers canceled.
+ * Implement the gettimeofday() virtual function
*/
-
- /* virtual */ int expire (void);
+ virtual ACE_Time_Value gettimeofday (void);
+ //@}
/**
- * Returns the current time of day. This method allows different
- * implementations of the timer queue to use special high resolution
- * timers.
+ * Allows applications to control how the timer queue gets the time
+ * of day.
+ * @deprecated Use TIME_POLICY support instead.
+ * This will only have effect when the TIME_POLICY used
+ * is ACE_FPointer_Time_Policy. Other standard ACE time
+ * policies will ignore this.
*/
- /* virtual */ ACE_Time_Value gettimeofday (void);
+ virtual void gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+
+ /// Implement an inlined, non-abstract version of gettimeofday(),
+ /// through this member function the internals of the class can
+ /// make calls to ACE_OS::gettimeofday() with zero overhead.
+ ACE_Time_Value gettimeofday_static();
/// Allows applications to control how the timer queue gets the time
/// of day.
- void gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+ void set_time_policy(TIME_POLICY const & time_policy);
/// Determine the next event to timeout. Returns @a max if there are
/// no pending timers or if all pending timers are longer than max.
/// This method acquires a lock internally since it modifies internal state.
- virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max);
-
+ //@{
/**
- * Determine the next event to timeout. Returns @a max if there are
- * no pending timers or if all pending timers are longer than max.
- * <the_timeout> should be a pointer to storage for the timeout value,
- * and this value is also returned. This method does not acquire a
- * lock internally since it doesn't modify internal state. If you
- * need to call this method when the queue is being modified
- * concurrently, however, you should make sure to acquire the <mutex()>
- * externally before making the call.
+ * Implement calculate_timeout() using the right locking policy
*/
+ virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max);
virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max,
ACE_Time_Value *the_timeout);
+ virtual ACE_Time_Value current_time();
+ //@}
/// Set the timer skew for the Timer_Queue.
void timer_skew (const ACE_Time_Value &skew);
@@ -377,21 +168,9 @@ public:
/// Synchronization variable used by the queue
ACE_LOCK &mutex (void);
- /// Accessor to the upcall functor
- FUNCTOR &upcall_functor (void);
-
- /// Returns a pointer to this ACE_Timer_Queue's iterator.
- virtual ITERATOR &iter (void) = 0;
-
- /// Removes the earliest node from the queue and returns it
- virtual ACE_Timer_Node_T<TYPE> *remove_first (void) = 0;
-
/// Dump the state of a object.
virtual void dump (void) const;
- /// Reads the earliest node from the queue and returns it.
- virtual ACE_Timer_Node_T<TYPE> *get_first (void) = 0;
-
/// Method used to return a timer node to the queue's ownership
/// after it is returned by a method like <remove_first>.
virtual void return_node (ACE_Timer_Node_T<TYPE> *);
@@ -442,14 +221,8 @@ protected:
/// Class that implements a free list
ACE_Free_List<ACE_Timer_Node_T<TYPE> > *free_list_;
- /// Pointer to function that returns the current time of day.
- ACE_Time_Value (*gettimeofday_)(void);
-
- /// Upcall functor
- FUNCTOR *upcall_functor_;
-
- /// To delete or not to delete is the question?
- bool const delete_upcall_functor_;
+ /// The policy to return the current time of day
+ TIME_POLICY time_policy_;
/// Flag to delete only if the class created the <free_list_>
bool const delete_free_list_;
@@ -461,91 +234,6 @@ private:
/// Adjusts for timer skew in various clocks.
ACE_Time_Value timer_skew_;
-
- // = Don't allow these operations for now.
- ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Queue_T (const ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> &))
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> &))
-};
-
-/**
- * @class ACE_Event_Handler_Handle_Timeout_Upcall
- *
- * @brief Functor for Timer_Queues.
- *
- * This class implements the functor required by the Timer
- * Queue to call <handle_timeout> on ACE_Event_Handlers.
- */
-template <class ACE_LOCK>
-class ACE_Event_Handler_Handle_Timeout_Upcall
-{
-public:
- typedef ACE_Timer_Queue_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>,
- ACE_LOCK>
- TIMER_QUEUE;
-
- // = Initialization and termination methods.
- /// Constructor.
- ACE_Event_Handler_Handle_Timeout_Upcall (void);
-
- /// Destructor.
- ~ACE_Event_Handler_Handle_Timeout_Upcall (void);
-
- /// This method is called when a timer is registered.
- int registration (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- const void *arg);
-
- /// This method is called before the timer expires.
- int preinvoke (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- const void *arg,
- int recurring_timer,
- const ACE_Time_Value &cur_time,
- const void *&upcall_act);
-
- /// This method is called when the timer expires.
- int timeout (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- const void *arg,
- int recurring_timer,
- const ACE_Time_Value &cur_time);
-
- /// This method is called after the timer expires.
- int postinvoke (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- const void *arg,
- int recurring_timer,
- const ACE_Time_Value &cur_time,
- const void *upcall_act);
-
- /// This method is called when a handler is cancelled
- int cancel_type (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- int dont_call,
- int &requires_reference_counting);
-
- /// This method is called when a timer is cancelled
- int cancel_timer (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- int dont_call,
- int requires_reference_counting);
-
- /// This method is called when the timer queue is destroyed and
- /// the timer is still contained in it
- int deletion (TIMER_QUEUE &timer_queue,
- ACE_Event_Handler *handler,
- const void *arg);
-
-private:
-
- /// Flag indicating that reference counting is required for this
- /// event handler upcall.
- int requires_reference_counting_;
-
- // = Don't allow these operations for now.
- ACE_UNIMPLEMENTED_FUNC (ACE_Event_Handler_Handle_Timeout_Upcall (const ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK> &))
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK> &))
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_Queue_T.inl b/dep/acelite/ace/Timer_Queue_T.inl
index 7606a2e1f62..eb896b6b8bd 100644
--- a/dep/acelite/ace/Timer_Queue_T.inl
+++ b/dep/acelite/ace/Timer_Queue_T.inl
@@ -1,160 +1,38 @@
// -*- C++ -*-
//
-// $Id: Timer_Queue_T.inl 80826 2008-03-04 14:51:23Z wotte $
+// $Id: Timer_Queue_T.inl 95332 2011-12-15 11:09:41Z mcorino $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
- const void *a,
- const ACE_Time_Value &t,
- const ACE_Time_Value &i,
- ACE_Timer_Node_T<TYPE> *n,
- long timer_id)
+template <class TYPE, class FUNCTOR> ACE_INLINE FUNCTOR &
+ACE_Timer_Queue_Upcall_Base<TYPE, FUNCTOR>::upcall_functor (void)
{
- this->type_ = type;
- this->act_ = a;
- this->timer_value_ = t;
- this->interval_ = i;
- this->next_ = n;
- this->timer_id_ = timer_id;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
- const void *a,
- const ACE_Time_Value &t,
- const ACE_Time_Value &i,
- ACE_Timer_Node_T<TYPE> *p,
- ACE_Timer_Node_T<TYPE> *n,
- long timer_id)
-{
- this->type_ = type;
- this->act_ = a;
- this->timer_value_ = t;
- this->interval_ = i;
- this->prev_ = p;
- this->next_ = n;
- this->timer_id_ = timer_id;
-}
-
-template <class TYPE> ACE_INLINE TYPE &
-ACE_Timer_Node_T<TYPE>::get_type (void)
-{
- return this->type_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_type (TYPE &type)
-{
- this->type_ = type;
-}
-
-template <class TYPE> ACE_INLINE const void *
-ACE_Timer_Node_T<TYPE>::get_act (void)
-{
- return this->act_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_act (void *act)
-{
- this->act_ = act;
-}
-
-template <class TYPE> ACE_INLINE const ACE_Time_Value &
-ACE_Timer_Node_T<TYPE>::get_timer_value (void) const
-{
- return this->timer_value_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_timer_value (const ACE_Time_Value &timer_value)
-{
- this->timer_value_ = timer_value;
-}
-
-template <class TYPE> ACE_INLINE const ACE_Time_Value &
-ACE_Timer_Node_T<TYPE>::get_interval (void) const
-{
- return this->interval_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_interval (const ACE_Time_Value &interval)
-{
- this->interval_ = interval;
-}
-
-template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Node_T<TYPE>::get_prev (void)
-{
- return this->prev_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_prev (ACE_Timer_Node_T<TYPE> *prev)
-{
- this->prev_ = prev;
-}
-
-template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Node_T<TYPE>::get_next (void)
-{
- return this->next_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_next (ACE_Timer_Node_T<TYPE> *next)
-{
- this->next_ = next;
-}
-
-template <class TYPE> ACE_INLINE long
-ACE_Timer_Node_T<TYPE>::get_timer_id (void) const
-{
- return this->timer_id_;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::set_timer_id (long timer_id)
-{
- this->timer_id_ = timer_id;
-}
-
-template <class TYPE> ACE_INLINE void
-ACE_Timer_Node_T<TYPE>::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
-{
- // Yes, do a copy
- info.type_ = this->type_;
- info.act_ = this->act_;
- info.recurring_timer_ =
- this->interval_ > ACE_Time_Value::zero;
+ return *this->upcall_functor_;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::timer_skew (const ACE_Time_Value &skew)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::timer_skew (const ACE_Time_Value &skew)
{
timer_skew_ = skew;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE const ACE_Time_Value &
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::timer_skew (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE const ACE_Time_Value &
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::timer_skew (void) const
{
return timer_skew_;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE int
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE int
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::expire (void)
{
if (!this->is_empty ())
- return this->expire (this->gettimeofday () + timer_skew_);
+ return this->expire (this->gettimeofday_static () + timer_skew_);
else
return 0;
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info (const ACE_Time_Value &cur_time,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::dispatch_info (const ACE_Time_Value &cur_time,
ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
{
ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info");
@@ -163,8 +41,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info (const ACE_Time_Value
return this->dispatch_info_i (cur_time, info);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::upcall (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
const ACE_Time_Value &cur_time)
{
this->upcall_functor ().timeout (*this,
@@ -174,8 +52,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall (ACE_Timer_Node_Dispatch_Info
cur_time);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::preinvoke (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::preinvoke (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
const ACE_Time_Value &cur_time,
const void *&upcall_act)
{
@@ -187,8 +65,8 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::preinvoke (ACE_Timer_Node_Dispatch_I
upcall_act);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::postinvoke (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::postinvoke (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
const ACE_Time_Value &cur_time,
const void *upcall_act)
{
@@ -200,23 +78,17 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::postinvoke (ACE_Timer_Node_Dispatch_
upcall_act);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE ACE_Time_Value
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::gettimeofday (void)
-{
- // Invoke gettimeofday via pointer to function.
- return this->gettimeofday_ ();
-}
-
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::gettimeofday (ACE_Time_Value (*gettimeofday)(void))
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE ACE_Time_Value
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::gettimeofday_static (void)
{
- this->gettimeofday_ = gettimeofday;
+ // Get the current time according to the time policy.
+ return this->time_policy_ ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE FUNCTOR &
-ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall_functor (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_INLINE void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::set_time_policy (TIME_POLICY const & rhs)
{
- return *this->upcall_functor_;
+ this->time_policy_ = rhs;
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_Queuefwd.h b/dep/acelite/ace/Timer_Queuefwd.h
index 662f29c0411..46f0612cc87 100644
--- a/dep/acelite/ace/Timer_Queuefwd.h
+++ b/dep/acelite/ace/Timer_Queuefwd.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Queuefwd.h
*
- * $Id: Timer_Queuefwd.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_Queuefwd.h 95332 2011-12-15 11:09:41Z mcorino $
*
* Forward declarations and typedefs of ACE_Timer_Queue class.
*
@@ -17,19 +17,13 @@
#include /**/ "ace/pre.h"
-#include "ace/Synch_Traits.h"
+#include "ace/config-all.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TYPE, class FUNCTOR, class ACE_LOCK> class ACE_Timer_Queue_T;
-template <class ACE_LOCK> class ACE_Event_Handler_Handle_Timeout_Upcall;
-
class ACE_Event_Handler;
-
-typedef ACE_Timer_Queue_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
- ACE_SYNCH_RECURSIVE_MUTEX>
- ACE_Timer_Queue;
+template <class TYPE> class ACE_Abstract_Timer_Queue;
+typedef ACE_Abstract_Timer_Queue<ACE_Event_Handler*> ACE_Timer_Queue;
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_Wheel.h b/dep/acelite/ace/Timer_Wheel.h
index 21ba8776102..12b8bff0d5d 100644
--- a/dep/acelite/ace/Timer_Wheel.h
+++ b/dep/acelite/ace/Timer_Wheel.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Wheel.h
*
- * $Id: Timer_Wheel.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Timer_Wheel.h 95335 2011-12-15 13:13:17Z msmit $
*
* @author Darrell Brunsch (brunsch@cs.wustl.edu)
*/
@@ -16,6 +16,7 @@
#include /**/ "ace/pre.h"
#include "ace/Timer_Wheel_T.h"
+#include "ace/Event_Handler_Handle_Timeout_Upcall.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -27,13 +28,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// compatibility.
typedef ACE_Timer_Wheel_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX>
ACE_Timer_Wheel;
typedef ACE_Timer_Wheel_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_SYNCH_RECURSIVE_MUTEX>,
- ACE_SYNCH_RECURSIVE_MUTEX>
+ ACE_Event_Handler_Handle_Timeout_Upcall,
+ ACE_SYNCH_RECURSIVE_MUTEX,
+ ACE_Default_Time_Policy>
ACE_Timer_Wheel_Iterator;
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/Timer_Wheel_T.cpp b/dep/acelite/ace/Timer_Wheel_T.cpp
index 529cc456d50..4d596ed2c9b 100644
--- a/dep/acelite/ace/Timer_Wheel_T.cpp
+++ b/dep/acelite/ace/Timer_Wheel_T.cpp
@@ -1,4 +1,4 @@
-// $Id: Timer_Wheel_T.cpp 89254 2010-02-25 22:10:39Z cleeland $
+// $Id: Timer_Wheel_T.cpp 95401 2011-12-31 22:17:35Z schmidt $
#ifndef ACE_TIMER_WHEEL_T_CPP
#define ACE_TIMER_WHEEL_T_CPP
@@ -41,12 +41,13 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* @param upcall_functor A pointer to a functor to use instead of the default
* @param freelist A pointer to a freelist to use instead of the default
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Wheel_T
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_Wheel_T
(FUNCTOR* upcall_functor
, FreeList* freelist
+ , TIME_POLICY const & time_policy
)
-: Base (upcall_functor, freelist)
+ : Base_Timer_Queue (upcall_functor, freelist, time_policy)
, spokes_(0)
, spoke_count_(0) // calculated in open_i
, spoke_bits_(0)
@@ -71,14 +72,15 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Wheel_T
* @param upcall_functor A pointer to a functor to use instead of the default
* @param freelist A pointer to a freelist to use instead of the default
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Wheel_T
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::ACE_Timer_Wheel_T
(u_int spoke_count,
u_int resolution,
size_t prealloc,
FUNCTOR* upcall_functor,
- FreeList* freelist)
-: Base (upcall_functor, freelist)
+ FreeList* freelist,
+ TIME_POLICY const & time_policy)
+: Base_Timer_Queue (upcall_functor, freelist, time_policy)
, spokes_ (0)
, spoke_count_ (0) // calculated in open_i
, spoke_bits_ (0)
@@ -91,8 +93,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Wheel_T
this->open_i (prealloc, spoke_count, resolution);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::power2bits (int n,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::power2bits (int n,
int min_bits,
int max_bits)
{
@@ -127,14 +129,12 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::power2bits (int n,
* Initialize the queue. Uses the established members for all needed
* information.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::open_i
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::open_i
(size_t prealloc, u_int spokes, u_int res)
{
ACE_TRACE ("ACE_Timer_Wheel_T::open_i");
- this->gettimeofday (ACE_OS::gettimeofday);
-
// Rather than waste bits in our timer id, we might as well round up
// the spoke count to the next power of two - 1 . (i.e 1,3,7,15,...127,etc.)
const int MIN_SPOKE_BITS = 3; // Allow between 8 and 4096 spokes
@@ -164,13 +164,30 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::open_i
}
/// Destructor just cleans up its memory
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Wheel_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::~ACE_Timer_Wheel_T (void)
{
ACE_TRACE ("ACE_Timer_Wheel_T::~ACE_Timer_Wheel_T");
delete iterator_;
+ this->close ();
+ for (u_int i = 0; i < this->spoke_count_; ++i)
+ {
+ // Free all the nodes starting at the root
+ ACE_Timer_Node_T<TYPE>* root = this->spokes_[i];
+ this->free_node (root);
+ }
+
+ delete[] this->spokes_;
+}
+
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::close (void)
+{
+ ACE_TRACE ("ACE_Timer_Wheel_T::close");
+
+ // Remove any remaining nodes
for (u_int i = 0; i < this->spoke_count_; ++i)
{
// Free all the nodes starting at the root
@@ -184,15 +201,16 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Wheel_T (void)
this->free_node (n);
n = next;
}
- delete root;
}
- delete[] this->spokes_;
+
+ // Leave rest for destructor
+ return 0;
}
/// Searches for a node by timer_id within one spoke.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE>*
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::find_spoke_node
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::find_spoke_node
(u_int spoke, long timer_id) const
{
ACE_Timer_Node_T<TYPE>* root = this->spokes_[spoke];
@@ -208,9 +226,9 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::find_spoke_node
/// Searches all spokes for a node matching the specified timer_id
/// Uses the spoke encoded in the timer_id as a starting place.
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE>*
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::find_node (long timer_id) const
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::find_node (long timer_id) const
{
if (timer_id == -1)
return 0;
@@ -244,8 +262,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::find_node (long timer_id) const
*
* @return True if empty
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> bool
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> bool
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::is_empty (void) const
{
ACE_TRACE ("ACE_Timer_Wheel_T::is_empty");
return timer_count_ == 0;
@@ -255,8 +273,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const
/**
* @return First (earliest) node in the wheel_'s earliest_spoke_ list
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> const ACE_Time_Value &
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> const ACE_Time_Value &
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::earliest_time (void) const
{
ACE_TRACE ("ACE_Timer_Wheel_T::earliest_time");
ACE_Timer_Node_T<TYPE>* n = this->get_first_i ();
@@ -268,8 +286,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const
/// Uses a simple hash to find which spoke to use based on when the
/// timer is due to expire. Hopefully the 64bit int operations avoid
/// any overflow problems.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> u_int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_spoke
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> u_int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::calculate_spoke
(const ACE_Time_Value& t) const
{
return static_cast<u_int> ((t.msec () >> this->res_bits_) & (this->spoke_count_ - 1));
@@ -280,8 +298,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_spoke
/// have to do exhaustive searches within the spoke to ensure that a particular
/// timer id is not already in use. Some optimizations are in place so
/// that this hopefully doesn't have to happen often.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> long
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::generate_timer_id (u_int spoke)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> long
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::generate_timer_id (u_int spoke)
{
int cnt_bits = sizeof (long) * 8 - this->spoke_bits_;
@@ -382,8 +400,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::generate_timer_id (u_int spoke)
* @return Unique identifier (can be used to cancel the timer).
* -1 on failure.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> long
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (const TYPE& type,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> long
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::schedule_i (const TYPE& type,
const void* act,
const ACE_Time_Value& future_time,
const ACE_Time_Value& interval)
@@ -418,8 +436,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (const TYPE& type,
*
* @param n The timer node to reschedule
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE>* n)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reschedule (ACE_Timer_Node_T<TYPE>* n)
{
ACE_TRACE ("ACE_Timer_Wheel_T::reschedule");
const ACE_Time_Value& expire = n->get_timer_value ();
@@ -428,8 +446,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE>*
}
/// The shared scheduling functionality between schedule() and reschedule()
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::schedule_i
(ACE_Timer_Node_T<TYPE>* n,
u_int spoke,
const ACE_Time_Value& expire)
@@ -476,8 +494,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i
*
* @return 0 if successful, -1 if no.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::reset_interval (long timer_id,
const ACE_Time_Value &interval
)
{
@@ -506,8 +524,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
*
* @return Number of timers cancelled
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE& type, int skip_close)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel (const TYPE& type, int skip_close)
{
ACE_TRACE ("ACE_Timer_Wheel_T::cancel");
@@ -589,8 +607,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE& type, int skip_c
* @return 1 for sucess and 0 if the timer_id wasn't found (or was
* found to be invalid)
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel (long timer_id,
const void **act,
int skip_close)
{
@@ -631,8 +649,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
}
/// Shared subset of the two cancel() methods.
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::cancel_i (ACE_Timer_Node_T<TYPE>* n)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::cancel_i (ACE_Timer_Node_T<TYPE>* n)
{
this->unlink (n);
this->free_node (n);
@@ -644,8 +662,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::cancel_i (ACE_Timer_Node_T<TYPE>* n)
/// determined from their expiration time.
/// The last time is always passed in, even though you can often calculate
/// it as get_first()->get_timer_value().
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::recalc_earliest
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::recalc_earliest
(const ACE_Time_Value& last)
{
// This is possible because we use a count for is_empty()
@@ -687,8 +705,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::recalc_earliest
* Dumps out the size of the wheel, the resolution, and the contents
* of the wheel.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Timer_Wheel_T::dump");
@@ -723,15 +741,15 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
*
* @return The earliest timer node.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::remove_first (void)
{
ACE_TRACE ("ACE_Timer_Wheel_T::remove_first");
return remove_first_expired (ACE_Time_Value::max_time);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::unlink (ACE_Timer_Node_T<TYPE>* n)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::unlink (ACE_Timer_Node_T<TYPE>* n)
{
ACE_TRACE ("ACE_Timer_Wheel_T::unlink");
--timer_count_;
@@ -741,8 +759,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::unlink (ACE_Timer_Node_T<TYPE>* n)
n->set_next (0);
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first_expired (const ACE_Time_Value& now)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::remove_first_expired (const ACE_Time_Value& now)
{
ACE_Timer_Node_T<TYPE>* n = this->get_first ();
if (n != 0 && n->get_timer_value() <= now)
@@ -759,17 +777,17 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first_expired (const ACE_Time
*
* @return The earliest timer node.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE>*
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::get_first (void)
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::get_first (void)
{
ACE_TRACE ("ACE_Timer_Wheel_T::get_first");
return this->get_first_i ();
}
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
ACE_Timer_Node_T<TYPE>*
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::get_first_i (void) const
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::get_first_i (void) const
{
ACE_Timer_Node_T<TYPE>* root = this->spokes_[this->earliest_spoke_];
ACE_Timer_Node_T<TYPE>* first = root->get_next ();
@@ -782,9 +800,9 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::get_first_i (void) const
/**
* @return The iterator
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>&
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Queue_Iterator_T<TYPE> &
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::iter (void)
{
this->iterator_->first ();
return *this->iterator_;
@@ -794,8 +812,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
* Dummy version of expire to get rid of warnings in Sun CC 4.2
* Just call the expire of the base class.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire ()
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::expire ()
{
return ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK>::expire ();
}
@@ -808,8 +826,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire ()
*
* @return Number of timers expired
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> int
-ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value& cur_time)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> int
+ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::expire (const ACE_Time_Value& cur_time)
{
ACE_TRACE ("ACE_Timer_Wheel_T::expire");
@@ -866,8 +884,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value& cur_ti
*
* @param wheel A reference for a timer queue to iterate over
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Wheel_Iterator_T<TYPE,FUNCTOR,ACE_LOCK>::ACE_Timer_Wheel_Iterator_T
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Wheel_Iterator_T<TYPE,FUNCTOR,ACE_LOCK,TIME_POLICY>::ACE_Timer_Wheel_Iterator_T
(Wheel& wheel)
: timer_wheel_ (wheel)
{
@@ -878,10 +896,8 @@ ACE_Timer_Wheel_Iterator_T<TYPE,FUNCTOR,ACE_LOCK>::ACE_Timer_Wheel_Iterator_T
/**
* Destructor, at this level does nothing.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-ACE_Timer_Wheel_Iterator_T<TYPE,
-FUNCTOR,
-ACE_LOCK>::~ACE_Timer_Wheel_Iterator_T (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
+ACE_Timer_Wheel_Iterator_T<TYPE,FUNCTOR,ACE_LOCK,TIME_POLICY>::~ACE_Timer_Wheel_Iterator_T (void)
{
}
@@ -894,8 +910,8 @@ ACE_LOCK>::~ACE_Timer_Wheel_Iterator_T (void)
* If the wheel is empty, spoke_ will be equal timer_wheel_.spoke_count_ and
* current_node_ would be 0.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::first (void)
{
this->goto_next(0);
}
@@ -904,8 +920,8 @@ ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void)
/**
* Positions the iterator at the next node.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::next (void)
{
if (this->isdone())
return;
@@ -919,8 +935,8 @@ ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
}
/// Helper class for common functionality of next() and first()
-template <class TYPE, class FUNCTOR, class ACE_LOCK> void
-ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::goto_next (u_int start_spoke)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::goto_next (u_int start_spoke)
{
// Find the first non-empty entry.
u_int sc = this->timer_wheel_.spoke_count_;
@@ -943,8 +959,8 @@ ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::goto_next (u_int start_spok
/**
* @return True when we there aren't any more items (when current_node_ == 0)
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> bool
-ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone (void) const
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> bool
+ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::isdone (void) const
{
return this->current_node_ == 0;
}
@@ -953,8 +969,8 @@ ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone (void) const
* @return The node at the current spokeition in the sequence or 0 if the wheel
* is empty
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
-ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item (void)
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Timer_Node_T<TYPE> *
+ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::item (void)
{
return this->current_node_;
}
diff --git a/dep/acelite/ace/Timer_Wheel_T.h b/dep/acelite/ace/Timer_Wheel_T.h
index 266099f2e6a..e451deca908 100644
--- a/dep/acelite/ace/Timer_Wheel_T.h
+++ b/dep/acelite/ace/Timer_Wheel_T.h
@@ -4,7 +4,7 @@
/**
* @file Timer_Wheel_T.h
*
- * $Id: Timer_Wheel_T.h 84619 2009-02-26 12:26:16Z johnnyw $
+ * $Id: Timer_Wheel_T.h 95368 2011-12-19 13:38:49Z mcorino $
*
* @author Darrell Brunsch <brunsch@cs.wustl.edu>
*/
@@ -15,6 +15,7 @@
#include /**/ "ace/pre.h"
#include "ace/Timer_Queue_T.h"
+#include "ace/Copy_Disabled.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -23,7 +24,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward declaration
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY>
class ACE_Timer_Wheel_T;
/**
@@ -35,19 +36,19 @@ class ACE_Timer_Wheel_T;
* node of a timer queue. Be aware that it doesn't traverse
* in the order of timeout values.
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
class ACE_Timer_Wheel_Iterator_T
- : public ACE_Timer_Queue_Iterator_T <TYPE, FUNCTOR, ACE_LOCK>
+ : public ACE_Timer_Queue_Iterator_T <TYPE>
{
public:
- typedef ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK> Wheel;
+ typedef ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Wheel;
typedef ACE_Timer_Node_T<TYPE> Node;
/// Constructor
ACE_Timer_Wheel_Iterator_T (Wheel &);
/// Destructor
- ~ACE_Timer_Wheel_Iterator_T (void);
+ virtual ~ACE_Timer_Wheel_Iterator_T (void);
/// Positions the iterator at the earliest node in the Timer Queue
virtual void first (void);
@@ -88,28 +89,31 @@ private:
* Timer Facilities"
* (http://dworkin.wustl.edu/~varghese/PAPERS/newbsd.ps.Z)
*/
-template <class TYPE, class FUNCTOR, class ACE_LOCK>
-class ACE_Timer_Wheel_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy>
+class ACE_Timer_Wheel_T
+ : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>
{
public:
/// Type of iterator
- typedef ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> Iterator;
+ typedef ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Iterator;
/// Iterator is a friend
- friend class ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>;
+ friend class ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>;
typedef ACE_Timer_Node_T<TYPE> Node;
/// Type inherited from
- typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> Base;
+ typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Base_Timer_Queue;
typedef ACE_Free_List<Node> FreeList;
/// Default constructor
- ACE_Timer_Wheel_T (FUNCTOR* upcall_functor = 0, FreeList* freelist = 0);
+ ACE_Timer_Wheel_T (FUNCTOR* upcall_functor = 0, FreeList* freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/// Constructor with opportunities to set the wheelsize and resolution
ACE_Timer_Wheel_T (u_int spoke_count,
u_int resolution,
size_t prealloc = 0,
FUNCTOR* upcall_functor = 0,
- FreeList* freelist = 0);
+ FreeList* freelist = 0,
+ TIME_POLICY const & time_policy = TIME_POLICY());
/// Destructor
virtual ~ACE_Timer_Wheel_T (void);
@@ -139,6 +143,11 @@ public:
const void** act = 0,
int dont_call_handle_close = 1);
+ /**
+ * Destroy timer queue. Cancels all timers.
+ */
+ virtual int close (void);
+
/// Run the <functor> for all timers whose values are <=
/// <ACE_OS::gettimeofday>. Also accounts for <timer_skew>. Returns
/// the number of timers canceled.
@@ -150,7 +159,7 @@ public:
int expire (const ACE_Time_Value& current_time);
/// Returns a pointer to this <ACE_Timer_Queue_T>'s iterator.
- virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>& iter (void);
+ virtual ACE_Timer_Queue_Iterator_T<TYPE> & iter (void);
/// Removes the earliest node from the queue and returns it
virtual ACE_Timer_Node_T<TYPE>* remove_first (void);
@@ -205,11 +214,6 @@ private:
ACE_Time_Value wheel_time_;
/// The total number of timers currently scheduled.
u_int timer_count_;
-
- // = Don't allow these operations for now, don't split into multiple lines
- // breaks sun compilers
- ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Wheel_T (const ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK> &))
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK> &))
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/TkReactor/ACE_TkReactor_export.h b/dep/acelite/ace/TkReactor/ACE_TkReactor_export.h
new file mode 100644
index 00000000000..bbb6a52a1e3
--- /dev/null
+++ b/dep/acelite/ace/TkReactor/ACE_TkReactor_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: ACE_TkReactor_export.h 80826 2008-03-04 14:51:23Z wotte $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s ACE_TkReactor
+// ------------------------------
+#ifndef ACE_TKREACTOR_EXPORT_H
+#define ACE_TKREACTOR_EXPORT_H
+
+#include /**/ "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_TKREACTOR_HAS_DLL)
+# define ACE_TKREACTOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_TKREACTOR_HAS_DLL */
+
+#if !defined (ACE_TKREACTOR_HAS_DLL)
+# define ACE_TKREACTOR_HAS_DLL 1
+#endif /* ! ACE_TKREACTOR_HAS_DLL */
+
+#if defined (ACE_TKREACTOR_HAS_DLL) && (ACE_TKREACTOR_HAS_DLL == 1)
+# if defined (ACE_TKREACTOR_BUILD_DLL)
+# define ACE_TkReactor_Export ACE_Proper_Export_Flag
+# define ACE_TKREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_TKREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_TKREACTOR_BUILD_DLL */
+# define ACE_TkReactor_Export ACE_Proper_Import_Flag
+# define ACE_TKREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_TKREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_TKREACTOR_BUILD_DLL */
+#else /* ACE_TKREACTOR_HAS_DLL == 1 */
+# define ACE_TkReactor_Export
+# define ACE_TKREACTOR_SINGLETON_DECLARATION(T)
+# define ACE_TKREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_TKREACTOR_HAS_DLL == 1 */
+
+// Set ACE_TKREACTOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_TKREACTOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_TKREACTOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_TKREACTOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_TKREACTOR_NTRACE */
+
+#if (ACE_TKREACTOR_NTRACE == 1)
+# define ACE_TKREACTOR_TRACE(X)
+#else /* (ACE_TKREACTOR_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_TKREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_TKREACTOR_NTRACE == 1) */
+
+#endif /* ACE_TKREACTOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/TkReactor/TkReactor.cpp b/dep/acelite/ace/TkReactor/TkReactor.cpp
new file mode 100644
index 00000000000..1d73e0f6fe1
--- /dev/null
+++ b/dep/acelite/ace/TkReactor/TkReactor.cpp
@@ -0,0 +1,438 @@
+// $Id: TkReactor.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+#include "ace/TkReactor/TkReactor.h"
+
+#include "ace/SOCK_Acceptor.h"
+#include "ace/SOCK_Connector.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_ALLOC_HOOK_DEFINE (ACE_TkReactor)
+
+// Must be called with lock held
+ACE_TkReactor::ACE_TkReactor (size_t size,
+ bool restart,
+ ACE_Sig_Handler *h)
+ : ACE_Select_Reactor (size, restart, h),
+ ids_ (0),
+ timeout_ (0)
+{
+ // When the ACE_Select_Reactor is constructed it creates the notify
+ // pipe and registers it with the register_handler_i() method. The
+ // TkReactor overloads this method BUT because the
+ // register_handler_i occurs when constructing the base class
+ // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i()
+ // is called not the TkReactor register_handler_i(). This means
+ // that the notify pipe is registered with the ACE_Select_Reactor
+ // event handling code not the TkReactor and so notfications don't
+ // work. To get around this we simply close and re-opened the
+ // notification handler in the constructor of the TkReactor.
+
+#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+ this->notify_handler_->close ();
+ this->notify_handler_->open (this, 0);
+#endif /* ACE_MT_SAFE */
+}
+
+ACE_TkReactor::~ACE_TkReactor (void)
+{
+ // Delete the remaining items in the linked list.
+
+ while (this->ids_)
+ {
+ ACE_TkReactorID *TkID = this->ids_->next_;
+ delete this->ids_;
+ this->ids_ = TkID;
+ }
+}
+
+// This is just the <wait_for_multiple_events> from ace/Reactor.cpp
+// but we use the Tk functions to wait for an event, not <select>
+
+int
+ACE_TkReactor::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set,
+ ACE_Time_Value *max_wait_time)
+{
+ ACE_TRACE ("ACE_TkReactor::wait_for_multiple_events");
+ int nfound;
+
+ do
+ {
+ max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time);
+
+ size_t width = this->handler_rep_.max_handlep1 ();
+ handle_set.rd_mask_ = this->wait_set_.rd_mask_;
+ handle_set.wr_mask_ = this->wait_set_.wr_mask_;
+ handle_set.ex_mask_ = this->wait_set_.ex_mask_;
+ nfound = TkWaitForMultipleEvents (width,
+ handle_set,
+ max_wait_time);
+
+ } while (nfound == -1 && this->handle_error () > 0);
+
+ if (nfound > 0)
+ {
+#if !defined (ACE_WIN32)
+ handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ());
+#endif /* ACE_WIN32 */
+ }
+ return nfound; // Timed out or input available
+}
+
+void
+ACE_TkReactor::TimerCallbackProc (ClientData cd)
+{
+ ACE_TkReactor *self = (ACE_TkReactor *) cd;
+ self->timeout_ = 0;
+
+ // Deal with any timer events
+ ACE_Select_Reactor_Handle_Set handle_set;
+ self->dispatch (0, handle_set);
+ self->reset_timeout ();
+}
+
+/**
+ * @todo the unused mask argument is probably quite useful, but we
+ * ignore it, why? In fact the following comment probably
+ * relates to that:
+ * This could be made shorter if we know which *kind* of event
+ * we were about to get. Here we use <select> to find out which
+ * one might be available.
+ */
+void
+ACE_TkReactor::InputCallbackProc (ClientData cd,
+ int /* mask */)
+{
+ ACE_TkReactor_Input_Callback *callback = (ACE_TkReactor_Input_Callback *) cd;
+ ACE_TkReactor *self = callback->reactor_;
+ ACE_HANDLE handle = callback->handle_;
+
+ // my copy isn't const.
+ ACE_Time_Value zero = ACE_Time_Value::zero;
+
+ ACE_Select_Reactor_Handle_Set wait_set;
+
+ // Deal with one file event.
+
+ // - read which kind of event
+ if (self->wait_set_.rd_mask_.is_set (handle))
+ wait_set.rd_mask_.set_bit (handle);
+ if (self->wait_set_.wr_mask_.is_set (handle))
+ wait_set.wr_mask_.set_bit (handle);
+ if (self->wait_set_.ex_mask_.is_set (handle))
+ wait_set.ex_mask_.set_bit (handle);
+
+ int result = ACE_OS::select (handle + 1,
+ wait_set.rd_mask_,
+ wait_set.wr_mask_,
+ wait_set.ex_mask_, &zero);
+
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+
+ // - Use only that one file event (removes events for other files).
+ if (result > 0)
+ {
+ if (wait_set.rd_mask_.is_set (handle))
+ dispatch_set.rd_mask_.set_bit (handle);
+ if (wait_set.wr_mask_.is_set (handle))
+ dispatch_set.wr_mask_.set_bit (handle);
+ if (wait_set.ex_mask_.is_set (handle))
+ dispatch_set.ex_mask_.set_bit (handle);
+
+ self->dispatch (1, dispatch_set);
+ }
+}
+
+int
+ACE_TkReactor::TkWaitForMultipleEvents (int width,
+ ACE_Select_Reactor_Handle_Set &wait_set,
+ ACE_Time_Value *)
+{
+ // Check to make sure our handle's are all usable.
+ ACE_Select_Reactor_Handle_Set temp_set = wait_set;
+
+ if (ACE_OS::select (width,
+ temp_set.rd_mask_,
+ temp_set.wr_mask_,
+ temp_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero) == -1)
+ return -1; // Bad file arguments...
+
+ // Instead of waiting using <select>, just use the Tk mechanism to
+ // wait for a single event.
+
+ // Wait for something to happen.
+ ::Tcl_DoOneEvent (0);
+
+ // Reset the width, in case it changed during the upcalls.
+ width = this->handler_rep_.max_handlep1 ();
+
+ // Now actually read the result needed by the <Select_Reactor> using
+ // <select>.
+ return ACE_OS::select (width,
+ wait_set.rd_mask_,
+ wait_set.wr_mask_,
+ wait_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero);
+}
+
+int
+ACE_TkReactor::register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_TkReactor::register_handler_i");
+
+ int result = ACE_Select_Reactor::register_handler_i (handle,
+ handler, mask);
+ if (result == -1)
+ return -1;
+
+ int condition = 0;
+
+#if !defined ACE_WIN32
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, TK_READABLE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, TK_WRITABLE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_SET_BITS (condition, TK_EXCEPTION);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK))
+ ACE_SET_BITS (condition, TK_READABLE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){
+ ACE_SET_BITS (condition, TK_READABLE); // connected, you may write
+ ACE_SET_BITS (condition, TK_WRITABLE); // connected, you have data/err
+ }
+#else
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, TK_READABLE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, TK_WRITABLE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_NOTSUP_RETURN(-1);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK))
+ ACE_SET_BITS (condition, TK_READABLE);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){
+ ACE_SET_BITS (condition, TK_READABLE); // connected, you may write
+ ACE_SET_BITS (condition, TK_WRITABLE); // connected, you have data/err
+ }
+#endif /* !ACE_WIN32 */
+
+ if (condition != 0)
+ {
+ ACE_TkReactorID *TkID = this->ids_;
+
+ while(TkID)
+ {
+ if (TkID->handle_ == handle)
+ {
+ ::Tk_DeleteFileHandler (TkID->handle_);
+
+ ACE_TkReactor_Input_Callback *callback;
+ ACE_NEW_RETURN (callback,
+ ACE_TkReactor_Input_Callback,
+ -1);
+ callback->reactor_ = this;
+ callback->handle_ = handle;
+ ::Tk_CreateFileHandler ((int) handle,
+ condition,
+ InputCallbackProc,
+ (ClientData) callback);
+ return 0;
+ }
+ else
+ TkID = TkID->next_;
+ }
+
+ ACE_NEW_RETURN (TkID,
+ ACE_TkReactorID,
+ -1);
+ TkID->next_ = this->ids_;
+ TkID->handle_ = handle;
+ ACE_TkReactor_Input_Callback *callback;
+ ACE_NEW_RETURN (callback,
+ ACE_TkReactor_Input_Callback,
+ -1);
+ callback->reactor_ = this;
+ callback->handle_ = handle;
+
+ ::Tk_CreateFileHandler ((int) handle,
+ condition,
+ InputCallbackProc,
+ (ClientData) callback);
+ this->ids_ = TkID;
+ }
+ return 0;
+}
+
+int
+ACE_TkReactor::register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::register_handler_i (handles,
+ handler,
+ mask);
+}
+
+int
+ACE_TkReactor::remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_TkReactor::remove_handler_i");
+
+ // In the registration phase we registered first with
+ // ACE_Select_Reactor and then with X. Now we are now doing things
+ // in reverse order.
+
+ // First clean up the corresponding X11Input.
+ this->remove_TkFileHandler (handle);
+
+ // Now let the reactor do its work.
+ return ACE_Select_Reactor::remove_handler_i (handle,
+ mask);
+}
+
+void
+ACE_TkReactor::remove_TkFileHandler (ACE_HANDLE handle)
+{
+ ACE_TRACE ("ACE_TkReactor::remove_TkFileHandler");
+
+ ACE_TkReactorID *TkID = this->ids_;
+
+ if (TkID)
+ {
+ if (TkID->handle_ == handle)
+ {
+ ::Tk_DeleteFileHandler (TkID->handle_);
+ this->ids_ = TkID->next_;
+ delete TkID;
+ return;
+ }
+
+ ACE_TkReactorID *NextID = TkID->next_;
+
+ while (NextID)
+ {
+ if (NextID->handle_ == handle)
+ {
+ ::Tk_DeleteFileHandler (NextID->handle_);
+ TkID->next_ = NextID->next_;
+ delete NextID;
+ return;
+ }
+ else
+ {
+ TkID = NextID;
+ NextID = NextID->next_;
+ }
+ }
+ }
+}
+
+int
+ACE_TkReactor::remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::remove_handler_i (handles,
+ mask);
+}
+
+// The following functions ensure that there is an Tk timeout for the
+// first timeout in the Reactor's Timer_Queue.
+
+void
+ACE_TkReactor::reset_timeout (void)
+{
+ if (this->timeout_)
+ ::Tk_DeleteTimerHandler (this->timeout_);
+ timeout_ = 0;
+
+ ACE_Time_Value *max_wait_time =
+ this->timer_queue_->calculate_timeout (0);
+
+ if (max_wait_time)
+ timeout_ = ::Tk_CreateTimerHandler (max_wait_time->msec (),
+ TimerCallbackProc,
+ (ClientData) this);
+}
+
+int
+ACE_TkReactor::reset_timer_interval
+ (long timer_id,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_TkReactor::reset_timer_interval");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ int result = ACE_Select_Reactor::timer_queue_->reset_interval
+ (timer_id,
+ interval);
+
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+long
+ACE_TkReactor::schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_TkReactor::schedule_timer");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ long result = ACE_Select_Reactor::schedule_timer (event_handler,
+ arg,
+ delay,
+ interval);
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+int
+ACE_TkReactor::cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_TkReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (handler,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+int
+ACE_TkReactor::cancel_timer (long timer_id,
+ const void **arg,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_TkReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (timer_id,
+ arg,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/TkReactor/TkReactor.h b/dep/acelite/ace/TkReactor/TkReactor.h
new file mode 100644
index 00000000000..60ad54dd42f
--- /dev/null
+++ b/dep/acelite/ace/TkReactor/TkReactor.h
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TkReactor.h
+ *
+ * $Id: TkReactor.h 82723 2008-09-16 09:35:44Z johnnyw $
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef ACE_TKREACTOR_H
+#define ACE_TKREACTOR_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/TkReactor/ACE_TkReactor_export.h"
+#include "ace/Select_Reactor.h"
+#include /**/ <tk.h>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_TkReactorID
+ *
+ * @brief This little class is necessary due to the way that Microsoft
+ * implements sockets to be pointers rather than indices.
+ */
+class ACE_TkReactor_Export ACE_TkReactorID
+{
+public:
+ /// Underlying handle.
+ ACE_HANDLE handle_;
+
+ /// Pointer to next node in the linked list.
+ ACE_TkReactorID *next_;
+};
+
+class ACE_TkReactor;
+
+class ACE_TkReactor_Export ACE_TkReactor_Input_Callback
+{
+public:
+ ACE_TkReactor *reactor_;
+ ACE_HANDLE handle_;
+};
+
+/**
+ * @class ACE_TkReactor
+ *
+ * @brief An object-oriented event demultiplexor and event handler
+ * dispatcher that uses the Tk functions.
+ */
+class ACE_TkReactor_Export ACE_TkReactor : public ACE_Select_Reactor
+{
+public:
+ // = Initialization and termination methods.
+ ACE_TkReactor (size_t size = DEFAULT_SIZE,
+ bool restart = false,
+ ACE_Sig_Handler * = 0);
+
+ virtual ~ACE_TkReactor (void);
+
+ // = Timer operations.
+ virtual long schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval);
+ virtual int reset_timer_interval (long timer_id,
+ const ACE_Time_Value &interval);
+ virtual int cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close = 1);
+ virtual int cancel_timer (long timer_id,
+ const void **arg = 0,
+ int dont_call_handle_close = 1);
+
+protected:
+ // = Register timers/handles with Tk.
+ /// Register a single @a handler.
+ virtual int register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Register a set of <handlers>.
+ virtual int register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Remove the @a handler associated with this @a handle.
+ virtual int remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask);
+
+ /// Remove a set of <handles>.
+ virtual int remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask);
+
+ /// Removes an Tk FileHandler.
+ virtual void remove_TkFileHandler (ACE_HANDLE handle);
+
+ /// Wait for events to occur.
+ virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
+ ACE_Time_Value *);
+
+ ///Wait for Tk events to occur.
+ virtual int TkWaitForMultipleEvents (int,
+ ACE_Select_Reactor_Handle_Set &,
+ ACE_Time_Value *);
+
+ ACE_TkReactorID *ids_;
+ Tk_TimerToken timeout_;
+
+private:
+ /// This method ensures there's a Tk timeout for the first timeout in
+ /// the Reactor's Timer_Queue.
+ void reset_timeout (void);
+
+ // = Integrate with the X callback function mechanism.
+ static void TimerCallbackProc (ClientData cd);
+ static void InputCallbackProc (ClientData cd,int mask);
+
+ /// Deny access since member-wise won't work...
+ ACE_TkReactor (const ACE_TkReactor &);
+ ACE_TkReactor &operator = (const ACE_TkReactor &);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ACE_TK_REACTOR_H */
diff --git a/dep/acelite/ace/Token.cpp b/dep/acelite/ace/Token.cpp
index c63370fa534..909f14c16e3 100644
--- a/dep/acelite/ace/Token.cpp
+++ b/dep/acelite/ace/Token.cpp
@@ -1,4 +1,4 @@
-// $Id: Token.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: Token.cpp 96024 2012-08-09 19:42:19Z schmidt $
#include "ace/Token.h"
@@ -204,9 +204,7 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *),
return 0;
}
- //
// Someone already holds the token.
- //
// Check if it is us.
if (ACE_OS::thr_equal (thr_id, this->owner_))
@@ -536,7 +534,6 @@ ACE_Token::wakeup_next_waiter (void)
// Wake up waiter and make it runable.
queue->head_->runable_ = 1;
queue->head_->signal ();
-
this->owner_ = queue->head_->thread_id_;
}
diff --git a/dep/acelite/ace/Truncate.h b/dep/acelite/ace/Truncate.h
index 223513a56d9..8ff05141516 100644
--- a/dep/acelite/ace/Truncate.h
+++ b/dep/acelite/ace/Truncate.h
@@ -4,7 +4,7 @@
/**
* @file Truncate.h
*
- * $Id: Truncate.h 83306 2008-10-17 12:19:53Z johnnyw $
+ * $Id: Truncate.h 95761 2012-05-15 18:23:04Z johnnyw $
*
* @author Steve Huston <shuston@riverace.com>
* @author Ossama Othman <ossama_othman@symantec.com>
@@ -27,10 +27,6 @@
#include "ace/If_Then_Else.h"
#include "ace/Numeric_Limits.h"
-#if defined (ACE_LACKS_LONGLONG_T)
-# include "ace/Basic_Types.h"
-#endif /* ACE_LACKS_LONGLONG_T */
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_Utils
@@ -42,30 +38,24 @@ namespace ACE_Utils
template<> struct Sign_Check<unsigned short> { ACE_STATIC_CONSTANT (bool, is_signed = 0); };
template<> struct Sign_Check<unsigned int> { ACE_STATIC_CONSTANT (bool, is_signed = 0); };
template<> struct Sign_Check<unsigned long> { ACE_STATIC_CONSTANT (bool, is_signed = 0); };
-#if !(defined(ACE_LACKS_LONGLONG_T) || defined(ACE_LACKS_UNSIGNEDLONGLONG_T))
# ifdef __GNUC__
// Silence g++ "-pedantic" warnings regarding use of "long long"
// type.
__extension__
# endif /* __GNUC__ */
template<> struct Sign_Check<unsigned long long> { ACE_STATIC_CONSTANT (bool, is_signed = 0); };
-#else
- template<> struct Sign_Check<ACE_U_LongLong> { ACE_STATIC_CONSTANT (bool, is_signed = 0); };
-#endif /* !ACE_LACKS_LONGLONG_T */
// Specialize the signed cases.
template<> struct Sign_Check<signed char> { ACE_STATIC_CONSTANT (bool, is_signed = 1); };
template<> struct Sign_Check<signed short> { ACE_STATIC_CONSTANT (bool, is_signed = 1); };
template<> struct Sign_Check<signed int> { ACE_STATIC_CONSTANT (bool, is_signed = 1); };
template<> struct Sign_Check<signed long> { ACE_STATIC_CONSTANT (bool, is_signed = 1); };
-#ifndef ACE_LACKS_LONGLONG_T
# ifdef __GNUC__
// Silence g++ "-pedantic" warnings regarding use of "long long"
// type.
__extension__
# endif /* __GNUC__ */
template<> struct Sign_Check<signed long long> { ACE_STATIC_CONSTANT (bool, is_signed = 1); };
-#endif /* !ACE_LACKS_LONGLONG_T */
// -----------------------------------------------------
@@ -110,7 +100,6 @@ namespace ACE_Utils
unsigned_type operator() (unsigned_type x) { return x; }
};
-#if !(defined(ACE_LACKS_LONGLONG_T) || defined(ACE_LACKS_UNSIGNEDLONGLONG_T))
# ifdef __GNUC__
// Silence g++ "-pedantic" warnings regarding use of "long long"
// type.
@@ -123,15 +112,6 @@ namespace ACE_Utils
unsigned_type operator() (unsigned_type x) { return x; }
};
-#else
- template<>
- struct To_Unsigned<ACE_U_LongLong>
- {
- typedef ACE_U_LongLong unsigned_type;
-
- unsigned_type operator() (unsigned_type x) { return x; }
- };
-#endif /* !ACE_LACKS_LONGLONG_T */
// ----------------
@@ -183,7 +163,6 @@ namespace ACE_Utils
}
};
-#if !(defined(ACE_LACKS_LONGLONG_T) || defined(ACE_LACKS_UNSIGNEDLONGLONG_T))
# ifdef __GNUC__
// Silence g++ "-pedantic" warnings regarding use of "long long"
// type.
@@ -200,7 +179,6 @@ namespace ACE_Utils
return static_cast<unsigned_type> (x);
}
};
-#endif /* !ACE_LACKS_LONGLONG_T */
// -----------------------------------------------------
@@ -439,28 +417,6 @@ namespace ACE_Utils
};
-#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- // Partial specialization for the case where we're casting from
- // ACE_U_LongLong to a smaller integer. We assume that we're always
- // truncating from ACE_U_LongLong to a smaller type. The partial
- // specialization above handles the case where both the FROM and TO
- // types are ACE_U_LongLong.
- template<typename TO>
- struct Truncator<ACE_U_LongLong, TO>
- {
- TO operator() (ACE_U_LongLong const & val)
- {
- // If val less than or equal to ACE_Numeric_Limits<TO>::max(),
- // val.lo() must be less than or equal to
- // ACE_Numeric_Limits<TO>::max (), as well.
- return
- (val > ACE_Numeric_Limits<TO>::max ()
- ? ACE_Numeric_Limits<TO>::max ()
- : static_cast<TO> (val.lo ()));
- }
- };
-#endif /* ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */
-
// -----------------------------------------------------
/**
* @struct Noop_Truncator
diff --git a/dep/acelite/ace/UUID.cpp b/dep/acelite/ace/UUID.cpp
index 8fdf150b0fd..09855ca672d 100644
--- a/dep/acelite/ace/UUID.cpp
+++ b/dep/acelite/ace/UUID.cpp
@@ -1,4 +1,4 @@
-//$Id: UUID.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+//$Id: UUID.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/UUID.h"
#include "ace/Guard_T.h"
@@ -359,7 +359,7 @@ namespace ACE_Utils
uuid.time_mid (static_cast<ACE_UINT16> ((timestamp >> 32) & 0xFFFF));
ACE_UINT16 tHAV = static_cast<ACE_UINT16> ((timestamp >> 48) & 0xFFFF);
- tHAV |= (version << 12);
+ tHAV = static_cast<ACE_UINT16> (tHAV | (version << 12));
uuid.time_hi_and_version (tHAV);
u_char cseqHAV;
@@ -367,7 +367,7 @@ namespace ACE_Utils
cseqHAV = static_cast<u_char> ((clock_sequence & 0x3f00) >> 8);
uuid_state_.timestamp = timestamp;
- cseqHAV |= variant;
+ cseqHAV = static_cast<u_char> (cseqHAV | variant);
uuid.clock_seq_hi_and_reserved (cseqHAV);
uuid.node (uuid_state_.node);
@@ -460,13 +460,7 @@ namespace ACE_Utils
UUID_Generator::get_systemtime (UUID_Time & timestamp)
{
const UUID_Time timeOffset =
-#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
- ACE_U_LongLong (ACE_INT64_LITERAL (0x1B21DD213814000));
-#elif defined (ACE_LACKS_LONGLONG_T)
- ACE_U_LongLong (0x13814000u, 0x1B21DD2u);
-#else
ACE_UINT64_LITERAL (0x1B21DD213814000);
-#endif /* ACE_LACKS_UNSIGNEDLONGLONG_T */
/// Get the time of day, convert to 100ns ticks then add the offset.
ACE_Time_Value now = ACE_OS::gettimeofday ();
diff --git a/dep/acelite/ace/Unbounded_Set_Ex.cpp b/dep/acelite/ace/Unbounded_Set_Ex.cpp
index c5cd9e27b21..763d7aa01f3 100644
--- a/dep/acelite/ace/Unbounded_Set_Ex.cpp
+++ b/dep/acelite/ace/Unbounded_Set_Ex.cpp
@@ -1,4 +1,4 @@
-// $Id: Unbounded_Set_Ex.cpp 81702 2008-05-15 10:18:07Z johnnyw $
+// $Id: Unbounded_Set_Ex.cpp 94304 2011-07-07 15:25:58Z johnnyw $
#ifndef ACE_UNBOUNDED_SET_EX_CPP
#define ACE_UNBOUNDED_SET_EX_CPP
@@ -76,7 +76,7 @@ ACE_Unbounded_Set_Ex<T, C>::dump (void) const
const_iterator const the_end = this->end ();
for (const_iterator i (this->begin ());
- i != end;
+ i != the_end;
++i)
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("count = %u\n"), count++));
diff --git a/dep/acelite/ace/Value_Ptr.h b/dep/acelite/ace/Value_Ptr.h
index c9272a90cff..dbcd20a0f2c 100644
--- a/dep/acelite/ace/Value_Ptr.h
+++ b/dep/acelite/ace/Value_Ptr.h
@@ -4,7 +4,7 @@
/**
* @file Value_Ptr.h
*
- * $Id: Value_Ptr.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: Value_Ptr.h 92386 2010-10-28 07:44:37Z johnnyw $
*
* Value_Ptr implementation based on code in Herb Sutter's book "More
* Exceptional C++".
@@ -103,11 +103,6 @@ namespace ACE
return *this;
}
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
-
- // Compiler can't handle member templates so we lose converting
- // copy operations.
-
/// Converting copy constructor.
template <typename U>
Value_Ptr (Value_Ptr<U> const & other)
@@ -123,12 +118,8 @@ namespace ACE
return *this;
}
-#endif /* !ACE_LACKS_MEMBER_TEMPLATES */
-
private:
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
-
/// Copying method invoked when copy constructing.
template <typename U>
T * create_from (U const * p) const
@@ -136,24 +127,8 @@ namespace ACE
return p ? VP_traits<U>::clone (p) : 0;
}
-#else
-
- // Compiler can't handle member templates so we lose converting
- // copy operations.
-
- /// Copying method invoked when copy constructing.
- T * create_from (T const * p) const
- {
- return p ? VP_traits<T>::clone (p) : 0;
- }
-
-#endif /* !ACE_LACKS_MEMBER_TEMPLATES */
-
private:
-
-#ifndef ACE_LACKS_MEMBER_TEMPLATES
template <typename U> friend class Value_Ptr;
-#endif /* !ACE_LACKS_MEMBER_TEMPLATES */
/// Object owned by this @c Value_Ptr.
T * p_;
diff --git a/dep/acelite/ace/Version.h b/dep/acelite/ace/Version.h
index 835fc849fd1..33a98834bad 100644
--- a/dep/acelite/ace/Version.h
+++ b/dep/acelite/ace/Version.h
@@ -1,9 +1,9 @@
// -*- C++ -*-
-// $Id: Version.h 92364 2010-10-27 10:02:39Z johnnyw $
+// $Id: Version.h 96107 2012-08-29 06:17:32Z johnnyw $
// This is file was automatically generated by \$ACE_ROOT/bin/make_release.py
-#define ACE_MAJOR_VERSION 5
-#define ACE_MINOR_VERSION 8
-#define ACE_BETA_VERSION 3
-#define ACE_VERSION "5.8.3"
+#define ACE_MAJOR_VERSION 6
+#define ACE_MINOR_VERSION 1
+#define ACE_BETA_VERSION 4
+#define ACE_VERSION "6.1.4"
diff --git a/dep/acelite/ace/WFMO_Reactor.cpp b/dep/acelite/ace/WFMO_Reactor.cpp
index a86b9798e50..dd4086ffd06 100644
--- a/dep/acelite/ace/WFMO_Reactor.cpp
+++ b/dep/acelite/ace/WFMO_Reactor.cpp
@@ -1,4 +1,4 @@
-// $Id: WFMO_Reactor.cpp 91286 2010-08-05 09:04:31Z johnnyw $
+// $Id: WFMO_Reactor.cpp 95368 2011-12-19 13:38:49Z mcorino $
#include "ace/WFMO_Reactor.h"
@@ -1153,6 +1153,8 @@ ACE_WFMO_Reactor::open (size_t size,
// Timer Queue
if (this->delete_timer_queue_)
delete this->timer_queue_;
+ else if (this->timer_queue_)
+ this->timer_queue_->close ();
if (tq == 0)
{
@@ -1283,8 +1285,14 @@ ACE_WFMO_Reactor::timer_queue (void) const
int
ACE_WFMO_Reactor::timer_queue (ACE_Timer_Queue *tq)
{
- if (this->timer_queue_ != 0 && this->delete_timer_queue_)
- delete this->timer_queue_;
+ if (this->delete_timer_queue_)
+ {
+ delete this->timer_queue_;
+ }
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ }
this->timer_queue_ = tq;
this->delete_timer_queue_ = false;
return 0;
@@ -1326,6 +1334,11 @@ ACE_WFMO_Reactor::~ACE_WFMO_Reactor (void)
this->timer_queue_ = 0;
this->delete_timer_queue_ = false;
}
+ else if (this->timer_queue_)
+ {
+ this->timer_queue_->close ();
+ this->timer_queue_ = 0;
+ }
if (this->delete_signal_handler_)
{
@@ -1683,7 +1696,10 @@ ACE_WFMO_Reactor::event_handling (ACE_Time_Value *max_wait_time,
// Make sure we are not closed
if (!this->open_for_business_ || this->deactivated_)
- return -1;
+ {
+ errno = ESHUTDOWN;
+ return -1;
+ }
// Stash the current time -- the destructor of this object will
// automatically compute how much time elapsed since this method was
@@ -1952,7 +1968,6 @@ ACE_WFMO_Reactor::dispatch_handles (DWORD wait_status)
{
const bool ok = (
#if ! defined(__BORLANDC__) \
- && !defined (ghs) \
&& !defined (__MINGW32__) \
&& !defined (_MSC_VER)
// wait_status is unsigned in Borland, Green Hills,
diff --git a/dep/acelite/ace/WFMO_Reactor.h b/dep/acelite/ace/WFMO_Reactor.h
index fb3a14d28cd..e15643e3bbf 100644
--- a/dep/acelite/ace/WFMO_Reactor.h
+++ b/dep/acelite/ace/WFMO_Reactor.h
@@ -4,7 +4,7 @@
/**
* @file WFMO_Reactor.h
*
- * $Id: WFMO_Reactor.h 84727 2009-03-05 19:22:29Z johnnyw $
+ * $Id: WFMO_Reactor.h 93792 2011-04-07 11:48:50Z mcorino $
*
* @author Irfan Pyarali <irfan@cs.wustl.edu>
* @author Tim Harrison <harrison@cs.wustl.edu>
@@ -112,7 +112,7 @@ public:
* @class Common_Info
*
* @brief This struct contains the necessary information for every
- * <Event_Handler> entry. The reason the event is not in this
+ * Event_Handler entry. The reason the event is not in this
* structure is because we need to pass an event array into
* WaitForMultipleObjects and therefore keeping the events
* seperate makes sense.
@@ -124,25 +124,25 @@ public:
/// event
bool io_entry_;
- /// The assosiated <Event_Handler>
+ /// The assosiated Event_Handler
ACE_Event_Handler *event_handler_;
- /// The I/O handle related to the <Event_Handler>. This entry is
- /// only valid if the <io_entry_> flag is true.
+ /// The I/O handle related to the Event_Handler. This entry is
+ /// only valid if the io_entry_ flag is true.
ACE_HANDLE io_handle_;
/**
- * This is the set of events that the <Event_Handler> is
- * interested in. This entry is only valid if the <io_entry_> flag
+ * This is the set of events that the Event_Handler is
+ * interested in. This entry is only valid if the io_entry_ flag
* is true.
*/
long network_events_;
/**
- * This flag indicates that <WFMO_Reactor> created the event on
+ * This flag indicates that WFMO_Reactor created the event on
* behalf of the user. Therefore we need to clean this up when the
- * <Event_Handler> removes itself from <WFMO_Reactor>. This entry
- * is only valid if the <io_entry_> flag is true.
+ * Event_Handler removes itself from WFMO_Reactor. This entry
+ * is only valid if the io_entry_ flag is true.
*/
bool delete_event_;
@@ -150,8 +150,8 @@ public:
bool delete_entry_;
/**
- * These are the masks related to <handle_close> for the
- * <Event_Handler>. This is only valid when <delete_entry_> is
+ * These are the masks related to handle_close() for the
+ * Event_Handler. This is only valid when delete_entry_ is
* set.
*/
ACE_Reactor_Mask close_masks_;
@@ -302,7 +302,7 @@ public:
/// Destructor.
virtual ~ACE_WFMO_Reactor_Handler_Repository (void);
- /// Initialize the repository of the approriate @a size.
+ /// Initialize the repository of the appropriate @a size.
int open (size_t size);
/// Close down the handler repository.
@@ -314,7 +314,7 @@ public:
/// the simple event entry.
int bind (ACE_HANDLE, ACE_Event_Handler *);
- /// Insert I/O <Event_Handler> entry into the system. This method
+ /// Insert I/O Event_Handler entry into the system. This method
/// assumes that the lock are head *before* this method is invoked.
int bind_i (bool io_entry,
ACE_Event_Handler *event_handler,
@@ -363,7 +363,7 @@ public:
/**
* This method is used to calculate the network mask after a mask_op
- * request to <WFMO_Reactor>. Note that because the <Event_Handler>
+ * request to <WFMO_Reactor>. Note that because the Event_Handler
* may already be in the handler repository, we may have to find the
* old event and the old network events
*/
@@ -561,7 +561,7 @@ public:
/**
* Get the maximum number of times that the
- * <ACE_WFMO_Reactor_Notify::handle_input> method will iterate and
+ * ACE_WFMO_Reactor_Notify::handle_input() method will iterate and
* dispatch the ACE_Event_Handlers that are passed in via the
* notify queue before breaking out of its
* <ACE_Message_Queue::dequeue> loop.
@@ -592,7 +592,7 @@ private:
*/
virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
- /// An auto event is used so that we can <signal> it to wakeup one
+ /// An auto event is used so that we can signal() it to wakeup one
/// thread up (e.g., when the <notify> method is called).
ACE_Auto_Event wakeup_one_thread_;
@@ -808,7 +808,7 @@ public:
* <ACE_INVALID_HANDLE>, WFMO_Reactor will create an event for
* associating it with the I/O handle. When the <event_handle> is
* signalled, the appropriate <handle_*> callback will be invoked on
- * the <Event_Handler>
+ * the Event_Handler
*/
virtual int register_handler (ACE_HANDLE event_handle,
ACE_HANDLE io_handle,
@@ -827,7 +827,7 @@ public:
/**
* This is a simple version of the above <register_handler> method
* where the I/O handle will always come from <get_handle> on the
- * <Event_Handler> and the event handle will always be created by
+ * Event_Handler and the event handle will always be created by
* <WFMO_Reactor>
*/
virtual int register_handler (ACE_Event_Handler *event_handler,
@@ -874,10 +874,10 @@ public:
* either be the <event_handle> or the <io_handle>
*
* For the case of I/O entries, this removes the @a mask binding of
- * <Event_Handler> whose handle is @a handle from <WFMO_Reactor>. If
+ * Event_Handler whose handle is @a handle from <WFMO_Reactor>. If
* there are no more bindings for this <event_handler> then it is
* removed from the WFMO_Reactor. For simple event entries, mask is
- * mostly ignored and the <Event_Handler> is always removed from
+ * mostly ignored and the Event_Handler is always removed from
* <WFMO_Reactor>
*/
virtual int remove_handler (ACE_HANDLE handle,
@@ -885,7 +885,7 @@ public:
/**
* Removes all the @a mask bindings for handles in the @a handle_set
- * bind of <Event_Handler>. If there are no more bindings for any
+ * bind of Event_Handler. If there are no more bindings for any
* of these handles then they are removed from WFMO_Reactor.
*/
virtual int remove_handler (const ACE_Handle_Set &handle_set,
@@ -903,13 +903,13 @@ public:
ACE_Sig_Action *old_disp = 0,
int sigkey = -1);
- /// Calls <remove_handler> for every signal in @a sigset.
+ /// Calls remove_handler() for every signal in @a sigset.
virtual int remove_handler (const ACE_Sig_Set &sigset);
// = Suspend and resume Handlers.
/// Suspend @a event_handler temporarily. Use
- /// <ACE_Event_Handler::get_handle> to get the handle.
+ /// ACE_Event_Handler::get_handle() to get the handle.
virtual int suspend_handler (ACE_Event_Handler *event_handler);
/// Suspend @a handle temporarily.
@@ -918,7 +918,7 @@ public:
/// Suspend all @a handles in handle set temporarily.
virtual int suspend_handler (const ACE_Handle_Set &handles);
- /// Suspend all <handles> temporarily.
+ /// Suspend all handles temporarily.
virtual int suspend_handlers (void);
/// Resume @a event_handler. Use <ACE_Event_Handler::get_handle> to
@@ -975,7 +975,7 @@ public:
/**
* Resets the interval of the timer represented by @a timer_id to
* @a interval, which is specified in relative time to the current
- * <gettimeofday>. If @a interval is equal to
+ * gettimeofday(). If @a interval is equal to
* ACE_Time_Value::zero, the timer will become a non-rescheduling
* timer. Returns 0 if successful, -1 if not.
*/
@@ -1019,15 +1019,15 @@ public:
ACE_Reactor_Mask masks_to_be_added);
/**
- * Remove <masks_to_be_deleted> to the <handle>'s entry in
- * WFMO_Reactor. The Event_Handler associated with <handle> must
+ * Remove @a masks_to_be_deleted to the <handle>'s entry in
+ * WFMO_Reactor. The Event_Handler associated with @a event_handler must
* already have been registered with WFMO_Reactor.
*/
virtual int cancel_wakeup (ACE_Event_Handler *event_handler,
ACE_Reactor_Mask masks_to_be_deleted);
/**
- * Remove <masks_to_be_deleted> to the <handle>'s entry in
+ * Remove @a masks_to_be_deleted to the <handle>'s entry in
* WFMO_Reactor. The Event_Handler associated with <handle> must
* already have been registered with WFMO_Reactor.
*/
diff --git a/dep/acelite/ace/WIN32_Asynch_IO.cpp b/dep/acelite/ace/WIN32_Asynch_IO.cpp
index 75da1ad6f08..8eaf745ed15 100644
--- a/dep/acelite/ace/WIN32_Asynch_IO.cpp
+++ b/dep/acelite/ace/WIN32_Asynch_IO.cpp
@@ -1,4 +1,4 @@
-// $Id: WIN32_Asynch_IO.cpp 91368 2010-08-16 13:03:34Z mhengstmengel $
+// $Id: WIN32_Asynch_IO.cpp 95652 2012-03-23 22:11:35Z shuston $
#include "ace/WIN32_Asynch_IO.h"
@@ -3367,11 +3367,15 @@ ACE_WIN32_Asynch_Read_Dgram::recv (ACE_Message_Block *message_block,
-1);
// do the scatter/gather recv
+ // NOTE! The flags value is in/out to recvfrom() - it's changed AFTER
+ // the call to WSARecvFrom returns and if it completes immediately, the
+ // result object may already be deleted. Since the changed value is not
+ // used, and not needed by result, pass a copy to avoid the race.
ssize_t initiate_result = ACE_OS::recvfrom (result->handle (),
iov,
iovcnt,
number_of_bytes_recvd,
- result->flags_,
+ flags,
result->saddr (),
&(result->addr_len_),
result,
@@ -3644,7 +3648,9 @@ ACE_WIN32_Asynch_Write_Dgram::send (ACE_Message_Block *message_block,
do
{
- if (msg_len >= 0 && iovcnt < ACE_IOV_MAX)
+ //if (msg_len >= 0 && iovcnt < ACE_IOV_MAX)
+ // msg_len >= 0 is always true since msg_len is unsigned
+ if (iovcnt < ACE_IOV_MAX)
{
u_long this_chunk_length;
if (msg_len > ULONG_MAX)
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp b/dep/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp
new file mode 100644
index 00000000000..6c13fc94d9d
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/Traversal.hpp
@@ -0,0 +1,76 @@
+// file : XMLSchema/Traversal.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Traversal.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+#ifndef XMLSCHEMA_TRAVERSAL_HPP
+#define XMLSCHEMA_TRAVERSAL_HPP
+
+#include <ace/XML_Utils/XSCRT/Traversal.hpp>
+#include <ace/XML_Utils/XMLSchema/Types.hpp>
+
+namespace XMLSchema
+{
+ namespace Traversal
+ {
+ // Automatic traversal of IDREFs.
+ //
+ //
+ struct IDREF :
+ XSCRT::Traversal::Traverser<XMLSchema::IDREF_Base, XSCRT::Type>
+ {
+ virtual void
+ traverse (XMLSchema::IDREF_Base& r)
+ {
+ if (r.get ()) dispatch (*(r.get ()));
+ }
+
+ virtual void
+ traverse (XMLSchema::IDREF_Base const& r)
+ {
+ if (r.get ()) dispatch (*(r.get ()));
+ }
+ };
+
+
+ template <typename T>
+ struct Traverser : XSCRT::Traversal::Traverser<T, XSCRT::Type>
+ {
+ };
+
+ typedef Traverser<byte> byte;
+ typedef Traverser<unsignedByte> unsignedByte;
+
+ typedef Traverser<short_> short_;
+ typedef Traverser<unsignedShort> unsignedShort;
+
+ typedef Traverser<int_> int_;
+ typedef Traverser<unsignedInt> unsignedInt;
+
+ typedef Traverser<long_> long_;
+ typedef Traverser<unsignedLong> unsignedLong;
+
+ typedef Traverser<boolean> boolean;
+
+ typedef Traverser<float_> float_;
+ typedef Traverser<double_> double_;
+
+ template <typename C>
+ struct string : Traverser<XMLSchema::string<C> >
+ {
+ };
+
+ template <typename C>
+ struct ID : Traverser<XMLSchema::ID<C> >
+ {
+ };
+
+ template <typename C>
+ struct anyURI : Traverser <XMLSchema::anyURI<C> >
+ {
+ };
+ }
+}
+
+#include <ace/XML_Utils/XMLSchema/Traversal.ipp>
+
+#endif // XMLSCHEMA_TRAVERSAL_HPP
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp b/dep/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp
new file mode 100644
index 00000000000..8d467fa319a
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/Traversal.ipp
@@ -0,0 +1,10 @@
+// file : XMLSchema/Traversal.ipp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Traversal.ipp 86462 2009-08-12 13:31:27Z wotte $
+
+namespace XMLSchema
+{
+ namespace Traversal
+ {
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp b/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp
new file mode 100644
index 00000000000..7825bf67337
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.hpp
@@ -0,0 +1,22 @@
+// file : XMLSchema/TypeInfo.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: TypeInfo.hpp 95802 2012-05-31 12:37:36Z johnnyw $
+
+#ifndef XMLSCHEMA_TYPE_INFO_HPP
+#define XMLSCHEMA_TYPE_INFO_HPP
+
+#include <ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp>
+
+namespace XMLSchema
+{
+ template <typename C>
+ struct TypeInfoInitializer
+ {
+ TypeInfoInitializer (XSCRT::ExtendedTypeInfoMap&);
+ };
+}
+
+#include <ace/XML_Utils/XMLSchema/TypeInfo.ipp>
+#include <ace/XML_Utils/XMLSchema/TypeInfo.tpp>
+
+#endif // XMLSCHEMA_TYPE_INFO_HPP
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp b/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp
new file mode 100644
index 00000000000..8f8487311f0
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.ipp
@@ -0,0 +1,7 @@
+// file : XMLSchema/TypeInfo.ipp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: TypeInfo.ipp 86462 2009-08-12 13:31:27Z wotte $
+
+namespace XMLSchema
+{
+}
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp b/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp
new file mode 100644
index 00000000000..1be4df0cf31
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/TypeInfo.tpp
@@ -0,0 +1,98 @@
+// file : XMLSchema/TypeInfo.tpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: TypeInfo.tpp 91814 2010-09-17 08:33:40Z johnnyw $
+
+namespace XMLSchema
+{
+ //@@ VC6
+ //
+ template<typename T>
+ void
+ add_info (XSCRT::ExtendedTypeInfoMap& map, T*)
+ {
+ using XSCRT::TypeId;
+ using XSCRT::ExtendedTypeInfo;
+
+ TypeId id (typeid (T));
+ ExtendedTypeInfo info (id);
+
+ info.add_base (ExtendedTypeInfo::Access::public_,
+ false,
+ typeid (XSCRT::Type));
+
+ map.insert (std::make_pair (id, info));
+ }
+
+
+ template <typename C>
+ inline
+ TypeInfoInitializer<C>::
+ TypeInfoInitializer (XSCRT::ExtendedTypeInfoMap& map)
+ {
+ using XSCRT::TypeId;
+ using XSCRT::ExtendedTypeInfo;
+
+ // XSCRT::Type
+ //
+ {
+ TypeId id (typeid (XSCRT::Type));
+ map.insert (std::make_pair (id, ExtendedTypeInfo (id)));
+ }
+
+ //@@ VC6
+
+ add_info<byte> (map, 0);
+ add_info<unsignedByte> (map, 0);
+
+ add_info<short_> (map, 0);
+ add_info<unsignedShort> (map, 0);
+
+ add_info<int_> (map, 0);
+ add_info<unsignedInt> (map, 0);
+
+ add_info<long_> (map, 0);
+ add_info<unsignedLong> (map, 0);
+
+ add_info<boolean> (map, 0);
+
+ add_info<float_> (map, 0);;
+ add_info<double_> (map, 0);
+
+ add_info<string<C> > (map, 0);
+
+ add_info<normalizedString<C> > (map, 0);
+ add_info<token<C> > (map, 0);
+ add_info<NMTOKEN<C> > (map, 0);
+ add_info<Name<C> > (map, 0);
+ add_info<NCName<C> > (map, 0);
+ add_info<QName<C> > (map, 0);
+
+ add_info<ID<C> > (map, 0);
+
+ // IDREF_Base
+ //
+ {
+ TypeId id (typeid (IDREF_Base));
+ ExtendedTypeInfo info (id);
+
+ info.add_base (ExtendedTypeInfo::Access::public_,
+ false,
+ typeid (XSCRT::Type));
+
+ map.insert (std::make_pair (id, info));
+ }
+
+ // IDREF
+ //
+ {
+ TypeId id (typeid (IDREF<C>));
+ ExtendedTypeInfo info (id);
+
+ info.add_base (ExtendedTypeInfo::Access::public_,
+ false,
+ typeid (IDREF_Base));
+
+ map.insert (std::make_pair (id, info));
+ }
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/Types.hpp b/dep/acelite/ace/XML_Utils/XMLSchema/Types.hpp
new file mode 100644
index 00000000000..fdbcdb43928
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/Types.hpp
@@ -0,0 +1,669 @@
+// file : XMLSchema/Types.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Types.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+#ifndef XMLSCHEMA_TYPES_HPP
+#define XMLSCHEMA_TYPES_HPP
+
+#include <string>
+#include "ace/XML_Utils/XSCRT/Elements.hpp"
+
+#include "ace/Basic_Types.h"
+/**
+ * @@ HACK: VC7
+ *
+ * Disabled the warning about using this in the base member initialization section.
+ * Our use in this file is fine.
+ */
+#ifdef _MSC_VER
+# pragma warning ( disable: 4355 )
+#endif
+namespace XMLSchema
+{
+ typedef XSCRT::FundamentalType<ACE_INT8> byte;
+ typedef XSCRT::FundamentalType<ACE_UINT8> unsignedByte;
+
+ typedef XSCRT::FundamentalType<ACE_INT16> short_;
+ typedef XSCRT::FundamentalType<ACE_UINT16> unsignedShort;
+
+ typedef XSCRT::FundamentalType<ACE_INT32> int_;
+ typedef XSCRT::FundamentalType<ACE_UINT32> unsignedInt;
+
+ typedef XSCRT::FundamentalType<ACE_INT64> long_;
+ typedef XSCRT::FundamentalType<ACE_UINT64> unsignedLong;
+
+ //@@ It would be nice to use some arbitrary-length integer class.
+ //
+ typedef long_ decimal;
+ typedef decimal integer;
+ typedef integer nonPositiveInteger;
+ typedef integer nonNegativeInteger;
+ typedef nonNegativeInteger positiveInteger;
+ typedef nonPositiveInteger negativeInteger;
+
+
+ typedef XSCRT::FundamentalType<bool> boolean;
+
+ typedef XSCRT::FundamentalType<float> float_;
+ typedef XSCRT::FundamentalType<double> double_;
+
+ // Just to make GCC 3.3 and other broken compilers shutup.
+ //
+ using std::basic_string;
+
+
+ template <typename C>
+ class string : public XSCRT::Type, public basic_string<C>
+ {
+ protected:
+ typedef basic_string<C> Base__ ;
+
+ public:
+ // typedef ACE_Refcounted_Auto_Ptr < string, ACE_Null_Mutex > _ptr;
+
+ //@@ VC6 does not inject XSCRT::Type into the scope so I have
+ // to qualify it all the time.
+ //
+
+ string ()
+ {
+ }
+
+ string (XSCRT::XML::Element<C> const& e)
+ : Base__ (e.value ())
+ {
+ }
+
+ string (XSCRT::XML::Attribute<C> const& a)
+ : Base__ (a.value ())
+ {
+ }
+
+ string (Base__ const& x)
+ : Base__ (x)
+ {
+ }
+
+ string (C const* x)
+ : Base__ (x)
+ {
+ }
+
+ string&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class normalizedString : public string<C>
+ {
+ protected:
+ typedef typename string<C>::Base__ Base__;
+
+ public:
+ normalizedString ()
+ {
+ }
+
+ normalizedString (XSCRT::XML::Element<C> const& e)
+ : string<C> (e)
+ {
+ }
+
+ normalizedString (XSCRT::XML::Attribute<C> const& a)
+ : string<C> (a)
+ {
+ }
+
+ normalizedString (Base__ const& x)
+ : string<C> (x)
+ {
+ }
+
+ normalizedString (C const* x)
+ : string<C> (x)
+ {
+ }
+
+ normalizedString&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class token : public normalizedString<C>
+ {
+ protected:
+ typedef typename normalizedString<C>::Base__ Base__;
+
+ public:
+ token ()
+ {
+ }
+
+ token (XSCRT::XML::Element<C> const& e)
+ : normalizedString<C> (e)
+ {
+ }
+
+ token (XSCRT::XML::Attribute<C> const& a)
+ : normalizedString<C> (a)
+ {
+ }
+
+ token (Base__ const& x)
+ : normalizedString<C> (x)
+ {
+ }
+
+ token (C const* x)
+ : normalizedString<C> (x)
+ {
+ }
+
+ token&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class NMTOKEN : public token<C>
+ {
+ protected:
+ typedef typename token<C>::Base__ Base__;
+
+ public:
+ NMTOKEN ()
+ {
+ }
+
+ NMTOKEN (XSCRT::XML::Element<C> const& e)
+ : token<C> (e)
+ {
+ }
+
+ NMTOKEN (XSCRT::XML::Attribute<C> const& a)
+ : token<C> (a)
+ {
+ }
+
+ NMTOKEN (Base__ const& x)
+ : token<C> (x)
+ {
+ }
+
+ NMTOKEN (C const* x)
+ : token<C> (x)
+ {
+ }
+
+ NMTOKEN&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+ template <typename C>
+ class Name: public token<C>
+ {
+ protected:
+ typedef typename token<C>::Base__ Base__;
+
+ public:
+ Name()
+ {
+ }
+
+ Name(XSCRT::XML::Element<C> const& e)
+ : token<C> (e)
+ {
+ }
+
+ Name(XSCRT::XML::Attribute<C> const& a)
+ : token<C> (a)
+ {
+ }
+
+ Name(Base__ const& x)
+ : token<C> (x)
+ {
+ }
+
+ Name (C const* x)
+ : token<C> (x)
+ {
+ }
+
+ Name&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class NCName: public Name<C>
+ {
+ protected:
+ typedef typename Name<C>::Base__ Base__;
+
+ public:
+ NCName()
+ {
+ }
+
+ NCName(XSCRT::XML::Element<C> const& e)
+ : Name<C> (e)
+ {
+ }
+
+ NCName(XSCRT::XML::Attribute<C> const& a)
+ : Name<C> (a)
+ {
+ }
+
+ NCName(Base__ const& x)
+ : Name<C> (x)
+ {
+ }
+
+ NCName (C const* x)
+ : Name<C> (x)
+ {
+ }
+
+ NCName&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+ template <typename C>
+ class QName: public Name<C>
+ {
+ protected:
+ typedef typename Name<C>::Base__ Base__;
+
+ public:
+ QName()
+ {
+ }
+
+ QName(XSCRT::XML::Element<C> const& e)
+ : Name<C> (e)
+ {
+ }
+
+ QName(XSCRT::XML::Attribute<C> const& a)
+ : Name<C> (a)
+ {
+ }
+
+ QName(Base__ const& x)
+ : Name<C> (x)
+ {
+ }
+
+ QName (C const* x)
+ : Name<C> (x)
+ {
+ }
+
+ QName&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+ template <typename C>
+ struct IdentityProvider : XSCRT::IdentityProvider
+ {
+ IdentityProvider (NCName<C> const& id)
+ : id_ (id)
+ {
+ }
+
+ virtual ~IdentityProvider (void)
+ {
+ }
+
+ virtual bool
+ before (XSCRT::IdentityProvider const& y) const
+ {
+ return id_ < dynamic_cast<IdentityProvider const&> (y).id_;
+ }
+
+ private:
+ NCName<C> const& id_;
+
+ private:
+ IdentityProvider (IdentityProvider const&);
+
+ IdentityProvider&
+ operator= (IdentityProvider const&);
+ };
+
+
+ template <typename C>
+ class ID : public NCName<C>
+ {
+ protected:
+ typedef typename NCName<C>::Base__ Base__;
+
+ public:
+ ~ID()
+ {
+ unregister_id ();
+ }
+
+ ID ()
+ : id_provider_ (*this)
+ {
+ }
+
+ ID (XSCRT::XML::Element<C> const& e)
+ : NCName<C> (e), id_provider_ (*this)
+ {
+ }
+
+ ID (XSCRT::XML::Attribute<C> const& a)
+ : NCName<C> (a), id_provider_ (*this)
+ {
+ }
+
+ ID (ID const& x)
+ : NCName<C> (x), id_provider_ (*this)
+ {
+ }
+
+ ID (Base__ const& x)
+ : NCName<C> (x), id_provider_ (*this)
+ {
+ }
+
+ ID (C const* x)
+ : NCName<C> (x), id_provider_ (*this)
+ {
+ }
+
+ ID&
+ operator= (Base__ const& x)
+ {
+ unregister_id ();
+
+ static_cast<NCName<C>&>(*this) = x;
+
+ register_id ();
+
+ return *this;
+ }
+
+ ID&
+ operator= (ID const& x)
+ {
+ unregister_id ();
+
+ static_cast<NCName<C>&>(*this) = static_cast<NCName<C> const&>(x);
+
+ register_id ();
+
+ return *this;
+ }
+
+ public:
+ using NCName<C>::container;
+
+ virtual void
+ container (XSCRT::Type* c)
+ {
+ unregister_id ();
+
+ NCName<C>::container (c);
+
+ register_id ();
+ }
+
+ private:
+ using NCName<C>::empty;
+ using NCName<C>::root;
+
+ void
+ register_id ()
+ {
+ if (NCName<C>::container () != this && !empty ())
+ {
+ //std::wcerr << "registering " << container ()
+ // << " as '" << *this
+ // << "' on " << container () << std::endl;
+ NCName<C>::container ()->register_id (id_provider_,
+ NCName<C>::container ());
+ }
+ }
+
+ void
+ unregister_id ()
+ {
+ if (NCName<C>::container () != this && !empty ())
+ {
+ //std::wcerr << "un-registering " << container ()
+ // << " as '" << *this
+ // << "' on " << container () << std::endl;
+ NCName<C>::container ()->unregister_id (id_provider_);
+ }
+ }
+
+ private:
+ IdentityProvider<C> id_provider_;
+ };
+
+ struct IDREF_Base : public XSCRT::Type
+ {
+ virtual XSCRT::Type const*
+ get () const = 0;
+
+ virtual XSCRT::Type*
+ get () = 0;
+ };
+
+ template <typename C>
+ class IDREF : public IDREF_Base
+ {
+ public:
+ typedef C CDR_Type__;
+ IDREF ()
+ : id_provider_ (id_)
+ {
+ }
+
+ IDREF (XSCRT::XML::Element<C> const& e)
+ : id_ (e), id_provider_ (id_)
+ {
+ }
+
+ IDREF (XSCRT::XML::Attribute<C> const& a)
+ : id_ (a), id_provider_ (id_)
+ {
+ }
+
+ IDREF (IDREF const& x)
+ : XMLSchema::IDREF_Base (),
+ id_ (x.id_), id_provider_ (id_)
+ {
+ }
+
+ IDREF (basic_string<C> const& id)
+ : id_ (id), id_provider_ (id_)
+ {
+ }
+
+ IDREF (C const* id)
+ : id_ (id), id_provider_ (id_)
+ {
+ }
+
+ IDREF&
+ operator= (IDREF const& x)
+ {
+ id_ = x.id_;
+ return *this;
+ }
+
+ IDREF&
+ operator= (basic_string<C> const& x)
+ {
+ id_ = x;
+ return *this;
+ }
+
+ public:
+ NCName<C>
+ id () const
+ {
+ return id_;
+ }
+
+ public:
+ XSCRT::Type const*
+ operator-> () const
+ {
+ return get ();
+ }
+
+ XSCRT::Type*
+ operator-> ()
+ {
+ return get ();
+ }
+
+ XSCRT::Type const&
+ operator* () const
+ {
+ return *(get ());
+ }
+
+ XSCRT::Type&
+ operator* ()
+ {
+ return *(get ());
+ }
+
+ virtual XSCRT::Type const*
+ get () const
+ {
+ if (!id_.empty () && container () != this)
+ {
+ return root ()->lookup_id (id_provider_);
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ virtual XSCRT::Type*
+ get ()
+ {
+ if (!id_.empty () && container () != this)
+ {
+ return root ()->lookup_id (id_provider_);
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ // conversion to bool
+ //
+ typedef void (IDREF::*bool_convertable)();
+
+ operator bool_convertable () const
+ {
+ return get () ? &IDREF::true_ : 0;
+ }
+
+ private:
+ void true_ ()
+ {
+ }
+
+ private:
+ NCName<C> id_;
+ IdentityProvider<C> id_provider_;
+ };
+
+ template <typename C>
+ class anyURI : public XSCRT::Type, public basic_string <C>
+ {
+ protected:
+ typedef basic_string <C> Base__ ;
+
+ public:
+ // Trait for marshaling string
+ typedef C CDR_Type__;
+
+ //@@ VC6 does not inject XSCRT::Type into the scope so I have
+ // to qualify it all the time.
+ //
+
+ anyURI (void)
+ {
+ }
+
+ anyURI (XSCRT::XML::Element<C> const& e)
+ : Base__ (e.value ())
+ {
+ }
+
+ anyURI (XSCRT::XML::Attribute<C> const& a)
+ : Base__ (a.value ())
+ {
+ }
+
+ anyURI (Base__ const& x)
+ : Base__ (x)
+ {
+ }
+
+ anyURI (C const * x)
+ : Base__ (x)
+ {
+ }
+
+ anyURI (const anyURI& s)
+ : Base__ (s)
+ {
+
+ }
+
+ anyURI & operator= (Base__ const& x)
+ {
+ static_cast <Base__ &> (*this) = x;
+ return *this;
+ }
+ };
+}
+
+#include "ace/XML_Utils/XMLSchema/Types.ipp"
+
+#endif // XMLSCHEMA_TYPES_HPP
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/Types.ipp b/dep/acelite/ace/XML_Utils/XMLSchema/Types.ipp
new file mode 100644
index 00000000000..9362a5b0066
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/Types.ipp
@@ -0,0 +1,8 @@
+// file : XMLSchema/Types.ipp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Types.ipp 86462 2009-08-12 13:31:27Z wotte $
+
+namespace XMLSchema
+{
+
+}
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/Writer.hpp b/dep/acelite/ace/XML_Utils/XMLSchema/Writer.hpp
new file mode 100644
index 00000000000..f54737a2846
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/Writer.hpp
@@ -0,0 +1,158 @@
+// file : XMLSchema/Writer.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Writer.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+#ifndef XMLSCHEMA_WRITER_HPP
+#define XMLSCHEMA_WRITER_HPP
+
+#include <sstream>
+
+#include <ace/XML_Utils/XSCRT/Writer.hpp>
+
+#include <ace/XML_Utils/XMLSchema/Types.hpp>
+#include <ace/XML_Utils/XMLSchema/Traversal.hpp>
+
+#include <iostream>
+
+namespace XMLSchema
+{
+ namespace Writer
+ {
+ template <typename T, typename C>
+ struct FundamentalType : Traversal::Traverser<T>,
+ virtual XSCRT::Writer<C>
+ {
+ FundamentalType (XSCRT::XML::Element<C>& e)
+ : XSCRT::Writer<C> (e)
+ {
+ }
+
+ using XSCRT::Writer<C>::top_;
+ using XSCRT::Writer<C>::attr_;
+
+ virtual void
+ traverse (T const& o)
+ {
+ using namespace XSCRT::XML;
+
+ std::basic_ostringstream<C> os;
+
+ os << o;
+
+ if (Attribute<C>* a = attr_ ())
+ {
+ a->value (os.str ());
+ }
+ else
+ {
+ top_().value (os.str ());
+ }
+ }
+
+ protected:
+ virtual void
+ traverse (T &t)
+ {
+ Traversal::Traverser<T>::traverse (t);
+ }
+
+ FundamentalType ()
+ {
+ }
+ };
+
+ template<typename C>
+ struct FundamentalType <XSCRT::FundamentalType<bool>, C> :
+ Traversal::Traverser<XSCRT::FundamentalType<bool> >,
+ virtual XSCRT::Writer<C>
+ {
+ FundamentalType (XSCRT::XML::Element<C> &e)
+ : XSCRT::Writer<C> (e)
+ {
+ }
+
+ using XSCRT::Writer<C>::top_;
+ using XSCRT::Writer<C>::attr_;
+
+ virtual void
+ traverse (XSCRT::FundamentalType<bool> const &o)
+ {
+ using namespace XSCRT::XML;
+
+ std::basic_ostringstream<C> os;
+
+ if (o)
+ {
+ os << "true";
+ }
+ else
+ {
+ os << "false";
+ }
+
+ if (Attribute<C>* a = attr_ ())
+ {
+ a->value (os.str ());
+ }
+ else
+ {
+ top_().value (os.str ());
+ }
+ }
+
+ protected:
+ virtual void
+ traverse (XSCRT::FundamentalType<bool> &t)
+ {
+ Traversal::Traverser<XSCRT::FundamentalType<bool> >::traverse (t);
+ }
+
+ FundamentalType ()
+ {
+ }
+ };
+
+
+ template <typename C>
+ struct IDREF : Traversal::Traverser<XMLSchema::IDREF<C> >,
+ virtual XSCRT::Writer<C>
+ {
+ IDREF (XSCRT::XML::Element<C>& e)
+ : XSCRT::Writer<C> (e)
+ {
+ }
+
+ virtual void
+ traverse (
+ typename Traversal::Traverser<XMLSchema::IDREF<C> >::Type const& o)
+ {
+ using namespace XSCRT::XML;
+
+ if (Attribute<C>* a = XSCRT::Writer<C>::attr_ ())
+ {
+ a->value (o.id ());
+ }
+ else
+ {
+ XSCRT::Writer<C>::top_().value (o.id ());
+ }
+ }
+
+ protected:
+
+ virtual void
+ traverse (typename Traversal::Traverser<XMLSchema::IDREF<C> >::Type &o)
+ {
+ Traversal::Traverser<XMLSchema::IDREF<C> >::traverse (o);
+ }
+
+ IDREF ()
+ {
+ }
+ };
+ }
+}
+
+#include <ace/XML_Utils/XMLSchema/Writer.ipp>
+
+#endif // XMLSCHEMA_WRITER_HPP
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/Writer.ipp b/dep/acelite/ace/XML_Utils/XMLSchema/Writer.ipp
new file mode 100644
index 00000000000..04019b1b1b9
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/Writer.ipp
@@ -0,0 +1,10 @@
+// file : XMLSchema/Writer.ipp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Writer.ipp 84406 2009-02-11 14:59:08Z wotte $
+
+namespace XMLSchema
+{
+ namespace Writer
+ {
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XMLSchema/id_map.hpp b/dep/acelite/ace/XML_Utils/XMLSchema/id_map.hpp
new file mode 100644
index 00000000000..0356e250c48
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XMLSchema/id_map.hpp
@@ -0,0 +1,144 @@
+// -*- C++ -*-
+// $Id: id_map.hpp 95802 2012-05-31 12:37:36Z johnnyw $
+
+//=============================================================================
+/**
+ * @file id_map.hpp
+ *
+ * This file contains the ID_Map class which has the responsibility of linking
+ * XML IDREF objects to their XML ID counterparts. In the output files, this
+ * means that a <IDREF name>_ptr() will return a pointer to the identified
+ * object.
+ *
+ * Exception NULL_PTR_Entry is thrown when a program attempts to add a NULL_PTR
+ * to either the id_map or idref_map.
+ *
+ * Exception Unresolved_IDREF is thrown if an element in an XML document attempts
+ * to reference an ID that does not exist.
+ *
+ * @author Jason R. Cody <jason.r.cody@vanderbilt.edu; jason.r.cody@gmail.com>
+ */
+//=============================================================================
+
+#ifndef _ID_MAP_H
+#define _ID_MAP_H
+
+//ID_Map makes use of the Types::idref_ data member to set it to the appropriate
+//object created during parsing
+#include "ace/XML_Utils/XMLSchema/Types.hpp"
+
+//The ID_Map is a Thread Specific Storage element.
+#include "ace/TSS_T.h"
+#include "ace/ace_wchar.h"
+
+ /**
+ * @class ID_Map
+ *
+ * @brief A class that handles the mapping of IDREF objects to objects with the
+ * respective ID.
+ */
+ class ID_Map
+ {
+ public:
+
+ //Trait to allow for ease of thread specific storage.
+ typedef ACE_TSS<ID_Map> TSS_ID_Map;
+ typedef std::map<std::basic_string<ACE_TCHAR>, XSCRT::Type*>::iterator id_iterator;
+ typedef std::multimap<std::basic_string<ACE_TCHAR>, XSCRT::Type*>::iterator idref_iterator;
+ typedef std::map<std::basic_string<ACE_TCHAR>, XSCRT::Type*> ID_MAP;
+ typedef std::multimap<std::basic_string<ACE_TCHAR>, XSCRT::Type*> IDREF_MAP;
+
+
+ //Exception Classes
+ //NULL_PTR_Entry thrown when a NULL PTR is added to the
+ //ID_Map
+ class NULL_PTR_Entry {};
+
+ //Unresolved_IDREF thrown when there are IDREF's in the
+ //XML document.
+ class Unresolved_IDREF {};
+
+ //Only a default constructor and destructor are needed
+ //Constructor
+ ID_Map ()
+ {
+ }
+
+ //Destructor
+ ~ID_Map ()
+ {
+ }
+
+ //Add an ID to the ID map
+ void add_id (std::basic_string<ACE_TCHAR> id, XSCRT::Type *obj_ref)
+ {
+ if (obj_ref)
+ {
+ this->id_map_.insert (ID_MAP::value_type(id, obj_ref));
+ }
+ else
+ {
+ throw NULL_PTR_Entry();
+ }
+ return;
+ }
+
+ //Add an IDREF to the IDREF map
+ void add_idref (std::basic_string<ACE_TCHAR> idref, XSCRT::Type *obj_ref)
+ {
+ if (obj_ref)
+ {
+ this->idref_map_.insert (IDREF_MAP::value_type(idref, obj_ref));
+ }
+ else
+ {
+ throw NULL_PTR_Entry();
+ }
+ return;
+ }
+
+ //Sets the referencing elements XSCRT::Type::idref_ to point to the
+ //referenced element.
+ //Note: The pointer is of type "XSCRT::Type*"
+ void resolve_idref ( void )
+ {
+ //Declare iterators to navigate the maps
+ ID_Map::id_iterator id_iterator;
+ ID_Map::idref_iterator idref_iterator;
+
+ for (idref_iterator = this->idref_map_.begin();
+ idref_iterator != this->idref_map_.end();
+ ++idref_iterator)
+ {
+ //Find the ID that matches the IDREF element
+ id_iterator = this->id_map_.find(idref_iterator->first);
+ if (id_iterator != this->id_map_.end())
+ {
+ //Add the IDREF identifier and the reference to the
+ //identified object
+ std::basic_string<ACE_TCHAR> temp_id = id_iterator->first;
+ idref_iterator->second->set_idref(temp_id, id_iterator->second);
+ }
+ else
+ {
+ //throw Unresolved_IDREF();
+ }
+ }
+ }
+
+ void reset (void)
+ {
+ id_map_.clear ();
+ idref_map_.clear ();
+ }
+
+ private:
+ //id_map_: maps the ID string to the element with the
+ // ID attribute
+ //idref_map_: multimap that maps the IDREF string to the
+ // element with the IDREF attribute
+ ID_MAP id_map_;
+ IDREF_MAP idref_map_;
+ };
+
+#endif /* _ID_MAP_HPP */
diff --git a/dep/acelite/ace/XML_Utils/XML_Error_Handler.cpp b/dep/acelite/ace/XML_Utils/XML_Error_Handler.cpp
new file mode 100644
index 00000000000..093a85ec942
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Error_Handler.cpp
@@ -0,0 +1,77 @@
+// $Id: XML_Error_Handler.cpp 95885 2012-06-14 14:05:44Z johnnyw $
+
+#include "XML_Error_Handler.h"
+#include "ace/Log_Msg.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/ACE.h"
+#include <xercesc/util/XMLString.hpp>
+#include <xercesc/dom/DOMLocator.hpp>
+#include <xercesc/sax/SAXParseException.hpp>
+#include "XercesString.h"
+#include <iostream>
+
+using xercesc::SAXParseException;
+
+namespace XML
+{
+ XML_Error_Handler::XML_Error_Handler (void)
+ : errors_ (false)
+ {
+ }
+
+ XML_Error_Handler::~XML_Error_Handler()
+ {
+ }
+
+ void XML_Error_Handler::warning(const SAXParseException& toCatch)
+ {
+ if (ACE::debug ())
+ {
+ XStr file (toCatch.getSystemId ());
+ XStr msg (toCatch.getMessage ());
+
+ std::cerr << "Warning: " << file << ':' << toCatch.getLineNumber ()
+ << ':' << toCatch.getColumnNumber () << " - "
+ << msg << std::endl;
+ }
+ }
+
+ void XML_Error_Handler::error(const SAXParseException& toCatch)
+ {
+ if (ACE::debug ())
+ {
+ XStr file (toCatch.getSystemId ());
+ XStr msg (toCatch.getMessage ());
+
+ std::cerr << "Error: " << file << ':' << toCatch.getLineNumber ()
+ << ':' << toCatch.getColumnNumber () << " - "
+ << msg << std::endl;
+ }
+ this->errors_ = true;
+ }
+
+ void XML_Error_Handler::fatalError(const SAXParseException& toCatch)
+ {
+ if (ACE::debug ())
+ {
+ XStr file (toCatch.getSystemId ());
+ XStr msg (toCatch.getMessage ());
+
+ std::cerr << "Fatal Error: " << file << ':' << toCatch.getLineNumber ()
+ << ':' << toCatch.getColumnNumber () << " - "
+ << msg << std::endl;
+ }
+ this->errors_ = true;
+ }
+
+ void XML_Error_Handler::resetErrors()
+ {
+ this->errors_ = false;
+ }
+
+ bool
+ XML_Error_Handler::getErrors (void) const
+ {
+ return this->errors_;
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XML_Error_Handler.h b/dep/acelite/ace/XML_Utils/XML_Error_Handler.h
new file mode 100644
index 00000000000..4047df6a09a
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Error_Handler.h
@@ -0,0 +1,60 @@
+//==============================================================
+/**
+ * @file XML_Error_Handler.h
+ *
+ * $Id: XML_Error_Handler.h 95801 2012-05-31 09:14:36Z johnnyw $
+ *
+ * @brief Error handler for Xerces
+ *
+ * @author Bala Natarajan <bala@dre.vanderbilt.edu>
+ */
+//================================================================
+#ifndef ACE_XML_ERROR_HANDLER_H
+#define ACE_XML_ERROR_HANDLER_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "XML_Utils_Export.h"
+
+#include <xercesc/sax/ErrorHandler.hpp>
+
+using xercesc::SAXParseException;
+
+namespace XML
+{
+ /**
+ * @class XML_Error_Hander
+ *
+ * @brief Error handler for XERCES
+ *
+ */
+ class XML_Utils_Export XML_Error_Handler
+ : public xercesc::ErrorHandler
+ {
+ public:
+
+ XML_Error_Handler (void);
+
+ ~XML_Error_Handler (void);
+
+ void warning(const SAXParseException& toCatch);
+ void error(const SAXParseException& toCatch);
+ void fatalError(const SAXParseException& toCatch);
+ void resetErrors();
+ bool getErrors (void) const;
+ private :
+ // Disallow copying
+ XML_Error_Handler (const XML_Error_Handler&);
+ XML_Error_Handler& operator= (const XML_Error_Handler&);
+
+ bool errors_;
+ };
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_XML_ERROR_HANDLER_H */
diff --git a/dep/acelite/ace/XML_Utils/XML_Helper.h b/dep/acelite/ace/XML_Utils/XML_Helper.h
new file mode 100644
index 00000000000..4bb0e8161f2
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Helper.h
@@ -0,0 +1,99 @@
+// $Id: XML_Helper.h 95801 2012-05-31 09:14:36Z johnnyw $
+//============================================================
+/**
+ * @file XML_Helper.h
+ *
+ * @brief Some helper functions for XML
+ *
+ * @author Bala Natarajan <bala@dre.vanderbilt.edu>
+ * @author William R. Otte <wotte@dre.vanderbilt.edu>
+ */
+//============================================================
+#ifndef ACE_XML_HELPER_H
+#define ACE_XML_HELPER_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "XML_Error_Handler.h"
+#include "XML_Schema_Resolver.h"
+
+#include "xercesc/util/XercesDefs.hpp"
+#include "xercesc/parsers/XercesDOMParser.hpp"
+
+#include <memory>
+
+namespace XERCES_CPP_NAMESPACE
+{
+ class DOMDocument;
+ class DOMWriter;
+ class DOMImplementation;
+ class DOMDocumentType;
+}
+
+namespace XML
+{
+ /**
+ * @class XML_Helper
+ *
+ * @brief Helper class for some routine XML stuff.
+ */
+ template <typename Resolver = XML_Schema_Resolver <>,
+ typename Error_Handler = XML_Error_Handler>
+ class XML_Helper
+ {
+ public:
+ // XML_Helper (void);
+ XML_Helper (Resolver *resolver = 0, Error_Handler *eh = 0);
+
+ ~XML_Helper (void);
+
+ /// Create a DOM tree
+ XERCES_CPP_NAMESPACE::DOMDocument *
+ create_dom (const ACE_TCHAR *uri) const;
+
+ XERCES_CPP_NAMESPACE::DOMDocument *
+ create_dom (const ACE_TCHAR *root,
+ const ACE_TCHAR *ns,
+ XERCES_CPP_NAMESPACE::DOMDocumentType * doctype = 0) const;
+
+ XERCES_CPP_NAMESPACE::DOMDocumentType *
+ create_doctype (const ACE_TCHAR *qn,
+ const ACE_TCHAR *pid,
+ const ACE_TCHAR *sid) const;
+
+ /// Writes out a DOMDocument to an XML file
+ bool write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc,
+ const ACE_TCHAR *file) const;
+
+ bool is_initialized (void) const;
+
+ /// Terminate the parser
+ void terminate_parser (void);
+
+ Resolver &get_resolver (void);
+
+ Error_Handler &get_error_handler (void);
+
+ protected:
+ /// Intialize the parser
+ void init_parser (void);
+
+ private:
+ bool initialized_;
+ XERCES_CPP_NAMESPACE::DOMImplementation *impl_;
+ mutable std::auto_ptr<XERCES_CPP_NAMESPACE::XercesDOMParser> parser_;
+
+ Resolver *resolver_;
+ bool release_resolver_;
+ Error_Handler *e_handler_;
+ bool release_e_handler_;
+ };
+}
+
+#include "XML_Helper.tpp"
+
+#include /**/ "ace/post.h"
+#endif/*ACE_XML_HELPER_H*/
diff --git a/dep/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp b/dep/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp
new file mode 100644
index 00000000000..26914d99439
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Schema_Resolver.cpp
@@ -0,0 +1,77 @@
+// $Id: XML_Schema_Resolver.cpp 95760 2012-05-15 13:46:19Z msmit $
+#include "XML_Schema_Resolver.h"
+
+#include <xercesc/util/PlatformUtils.hpp>
+#include <xercesc/util/XercesDefs.hpp>
+
+#include "XercesString.h"
+
+#include "ace/Env_Value_T.h"
+
+#include <iostream>
+
+namespace XML
+{
+ Basic_Resolver::Basic_Resolver (const ACE_TCHAR *path)
+ : path_ (path)
+ {
+ }
+
+ XMLCh *
+ Basic_Resolver::operator() (const XMLCh *const,
+ const XMLCh *const systemId) const
+ {
+ XStr path (path_);
+ path.append (systemId);
+ return path.release ();
+ }
+
+ Environment_Resolver::Environment_Resolver (void)
+ {
+ }
+
+ Environment_Resolver::Environment_Resolver (const ACE_TCHAR *variable,
+ const ACE_TCHAR *relpath)
+ {
+ this->add_path (variable, relpath);
+ }
+
+ using xercesc::XMLPlatformUtils;
+
+ void
+ Environment_Resolver::add_path (const ACE_TCHAR *variable,
+ const ACE_TCHAR *relpath)
+ {
+ ACE_Env_Value <const ACE_TCHAR *> path_env (variable,
+ ACE_TEXT(""));
+
+ XStr xpath (path_env);
+ XStr xrelpath (relpath);
+
+ xpath.append (xrelpath);
+
+ paths_.push_back (xpath);
+ }
+
+ XMLCh *
+ Environment_Resolver::operator() (const XMLCh *const,
+ const XMLCh *const systemId) const
+ {
+ for (std::vector<XStr>::const_iterator i = this->paths_.begin ();
+ i != this->paths_.end ();
+ ++i)
+ {
+ XStr path (*i);
+ path.append(systemId);
+
+ FileHandle file (XMLPlatformUtils::openFile (path));
+
+ if (file != 0)
+ {
+ XMLPlatformUtils::closeFile (file);
+ return path.release ();
+ }
+ }
+ return 0;
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XML_Schema_Resolver.h b/dep/acelite/ace/XML_Utils/XML_Schema_Resolver.h
new file mode 100644
index 00000000000..174e3ea56e7
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Schema_Resolver.h
@@ -0,0 +1,110 @@
+/**
+ * @file XML_Schema_Resolver.h
+ * @author Will Otte <wotte@dre.vanderbilt.edu>
+ *
+ * $Id: XML_Schema_Resolver.h 95801 2012-05-31 09:14:36Z johnnyw $
+ *
+ * Resolves schema locations.
+ */
+
+#ifndef ACE_XML_SCHEMA_RESOLVER_H
+#define ACE_XML_SCHEMA_RESOLVER_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "XML_Utils_Export.h"
+#include "XercesString.h"
+
+#include <xercesc/sax/EntityResolver.hpp>
+#include <vector>
+#include <string>
+
+using namespace xercesc;
+
+namespace XML
+{
+ // forward decl.
+ struct NoOp_Resolver;
+
+ /**
+ * @class XML_Schema_Resolver
+ * @brief Resolves schema locations
+ *
+ * Template argument Resolver should be a functor with an operation
+ * const ACE_TCHAR * operator () (...arguments from resolveEntity...)
+ */
+ template <typename Resolver = NoOp_Resolver>
+ class XML_Schema_Resolver
+ : public virtual EntityResolver
+ {
+ public:
+ XML_Schema_Resolver (void);
+
+ XML_Schema_Resolver (Resolver &resolver);
+
+ /// This function is called by the Xerces infrastructure to
+ /// actually resolve the location of a schema.
+ virtual InputSource * resolveEntity (const XMLCh *const publicId,
+ const XMLCh *const systemId);
+
+ Resolver &get_resolver (void);
+
+ private:
+ XML_Schema_Resolver (XML_Schema_Resolver<Resolver> &);
+
+ Resolver resolver_;
+ };
+
+ /**
+ * @class NoOp_Resolver
+ * @brief Resolver that does nothing.
+ */
+ struct NoOp_Resolver
+ {
+ const XMLCh* operator() (const XMLCh *const,
+ const XMLCh *const systemId) const
+ { return systemId; };
+ };
+
+ /**
+ * @class Basic_Resolver
+ * @brief Resolves a schema location from a fixed path.
+ */
+ struct Basic_Resolver
+ {
+ Basic_Resolver (const ACE_TCHAR *path);
+
+ XMLCh* operator() (const XMLCh *const publicId,
+ const XMLCh *const systemId) const;
+ XStr path_;
+ };
+
+ /**
+ * @class Environment_Resolver
+ * @brief Resolves a schema location from a path from an environment variable.
+ */
+ struct XML_Utils_Export Environment_Resolver
+ {
+ Environment_Resolver (void);
+
+ Environment_Resolver (const ACE_TCHAR *variable,
+ const ACE_TCHAR *path);
+
+ void add_path (const ACE_TCHAR *variable,
+ const ACE_TCHAR *path);
+
+ XMLCh* operator() (const XMLCh *const publicId,
+ const XMLCh *const systemId) const;
+
+ std::vector<XStr> paths_;
+ };
+}
+
+#include "XML_Schema_Resolver.tpp"
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_XML_SCHEMA_RESOLVER_H */
diff --git a/dep/acelite/ace/XML_Utils/XML_Typedefs.cpp b/dep/acelite/ace/XML_Utils/XML_Typedefs.cpp
new file mode 100644
index 00000000000..aad41d82e80
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Typedefs.cpp
@@ -0,0 +1,8 @@
+// $Id: XML_Typedefs.cpp 95760 2012-05-15 13:46:19Z msmit $
+
+#include "XML_Typedefs.h"
+
+namespace XML
+{
+ XML_Typedef::HELPER XML_Typedef::XML_HELPER;
+}
diff --git a/dep/acelite/ace/XML_Utils/XML_Typedefs.h b/dep/acelite/ace/XML_Utils/XML_Typedefs.h
new file mode 100644
index 00000000000..c41da608f76
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Typedefs.h
@@ -0,0 +1,32 @@
+/**
+ * @file XML_Typedefs.h
+ * @author William R. Otte <wotte@dre.vanderbilt.edu>
+ * $Id: XML_Typedefs.h 95760 2012-05-15 13:46:19Z msmit $
+ * Typedefs from the XML Utilities.
+ */
+#ifndef XML_TYPEDEFS_H
+#define XML_TYPEDEFS_H
+
+#include "XML_Utils_Export.h"
+#include "XML_Helper.h"
+#include "XML_Schema_Resolver.h"
+#include "XML_Error_Handler.h"
+
+namespace XML
+{
+ class XML_Utils_Export XML_Typedef
+ {
+ public:
+ typedef ::XML::Environment_Resolver PATH_RESOLVER;
+ typedef ::XML::XML_Schema_Resolver< ::XML::Environment_Resolver > XML_RESOLVER;
+ typedef ::XML::XML_Error_Handler ERROR_HANDLER;
+ typedef ::XML::XML_Helper< XML_RESOLVER, ERROR_HANDLER > HELPER;
+
+ static ERROR_HANDLER _xml_error_handler;
+
+ public:
+ static HELPER XML_HELPER;
+ };
+}
+
+#endif /* XML_TYPEDEFS_H */
diff --git a/dep/acelite/ace/XML_Utils/XML_Utils_Export.h b/dep/acelite/ace/XML_Utils/XML_Utils_Export.h
new file mode 100644
index 00000000000..56ea76a248b
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XML_Utils_Export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: XML_Utils_Export.h 95760 2012-05-15 13:46:19Z msmit $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl XML_Utils
+// ------------------------------
+#ifndef XML_UTILS_EXPORT_H
+#define XML_UTILS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (XML_UTILS_HAS_DLL)
+# define XML_UTILS_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && XML_UTILS_HAS_DLL */
+
+#if !defined (XML_UTILS_HAS_DLL)
+# define XML_UTILS_HAS_DLL 1
+#endif /* ! XML_UTILS_HAS_DLL */
+
+#if defined (XML_UTILS_HAS_DLL) && (XML_UTILS_HAS_DLL == 1)
+# if defined (XML_UTILS_BUILD_DLL)
+# define XML_Utils_Export ACE_Proper_Export_Flag
+# define XML_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* XML_UTILS_BUILD_DLL */
+# define XML_Utils_Export ACE_Proper_Import_Flag
+# define XML_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* XML_UTILS_BUILD_DLL */
+#else /* XML_UTILS_HAS_DLL == 1 */
+# define XML_Utils_Export
+# define XML_UTILS_SINGLETON_DECLARATION(T)
+# define XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* XML_UTILS_HAS_DLL == 1 */
+
+// Set XML_UTILS_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (XML_UTILS_NTRACE)
+# if (ACE_NTRACE == 1)
+# define XML_UTILS_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define XML_UTILS_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !XML_UTILS_NTRACE */
+
+#if (XML_UTILS_NTRACE == 1)
+# define XML_UTILS_TRACE(X)
+#else /* (XML_UTILS_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define XML_UTILS_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (XML_UTILS_NTRACE == 1) */
+
+#endif /* XML_UTILS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/Elements.hpp b/dep/acelite/ace/XML_Utils/XSCRT/Elements.hpp
new file mode 100644
index 00000000000..d0afe1aaf2d
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/Elements.hpp
@@ -0,0 +1,569 @@
+// file : XSCRT/Elements.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Elements.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+#ifndef XSCRT_ELEMENTS_HPP
+#define XSCRT_ELEMENTS_HPP
+
+#include <map>
+#include <string>
+#include <sstream>
+#include "ace/ace_wchar.h"
+// #include <iostream> //@@ tmp
+
+#include <ace/XML_Utils/XSCRT/Parser.hpp>
+#include "ace/Refcounted_Auto_Ptr.h"
+
+namespace XSCRT
+{
+ struct IdentityProvider
+ {
+ virtual bool
+ before (IdentityProvider const&) const = 0;
+
+ virtual ~IdentityProvider (void)
+ {
+
+ }
+ };
+
+ class Type
+ {
+ public:
+
+ virtual ~Type (void)
+ {
+ }
+
+ protected:
+ Type (void)
+ : container_ (0)
+ {
+ }
+
+ template <typename C>
+ Type (XML::Element<C> const&)
+ : container_ (0)
+ {
+ }
+
+ template <typename C>
+ Type (XML::Attribute<C> const&)
+ : container_ (0)
+ {
+ }
+
+ Type (Type const&)
+ : container_ (0)
+ {
+ }
+
+ Type&
+ operator= (Type const&)
+ {
+ //@@ I don't need this.
+ //if (map_.get ()) map_->clear (); // Flush the map.
+ return *this;
+ }
+
+ public:
+ Type const*
+ container () const
+ {
+ return container_ ? container_ : this;
+ }
+
+ Type*
+ container ()
+ {
+ return container_ ? container_ : this;
+ }
+
+
+ Type const*
+ root () const
+ {
+ Type const* r = container ();
+
+ //@@ VC6 can't handle this inside the loop.
+ //
+ Type const* c = r->container ();
+
+ for (; c != r; c = c->container ()) r = c;
+
+ return r;
+ }
+
+ Type*
+ root ()
+ {
+ Type* r = container ();
+
+ for (Type* c = r->container (); c != r; c = c->container ()) r = c;
+
+ return r;
+ }
+
+ //@@
+ //protected:
+
+ public:
+ virtual void
+ container (Type* c)
+ {
+ if (container_ == c) return;
+
+ // Revoke registrations from our old container.
+ //
+ if (container_ != 0 && map_.get ())
+ {
+ for (Map_::iterator i (map_->begin ()); i != map_->end (); ++i)
+ {
+ //std::wcerr << "revoking " << i->second
+ // << " to " << container_ << std::endl;
+
+ container_->unregister_id (*(i->first));
+ }
+ }
+
+ // Copy registrations to our new container.
+ //
+ if (c != 0 && map_.get ())
+ {
+ for (Map_::iterator i (map_->begin ()); i != map_->end (); ++i)
+ {
+ //std::wcerr << "copying " << i->second
+ // << " to " << c << std::endl;
+
+ c->register_id (*(i->first), i->second);
+ }
+ }
+
+ container_ = c;
+ }
+
+ //@@
+ //protected:
+
+ public:
+ void
+ register_id (IdentityProvider const& id, Type* t)
+ {
+ if (map_.get () == 0)
+ {
+ map_ = std::auto_ptr<Map_> (new Map_);
+ }
+
+ if (!map_->insert (
+ std::pair<IdentityProvider const*, Type*> (&id, t)).second)
+ {
+ throw 1;
+ }
+
+ if (container () != this) container ()->register_id (id, t);
+ }
+
+ void
+ unregister_id (IdentityProvider const& id)
+ {
+ if (map_.get ())
+ {
+ Map_::iterator it (map_->find (&id));
+
+ if (it != map_->end ())
+ {
+ map_->erase (it);
+
+ if (container () != this) container ()->unregister_id (id);
+
+ return;
+ }
+ }
+
+ throw 1;
+ }
+
+ Type*
+ lookup_id (IdentityProvider const& id) const
+ {
+ if (map_.get ())
+ {
+ Map_::const_iterator it (map_->find (&id));
+
+ if (it != map_->end ())
+ {
+ return it->second;
+ }
+ }
+
+ return 0;
+ }
+
+ //Get and set methods for the idref_map_ data member
+ Type* get_idref (const char* name)
+ {
+ std::basic_string<ACE_TCHAR> name_string (ACE_TEXT_CHAR_TO_TCHAR(name));
+ std::map<std::basic_string<ACE_TCHAR>, XSCRT::Type*>::iterator i =
+ this->idref_map_.find(name_string);
+ if (i != idref_map_.end())
+ {
+ return i->second;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ Type* get_idref (const wchar_t *name)
+ {
+ std::basic_string<ACE_TCHAR> name_string (ACE_TEXT_WCHAR_TO_TCHAR(name));
+ std::map<std::basic_string<ACE_TCHAR>, XSCRT::Type*>::iterator i =
+ this->idref_map_.find(name_string);
+ if (i != idref_map_.end())
+ {
+ return i->second;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+
+ void set_idref (std::basic_string<ACE_TCHAR> name, Type* new_idref)
+ {
+ this->idref_map_.insert(std::pair<std::basic_string<ACE_TCHAR>,Type*>(name, new_idref));
+ return;
+ }
+
+ private:
+
+ //Data member to handle unbounded IDREF attributes and elements
+ std::map<std::basic_string<ACE_TCHAR>, XSCRT::Type*> idref_map_;
+
+ Type* container_;
+
+ struct IdentityComparator
+ {
+ bool operator () (IdentityProvider const* x,
+ IdentityProvider const* y) const
+ {
+ return x->before (*y);
+ }
+ };
+
+ typedef
+ std::map<IdentityProvider const*, Type*, IdentityComparator>
+ Map_;
+
+ std::auto_ptr<Map_> map_;
+ };
+
+ // Fundamental types template.
+ //
+ //
+ template <typename X>
+ class FundamentalType : public Type
+ {
+ public:
+ // Trait for marshaling a FundamentalType X
+ typedef X CDR_Type__;
+#if !defined (__BORLANDC__) || (__BORLANDC__ >= 0x620)
+ typedef ACE_Refcounted_Auto_Ptr < FundamentalType, ACE_Null_Mutex > _ptr;
+#endif /* !__BORLANDC__ */
+
+ FundamentalType ()
+ {
+ }
+
+ template<typename C>
+ FundamentalType (XML::Element<C> const& e)
+ {
+ std::basic_stringstream<C> s;
+ s << e.value ();
+ s >> x_;
+ }
+
+ template<typename C>
+ FundamentalType (XML::Attribute<C> const& a)
+ {
+ std::basic_stringstream<C> s;
+ s << a.value ();
+ s >> x_;
+ }
+
+ FundamentalType (X const& x)
+ : x_ (x)
+ {
+ }
+
+ FundamentalType&
+ operator= (X const& x)
+ {
+ x_ = x;
+ return *this;
+ }
+
+ public:
+ operator X const& () const
+ {
+ return x_;
+ }
+
+ operator X& ()
+ {
+ return x_;
+ }
+
+ protected:
+ X x_;
+ };
+
+#if !((defined (__GNUC__) && (__GNUC__ == 3 && (__GNUC_MINOR__ < 3))) || \
+ (defined (__BORLANDC__) && (__BORLANDC__ < 0x620)) || \
+ (defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x5100)))
+
+ // Stuff for normal compilers.
+ //
+
+ // Specialization for `signed char'
+ //
+ //
+ template<>
+ template<typename C>
+ inline
+ FundamentalType<signed char>::
+ FundamentalType (XML::Element<C> const& e)
+ {
+ std::basic_stringstream<C> s;
+ s << e.value ();
+
+ short t;
+ s >> t;
+
+ x_ = static_cast<signed char> (t);
+ }
+
+ template<>
+ template<typename C>
+ inline
+ FundamentalType<signed char>::
+ FundamentalType (XML::Attribute<C> const& a)
+ {
+ std::basic_stringstream<C> s;
+ s << a.value ();
+
+ short t;
+ s >> t;
+
+ x_ = static_cast<signed char> (t);
+ }
+
+ // Specialization for `unsigned char'
+ //
+ //
+ template<>
+ template<typename C>
+ inline
+ FundamentalType<unsigned char>::
+ FundamentalType (XML::Element<C> const& e)
+ {
+ std::basic_stringstream<C> s;
+ s << e.value ();
+
+ unsigned short t;
+ s >> t;
+
+ x_ = static_cast<unsigned char> (t);
+ }
+
+ template<>
+ template<typename C>
+ inline
+ FundamentalType<unsigned char>::
+ FundamentalType (XML::Attribute<C> const& a)
+ {
+ std::basic_stringstream<C> s;
+ s << a.value ();
+
+ unsigned short t;
+ s >> t;
+
+ x_ = static_cast<unsigned char> (t);
+ }
+
+#else
+
+ // Stuff for broken VC6 & gcc < 3.3. Don't like what you see - use better
+ // compiler!
+ //
+
+ // Specialization for signed char.
+ //
+ template <>
+ class FundamentalType<signed char> : public Type
+ {
+ public:
+ FundamentalType ()
+ {
+ }
+
+ template<typename C>
+ FundamentalType (XML::Element<C> const& e)
+ {
+ std::basic_stringstream<C> s;
+ s << e.value ();
+
+ short t;
+ s >> t;
+
+ x_ = static_cast<signed char> (t);
+ }
+
+ template<typename C>
+ FundamentalType (XML::Attribute<C> const& a)
+ {
+ std::basic_stringstream<C> s;
+ s << a.value ();
+
+ short t;
+ s >> t;
+
+ x_ = static_cast<signed char> (t);
+ }
+
+ FundamentalType (signed char const& x)
+ : x_ (x)
+ {
+ }
+
+ FundamentalType&
+ operator= (signed char const& x)
+ {
+ x_ = x;
+ return *this;
+ }
+
+ public:
+ operator signed char const& () const
+ {
+ return x_;
+ }
+
+ operator signed char& ()
+ {
+ return x_;
+ }
+
+ protected:
+ signed char x_;
+ };
+
+ // Specialization for unsigned char.
+ //
+ template <>
+ class FundamentalType<unsigned char> : public Type
+ {
+ public:
+ FundamentalType ()
+ {
+ }
+
+ template<typename C>
+ FundamentalType (XML::Element<C> const& e)
+ {
+ std::basic_stringstream<C> s;
+ s << e.value ();
+
+ unsigned short t;
+ s >> t;
+
+ x_ = static_cast<unsigned char> (t);
+ }
+
+ template<typename C>
+ FundamentalType (XML::Attribute<C> const& a)
+ {
+ std::basic_stringstream<C> s;
+ s << a.value ();
+
+ unsigned short t;
+ s >> t;
+
+ x_ = static_cast<unsigned char> (t);
+ }
+
+ FundamentalType (unsigned char const& x)
+ : x_ (x)
+ {
+ }
+
+ FundamentalType&
+ operator= (unsigned char const& x)
+ {
+ x_ = x;
+ return *this;
+ }
+
+ public:
+ operator unsigned char const& () const
+ {
+ return x_;
+ }
+
+ operator unsigned char& ()
+ {
+ return x_;
+ }
+
+ protected:
+ unsigned char x_;
+ };
+
+#endif
+
+
+ // Specialization for bool.
+ //
+ //
+
+ template<>
+ template<>
+ inline
+ FundamentalType<bool>::
+ FundamentalType (XML::Element<char> const& e)
+ {
+ x_ = (e.value () == "true") || (e.value () == "1");
+ }
+
+ template<>
+ template<>
+ inline
+ FundamentalType<bool>::
+ FundamentalType (XML::Element<wchar_t> const& e)
+ {
+ x_ = (e.value () == L"true") || (e.value () == L"1");
+ }
+
+ template<>
+ template<>
+ inline
+ FundamentalType<bool>::
+ FundamentalType (XML::Attribute<char> const& a)
+ {
+ x_ = (a.value () == "true") || (a.value () == "1");
+ }
+
+ template<>
+ template<>
+ inline
+ FundamentalType<bool>::
+ FundamentalType (XML::Attribute<wchar_t> const& a)
+ {
+ x_ = (a.value () == L"true") || (a.value () == L"1");
+ }
+
+}
+
+#endif // XSCRT_ELEMENTS_HPP
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp b/dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp
new file mode 100644
index 00000000000..89f6da81f52
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp
@@ -0,0 +1,182 @@
+// file : XSCRT/ExtendedTypeInfo.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: ExtendedTypeInfo.hpp 95802 2012-05-31 12:37:36Z johnnyw $
+
+#ifndef XSCRT_EXTENDED_TYPE_INFO_HPP
+#define XSCRT_EXTENDED_TYPE_INFO_HPP
+
+#include <map>
+#include <vector>
+#include <typeinfo>
+
+namespace XSCRT
+{
+ //
+ //
+ //
+ class TypeId
+ {
+ public:
+ template<typename T>
+ TypeId (T const& t);
+
+ TypeId (std::type_info const& tid);
+
+ public:
+ bool
+ operator == (TypeId const& other) const;
+
+ bool
+ operator != (TypeId const& other) const;
+
+ bool
+ operator < (TypeId const& other) const;
+
+ /*
+ friend std::ostream&
+ operator << (std::ostream& os, TypeId const& t);
+ */
+
+ public:
+ char const*
+ name () const
+ {
+ return tid_->name ();
+ }
+
+ private:
+ std::type_info const* tid_;
+ };
+
+
+ //
+ //
+ //
+ class ExtendedTypeInfo
+ {
+ public:
+
+ //
+ //
+ //
+ struct Access
+ {
+ enum Value
+ {
+ private_,
+ protected_,
+ public_
+ };
+ };
+
+
+ //
+ //
+ //
+ class BaseInfo
+ {
+ public:
+ BaseInfo (Access::Value access, bool virtual_base, TypeId const& tid);
+
+ public:
+ ExtendedTypeInfo const&
+ type_info () const;
+
+ Access::Value
+ access () const;
+
+ bool
+ virtual_base () const;
+
+ private:
+ TypeId tid_;
+ mutable ExtendedTypeInfo const* ti_;
+ bool virtual_base_;
+ Access::Value access_;
+ };
+
+ private:
+ typedef
+ std::vector<BaseInfo>
+ BaseInfoList;
+
+ public:
+ typedef
+ BaseInfoList::const_iterator
+ BaseIterator;
+
+ public:
+ ExtendedTypeInfo (TypeId const& tid);
+
+ TypeId
+ type_id () const;
+
+ BaseIterator
+ begin_base () const;
+
+ BaseIterator
+ end_base () const;
+
+ void
+ add_base (Access::Value access, bool virtual_base, TypeId const& tid);
+
+ private:
+ TypeId tid_;
+ BaseInfoList base_;
+ };
+
+ typedef
+ std::map<TypeId, ExtendedTypeInfo>
+ ExtendedTypeInfoMap;
+
+
+ ExtendedTypeInfoMap&
+ extended_type_info_map ();
+
+
+ class NotAvailable {};
+
+
+ template<typename T>
+ ExtendedTypeInfo const&
+ extended_type_info (T const& t)
+ {
+ return extended_type_info (typeid (t));
+ }
+
+ template<typename T>
+ ExtendedTypeInfo const&
+ extended_type_info ()
+ {
+ return extended_type_info (typeid (T));
+ }
+
+ //@@ Had to use function template specialization because VC6
+ // cannot handle simply overloaded functions.
+ //
+
+ template <>
+ inline
+ ExtendedTypeInfo const&
+ extended_type_info<TypeId> (TypeId const& tid)
+ {
+ ExtendedTypeInfoMap::const_iterator i (
+ extended_type_info_map ().find (tid));
+
+ if (i == extended_type_info_map ().end ()) throw NotAvailable ();
+
+ return i->second;
+ }
+
+ template <>
+ inline
+ ExtendedTypeInfo const&
+ extended_type_info<std::type_info> (std::type_info const& tid)
+ {
+ return extended_type_info (TypeId (tid));
+ }
+}
+
+#include <ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp>
+
+#endif // XSCRT_EXTENDED_TYPE_INFO_HPP
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp b/dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp
new file mode 100644
index 00000000000..5d62821347f
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/ExtendedTypeInfo.ipp
@@ -0,0 +1,141 @@
+// file : XSCRT/ExtendedTypeInfo.ipp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: ExtendedTypeInfo.ipp 86462 2009-08-12 13:31:27Z wotte $
+
+
+/*
+ * @@HACK: Visual Studio.
+ * I think the return value for operator== for type_info
+ * in VC7 (perhaps others) is int when is should be bool.
+ * This causes a warning about converting the return value from
+ * int to bool.
+ */
+#ifdef _MSC_VER
+# pragma warning( disable: 4800 )
+#endif
+
+namespace XSCRT
+{
+ // TypeId
+ //
+ //
+ inline
+ TypeId::
+ TypeId (std::type_info const& tid)
+ : tid_ (&tid)
+ {
+ }
+
+ inline
+ bool TypeId::
+ operator == (TypeId const& other) const
+ {
+ return *tid_ == *other.tid_;
+ }
+
+ inline
+ bool TypeId::
+ operator != (TypeId const& other) const
+ {
+ return *tid_ != *other.tid_;
+ }
+
+ inline
+ bool TypeId::
+ operator < (TypeId const& other) const
+ {
+ return tid_->before (*other.tid_);
+ }
+
+
+ // ExtendedTypeInfo::BaseInfo
+ //
+ //
+
+ inline
+ ExtendedTypeInfo::BaseInfo::
+ BaseInfo (Access::Value access, bool virtual_base, TypeId const& tid)
+ : tid_ (tid),
+ ti_ (0),
+ virtual_base_ (virtual_base),
+ access_ (access)
+ {
+ }
+
+ inline
+ ExtendedTypeInfo const& ExtendedTypeInfo::BaseInfo::
+ type_info () const
+ {
+ if (ti_ == 0) ti_ = &(extended_type_info (tid_));
+
+ return *ti_;
+ }
+
+
+ inline
+ ExtendedTypeInfo::Access::Value ExtendedTypeInfo::BaseInfo::
+ access () const
+ {
+ return access_;
+ }
+
+ inline
+ bool ExtendedTypeInfo::BaseInfo::
+ virtual_base () const
+ {
+ return virtual_base_;
+ }
+
+
+ // ExtendedTypeInfo
+ //
+ //
+ inline
+ ExtendedTypeInfo::
+ ExtendedTypeInfo (TypeId const& tid)
+ : tid_ (tid)
+ {
+ }
+
+ inline
+ TypeId ExtendedTypeInfo::
+ type_id () const
+ {
+ return tid_;
+ }
+
+ inline
+ ExtendedTypeInfo::BaseIterator ExtendedTypeInfo::
+ begin_base () const
+ {
+ return base_.begin ();
+ }
+
+
+ inline
+ ExtendedTypeInfo::BaseIterator ExtendedTypeInfo::
+ end_base () const
+ {
+ return base_.end ();
+ }
+
+ inline
+ void ExtendedTypeInfo::
+ add_base (Access::Value access, bool virtual_base, TypeId const& tid)
+ {
+ base_.push_back (BaseInfo (access, virtual_base, tid));
+ }
+
+ // ExtendedTypeInfoMap
+ //
+ //
+
+ inline
+ ExtendedTypeInfoMap&
+ extended_type_info_map ()
+ {
+ static ExtendedTypeInfoMap extended_type_info_map_;
+
+ return extended_type_info_map_;
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/Parser.hpp b/dep/acelite/ace/XML_Utils/XSCRT/Parser.hpp
new file mode 100644
index 00000000000..52f7c6dcb14
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/Parser.hpp
@@ -0,0 +1,64 @@
+// file : XSCRT/Parser.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Parser.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+#ifndef XSCRT_PARSER_HPP
+#define XSCRT_PARSER_HPP
+
+#include <string>
+
+#include "ace/XML_Utils/XSCRT/XML.hpp"
+
+namespace XSCRT
+{
+ template <typename C>
+ class Parser
+ {
+ public:
+ Parser (XML::Element<C> const& e)
+ : e_ (e.dom_element ()->getChildNodes ()), ei_ (0),
+ a_ (e.dom_element ()->getAttributes ()), ai_ (0)
+ {
+ }
+
+ bool
+ more_elements () const
+ {
+ return e_->getLength () > ei_;
+ }
+
+ XML::Element<C>
+ next_element ()
+ {
+ return XML::Element<C> (XML::dom_cast <xercesc::DOMElement*> (e_->item (ei_++)));
+ }
+
+ bool
+ more_attributes () const
+ {
+ return a_->getLength () > ai_;
+ }
+
+ XML::Attribute<C>
+ next_attribute ()
+ {
+ return XML::Attribute<C> (
+ XML::dom_cast <xercesc::DOMAttr*> (a_->item (ai_++)));
+ }
+
+ private:
+ xercesc::DOMNodeList const* e_;
+ unsigned long ei_;
+
+ xercesc::DOMNamedNodeMap const* a_;
+ unsigned long ai_;
+
+ private:
+ Parser (Parser const&);
+
+ void
+ operator= (Parser const&);
+ };
+}
+
+#endif // XSCRT_PARSER_HPP
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/Traversal.hpp b/dep/acelite/ace/XML_Utils/XSCRT/Traversal.hpp
new file mode 100644
index 00000000000..ea04567fe7c
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/Traversal.hpp
@@ -0,0 +1,265 @@
+// file : XSCRT/Traversal.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Traversal.hpp 95833 2012-06-06 14:53:45Z johnnyw $
+
+#ifndef XSCRT_TRAVERSAL_HPP
+#define XSCRT_TRAVERSAL_HPP
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include "ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp"
+
+namespace XSCRT
+{
+ namespace Traversal
+ {
+ //
+ //
+ //
+ template<typename B>
+ class TraverserBase
+ {
+ protected:
+ virtual
+ ~TraverserBase ();
+
+ //@@ VC6
+ public:
+ virtual void
+ trampoline (B& n) = 0;
+
+ virtual void
+ trampoline (B const& n) = 0;
+ };
+
+
+ //
+ //
+ //
+ template <typename B>
+ class DispatcherBase
+ {
+ public:
+ virtual
+ ~DispatcherBase ();
+
+ virtual void
+ dispatch (B& n);
+
+ virtual void
+ dispatch (B const& n);
+
+ void
+ map (TypeId id, TraverserBase<B>& t)
+ {
+ //wcerr << "map for " << id.name () << " to " << &t
+ // << " in " << &traversal_map_ << endl;
+
+ //@@ VC6
+ Traversers& traversers = traversal_map_[id];
+ traversers.push_back (&t);
+ }
+
+ public:
+ typedef
+ std::vector<TraverserBase<B>*>
+ Traversers;
+
+ typedef
+ std::map<TypeId, Traversers>
+ TraversalMap;
+
+ typedef
+ typename TraversalMap::const_iterator
+ Iterator;
+
+ Iterator
+ begin () const
+ {
+ return traversal_map_.begin ();
+ }
+
+ Iterator
+ end () const
+ {
+ return traversal_map_.end ();
+ }
+
+ private:
+ struct TypeInfoComparator
+ {
+ bool
+ operator () (ExtendedTypeInfo const& x,
+ ExtendedTypeInfo const& y) const
+ {
+ return x.type_id () < y.type_id ();
+ }
+ };
+
+ typedef
+ std::map<ExtendedTypeInfo, unsigned long, TypeInfoComparator>
+ LevelMap;
+
+ typedef
+ std::set<ExtendedTypeInfo, TypeInfoComparator>
+ TypeInfoSet;
+
+ static unsigned long
+ compute_levels (ExtendedTypeInfo const& ti,
+ unsigned long cur,
+ LevelMap& map);
+
+ static void
+ flatten_tree (ExtendedTypeInfo const& ti, TypeInfoSet& set);
+
+ private:
+ TraversalMap traversal_map_;
+ };
+
+
+ //
+ //
+ //
+ template <typename B>
+ class Dispatcher : public virtual DispatcherBase<B>
+ {
+ public:
+ Dispatcher ()
+ : merge_ (true)
+ {
+ }
+
+ void
+ traverser (DispatcherBase<B>& d)
+ {
+ for (typename DispatcherBase<B>::Iterator
+ i (d.begin ()), end (d.end ());
+ i != end; ++i)
+ {
+ for (typename DispatcherBase<B>::Traversers::const_iterator
+ t (i->second.begin ()), end (i->second.end ());
+ t != end; ++t)
+ {
+ dispatcher_.map (i->first, **t);
+ }
+ }
+ }
+
+ public:
+ virtual void
+ dispatch (B& n)
+ {
+ merge ();
+ dispatcher_.dispatch (n);
+ }
+
+ virtual void
+ dispatch (B const& n)
+ {
+ merge ();
+ dispatcher_.dispatch (n);
+ }
+
+ using DispatcherBase<B>::begin;
+ using DispatcherBase<B>::end;
+
+ private:
+ void
+ merge ()
+ {
+ if (merge_)
+ {
+ for (typename DispatcherBase<B>::Iterator
+ i (begin ()), e (end ()); i != e; ++i)
+ {
+ for (typename DispatcherBase<B>::Traversers::const_iterator
+ t (i->second.begin ()), e (i->second.end ()); t != e; ++t)
+ {
+ dispatcher_.map (i->first, **t);
+ }
+ }
+
+ merge_ = false;
+ }
+ }
+
+ protected:
+ // DispatcherBase<B>&
+ // traverser ()
+ // {
+ // return dispatcher_;
+ // }
+
+ template <typename X, typename A, typename I>
+ void
+ iterate_and_dispatch (I begin, I end, X& x, void (X::*next)(A&), A& a)
+ {
+ for (; begin != end;)
+ {
+ dispatch (*begin);
+
+ if (++begin != end) (x.*next) (a);
+ }
+ }
+
+ private:
+ bool merge_;
+ DispatcherBase<B> dispatcher_;
+ };
+
+
+
+ //
+ //
+ //
+ template <typename T, typename B>
+ struct Traverser : TraverserBase<B>, virtual Dispatcher<B>
+ {
+ typedef
+ T
+ Type;
+
+ Traverser ()
+ {
+ DispatcherBase<B>::map (typeid (Type), *this);
+ }
+
+ virtual void
+ traverse (Type&)
+ {
+ abort ();
+ }
+
+ virtual void
+ traverse (Type const&)
+ {
+ abort ();
+ }
+
+ protected:
+ virtual void
+ trampoline (B& n)
+ {
+ //wcerr << "trampoline for " << &n << " to type "
+ // << typeid (Type).name () << endl;
+
+ traverse (dynamic_cast<Type&> (n));
+ }
+
+ virtual void
+ trampoline (B const& n)
+ {
+ //wcerr << "trampoline for " << &n << " to type "
+ // << typeid (Type).name () << endl;
+
+ traverse (dynamic_cast<Type const&> (n));
+ }
+ };
+ }
+}
+
+#include <ace/XML_Utils/XSCRT/Traversal.tpp>
+
+#endif // XSCRT_TRAVERSAL_HPP
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/Traversal.tpp b/dep/acelite/ace/XML_Utils/XSCRT/Traversal.tpp
new file mode 100644
index 00000000000..f4e3d96fce1
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/Traversal.tpp
@@ -0,0 +1,195 @@
+// file : XSCRT/Traversal.tpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Traversal.tpp 95833 2012-06-06 14:53:45Z johnnyw $
+
+namespace XSCRT
+{
+ namespace Traversal
+ {
+ // TraverserBase
+ //
+ //
+
+ template<typename B>
+ TraverserBase<B>::
+ ~TraverserBase ()
+ {
+ }
+
+ // DispatcherBase
+ //
+ //
+
+ template <typename B>
+ DispatcherBase<B>::
+ ~DispatcherBase ()
+ {
+ }
+
+ //@@ merge after dropping VC6
+ //
+ //
+ template <typename B>
+ void DispatcherBase<B>::
+ dispatch (B& n)
+ {
+ LevelMap levels;
+
+ //@@ VC6
+ ExtendedTypeInfo const& ti = extended_type_info (n);
+
+ unsigned long max = compute_levels (ti, 0, levels);
+
+
+ //wcerr << "starting dispatch process for "
+ // << typeid (n).name () << " with "
+ // << max << " levels" << endl;
+
+ for (unsigned long l = 0; l < max + 1; ++l)
+ {
+ TypeInfoSet dispatched;
+
+ for (typename LevelMap::const_iterator
+ i (levels.begin ()), e (levels.end ());
+ i != e; ++i)
+ {
+ if (i->second == l)
+ {
+ typename TraversalMap::const_iterator v (
+ traversal_map_.find (i->first.type_id ()));
+
+ if (v != traversal_map_.end ())
+ {
+ //wcerr << "dispatching traversers for "
+ // << typeid (n).name () << " as "
+ // << i->first.type_id ().name () << endl;
+
+ //@@ VC6
+ Traversers const& traversers = v->second;
+ for (typename Traversers::const_iterator
+ ti (traversers.begin ()), te (traversers.end ());
+ ti != te; ++ti)
+ {
+ (*ti)->trampoline (n);
+ }
+
+ flatten_tree (i->first, dispatched);
+ }
+ }
+ }
+
+ // Remove traversed types from the level map.
+ //
+ //@@ VC6
+ {
+ for (typename TypeInfoSet::const_iterator i = dispatched.begin ();
+ i != dispatched.end ();
+ ++i)
+ {
+ levels.erase (*i);
+ }
+ }
+ }
+ }
+
+ template <typename B>
+ void DispatcherBase<B>::
+ dispatch (B const& n)
+ {
+ LevelMap levels;
+
+ //@@ VC6
+ ExtendedTypeInfo const& ti = extended_type_info (n);
+
+ unsigned long max = compute_levels (ti, 0, levels);
+
+
+ //wcerr << "starting dispatch process for "
+ // << typeid (n).name () << " with "
+ // << max << " levels" << endl;
+
+ //wcerr << "using " << &traversal_map_ << " traversal map" << endl;
+
+ for (unsigned long l = 0; l < max + 1; ++l)
+ {
+ TypeInfoSet dispatched;
+
+ for (typename LevelMap::const_iterator
+ i (levels.begin ()), e (levels.end ());
+ i != e; ++i)
+ {
+ if (i->second == l)
+ {
+ typename TraversalMap::const_iterator v (
+ traversal_map_.find (i->first.type_id ()));
+
+ if (v != traversal_map_.end ())
+ {
+ //wcerr << "dispatching traversers for "
+ // << typeid (n).name () << " as "
+ // << i->first.type_id ().name () << endl;
+
+ //@@ VC6
+ Traversers const& traversers = v->second;
+ for (typename Traversers::const_iterator
+ ti (traversers.begin ()), te (traversers.end ());
+ ti != te; ++ti)
+ {
+ (*ti)->trampoline (n);
+ }
+
+ flatten_tree (i->first, dispatched);
+ }
+ }
+ }
+
+ // Remove traversed types from the level map.
+ //
+ //@@ VC6
+ {
+ for (typename TypeInfoSet::const_iterator i = dispatched.begin ();
+ i != dispatched.end ();
+ ++i)
+ {
+ levels.erase (*i);
+ }
+ }
+ }
+ }
+
+ template <typename B>
+ unsigned long DispatcherBase<B>::
+ compute_levels (ExtendedTypeInfo const& ti,
+ unsigned long cur,
+ LevelMap& map)
+ {
+ unsigned long ret = cur;
+
+ if (map.find (ti) == map.end () || map[ti] < cur) map[ti] = cur;
+
+ for (ExtendedTypeInfo::BaseIterator i = ti.begin_base ();
+ i != ti.end_base ();
+ i++)
+ {
+ unsigned long t = compute_levels (i->type_info (), cur + 1, map);
+ if (t > ret) ret = t;
+ }
+
+ return ret;
+ }
+
+ template <typename B>
+ void DispatcherBase<B>::
+ flatten_tree (ExtendedTypeInfo const& ti, TypeInfoSet& set)
+ {
+ set.insert (ti);
+
+ for (ExtendedTypeInfo::BaseIterator i = ti.begin_base ();
+ i != ti.end_base ();
+ i++)
+ {
+ flatten_tree (i->type_info (), set);
+ }
+ }
+ }
+}
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/Writer.hpp b/dep/acelite/ace/XML_Utils/XSCRT/Writer.hpp
new file mode 100644
index 00000000000..10dd392304d
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/Writer.hpp
@@ -0,0 +1,78 @@
+// file : XSCRT/Writer.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: Writer.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+#ifndef XSCRT_WRITER_HPP
+#define XSCRT_WRITER_HPP
+
+#include <stack>
+#include <string>
+
+#include "ace/XML_Utils/XSCRT/XML.hpp"
+
+namespace XSCRT
+{
+ template <typename C>
+ class Writer
+ {
+ public:
+ Writer (XML::Element<C>& e)
+ : attr__ (0)
+ {
+ push_ (e);
+ }
+
+ protected:
+ // This c-tor should never be called.
+ //
+ Writer ()
+ {
+ abort ();
+ }
+
+ public:
+ void
+ push_ (XML::Element<C> const& e)
+ {
+ stack_.push (e);
+ }
+
+ void
+ pop_ ()
+ {
+ stack_.pop ();
+ }
+
+ XML::Element<C>&
+ top_ ()
+ {
+ return stack_.top ();
+ }
+
+ public:
+ XML::Attribute<C>*
+ attr_ ()
+ {
+ return attr__;
+ }
+
+ void
+ attr_ (XML::Attribute<C>* a)
+ {
+ attr__ = a;
+ }
+
+ private:
+ std::stack<XML::Element<C> > stack_;
+
+ XML::Attribute<C>* attr__;
+
+ private:
+ Writer (Writer const&);
+
+ void
+ operator= (Writer const&);
+ };
+}
+
+#endif // XSCRT_WRITER_HPP
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/XML.hpp b/dep/acelite/ace/XML_Utils/XSCRT/XML.hpp
new file mode 100644
index 00000000000..24f1968ba80
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/XML.hpp
@@ -0,0 +1,490 @@
+// file : XSCRT/XML.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: XML.hpp 95832 2012-06-06 13:09:50Z johnnyw $
+
+
+#ifndef XSCRT_XML_HPP
+#define XSCRT_XML_HPP
+
+#include <string>
+
+#include <xercesc/dom/DOM.hpp>
+#include <xercesc/util/XMLString.hpp>
+
+namespace XSCRT
+{
+ namespace XML
+ {
+ //@@ VC6
+ //
+ template <typename C>
+ std::basic_string<C>
+ transcode (XMLCh const* s, C*);
+
+ template <typename C>
+ XMLCh*
+ transcode (std::basic_string<C> const& s);
+
+ //
+ //
+ //
+ class string
+ {
+ public :
+ template <typename C>
+ string (std::basic_string<C> const& s)
+ : s_ (XSCRT::XML::transcode<C> (s))
+ {
+ }
+
+ template <typename C>
+ string (C const* s)
+ : s_ (XSCRT::XML::transcode<C> (s))
+ {
+ }
+
+ ~string ()
+ {
+ delete[] s_;
+ }
+
+ XMLCh const*
+ c_str () const
+ {
+ return s_;
+ }
+
+ private :
+ XMLCh* s_;
+ };
+
+
+ template <>
+ inline
+ std::basic_string<char>
+ transcode<char> (XMLCh const* s, char*)
+ {
+ if (s == 0) return std::basic_string<char> ();
+
+ char* buf = xercesc::XMLString::transcode (s);
+
+ std::basic_string<char> r (buf);
+
+ xercesc::XMLString::release (&buf);
+
+ return r;
+ }
+
+ template <>
+ inline
+ std::basic_string<wchar_t>
+ transcode<wchar_t> (XMLCh const* s, wchar_t*)
+ {
+ if (s == 0) return std::basic_string<wchar_t> ();
+
+ // std::wcerr << s << std::endl;
+
+ std::basic_string<wchar_t> r (xercesc::XMLString::stringLen (s), L'0');
+
+ for (std::size_t i (0); *s != XMLCh (0); ++s, ++i)
+ {
+ r[i] = *s;
+ }
+
+ return r;
+ }
+
+ template <>
+ inline
+ XMLCh*
+ transcode (std::basic_string<char> const& s)
+ {
+ return xercesc::XMLString::transcode (s.c_str ());
+ }
+
+ template <>
+ inline
+ XMLCh*
+ transcode (std::basic_string<wchar_t> const& s)
+ {
+ //@@ VC6
+ std::size_t l = s.length ();
+
+ //@@ VC6
+ XMLCh* r = new XMLCh[l + 1];
+ XMLCh* ir = r;
+
+ for (std::size_t i (0); i < l; ++ir, ++i)
+ {
+ *ir = static_cast<XMLCh>(s[i]);
+ //std::wcerr << s[i] << "->" << *ir << std::endl;
+ }
+
+ *ir = XMLCh (0);
+
+ // std::wcerr << r << std::endl;
+
+ return r;
+ }
+
+
+ template <typename C>
+ class Element;
+
+ template <typename C>
+ std::basic_string<C>
+ ns_prefix (std::basic_string<C> const& ns, Element<C> const& e);
+
+ // Casting helpers, made necessary by the Xerces project's braindead
+ // avoidance of RTTI.
+ template <typename DERIVED> struct dom_traits;
+
+ // Specializations for different node types
+ template <>
+ struct dom_traits<xercesc::DOMElement *>
+ {
+ static const xercesc::DOMNode::NodeType node_type = xercesc::DOMNode::ELEMENT_NODE;
+ };
+
+ template <>
+ struct dom_traits<xercesc::DOMAttr *>
+ {
+ static const xercesc::DOMNode::NodeType node_type = xercesc::DOMNode::ATTRIBUTE_NODE;
+ };
+
+ template <typename DERIVED_PTR>
+ DERIVED_PTR dom_cast (xercesc::DOMNode *node)
+ {
+ DERIVED_PTR elem = 0;
+ if ((node != 0) &&
+ (node->getNodeType () == dom_traits<DERIVED_PTR>::node_type))
+ {
+ elem = reinterpret_cast <DERIVED_PTR> (node);
+ }
+ return elem;
+ }
+
+ template <typename C>
+ class Element
+ {
+ typedef std::basic_string<C> string_;
+
+ public:
+ Element (xercesc::DOMElement const* e)
+ : e_ (0),
+ ce_ (e),
+ name_ (transcode<C> (e->getLocalName (), 0)),
+ namespace__ (transcode<C> (e->getNamespaceURI (), 0))
+ {
+ }
+
+ Element (xercesc::DOMElement* e)
+ : e_ (e),
+ ce_ (e),
+ name_ (transcode<C> (e->getLocalName (), 0)),
+ namespace__ (transcode<C> (e->getNamespaceURI (), 0))
+ {
+ }
+
+ Element (string_ const& name, Element& parent)
+ : e_ (0),
+ ce_ (0),
+ name_ (name)
+ {
+ xercesc::DOMDocument* doc (
+ parent.dom_element ()->getOwnerDocument ());
+
+ e_ = doc->createElement (string (name).c_str ());
+
+ parent.dom_element ()->appendChild (e_);
+
+ ce_ = e_;
+ }
+
+ Element (string_ const& name, string_ const& ns, Element& parent)
+ : e_ (0),
+ ce_ (0),
+ name_ (name),
+ namespace__ (ns)
+ {
+ string_ prefix (ns_prefix (ns, parent));
+
+ xercesc::DOMDocument* doc (
+ parent.dom_element ()->getOwnerDocument ());
+
+ e_ = doc->createElementNS (
+ string (ns).c_str (),
+ string (prefix.empty ()
+ ? name
+ : prefix + string_ (1, ':') + name).c_str ());
+
+ parent.dom_element ()->appendChild (e_);
+
+ ce_ = e_;
+ }
+
+ public:
+ string_
+ name () const
+ {
+ return name_;
+ }
+
+ string_
+ namespace_ () const
+ {
+ return namespace__;
+ }
+
+ public:
+ Element<C>
+ parent () const
+ {
+ return dom_cast <xercesc::DOMElement const*>(ce_->getParentNode ());
+ }
+
+ public:
+ string_
+ value () const
+ {
+ return XML::transcode<C> (dom_element ()->getTextContent (), 0);
+ }
+
+ void
+ value (string_ const& v)
+ {
+ xercesc::DOMText* text (
+ dom_element ()->getOwnerDocument ()->createTextNode(
+ string (v).c_str ()));
+
+ dom_element ()->appendChild (text);
+ }
+
+ public:
+ string_
+ operator[] (string_ const& s) const
+ {
+ //@@ VC6
+ XMLCh const* value = ce_->getAttribute (string (s).c_str ());
+
+ return transcode<C> (value, 0);
+ }
+
+ public:
+ xercesc::DOMElement const*
+ dom_element () const
+ {
+ return ce_;
+ }
+
+ xercesc::DOMElement*
+ dom_element ()
+ {
+ return e_;
+ }
+
+ private:
+ xercesc::DOMElement* e_;
+ xercesc::DOMElement const* ce_;
+
+ string_ name_;
+ string_ namespace__;
+ };
+
+
+ template <typename C>
+ class Attribute
+ {
+ typedef std::basic_string<C> string_;
+
+ public:
+ Attribute (xercesc::DOMAttr const* a)
+ : a_ (0),
+ ca_ (a),
+ name_ (transcode<C> (a->getLocalName (), 0)),
+ value_ (transcode<C> (a->getValue (), 0))
+ {
+ }
+
+ Attribute (xercesc::DOMAttr* a)
+ : a_ (a),
+ ca_ (a),
+ name_ (transcode<C> (a->getLocalName (), 0)),
+ value_ (transcode<C> (a->getValue (), 0))
+ {
+ }
+
+ Attribute (string_ const& name,
+ string_ const& v,
+ Element<C>& parent)
+ : a_ (0),
+ ca_ (0),
+ name_ (name),
+ value_ ()
+ {
+ xercesc::DOMDocument* doc (
+ parent.dom_element ()->getOwnerDocument ());
+
+ a_ = doc->createAttribute (string (name).c_str ());
+
+ value (v);
+
+ parent.dom_element ()->setAttributeNode (a_);
+
+ ca_ = a_;
+ }
+
+ Attribute (string_ const& name,
+ string_ const& ns,
+ string_ const& v,
+ Element<C>& parent)
+ : a_ (0),
+ ca_ (0),
+ name_ (name),
+ value_ ()
+ {
+ string_ prefix (ns_prefix (ns, parent));
+
+ xercesc::DOMDocument* doc (
+ parent.dom_element ()->getOwnerDocument ());
+
+ a_ = doc->createAttributeNS (
+ string (ns).c_str (),
+ string (prefix.empty ()
+ ? name
+ : prefix + string_ (1, ':') + name).c_str ());
+
+ value (v);
+
+ parent.dom_element ()->setAttributeNodeNS (a_);
+
+ ca_ = a_;
+ }
+
+ string_
+ name () const
+ {
+ return name_;
+ }
+
+ string_
+ value () const
+ {
+ return value_;
+ }
+
+ void
+ value (string_ const& v)
+ {
+ value_ = v;
+ a_->setValue (string (v).c_str ());
+ }
+
+ public:
+ xercesc::DOMAttr const*
+ dom_attribute () const
+ {
+ return ca_;
+ }
+
+ xercesc::DOMAttr*
+ dom_attribute ()
+ {
+ return a_;
+ }
+
+ private:
+
+ private:
+ xercesc::DOMAttr* a_;
+ xercesc::DOMAttr const* ca_;
+
+ string_ name_;
+ string_ value_;
+ };
+
+ template <typename C>
+ std::basic_string<C>
+ prefix (std::basic_string<C> const& n)
+ {
+ std::size_t i (0);
+ while (i < n.length () && n[i] != ':') ++i;
+
+ //std::wcerr << "prefix " << n << " "
+ // << std::wstring (n, i == n.length () ? i : 0, i) << std::endl;
+
+ return std::basic_string<C> (n, i == n.length () ? i : 0, i);
+ }
+
+ template <typename C>
+ std::basic_string<C>
+ uq_name (std::basic_string<C> const& n)
+ {
+ std::size_t i (0);
+ while (i < n.length () && n[i] != ':') ++i;
+
+ return std::basic_string<C> (n.c_str () + (i == n.length () ? 0 : i + 1));
+ }
+
+ template <typename C>
+ std::basic_string<C>
+ ns_name (Element<C> const& e, std::basic_string<C> const& n)
+ {
+ std::basic_string<C> wp (prefix (n));
+
+ //@@ VC6
+ XMLCh const* xns = e.dom_element ()->lookupNamespaceURI (
+ wp.empty () ? 0 : string (wp).c_str ());
+
+
+ std::basic_string<C> ns (
+ xns ? transcode<C> (xns, 0) : std::basic_string<C> ());
+
+ return ns;
+
+ }
+
+ template <typename C>
+ std::basic_string<C>
+ fq_name (Element<C> const& e, std::basic_string<C> const& n)
+ {
+ std::basic_string<C> ns (ns_name (e, n));
+ std::basic_string<C> un (uq_name (n));
+
+ return ns.empty () ? un : (ns + C ('#') + un);
+ }
+
+ class no_prefix {};
+
+ template <typename C>
+ std::basic_string<C>
+ ns_prefix (std::basic_string<C> const& ns, Element<C> const& e)
+ {
+ string xns (ns);
+
+#if defined(XERCES_VERSION_MAJOR) && XERCES_VERSION_MAJOR > 2
+ XMLCh const* p (e.dom_element ()->lookupPrefix (xns.c_str ()));
+#else
+ XMLCh const* p (e.dom_element ()->lookupNamespacePrefix (xns.c_str (), false));
+#endif
+
+ if (p == 0)
+ {
+ bool r (e.dom_element ()->isDefaultNamespace (xns.c_str ()));
+
+ if (r)
+ {
+ return std::basic_string<C> ();
+ }
+ else
+ {
+ throw no_prefix ();
+ }
+ }
+
+ return transcode<C> (p, 0);
+ }
+ }
+}
+
+#endif // XSCRT_XML_HPP
diff --git a/dep/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp b/dep/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp
new file mode 100644
index 00000000000..f975238f363
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XSCRT/XMLSchema.hpp
@@ -0,0 +1,588 @@
+// file : XSCRT/XMLSchema.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id: XMLSchema.hpp 95802 2012-05-31 12:37:36Z johnnyw $
+
+#ifndef XSCRT_XMLSCHEMA_HPP
+#define XSCRT_XMLSCHEMA_HPP
+
+#include <string>
+// #include <iostream> //@@ tmp
+
+#include "ace/XML_Utils/XMLSchema/XSCRT/Elements.hpp"
+
+namespace XMLSchema
+{
+ typedef XSCRT::FundamentalType<signed char> byte;
+ typedef XSCRT::FundamentalType<unsigned char> unsignedByte;
+
+ typedef XSCRT::FundamentalType<short> short_;
+ typedef XSCRT::FundamentalType<unsigned short> unsignedShort;
+
+ typedef XSCRT::FundamentalType<int> int_;
+ typedef XSCRT::FundamentalType<unsigned int> unsignedInt;
+
+ typedef XSCRT::FundamentalType<long long> long_;
+ typedef XSCRT::FundamentalType<unsigned long long> unsignedLong;
+
+ //@@ It would be nice to use some arbitrary-length integer class.
+ //
+ typedef long_ decimal;
+ typedef decimal integer;
+ typedef integer nonPositiveInteger;
+ typedef integer nonNegativeInteger;
+ typedef nonNegativeInteger positiveInteger;
+ typedef nonPositiveInteger negativeInteger;
+
+
+ typedef XSCRT::FundamentalType<bool> boolean;
+
+ typedef XSCRT::FundamentalType<float> float_;
+ typedef XSCRT::FundamentalType<double> double_;
+
+ // Just to make GCC 3.3 and other broken compilers shutup.
+ //
+ using std::basic_string;
+
+
+ template <typename C>
+ class string : public XSCRT::Type, public basic_string<C>
+ {
+ protected:
+ typedef basic_string<C> Base__ ;
+
+ public:
+
+ //@@ VC6 does not inject XSCRT::Type into the scope so I have
+ // to qualify it all the time.
+ //
+
+ string ()
+ {
+ }
+
+ string (XSCRT::XML::Element<C> const& e)
+ : Base__ (e.value ())
+ {
+ }
+
+ string (XSCRT::XML::Attribute<C> const& a)
+ : Base__ (a.value ())
+ {
+ }
+
+ string (Base__ const& x)
+ : Base__ (x)
+ {
+ }
+
+ string&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class normalizedString : public string<C>
+ {
+ protected:
+ typedef typename string<C>::Base__ Base__;
+
+ public:
+ normalizedString ()
+ {
+ }
+
+ normalizedString (XSCRT::XML::Element<C> const& e)
+ : string<C> (e)
+ {
+ }
+
+ normalizedString (XSCRT::XML::Attribute<C> const& a)
+ : string<C> (a)
+ {
+ }
+
+ normalizedString (Base__ const& x)
+ : string<C> (x)
+ {
+ }
+
+ normalizedString&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class token : public normalizedString<C>
+ {
+ protected:
+ typedef typename normalizedString<C>::Base__ Base__;
+
+ public:
+ token ()
+ {
+ }
+
+ token (XSCRT::XML::Element<C> const& e)
+ : normalizedString<C> (e)
+ {
+ }
+
+ token (XSCRT::XML::Attribute<C> const& a)
+ : normalizedString<C> (a)
+ {
+ }
+
+ token (Base__ const& x)
+ : normalizedString<C> (x)
+ {
+ }
+
+ token&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class NMTOKEN : public token<C>
+ {
+ protected:
+ typedef typename token<C>::Base__ Base__;
+
+ public:
+ NMTOKEN ()
+ {
+ }
+
+ NMTOKEN (XSCRT::XML::Element<C> const& e)
+ : token<C> (e)
+ {
+ }
+
+ NMTOKEN (XSCRT::XML::Attribute<C> const& a)
+ : token<C> (a)
+ {
+ }
+
+ NMTOKEN (Base__ const& x)
+ : token<C> (x)
+ {
+ }
+
+ NMTOKEN&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+ template <typename C>
+ class Name: public token<C>
+ {
+ protected:
+ typedef typename token<C>::Base__ Base__;
+
+ public:
+ Name()
+ {
+ }
+
+ Name(XSCRT::XML::Element<C> const& e)
+ : token<C> (e)
+ {
+ }
+
+ Name(XSCRT::XML::Attribute<C> const& a)
+ : token<C> (a)
+ {
+ }
+
+ Name(Base__ const& x)
+ : token<C> (x)
+ {
+ }
+
+ Name&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+
+ template <typename C>
+ class NCName: public Name<C>
+ {
+ protected:
+ typedef typename Name<C>::Base__ Base__;
+
+ public:
+ NCName()
+ {
+ }
+
+ NCName(XSCRT::XML::Element<C> const& e)
+ : Name<C> (e)
+ {
+ }
+
+ NCName(XSCRT::XML::Attribute<C> const& a)
+ : Name<C> (a)
+ {
+ }
+
+ NCName(Base__ const& x)
+ : Name<C> (x)
+ {
+ }
+
+ NCName&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+ template <typename C>
+ class QName: public Name<C>
+ {
+ protected:
+ typedef typename Name<C>::Base__ Base__;
+
+ public:
+ QName()
+ {
+ }
+
+ QName(XSCRT::XML::Element<C> const& e)
+ : Name<C> (e)
+ {
+ }
+
+ QName(XSCRT::XML::Attribute<C> const& a)
+ : Name<C> (a)
+ {
+ }
+
+ QName(Base__ const& x)
+ : Name<C> (x)
+ {
+ }
+
+ QName&
+ operator= (Base__ const& x)
+ {
+ static_cast<Base__&> (*this) = x;
+ return *this;
+ }
+ };
+
+ template <typename C>
+ struct IdentityProvider : XSCRT::IdentityProvider
+ {
+ IdentityProvider (NCName<C> const& id)
+ : id_ (id)
+ {
+ }
+
+ virtual bool
+ before (XSCRT::IdentityProvider const& y) const
+ {
+ return id_ < dynamic_cast<IdentityProvider const&> (y).id_;
+ }
+
+ private:
+ NCName<C> const& id_;
+
+ private:
+ IdentityProvider (IdentityProvider const&);
+
+ IdentityProvider&
+ operator= (IdentityProvider const&);
+ };
+
+
+ template <typename C>
+ class ID : public NCName<C>
+ {
+ protected:
+ typedef typename NCName<C>::Base__ Base__;
+
+ public:
+ ~ID()
+ {
+ unregister_id ();
+ }
+
+ ID ()
+ : id_provider_ (*this)
+ {
+ }
+
+ ID (XSCRT::XML::Element<C> const& e)
+ : NCName<C> (e), id_provider_ (*this)
+ {
+ }
+
+ ID (XSCRT::XML::Attribute<C> const& a)
+ : NCName<C> (a), id_provider_ (*this)
+ {
+ }
+
+ ID (ID const& x)
+ : NCName<C> (x), id_provider_ (*this)
+ {
+ }
+
+ ID (Base__ const& x)
+ : NCName<C> (x), id_provider_ (*this)
+ {
+ }
+
+ ID&
+ operator= (Base__ const& x)
+ {
+ unregister_id ();
+
+ static_cast<NCName<C>&>(*this) = x;
+
+ register_id ();
+
+ return *this;
+ }
+
+ ID&
+ operator= (ID const& x)
+ {
+ unregister_id ();
+
+ static_cast<NCName<C>&>(*this) = static_cast<NCName<C> const&>(x);
+
+ register_id ();
+
+ return *this;
+ }
+
+ public:
+ using NCName<C>::container;
+
+ virtual void
+ container (XSCRT::Type* c)
+ {
+ unregister_id ();
+
+ NCName<C>::container (c);
+
+ register_id ();
+ }
+
+ private:
+ using NCName<C>::empty;
+ using NCName<C>::root;
+
+ void
+ register_id ()
+ {
+ if (container () != this && !empty ())
+ {
+ //std::wcerr << "registering " << container ()
+ // << " as '" << *this
+ // << "' on " << container () << std::endl;
+ container ()->register_id (id_provider_, container ());
+ }
+ }
+
+ void
+ unregister_id ()
+ {
+ if (container () != this && !empty ())
+ {
+ //std::wcerr << "un-registering " << container ()
+ // << " as '" << *this
+ // << "' on " << container () << std::endl;
+ container ()->unregister_id (id_provider_);
+ }
+ }
+
+ private:
+ IdentityProvider<C> id_provider_;
+ };
+
+ struct IDREF_Base : public XSCRT::Type
+ {
+ virtual XSCRT::Type*
+ get () const = 0;
+ };
+
+ template <typename C>
+ class IDREF : public IDREF_Base
+ {
+ public:
+ IDREF ()
+ : id_provider_ (id_)
+ {
+ }
+
+ IDREF (XSCRT::XML::Element<C> const& e)
+ : id_ (e), id_provider_ (id_)
+ {
+ }
+
+ IDREF (XSCRT::XML::Attribute<C> const& a)
+ : id_ (a), id_provider_ (id_)
+ {
+ }
+
+ IDREF (IDREF const& x)
+ : id_ (x.id_), id_provider_ (id_)
+ {
+ }
+
+ IDREF (basic_string<C> const& id)
+ : id_ (id), id_provider_ (id_)
+ {
+ }
+
+ IDREF&
+ operator= (IDREF const& x)
+ {
+ id_ = x.id_;
+ return *this;
+ }
+
+ IDREF&
+ operator= (basic_string<C> const& x)
+ {
+ id_ = x;
+ return *this;
+ }
+
+ public:
+ XSCRT::Type*
+ operator-> () const
+ {
+ return get ();
+ }
+
+ XSCRT::Type&
+ operator* () const
+ {
+ return *(get ());
+ }
+
+ virtual XSCRT::Type*
+ get () const
+ {
+ if (!id_.empty () && container () != this)
+ {
+ return root ()->lookup_id (id_provider_);
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ // conversion to bool
+ //
+ typedef XSCRT::Type* (IDREF::*bool_convertable)() const;
+
+ operator bool_convertable () const
+ {
+ return get () ? &IDREF::operator-> : 0;
+ }
+
+ private:
+ NCName<C> id_;
+ IdentityProvider<C> id_provider_;
+ };
+}
+
+// Traversal
+//
+//
+
+#include "ace/XML_Utils/XSCRT/Traversal.hpp"
+
+namespace XMLSchema
+{
+ namespace Traversal
+ {
+ template <typename T>
+ struct Traverser : XSCRT::Traversal::Traverser<T, XSCRT::Type>,
+ XSCRT::Traversal::Traverser<IDREF_Base, XSCRT::Type>
+ {
+ typedef
+ T
+ Type;
+
+ virtual void
+ traverse (XMLSchema::IDREF_Base& r)
+ {
+ if (r.get ()) dispatch (*(r.get ()));
+ }
+ };
+
+ typedef Traverser<byte> byte;
+ typedef Traverser<unsignedByte> unsignedByte;
+
+ typedef Traverser<short_> short_;
+ typedef Traverser<unsignedShort> unsignedShort;
+
+ typedef Traverser<int_> int_;
+ typedef Traverser<unsignedInt> unsignedInt;
+
+ typedef Traverser<long_> long_;
+ typedef Traverser<unsignedLong> unsignedLong;
+
+ typedef Traverser<boolean> boolean;
+
+ typedef Traverser<float_> float_;
+ typedef Traverser<double_> double_;
+
+ template <typename C>
+ struct string : Traverser<XMLSchema::string<C> >
+ {
+ };
+
+ template <typename C>
+ struct ID : Traverser<XMLSchema::ID<C> >
+ {
+ };
+ }
+}
+
+
+// ExtendedTypeInfo for XML Schema types
+//
+//
+
+#include "ace/XML_Utils/XSCRT/ExtendedTypeInfo.hpp"
+
+namespace XMLSchema
+{
+ template <typename C>
+ struct TypeInfoInitializer
+ {
+ TypeInfoInitializer (XSCRT::ExtendedTypeInfoMap&);
+ };
+}
+
+#include "ace/XML_Utils/XSCRT/XMLSchema.ipp"
+#include "ace/XML_Utils/XSCRT/XMLSchema.tpp"
+
+#endif // XSCRT_XMLSCHEMA_HPP
diff --git a/dep/acelite/ace/XML_Utils/XercesString.cpp b/dep/acelite/ace/XML_Utils/XercesString.cpp
new file mode 100644
index 00000000000..41cfa49d988
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XercesString.cpp
@@ -0,0 +1,167 @@
+// $Id: XercesString.cpp 95760 2012-05-15 13:46:19Z msmit $
+
+#include <ostream>
+#include <algorithm>
+
+#include "XercesString.h"
+#include "xercesc/util/PlatformUtils.hpp"
+
+using xercesc::XMLString;
+using xercesc::XMLPlatformUtils;
+
+namespace XML
+{
+// On unicode windows, ACE_TCHAR == XMLCh
+#if !defined (_MSC_VER) || !defined (ACE_USES_WCHAR)
+ XStr::XStr (const ACE_TCHAR* str)
+ : _wstr(0)
+ {
+ _wstr = XMLString::transcode(ACE_TEXT_ALWAYS_CHAR (str));
+ }
+#endif
+
+ XStr::XStr (XMLCh *wstr)
+ : _wstr(wstr)
+ {
+
+ }
+
+ XStr::XStr (const XMLCh* wstr)
+ : _wstr(0)
+ {
+ _wstr = XMLString::replicate(wstr);
+ }
+
+ XStr::XStr (const XStr &right)
+ : _wstr(0)
+ {
+ _wstr = XMLString::replicate(right._wstr);
+ }
+
+ XStr& XStr::operator= (const XStr& rhs)
+ {
+ if (&rhs == this)
+ return *this;
+ XStr temp (rhs);
+ std::swap (this->_wstr, temp._wstr);
+ return *this;
+ }
+
+ XStr::~XStr ()
+ {
+ this->reset ();
+ }
+
+ const XMLCh* XStr::begin () const
+ {
+ return _wstr;
+ }
+
+ const XMLCh* XStr::end () const
+ {
+ return _wstr + size();
+ }
+
+ bool XStr::append(const XMLCh *tail)
+ {
+ int iTailLen = XMLString::stringLen(tail);
+ int iWorkLen = XMLString::stringLen(_wstr);
+
+ XMLSize_t bytes = (iWorkLen + iTailLen + 1) * sizeof (XMLCh);
+ void *tmp = XMLPlatformUtils::fgMemoryManager->allocate (bytes);
+ XMLCh *result = reinterpret_cast<XMLCh *> (tmp);
+
+ bool bOK = result != 0;
+ if (bOK)
+ {
+ XMLCh *target = result;
+ XMLString::moveChars(target, _wstr, iWorkLen);
+ target += iWorkLen;
+ XMLString::moveChars(target, tail, iTailLen);
+ target += iTailLen;
+ *target++ = 0;
+ XMLString::release(&_wstr);
+ _wstr = result;
+ }
+ return bOK;
+ }
+
+ bool XStr::erase(const XMLCh *head, const XMLCh *tail)
+ {
+ bool bOK = head <= tail && head >= begin() && tail <= end();
+ if (bOK)
+ {
+ XMLSize_t bytes = (size() - (tail - head) + 1 ) * sizeof (XMLCh);
+ void *tmp = XMLPlatformUtils::fgMemoryManager->allocate (bytes);
+ XMLCh *result = reinterpret_cast<XMLCh *> (tmp);
+
+ XMLCh *target = result;
+ bOK = target != 0;
+ if (bOK)
+ {
+ const XMLCh *cursor = begin();
+
+ while (cursor != head) *target++ = *cursor++;
+ cursor = tail;
+ while ( cursor != end() ) *target++ = *cursor++;
+ *target ++ = 0;
+ XMLString::release(&_wstr);
+ _wstr = result;
+ }
+ }
+ return bOK;
+ }
+
+ int XStr::size () const
+ {
+ return XMLString::stringLen(_wstr);
+ }
+
+ XMLCh XStr::operator [] (const int i)
+ {
+ return _wstr[i];
+ }
+
+ XMLCh XStr::operator [] (const int i) const
+ {
+ return _wstr[i];
+ }
+
+ XMLCh * XStr::release (void)
+ {
+ XMLCh* tmp = _wstr;
+ this->_wstr = 0;
+ return tmp;
+ }
+
+ void
+ XStr::reset (void)
+ {
+ if (_wstr)
+ XMLString::release(&_wstr);
+ _wstr = 0;
+ }
+
+ bool operator== (const XStr& lhs, const XStr& rhs)
+ {
+ return XMLString::compareIString (lhs,rhs) == 0;
+ }
+
+ bool operator!= (const XStr& lhs, const XStr& rhs)
+ {
+ return !operator==(lhs, rhs);
+ }
+
+
+ std::ostream&
+ operator<< (std::ostream& o, XStr const& str)
+ {
+ char* s = XMLString::transcode (str);
+
+ o << s;
+
+ XMLString::release (&s); // idiots?
+ return o;
+ }
+
+}
diff --git a/dep/acelite/ace/XML_Utils/XercesString.h b/dep/acelite/ace/XML_Utils/XercesString.h
new file mode 100644
index 00000000000..7073184a491
--- /dev/null
+++ b/dep/acelite/ace/XML_Utils/XercesString.h
@@ -0,0 +1,82 @@
+// $Id: XercesString.h 95760 2012-05-15 13:46:19Z msmit $
+
+#ifndef _XERCESSTRING_H
+#define _XERCESSTRING_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <iosfwd>
+
+#ifdef __BORLANDC__
+using std::memcpy;
+#endif
+
+#include <xercesc/util/XMLString.hpp>
+
+// Utility class that provides a std::string like facade to XMLString.
+// Doesn't implement all of the methods of std::string.
+#include "XML_Utils_Export.h"
+
+namespace XML
+{
+ class XML_Utils_Export XStr
+ {
+ public:
+ XStr() : _wstr(0L) { };
+
+// On unicode windows, ACE_TCHAR == XMLCh
+#if !defined (_MSC_VER) || !defined (ACE_USES_WCHAR)
+ XStr (const ACE_TCHAR* str);
+#endif
+
+ XStr (XMLCh* wstr);
+
+ XStr (const XMLCh* wstr);
+
+ XStr (const XStr& copy);
+
+ XStr& operator= (const XStr& rhs);
+
+ ~XStr();
+
+ const XMLCh* begin() const;
+
+ const XMLCh* end() const;
+
+ bool append(const XMLCh* tail);
+
+ bool erase (const XMLCh* head, const XMLCh* tail);
+
+ int size() const;
+
+ XMLCh operator [] (const int i);
+
+ XMLCh operator [] (const int i) const;
+
+ operator const XMLCh* () const { return _wstr; };
+
+ XMLCh * release (void);
+
+ /// Release the held string and free its memory.
+ void reset (void);
+ private:
+
+ XMLCh* _wstr; // Internal representation
+
+ };
+
+ XML_Utils_Export bool operator== (const XStr& lhs, const XStr& rhs);
+ XML_Utils_Export bool operator!= (const XStr& lhs, const XStr& rhs);
+
+ XML_Utils_Export std::ostream&
+ operator<< (std::ostream& o, XStr const& str);
+
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* _XERCESSTRING_H */
diff --git a/dep/acelite/ace/XtReactor/ACE_XtReactor_export.h b/dep/acelite/ace/XtReactor/ACE_XtReactor_export.h
new file mode 100644
index 00000000000..323355be750
--- /dev/null
+++ b/dep/acelite/ace/XtReactor/ACE_XtReactor_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id: ACE_XtReactor_export.h 80826 2008-03-04 14:51:23Z wotte $
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s ACE_XtReactor
+// ------------------------------
+#ifndef ACE_XTREACTOR_EXPORT_H
+#define ACE_XTREACTOR_EXPORT_H
+
+#include /**/ "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_XTREACTOR_HAS_DLL)
+# define ACE_XTREACTOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACE_XTREACTOR_HAS_DLL */
+
+#if !defined (ACE_XTREACTOR_HAS_DLL)
+# define ACE_XTREACTOR_HAS_DLL 1
+#endif /* ! ACE_XTREACTOR_HAS_DLL */
+
+#if defined (ACE_XTREACTOR_HAS_DLL) && (ACE_XTREACTOR_HAS_DLL == 1)
+# if defined (ACE_XTREACTOR_BUILD_DLL)
+# define ACE_XtReactor_Export ACE_Proper_Export_Flag
+# define ACE_XTREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_XTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACE_XTREACTOR_BUILD_DLL */
+# define ACE_XtReactor_Export ACE_Proper_Import_Flag
+# define ACE_XTREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_XTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_XTREACTOR_BUILD_DLL */
+#else /* ACE_XTREACTOR_HAS_DLL == 1 */
+# define ACE_XtReactor_Export
+# define ACE_XTREACTOR_SINGLETON_DECLARATION(T)
+# define ACE_XTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_XTREACTOR_HAS_DLL == 1 */
+
+// Set ACE_XTREACTOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACE_XTREACTOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACE_XTREACTOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACE_XTREACTOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACE_XTREACTOR_NTRACE */
+
+#if (ACE_XTREACTOR_NTRACE == 1)
+# define ACE_XTREACTOR_TRACE(X)
+#else /* (ACE_XTREACTOR_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define ACE_XTREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (ACE_XTREACTOR_NTRACE == 1) */
+
+#endif /* ACE_XTREACTOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/dep/acelite/ace/XtReactor/XtReactor.cpp b/dep/acelite/ace/XtReactor/XtReactor.cpp
new file mode 100644
index 00000000000..1233a304d58
--- /dev/null
+++ b/dep/acelite/ace/XtReactor/XtReactor.cpp
@@ -0,0 +1,468 @@
+// $Id: XtReactor.cpp 95528 2012-02-07 12:57:33Z johnnyw $
+
+#include "ace/XtReactor/XtReactor.h"
+
+#include "ace/SOCK_Acceptor.h"
+#include "ace/SOCK_Connector.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_ALLOC_HOOK_DEFINE (ACE_XtReactor)
+
+// Must be called with lock held
+ACE_XtReactor::ACE_XtReactor (XtAppContext context,
+ size_t size,
+ bool restart,
+ ACE_Sig_Handler *h)
+ : ACE_Select_Reactor (size, restart, h),
+ context_ (context),
+ ids_ (0),
+ timeout_ (0)
+{
+ // When the ACE_Select_Reactor is constructed it creates the notify
+ // pipe and registers it with the register_handler_i() method. The
+ // XtReactor overloads this method BUT because the
+ // register_handler_i occurs when constructing the base class
+ // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i()
+ // is called not the XtReactor register_handler_i(). This means
+ // that the notify pipe is registered with the ACE_Select_Reactor
+ // event handling code not the XtReactor and so notfications don't
+ // work. To get around this we simply close and re-opened the
+ // notification handler in the constructor of the XtReactor.
+
+#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+ this->notify_handler_->close ();
+ this->notify_handler_->open (this, 0);
+#endif /* ACE_MT_SAFE */
+}
+
+ACE_XtReactor::~ACE_XtReactor (void)
+{
+ // Delete the remaining items in the linked list.
+
+ while (this->ids_)
+ {
+ ACE_XtReactorID *XtID = this->ids_->next_;
+ delete this->ids_;
+ this->ids_ = XtID;
+ }
+}
+
+// This is just the <wait_for_multiple_events> from ace/Reactor.cpp
+// but we use the Xt functions to wait for an event, not <select>
+
+int
+ACE_XtReactor::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set,
+ ACE_Time_Value *max_wait_time)
+{
+ ACE_TRACE ("ACE_XtReactor::wait_for_multiple_events");
+ int nfound;
+
+ do
+ {
+ max_wait_time = this->timer_queue_->calculate_timeout (max_wait_time);
+
+ size_t width = this->handler_rep_.max_handlep1 ();
+ handle_set.rd_mask_ = this->wait_set_.rd_mask_;
+ handle_set.wr_mask_ = this->wait_set_.wr_mask_;
+ handle_set.ex_mask_ = this->wait_set_.ex_mask_;
+ nfound = XtWaitForMultipleEvents (width,
+ handle_set,
+ max_wait_time);
+
+ } while (nfound == -1 && this->handle_error () > 0);
+
+ if (nfound > 0)
+ {
+#if !defined (ACE_WIN32)
+ handle_set.rd_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.wr_mask_.sync (this->handler_rep_.max_handlep1 ());
+ handle_set.ex_mask_.sync (this->handler_rep_.max_handlep1 ());
+#endif /* ACE_WIN32 */
+ }
+ return nfound; // Timed out or input available
+}
+
+void
+ACE_XtReactor::TimerCallbackProc (XtPointer closure, XtIntervalId * /* id */)
+{
+ ACE_XtReactor *self = (ACE_XtReactor *) closure;
+ self->timeout_ = 0;
+
+ // Deal with any timer events
+ ACE_Select_Reactor_Handle_Set handle_set;
+ self->dispatch (0, handle_set);
+ self->reset_timeout ();
+}
+
+// This could be made shorter if we know which *kind* of event we were
+// about to get. Here we use <select> to find out which one might be
+// available.
+
+void
+ACE_XtReactor::InputCallbackProc (XtPointer closure,
+ int *source,
+ XtInputId *)
+{
+ ACE_XtReactor *self = (ACE_XtReactor *) closure;
+ ACE_HANDLE handle = (ACE_HANDLE) *source;
+
+ // my copy isn't const.
+ ACE_Time_Value zero = ACE_Time_Value::zero;
+
+ ACE_Select_Reactor_Handle_Set wait_set;
+
+ // Deal with one file event.
+
+ // - read which kind of event
+ if (self->wait_set_.rd_mask_.is_set (handle))
+ wait_set.rd_mask_.set_bit (handle);
+ if (self->wait_set_.wr_mask_.is_set (handle))
+ wait_set.wr_mask_.set_bit (handle);
+ if (self->wait_set_.ex_mask_.is_set (handle))
+ wait_set.ex_mask_.set_bit (handle);
+
+ int result = ACE_OS::select (*source + 1,
+ wait_set.rd_mask_,
+ wait_set.wr_mask_,
+ wait_set.ex_mask_, &zero);
+
+ ACE_Select_Reactor_Handle_Set dispatch_set;
+
+ // - Use only that one file event (removes events for other files).
+ if (result > 0)
+ {
+ if (wait_set.rd_mask_.is_set (handle))
+ dispatch_set.rd_mask_.set_bit (handle);
+ if (wait_set.wr_mask_.is_set (handle))
+ dispatch_set.wr_mask_.set_bit (handle);
+ if (wait_set.ex_mask_.is_set (handle))
+ dispatch_set.ex_mask_.set_bit (handle);
+
+ self->dispatch (1, dispatch_set);
+ }
+}
+
+int
+ACE_XtReactor::XtWaitForMultipleEvents (int width,
+ ACE_Select_Reactor_Handle_Set &wait_set,
+ ACE_Time_Value *)
+{
+ // Make sure we have a valid context
+ ACE_ASSERT (this->context_ != 0);
+
+ // Check to make sure our handle's are all usable.
+ ACE_Select_Reactor_Handle_Set temp_set = wait_set;
+
+ if (ACE_OS::select (width,
+ temp_set.rd_mask_,
+ temp_set.wr_mask_,
+ temp_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero) == -1)
+ return -1; // Bad file arguments...
+
+ // Instead of waiting using <select>, just use the Xt mechanism to
+ // wait for a single event.
+
+ // Wait for something to happen.
+ ::XtAppProcessEvent (this->context_, XtIMAll);
+
+ // Reset the width, in case it changed during the upcalls.
+ width = this->handler_rep_.max_handlep1 ();
+
+ // Now actually read the result needed by the <Select_Reactor> using
+ // <select>.
+ return ACE_OS::select (width,
+ wait_set.rd_mask_,
+ wait_set.wr_mask_,
+ wait_set.ex_mask_,
+ (ACE_Time_Value *) &ACE_Time_Value::zero);
+}
+
+XtAppContext
+ACE_XtReactor::context (void) const
+{
+ return this->context_;
+}
+
+void
+ACE_XtReactor::context (XtAppContext context)
+{
+ this->context_ = context;
+}
+
+int
+ACE_XtReactor::register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_XtReactor::register_handler_i");
+
+ // Make sure we have a valid context
+ ACE_ASSERT (this->context_ != 0);
+
+#if defined ACE_WIN32
+ // Let's handle this special case before we do any real work.
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_NOTSUP_RETURN(-1);
+#endif /* ACE_WIN32 */
+
+ int result = ACE_Select_Reactor::register_handler_i (handle,
+ handler, mask);
+ if (result == -1)
+ return -1;
+
+ synchronize_XtInput (handle);
+ return 0;
+}
+
+int
+ACE_XtReactor::register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::register_handler_i (handles,
+ handler,
+ mask);
+}
+
+int
+ACE_XtReactor::remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask)
+{
+ ACE_TRACE ("ACE_XtReactor::remove_handler_i");
+
+ int result = ACE_Select_Reactor::remove_handler_i (handle,
+ mask);
+ if (result == -1)
+ return -1;
+
+ synchronize_XtInput (handle);
+ return 0;
+}
+
+int
+ACE_XtReactor::remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask mask)
+{
+ return ACE_Select_Reactor::remove_handler_i (handles,
+ mask);
+}
+
+int
+ACE_XtReactor::suspend_i (ACE_HANDLE handle)
+{
+ ACE_TRACE ("ACE_XtReactor::suspend_i");
+
+ int result = ACE_Select_Reactor::suspend_i (handle);
+
+ if (result == -1)
+ return -1;
+
+ synchronize_XtInput (handle);
+ return 0;
+}
+
+int
+ACE_XtReactor::resume_i (ACE_HANDLE handle)
+{
+ ACE_TRACE ("ACE_XtReactor::resume_i");
+
+ int result = ACE_Select_Reactor::resume_i (handle);
+
+ if (result == -1)
+ return -1;
+
+ synchronize_XtInput (handle);
+ return 0;
+}
+
+void
+ACE_XtReactor::synchronize_XtInput(ACE_HANDLE handle)
+{
+ ACE_TRACE ("ACE_XtReactor::synchronize_XtInput");
+
+ // The idea here is to call this function after the base class has
+ // processed the register/remove/suspend/resume_handler request. The
+ // resulting mask is used to find out which XtInput mask we need.
+
+ // Find existing handler in linked list.
+ ACE_XtReactorID **XtID = &(this->ids_);
+
+ while (*XtID && (*XtID)->handle_ != handle)
+ XtID = &((*XtID)->next_);
+
+ // Remove existing input handler.
+ if (*XtID)
+ ::XtRemoveInput ((*XtID)->id_);
+
+ int condition = compute_Xt_condition (handle);
+
+ if (condition == 0) // No input handler needed.
+ {
+ if (*XtID)
+ {
+ // Remove linked list entry.
+ ACE_XtReactorID *toDelete = *XtID;
+ *XtID = (*XtID)->next_;
+ delete toDelete;
+ }
+ return;
+ }
+
+ if (*XtID == 0)
+ {
+ // Create new node.
+ ACE_XtReactorID *tmp = new ACE_XtReactorID;
+ tmp->next_ = this->ids_;
+ tmp->handle_ = handle;
+ this->ids_ = tmp;
+ XtID = &(this->ids_);
+ }
+
+ // Finally, add input handler.
+ (*XtID)->id_ = ::XtAppAddInput (this->context_,
+ (int) handle,
+ reinterpret_cast <XtPointer> (condition),
+ InputCallbackProc,
+ (XtPointer) this);
+}
+
+int
+ACE_XtReactor::compute_Xt_condition(ACE_HANDLE handle)
+{
+ ACE_TRACE ("ACE_XtReactor::compute_Xt_condition");
+
+ // Retrieve current wait mask from base class.
+ // The returned value is either a combination of READ/WRITE/EXCEPT_MASK
+ // or -1.
+ int mask =this->bit_ops(handle,
+ 0,
+ this->wait_set_,
+ ACE_Reactor::GET_MASK);
+
+ if (mask == -1) // No active mask.
+ return 0;
+
+ int condition = 0;
+
+#if !defined ACE_WIN32
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, XtInputReadMask);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, XtInputWriteMask);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK))
+ ACE_SET_BITS (condition, XtInputExceptMask);
+#else
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK))
+ ACE_SET_BITS (condition, XtInputReadWinsock);
+ if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK))
+ ACE_SET_BITS (condition, XtInputWriteWinsock);
+ // EXCEPT_MASK is not supported for WIN32. As this was
+ // already handled in register_handler_i, no check here.
+#endif /* !ACE_WIN32 */
+
+ return condition;
+}
+
+// The following functions ensure that there is an Xt timeout for the
+// first timeout in the Reactor's Timer_Queue.
+
+void
+ACE_XtReactor::reset_timeout (void)
+{
+ // Make sure we have a valid context
+ ACE_ASSERT (this->context_ != 0);
+
+ if (timeout_)
+ ::XtRemoveTimeOut (timeout_);
+ timeout_ = 0;
+
+ ACE_Time_Value *max_wait_time =
+ this->timer_queue_->calculate_timeout (0);
+
+ if (max_wait_time)
+ timeout_ = ::XtAppAddTimeOut (this->context_,
+ max_wait_time->msec (),
+ TimerCallbackProc,
+ (XtPointer) this);
+}
+
+int
+ACE_XtReactor::reset_timer_interval
+ (long timer_id,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_XtReactor::reset_timer_interval");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ int const result = ACE_Select_Reactor::timer_queue_->reset_interval
+ (timer_id,
+ interval);
+
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+long
+ACE_XtReactor::schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval)
+{
+ ACE_TRACE ("ACE_XtReactor::schedule_timer");
+ ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, ace_mon, this->token_, -1));
+
+ long const result = ACE_Select_Reactor::schedule_timer (event_handler,
+ arg,
+ delay,
+ interval);
+ if (result == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return result;
+ }
+}
+
+int
+ACE_XtReactor::cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_XtReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (handler,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+int
+ACE_XtReactor::cancel_timer (long timer_id,
+ const void **arg,
+ int dont_call_handle_close)
+{
+ ACE_TRACE ("ACE_XtReactor::cancel_timer");
+
+ if (ACE_Select_Reactor::cancel_timer (timer_id,
+ arg,
+ dont_call_handle_close) == -1)
+ return -1;
+ else
+ {
+ this->reset_timeout ();
+ return 0;
+ }
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/dep/acelite/ace/XtReactor/XtReactor.h b/dep/acelite/ace/XtReactor/XtReactor.h
new file mode 100644
index 00000000000..a4082f0d305
--- /dev/null
+++ b/dep/acelite/ace/XtReactor/XtReactor.h
@@ -0,0 +1,147 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file XtReactor.h
+ *
+ * $Id: XtReactor.h 91743 2010-09-13 18:24:51Z johnnyw $
+ *
+ * @author Eric C. Newton <ecn@clark.net>
+ * @author Kirill Rybaltchenko <Kirill.Rybaltchenko@cern.ch>
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef ACE_XTREACTOR_H
+#define ACE_XTREACTOR_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "ace/XtReactor/ACE_XtReactor_export.h"
+#include "ace/Select_Reactor.h"
+
+#include /**/ <X11/Intrinsic.h>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_XtReactorID
+ *
+ * @brief This little class is necessary due to the way that Microsoft
+ * implements sockets to be pointers rather than indices.
+ */
+class ACE_XtReactor_Export ACE_XtReactorID
+{
+public:
+ /// Magic cookie.
+ XtInputId id_;
+
+ /// Underlying handle.
+ ACE_HANDLE handle_;
+
+ /// Pointer to next node in the linked list.
+ ACE_XtReactorID *next_;
+};
+
+/**
+ * @class ACE_XtReactor
+ *
+ * @brief An object-oriented event demultiplexor and event handler
+ * dispatcher that uses the X Toolkit functions.
+ */
+class ACE_XtReactor_Export ACE_XtReactor : public ACE_Select_Reactor
+{
+public:
+ // = Initialization and termination methods.
+ ACE_XtReactor (XtAppContext context = 0,
+ size_t size = DEFAULT_SIZE,
+ bool restart = false,
+ ACE_Sig_Handler * = 0);
+ virtual ~ACE_XtReactor (void);
+
+ XtAppContext context (void) const;
+ void context (XtAppContext);
+
+ // = Timer operations.
+ virtual long schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval);
+ virtual int reset_timer_interval (long timer_id,
+ const ACE_Time_Value &interval);
+ virtual int cancel_timer (ACE_Event_Handler *handler,
+ int dont_call_handle_close = 1);
+
+ virtual int cancel_timer (long timer_id,
+ const void **arg = 0,
+ int dont_call_handle_close = 1);
+
+protected:
+ // = Register timers/handles with Xt.
+ /// Register a single @a handler.
+ virtual int register_handler_i (ACE_HANDLE handle,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Register a set of <handlers>.
+ virtual int register_handler_i (const ACE_Handle_Set &handles,
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask);
+
+ /// Remove the @a handler associated with this @a handle.
+ virtual int remove_handler_i (ACE_HANDLE handle,
+ ACE_Reactor_Mask mask);
+
+ /// Remove a set of <handles>.
+ virtual int remove_handler_i (const ACE_Handle_Set &handles,
+ ACE_Reactor_Mask);
+
+ /// Suspend the <Event_Handler> associated with @a handle
+ virtual int suspend_i (ACE_HANDLE handle);
+
+ /// Resume the <Event_Handler> associated with @a handle
+ virtual int resume_i (ACE_HANDLE handle);
+
+ /// Synchronize XtInputHandler for @a handle
+ virtual void synchronize_XtInput(ACE_HANDLE handle);
+
+ /// Compute needed Xt condition by looking at base class wait set.
+ virtual int compute_Xt_condition(ACE_HANDLE handle);
+
+ /// Wait for events to occur.
+ virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
+ ACE_Time_Value *);
+
+ ///Wait for Xt events to occur.
+ virtual int XtWaitForMultipleEvents (int,
+ ACE_Select_Reactor_Handle_Set &,
+ ACE_Time_Value *);
+
+ XtAppContext context_;
+ ACE_XtReactorID *ids_;
+ XtIntervalId timeout_;
+
+private:
+ /// This method ensures there's an Xt timeout for the first timeout
+ /// in the Reactor's Timer_Queue.
+ void reset_timeout (void);
+
+ // = Integrate with the X callback function mechanism.
+ static void TimerCallbackProc (XtPointer closure, XtIntervalId *id);
+ static void InputCallbackProc (XtPointer closure, int* source, XtInputId *id);
+
+ /// Deny access since member-wise won't work...
+ ACE_XtReactor (const ACE_XtReactor &);
+ ACE_XtReactor &operator = (const ACE_XtReactor &);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_XTREACTOR_H */
diff --git a/dep/acelite/ace/ace_wchar.h b/dep/acelite/ace/ace_wchar.h
index 77db8f83808..ff884231b1a 100644
--- a/dep/acelite/ace/ace_wchar.h
+++ b/dep/acelite/ace/ace_wchar.h
@@ -4,7 +4,7 @@
/**
* @file ace_wchar.h
*
- * $Id: ace_wchar.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: ace_wchar.h 93597 2011-03-21 12:54:52Z johnnyw $
*
* @author Darrell Brunsch <brunsch@uci.edu>
*/
@@ -148,10 +148,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Wide_To_Ascii
{
public:
- /// Ctor must take a wchar string.
+ /// Constructor must take a wchar string.
ACE_Wide_To_Ascii (const wchar_t *s);
- /// Dtor will free up the memory.
+ /// Destructor will free up the memory.
~ACE_Wide_To_Ascii (void);
/// Return the internal char* representation.
@@ -186,10 +186,10 @@ private:
class ACE_Ascii_To_Wide
{
public:
- /// Ctor must take a wchar string.
+ /// Constructor must take a wchar string.
ACE_Ascii_To_Wide (const char *s);
- /// Dtor will free up the memory.
+ /// Destructor will free up the memory.
~ACE_Ascii_To_Wide (void);
/// Return the internal wchar* representation.
diff --git a/dep/acelite/ace/config-WinCE.h b/dep/acelite/ace/config-WinCE.h
index 93040583980..121f46555f9 100644
--- a/dep/acelite/ace/config-WinCE.h
+++ b/dep/acelite/ace/config-WinCE.h
@@ -1,4 +1,4 @@
-// $Id: config-WinCE.h 89494 2010-03-15 20:11:18Z olli $
+// $Id: config-WinCE.h 93622 2011-03-22 15:45:57Z johnnyw $
// Note: For WinCE build, simply use: #include "ace/config-win32.h"
// It is same as config.h for Windows NT/2k so that you can
@@ -53,6 +53,7 @@
// the information using getenv.
#define ACE_DEFAULT_LD_SEARCH_PATH ACE_TEXT (".\\;\\windows")
+#define ACE_LACKS_ABORT
#define ACE_LACKS_FCNTL_H
#define ACE_LACKS_SYS_TYPES_H
#define ACE_LACKS_GETCWD
@@ -61,6 +62,7 @@
#define ACE_LACKS_GMTIME
#define ACE_LACKS_GMTIME_R
#define ACE_LACKS_LOCALTIME
+#define ACE_LACKS_STRTOK_R
#define ACE_LACKS_PERROR
#define ACE_LACKS_STRFTIME
#define ACE_LACKS_WIN32_SETFILEPOINTEREX
@@ -74,8 +76,6 @@
#define ACE_LACKS_RAISE
#define ACE_LACKS_BSEARCH
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
-
#define ACE_LACKS_MSG_WFMO
#define ACE_LACKS_UMASK
#define ACE_HAS_TYPES_H
diff --git a/dep/acelite/ace/config-aix-5.x.h b/dep/acelite/ace/config-aix-5.x.h
index 3e212059507..edff471a0f9 100644
--- a/dep/acelite/ace/config-aix-5.x.h
+++ b/dep/acelite/ace/config-aix-5.x.h
@@ -1,4 +1,4 @@
-// $Id: config-aix-5.x.h 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: config-aix-5.x.h 93530 2011-03-11 12:12:40Z olli $
//
// Config file for AIX 5.1 and higher.
@@ -312,7 +312,6 @@
#undef ACE_LACKS_NETINET_TCP_H
#define ACE_HAS_3_PARAM_READDIR_R
-#define ACE_HAS_POSIX_GETPWNAM_R
#define ACE_HAS_SCANDIR
#define ACE_SCANDIR_CMP_USES_VOIDPTR
#define ACE_SCANDIR_SEL_LACKS_CONST
diff --git a/dep/acelite/ace/config-aix-7.h b/dep/acelite/ace/config-aix-7.h
new file mode 100644
index 00000000000..29ae0802344
--- /dev/null
+++ b/dep/acelite/ace/config-aix-7.h
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file config-aix-7.h
+ *
+ * $Id: config-aix-7.h 93556 2011-03-16 12:12:04Z shuston $
+ *
+ * This is the config file for AIX 7 and higher.
+ *
+ * @author Steve Huston <shuston@riverace.com>
+ */
+//=============================================================================
+
+#ifndef ACE_CONFIG_AIX_7_H
+#define ACE_CONFIG_AIX_7_H
+
+// Diffs from prior AIX versions are related to scandir() arguments.
+#include "ace/config-aix-5.x.h"
+
+#ifdef ACE_SCANDIR_CMP_USES_VOIDPTR
+# undef ACE_SCANDIR_CMP_USES_VOIDPTR
+#endif /* ACE_SCANDIR_CMP_USES_VOIDPTR */
+
+#ifdef ACE_SCANDIR_SEL_LACKS_CONST
+# undef ACE_SCANDIR_SEL_LACKS_CONST
+#endif /* ACE_SCANDIR_SEL_LACKS_CONST */
+
+#endif /* ACE_CONFIG_AIX_7_H */
diff --git a/dep/acelite/ace/config-linux-common.h b/dep/acelite/ace/config-android.h
index a2367bb81f6..26be6ffec7a 100644
--- a/dep/acelite/ace/config-linux-common.h
+++ b/dep/acelite/ace/config-android.h
@@ -1,22 +1,87 @@
-/* -*- C++ -*- */
-// $Id: config-linux-common.h 92183 2010-10-08 08:44:15Z olli $
-
-// Do not use this configuration file directly since it's designed to
-// be included by another, specific configuration file, such as
-// config-linux.h. It provides config information common to all Linux
-// platforms. It automatically determines the CPU architecture,
-// compiler (g++ or egcs), and libc (libc5 or glibc), and configures
-// based on those.
-
-#ifndef ACE_LINUX_COMMON_H
-#define ACE_LINUX_COMMON_H
+// -*- C++ -*-
+// $Id: config-android.h 94491 2011-09-12 11:17:33Z johnnyw $
+
+// The following configuration file is designed to work for Android
+// platforms using GNU C++.
+
+#ifndef ACE_CONFIG_ANDROID_H
+#define ACE_CONFIG_ANDROID_H
#include /**/ "ace/pre.h"
-#define ACE_HAS_BYTESEX_H
+// Location of the __ANDROID_API__ define
+// #include $NDK_ROOT/sysroot/usr/include/android/api-level.h
+#include "android/api-level.h"
-#if ! defined (__ACE_INLINE__)
-#define __ACE_INLINE__
-#endif /* ! __ACE_INLINE__ */
+#if !defined (__ANDROID_API__)
+# error __ANDROID_API__ must be defined
+#endif
+
+#define ACE_HAS_SSIZE_T
+
+// system errorno is a volatile int
+#define ACE_HAS_VOLATILE_ERRNO
+
+#define ACE_ERRNO_TYPE volatile int
+
+// Android doesn't check is sig is out of range.
+#define ACE_HAS_SIGISMEMBER_BUG
+
+#define ACE_HAS_PTHREADS_UNIX98_EXT
+
+// Android does not support pthread concurrency (yet)
+#define ACE_LACKS_MUTEXATTR_PSHARED 1
+
+// the android definition of struct stat{} uses
+// unsigned long rather than time_t for st_[acm]time
+// members of the stat struct used to report file
+// status details.
+#define ACE_USES_ULONG_FOR_STAT_TIME
+
+#define ACE_LACKS_NEW_H
+#define ACE_LACKS_SEARCH_H
+#define ACE_LACKS_SIGINFO_H
+#define ACE_LACKS_STROPTS_H
+#define ACE_LACKS_SYS_SEM_H
+#define ACE_LACKS_SYS_MSG_H
+#define ACE_LACKS_SYS_SHM_H
+#define ACE_LACKS_SYS_SYSCTL_H
+#define ACE_LACKS_UCONTEXT_H
+
+#define ACE_LACKS_CUSERID
+#define ACE_LACKS_FD_MASK
+#define ACE_LACKS_GETHOSTENT
+#define ACE_LACKS_GETLOADAVG
+#define ACE_LACKS_ISCTYPE
+#define ACE_LACKS_LOG2
+#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
+#define ACE_LACKS_PWD_FUNCTIONS
+#define ACE_LACKS_PTHREAD_CANCEL
+#define ACE_LACKS_SEEKDIR
+#define ACE_LACKS_SEMBUF_T
+#define ACE_LACKS_SETINHERITSCHED
+#define ACE_LACKS_STD_WSTRING
+#define ACE_LACKS_STRRECVFD
+#define ACE_LACKS_SWAB
+#define ACE_LACKS_SYSV_SHMEM
+#define ACE_LACKS_TELLDIR
+#define ACE_LACKS_WCSTOLL
+#define ACE_LACKS_WCSTOULL
+
+#define ACE_LACKS_RAND_R
+
+// Android seems to have 64 keys of which Android itself use 5
+#define ACE_DEFAULT_THREAD_KEYS 59
+
+// Android Standalone compiler std library does not include
+// wide character support
+// Used in tests/Sequence_Unit_Tests/string_sequence_tester.hpp
+# define TAO_LACKS_WCHAR_CXX_STDLIB
+
+#if !defined (ACE_MT_SAFE)
+# define ACE_MT_SAFE 1
+#endif
+
+#define ACE_PLATFORM_CONFIG config-android.h
// Needed to differentiate between libc 5 and libc 6 (aka glibc).
#include <features.h>
@@ -25,10 +90,10 @@
# define ACE_HAS_PTHREADS_UNIX98_EXT
#endif /* _XOPEN_SOURCE - 0 >= 500 */
-#if !defined (ACE_LACKS_LINUX_NPTL)
-
# include "ace/config-posix.h"
+#if !defined (ACE_LACKS_LINUX_NPTL)
+
// Temporary fix because NPTL kernels do have shm_open but there is a problem
// with shm_open/shm_unlink pairing in ACE which needs to be fixed when I have time.
# if defined (ACE_HAS_SHM_OPEN)
@@ -50,6 +115,14 @@
# endif /* ACE_HAS_POSIX_SEM */
#endif /* !ACE_LACKS_LINUX_NPTL */
+// AIO support pulls in the rt library, which pulls in the pthread
+// library. Disable AIO in single-threaded builds.
+#if defined (ACE_HAS_THREADS)
+# define ACE_HAS_CLOCK_GETTIME
+#else
+# undef ACE_HAS_AIO_CALLS
+#endif
+
// First the machine specific part
#if defined (__powerpc__) || defined (__x86_64__)
@@ -64,93 +137,17 @@
# endif /* ! ACE_DEFAULT_BASE_ADDR */
#endif /* ! __powerpc__ && ! __ia64 */
-// Then glibc/libc5 specific parts
-
-#if defined(__GLIBC__)
-# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
-# define ACE_HAS_NONCONST_SETRLIMIT
-# endif
-# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 3)
-# define ACE_HAS_RUSAGE_WHO_ENUM enum __rusage_who
-# define ACE_HAS_RLIMIT_RESOURCE_ENUM enum __rlimit_resource
-# define ACE_LACKS_ISCTYPE
-# endif
-# define ACE_HAS_SOCKLEN_T
-# define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-
- // glibc defines both of these, used in OS_String.
-# if defined (_GNU_SOURCE)
-# define ACE_HAS_STRNLEN
-# define ACE_HAS_WCSNLEN
-
- // This is probably not a 100%-sure-fire check... Red Hat Linux 9
- // and Enterprise Linux 3 and up have a new kernel that can send signals
- // across threads. This was not possible prior because there was no real
- // difference between a process and a thread. With this, the
- // ACE_POSIX_SIG_Proactor is the only chance of getting asynch I/O working.
- // There are restrictions, such as all socket operations being silently
- // converted to synchronous by the kernel, that make aio a non-starter
- // for most Linux platforms at this time. But we'll start to crawl...
-# define ACE_POSIX_SIG_PROACTOR
-# endif
-
- // To avoid the strangeness with Linux's ::select (), which modifies
- // its timeout argument, use ::poll () instead.
-# define ACE_HAS_POLL
-
-// Don't define _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED in ACE to make
-// getpgid() prototype visible. ACE shouldn't depend on feature test
-// macros to make prototypes visible.
-# define ACE_LACKS_GETPGID_PROTOTYPE
-
-// @note the following defines are necessary with glibc 2.0 (0.961212-5)
-// on Alpha. I assume that they're necessary on Intel as well,
-// but that may depend on the version of glibc that is used.
-//# define ACE_HAS_DLFCN_H_BROKEN_EXTERN_C
-# define ACE_HAS_VOIDPTR_SOCKOPT
-
-// Don't define _POSIX_SOURCE in ACE to make strtok() prototype
-// visible. ACE shouldn't depend on feature test macros to make
-// prototypes visible.
-# define ACE_LACKS_STRTOK_R_PROTOTYPE
-// @note end of glibc 2.0 (0.961212-5)-specific configuration.
-
-# if __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1
- // These were suggested by Robert Hanzlik <robi@codalan.cz> to get
- // ACE to compile on Linux using glibc 2.1 and libg++/gcc 2.8.
-# undef ACE_HAS_BYTESEX_H
-# define ACE_HAS_SIGINFO_T
-# define ACE_LACKS_SIGINFO_H
-# define ACE_HAS_UCONTEXT_T
-
- // Pre-glibc (RedHat 5.2) doesn't have sigtimedwait.
-# define ACE_HAS_SIGTIMEDWAIT
-# endif /* __GLIBC__ 2.1+ */
-#else /* ! __GLIBC__ */
- // Fixes a problem with some non-glibc versions of Linux...
-# define ACE_LACKS_MADVISE
-# define ACE_LACKS_MSG_ACCRIGHTS
-#endif /* ! __GLIBC__ */
-
-// Don't define _LARGEFILE64_SOURCE in ACE to make llseek() or
-// lseek64() prototype visible. ACE shouldn't depend on feature test
-// macros to make prototypes visible.
-#if __GLIBC__ > 1
-# if __GLIBC_MINOR__ == 0
-# define ACE_HAS_LLSEEK
-# define ACE_LACKS_LLSEEK_PROTOTYPE
-# else /* __GLIBC_MINOR__ > 0 */
-# define ACE_HAS_LSEEK64
-# define ACE_LACKS_LSEEK64_PROTOTYPE
-# endif
-#endif /* __GLIBC__ > 1 */
-
-#if __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1
-# define ACE_HAS_P_READ_WRITE
+#define ACE_HAS_SIGINFO_T
+#define ACE_HAS_SOCKLEN_T
+#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
+
+#define ACE_HAS_LSEEK64
+//#define ACE_LACKS_LSEEK64_PROTOTYPE
+
+#define ACE_HAS_P_READ_WRITE
// Use ACE's alternate cuserid() implementation since the use of the
// system cuserid() is discouraged.
-# define ACE_HAS_ALT_CUSERID
-#endif /* __GLIBC__ > 1 && __GLIBC_MINOR__ >= 0 */
+#define ACE_HAS_ALT_CUSERID
#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
# define ACE_HAS_ISASTREAM_PROTOTYPE
@@ -160,22 +157,11 @@
// Then the compiler specific parts
-#if defined (__INTEL_COMPILER)
-# include "ace/config-icc-common.h"
-#elif defined (__GNUG__)
+#if defined (__GNUG__)
// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so
// this must appear before its #include.
# define ACE_HAS_STRING_CLASS
# include "ace/config-g++-common.h"
-#elif defined (__SUNCC_PRO) || defined (__SUNPRO_CC)
-# include "ace/config-suncc-common.h"
-#elif defined (__PGI)
-// Portable group compiler
-# define ACE_HAS_CPLUSPLUS_HEADERS
-# define ACE_HAS_STDCPP_STL_INCLUDES
-# define ACE_HAS_STANDARD_CPP_LIBRARY 1
-# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-# define ACE_LACKS_SWAB
#elif defined (__GNUC__)
/**
* GNU C compiler.
@@ -187,7 +173,7 @@
*/
#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && && !__PGI */
# ifdef __cplusplus /* Let it slide for C compilers. */
-# error unsupported compiler in ace/config-linux-common.h
+# error unsupported compiler in ace/config-android.h
# endif /* __cplusplus */
#endif /* ! __GNUG__*/
@@ -198,40 +184,21 @@
#define ACE_HAS_SIGSUSPEND
-#define ACE_HAS_UALARM
-
#define ACE_HAS_STRSIGNAL
-#if __GLIBC__ >= 2
#ifndef ACE_HAS_POSIX_REALTIME_SIGNALS
-#define ACE_HAS_POSIX_REALTIME_SIGNALS
+# define ACE_HAS_POSIX_REALTIME_SIGNALS
#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */
-#ifndef ACE_HAS_AIO_CALLS
-#define ACE_HAS_AIO_CALLS
-#endif /* ACE_HAS_AIO_CALLS */
-#endif
-
-#if __GLIBC__ >= 2
-// glibc 2 and higher has wchar support
-# define ACE_HAS_XPG4_MULTIBYTE_CHAR
-# define ACE_HAS_VFWPRINTF
-#endif
-
-#if __GLIBC__ < 2
-// These are present in glibc 2 and higher
-# define ACE_LACKS_WCSTOK
-# define ACE_LACKS_WCSDUP_PROTOTYPE
-#endif /* __GLIBC__ < 2 */
+#define ACE_HAS_XPG4_MULTIBYTE_CHAR
+#define ACE_HAS_VFWPRINTF
#define ACE_LACKS_ITOW
#define ACE_LACKS_WCSICMP
#define ACE_LACKS_WCSNICMP
#define ACE_LACKS_ISWASCII
-#if __GLIBC__ >= 2
-# define ACE_HAS_3_PARAM_WCSTOK
-#endif
+#define ACE_HAS_3_PARAM_WCSTOK
#define ACE_HAS_3_PARAM_READDIR_R
@@ -239,11 +206,7 @@
# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
#endif /* ! ACE_DEFAULT_BASE_ADDR */
-// Compiler/platform supports alloca().
-// Although ACE does have alloca() on this compiler/platform combination, it is
-// disabled by default since it can be dangerous. Uncomment the following line
-// if you ACE to use it.
-//#define ACE_HAS_ALLOCA
+#define ACE_HAS_ALLOCA
// Compiler/platform has <alloca.h>
#define ACE_HAS_ALLOCA_H
@@ -258,8 +221,8 @@
#define ACE_HAS_BSWAP_16
#define ACE_HAS_BSWAP_32
-#if defined __GNUC__ && __GNUC__ >= 2
-# define ACE_HAS_BSWAP_64
+#if defined (__GNUC__)
+# define ACE_HAS_BSWAP_64
#endif
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
@@ -294,59 +257,25 @@
#define ACE_HAS_GETPAGESIZE 1
-#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
-// glibc supports wchar, but lacks fgetwc and ungetwc
-# define ACE_LACKS_FGETWC
-# define ACE_HAS_NONCONST_MSGSND
-# define ACE_LACKS_STRNLEN_PROTOTYPE
-#endif
-
-// glibc requires _XOPEN_SOURCE_EXTENDED to make this prototype
-// visible, so force ACE to declare one. Yuk!
-#ifndef _XOPEN_SOURCE_EXTENDED
-# define ACE_LACKS_MKSTEMP_PROTOTYPE
-#endif /* !_XOPEN_SOURCE_EXTENDED */
-
// Platform defines struct timespec but not timespec_t
#define ACE_LACKS_TIMESPEC_T
// Platform supplies scandir()
#define ACE_HAS_SCANDIR
-#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10)
-// Although the scandir man page says otherwise, this setting is correct.
-// The setting was fixed in 2.10, so do not use the hack after that.
-#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
-#endif
-// A conflict appears when including both <ucontext.h> and
-// <sys/procfs.h> with recent glibc headers.
-//#define ACE_HAS_PROC_FS
-
-// Platform supports System V IPC (most versions of UNIX, but not Win32)
-#define ACE_HAS_SYSV_IPC
+#define ACE_MMAP_NO_ZERO
// Compiler/platform contains the <sys/syscall.h> file.
#define ACE_HAS_SYS_SYSCALL_H
-// Platform/compiler supports global timezone variable.
-#define ACE_HAS_TIMEZONE
-
#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-// Don't define _XOPEN_SOURCE in ACE to make strptime() prototype
-// visible. ACE shouldn't depend on feature test macros to make
-// prototypes visible.
-#define ACE_LACKS_STRPTIME_PROTOTYPE
-
// Compiler supports the ssize_t typedef.
#define ACE_HAS_SSIZE_T
// Compiler/platform defines the sig_atomic_t typedef.
#define ACE_HAS_SIG_ATOMIC_T
-// Compiler/platform defines a union semun for SysV shared memory.
-#define ACE_HAS_SEMUN
-
#define ACE_HAS_POSIX_TIME
#define ACE_HAS_GPERF
@@ -364,7 +293,7 @@
# define ACE_HAS_STRBUF_T
#endif
-#if defined (__ia64) || defined(__alpha) || defined (__x86_64__)
+#if defined (__ia64) || defined(__alpha) || defined (__x86_64__) || defined(__powerpc64__)
// On 64 bit platforms, the "long" type is 64-bits. Override the
// default 32-bit platform-specific format specifiers appropriately.
# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%lu"
@@ -390,8 +319,6 @@
#define ACE_HAS_VOIDPTR_MMAP
-#define ACE_HAS_ICMP_SUPPORT 1
-
#define ACE_HAS_VASPRINTF
// According to man pages Linux uses different (compared to UNIX systems) types
@@ -405,9 +332,6 @@
# include "ace/config-posix-nonetworking.h"
#else
# define ACE_HAS_NETLINK
-# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
-# define ACE_HAS_GETIFADDRS
-# endif
#endif
#if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO)
@@ -428,11 +352,26 @@
# if !defined (ACE_LACKS_LINUX_VERSION_H)
# include <linux/version.h>
# endif /* !ACE_LACKS_LINUX_VERSION_H */
-# if (LINUX_VERSION_CODE > KERNEL_VERSION (2,6,0))
-# define ACE_HAS_EVENT_POLL
-# endif
+#endif
+
+#define ACE_HAS_SVR4_DYNAMIC_LINKING
+#define ACE_HAS_AUTOMATIC_INIT_FINI
+#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE
+#define ACE_HAS_RECURSIVE_MUTEXES
+#define ACE_HAS_THREAD_SPECIFIC_STORAGE
+#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS
+#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+#define ACE_HAS_REENTRANT_FUNCTIONS
+
+#if __ANDROID_API__ == 8
+# define ACE_LACKS_REGEX_H 1
+# define ACE_LACKS_CONDATTR 1
+#elif __ANDROID_API__ == 9
+# define ACE_HAS_TIMEZONE
+#else
+# error Unsupported Android release
#endif
#include /**/ "ace/post.h"
-#endif /* ACE_LINUX_COMMON_H */
+#endif /* ACE_CONFIG_ANDROID_H */
diff --git a/dep/acelite/ace/config-cray.h b/dep/acelite/ace/config-cray.h
deleted file mode 100644
index 1b944876112..00000000000
--- a/dep/acelite/ace/config-cray.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-cray.h 87169 2009-10-19 20:26:55Z olli $
-
-#ifndef ACE_CONFIG_CRAY_H
-#define ACE_CONFIG_CRAY_H
-#include /**/ "ace/pre.h"
-
-/*
- The following predefined macros are used within ACE ifdefs.
- These are defined when using the Cray compilers. _CRAYMPP
- is defined, for example, if you are running on a Cray T3E
- massively parallel machine. Moreover, in the case of the T3E,
- _CRAYT3E will be defined. This is used to determine the
- ACE_SIZEOF defines for primitive types.
-
- _UNICOS is defined as either the major version of UNICOS being run,
- e.g. 9 or 10 on the vector machines (e.g. C90, T90, J90, YMP, ...)
- or the major+minor+level UNICOS/mk version, e.g. 2.0.3 => 203,
- being run on an MPP machine.
-
- Summary:
-
- _CRAYMPP (defined only if running on MPP machine, e.g. T3E, UNICOS/mk)
- _CRAYT3E (defined specifically if compiling on a Cray T3E)
- _UNICOS (defined if running UNICOS or UNICOS/mk)
-
- Tested on UNICOS 10.0.0.5, UNICOS/mk 2.0.4.57
- Compiles on UNICOS 9.0.2.8, but some tests deadlock
-
- Contributed by Doug Anderson <dla@home.com>
-*/
-
-#if defined (_UNICOS) && !defined (MAXPATHLEN)
-#define MAXPATHLEN 1023
-#endif /* _UNICOS */
-
-#define ACE_DEFAULT_CLOSE_ALL_HANDLES 0
-
-// Defines the page size of the system.
-#define ACE_PAGE_SIZE 4096
-
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-#define ACE_HAS_SSIZE_T
-
-#define ACE_HAS_SYSV_IPC
-
-#define ACE_MT_SAFE 1
-
-#define ACE_HAS_THREADS
-
-#define ACE_HAS_PTHREADS
-
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-
-#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP
-
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-
-#define ACE_HAS_POSIX_TIME
-
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-
-#define ACE_HAS_POSIX_NONBLOCK
-
-// Platform has POSIX terminal interface.
-#define ACE_HAS_TERMIOS
-
-#define ACE_HAS_DIRENT
-
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-
-#define ACE_HAS_IP_MULTICAST
-
-#define ACE_HAS_SOCKADDR_IN_SIN_LEN
-
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-
-#define ACE_HAS_NONCONST_READLINK
-
-#define ACE_HAS_CHARPTR_SOCKOPT
-
-#define ACE_HAS_NONCONST_GETBY
-#define ACE_HAS_NONCONST_INET_ADDR
-
-// has man pages, but links with missing symbols and I can't find lib yet
-/* #define ACE_HAS_REGEX */
-
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-
-#if _UNICOS > 9
-# define ACE_HAS_SIGWAIT
-#endif
-
-#define ACE_HAS_SIG_ATOMIC_T
-
-#define ACE_HAS_SIGISMEMBER_BUG
-
-#define ACE_HAS_MSG
-
-#define ACE_HAS_GPERF
-
-// Special modifications that apply to UNICOS/mk
-#if defined(_CRAYMPP)
-
-# define ACE_HAS_SIGINFO_T
-# define ACE_HAS_UCONTEXT_T
-
-#endif
-
-// The Cray T90 supposedly supports SYSV SHMEM, but I was unable to get it
-// working. Of course, all other Cray PVP and MPP systems do NOT support it,
-// so it's probably good to just define like this for consistency
-#define ACE_LACKS_SYSV_SHMEM
-#define ACE_LACKS_MMAP
-#define ACE_LACKS_CONST_TIMESPEC_PTR
-#define ACE_LACKS_SYSCALL
-#define ACE_LACKS_STRRECVFD
-#define ACE_LACKS_MADVISE
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-#define ACE_LACKS_PTHREAD_CLEANUP
-#define ACE_LACKS_CONDATTR_PSHARED
-#define ACE_LACKS_THREAD_PROCESS_SCOPING
-
-#if !defined(_CRAYMPP)
-
-#define ACE_LACKS_PTHREAD_CANCEL
-#define ACE_LACKS_PTHREAD_KILL
-
-#endif
-
-#define ACE_LACKS_MUTEXATTR_PSHARED
-#define ACE_LACKS_RWLOCK_T
-#define ACE_LACKS_PRI_T
-#define ACE_LACKS_GETPGID
-#define ACE_LACKS_SETPGID
-#define ACE_LACKS_SETREGID
-#define ACE_LACKS_SETREUID
-#define ACE_LACKS_MPROTECT
-#define ACE_LACKS_MSYNC
-#define ACE_LACKS_READV
-#define ACE_LACKS_RLIMIT
-
-// we probably want to fake not having this, since Cray memory mgmt is different
-#define ACE_LACKS_SBRK
-
-#define ACE_LACKS_SETSCHED
-
-#define ACE_LACKS_SIGINFO_H
-
-#define ACE_LACKS_TIMESPEC_T
-
-#define ACE_LACKS_WRITEV
-
-// Cray vector machines are "word" oriented, and modern ones are hard 64-bit.
-// "char" is somewhat of a special case. Most problems arise when code thinks
-// it can address 32-bit quantities and the like. MPP crays are typically
-// byte oriented, e.g. T3E uses Alpha processors, so we don't need as much
-// special treatment.
-
-#ifndef _CRAYMPP
-
-# define ACE_SIZEOF_CHAR 1
-# define ACE_SIZEOF_SHORT 8
-# define ACE_SIZEOF_INT 8
-# define ACE_SIZEOF_LONG 8
-# define ACE_SIZEOF_LONG_LONG 8
-# define ACE_SIZEOF_FLOAT 8
-# define ACE_SIZEOF_DOUBLE 8
-# define ACE_SIZEOF_LONG_DOUBLE 16
-# define ACE_SIZEOF_VOID_P 8
-
-#elif defined(_CRAYT3E)
-
-# define ACE_SIZEOF_CHAR 1
-# define ACE_SIZEOF_SHORT 4
-# define ACE_SIZEOF_INT 8
-# define ACE_SIZEOF_LONG 8
-# define ACE_SIZEOF_LONG_LONG 8
-# define ACE_SIZEOF_FLOAT 4
-# define ACE_SIZEOF_DOUBLE 8
-# define ACE_SIZEOF_LONG_DOUBLE 8
-# define ACE_SIZEOF_VOID_P 8
-
-#endif
-
-// Ones to check out at some point
-
-// C++ Compiler stuff to verify
-/* #define ACE_NEW_THROWS_EXCEPTIONS */
-/* #define ACE_HAS_TEMPLATE_TYPEDEFS */
-
-// thread issues to check out
-/* #define ACE_LACKS_TIMEDWAIT_PROTOTYPES */
-
-// Cray does seem to support it, in -lnsl and has tiuser.h header
-/* #define ACE_HAS_TLI */
-/* #define ACE_HAS_TIUSER_H */
-/* #define ACE_HAS_TLI_PROTOTYPES */
-
-/* #define ACE_LACKS_NAMED_POSIX_SEM */
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_CRAY_H */
diff --git a/dep/acelite/ace/config-cxx-common.h b/dep/acelite/ace/config-cxx-common.h
deleted file mode 100644
index 024c25fd27e..00000000000
--- a/dep/acelite/ace/config-cxx-common.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// -*- C++ -*-
-//
-// $Id: config-cxx-common.h 81935 2008-06-12 22:01:53Z jtc $
-
-#ifndef ACE_CXX_COMMON_H
-#define ACE_CXX_COMMON_H
-#include /**/ "ace/pre.h"
-
-#if !defined (ACE_CONFIG_INCLUDE_CXX_COMMON)
-# error ace/config-cxx-common.h: ACE configuration error! Do not #include this file directly!
-#endif
-
-#if defined (__DECCXX)
-# if !defined (linux)
-# define ACE_HAS_STRING_CLASS
-# if (__DECCXX_VER >= 60090010)
-# define ACE_HAS_STDCPP_STL_INCLUDES
-# endif /* __DECCXX_VER < 60090010 */
-# endif /* ! linux */
-
-# define DEC_CXX
-# define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR
-# define ACE_LACKS_LINEBUFFERED_STREAMBUF
-# define ACE_LACKS_SIGNED_CHAR
-# define ACE_HAS_CPLUSPLUS_HEADERS
-# define ACE_TEMPLATES_REQUIRE_SOURCE
-# if (__DECCXX_VER >= 60090010)
- // DEC CXX 6.0 supports exceptions, etc., by default. Exceptions
- // are enabled by platform_osf1_4.x.GNU/wrapper_macros.GNU.
-# if defined (ACE_HAS_EXCEPTIONS)
-# define ACE_NEW_THROWS_EXCEPTIONS
-# endif /* ACE_HAS_EXCEPTIONS */
-# define ACE_HAS_STANDARD_CPP_LIBRARY 1
-# define ACE_HAS_TEMPLATE_TYPEDEFS
-
-# define ACE_ENDLESS_LOOP \
- unsigned int ace_endless_loop____ = 0; if (ace_endless_loop____) break;
-
-# if defined (__USE_STD_IOSTREAM)
-# define ACE_LACKS_CHAR_RIGHT_SHIFTS
-# define ACE_LACKS_IOSTREAM_FX
-# define ACE_LACKS_UNBUFFERED_STREAMBUF
-# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-# else /* ! __USE_STD_IOSTREAM */
-# define ACE_USES_OLD_IOSTREAMS
-# endif /* ! __USE_STD_IOSTREAM */
-
-// 9: nested comment not allowed. (/usr/include/pdsc.h!) (nestcomment)
-// 177: variable was declared but never referenced (declbutnotref)
-// 193: zero used for undefined preprocessing identifier (undpreid)
-// 236: controlling expression is constant (boolexprconst)
-// 401: base_class_with_nonvirtual_dtor (basclsnondto)
-// 1016: expected type is incompatible with declared type of int (incint)
-// 1136: conversion to smaller size integer could lose data (intconlosbit)
-
-# pragma message disable basclsnondto
-# pragma message disable boolexprconst
-# pragma message disable undpreid
-# pragma message disable notusetmpfunprm
-# pragma message disable bltinclnk
-
-# if (__DECCXX_VER >= 60190029)
- // 6.1-029 and later support msg 1136. Disable it because it
- // causes warnings from ACE and/or TAO.
-# pragma message disable intconlosbit
-# endif /* __DECCXX_VER >= 60190029 */
-
-# if (__DECCXX_VER == 60190027)
- // Seems that this version of cxx doesn't have reset
-# define ACE_AUTO_PTR_LACKS_RESET
-# endif /* __DECCXX_VER == 60190027 */
-
-# if defined (DIGITAL_UNIX) && DIGITAL_UNIX >= 0x40D
- // variable "PTHREAD_THIS_CATCH_NP" was declared but never referenced
-# pragma message disable declbutnotref
-# endif /* DIGITAL_UNIX >= 4.0f */
-
-# else /* __DECCXX_VER < 60090010 */
-# define ACE_LACKS_PRAGMA_ONCE
-# endif /* __DECCXX_VER < 60090010 */
-#else /* ! __DECCXX */
-# error ace/config-cxx-common.h can only be used with Compaq CXX!
-#endif /* ! __DECCXX */
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CXX_COMMON_H */
diff --git a/dep/acelite/ace/config-cygwin32.h b/dep/acelite/ace/config-cygwin32.h
index 35c517c3ca6..4fc15437100 100644
--- a/dep/acelite/ace/config-cygwin32.h
+++ b/dep/acelite/ace/config-cygwin32.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-cygwin32.h 87169 2009-10-19 20:26:55Z olli $
+// $Id: config-cygwin32.h 93530 2011-03-11 12:12:40Z olli $
// The following configuration file is designed to work for CygWin
// platforms using GNU C++.
@@ -64,7 +64,6 @@
#define ACE_HAS_VOIDPTR_SOCKOPT 1
#define ACE_HAS_UALARM 1
#define ACE_HAS_STRNLEN 1
-#define ACE_HAS_POSIX_GETPWNAM_R 1
#define ACE_HAS_POSIX_NONBLOCK 1
#define ACE_HAS_POSIX_TIME
#define ACE_HAS_CLOCK_GETTIME 1
@@ -73,11 +72,9 @@
#define ACE_DEFAULT_BASE_ADDR ((char *) 0x8000000)
#define ACE_HAS_NONCONST_SELECT_TIMEVAL
#define ACE_HAS_SVR4_DYNAMIC_LINKING
-//#define ACE_HAS_SYSV_IPC
#define ACE_HAS_VOIDPTR_MMAP
#define ACE_HAS_CPLUSPLUS_HEADERS
#define ACE_HAS_POLL
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
#define ACE_HAS_SOCKADDR_MSG_NAME 1
#define ACE_LACKS_PRI_T 1
#define ACE_HAS_3_PARAM_READDIR_R
diff --git a/dep/acelite/ace/config-doxygen.h b/dep/acelite/ace/config-doxygen.h
deleted file mode 100644
index 5664338e3a0..00000000000
--- a/dep/acelite/ace/config-doxygen.h
+++ /dev/null
@@ -1,119 +0,0 @@
-// -*- C++ -*-
-
-/**
- * This is a configuration file to define all the macros that Doxygen
- * needs
- *
- * @file config-doxygen.h
- *
- * $Id: config-doxygen.h 91685 2010-09-09 09:35:14Z johnnyw $
- *
- * @author Carlos O'Ryan <coryan@uci.edu>
- * @author Darrell Brunsch <brunsch@uci.edu>
- *
- */
-#ifndef ACE_CONFIG_DOXYGEN_H
-#define ACE_CONFIG_DOXYGEN_H
-
-/// Make sure that we always turn inlining on.
-#define __ACE_INLINE__
-
-/// Make the wchar_t interfaces available.
-#define ACE_HAS_WCHAR
-
-/// Make all the emulation versions of string operations visible
-// #define ACE_LACKS_WCSTOK
-#define ACE_LACKS_ITOW
-#define ACE_LACKS_STRCASECMP
-#define ACE_LACKS_STRRCHR
-#define ACE_LACKS_WCSCAT
-#define ACE_LACKS_WCSCHR
-#define ACE_LACKS_WCSCMP
-#define ACE_LACKS_WCSCPY
-#define ACE_LACKS_WCSICMP
-#define ACE_LACKS_WCSLEN
-#define ACE_LACKS_WCSNCAT
-#define ACE_LACKS_WCSNCMP
-#define ACE_LACKS_WCSNCPY
-#define ACE_LACKS_WCSNICMP
-#define ACE_LACKS_WCSPBRK
-#define ACE_LACKS_WCSRCHR
-#define ACE_LACKS_WCSCSPN
-#define ACE_LACKS_WCSSPN
-#define ACE_LACKS_WCSSTR
-
-/// Support for threads enables several important classes
-#define ACE_HAS_THREADS
-
-/// Support for Win32 enables the WFMO_Reactor and several Async I/O
-/// classes
-#define ACE_WIN32
-
-/// Enable support for POSIX Asynchronous I/O calls
-#define ACE_HAS_AIO_CALLS
-
-/// Enable support for TLI interfaces
-#define ACE_HAS_TLI
-
-/// Enable support for the SSL wrappers
-#define ACE_HAS_SSL 1
-
-/// Enable timeprobes
-#define ACE_COMPILE_TIMEPROBES
-
-/// Enable unicode to generate ACE_Registry_Name_Space
-#define UNICODE
-
-/// These defines make sure that Svc_Conf_y.cpp and Svc_Conf_l.cpp are correctly
-/// parsed
-#define __cplusplus
-#define ACE_YY_USE_PROTOS
-
-/// TAO features that should be documented too
-#define TAO_HAS_RT_CORBA 1
-#define TAO_HAS_MINIMUM_CORBA 0
-#define TAO_HAS_AMI 1
-#define TAO_HAS_INTERCEPTORS 1
-#define TAO_HAS_SCIOP 1
-#define TAO_HAS_COIOP 1
-#define TAO_HAS_TRANSPORT_CURRENT 1
-
-/// Generate token library documentation
-#define ACE_HAS_TOKENS_LIBRARY
-
-/// Generate ACE ATM classes documentation
-#define ACE_HAS_ATM
-
-/// Generate ACE XTI ATM class documentation
-#define ACE_HAS_XTI_ATM
-
-/// Generate ACE_Dev_Poll_Reactor documentation
-#define ACE_HAS_DEV_POLL
-
-/// Generate ACE_Log_Msg_NT_Event_Log documentation
-#define ACE_HAS_LOG_MSG_NT_EVENT_LOG
-
-/// Generate icmp documentation
-#define ACE_HAS_ICMP_SUPPORT 1
-
-/// Parse some ACE_SSL classes that depend on recent versions of
-/// OpenSSL.
-#define OPENSSL_VERSION_NUMBER 0x00905820L
-
-/// Enable IPv6
-#define ACE_HAS_IPV6
-
-/// Enable netlink socket support
-#define ACE_HAS_NETLINK
-
-#define ACE_HAS_IP_MULTICAST
-
-#define ACE_INLINE
-#define ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-#define ACE_END_VERSIONED_NAMESPACE_DECL
-#define TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-#define TAO_END_VERSIONED_NAMESPACE_DECL
-
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
-
-#endif /* ACE_CONFIG_DOXYGEN_H */
diff --git a/dep/acelite/ace/config-freebsd.h b/dep/acelite/ace/config-freebsd.h
index b83394ddece..afd68e53c62 100644
--- a/dep/acelite/ace/config-freebsd.h
+++ b/dep/acelite/ace/config-freebsd.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-freebsd.h 87483 2009-11-11 13:50:04Z olli $
+// $Id: config-freebsd.h 95430 2012-01-11 20:45:28Z mcorino $
// The following configuration file is designed to work for FreeBSD
@@ -8,49 +8,20 @@
#include /**/ "ace/pre.h"
#if !defined (ACE_MT_SAFE)
-# define ACE_MT_SAFE 1
+# define ACE_MT_SAFE 1
#endif
-#if ACE_MT_SAFE
- // Yes, we do have threads.
-# define ACE_HAS_THREADS 1
-#else
- // Set to 0 since that's what config-posix.h checks for.
-# define ACE_HAS_THREADS 0
-#endif /* ACE_MT_SAFE */
-
-#include "ace/config-posix.h"
-
// Make sure we source in the OS version.
#include <osreldate.h>
-#if !defined (__ACE_INLINE__)
-# define __ACE_INLINE__
-#endif /* ! __ACE_INLINE__ */
-
-#if (__FreeBSD_version < 220000)
-# if defined (ACE_HAS_THREADS)
-# error Threads are not supported.
-# endif /* ACE_HAS_THREADS */
-#endif /* __FreeBSD_version < 220000 */
+#include "ace/config-posix.h"
-#if defined (__GNUG__)
-# include "ace/config-g++-common.h"
-#endif /* __GNUG__ */
+#include "ace/config-g++-common.h"
#if defined (ACE_HAS_PENTIUM)
# undef ACE_HAS_PENTIUM
#endif /* ACE_HAS_PENTIUM */
-// Platform specific directives
-// gcc defines __FreeBSD__ automatically for us.
-#ifdef ACE_HAS_THREADS
-# if !defined (_THREAD_SAFE)
-# define _THREAD_SAFE
-# endif /* _THREAD_SAFE */
-#endif
-
-
#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_3_PARAM_WCSTOK
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
@@ -91,6 +62,8 @@
#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
#define ACE_HAS_UALARM
+#define ACE_HAS_XPG4_MULTIBYTE_CHAR
+
#define ACE_LACKS_CONDATTR_PSHARED
#define ACE_LACKS_ISCTYPE
#define ACE_LACKS_ITOW
@@ -155,12 +128,12 @@
#if (__FreeBSD_version < 400000)
# define ACE_LACKS_SIGSET
+# define ACE_LACKS_SIGSET_T
# define ACE_LACKS_RWLOCK_T
# define ACE_LACKS_READDIR_R
# define ACE_LACKS_SETSCHED
# define ACE_LACKS_PTHREAD_THR_SIGSETMASK
# define ACE_LACKS_UCONTEXT_H
-# define ACE_LACKS_RAND_REENTRANT_FUNCTIONS
enum schedparam_policy {
SCHED_RR,
@@ -189,7 +162,6 @@ enum schedparam_policy {
#if (__FreeBSD_version < 501000)
# define ACE_LACKS_STDINT_H
-# define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
#endif
#if (__FreeBSD_version >= 501000)
diff --git a/dep/acelite/ace/config-g++-common.h b/dep/acelite/ace/config-g++-common.h
index 4146b5c2147..6bd902d6e68 100644
--- a/dep/acelite/ace/config-g++-common.h
+++ b/dep/acelite/ace/config-g++-common.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: config-g++-common.h 92120 2010-10-01 12:00:01Z johnnyw $
+// $Id: config-g++-common.h 93500 2011-03-07 16:19:27Z vzykov $
// This configuration file is designed to be included by another,
// specific configuration file. It provides config information common
@@ -24,20 +24,10 @@
#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
#define ACE_TEMPLATES_REQUIRE_SOURCE
-#if ( __GNUC__ == 2 && __GNUC_MINOR__ < 97 )
- // gcc 2.97 and lower use old iostreams
-# define ACE_USES_OLD_IOSTREAMS
-#endif /* __GNUC__ >= 2.97 */
-
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS
#endif /* __GNUC__ >= 3.4 */
-#if (__GNUC__ < 3)
-# define ACE_LACKS_MEMBER_TEMPLATES
-# define ACE_LACKS_NUMERIC_LIMITS
-#endif /* __GNUC__ < 3 */
-
#define ACE_NEW_THROWS_EXCEPTIONS
#if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
// Versions of g++ prior to 3.3 had a buggy operator // new(nothrow)[]().
@@ -73,6 +63,10 @@
#define ACE_HAS_GCC_DEPRECATED_ATTRIBUTE 1
#endif
+#if !defined (ACE_HAS_GCC_FORMAT_ATTRIBUTE)
+#define ACE_HAS_GCC_FORMAT_ATTRIBUTE 1
+#endif
+
#if (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE == 1)
# define ACE_GCC_CONSTRUCTOR_ATTRIBUTE __attribute__ ((constructor))
#endif
@@ -85,6 +79,11 @@
#define ACE_DEPRECATED __attribute__ ((deprecated))
#endif
+#if (ACE_HAS_GCC_FORMAT_ATTRIBUTE == 1)
+# define ACE_GCC_FORMAT_ATTRIBUTE(TYPE, STR_INDEX, FIRST_INDEX) \
+ __attribute__ ((format (TYPE, STR_INDEX, FIRST_INDEX)))
+#endif
+
// GNU g++ >= 4.x implements "#pragma once".
#if (__GNUC__ < 4) && !defined (ACE_LACKS_PRAGMA_ONCE)
// We define it with a -D with make depend.
diff --git a/dep/acelite/ace/config-ghs-common.h b/dep/acelite/ace/config-ghs-common.h
deleted file mode 100644
index ffa554c047e..00000000000
--- a/dep/acelite/ace/config-ghs-common.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-ghs-common.h 80826 2008-03-04 14:51:23Z wotte $
-
-// This configuration file is designed to be included by another,
-// specific configuration file. It provides config information common
-// to all Green Hills platforms.
-
-#ifndef ACE_GHS_COMMON_H
-#define ACE_GHS_COMMON_H
-#include /**/ "ace/pre.h"
-
-#if !defined (ACE_CONFIG_INCLUDE_GHS_COMMON)
-# error ace/config-ghs-common.h: ACE configuration error! Do not #include this file directly!
-#endif
-
-#if defined (ghs)
-
-# if defined (sun)
- // Need nonstatic Object_Manager on Solaris to prevent seg fault
- // on startup.
-# define ACE_HAS_NONSTATIC_OBJECT_MANAGER
-# endif /* sun */
-
-# if defined (__STANDARD_CXX)
- // Green Hills 1.8.9, but not 1.8.8.
-# define ACE_HAS_STANDARD_CPP_LIBRARY 1
-# define ACE_LACKS_AUTO_PTR
-# define ACE_LACKS_CHAR_RIGHT_SHIFTS
-# define ACE_LACKS_UNBUFFERED_STREAMBUF
-# else
-# define ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA
-# endif /* __STANDARD_CXX */
-
-# define ACE_LACKS_LINEBUFFERED_STREAMBUF
-# define ACE_LACKS_LONGLONG_T
-# define ACE_LACKS_SIGNED_CHAR
-
-#else /* ! ghs */
-# error ace/config-ghs-common.h can only be used with Green Hills compilers!
-#endif /* ! ghs */
-
-#include /**/ "ace/post.h"
-#endif /* ACE_GHS_COMMON_H */
diff --git a/dep/acelite/ace/config-hpux-11.00.h b/dep/acelite/ace/config-hpux-11.00.h
index 978a85a8e87..4f16be93b5c 100644
--- a/dep/acelite/ace/config-hpux-11.00.h
+++ b/dep/acelite/ace/config-hpux-11.00.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-hpux-11.00.h 92102 2010-09-30 08:14:15Z johnnyw $
+// $Id: config-hpux-11.00.h 96096 2012-08-23 12:34:02Z johnnyw $
// The following configuration file is designed to work for HP
// platforms running HP-UX 11.00 using aC++ or gcc (2.95 and up).
@@ -164,6 +164,9 @@
#define ACE_HAS_CLOCK_GETTIME
#define ACE_HAS_CLOCK_SETTIME
+#define ACE_LACKS_CLOCK_MONOTONIC
+#define ACE_LACKS_MONOTONIC_TIME
+
// Prototypes for both signal() and struct sigaction are consistent.
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
@@ -205,13 +208,6 @@
// Compiler/platform supports poll().
#define ACE_HAS_POLL
-/* Platform supports "position-independent" features provided by
- ACE_Based_Pointer<>. */
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
-
-/* Platform supports POSIX getpwnam_r() function */
-#define ACE_HAS_POSIX_GETPWNAM_R 1
-
// Platform supports POSIX O_NONBLOCK semantics.
#define ACE_HAS_POSIX_NONBLOCK
@@ -319,12 +315,12 @@
#define ACE_LACKS_SUSECONDS_T
#define ACE_LACKS_SYS_SYSCTL_H
-// @@ TODO: It looks like HP-UX provides strtoll, strtoull, wcstoll and
-// wcstoull but some more work is needed to plug them in correctly.
-#define ACE_LACKS_STRTOLL
-#define ACE_LACKS_WCSTOLL
-#define ACE_LACKS_STRTOULL
-#define ACE_LACKS_WCSTOULL
+#if !(defined(__STDC_EXT__) || defined(_INCLUDE_LONGLONG) || defined(_INCLUDE_STDC__SOURCE_199901))
+# define ACE_LACKS_STRTOLL
+# define ACE_LACKS_WCSTOLL
+# define ACE_LACKS_STRTOULL
+# define ACE_LACKS_WCSTOULL
+#endif
#define ACE_LACKS_ISWASCII
@@ -425,6 +421,7 @@
# define ACE_HAS_RECURSIVE_MUTEXES
# define ACE_HAS_THREAD_SPECIFIC_STORAGE
# define ACE_LACKS_PTHREAD_ATTR_SETSTACK
+# define ACE_LACKS_CONDATTR_SETCLOCK
#endif /* ACE_HAS_THREADS */
#define ACE_HAS_POSIX_SEM
diff --git a/dep/acelite/ace/config-irix6.5.x-sgic++.h b/dep/acelite/ace/config-irix6.5.x-sgic++.h
deleted file mode 100644
index 2d501010b68..00000000000
--- a/dep/acelite/ace/config-irix6.5.x-sgic++.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- C++ -*-
-// $Id: config-irix6.5.x-sgic++.h 80826 2008-03-04 14:51:23Z wotte $
-
-// Use this file for IRIX 6.5.x
-
-#ifndef ACE_CONFIG_IRIX65X_H
-#define ACE_CONFIG_IRIX65X_H
-#include /**/ "ace/pre.h"
-
-// Include IRIX 6.[234] configuration
-#include "ace/config-irix6.x-sgic++.h"
-
-// Irix 6.5 man pages show that they exist
-#undef ACE_LACKS_CONDATTR_PSHARED
-#undef ACE_LACKS_MUTEXATTR_PSHARED
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_IRIX65X_H */
diff --git a/dep/acelite/ace/config-irix6.x-common.h b/dep/acelite/ace/config-irix6.x-common.h
deleted file mode 100644
index 1de756d530c..00000000000
--- a/dep/acelite/ace/config-irix6.x-common.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/* -*- C++ -*- */
-//
-// $Id: config-irix6.x-common.h 87167 2009-10-19 19:33:53Z olli $
-//
-// This file contains the common configuration options for both
-// SGI/MIPSPro C++ and g++ under IRIX 6.X
-//
-// For IRIX 6.2 there are several patches that should be applied to
-// get reliable operation with multi-threading and exceptions.
-// Specifically you should get a reasonable current IRIX, Compiler
-// and POSIX patch-sets.
-
-// For IRIX 6.[34] it's less critical, but it's still recommended
-// that you apply the applicable patch-sets (IRIX and Compiler I believe).
-
-// These patches are updated frequently, so you should ask your support
-// contact or search SGI's web site (http://www.sgi.com) for the latest
-// version.
-
-// Use this file for IRIX 6.[234] if you have the pthreads patches
-// installed.
-
-#ifndef ACE_CONFIG_IRIX6X_COMMON_H
-
-#ifndef IRIX6
-# define IRIX6
-#endif
-
-#if ! defined(ACE_CONFIG_H)
-#error "This file may only be included by config-irix6.x-sgic++.h, config-irix6.x-kcc.h or config-irix6.x-g++.h"
-#endif
-
-// The Irix 6.x float.h doesn't allow us to distinguish between a
-// double and a long double. So, we have to hard-code this. Thanks
-// to Bob Laferriere <laferrie@gsao.med.ge.com> for figuring it out.
-#if defined (_MIPS_SIM) /* 6.X System */
-# include <sgidefs.h>
-# if defined (__GNUC__)
-# define ACE_SIZEOF_LONG_DOUBLE 16
-# elif defined (_MIPS_SIM_NABI32) && (_MIPS_SIM == _MIPS_SIM_NABI32)
-# define ACE_SIZEOF_LONG_DOUBLE 16
-# elif defined (_MIPS_SIM_ABI32) && (_MIPS_SIM == _MIPS_SIM_ABI32)
-# define ACE_SIZEOF_LONG_DOUBLE 8
-# elif defined (_MIPS_SIM_ABI64) && (_MIPS_SIM == _MIPS_SIM_ABI64)
-# define ACE_SIZEOF_LONG_DOUBLE 16
-# elif !defined (ACE_SIZEOF_LONG_DOUBLE)
-# define ACE_SIZEOF_LONG_DOUBLE 8
-# endif
-#else
-# define ACE_SIZEOF_LONG_DOUBLE 8 /* 5.3 System */
-#endif
-
-// petern, Next part of it:
-
-// Platform supports getpagesize() call.
-#define ACE_HAS_GETPAGESIZE
-
-// Platform has no implementation of pthread_condattr_setpshared(),
-// even though it supports pthreads! (like Irix 6.2)
-#define ACE_LACKS_CONDATTR_PSHARED
-#define ACE_LACKS_MUTEXATTR_PSHARED
-
-#define ACE_LACKS_SUSECONDS_T
-
-// Platform/compiler has the sigwait(2) prototype
-#define ACE_HAS_SIGWAIT
-#define ACE_HAS_SIGTIMEDWAIT
-#define ACE_HAS_SIGSUSPEND
-
-// Platform supports System V IPC (most versions of UNIX, but not Win32)
-#define ACE_HAS_SYSV_IPC
-
-// Platform requires void * for mmap().
-#define ACE_HAS_VOIDPTR_MMAP
-
-// Platform supports recvmsg and sendmsg.
-#define ACE_HAS_MSG
-
-// Compiler/platform contains the <sys/syscall.h> file.
-#define ACE_HAS_SYS_SYSCALL_H
-
-// Compiler/platform supports alloca()
-// Although ACE does have alloca() on this compiler/platform combination, it is
-// disabled by default since it can be dangerous. Uncomment the following line
-// if you ACE to use it.
-//#define ACE_HAS_ALLOCA
-
-// Compiler/platform has <alloca.h>
-#define ACE_HAS_ALLOCA_H
-
-// Irix needs to define bzero() in this odd file <bstring.h>
-#define ACE_HAS_BSTRING
-
-// Compiler/platform has the getrusage() system call.
-#define ACE_HAS_GETRUSAGE
-
-// Platform supports POSIX O_NONBLOCK semantics.
-#define ACE_HAS_POSIX_NONBLOCK
-
-// Compiler/platform has correctly prototyped header files.
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-// Platform contains <poll.h>.
-#define ACE_HAS_POLL
-
-// Platform supports the /proc file system.
-#define ACE_HAS_PROC_FS
-
-// Compiler/platform defines the sig_atomic_t typedef.
-#define ACE_HAS_SIG_ATOMIC_T
-
-// Platform supports SVR4 extended signals.
-#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_UCONTEXT_T
-
-// Compiler supports the ssize_t typedef.
-#define ACE_HAS_SSIZE_T
-
-// Platform supports STREAMS.
-#define ACE_HAS_STREAMS
-
-// Compiler/platform supports struct strbuf.
-#define ACE_HAS_STRBUF_T
-
-// Compiler/platform supports SVR4 dynamic linking semantics.
-#define ACE_HAS_SVR4_DYNAMIC_LINKING
-
-// Platform provides <sys/filio.h> header.
-#define ACE_HAS_SYS_FILIO_H
-
-// Compiler/platform defines a union semun for SysV shared memory.
-#define ACE_HAS_SEMUN
-
-// Platform supports IP multicast
-#define ACE_HAS_IP_MULTICAST
-#ifdef ACE_LACKS_PERFECT_MULTICAST_FILTERING
- #undef ACE_LACKS_PERFECT_MULTICAST_FILTERING
-#endif
-#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1
-
-//**************************************************************
-// Not so sure how next lines should look like
-
-// Platform supports POSIX timers via timestruc_t.
-#define ACE_HAS_POSIX_TIME
-
-//**************************************************************
-
-// IRIX 6.4 and below do not support reentrant netdb functions
-// (getprotobyname_r, getprotobynumber_r, gethostbyaddr_r,
-// gethostbyname_r, getservbyname_r).
-#if (ACE_IRIX_VERS <= 64) && !defined (ACE_HAS_NETDB_REENTRANT_FUNCTIONS)
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-#endif /* ACE_HAS_NETDB_REENTRANT_FUNCTIONS */
-
-#define ACE_HAS_DIRENT
-// Unless the thread enabled version is used the readdir_r interface
-// does not get defined in IRIX 6.2
-#define ACE_LACKS_READDIR_R
-#define ACE_LACKS_RWLOCK_T
-
-#define ACE_HAS_GPERF
-
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_HAS_BROKEN_DGRAM_SENDV
-
-#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE
-#define ACE_PI_CONTROL_BLOCK_ALIGN_LONGS 2
-
-// Platform has POSIX terminal interface.
-#define ACE_HAS_TERMIOS
-
-// IRIX 6.5 supports AIO
-#define ACE_HAS_AIO_CALLS
-#define ACE_POSIX_AIOCB_PROACTOR
-#define ACE_HAS_SGIDLADD
-#define ACE_HAS_P_READ_WRITE
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-#define ACE_LACKS_STDINT_H
-#define ACE_HAS_SYSENT_H
-#define ACE_HAS_SYSV_SYSINFO
-#define ACE_HAS_SYS_SYSTEMINFO_H
-
-// Platform has support for multi-byte character support compliant
-// with the XPG4 Worldwide Portability Interface wide-character
-// classification.
-#define ACE_HAS_XPG4_MULTIBYTE_CHAR
-
-// We need to setup a very high address or Naming_Test won't run.
-#define ACE_DEFAULT_BASE_ADDR ((char *) (1024U * 1024 * 1024))
-
-#define ACE_LACKS_SIGNED_CHAR
-
-// Platform supports reentrant functions (i.e., all the POSIX *_r
-// functions).
-#define ACE_HAS_REENTRANT_FUNCTIONS
-
-// Optimize ACE_Handle_Set for select().
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-
-// Platform does not support reentrant password file accessor functiions.
-#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
-
-// uses ctime_r & asctime_r with only two parameters vs. three
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-
-// Prototypes for both signal() and struct sigaction are consistent.
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-
-#define ACE_HAS_UALARM
-
-// Scheduling functions are declared in <sched.h>
-#define ACE_NEEDS_SCHED_H
-
-// Compile using multi-thread libraries by default
-#if !defined (ACE_MT_SAFE)
- #define ACE_MT_SAFE 1
-#endif /* ACE_MT_SAFE */
-
-#if (ACE_MT_SAFE != 0)
-
-// Add threading support
-
-#define ACE_HAS_IRIX62_THREADS
-
-// Needed for the threading stuff?
-#include /**/ <task.h>
-#define PTHREAD_MIN_PRIORITY PX_PRIO_MIN
-#define PTHREAD_MAX_PRIORITY PX_PRIO_MAX
-
-// ACE supports threads.
-#define ACE_HAS_THREADS
-
-// Platform has no implementation of pthread_condattr_setpshared(),
-// even though it supports pthreads! (like Irix 6.2)
-#define ACE_LACKS_CONDATTR_PSHARED
-#define ACE_LACKS_MUTEXATTR_PSHARED
-
-// IRIX 6.2 supports a variant of POSIX Pthreads, supposedly POSIX 1c
-#define ACE_HAS_PTHREADS
-
-// Compiler/platform has thread-specific storage
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-
-// The pthread_cond_timedwait call does not reset the timer.
-#define ACE_LACKS_COND_TIMEDWAIT_RESET 1
-
-// When threads are enabled READDIR_R is supported on IRIX.
-#undef ACE_LACKS_READDIR_R
-
-#endif /* (ACE_MT_SAFE == 0) */
-
-
-#endif /* ACE_CONFIG_IRIX6X_COMMON_H */
diff --git a/dep/acelite/ace/config-irix6.x-g++.h b/dep/acelite/ace/config-irix6.x-g++.h
deleted file mode 100644
index 94c79119a64..00000000000
--- a/dep/acelite/ace/config-irix6.x-g++.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-irix6.x-g++.h 87268 2009-10-29 21:06:06Z olli $
-
-// The following configuration file is designed to work for the SGI
-// Indigo2EX running Irix 6.2 platform using the GNU C++ Compiler
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-#include /**/ "ace/pre.h"
-
-#include "ace/config-g++-common.h"
-#include "ace/config-irix6.x-common.h"
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-irix6.x-sgic++.h b/dep/acelite/ace/config-irix6.x-sgic++.h
deleted file mode 100644
index 8bba07ac671..00000000000
--- a/dep/acelite/ace/config-irix6.x-sgic++.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-irix6.x-sgic++.h 81935 2008-06-12 22:01:53Z jtc $
-
-// Use this file for IRIX 6.[234] if you have the pthreads patches
-// installed.
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-#include /**/ "ace/pre.h"
-
-#include "ace/config-irix6.x-common.h"
-
-// This is the config file for IRIX 6.2, 6.4 and hopefully 6.3, using
-// the SGI C++ compiler (7.1 or higher).
-
-// The following three should be enabled/disabled together.
-#if _COMPILER_VERSION < 720
-#define ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA
-#endif /* _COMPILER_VERSION < 720 */
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-#define ACE_NEEDS_FUNC_DEFINITIONS
-
-// Platform supports STREAM pipes (note that this is disabled by
-// default, see the manual page on pipe(2) to find out how to enable
-// it).
-// #define ACE_HAS_STREAM_PIPES
-
-#if defined (_COMPILER_VERSION)
-# define ACE_CC_NAME ACE_TEXT ("SGI/MIPSPro")
-# define ACE_CC_MAJOR_VERSION (_COMPILER_VERSION / 100)
-# define ACE_CC_MINOR_VERSION (_COMPILER_VERSION % 100)
-# define ACE_CC_BETA_VERSION (0)
-#endif /* _COMPILER_VERSION */
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-kfreebsd.h b/dep/acelite/ace/config-kfreebsd.h
index ab2cd8882f4..1f607d13efa 100644
--- a/dep/acelite/ace/config-kfreebsd.h
+++ b/dep/acelite/ace/config-kfreebsd.h
@@ -1,4 +1,4 @@
-// $Id: config-kfreebsd.h 91743 2010-09-13 18:24:51Z johnnyw $
+// $Id: config-kfreebsd.h 93550 2011-03-15 21:26:56Z olli $
#ifndef ACE_CONFIG_KFREEBSD_H
#define ACE_CONFIG_KFREEBSDH
@@ -153,13 +153,6 @@
/* Platform contains <poll.h> */
#define ACE_HAS_POLL 1
-/* Platform supports "position-independent" features provided by
- ACE_Based_Pointer<>. */
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
-
-/* Platform supports POSIX getpwnam_r() function */
-#define ACE_HAS_POSIX_GETPWNAM_R 1
-
/* Platform supports POSIX O_NONBLOCK semantics */
#define ACE_HAS_POSIX_NONBLOCK 1
@@ -176,9 +169,6 @@
/* Define to 1 if platform has POSIX threads */
#define ACE_HAS_PTHREADS 1
-/* Platform supports POSIX.1c-1995 threads */
-#define ACE_HAS_PTHREADS_STD 1
-
/* Platform has the UNIX98 extensions to Pthreads (rwlocks) */
#define ACE_HAS_PTHREADS_UNIX98_EXT 1
diff --git a/dep/acelite/ace/config-linux.h b/dep/acelite/ace/config-linux.h
index 8b79c13a415..7283136d034 100644
--- a/dep/acelite/ace/config-linux.h
+++ b/dep/acelite/ace/config-linux.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
-// $Id: config-linux.h 80826 2008-03-04 14:51:23Z wotte $
+// $Id: config-linux.h 96072 2012-08-17 12:29:59Z mcorino $
// The following configuration file is designed to work for Linux
// platforms using GNU C++.
@@ -9,66 +9,444 @@
#define ACE_CONFIG_LINUX_H
#include /**/ "ace/pre.h"
-#define ACE_PLATFORM_CONFIG config-linux.h
+#if !defined (ACE_LINUX)
+#define ACE_LINUX
+#endif /* ACE_LINUX */
-#include "ace/config-linux-common.h"
+#if !defined (ACE_MT_SAFE)
+# define ACE_MT_SAFE 1
+#endif
-#define ACE_HAS_SVR4_DYNAMIC_LINKING
-#define ACE_HAS_AUTOMATIC_INIT_FINI
-#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE
+#if !defined (__ACE_INLINE__)
+# define __ACE_INLINE__
+#endif /* ! __ACE_INLINE__ */
-#if !defined (ACE_MT_SAFE)
-#define ACE_MT_SAFE 1 // JCEJ 12/22/96 #1
+#if !defined (ACE_PLATFORM_CONFIG)
+#define ACE_PLATFORM_CONFIG config-linux.h
#endif
-#if ACE_MT_SAFE
-// Yes, we do have threads.
-#define ACE_HAS_THREADS
-// And they're even POSIX pthreads (LinuxThreads implementation)
-#define ACE_HAS_PTHREADS
-
-// On linux this is part of pthreads
-# if (defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L)
-# if !defined (ACE_HAS_CLOCK_GETTIME)
-# if !defined(__PGI)
-# define ACE_HAS_CLOCK_GETTIME
-# endif /* __PGI */
-# define ACE_HAS_CLOCK_SETTIME
-# endif /* !ACE_HAS_CLOCK_GETTIME */
-# endif /* _POSIX_C_SOURCE >= 199309L */
-
-#if !defined (ACE_HAS_PTHREADS_UNIX98_EXT)
-# define ACE_LACKS_RWLOCK_T
+#define ACE_HAS_BYTESEX_H
+
+// Needed to differentiate between libc 5 and libc 6 (aka glibc).
+#include <features.h>
+
+#if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)
+# define ACE_HAS_PTHREADS_UNIX98_EXT
+#endif /* _XOPEN_SOURCE - 0 >= 500 */
+
+# include "ace/config-posix.h"
+
+#if !defined (ACE_LACKS_LINUX_NPTL)
+
+ // Temporary fix because NPTL kernels do have shm_open but there is a problem
+ // with shm_open/shm_unlink pairing in ACE which needs to be fixed when I have time.
+# if defined (ACE_HAS_SHM_OPEN)
+# undef ACE_HAS_SHM_OPEN
+# endif /* ACE_HAS_SHM_OPEN */
+
+# if defined (ACE_USES_FIFO_SEM)
+ // Don't use this for Linux NPTL since this has complete
+ // POSIX semaphores which are more efficient
+# undef ACE_USES_FIFO_SEM
+# endif /* ACE_USES_FIFO_SEM */
+
+# if defined (ACE_HAS_POSIX_SEM)
+ // Linux NPTL may not define the right POSIX macro
+ // but they have the actual runtime support for this stuff
+# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && (((_POSIX_C_SOURCE - 0) >= 200112L) || (_XOPEN_SOURCE >= 600))
+# define ACE_HAS_POSIX_SEM_TIMEOUT
+# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT && (((_POSIX_C_SOURCE - 0) >= 200112L) || (_XOPEN_SOURCE >= 600)) */
+# endif /* ACE_HAS_POSIX_SEM */
+#endif /* !ACE_LACKS_LINUX_NPTL */
+
+// AIO support pulls in the rt library, which pulls in the pthread
+// library. Disable AIO in single-threaded builds.
+#if defined (ACE_HAS_THREADS)
+# define ACE_HAS_CLOCK_GETTIME
+# define ACE_HAS_CLOCK_SETTIME
#else
-# define ACE_HAS_RECURSIVE_MUTEXES
-#endif /* !ACE_HAS_PTHREADS_UNIX98_EXT */
+# undef ACE_HAS_AIO_CALLS
+#endif
+
+// First the machine specific part
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE // jcej 12/22/96 #2
+#if defined (__powerpc__) || defined (__x86_64__)
+# if !defined (ACE_DEFAULT_BASE_ADDR)
+# define ACE_DEFAULT_BASE_ADDR ((char *) 0x40000000)
+# endif /* ! ACE_DEFAULT_BASE_ADDR */
+#elif defined (__ia64)
+# if !defined (ACE_DEFAULT_BASE_ADDR)
+// Zero base address should work fine for Linux of IA-64: it just lets
+// the kernel to choose the right value.
+# define ACE_DEFAULT_BASE_ADDR ((char *) 0x0000000000000000)
+# endif /* ! ACE_DEFAULT_BASE_ADDR */
+#endif /* ! __powerpc__ && ! __ia64 */
-#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS // JCEJ 1/7-8/96
+// Then glibc/libc5 specific parts
#if defined(__GLIBC__)
-// Platform supports reentrant functions (i.e., all the POSIX *_r
-// functions).
-#define ACE_HAS_REENTRANT_FUNCTIONS
+# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 3)
+# define ACE_HAS_RUSAGE_WHO_ENUM enum __rusage_who
+# define ACE_HAS_RLIMIT_RESOURCE_ENUM enum __rlimit_resource
+# define ACE_LACKS_ISCTYPE
+# endif
+# define ACE_HAS_SOCKLEN_T
+# define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
- // Older versions of glibc lacked reentrant netdb functions
-# define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
+ // glibc defines both of these, used in OS_String.
+# if defined (_GNU_SOURCE)
+# define ACE_HAS_STRNLEN
+# define ACE_HAS_WCSNLEN
- // glibc < 2.1 lacks pthread_attr_setstacksize()
-# define ACE_LACKS_PTHREAD_ATTR_SETSTACKSIZE
-#endif /* (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) */
+ // This is probably not a 100%-sure-fire check... Red Hat Linux 9
+ // and Enterprise Linux 3 and up have a new kernel that can send signals
+ // across threads. This was not possible prior because there was no real
+ // difference between a process and a thread. With this, the
+ // ACE_POSIX_SIG_Proactor is the only chance of getting asynch I/O working.
+ // There are restrictions, such as all socket operations being silently
+ // converted to synchronous by the kernel, that make aio a non-starter
+ // for most Linux platforms at this time. But we'll start to crawl...
+# define ACE_POSIX_SIG_PROACTOR
+# endif
-// uses ctime_r & asctime_r with only two parameters vs. three
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+ // To avoid the strangeness with Linux's ::select (), which modifies
+ // its timeout argument, use ::poll () instead.
+# define ACE_HAS_POLL
+
+# define ACE_HAS_SIGINFO_T
+# define ACE_LACKS_SIGINFO_H
+# define ACE_HAS_UCONTEXT_T
+# define ACE_HAS_SIGTIMEDWAIT
+
+#else /* ! __GLIBC__ */
+ // Fixes a problem with some non-glibc versions of Linux...
+# define ACE_LACKS_MADVISE
+# define ACE_LACKS_MSG_ACCRIGHTS
+#endif /* ! __GLIBC__ */
+
+#define ACE_HAS_LSEEK64
+//#define ACE_LACKS_LSEEK64_PROTOTYPE
+
+#define ACE_HAS_P_READ_WRITE
+// Use ACE's alternate cuserid() implementation since the use of the
+// system cuserid() is discouraged.
+#define ACE_HAS_ALT_CUSERID
+
+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+# define ACE_HAS_ISASTREAM_PROTOTYPE
+# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE
+# define ACE_HAS_CPU_SET_T
+#endif /* __GLIBC__ > 2 || __GLIBC__ === 2 && __GLIBC_MINOR__ >= 3) */
+
+// Then the compiler specific parts
+
+#if defined (__INTEL_COMPILER)
+# include "ace/config-icc-common.h"
+#elif defined (__GNUG__)
+ // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so
+ // this must appear before its #include.
+# define ACE_HAS_STRING_CLASS
+# include "ace/config-g++-common.h"
+# ifdef __clang__
+# undef ACE_HAS_GCC_ATOMIC_BUILTINS
+# endif
+#elif defined (__SUNCC_PRO) || defined (__SUNPRO_CC)
+# include "ace/config-suncc-common.h"
+#elif defined (__PGI)
+// Portable group compiler
+# define ACE_HAS_CPLUSPLUS_HEADERS
+# define ACE_HAS_STDCPP_STL_INCLUDES
+# define ACE_HAS_STANDARD_CPP_LIBRARY 1
+# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
+# define ACE_LACKS_SWAB
+#elif defined (__GNUC__)
+/**
+ * GNU C compiler.
+ *
+ * We need to recognize the GNU C compiler since TAO has at least one
+ * C source header and file
+ * (TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.{h,c}) that may indirectly
+ * include this
+ */
+#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && && !__PGI */
+# ifdef __cplusplus /* Let it slide for C compilers. */
+# error unsupported compiler in ace/config-linux.h
+# endif /* __cplusplus */
+#endif /* ! __GNUG__*/
+
+// Completely common part :-)
+
+// Platform/compiler has the sigwait(2) prototype
+#define ACE_HAS_SIGWAIT
+
+#define ACE_HAS_SIGSUSPEND
+
+#define ACE_HAS_UALARM
+
+#define ACE_HAS_STRSIGNAL
+
+#ifndef ACE_HAS_POSIX_REALTIME_SIGNALS
+# define ACE_HAS_POSIX_REALTIME_SIGNALS
+#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */
+
+#define ACE_HAS_XPG4_MULTIBYTE_CHAR
+#define ACE_HAS_VFWPRINTF
+
+#define ACE_LACKS_ITOW
+#define ACE_LACKS_WCSICMP
+#define ACE_LACKS_WCSNICMP
+#define ACE_LACKS_ISWASCII
+
+#define ACE_HAS_3_PARAM_WCSTOK
+
+#define ACE_HAS_3_PARAM_READDIR_R
+
+#if !defined (ACE_DEFAULT_BASE_ADDR)
+# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
+#endif /* ! ACE_DEFAULT_BASE_ADDR */
+
+#define ACE_HAS_ALLOCA
+
+// Compiler/platform has <alloca.h>
+#define ACE_HAS_ALLOCA_H
+#define ACE_HAS_SYS_SYSINFO_H
+#define ACE_HAS_LINUX_SYSINFO
+
+// Compiler/platform has the getrusage() system call.
+#define ACE_HAS_GETRUSAGE
+#define ACE_HAS_GETRUSAGE_PROTOTYPE
+
+#define ACE_HAS_BYTESWAP_H
+#define ACE_HAS_BSWAP_16
+#define ACE_HAS_BSWAP_32
+
+#if defined (__GNUC__)
+# define ACE_HAS_BSWAP_64
+#endif
+
+#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
+
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
+// ONLY define this if you have config'd multicast into a 2.0.34 or
+// prior kernel. It is enabled by default in 2.0.35 kernels.
+#if !defined (ACE_HAS_IP_MULTICAST)
+# define ACE_HAS_IP_MULTICAST
+#endif /* ! ACE_HAS_IP_MULTICAST */
+
+// At least for IPv4, Linux lacks perfect filtering.
+#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING
+# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1
+#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */
+
+#define ACE_HAS_BIG_FD_SET
+
+// Linux defines struct msghdr in /usr/include/socket.h
+#define ACE_HAS_MSG
+
+// Linux "improved" the interface to select() so that it modifies
+// the struct timeval to reflect the amount of time not slept
+// (see NOTES in Linux's select(2) man page).
+#define ACE_HAS_NONCONST_SELECT_TIMEVAL
+
+#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535
+
+#define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1
+
+#define ACE_HAS_GETPAGESIZE 1
+
+// Platform defines struct timespec but not timespec_t
+#define ACE_LACKS_TIMESPEC_T
+
+// Platform supplies scandir()
+#define ACE_HAS_SCANDIR
+#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10)
+// Although the scandir man page says otherwise, this setting is correct.
+// The setting was fixed in 2.10, so do not use the hack after that.
+#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
+#endif
+
+// A conflict appears when including both <ucontext.h> and
+// <sys/procfs.h> with recent glibc headers.
+//#define ACE_HAS_PROC_FS
+
+// Platform supports System V IPC (most versions of UNIX, but not Win32)
+#define ACE_HAS_SYSV_IPC
+
+// Compiler/platform contains the <sys/syscall.h> file.
+#define ACE_HAS_SYS_SYSCALL_H
+
+// Platform/compiler supports global timezone variable.
+#define ACE_HAS_TIMEZONE
+
+#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
+
+// Compiler supports the ssize_t typedef.
+#define ACE_HAS_SSIZE_T
+
+// Compiler/platform defines the sig_atomic_t typedef.
+#define ACE_HAS_SIG_ATOMIC_T
+
+// Compiler/platform defines a union semun for SysV shared memory.
+#define ACE_HAS_SEMUN
+
+#define ACE_HAS_POSIX_TIME
+
+#define ACE_HAS_GPERF
+
+#define ACE_HAS_DIRENT
+
+// Starting with FC9 rawhide this file is not available anymore but
+// this define is set
+#if defined _XOPEN_STREAMS && _XOPEN_STREAMS == -1
+# define ACE_LACKS_STROPTS_H
+# define ACE_LACKS_STRRECVFD
+#endif
+
+#if !defined (ACE_LACKS_STROPTS_H)
+# define ACE_HAS_STRBUF_T
+#endif
+
+#if defined (__ia64) || defined(__alpha) || defined (__x86_64__) || defined(__powerpc64__)
+// On 64 bit platforms, the "long" type is 64-bits. Override the
+// default 32-bit platform-specific format specifiers appropriately.
+# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%lu"
+# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld"
+# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu"
+#endif /* __ia64 */
+
+#define ACE_SIZEOF_WCHAR 4
+
+#if defined (__powerpc__) && !defined (ACE_SIZEOF_LONG_DOUBLE)
+// 32bit PowerPC Linux uses 128bit long double
+# define ACE_SIZEOF_LONG_DOUBLE 16
#endif
+#define ACE_LACKS_GETIPNODEBYADDR
+#define ACE_LACKS_GETIPNODEBYNAME
+
+// Platform has POSIX terminal interface.
+#define ACE_HAS_TERMIOS
+
+// Linux implements sendfile().
+#define ACE_HAS_SENDFILE 1
+
+#define ACE_HAS_VOIDPTR_MMAP
+
+#define ACE_HAS_ICMP_SUPPORT 1
+
+#define ACE_HAS_VASPRINTF
+
+// According to man pages Linux uses different (compared to UNIX systems) types
+// for setting IP_MULTICAST_TTL and IPV6_MULTICAST_LOOP / IP_MULTICAST_LOOP
+// in setsockopt/getsockopt.
+// In the current (circa 2012) kernel source however there is an explicit check
+// for IPV6_MULTICAST_LOOP being sizeof(int). Anything else is rejected so it must
+// not be a passed a bool, irrespective of what the man pages (still) say.
+// i.e. #define ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL 1 is wrong
+#define ACE_HAS_IP_MULTICAST_TTL_AS_INT 1
+#define ACE_HAS_IP_MULTICAST_LOOP_AS_INT 1
+
+#if defined (ACE_LACKS_NETWORKING)
+# include "ace/config-posix-nonetworking.h"
#else
-// AIO support pulls in the rt library, which pulls in the pthread
-// library. Disable AIO in single-threaded builds.
-# undef ACE_HAS_AIO_CALLS
-#endif /* ACE_MT_SAFE */
+# define ACE_HAS_NETLINK
+# define ACE_HAS_GETIFADDRS
+#endif
+
+#if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO)
+// Detect if getsockname() and getpeername() returns random values in
+// the sockaddr_in::sin_zero field by evaluation of the kernel
+// version. Since version 2.5.47 this problem is fixed.
+# if !defined (ACE_LACKS_LINUX_VERSION_H)
+# include <linux/version.h>
+# endif /* !ACE_LACKS_LINUX_VERSION_H */
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47))
+# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 0
+# else
+# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 1
+# endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,47)) */
+#endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */
+
+#if !defined (ACE_HAS_EVENT_POLL) && !defined (ACE_HAS_DEV_POLL)
+# if !defined (ACE_LACKS_LINUX_VERSION_H)
+# include <linux/version.h>
+# endif /* !ACE_LACKS_LINUX_VERSION_H */
+# if (LINUX_VERSION_CODE > KERNEL_VERSION (2,6,0))
+# define ACE_HAS_EVENT_POLL
+# endif
+#endif
+
+// This is ghastly, but as long as there are platforms supported
+// which define the right POSIX macros but lack actual support
+// we have no choice.
+// RHEL4 fails (2.6.9) while RHEL5 works (2.6.18)
+#if !defined (ACE_LACKS_CONDATTR_SETCLOCK)
+# if !defined (ACE_LACKS_LINUX_VERSION_H)
+# include <linux/version.h>
+# endif /* !ACE_LACKS_LINUX_VERSION_H */
+# if (LINUX_VERSION_CODE < KERNEL_VERSION (2,6,18))
+# define ACE_LACKS_CONDATTR_SETCLOCK
+# endif
+#endif
+
+#define ACE_HAS_SVR4_DYNAMIC_LINKING
+#define ACE_HAS_AUTOMATIC_INIT_FINI
+#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE
+#define ACE_HAS_RECURSIVE_MUTEXES
+#define ACE_HAS_THREAD_SPECIFIC_STORAGE
+#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS
+#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+#define ACE_HAS_REENTRANT_FUNCTIONS
+
+// To support UCLIBC
+#if defined (__UCLIBC__)
+
+# define ACE_LACKS_STROPTS_H
+# define ACE_LACKS_GETLOADAVG
+# define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
+# define ACE_LACKS_PTHREAD_SETSTACK
+# define ACE_LACKS_STRRECVFD
+# define ACE_HAS_CPU_SET_T
+
+# if defined (ACE_HAS_STRBUF_T)
+# undef ACE_HAS_STRBUF_T
+# endif /* ACE_HAS_STRBUF_T */
+
+# if defined (ACE_HAS_PTHREAD_SETSTACK)
+# undef ACE_HAS_PTHREAD_SETSTACK
+# endif /* ACE_HAS_PTHREAD_SETSTACK */
+
+# if defined (ACE_HAS_AIO_CALLS)
+# undef ACE_HAS_AIO_CALLS
+# endif /* ACE_HAS_AIO_CALLS */
+
+# if defined (ACE_HAS_GETIFADDRS)
+# undef ACE_HAS_GETIFADDRS
+# endif /* ACE_HAS_GETIFADDRS */
+
+# if defined (ACE_SCANDIR_CMP_USES_VOIDPTR)
+# undef ACE_SCANDIR_CMP_USES_VOIDPTR
+# endif /* ACE_SCANDIR_CMP_USES_VOIDPTR */
+
+# if defined (ACE_SCANDIR_CMP_USES_CONST_VOIDPTR)
+# undef ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
+# endif /* ACE_SCANDIR_CMP_USES_CONST_VOIDPTR */
+
+# if defined (ACE_HAS_EXECINFO_H)
+# undef ACE_HAS_EXECINFO_H
+# endif /* ACE_HAS_EXECINFO_H */
+
+# if defined(__GLIBC__)
+# undef __GLIBC__
+# endif /* __GLIBC__ */
+
+# if defined(ACE_HAS_SEMUN)
+# undef ACE_HAS_SEMUN
+# endif /* ACE_HAS_SEMUN */
+
+#endif /* __UCLIBC__ */
#include /**/ "ace/post.h"
diff --git a/dep/acelite/ace/config-lite.h b/dep/acelite/ace/config-lite.h
index 1a6937c851b..7c0fab03e75 100644
--- a/dep/acelite/ace/config-lite.h
+++ b/dep/acelite/ace/config-lite.h
@@ -4,7 +4,7 @@
/**
* @file config-lite.h
*
- * $Id: config-lite.h 85832 2009-06-28 16:14:59Z johnnyw $
+ * $Id: config-lite.h 95867 2012-06-11 21:46:38Z mitza $
*
* @author (Originally in OS.h)Doug Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -27,12 +27,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-// Empty ACE_OS namespace to help identify compiler errors more
-// easily. -- @@ Do we really need this?
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-namespace ACE_OS {}
-ACE_END_VERSIONED_NAMESPACE_DECL
-
// ============================================================================
// UNICODE macros (to be added later)
// ============================================================================
@@ -122,13 +116,13 @@ ACE_END_VERSIONED_NAMESPACE_DECL
// Once all C++ compilers support the standard reverse_iterator
// adapters, we can drop this generator macro or at least drop the
// MSVC++ or Sun Studio preprocessor conditional blocks.
-#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5100 \
+#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5120 \
&& !defined (_STLPORT_VERSION)
// If we're not using the stlport4 C++ library (which has standard
// iterators), we need to ensure this is included in order to test
// the _RWSTD_NO_CLASS_PARTIAL_SPEC feature test macro below.
# include <Cstd/stdcomp.h>
-#endif /* __SUNPRO_CC <= 0x5100 */
+#endif /* __SUNPRO_CC <= 0x5110 */
#if (defined (_MSC_VER) && (_MSC_VER <= 1310) && defined (_WIN64)) \
|| defined (ACE_HAS_BROKEN_STD_REVERSE_ITERATOR)
// VC 7.1 and the latest 64-bit platform SDK still don't define a standard
@@ -137,7 +131,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL
typedef std::reverse_iterator<iterator, value_type> reverse_iterator; \
typedef std::reverse_iterator<const_iterator, \
value_type const> const_reverse_iterator;
-#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5100 \
+#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5120 \
&& defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
# define ACE_DECLARE_STL_REVERSE_ITERATORS \
typedef std::reverse_iterator<iterator, \
diff --git a/dep/acelite/ace/config-lynxos.h b/dep/acelite/ace/config-lynxos.h
index cd217465685..e0d5f4d1cf5 100644
--- a/dep/acelite/ace/config-lynxos.h
+++ b/dep/acelite/ace/config-lynxos.h
@@ -1,4 +1,4 @@
-// $Id: config-lynxos.h 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: config-lynxos.h 94274 2011-06-29 07:59:12Z mcorino $
// The following configuration file is designed to work for LynxOS,
// version 4.0.0 and later, using the GNU g++ compiler.
@@ -14,29 +14,23 @@
#include <param.h>
#undef __FREEBSDCODE__
-#if ! defined (__ACE_INLINE__)
-# define __ACE_INLINE__
-#endif /* ! __ACE_INLINE__ */
-
-#if defined (__GNUG__)
-# include "ace/config-g++-common.h"
-#endif /* __GNUG__ */
+#include "ace/config-g++-common.h"
// Compile using multi-thread libraries.
#if !defined (ACE_MT_SAFE)
-# define ACE_MT_SAFE 1
+# define ACE_MT_SAFE 1
#endif
#include "ace/config-posix.h"
#if defined (__x86__)
-# define ACE_HAS_PENTIUM
+# define ACE_HAS_PENTIUM
#elif defined (__powerpc__)
- // It looks like the default stack size is 15000.
- // ACE's Recursive_Mutex_Test needs more.
-# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536
- // This doesn't work on LynxOS 3.0.0, because it resets the TimeBaseRegister.
- // # define ACE_HAS_POWERPC_TIMER
+ // It looks like the default stack size is 15000.
+ // ACE's Recursive_Mutex_Test needs more.
+# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536
+ // This doesn't work on LynxOS 3.0.0, because it resets the TimeBaseRegister.
+ // # define ACE_HAS_POWERPC_TIMER
#endif /* __x86__ || __powerpc__ */
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
@@ -72,10 +66,14 @@
#define ACE_HAS_NONCONST_SELECT_TIMEVAL
#define ACE_HAS_NONCONST_SETRLIMIT
#define ACE_HAS_NONCONST_WRITEV
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
#define ACE_HAS_POSIX_NONBLOCK
#define ACE_HAS_POSIX_TIME
+#define ACE_HAS_PTHREADS_UNIX98_EXT
+#define ACE_HAS_PTHREAD_GETCONCURRENCY
+#define ACE_HAS_PTHREAD_SETCONCURRENCY
+#define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE
#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS
+#define ACE_HAS_REENTRANT_FUNCTIONS
#define ACE_HAS_SCANDIR
#define ACE_HAS_SIGACTION_CONSTP2
#define ACE_HAS_SIGINFO_T
@@ -96,28 +94,21 @@
#define ACE_HAS_SYS_FILIO_H
#define ACE_HAS_SYS_SOCKIO_H
#define ACE_HAS_TERMIOS
+#define ACE_HAS_THREAD_SPECIFIC_STORAGE
#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
#define ACE_LACKS_ALPHASORT_PROTOTYPE
-#define ACE_LACKS_CONST_TIMESPEC_PTR
-#define ACE_LACKS_GETPGID
#define ACE_LACKS_ISCTYPE
#define ACE_LACKS_MADVISE
-#define ACE_LACKS_MKSTEMP_PROTOTYPE
-#define ACE_LACKS_MKTEMP_PROTOTYPE
-#define ACE_LACKS_PUTENV_PROTOTYPE
+#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
#define ACE_LACKS_REALPATH
-#define ACE_LACKS_RLIMIT_NOFILE
-#define ACE_LACKS_RWLOCK_T
#define ACE_LACKS_SCANDIR_PROTOTYPE
-#define ACE_LACKS_SETEGID
-#define ACE_LACKS_SETEUID
#define ACE_LACKS_SIGINFO_H
#define ACE_LACKS_STRPTIME
-#define ACE_LACKS_SWAB_PROTOTYPE
+#define ACE_LACKS_SUSECONDS_T
#define ACE_LACKS_TIMESPEC_T
#define ACE_LACKS_UCONTEXT_H
-#define ACE_LACKS_SUSECONDS_T
+#define ACE_LACKS_STD_WSTRING
#define ACE_DEFAULT_BASE_ADDR ((char *) 0)
#define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS
@@ -129,66 +120,68 @@
// LynxOS has poll.h but it is unusable since implementation is not provided
#define ACE_LACKS_POLL_H
-#if ACE_MT_SAFE == 1
- // Platform supports threads.
-# define ACE_HAS_PTHREADS
-# define ACE_HAS_PTHREADS_STD
-# define ACE_HAS_PTHREADS_UNIX98_EXT
-# define ACE_HAS_PTHREAD_GETCONCURRENCY
-# define ACE_HAS_PTHREAD_SETCONCURRENCY
-# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE
-# define ACE_HAS_THREAD_SPECIFIC_STORAGE
-# define ACE_LACKS_PTHREAD_ATTR_SETSTACK
-# define ACE_LACKS_THREAD_PROCESS_SCOPING
-# if ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR == 0
-# define ACE_LACKS_SETDETACH
-# define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR
-# endif
-#endif /* ACE_MT_SAFE */
+#if defined (ACE_HAS_SVR4_DYNAMIC_LINKING)
+# define ACE_HAS_BROKEN_THREAD_KEYFREE
+#endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */
#if ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR == 0
-# define ACE_LACKS_GETOPT_PROTOTYPE
-# define ACE_LACKS_INET_ATON_PROTOTYPE
-# define ACE_LACKS_REGEX_H
-# define ACE_LACKS_STRCASECMP_PROTOTYPE
-# define ACE_LACKS_STRNCASECMP_PROTOTYPE
-# define ACE_LACKS_SYS_SELECT_H
+// LynxOS 4.0
+# define ACE_LACKS_GETOPT_PROTOTYPE
+# define ACE_LACKS_INET_ATON_PROTOTYPE
+# define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR
+# define ACE_LACKS_REGEX_H
+# define ACE_LACKS_RWLOCK_T
+# define ACE_LACKS_SETDETACH
+# define ACE_LACKS_STRCASECMP_PROTOTYPE
+# define ACE_LACKS_STRNCASECMP_PROTOTYPE
+# define ACE_LACKS_SYS_SELECT_H
+# define ACE_LACKS_THREAD_PROCESS_SCOPING
#endif
#if (ACE_LYNXOS_MAJOR > 4) || (ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR >= 2)
-// LynxOS 4.2 additons
-# define ACE_HAS_POSIX_SEM_TIMEOUT
-# define ACE_HAS_MUTEX_TIMEOUTS
+// LynxOS 4.2 and 5.0
+# define ACE_HAS_POSIX_SEM_TIMEOUT
+# define ACE_HAS_MUTEX_TIMEOUTS
#endif
-#if (ACE_LYNXOS_MAJOR >=5)
-// LynxOS 5.0 Additons
-# define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-# define ACE_HAS_NONCONST_INET_ADDR
-# define ACE_LACKS_INET_ATON_PROTOTYPE
-# define ACE_LACKS_SEMBUF_T
-# define ACE_LACKS_STROPTS_H
-# define ACE_LACKS_STRRECVFD
-# define ACE_LACKS_SYS_SEM_H
-# define ACE_SYS_SIGLIST __sys_siglist
-#else
-// LynxOS 5.0 Removals
+#if (ACE_LYNXOS_MAJOR < 5)
+// LynxOS 4.x
+# define ACE_HAS_LYNXOS4_GETPWNAM_R
# define ACE_HAS_LYNXOS4_SIGNALS
# define ACE_HAS_SEMUN
# define ACE_HAS_STRBUF_T
# define ACE_HAS_SYSV_IPC
+# define ACE_LACKS_CONST_TIMESPEC_PTR
+# define ACE_LACKS_GETPGID
# define ACE_LACKS_ISBLANK
+# define ACE_LACKS_MKSTEMP_PROTOTYPE
+# define ACE_LACKS_MKTEMP_PROTOTYPE
+# define ACE_LACKS_PTHREAD_ATTR_SETSTACK
+# define ACE_LACKS_PUTENV_PROTOTYPE
+# define ACE_LACKS_SETEGID
# define ACE_LACKS_SETENV
+# define ACE_LACKS_SETEUID
+# define ACE_LACKS_SWAB_PROTOTYPE
# define ACE_LACKS_UNSETENV
# define ACE_LACKS_USECONDS_T
# define ACE_LACKS_VSNPRINTF
# define ACE_LACKS_WCHAR_H
# define ACE_SYS_SIGLIST sys_siglist
+# if !defined (ACE_HAS_THREADS)
+# undef ACE_HAS_AIO_CALLS
+# endif
+#else
+// LynxOS 5.0
+# define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
+# define ACE_HAS_NONCONST_INET_ADDR
+# define ACE_LACKS_INET_ATON_PROTOTYPE
+# define ACE_LACKS_SEMBUF_T
+# define ACE_LACKS_STROPTS_H
+# define ACE_LACKS_STRRECVFD
+# define ACE_LACKS_SYS_SEM_H
+# define ACE_SYS_SIGLIST __sys_siglist
#endif
-#if defined (ACE_HAS_SVR4_DYNAMIC_LINKING)
-# define ACE_HAS_BROKEN_THREAD_KEYFREE
-#endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */
-
#include /**/ "ace/post.h"
+
#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-macosx-iphone-hardware.h b/dep/acelite/ace/config-macosx-iOS-hardware.h
index 6201d8e824b..927dacd74b1 100644
--- a/dep/acelite/ace/config-macosx-iphone-hardware.h
+++ b/dep/acelite/ace/config-macosx-iOS-hardware.h
@@ -1,15 +1,15 @@
-// $Id: config-macosx-iphone-hardware.h 88739 2010-01-27 05:35:23Z sowayaa $
+// $Id: config-macosx-iOS-hardware.h 95319 2011-12-13 14:54:44Z mhengstmengel $
#ifndef ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H
#define ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H
#define ACE_HAS_IPHONE
#define ACE_SIZEOF_LONG_DOUBLE 8
-#include "ace/config-macosx-snowleopard.h"
+#include "ace/config-macosx-lion.h"
#ifdef ACE_HAS_SYSV_IPC
#undef ACE_HAS_SYSV_IPC
#endif
-#endif ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H
+#endif /* ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H */
diff --git a/dep/acelite/ace/config-macosx-iOS-simulator.h b/dep/acelite/ace/config-macosx-iOS-simulator.h
new file mode 100644
index 00000000000..73d7e90a17e
--- /dev/null
+++ b/dep/acelite/ace/config-macosx-iOS-simulator.h
@@ -0,0 +1,9 @@
+// $Id: config-macosx-iOS-simulator.h 94431 2011-08-31 11:36:49Z sowayaa $
+#ifndef ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H
+#define ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H
+
+#define ACE_HAS_IPHONE
+#include "ace/config-macosx-lion.h"
+
+#endif /* ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H */
+
diff --git a/dep/acelite/ace/config-macosx-iphone-simulator.h b/dep/acelite/ace/config-macosx-iphone-simulator.h
deleted file mode 100644
index 024cf8480a3..00000000000
--- a/dep/acelite/ace/config-macosx-iphone-simulator.h
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id: config-macosx-iphone-simulator.h 88653 2010-01-21 23:19:50Z sowayaa $
-#ifndef ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H
-#define ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H
-
-#define ACE_HAS_IPHONE
-#include "ace/config-macosx-snowleopard.h"
-
-#endif ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H
-
diff --git a/dep/acelite/ace/config-macosx-leopard.h b/dep/acelite/ace/config-macosx-leopard.h
index 5fb28c338f3..42229ebd2d4 100644
--- a/dep/acelite/ace/config-macosx-leopard.h
+++ b/dep/acelite/ace/config-macosx-leopard.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-macosx-leopard.h 91688 2010-09-09 11:21:50Z johnnyw $
+// $Id: config-macosx-leopard.h 96085 2012-08-21 02:48:37Z mesnier_p $
// This configuration file is designed to work with the MacOS X operating system.
@@ -176,7 +176,6 @@
# define ACE_HAS_THREADS
// And they're even POSIX pthreads
# define ACE_HAS_PTHREADS
-# define ACE_HAS_PTHREADS_STD
# define ACE_HAS_PTHREAD_SCHEDPARAM
# define ACE_HAS_THREAD_SPECIFIC_STORAGE
#endif /* ACE_MT_SAFE == 1 */
@@ -205,6 +204,7 @@
#define ACE_HAS_VOID_UNSETENV
#endif
+#define ACE_LACKS_CONDATTR_SETCLOCK
// dlcompat package (not part of base Darwin) is needed for dlopen().
// You may download directly from sourceforge and install or use fink
diff --git a/dep/acelite/ace/config-macosx-lion.h b/dep/acelite/ace/config-macosx-lion.h
new file mode 100644
index 00000000000..e4a56ae4ebc
--- /dev/null
+++ b/dep/acelite/ace/config-macosx-lion.h
@@ -0,0 +1,19 @@
+// $Id: config-macosx-lion.h 94764 2011-10-15 01:02:57Z sowayaa $
+#ifndef ACE_CONFIG_MACOSX_LION_H
+#define ACE_CONFIG_MACOSX_LION_H
+
+
+#include "ace/config-macosx-leopard.h"
+
+#ifdef __clang__
+#ifdef ACE_HAS_GCC_ATOMIC_BUILTINS
+#undef ACE_HAS_GCC_ATOMIC_BUILTINS
+#endif
+
+#define ACE_ANY_OPS_USE_NAMESPACE
+
+#endif
+
+#define ACE_LACKS_UCONTEXT_H
+
+#endif // ACE_CONFIG_MACOSX_LION_H
diff --git a/dep/acelite/ace/config-macosx.h b/dep/acelite/ace/config-macosx.h
index 12b69de3b72..e39e27e0e73 100644
--- a/dep/acelite/ace/config-macosx.h
+++ b/dep/acelite/ace/config-macosx.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-macosx.h 91693 2010-09-09 12:57:54Z johnnyw $
+// $Id: config-macosx.h 93359 2011-02-11 11:33:12Z mcorino $
// This configuration file is designed to work with the MacOS X operating system, version 10.2 (Jaguar).
@@ -51,6 +51,8 @@
#define ACE_LACKS_GETPGID
#define ACE_LACKS_RWLOCK_T
+#define ACE_HAS_SIOCGIFCONF
+
// Optimize ACE_Handle_Set for select().
#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
diff --git a/dep/acelite/ace/config-macros.h b/dep/acelite/ace/config-macros.h
index d81156e9480..32e58947e9a 100644
--- a/dep/acelite/ace/config-macros.h
+++ b/dep/acelite/ace/config-macros.h
@@ -4,7 +4,7 @@
/**
* @file config-macros.h
*
- * $Id: config-macros.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: config-macros.h 94386 2011-08-10 12:42:53Z johnnyw $
*
* @author (Originally in OS.h)Doug Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -69,9 +69,6 @@
# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
# define ACE_MT(X) X
-# if !defined (_REENTRANT)
-# define _REENTRANT
-# endif /* _REENTRANT */
# else
# define ACE_MT(X)
# endif /* ACE_MT_SAFE */
@@ -82,6 +79,7 @@
# if defined (ACE_HAS_VALGRIND)
# define ACE_INITIALIZE_MEMORY_BEFORE_USE
+# define ACE_LACKS_DLCLOSE
# endif /* ACE_HAS_VALGRIND */
// =========================================================================
@@ -499,8 +497,16 @@ extern "C" u_long CLS##_Export _get_dll_unload_policy (void) \
#define ACE_HAS_TEMPLATE_TYPEDEFS
#endif
+#ifndef ACE_GCC_FORMAT_ATTRIBUTE
+# define ACE_GCC_FORMAT_ATTRIBUTE(TYPE, STR_INDEX, FIRST_INDEX)
+#endif
+
#ifndef ACE_DEPRECATED
# define ACE_DEPRECATED
#endif
+#ifndef ACE_HAS_REACTOR_NOTIFICATION_QUEUE
+# define ACE_HAS_REACTOR_NOTIFICATION_QUEUE
+#endif
+
#endif /* ACE_CONFIG_MACROS_H */
diff --git a/dep/acelite/ace/config-minimal.h b/dep/acelite/ace/config-minimal.h
deleted file mode 100644
index 4cf2e8a487b..00000000000
--- a/dep/acelite/ace/config-minimal.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-minimal.h 80826 2008-03-04 14:51:23Z wotte $
-
-// This configuration file is designed to build only the minimal
-// ACE_OS adaptation layer.
-
-#ifndef ACE_CONFIG_MINIMAL_H
-#define ACE_CONFIG_MINIMAL_H
-#include /**/ "ace/pre.h"
-
-#define ACE_HAS_MINIMAL_ACE_OS
-
-// Only instantiate the ACE_OS_Object_Manager.
-#define ACE_MAIN_OBJECT_MANAGER \
- ACE_OS_Object_Manager ace_os_object_manager;
-
-#if !defined(ACE_USE_THREAD_MANAGER_ADAPTER)
- // To prevent use of ACE_Thread_Exit functions in
- // ACE_Thread_Adapter::invoke ().
-# define ACE_USE_THREAD_MANAGER_ADAPTER
-#endif /* ! ACE_USE_THREAD_MANAGER_ADAPTER */
-
-#if defined (ACE_ASSERT)
-# undef ACE_ASSERT
-#endif /* ACE_ASSERT */
-#define ACE_ASSERT(x)
-
-#if defined (ACE_DEBUG)
-# undef ACE_DEBUG
-#endif /* ACE_DEBUG */
-#define ACE_DEBUG(x)
-
-#if defined (ACE_ERROR)
-# undef ACE_ERROR
-#endif /* ACE_ERROR */
-#define ACE_ERROR(x)
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_MINIMAL_H */
diff --git a/dep/acelite/ace/config-mvs.h b/dep/acelite/ace/config-mvs.h
deleted file mode 100644
index ce2971025a0..00000000000
--- a/dep/acelite/ace/config-mvs.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-mvs.h 92102 2010-09-30 08:14:15Z johnnyw $
-
-// Config file for MVS with OpenEdition
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-#include /**/ "ace/pre.h"
-
-// The following #defines are hacks to get around things
-// that seem to be missing or different in MVS land
-#define MAXPATHLEN 1024 /* sys/param.h not on MVS */
-#define NSIG 44 /* missing from Signal.h */
-#define MAXHOSTNAMELEN 256 /* missing form netdb.h */
-#define howmany __howmany /* MVS uses different names than most others */
-#define MAXNAMLEN __DIR_NAME_MAX
-#if defined (log) /* log is a macro in math.h */
-# undef log /* conflicts with log function in ACE */
-#endif /* log */
-
-#define ACE_MVS
-
-// Preprocesor requires an extra argument
-#define ACE_CC_PREPROCESSOR_ARGS "-+ -E"
-
-// See the README file in this directory
-// for a description of the following ACE_ macros
-
-#if __COMPILER_VER__ >= 0x21020000 /* OS/390 r2 or higher */
-# define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-# define ACE_HAS_UCONTEXT_T
-#else /* __COMPILER_VER__ < 0x21020000 */
-# define ACE_LACKS_UCONTEXT_H
-#endif /* __COMPILER_VER__ < 0x21020000 */
-
-#if __COMPILER_VER__ < 0x22060000 /* before OS/390 r2.6 */
-# define ACE_LACKS_LONGLONG_T
-#endif /* __COMPILER_VER__ < 0x22060000 */
-
-#define ERRMAX __sys_nerr
-
-#define ACE_HAS_3_PARAM_WCSTOK
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-#define ACE_HAS_CPLUSPLUS_HEADERS
-#define ACE_HAS_DIRENT
-#define ACE_HAS_GETPAGESIZE
-#define ACE_HAS_GETRUSAGE
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-#define ACE_HAS_LIMITED_RUSAGE_T
-#define ACE_HAS_MSG
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_HAS_NONSCALAR_THREAD_KEY_T
-#define ACE_HAS_POLL
-#define ACE_HAS_POSIX_NONBLOCK
-#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PTHREADS
-#define ACE_HAS_PTHREAD_CONDATTR_SETKIND_NP
-#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP
-#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_SIGWAIT
-#define ACE_HAS_SIG_ATOMIC_T
-#define ACE_HAS_SIG_C_FUNC
-#define ACE_HAS_SOCKADDR_IN_SIN_LEN
-#define ACE_HAS_SIZET_SOCKET_LEN
-#define ACE_HAS_SSIZE_T
-#define ACE_HAS_STRBUF_T
-#define ACE_HAS_STRINGS
-#define ACE_HAS_SYSV_IPC
-#define ACE_HAS_THREADS
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-#define ACE_HAS_THR_C_DEST
-#define ACE_HAS_THR_C_FUNC
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-#define ACE_HAS_UALARM
-#define ACE_HAS_UTIME
-#define ACE_HAS_VOIDPTR_MMAP
-#define ACE_HAS_VOIDPTR_SOCKOPT
-#define ACE_HAS_XPG4_MULTIBYTE_CHAR
-
-#define ACE_LACKS_CONDATTR_PSHARED
-#define ACE_LACKS_INET_ATON
-#define ACE_LACKS_MUTEXATTR_PSHARED
-#define ACE_LACKS_IOSTREAM_FX
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-#define ACE_LACKS_MADVISE
-#define ACE_LACKS_MALLOC_H
-#define ACE_LACKS_PARAM_H
-#define ACE_LACKS_SYS_PARAM_H
-#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
-#define ACE_LACKS_READDIR_R
-#define ACE_LACKS_RWLOCK_T
-#define ACE_LACKS_SCHED_H
-#define ACE_LACKS_SETSCHED
-#define ACE_LACKS_SEMAPHORE_H
-#define ACE_LACKS_SIGINFO_H
-#define ACE_LACKS_STDINT_H
-#define ACE_LACKS_SYS_SELECT_H
-#define ACE_LACKS_SYS_SYSCTL_H
-#define ACE_LACKS_SYSTIME_H
-#define ACE_LACKS_NETINET_TCP_H
-#define ACE_LACKS_TCP_H
-#define ACE_LACKS_THREAD_PROCESS_SCOPING
-#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR
-#define ACE_LACKS_TIMESPEC_T
-#define ACE_LACKS_FD_MASK
-
-#if !defined (ACE_MT_SAFE)
-# define ACE_MT_SAFE 1
-#endif
-
-#define ACE_NEEDS_DEV_IO_CONVERSION
-
-#define ACE_SIZEOF_FLOAT 4
-#define ACE_SIZEOF_DOUBLE 8
-#define ACE_SIZEOF_LONG_DOUBLE 16
-#define ACE_HAS_EBCDIC
-
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-
-#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
-#define IN_MULTICAST(a) IN_CLASSD(a)
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-netbsd.h b/dep/acelite/ace/config-netbsd.h
index 242b3af700a..227c10832a2 100644
--- a/dep/acelite/ace/config-netbsd.h
+++ b/dep/acelite/ace/config-netbsd.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-netbsd.h 91285 2010-08-05 08:29:30Z johnnyw $
+// $Id: config-netbsd.h 93530 2011-03-11 12:12:40Z olli $
#ifndef ACE_CONFIG_H
#define ACE_CONFIG_H
@@ -48,7 +48,6 @@
#define ACE_HAS_NONCONST_SELECT_TIMEVAL 1
#define ACE_HAS_ONLY_SCHED_OTHER 1
#define ACE_HAS_POLL 1
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
#define ACE_HAS_POSIX_NONBLOCK 1
#define ACE_HAS_POSIX_TIME 1
#define ACE_HAS_P_READ_WRITE 1
@@ -69,7 +68,6 @@
#define ACE_HAS_SOCKLEN_T 1
#define ACE_HAS_SSIZE_T 1
#define ACE_HAS_STANDARD_CPP_LIBRARY 1
-#define ACE_HAS_STDEXCEPT_NO_H 1
#define ACE_HAS_STRINGS 1
#define ACE_HAS_STRING_CLASS 1
#define ACE_HAS_SVR4_DYNAMIC_LINKING 1
@@ -105,7 +103,6 @@
#define ACE_LACKS_PRI_T 1
#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1
#define ACE_LACKS_PTHREAD_YIELD 1
-#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS 1
#define ACE_LACKS_RWLOCKATTR_PSHARED 1
#define ACE_LACKS_RWLOCK_T 1
#define ACE_LACKS_SETSCHED 1
diff --git a/dep/acelite/ace/config-openbsd.h b/dep/acelite/ace/config-openbsd.h
index aab03106aab..a4039d556a8 100644
--- a/dep/acelite/ace/config-openbsd.h
+++ b/dep/acelite/ace/config-openbsd.h
@@ -1,61 +1,22 @@
/* -*- C++ -*- */
-// $Id: config-openbsd.h 89494 2010-03-15 20:11:18Z olli $
+// $Id: config-openbsd.h 93613 2011-03-22 09:27:38Z olli $
// The following configuration file is designed to work for OpenBSD
-// platforms using GNU g++.
#ifndef ACE_CONFIG_H
-# define ACE_CONFIG_H
+#define ACE_CONFIG_H
#include /**/ "ace/pre.h"
+#if !defined (ACE_MT_SAFE)
+# define ACE_MT_SAFE 1
+#endif
+
// Platform specific directives
-// gcc defines __OpenBSD__ automatically for us.
#include <sys/param.h>
-#if defined (ACE_HAS_THREADS)
-# include /**/ <pthread.h>
-#endif /* ACE_HAS_THREADS */
-
#include "ace/config-posix.h"
-#if !defined (__ACE_INLINE__)
-# define __ACE_INLINE__
-#endif /* !__ACE_INLINE__ */
-
-#if defined (__GNUG__)
-# include "ace/config-g++-common.h"
-#endif /* __GNUG__ */
-
-
-#if defined (ACE_HAS_THREADS)
-
-# if !defined (_THREAD_SAFE)
-# define _THREAD_SAFE
-# endif /* _THREAD_SAFE */
-
-// And they're even POSIX pthreads
-# if !defined (ACE_MT_SAFE)
-# define ACE_MT_SAFE 1
-# endif /* ! ACE_MT_SAFE */
-
-
-// Check if pthreads and native exceptions are being used together.
-// This causes SEGVs to tbe thrown somewhat randomly for some
-// reason. According to newsgroup postings, it appears to be an
-// OpenBSD or gcc bug.
-# if defined (ACE_USES_NATIVE_EXCEPTIONS)
-# error "OpenBSD pthreads and native exceptions currently do not work. See OpenBSD bug #1750"
-# endif /* ACE_USES_NATIVE_EXCEPTIONS */
-
-#else
-// OpenBSD really has readdir_r () in single threaded mode,
-// but the #ifdefs in OS.i select one with the wrong parameter
-// sets if the ACE_HAS_POSIX_STD isn't defined (which is defined
-// when ACE_HAS_THREADS is defined.)
-# define ACE_LACKS_READDIR_R
-
-#endif /* ACE_HAS_THREADS */
-
+#include "ace/config-g++-common.h"
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
#define ACE_HAS_3_PARAM_READDIR_R
@@ -86,11 +47,8 @@
#define ACE_HAS_NONCONST_SELECT_TIMEVAL
#define ACE_HAS_NONCONST_SWAB
#define ACE_HAS_POLL
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
-#define ACE_HAS_POSIX_GETPWNAM_R
#define ACE_HAS_POSIX_NONBLOCK
#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PTHREADS_STD
#define ACE_HAS_PTHREADS_UNIX98_EXT
#define ACE_HAS_PTHREAD_ATTR_SETCREATESUSPEND_NP
#define ACE_HAS_PTHREAD_GETCONCURRENCY
@@ -137,47 +95,19 @@
#define ACE_HAS_VOID_UNSETENV
#define ACE_HAS_WCHAR
#define ACE_HAS_XPG4_MULTIBYTE_CHAR
+#define ACE_HAS_SYS_SIGINFO_H
-#define ACE_LACKS_CONDATTR_PSHARED
#define ACE_LACKS_GETIPNODEBYADDR
#define ACE_LACKS_GETIPNODEBYNAME
-#define ACE_LACKS_GETPGID
-#define ACE_LACKS_IOSTREAM_FX
#define ACE_LACKS_ISCTYPE
-#define ACE_LACKS_ITOW
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-#define ACE_LACKS_LOG2
-#define ACE_LACKS_MALLOC_H
-#define ACE_LACKS_MSG_ACCRIGHTS
-#define ACE_LACKS_MUTEXATTR_PSHARED
+#define ACE_LACKS_ISWASCII
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
#define ACE_LACKS_PERFECT_MULTICAST_FILTERING
-#define ACE_LACKS_PRI_T
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
-#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
-#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS
-#define ACE_LACKS_RLIMIT_PROTOTYPE
-#define ACE_LACKS_RWLOCK_T
-#define ACE_LACKS_SETPGID
-#define ACE_LACKS_SETREGID
-#define ACE_LACKS_SETREUID
#define ACE_LACKS_SETSCHED
-#define ACE_LACKS_SIGINFO_H
-#define ACE_LACKS_STDINT_H
#define ACE_LACKS_STROPTS_H
#define ACE_LACKS_STRRECVFD
-#define ACE_LACKS_TERMIO_H
-#define ACE_LACKS_THREAD_PROCESS_SCOPING
-#define ACE_LACKS_TIMEDWAIT_PROTOTYPES
#define ACE_LACKS_TIMESPEC_T
#define ACE_LACKS_UCONTEXT_H
-#define ACE_LACKS_UNBUFFERED_STREAMBUF
-#define ACE_LACKS_U_LONGLONG_T
-#define ACE_LACKS_WCHAR_H
-#define ACE_LACKS_WCSCASECMP
-#define ACE_LACKS_WCSDUP
-#define ACE_LACKS_WCSNCASECMP
-#define ACE_LACKS_WCSNICMP
#define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS
#define ACE_PAGE_SIZE 4096
@@ -186,23 +116,26 @@
// OpenBSD 3.6
#if (OpenBSD < 200411)
-# define ACE_USES_ASM_SYMBOL_IN_DLSYM
+# define ACE_USES_ASM_SYMBOL_IN_DLSYM
#endif
// ucontext_t is in OpenBSD 3.5 and later.
#if (OpenBSD >= 200405)
-# define ACE_HAS_UCONTEXT_T
+# define ACE_HAS_UCONTEXT_T
#endif /* OpenBSD >= 200405 */
// Lacks perfect filtering, must bind group address.
#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING
-# define ACE_LACKS_PERFECT_MULTICAST_FILTERING
+# define ACE_LACKS_PERFECT_MULTICAST_FILTERING
#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */
// OpenBSD's dlsym call segfaults when passed an invalid handle.
// It seems as if most other OSs detect this and just report an error.
#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE
+#define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld"
+#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu"
+
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-openvms.h b/dep/acelite/ace/config-openvms.h
index 33e2ff52d7a..91762386fc0 100644
--- a/dep/acelite/ace/config-openvms.h
+++ b/dep/acelite/ace/config-openvms.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-openvms.h 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: config-openvms.h 94294 2011-07-01 09:32:25Z johnnyw $
// The following configuration file is designed to work for OpenVMS 7.3-2
@@ -87,9 +87,6 @@
#define ACE_LACKS_SYMLINKS 1
-#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS 1
-#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS 1
-
#define ACE_HAS_P_READ_WRITE
#define ACE_HAS_CHARPTR_DL 1
#define ACE_HAS_CLOCK_GETTIME 1
@@ -189,4 +186,7 @@
#define ACE_LACKS_SETENV
#define ACE_LACKS_UNSETENV
+#define ACE_HAS_SOCK_BUF_SIZE_MAX
+#define ACE_HAS_SOCK_BUF_SIZE_MAX_VALUE 65535
+
#endif
diff --git a/dep/acelite/ace/config-qnx-neutrino.h b/dep/acelite/ace/config-qnx-neutrino.h
deleted file mode 100644
index 8ba1b97e4c2..00000000000
--- a/dep/acelite/ace/config-qnx-neutrino.h
+++ /dev/null
@@ -1,136 +0,0 @@
-// -*- C++ -*-
-// $Id: config-qnx-neutrino.h 92120 2010-10-01 12:00:01Z johnnyw $
-// The following configuration file is designed to work for Neutrino
-// 2.0 (Beta) with GNU C++ and the POSIX (pthread) threads package.
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-#include /**/ "ace/pre.h"
-
-#define _POSIX_C_SOURCE 199506
-#define _QNX_SOURCE
-
-// These constants are in i386-nto/include/limits.h, but egcs
-// picks up its own limits.h instead:
-#define _POSIX_NAME_MAX 14 /* Max bytes in a filename */
-#define _POSIX_PATH_MAX 256 /* Num. bytes in pathname (excl. NULL) */
-
-#if defined(__OPTIMIZE__)
-# if defined(__X86__)
- // string.h can't be used by ACE with __OPTIMIZE__.
-# undef __OPTIMIZE__
-# include <string.h>
-# define __OPTIMIZE__
-# endif /* __X86__ */
-#endif /* __OPTIMIZE__ */
-
-// The following defines the Neutrino compiler.
-// gcc should know to call g++ as necessary
-#ifdef __GNUC__
-# define ACE_CC_NAME ACE_TEXT ("gcc")
-#else
-# define ACE_CC_NAME ACE_TEXT ("NTO compiler ??")
-#endif
-
-#include "ace/config-g++-common.h"
-
-// /usr/nto/include/float.h defines
-// FLT_MAX_EXP 127
-// DBL_MAX_EXP 1023
-// ace expects 128 & 1024 respectively
-// to set the following macros in ace/Basic_Types.h
-// These macros are:
-// #define ACE_SIZEOF_DOUBLE 8
-// #define ACE_SIZEOF_FLOAT 4
-
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-// Although ACE does have alloca() on this compiler/platform combination, it is
-// disabled by default since it can be dangerous. Uncomment the following line
-// if you ACE to use it.
-//#define ACE_HAS_ALLOCA
-#define ACE_HAS_ALLOCA_H
-#define ACE_HAS_AUTOMATIC_INIT_FINI
-#define ACE_HAS_CLOCK_GETTIME
-#define ACE_HAS_CLOCK_SETTIME
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-#define ACE_HAS_DIRENT
-#define ACE_HAS_GETPAGESIZE
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-#define ACE_HAS_NONSTATIC_OBJECT_MANAGER
-#define ACE_HAS_INLINED_OSCALLS
-#define ACE_HAS_IP_MULTICAST
-#define ACE_HAS_MSG
-#define ACE_HAS_MT_SAFE_MKTIME
-#define ACE_HAS_MUTEX_TIMEOUTS
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_HAS_NONCONST_SWAB
-#define ACE_HAS_POSIX_SEM
-#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PTHREADS
-#define ACE_HAS_P_READ_WRITE
-#define ACE_HAS_REENTRANT_FUNCTIONS
-#define ACE_HAS_SELECT_H
-#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_SIGISMEMBER_BUG
-#define ACE_HAS_SIGWAIT
-#define ACE_HAS_SIG_ATOMIC_T
-#define ACE_HAS_SOCKADDR_IN_SIN_LEN
-#define ACE_HAS_SSIZE_T
-#define ACE_HAS_STRINGS
-#define ACE_HAS_SVR4_GETTIMEOFDAY
-#define ACE_HAS_TERMIOS
-#define ACE_HAS_THREADS
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-#define ACE_HAS_THR_C_DEST
-#define ACE_HAS_THR_C_FUNC
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-#define ACE_HAS_UALARM
-#define ACE_HAS_UCONTEXT_T
-#define ACE_HAS_VOIDPTR_MMAP
-#define ACE_HAS_VOIDPTR_SOCKOPT
-#define ACE_LACKS_CONDATTR_PSHARED
-#define ACE_LACKS_CONST_TIMESPEC_PTR
-#define ACE_LACKS_CUSERID
-#define ACE_LACKS_FORK
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-#define ACE_LACKS_MADVISE
-#define ACE_LACKS_MUTEXATTR_PSHARED
-#define ACE_LACKS_NAMED_POSIX_SEM
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-#define ACE_LACKS_POLL_H
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
-#define ACE_LACKS_RWLOCK_T
-#define ACE_LACKS_SBRK
-#define ACE_LACKS_SEEKDIR
-#define ACE_LACKS_SO_SNDBUF
-#define ACE_LACKS_SO_RCVBUF
-#define ACE_LACKS_SOCKETPAIR
-#define ACE_LACKS_STROPTS_H
-#define ACE_LACKS_STREAM_MODULES
-#define ACE_LACKS_STRRECVFD
-#define ACE_LACKS_SYSCALL
-#define ACE_LACKS_SYS_MSG_H
-#define ACE_LACKS_SYS_SHM_H
-#define ACE_LACKS_SYSV_SHMEM
-#define ACE_LACKS_TCP_NODELAY
-#define ACE_LACKS_TELLDIR
-#define ACE_LACKS_TIMESPEC_T
-#define ACE_LACKS_TRUNCATE
-#define ACE_LACKS_T_ERRNO
-#define ACE_LACKS_UALARM_PROTOTYPE
-#define ACE_LACKS_UCONTEXT_H
-#define ACE_LACKS_UNIX_DOMAIN_SOCKETS
-#define ACE_LACKS_U_LONGLONG_T
-#define ACE_MT_SAFE 1
-#define ACE_NEEDS_FUNC_DEFINITIONS
-#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-#define ACE_THR_PRI_FIFO_DEF 10
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-#define ACE_HAS_SIGTIMEDWAIT
-#define ACE_HAS_SIGSUSPEND
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-qnx-rtp-common.h b/dep/acelite/ace/config-qnx-rtp-common.h
deleted file mode 100644
index 9d9e0aced4e..00000000000
--- a/dep/acelite/ace/config-qnx-rtp-common.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// -*- C++ -*-
-// $Id: config-qnx-rtp-common.h 92120 2010-10-01 12:00:01Z johnnyw $
-// several macros common to various qnx neutrino version.
-
-#ifndef ACE_CONFIG_QNX_RTP_COMMON_H
-#define ACE_CONFIG_QNX_RTP_COMMON_H
-#include /**/ "ace/pre.h"
-
-#define _POSIX_C_SOURCE 199506
-#define _QNX_SOURCE
-
-// These constants are in i386-nto/include/limits.h, but egcs
-// picks up its own limits.h instead:
-#define _POSIX_NAME_MAX 14 /* Max bytes in a filename */
-#define _POSIX_PATH_MAX 256 /* Num. bytes in pathname (excl. NULL) */
-
-#if defined(__OPTIMIZE__)
-# if defined(__X86__)
- // string.h can't be used by ACE with __OPTIMIZE__.
-# undef __OPTIMIZE__
-# include <string.h>
-# define __OPTIMIZE__
-# endif /* __X86__ */
-#endif /* __OPTIMIZE__ */
-
-// The following defines the Neutrino compiler.
-// gcc should know to call g++ as necessary
-#ifdef __GNUC__
-# define ACE_CC_NAME ACE_TEXT ("gcc")
-#else
-# define ACE_CC_NAME ACE_TEXT ("QNX-RTP compiler ??")
-#endif
-
-#include "ace/config-g++-common.h"
-
-// /usr/nto/include/float.h defines
-// FLT_MAX_EXP 127
-// DBL_MAX_EXP 1023
-// ace expects 128 & 1024 respectively
-// to set the following macros in ace/Basic_Types.h
-// These macros are:
-#define ACE_SIZEOF_DOUBLE 8
-#define ACE_SIZEOF_FLOAT 4
-
-// At least qnx 6.3.2 uses a void return for unsetenv
-// This assumes that older versions do too.
-#define ACE_HAS_VOID_UNSETENV
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_QNX_RTP_COMMON_H */
diff --git a/dep/acelite/ace/config-qnx-rtp-pre62x.h b/dep/acelite/ace/config-qnx-rtp-pre62x.h
deleted file mode 100644
index 504d3a3ac09..00000000000
--- a/dep/acelite/ace/config-qnx-rtp-pre62x.h
+++ /dev/null
@@ -1,152 +0,0 @@
-// -*- C++ -*-
-// $Id: config-qnx-rtp-pre62x.h 87167 2009-10-19 19:33:53Z olli $
-// The following configuration file is designed to work for QNX RTP
-// GNU C++ and the POSIX (pthread) threads package. You can get QNX
-// RTP at http://get.qnx.com
-
-#ifndef ACE_CONFIG_RTP_PRE62x_H
-#define ACE_CONFIG_RTP_PRE62x_H
-#include /**/ "ace/pre.h"
-#include /**/ "ace/config-qnx-rtp-common.h"
-
-/////////////////////////////////////////////////////////////////
-// Definition of the features that are available.
-//
-// ACE_HAS Section
-/////////////////////////////////////////////////////////////////
-
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-// Although ACE does have alloca() on this compiler/platform combination, it is
-// disabled by default since it can be dangerous. Uncomment the following line
-// if you ACE to use it.
-//#define ACE_HAS_ALLOCA
-#define ACE_HAS_ALLOCA_H
-#define ACE_HAS_AUTOMATIC_INIT_FINI
-#define ACE_HAS_CLOCK_GETTIME
-#define ACE_HAS_CLOCK_SETTIME
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-#define ACE_HAS_DIRENT
-#define ACE_HAS_GETPAGESIZE
-// Enable gperf, this is a hosted configuration.
-#define ACE_HAS_GPERF
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER
-#define ACE_HAS_INLINED_OSCALLS
-#define ACE_HAS_IP_MULTICAST
-#define ACE_HAS_MSG
-#define ACE_HAS_MT_SAFE_MKTIME
-#define ACE_HAS_MUTEX_TIMEOUTS
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_HAS_POSIX_SEM
-#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PTHREADS
-#define ACE_HAS_P_READ_WRITE
-#define ACE_HAS_REENTRANT_FUNCTIONS
-#define ACE_HAS_SELECT_H
-#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_SIGISMEMBER_BUG
-#define ACE_HAS_SIGWAIT
-#define ACE_HAS_SIG_ATOMIC_T
-#define ACE_HAS_SOCKADDR_IN_SIN_LEN
-// #define ACE_HAS_SIZET_SOCKET_LEN
-#define ACE_HAS_SOCKLEN_T
-#define ACE_HAS_SSIZE_T
-#define ACE_HAS_STRINGS
-#define ACE_HAS_SVR4_GETTIMEOFDAY
-#define ACE_HAS_TERMIOS
-#define ACE_HAS_THREADS
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-#define ACE_HAS_THR_C_DEST
-#define ACE_HAS_THR_C_FUNC
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-#define ACE_HAS_UALARM
-#define ACE_HAS_UCONTEXT_T
-#define ACE_HAS_VOIDPTR_MMAP
-#define ACE_HAS_VOIDPTR_SOCKOPT
-
-/////////////////////////////////////////////////////////////////
-// Definition of the features that are not available.
-//
-// ACE_LACKS Section
-/////////////////////////////////////////////////////////////////
-#define ACE_LACKS_CONDATTR_PSHARED
-#define ACE_LACKS_CONST_TIMESPEC_PTR
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-#define ACE_LACKS_MADVISE
-#define ACE_LACKS_MUTEXATTR_PSHARED
-#define ACE_LACKS_NAMED_POSIX_SEM
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
-#define ACE_LACKS_RWLOCK_T
-#define ACE_LACKS_SBRK
-#define ACE_LACKS_SEEKDIR
-#define ACE_LACKS_SO_SNDBUF
-#define ACE_LACKS_SO_RCVBUF
-#define ACE_LACKS_SOCKETPAIR
-// Even if the QNX RTP docs says that socket pair are
-// available, there is actually no implementation of
-// soket-pairs.
-#define ACE_LACKS_STREAM_MODULES
-#define ACE_LACKS_STRRECVFD
-#define ACE_LACKS_SYSCALL
-#define ACE_LACKS_SYS_MSG_H
-#define ACE_LACKS_SYSV_SHMEM
-#define ACE_LACKS_ALPHASORT
-//#define ACE_LACKS_TCP_NODELAY // Based on the QNX RTP documentation, this option seems to
- // to be supported.
-#define ACE_LACKS_TELLDIR
-#define ACE_LACKS_TIMESPEC_T
-#define ACE_LACKS_TRUNCATE
-#define ACE_LACKS_T_ERRNO
-#define ACE_LACKS_UALARM_PROTOTYPE
-#define ACE_LACKS_UCONTEXT_H
-#define ACE_LACKS_UNIX_DOMAIN_SOCKETS
-#define ACE_LACKS_U_LONGLONG_T
-#define ACE_LACKS_FD_MASK
-#define ACE_LACKS_NFDBITS
-
-#define ACE_LACKS_RLIMIT // QNX rlimit syscalls don't work properly with ACE.
-
-#define ACE_MT_SAFE 1
-#define ACE_NEEDS_FUNC_DEFINITIONS
-#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 64000
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-#define ACE_THR_PRI_FIFO_DEF 10
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-#define ACE_HAS_SIGTIMEDWAIT
-#define ACE_HAS_SIGSUSPEND
-
-#define ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK 1
-
-#define ACE_SIZEOF_WCHAR 4
-
-// Not really, but the prototype returns wchar_t instead of wchar_t *
-#define ACE_LACKS_WCSSTR
-
-// No prototypes
-#define ACE_LACKS_ITOW
-#define ACE_LACKS_WCSICMP
-#define ACE_LACKS_WCSNICMP
-#define ACE_LACKS_WCSDUP
-
-// And these have prototypes but no implementation
-#define ACE_LACKS_WCSLEN
-#define ACE_LACKS_WCSNCMP
-#define ACE_LACKS_WCSCPY
-#define ACE_LACKS_WCSNCPY
-#define ACE_LACKS_TOWLOWER
-#define ACE_LACKS_TOWUPPER
-#define ACE_LACKS_WCSCMP
-#define ACE_LACKS_WCSCAT
-#define ACE_LACKS_WCSNCAT
-#define ACE_LACKS_WCSSPN
-#define ACE_LACKS_WCSCHR
-#define ACE_LACKS_WCSPBRK
-#define ACE_LACKS_WCSRCHR
-
-#define ACE_LACKS_ACE_IOSTREAM
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_RTP_PRE62x_H */
diff --git a/dep/acelite/ace/config-qnx-rtp.h b/dep/acelite/ace/config-qnx-rtp.h
deleted file mode 100644
index 02ee89bc5ef..00000000000
--- a/dep/acelite/ace/config-qnx-rtp.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// -*- C++ -*-
-// $Id: config-qnx-rtp.h 91743 2010-09-13 18:24:51Z johnnyw $
-// The following configuration file is designed to work for QNX RTP
-// GNU C++ and the POSIX (pthread) threads package. You can get QNX
-// RTP at http://get.qnx.com.
-// This header is intended to switch between configuration for
-// various NTO versions.
-#ifndef ACE_CONFIG_QNX_RTP_H
-#define ACE_CONFIG_QNX_RTP_H
-#include /**/ "ace/pre.h"
-
-#include <sys/neutrino.h>
-#if !defined(_NTO_VERSION)
-# error "Could not detect QNX version from macro _NTO_VERSION"
-#else
-# define ACE_NTO_VERS _NTO_VERSION
-# if ACE_NTO_VERS < 620
-# include /**/ "ace/config-qnx-rtp-pre62x.h"
-# else
-# include /**/ "ace/config-qnx-rtp-62x.h"
-# endif
-#endif
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_QNX_RTP_H */
diff --git a/dep/acelite/ace/config-qnx-rtp-62x.h b/dep/acelite/ace/config-qnx.h
index 7fa7514a1c8..73353d4ffa7 100644
--- a/dep/acelite/ace/config-qnx-rtp-62x.h
+++ b/dep/acelite/ace/config-qnx.h
@@ -1,12 +1,43 @@
// -*- C++ -*-
-// $Id: config-qnx-rtp-62x.h 87167 2009-10-19 19:33:53Z olli $
-// The following configuration file is designed to work for QNX RTP 621
+// $Id: config-qnx.h 94293 2011-07-01 08:47:39Z mcorino $
+// The following configuration file is designed to work for QNX RTP
// GNU C++ and the POSIX (pthread) threads package. You can get QNX
-// RTP at http://get.qnx.com
-#ifndef ACE_CONFIG_QNX_RTP_62x_H
-#define ACE_CONFIG_QNX_RTP_62x_H
+// RTP at http://get.qnx.com.
+// This header is intended to switch between configuration for
+// various NTO versions.
+#ifndef ACE_CONFIG_QNX_H
+#define ACE_CONFIG_QNX_H
#include /**/ "ace/pre.h"
-#include /**/ "ace/config-qnx-rtp-common.h"
+
+#include <sys/neutrino.h>
+#if !defined(_NTO_VERSION)
+# error "Could not detect QNX version from macro _NTO_VERSION"
+#endif
+
+#define _POSIX_C_SOURCE 199506
+
+// The following defines the Neutrino compiler.
+// gcc should know to call g++ as necessary
+#ifdef __GNUC__
+# define ACE_CC_NAME ACE_TEXT ("gcc")
+#else
+# define ACE_CC_NAME ACE_TEXT ("QNX-RTP compiler ??")
+#endif
+
+#include "ace/config-g++-common.h"
+
+// /usr/nto/include/float.h defines
+// FLT_MAX_EXP 127
+// DBL_MAX_EXP 1023
+// ace expects 128 & 1024 respectively
+// to set the following macros in ace/Basic_Types.h
+// These macros are:
+#define ACE_SIZEOF_DOUBLE 8
+#define ACE_SIZEOF_FLOAT 4
+
+// At least qnx 6.3.2 uses a void return for unsetenv
+// This assumes that older versions do too.
+#define ACE_HAS_VOID_UNSETENV
/////////////////////////////////////////////////////////////////
// Definition of the features that are available.
@@ -30,10 +61,8 @@
#define ACE_HAS_DIRENT
#define ACE_HAS_GETPAGESIZE
#define ACE_HAS_GETIFADDRS
-// Enable gperf, this is a hosted configuration.
#define ACE_HAS_GPERF
#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER
#define ACE_HAS_IP_MULTICAST
#define ACE_HAS_MSG
#define ACE_HAS_MT_SAFE_MKTIME
@@ -42,7 +71,6 @@
#define ACE_HAS_NONCONST_SWAB
#define ACE_HAS_POSIX_SEM
#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PTHREADS
#define ACE_HAS_P_READ_WRITE
#define ACE_HAS_REENTRANT_FUNCTIONS
#define ACE_HAS_SELECT_H
@@ -51,6 +79,7 @@
#define ACE_HAS_SIGISMEMBER_BUG
#define ACE_HAS_SIGWAIT
#define ACE_HAS_SIG_ATOMIC_T
+#define ACE_HAS_SIOCGIFCONF
#define ACE_HAS_SOCKADDR_IN_SIN_LEN
#define ACE_HAS_SOCKLEN_T
#define ACE_HAS_SSIZE_T
@@ -58,7 +87,6 @@
#define ACE_HAS_SVR4_DYNAMIC_LINKING
#define ACE_HAS_SVR4_GETTIMEOFDAY
#define ACE_HAS_TERMIOS
-#define ACE_HAS_THREADS
#define ACE_HAS_THREAD_SPECIFIC_STORAGE
#define ACE_HAS_THR_C_DEST
#define ACE_HAS_THR_C_FUNC
@@ -67,6 +95,23 @@
#define ACE_HAS_UCONTEXT_T
#define ACE_HAS_VOIDPTR_MMAP
#define ACE_HAS_VOIDPTR_SOCKOPT
+#define ACE_HAS_NET_IF_DL_H
+#define ACE_HAS_SYS_SIGINFO_H
+#define ACE_HAS_GETTIMEOFDAY 1
+#define ACE_HAS_GETRUSAGE 1
+#define ACE_HAS_GETRUSAGE_PROTOTYPE 1
+#define ACE_HAS_NEW_NO_H 1
+#define ACE_IOCTL_TYPE_ARG2 u_long
+#define ACE_HAS_TIMEZONE 1
+#define ACE_HAS_SOCKADDR_MSG_NAME 1
+#define ACE_HAS_SIG_C_FUNC 1
+#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN 1
+#define ACE_HAS_STANDARD_CPP_LIBRARY 1
+#define ACE_HAS_STRING_CLASS 1
+#define ACE_HAS_STRSIGNAL
+#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
+#define ACE_HAS_POSIX_NONBLOCK 1
+#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1
/////////////////////////////////////////////////////////////////
// Definition of the features that are not available.
@@ -76,30 +121,38 @@
#define ACE_LACKS_CONST_TIMESPEC_PTR
#define ACE_LACKS_LINEBUFFERED_STREAMBUF
#define ACE_LACKS_MADVISE
-// lacks mqueue mgr or speed-up named sem by shm emulation
-#define ACE_LACKS_NAMED_POSIX_SEM
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
// Multicast_Tests reports for NTO 621 frames from unsubscribed groups
#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1
-#define ACE_LACKS_POLL_H
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
#define ACE_LACKS_RWLOCK_T
#define ACE_LACKS_SO_SNDBUF
#define ACE_LACKS_SO_RCVBUF
#define ACE_LACKS_STREAM_MODULES
#define ACE_LACKS_STROPTS_H
-#define ACE_LACKS_STRPTIME
#define ACE_LACKS_STRRECVFD
#define ACE_LACKS_SYSCALL
-#define ACE_LACKS_SYS_MSG_H
#define ACE_LACKS_SYSV_SHMEM
#define ACE_LACKS_SYS_SHM_H
#define ACE_LACKS_TIMESPEC_T
#define ACE_LACKS_T_ERRNO
#define ACE_LACKS_U_LONGLONG_T
-#define ACE_LACKS_ALPHASORT
-#define ACE_LACKS_FD_MASK
-#define ACE_LACKS_NFDBITS
+#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
+#define ACE_HAS_SYS_SOCKIO_H 1
+#define ACE_HAS_SYSCTL
+#define ACE_HAS_SIGACTION_CONSTP2 1
+
+#if _NTO_VERSION < 650
+# define ACE_LACKS_NFDBITS
+# define ACE_LACKS_FD_MASK
+# define ACE_LACKS_SYS_MSG_H
+# define ACE_LACKS_ALPHASORT
+# define ACE_LACKS_STRPTIME
+# define ACE_LACKS_POLL_H
+#else
+# define ACE_HAS_POLL 1
+# define ACE_HAS_WCHAR 1
+# define ACE_HAS_XPG4_MULTIBYTE_CHAR 1
+#endif
+
#define ACE_LACKS_ISCTYPE
#define ACE_LACKS_RLIMIT // QNX rlimit syscalls don't work properly with ACE.
@@ -121,11 +174,23 @@
#define ACE_LACKS_WCSICMP
#define ACE_LACKS_WCSNICMP
#define ACE_LACKS_WCSDUP
+#define ACE_LACKS_STD_WSTRING
+
+#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+# define ACE_HAS_THREADS
+# define ACE_HAS_PTHREADS
+# define ACE_HAS_PTHREADS_UNIX98_EXT 1
+# define ACE_LACKS_PTHREAD_THR_SIGSETMASK
+# define ACE_HAS_PTHREAD_GETCONCURRENCY
+#endif /* ACE_MT_SAFE */
+
+
// The default value of FD_SETSIZE is 32, but actually x86 NTO
// supports by default at least 1000 descriptors in fd_set.
#if defined( FD_SETSIZE )
#undef FD_SETSIZE
#endif
#define FD_SETSIZE 1000
+
#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_QNX_RTP_62x_H*/
+#endif /* ACE_CONFIG_QNX_H */
diff --git a/dep/acelite/ace/config-rtems.h b/dep/acelite/ace/config-rtems.h
index d113a1434a4..f65893cc57b 100644
--- a/dep/acelite/ace/config-rtems.h
+++ b/dep/acelite/ace/config-rtems.h
@@ -1,5 +1,5 @@
/* -*- C -*- */
-// $Id: config-rtems.h 87169 2009-10-19 20:26:55Z olli $
+// $Id: config-rtems.h 93571 2011-03-17 07:37:11Z olli $
/* The following configuration file is designed to work for RTEMS
platforms using GNU C.
@@ -56,7 +56,6 @@
#define ACE_LACKS_MKSTEMP
#define ACE_LACKS_STRDUP
#define ACE_LACKS_STRTOK_R
-#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS
#define ACE_LACKS_REALPATH
#define ACE_LACKS_TEMPNAM
#define ACE_LACKS_TZSET
@@ -76,7 +75,6 @@
# define ACE_HAS_PTHREAD_SCHEDPARAM
# define ACE_LACKS_THREAD_PROCESS_SCOPING
#else
-# define ACE_HAS_POSIX_GETPWNAM_R
# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
#endif
diff --git a/dep/acelite/ace/config-sco-5.0.0-nothread.h b/dep/acelite/ace/config-sco-5.0.0-nothread.h
deleted file mode 100644
index 259bd55c273..00000000000
--- a/dep/acelite/ace/config-sco-5.0.0-nothread.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-sco-5.0.0-nothread.h 87268 2009-10-29 21:06:06Z olli $
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-#include /**/ "ace/pre.h"
-
-#include "ace/config-g++-common.h"
-#include "ace/config-sco-5.0.0.h"
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-sco-5.0.0.h b/dep/acelite/ace/config-sco-5.0.0.h
deleted file mode 100644
index 61b68213bc1..00000000000
--- a/dep/acelite/ace/config-sco-5.0.0.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-sco-5.0.0.h 87167 2009-10-19 19:33:53Z olli $
-
-#ifndef ACE_CONFIG_SCO_5_0_0_H
-#define ACE_CONFIG_SCO_5_0_0_H
-#include /**/ "ace/pre.h"
-
-// Compiling for SCO.
-#if !defined (SCO)
-#define SCO
-#endif /* SCO */
-
-#if defined (SCO) && !defined (MAXPATHLEN)
-#define MAXPATHLEN 1023
-#endif /* SCO */
-
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_LACKS_CONST_TIMESPEC_PTR
-#define ACE_LACKS_SYSCALL
-#define ACE_LACKS_STRRECVFD
-#define ACE_NEEDS_FTRUNCATE
-#define ACE_LACKS_MADVISE
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-
-#define ACE_DEFAULT_CLOSE_ALL_HANDLES 0
-
-// Platform supports System V IPC (most versions of UNIX, but not Win32)
-#define ACE_HAS_SYSV_IPC
-#define ACE_HAS_NONCONST_MSGSND
-#define ACE_HAS_BIG_FD_SET
-#define ACE_HAS_SVR4_DYNAMIC_LINKING
-#define ACE_HAS_AUTOMATIC_INIT_FINI
-
-// Platform has POSIX terminal interface.
-#define ACE_HAS_TERMIOS
-
-// Compiler/platform contains the <sys/syscall.h> file.
-//#define ACE_HAS_SYS_SYSCALL_H
-
-// Fixes a problem with HP/UX not wrapping the mmap(2) header files
-// with extern "C".
-//#define ACE_HAS_BROKEN_MMAP_H
-
-// Prototypes for both signal() and struct sigaction are consistent.
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-
-// Compiler/platform has correctly prototyped header files.
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-// Compiler/platform supports poll().
-// #define ACE_HAS_POLL
-
-// Platform supports POSIX O_NONBLOCK semantics.
-#define ACE_HAS_POSIX_NONBLOCK
-
-// Compiler/platform defines the sig_atomic_t typedef
-#define ACE_HAS_SIG_ATOMIC_T
-
-// Compiler supports the ssize_t typedef.
-//#define ACE_HAS_SSIZE_T
-
-// Defines the page size of the system.
-#define ACE_PAGE_SIZE 4096
-
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-
-// Note, this only works if the flag is set above!
-//#define ACE_HAS_GETRUSAGE
-
-// Platform uses int for select() rather than fd_set.
-#define ACE_HAS_SELECT_H
-
-// Platform has prototypes for ACE_TLI.
-#define ACE_HAS_TLI_PROTOTYPES
-// Platform has the XLI version of ACE_TLI.
-// #define ACE_HAS_XLI
-
-#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_UCONTEXT_T
-
-#define ACE_LACKS_STRCASECMP
-
-// #define ACE_HAS_POSIX_TIME
-#define ACE_HAS_IP_MULTICAST
-#define ACE_HAS_DIRENT
-#define ACE_LACKS_READDIR_R
-#define ACE_HAS_GPERF
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_SCO_5_0_0_H */
diff --git a/dep/acelite/ace/config-sunos5.10.h b/dep/acelite/ace/config-sunos5.10.h
index df6f095fec9..1ba1e19a184 100644
--- a/dep/acelite/ace/config-sunos5.10.h
+++ b/dep/acelite/ace/config-sunos5.10.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-sunos5.10.h 89905 2010-04-16 13:04:47Z johnnyw $
+// $Id: config-sunos5.10.h 95428 2012-01-11 15:42:20Z sma $
// The following configuration file is designed to work for SunOS 5.10
// (Solaris 10) platforms using the SunC++ 5.x (Sun Studio 8-10), or g++
@@ -38,15 +38,10 @@
#endif
// Solaris 10 introduced printf() modifiers for [s]size_t types.
-#if defined (ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII)
-# undef ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII
-# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%zd"
-#endif /* ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII */
-
-#if defined (ACE_SIZE_T_FORMAT_SPECIFIER_ASCII)
-# undef ACE_SIZE_T_FORMAT_SPECIFIER_ASCII
-# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%zu"
-#endif /* ACE_SIZE_T_FORMAT_SPECIFIER_ASCII */
+#undef ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII
+#define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%zd"
+#undef ACE_SIZE_T_FORMAT_SPECIFIER_ASCII
+#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%zu"
// Solaris 10 offers wcstoll() and wcstoull()
#if defined (ACE_LACKS_WCSTOLL)
diff --git a/dep/acelite/ace/config-sunos5.4-g++.h b/dep/acelite/ace/config-sunos5.4-g++.h
index a678389e78d..55fc6579c24 100644
--- a/dep/acelite/ace/config-sunos5.4-g++.h
+++ b/dep/acelite/ace/config-sunos5.4-g++.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-sunos5.4-g++.h 87268 2009-10-29 21:06:06Z olli $
+// $Id: config-sunos5.4-g++.h 93573 2011-03-17 07:53:03Z olli $
// The following configuration file is designed to work for SunOS 5.4
// platforms using the GNU g++ compiler.
@@ -34,9 +34,6 @@
// Sun has the wrong prototype for sendmsg.
#define ACE_HAS_NONCONST_SENDMSG
-// The SunOS 5.x version of rand_r is inconsistent with the header files...
-#define ACE_HAS_BROKEN_RANDR
-
// Platform supports system configuration information.
#define ACE_HAS_SYS_SYSTEMINFO_H
#define ACE_HAS_SYSV_SYSINFO
diff --git a/dep/acelite/ace/config-sunos5.4-sunc++-4.x.h b/dep/acelite/ace/config-sunos5.4-sunc++-4.x.h
index e4bc8239125..4c7a3a63923 100644
--- a/dep/acelite/ace/config-sunos5.4-sunc++-4.x.h
+++ b/dep/acelite/ace/config-sunos5.4-sunc++-4.x.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-sunos5.4-sunc++-4.x.h 91285 2010-08-05 08:29:30Z johnnyw $
+// $Id: config-sunos5.4-sunc++-4.x.h 93573 2011-03-17 07:53:03Z olli $
// The following configuration file is designed to work for SunOS 5.4
// platforms using the SunC++ 4.0.x compiler.
@@ -26,9 +26,6 @@
// Sun has the wrong prototype for sendmsg.
#define ACE_HAS_NONCONST_SENDMSG
-// The SunOS 5.x version of rand_r is inconsistent with the header files...
-#define ACE_HAS_BROKEN_RANDR
-
// Platform supports system configuration information.
#define ACE_HAS_SYS_SYSTEMINFO_H
#define ACE_HAS_SYSV_SYSINFO
diff --git a/dep/acelite/ace/config-sunos5.5.h b/dep/acelite/ace/config-sunos5.5.h
index d3279b9d3b6..30e48da6d59 100644
--- a/dep/acelite/ace/config-sunos5.5.h
+++ b/dep/acelite/ace/config-sunos5.5.h
@@ -1,10 +1,10 @@
/* -*- C++ -*- */
-// $Id: config-sunos5.5.h 92102 2010-09-30 08:14:15Z johnnyw $
+// $Id: config-sunos5.5.h 94454 2011-09-08 17:36:56Z johnnyw $
// This configuration file is designed to work for SunOS 5.5 platforms
// using the following compilers:
// * Sun C++ 4.2 and later (including 5.x), patched as noted below
-// * g++ 2.7.2 and later, including egcs
+// * g++
// * Green Hills 1.8.8 and later
#ifndef ACE_CONFIG_H
@@ -24,24 +24,10 @@
// SunOS 5.5 does not provide getloadavg()
#define ACE_LACKS_GETLOADAVG
-// Some SunOS releases define _POSIX_PTHREAD_SEMANTICS automatically.
-// We need to be check if the user has manually defined the macro before
-// including <sys/feature_tests.h>.
-#if defined (_POSIX_PTHREAD_SEMANTICS)
-# define ACE_HAS_POSIX_PTHREAD_SEMANTICS
-#endif /* _POSIX_PTHREAD_SEMANTICS */
-
// Before we do anything, we should include <sys/feature_tests.h> to
// ensure that things are set up properly.
#include <sys/feature_tests.h>
-// Some SunOS releases define _POSIX_PTHREAD_SEMANTICS automatically.
-// We need to undef if the macro is set and not defined by the user.
-#if defined (_POSIX_PTHREAD_SEMANTICS) && \
- !defined (ACE_HAS_POSIX_PTHREAD_SEMANTICS)
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif /* _POSIX_PTHREAD_SEMANTICS && !ACE_HAS_POSIX_PTHREAD_SEMANTICS */
-
// Sun has the posix defines so let this file sort out what Sun delivers
#include "ace/config-posix.h"
@@ -125,33 +111,15 @@
# endif /* _REENTRANT */
# endif /* !ACE_MT_SAFE */
-#elif defined (ghs)
-
-# if !defined (ACE_MT_SAFE) || ACE_MT_SAFE != 0
- // ACE_MT_SAFE is #defined below, for all compilers.
-# if !defined (_REENTRANT)
- /* If you want to disable threading, comment out the following
- line. Or, add -DACE_MT_SAFE=0 to your CFLAGS, e.g., using
- make threads=0. */
-# define _REENTRANT
-# endif /* _REENTRANT */
-# endif /* !ACE_MT_SAFE */
-
-# define ACE_CONFIG_INCLUDE_GHS_COMMON
-# include "ace/config-ghs-common.h"
-
- // To avoid warning about inconsistent declaration between Sun's
- // stdlib.h and Green Hills' ctype.h.
-# include <stdlib.h>
+# if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 3))
+# define ACE_LACKS_STD_WSTRING 1
+# endif
- // IOStream_Test never halts with Green Hills 1.8.9.
-# define ACE_LACKS_ACE_IOSTREAM
-
-#else /* ! __SUNPRO_CC && ! __GNUG__ && ! ghs */
+#else /* ! __SUNPRO_CC && ! __GNUG__ */
# ifdef __cplusplus /* Let it slide for C compilers. */
# error unsupported compiler in ace/config-sunos5.5.h
# endif /* __cplusplus */
-#endif /* ! __SUNPRO_CC && ! __GNUG__ && ! ghs */
+#endif /* ! __SUNPRO_CC && ! __GNUG__ */
#if !defined (__ACE_INLINE__)
// @note If you have link problems with undefined inline template
@@ -282,12 +250,6 @@
# define ACE_HAS_CHARPTR_SHMDT
#endif
-// Platform has posix getpwnam_r
-#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE - 0 >= 199506L) || \
- defined(_POSIX_PTHREAD_SEMANTICS)
-# define ACE_HAS_POSIX_GETPWNAM_R
-#endif /* _POSIX_C_SOURCE || _POSIX_PTHREAD_SEMANTICS */
-
#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE == 1)
#if defined (_REENTRANT) || \
(defined (_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L)) || \
diff --git a/dep/acelite/ace/config-sunos5.6.h b/dep/acelite/ace/config-sunos5.6.h
index 958e019cd1b..e7f935c753e 100644
--- a/dep/acelite/ace/config-sunos5.6.h
+++ b/dep/acelite/ace/config-sunos5.6.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-sunos5.6.h 91685 2010-09-09 09:35:14Z johnnyw $
+// $Id: config-sunos5.6.h 93117 2011-01-20 12:11:28Z mcorino $
// The following configuration file is designed to work for SunOS 5.6
// platforms using the SunC++ 4.x or g++ compilers.
@@ -78,7 +78,6 @@
// SunOS 5.6 and above support mkstemp
#undef ACE_LACKS_MKSTEMP
-
// SunOS 5.6 has AIO calls.
#if !defined (ACE_HAS_AIO_CALLS)
#define ACE_HAS_AIO_CALLS
diff --git a/dep/acelite/ace/config-sunos5.7.h b/dep/acelite/ace/config-sunos5.7.h
index b01b0d47708..720fbbd430a 100644
--- a/dep/acelite/ace/config-sunos5.7.h
+++ b/dep/acelite/ace/config-sunos5.7.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-sunos5.7.h 91581 2010-08-31 13:18:11Z shuston $
+// $Id: config-sunos5.7.h 93543 2011-03-14 08:25:46Z johnnyw $
// The following configuration file is designed to work for SunOS 5.7
// (Solaris 7) platforms using the SunC++ 4.x, 5.x, or g++ compilers.
@@ -25,17 +25,10 @@
// SunOS 5.7 has getloadavg()
#undef ACE_LACKS_GETLOADAVG
-#if defined (ghs)
- // SunOS 5.7's /usr/include/sys/procfs_isa.h needs uint64_t,
- // but /usr/include/sys/int_types.h doesn't #define it because
- // _NO_LONGLONG is #
-# undef ACE_HAS_PROC_FS
-# undef ACE_HAS_PRUSAGE_T
-
-#elif defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)
+#if defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)
// Wide character methods are in std:: when using SunCC 5.3
# define ACE_WCHAR_IN_STD_NAMESPACE
-#endif /* __GNUG__ || ghs */
+#endif
// SunOS 5.7 supports SCHED_FIFO and SCHED_RR, as well as SCHED_OTHER.
#undef ACE_HAS_ONLY_SCHED_OTHER
diff --git a/dep/acelite/ace/config-tandem-nsk-mips-v2.h b/dep/acelite/ace/config-tandem-nsk-mips-v2.h
deleted file mode 100644
index ff2111cf56e..00000000000
--- a/dep/acelite/ace/config-tandem-nsk-mips-v2.h
+++ /dev/null
@@ -1,384 +0,0 @@
-// -*- C++ -*-
-//
-// $Id: config-tandem-nsk-mips-v2.h 91685 2010-09-09 09:35:14Z johnnyw $
-
-#ifndef ACE_CONFIG_NSK_H
-#define ACE_CONFIG_NSK_H
-
-#include /**/ "ace/pre.h"
-
-// The following configuration file contains defines for Tandem NSK
-// platform, MIPS processor, version 2 C++ compiler.
-
-
-//=========================================================================
-// Tandem NSK specific parts
-//=========================================================================
-
-
-// Disable pthread renaming of symbols such as "open" and "close"
-#define _CMA_NOWRAPPERS_ 1
-
-// Get Handle_Set.cpp to generate correct bit operations for NSK platform
-#define ACE_TANDEM_NSK_BIT_ORDER
-
-// Use facilities provided by T1248 version of pthreads.
-// (If not defined, will use old version of pthreads.)
-#define ACE_TANDEM_T1248_PTHREADS
-
-// Use all available T1248 thread aware wrapper functions for providing
-// non-blocking I/O.
-// [@note this causes a significant performance degradation]
-//#define ACE_TANDEM_T1248_PTHREADS_ALL_IO_WRAPPERS
-
-
-// Need this include here because some symbols defined by pthreads
-// (e.g. timespec_t) are needed before spthread.h is normally included
-// by ACE
-#ifdef ACE_TANDEM_T1248_PTHREADS
-#include <spthread.h>
-#else
-#include "pthread.h"
-#include "dce/cma_dispatch_coop.h"
-#endif
-
-// The following #defines are hacks to get around things
-// that seem to be missing or different in Tandem land
-#define NSIG 32 // missing from Signal.h
- // note: on nsk TNS/R there is room in
- // sigset_t for 128 signals but those
- // above 31 are not valid.
-#define MAXNAMLEN 248 // missing from dirent.h
-#define ERRMAX 4218 // from errno.h
-
-// Following seems to be missing from G06.20 version of standard
-// pthreads includes (it appeared in older version of standard pthreads)
-// (SCHED_FIFO (aka cma_c_sched_fifo) used in Dynamic_Priority_Test)
-#ifdef ACE_TANDEM_T1248_PTHREADS
-typedef enum CMA_T_SCHED_POLICY {
- cma_c_sched_fifo = 0,
- cma_c_sched_rr = 1,
- cma_c_sched_throughput = 2,
- cma_c_sched_background = 3,
- cma_c_sched_ada_low = 4
- } cma_t_sched_policy;
-#endif
-
-// T1248 doesn't define these constants. They're defined in spt/cma.h
-// (formerly dce/cma.h), but this header is not included or provided
-// by T1248 G07-AAL.
-#define cma_c_prio_fifo_min 16
-#define cma_c_prio_fifo_mid 24
-#define cma_c_prio_fifo_max 31
-#define cma_c_prio_rr_min 16
-#define cma_c_prio_rr_mid 24
-#define cma_c_prio_rr_max 31
-#define cma_c_prio_through_min 8
-#define cma_c_prio_through_mid 12
-#define cma_c_prio_through_max 15
-#define cma_c_prio_back_min 1
-#define cma_c_prio_back_mid 4
-#define cma_c_prio_back_max 7
-
-// Enable NSK Pluggable Protocols
-#define TAO_HAS_NSKPW 1
-#define TAO_HAS_NSKFS 1
-
-//=========================================================================
-// Platform specific parts
-//=========================================================================
-
-// Platform lacks getpwnam_r() methods (e.g., SGI 6.2).
-#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
-
-// Platform/compiler lacks {get,set}rlimit() function
-#define ACE_LACKS_RLIMIT
-
-// The platform doesn't have mmap(2)
-#define ACE_LACKS_MMAP
-
-// Platform lacks streambuf "linebuffered ()". [C++ iostream]
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-
-// Platform supports recvmsg and sendmsg
-#define ACE_HAS_MSG
-
-// Platform defines ACE_HAS_MSG, but lacks msg_accrights{,len}.
-#define ACE_LACKS_MSG_ACCRIGHTS
-
-// Platform supports sigsuspend()
-#define ACE_HAS_SIGSUSPEND
-
-// Platform/compiler has the sigwait(2) prototype
-#define ACE_HAS_SIGWAIT
-
-// Compiler/platform defines the sig_atomic_t typedef
-#define ACE_HAS_SIG_ATOMIC_T
-
-// OS/compiler uses size_t * rather than int * for socket lengths
-#define ACE_HAS_SIZET_SOCKET_LEN
-
-// OS/compiler uses void * arg 4 setsockopt() rather than const char *
-#define ACE_HAS_VOIDPTR_SOCKOPT
-
-// The platform doesn't have mprotect(2)
-#define ACE_LACKS_MPROTECT
-
-// Platform lacks msync()
-#define ACE_LACKS_MSYNC
-
-// Platform does not support reentrant netdb functions (getprotobyname_r,
-// getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r).
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support
-
-// Platform lacks madvise()
-#define ACE_LACKS_MADVISE
-
-// Platform lacks pri_t
-#define ACE_LACKS_PRI_T
-
-// Platform lacks a working sbrk()
-#define ACE_LACKS_SBRK
-
-// Platform doesn't have syscall() prototype
-#define ACE_LACKS_SYSCALL
-
-// Platform lacks the inet_aton() function.
-#define ACE_LACKS_INET_ATON
-
-// Compiler/platform has Dirent iterator functions
-#define ACE_HAS_DIRENT
-
-// Platform uses ACE_HAS_DIRENT but does not have readdir_r()
-#define ACE_LACKS_READDIR_R
-
-// Platform supports getpagesize() call (otherwise,
-// ACE_PAGE_SIZE must be defined)
-#define ACE_HAS_GETPAGESIZE
-
-// Platform supports IP multicast
-#define ACE_HAS_IP_MULTICAST
-
-// Platform's select() uses non-const timeval*
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-
-// Platform supports POSIX O_NONBLOCK semantics
-#define ACE_HAS_POSIX_NONBLOCK
-
-// Platform lacks named POSIX semaphores
-#define ACE_LACKS_NAMED_POSIX_SEM
-
-// Platform has support for multi-byte character support compliant
-// with the XPG4 Worldwide Portability Interface wide-character
-// classification.
-#define ACE_HAS_XPG4_MULTIBYTE_CHAR
-
-// No wcsstr function available for this compiler
-#define ACE_LACKS_WCSSTR
-
-// No wctype.h available for this compiler
-#define ACE_LACKS_WCTYPE_H
-
-// Platform supports the POSIX regular expression library.
-// [Note Tandem NSK platform does have regular expresson support but it
-// does not follow the assumptions made by ACE. To use it would need
-// to make some ACE modifications.]
-//#define ACE_HAS_REGEX
-
-// Platform doesn't have truncate()
-#define ACE_LACKS_TRUNCATE
-
-// Platform lacks readers/writer locks.
-#define ACE_LACKS_RWLOCK_T
-
-// Compiler's 'new' throws exception on failure (ANSI C++ behavior).
-#define ACE_NEW_THROWS_EXCEPTIONS
-
-// Optimize ACE_Handle_Set::count_bits for select() operations (common
-// case)
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-
-// Platform lacks setreuid()
-#define ACE_LACKS_SETREUID
-
-// Platform lacks setregid()
-#define ACE_LACKS_SETREGID
-
-// Compile using multi-thread libraries
-#define ACE_MT_SAFE 1
-
-
-
-// Platform supports System V IPC
-#define ACE_HAS_SYSV_IPC
-
-#define ACE_LACKS_SO_SNDBUF
-#define ACE_LACKS_SO_RCVBUF
-
-// Platform lacks the socketpair() call
-#define ACE_LACKS_SOCKETPAIR
-
-// Platform limits the maximum socket message size.
-#define ACE_HAS_SOCK_BUF_SIZE_MAX
-
-// hrtime_t is a basic type that doesn't require ACE_U64_TO_U32 conversion
-#define ACE_HRTIME_T_IS_BASIC_TYPE
-
-// printf format specifiers for 64 bit integers
-# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Ld"
-# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld"
-
-//=========================================================================
-// Threads specific parts
-//=========================================================================
-
-// Platform supports threads
-#define ACE_HAS_THREADS
-
-// Platform supports POSIX Pthreads, of one form or another. This
-// macro says the platform has a pthreads variety - should also define
-// one of the below to say which one. Also may need some
-// ACE_HAS_... thing for extensions.
-#define ACE_HAS_PTHREADS
-
-// Standard pthreads supports only SCHED_FIFO
-#define ACE_HAS_ONLY_SCHED_FIFO
-
-// Compiler/platform has thread-specific storage
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-
-// Platform has no implementation of pthread_condattr_setpshared(),
-// even though it supports pthreads!
-#define ACE_LACKS_CONDATTR_PSHARED
-
-// pthread_cond_timedwait does *not* reset the time argument when the
-// lock is acquired.
-#define ACE_LACKS_COND_TIMEDWAIT_RESET
-
-// Platform lacks pthread_attr_setsched()
-#define ACE_LACKS_SETSCHED
-
-// Platform has pthread_mutexattr_setkind_np().
-#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP
-
-// Platform lacks pthread_mutexattr_setpshared().
-#define ACE_LACKS_MUTEXATTR_PSHARED
-
-// Platform lacks pthread_attr_setscope()
-#define ACE_LACKS_THREAD_PROCESS_SCOPING
-
-// Platform lacks pthread_attr_setstackaddr
-#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR
-
-// Defining ACE_HAS_UCONTEXT_T since G06.21 version of spthreads has
-// a definition for it.
-#ifdef ACE_TANDEM_T1248_PTHREADS
-#define ACE_HAS_UCONTEXT_T
-#endif
-
-#define ACE_LACKS_FD_MASK
-
-//=========================================================================
-// Include file characteristics
-//=========================================================================
-
-// Compiler/platform contains the <sys/syscall.h> file.
-#define ACE_HAS_SYS_SYSCALL_H
-
-// Platform lacks malloc.h
-#define ACE_LACKS_MALLOC_H
-
-// Platform lacks the siginfo.h include file
-#define ACE_LACKS_SIGINFO_H
-
-// Platform doesn't define struct strrecvfd.
-#define ACE_LACKS_STRRECVFD
-
-// Platform lacks the ucontext.h file
-#define ACE_LACKS_UCONTEXT_H
-
-// Prototypes for both signal() and struct sigaction are consistent.
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-
-// Platform supports the POSIX struct timespec type
-#define ACE_HAS_POSIX_TIME
-
-// Platform/compiler supports timezone * as second parameter to gettimeofday()
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-
-// Platform has <strings.h> (which contains bzero() prototype)
-#define ACE_HAS_STRINGS 1
-
-
-// OS/compiler omits the const from the iovec parameter in the
-// writev() prototype.
-#define ACE_HAS_NONCONST_WRITEV
-
-// Platform lacks <stdint.h>
-#define ACE_LACKS_STDINT_H
-
-// Platform lacks <inttypes.h>
-#define ACE_LACKS_INTTYPES_H
-
-// Platform lacks <sys/select.h>
-#define ACE_LACKS_SYS_SELECT_H
-
-// Platform lacks <dlfcn.h>
-#define ACE_LACKS_DLFCN_H
-
-// Platform lacks <semaphore.h>
-#define ACE_LACKS_SEMAPHORE_H
-
-// Platform lacks <poll.h>
-#define ACE_LACKS_POLL_H
-
-//=========================================================================
-// Compiler specific parts
-//=========================================================================
-
-// Compiler/platform has correctly prototyped header files
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-// Compiler/platform does not support the unsigned long long datatype.
-#define ACE_LACKS_LONGLONG_T
-
-// Compiler supports the ssize_t typedef
-#define ACE_HAS_SSIZE_T
-
-// Platform/compiler supports Standard C++ Library
-#define ACE_HAS_STANDARD_CPP_LIBRARY 0
-
-// Compiler's template mechanism must see source code (i.e.,
-// .cpp files).
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-
-// Platform has its standard c++ library in the namespace std.
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-
-// Compiler doesn't support static data member templates
-#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
-
-// Platform lacks "signed char" type (broken!)
-// Following will not be needed if use standard c library (G06.20 and later)
-#define ACE_LACKS_SIGNED_CHAR
-
-//=========================================================================
-// Build options
-//=========================================================================
-
-// For debugging problems in os calls (but this doesn't work too well
-// since output is not interleaved properly with output from ACE_TRACE
-//# define ACE_OS_TRACE(X) ::printf(X)
-
-// Uncomment the following if timed message blocks are needed (e.g.
-// for Dynamic_Priority_Test. Otherwise leave this disabled because
-// enabling it adds overhead to message blocks and timed message blocks
-// are "rarely used."
-//#define ACE_HAS_TIMED_MESSAGE_BLOCKS
-
-// Uncomment the following if tokens library is needed.
-//#define ACE_HAS_TOKENS_LIBRARY
-
-#include /**/ "ace/post.h"
-
-#endif /* ACE_CONFIG_NSK_H */
diff --git a/dep/acelite/ace/config-tandem-nsk-mips-v3.h b/dep/acelite/ace/config-tandem-nsk-mips-v3.h
deleted file mode 100644
index c037bed4ec8..00000000000
--- a/dep/acelite/ace/config-tandem-nsk-mips-v3.h
+++ /dev/null
@@ -1,454 +0,0 @@
-// -*- C++ -*-
-//
-// $Id: config-tandem-nsk-mips-v3.h 91685 2010-09-09 09:35:14Z johnnyw $
-
-
-#ifndef ACE_CONFIG_NSK_H
-#define ACE_CONFIG_NSK_H
-
-#include /**/ "ace/pre.h"
-
-// The following configuration file contains defines for Tandem NSK
-// platform, MIPS processor, version 3 C++ compiler.
-
-
-//=========================================================================
-// Tandem NSK specific parts
-//=========================================================================
-
-
-// Disable pthread renaming of symbols such as "open" and "close"
-#define _CMA_NOWRAPPERS_ 1
-
-// Get Handle_Set.cpp to generate correct bit operations for NSK platform
-#define ACE_TANDEM_NSK_BIT_ORDER
-
-// Use facilities provided by T1248 version of pthreads.
-// (If not defined, will use old version of pthreads.)
-#define ACE_TANDEM_T1248_PTHREADS
-
-// Use all available T1248 thread aware wrapper functions for providing
-// non-blocking I/O.
-// [Note: this causes a significant performance degradation]
-//#define ACE_TANDEM_T1248_PTHREADS_ALL_IO_WRAPPERS
-
-
-// Need this include here because some symbols defined by pthreads
-// (e.g. timespec_t) are needed before spthread.h is normally included
-// by ACE
-#ifdef ACE_TANDEM_T1248_PTHREADS
-#include <spthread.h>
-#else
-#include "pthread.h"
-#include "dce/cma_dispatch_coop.h"
-#endif
-
-// The following #defines are hacks to get around things
-// that seem to be missing or different in Tandem land
-#define NSIG 32 // missing from Signal.h
- // note: on nsk TNS/R there is room in
- // sigset_t for 128 signals but those
- // above 31 are not valid.
-#define MAXNAMLEN 248 // missing from dirent.h
-#define ERRMAX 4218 // from errno.h
-
-// Following seems to be missing from G06.20 version of standard
-// pthreads includes (it appeared in older version of standard pthreads)
-// (SCHED_FIFO (aka cma_c_sched_fifo) used in Dynamic_Priority_Test)
-#ifdef ACE_TANDEM_T1248_PTHREADS
-typedef enum CMA_T_SCHED_POLICY {
- cma_c_sched_fifo = 0,
- cma_c_sched_rr = 1,
- cma_c_sched_throughput = 2,
- cma_c_sched_background = 3,
- cma_c_sched_ada_low = 4
- } cma_t_sched_policy;
-#endif
-
-// T1248 doesn't define these constants. They're defined in spt/cma.h
-// (formerly dce/cma.h), but this header is not included or provided
-// by T1248 G07-AAL.
-#define cma_c_prio_fifo_min 16
-#define cma_c_prio_fifo_mid 24
-#define cma_c_prio_fifo_max 31
-#define cma_c_prio_rr_min 16
-#define cma_c_prio_rr_mid 24
-#define cma_c_prio_rr_max 31
-#define cma_c_prio_through_min 8
-#define cma_c_prio_through_mid 12
-#define cma_c_prio_through_max 15
-#define cma_c_prio_back_min 1
-#define cma_c_prio_back_mid 4
-#define cma_c_prio_back_max 7
-
-// Enable NSK Pluggable Protocols
-#define TAO_HAS_NSKPW 1
-#define TAO_HAS_NSKFS 1
-
-//=========================================================================
-// Platform specific parts
-//=========================================================================
-
-// Platform lacks getpwnam_r() methods (e.g., SGI 6.2).
-#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
-
-// Platform/compiler lacks {get,set}rlimit() function
-#define ACE_LACKS_RLIMIT
-
-// The platform doesn't have mmap(2)
-#define ACE_LACKS_MMAP
-
-// Platform lacks streambuf "linebuffered ()". [C++ iostream]
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-
-// Platform supports recvmsg and sendmsg
-#define ACE_HAS_MSG
-
-// Platform defines ACE_HAS_MSG, but lacks msg_accrights{,len}.
-#define ACE_LACKS_MSG_ACCRIGHTS
-
-// Platform supports sigsuspend()
-#define ACE_HAS_SIGSUSPEND
-
-// Platform/compiler has the sigwait(2) prototype
-#define ACE_HAS_SIGWAIT
-
-// Compiler/platform defines the sig_atomic_t typedef
-#define ACE_HAS_SIG_ATOMIC_T
-
-// OS/compiler uses size_t * rather than int * for socket lengths
-#define ACE_HAS_SIZET_SOCKET_LEN
-
-// OS/compiler uses void * arg 4 setsockopt() rather than const char *
-#define ACE_HAS_VOIDPTR_SOCKOPT
-
-// The platform doesn't have mprotect(2)
-#define ACE_LACKS_MPROTECT
-
-// Platform lacks msync()
-#define ACE_LACKS_MSYNC
-
-// Platform does not support reentrant netdb functions (getprotobyname_r,
-// getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r).
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support
-
-// Platform lacks madvise()
-#define ACE_LACKS_MADVISE
-
-// Platform lacks pri_t
-#define ACE_LACKS_PRI_T
-
-// Platform lacks a working sbrk()
-#define ACE_LACKS_SBRK
-
-// Platform doesn't have syscall() prototype
-#define ACE_LACKS_SYSCALL
-
-// Platform lacks the inet_aton() function.
-#define ACE_LACKS_INET_ATON
-
-// Compiler/platform has Dirent iterator functions
-#define ACE_HAS_DIRENT
-
-// Platform uses ACE_HAS_DIRENT but does not have readdir_r()
-#define ACE_LACKS_READDIR_R
-
-// Platform supports getpagesize() call (otherwise,
-// ACE_PAGE_SIZE must be defined)
-#define ACE_HAS_GETPAGESIZE
-
-// Platform supports IP multicast
-#define ACE_HAS_IP_MULTICAST
-
-// Platform's select() uses non-const timeval*
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-
-// Platform supports POSIX O_NONBLOCK semantics
-#define ACE_HAS_POSIX_NONBLOCK
-
-// Platform lacks named POSIX semaphores
-#define ACE_LACKS_NAMED_POSIX_SEM
-
-// Platform has support for multi-byte character support compliant
-// with the XPG4 Worldwide Portability Interface wide-character
-// classification.
-#define ACE_HAS_XPG4_MULTIBYTE_CHAR
-
-// No wcsstr function available for this compiler
-#define ACE_LACKS_WCSSTR
-
-// No wctype.h available for this compiler
-#define ACE_LACKS_WCTYPE_H
-
-// Platform supports the POSIX regular expression library.
-// [Note Tandem NSK platform does have regular expresson support but it
-// does not follow the assumptions made by ACE. To use it would need
-// to make some ACE modifications.]
-//#define ACE_HAS_REGEX
-
-// Platform doesn't have truncate()
-#define ACE_LACKS_TRUNCATE
-
-// Platform lacks readers/writer locks.
-#define ACE_LACKS_RWLOCK_T
-
-// Compiler's 'new' throws exception on failure (ANSI C++ behavior).
-#define ACE_NEW_THROWS_EXCEPTIONS
-
-// Optimize ACE_Handle_Set::count_bits for select() operations (common
-// case)
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-
-// Platform lacks setreuid()
-#define ACE_LACKS_SETREUID
-
-// Platform lacks setregid()
-#define ACE_LACKS_SETREGID
-
-// Compile using multi-thread libraries
-#define ACE_MT_SAFE 1
-
-
-
-// Platform supports System V IPC
-#define ACE_HAS_SYSV_IPC
-
-#define ACE_LACKS_SO_SNDBUF
-#define ACE_LACKS_SO_RCVBUF
-
-// Platform lacks the socketpair() call
-#define ACE_LACKS_SOCKETPAIR
-
-// Platform limits the maximum socket message size.
-#define ACE_HAS_SOCK_BUF_SIZE_MAX
-
-// hrtime_t is a basic type that doesn't require ACE_U64_TO_U32 conversion
-#define ACE_HRTIME_T_IS_BASIC_TYPE
-
-// printf format specifiers for 64 bit integers
-# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Ld"
-# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld"
-
-// Use larger default buffer size for ease of interoperability
-#define ACE_DEFAULT_CDR_BUFSIZE 4096
-
-// Size of a wchar
-#define ACE_SIZEOF_WCHAR 2
-
-// Platform lacks time typedefs
-#define ACE_LACKS_SUSECONDS_T
-#define ACE_LACKS_USECONDS_T
-
-// Platform lacks setegid() and seteuid()
-#define ACE_LACKS_SETEGID
-#define ACE_LACKS_SETEUID
-
-// Platform lacks vsnprintf()
-#define ACE_LACKS_VSNPRINTF
-
-// Platform lacks log2()
-#define ACE_LACKS_LOG2
-
-// Platform lacks alphasort()
-#define ACE_LACKS_ALPHASORT
-
-#define ACE_LACKS_FD_MASK
-#define ACE_LACKS_NFDBITS
-
-//=========================================================================
-// Threads specific parts
-//=========================================================================
-
-// Platform supports threads
-#define ACE_HAS_THREADS
-
-// Platform supports POSIX Pthreads, of one form or another. This
-// macro says the platform has a pthreads variety - should also define
-// one of the below to say which one. Also may need some
-// ACE_HAS_... thing for extensions.
-#define ACE_HAS_PTHREADS
-
-// Standard pthreads supports only SCHED_FIFO
-#define ACE_HAS_ONLY_SCHED_FIFO
-
-// Compiler/platform has thread-specific storage
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-
-// Platform has no implementation of pthread_condattr_setpshared(),
-// even though it supports pthreads!
-#define ACE_LACKS_CONDATTR_PSHARED
-
-// pthread_cond_timedwait does *not* reset the time argument when the
-// lock is acquired.
-#define ACE_LACKS_COND_TIMEDWAIT_RESET
-
-// Platform lacks pthread_attr_setsched()
-#define ACE_LACKS_SETSCHED
-
-// Platform has pthread_getschedparam and pthread_setschedparam
-// even when ACE_LACKS_SETSCHED is defined.
-#define ACE_HAS_PTHREAD_SCHEDPARAM
-
-// Platform has pthread_mutexattr_setkind_np().
-#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP
-
-// Platform lacks pthread_mutexattr_setpshared().
-#define ACE_LACKS_MUTEXATTR_PSHARED
-
-// Platform lacks pthread_attr_setscope()
-#define ACE_LACKS_THREAD_PROCESS_SCOPING
-
-// Platform lacks pthread_attr_setstackaddr
-#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR
-
-// Platform lacks pthread_attr_setstack
-#define ACE_LACKS_PTHREAD_ATTR_SETSTACK
-
-// Defining ACE_HAS_UCONTEXT_T since G06.21 version of spthreads has
-// a definition for it.
-#ifdef ACE_TANDEM_T1248_PTHREADS
-#define ACE_HAS_UCONTEXT_T
-#endif
-
-//=========================================================================
-// Include file characteristics
-//=========================================================================
-
-// Compiler/platform contains the <sys/syscall.h> file.
-#define ACE_HAS_SYS_SYSCALL_H
-
-// Platform lacks malloc.h
-#define ACE_LACKS_MALLOC_H
-
-// Platform lacks the siginfo.h include file
-#define ACE_LACKS_SIGINFO_H
-
-// Platform doesn't define struct strrecvfd.
-#define ACE_LACKS_STRRECVFD
-
-// Platform lacks the ucontext.h file
-#define ACE_LACKS_UCONTEXT_H
-
-// Prototypes for both signal() and struct sigaction are consistent.
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-
-// Platform supports the POSIX struct timespec type
-#define ACE_HAS_POSIX_TIME
-
-// Platform/compiler supports timezone * as second parameter to gettimeofday()
-#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
-
-// Platform has <strings.h> (which contains bzero() prototype)
-#define ACE_HAS_STRINGS 1
-
-
-// OS/compiler omits the const from the iovec parameter in the
-// writev() prototype.
-#define ACE_HAS_NONCONST_WRITEV
-
-// Platform lacks <stdint.h>
-#define ACE_LACKS_STDINT_H
-
-// Platform lacks <inttypes.h>
-#define ACE_LACKS_INTTYPES_H
-
-// Platform lacks <sys/select.h>
-#define ACE_LACKS_SYS_SELECT_H
-
-// Platform lacks <dlfcn.h>
-#define ACE_LACKS_DLFCN_H
-
-// Platform lacks <semaphore.h>
-#define ACE_LACKS_SEMAPHORE_H
-
-// Platform lacks <poll.h>
-#define ACE_LACKS_POLL_H
-
-// Platform lacks <sys/sysctl.h>
-#define ACE_LACKS_SYS_SYSCTL_H
-
-//=========================================================================
-// Compiler specific parts
-//=========================================================================
-
-// Compiler/platform has correctly prototyped header files
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-// Compiler/platform does not support the unsigned long long datatype.
-#define ACE_LACKS_UNSIGNEDLONGLONG_T
-
-// Compiler supports the ssize_t typedef
-#define ACE_HAS_SSIZE_T
-
-// Platform/compiler supports Standard C++ Library
-#define ACE_HAS_STANDARD_CPP_LIBRARY 1
-
-// Compiler's template mechanism must see source code (i.e.,
-// .cpp files).
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-
-// Platform/Compiler supports a String class
-#define ACE_HAS_STRING_CLASS
-#define ACE_HAS_STDCPP_STL_INCLUDES
-
-// Platform has its standard c++ library in the namespace std.
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-
-// Compiler doesn't support static data member templates
-#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
-
-// Platform lacks "signed char" type (broken!)
-// Following will not be needed if use standard c library (G06.20 and later)
-#define ACE_LACKS_SIGNED_CHAR
-
-// Compiler can handle any operators in namespace
-#define ACE_ANY_OPS_USE_NAMESPACE
-
-// Platform lacks intptr_t typedef
-#define ACE_LACKS_INTPTR_T
-
-//=========================================================================
-// C++ version3 import/export macros
-//=========================================================================
-
-// Define the export macros needed to export symbols outside a DLL
-// The ACE_IMPORT_SINGLETON_DECLARE macro has been modified to not explicitly
-// instantiate the class template.
-#if defined(USE_EXPLICIT_EXPORT)
-#define ACE_LACKS_INLINE_FUNCTIONS
-
-#define ACE_HAS_CUSTOM_EXPORT_MACROS
-#define ACE_Proper_Export_Flag export$
-#define ACE_Proper_Import_Flag import$
-#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class export$ T
-#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class export$ SINGLETON_TYPE<CLASS, LOCK>;
-#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class import$ T
-#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class import$ SINGLETON_TYPE <CLASS, LOCK>;
-#endif
-
-
-//=========================================================================
-// Build options
-//=========================================================================
-
-// For debugging problems in os calls (but this doesn't work too well
-// since output is not interleaved properly with output from ACE_TRACE
-//# define ACE_OS_TRACE(X) ::printf(X)
-
-// Uncomment the following if timed message blocks are needed (e.g.
-// for Dynamic_Priority_Test. Otherwise leave this disabled because
-// enabling it adds overhead to message blocks and timed message blocks
-// are "rarely used."
-//#define ACE_HAS_TIMED_MESSAGE_BLOCKS
-
-// Uncomment the following if tokens library is needed.
-//#define ACE_HAS_TOKENS_LIBRARY
-
-// NonStop CORBA uses the XML Service Configurator
-#define ACE_HAS_XML_SVC_CONF
-
-#define ACE_LD_SEARCH_PATH "_RLD_LIB_PATH"
-
-#include /**/ "ace/post.h"
-
-#endif /* ACE_CONFIG_NSK_H */
diff --git a/dep/acelite/ace/config-tandem.h b/dep/acelite/ace/config-tandem.h
deleted file mode 100644
index fa2869b3ca8..00000000000
--- a/dep/acelite/ace/config-tandem.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- C++ -*- */
-// Testing TANDEM
-// $Id: config-tandem.h 91781 2010-09-15 12:49:15Z johnnyw $
-
-// The following configuration file is designed to work for Tandems NonStop-UX
-// 4.2MP platforms using the NCC 3.20 compiler.
-
-// Note this is a test version it might include several errors I
-// have done a test and set/unset until I errors disappered.
-// Some of the options that should be set aren't because of the simple fact
-// that i haven't the time to check what is wrong.
-// e.g. widecharacter are supported but a wcstok which only take 2 parameters
-// are included by the compiler, to get the correct wcstok that takes 3 params
-// we must set _XOPEN_SOURCE and we get ALOT of errors and warnings.
-// So this config is done to get things to start to work it isn't finished.
-// Janne (Jan.Perman@osd.Ericsson.se)
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-#include /**/ "ace/pre.h"
-
-#if ! defined (__ACE_INLINE__)
-# define __ACE_INLINE__
-#endif /* ! __ACE_INLINE__ */
-
-#define ACE_HAS_IDTYPE_T
-// Optimize ACE_Handle_Set for select().
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-
-// Tandem doesn't include this although they are defined
-// in sys/time.h and sys/resource.h
-#define ACE_LACKS_RLIMIT_PROTOTYPE // jjpp
-// Tandem has a function to set t_errno (set_t_errno)
-#define ACE_HAS_SET_T_ERRNO // jjpp
-
-//Platform supports System V IPC (most versions of UNIX, but not Win32)
-#define ACE_HAS_SYSV_IPC
-
-// OS/compiler omits the const from the sendmsg() prototype.
-#define ACE_HAS_NONCONST_SENDMSG
-
-//Platform supports system configuration information
-#define ACE_HAS_SYS_SYSTEMINFO_H
-#define ACE_HAS_SYSV_SYSINFO
-
-//Platform supports the POSIX regular expression library
-#define ACE_HAS_REGEX
-
-// Platform supports recvmsg and sendmsg
-#define ACE_HAS_MSG
-
-//Compiler/platform contains the <sys/syscall.h> file.
-#define ACE_HAS_SYS_SYSCALL_H
-
-//Platform provides <sysent.h> header
-#define ACE_HAS_SYSENT_H
-
-// Platform has POSIX terminal interface.
-#define ACE_HAS_TERMIOS
-
-//Platform supports POSIX O_NONBLOCK semantics
-#define ACE_HAS_POSIX_NONBLOCK
-
-// Compiler/platform has correctly prototyped header files
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-//Compiler/platform supports alloca()
-// Although ACE does have alloca() on this compiler/platform combination, it is
-// disabled by default since it can be dangerous. Uncomment the following line
-// if you ACE to use it.
-//#define ACE_HAS_ALLOCA
-
-//Compiler/platform has <alloca.h>
-#define ACE_HAS_ALLOCA_H
-
-//Platform contains <poll.h>
-#define ACE_HAS_POLL
-
-// Platform supports the POSIX struct timespec type
-#define ACE_HAS_POSIX_TIME // As i understand it, but i'm in deep water
-//Platform supports the SVR4 timestruc_t type
-
-// To get this to work a patch in sys/signal must be made
-// typedef void SIG_FUNC_TYPE(int);
-//#if defined (__cplusplus)
-// void (*sa_handler)(int);
-//#else
-// ...
-//#endif
-//#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-#define ACE_HAS_TANDEM_SIGNALS
-//Compiler/platform defines the sig_atomic_t typedef
-#define ACE_HAS_SIG_ATOMIC_T
-//Platform supports SVR4 extended signals
-#define ACE_HAS_SIGINFO_T
-//Platform supports ucontext_t (which is used in the extended signal API).
-#define ACE_HAS_UCONTEXT_T
-
-// Platform/compiler has the sigwait(2) prototype
-#define ACE_HAS_SIGWAIT
-
-//Compiler/platform provides the sockio.h file
-#define ACE_HAS_SYS_SOCKIO_H
-
-// Compiler supports the ssize_t typedef
-#define ACE_HAS_SSIZE_T // Limits.h must be included
-
-//Platform supports STREAMS
-#define ACE_HAS_STREAMS
-
-#define ACE_HAS_STREAM_PIPES
-//Platform supports STREAM pipes
-
-//Compiler/platform supports struct strbuf
-#define ACE_HAS_STRBUF_T
-
-//Compiler/platform supports SVR4 dynamic linking semantics
-#define ACE_HAS_SVR4_DYNAMIC_LINKING
-
-//Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)...
-#define ACE_HAS_SVR4_TLI
-
-//Platform provides <sys/filio.h> header
-#define ACE_HAS_SYS_FILIO_H
-
-//Platform supports TLI timod STREAMS module
-#define ACE_HAS_TIMOD_H
-//Platform supports TLI tiuser header
-#define ACE_HAS_TIUSER_H
-
-//Platform supports TLI
-#define ACE_HAS_TLI
-//Platform provides TLI function prototypes
-#define ACE_HAS_TLI_PROTOTYPES
-
-//Platform lacks streambuf "linebuffered ()".
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF
-
-// Platform lacks "signed char" type (broken!)
-#define ACE_LACKS_SIGNED_CHAR
-
-
-#define ACE_PAGE_SIZE 4096
-// Defines the page size of the system (not used on Win32 or
-// with ACE_HAS_GETPAGESIZE).
-
-/****** THREAD SPECIFIC **********/
-/* If you want to remove threading then comment out the following four #defines .*/
-#if !defined (ACE_MT_SAFE)
- #define ACE_MT_SAFE 1 //Compile using multi-thread libraries
-#endif
-#define ACE_HAS_THREADS //Platform supports threads
-#define ACE_HAS_STHREADS //Platform supports Solaris threads
-
-// Compiler/platform has threadspecific storage
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-
-#define ACE_HAS_THR_MINSTACK // Tandem uses thr_minstack instead of thr_min_stack
-#define ACE_LACKS_PRI_T // Tandem lacks pri_t
-#define ACE_HAS_THR_KEYDELETE
-
-//*************************************
-
-/*********************************/
-
-/******* SIGNAL STUFF *******/
-
-//Platform uses non-const char * in calls to gethostbyaddr, gethostbyname,
-// getservbyname
-#define ACE_HAS_NONCONST_GETBY
-#define ACE_HAS_NONCONST_INET_ADDR
-// Platform's select() uses non-const timeval* (only found on Linux right now)
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-// And on Tandem :-)
-//Uses ctime_r & asctime_r with only two parameters vs. three.
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-//Platform has special header for select().
-#define ACE_HAS_SELECT_H
-// Platform/compiler supports Standard C++ Library
-#define ACE_HAS_STANDARD_CPP_LIBRARY
-//Platform lacks madvise() (e.g., Linux)
-#define ACE_LACKS_MADVISE
-#define ACE_LACKS_STRCASECMP
-
-// Defines the page size of the system.
-#define ACE_PAGE_SIZE 4096
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-tru64.h b/dep/acelite/ace/config-tru64.h
deleted file mode 100644
index 45a7aa6bd53..00000000000
--- a/dep/acelite/ace/config-tru64.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-tru64.h 87270 2009-10-29 21:47:47Z olli $
-
-// The following configuration file is designed to work for the
-// Digital UNIX V4.0a and later platforms. It relies on
-// config-osf1-4.0.h, and adds deltas for newer platforms.
-
-#ifndef ACE_CONFIG_TRU64_H
-#define ACE_CONFIG_TRU64_H
-#include /**/ "ace/pre.h"
-
-#if !defined (__ACE_INLINE__)
-# define __ACE_INLINE__
-#endif /* ! __ACE_INLINE__ */
-
-// Compile using multi-thread libraries.
-#if !defined (ACE_MT_SAFE)
-# define ACE_MT_SAFE 1
-#endif /* ! ACE_MT_SAFE */
-
-/*clearerr is not defined when _REENTRANT is not defined*/
-#if ACE_MT_SAFE == 0
-#define ACE_LACKS_CLEARERR
-#endif /* ACE_MT_SAFE == 0 */
-
-#include "ace/config-posix.h"
-
-// Configuration-specific #defines:
-// 1) g++ or cxx
-// 2) pthreads or DCE threads
-#if defined (__GNUG__)
- // g++ with pthreads
-
- // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so
- // this must appear before its #include.
-# define ACE_HAS_STRING_CLASS
-
-# include "ace/config-g++-common.h"
-
-# define ACE_HAS_REENTRANT_FUNCTIONS
-#elif defined (__DECCXX)
-
-# define ACE_CONFIG_INCLUDE_CXX_COMMON
-# include "ace/config-cxx-common.h"
-
-#elif defined (__rational__)
-# define ACE_HAS_REENTRANT_FUNCTIONS
-# define ACE_HAS_STRING_CLASS
-# define ACE_LACKS_LINEBUFFERED_STREAMBUF
-# define ACE_LACKS_SIGNED_CHAR
-
- // Exceptions are enabled by platform_osf1_4.0_rcc.GNU.
-# define ACE_HAS_STDCPP_STL_INCLUDES
-#else
-# ifdef __cplusplus /* Let it slide for C compilers. */
-# error unsupported compiler on Digital Unix
-# endif /* __cplusplus */
-#endif /* ! __GNUG__ && ! __DECCXX && ! __rational__ */
-
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-#define ACE_HAS_BROKEN_IF_HEADER
-#if (ACE_MT_SAFE != 0)
-# define ACE_HAS_PTHREADS
-# define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS
-#endif /* ACE_MT_SAFE != 0 */
-#define ACE_LACKS_T_ERRNO
-#if !defined (DIGITAL_UNIX)
-# define DIGITAL_UNIX 0x400
-#endif /* ! DIGITAL_UNIX */
-
-#define ACE_SIZEOF_LONG 8
-
-#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
-#define ACE_HAS_AUTOMATIC_INIT_FINI
-#define ACE_HAS_NONCONST_SETRLIMIT
-#define ACE_HAS_BROKEN_T_ERROR
-#define ACE_HAS_NONCONST_WRITEV
-#define ACE_HAS_CLOCK_GETTIME
-#define ACE_HAS_CLOCK_SETTIME
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
-#define ACE_HAS_CPLUSPLUS_HEADERS
-#define ACE_HAS_DIRENT
-#define ACE_HAS_GETRUSAGE
-#define ACE_HAS_GPERF
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
-#define ACE_HAS_IP_MULTICAST
-#define ACE_HAS_LLSEEK
-#define ACE_HAS_LONG_MAP_FAILED
-#define ACE_HAS_MSG
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_HAS_NONCONST_SENDMSG
-#define ACE_HAS_OSF1_GETTIMEOFDAY
-#define ACE_HAS_OSF_TIMOD_H
-#define ACE_HAS_POLL
-#define ACE_HAS_POSIX_NONBLOCK
-#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PRIOCNTL
-#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_SIG_ATOMIC_T
-#define ACE_HAS_SSIZE_T
-#define ACE_HAS_STRBUF_T
-#define ACE_HAS_STREAMS
-#define ACE_HAS_STRPTIME
-#define ACE_HAS_SVR4_DYNAMIC_LINKING
-#define ACE_HAS_SVR4_SIGNAL_T
-#define ACE_HAS_SYS_SYSCALL_H
-#define ACE_HAS_SYSV_IPC
-#if (ACE_MT_SAFE == 0)
-// clearerr is not defined when _REENTRANT is not defined
-#define ACE_LACKS_CLEARERR
-#else /* ACE_MT_SAFE != 0 */
-#define ACE_HAS_THREADS
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR
-#endif /* ACE_MT_SAFE != 0 */
-#define ACE_HAS_TIUSER_H
-#define ACE_HAS_XTI
-#define ACE_HAS_TLI_PROTOTYPES
-#define ACE_HAS_UALARM
-#define ACE_HAS_UCONTEXT_T
-#define ACE_LACKS_PRI_T
-#define ACE_LACKS_RWLOCK_T
-#define ACE_PAGE_SIZE 8192
-#define ACE_HAS_SIGTIMEDWAIT
-#define ACE_HAS_SIGSUSPEND
-
-// DJT 6/10/96 All these broken macro's can now be removed with the
-// approporiate ordering of the include files. The Platinum release
-// now temporarily supports both forms. Platform's implementation of
-// sendmsg() has a non-const msgheader parameter.
-#define ACE_HAS_NONCONST_SENDMSG
-#define ACE_HAS_IDTYPE_T
-#define ACE_HAS_NONSTATIC_OBJECT_MANAGER
-
-#if DIGITAL_UNIX >= 0x500
-# define ACE_HAS_XPG4_MULTIBYTE_CHAR 1
-#endif /* DIGITAL_UNIX >= 0x500 */
-
-#if DIGITAL_UNIX >= 0x40E
-# define ACE_LACKS_STDINT_H
-#endif /* DIGITAL_UNIX >= 0x40E */
-
-#if (DIGITAL_UNIX >= 0x400) && (DIGITAL_UNIX < 0x500)
-#define ACE_LACKS_PREAD_PROTOTYPE
-#endif /* (DIGITAL_UNIX >= 0x400) && (DIGITAL_UNIX < 0x500) */
-
-// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses
-#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_TRU64_H */
diff --git a/dep/acelite/ace/config-unixware-7.1.0.h b/dep/acelite/ace/config-unixware-7.1.0.h
deleted file mode 100644
index 820e7fb763a..00000000000
--- a/dep/acelite/ace/config-unixware-7.1.0.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-unixware-7.1.0.h 87268 2009-10-29 21:06:06Z olli $
-
-#ifndef ACE_CONFIG_H
-#define ACE_CONFIG_H
-
-/* ACE configuration header file */
-
-/* Include the commong gnu config file */
-#include "config-g++-common.h"
-
-/* For unixware 7.1 && g++ 2.91.57, see if this fixes my problem */
-#ifndef UNIXWARE_7_1
-#define UNIXWARE_7_1
-#endif
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if lex declares yytext as a char * by default, not a char[]. */
-#define YYTEXT_POINTER 1
-
-/* Define _REENTRANT if reentrant functions should be used. */
-#ifndef _REENTRANT
-# define _REENTRANT 1
-#endif
-
-#define ACE_HAS_NEW_NO_H 1
-#define ACE_HAS_STDEXCEPT_NO_H 1
-
-#define ACE_THREAD_MIN_PRIORITY 0
-#if defined (ACE_THREAD_MIN_PRIORITY)
-# define PTHREAD_MIN_PRIORITY ACE_THREAD_MIN_PRIORITY
-#endif /* #if defined (ACE_THREAD_MIN_PRIORITY) */
-
-#define ACE_THREAD_MAX_PRIORITY 99
-#if defined (ACE_THREAD_MAX_PRIORITY)
-# define PTHREAD_MAX_PRIORITY ACE_THREAD_MAX_PRIORITY
-#endif /* #if defined (ACE_THREAD_MAX_PRIORITY) */
-
-/* Specify sizes of given built-in types. If a size isn't defined here,
- then ace/Basic_Types.h will attempt to deduce the size. */
-/* #undef ACE_SIZEOF_CHAR */
-#define ACE_SIZEOF_SHORT 2
-#define ACE_SIZEOF_INT 4
-#define ACE_SIZEOF_LONG 4
-#define ACE_SIZEOF_LONG_LONG 8
-#define ACE_SIZEOF_VOID_P 4
-#define ACE_SIZEOF_FLOAT 4
-#define ACE_SIZEOF_DOUBLE 8
-#define ACE_SIZEOF_LONG_DOUBLE 12
-
-/* Enable ACE inlining */
-#define __ACE_INLINE__ 1
-
-/* OS has priocntl (2) */
-#define ACE_HAS_PRIOCNTL 1
-
-/* Platform has pread() and pwrite() support */
-#define ACE_HAS_P_READ_WRITE 1
-
-/* Compiler/platform supports alloca() */
-// Although ACE does have alloca() on this compiler/platform combination, it is
-// disabled by default since it can be dangerous. Uncomment the following line
-// if you ACE to use it.
-//#define ACE_HAS_ALLOCA 1
-
-/* Compiler/platform correctly calls init()/fini() for shared libraries */
-#define ACE_HAS_AUTOMATIC_INIT_FINI 1
-
-/* Platform doesn't cast MAP_FAILED to a (void *). */
-/* #undef ACE_HAS_BROKEN_MAP_FAILED */
-/* Staller: oh yes, let's do this! */
-#define ACE_HAS_BROKEN_MAP_FAILED
-
-/* Prototypes for both signal() and struct sigaction are consistent. */
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1
-
-/* Platform supports operations on directories via struct dirent,
- readdir_r, etc. */
-#define ACE_HAS_DIRENT 1
-
-/* Compiler supports C++ exception handling */
-// MM-Graz if ! defined inserted, to prevent warnings, because it is already
-// defined in config-g++common.h
-# if !defined (ACE_HAS_EXCEPTIONS)
-#define ACE_HAS_EXCEPTIONS 1
-# endif
-
-/* Platform supports getpagesize() call (otherwise, ACE_PAGE_SIZE must be
- defined, except on Win32) */
-#define ACE_HAS_GETPAGESIZE 1
-
-/* Platform supports the getrusage() system call. */
-#define ACE_HAS_GETRUSAGE 1
-
-/* Platform has a getrusage () prototype in sys/resource.h that differs from
- the one in ace/OS.i. */
-#define ACE_HAS_GETRUSAGE_PROTOTYPE 1
-
-/* The GPERF utility is compiled for this platform */
-#define ACE_HAS_GPERF 1
-
-/* Optimize ACE_Handle_Set::count_bits for select() operations (common case) */
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1
-
-/* Compiler/platform supports idtype_t. */
-#define ACE_HAS_IDTYPE_T 1
-
-/* Platform supports IP multicast */
-#define ACE_HAS_IP_MULTICAST 1
-
-/* Platform supports thr_keydelete (e.g,. UNIXWARE) */
-#define ACE_HAS_THR_KEYDELETE 1
-
-/* Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem). */
-#define ACE_HAS_THR_MINSTACK 1
-
-/* Platform supports recvmsg and sendmsg */
-#define ACE_HAS_MSG 1
-
-/* Platform's select() uses non-const timeval* (only found on Linux right
- now) */
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL 1
-
-/* Uses ctime_r & asctime_r with only two parameters vs. three. */
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1
-
-/* Platform is an Intel Pentium microprocessor. */
-/* There is a problem with the gethrtime() because of (apparently) a problem
- with the inline assembly instruction. Hopefully there is a way to resolve
- that with an improvement to the assembler
-*/
-#ifdef ACE_HAS_PENTIUM
-#undef ACE_HAS_PENTIUM
-#endif /* ACE_HAS_PENTIUM */
-
-
-/* Platform contains <poll.h> */
-#define ACE_HAS_POLL 1
-
-/* Platform supports POSIX O_NONBLOCK semantics */
-#define ACE_HAS_POSIX_NONBLOCK 1
-
-/* Platform supports the POSIX struct timespec type */
-#define ACE_HAS_POSIX_TIME 1
-
-/* Platform supports the /proc file system and defines tid_t
- in <sys/procfs.h> */
-#define ACE_HAS_PROC_FS 1
-
-/* Platform supports POSIX Threads */
-#define ACE_HAS_PTHREADS 1
-
-/* pthread.h declares an enum with PTHREAD_PROCESS_PRIVATE and
- PTHREAD_PROCESS_SHARED values */
-#define ACE_HAS_PTHREAD_PROCESS_ENUM 1
-
-/* Platform will recurse infinitely on thread exits from TSS cleanup routines
- (e.g., AIX) */
-#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1
-
-/* Platform supports reentrant functions (i.e., all the POSIX *_r
- functions). */
-#define ACE_HAS_REENTRANT_FUNCTIONS 1
-
-/* Platform has support for multi-byte character support compliant with the
- XPG4 Worldwide Portability Interface wide-character classification. */
-#define ACE_HAS_XPG4_MULTIBYTE_CHAR 1
-
-/* Platform does not support reentrant netdb functions (getprotobyname_r,
- getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). */
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS 1
-
-/* Platform supports the POSIX regular expression library */
-#define ACE_HAS_REGEX 1
-
-/* Platform has special header for select(). */
-#define ACE_HAS_SELECT_H 1
-
-/* Platform has a function to set t_errno (e.g., Tandem). */
-#define ACE_HAS_SET_T_ERRNO 1
-
-/* Platform supports SVR4 extended signals */
-#define ACE_HAS_SIGINFO_T 1
-
-/* Platform/compiler has the sigwait(2) prototype */
-#define ACE_HAS_SIGWAIT 1
-
-/* Compiler/platform defines the sig_atomic_t typedef */
-#define ACE_HAS_SIG_ATOMIC_T 1
-
-/* Platform supports new BSD inet_addr len field. */
-#define ACE_HAS_SOCKADDR_IN_SIN_LEN 1
-
-/* OS/compiler uses size_t * rather than int * for socket lengths */
-#define ACE_HAS_SIZET_SOCKET_LEN 1
-
-/* Compiler/platform provides the sys/sockio.h file */
-#define ACE_HAS_SYS_SOCKIO_H 1
-
-/* Compiler supports the ssize_t typedef */
-#define ACE_HAS_SSIZE_T 1
-
-/* Platform supports UNIX International Threads */
-#define ACE_HAS_STHREADS 1
-
-/* Platform has thr_yield() */
-#define ACE_HAS_THR_YIELD 1
-
-/* Compiler/platform supports struct strbuf */
-#define ACE_HAS_STRBUF_T 1
-
-/* Platform supports STREAMS */
-#define ACE_HAS_STREAMS 1
-
-/* Platform supports STREAM pipes */
-#define ACE_HAS_STREAM_PIPES 1
-
-/* Platform/Compiler supports a String class (e.g., GNU or Win32). */
-#define ACE_HAS_STRING_CLASS 1
-
-/* Platform has <strings.h> (which contains bzero() prototype) */
-#define ACE_HAS_STRINGS 1
-
-/* Platform/compiler supports void * as second parameter to gettimeofday(). */
-#define ACE_HAS_VOIDPTR_GETTIMEOFDAY 1
-
-/* Compiler/platform supports SVR4 dynamic linking semantics */
-#define ACE_HAS_SVR4_DYNAMIC_LINKING 1
-
-/* Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... */
-#define ACE_HAS_SVR4_TLI 1
-
-/* Compiler/platform contains the <sys/syscall.h> file. */
-#define ACE_HAS_SYS_SYSCALL_H 1
-
-/* Platform supports system configuration information */
-#define ACE_HAS_SYS_SYSTEMINFO_H
-#define ACE_HAS_SYSV_SYSINFO 1
-
-/* Platform supports System V IPC (most versions of UNIX, but not Win32) */
-#define ACE_HAS_SYSV_IPC 1
-
-/* Platform provides <sys/filio.h> header */
-#define ACE_HAS_SYS_FILIO_H 1
-
-/* Platform provides <sys/xti.h> header */
-#define ACE_HAS_SYS_XTI_H 1
-
-/* Platform has POSIX terminal interface. */
-#define ACE_HAS_TERMIOS 1
-
-/* Platform supports threads */
-#define ACE_HAS_THREADS 1
-
-/* Compiler/platform has thread-specific storage */
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1
-
-/* Platform supports TLI timod STREAMS module */
-#define ACE_HAS_TIMOD_H 1
-
-/* Platform supports TLI tiuser header */
-#define ACE_HAS_TIUSER_H 1
-
-/* Platform supports TLI. Also see ACE_TLI_TCP_DEVICE. */
-#define ACE_HAS_TLI 1
-
-/* Platform provides TLI function prototypes */
-#define ACE_HAS_TLI_PROTOTYPES 1
-
-/* Platform supports ualarm() */
-#define ACE_HAS_UALARM 1
-
-/* Platform supports ucontext_t (which is used in the extended signal API). */
-#define ACE_HAS_UCONTEXT_T 1
-
-/* Platform has <utime.h> header file */
-#define ACE_HAS_UTIME 1
-
-/* Platform requires void * for mmap(). */
-#define ACE_HAS_VOIDPTR_MMAP 1
-
-/* Platform has XTI (X/Open-standardized superset of TLI). Implies
- ACE_HAS_TLI but uses a different header file. */
-#define ACE_HAS_XTI 1
-
-/* Platform can not build ace/IOStream{,_T}.cpp. This does not necessarily
- mean that the platform does not support iostreams. */
-#define ACE_LACKS_ACE_IOSTREAM 1
-
-/* Platform does not have u_longlong_t typedef */
-#define ACE_LACKS_U_LONGLONG_T 1
-
-/* Platform lacks madvise() (e.g., Linux) */
-#define ACE_LACKS_MADVISE 1
-
-/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */
-#define ACE_LACKS_PRI_T 1
-
-/* Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) */
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1
-
-/* Platfrom lack pthread_yield() support. */
-#define ACE_LACKS_PTHREAD_YIELD 1
-
-/* Platform lacks readers/writer locks. */
-#define ACE_LACKS_RWLOCK_T 1
-
-/* MIT pthreads platform lacks the timedwait prototypes */
-#define ACE_LACKS_TIMEDWAIT_PROTOTYPES 1
-
-/* Platform does not define timepec_t as a typedef for struct timespec. */
-#define ACE_LACKS_TIMESPEC_T 1
-
-/* Compile using multi-thread libraries */
-#define ACE_MT_SAFE 1
-
-/* Platform needs to #include <sched.h> to get thread scheduling defs. */
-#define ACE_NEEDS_SCHED_H 1
-
-/*********************************************************************/
-/* Compiler's template mechanim must see source code (i.e., .cpp files). This
- is used for GNU G++. */
-/* Staller -> make 0 */
-// #undef ACE_TEMPLATES_REQUIRE_SOURCE
-
-/*********************************************************************/
-
-/* The OS/platform supports the poll() event demultiplexor */
-#define ACE_USE_POLL 1
-
-/* Platform has its standard c++ library in the namespace std. */
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-
-/* The number of bytes in a double. */
-#define SIZEOF_DOUBLE 8
-
-/* The number of bytes in a float. */
-#define SIZEOF_FLOAT 4
-
-/* The number of bytes in a int. */
-#define SIZEOF_INT 4
-
-/* The number of bytes in a long. */
-#define SIZEOF_LONG 4
-
-/* The number of bytes in a long double. */
-#define SIZEOF_LONG_DOUBLE 12
-
-/* The number of bytes in a long long. */
-#define SIZEOF_LONG_LONG 8
-
-/* The number of bytes in a short. */
-#define SIZEOF_SHORT 2
-
-/* The number of bytes in a signed char. */
-#define SIZEOF_SIGNED_CHAR 1
-
-/* The number of bytes in a void *. */
-#define SIZEOF_VOID_P 4
-
-/* Define if you have the execv function. */
-#define HAVE_EXECV 1
-
-/* Define if you have the execve function. */
-#define HAVE_EXECVE 1
-
-/* Define if you have the execvp function. */
-#define HAVE_EXECVP 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <fstream> header file. */
-#define HAVE_FSTREAM 1
-
-/* Define if you have the <iomanip> header file. */
-#define HAVE_IOMANIP 1
-
-/* Define if you have the <iostream> header file. */
-#define HAVE_IOSTREAM 1
-
-/* Define if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Name of package */
-#define PACKAGE "ace"
-
-/* Added by Staller */
-#define ENUM_BOOLEAN // See file /usr/local/lib/gcc-lib/i486-pc-sysv5/egcs-2.91.60/include/sys/types.h
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#define ACE_HAS_BROKEN_T_ERROR // make a nasty warning disappear in OS.i
-#define __USLC__ 1
-#define __IOCTL_VERSIONED__ // By Carlo!
-
-#endif /* ACE_CONFIG_H */
diff --git a/dep/acelite/ace/config-unixware-7.1.0.udk.h b/dep/acelite/ace/config-unixware-7.1.0.udk.h
deleted file mode 100644
index ec668c19581..00000000000
--- a/dep/acelite/ace/config-unixware-7.1.0.udk.h
+++ /dev/null
@@ -1,457 +0,0 @@
-/* -*- C++ -*- */
-#ifndef ACE_CONFIG_UNIXWARE_UDK_H
-#define ACE_CONFIG_UNIXWARE_UDK_H
-
-// $Id: config-unixware-7.1.0.udk.h 87167 2009-10-19 19:33:53Z olli $
-
-// Configuration for the unixware UDK compiler. derived from the unixware/g++ config
-// which was itself derived from an autoconfig run.
-
-/* ACE configuration header file */
-
-#define ACE_TEMPLATES_REQUIRE_SOURCE
-
-#ifndef UNIXWARE_7_1
-#define UNIXWARE_7_1
-#endif
-
-#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE
-
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if lex declares yytext as a char * by default, not a char[]. */
-#define YYTEXT_POINTER 1
-
-/* Define _REENTRANT if reentrant functions should be used. */
-#ifndef _REENTRANT
-# define _REENTRANT 1
-#endif
-
-#define ACE_HAS_NEW_NO_H 1
-#define ACE_HAS_STDEXCEPT_NO_H 1
-
-/*
- * TODO: These two next #defines have an #undef before them, in
- * case the variable being defined already had a value.
- * The #undefs are being picked up by configure, and are commented out!
- */
-#define ACE_THREAD_MIN_PRIORITY 0
-#if defined (ACE_THREAD_MIN_PRIORITY)
-/* # undef PTHREAD_MIN_PRIORITY */
-# define PTHREAD_MIN_PRIORITY ACE_THREAD_MIN_PRIORITY
-#endif /* #if defined (ACE_THREAD_MIN_PRIORITY) */
-
-#define ACE_THREAD_MAX_PRIORITY 99
-#if defined (ACE_THREAD_MAX_PRIORITY)
-/* # undef PTHREAD_MAX_PRIORITY */
-# define PTHREAD_MAX_PRIORITY ACE_THREAD_MAX_PRIORITY
-#endif /* #if defined (ACE_THREAD_MAX_PRIORITY) */
-
-
-
-/* UnixWare specific configuration parameters */
-/* #undef UNIXWARE */
-/* #undef UNIXWARE_2_0 */
-/* #undef UNIXWARE_2_1 */
-
-/* Specify sizes of given built-in types. If a size isn't defined here,
- then ace/Basic_Types.h will attempt to deduce the size. */
-/* #undef ACE_SIZEOF_CHAR */
-#define ACE_SIZEOF_SHORT 2
-#define ACE_SIZEOF_INT 4
-#define ACE_SIZEOF_LONG 4
-#define ACE_SIZEOF_LONG_LONG 8
-#define ACE_SIZEOF_VOID_P 4
-#define ACE_SIZEOF_FLOAT 4
-#define ACE_SIZEOF_DOUBLE 8
-#define ACE_SIZEOF_LONG_DOUBLE 12
-
-/* Enable ACE inlining */
-#define __ACE_INLINE__ 1
-
-/* Platform supports Asynchronous IO calls */
-/* #define ACE_HAS_AIO_CALLS */
-
-/* Specify this if you don't want threads to inherit parent thread's
- ACE_Log_Msg properties. */
-/* #undef ACE_THREADS_DONT_INHERIT_LOG_MSG */
-
-/* OS has priocntl (2) */
-#define ACE_HAS_PRIOCNTL 1
-
-/* Platform has pread() and pwrite() support */
-#define ACE_HAS_P_READ_WRITE 1
-
-/* Compiler/platform correctly calls init()/fini() for shared libraries */
-#define ACE_HAS_AUTOMATIC_INIT_FINI 1
-
-/* Compiler handles explicit calling of template destructor correctly.
- See "ace/OS.h" for details. */
-/* Staller: already defined by config-g++-common.h
-#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR 1
-*/
-
-/* Platform doesn't cast MAP_FAILED to a (void *). */
-/* #undef ACE_HAS_BROKEN_MAP_FAILED */
-/* Staller: oh yes, let's do this! */
-#define ACE_HAS_BROKEN_MAP_FAILED
-
-
-/* Prototypes for both signal() and struct sigaction are consistent. */
-#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1
-
-/* Compiler/platform has correctly prototyped header files */
-#define ACE_HAS_CPLUSPLUS_HEADERS
-
-/* Platform supports operations on directories via struct dirent,
- readdir_r, etc. */
-#define ACE_HAS_DIRENT
-
-/* Compiler supports C++ exception handling */
-# if !defined (ACE_HAS_EXCEPTIONS)
-#define ACE_HAS_EXCEPTIONS
-# endif
-
-/* Platform supports getpagesize() call (otherwise, ACE_PAGE_SIZE must be
- defined, except on Win32) */
-#define ACE_HAS_GETPAGESIZE
-
-/* Platform supports the getrusage() system call. */
-#define ACE_HAS_GETRUSAGE
-
-/* Platform has a getrusage () prototype in sys/resource.h that differs from
- the one in ace/OS.i. */
-#define ACE_HAS_GETRUSAGE_PROTOTYPE
-
-/* The GPERF utility is compiled for this platform */
-#define ACE_HAS_GPERF
-
-/* Optimize ACE_Handle_Set::count_bits for select() operations (common case) */
-#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1
-
-/* Compiler/platform supports SunOS high resolution timers */
-/* #undef ACE_HAS_HI_RES_TIMER */
-
-/* Compiler/platform supports idtype_t. */
-#define ACE_HAS_IDTYPE_T
-
-/* Inline all the static class OS methods to remove call overhead */
-/* Note: This gets defined by OS.h if __ACE_INLINE__ is defined */
-/* #undef ACE_HAS_INLINED_OSCALLS */
-
-/* Platform supports IP multicast */
-#define ACE_HAS_IP_MULTICAST
-
-/* Platform supports thr_keydelete (e.g,. UNIXWARE) */
-#define ACE_HAS_THR_KEYDELETE
-
-/* Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem). */
-#define ACE_HAS_THR_MINSTACK
-
-/* Some files, such as ace/streams.h, want to include new style C++ stream
- headers. These headers are iomanip, ios, iostream, istream, ostream,
- fstream and streambuf. If _all_ of these headers aren't available, then
- assume that only iostream.h and fstream.h are available. */
-/* #define ACE_USES_OLD_IOSTREAMS */
-
-/* Platform supports recvmsg and sendmsg */
-#define ACE_HAS_MSG
-
-/* Platform's select() uses non-const timeval* (only found on Linux right
- now) */
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-
-/* Uses ctime_r & asctime_r with only two parameters vs. three. */
-#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-
-
-/* Platform is an Intel Pentium microprocessor. */
-/* There is a problem with the gethrtime() because of (apparently) a problem
- with the inline assembly instruction. Hopefully there is a way to resolve
- that with an improvement to the assembler
-*/
-#ifdef ACE_HAS_PENTIUM
-//#undef ACE_HAS_PENTIUM
-#endif /* ACE_HAS_PENTIUM */
-
-
-/* Platform contains <poll.h> */
-#define ACE_HAS_POLL
-
-/* Platform supports POSIX O_NONBLOCK semantics */
-#define ACE_HAS_POSIX_NONBLOCK
-
-/* Platform supports the POSIX struct timespec type */
-#define ACE_HAS_POSIX_TIME
-
-/* Platform supports the /proc file system and defines tid_t
- in <sys/procfs.h> */
-#define ACE_HAS_PROC_FS
-
-/* Platform supports POSIX Threads */
-#define ACE_HAS_PTHREADS
-
-/* pthread.h declares an enum with PTHREAD_PROCESS_PRIVATE and
- PTHREAD_PROCESS_SHARED values */
-#define ACE_HAS_PTHREAD_PROCESS_ENUM
-
-/* Platform will recurse infinitely on thread exits from TSS cleanup routines
- (e.g., AIX) */
-#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS
-
-/* Platform supports reentrant functions (i.e., all the POSIX *_r
- functions). */
-#define ACE_HAS_REENTRANT_FUNCTIONS
-
-/* Platform has support for multi-byte character support compliant with the
- XPG4 Worldwide Portability Interface wide-character classification. */
-#define ACE_HAS_XPG4_MULTIBYTE_CHAR
-
-/* Platform does not support reentrant netdb functions (getprotobyname_r,
- getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). */
-#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
-
-/* Platform supports the POSIX regular expression library */
-#define ACE_HAS_REGEX
-
-/* Platform has special header for select(). */
-#define ACE_HAS_SELECT_H
-
-/* Platform has a function to set t_errno (e.g., Tandem). */
-#define ACE_HAS_SET_T_ERRNO
-
-/* Platform supports SVR4 extended signals */
-#define ACE_HAS_SIGINFO_T
-
-/* Platform/compiler has the sigwait(2) prototype */
-#define ACE_HAS_SIGWAIT
-
-/* Compiler/platform defines the sig_atomic_t typedef */
-#define ACE_HAS_SIG_ATOMIC_T
-
-/* Platform supports new BSD inet_addr len field. */
-#define ACE_HAS_SOCKADDR_IN_SIN_LEN
-
-/* OS/compiler uses size_t * rather than int * for socket lengths */
-#define ACE_HAS_SIZET_SOCKET_LEN
-
-/* Compiler/platform provides the sys/sockio.h file */
-#define ACE_HAS_SYS_SOCKIO_H
-
-/* Compiler supports the ssize_t typedef */
-#define ACE_HAS_SSIZE_T
-
-/* Platform supports UNIX International Threads */
-#define ACE_HAS_STHREADS
-
-/* Platform has thr_yield() */
-#define ACE_HAS_THR_YIELD
-
-/* Platform/compiler supports Standard C++ Library */
-/* It seems that UDK provides std-like declarations for only portions
- such as <exception>
-*/
-#define ACE_HAS_STANDARD_CPP_LIBRARY 0
-
-/* Compiler/platform supports struct strbuf */
-#define ACE_HAS_STRBUF_T
-
-/* Platform supports STREAMS */
-#define ACE_HAS_STREAMS
-
-/* Platform supports STREAM pipes */
-#define ACE_HAS_STREAM_PIPES
-
-/* Platform/Compiler supports a String class (e.g., GNU or Win32). */
-#define ACE_HAS_STRING_CLASS
-
-/* Platform has <strings.h> (which contains bzero() prototype) */
-#define ACE_HAS_STRINGS
-
-/* Platform/compiler supports void * as second parameter to gettimeofday(). */
-#define ACE_HAS_VOIDPTR_GETTIMEOFDAY
-
-/* Compiler/platform supports SVR4 dynamic linking semantics */
-#define ACE_HAS_SVR4_DYNAMIC_LINKING
-
-/* Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... */
-#define ACE_HAS_SVR4_TLI
-
-/* Compiler/platform contains the <sys/syscall.h> file. */
-#define ACE_HAS_SYS_SYSCALL_H
-
-/* Platform supports system configuration information */
-#define ACE_HAS_SYS_SYSTEMINFO_H
-#define ACE_HAS_SYSV_SYSINFO 1
-
-/* Platform supports System V IPC (most versions of UNIX, but not Win32) */
-#define ACE_HAS_SYSV_IPC 1
-
-/* Platform provides <sys/filio.h> header */
-#define ACE_HAS_SYS_FILIO_H 1
-
-/* Platform provides <sys/xti.h> header */
-#define ACE_HAS_SYS_XTI_H 1
-
-/* Compiler implements templates that support typedefs inside of classes used
- as formal arguments to a template class. */
-#define ACE_HAS_TEMPLATE_TYPEDEFS 1
-
-/* Platform has POSIX terminal interface. */
-#define ACE_HAS_TERMIOS 1
-
-/* Platform supports threads */
-#define ACE_HAS_THREADS 1
-
-/* Compiler/platform has thread-specific storage */
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1
-
-/* Platform supports TLI timod STREAMS module */
-#define ACE_HAS_TIMOD_H 1
-
-/* Platform supports TLI tiuser header */
-#define ACE_HAS_TIUSER_H 1
-
-/* Platform supports TLI. Also see ACE_TLI_TCP_DEVICE. */
-#define ACE_HAS_TLI 1
-
-/* Platform provides TLI function prototypes */
-#define ACE_HAS_TLI_PROTOTYPES 1
-
-/* Platform supports ualarm() */
-#define ACE_HAS_UALARM 1
-
-/* Platform supports ucontext_t (which is used in the extended signal API). */
-#define ACE_HAS_UCONTEXT_T 1
-
-/* Platform has <utime.h> header file */
-#define ACE_HAS_UTIME 1
-
-/* Prints out console message in ACE_NOTSUP. Useful for tracking down origin
- of ACE_NOTSUP. */
-/* #undef ACE_HAS_VERBOSE_NOTSUP */
-
-/* Platform requires void * for mmap(). */
-#define ACE_HAS_VOIDPTR_MMAP 1
-
-/* Platform has XTI (X/Open-standardized superset of TLI). Implies
- ACE_HAS_TLI but uses a different header file. */
-#define ACE_HAS_XTI 1
-
-/* Platform can not build ace/IOStream{,_T}.cpp. This does not necessarily
- mean that the platform does not support iostreams. */
-#define ACE_LACKS_ACE_IOSTREAM 1
-
-/* Platform does not have u_longlong_t typedef */
-#define ACE_LACKS_U_LONGLONG_T 1
-
-/* Platform lacks madvise() (e.g., Linux) */
-#define ACE_LACKS_MADVISE 1
-
-/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */
-#define ACE_LACKS_PRI_T 1
-
-/* Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) */
-#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1
-
-/* Platfrom lack pthread_yield() support. */
-#define ACE_LACKS_PTHREAD_YIELD 1
-
-/* Platform lacks readers/writer locks. */
-#define ACE_LACKS_RWLOCK_T 1
-
-/* MIT pthreads platform lacks the timedwait prototypes */
-#define ACE_LACKS_TIMEDWAIT_PROTOTYPES 1
-
-/* Platform does not define timepec_t as a typedef for struct timespec. */
-#define ACE_LACKS_TIMESPEC_T 1
-
-/* Compile using multi-thread libraries */
-#define ACE_MT_SAFE 1
-
-/* Platform needs to #include <sched.h> to get thread scheduling defs. */
-#define ACE_NEEDS_SCHED_H 1
-
-/* The OS/platform supports the poll() event demultiplexor */
-#define ACE_USE_POLL 1
-
-/* Platform has its standard c++ library in the namespace std. */
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-
-/* The number of bytes in a double. */
-#define SIZEOF_DOUBLE 8
-
-/* The number of bytes in a float. */
-#define SIZEOF_FLOAT 4
-
-/* The number of bytes in a int. */
-#define SIZEOF_INT 4
-
-/* The number of bytes in a long. */
-#define SIZEOF_LONG 4
-
-/* The number of bytes in a long double. */
-#define SIZEOF_LONG_DOUBLE 12
-
-/* The number of bytes in a long long. */
-#define SIZEOF_LONG_LONG 8
-
-/* The number of bytes in a short. */
-#define SIZEOF_SHORT 2
-
-/* The number of bytes in a signed char. */
-#define SIZEOF_SIGNED_CHAR 1
-
-/* The number of bytes in a void *. */
-#define SIZEOF_VOID_P 4
-
-/* Define if you have the execv function. */
-#define HAVE_EXECV 1
-
-/* Define if you have the execve function. */
-#define HAVE_EXECVE 1
-
-/* Define if you have the execvp function. */
-#define HAVE_EXECVP 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <fstream> header file. */
-#define HAVE_FSTREAM 1
-
-/* Define if you have the <iomanip> header file. */
-#define HAVE_IOMANIP 1
-
-/* Define if you have the <iostream> header file. */
-#define HAVE_IOSTREAM 1
-
-/* Define if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Name of package */
-#define PACKAGE "ace"
-
-/* Version number of package */
-#define VERSION "4.6.37"
-
-/* Added by Staller */
-#define ENUM_BOOLEAN // See file /usr/local/lib/gcc-lib/i486-pc-sysv5/egcs-2.91.60/include/sys/types.h
-/* Hat nix gebracht
-#define ACE_DEFAULT_SELECT_REACTOR_SIZE 256 // this is like in linux config fileto avoid another error
-*/
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#define ACE_HAS_BROKEN_T_ERROR // let disappear a nasty warning from OS.i
-#if !defined (__USLC__)
-# define __USLC__ 1
-#endif
-
-#define __IOCTL_VERSIONED__ // By Carlo!
-#endif /* ACE_UNIXWARE_UDK_H */
diff --git a/dep/acelite/ace/config-visualage.h b/dep/acelite/ace/config-visualage.h
deleted file mode 100644
index 4cef8108bc5..00000000000
--- a/dep/acelite/ace/config-visualage.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- C++ -*- */
-// $Id: config-visualage.h 80826 2008-03-04 14:51:23Z wotte $
-
-// This configuration file automatically includes the proper
-// configurations for IBM's VisualAge C++ compiler on Win32 and AIX.
-
-#ifndef CONFIG_VISUALAGE_H
-#define CONFIG_VISUALAGE_H
-#include /**/ "ace/pre.h"
-
-#ifdef __TOS_WIN__
- #include "ace/config-win32.h"
-#elif __TOS_AIX__
- #include "ace/config-aix-4.x.h"
-#else
- #include "PLATFORM NOT SPECIFIED"
-#endif /* __TOS_WIN__ */
-
-#include /**/ "ace/post.h"
-#endif //CONFIG_VISUALAGE_H
diff --git a/dep/acelite/ace/config-vxworks.h b/dep/acelite/ace/config-vxworks.h
index fd4e04193c0..79e51ebd321 100644
--- a/dep/acelite/ace/config-vxworks.h
+++ b/dep/acelite/ace/config-vxworks.h
@@ -1,5 +1,5 @@
//* -*- C++ -*- */
-// $Id: config-vxworks.h 87036 2009-10-10 18:21:39Z johnnyw $
+// $Id: config-vxworks.h 95534 2012-02-17 23:19:33Z mitza $
// The following configuration file is designed to work for VxWorks
// Based on ACE_VXWORKS it will select the correct config file
@@ -33,6 +33,8 @@
# define ACE_VXWORKS 0x670
# elif (_WRS_VXWORKS_MINOR == 8)
# define ACE_VXWORKS 0x680
+# elif (_WRS_VXWORKS_MINOR == 9)
+# define ACE_VXWORKS 0x690
# endif
# endif
# endif
@@ -48,6 +50,8 @@
# include "ace/config-vxworks6.7.h"
#elif (ACE_VXWORKS == 0x680)
# include "ace/config-vxworks6.8.h"
+#elif (ACE_VXWORKS == 0x690)
+# include "ace/config-vxworks6.9.h"
#else
#error Unknown or unsupported VxWorks version
#endif
diff --git a/dep/acelite/ace/config-vxworks6.4.h b/dep/acelite/ace/config-vxworks6.4.h
index 9a0487f36bf..4ed50a7a1df 100644
--- a/dep/acelite/ace/config-vxworks6.4.h
+++ b/dep/acelite/ace/config-vxworks6.4.h
@@ -1,5 +1,5 @@
//* -*- C++ -*- */
-// $Id: config-vxworks6.4.h 91683 2010-09-09 09:07:49Z johnnyw $
+// $Id: config-vxworks6.4.h 93571 2011-03-17 07:37:11Z olli $
// The following configuration file is designed to work for VxWorks
// 6.4 platforms using one of these compilers:
@@ -48,7 +48,7 @@
#elif defined (__DCC__)
# define ACE_HAS_STANDARD_CPP_LIBRARY 1
# define ACE_TEMPLATES_REQUIRE_SOURCE
-#else /* ! __GNUG__ && ! ghs && !__DCC__ */
+#else /* ! __GNUG__ && !__DCC__ */
# ifdef __cplusplus /* Let it slide for C compilers. */
# error unsupported compiler on VxWorks
# endif /* __cplusplus */
@@ -238,7 +238,6 @@
#define ACE_LACKS_STDINT_H
#define ACE_LACKS_UNAME
#define ACE_LACKS_UTSNAME_T
- #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS
#define ACE_LACKS_DLFCN_H
#define ACE_LACKS_WAIT
#define ACE_LACKS_WAITPID
diff --git a/dep/acelite/ace/config-vxworks6.8.h b/dep/acelite/ace/config-vxworks6.8.h
index ecad4752d95..14e072df663 100644
--- a/dep/acelite/ace/config-vxworks6.8.h
+++ b/dep/acelite/ace/config-vxworks6.8.h
@@ -1,5 +1,5 @@
//* -*- C++ -*- */
-// $Id: config-vxworks6.8.h 87036 2009-10-10 18:21:39Z johnnyw $
+// $Id: config-vxworks6.8.h 96050 2012-08-14 22:22:54Z mitza $
// The following configuration file is designed to work for VxWorks
// 6.8 platforms using one of these compilers:
@@ -16,6 +16,14 @@
#include "ace/config-vxworks6.7.h"
+#ifndef ACE_LACKS_RAND_R
+# define ACE_LACKS_RAND_R 1
+#endif
+
+#ifndef __RTP__
+# define ACE_LACKS_STD_WSTRING
+#endif
+
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_VXWORKS_6_8_H */
diff --git a/dep/acelite/ace/config-vxworks6.9.h b/dep/acelite/ace/config-vxworks6.9.h
new file mode 100644
index 00000000000..f15b2304621
--- /dev/null
+++ b/dep/acelite/ace/config-vxworks6.9.h
@@ -0,0 +1,33 @@
+//* -*- C++ -*- */
+// $Id: config-vxworks6.9.h 96017 2012-08-08 22:18:09Z mitza $
+
+// The following configuration file is designed to work for VxWorks
+// 6.9 platforms using one of these compilers:
+// 1) The GNU g++ compiler that is shipped with VxWorks 6.9
+// 2) The Diab compiler that is shipped with VxWorks 6.9
+
+#ifndef ACE_CONFIG_VXWORKS_6_9_H
+#define ACE_CONFIG_VXWORKS_6_9_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_VXWORKS)
+# define ACE_VXWORKS 0x690
+#endif /* ! ACE_VXWORKS */
+
+#define ACE_HAS_SSIZE_T
+
+#include "ace/config-vxworks6.8.h"
+
+#ifndef ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+// already defined for earlier RTP versions
+# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1
+#endif
+
+#if defined(__RTP__)
+// bzero is in strings.h
+# define ACE_HAS_STRINGS 1
+#endif
+
+#include /**/ "ace/post.h"
+#endif /* ACE_CONFIG_VXWORKS_6_9_H */
+
diff --git a/dep/acelite/ace/config-win32-borland.h b/dep/acelite/ace/config-win32-borland.h
deleted file mode 100644
index f5305d3b003..00000000000
--- a/dep/acelite/ace/config-win32-borland.h
+++ /dev/null
@@ -1,172 +0,0 @@
-// -*- C++ -*-
-//$Id: config-win32-borland.h 92102 2010-09-30 08:14:15Z johnnyw $
-
-// The following configuration file contains defines for Borland compilers.
-
-#ifndef ACE_CONFIG_WIN32_BORLAND_H
-#define ACE_CONFIG_WIN32_BORLAND_H
-#include /**/ "ace/pre.h"
-
-#ifndef ACE_CONFIG_WIN32_H
-#error Use config-win32.h in config.h instead of this header
-#endif /* ACE_CONFIG_WIN32_H */
-
-#define ACE_HAS_CUSTOM_EXPORT_MACROS
-#define ACE_Proper_Export_Flag __declspec (dllexport)
-#define ACE_Proper_Import_Flag __declspec (dllimport)
-#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T
-#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE<CLASS, LOCK>;
-#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class __declspec (dllimport) T
-#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllimport) SINGLETON_TYPE <CLASS, LOCK>;
-
-// In later versions of C++Builder we will prefer inline functions by
-// default. The debug configuration of ACE is built with functions
-// out-of-line, so when linking your application against a debug ACE
-// build, you can choose to use the out-of-line functions by adding
-// ACE_NO_INLINE=1 to your project settings.
-# if !defined (__ACE_INLINE__)
-# define __ACE_INLINE__ 1
-# endif /* __ACE_INLINE__ */
-
-# define ACE_CC_NAME ACE_TEXT ("Embarcadero C++ Builder")
-# define ACE_CC_MAJOR_VERSION (__BORLANDC__ / 0x100)
-# define ACE_CC_MINOR_VERSION (__BORLANDC__ % 0x100)
-# define ACE_CC_BETA_VERSION (0)
-
-#if (__BORLANDC__ >= 0x620)
-# define ACE_CC_PREPROCESSOR_ARGS "-q -Sl -o%s"
-#else
-# define ACE_CC_PREPROCESSOR_ARGS "-q -P- -o%s"
-#endif
-
-// Automatically define WIN32 macro if the compiler tells us it is our
-// target platform.
-# if defined (__WIN32__) && !defined (WIN32)
-# define WIN32 1
-# endif
-
-// When building a VCL application, the main VCL header file should be
-// included before anything else. You can define ACE_HAS_VCL=1 in your
-// project settings to have this file included for you automatically.
-# if defined (ACE_HAS_VCL) && (ACE_HAS_VCL != 0)
-# include /**/ <vcl.h>
-# endif
-
-# define ACE_CC_PREPROCESSOR "CPP32.EXE"
-
-# include "ace/config-win32-common.h"
-
-# define ACE_WSTRING_HAS_USHORT_SUPPORT 1
-# define ACE_HAS_DIRENT
-
-#define ACE_USES_STD_NAMESPACE_FOR_STDC_LIB 1
-
-#define ACE_NEEDS_DL_UNDERSCORE
-
-#define ACE_LACKS_TERMIOS_H
-#define ACE_LACKS_NETINET_TCP_H
-#define ACE_LACKS_REGEX_H
-#define ACE_LACKS_SYS_MSG_H
-#define ACE_LACKS_PWD_H
-#define ACE_LACKS_POLL_H
-#define ACE_LACKS_SYS_SHM_H
-#define ACE_LACKS_STRINGS_H
-#define ACE_LACKS_SEMAPHORE_H
-#define ACE_LACKS_INTTYPES_H
-#define ACE_LACKS_UCONTEXT_H
-#define ACE_LACKS_SYS_SELECT_H
-#define ACE_LACKS_SYS_TIME_H
-#define ACE_LACKS_SYS_RESOURCE_H
-#define ACE_LACKS_SYS_WAIT_H
-#define ACE_LACKS_DLFCN_H
-#define ACE_LACKS_SYS_MMAN_H
-#define ACE_LACKS_SYS_UIO_H
-#define ACE_LACKS_SYS_SOCKET_H
-#define ACE_LACKS_NETINET_IN_H
-#define ACE_LACKS_NETDB_H
-#define ACE_LACKS_NET_IF_H
-#define ACE_LACKS_SYS_IPC_H
-#define ACE_LACKS_SYS_SEM_H
-#define ACE_LACKS_SYS_IOCTL_H
-#define ACE_LACKS_STROPTS_H
-
-#undef ACE_LACKS_STRUCT_DIR
-#undef ACE_LACKS_CLOSEDIR
-#undef ACE_LACKS_OPENDIR
-#undef ACE_LACKS_READDIR
-#undef ACE_LACKS_REWINDDIR
-
-#define ACE_HAS_WOPENDIR
-#define ACE_HAS_WCLOSEDIR
-#define ACE_HAS_WREADDIR
-#define ACE_HAS_WREWINDDIR
-
-#define ACE_LACKS_STRRECVFD
-#define ACE_USES_EXPLICIT_STD_NAMESPACE
-
-#define ACE_HAS_TIME_T_LONG_MISMATCH
-
-#define ACE_EXPORT_NESTED_CLASSES 1
-#define ACE_HAS_CPLUSPLUS_HEADERS 1
-#define ACE_HAS_NONCONST_SELECT_TIMEVAL
-#define ACE_HAS_SIG_ATOMIC_T
-#define ACE_HAS_STANDARD_CPP_LIBRARY 1
-#define ACE_HAS_STDCPP_STL_INCLUDES 1
-#define ACE_HAS_STRING_CLASS 1
-#define ACE_HAS_USER_MODE_MASKS 1
-#define ACE_LACKS_ACE_IOSTREAM 1
-#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1
-#define ACE_HAS_NEW_NOTHROW
-#define ACE_TEMPLATES_REQUIRE_SOURCE 1
-#define ACE_SIZEOF_LONG_DOUBLE 10
-#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Lu"
-#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld"
-#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-#define ACE_USES_STD_NAMESPACE_FOR_ABS 1
-#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS)
-
-#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
-// must have _MT defined to include multithreading
-// features from win32 headers
-# if !defined(__MT__)
-// *** DO NOT *** defeat this error message by defining __MT__ yourself.
-// You must link with the multi threaded libraries. Add -tWM to your
-// compiler options
-# error You must link against multi-threaded libraries when using ACE (check your project settings)
-# endif /* !_MT && !ACE_HAS_WINCE */
-#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */
-
-#if (__BORLANDC__ < 0x620)
-# define ACE_LACKS_ISBLANK
-# define ACE_LACKS_ISWBLANK
-# define ACE_LACKS_PRAGMA_ONCE 1
-#endif
-
-#if (__BORLANDC__ < 0x630)
-# define ACE_LACKS_ISWCTYPE
-# define ACE_LACKS_ISCTYPE
-#endif
-
-#if (__BORLANDC__ < 0x620)
-// Older Borland compilers can't handle assembly in inline methods or
-// templates (E2211). When we build for pentium optimized and we are inlining
-// then we disable inline assembly
-# if defined (ACE_HAS_PENTIUM) && defined(__ACE_INLINE__)
-# define ACE_LACKS_INLINE_ASSEMBLY
-# endif
-#endif
-
-#if (__BORLANDC__ == 0x621)
-// C++ Builder 2010 wcsncat seems broken
-# define ACE_LACKS_WCSNCAT
-#endif
-
-#define ACE_WCSDUP_EQUIVALENT ::_wcsdup
-#define ACE_STRCASECMP_EQUIVALENT ::stricmp
-#define ACE_STRNCASECMP_EQUIVALENT ::strnicmp
-#define ACE_WTOF_EQUIVALENT ::_wtof
-#define ACE_FILENO_EQUIVALENT(X) (_get_osfhandle (::_fileno (X)))
-#define ACE_HAS_ITOA 1
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_WIN32_BORLAND_H */
diff --git a/dep/acelite/ace/config-win32-common.h b/dep/acelite/ace/config-win32-common.h
index 95cc3d3d107..098ddbd5701 100644
--- a/dep/acelite/ace/config-win32-common.h
+++ b/dep/acelite/ace/config-win32-common.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-// $Id: config-win32-common.h 92120 2010-10-01 12:00:01Z johnnyw $
+// $Id: config-win32-common.h 96094 2012-08-22 11:51:11Z johnnyw $
#ifndef ACE_CONFIG_WIN32_COMMON_H
@@ -10,7 +10,6 @@
#error Use config-win32.h in config.h instead of this header
#endif /* ACE_CONFIG_WIN32_H */
-
// Windows Mobile (CE) stuff is primarily further restrictions to what's
// in the rest of this file. Also, it defined ACE_HAS_WINCE, which is used
// in this file.
@@ -18,6 +17,21 @@
# include "ace/config-WinCE.h"
#endif /* _WIN32_WCE */
+#if defined(__MINGW32__)
+// When using the --std=c++0x option with MinGW the compiler omits defining
+// the following required macros (at least with the GCC 4.6.2 version)
+// So we define them ourselves here.
+# if !defined(WIN32)
+# define _stdcall __attribute__((__stdcall__))
+# define _cdecl __attribute__((__cdecl__))
+# define _thiscall __attribute__((__thiscall__))
+# define _fastcall __attribute__((__fastcall__))
+# define WIN32 1
+# define WINNT 1
+# define i386 1
+# endif
+#endif
+
// Complain if WIN32 is not already defined.
#if !defined (WIN32) && !defined (ACE_HAS_WINCE)
# error Please define WIN32 in your project settings.
@@ -27,6 +41,12 @@
#if defined (_WIN64) || defined (WIN64)
# define ACE_WIN64
+// MPC template adds _AMD64_ but user projects not generated using MPC
+// may want to use _AMD64_ as well. Ensure it's there in all cases.
+# ifndef _AMD64_
+# define _AMD64_
+# endif
+
// Use 64-bit file offsets by default in the WIN64 case, similar to
// what 64-bit UNIX systems do.
//
@@ -227,6 +247,10 @@
#define ACE_LACKS_SEEKDIR
#define ACE_LACKS_TELLDIR
+#define ACE_LACKS_CLOCKID_T
+#define ACE_LACKS_CLOCK_REALTIME
+#define ACE_LACKS_CLOCK_MONOTONIC
+
/* LACKS gid/pid/sid/uid facilities */
#define ACE_LACKS_GETPGID
#define ACE_LACKS_GETPPID
@@ -258,6 +282,7 @@
#define ACE_LACKS_MODE_MASKS
#define ACE_LACKS_PTHREAD_H
#define ACE_LACKS_PWD_FUNCTIONS
+#define ACE_LACKS_RAND_R
#define ACE_LACKS_READLINK
#define ACE_LACKS_RLIMIT
#define ACE_LACKS_SBRK
@@ -265,6 +290,7 @@
#define ACE_LACKS_SEMBUF_T
#define ACE_LACKS_SIGACTION
#define ACE_LACKS_SIGSET
+#define ACE_LACKS_SIGSET_T
#define ACE_LACKS_SOCKETPAIR
#define ACE_LACKS_SUSECONDS_T
#define ACE_LACKS_USECONDS_T
@@ -301,7 +327,7 @@
#define ACE_SIZEOF_LONG_LONG 8
-#if !defined (ACE_LACKS_LONGLONG_T) && !defined (__MINGW32__)
+#if !defined (__MINGW32__)
#define ACE_INT64_TYPE signed __int64
#define ACE_UINT64_TYPE unsigned __int64
#endif
@@ -501,9 +527,9 @@
# else
# pragma comment(lib, "ws2_32.lib")
# pragma comment(lib, "mswsock.lib")
-# if defined (ACE_HAS_IPV6)
+// # if defined (ACE_HAS_IPV6)
# pragma comment(lib, "iphlpapi.lib")
-# endif
+// # endif
# endif /* ACE_HAS_WINCE */
# endif /* _MSC_VER */
@@ -580,6 +606,9 @@
// Looks like Win32 has a non-const swab function
#define ACE_HAS_NONCONST_SWAB
+// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses
+#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED
+
// If we are using winsock2 then the SO_REUSEADDR feature is broken
// SO_REUSEADDR=1 behaves like SO_REUSEPORT=1. (SO_REUSEPORT is an
// extension to sockets on some platforms)
diff --git a/dep/acelite/ace/config-win32-ghs.h b/dep/acelite/ace/config-win32-ghs.h
deleted file mode 100644
index 0ac80bfbd11..00000000000
--- a/dep/acelite/ace/config-win32-ghs.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// -*- C++ -*-
-// $Id: config-win32-ghs.h 87268 2009-10-29 21:06:06Z olli $
-
-// The following configuration file contains defines for Green Hills compilers.
-
-#ifndef ACE_CONFIG_WIN32_GHS_H
-#define ACE_CONFIG_WIN32_GHS_H
-#include /**/ "ace/pre.h"
-
-#ifndef ACE_CONFIG_WIN32_H
-#error Use config-win32.h in config.h instead of this header
-#endif /* ACE_CONFIG_WIN32_H */
-
-#ifndef WIN32
-# define WIN32
-#endif /* WIN32 */
-
-#undef _M_IX86
-// This turns on ACE_HAS_PENTIUM
-#define _M_IX86 500
-// GHS does not provide DLL support
-#define ACE_HAS_DLL 0
-#define TAO_HAS_DLL 0
-#undef _DLL
-
-//Green Hills Native x86 does not support structural exceptions
-# undef ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS
-# undef ACE_HAS_WCHAR
-# define ACE_CONFIG_INCLUDE_GHS_COMMON
-# include "ace/config-ghs-common.h"
-
-// Changed ACE_TEXT to ACE_TEXT in the following line
-# define ACE_CC_NAME ACE_TEXT ("Green Hills C++")
-# define ACE_CC_MAJOR_VERSION (1)
-# define ACE_CC_MINOR_VERSION (8)
-# define ACE_CC_BETA_VERSION (9)
-# ifndef ACE_USING_MCPP_PREPROCESSOR
-# define ACE_CC_PREPROCESSOR "GCX.EXE"
-# define ACE_CC_PREPROCESSOR_ARGS "-E"
-# endif
-
-// GHS uses Microsoft's standard cpp library, which has auto_ptr.
-# undef ACE_LACKS_AUTO_PTR
-// Microsoft's standard cpp library auto_ptr doesn't have reset ().
-# define ACE_AUTO_PTR_LACKS_RESET
-
-#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS)
-
-// This section below was extracted from config-win32-msvc
-#define ACE_HAS_ITOA
-#define ACE_ITOA_EQUIVALENT ::_itoa
-#define ACE_STRCASECMP_EQUIVALENT ::_stricmp
-#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp
-#define ACE_WCSDUP_EQUIVALENT ::_wcsdup
-// This section above was extracted from config-win32-msvc
-
-# define ACE_EXPORT_NESTED_CLASSES 1
-# define ACE_HAS_CPLUSPLUS_HEADERS 1
-//# define ACE_HAS_EXCEPTIONS 1
-# define ACE_HAS_NONCONST_SELECT_TIMEVAL 1
-# define ACE_HAS_SIG_ATOMIC_T 1
-# define ACE_HAS_STANDARD_CPP_LIBRARY 1
-# define ACE_HAS_STDCPP_STL_INCLUDES 1
-# define ACE_HAS_STRING_CLASS 1
-# define ACE_HAS_TEMPLATE_TYPEDEFS 1
-# define ACE_HAS_USER_MODE_MASKS 1
-# define ACE_LACKS_ACE_IOSTREAM 1
-//# define ACE_LACKS_LINEBUFFERED_STREAMBUF 1
-# define ACE_LACKS_STRPTIME 1
-//# define ACE_LACKS_PRAGMA_ONCE 1
-# define ACE_LACKS_STRRECVFD 1
-//# define ACE_NEW_THROWS_EXCEPTIONS 1
-# define ACE_SIZEOF_LONG_DOUBLE 10
-# define ACE_TEMPLATES_REQUIRE_SOURCE 1
-# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u"
-# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d"
-# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
-// Set the following to zero to placate SString.h ACE_WString CTOR
-# undef ACE_WSTRING_HAS_USHORT_SUPPORT
-
-// Green Hills Native x86 does not support __int64 keyword
-# define ACE_LACKS_LONGLONG_T
-
-/* need to ensure these are included before <iomanip> */
-# include <time.h>
-# include <stdlib.h>
-
-# if !defined (ACE_LD_DECORATOR_STR) && defined (_DEBUG)
-# define ACE_LD_DECORATOR_STR ACE_TEXT ("d")
-# endif
-
-#include /**/ "ace/post.h"
-#endif /* ACE_CONFIG_WIN32_GHS_H */
diff --git a/dep/acelite/ace/config-win32-interix.h b/dep/acelite/ace/config-win32-interix.h
index 2fa9695996c..a1a8faefff7 100644
--- a/dep/acelite/ace/config-win32-interix.h
+++ b/dep/acelite/ace/config-win32-interix.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// $Id: config-win32-interix.h 91285 2010-08-05 08:29:30Z johnnyw $
+// $Id: config-win32-interix.h 93550 2011-03-15 21:26:56Z olli $
// The following configuration file is designed to work for Interix
// platforms using GNU g++ (Interix == Microsoft's Services for Unix)
@@ -11,6 +11,7 @@
#include "ace/config-g++-common.h"
+#define ACE_HAS_SYS_SIGINFO_H
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
@@ -32,11 +33,8 @@
#define ACE_HAS_NEW_NO_H
#define ACE_HAS_NONCONST_SELECT_TIMEVAL
#define ACE_HAS_POLL
-#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
-#define ACE_HAS_POSIX_GETPWNAM_R
#define ACE_HAS_POSIX_NONBLOCK
#define ACE_HAS_POSIX_TIME
-#define ACE_HAS_PTHREADS_STD
#define ACE_HAS_PTHREADS_UNIX98_EXT
#define ACE_HAS_PTHREAD_GETCONCURRENCY
#define ACE_HAS_PTHREAD_SETCONCURRENCY
diff --git a/dep/acelite/ace/config-win32-mingw.h b/dep/acelite/ace/config-win32-mingw.h
index 58635b74ca8..a34ff605b2d 100644
--- a/dep/acelite/ace/config-win32-mingw.h
+++ b/dep/acelite/ace/config-win32-mingw.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// $Id: config-win32-mingw.h 92102 2010-09-30 08:14:15Z johnnyw $
+// $Id: config-win32-mingw.h 95438 2012-01-16 10:35:03Z mcorino $
//
// The following configuration file is designed to work for win32
@@ -28,11 +28,17 @@
#define ACE_HAS_USER_MODE_MASKS
-#if (__MINGW32_MAJOR_VERSION < 2)
+#if (__MINGW32_MAJOR_VERSION < 2) && (__MINGW64_VERSION_MAJOR < 3)
# error You need a newer version (>= 2.0) of mingw32/w32api
#endif
-#if (__MINGW32_MAJOR_VERSION >= 3)
+// In strict ANSI mode (default when using --std=c++0x) the fileno()
+// macro is not defined so use the following work around.
+#if defined(__STRICT_ANSI__)
+# define ACE_FILENO_EQUIVALENT ::_fileno
+#endif
+
+#if (__MINGW32_MAJOR_VERSION >= 3) || (__MINGW64_VERSION_MAJOR >= 3)
# define ACE_HAS_SSIZE_T
# undef ACE_LACKS_STRUCT_DIR
# undef ACE_LACKS_OPENDIR
@@ -47,6 +53,22 @@
#if (__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 15))
# undef ACE_LACKS_USECONDS_T
+#elif (__MINGW64_VERSION_MAJOR >= 3)
+# undef ACE_LACKS_USECONDS_T
+#endif
+
+#if (__MINGW64_VERSION_MAJOR >= 3)
+# define ACE_HAS_POSIX_TIME 1
+# define ACE_LACKS_TIMESPEC_T 1
+
+# include <stdlib.h>
+# if defined (strtod)
+# undef strtod
+# endif
+#else
+# if defined (ACE_LACKS_SIGSET_T)
+# undef ACE_LACKS_SIGSET_T
+# endif
#endif
#undef ACE_HAS_WTOF
@@ -78,6 +100,8 @@
#define ACE_LACKS_SYS_IOCTL_H
#define ACE_LACKS_PDH_H
#define ACE_LACKS_PDHMSG_H
+#define ACE_LACKS_STRTOK_R
+#define ACE_LACKS_LOCALTIME_R
#define ACE_HAS_NONCONST_WCSDUP
#define ACE_HAS_WINSOCK2_GQOS
#define ACE_ISCTYPE_EQUIVALENT ::_isctype
diff --git a/dep/acelite/ace/config-win32-msvc-10.h b/dep/acelite/ace/config-win32-msvc-10.h
index f915cb22ca9..2cbcd941ae6 100644
--- a/dep/acelite/ace/config-win32-msvc-10.h
+++ b/dep/acelite/ace/config-win32-msvc-10.h
@@ -3,7 +3,7 @@
/**
* @file config-win32-msvc-10.h
*
- * $Id: config-win32-msvc-10.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: config-win32-msvc-10.h 95719 2012-05-01 12:54:01Z johnnyw $
*
* @brief Microsoft Visual C++ 10.0 configuration file.
*
@@ -35,11 +35,10 @@
#endif
// Windows' timeval is non-conformant (defined in terms of long instead of
-// time_t) and VC9 (on desktop, not CE) changed time_t to a 64-bit value
-// even when compiling a 32-bit application. Therefore, ace/Time_Value
-// needs to rearrange a few things for this compiler. See Time_Value.h
-// for complete details.
-#if !defined (ACE_HAS_WINCE)
+// time_t) and VC8 changed time_t to a 64-bit value even when compiling a
+// 32-bit application. Therefore, ace/Time_Value needs to rearrange a few
+// things for this compiler. See Time_Value.h for complete details.
+#if !defined (_USE_32BIT_TIME_T)
# define ACE_HAS_TIME_T_LONG_MISMATCH
#endif
diff --git a/dep/acelite/ace/config-win32-msvc-7.h b/dep/acelite/ace/config-win32-msvc-7.h
index d7fb64078d9..93ced167cc3 100644
--- a/dep/acelite/ace/config-win32-msvc-7.h
+++ b/dep/acelite/ace/config-win32-msvc-7.h
@@ -3,7 +3,7 @@
/**
* @file config-win32-msvc-7.h
*
- * $Id: config-win32-msvc-7.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: config-win32-msvc-7.h 93562 2011-03-16 14:13:52Z olli $
*
* @brief Microsoft Visual C++ 7.0 configuration file.
*
@@ -48,6 +48,9 @@
#define ACE_LACKS_STRPTIME
+#define ACE_LACKS_STRTOK_R
+#define ACE_LACKS_LOCALTIME_R
+
#define ACE_HAS_SIG_ATOMIC_T
#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
#define ACE_LACKS_STRRECVFD
diff --git a/dep/acelite/ace/config-win32-msvc-8.h b/dep/acelite/ace/config-win32-msvc-8.h
index ef13986f906..fa6c63a1fd3 100644
--- a/dep/acelite/ace/config-win32-msvc-8.h
+++ b/dep/acelite/ace/config-win32-msvc-8.h
@@ -3,7 +3,7 @@
/**
* @file config-win32-msvc-8.h
*
- * $Id: config-win32-msvc-8.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: config-win32-msvc-8.h 95719 2012-05-01 12:54:01Z johnnyw $
*
* @brief Microsoft Visual C++ 8.0 configuration file.
*
@@ -37,11 +37,10 @@
#endif
// Windows' timeval is non-conformant (defined in terms of long instead of
-// time_t) and VC8 (on desktop, not CE) changed time_t to a 64-bit value
-// even when compiling a 32-bit application. Therefore, ace/Time_Value
-// needs to rearrange a few things for this compiler. See Time_Value.h
-// for complete details.
-#if !defined (ACE_HAS_WINCE)
+// time_t) and VC8 changed time_t to a 64-bit value even when compiling a
+// 32-bit application. Therefore, ace/Time_Value needs to rearrange a few
+// things for this compiler. See Time_Value.h for complete details.
+#if !defined (_USE_32BIT_TIME_T)
# define ACE_HAS_TIME_T_LONG_MISMATCH
#endif
@@ -131,7 +130,7 @@
# define ACE_HAS_TR24731_2005_CRT
#endif
-//Detect Platform SDK 64-bit (AMD64) compiler using _MSC_FULL_VER
+// Detect Platform SDK 64-bit (AMD64) compiler using _MSC_FULL_VER
#if (defined (_WIN64) || defined (WIN64)) && _MSC_FULL_VER < 140050000
# define ACE_AUTO_PTR_LACKS_RESET
# define ACE_MSVC_USES_DOUBLE_UNDERSCORE_STAT64
diff --git a/dep/acelite/ace/config-win32-msvc-9.h b/dep/acelite/ace/config-win32-msvc-9.h
index 884f975347e..551b80f7694 100644
--- a/dep/acelite/ace/config-win32-msvc-9.h
+++ b/dep/acelite/ace/config-win32-msvc-9.h
@@ -3,7 +3,7 @@
/**
* @file config-win32-msvc-9.h
*
- * $Id: config-win32-msvc-9.h 91685 2010-09-09 09:35:14Z johnnyw $
+ * $Id: config-win32-msvc-9.h 95719 2012-05-01 12:54:01Z johnnyw $
*
* @brief Microsoft Visual C++ 9.0 configuration file.
*
@@ -35,11 +35,10 @@
#endif
// Windows' timeval is non-conformant (defined in terms of long instead of
-// time_t) and VC9 (on desktop, not CE) changed time_t to a 64-bit value
-// even when compiling a 32-bit application. Therefore, ace/Time_Value
-// needs to rearrange a few things for this compiler. See Time_Value.h
-// for complete details.
-#if !defined (ACE_HAS_WINCE)
+// time_t) and VC9 changed time_t to a 64-bit value even when compiling a
+// 32-bit application. Therefore, ace/Time_Value needs to rearrange a few
+// things for this compiler. See Time_Value.h for complete details.
+#if !defined (_USE_32BIT_TIME_T)
# define ACE_HAS_TIME_T_LONG_MISMATCH
#endif
@@ -57,14 +56,13 @@
# define ACE_FILENO_EQUIVALENT(X) (_get_osfhandle (::_fileno (X)))
#endif
-// Windows Mobile 6 doesn't do sig_atomic_t, but maybe future versions will.
-# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x601)
+// Windows CE 7 doesn't do sig_atomic_t, but maybe future versions will.
+# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x700)
# define ACE_HAS_SIG_ATOMIC_T
-# endif /* !Win CE 6.0 or less */
+# endif /* !Win CE 7.0 or less */
#define ACE_LACKS_STRPTIME
-// Evaluate this with a WinCE build; maybe things have improved since VC8.
#if !defined (ACE_HAS_WINCE)
# define ACE_HAS_INTRIN_H
# define ACE_HAS_INTRINSIC_INTERLOCKED
diff --git a/dep/acelite/ace/config-win32-msvc.h b/dep/acelite/ace/config-win32-msvc.h
index 6b84ac2348c..d6ec650e5f8 100644
--- a/dep/acelite/ace/config-win32-msvc.h
+++ b/dep/acelite/ace/config-win32-msvc.h
@@ -2,12 +2,11 @@
/**
* @file config-win32-msvc.h
*
- * $Id: config-win32-msvc.h 92120 2010-10-01 12:00:01Z johnnyw $
+ * $Id: config-win32-msvc.h 95788 2012-05-24 07:59:51Z johnnyw $
*
* @brief Microsoft Visual C++ configuration file.
*
- * This file is the ACE configuration file for Microsoft Visual C++ versions
- * 5.0, 6.0, and 7.0 (.NET)
+ * This file is the ACE configuration file for Microsoft Visual C++
*
* @author Darrell Brunsch <brunsch@cs.wustl.edu>
*/
@@ -156,7 +155,7 @@
# pragma warning(disable: 1744) /* field of class type without a DLL interface used in a class with a DLL interface */
# pragma warning(disable: 1738)
# endif
-#endif /* !ALL_WARNINGS && _MSV_VER && !ghs && !__MINGW32__ */
+#endif /* !ALL_WARNINGS && _MSV_VER && !__MINGW32__ */
// STRICT type checking in WINDOWS.H enhances type safety for Windows
// programs by using distinct types to represent all the different
diff --git a/dep/acelite/ace/config-win32.h b/dep/acelite/ace/config-win32.h
index 89d8d68bc65..3f8caefb6a4 100644
--- a/dep/acelite/ace/config-win32.h
+++ b/dep/acelite/ace/config-win32.h
@@ -3,7 +3,7 @@
/**
* @file config-win32.h
*
- * $Id: config-win32.h 92120 2010-10-01 12:00:01Z johnnyw $
+ * $Id: config-win32.h 94388 2011-08-10 17:14:40Z johnnyw $
*
* @brief Microsoft Windows configuration file.
*
@@ -22,18 +22,10 @@
// NOTE: Please do not add anything besides #include's here. Put other stuff
// (definitions, etc.) in the included headers
-// We need to ensure that for Borland vcl.h can be included before
-// windows.h. So we will not include config-win32-common.h from here,
-// but instead let it be included at the appropriate place in
-// config-win32-borland.h.
-#if !defined (__BORLANDC__)
-# include "ace/config-win32-common.h"
-#endif /* !__BORLANDC__ */
+#include "ace/config-win32-common.h"
// Include the config-win32-* file specific to the compiler
-#if defined (__BORLANDC__)
-# include "ace/config-win32-borland.h"
-#elif defined (_MSC_VER)
+#if defined (_MSC_VER)
# include "ace/config-win32-msvc.h"
#elif defined (ACE_HAS_CEGCC) //need to be prior to MINGW32
# include "ace/config-win32-cegcc.h"
@@ -45,9 +37,6 @@
# error Compiler is not supported
#endif
-// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses
-#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED
-
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_WIN32_H */
diff --git a/dep/acelite/ace/config-windows.h b/dep/acelite/ace/config-windows.h
new file mode 100644
index 00000000000..28e59c9a3d8
--- /dev/null
+++ b/dep/acelite/ace/config-windows.h
@@ -0,0 +1,5 @@
+/* -*- C++ -*- */
+// $Id: config-windows.h 94353 2011-07-30 13:13:13Z johnnyw $
+
+// This is all we need to do to build ACE on a Windows platform (32bit or 64bit)
+#include "config-win32.h"
diff --git a/dep/acelite/ace/gethrtime.cpp b/dep/acelite/ace/gethrtime.cpp
deleted file mode 100644
index 5c32d16dadd..00000000000
--- a/dep/acelite/ace/gethrtime.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-// $Id: gethrtime.cpp 91286 2010-08-05 09:04:31Z johnnyw $
-//
-// Build this file with g++. It can be linked in to a ACE application
-// that was compiled with GreenHills. It wouldn't be necessary if I
-// knew a way to correctly move values from registers to a 64-bit
-// variable in GHS asm code. That's easy with g++ asm.
-
-#include "ace/config-all.h"
-
-
-
-#if defined (ghs) && (defined (i386) || defined(__i386__))
-
-#include "ace/OS_NS_time.h"
-
-extern "C"
-ACE_hrtime_t
-ACE_GETHRTIME_NAME (void)
-{
-#if defined (ACE_HAS_PENTIUM)
- // ACE_TRACE ("ACE_GETHRTIME_NAME");
-
-#if defined (ACE_LACKS_LONGLONG_T)
- double now;
-#else /* ! ACE_LACKS_LONGLONG_T */
- ACE_hrtime_t now;
-#endif /* ! ACE_LACKS_LONGLONG_T */
-
- // Read the high-res tick counter directly into memory variable
- // "now". The A constraint signifies a 64-bit int.
-#if defined (__GNUG__)
- asm volatile ("rdtsc" : "=A" (now) : : "memory");
-// #elif defined (ghs)
-// The following doesn't work. For now, this file must be compile with g++.
-// asm ("rdtsc");
-// asm ("movl %edx,-16(%ebp)");
-// asm ("movl %eax,-12(%ebp)");
-#else
-# error unsupported compiler
-#endif
-
-#if defined (ACE_LACKS_LONGLONG_T)
- // ACE_U_LongLong doesn't have the same layout as now, so construct
- // it "properly".
- ACE_UINT32 least, most;
- ACE_OS::memcpy (&least, &now, sizeof (ACE_UINT32));
- ACE_OS::memcpy (&most, (unsigned char *) &now + sizeof (ACE_UINT32),
- sizeof (ACE_UINT32));
-
- const ACE_hrtime_t ret (least, most);
- return ret;
-#else /* ! ACE_LACKS_LONGLONG_T */
- return now;
-#endif /* ! ACE_LACKS_LONGLONG_T */
-
-#else /* ! ACE_HAS_PENTIUM */
-# error This file can _only_ be compiled with ACE_HAS_PENTIUM.
-#endif /* ! ACE_HAS_PENTIUM */
-}
-#endif /* ghs */
diff --git a/dep/acelite/ace/os_include/os_dirent.h b/dep/acelite/ace/os_include/os_dirent.h
index 034bacd006d..a51317a4612 100644
--- a/dep/acelite/ace/os_include/os_dirent.h
+++ b/dep/acelite/ace/os_include/os_dirent.h
@@ -6,7 +6,7 @@
*
* format of directory entries
*
- * $Id: os_dirent.h 82985 2008-10-08 18:15:30Z johnnyw $
+ * $Id: os_dirent.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -27,10 +27,6 @@
#include "ace/os_include/sys/os_types.h"
#include "ace/os_include/os_limits.h"
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
-# include "ace/os_include/os_unistd.h" // VxWorks needs this to compile
-#endif /* ACE_VXWORKS */
-
#if !defined (ACE_LACKS_DIRENT_H)
# include /**/ <dirent.h>
#endif /* !ACE_LACKS_DIRENT_H */
diff --git a/dep/acelite/ace/os_include/os_dlfcn.h b/dep/acelite/ace/os_include/os_dlfcn.h
index 0f74437fb80..c65d78f197c 100644
--- a/dep/acelite/ace/os_include/os_dlfcn.h
+++ b/dep/acelite/ace/os_include/os_dlfcn.h
@@ -6,7 +6,7 @@
*
* dynamic linking
*
- * $Id: os_dlfcn.h 82273 2008-07-09 14:21:45Z jtc $
+ * $Id: os_dlfcn.h 94379 2011-08-09 17:18:49Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -49,13 +49,6 @@ extern "C"
{
#endif /* __cplusplus */
-#if defined (_M_UNIX)
- int _dlclose (void *);
- char *_dlerror (void);
- void *_dlopen (const char *, int);
- void * _dlsym (void *, const char *);
-#endif /* _M_UNIX */
-
/* Set the proper handle type for dynamically-loaded libraries. */
/* Also define a default 'mode' for loading a library - the names and values */
/* differ between OSes, so if you write code that uses the mode, be careful */
@@ -63,22 +56,38 @@ extern "C"
#if defined (ACE_WIN32)
// Dynamic loading-related types - used for dlopen and family.
typedef HINSTANCE ACE_SHLIB_HANDLE;
-# define ACE_SHLIB_INVALID_HANDLE 0
-# define ACE_DEFAULT_SHLIB_MODE 0
+# if !defined (ACE_SHLIB_INVALID_HANDLE)
+# define ACE_SHLIB_INVALID_HANDLE 0
+# endif /* ACE_SHLIB_INVALID_HANDLE */
+# if !defined (ACE_DEFAULT_SHLIB_MODE)
+# define ACE_DEFAULT_SHLIB_MODE 0
+# endif /* ACE_DEFAULT_SHLIB_MODE */
#elif defined (ACE_HAS_SVR4_DYNAMIC_LINKING)
typedef void *ACE_SHLIB_HANDLE;
-# define ACE_SHLIB_INVALID_HANDLE 0
+# if !defined (ACE_SHLIB_INVALID_HANDLE)
+# define ACE_SHLIB_INVALID_HANDLE 0
+# endif /* ACE_SHLIB_INVALID_HANDLE */
// This is needed to for dynamic_cast to work properly on objects passed to
// libraries.
-# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY | RTLD_GLOBAL
+# if !defined (ACE_DEFAULT_SHLIB_MODE)
+# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY | RTLD_GLOBAL
+# endif
#elif defined (__hpux)
typedef shl_t ACE_SHLIB_HANDLE;
-# define ACE_SHLIB_INVALID_HANDLE 0
-# define ACE_DEFAULT_SHLIB_MODE BIND_DEFERRED | DYNAMIC_PATH
+# if !defined (ACE_SHLIB_INVALID_HANDLE)
+# define ACE_SHLIB_INVALID_HANDLE 0
+# endif /* ACE_SHLIB_INVALID_HANDLE */
+# if !defined (ACE_DEFAULT_SHLIB_MODE)
+# define ACE_DEFAULT_SHLIB_MODE BIND_DEFERRED | DYNAMIC_PATH
+# endif /* ACE_DEFAULT_SHLIB_MODE */
#else /* !ACE_WIN32 && !ACE_HAS_SVR4_DYNAMIC_LINKING && !__hpux */
typedef void *ACE_SHLIB_HANDLE;
-# define ACE_SHLIB_INVALID_HANDLE 0
-# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY
+# if !defined (ACE_SHLIB_INVALID_HANDLE)
+# define ACE_SHLIB_INVALID_HANDLE 0
+# endif /* ACE_SHLIB_INVALID_HANDLE */
+# if !defined (ACE_DEFAULT_SHLIB_MODE)
+# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY
+# endif /* ACE_DEFAULT_SHLIB_MODE */
#endif /* ACE_WIN32 */
#if !defined (RTLD_LAZY)
diff --git a/dep/acelite/ace/os_include/os_fcntl.h b/dep/acelite/ace/os_include/os_fcntl.h
index 048ff62ae6e..bc3796a6b1f 100644
--- a/dep/acelite/ace/os_include/os_fcntl.h
+++ b/dep/acelite/ace/os_include/os_fcntl.h
@@ -6,7 +6,7 @@
*
* file control options
*
- * $Id: os_fcntl.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: os_fcntl.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -31,11 +31,6 @@
# include /**/ <fcntl.h>
#endif /* !ACE_LACKS_FCNTL_H */
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
-// for creat(), open()
-# include /**/ <ioLib.h>
-#endif /* ACE_VXWORKS */
-
// Place all additions (especially function declarations) within extern "C" {}
#ifdef __cplusplus
extern "C"
diff --git a/dep/acelite/ace/os_include/os_ifaddrs.h b/dep/acelite/ace/os_include/os_ifaddrs.h
new file mode 100644
index 00000000000..1009c592a63
--- /dev/null
+++ b/dep/acelite/ace/os_include/os_ifaddrs.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file os_ifaddrs.h
+ *
+ * os_ifaddrs.h include
+ *
+ * $Id: os_ifaddrs.h 93622 2011-03-22 15:45:57Z johnnyw $
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef ACE_OS_INCLUDE_OS_IFADDRS_H
+#define ACE_OS_INCLUDE_OS_IFADDRS_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_VXWORKS)
+# include /**/ <net/ifaddrs.h>
+#else
+# include /**/ <ifaddrs.h>
+#endif /*ACE_VXWORKS */
+
+// Place all additions (especially function declarations) within extern "C" {}
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_OS_INCLUDE_OS_IFADDRS_H */
diff --git a/dep/acelite/ace/os_include/os_limits.h b/dep/acelite/ace/os_include/os_limits.h
index a128efcc060..c0e5e23914a 100644
--- a/dep/acelite/ace/os_include/os_limits.h
+++ b/dep/acelite/ace/os_include/os_limits.h
@@ -6,7 +6,7 @@
*
* implementation-defined constants
*
- * $Id: os_limits.h 84972 2009-03-25 19:09:06Z johnnyw $
+ * $Id: os_limits.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -35,11 +35,6 @@
# include /**/ <sys/param.h>
#endif /* ACE_LACKS_SYS_PARAM_H */
-// On VxWorks 5.5.1 _POSIX_TIMER_MAX is defined in time.h
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
-# include /**/ <time.h>
-#endif /* ACE_VXWORKS */
-
// Place all additions (especially function declarations) within extern "C" {}
#ifdef __cplusplus
extern "C"
@@ -102,7 +97,7 @@ extern "C"
# define ACE_IOV_MAX IOV_MAX
#endif /* ACE_IOV_MAX */
-#if defined (ACE_VXWORKS) && ((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x670)) && !defined (__RTP__)
+#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670) && !defined (__RTP__)
# if defined (PIPE_BUF) && (PIPE_BUF == -1)
# undef PIPE_BUF
# endif
diff --git a/dep/acelite/ace/os_include/os_netdb.h b/dep/acelite/ace/os_include/os_netdb.h
index 87629474aa9..14a8e5d7f8b 100644
--- a/dep/acelite/ace/os_include/os_netdb.h
+++ b/dep/acelite/ace/os_include/os_netdb.h
@@ -6,7 +6,7 @@
*
* definitions for network database operations
*
- * $Id: os_netdb.h 91743 2010-09-13 18:24:51Z johnnyw $
+ * $Id: os_netdb.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -27,10 +27,6 @@
#include "ace/os_include/netinet/os_in.h"
#include "ace/os_include/os_limits.h"
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
-# include /**/ <hostLib.h>
-#endif /* ACE_VXWORKS */
-
// Place all additions (especially function declarations) within extern "C" {}
#ifdef __cplusplus
extern "C"
diff --git a/dep/acelite/ace/os_include/os_pthread.h b/dep/acelite/ace/os_include/os_pthread.h
index 64f1b75537d..aef6fca29ab 100644
--- a/dep/acelite/ace/os_include/os_pthread.h
+++ b/dep/acelite/ace/os_include/os_pthread.h
@@ -6,7 +6,7 @@
*
* threads
*
- * $Id: os_pthread.h 91781 2010-09-15 12:49:15Z johnnyw $
+ * $Id: os_pthread.h 95761 2012-05-15 18:23:04Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -48,11 +48,7 @@
#if !defined (ACE_LACKS_PTHREAD_H)
extern "C" {
-# if defined (ACE_TANDEM_T1248_PTHREADS)
-# include /**/ <spthread.h>
-# else
# include /**/ <pthread.h>
-# endif
}
#endif /* !ACE_LACKS_PTHREAD_H */
@@ -233,26 +229,10 @@
# endif /* ! ACE_LACKS_COND_T */
typedef pthread_mutex_t ACE_thread_mutex_t;
-# if !defined (PTHREAD_CANCEL_DISABLE)
-# define PTHREAD_CANCEL_DISABLE 0
-# endif /* PTHREAD_CANCEL_DISABLE */
-
-# if !defined (PTHREAD_CANCEL_ENABLE)
-# define PTHREAD_CANCEL_ENABLE 0
-# endif /* PTHREAD_CANCEL_ENABLE */
-
-# if !defined (PTHREAD_CANCEL_DEFERRED)
-# define PTHREAD_CANCEL_DEFERRED 0
-# endif /* PTHREAD_CANCEL_DEFERRED */
-
-# if !defined (PTHREAD_CANCEL_ASYNCHRONOUS)
-# define PTHREAD_CANCEL_ASYNCHRONOUS 0
-# endif /* PTHREAD_CANCEL_ASYNCHRONOUS */
-
-# define THR_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE
-# define THR_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE
-# define THR_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED
-# define THR_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS
+# define THR_CANCEL_DISABLE 0x00000100
+# define THR_CANCEL_ENABLE 0x00000200
+# define THR_CANCEL_DEFERRED 0x00000400
+# define THR_CANCEL_ASYNCHRONOUS 0x00000800
# if !defined (PTHREAD_CREATE_JOINABLE)
# if defined (PTHREAD_CREATE_UNDETACHED)
@@ -292,20 +272,20 @@
# endif /* ACE_HAS_STHREADS */
/* MM-Graz: prevent warnings */
-# undef THR_BOUND
-# undef THR_NEW_LWP
-# undef THR_DETACHED
-# undef THR_SUSPENDED
-# undef THR_DAEMON
-
-# define THR_BOUND 0x00000001
-# define THR_NEW_LWP 0x00000002
-# define THR_DETACHED 0x00000040
-# define THR_SUSPENDED 0x00000080
-# define THR_DAEMON 0x00000100
-# define THR_SCHED_FIFO 0x00020000
-# define THR_SCHED_RR 0x00040000
-# define THR_SCHED_DEFAULT 0x00080000
+# undef THR_BOUND
+# undef THR_NEW_LWP
+# undef THR_DETACHED
+# undef THR_SUSPENDED
+# undef THR_DAEMON
+
+# define THR_BOUND 0x00000001
+# define THR_NEW_LWP 0x00000002
+# define THR_DAEMON 0x00000010
+# define THR_DETACHED 0x00000040
+# define THR_SUSPENDED 0x00000080
+# define THR_SCHED_FIFO 0x00020000
+# define THR_SCHED_RR 0x00040000
+# define THR_SCHED_DEFAULT 0x00080000
# define THR_JOINABLE 0x00010000
@@ -385,7 +365,7 @@ public:
const struct timespec * abstime);
# endif /* _XOPEN_SOURCE && _XOPEN_SOURCE < 600 */
-# endif /* linux && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) */
+# endif /* ACE_LINUX && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) */
#elif defined (ACE_HAS_STHREADS)
# if !defined (ACE_THR_PRI_FIFO_MIN)
diff --git a/dep/acelite/ace/os_include/os_pwd.h b/dep/acelite/ace/os_include/os_pwd.h
index be00448a9d0..a478a770b3b 100644
--- a/dep/acelite/ace/os_include/os_pwd.h
+++ b/dep/acelite/ace/os_include/os_pwd.h
@@ -6,7 +6,7 @@
*
* password structure
*
- * $Id: os_pwd.h 91683 2010-09-09 09:07:49Z johnnyw $
+ * $Id: os_pwd.h 93564 2011-03-16 14:35:58Z olli $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -36,14 +36,6 @@ extern "C"
{
#endif /* __cplusplus */
-#if !defined (ACE_WIN32)
-// VAC++ doesn't correctly grok the ::getpwnam_r - the function is redefined
-// in pwd.h, and that redefinition is used here
-# if defined (_AIX) && defined (__IBMCPP__) && (__IBMCPP__ >= 400)
- extern int _posix_getpwnam_r(const char *, struct passwd *, char *,
- int, struct passwd **);
-# endif /* AIX and VAC++ 4 */
-#endif /* !ACE_WIN32 */
#ifdef __cplusplus
}
diff --git a/dep/acelite/ace/os_include/os_signal.h b/dep/acelite/ace/os_include/os_signal.h
index 667f28401e4..14e12a81127 100644
--- a/dep/acelite/ace/os_include/os_signal.h
+++ b/dep/acelite/ace/os_include/os_signal.h
@@ -6,7 +6,7 @@
*
* signals
*
- * $Id: os_signal.h 91781 2010-09-15 12:49:15Z johnnyw $
+ * $Id: os_signal.h 95430 2012-01-11 20:45:28Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -34,27 +34,23 @@
#if defined (ACE_HAS_SIGINFO_T)
# if !defined (ACE_LACKS_SIGINFO_H)
-# if defined (__QNX__) || defined (__OpenBSD__) || defined (__INTERIX)
+# if defined (ACE_HAS_SYS_SIGINFO_H)
# include /**/ <sys/siginfo.h>
-# else /* __QNX__ || __OpenBSD__ */
+# else /* ACE_HAS_SYS_SIGINFO_H */
# include /**/ <siginfo.h>
-# endif /* __QNX__ || __OpenBSD__ */
+# endif /* ACE_HAS_SYS_SIGINFO_H */
# endif /* ACE_LACKS_SIGINFO_H */
#endif /* ACE_HAS_SIGINFO_T */
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) && !defined (__RTP__)
-# include /**/ <sigLib.h>
-#endif /* ACE_VXWORKS */
-
// Place all additions (especially function declarations) within extern "C" {}
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
-#if defined (ACE_LACKS_SIGSET) && !defined (__MINGW32__)
+#if defined (ACE_LACKS_SIGSET_T)
typedef u_int sigset_t;
-#endif /* ACE_LACKS_SIGSET && !sigset_t */
+#endif /* ACE_LACKS_SIGSET_T && !sigset_t */
#if !defined (ACE_HAS_SIG_ATOMIC_T)
typedef int sig_atomic_t;
diff --git a/dep/acelite/ace/os_include/os_stdio.h b/dep/acelite/ace/os_include/os_stdio.h
index e9f452024ff..fe2a7e305e3 100644
--- a/dep/acelite/ace/os_include/os_stdio.h
+++ b/dep/acelite/ace/os_include/os_stdio.h
@@ -6,7 +6,7 @@
*
* standard buffered input/output
*
- * $Id: os_stdio.h 80826 2008-03-04 14:51:23Z wotte $
+ * $Id: os_stdio.h 93597 2011-03-21 12:54:52Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -37,9 +37,6 @@
# include /**/ <ioLib.h>
// for remCurIdGet()
# include /**/ <remLib.h>
-# if defined (__RTP__) && ((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x650))
-# define L_cuserid _PARM_L_cuserid
-# endif
#endif /* ACE_VXWORKS */
// Place all additions (especially function declarations) within extern "C" {}
diff --git a/dep/acelite/ace/os_include/os_stdlib.h b/dep/acelite/ace/os_include/os_stdlib.h
index 863a508029f..5576b142c6a 100644
--- a/dep/acelite/ace/os_include/os_stdlib.h
+++ b/dep/acelite/ace/os_include/os_stdlib.h
@@ -6,7 +6,7 @@
*
* standard library definitions
*
- * $Id: os_stdlib.h 91683 2010-09-09 09:07:49Z johnnyw $
+ * $Id: os_stdlib.h 93573 2011-03-17 07:53:03Z olli $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -45,14 +45,6 @@ extern "C"
{
#endif /* __cplusplus */
- typedef u_int ACE_RANDR_TYPE;
-#if defined (ACE_HAS_BROKEN_RANDR)
- // The SunOS 5.4.X version of rand_r is inconsistent with the header
- // files...
- int rand_r (ACE_RANDR_TYPE seed);
-#else
-#endif /* ACE_HAS_BROKEN_RANDR */
-
#if defined (ACE_LACKS_PUTENV_PROTOTYPE)
int putenv (char *);
#endif /* ACE_LACKS_PUTENV_PROTOTYPE */
diff --git a/dep/acelite/ace/os_include/os_string.h b/dep/acelite/ace/os_include/os_string.h
index 0aa2f7de7cc..779e97cf9fe 100644
--- a/dep/acelite/ace/os_include/os_string.h
+++ b/dep/acelite/ace/os_include/os_string.h
@@ -6,7 +6,7 @@
*
* string operations
*
- * $Id: os_string.h 87216 2009-10-23 20:26:16Z olli $
+ * $Id: os_string.h 93117 2011-01-20 12:11:28Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -41,10 +41,6 @@ extern "C"
char *strtok_r (char *s, const char *delim, char **save_ptr);
#endif /* ACE_LACKS_STRTOK_R_PROTOTYPE */
-#if defined (ACE_LACKS_STRNLEN_PROTOTYPE)
- size_t strnlen(const char *s, size_t maxlen);
-#endif /* ACE_LACKS_STRNLEN_PROTOTYPE */
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/dep/acelite/ace/os_include/os_wchar.h b/dep/acelite/ace/os_include/os_wchar.h
index 37eab2e4ee0..86f6572bc62 100644
--- a/dep/acelite/ace/os_include/os_wchar.h
+++ b/dep/acelite/ace/os_include/os_wchar.h
@@ -6,7 +6,7 @@
*
* wide-character handling
*
- * $Id: os_wchar.h 83948 2008-12-02 13:55:34Z jtc $
+ * $Id: os_wchar.h 93117 2011-01-20 12:11:28Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -41,14 +41,6 @@ extern "C"
{
#endif /* __cplusplus */
-#if defined (ACE_LACKS_WCSTOLL_PROTOTYPE)
- long long wcstoll (const wchar_t *, wchar_t **, int);
-#endif /* ACE_LACKS_WCSTOLL_PROTOTYPE */
-
-#if defined (ACE_LACKS_WCSTOULL_PROTOTYPE)
- unsigned long long wcstoull (const wchar_t *, wchar_t **, int);
-#endif /* ACE_LACKS_WCSTOULL_PROTOTYPE */
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/dep/acelite/ace/os_include/sys/os_resource.h b/dep/acelite/ace/os_include/sys/os_resource.h
index 7f644a09d25..3ee101438cf 100644
--- a/dep/acelite/ace/os_include/sys/os_resource.h
+++ b/dep/acelite/ace/os_include/sys/os_resource.h
@@ -6,7 +6,7 @@
*
* definitions for XSI resource operations
*
- * $Id: os_resource.h 91781 2010-09-15 12:49:15Z johnnyw $
+ * $Id: os_resource.h 93895 2011-04-14 07:59:18Z olli $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -50,17 +50,6 @@ extern "C"
{
#endif /* __cplusplus */
-// There must be a better way to do this...
-#if !defined (RLIMIT_NOFILE) && !defined (ACE_LACKS_RLIMIT_NOFILE)
-# if defined (linux) || defined (AIX)
-# if defined (RLIMIT_OFILE)
-# define RLIMIT_NOFILE RLIMIT_OFILE
-# else
-# define RLIMIT_NOFILE 200
-# endif /* RLIMIT_OFILE */
-# endif /* defined (linux) || defined (AIX) */
-#endif /* RLIMIT_NOFILE */
-
#if defined (ACE_WIN32)
# define RUSAGE_SELF 1
/// Fake the UNIX rusage structure. Perhaps we can add more to this
diff --git a/dep/acelite/ace/os_include/sys/os_select.h b/dep/acelite/ace/os_include/sys/os_select.h
index 59473aff398..d6f7a36f796 100644
--- a/dep/acelite/ace/os_include/sys/os_select.h
+++ b/dep/acelite/ace/os_include/sys/os_select.h
@@ -6,7 +6,7 @@
*
* select types
*
- * $Id: os_select.h 85015 2009-04-03 12:27:59Z johnnyw $
+ * $Id: os_select.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -44,7 +44,7 @@ extern "C"
#if defined (ACE_LACKS_FD_MASK)
typedef long fd_mask;
-#endif /* __QNX__ */
+#endif /* ACE_LACKS_FD_MASK */
#if defined (ACE_WIN32)
// This will help until we figure out everything:
diff --git a/dep/acelite/ace/os_include/sys/os_stat.h b/dep/acelite/ace/os_include/sys/os_stat.h
index 19b126500c1..d4987246680 100644
--- a/dep/acelite/ace/os_include/sys/os_stat.h
+++ b/dep/acelite/ace/os_include/sys/os_stat.h
@@ -6,7 +6,7 @@
*
* data returned by the stat() function
*
- * $Id: os_stat.h 85057 2009-04-08 10:59:58Z msmit $
+ * $Id: os_stat.h 95718 2012-05-01 11:42:47Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -110,6 +110,7 @@ extern "C"
# define S_IFDIR FILE_ATTRIBUTE_DIRECTORY
# define S_IFREG FILE_ATTRIBUTE_NORMAL
# define S_IFLNK 0
+# define S_IFCHR 0
# if !defined (__MINGW32__)
// Since CE does not have _stat by default as NT/2000 does, the 'stat'
diff --git a/dep/acelite/ace/os_include/sys/os_time.h b/dep/acelite/ace/os_include/sys/os_time.h
index 937ceebaa13..29e317d58f7 100644
--- a/dep/acelite/ace/os_include/sys/os_time.h
+++ b/dep/acelite/ace/os_include/sys/os_time.h
@@ -6,7 +6,7 @@
*
* time types
*
- * $Id: os_time.h 85365 2009-05-18 08:27:42Z johnnyw $
+ * $Id: os_time.h 96090 2012-08-22 06:13:38Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -30,9 +30,13 @@
# include /**/ <sys/time.h>
#endif /* !ACE_LACKS_SYS_TIME_H */
-#if defined (ACE_VXWORKS) && (ACE_VXWORKS == 0x620)
-# include /**/ <time.h> // VxWorks 6.2 defined timeval in time.h
-#endif
+#if defined (ACE_LACKS_CLOCK_REALTIME)
+# define CLOCK_REALTIME 0
+#endif /* ACE_LACKS_CLOCK_REALTIME */
+
+#if defined (ACE_LACKS_CLOCK_MONOTONIC)
+# define CLOCK_MONOTONIC 1
+#endif /* ACE_LACKS_CLOCK_MONOTONIC */
// Place all additions (especially function declarations) within extern "C" {}
#ifdef __cplusplus
diff --git a/dep/acelite/ace/os_include/sys/os_types.h b/dep/acelite/ace/os_include/sys/os_types.h
index 195f24cffa5..d2920899283 100644
--- a/dep/acelite/ace/os_include/sys/os_types.h
+++ b/dep/acelite/ace/os_include/sys/os_types.h
@@ -6,7 +6,7 @@
*
* data types
*
- * $Id: os_types.h 91683 2010-09-09 09:07:49Z johnnyw $
+ * $Id: os_types.h 96089 2012-08-21 16:59:07Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -47,13 +47,9 @@ extern "C"
typedef double ACE_timer_t;
-// todo: don't forget to clean this up! ;-)
-#if !defined (ACE_HAS_CLOCK_GETTIME) && !(defined (_CLOCKID_T_) || defined (_CLOCKID_T))
+#if defined (ACE_LACKS_CLOCKID_T)
typedef int clockid_t;
-# if !defined (CLOCK_REALTIME)
-# define CLOCK_REALTIME 0
-# endif /* CLOCK_REALTIME */
-#endif /* ! ACE_HAS_CLOCK_GETTIME && ! _CLOCKID_T_ */
+#endif /* ACE_LACKS_CLOCKID_T */
#if defined (ACE_LACKS_DEV_T)
typedef unsigned int dev_t;
@@ -71,7 +67,7 @@ typedef double ACE_timer_t;
#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG == 8
typedef off_t ACE_LOFF_T;
-#elif defined (ACE_HAS_RTEMS) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || defined(ACE_MVS) || defined(__INTERIX) || \
+#elif defined (ACE_HAS_RTEMS) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || defined(__INTERIX) || \
(defined (ACE_OPENVMS) && defined (_LARGEFILE))
typedef off_t ACE_LOFF_T;
#elif defined (AIX) || defined (HPUX) || defined (__QNX__)
@@ -80,7 +76,7 @@ typedef double ACE_timer_t;
typedef offset_t ACE_LOFF_T;
#elif defined (WIN32)
typedef __int64 ACE_LOFF_T;
-#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x680)) || \
+#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x690)) || \
defined (ACE_LYNXOS_MAJOR) || \
(defined (ACE_OPENVMS) && !defined (_LARGEFILE)) || \
defined (__TANDEM)
diff --git a/dep/bzip2/LICENSE b/dep/bzip2/LICENSE
new file mode 100644
index 00000000000..cc614178cf7
--- /dev/null
+++ b/dep/bzip2/LICENSE
@@ -0,0 +1,42 @@
+
+--------------------------------------------------------------------------
+
+This program, "bzip2", the associated library "libbzip2", and all
+documentation, are copyright (C) 1996-2010 Julian R Seward. All
+rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, jseward@bzip.org
+bzip2/libbzip2 version 1.0.6 of 6 September 2010
+
+--------------------------------------------------------------------------
diff --git a/dep/bzip2/README b/dep/bzip2/README
new file mode 100644
index 00000000000..9fb0f636013
--- /dev/null
+++ b/dep/bzip2/README
@@ -0,0 +1,215 @@
+
+This is the README for bzip2/libzip2.
+This version is fully compatible with the previous public releases.
+
+------------------------------------------------------------------
+This file is part of bzip2/libbzip2, a program and library for
+lossless, block-sorting data compression.
+
+bzip2/libbzip2 version 1.0.6 of 6 September 2010
+Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+
+Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
+
+This program is released under the terms of the license contained
+in the file LICENSE.
+------------------------------------------------------------------
+
+Complete documentation is available in Postscript form (manual.ps),
+PDF (manual.pdf) or html (manual.html). A plain-text version of the
+manual page is available as bzip2.txt.
+
+
+HOW TO BUILD -- UNIX
+
+Type 'make'. This builds the library libbz2.a and then the programs
+bzip2 and bzip2recover. Six self-tests are run. If the self-tests
+complete ok, carry on to installation:
+
+To install in /usr/local/bin, /usr/local/lib, /usr/local/man and
+/usr/local/include, type
+
+ make install
+
+To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
+
+ make install PREFIX=/xxx/yyy
+
+If you are (justifiably) paranoid and want to see what 'make install'
+is going to do, you can first do
+
+ make -n install or
+ make -n install PREFIX=/xxx/yyy respectively.
+
+The -n instructs make to show the commands it would execute, but not
+actually execute them.
+
+
+HOW TO BUILD -- UNIX, shared library libbz2.so.
+
+Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for
+Linux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims
+that it works for any other platform, though I suspect it probably
+will work for most platforms employing both ELF and gcc.
+
+bzip2-shared, a client of the shared library, is also built, but not
+self-tested. So I suggest you also build using the normal Makefile,
+since that conducts a self-test. A second reason to prefer the
+version statically linked to the library is that, on x86 platforms,
+building shared objects makes a valuable register (%ebx) unavailable
+to gcc, resulting in a slowdown of 10%-20%, at least for bzip2.
+
+Important note for people upgrading .so's from 0.9.0/0.9.5 to version
+1.0.X. All the functions in the library have been renamed, from (eg)
+bzCompress to BZ2_bzCompress, to avoid namespace pollution.
+Unfortunately this means that the libbz2.so created by
+Makefile-libbz2_so will not work with any program which used an older
+version of the library. I do encourage library clients to make the
+effort to upgrade to use version 1.0, since it is both faster and more
+robust than previous versions.
+
+
+HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
+
+It's difficult for me to support compilation on all these platforms.
+My approach is to collect binaries for these platforms, and put them
+on the master web site (http://www.bzip.org). Look there. However
+(FWIW), bzip2-1.0.X is very standard ANSI C and should compile
+unmodified with MS Visual C. If you have difficulties building, you
+might want to read README.COMPILATION.PROBLEMS.
+
+At least using MS Visual C++ 6, you can build from the unmodified
+sources by issuing, in a command shell:
+
+ nmake -f makefile.msc
+
+(you may need to first run the MSVC-provided script VCVARS32.BAT
+ so as to set up paths to the MSVC tools correctly).
+
+
+VALIDATION
+
+Correct operation, in the sense that a compressed file can always be
+decompressed to reproduce the original, is obviously of paramount
+importance. To validate bzip2, I used a modified version of Mark
+Nelson's churn program. Churn is an automated test driver which
+recursively traverses a directory structure, using bzip2 to compress
+and then decompress each file it encounters, and checking that the
+decompressed data is the same as the original.
+
+
+
+Please read and be aware of the following:
+
+WARNING:
+
+ This program and library (attempts to) compress data by
+ performing several non-trivial transformations on it.
+ Unless you are 100% familiar with *all* the algorithms
+ contained herein, and with the consequences of modifying them,
+ you should NOT meddle with the compression or decompression
+ machinery. Incorrect changes can and very likely *will*
+ lead to disastrous loss of data.
+
+
+DISCLAIMER:
+
+ I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
+ USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED.
+
+ Every compression of a file implies an assumption that the
+ compressed file can be decompressed to reproduce the original.
+ Great efforts in design, coding and testing have been made to
+ ensure that this program works correctly. However, the complexity
+ of the algorithms, and, in particular, the presence of various
+ special cases in the code which occur with very low but non-zero
+ probability make it impossible to rule out the possibility of bugs
+ remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS
+ PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
+ SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
+
+ That is not to say this program is inherently unreliable.
+ Indeed, I very much hope the opposite is true. bzip2/libbzip2
+ has been carefully constructed and extensively tested.
+
+
+PATENTS:
+
+ To the best of my knowledge, bzip2/libbzip2 does not use any
+ patented algorithms. However, I do not have the resources
+ to carry out a patent search. Therefore I cannot give any
+ guarantee of the above statement.
+
+
+
+WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ?
+
+ * Approx 10% faster compression, 30% faster decompression
+ * -t (test mode) is a lot quicker
+ * Can decompress concatenated compressed files
+ * Programming interface, so programs can directly read/write .bz2 files
+ * Less restrictive (BSD-style) licensing
+ * Flag handling more compatible with GNU gzip
+ * Much more documentation, i.e., a proper user manual
+ * Hopefully, improved portability (at least of the library)
+
+WHAT'S NEW IN 0.9.5 ?
+
+ * Compression speed is much less sensitive to the input
+ data than in previous versions. Specifically, the very
+ slow performance caused by repetitive data is fixed.
+ * Many small improvements in file and flag handling.
+ * A Y2K statement.
+
+WHAT'S NEW IN 1.0.0 ?
+
+ See the CHANGES file.
+
+WHAT'S NEW IN 1.0.2 ?
+
+ See the CHANGES file.
+
+WHAT'S NEW IN 1.0.3 ?
+
+ See the CHANGES file.
+
+WHAT'S NEW IN 1.0.4 ?
+
+ See the CHANGES file.
+
+WHAT'S NEW IN 1.0.5 ?
+
+ See the CHANGES file.
+
+WHAT'S NEW IN 1.0.6 ?
+
+ See the CHANGES file.
+
+
+I hope you find bzip2 useful. Feel free to contact me at
+ jseward@bzip.org
+if you have any suggestions or queries. Many people mailed me with
+comments, suggestions and patches after the releases of bzip-0.15,
+bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
+1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this
+feedback. I thank you for your comments.
+
+bzip2's "home" is http://www.bzip.org/
+
+Julian Seward
+jseward@bzip.org
+Cambridge, UK.
+
+18 July 1996 (version 0.15)
+25 August 1996 (version 0.21)
+ 7 August 1997 (bzip2, version 0.1)
+29 August 1997 (bzip2, version 0.1pl2)
+23 August 1998 (bzip2, version 0.9.0)
+ 8 June 1999 (bzip2, version 0.9.5)
+ 4 Sept 1999 (bzip2, version 0.9.5d)
+ 5 May 2000 (bzip2, version 1.0pre8)
+30 December 2001 (bzip2, version 1.0.2pre1)
+15 February 2005 (bzip2, version 1.0.3)
+20 December 2006 (bzip2, version 1.0.4)
+10 December 2007 (bzip2, version 1.0.5)
+ 6 Sept 2010 (bzip2, version 1.0.6)
diff --git a/dep/bzip2/blocksort.c b/dep/bzip2/blocksort.c
index bd2dec157fa..d0d662cd4e9 100644
--- a/dep/bzip2/blocksort.c
+++ b/dep/bzip2/blocksort.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/bzip2/bzip2.c b/dep/bzip2/bzip2.c
new file mode 100644
index 00000000000..6de9d1d1488
--- /dev/null
+++ b/dep/bzip2/bzip2.c
@@ -0,0 +1,2034 @@
+
+/*-----------------------------------------------------------*/
+/*--- A block-sorting, lossless compressor bzip2.c ---*/
+/*-----------------------------------------------------------*/
+
+/* ------------------------------------------------------------------
+ This file is part of bzip2/libbzip2, a program and library for
+ lossless, block-sorting data compression.
+
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+
+ Please read the WARNING, DISCLAIMER and PATENTS sections in the
+ README file.
+
+ This program is released under the terms of the license contained
+ in the file LICENSE.
+ ------------------------------------------------------------------ */
+
+
+/* Place a 1 beside your platform, and 0 elsewhere.
+ Generic 32-bit Unix.
+ Also works on 64-bit Unix boxes.
+ This is the default.
+*/
+#define BZ_UNIX 1
+
+/*--
+ Win32, as seen by Jacob Navia's excellent
+ port of (Chris Fraser & David Hanson)'s excellent
+ lcc compiler. Or with MS Visual C.
+ This is selected automatically if compiled by a compiler which
+ defines _WIN32, not including the Cygwin GCC.
+--*/
+#define BZ_LCCWIN32 0
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#undef BZ_LCCWIN32
+#define BZ_LCCWIN32 1
+#undef BZ_UNIX
+#define BZ_UNIX 0
+#endif
+
+
+/*---------------------------------------------*/
+/*--
+ Some stuff for all platforms.
+--*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <math.h>
+#include <errno.h>
+#include <ctype.h>
+#include "bzlib.h"
+
+#define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); }
+#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); }
+#define ERROR_IF_MINUS_ONE(i) { if ((i) == (-1)) ioError(); }
+
+
+/*---------------------------------------------*/
+/*--
+ Platform-specific stuff.
+--*/
+
+#if BZ_UNIX
+# include <fcntl.h>
+# include <sys/types.h>
+# include <utime.h>
+# include <unistd.h>
+# include <sys/stat.h>
+# include <sys/times.h>
+
+# define PATH_SEP '/'
+# define MY_LSTAT lstat
+# define MY_STAT stat
+# define MY_S_ISREG S_ISREG
+# define MY_S_ISDIR S_ISDIR
+
+# define APPEND_FILESPEC(root, name) \
+ root=snocString((root), (name))
+
+# define APPEND_FLAG(root, name) \
+ root=snocString((root), (name))
+
+# define SET_BINARY_MODE(fd) /**/
+
+# ifdef __GNUC__
+# define NORETURN __attribute__ ((noreturn))
+# else
+# define NORETURN /**/
+# endif
+
+# ifdef __DJGPP__
+# include <io.h>
+# include <fcntl.h>
+# undef MY_LSTAT
+# undef MY_STAT
+# define MY_LSTAT stat
+# define MY_STAT stat
+# undef SET_BINARY_MODE
+# define SET_BINARY_MODE(fd) \
+ do { \
+ int retVal = setmode ( fileno ( fd ), \
+ O_BINARY ); \
+ ERROR_IF_MINUS_ONE ( retVal ); \
+ } while ( 0 )
+# endif
+
+# ifdef __CYGWIN__
+# include <io.h>
+# include <fcntl.h>
+# undef SET_BINARY_MODE
+# define SET_BINARY_MODE(fd) \
+ do { \
+ int retVal = setmode ( fileno ( fd ), \
+ O_BINARY ); \
+ ERROR_IF_MINUS_ONE ( retVal ); \
+ } while ( 0 )
+# endif
+#endif /* BZ_UNIX */
+
+
+
+#if BZ_LCCWIN32
+# include <io.h>
+# include <fcntl.h>
+# include <sys\stat.h>
+
+# define NORETURN /**/
+# define PATH_SEP '\\'
+# define MY_LSTAT _stat
+# define MY_STAT _stat
+# define MY_S_ISREG(x) ((x) & _S_IFREG)
+# define MY_S_ISDIR(x) ((x) & _S_IFDIR)
+
+# define APPEND_FLAG(root, name) \
+ root=snocString((root), (name))
+
+# define APPEND_FILESPEC(root, name) \
+ root = snocString ((root), (name))
+
+# define SET_BINARY_MODE(fd) \
+ do { \
+ int retVal = setmode ( fileno ( fd ), \
+ O_BINARY ); \
+ ERROR_IF_MINUS_ONE ( retVal ); \
+ } while ( 0 )
+
+#endif /* BZ_LCCWIN32 */
+
+
+/*---------------------------------------------*/
+/*--
+ Some more stuff for all platforms :-)
+--*/
+
+typedef char Char;
+typedef unsigned char Bool;
+typedef unsigned char UChar;
+typedef int Int32;
+typedef unsigned int UInt32;
+typedef short Int16;
+typedef unsigned short UInt16;
+
+#define True ((Bool)1)
+#define False ((Bool)0)
+
+/*--
+ IntNative is your platform's `native' int size.
+ Only here to avoid probs with 64-bit platforms.
+--*/
+typedef int IntNative;
+
+
+/*---------------------------------------------------*/
+/*--- Misc (file handling) data decls ---*/
+/*---------------------------------------------------*/
+
+Int32 verbosity;
+Bool keepInputFiles, smallMode, deleteOutputOnInterrupt;
+Bool forceOverwrite, testFailsExist, unzFailsExist, noisy;
+Int32 numFileNames, numFilesProcessed, blockSize100k;
+Int32 exitValue;
+
+/*-- source modes; F==file, I==stdin, O==stdout --*/
+#define SM_I2O 1
+#define SM_F2O 2
+#define SM_F2F 3
+
+/*-- operation modes --*/
+#define OM_Z 1
+#define OM_UNZ 2
+#define OM_TEST 3
+
+Int32 opMode;
+Int32 srcMode;
+
+#define FILE_NAME_LEN 1034
+
+Int32 longestFileName;
+Char inName [FILE_NAME_LEN];
+Char outName[FILE_NAME_LEN];
+Char tmpName[FILE_NAME_LEN];
+Char *progName;
+Char progNameReally[FILE_NAME_LEN];
+FILE *outputHandleJustInCase;
+Int32 workFactor;
+
+static void panic ( const Char* ) NORETURN;
+static void ioError ( void ) NORETURN;
+static void outOfMemory ( void ) NORETURN;
+static void configError ( void ) NORETURN;
+static void crcError ( void ) NORETURN;
+static void cleanUpAndFail ( Int32 ) NORETURN;
+static void compressedStreamEOF ( void ) NORETURN;
+
+static void copyFileName ( Char*, Char* );
+static void* myMalloc ( Int32 );
+static void applySavedFileAttrToOutputFile ( IntNative fd );
+
+
+
+/*---------------------------------------------------*/
+/*--- An implementation of 64-bit ints. Sigh. ---*/
+/*--- Roll on widespread deployment of ANSI C9X ! ---*/
+/*---------------------------------------------------*/
+
+typedef
+ struct { UChar b[8]; }
+ UInt64;
+
+
+static
+void uInt64_from_UInt32s ( UInt64* n, UInt32 lo32, UInt32 hi32 )
+{
+ n->b[7] = (UChar)((hi32 >> 24) & 0xFF);
+ n->b[6] = (UChar)((hi32 >> 16) & 0xFF);
+ n->b[5] = (UChar)((hi32 >> 8) & 0xFF);
+ n->b[4] = (UChar) (hi32 & 0xFF);
+ n->b[3] = (UChar)((lo32 >> 24) & 0xFF);
+ n->b[2] = (UChar)((lo32 >> 16) & 0xFF);
+ n->b[1] = (UChar)((lo32 >> 8) & 0xFF);
+ n->b[0] = (UChar) (lo32 & 0xFF);
+}
+
+
+static
+double uInt64_to_double ( UInt64* n )
+{
+ Int32 i;
+ double base = 1.0;
+ double sum = 0.0;
+ for (i = 0; i < 8; i++) {
+ sum += base * (double)(n->b[i]);
+ base *= 256.0;
+ }
+ return sum;
+}
+
+
+static
+Bool uInt64_isZero ( UInt64* n )
+{
+ Int32 i;
+ for (i = 0; i < 8; i++)
+ if (n->b[i] != 0) return 0;
+ return 1;
+}
+
+
+/* Divide *n by 10, and return the remainder. */
+static
+Int32 uInt64_qrm10 ( UInt64* n )
+{
+ UInt32 rem, tmp;
+ Int32 i;
+ rem = 0;
+ for (i = 7; i >= 0; i--) {
+ tmp = rem * 256 + n->b[i];
+ n->b[i] = tmp / 10;
+ rem = tmp % 10;
+ }
+ return rem;
+}
+
+
+/* ... and the Whole Entire Point of all this UInt64 stuff is
+ so that we can supply the following function.
+*/
+static
+void uInt64_toAscii ( char* outbuf, UInt64* n )
+{
+ Int32 i, q;
+ UChar buf[32];
+ Int32 nBuf = 0;
+ UInt64 n_copy = *n;
+ do {
+ q = uInt64_qrm10 ( &n_copy );
+ buf[nBuf] = q + '0';
+ nBuf++;
+ } while (!uInt64_isZero(&n_copy));
+ outbuf[nBuf] = 0;
+ for (i = 0; i < nBuf; i++)
+ outbuf[i] = buf[nBuf-i-1];
+}
+
+
+/*---------------------------------------------------*/
+/*--- Processing of complete files and streams ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------*/
+static
+Bool myfeof ( FILE* f )
+{
+ Int32 c = fgetc ( f );
+ if (c == EOF) return True;
+ ungetc ( c, f );
+ return False;
+}
+
+
+/*---------------------------------------------*/
+static
+void compressStream ( FILE *stream, FILE *zStream )
+{
+ BZFILE* bzf = NULL;
+ UChar ibuf[5000];
+ Int32 nIbuf;
+ UInt32 nbytes_in_lo32, nbytes_in_hi32;
+ UInt32 nbytes_out_lo32, nbytes_out_hi32;
+ Int32 bzerr, bzerr_dummy, ret;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
+ bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
+ blockSize100k, verbosity, workFactor );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n" );
+
+ while (True) {
+
+ if (myfeof(stream)) break;
+ nIbuf = fread ( ibuf, sizeof(UChar), 5000, stream );
+ if (ferror(stream)) goto errhandler_io;
+ if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ }
+
+ BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
+ &nbytes_in_lo32, &nbytes_in_hi32,
+ &nbytes_out_lo32, &nbytes_out_hi32 );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (ferror(zStream)) goto errhandler_io;
+ ret = fflush ( zStream );
+ if (ret == EOF) goto errhandler_io;
+ if (zStream != stdout) {
+ Int32 fd = fileno ( zStream );
+ if (fd < 0) goto errhandler_io;
+ applySavedFileAttrToOutputFile ( fd );
+ ret = fclose ( zStream );
+ outputHandleJustInCase = NULL;
+ if (ret == EOF) goto errhandler_io;
+ }
+ outputHandleJustInCase = NULL;
+ if (ferror(stream)) goto errhandler_io;
+ ret = fclose ( stream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (verbosity >= 1) {
+ if (nbytes_in_lo32 == 0 && nbytes_in_hi32 == 0) {
+ fprintf ( stderr, " no data compressed.\n");
+ } else {
+ Char buf_nin[32], buf_nout[32];
+ UInt64 nbytes_in, nbytes_out;
+ double nbytes_in_d, nbytes_out_d;
+ uInt64_from_UInt32s ( &nbytes_in,
+ nbytes_in_lo32, nbytes_in_hi32 );
+ uInt64_from_UInt32s ( &nbytes_out,
+ nbytes_out_lo32, nbytes_out_hi32 );
+ nbytes_in_d = uInt64_to_double ( &nbytes_in );
+ nbytes_out_d = uInt64_to_double ( &nbytes_out );
+ uInt64_toAscii ( buf_nin, &nbytes_in );
+ uInt64_toAscii ( buf_nout, &nbytes_out );
+ fprintf ( stderr, "%6.3f:1, %6.3f bits/byte, "
+ "%5.2f%% saved, %s in, %s out.\n",
+ nbytes_in_d / nbytes_out_d,
+ (8.0 * nbytes_out_d) / nbytes_in_d,
+ 100.0 * (1.0 - nbytes_out_d / nbytes_in_d),
+ buf_nin,
+ buf_nout
+ );
+ }
+ }
+
+ return;
+
+ errhandler:
+ BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1,
+ &nbytes_in_lo32, &nbytes_in_hi32,
+ &nbytes_out_lo32, &nbytes_out_hi32 );
+ switch (bzerr) {
+ case BZ_CONFIG_ERROR:
+ configError(); break;
+ case BZ_MEM_ERROR:
+ outOfMemory (); break;
+ case BZ_IO_ERROR:
+ errhandler_io:
+ ioError(); break;
+ default:
+ panic ( "compress:unexpected error" );
+ }
+
+ panic ( "compress:end" );
+ /*notreached*/
+}
+
+
+
+/*---------------------------------------------*/
+static
+Bool uncompressStream ( FILE *zStream, FILE *stream )
+{
+ BZFILE* bzf = NULL;
+ Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
+ UChar obuf[5000];
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ void* unusedTmpV;
+ UChar* unusedTmp;
+
+ nUnused = 0;
+ streamNo = 0;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+ &bzerr, zStream, verbosity,
+ (int)smallMode, unused, nUnused
+ );
+ if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
+ streamNo++;
+
+ while (bzerr == BZ_OK) {
+ nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
+ if (bzerr == BZ_DATA_ERROR_MAGIC) goto trycat;
+ if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
+ fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+ BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
+ if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
+
+ unusedTmp = (UChar*)unusedTmpV;
+ for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
+
+ BZ2_bzReadClose ( &bzerr, bzf );
+ if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
+
+ if (nUnused == 0 && myfeof(zStream)) break;
+ }
+
+ closeok:
+ if (ferror(zStream)) goto errhandler_io;
+ if (stream != stdout) {
+ Int32 fd = fileno ( stream );
+ if (fd < 0) goto errhandler_io;
+ applySavedFileAttrToOutputFile ( fd );
+ }
+ ret = fclose ( zStream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (ferror(stream)) goto errhandler_io;
+ ret = fflush ( stream );
+ if (ret != 0) goto errhandler_io;
+ if (stream != stdout) {
+ ret = fclose ( stream );
+ outputHandleJustInCase = NULL;
+ if (ret == EOF) goto errhandler_io;
+ }
+ outputHandleJustInCase = NULL;
+ if (verbosity >= 2) fprintf ( stderr, "\n " );
+ return True;
+
+ trycat:
+ if (forceOverwrite) {
+ rewind(zStream);
+ while (True) {
+ if (myfeof(zStream)) break;
+ nread = fread ( obuf, sizeof(UChar), 5000, zStream );
+ if (ferror(zStream)) goto errhandler_io;
+ if (nread > 0) fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
+ }
+ goto closeok;
+ }
+
+ errhandler:
+ BZ2_bzReadClose ( &bzerr_dummy, bzf );
+ switch (bzerr) {
+ case BZ_CONFIG_ERROR:
+ configError(); break;
+ case BZ_IO_ERROR:
+ errhandler_io:
+ ioError(); break;
+ case BZ_DATA_ERROR:
+ crcError();
+ case BZ_MEM_ERROR:
+ outOfMemory();
+ case BZ_UNEXPECTED_EOF:
+ compressedStreamEOF();
+ case BZ_DATA_ERROR_MAGIC:
+ if (zStream != stdin) fclose(zStream);
+ if (stream != stdout) fclose(stream);
+ if (streamNo == 1) {
+ return False;
+ } else {
+ if (noisy)
+ fprintf ( stderr,
+ "\n%s: %s: trailing garbage after EOF ignored\n",
+ progName, inName );
+ return True;
+ }
+ default:
+ panic ( "decompress:unexpected error" );
+ }
+
+ panic ( "decompress:end" );
+ return True; /*notreached*/
+}
+
+
+/*---------------------------------------------*/
+static
+Bool testStream ( FILE *zStream )
+{
+ BZFILE* bzf = NULL;
+ Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
+ UChar obuf[5000];
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ void* unusedTmpV;
+ UChar* unusedTmp;
+
+ nUnused = 0;
+ streamNo = 0;
+
+ SET_BINARY_MODE(zStream);
+ if (ferror(zStream)) goto errhandler_io;
+
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+ &bzerr, zStream, verbosity,
+ (int)smallMode, unused, nUnused
+ );
+ if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
+ streamNo++;
+
+ while (bzerr == BZ_OK) {
+ nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
+ if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+ BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
+ if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
+
+ unusedTmp = (UChar*)unusedTmpV;
+ for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
+
+ BZ2_bzReadClose ( &bzerr, bzf );
+ if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
+ if (nUnused == 0 && myfeof(zStream)) break;
+
+ }
+
+ if (ferror(zStream)) goto errhandler_io;
+ ret = fclose ( zStream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n " );
+ return True;
+
+ errhandler:
+ BZ2_bzReadClose ( &bzerr_dummy, bzf );
+ if (verbosity == 0)
+ fprintf ( stderr, "%s: %s: ", progName, inName );
+ switch (bzerr) {
+ case BZ_CONFIG_ERROR:
+ configError(); break;
+ case BZ_IO_ERROR:
+ errhandler_io:
+ ioError(); break;
+ case BZ_DATA_ERROR:
+ fprintf ( stderr,
+ "data integrity (CRC) error in data\n" );
+ return False;
+ case BZ_MEM_ERROR:
+ outOfMemory();
+ case BZ_UNEXPECTED_EOF:
+ fprintf ( stderr,
+ "file ends unexpectedly\n" );
+ return False;
+ case BZ_DATA_ERROR_MAGIC:
+ if (zStream != stdin) fclose(zStream);
+ if (streamNo == 1) {
+ fprintf ( stderr,
+ "bad magic number (file not created by bzip2)\n" );
+ return False;
+ } else {
+ if (noisy)
+ fprintf ( stderr,
+ "trailing garbage after EOF ignored\n" );
+ return True;
+ }
+ default:
+ panic ( "test:unexpected error" );
+ }
+
+ panic ( "test:end" );
+ return True; /*notreached*/
+}
+
+
+/*---------------------------------------------------*/
+/*--- Error [non-] handling grunge ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------*/
+static
+void setExit ( Int32 v )
+{
+ if (v > exitValue) exitValue = v;
+}
+
+
+/*---------------------------------------------*/
+static
+void cadvise ( void )
+{
+ if (noisy)
+ fprintf (
+ stderr,
+ "\nIt is possible that the compressed file(s) have become corrupted.\n"
+ "You can use the -tvv option to test integrity of such files.\n\n"
+ "You can use the `bzip2recover' program to attempt to recover\n"
+ "data from undamaged sections of corrupted files.\n\n"
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void showFileNames ( void )
+{
+ if (noisy)
+ fprintf (
+ stderr,
+ "\tInput file = %s, output file = %s\n",
+ inName, outName
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void cleanUpAndFail ( Int32 ec )
+{
+ IntNative retVal;
+ struct MY_STAT statBuf;
+
+ if ( srcMode == SM_F2F
+ && opMode != OM_TEST
+ && deleteOutputOnInterrupt ) {
+
+ /* Check whether input file still exists. Delete output file
+ only if input exists to avoid loss of data. Joerg Prante, 5
+ January 2002. (JRS 06-Jan-2002: other changes in 1.0.2 mean
+ this is less likely to happen. But to be ultra-paranoid, we
+ do the check anyway.) */
+ retVal = MY_STAT ( inName, &statBuf );
+ if (retVal == 0) {
+ if (noisy)
+ fprintf ( stderr,
+ "%s: Deleting output file %s, if it exists.\n",
+ progName, outName );
+ if (outputHandleJustInCase != NULL)
+ fclose ( outputHandleJustInCase );
+ retVal = remove ( outName );
+ if (retVal != 0)
+ fprintf ( stderr,
+ "%s: WARNING: deletion of output file "
+ "(apparently) failed.\n",
+ progName );
+ } else {
+ fprintf ( stderr,
+ "%s: WARNING: deletion of output file suppressed\n",
+ progName );
+ fprintf ( stderr,
+ "%s: since input file no longer exists. Output file\n",
+ progName );
+ fprintf ( stderr,
+ "%s: `%s' may be incomplete.\n",
+ progName, outName );
+ fprintf ( stderr,
+ "%s: I suggest doing an integrity test (bzip2 -tv)"
+ " of it.\n",
+ progName );
+ }
+ }
+
+ if (noisy && numFileNames > 0 && numFilesProcessed < numFileNames) {
+ fprintf ( stderr,
+ "%s: WARNING: some files have not been processed:\n"
+ "%s: %d specified on command line, %d not processed yet.\n\n",
+ progName, progName,
+ numFileNames, numFileNames - numFilesProcessed );
+ }
+ setExit(ec);
+ exit(exitValue);
+}
+
+
+/*---------------------------------------------*/
+static
+void panic ( const Char* s )
+{
+ fprintf ( stderr,
+ "\n%s: PANIC -- internal consistency error:\n"
+ "\t%s\n"
+ "\tThis is a BUG. Please report it to me at:\n"
+ "\tjseward@bzip.org\n",
+ progName, s );
+ showFileNames();
+ cleanUpAndFail( 3 );
+}
+
+
+/*---------------------------------------------*/
+static
+void crcError ( void )
+{
+ fprintf ( stderr,
+ "\n%s: Data integrity error when decompressing.\n",
+ progName );
+ showFileNames();
+ cadvise();
+ cleanUpAndFail( 2 );
+}
+
+
+/*---------------------------------------------*/
+static
+void compressedStreamEOF ( void )
+{
+ if (noisy) {
+ fprintf ( stderr,
+ "\n%s: Compressed file ends unexpectedly;\n\t"
+ "perhaps it is corrupted? *Possible* reason follows.\n",
+ progName );
+ perror ( progName );
+ showFileNames();
+ cadvise();
+ }
+ cleanUpAndFail( 2 );
+}
+
+
+/*---------------------------------------------*/
+static
+void ioError ( void )
+{
+ fprintf ( stderr,
+ "\n%s: I/O or other error, bailing out. "
+ "Possible reason follows.\n",
+ progName );
+ perror ( progName );
+ showFileNames();
+ cleanUpAndFail( 1 );
+}
+
+
+/*---------------------------------------------*/
+static
+void mySignalCatcher ( IntNative n )
+{
+ fprintf ( stderr,
+ "\n%s: Control-C or similar caught, quitting.\n",
+ progName );
+ cleanUpAndFail(1);
+}
+
+
+/*---------------------------------------------*/
+static
+void mySIGSEGVorSIGBUScatcher ( IntNative n )
+{
+ if (opMode == OM_Z)
+ fprintf (
+ stderr,
+ "\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n"
+ "\n"
+ " Possible causes are (most likely first):\n"
+ " (1) This computer has unreliable memory or cache hardware\n"
+ " (a surprisingly common problem; try a different machine.)\n"
+ " (2) A bug in the compiler used to create this executable\n"
+ " (unlikely, if you didn't compile bzip2 yourself.)\n"
+ " (3) A real bug in bzip2 -- I hope this should never be the case.\n"
+ " The user's manual, Section 4.3, has more info on (1) and (2).\n"
+ " \n"
+ " If you suspect this is a bug in bzip2, or are unsure about (1)\n"
+ " or (2), feel free to report it to me at: jseward@bzip.org.\n"
+ " Section 4.3 of the user's manual describes the info a useful\n"
+ " bug report should have. If the manual is available on your\n"
+ " system, please try and read it before mailing me. If you don't\n"
+ " have the manual or can't be bothered to read it, mail me anyway.\n"
+ "\n",
+ progName );
+ else
+ fprintf (
+ stderr,
+ "\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
+ "\n"
+ " Possible causes are (most likely first):\n"
+ " (1) The compressed data is corrupted, and bzip2's usual checks\n"
+ " failed to detect this. Try bzip2 -tvv my_file.bz2.\n"
+ " (2) This computer has unreliable memory or cache hardware\n"
+ " (a surprisingly common problem; try a different machine.)\n"
+ " (3) A bug in the compiler used to create this executable\n"
+ " (unlikely, if you didn't compile bzip2 yourself.)\n"
+ " (4) A real bug in bzip2 -- I hope this should never be the case.\n"
+ " The user's manual, Section 4.3, has more info on (2) and (3).\n"
+ " \n"
+ " If you suspect this is a bug in bzip2, or are unsure about (2)\n"
+ " or (3), feel free to report it to me at: jseward@bzip.org.\n"
+ " Section 4.3 of the user's manual describes the info a useful\n"
+ " bug report should have. If the manual is available on your\n"
+ " system, please try and read it before mailing me. If you don't\n"
+ " have the manual or can't be bothered to read it, mail me anyway.\n"
+ "\n",
+ progName );
+
+ showFileNames();
+ if (opMode == OM_Z)
+ cleanUpAndFail( 3 ); else
+ { cadvise(); cleanUpAndFail( 2 ); }
+}
+
+
+/*---------------------------------------------*/
+static
+void outOfMemory ( void )
+{
+ fprintf ( stderr,
+ "\n%s: couldn't allocate enough memory\n",
+ progName );
+ showFileNames();
+ cleanUpAndFail(1);
+}
+
+
+/*---------------------------------------------*/
+static
+void configError ( void )
+{
+ fprintf ( stderr,
+ "bzip2: I'm not configured correctly for this platform!\n"
+ "\tI require Int32, Int16 and Char to have sizes\n"
+ "\tof 4, 2 and 1 bytes to run properly, and they don't.\n"
+ "\tProbably you can fix this by defining them correctly,\n"
+ "\tand recompiling. Bye!\n" );
+ setExit(3);
+ exit(exitValue);
+}
+
+
+/*---------------------------------------------------*/
+/*--- The main driver machinery ---*/
+/*---------------------------------------------------*/
+
+/* All rather crufty. The main problem is that input files
+ are stat()d multiple times before use. This should be
+ cleaned up.
+*/
+
+/*---------------------------------------------*/
+static
+void pad ( Char *s )
+{
+ Int32 i;
+ if ( (Int32)strlen(s) >= longestFileName ) return;
+ for (i = 1; i <= longestFileName - (Int32)strlen(s); i++)
+ fprintf ( stderr, " " );
+}
+
+
+/*---------------------------------------------*/
+static
+void copyFileName ( Char* to, Char* from )
+{
+ if ( strlen(from) > FILE_NAME_LEN-10 ) {
+ fprintf (
+ stderr,
+ "bzip2: file name\n`%s'\n"
+ "is suspiciously (more than %d chars) long.\n"
+ "Try using a reasonable file name instead. Sorry! :-)\n",
+ from, FILE_NAME_LEN-10
+ );
+ setExit(1);
+ exit(exitValue);
+ }
+
+ strncpy(to,from,FILE_NAME_LEN-10);
+ to[FILE_NAME_LEN-10]='\0';
+}
+
+
+/*---------------------------------------------*/
+static
+Bool fileExists ( Char* name )
+{
+ FILE *tmp = fopen ( name, "rb" );
+ Bool exists = (tmp != NULL);
+ if (tmp != NULL) fclose ( tmp );
+ return exists;
+}
+
+
+/*---------------------------------------------*/
+/* Open an output file safely with O_EXCL and good permissions.
+ This avoids a race condition in versions < 1.0.2, in which
+ the file was first opened and then had its interim permissions
+ set safely. We instead use open() to create the file with
+ the interim permissions required. (--- --- rw-).
+
+ For non-Unix platforms, if we are not worrying about
+ security issues, simple this simply behaves like fopen.
+*/
+static
+FILE* fopen_output_safely ( Char* name, const char* mode )
+{
+# if BZ_UNIX
+ FILE* fp;
+ IntNative fh;
+ fh = open(name, O_WRONLY|O_CREAT|O_EXCL, S_IWUSR|S_IRUSR);
+ if (fh == -1) return NULL;
+ fp = fdopen(fh, mode);
+ if (fp == NULL) close(fh);
+ return fp;
+# else
+ return fopen(name, mode);
+# endif
+}
+
+
+/*---------------------------------------------*/
+/*--
+ if in doubt, return True
+--*/
+static
+Bool notAStandardFile ( Char* name )
+{
+ IntNative i;
+ struct MY_STAT statBuf;
+
+ i = MY_LSTAT ( name, &statBuf );
+ if (i != 0) return True;
+ if (MY_S_ISREG(statBuf.st_mode)) return False;
+ return True;
+}
+
+
+/*---------------------------------------------*/
+/*--
+ rac 11/21/98 see if file has hard links to it
+--*/
+static
+Int32 countHardLinks ( Char* name )
+{
+ IntNative i;
+ struct MY_STAT statBuf;
+
+ i = MY_LSTAT ( name, &statBuf );
+ if (i != 0) return 0;
+ return (statBuf.st_nlink - 1);
+}
+
+
+/*---------------------------------------------*/
+/* Copy modification date, access date, permissions and owner from the
+ source to destination file. We have to copy this meta-info off
+ into fileMetaInfo before starting to compress / decompress it,
+ because doing it afterwards means we get the wrong access time.
+
+ To complicate matters, in compress() and decompress() below, the
+ sequence of tests preceding the call to saveInputFileMetaInfo()
+ involves calling fileExists(), which in turn establishes its result
+ by attempting to fopen() the file, and if successful, immediately
+ fclose()ing it again. So we have to assume that the fopen() call
+ does not cause the access time field to be updated.
+
+ Reading of the man page for stat() (man 2 stat) on RedHat 7.2 seems
+ to imply that merely doing open() will not affect the access time.
+ Therefore we merely need to hope that the C library only does
+ open() as a result of fopen(), and not any kind of read()-ahead
+ cleverness.
+
+ It sounds pretty fragile to me. Whether this carries across
+ robustly to arbitrary Unix-like platforms (or even works robustly
+ on this one, RedHat 7.2) is unknown to me. Nevertheless ...
+*/
+#if BZ_UNIX
+static
+struct MY_STAT fileMetaInfo;
+#endif
+
+static
+void saveInputFileMetaInfo ( Char *srcName )
+{
+# if BZ_UNIX
+ IntNative retVal;
+ /* Note use of stat here, not lstat. */
+ retVal = MY_STAT( srcName, &fileMetaInfo );
+ ERROR_IF_NOT_ZERO ( retVal );
+# endif
+}
+
+
+static
+void applySavedTimeInfoToOutputFile ( Char *dstName )
+{
+# if BZ_UNIX
+ IntNative retVal;
+ struct utimbuf uTimBuf;
+
+ uTimBuf.actime = fileMetaInfo.st_atime;
+ uTimBuf.modtime = fileMetaInfo.st_mtime;
+
+ retVal = utime ( dstName, &uTimBuf );
+ ERROR_IF_NOT_ZERO ( retVal );
+# endif
+}
+
+static
+void applySavedFileAttrToOutputFile ( IntNative fd )
+{
+# if BZ_UNIX
+ IntNative retVal;
+
+ retVal = fchmod ( fd, fileMetaInfo.st_mode );
+ ERROR_IF_NOT_ZERO ( retVal );
+
+ (void) fchown ( fd, fileMetaInfo.st_uid, fileMetaInfo.st_gid );
+ /* chown() will in many cases return with EPERM, which can
+ be safely ignored.
+ */
+# endif
+}
+
+
+/*---------------------------------------------*/
+static
+Bool containsDubiousChars ( Char* name )
+{
+# if BZ_UNIX
+ /* On unix, files can contain any characters and the file expansion
+ * is performed by the shell.
+ */
+ return False;
+# else /* ! BZ_UNIX */
+ /* On non-unix (Win* platforms), wildcard characters are not allowed in
+ * filenames.
+ */
+ for (; *name != '\0'; name++)
+ if (*name == '?' || *name == '*') return True;
+ return False;
+# endif /* BZ_UNIX */
+}
+
+
+/*---------------------------------------------*/
+#define BZ_N_SUFFIX_PAIRS 4
+
+const Char* zSuffix[BZ_N_SUFFIX_PAIRS]
+ = { ".bz2", ".bz", ".tbz2", ".tbz" };
+const Char* unzSuffix[BZ_N_SUFFIX_PAIRS]
+ = { "", "", ".tar", ".tar" };
+
+static
+Bool hasSuffix ( Char* s, const Char* suffix )
+{
+ Int32 ns = strlen(s);
+ Int32 nx = strlen(suffix);
+ if (ns < nx) return False;
+ if (strcmp(s + ns - nx, suffix) == 0) return True;
+ return False;
+}
+
+static
+Bool mapSuffix ( Char* name,
+ const Char* oldSuffix,
+ const Char* newSuffix )
+{
+ if (!hasSuffix(name,oldSuffix)) return False;
+ name[strlen(name)-strlen(oldSuffix)] = 0;
+ strcat ( name, newSuffix );
+ return True;
+}
+
+
+/*---------------------------------------------*/
+static
+void compress ( Char *name )
+{
+ FILE *inStr;
+ FILE *outStr;
+ Int32 n, i;
+ struct MY_STAT statBuf;
+
+ deleteOutputOnInterrupt = False;
+
+ if (name == NULL && srcMode != SM_I2O)
+ panic ( "compress: bad modes\n" );
+
+ switch (srcMode) {
+ case SM_I2O:
+ copyFileName ( inName, (Char*)"(stdin)" );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ case SM_F2F:
+ copyFileName ( inName, name );
+ copyFileName ( outName, name );
+ strcat ( outName, ".bz2" );
+ break;
+ case SM_F2O:
+ copyFileName ( inName, name );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ }
+
+ if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
+ if (noisy)
+ fprintf ( stderr, "%s: There are no files matching `%s'.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ }
+ for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) {
+ if (hasSuffix(inName, zSuffix[i])) {
+ if (noisy)
+ fprintf ( stderr,
+ "%s: Input file %s already has %s suffix.\n",
+ progName, inName, zSuffix[i] );
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
+ MY_STAT(inName, &statBuf);
+ if ( MY_S_ISDIR(statBuf.st_mode) ) {
+ fprintf( stderr,
+ "%s: Input file %s is a directory.\n",
+ progName,inName);
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
+ if (noisy)
+ fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode == SM_F2F && fileExists ( outName ) ) {
+ if (forceOverwrite) {
+ remove(outName);
+ } else {
+ fprintf ( stderr, "%s: Output file %s already exists.\n",
+ progName, outName );
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite &&
+ (n=countHardLinks ( inName )) > 0) {
+ fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
+ progName, inName, n, n > 1 ? "s" : "" );
+ setExit(1);
+ return;
+ }
+
+ if ( srcMode == SM_F2F ) {
+ /* Save the file's meta-info before we open it. Doing it later
+ means we mess up the access times. */
+ saveInputFileMetaInfo ( inName );
+ }
+
+ switch ( srcMode ) {
+
+ case SM_I2O:
+ inStr = stdin;
+ outStr = stdout;
+ if ( isatty ( fileno ( stdout ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't write compressed data to a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2O:
+ inStr = fopen ( inName, "rb" );
+ outStr = stdout;
+ if ( isatty ( fileno ( stdout ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't write compressed data to a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ };
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2F:
+ inStr = fopen ( inName, "rb" );
+ outStr = fopen_output_safely ( outName, "wb" );
+ if ( outStr == NULL) {
+ fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
+ progName, outName, strerror(errno) );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ }
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ if ( outStr != NULL ) fclose ( outStr );
+ setExit(1);
+ return;
+ };
+ break;
+
+ default:
+ panic ( "compress: bad srcMode" );
+ break;
+ }
+
+ if (verbosity >= 1) {
+ fprintf ( stderr, " %s: ", inName );
+ pad ( inName );
+ fflush ( stderr );
+ }
+
+ /*--- Now the input and output handles are sane. Do the Biz. ---*/
+ outputHandleJustInCase = outStr;
+ deleteOutputOnInterrupt = True;
+ compressStream ( inStr, outStr );
+ outputHandleJustInCase = NULL;
+
+ /*--- If there was an I/O error, we won't get here. ---*/
+ if ( srcMode == SM_F2F ) {
+ applySavedTimeInfoToOutputFile ( outName );
+ deleteOutputOnInterrupt = False;
+ if ( !keepInputFiles ) {
+ IntNative retVal = remove ( inName );
+ ERROR_IF_NOT_ZERO ( retVal );
+ }
+ }
+
+ deleteOutputOnInterrupt = False;
+}
+
+
+/*---------------------------------------------*/
+static
+void uncompress ( Char *name )
+{
+ FILE *inStr;
+ FILE *outStr;
+ Int32 n, i;
+ Bool magicNumberOK;
+ Bool cantGuess;
+ struct MY_STAT statBuf;
+
+ deleteOutputOnInterrupt = False;
+
+ if (name == NULL && srcMode != SM_I2O)
+ panic ( "uncompress: bad modes\n" );
+
+ cantGuess = False;
+ switch (srcMode) {
+ case SM_I2O:
+ copyFileName ( inName, (Char*)"(stdin)" );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ case SM_F2F:
+ copyFileName ( inName, name );
+ copyFileName ( outName, name );
+ for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++)
+ if (mapSuffix(outName,zSuffix[i],unzSuffix[i]))
+ goto zzz;
+ cantGuess = True;
+ strcat ( outName, ".out" );
+ break;
+ case SM_F2O:
+ copyFileName ( inName, name );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ }
+
+ zzz:
+ if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
+ if (noisy)
+ fprintf ( stderr, "%s: There are no files matching `%s'.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ }
+ if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
+ MY_STAT(inName, &statBuf);
+ if ( MY_S_ISDIR(statBuf.st_mode) ) {
+ fprintf( stderr,
+ "%s: Input file %s is a directory.\n",
+ progName,inName);
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
+ if (noisy)
+ fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( /* srcMode == SM_F2F implied && */ cantGuess ) {
+ if (noisy)
+ fprintf ( stderr,
+ "%s: Can't guess original name for %s -- using %s\n",
+ progName, inName, outName );
+ /* just a warning, no return */
+ }
+ if ( srcMode == SM_F2F && fileExists ( outName ) ) {
+ if (forceOverwrite) {
+ remove(outName);
+ } else {
+ fprintf ( stderr, "%s: Output file %s already exists.\n",
+ progName, outName );
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite &&
+ (n=countHardLinks ( inName ) ) > 0) {
+ fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
+ progName, inName, n, n > 1 ? "s" : "" );
+ setExit(1);
+ return;
+ }
+
+ if ( srcMode == SM_F2F ) {
+ /* Save the file's meta-info before we open it. Doing it later
+ means we mess up the access times. */
+ saveInputFileMetaInfo ( inName );
+ }
+
+ switch ( srcMode ) {
+
+ case SM_I2O:
+ inStr = stdin;
+ outStr = stdout;
+ if ( isatty ( fileno ( stdin ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't read compressed data from a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2O:
+ inStr = fopen ( inName, "rb" );
+ outStr = stdout;
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
+ progName, inName, strerror(errno) );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2F:
+ inStr = fopen ( inName, "rb" );
+ outStr = fopen_output_safely ( outName, "wb" );
+ if ( outStr == NULL) {
+ fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
+ progName, outName, strerror(errno) );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ }
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ if ( outStr != NULL ) fclose ( outStr );
+ setExit(1);
+ return;
+ };
+ break;
+
+ default:
+ panic ( "uncompress: bad srcMode" );
+ break;
+ }
+
+ if (verbosity >= 1) {
+ fprintf ( stderr, " %s: ", inName );
+ pad ( inName );
+ fflush ( stderr );
+ }
+
+ /*--- Now the input and output handles are sane. Do the Biz. ---*/
+ outputHandleJustInCase = outStr;
+ deleteOutputOnInterrupt = True;
+ magicNumberOK = uncompressStream ( inStr, outStr );
+ outputHandleJustInCase = NULL;
+
+ /*--- If there was an I/O error, we won't get here. ---*/
+ if ( magicNumberOK ) {
+ if ( srcMode == SM_F2F ) {
+ applySavedTimeInfoToOutputFile ( outName );
+ deleteOutputOnInterrupt = False;
+ if ( !keepInputFiles ) {
+ IntNative retVal = remove ( inName );
+ ERROR_IF_NOT_ZERO ( retVal );
+ }
+ }
+ } else {
+ unzFailsExist = True;
+ deleteOutputOnInterrupt = False;
+ if ( srcMode == SM_F2F ) {
+ IntNative retVal = remove ( outName );
+ ERROR_IF_NOT_ZERO ( retVal );
+ }
+ }
+ deleteOutputOnInterrupt = False;
+
+ if ( magicNumberOK ) {
+ if (verbosity >= 1)
+ fprintf ( stderr, "done\n" );
+ } else {
+ setExit(2);
+ if (verbosity >= 1)
+ fprintf ( stderr, "not a bzip2 file.\n" ); else
+ fprintf ( stderr,
+ "%s: %s is not a bzip2 file.\n",
+ progName, inName );
+ }
+
+}
+
+
+/*---------------------------------------------*/
+static
+void testf ( Char *name )
+{
+ FILE *inStr;
+ Bool allOK;
+ struct MY_STAT statBuf;
+
+ deleteOutputOnInterrupt = False;
+
+ if (name == NULL && srcMode != SM_I2O)
+ panic ( "testf: bad modes\n" );
+
+ copyFileName ( outName, (Char*)"(none)" );
+ switch (srcMode) {
+ case SM_I2O: copyFileName ( inName, (Char*)"(stdin)" ); break;
+ case SM_F2F: copyFileName ( inName, name ); break;
+ case SM_F2O: copyFileName ( inName, name ); break;
+ }
+
+ if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
+ if (noisy)
+ fprintf ( stderr, "%s: There are no files matching `%s'.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
+ fprintf ( stderr, "%s: Can't open input %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O ) {
+ MY_STAT(inName, &statBuf);
+ if ( MY_S_ISDIR(statBuf.st_mode) ) {
+ fprintf( stderr,
+ "%s: Input file %s is a directory.\n",
+ progName,inName);
+ setExit(1);
+ return;
+ }
+ }
+
+ switch ( srcMode ) {
+
+ case SM_I2O:
+ if ( isatty ( fileno ( stdin ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't read compressed data from a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ setExit(1);
+ return;
+ };
+ inStr = stdin;
+ break;
+
+ case SM_F2O: case SM_F2F:
+ inStr = fopen ( inName, "rb" );
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ };
+ break;
+
+ default:
+ panic ( "testf: bad srcMode" );
+ break;
+ }
+
+ if (verbosity >= 1) {
+ fprintf ( stderr, " %s: ", inName );
+ pad ( inName );
+ fflush ( stderr );
+ }
+
+ /*--- Now the input handle is sane. Do the Biz. ---*/
+ outputHandleJustInCase = NULL;
+ allOK = testStream ( inStr );
+
+ if (allOK && verbosity >= 1) fprintf ( stderr, "ok\n" );
+ if (!allOK) testFailsExist = True;
+}
+
+
+/*---------------------------------------------*/
+static
+void license ( void )
+{
+ fprintf ( stderr,
+
+ "bzip2, a block-sorting file compressor. "
+ "Version %s.\n"
+ " \n"
+ " Copyright (C) 1996-2010 by Julian Seward.\n"
+ " \n"
+ " This program is free software; you can redistribute it and/or modify\n"
+ " it under the terms set out in the LICENSE file, which is included\n"
+ " in the bzip2-1.0.6 source distribution.\n"
+ " \n"
+ " This program is distributed in the hope that it will be useful,\n"
+ " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ " LICENSE file for more details.\n"
+ " \n",
+ BZ2_bzlibVersion()
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void usage ( Char *fullProgName )
+{
+ fprintf (
+ stderr,
+ "bzip2, a block-sorting file compressor. "
+ "Version %s.\n"
+ "\n usage: %s [flags and input files in any order]\n"
+ "\n"
+ " -h --help print this message\n"
+ " -d --decompress force decompression\n"
+ " -z --compress force compression\n"
+ " -k --keep keep (don't delete) input files\n"
+ " -f --force overwrite existing output files\n"
+ " -t --test test compressed file integrity\n"
+ " -c --stdout output to standard out\n"
+ " -q --quiet suppress noncritical error messages\n"
+ " -v --verbose be verbose (a 2nd -v gives more)\n"
+ " -L --license display software version & license\n"
+ " -V --version display software version & license\n"
+ " -s --small use less memory (at most 2500k)\n"
+ " -1 .. -9 set block size to 100k .. 900k\n"
+ " --fast alias for -1\n"
+ " --best alias for -9\n"
+ "\n"
+ " If invoked as `bzip2', default action is to compress.\n"
+ " as `bunzip2', default action is to decompress.\n"
+ " as `bzcat', default action is to decompress to stdout.\n"
+ "\n"
+ " If no file names are given, bzip2 compresses or decompresses\n"
+ " from standard input to standard output. You can combine\n"
+ " short flags, so `-v -4' means the same as -v4 or -4v, &c.\n"
+# if BZ_UNIX
+ "\n"
+# endif
+ ,
+
+ BZ2_bzlibVersion(),
+ fullProgName
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void redundant ( Char* flag )
+{
+ fprintf (
+ stderr,
+ "%s: %s is redundant in versions 0.9.5 and above\n",
+ progName, flag );
+}
+
+
+/*---------------------------------------------*/
+/*--
+ All the garbage from here to main() is purely to
+ implement a linked list of command-line arguments,
+ into which main() copies argv[1 .. argc-1].
+
+ The purpose of this exercise is to facilitate
+ the expansion of wildcard characters * and ? in
+ filenames for OSs which don't know how to do it
+ themselves, like MSDOS, Windows 95 and NT.
+
+ The actual Dirty Work is done by the platform-
+ specific macro APPEND_FILESPEC.
+--*/
+
+typedef
+ struct zzzz {
+ Char *name;
+ struct zzzz *link;
+ }
+ Cell;
+
+
+/*---------------------------------------------*/
+static
+void *myMalloc ( Int32 n )
+{
+ void* p;
+
+ p = malloc ( (size_t)n );
+ if (p == NULL) outOfMemory ();
+ return p;
+}
+
+
+/*---------------------------------------------*/
+static
+Cell *mkCell ( void )
+{
+ Cell *c;
+
+ c = (Cell*) myMalloc ( sizeof ( Cell ) );
+ c->name = NULL;
+ c->link = NULL;
+ return c;
+}
+
+
+/*---------------------------------------------*/
+static
+Cell *snocString ( Cell *root, Char *name )
+{
+ if (root == NULL) {
+ Cell *tmp = mkCell();
+ tmp->name = (Char*) myMalloc ( 5 + strlen(name) );
+ strcpy ( tmp->name, name );
+ return tmp;
+ } else {
+ Cell *tmp = root;
+ while (tmp->link != NULL) tmp = tmp->link;
+ tmp->link = snocString ( tmp->link, name );
+ return root;
+ }
+}
+
+
+/*---------------------------------------------*/
+static
+void addFlagsFromEnvVar ( Cell** argList, Char* varName )
+{
+ Int32 i, j, k;
+ Char *envbase, *p;
+
+ envbase = getenv(varName);
+ if (envbase != NULL) {
+ p = envbase;
+ i = 0;
+ while (True) {
+ if (p[i] == 0) break;
+ p += i;
+ i = 0;
+ while (isspace((Int32)(p[0]))) p++;
+ while (p[i] != 0 && !isspace((Int32)(p[i]))) i++;
+ if (i > 0) {
+ k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10;
+ for (j = 0; j < k; j++) tmpName[j] = p[j];
+ tmpName[k] = 0;
+ APPEND_FLAG(*argList, tmpName);
+ }
+ }
+ }
+}
+
+
+/*---------------------------------------------*/
+#define ISFLAG(s) (strcmp(aa->name, (s))==0)
+
+IntNative main ( IntNative argc, Char *argv[] )
+{
+ Int32 i, j;
+ Char *tmp;
+ Cell *argList;
+ Cell *aa;
+ Bool decode;
+
+ /*-- Be really really really paranoid :-) --*/
+ if (sizeof(Int32) != 4 || sizeof(UInt32) != 4 ||
+ sizeof(Int16) != 2 || sizeof(UInt16) != 2 ||
+ sizeof(Char) != 1 || sizeof(UChar) != 1)
+ configError();
+
+ /*-- Initialise --*/
+ outputHandleJustInCase = NULL;
+ smallMode = False;
+ keepInputFiles = False;
+ forceOverwrite = False;
+ noisy = True;
+ verbosity = 0;
+ blockSize100k = 9;
+ testFailsExist = False;
+ unzFailsExist = False;
+ numFileNames = 0;
+ numFilesProcessed = 0;
+ workFactor = 30;
+ deleteOutputOnInterrupt = False;
+ exitValue = 0;
+ i = j = 0; /* avoid bogus warning from egcs-1.1.X */
+
+ /*-- Set up signal handlers for mem access errors --*/
+ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
+# if BZ_UNIX
+# ifndef __DJGPP__
+ signal (SIGBUS, mySIGSEGVorSIGBUScatcher);
+# endif
+# endif
+
+ copyFileName ( inName, (Char*)"(none)" );
+ copyFileName ( outName, (Char*)"(none)" );
+
+ copyFileName ( progNameReally, argv[0] );
+ progName = &progNameReally[0];
+ for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++)
+ if (*tmp == PATH_SEP) progName = tmp + 1;
+
+
+ /*-- Copy flags from env var BZIP2, and
+ expand filename wildcards in arg list.
+ --*/
+ argList = NULL;
+ addFlagsFromEnvVar ( &argList, (Char*)"BZIP2" );
+ addFlagsFromEnvVar ( &argList, (Char*)"BZIP" );
+ for (i = 1; i <= argc-1; i++)
+ APPEND_FILESPEC(argList, argv[i]);
+
+
+ /*-- Find the length of the longest filename --*/
+ longestFileName = 7;
+ numFileNames = 0;
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFileNames++;
+ if (longestFileName < (Int32)strlen(aa->name) )
+ longestFileName = (Int32)strlen(aa->name);
+ }
+
+
+ /*-- Determine source modes; flag handling may change this too. --*/
+ if (numFileNames == 0)
+ srcMode = SM_I2O; else srcMode = SM_F2F;
+
+
+ /*-- Determine what to do (compress/uncompress/test/cat). --*/
+ /*-- Note that subsequent flag handling may change this. --*/
+ opMode = OM_Z;
+
+ if ( (strstr ( progName, "unzip" ) != 0) ||
+ (strstr ( progName, "UNZIP" ) != 0) )
+ opMode = OM_UNZ;
+
+ if ( (strstr ( progName, "z2cat" ) != 0) ||
+ (strstr ( progName, "Z2CAT" ) != 0) ||
+ (strstr ( progName, "zcat" ) != 0) ||
+ (strstr ( progName, "ZCAT" ) != 0) ) {
+ opMode = OM_UNZ;
+ srcMode = (numFileNames == 0) ? SM_I2O : SM_F2O;
+ }
+
+
+ /*-- Look at the flags. --*/
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) break;
+ if (aa->name[0] == '-' && aa->name[1] != '-') {
+ for (j = 1; aa->name[j] != '\0'; j++) {
+ switch (aa->name[j]) {
+ case 'c': srcMode = SM_F2O; break;
+ case 'd': opMode = OM_UNZ; break;
+ case 'z': opMode = OM_Z; break;
+ case 'f': forceOverwrite = True; break;
+ case 't': opMode = OM_TEST; break;
+ case 'k': keepInputFiles = True; break;
+ case 's': smallMode = True; break;
+ case 'q': noisy = False; break;
+ case '1': blockSize100k = 1; break;
+ case '2': blockSize100k = 2; break;
+ case '3': blockSize100k = 3; break;
+ case '4': blockSize100k = 4; break;
+ case '5': blockSize100k = 5; break;
+ case '6': blockSize100k = 6; break;
+ case '7': blockSize100k = 7; break;
+ case '8': blockSize100k = 8; break;
+ case '9': blockSize100k = 9; break;
+ case 'V':
+ case 'L': license(); break;
+ case 'v': verbosity++; break;
+ case 'h': usage ( progName );
+ exit ( 0 );
+ break;
+ default: fprintf ( stderr, "%s: Bad flag `%s'\n",
+ progName, aa->name );
+ usage ( progName );
+ exit ( 1 );
+ break;
+ }
+ }
+ }
+ }
+
+ /*-- And again ... --*/
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) break;
+ if (ISFLAG("--stdout")) srcMode = SM_F2O; else
+ if (ISFLAG("--decompress")) opMode = OM_UNZ; else
+ if (ISFLAG("--compress")) opMode = OM_Z; else
+ if (ISFLAG("--force")) forceOverwrite = True; else
+ if (ISFLAG("--test")) opMode = OM_TEST; else
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
+ if (ISFLAG("--version")) license(); else
+ if (ISFLAG("--license")) license(); else
+ if (ISFLAG("--exponential")) workFactor = 1; else
+ if (ISFLAG("--repetitive-best")) redundant(aa->name); else
+ if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
+ if (ISFLAG("--fast")) blockSize100k = 1; else
+ if (ISFLAG("--best")) blockSize100k = 9; else
+ if (ISFLAG("--verbose")) verbosity++; else
+ if (ISFLAG("--help")) { usage ( progName ); exit ( 0 ); }
+ else
+ if (strncmp ( aa->name, "--", 2) == 0) {
+ fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name );
+ usage ( progName );
+ exit ( 1 );
+ }
+ }
+
+ if (verbosity > 4) verbosity = 4;
+ if (opMode == OM_Z && smallMode && blockSize100k > 2)
+ blockSize100k = 2;
+
+ if (opMode == OM_TEST && srcMode == SM_F2O) {
+ fprintf ( stderr, "%s: -c and -t cannot be used together.\n",
+ progName );
+ exit ( 1 );
+ }
+
+ if (srcMode == SM_F2O && numFileNames == 0)
+ srcMode = SM_I2O;
+
+ if (opMode != OM_Z) blockSize100k = 0;
+
+ if (srcMode == SM_F2F) {
+ signal (SIGINT, mySignalCatcher);
+ signal (SIGTERM, mySignalCatcher);
+# if BZ_UNIX
+ signal (SIGHUP, mySignalCatcher);
+# endif
+ }
+
+ if (opMode == OM_Z) {
+ if (srcMode == SM_I2O) {
+ compress ( NULL );
+ } else {
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFilesProcessed++;
+ compress ( aa->name );
+ }
+ }
+ }
+ else
+
+ if (opMode == OM_UNZ) {
+ unzFailsExist = False;
+ if (srcMode == SM_I2O) {
+ uncompress ( NULL );
+ } else {
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFilesProcessed++;
+ uncompress ( aa->name );
+ }
+ }
+ if (unzFailsExist) {
+ setExit(2);
+ exit(exitValue);
+ }
+ }
+
+ else {
+ testFailsExist = False;
+ if (srcMode == SM_I2O) {
+ testf ( NULL );
+ } else {
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFilesProcessed++;
+ testf ( aa->name );
+ }
+ }
+ if (testFailsExist && noisy) {
+ fprintf ( stderr,
+ "\n"
+ "You can use the `bzip2recover' program to attempt to recover\n"
+ "data from undamaged sections of corrupted files.\n\n"
+ );
+ setExit(2);
+ exit(exitValue);
+ }
+ }
+
+ /* Free the argument list memory to mollify leak detectors
+ (eg) Purify, Checker. Serves no other useful purpose.
+ */
+ aa = argList;
+ while (aa != NULL) {
+ Cell* aa2 = aa->link;
+ if (aa->name != NULL) free(aa->name);
+ free(aa);
+ aa = aa2;
+ }
+
+ return exitValue;
+}
+
+
+/*-----------------------------------------------------------*/
+/*--- end bzip2.c ---*/
+/*-----------------------------------------------------------*/
diff --git a/dep/bzip2/bzip2recover.c b/dep/bzip2/bzip2recover.c
new file mode 100644
index 00000000000..f9de0496abf
--- /dev/null
+++ b/dep/bzip2/bzip2recover.c
@@ -0,0 +1,514 @@
+/*-----------------------------------------------------------*/
+/*--- Block recoverer program for bzip2 ---*/
+/*--- bzip2recover.c ---*/
+/*-----------------------------------------------------------*/
+
+/* ------------------------------------------------------------------
+ This file is part of bzip2/libbzip2, a program and library for
+ lossless, block-sorting data compression.
+
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+
+ Please read the WARNING, DISCLAIMER and PATENTS sections in the
+ README file.
+
+ This program is released under the terms of the license contained
+ in the file LICENSE.
+ ------------------------------------------------------------------ */
+
+/* This program is a complete hack and should be rewritten properly.
+ It isn't very complicated. */
+
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* This program records bit locations in the file to be recovered.
+ That means that if 64-bit ints are not supported, we will not
+ be able to recover .bz2 files over 512MB (2^32 bits) long.
+ On GNU supported platforms, we take advantage of the 64-bit
+ int support to circumvent this problem. Ditto MSVC.
+
+ This change occurred in version 1.0.2; all prior versions have
+ the 512MB limitation.
+*/
+#ifdef __GNUC__
+ typedef unsigned long long int MaybeUInt64;
+# define MaybeUInt64_FMT "%Lu"
+#else
+#ifdef _MSC_VER
+ typedef unsigned __int64 MaybeUInt64;
+# define MaybeUInt64_FMT "%I64u"
+#else
+ typedef unsigned int MaybeUInt64;
+# define MaybeUInt64_FMT "%u"
+#endif
+#endif
+
+typedef unsigned int UInt32;
+typedef int Int32;
+typedef unsigned char UChar;
+typedef char Char;
+typedef unsigned char Bool;
+#define True ((Bool)1)
+#define False ((Bool)0)
+
+
+#define BZ_MAX_FILENAME 2000
+
+Char inFileName[BZ_MAX_FILENAME];
+Char outFileName[BZ_MAX_FILENAME];
+Char progName[BZ_MAX_FILENAME];
+
+MaybeUInt64 bytesOut = 0;
+MaybeUInt64 bytesIn = 0;
+
+
+/*---------------------------------------------------*/
+/*--- Header bytes ---*/
+/*---------------------------------------------------*/
+
+#define BZ_HDR_B 0x42 /* 'B' */
+#define BZ_HDR_Z 0x5a /* 'Z' */
+#define BZ_HDR_h 0x68 /* 'h' */
+#define BZ_HDR_0 0x30 /* '0' */
+
+
+/*---------------------------------------------------*/
+/*--- I/O errors ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------*/
+static void readError ( void )
+{
+ fprintf ( stderr,
+ "%s: I/O error reading `%s', possible reason follows.\n",
+ progName, inFileName );
+ perror ( progName );
+ fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
+ progName );
+ exit ( 1 );
+}
+
+
+/*---------------------------------------------*/
+static void writeError ( void )
+{
+ fprintf ( stderr,
+ "%s: I/O error reading `%s', possible reason follows.\n",
+ progName, inFileName );
+ perror ( progName );
+ fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
+ progName );
+ exit ( 1 );
+}
+
+
+/*---------------------------------------------*/
+static void mallocFail ( Int32 n )
+{
+ fprintf ( stderr,
+ "%s: malloc failed on request for %d bytes.\n",
+ progName, n );
+ fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
+ progName );
+ exit ( 1 );
+}
+
+
+/*---------------------------------------------*/
+static void tooManyBlocks ( Int32 max_handled_blocks )
+{
+ fprintf ( stderr,
+ "%s: `%s' appears to contain more than %d blocks\n",
+ progName, inFileName, max_handled_blocks );
+ fprintf ( stderr,
+ "%s: and cannot be handled. To fix, increase\n",
+ progName );
+ fprintf ( stderr,
+ "%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n",
+ progName );
+ exit ( 1 );
+}
+
+
+
+/*---------------------------------------------------*/
+/*--- Bit stream I/O ---*/
+/*---------------------------------------------------*/
+
+typedef
+ struct {
+ FILE* handle;
+ Int32 buffer;
+ Int32 buffLive;
+ Char mode;
+ }
+ BitStream;
+
+
+/*---------------------------------------------*/
+static BitStream* bsOpenReadStream ( FILE* stream )
+{
+ BitStream *bs = malloc ( sizeof(BitStream) );
+ if (bs == NULL) mallocFail ( sizeof(BitStream) );
+ bs->handle = stream;
+ bs->buffer = 0;
+ bs->buffLive = 0;
+ bs->mode = 'r';
+ return bs;
+}
+
+
+/*---------------------------------------------*/
+static BitStream* bsOpenWriteStream ( FILE* stream )
+{
+ BitStream *bs = malloc ( sizeof(BitStream) );
+ if (bs == NULL) mallocFail ( sizeof(BitStream) );
+ bs->handle = stream;
+ bs->buffer = 0;
+ bs->buffLive = 0;
+ bs->mode = 'w';
+ return bs;
+}
+
+
+/*---------------------------------------------*/
+static void bsPutBit ( BitStream* bs, Int32 bit )
+{
+ if (bs->buffLive == 8) {
+ Int32 retVal = putc ( (UChar) bs->buffer, bs->handle );
+ if (retVal == EOF) writeError();
+ bytesOut++;
+ bs->buffLive = 1;
+ bs->buffer = bit & 0x1;
+ } else {
+ bs->buffer = ( (bs->buffer << 1) | (bit & 0x1) );
+ bs->buffLive++;
+ };
+}
+
+
+/*---------------------------------------------*/
+/*--
+ Returns 0 or 1, or 2 to indicate EOF.
+--*/
+static Int32 bsGetBit ( BitStream* bs )
+{
+ if (bs->buffLive > 0) {
+ bs->buffLive --;
+ return ( ((bs->buffer) >> (bs->buffLive)) & 0x1 );
+ } else {
+ Int32 retVal = getc ( bs->handle );
+ if ( retVal == EOF ) {
+ if (errno != 0) readError();
+ return 2;
+ }
+ bs->buffLive = 7;
+ bs->buffer = retVal;
+ return ( ((bs->buffer) >> 7) & 0x1 );
+ }
+}
+
+
+/*---------------------------------------------*/
+static void bsClose ( BitStream* bs )
+{
+ Int32 retVal;
+
+ if ( bs->mode == 'w' ) {
+ while ( bs->buffLive < 8 ) {
+ bs->buffLive++;
+ bs->buffer <<= 1;
+ };
+ retVal = putc ( (UChar) (bs->buffer), bs->handle );
+ if (retVal == EOF) writeError();
+ bytesOut++;
+ retVal = fflush ( bs->handle );
+ if (retVal == EOF) writeError();
+ }
+ retVal = fclose ( bs->handle );
+ if (retVal == EOF) {
+ if (bs->mode == 'w') writeError(); else readError();
+ }
+ free ( bs );
+}
+
+
+/*---------------------------------------------*/
+static void bsPutUChar ( BitStream* bs, UChar c )
+{
+ Int32 i;
+ for (i = 7; i >= 0; i--)
+ bsPutBit ( bs, (((UInt32) c) >> i) & 0x1 );
+}
+
+
+/*---------------------------------------------*/
+static void bsPutUInt32 ( BitStream* bs, UInt32 c )
+{
+ Int32 i;
+
+ for (i = 31; i >= 0; i--)
+ bsPutBit ( bs, (c >> i) & 0x1 );
+}
+
+
+/*---------------------------------------------*/
+static Bool endsInBz2 ( Char* name )
+{
+ Int32 n = strlen ( name );
+ if (n <= 4) return False;
+ return
+ (name[n-4] == '.' &&
+ name[n-3] == 'b' &&
+ name[n-2] == 'z' &&
+ name[n-1] == '2');
+}
+
+
+/*---------------------------------------------------*/
+/*--- ---*/
+/*---------------------------------------------------*/
+
+/* This logic isn't really right when it comes to Cygwin. */
+#ifdef _WIN32
+# define BZ_SPLIT_SYM '\\' /* path splitter on Windows platform */
+#else
+# define BZ_SPLIT_SYM '/' /* path splitter on Unix platform */
+#endif
+
+#define BLOCK_HEADER_HI 0x00003141UL
+#define BLOCK_HEADER_LO 0x59265359UL
+
+#define BLOCK_ENDMARK_HI 0x00001772UL
+#define BLOCK_ENDMARK_LO 0x45385090UL
+
+/* Increase if necessary. However, a .bz2 file with > 50000 blocks
+ would have an uncompressed size of at least 40GB, so the chances
+ are low you'll need to up this.
+*/
+#define BZ_MAX_HANDLED_BLOCKS 50000
+
+MaybeUInt64 bStart [BZ_MAX_HANDLED_BLOCKS];
+MaybeUInt64 bEnd [BZ_MAX_HANDLED_BLOCKS];
+MaybeUInt64 rbStart[BZ_MAX_HANDLED_BLOCKS];
+MaybeUInt64 rbEnd [BZ_MAX_HANDLED_BLOCKS];
+
+Int32 main ( Int32 argc, Char** argv )
+{
+ FILE* inFile;
+ FILE* outFile;
+ BitStream* bsIn, *bsWr;
+ Int32 b, wrBlock, currBlock, rbCtr;
+ MaybeUInt64 bitsRead;
+
+ UInt32 buffHi, buffLo, blockCRC;
+ Char* p;
+
+ strcpy ( progName, argv[0] );
+ inFileName[0] = outFileName[0] = 0;
+
+ fprintf ( stderr,
+ "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" );
+
+ if (argc != 2) {
+ fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
+ progName, progName );
+ switch (sizeof(MaybeUInt64)) {
+ case 8:
+ fprintf(stderr,
+ "\trestrictions on size of recovered file: None\n");
+ break;
+ case 4:
+ fprintf(stderr,
+ "\trestrictions on size of recovered file: 512 MB\n");
+ fprintf(stderr,
+ "\tto circumvent, recompile with MaybeUInt64 as an\n"
+ "\tunsigned 64-bit int.\n");
+ break;
+ default:
+ fprintf(stderr,
+ "\tsizeof(MaybeUInt64) is not 4 or 8 -- "
+ "configuration error.\n");
+ break;
+ }
+ exit(1);
+ }
+
+ if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) {
+ fprintf ( stderr,
+ "%s: supplied filename is suspiciously (>= %d chars) long. Bye!\n",
+ progName, (int)strlen(argv[1]) );
+ exit(1);
+ }
+
+ strcpy ( inFileName, argv[1] );
+
+ inFile = fopen ( inFileName, "rb" );
+ if (inFile == NULL) {
+ fprintf ( stderr, "%s: can't read `%s'\n", progName, inFileName );
+ exit(1);
+ }
+
+ bsIn = bsOpenReadStream ( inFile );
+ fprintf ( stderr, "%s: searching for block boundaries ...\n", progName );
+
+ bitsRead = 0;
+ buffHi = buffLo = 0;
+ currBlock = 0;
+ bStart[currBlock] = 0;
+
+ rbCtr = 0;
+
+ while (True) {
+ b = bsGetBit ( bsIn );
+ bitsRead++;
+ if (b == 2) {
+ if (bitsRead >= bStart[currBlock] &&
+ (bitsRead - bStart[currBlock]) >= 40) {
+ bEnd[currBlock] = bitsRead-1;
+ if (currBlock > 0)
+ fprintf ( stderr, " block %d runs from " MaybeUInt64_FMT
+ " to " MaybeUInt64_FMT " (incomplete)\n",
+ currBlock, bStart[currBlock], bEnd[currBlock] );
+ } else
+ currBlock--;
+ break;
+ }
+ buffHi = (buffHi << 1) | (buffLo >> 31);
+ buffLo = (buffLo << 1) | (b & 1);
+ if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI
+ && buffLo == BLOCK_HEADER_LO)
+ ||
+ ( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI
+ && buffLo == BLOCK_ENDMARK_LO)
+ ) {
+ if (bitsRead > 49) {
+ bEnd[currBlock] = bitsRead-49;
+ } else {
+ bEnd[currBlock] = 0;
+ }
+ if (currBlock > 0 &&
+ (bEnd[currBlock] - bStart[currBlock]) >= 130) {
+ fprintf ( stderr, " block %d runs from " MaybeUInt64_FMT
+ " to " MaybeUInt64_FMT "\n",
+ rbCtr+1, bStart[currBlock], bEnd[currBlock] );
+ rbStart[rbCtr] = bStart[currBlock];
+ rbEnd[rbCtr] = bEnd[currBlock];
+ rbCtr++;
+ }
+ if (currBlock >= BZ_MAX_HANDLED_BLOCKS)
+ tooManyBlocks(BZ_MAX_HANDLED_BLOCKS);
+ currBlock++;
+
+ bStart[currBlock] = bitsRead;
+ }
+ }
+
+ bsClose ( bsIn );
+
+ /*-- identified blocks run from 1 to rbCtr inclusive. --*/
+
+ if (rbCtr < 1) {
+ fprintf ( stderr,
+ "%s: sorry, I couldn't find any block boundaries.\n",
+ progName );
+ exit(1);
+ };
+
+ fprintf ( stderr, "%s: splitting into blocks\n", progName );
+
+ inFile = fopen ( inFileName, "rb" );
+ if (inFile == NULL) {
+ fprintf ( stderr, "%s: can't open `%s'\n", progName, inFileName );
+ exit(1);
+ }
+ bsIn = bsOpenReadStream ( inFile );
+
+ /*-- placate gcc's dataflow analyser --*/
+ blockCRC = 0; bsWr = 0;
+
+ bitsRead = 0;
+ outFile = NULL;
+ wrBlock = 0;
+ while (True) {
+ b = bsGetBit(bsIn);
+ if (b == 2) break;
+ buffHi = (buffHi << 1) | (buffLo >> 31);
+ buffLo = (buffLo << 1) | (b & 1);
+ if (bitsRead == 47+rbStart[wrBlock])
+ blockCRC = (buffHi << 16) | (buffLo >> 16);
+
+ if (outFile != NULL && bitsRead >= rbStart[wrBlock]
+ && bitsRead <= rbEnd[wrBlock]) {
+ bsPutBit ( bsWr, b );
+ }
+
+ bitsRead++;
+
+ if (bitsRead == rbEnd[wrBlock]+1) {
+ if (outFile != NULL) {
+ bsPutUChar ( bsWr, 0x17 ); bsPutUChar ( bsWr, 0x72 );
+ bsPutUChar ( bsWr, 0x45 ); bsPutUChar ( bsWr, 0x38 );
+ bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
+ bsPutUInt32 ( bsWr, blockCRC );
+ bsClose ( bsWr );
+ }
+ if (wrBlock >= rbCtr) break;
+ wrBlock++;
+ } else
+ if (bitsRead == rbStart[wrBlock]) {
+ /* Create the output file name, correctly handling leading paths.
+ (31.10.2001 by Sergey E. Kusikov) */
+ Char* split;
+ Int32 ofs, k;
+ for (k = 0; k < BZ_MAX_FILENAME; k++)
+ outFileName[k] = 0;
+ strcpy (outFileName, inFileName);
+ split = strrchr (outFileName, BZ_SPLIT_SYM);
+ if (split == NULL) {
+ split = outFileName;
+ } else {
+ ++split;
+ }
+ /* Now split points to the start of the basename. */
+ ofs = split - outFileName;
+ sprintf (split, "rec%5d", wrBlock+1);
+ for (p = split; *p != 0; p++) if (*p == ' ') *p = '0';
+ strcat (outFileName, inFileName + ofs);
+
+ if ( !endsInBz2(outFileName)) strcat ( outFileName, ".bz2" );
+
+ fprintf ( stderr, " writing block %d to `%s' ...\n",
+ wrBlock+1, outFileName );
+
+ outFile = fopen ( outFileName, "wb" );
+ if (outFile == NULL) {
+ fprintf ( stderr, "%s: can't write `%s'\n",
+ progName, outFileName );
+ exit(1);
+ }
+ bsWr = bsOpenWriteStream ( outFile );
+ bsPutUChar ( bsWr, BZ_HDR_B );
+ bsPutUChar ( bsWr, BZ_HDR_Z );
+ bsPutUChar ( bsWr, BZ_HDR_h );
+ bsPutUChar ( bsWr, BZ_HDR_0 + 9 );
+ bsPutUChar ( bsWr, 0x31 ); bsPutUChar ( bsWr, 0x41 );
+ bsPutUChar ( bsWr, 0x59 ); bsPutUChar ( bsWr, 0x26 );
+ bsPutUChar ( bsWr, 0x53 ); bsPutUChar ( bsWr, 0x59 );
+ }
+ }
+
+ fprintf ( stderr, "%s: finished\n", progName );
+ return 0;
+}
+
+
+
+/*-----------------------------------------------------------*/
+/*--- end bzip2recover.c ---*/
+/*-----------------------------------------------------------*/
diff --git a/dep/bzip2/bzlib.c b/dep/bzip2/bzlib.c
index ef86c91e695..bd358a793b8 100644
--- a/dep/bzip2/bzlib.c
+++ b/dep/bzip2/bzlib.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/bzip2/bzlib.h b/dep/bzip2/bzlib.h
index c5b75d6d8ff..8277123da8c 100644
--- a/dep/bzip2/bzlib.h
+++ b/dep/bzip2/bzlib.h
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/bzip2/bzlib_private.h b/dep/bzip2/bzlib_private.h
index 23427879b18..5d0217f4635 100644
--- a/dep/bzip2/bzlib_private.h
+++ b/dep/bzip2/bzlib_private.h
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -36,7 +36,7 @@
/*-- General stuff. --*/
-#define BZ_VERSION "1.0.5, 10-Dec-2007"
+#define BZ_VERSION "1.0.6, 6-Sept-2010"
typedef char Char;
typedef unsigned char Bool;
diff --git a/dep/bzip2/compress.c b/dep/bzip2/compress.c
index 8c80a079700..caf7696011b 100644
--- a/dep/bzip2/compress.c
+++ b/dep/bzip2/compress.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/bzip2/crctable.c b/dep/bzip2/crctable.c
index 215687b2c05..1fea7e946c5 100644
--- a/dep/bzip2/crctable.c
+++ b/dep/bzip2/crctable.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/bzip2/decompress.c b/dep/bzip2/decompress.c
index bba5e0fa36d..311f5668f9a 100644
--- a/dep/bzip2/decompress.c
+++ b/dep/bzip2/decompress.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -381,6 +381,13 @@ Int32 BZ2_decompress ( DState* s )
es = -1;
N = 1;
do {
+ /* Check that N doesn't get too big, so that es doesn't
+ go negative. The maximum value that can be
+ RUNA/RUNB encoded is equal to the block size (post
+ the initial RLE), viz, 900k, so bounding N at 2
+ million should guard against overflow without
+ rejecting any legitimate inputs. */
+ if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2;
@@ -485,15 +492,28 @@ Int32 BZ2_decompress ( DState* s )
RETURN(BZ_DATA_ERROR);
/*-- Set up cftab to facilitate generation of T^(-1) --*/
+ /* Check: unzftab entries in range. */
+ for (i = 0; i <= 255; i++) {
+ if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
+ RETURN(BZ_DATA_ERROR);
+ }
+ /* Actually generate cftab. */
s->cftab[0] = 0;
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
+ /* Check: cftab entries in range. */
for (i = 0; i <= 256; i++) {
if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
/* s->cftab[i] can legitimately be == nblock */
RETURN(BZ_DATA_ERROR);
}
}
+ /* Check: cftab entries non-descending. */
+ for (i = 1; i <= 256; i++) {
+ if (s->cftab[i-1] > s->cftab[i]) {
+ RETURN(BZ_DATA_ERROR);
+ }
+ }
s->state_out_len = 0;
s->state_out_ch = 0;
diff --git a/dep/bzip2/huffman.c b/dep/bzip2/huffman.c
index 87e79e38af0..2283fdbc5a1 100644
--- a/dep/bzip2/huffman.c
+++ b/dep/bzip2/huffman.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/bzip2/randtable.c b/dep/bzip2/randtable.c
index 068b76367bc..6d624599061 100644
--- a/dep/bzip2/randtable.c
+++ b/dep/bzip2/randtable.c
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
diff --git a/dep/g3dlite/G3D-v8.0_extra.diff b/dep/g3dlite/G3D-v8.0_extra.diff
new file mode 100644
index 00000000000..d556103c96d
--- /dev/null
+++ b/dep/g3dlite/G3D-v8.0_extra.diff
@@ -0,0 +1,12 @@
+diff --git a/dep/g3dlite/include/G3D/GMutex.h b/dep/g3dlite/include/G3D/GMutex.h
+index 3469b81..9fe098d 100644
+--- a/dep/g3dlite/include/G3D/GMutex.h
++++ b/dep/g3dlite/include/G3D/GMutex.h
+@@ -16,6 +16,7 @@
+ #ifndef G3D_WIN32
+ # include <pthread.h>
+ # include <signal.h>
++# include <unistd.h>
+ #endif
+
+
diff --git a/dep/g3dlite/include/G3D/AABox.h b/dep/g3dlite/include/G3D/AABox.h
index 2e8da1f6098..d57320d73eb 100644
--- a/dep/g3dlite/include/G3D/AABox.h
+++ b/dep/g3dlite/include/G3D/AABox.h
@@ -20,6 +20,7 @@
#include "G3D/debug.h"
#include "G3D/Array.h"
#include "G3D/Plane.h"
+#include "G3D/Sphere.h"
namespace G3D {
@@ -259,6 +260,8 @@ public:
void getBounds(AABox& out) const {
out = *this;
}
+
+ void getBounds(Sphere& out) const;
};
}
diff --git a/dep/g3dlite/include/G3D/Any.h b/dep/g3dlite/include/G3D/Any.h
index c267eedd22f..e2d0fbe7e62 100644
--- a/dep/g3dlite/include/G3D/Any.h
+++ b/dep/g3dlite/include/G3D/Any.h
@@ -17,7 +17,9 @@
#include "G3D/platform.h"
#include "G3D/Table.h"
#include "G3D/Array.h"
+#include "G3D/Set.h"
#include "G3D/AtomicInt32.h"
+#include "G3D/stringutils.h"
#include <string>
// needed for Token
@@ -448,7 +450,6 @@ public:
*/
std::string resolveStringAsFilename() const;
-
/** If this is named ARRAY or TABLE, returns the name. */
const std::string& name() const;
@@ -518,7 +519,7 @@ public:
// Needed to prevent the operator[](int) overload from catching
// string literals
- inline const Any& operator[](const char* key) const {
+ const Any& operator[](const char* key) const {
return operator[](std::string(key));
}
@@ -548,7 +549,7 @@ public:
Any& operator[](const std::string& key);
/** \copydoc Any::operator[](const std::string&) */
- inline Any& operator[](const char* key) {
+ Any& operator[](const char* key) {
return operator[](std::string(key));
}
@@ -636,6 +637,124 @@ private:
}; // class Any
+
+/**
+ Convenient iteration over the keys of a Any::TABLE, usually
+ for implementing construction of an object from an Any.
+
+ Getting an element using either iteration or explicit requests
+ consumes that element from the iterator (but not from the Any!)
+ It is an error to consume the same element more than once from
+ the same iterator.
+
+ <pre>
+ AnyKeyIterator r(a);
+ r.getIfPresent("enabled", enabled);
+ r.getIfPresent("showSamples", showSamples);
+ r.getIfPresent("showTiles", showTiles);
+
+ r.verifyDone();
+ </pre>
+
+ \beta
+*/
+class AnyTableReader {
+private:
+ Any m_any;
+ Set<std::string> m_alreadyRead;
+public:
+
+ /** Verifies that \a is a TABLE with the given \a name. */
+ AnyTableReader(const std::string& name, const Any& a) : m_any(a) {
+ try {
+ m_any.verifyType(Any::TABLE);
+ m_any.verifyName(name);
+ } catch (const ParseError& e) {
+ // If an exception is thrown, the destructors will not be
+ // invoked automatically.
+ m_any.~Any();
+ m_alreadyRead.~Set();
+ throw e;
+ }
+ }
+
+ /** Verifies that \a is a TABLE. */
+ AnyTableReader(const Any& a) : m_any(a) {
+ try {
+ m_any.verifyType(Any::TABLE);
+ } catch (const ParseError& e) {
+ // If an exception is thrown, the destructors will not be
+ // invoked automatically.
+ m_any.~Any();
+ m_alreadyRead.~Set();
+ throw e;
+ }
+ }
+
+ bool hasMore() const {
+ return m_any.size() > m_alreadyRead.size();
+ }
+
+ /** Verifies that all keys have been read. */
+ void verifyDone() const {
+ if (hasMore()) {
+ // Generate all keys
+ // Remove the ones we've read
+ // Assert the rest
+ // any.verify("");
+ }
+ }
+
+#if 0
+ /** Returns the current key */
+ const std::string& key() const;
+
+ /** Returns the current value */
+ const Any& value() const;
+
+ AnyKeyIterator& operator++();
+#endif
+
+ /** If key \s appears in the any, reads its value into \a v and
+ removes that key from the ones available to iterate over.
+
+ If key \s does not appear in the any, throws a G3D::ParseError.
+
+ Assumes that if key \s appears in the any it has not already been extracted
+ by this iterator. If it has been read before, an assertion will fail in debug mode.
+
+ */
+ template<class ValueType>
+ void get(const std::string& s, ValueType& v) {
+ v = m_any[s];
+ m_alreadyRead.insert(toLower(s));
+ }
+
+ /** Get the value associated with a key only if the key is actually present.
+
+ If key \s appears in the any, reads its value into \a v and
+ removes that key from the ones available to iterate over.
+
+ If key \s does not appear in the any, does nothing.
+
+ Assumes that if key \s appears in the any it has not already been extracted
+ by this iterator. If it has been read before, an assertion will fail in debug mode.
+
+ \return True if the value was read.
+ */
+ template<class ValueType>
+ bool getIfPresent(const std::string& s, ValueType& v) {
+ if (m_any.containsKey(s)) {
+ debugAssertM(! m_alreadyRead.contains(toLower(s)), "read twice");
+
+ get(s, v);
+ return true;
+ } else {
+ return false;
+ }
+ }
+};
+
} // namespace G3D
#endif
diff --git a/dep/g3dlite/include/G3D/GMutex.h b/dep/g3dlite/include/G3D/GMutex.h
index 3469b812736..9fe098d10e3 100644
--- a/dep/g3dlite/include/G3D/GMutex.h
+++ b/dep/g3dlite/include/G3D/GMutex.h
@@ -16,6 +16,7 @@
#ifndef G3D_WIN32
# include <pthread.h>
# include <signal.h>
+# include <unistd.h>
#endif
diff --git a/dep/g3dlite/include/G3D/PointHashGrid.h b/dep/g3dlite/include/G3D/PointHashGrid.h
index 5b128d1b5d9..d0b60a88ae5 100644
--- a/dep/g3dlite/include/G3D/PointHashGrid.h
+++ b/dep/g3dlite/include/G3D/PointHashGrid.h
@@ -360,7 +360,7 @@ public:
m_arrayIndex(0), m_epoch(0) {}
Iterator(const ThisType* grid) :
- m_isEnd(false),
+ m_isEnd(grid->size() == 0),
m_grid(grid),
m_tableIterator( grid->m_data.begin() ),
m_arrayIndex(0),
@@ -387,6 +387,10 @@ public:
}
}
+ bool hasMore() const {
+ return ! m_isEnd;
+ }
+
bool operator==(const Iterator& other) const {
return !(*this != other);
}
diff --git a/dep/g3dlite/include/G3D/Quat.inl b/dep/g3dlite/include/G3D/Quat.inl
deleted file mode 100644
index 9e4c861d93b..00000000000
--- a/dep/g3dlite/include/G3D/Quat.inl
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- Quat.inl
-
- @cite Quaternion implementation based on Watt & Watt page 363.
- Thanks to Max McGuire for slerp optimizations.
-
- @maintainer Morgan McGuire, matrix@graphics3d.com
-
- @created 2002-01-23
- @edited 2004-03-04
- */
-
-namespace G3D {
-
-inline float& Quat::operator[] (int i) {
- debugAssert(i >= 0);
- debugAssert(i < 4);
- return ((float*)this)[i];
-}
-
-inline const float& Quat::operator[] (int i) const {
- debugAssert(i >= 0);
- debugAssert(i < 4);
- return ((float*)this)[i];
-}
-
-inline Quat Quat::operator-(const Quat& other) const {
- return Quat(x - other.x, y - other.y, z - other.z, w - other.w);
-}
-
-inline Quat Quat::operator+(const Quat& other) const {
- return Quat(x + other.x, y + other.y, z + other.z, w + other.w);
-}
-
-}
-
diff --git a/dep/g3dlite/include/G3D/Sphere.h b/dep/g3dlite/include/G3D/Sphere.h
index 595b61c4bf1..d1448261d9f 100644
--- a/dep/g3dlite/include/G3D/Sphere.h
+++ b/dep/g3dlite/include/G3D/Sphere.h
@@ -15,7 +15,6 @@
#include "G3D/platform.h"
#include "G3D/Vector3.h"
#include "G3D/Array.h"
-#include "G3D/Sphere.h"
namespace G3D {
diff --git a/dep/g3dlite/include/G3D/Table.h b/dep/g3dlite/include/G3D/Table.h
index 896a5a2a08a..ab0b114b1c4 100644
--- a/dep/g3dlite/include/G3D/Table.h
+++ b/dep/g3dlite/include/G3D/Table.h
@@ -86,12 +86,11 @@ namespace G3D {
<PRE>
template<> struct HashTrait<MyEnum> {
- static size_t equals(const MyEnum& key) const { return reinterpret_cast<size_t>( key ); }
+ static size_t hashCode(const MyEnum& key) const { return reinterpret_cast<size_t>( key ); }
};
</PRE>
- And rely on the default enum operator==.
-
+ and rely on the default enum operator==.
Periodically check that debugGetLoad() is low (> 0.1). When it gets near
1.0 your hash function is badly designed and maps too many inputs to
diff --git a/dep/g3dlite/include/G3D/Vector2.inl b/dep/g3dlite/include/G3D/Vector2.inl
deleted file mode 100644
index 4f7c55a39cf..00000000000
--- a/dep/g3dlite/include/G3D/Vector2.inl
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- @file Vector2.inl
-
- @maintainer Morgan McGuire, matrix@graphics3d.com
- @cite Portions by Laura Wollstadt, graphics3d.com
-
- @cite Portions based on Dave Eberly'x Magic Software Library
- at http://www.magic-software.com
-
- @created 2001-06-02
- @edited 2006-01-14
-
- Copyright 2000-2006, Morgan McGuire.
- All rights reserved.
- */
-
-}
-
diff --git a/dep/g3dlite/include/G3D/Vector3.inl b/dep/g3dlite/include/G3D/Vector3.inl
deleted file mode 100644
index 9211c2a70fd..00000000000
--- a/dep/g3dlite/include/G3D/Vector3.inl
+++ /dev/null
@@ -1,249 +0,0 @@
-/**
- @file Vector3.inl
-
- @maintainer Morgan McGuire, matrix@graphics3d.com
-
- @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com
-
- @created 2001-06-02
- @edited 2004-05-21
- Copyright 2000-2004, Morgan McGuire.
- All rights reserved.
- */
-
-//----------------------------------------------------------------------------
-#ifdef SSE
- // If you receive an error on this line, it is because you do not have the file
- // xmmintrin.h needed for MMX & SSE extensions. Download and install
- //
- // http://download.microsoft.com/download/vstudio60ent/SP5/Wideband-Full/WIN98Me/EN-US/vs6sp5.exe
- // and
- // http://download.microsoft.com/download/vb60ent/Update/6/W9X2KXP/EN-US/vcpp5.exe
- //
- // to get this file.
-# include <xmmintrin.h>
-#endif
-
-inline unsigned int hashCode(const G3D::Vector3& v) {
- return v.hashCode();
-}
-
-namespace G3D {
-
-//----------------------------------------------------------------------------
-inline Vector3::Vector3() : x(0.0f), y(0.0f), z(0.0f) {
-}
-
-//----------------------------------------------------------------------------
-
-inline Vector3::Vector3 (float fX, float fY, float fZ) : x(fX), y(fY), z(fZ) {
-}
-
-//----------------------------------------------------------------------------
-inline Vector3::Vector3 (float V[3]) : x(V[0]), y(V[1]), z(V[2]){
-}
-//----------------------------------------------------------------------------
-inline Vector3::Vector3 (double V[3]) : x((float)V[0]), y((float)V[1]), z((float)V[2]){
-}
-
-//----------------------------------------------------------------------------
-inline Vector3::Vector3 (const Vector3& V) : x(V.x), y(V.y), z(V.z) {
-}
-
-//----------------------------------------------------------------------------
-
-//inline Vector3::Vector3 (const __m128& m) {
- // Cast from SSE packed floats
-// *this = *(Vector3*)&m;
-//}
-
-//----------------------------------------------------------------------------
-inline const float& Vector3::operator[] (int i) const {
- return ((float*)this)[i];
-}
-
-inline float& Vector3::operator[] (int i) {
- return ((float*)this)[i];
-}
-
-//----------------------------------------------------------------------------
-inline Vector3& Vector3::operator= (const Vector3& rkVector) {
- x = rkVector.x;
- y = rkVector.y;
- z = rkVector.z;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-
-inline bool Vector3::fuzzyEq(const Vector3& other) const {
- return G3D::fuzzyEq((*this - other).squaredMagnitude(), 0);
-}
-
-//----------------------------------------------------------------------------
-
-inline bool Vector3::fuzzyNe(const Vector3& other) const {
- return G3D::fuzzyNe((*this - other).squaredMagnitude(), 0);
-}
-
-//----------------------------------------------------------------------------
-
-inline bool Vector3::isFinite() const {
- return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z);
-}
-
-//----------------------------------------------------------------------------
-inline bool Vector3::operator== (const Vector3& rkVector) const {
- return ( x == rkVector.x && y == rkVector.y && z == rkVector.z );
-}
-
-//----------------------------------------------------------------------------
-inline bool Vector3::operator!= (const Vector3& rkVector) const {
- return ( x != rkVector.x || y != rkVector.y || z != rkVector.z );
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::operator+ (const Vector3& rkVector) const {
- return Vector3(x + rkVector.x, y + rkVector.y, z + rkVector.z);
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::operator- (const Vector3& rkVector) const {
- return Vector3(x - rkVector.x, y - rkVector.y, z - rkVector.z);
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::operator* (const Vector3& rkVector) const {
- return Vector3(x * rkVector.x, y * rkVector.y, z * rkVector.z);
-}
-
-inline Vector3 Vector3::operator*(float f) const {
- return Vector3(x * f, y * f, z * f);
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::operator/ (const Vector3& rkVector) const {
- return Vector3(x / rkVector.x, y / rkVector.y, z / rkVector.z);
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::operator- () const {
- return Vector3(-x, -y, -z);
-}
-
-//----------------------------------------------------------------------------
-inline Vector3& Vector3::operator+= (const Vector3& rkVector) {
- x += rkVector.x;
- y += rkVector.y;
- z += rkVector.z;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline Vector3& Vector3::operator-= (const Vector3& rkVector) {
- x -= rkVector.x;
- y -= rkVector.y;
- z -= rkVector.z;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline Vector3& Vector3::operator*= (float fScalar) {
- x *= fScalar;
- y *= fScalar;
- z *= fScalar;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline Vector3& Vector3::operator*= (const Vector3& rkVector) {
- x *= rkVector.x;
- y *= rkVector.y;
- z *= rkVector.z;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline Vector3& Vector3::operator/= (const Vector3& rkVector) {
- x /= rkVector.x;
- y /= rkVector.y;
- z /= rkVector.z;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline float Vector3::squaredMagnitude () const {
- return x*x + y*y + z*z;
-}
-
-//----------------------------------------------------------------------------
-inline float Vector3::squaredLength () const {
- return squaredMagnitude();
-}
-
-//----------------------------------------------------------------------------
-inline float Vector3::magnitude() const {
- return sqrtf(x*x + y*y + z*z);
-}
-
-//----------------------------------------------------------------------------
-inline float Vector3::length() const {
- return magnitude();
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::direction () const {
- float lenSquared = squaredMagnitude();
- float invSqrt = 1.0f / sqrtf(lenSquared);
- return Vector3(x * invSqrt, y * invSqrt, z * invSqrt);
-}
-
-//----------------------------------------------------------------------------
-
-inline Vector3 Vector3::fastDirection () const {
- float lenSquared = x * x + y * y + z * z;
- float invSqrt = rsq(lenSquared);
- return Vector3(x * invSqrt, y * invSqrt, z * invSqrt);
-}
-
-//----------------------------------------------------------------------------
-inline float Vector3::dot (const Vector3& rkVector) const {
- return x*rkVector.x + y*rkVector.y + z*rkVector.z;
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::cross (const Vector3& rkVector) const {
- return Vector3(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z,
- x*rkVector.y - y*rkVector.x);
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::unitCross (const Vector3& rkVector) const {
- Vector3 kCross(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z,
- x*rkVector.y - y*rkVector.x);
- kCross.unitize();
- return kCross;
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::min(const Vector3 &v) const {
- return Vector3(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z));
-}
-
-//----------------------------------------------------------------------------
-inline Vector3 Vector3::max(const Vector3 &v) const {
- return Vector3(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z));
-}
-
-//----------------------------------------------------------------------------
-inline bool Vector3::isZero() const {
- return G3D::fuzzyEq(squaredMagnitude(), 0.0f);
-}
-
-//----------------------------------------------------------------------------
-
-inline bool Vector3::isUnit() const {
- return G3D::fuzzyEq(squaredMagnitude(), 1.0f);
-}
-
-} // namespace
diff --git a/dep/g3dlite/include/G3D/Vector4.inl b/dep/g3dlite/include/G3D/Vector4.inl
deleted file mode 100644
index 576cca83b56..00000000000
--- a/dep/g3dlite/include/G3D/Vector4.inl
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- @file Vector4.inl
-
- @maintainer Morgan McGuire, matrix@graphics3d.com
-
- @created 2002-07-09
- @edited 2003-02-10
- */
-
-//----------------------------------------------------------------------------
-
-inline unsigned int hashCode(const G3D::Vector4& v) {
- return v.hashCode();
-}
-
-namespace G3D {
-
-//----------------------------------------------------------------------------
-inline Vector4::Vector4() {
- x = y = z = w = 0;
-}
-
-//----------------------------------------------------------------------------
-
-inline Vector4::Vector4 (float fX, float fY, float fZ, float fW) {
- x = fX;
- y = fY;
- z = fZ;
- w = fW;
-}
-
-//----------------------------------------------------------------------------
-inline Vector4::Vector4 (float afCoordinate[4]) {
- x = afCoordinate[0];
- y = afCoordinate[1];
- z = afCoordinate[2];
- w = afCoordinate[3];
-}
-
-//----------------------------------------------------------------------------
-inline Vector4::Vector4(const Vector4& rkVector) {
- x = rkVector.x;
- y = rkVector.y;
- z = rkVector.z;
- w = rkVector.w;
-}
-//----------------------------------------------------------------------------
-inline Vector4::Vector4(const Vector3& rkVector, float fW) {
- x = rkVector.x;
- y = rkVector.y;
- z = rkVector.z;
- w = fW;
-}
-
-//----------------------------------------------------------------------------
-inline float& Vector4::operator[] (int i) {
- return ((float*)this)[i];
-}
-
-//----------------------------------------------------------------------------
-inline const float& Vector4::operator[] (int i) const {
- return ((float*)this)[i];
-}
-
-//----------------------------------------------------------------------------
-inline Vector4::operator float* () {
- return (float*)this;
-}
-
-inline Vector4::operator const float* () const {
- return (float*)this;
-}
-
-//----------------------------------------------------------------------------
-inline Vector4& Vector4::operator= (const Vector4& rkVector) {
- x = rkVector.x;
- y = rkVector.y;
- z = rkVector.z;
- w = rkVector.w;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline bool Vector4::operator== (const Vector4& rkVector) const {
- return ( (x == rkVector.x) && (y == rkVector.y) && (z == rkVector.z) && (w == rkVector.w));
-}
-
-//----------------------------------------------------------------------------
-inline bool Vector4::operator!= (const Vector4& rkVector) const {
- return ( x != rkVector.x || y != rkVector.y || z != rkVector.z || w != rkVector.w);
-}
-
-//----------------------------------------------------------------------------
-inline Vector4 Vector4::operator+ (const Vector4& rkVector) const {
- return Vector4(x + rkVector.x, y + rkVector.y, z + rkVector.z, w + rkVector.w);
-}
-
-//----------------------------------------------------------------------------
-inline Vector4 Vector4::operator- (const Vector4& rkVector) const {
- return Vector4(x - rkVector.x, y - rkVector.y, z - rkVector.z, w - rkVector.w);
-}
-
-//----------------------------------------------------------------------------
-inline Vector4 Vector4::operator* (float fScalar) const {
- return Vector4(fScalar*x, fScalar*y, fScalar*z, fScalar*w);
-}
-
-//----------------------------------------------------------------------------
-inline Vector4 Vector4::operator- () const {
- return Vector4( -x, -y, -z, -w);
-}
-
-//----------------------------------------------------------------------------
-inline Vector4& Vector4::operator+= (const Vector4& rkVector) {
- x += rkVector.x;
- y += rkVector.y;
- z += rkVector.z;
- w += rkVector.w;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline Vector4& Vector4::operator-= (const Vector4& rkVector) {
- x -= rkVector.x;
- y -= rkVector.y;
- z -= rkVector.z;
- w -= rkVector.w;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-
-inline Vector4 Vector4::lerp(const Vector4& v, float alpha) const {
- return (*this) + (v - *this) * alpha;
-}
-
-//----------------------------------------------------------------------------
-inline Vector4& Vector4::operator*= (float fScalar) {
- x *= fScalar;
- y *= fScalar;
- z *= fScalar;
- w *= fScalar;
- return *this;
-}
-
-//----------------------------------------------------------------------------
-inline float Vector4::dot(const Vector4& rkVector) const {
- return x*rkVector.x + y*rkVector.y + z*rkVector.z + w*rkVector.w;
-}
-
-//----------------------------------------------------------------------------
-inline Vector4 Vector4::min(const Vector4 &v) const {
- return Vector4(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z), G3D::min(v.w, w));
-}
-
-//----------------------------------------------------------------------------
-inline Vector4 Vector4::max(const Vector4 &v) const {
- return Vector4(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z), G3D::max(v.w, w));
-}
-
-//----------------------------------------------------------------------------
-inline bool Vector4::isZero() const {
- return (x == 0.0f) && (y == 0.0f) && (z == 0.0f) && (w == 0.0f);
-}
-
-//----------------------------------------------------------------------------
-
-inline bool Vector4::isFinite() const {
- return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z) && G3D::isFinite(w);
-}
-
-//----------------------------------------------------------------------------
-
-inline bool Vector4::isUnit() const {
- return squaredLength() == 1.0;
-}
-
-//----------------------------------------------------------------------------
-
-inline float Vector4::length() const {
- return sqrtf(squaredLength());
-}
-
-//----------------------------------------------------------------------------
-
-inline float Vector4::squaredLength() const {
- return x * x + y * y + z * z + w * w;
-}
-
-}
-
diff --git a/dep/g3dlite/include/G3D/g3dmath.inl b/dep/g3dlite/include/G3D/g3dmath.inl
deleted file mode 100644
index 9bf661a7ebc..00000000000
--- a/dep/g3dlite/include/G3D/g3dmath.inl
+++ /dev/null
@@ -1,288 +0,0 @@
-/**
- @file g3dmath.inl
-
- @maintainer Morgan McGuire, matrix@graphics3d.com
-
- @created 2001-06-02
- @edited 2006-01-14
- */
-
-#include <stdlib.h>
-
-#ifdef _MSC_VER
-// Disable conditional expression is constant, which occurs incorrectly on inlined functions
-# pragma warning (push)
-# pragma warning( disable : 4127 )
-#endif
-
-namespace G3D {
-
-inline bool isNaN(double x) {
- bool b1 = (x < 0.0);
- bool b2 = (x >= 0.0);
- bool b3 = !(b1 || b2);
- return b3;
-}
-
-inline bool isFinite(double x) {
- return ! isNaN(x) && (x < G3D::inf()) && (x > -G3D::inf());
-}
-
-//----------------------------------------------------------------------------
-inline int iAbs (int iValue) {
- return ( iValue >= 0 ? iValue : -iValue );
-}
-
-//----------------------------------------------------------------------------
-inline int iCeil (double fValue) {
- return int(::ceil(fValue));
-}
-
-//----------------------------------------------------------------------------
-
-inline int iClamp(int val, int low, int hi) {
- debugAssert(low <= hi);
- if (val <= low) {
- return low;
- } else if (val >= hi) {
- return hi;
- } else {
- return val;
- }
-}
-
-//----------------------------------------------------------------------------
-
-inline double clamp(double val, double low, double hi) {
- debugAssert(low <= hi);
- if (val <= low) {
- return low;
- } else if (val >= hi) {
- return hi;
- } else {
- return val;
- }
-}
-
-inline float clamp(float val, float low, float hi) {
- debugAssert(low <= hi);
- if (val <= low) {
- return low;
- } else if (val >= hi) {
- return hi;
- } else {
- return val;
- }
-}
-//----------------------------------------------------------------------------
-
-inline int iWrap(int val, int hi) {
- if (val < 0) {
- return ((val % hi) + hi) % hi;
- } else {
- return val % hi;
- }
-}
-
-//----------------------------------------------------------------------------
-inline int iFloor (double fValue) {
- return int(::floor(fValue));
-}
-
-//----------------------------------------------------------------------------
-inline int iSign (int iValue) {
- return ( iValue > 0 ? + 1 : ( iValue < 0 ? -1 : 0 ) );
-}
-
-inline int iSign (double fValue) {
- return ( fValue > 0.0 ? + 1 : ( fValue < 0.0 ? -1 : 0 ) );
-}
-
-//----------------------------------------------------------------------------
-inline double abs (double fValue) {
- return double(::fabs(fValue));
-}
-
-//----------------------------------------------------------------------------
-inline double aCos (double fValue) {
- if ( -1.0 < fValue ) {
- if ( fValue < 1.0 )
- return double(::acos(fValue));
- else
- return 0.0;
- } else {
- return G3D_PI;
- }
-}
-
-//----------------------------------------------------------------------------
-inline double aSin (double fValue) {
- if ( -1.0 < fValue ) {
- if ( fValue < 1.0 ) {
- return double(::asin(fValue));
- } else {
- return -G3D_HALF_PI;
- }
- } else {
- return G3D_HALF_PI;
- }
-}
-
-//----------------------------------------------------------------------------
-inline double aTan (double fValue) {
- return double(::atan(fValue));
-}
-
-//----------------------------------------------------------------------------
-inline double aTan2 (double fY, double fX) {
- return double(::atan2(fY, fX));
-}
-
-//----------------------------------------------------------------------------
-inline double sign (double fValue) {
- if (fValue > 0.0) {
- return 1.0;
- }
-
- if (fValue < 0.0) {
- return -1.0;
- }
-
- return 0.0;
-}
-
-inline double G3D_DEPRECATED unitRandom () {
- return double(::rand()) / double(RAND_MAX);
-}
-
-inline float uniformRandom(float low, float hi) {
- return (hi - low) * float(::rand()) / float(RAND_MAX) + low;
-}
-
-//----------------------------------------------------------------------------
-inline double G3D_DEPRECATED symmetricRandom () {
- return 2.0 * double(::rand()) / double(RAND_MAX) - 1.0;
-}
-
-//----------------------------------------------------------------------------
-inline double square(double x) {
- return x * x;
-}
-
-//----------------------------------------------------------------------------
-inline double sumSquares(double x, double y) {
- return x*x + y*y;
-}
-
-//----------------------------------------------------------------------------
-inline double sumSquares(double x, double y, double z) {
- return x*x + y*y + z*z;
-}
-
-//----------------------------------------------------------------------------
-inline double distance(double x, double y) {
- return sqrt(sumSquares(x, y));
-}
-
-//----------------------------------------------------------------------------
-inline double distance(double x, double y, double z) {
- return sqrt(sumSquares(x, y, z));
-}
-
-//----------------------------------------------------------------------------
-
-/** @deprecated use G3D::min */
-inline int iMin(int x, int y) {
- return (x >= y) ? y : x;
-}
-
-//----------------------------------------------------------------------------
-/** @deprecated use G3D::min */
-inline int iMax(int x, int y) {
- return (x >= y) ? x : y;
-}
-
-//----------------------------------------------------------------------------
-inline int ceilPow2(unsigned int in) {
- in -= 1;
-
- in |= in >> 16;
- in |= in >> 8;
- in |= in >> 4;
- in |= in >> 2;
- in |= in >> 1;
-
- return in + 1;
-}
-
-inline bool isPow2(int num) {
- return ((num & -num) == num);
-}
-
-inline bool isOdd(int num) {
- return (num & 1) == 1;
-}
-
-inline bool isEven(int num) {
- return (num & 1) == 0;
-}
-
-inline double toRadians(double deg) {
- return deg * G3D_PI / 180.0;
-}
-
-inline double toDegrees(double rad) {
- return rad * 180.0 / G3D_PI;
-}
-
-/**
- Computes an appropriate epsilon for comparing a and b.
- */
-inline double eps(double a, double b) {
- // For a and b to be nearly equal, they must have nearly
- // the same magnitude. This means that we can ignore b
- // since it either has the same magnitude or the comparison
- // will fail anyway.
- (void)b;
- const double aa = abs(a) + 1;
- if (aa == inf()) {
- return fuzzyEpsilon;
- } else {
- return fuzzyEpsilon * aa;
- }
-}
-
-inline bool fuzzyEq(double a, double b) {
- return (a == b) || (abs(a - b) <= eps(a, b));
-}
-
-inline bool fuzzyNe(double a, double b) {
- return ! fuzzyEq(a, b);
-}
-
-inline bool fuzzyGt(double a, double b) {
- return a > b + eps(a, b);
-}
-
-inline bool fuzzyGe(double a, double b) {
- return a > b - eps(a, b);
-}
-
-inline bool fuzzyLt(double a, double b) {
- return a < b - eps(a, b);
-}
-
-inline bool fuzzyLe(double a, double b) {
- return a < b + eps(a, b);
-}
-
-inline int iMod3(int x) {
- return x % 3;
-}
-
-} // namespace G3D
-
-#ifdef _MSC_VER
-// Disable conditional expression is constant, which occurs incorrectly on inlined functions
-# pragma warning (pop)
-#endif
diff --git a/dep/g3dlite/include/G3D/platform.h b/dep/g3dlite/include/G3D/platform.h
index d399135101b..c8d2f0b6534 100644
--- a/dep/g3dlite/include/G3D/platform.h
+++ b/dep/g3dlite/include/G3D/platform.h
@@ -6,7 +6,7 @@
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2003-06-09
- @edited 2010-01-11
+ @edited 2010-08-11
*/
#ifndef G3D_platform_h
@@ -16,7 +16,7 @@
The version number of G3D in the form: MmmBB ->
version M.mm [beta BB]
*/
-#define G3D_VER 80000
+#define G3D_VER 80100
// fatal error for unsupported architectures
#if defined(__powerpc__)
diff --git a/dep/g3dlite/source/AABox.cpp b/dep/g3dlite/source/AABox.cpp
index 035497aa3c4..8e66456c013 100644
--- a/dep/g3dlite/source/AABox.cpp
+++ b/dep/g3dlite/source/AABox.cpp
@@ -282,6 +282,10 @@ bool AABox::culledBy(
return false;
}
+void AABox::getBounds(Sphere& s) const {
+ s.center = center();
+ s.radius = extent().length() / 2;
+}
bool AABox::intersects(const class Sphere& sphere) const {
double d = 0;
diff --git a/dep/g3dlite/source/Log.cpp b/dep/g3dlite/source/Log.cpp
index d44d88d0242..f437351cfbd 100644
--- a/dep/g3dlite/source/Log.cpp
+++ b/dep/g3dlite/source/Log.cpp
@@ -23,23 +23,23 @@
namespace G3D {
void logPrintf(const char* fmt, ...) {
- va_list arg_list;
- va_start(arg_list, fmt);
+ va_list arg_list;
+ va_start(arg_list, fmt);
Log::common()->vprintf(fmt, arg_list);
va_end(arg_list);
}
void logLazyPrintf(const char* fmt, ...) {
- va_list arg_list;
- va_start(arg_list, fmt);
+ va_list arg_list;
+ va_start(arg_list, fmt);
Log::common()->lazyvprintf(fmt, arg_list);
va_end(arg_list);
}
Log* Log::commonLog = NULL;
-Log::Log(const std::string& filename, int stripFromStackBottom) :
+Log::Log(const std::string& filename, int stripFromStackBottom) :
stripFromStackBottom(stripFromStackBottom) {
this->filename = filename;
@@ -50,7 +50,7 @@ Log::Log(const std::string& filename, int stripFromStackBottom) :
std::string drive, base, ext;
Array<std::string> path;
parseFilename(filename, drive, path, base, ext);
- std::string logName = base + ((ext != "") ? ("." + ext) : "");
+ std::string logName = base + ((ext != "") ? ("." + ext) : "");
// Write time is greater than 1ms. This may be a network drive.... try another file.
#ifdef G3D_WIN32
@@ -80,7 +80,7 @@ Log::Log(const std::string& filename, int stripFromStackBottom) :
Log::~Log() {
section("Shutdown");
println("Closing log file");
-
+
// Make sure we don't leave a dangling pointer
if (Log::commonLog == this) {
Log::commonLog = NULL;
diff --git a/dep/g3dlite/source/System.cpp b/dep/g3dlite/source/System.cpp
index 5170ba44941..809f05c0ab4 100644
--- a/dep/g3dlite/source/System.cpp
+++ b/dep/g3dlite/source/System.cpp
@@ -920,9 +920,12 @@ RealTime System::time() {
////////////////////////////////////////////////////////////////
-#define REALPTR_TO_USERPTR(x) ((uint8*)(x) + sizeof (void *))
-#define USERPTR_TO_REALPTR(x) ((uint8*)(x) - sizeof (void *))
-#define REALBLOCK_SIZE(x) ((x) + sizeof (void *))
+
+#define REALPTR_TO_USERPTR(x) ((uint8*)(x) + sizeof(uint32))
+#define USERPTR_TO_REALPTR(x) ((uint8*)(x) - sizeof(uint32))
+#define USERSIZE_TO_REALSIZE(x) ((x) + sizeof(uint32))
+#define REALSIZE_FROM_USERPTR(u) (*(uint32*)USERPTR_TO_REALPTR(ptr) + sizeof(uint32))
+#define USERSIZE_FROM_USERPTR(u) (*(uint32*)USERPTR_TO_REALPTR(ptr))
class BufferPool {
public:
@@ -947,13 +950,19 @@ public:
private:
+ /** Pointer given to the program. Unless in the tiny heap, the user size of the block is stored right in front of the pointer as a uint32.*/
+ typedef void* UserPtr;
+
+ /** Actual block allocated on the heap */
+ typedef void* RealPtr;
+
class MemBlock {
public:
- void* ptr;
- size_t bytes;
+ UserPtr ptr;
+ size_t bytes;
inline MemBlock() : ptr(NULL), bytes(0) {}
- inline MemBlock(void* p, size_t b) : ptr(p), bytes(b) {}
+ inline MemBlock(UserPtr p, size_t b) : ptr(p), bytes(b) {}
};
MemBlock smallPool[maxSmallBuffers];
@@ -1010,13 +1019,13 @@ private:
/**
Malloc out of the tiny heap. Returns NULL if allocation failed.
*/
- inline void* tinyMalloc(size_t bytes) {
+ inline UserPtr tinyMalloc(size_t bytes) {
// Note that we ignore the actual byte size
// and create a constant size block.
(void)bytes;
assert(tinyBufferSize >= bytes);
- void* ptr = NULL;
+ UserPtr ptr = NULL;
if (tinyPoolSize > 0) {
--tinyPoolSize;
@@ -1040,20 +1049,20 @@ private:
}
/** Returns true if this is a pointer into the tiny heap. */
- bool inTinyHeap(void* ptr) {
+ bool inTinyHeap(UserPtr ptr) {
return
(ptr >= tinyHeap) &&
(ptr < (uint8*)tinyHeap + maxTinyBuffers * tinyBufferSize);
}
- void tinyFree(void* ptr) {
+ void tinyFree(UserPtr ptr) {
assert(ptr);
assert(tinyPoolSize < maxTinyBuffers);
// "Tried to free a tiny pool buffer when the tiny pool freelist is full.");
# ifdef G3D_DEBUG
if (tinyPoolSize > 0) {
- void* prevOnHeap = tinyPool[tinyPoolSize - 1];
+ UserPtr prevOnHeap = tinyPool[tinyPoolSize - 1];
assert(prevOnHeap != ptr);
// "System::malloc heap corruption detected: "
// "the last two pointers on the freelist are identical (during tinyFree).");
@@ -1070,7 +1079,8 @@ private:
void flushPool(MemBlock* pool, int& poolSize) {
for (int i = 0; i < poolSize; ++i) {
- ::free(pool[i].ptr);
+ bytesAllocated -= USERSIZE_TO_REALSIZE(pool[i].bytes);
+ ::free(USERPTR_TO_REALPTR(pool[i].ptr));
pool[i].ptr = NULL;
pool[i].bytes = 0;
}
@@ -1078,24 +1088,23 @@ private:
}
- /** Allocate out of a specific pool-> Return NULL if no suitable
- memory was found.
-
- */
- void* malloc(MemBlock* pool, int& poolSize, size_t bytes) {
+ /** Allocate out of a specific pool. Return NULL if no suitable
+ memory was found. */
+ UserPtr malloc(MemBlock* pool, int& poolSize, size_t bytes) {
// OPT: find the smallest block that satisfies the request.
- // See if there's something we can use in the buffer pool->
+ // See if there's something we can use in the buffer pool.
// Search backwards since usually we'll re-use the last one.
for (int i = (int)poolSize - 1; i >= 0; --i) {
if (pool[i].bytes >= bytes) {
- // We found a suitable entry in the pool->
+ // We found a suitable entry in the pool.
// No need to offset the pointer; it is already offset
- void* ptr = pool[i].ptr;
+ UserPtr ptr = pool[i].ptr;
- // Remove this element from the pool
+ // Remove this element from the pool, replacing it with
+ // the one from the end (same as Array::fastRemove)
--poolSize;
pool[i] = pool[poolSize];
@@ -1159,6 +1168,8 @@ public:
~BufferPool() {
::free(tinyHeap);
+ flushPool(smallPool, smallPoolSize);
+ flushPool(medPool, medPoolSize);
#if 0 //-------------------------------- old mutex
# ifdef G3D_WIN32
DeleteCriticalSection(&mutex);
@@ -1169,7 +1180,7 @@ public:
}
- void* realloc(void* ptr, size_t bytes) {
+ UserPtr realloc(UserPtr ptr, size_t bytes) {
if (ptr == NULL) {
return malloc(bytes);
}
@@ -1181,7 +1192,7 @@ public:
} else {
// Free the old pointer and malloc
- void* newPtr = malloc(bytes);
+ UserPtr newPtr = malloc(bytes);
System::memcpy(newPtr, ptr, tinyBufferSize);
tinyFree(ptr);
return newPtr;
@@ -1191,28 +1202,28 @@ public:
// In one of our heaps.
// See how big the block really was
- size_t realSize = *(uint32*)USERPTR_TO_REALPTR(ptr);
- if (bytes <= realSize) {
+ size_t userSize = USERSIZE_FROM_USERPTR(ptr);
+ if (bytes <= userSize) {
// The old block was big enough.
return ptr;
}
- // Need to reallocate
- void* newPtr = malloc(bytes);
- System::memcpy(newPtr, ptr, realSize);
+ // Need to reallocate and move
+ UserPtr newPtr = malloc(bytes);
+ System::memcpy(newPtr, ptr, userSize);
free(ptr);
return newPtr;
}
}
- void* malloc(size_t bytes) {
+ UserPtr malloc(size_t bytes) {
lock();
++totalMallocs;
if (bytes <= tinyBufferSize) {
- void* ptr = tinyMalloc(bytes);
+ UserPtr ptr = tinyMalloc(bytes);
if (ptr) {
++mallocsFromTinyPool;
@@ -1226,7 +1237,7 @@ public:
// through to a small buffer
if (bytes <= smallBufferSize) {
- void* ptr = malloc(smallPool, smallPoolSize, bytes);
+ UserPtr ptr = malloc(smallPool, smallPoolSize, bytes);
if (ptr) {
++mallocsFromSmallPool;
@@ -1239,7 +1250,7 @@ public:
// through into a medium allocation because that would
// waste the medium buffer's resources.
- void* ptr = malloc(medPool, medPoolSize, bytes);
+ UserPtr ptr = malloc(medPool, medPoolSize, bytes);
if (ptr) {
++mallocsFromMedPool;
@@ -1249,37 +1260,37 @@ public:
}
}
- bytesAllocated += REALBLOCK_SIZE(bytes);
+ bytesAllocated += USERSIZE_TO_REALSIZE(bytes);
unlock();
// Heap allocate
// Allocate 4 extra bytes for our size header (unfortunate,
// since malloc already added its own header).
- void* ptr = ::malloc(REALBLOCK_SIZE(bytes));
+ RealPtr ptr = ::malloc(USERSIZE_TO_REALSIZE(bytes));
if (ptr == NULL) {
// Flush memory pools to try and recover space
flushPool(smallPool, smallPoolSize);
flushPool(medPool, medPoolSize);
- ptr = ::malloc(REALBLOCK_SIZE(bytes));
+ ptr = ::malloc(USERSIZE_TO_REALSIZE(bytes));
}
if (ptr == NULL) {
if ((System::outOfMemoryCallback() != NULL) &&
- (System::outOfMemoryCallback()(REALBLOCK_SIZE(bytes), true) == true)) {
+ (System::outOfMemoryCallback()(USERSIZE_TO_REALSIZE(bytes), true) == true)) {
// Re-attempt the malloc
- ptr = ::malloc(REALBLOCK_SIZE(bytes));
+ ptr = ::malloc(USERSIZE_TO_REALSIZE(bytes));
}
}
if (ptr == NULL) {
if (System::outOfMemoryCallback() != NULL) {
// Notify the application
- System::outOfMemoryCallback()(REALBLOCK_SIZE(bytes), false);
+ System::outOfMemoryCallback()(USERSIZE_TO_REALSIZE(bytes), false);
}
# ifdef G3D_DEBUG
- debugPrintf("::malloc(%d) returned NULL\n", (int)REALBLOCK_SIZE(bytes));
+ debugPrintf("::malloc(%d) returned NULL\n", (int)USERSIZE_TO_REALSIZE(bytes));
# endif
debugAssertM(ptr != NULL,
"::malloc returned NULL. Either the "
@@ -1294,7 +1305,7 @@ public:
}
- void free(void* ptr) {
+ void free(UserPtr ptr) {
if (ptr == NULL) {
// Free does nothing on null pointers
return;
@@ -1309,7 +1320,7 @@ public:
return;
}
- uint32 bytes = *(uint32*)USERPTR_TO_REALPTR(ptr);
+ uint32 bytes = USERSIZE_FROM_USERPTR(ptr);
lock();
if (bytes <= smallBufferSize) {
@@ -1327,7 +1338,7 @@ public:
return;
}
}
- bytesAllocated -= REALBLOCK_SIZE(bytes);
+ bytesAllocated -= USERSIZE_TO_REALSIZE(bytes);
unlock();
// Free; the buffer pools are full or this is too big to store.
diff --git a/dep/g3dlite/source/TextInput.cpp b/dep/g3dlite/source/TextInput.cpp
index 09abacc7391..354d0de13c0 100644
--- a/dep/g3dlite/source/TextInput.cpp
+++ b/dep/g3dlite/source/TextInput.cpp
@@ -128,32 +128,34 @@ Token TextInput::read() {
}
-std::string TextInput::readUntilNewlineAsString() {
- // Go to the front of the next token
- Token t = read();
- // Reset the position to the start of this token
+std::string TextInput::readUntilNewlineAsString() {
+/*
+ // Reset the read position back to the start of that token
currentCharOffset = t.bytePosition();
+ lineNumber = t.line();
+ charNumber = t.character();
stack.clear();
if (currentCharOffset == buffer.size()) {
// End of file
return "";
}
-
+ */
std::string s;
// Read until newline or eof
char c = '\0';
do {
- c = buffer[currentCharOffset];
- if (c == '\r' || c == '\n') {
- // Done
- break;
- } else {
- s += c;
- ++currentCharOffset;
- }
+ c = buffer[currentCharOffset];
+ if (c == '\r' || c == '\n') {
+ // Done
+ break;
+ } else {
+ s += c;
+ ++currentCharOffset;
+ ++charNumber;
+ }
} while (currentCharOffset < buffer.size());
return s;
diff --git a/dep/gsoap/gsoap.stub b/dep/gsoap/gsoap.stub
new file mode 100644
index 00000000000..be215b46655
--- /dev/null
+++ b/dep/gsoap/gsoap.stub
@@ -0,0 +1 @@
+int ns1__executeCommand(char* command, char** result);
diff --git a/dep/gsoap/soapC.cpp b/dep/gsoap/soapC.cpp
index 7fefc27f5d1..2c675cc339d 100644
--- a/dep/gsoap/soapC.cpp
+++ b/dep/gsoap/soapC.cpp
@@ -1,8 +1,11 @@
/* soapC.cpp
- Generated by gSOAP 2.8.2 from stub.h
- Copyright(C) 2000-2011, Robert van Engelen, Genivia Inc. All Rights Reserved.
- The generated code is released under one of the following licenses:
- GPL OR Genivia's license for commercial use.
+ Generated by gSOAP 2.8.10 from gsoap.stub
+
+Copyright(C) 2000-2012, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The generated code is released under one of the following licenses:
+1) GPL or 2) Genivia's license for commercial use.
+This program is released under the GPL with the additional exemption that
+compiling, linking, and/or using OpenSSL is allowed.
*/
#if defined(__BORLANDC__)
@@ -12,15 +15,17 @@
#include "soapH.h"
-SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.8.2 2011-04-26 21:49:07 GMT")
+SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.8.10 2012-09-02 20:48:00 GMT")
#ifndef WITH_NOGLOBAL
-SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap *soap)
+SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap *soap)
{
- if (soap->header)
- soap_serialize_SOAP_ENV__Header(soap, soap->header);
+ soap->part = SOAP_IN_HEADER;
+ soap->header = soap_in_SOAP_ENV__Header(soap, "SOAP-ENV:Header", soap->header, NULL);
+ soap->part = SOAP_END_HEADER;
+ return soap->header == NULL;
}
SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap *soap)
@@ -34,12 +39,10 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap *soap)
return SOAP_OK;
}
-SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap *soap)
+SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap *soap)
{
- soap->part = SOAP_IN_HEADER;
- soap->header = soap_in_SOAP_ENV__Header(soap, "SOAP-ENV:Header", NULL, NULL);
- soap->part = SOAP_END_HEADER;
- return soap->header == NULL;
+ if (soap->header)
+ soap_serialize_SOAP_ENV__Header(soap, soap->header);
}
SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap *soap)
@@ -90,7 +93,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_getfault(struct soap *soap)
SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap *soap)
{
soap_fault(soap);
- if (soap->version == 2)
+ if (soap->version == 2 && soap->fault->SOAP_ENV__Code)
return (const char**)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value;
return (const char**)&soap->fault->faultcode;
}
@@ -108,6 +111,17 @@ SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap *soap)
return (const char**)&soap->fault->faultcode;
}
+SOAP_FMAC3 const char * SOAP_FMAC4 soap_check_faultsubcode(struct soap *soap)
+{
+ soap_fault(soap);
+ if (soap->version == 2)
+ { if (soap->fault->SOAP_ENV__Code && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode)
+ return soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value;
+ return NULL;
+ }
+ return soap->fault->faultcode;
+}
+
SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap *soap)
{
soap_fault(soap);
@@ -133,6 +147,16 @@ SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap *soap)
return (const char**)&soap->fault->SOAP_ENV__Detail->__any;
}
+SOAP_FMAC3 const char * SOAP_FMAC4 soap_check_faultdetail(struct soap *soap)
+{
+ soap_fault(soap);
+ if (soap->version == 2 && soap->fault->SOAP_ENV__Detail)
+ return soap->fault->SOAP_ENV__Detail->__any;
+ if (soap->fault->detail)
+ return soap->fault->detail->__any;
+ return NULL;
+}
+
#endif
#ifndef WITH_NOIDREF
@@ -158,7 +182,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap *soap)
extern "C" {
#endif
SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap *soap, int *type)
-{
+{ (void)type;
if (soap_peek_element(soap))
return NULL;
if (!*soap->id || !(*type = soap_lookup_type(soap, soap->id)))
@@ -280,7 +304,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap *soap)
extern "C" {
#endif
SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap *soap, const void *ptr, const char *tag, int id, int type)
-{
+{ (void)tag;
switch (type)
{
case SOAP_TYPE_byte:
@@ -340,7 +364,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap *soap, const void *ptr,
#endif
SOAP_FMAC3 void * SOAP_FMAC4 soap_instantiate(struct soap *soap, int t, const char *type, const char *arrayType, size_t *n)
-{
+{ (void)type;
switch (t)
{
case SOAP_TYPE_ns1__executeCommandResponse:
@@ -446,7 +470,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_byte(struct soap *soap, char *a)
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap *soap, const char *tag, int id, const char *a, const char *type)
-{
+{ (void)soap; (void)type; (void)tag; (void)id;
return soap_outbyte(soap, tag, id, a, type, SOAP_TYPE_byte);
}
@@ -483,7 +507,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_int(struct soap *soap, int *a)
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap *soap, const char *tag, int id, const int *a, const char *type)
-{
+{ (void)soap; (void)type; (void)tag; (void)id;
return soap_outint(soap, tag, id, a, type, SOAP_TYPE_int);
}
@@ -542,13 +566,14 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap *soap, con
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Fault *a, const char *type)
{
const char *soap_tmp_faultcode = soap_QName2s(soap, a->faultcode);
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Fault), type))
return soap->error;
if (soap_out__QName(soap, "faultcode", -1, (char*const*)&soap_tmp_faultcode, ""))
return soap->error;
- if (soap_out_string(soap, "faultstring", -1, &a->faultstring, "xsd:string"))
+ if (soap_out_string(soap, "faultstring", -1, &a->faultstring, ""))
return soap->error;
- if (soap_out_string(soap, "faultactor", -1, &a->faultactor, "xsd:string"))
+ if (soap_out_string(soap, "faultactor", -1, &a->faultactor, ""))
return soap->error;
if (soap_out_PointerToSOAP_ENV__Detail(soap, "detail", -1, &a->detail, ""))
return soap->error;
@@ -692,7 +717,7 @@ SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Fault(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Fault %p -> %p\n", q, p));
*(struct SOAP_ENV__Fault*)p = *(struct SOAP_ENV__Fault*)q;
}
@@ -715,6 +740,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap *soap, co
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Reason *a, const char *type)
{
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Reason), type))
return soap->error;
if (soap->lang)
@@ -803,7 +829,7 @@ SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reaso
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Reason(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Reason %p -> %p\n", q, p));
*(struct SOAP_ENV__Reason*)p = *(struct SOAP_ENV__Reason*)q;
}
@@ -828,6 +854,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap *soap, co
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Detail *a, const char *type)
{
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Detail), type))
return soap->error;
soap_outliteral(soap, "-any", &a->__any, NULL);
@@ -921,7 +948,7 @@ SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detai
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Detail(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Detail %p -> %p\n", q, p));
*(struct SOAP_ENV__Detail*)p = *(struct SOAP_ENV__Detail*)q;
}
@@ -947,6 +974,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap *soap, cons
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Code *a, const char *type)
{
const char *soap_tmp_SOAP_ENV__Value = soap_QName2s(soap, a->SOAP_ENV__Value);
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Code), type))
return soap->error;
if (soap_out__QName(soap, "SOAP-ENV:Value", -1, (char*const*)&soap_tmp_SOAP_ENV__Value, ""))
@@ -1041,7 +1069,7 @@ SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(st
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Code(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Code %p -> %p\n", q, p));
*(struct SOAP_ENV__Code*)p = *(struct SOAP_ENV__Code*)q;
}
@@ -1062,6 +1090,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap *soap, co
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type)
{
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type))
return soap->error;
return soap_element_end_out(soap, tag);
@@ -1140,7 +1169,7 @@ SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Heade
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Header(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Header %p -> %p\n", q, p));
*(struct SOAP_ENV__Header*)p = *(struct SOAP_ENV__Header*)q;
}
@@ -1161,9 +1190,10 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__executeCommand(struct soap *soap,
SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__executeCommand(struct soap *soap, const char *tag, int id, const struct ns1__executeCommand *a, const char *type)
{
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__executeCommand), type))
return soap->error;
- if (soap_out_string(soap, "command", -1, &a->command, "xsd:string"))
+ if (soap_out_string(soap, "command", -1, &a->command, ""))
return soap->error;
return soap_element_end_out(soap, tag);
}
@@ -1247,7 +1277,7 @@ SOAP_FMAC1 struct ns1__executeCommand * SOAP_FMAC2 soap_instantiate_ns1__execute
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns1__executeCommand(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns1__executeCommand %p -> %p\n", q, p));
*(struct ns1__executeCommand*)p = *(struct ns1__executeCommand*)q;
}
@@ -1266,9 +1296,10 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__executeCommandResponse(struct soa
SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__executeCommandResponse(struct soap *soap, const char *tag, int id, const struct ns1__executeCommandResponse *a, const char *type)
{
+ (void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__executeCommandResponse), type))
return soap->error;
- if (soap_out_PointerTostring(soap, "result", -1, &a->result, "xsd:string"))
+ if (soap_out_PointerTostring(soap, "result", -1, &a->result, ""))
return soap->error;
return soap_element_end_out(soap, tag);
}
@@ -1352,7 +1383,7 @@ SOAP_FMAC1 struct ns1__executeCommandResponse * SOAP_FMAC2 soap_instantiate_ns1_
SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns1__executeCommandResponse(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{
- (void)soap; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
+ (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns1__executeCommandResponse %p -> %p\n", q, p));
*(struct ns1__executeCommandResponse*)p = *(struct ns1__executeCommandResponse*)q;
}
@@ -1383,6 +1414,8 @@ SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reas
*a = NULL;
if (!soap->null && *soap->href != '#')
{ soap_revert(soap);
+ *a = (struct SOAP_ENV__Reason *)soap_malloc(soap, sizeof(struct SOAP_ENV__Reason));
+ soap_default_SOAP_ENV__Reason(soap, *a);
if (!(*a = soap_in_SOAP_ENV__Reason(soap, tag, *a, type)))
return NULL;
}
@@ -1438,6 +1471,8 @@ SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Deta
*a = NULL;
if (!soap->null && *soap->href != '#')
{ soap_revert(soap);
+ *a = (struct SOAP_ENV__Detail *)soap_malloc(soap, sizeof(struct SOAP_ENV__Detail));
+ soap_default_SOAP_ENV__Detail(soap, *a);
if (!(*a = soap_in_SOAP_ENV__Detail(soap, tag, *a, type)))
return NULL;
}
@@ -1493,6 +1528,8 @@ SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(s
*a = NULL;
if (!soap->null && *soap->href != '#')
{ soap_revert(soap);
+ *a = (struct SOAP_ENV__Code *)soap_malloc(soap, sizeof(struct SOAP_ENV__Code));
+ soap_default_SOAP_ENV__Code(soap, *a);
if (!(*a = soap_in_SOAP_ENV__Code(soap, tag, *a, type)))
return NULL;
}
diff --git a/dep/gsoap/soapH.h b/dep/gsoap/soapH.h
index e51d3defaaf..06e9ec21239 100644
--- a/dep/gsoap/soapH.h
+++ b/dep/gsoap/soapH.h
@@ -1,8 +1,11 @@
/* soapH.h
- Generated by gSOAP 2.8.2 from stub.h
- Copyright(C) 2000-2011, Robert van Engelen, Genivia Inc. All Rights Reserved.
- The generated code is released under one of the following licenses:
- GPL OR Genivia's license for commercial use.
+ Generated by gSOAP 2.8.10 from gsoap.stub
+
+Copyright(C) 2000-2012, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The generated code is released under one of the following licenses:
+1) GPL or 2) Genivia's license for commercial use.
+This program is released under the GPL with the additional exemption that
+compiling, linking, and/or using OpenSSL is allowed.
*/
#ifndef soapH_H
diff --git a/dep/gsoap/soapServer.cpp b/dep/gsoap/soapServer.cpp
index 8c8206fb3ef..b6304a3e525 100644
--- a/dep/gsoap/soapServer.cpp
+++ b/dep/gsoap/soapServer.cpp
@@ -1,8 +1,11 @@
/* soapServer.cpp
- Generated by gSOAP 2.8.2 from stub.h
- Copyright(C) 2000-2011, Robert van Engelen, Genivia Inc. All Rights Reserved.
- The generated code is released under one of the following licenses:
- GPL OR Genivia's license for commercial use.
+ Generated by gSOAP 2.8.10 from gsoap.stub
+
+Copyright(C) 2000-2012, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The generated code is released under one of the following licenses:
+1) GPL or 2) Genivia's license for commercial use.
+This program is released under the GPL with the additional exemption that
+compiling, linking, and/or using OpenSSL is allowed.
*/
#if defined(__BORLANDC__)
@@ -11,7 +14,7 @@
#endif
#include "soapH.h"
-SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.8.2 2011-04-26 21:49:07 GMT")
+SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.8.10 2012-09-02 20:48:00 GMT")
SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap)
@@ -67,6 +70,7 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__executeCommand(struct soap *soap)
soap_tmp_string = NULL;
soap_tmp_ns1__executeCommandResponse.result = &soap_tmp_string;
soap_default_ns1__executeCommand(soap, &soap_tmp_ns1__executeCommand);
+ soap->encodingStyle = NULL;
if (!soap_get_ns1__executeCommand(soap, &soap_tmp_ns1__executeCommand, "ns1:executeCommand", NULL))
return soap->error;
if (soap_body_end_in(soap)
diff --git a/dep/gsoap/soapStub.h b/dep/gsoap/soapStub.h
index 85f3119b9ff..fbdd170e0f4 100644
--- a/dep/gsoap/soapStub.h
+++ b/dep/gsoap/soapStub.h
@@ -1,13 +1,20 @@
/* soapStub.h
- Generated by gSOAP 2.8.2 from stub.h
- Copyright(C) 2000-2011, Robert van Engelen, Genivia Inc. All Rights Reserved.
- The generated code is released under one of the following licenses:
- GPL OR Genivia's license for commercial use.
+ Generated by gSOAP 2.8.10 from gsoap.stub
+
+Copyright(C) 2000-2012, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The generated code is released under one of the following licenses:
+1) GPL or 2) Genivia's license for commercial use.
+This program is released under the GPL with the additional exemption that
+compiling, linking, and/or using OpenSSL is allowed.
*/
#ifndef soapStub_H
#define soapStub_H
#include "stdsoap2.h"
+#if GSOAP_VERSION != 20810
+# error "GSOAP VERSION MISMATCH IN GENERATED CODE: PLEASE REINSTALL PACKAGE"
+#endif
+
/******************************************************************************\
* *
diff --git a/dep/gsoap/stdsoap2.cpp b/dep/gsoap/stdsoap2.cpp
index ed0922d86f2..36a8901dcab 100644
--- a/dep/gsoap/stdsoap2.cpp
+++ b/dep/gsoap/stdsoap2.cpp
@@ -1,17 +1,17 @@
/*
- stdsoap2.c[pp] 2.8.2
+ stdsoap2.c[pp] 2.8.10
gSOAP runtime engine
gSOAP XML Web services tools
-Copyright (C) 2000-2011, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2012, Robert van Engelen, Genivia Inc., All Rights Reserved.
This part of the software is released under ONE of the following licenses:
GPL, or the gSOAP public license, or Genivia's license for commercial use.
--------------------------------------------------------------------------------
Contributors:
Wind River Systems Inc., for the following additions under gSOAP public license:
- - vxWorks compatible
+ - vxWorks compatible options
--------------------------------------------------------------------------------
gSOAP public license.
@@ -24,7 +24,7 @@ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Robert A. van Engelen.
-Copyright (C) 2000-2011, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2012, Robert van Engelen, Genivia Inc., All Rights Reserved.
--------------------------------------------------------------------------------
GPL license.
@@ -49,25 +49,18 @@ compiling, linking, and/or using OpenSSL is allowed.
--------------------------------------------------------------------------------
A commercial use license is available from Genivia, Inc., contact@genivia.com
--------------------------------------------------------------------------------
-
-Installation note:
-
-Win32 build needs "ws2_32.lib"
-To do this in Visual C++ 6.0, go to "Project", "settings", select the "Link"
-tab (the project file needs to be selected in the file view) and add
-"ws2_32.lib" to the "Object/library modules" entry
-
-On Mac OS X with gcc (GCC) 3.1 20020420 (prerelease) you MUST compile with
--fstack_check when using -O2 because gcc 3.1 has a bug that smashes the stack
-when locally allocated data exceeds 64K.
-
*/
+#define GSOAP_LIB_VERSION 20810
+
#ifdef AS400
# pragma convert(819) /* EBCDIC to ASCII */
#endif
#include "stdsoap2.h"
+#if GSOAP_VERSION != GSOAP_LIB_VERSION
+# error "GSOAP VERSION MISMATCH IN LIBRARY: PLEASE REINSTALL PACKAGE"
+#endif
#ifdef __BORLANDC__
# pragma warn -8060
@@ -83,10 +76,10 @@ when locally allocated data exceeds 64K.
#endif
#ifdef __cplusplus
-SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.8.2 2011-04-17 00:00:00 GMT")
+SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.8.10 2012-08-16 00:00:00 GMT")
extern "C" {
#else
-SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.2 2011-04-17 00:00:00 GMT")
+SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.10 2012-08-16 00:00:00 GMT")
#endif
/* 8bit character representing unknown/nonrepresentable character data (e.g. not supported by current locale with multibyte support enabled) */
@@ -101,7 +94,7 @@ SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.2 2011-04-17 00:00:00 GMT")
#define SOAP_QT (soap_wchar)(-5) /* XML-specific '"' */
#define SOAP_AP (soap_wchar)(-6) /* XML-specific ''' */
-#define soap_blank(c) ((c) >= 0 && (c) <= 32)
+#define soap_blank(c) ((c)+1 > 0 && (c) <= 32)
#define soap_notblank(c) ((c) > 32)
#if defined(WIN32) && !defined(UNDER_CE)
@@ -138,8 +131,10 @@ static int soap_isxdigit(int);
static void *fplugin(struct soap*, const char*);
static size_t soap_count_attachments(struct soap *soap);
static int soap_try_connect_command(struct soap*, int http_command, const char *endpoint, const char *action);
+#ifdef WITH_NTLM
+static int soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const char *host, int port);
+#endif
#ifndef WITH_NOIDREF
-static void soap_update_ptrs(struct soap*, char*, char*, char*, char*);
static int soap_has_copies(struct soap*, const char*, const char*);
static void soap_init_iht(struct soap*);
static void soap_free_iht(struct soap*);
@@ -152,7 +147,7 @@ static void soap_free_pht(struct soap*);
static const char *soap_set_validation_fault(struct soap*, const char*, const char*);
static int soap_isnumeric(struct soap*, const char*);
static struct soap_nlist *soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized);
-static void soap_utilize_ns(struct soap *soap, const char *tag, size_t n);
+static void soap_utilize_ns(struct soap *soap, const char *tag);
#endif
#ifndef WITH_LEANER
@@ -208,9 +203,9 @@ static const char *soap_decode(char*, size_t, const char*, const char*);
#ifndef PALM_1
static soap_wchar soap_getchunkchar(struct soap*);
static const char *http_error(struct soap*, int);
-static int http_put(struct soap*);
static int http_get(struct soap*);
static int http_405(struct soap*);
+static int http_200(struct soap*);
static int http_post(struct soap*, const char*, const char*, int, const char*, const char*, size_t);
static int http_send_header(struct soap*, const char*);
static int http_post_header(struct soap*, const char*, const char*);
@@ -538,6 +533,7 @@ extern int h_errno;
static int
fsend(struct soap *soap, const char *s, size_t n)
{ register int nwritten, err;
+ SOAP_SOCKET sk;
#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
if (soap->os)
{ soap->os->write(s, (std::streamsize)n);
@@ -547,23 +543,26 @@ fsend(struct soap *soap, const char *s, size_t n)
return SOAP_EOF;
}
#endif
+ sk = soap->sendsk;
+ if (!soap_valid_socket(sk))
+ sk = soap->socket;
while (n)
- { if (soap_valid_socket(soap->socket))
+ { if (soap_valid_socket(sk))
{
if (soap->send_timeout)
{ for (;;)
{ register int r;
#ifdef WITH_OPENSSL
if (soap->ssl)
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_ALL, soap->send_timeout);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
else
#endif
#ifdef WITH_GNUTLS
if (soap->session)
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_ALL, soap->send_timeout);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
else
#endif
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout);
if (r > 0)
break;
if (!r)
@@ -590,25 +589,25 @@ fsend(struct soap *soap, const char *s, size_t n)
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
{ if (soap->peerlen)
- nwritten = sendto(soap->socket, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
+ nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
else
- nwritten = send(soap->socket, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
+ nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
/* retry and back-off algorithm */
/* TODO: this is not very clear from specs so verify and limit conditions under which we should loop (e.g. ENOBUFS) */
if (nwritten < 0)
{ int udp_repeat;
int udp_delay;
if ((soap->connect_flags & SO_BROADCAST))
- udp_repeat = 3; /* SOAP-over-UDP MULTICAST_UDP_REPEAT - 1 */
+ udp_repeat = 2; /* SOAP-over-UDP MULTICAST_UDP_REPEAT - 1 */
else
udp_repeat = 1; /* SOAP-over-UDP UNICAST_UDP_REPEAT - 1 */
udp_delay = ((unsigned int)soap_random % 201) + 50; /* UDP_MIN_DELAY .. UDP_MAX_DELAY */
do
- { tcp_select(soap, soap->socket, SOAP_TCP_SELECT_ERR, -1000 * udp_delay);
+ { tcp_select(soap, sk, SOAP_TCP_SELECT_ERR, -1000 * udp_delay);
if (soap->peerlen)
- nwritten = sendto(soap->socket, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
+ nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
else
- nwritten = send(soap->socket, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
+ nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
udp_delay <<= 1;
if (udp_delay > 500) /* UDP_UPPER_DELAY */
udp_delay = 500;
@@ -619,14 +618,14 @@ fsend(struct soap *soap, const char *s, size_t n)
else
#endif
#if !defined(PALM) && !defined(AS400)
- nwritten = send(soap->socket, s, (int)n, soap->socket_flags);
+ nwritten = send(sk, s, (int)n, soap->socket_flags);
#else
- nwritten = send(soap->socket, (void*)s, n, soap->socket_flags);
+ nwritten = send(sk, (void*)s, n, soap->socket_flags);
#endif
if (nwritten <= 0)
{
register int r = 0;
- err = soap_socket_errno(soap->socket);
+ err = soap_socket_errno(sk);
#ifdef WITH_OPENSSL
if (soap->ssl && (r = SSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE)
{ soap->errnum = err;
@@ -645,14 +644,14 @@ fsend(struct soap *soap, const char *s, size_t n)
{
#if defined(WITH_OPENSSL)
if (soap->ssl && r == SSL_ERROR_WANT_READ)
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
else
#elif defined(WITH_GNUTLS)
if (soap->session && !gnutls_record_get_direction(soap->session))
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
else
#endif
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
if (!r && soap->send_timeout)
return SOAP_EOF;
if (r < 0 && soap->errnum != SOAP_EINTR)
@@ -775,7 +774,7 @@ soap_flush(struct soap *soap)
do
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating %u bytes\n", soap->d_stream->avail_in));
if (deflate(soap->d_stream, Z_NO_FLUSH) != Z_OK)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to deflate: %s\n", soap->d_stream->msg?soap->d_stream->msg:SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
return soap->error = SOAP_ZLIB_ERROR;
}
if (!soap->d_stream->avail_out)
@@ -870,6 +869,7 @@ static size_t
frecv(struct soap *soap, char *s, size_t n)
{ register int r;
register int retries = 100; /* max 100 retries with non-blocking sockets */
+ SOAP_SOCKET sk;
soap->errnum = 0;
#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
if (soap->is)
@@ -878,7 +878,10 @@ frecv(struct soap *soap, char *s, size_t n)
return 0;
}
#endif
- if (soap_valid_socket(soap->socket))
+ sk = soap->recvsk;
+ if (!soap_valid_socket(sk))
+ sk = soap->socket;
+ if (soap_valid_socket(sk))
{ for (;;)
{
#ifdef WITH_OPENSSL
@@ -890,7 +893,7 @@ frecv(struct soap *soap, char *s, size_t n)
if (soap->recv_timeout)
#endif
{ for (;;)
- { r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout);
+ { r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout);
if (r > 0)
break;
if (!r)
@@ -930,7 +933,7 @@ frecv(struct soap *soap, char *s, size_t n)
if ((soap->omode & SOAP_IO_UDP))
{ SOAP_SOCKLEN_T k = (SOAP_SOCKLEN_T)sizeof(soap->peer);
memset((void*)&soap->peer, 0, sizeof(soap->peer));
- r = recvfrom(soap->socket, s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
+ r = recvfrom(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
soap->peerlen = (size_t)k;
#ifndef WITH_IPV6
soap->ip = ntohl(soap->peer.sin_addr.s_addr);
@@ -938,13 +941,13 @@ frecv(struct soap *soap, char *s, size_t n)
}
else
#endif
- r = recv(soap->socket, s, (int)n, soap->socket_flags);
+ r = recv(sk, s, (int)n, soap->socket_flags);
#ifdef PALM
/* CycleSyncDisplay(curStatusMsg); */
#endif
if (r >= 0)
return (size_t)r;
- r = soap_socket_errno(soap->socket);
+ r = soap_socket_errno(sk);
if (r != SOAP_EINTR && r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK)
{ soap->errnum = r;
return 0;
@@ -952,14 +955,14 @@ frecv(struct soap *soap, char *s, size_t n)
}
#if defined(WITH_OPENSSL)
if (soap->ssl && err == SSL_ERROR_WANT_WRITE)
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
else
#elif defined(WITH_GNUTLS)
if (soap->session && gnutls_record_get_direction(soap->session))
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
else
#endif
- r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
if (!r && soap->recv_timeout)
return 0;
if (r < 0)
@@ -970,7 +973,7 @@ frecv(struct soap *soap, char *s, size_t n)
if (retries-- <= 0)
return 0;
#ifdef PALM
- r = soap_socket_errno(soap->socket);
+ r = soap_socket_errno(sk);
if (r != SOAP_EINTR && retries-- <= 0)
{ soap->errnum = r;
return 0;
@@ -1076,10 +1079,9 @@ soap_recv_raw(struct soap *soap)
}
}
else if (r != Z_BUF_ERROR)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate error: %s\n", soap->d_stream->msg?soap->d_stream->msg:SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate error: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
soap->d_stream->next_out = Z_NULL;
- soap->error = SOAP_ZLIB_ERROR;
- return EOF;
+ return soap->error = SOAP_ZLIB_ERROR;
}
}
zlib_again:
@@ -1110,7 +1112,9 @@ zlib_again:
DBGMSG(RECV, soap->buf, ret);
soap->bufidx = 0;
if (!ret)
- return soap->ahead = EOF;
+ { soap->ahead = EOF;
+ return EOF;
+ }
}
else
soap->bufidx = soap->buflen;
@@ -1118,7 +1122,9 @@ zlib_again:
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk size (idx=%u len=%u)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen));
while (!soap_isxdigit((int)(c = soap_getchunkchar(soap))))
{ if ((int)c == EOF)
- return soap->ahead = EOF;
+ { soap->ahead = EOF;
+ return EOF;
+ }
}
do
*t++ = (char)c;
@@ -1126,7 +1132,9 @@ zlib_again:
while ((int)c != EOF && c != '\n')
c = soap_getchunkchar(soap);
if ((int)c == EOF)
- return soap->ahead = EOF;
+ { soap->ahead = EOF;
+ return EOF;
+ }
*t = '\0';
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunk size = %s (hex)\n", tmp));
soap->chunksize = (size_t)soap_strtoul(tmp, &t, 16);
@@ -1194,10 +1202,9 @@ zlib_again:
#endif
}
else
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to inflate: (%d) %s\n", r, soap->d_stream->msg?soap->d_stream->msg:SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to inflate: (%d) %s\n", r, soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
soap->d_stream->next_out = Z_NULL;
- soap->error = SOAP_ZLIB_ERROR;
- return EOF;
+ return soap->error = SOAP_ZLIB_ERROR;
}
}
#endif
@@ -1283,19 +1290,22 @@ soap_recv(struct soap *soap)
}
}
while (soap->ffilterrecv)
- { int err = soap->filterstop;
- if (err)
+ { int err, last = soap->filterstop;
+ if (last)
soap->bufidx = soap->buflen = 0;
- else
- err = soap_recv_raw(soap); /* do not call again after EOF */
- if ((soap->error = soap->ffilterrecv(soap, soap->buf, &soap->buflen, sizeof(soap->buf))))
- return soap->error;
+ if ((err = soap->ffilterrecv(soap, soap->buf, &soap->buflen, sizeof(soap->buf))))
+ return soap->error = err;
if (soap->buflen)
- { soap->filterstop = err;
+ { soap->bufidx = 0;
+ soap->filterstop = last;
return SOAP_OK;
}
- if (err)
- return err;
+ if (last)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Returning postponed error %d\n", last));
+ soap->filterstop = SOAP_OK;
+ return last;
+ }
+ soap->filterstop = soap_recv_raw(soap); /* do not call again after EOF */
}
#endif
return soap_recv_raw(soap);
@@ -1505,7 +1515,7 @@ soap_get(struct soap *soap)
{ c = soap_get0(soap);
if (c == '>')
{ soap->cdata = 0;
- soap_get1(soap);
+ c = soap_get1(soap);
c = soap_get1(soap);
}
else
@@ -1702,12 +1712,11 @@ SOAP_FMAC2
soap_getutf8(struct soap *soap)
{ register soap_wchar c, c1, c2, c3, c4;
c = soap->ahead;
- if (c > 0x7F)
- { soap->ahead = 0;
- return c;
- }
- c = soap_get(soap);
- if (c < 0x80 || (soap->mode & SOAP_ENC_LATIN))
+ if (c)
+ soap->ahead = 0;
+ else
+ c = soap_get(soap);
+ if (c < 0x80 || c > 0xFF || (soap->mode & SOAP_ENC_LATIN))
return c;
c1 = soap_get1(soap);
if (c1 < 0x80)
@@ -1896,7 +1905,7 @@ SOAP_FMAC1
unsigned char*
SOAP_FMAC2
soap_getbase64(struct soap *soap, int *n, int malloc_flag)
-{
+{ (void)malloc_flag;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
{ soap->dom->data = soap_string_in(soap, 0, -1, -1);
@@ -1921,6 +1930,8 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
register int j = 0;
do
{ register soap_wchar c = soap_get(soap);
+ if (c < SOAP_AP)
+ c &= 0x7FFFFFFF;
if (c == '=' || c < 0)
{ unsigned char *p;
switch (j)
@@ -2037,14 +2048,13 @@ SOAP_FMAC2
soap_xop_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options)
{ /* Check MTOM xop:Include element (within hex/base64Binary) */
/* TODO: this code to be obsoleted with new import/xop.h conventions */
- int body = soap->body; /* should save type too? */
+ short body = soap->body; /* should save type too? */
if (!soap_peek_element(soap))
{ if (!soap_element_begin_in(soap, "xop:Include", 0, NULL))
- { if (soap_dime_forward(soap, ptr, size, id, type, options))
+ { if (soap_dime_forward(soap, ptr, size, id, type, options)
+ || (soap->body && soap_element_end_in(soap, "xop:Include")))
return soap->error;
}
- if (soap->body && soap_element_end_in(soap, NULL))
- return soap->error;
}
soap->body = body;
return SOAP_OK;
@@ -2176,11 +2186,14 @@ soap_pop_block(struct soap *soap, struct soap_blist *b)
#endif
/******************************************************************************/
-#ifndef WITH_NOIDREF
#ifndef PALM_1
-static void
-soap_update_ptrs(struct soap *soap, char *start, char *end, char *p1, char *p2)
-{ int i;
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_update_pointers(struct soap *soap, char *start, char *end, char *p1, char *p2)
+{
+#ifndef WITH_NOIDREF
+ int i;
register struct soap_ilist *ip = NULL;
register struct soap_flist *fp = NULL;
#ifndef WITH_LEANER
@@ -2218,7 +2231,7 @@ soap_update_ptrs(struct soap *soap, char *start, char *end, char *p1, char *p2)
#ifndef WITH_LEANER
for (xp = soap->xlist; xp; xp = xp->next)
{ if (xp->ptr && (char*)xp->ptr >= start && (char*)xp->ptr < end)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update id='%s' %p -> %p\n", xp->id?xp->id:SOAP_STR_EOS, xp->ptr, (char*)xp->ptr + (p1-p2)));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update id='%s' %p -> %p\n", xp->id ? xp->id : SOAP_STR_EOS, xp->ptr, (char*)xp->ptr + (p1-p2)));
xp->ptr = (unsigned char**)((char*)xp->ptr + (p1-p2));
xp->size = (int*)((char*)xp->size + (p1-p2));
xp->type = (char**)((char*)xp->type + (p1-p2));
@@ -2226,8 +2239,10 @@ soap_update_ptrs(struct soap *soap, char *start, char *end, char *p1, char *p2)
}
}
#endif
-}
+#else
+ (void)soap; (void)start; (void)end; (void)p1; (void)p2;
#endif
+}
#endif
/******************************************************************************/
@@ -2469,11 +2484,11 @@ soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
if (p)
{ for (s = p, q = soap_first_block(soap, b); q; q = soap_next_block(soap, b))
{ n = soap_block_size(soap, b);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, q, s));
#ifndef WITH_NOIDREF
if (flag)
- soap_update_ptrs(soap, q, q + n, s, q);
+ soap_update_pointers(soap, q, q + n, s, q);
#endif
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, q, s));
memcpy(s, q, n);
s += n;
}
@@ -2701,12 +2716,7 @@ soap_push_namespace(struct soap *soap, const char *id, const char *ns)
if (p)
{ for (i = 0; p->id; p++, i++)
{ if (p->ns && !strcmp(ns, p->ns))
- { if (p->out)
- { SOAP_FREE(soap, p->out);
- p->out = NULL;
- }
break;
- }
if (p->out)
{ if (!strcmp(ns, p->out))
break;
@@ -2733,10 +2743,10 @@ soap_push_namespace(struct soap *soap, const char *id, const char *ns)
soap->nlist = np;
np->level = soap->level;
np->index = i;
- strcpy(np->id, id);
+ strcpy((char*)np->id, id);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u) '%s' '%s'\n", soap->level, id, ns));
if (i < 0)
- { np->ns = strcpy(np->id + n + 1, ns);
+ { np->ns = strcpy((char*)np->id + n + 1, ns);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push NOT OK: no match found for '%s' in namespace mapping table (added to stack anyway)\n", ns));
}
else
@@ -3067,6 +3077,7 @@ soap_ssl_init()
#ifdef WITH_OPENSSL
SSL_library_init();
OpenSSL_add_all_algorithms(); /* 2.8.1 change (wsseapi.c) */
+ OpenSSL_add_all_digests();
#ifndef WITH_LEAN
SSL_load_error_strings();
#endif
@@ -3122,7 +3133,11 @@ soap_ssl_error(struct soap *soap, int ret)
strcpy(soap->msgbuf, "EOF was observed that violates the protocol. The client probably provided invalid authentication information.");
break;
case -1:
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Error observed by underlying BIO: %s", strerror(errno));
+#else
sprintf(soap->msgbuf, "Error observed by underlying BIO: %s", strerror(errno));
+#endif
break;
}
}
@@ -3333,12 +3348,22 @@ ssl_verify_callback(int ok, X509_STORE_CTX *store)
#ifdef SOAP_DEBUG
if (!ok)
{ char buf[1024];
+ int err = X509_STORE_CTX_get_error(store);
X509 *cert = X509_STORE_CTX_get_current_cert(store);
- fprintf(stderr, "SSL verify error or warning with certificate at depth %d: %s\n", X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(X509_STORE_CTX_get_error(store)));
+ fprintf(stderr, "SSL verify error or warning with certificate at depth %d: %s\n", X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(err));
X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf));
fprintf(stderr, "certificate issuer %s\n", buf);
X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf));
fprintf(stderr, "certificate subject %s\n", buf);
+ /* accept self signed certificates and certificates out of date */
+ switch (err)
+ { case X509_V_ERR_CERT_NOT_YET_VALID:
+ case X509_V_ERR_CERT_HAS_EXPIRED:
+ case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
+ case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+ X509_STORE_CTX_set_error(store, X509_V_OK);
+ ok = 1;
+ }
}
#endif
/* Note: return 1 to continue, but unsafe progress will be terminated by OpenSSL */
@@ -3353,13 +3378,16 @@ ssl_verify_callback(int ok, X509_STORE_CTX *store)
static int
ssl_verify_callback_allow_expired_certificate(int ok, X509_STORE_CTX *store)
{ ok = ssl_verify_callback(ok, store);
- if (ok == 0 && X509_STORE_CTX_get_error(store) == X509_V_ERR_CERT_HAS_EXPIRED)
- {
-#ifdef SOAP_DEBUG
- fprintf(stderr, "ignoring certificate expiration\n");
-#endif
- X509_STORE_CTX_set_error(store, X509_V_OK);
- ok = 1;
+ if (!ok)
+ { /* accept self signed certificates and certificates out of date */
+ switch (X509_STORE_CTX_get_error(store))
+ { case X509_V_ERR_CERT_NOT_YET_VALID:
+ case X509_V_ERR_CERT_HAS_EXPIRED:
+ case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
+ case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+ X509_STORE_CTX_set_error(store, X509_V_OK);
+ ok = 1;
+ }
}
/* Note: return 1 to continue, but unsafe progress will be terminated by SSL */
return ok;
@@ -3414,11 +3442,11 @@ SOAP_FMAC1
int
SOAP_FMAC2
soap_ssl_accept(struct soap *soap)
-{ SOAP_SOCKET fd = soap->socket;
+{ SOAP_SOCKET sk = soap->socket;
#ifdef WITH_OPENSSL
BIO *bio;
int retries, r, s;
- if (!soap_valid_socket(fd))
+ if (!soap_valid_socket(sk))
return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR);
soap->ssl_flags &= ~SOAP_SSL_CLIENT;
if (!soap->ctx && (soap->error = soap->fsslauth(soap)))
@@ -3430,12 +3458,12 @@ soap_ssl_accept(struct soap *soap)
}
else
SSL_clear(soap->ssl);
- bio = BIO_new_socket((int)fd, BIO_NOCLOSE);
+ bio = BIO_new_socket((int)sk, BIO_NOCLOSE);
SSL_set_bio(soap->ssl, bio, bio);
/* Set SSL sockets to non-blocking */
retries = 0;
if (soap->accept_timeout)
- { SOAP_SOCKNONBLOCK(fd)
+ { SOAP_SOCKNONBLOCK(sk)
retries = 10*soap->accept_timeout;
}
if (retries <= 0)
@@ -3447,14 +3475,14 @@ soap_ssl_accept(struct soap *soap)
err = SSL_get_error(soap->ssl, r);
if (err == SSL_ERROR_WANT_ACCEPT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
{ if (err == SSL_ERROR_WANT_READ)
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
else
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
if (s < 0 && soap->errnum != SOAP_EINTR)
break;
}
else
- { soap->errnum = soap_socket_errno(fd);
+ { soap->errnum = soap_socket_errno(sk);
break;
}
}
@@ -3480,17 +3508,17 @@ soap_ssl_accept(struct soap *soap)
#endif
#ifdef WITH_GNUTLS
int retries = 0, r;
- if (!soap_valid_socket(fd))
+ if (!soap_valid_socket(sk))
return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR);
soap->ssl_flags &= ~SOAP_SSL_CLIENT;
if (!soap->session && (soap->error = soap->fsslauth(soap)))
{ soap_closesock(soap);
return soap->error;
}
- gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)fd);
+ gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)sk);
/* Set SSL sockets to non-blocking */
if (soap->accept_timeout)
- { SOAP_SOCKNONBLOCK(fd)
+ { SOAP_SOCKNONBLOCK(sk)
retries = 10*soap->accept_timeout;
}
if (retries <= 0)
@@ -3502,14 +3530,14 @@ soap_ssl_accept(struct soap *soap)
break;
if (r == GNUTLS_E_AGAIN || r == GNUTLS_E_INTERRUPTED)
{ if (!gnutls_record_get_direction(soap->session))
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
else
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
if (s < 0 && soap->errnum != SOAP_EINTR)
break;
}
else
- { soap->errnum = soap_socket_errno(fd);
+ { soap->errnum = soap_socket_errno(sk);
break;
}
}
@@ -3526,9 +3554,9 @@ soap_ssl_accept(struct soap *soap)
}
#endif
if (soap->recv_timeout || soap->send_timeout)
- SOAP_SOCKNONBLOCK(fd)
+ SOAP_SOCKNONBLOCK(sk)
else
- SOAP_SOCKBLOCK(fd)
+ SOAP_SOCKBLOCK(sk)
soap->imode |= SOAP_ENC_SSL;
soap->omode |= SOAP_ENC_SSL;
return SOAP_OK;
@@ -3672,7 +3700,7 @@ tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port)
#ifdef WITH_IPV6
struct addrinfo hints, *res, *ressave;
#endif
- SOAP_SOCKET fd;
+ SOAP_SOCKET sk;
int err = 0;
#ifndef WITH_LEAN
#ifndef WIN32
@@ -3714,7 +3742,7 @@ tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port)
}
ressave = res;
again:
- fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ sk = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
soap->errmode = 0;
#else
#ifndef WITH_LEAN
@@ -3722,12 +3750,12 @@ again:
#endif
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
- fd = socket(AF_INET, SOCK_DGRAM, 0);
+ sk = socket(AF_INET, SOCK_DGRAM, 0);
else
#endif
- fd = socket(AF_INET, SOCK_STREAM, 0);
+ sk = socket(AF_INET, SOCK_STREAM, 0);
#endif
- if (!soap_valid_socket(fd))
+ if (!soap_valid_socket(sk))
{
#ifdef WITH_IPV6
if (res->ai_next)
@@ -3735,7 +3763,7 @@ again:
goto again;
}
#endif
- soap->errnum = soap_socket_errno(fd);
+ soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "socket failed in tcp_connect()", SOAP_TCP_ERROR);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -3745,10 +3773,10 @@ again:
#ifdef SOCKET_CLOSE_ON_EXEC
#ifdef WIN32
#ifndef UNDER_CE
- SetHandleInformation((HANDLE)fd, HANDLE_FLAG_INHERIT, 0);
+ SetHandleInformation((HANDLE)sk, HANDLE_FLAG_INHERIT, 0);
#endif
#else
- fcntl(fd, F_SETFD, 1);
+ fcntl(sk, F_SETFD, 1);
#endif
#endif
#ifndef WITH_LEAN
@@ -3757,57 +3785,57 @@ again:
memset((void*)&linger, 0, sizeof(linger));
linger.l_onoff = 1;
linger.l_linger = soap->linger_time;
- if (setsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
- { soap->errnum = soap_socket_errno(fd);
+ if (setsockopt(sk, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
}
- else if (soap->connect_flags && setsockopt(fd, SOL_SOCKET, soap->connect_flags, (char*)&set, sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ else if (soap->connect_flags && setsockopt(sk, SOL_SOCKET, soap->connect_flags, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
- if ((soap->keep_alive || soap->tcp_keep_alive) && setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if ((soap->keep_alive || soap->tcp_keep_alive) && setsockopt(sk, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if (setsockopt(sk, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
#ifdef TCP_KEEPIDLE
- if (soap->tcp_keep_idle && setsockopt((SOAP_SOCKET)fd, IPPROTO_TCP, TCP_KEEPIDLE, (char*)&(soap->tcp_keep_idle), sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if (soap->tcp_keep_idle && setsockopt((SOAP_SOCKET)sk, IPPROTO_TCP, TCP_KEEPIDLE, (char*)&(soap->tcp_keep_idle), sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_KEEPIDLE failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, (SOAP_SOCKET)fd);
+ soap->fclosesocket(soap, (SOAP_SOCKET)sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3815,10 +3843,10 @@ again:
}
#endif
#ifdef TCP_KEEPINTVL
- if (soap->tcp_keep_intvl && setsockopt((SOAP_SOCKET)fd, IPPROTO_TCP, TCP_KEEPINTVL, (char*)&(soap->tcp_keep_intvl), sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if (soap->tcp_keep_intvl && setsockopt((SOAP_SOCKET)sk, IPPROTO_TCP, TCP_KEEPINTVL, (char*)&(soap->tcp_keep_intvl), sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_KEEPINTVL failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, (SOAP_SOCKET)fd);
+ soap->fclosesocket(soap, (SOAP_SOCKET)sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3826,10 +3854,10 @@ again:
}
#endif
#ifdef TCP_KEEPCNT
- if (soap->tcp_keep_cnt && setsockopt((SOAP_SOCKET)fd, IPPROTO_TCP, TCP_KEEPCNT, (char*)&(soap->tcp_keep_cnt), sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if (soap->tcp_keep_cnt && setsockopt((SOAP_SOCKET)sk, IPPROTO_TCP, TCP_KEEPCNT, (char*)&(soap->tcp_keep_cnt), sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_KEEPCNT failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, (SOAP_SOCKET)fd);
+ soap->fclosesocket(soap, (SOAP_SOCKET)sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3837,10 +3865,10 @@ again:
}
#endif
#ifdef TCP_NODELAY
- if (!(soap->omode & SOAP_IO_UDP) && setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
- { soap->errnum = soap_socket_errno(fd);
+ if (!(soap->omode & SOAP_IO_UDP) && setsockopt(sk, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3857,29 +3885,29 @@ again:
if ((soap->omode & SOAP_IO_UDP))
{ if (soap->ipv4_multicast_ttl)
{ unsigned char ttl = soap->ipv4_multicast_ttl;
- if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl)))
- { soap->errnum = soap_socket_errno(fd);
+ if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
}
if ((soap->omode & SOAP_IO_UDP) && soap->ipv4_multicast_if && !soap->ipv6_multicast_if)
- { if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr)))
+ { if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr)))
#ifndef WINDOWS
- { soap->errnum = soap_socket_errno(fd);
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
#else
#ifndef IP_MULTICAST_IF
#define IP_MULTICAST_IF 2
#endif
- if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr)))
- { soap->errnum = soap_socket_errno(fd);
+ if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr)))
+ { soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
#endif
@@ -3887,7 +3915,7 @@ again:
}
#endif
#endif
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Opening socket %d to host='%s' port=%d\n", fd, host, port));
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Opening socket %d to host='%s' port=%d\n", sk, host, port));
#ifndef WITH_IPV6
soap->peerlen = sizeof(soap->peer);
memset((void*)&soap->peer, 0, sizeof(soap->peer));
@@ -3896,7 +3924,7 @@ again:
if (soap->proxy_host)
{ if (soap->fresolve(soap, soap->proxy_host, &soap->peer.sin_addr))
{ soap_set_sender_error(soap, tcp_error(soap), "get proxy host by name failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
soap->peer.sin_port = htons((short)soap->proxy_port);
@@ -3904,7 +3932,7 @@ again:
else
{ if (soap->fresolve(soap, host, &soap->peer.sin_addr))
{ soap_set_sender_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
soap->peer.sin_port = htons((short)port);
@@ -3912,34 +3940,34 @@ again:
soap->errmode = 0;
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
- return fd;
+ return sk;
#endif
#else
if ((soap->omode & SOAP_IO_UDP))
{ memcpy(&soap->peer, res->ai_addr, res->ai_addrlen);
soap->peerlen = res->ai_addrlen;
freeaddrinfo(ressave);
- return fd;
+ return sk;
}
#endif
#ifndef WITH_LEAN
if (soap->connect_timeout)
- SOAP_SOCKNONBLOCK(fd)
+ SOAP_SOCKNONBLOCK(sk)
else
- SOAP_SOCKBLOCK(fd)
+ SOAP_SOCKBLOCK(sk)
retries = 10;
#endif
for (;;)
{
#ifdef WITH_IPV6
- if (connect(fd, res->ai_addr, (int)res->ai_addrlen))
+ if (connect(sk, res->ai_addr, (int)res->ai_addrlen))
#else
- if (connect(fd, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
+ if (connect(sk, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
#endif
- { err = soap_socket_errno(fd);
+ { err = soap_socket_errno(sk);
#ifndef WITH_LEAN
if (err == SOAP_EADDRINUSE)
- { soap->fclosesocket(soap, fd);
+ { soap->fclosesocket(soap, sk);
if (retries-- > 0)
goto again;
}
@@ -3948,13 +3976,13 @@ again:
SOAP_SOCKLEN_T k;
for (;;)
{ register int r;
- r = tcp_select(soap, fd, SOAP_TCP_SELECT_SND, soap->connect_timeout);
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND, soap->connect_timeout);
if (r > 0)
break;
if (!r)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect timeout\n"));
soap_set_sender_error(soap, "Timeout", "connect failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3964,7 +3992,7 @@ again:
if (r != SOAP_EINTR)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
soap_set_sender_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3972,13 +4000,13 @@ again:
}
}
k = (SOAP_SOCKLEN_T)sizeof(soap->errnum);
- if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &k) && !soap->errnum) /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
+ if (!getsockopt(sk, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &k) && !soap->errnum) /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
break;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
if (!soap->errnum)
- soap->errnum = soap_socket_errno(fd);
+ soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -3988,7 +4016,7 @@ again:
#ifdef WITH_IPV6
if (res->ai_next)
{ res = res->ai_next;
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
goto again;
}
#endif
@@ -3996,7 +4024,7 @@ again:
{ soap->errnum = err;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
soap_set_sender_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
@@ -4010,7 +4038,7 @@ again:
soap->peerlen = 0; /* IPv6: already connected so use send() */
freeaddrinfo(ressave);
#endif
- soap->socket = fd;
+ soap->socket = sk;
soap->imode &= ~SOAP_ENC_SSL;
soap->omode &= ~SOAP_ENC_SSL;
if (!soap_tag_cmp(endpoint, "https:*"))
@@ -4025,46 +4053,45 @@ again:
soap_mode om = soap->omode; /* make sure we only parse HTTP */
size_t n = soap->count; /* save the content length */
const char *userid, *passwd;
+ int status = soap->status; /* save the current status/command */
+ short keep_alive = soap->keep_alive; /* save the KA status */
soap->omode &= ~SOAP_ENC; /* mask IO and ENC */
soap->omode |= SOAP_IO_BUFFER;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connecting to %s proxy server\n", soap->proxy_http_version));
- sprintf(soap->tmpbuf, "CONNECT %s:%d HTTP/%s", host, port, soap->proxy_http_version);
- if (soap_begin_send(soap)
- || (soap->error = soap->fposthdr(soap, soap->tmpbuf, NULL)))
- { soap->fclosesocket(soap, fd);
- return SOAP_INVALID_SOCKET;
- }
-#ifndef WITH_LEAN
- if (soap->proxy_userid && soap->proxy_passwd && strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) < 761)
- { sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
- strcpy(soap->tmpbuf, "Basic ");
- soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
- if ((soap->error = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
- { soap->fclosesocket(soap, fd);
+#ifdef WITH_NTLM
+ if (soap->ntlm_challenge)
+ { if (soap_ntlm_handshake(soap, SOAP_CONNECT, endpoint, host, port))
return soap->error;
- }
}
#endif
- if ((soap->error = soap->fposthdr(soap, NULL, NULL))
- || soap_flush(soap))
- { soap->fclosesocket(soap, fd);
+ if (soap_begin_send(soap))
+ { soap->fclosesocket(soap, sk);
+ return SOAP_INVALID_SOCKET;
+ }
+ soap->status = SOAP_CONNECT;
+ soap->keep_alive = 1;
+ if ((soap->error = soap->fpost(soap, endpoint, host, port, NULL, NULL, 0))
+ || soap_end_send(soap))
+ { soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
+ soap->keep_alive = keep_alive;
soap->omode = om;
om = soap->imode;
soap->imode &= ~SOAP_ENC; /* mask IO and ENC */
userid = soap->userid; /* preserve */
passwd = soap->passwd; /* preserve */
if ((soap->error = soap->fparse(soap)))
- { soap->fclosesocket(soap, fd);
+ { soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
+ soap->status = status; /* restore */
soap->userid = userid; /* restore */
soap->passwd = passwd; /* restore */
soap->imode = om; /* restore */
soap->count = n; /* restore */
if (soap_begin_send(soap))
- { soap->fclosesocket(soap, fd);
+ { soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
if (endpoint)
@@ -4074,13 +4101,15 @@ again:
#ifdef WITH_OPENSSL
soap->ssl_flags |= SOAP_SSL_CLIENT;
if (!soap->ctx && (soap->error = soap->fsslauth(soap)))
- { soap->fclosesocket(soap, fd);
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n"));
+ soap->fclosesocket(soap, sk);
+ soap->error = SOAP_SSL_ERROR;
return SOAP_INVALID_SOCKET;
}
if (!soap->ssl)
{ soap->ssl = SSL_new(soap->ctx);
if (!soap->ssl)
- { soap->fclosesocket(soap, fd);
+ { soap->fclosesocket(soap, sk);
soap->error = SOAP_SSL_ERROR;
return SOAP_INVALID_SOCKET;
}
@@ -4095,16 +4124,16 @@ again:
}
soap->imode |= SOAP_ENC_SSL;
soap->omode |= SOAP_ENC_SSL;
- bio = BIO_new_socket((int)fd, BIO_NOCLOSE);
+ bio = BIO_new_socket((int)sk, BIO_NOCLOSE);
SSL_set_bio(soap->ssl, bio, bio);
/* Connect timeout: set SSL sockets to non-blocking */
retries = 0;
if (soap->connect_timeout)
- { SOAP_SOCKNONBLOCK(fd)
+ { SOAP_SOCKNONBLOCK(sk)
retries = 10*soap->connect_timeout;
}
else
- SOAP_SOCKBLOCK(fd)
+ SOAP_SOCKBLOCK(sk)
if (retries <= 0)
retries = 100; /* timeout: 10 sec retries, 100 times 0.1 sec */
/* Try connecting until success or timeout (when nonblocking) */
@@ -4114,37 +4143,37 @@ again:
if (err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
{ register int s;
if (err == SSL_ERROR_WANT_READ)
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
else
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
if (s < 0 && soap->errnum != SOAP_EINTR)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL_connect/select error in tcp_connect\n"));
soap_set_sender_error(soap, soap_ssl_error(soap, r), "SSL_connect failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
if (s == 0 && retries-- <= 0)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n"));
soap_set_sender_error(soap, "Timeout", "SSL_connect failed in tcp_connect()", SOAP_TCP_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
}
else
{ soap_set_sender_error(soap, soap_ssl_error(soap, r), "SSL_connect error in tcp_connect()", SOAP_SSL_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
}
} while (!SSL_is_init_finished(soap->ssl));
/* Set SSL sockets to nonblocking */
- SOAP_SOCKNONBLOCK(fd)
+ SOAP_SOCKNONBLOCK(sk)
/* Check server credentials when required */
if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION))
{ int err;
if ((err = SSL_get_verify_result(soap->ssl)) != X509_V_OK)
{ soap_set_sender_error(soap, X509_verify_cert_error_string(err), "SSL/TLS certificate presented by peer cannot be verified in tcp_connect()", SOAP_SSL_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
if (!(soap->ssl_flags & SOAP_SSL_SKIP_HOST_CHECK))
@@ -4155,7 +4184,7 @@ again:
peer = SSL_get_peer_certificate(soap->ssl);
if (!peer)
{ soap_set_sender_error(soap, "SSL/TLS error", "No SSL/TLS certificate was presented by the peer in tcp_connect()", SOAP_SSL_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
ext_count = X509_get_ext_count(peer);
@@ -4249,7 +4278,7 @@ again:
X509_free(peer);
if (!ok)
{ soap_set_sender_error(soap, "SSL/TLS error", "SSL/TLS certificate host name mismatch in tcp_connect()", SOAP_SSL_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
}
@@ -4258,17 +4287,17 @@ again:
#ifdef WITH_GNUTLS
soap->ssl_flags |= SOAP_SSL_CLIENT;
if (!soap->session && (soap->error = soap->fsslauth(soap)))
- { soap->fclosesocket(soap, fd);
+ { soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
- gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)fd);
+ gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)sk);
/* Set SSL sockets to non-blocking */
if (soap->connect_timeout)
- { SOAP_SOCKNONBLOCK(fd)
+ { SOAP_SOCKNONBLOCK(sk)
retries = 10*soap->connect_timeout;
}
else
- SOAP_SOCKBLOCK(fd)
+ SOAP_SOCKBLOCK(sk)
if (retries <= 0)
retries = 100; /* timeout: 10 sec retries, 100 times 0.1 sec */
while ((r = gnutls_handshake(soap->session)))
@@ -4278,42 +4307,42 @@ again:
break;
if (r == GNUTLS_E_AGAIN || r == GNUTLS_E_INTERRUPTED)
{ if (!gnutls_record_get_direction(soap->session))
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
else
- s = tcp_select(soap, fd, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
if (s < 0 && soap->errnum != SOAP_EINTR)
break;
}
else
- { soap->errnum = soap_socket_errno(fd);
+ { soap->errnum = soap_socket_errno(sk);
break;
}
}
if (r)
{ soap_set_sender_error(soap, soap_ssl_error(soap, r), "SSL/TLS handshake failed", SOAP_SSL_ERROR);
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION))
{ const char *err = ssl_verify(soap, host);
if (err)
- { soap->fclosesocket(soap, fd);
+ { soap->fclosesocket(soap, sk);
soap->error = soap_set_sender_error(soap, "SSL/TLS error", err, SOAP_SSL_ERROR);
return SOAP_INVALID_SOCKET;
}
}
#endif
#else
- soap->fclosesocket(soap, fd);
+ soap->fclosesocket(soap, sk);
soap->error = SOAP_SSL_ERROR;
return SOAP_INVALID_SOCKET;
#endif
}
if (soap->recv_timeout || soap->send_timeout)
- SOAP_SOCKNONBLOCK(fd)
+ SOAP_SOCKNONBLOCK(sk)
else
- SOAP_SOCKBLOCK(fd)
- return fd;
+ SOAP_SOCKBLOCK(sk)
+ return sk;
}
#endif
#endif
@@ -4322,7 +4351,7 @@ again:
#ifndef WITH_NOIO
#ifndef PALM_1
static int
-tcp_select(struct soap *soap, SOAP_SOCKET s, int flags, int timeout)
+tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout)
{ register int r;
struct timeval tv;
fd_set fd[3], *rfd, *sfd, *efd;
@@ -4333,12 +4362,12 @@ tcp_select(struct soap *soap, SOAP_SOCKET s, int flags, int timeout)
if (1)
#else
/* if fd max set size exceeded, use poll() */
- if ((int)s >= (int)FD_SETSIZE)
+ if ((int)sk >= (int)FD_SETSIZE)
#endif
#ifdef HAVE_POLL
{ struct pollfd pollfd;
int retries = 0;
- pollfd.fd = (int)s;
+ pollfd.fd = (int)sk;
pollfd.events = 0;
if (flags & SOAP_TCP_SELECT_RCV)
pollfd.events |= POLLIN;
@@ -4379,17 +4408,17 @@ tcp_select(struct soap *soap, SOAP_SOCKET s, int flags, int timeout)
if (flags & SOAP_TCP_SELECT_RCV)
{ rfd = &fd[0];
FD_ZERO(rfd);
- FD_SET(s, rfd);
+ FD_SET(sk, rfd);
}
if (flags & SOAP_TCP_SELECT_SND)
{ sfd = &fd[1];
FD_ZERO(sfd);
- FD_SET(s, sfd);
+ FD_SET(sk, sfd);
}
if (flags & SOAP_TCP_SELECT_ERR)
{ efd = &fd[2];
FD_ZERO(efd);
- FD_SET(s, efd);
+ FD_SET(sk, efd);
}
if (timeout >= 0)
{ tv.tv_sec = timeout;
@@ -4399,14 +4428,14 @@ tcp_select(struct soap *soap, SOAP_SOCKET s, int flags, int timeout)
{ tv.tv_sec = -timeout / 1000000;
tv.tv_usec = -timeout % 1000000;
}
- r = select((int)s + 1, rfd, sfd, efd, &tv);
+ r = select((int)sk + 1, rfd, sfd, efd, &tv);
if (r > 0)
{ r = 0;
- if ((flags & SOAP_TCP_SELECT_RCV) && FD_ISSET(s, rfd))
+ if ((flags & SOAP_TCP_SELECT_RCV) && FD_ISSET(sk, rfd))
r |= SOAP_TCP_SELECT_RCV;
- if ((flags & SOAP_TCP_SELECT_SND) && FD_ISSET(s, sfd))
+ if ((flags & SOAP_TCP_SELECT_SND) && FD_ISSET(sk, sfd))
r |= SOAP_TCP_SELECT_SND;
- if ((flags & SOAP_TCP_SELECT_ERR) && FD_ISSET(s, efd))
+ if ((flags & SOAP_TCP_SELECT_ERR) && FD_ISSET(sk, efd))
r |= SOAP_TCP_SELECT_ERR;
}
else if (r < 0)
@@ -4421,18 +4450,19 @@ tcp_select(struct soap *soap, SOAP_SOCKET s, int flags, int timeout)
#ifndef PALM_1
static SOAP_SOCKET
tcp_accept(struct soap *soap, SOAP_SOCKET s, struct sockaddr *a, int *n)
-{ SOAP_SOCKET fd;
- fd = accept(s, a, (SOAP_SOCKLEN_T*)n); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
+{ SOAP_SOCKET sk;
+ (void)soap;
+ sk = accept(s, a, (SOAP_SOCKLEN_T*)n); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
#ifdef SOCKET_CLOSE_ON_EXEC
#ifdef WIN32
#ifndef UNDER_CE
- SetHandleInformation((HANDLE)fd, HANDLE_FLAG_INHERIT, 0);
+ SetHandleInformation((HANDLE)sk, HANDLE_FLAG_INHERIT, 0);
#endif
#else
- fcntl(fd, F_SETFD, FD_CLOEXEC);
+ fcntl(sk, F_SETFD, FD_CLOEXEC);
#endif
#endif
- return fd;
+ return sk;
}
#endif
#endif
@@ -4533,9 +4563,10 @@ tcp_disconnect(struct soap *soap)
#ifndef WITH_NOIO
#ifndef PALM_1
static int
-tcp_closesocket(struct soap *soap, SOAP_SOCKET fd)
-{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Close socket %d\n", (int)fd));
- return soap_closesocket(fd);
+tcp_closesocket(struct soap *soap, SOAP_SOCKET sk)
+{ (void)soap;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Close socket %d\n", (int)sk));
+ return soap_closesocket(sk);
}
#endif
#endif
@@ -4544,9 +4575,10 @@ tcp_closesocket(struct soap *soap, SOAP_SOCKET fd)
#ifndef WITH_NOIO
#ifndef PALM_1
static int
-tcp_shutdownsocket(struct soap *soap, SOAP_SOCKET fd, int how)
-{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown socket %d how=%d\n", (int)fd, how));
- return shutdown(fd, how);
+tcp_shutdownsocket(struct soap *soap, SOAP_SOCKET sk, int how)
+{ (void)soap;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown socket %d how=%d\n", (int)sk, how));
+ return shutdown(sk, how);
}
#endif
#endif
@@ -4569,7 +4601,7 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
#endif
#endif
#ifndef WITH_LEAN
-#ifndef WITH_WIN32
+#ifndef WIN32
int len = SOAP_BUFLEN;
#else
int len = SOAP_BUFLEN + 1; /* speeds up windows xfer */
@@ -4623,6 +4655,7 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
soap_set_receiver_error(soap, tcp_error(soap), "socket failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
+ soap->port = port;
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
soap->socket = soap->master;
@@ -4642,7 +4675,7 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
- if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
+ if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && (!((soap->imode | soap->omode) & SOAP_IO_UDP)) && setsockopt(soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
@@ -4669,14 +4702,14 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
#ifdef WITH_IPV6_V6ONLY
if (setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt set IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
#endif
#ifdef WITH_NO_IPV6_V6ONLY
if (setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&unset, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt unset IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
#endif
@@ -4784,8 +4817,9 @@ SOAP_SOCKET
SOAP_FMAC2
soap_accept(struct soap *soap)
{ int n = (int)sizeof(soap->peer);
+ register int err;
#ifndef WITH_LEAN
-#ifndef WITH_WIN32
+#ifndef WIN32
int len = SOAP_BUFLEN;
#else
int len = SOAP_BUFLEN + 1; /* speeds up windows xfer */
@@ -4793,124 +4827,123 @@ soap_accept(struct soap *soap)
int set = 1;
#endif
soap->error = SOAP_OK;
-#ifndef WITH_LEAN
- if ((soap->omode & SOAP_IO_UDP))
- return soap->socket = soap->master;
-#endif
memset((void*)&soap->peer, 0, sizeof(soap->peer));
soap->socket = SOAP_INVALID_SOCKET;
soap->errmode = 0;
soap->keep_alive = 0;
- if (soap_valid_socket(soap->master))
- { register int err;
- for (;;)
- { if (soap->accept_timeout || soap->send_timeout || soap->recv_timeout)
- { for (;;)
- { register int r;
- r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_ALL, soap->accept_timeout ? soap->accept_timeout : 60);
- if (r > 0)
- break;
- if (!r && soap->accept_timeout)
- { soap_set_receiver_error(soap, "Timeout", "accept failed in soap_accept()", SOAP_TCP_ERROR);
+ if (!soap_valid_socket(soap->master))
+ { soap->errnum = 0;
+ soap_set_receiver_error(soap, tcp_error(soap), "no master socket in soap_accept()", SOAP_TCP_ERROR);
+ return SOAP_INVALID_SOCKET;
+ }
+#ifndef WITH_LEAN
+ if ((soap->omode & SOAP_IO_UDP))
+ return soap->socket = soap->master;
+#endif
+ for (;;)
+ { if (soap->accept_timeout || soap->send_timeout || soap->recv_timeout)
+ { for (;;)
+ { register int r;
+ r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_ALL, soap->accept_timeout ? soap->accept_timeout : 60);
+ if (r > 0)
+ break;
+ if (!r && soap->accept_timeout)
+ { soap_set_receiver_error(soap, "Timeout", "accept failed in soap_accept()", SOAP_TCP_ERROR);
+ return SOAP_INVALID_SOCKET;
+ }
+ if (r < 0)
+ { r = soap->errnum;
+ if (r != SOAP_EINTR)
+ { soap_closesock(soap);
+ soap_set_sender_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
- if (r < 0)
- { r = soap->errnum;
- if (r != SOAP_EINTR)
- { soap_closesock(soap);
- soap_set_sender_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
- return SOAP_INVALID_SOCKET;
- }
- }
}
}
- if (soap->accept_timeout)
- SOAP_SOCKNONBLOCK(soap->master)
- else
- SOAP_SOCKBLOCK(soap->master)
- soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*)&soap->peer, &n);
- soap->peerlen = (size_t)n;
- if (soap_valid_socket(soap->socket))
- {
+ }
+ if (soap->accept_timeout)
+ SOAP_SOCKNONBLOCK(soap->master)
+ else
+ SOAP_SOCKBLOCK(soap->master)
+ soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*)&soap->peer, &n);
+ soap->peerlen = (size_t)n;
+ if (soap_valid_socket(soap->socket))
+ {
#ifdef WITH_IPV6
-/* Use soap->host to store the numeric form of the remote host */
- getnameinfo((struct sockaddr*)&soap->peer, n, soap->host, sizeof(soap->host), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV);
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket %d from %s\n", soap->socket, soap->host));
- soap->ip = 0; /* info stored in soap->peer and soap->host */
- soap->port = 0; /* info stored in soap->peer and soap->host */
+ unsigned int ip1, ip2, ip3, ip4;
+ char port[16];
+ getnameinfo((struct sockaddr*)&soap->peer, n, soap->host, sizeof(soap->host), port, 16, NI_NUMERICHOST | NI_NUMERICSERV);
+ sscanf(soap->host, "%u.%u.%u.%u", &ip1, &ip2, &ip3, &ip4);
+ soap->ip = (unsigned long)ip1 << 24 | (unsigned long)ip2 << 16 | (unsigned long)ip3 << 8 | (unsigned long)ip4;
+ soap->port = soap_strtol(port, NULL, 10);
#else
- soap->ip = ntohl(soap->peer.sin_addr.s_addr);
- soap->port = (int)ntohs(soap->peer.sin_port); /* does not return port number on some systems */
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket %d at port %d from IP %d.%d.%d.%d\n", soap->socket, soap->port, (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF));
+ soap->ip = ntohl(soap->peer.sin_addr.s_addr);
+ sprintf(soap->host, "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
+ soap->port = (int)ntohs(soap->peer.sin_port); /* does not return port number on some systems */
#endif
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket %d at port %d from IP %s\n", soap->socket, soap->port, soap->host));
#ifndef WITH_LEAN
- if (soap->accept_flags == SO_LINGER)
- { struct linger linger;
- memset((void*)&linger, 0, sizeof(linger));
- linger.l_onoff = 1;
- linger.l_linger = soap->linger_time;
- if (setsockopt(soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
- { soap->errnum = soap_socket_errno(soap->socket);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR);
- soap_closesock(soap);
- return SOAP_INVALID_SOCKET;
- }
- }
- else if (soap->accept_flags && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags, (char*)&set, sizeof(int)))
+ if (soap->accept_flags == SO_LINGER)
+ { struct linger linger;
+ memset((void*)&linger, 0, sizeof(linger));
+ linger.l_onoff = 1;
+ linger.l_linger = soap->linger_time;
+ if (setsockopt(soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
{ soap->errnum = soap_socket_errno(soap->socket);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR);
- soap_closesock(soap);
- return SOAP_INVALID_SOCKET;
- }
- if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
- { soap->errnum = soap_socket_errno(soap->socket);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
- soap_closesock(soap);
- return SOAP_INVALID_SOCKET;
- }
- if (setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
- { soap->errnum = soap_socket_errno(soap->socket);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);
- soap_closesock(soap);
- return SOAP_INVALID_SOCKET;
- }
- if (setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
- { soap->errnum = soap_socket_errno(soap->socket);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
return SOAP_INVALID_SOCKET;
}
+ }
+ else if (soap->accept_flags && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno(soap->socket);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_closesock(soap);
+ return SOAP_INVALID_SOCKET;
+ }
+ if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno(soap->socket);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_closesock(soap);
+ return SOAP_INVALID_SOCKET;
+ }
+ if (setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno(soap->socket);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_closesock(soap);
+ return SOAP_INVALID_SOCKET;
+ }
+ if (setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno(soap->socket);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_closesock(soap);
+ return SOAP_INVALID_SOCKET;
+ }
#ifdef TCP_NODELAY
- if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
- { soap->errnum = soap_socket_errno(soap->socket);
- soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR);
- soap_closesock(soap);
- return SOAP_INVALID_SOCKET;
- }
-#endif
-#endif
- soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
- if (soap->send_timeout || soap->recv_timeout)
- SOAP_SOCKNONBLOCK(soap->socket)
- else
- SOAP_SOCKBLOCK(soap->socket)
- return soap->socket;
- }
- err = soap_socket_errno(soap->socket);
- if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));
- soap->errnum = err;
- soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
+ if (setsockopt(soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno(soap->socket);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
return SOAP_INVALID_SOCKET;
}
+#endif
+#endif
+ soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
+ if (soap->send_timeout || soap->recv_timeout)
+ SOAP_SOCKNONBLOCK(soap->socket)
+ else
+ SOAP_SOCKBLOCK(soap->socket)
+ return soap->socket;
+ }
+ err = soap_socket_errno(soap->socket);
+ if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK)
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));
+ soap->errnum = err;
+ soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_closesock(soap);
+ return SOAP_INVALID_SOCKET;
}
}
- else
- { soap->errnum = 0;
- soap_set_receiver_error(soap, tcp_error(soap), "no master socket in soap_accept()", SOAP_TCP_ERROR);
- return SOAP_INVALID_SOCKET;
- }
}
#endif
#endif
@@ -4949,6 +4982,19 @@ soap_closesock(struct soap *soap)
#endif
/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_force_closesock(struct soap *soap)
+{ soap->keep_alive = 0;
+ if (soap_valid_socket(soap->socket))
+ return soap_closesocket(soap->socket);
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
#ifndef WITH_NOIO
#ifndef PALM_2
SOAP_FMAC1
@@ -5004,11 +5050,11 @@ soap_done(struct soap *soap)
soap->fmalloc = NULL;
#ifndef WITH_NOHTTP
soap->fpost = http_post;
- soap->fput = http_put;
soap->fget = http_get;
+ soap->fput = http_405;
soap->fdel = http_405;
- soap->fopt = http_405;
- soap->fhead = http_405;
+ soap->fopt = http_200;
+ soap->fhead = http_200;
soap->fform = NULL;
soap->fposthdr = http_post_header;
soap->fresponse = http_response;
@@ -5106,7 +5152,11 @@ soap_done(struct soap *soap)
}
#endif
#ifdef WITH_C_LOCALE
+# ifdef WIN32
+ _free_locale(soap->c_locale);
+# else
freelocale(soap->c_locale);
+# endif
#endif
#ifdef WITH_ZLIB
if (soap->d_stream)
@@ -5147,16 +5197,24 @@ soap_done(struct soap *soap)
int
http_parse(struct soap *soap)
{ char header[SOAP_HDRLEN], *s;
- unsigned short httpcmd = 0, status = 0;
+ unsigned short httpcmd = 0;
+ int status = 0;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Waiting for HTTP request/response...\n"));
*soap->endpoint = '\0';
soap->length = 0;
- soap->userid = NULL;
- soap->passwd = NULL;
- soap->action = NULL;
- soap->authrealm = NULL;
+#ifdef WITH_NTLM
+ if (!soap->ntlm_challenge)
+#endif
+ { soap->userid = NULL;
+ soap->passwd = NULL;
+ soap->authrealm = NULL;
+ }
+#ifdef WITH_NTLM
+ soap->ntlm_challenge = NULL;
+#endif
soap->proxy_from = NULL;
soap->http_content = NULL;
+ soap->action = NULL;
soap->status = 0;
do
{ if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
@@ -5245,6 +5303,8 @@ http_parse(struct soap *soap)
n = sizeof(soap->endpoint) - 1;
strncpy(soap->path, soap->msgbuf + l, n - m);
soap->path[n - m] = '\0';
+ if (*soap->path && *soap->path != '/')
+ *soap->endpoint = '\0';
strcat(soap->endpoint, soap->path);
DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Target endpoint='%s'\n", soap->endpoint));
if (httpcmd > 1)
@@ -5277,7 +5337,7 @@ http_parse(struct soap *soap)
may not have a body. When content length, content type, or chunking is
used assume there is a message to parse, either XML or HTTP.
*/
- if (soap->length > 0 || (soap->http_content && soap->recv_timeout) || (soap->imode & SOAP_IO) == SOAP_IO_CHUNK)
+ if (soap->length > 0 || (soap->http_content && (!soap->keep_alive || soap->recv_timeout)) || (soap->imode & SOAP_IO) == SOAP_IO_CHUNK)
{ if ((soap->status > 200 && soap->status <= 299)
|| soap->status == 400
|| soap->status == 500)
@@ -5392,8 +5452,14 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
}
}
}
- else if (!soap_tag_cmp(key, "WWW-Authenticate"))
- { soap->authrealm = soap_strdup(soap, soap_get_header_attribute(soap, val + 6, "realm"));
+ else if (!soap_tag_cmp(key, "WWW-Authenticate") || !soap_tag_cmp(key, "Proxy-Authenticate"))
+ {
+#ifdef WITH_NTLM
+ if (!soap_tag_cmp(val, "NTLM*"))
+ soap->ntlm_challenge = soap_strdup(soap, val + 4);
+ else
+#endif
+ soap->authrealm = soap_strdup(soap, soap_get_header_attribute(soap, val + 6, "realm"));
}
else if (!soap_tag_cmp(key, "Expect"))
{ if (!soap_tag_cmp(val, "100-continue"))
@@ -5522,6 +5588,7 @@ soap_decode(char *buf, size_t len, const char *val, const char *sep)
static const char*
http_error(struct soap *soap, int status)
{ register const char *msg = SOAP_STR_EOS;
+ (void)soap;
#ifndef WITH_LEAN
msg = soap_code_str(h_http_error_codes, status);
if (!msg)
@@ -5533,21 +5600,25 @@ http_error(struct soap *soap, int status)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
-http_put(struct soap *soap)
-{ return http_parse(soap);
+http_get(struct soap *soap)
+{ (void)soap;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP GET request\n"));
+ return SOAP_GET_METHOD;
}
#endif
#endif
-/******************************************************************************/
+/******************************************************************************/
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
-http_get(struct soap *soap)
-{ return SOAP_GET_METHOD;
+http_405(struct soap *soap)
+{ return 405;
+ (void)soap;
}
#endif
#endif
@@ -5556,8 +5627,8 @@ http_get(struct soap *soap)
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
-http_405(struct soap *soap)
-{ return 405;
+http_200(struct soap *soap)
+{ return soap_send_empty_response(soap, 200);
}
#endif
#endif
@@ -5569,10 +5640,23 @@ static int
http_post(struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, size_t count)
{ register const char *s;
register int err;
- if (soap->status == SOAP_GET)
- s = "GET";
- else
- s = "POST";
+ switch (soap->status)
+ { case SOAP_GET:
+ s = "GET";
+ break;
+ case SOAP_PUT:
+ s = "PUT";
+ break;
+ case SOAP_DEL:
+ s = "DELETE";
+ break;
+ case SOAP_CONNECT:
+ s = "CONNECT";
+ break;
+ default:
+ s = "POST";
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP %s to %s\n", s, endpoint ? endpoint : "(null)"));
#ifdef PALM
if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && strncmp(endpoint, "httpg:", 6)) && strncmp(endpoint, "_beam:", 6) && strncmp(endpoint, "_local:", 7) && strncmp(endpoint, "_btobex:", 8))
#else
@@ -5580,24 +5664,30 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
#endif
return SOAP_OK;
if (strlen(endpoint) + strlen(soap->http_version) > sizeof(soap->tmpbuf) - 80)
- return soap->error = SOAP_EOM;
- if (soap->proxy_host && soap_tag_cmp(endpoint, "https:*"))
+ return soap->error = SOAP_EOM; /* prevent overrun */
+ if (soap->status == SOAP_CONNECT)
+ sprintf(soap->tmpbuf, "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version);
+ else if (soap->proxy_host && endpoint)
sprintf(soap->tmpbuf, "%s %s HTTP/%s", s, endpoint, soap->http_version);
else
sprintf(soap->tmpbuf, "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version);
if ((err = soap->fposthdr(soap, soap->tmpbuf, NULL)))
return err;
#ifdef WITH_OPENSSL
- if ((soap->ssl && soap->port != 443) || (!soap->ssl && soap->port != 80))
- sprintf(soap->tmpbuf, "%s:%d", host, port);
- else
- strcpy(soap->tmpbuf, host);
+ if ((soap->ssl && port != 443) || (!soap->ssl && port != 80))
#else
if (port != 80)
- sprintf(soap->tmpbuf, "%s:%d", host, port);
+#endif
+ {
+#ifdef WITH_IPV6
+ if (*host != '[' && strchr(host, ':'))
+ sprintf(soap->tmpbuf, "[%s]:%d", host, port); /* RFC 2732 */
+ else
+#endif
+ sprintf(soap->tmpbuf, "%s:%d", host, port);
+ }
else
strcpy(soap->tmpbuf, host);
-#endif
if ((err = soap->fposthdr(soap, "Host", soap->tmpbuf)))
return err;
if ((err = soap->fposthdr(soap, "User-Agent", "gSOAP/2.8")))
@@ -5614,16 +5704,30 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
#endif
#ifndef WITH_LEAN
if (soap->userid && soap->passwd && strlen(soap->userid) + strlen(soap->passwd) < 761)
- { sprintf(soap->tmpbuf + 262, "%s:%s", soap->userid, soap->passwd);
- strcpy(soap->tmpbuf, "Basic ");
- soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
+ {
+#ifdef WITH_NTLM
+ if (soap->ntlm_challenge && strlen(soap->ntlm_challenge) + 6 < sizeof(soap->tmpbuf))
+ sprintf(soap->tmpbuf, "NTLM %s", soap->ntlm_challenge);
+ else
+#endif
+ { strcpy(soap->tmpbuf, "Basic ");
+ sprintf(soap->tmpbuf + 262, "%s:%s", soap->userid, soap->passwd);
+ soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
+ }
if ((err = soap->fposthdr(soap, "Authorization", soap->tmpbuf)))
return err;
}
if (soap->proxy_userid && soap->proxy_passwd && strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) < 761)
- { sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
- strcpy(soap->tmpbuf, "Basic ");
- soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
+ {
+#ifdef WITH_NTLM
+ if (soap->ntlm_challenge && strlen(soap->ntlm_challenge) + 6 < sizeof(soap->tmpbuf))
+ sprintf(soap->tmpbuf, "NTLM %s", soap->ntlm_challenge);
+ else
+#endif
+ { strcpy(soap->tmpbuf, "Basic ");
+ sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
+ soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
+ }
if ((err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
return err;
}
@@ -5637,7 +5741,7 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
return soap->error;
#endif
#endif
- if (soap->status != SOAP_GET && soap->version == 1)
+ if (action && soap->status != SOAP_GET && soap->status != SOAP_DEL)
{ sprintf(soap->tmpbuf, "\"%s\"", action && strlen(action) < sizeof(soap->tmpbuf) - 3 ? action : SOAP_STR_EOS);
if ((err = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf)))
return err;
@@ -5699,7 +5803,7 @@ http_response(struct soap *soap, int status, size_t count)
if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK))
s = "200 OK";
else
- s = "202 ACCEPTED";
+ s = "202 Accepted";
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Status = %s\n", s));
#ifdef WMW_RPM_IO
if (soap->rpmreqid || soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* RPM behaves as if standalone */
@@ -5842,9 +5946,9 @@ soap_cookie(struct soap *soap, const char *name, const char *domain, const char
path = SOAP_STR_EOS;
else if (*path == '/')
path++;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Search cookie %s domain=%s path=%s\n", name, domain?domain:"(null)", path?path:"(null)"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Search cookie %s domain=%s path=%s\n", name, domain ? domain : "(null)", path ? path : "(null)"));
for (p = soap->cookies; p; p = p->next)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie in database: %s=%s domain=%s path=%s env=%hd\n", p->name, p->value?p->value:"(null)", p->domain?p->domain:"(null)", p->path?p->path:"(null)", p->env));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie in database: %s=%s domain=%s path=%s env=%hd\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->env));
if (!strcmp(p->name, name)
&& p->domain
&& p->path
@@ -5871,7 +5975,7 @@ soap_set_cookie(struct soap *soap, const char *name, const char *value, const ch
else if (*path == '/')
path++;
q = soap_cookie(soap, name, domain, path);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set %scookie: %s=%s domain=%s path=%s\n", q ? SOAP_STR_EOS : "new ", name, value?value:"(null)", domain?domain:"(null)", path?path:"(null)"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set %scookie: %s=%s domain=%s path=%s\n", q ? SOAP_STR_EOS : "new ", name, value ? value : "(null)", domain ? domain : "(null)", path ? path : "(null)"));
if (!q)
{ if ((q = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie))))
{ if ((q->name = (char*)SOAP_MALLOC(soap, strlen(name)+1)))
@@ -5940,13 +6044,13 @@ soap_clr_cookie(struct soap *soap, const char *name, const char *domain, const c
if (!domain)
domain = soap->cookie_domain;
if (!domain)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error in clear cookie %s: cookie domain not set\n", name?name:"(null)"));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error in clear cookie %s: cookie domain not set\n", name ? name : "(null)"));
return;
}
if (!path)
path = soap->cookie_path;
if (!path)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error in clear cookie %s: cookie path not set\n", name?name:"(null)"));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error in clear cookie %s: cookie path not set\n", name ? name : "(null)"));
return;
}
if (*path == '/')
@@ -6006,7 +6110,7 @@ int
SOAP_FMAC2
soap_set_cookie_expire(struct soap *soap, const char *name, long expire, const char *domain, const char *path)
{ struct soap_cookie *p;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie expiration max-age %ld: %s domain=%s path=%s\n", expire, name, domain?domain:"(null)", path?path:"(null)"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie expiration max-age %ld: %s domain=%s path=%s\n", expire, name, domain ? domain : "(null)", path ? path : "(null)"));
if ((p = soap_cookie(soap, name, domain, path)))
{ p->maxage = expire;
p->modified = 1;
@@ -6123,6 +6227,9 @@ soap_putcookies(struct soap *soap, const char *domain, const char *path, int sec
unsigned int version = 0;
time_t now = time(NULL);
char *s, tmp[4096];
+ if (!domain || !path)
+ return SOAP_OK;
+ s = tmp;
p = &soap->cookies;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending cookies for domain=%s path=%s\n", domain, path));
if (*path == '/')
@@ -6169,30 +6276,53 @@ soap_putcookies(struct soap *soap, const char *domain, const char *path, int sec
if (flag
&& (!q->path || !strncmp(q->path, path, strlen(q->path)))
&& (!q->secure || secure))
- { s = tmp;
+ { size_t n = 12;
+ if (q->name)
+ n += 3*strlen(q->name);
+ if (q->value && *q->value)
+ n += 3*strlen(q->value) + 1;
+ if (q->path && *q->path)
+ n += strlen(q->path) + 9;
+ if (q->domain)
+ n += strlen(q->domain) + 11;
+ if (tmp - s + n > sizeof(tmp))
+ { if (s == tmp)
+ return SOAP_OK; /* HTTP header size overflow */
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie: %s\n", tmp));
+ if ((soap->error = soap->fposthdr(soap, "Cookie", tmp)))
+ return soap->error;
+ s = tmp;
+ }
+ else if (s != tmp)
+ { strcat(s, " ");
+ s++;
+ }
if (q->version != version)
{ sprintf(s, "$Version=%u;", q->version);
version = q->version;
+ s += strlen(s);
}
if (q->name)
- s += soap_encode_cookie(q->name, s, tmp-s+4080);
+ s += soap_encode_cookie(q->name, s, tmp+sizeof(tmp)-s-16);
if (q->value && *q->value)
{ *s++ = '=';
- s += soap_encode_cookie(q->value, s, tmp-s+4080);
+ s += soap_encode_cookie(q->value, s, tmp+sizeof(tmp)-s-16);
}
- if (q->path && *q->path && (int)strlen(q->path) < tmp-s+4080)
+ if (q->path)
{ sprintf(s, ";$Path=\"/%s\"", (*q->path == '/' ? q->path + 1 : q->path));
s += strlen(s);
}
- if (q->domain && (int)strlen(q->domain) < tmp-s+4080)
- sprintf(s, ";$Domain=\"%s\"", q->domain);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie: %s\n", tmp));
- if ((soap->error = soap->fposthdr(soap, "Cookie", tmp)))
- return soap->error;
+ if (q->domain)
+ { sprintf(s, ";$Domain=\"%s\"", q->domain);
+ s += strlen(s);
+ }
}
p = &q->next;
}
}
+ if (s != tmp)
+ if ((soap->error = soap->fposthdr(soap, "Cookie", tmp)))
+ return soap->error;
return SOAP_OK;
}
@@ -6322,7 +6452,7 @@ soap_getcookies(struct soap *soap, const char *val)
p->secure = 1;
else
{ if (p)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie %s=%s domain=%s path=%s expire=%ld secure=%d\n", p->name, p->value?p->value:"(null)", p->domain?p->domain:"(null)", p->path?p->path:"(null)", p->expire, p->secure));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie %s=%s domain=%s path=%s expire=%ld secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure));
if ((q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path)))
{ q->version = p->version;
q->expire = p->expire;
@@ -6374,7 +6504,7 @@ soap_getcookies(struct soap *soap, const char *val)
}
}
if (p)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie %s=%s domain=%s path=%s expire=%ld secure=%d\n", p->name, p->value?p->value:"(null)", p->domain?p->domain:"(null)", p->path?p->path:"(null)", p->expire, p->secure));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie %s=%s domain=%s path=%s expire=%ld secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure));
if ((q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path)))
{ q->version = p->version;
q->expire = p->expire;
@@ -6506,30 +6636,10 @@ soap_init_pht(struct soap *soap)
SOAP_FMAC1
struct soap*
SOAP_FMAC2
-soap_new1(soap_mode mode)
-{ return soap_new2(mode, mode);
-}
-#endif
-
-/******************************************************************************/
-#ifndef PALM_1
-SOAP_FMAC1
-struct soap*
-SOAP_FMAC2
-soap_new()
-{ return soap_new2(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
-}
-#endif
-
-/******************************************************************************/
-#ifndef PALM_1
-SOAP_FMAC1
-struct soap*
-SOAP_FMAC2
-soap_new2(soap_mode imode, soap_mode omode)
+soap_versioning(soap_new)(soap_mode imode, soap_mode omode)
{ struct soap *soap = (struct soap*)malloc(sizeof(struct soap));
if (soap)
- soap_init2(soap, imode, omode);
+ soap_versioning(soap_init)(soap, imode, omode);
return soap;
}
#endif
@@ -6597,6 +6707,7 @@ soap_embed(struct soap *soap, const void *p, const struct soap_array *a, int n,
soap_set_embedded(soap, pp);
}
return i;
+ (void)soap;
}
#endif
#endif
@@ -6649,7 +6760,7 @@ soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a,
h = soap_hash_ptr(a->__ptr);
else
h = soap_hash_ptr(p);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%d dim=%d type=%d id=%d\n", p, a?a->__ptr:NULL, a?a->__size:0, n, type, soap->idnum+1));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%d dim=%d type=%d id=%d\n", p, a ? a->__ptr : NULL, a ? a->__size : 0, n, type, soap->idnum+1));
pp->next = soap->pht[h];
pp->type = type;
pp->mark1 = 0;
@@ -6659,6 +6770,7 @@ soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a,
soap->pht[h] = pp;
pp->id = ++soap->idnum;
return pp->id;
+ (void)n;
}
#endif
#endif
@@ -6747,6 +6859,7 @@ soap_begin_count(struct soap *soap)
soap->encoding = 0;
soap->part = SOAP_BEGIN;
soap->event = 0;
+ soap->evlev = 0;
soap->idnum = 0;
soap_clr_attr(soap);
soap_set_local_namespaces(soap);
@@ -6829,7 +6942,7 @@ soap_begin_send(struct soap *soap)
#ifdef WIN32
#ifndef UNDER_CE
#ifndef WITH_FASTCGI
- if (!soap_valid_socket(soap->socket)) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
+ if (!soap_valid_socket(soap->socket) && !soap->os) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
#ifdef __BORLANDC__
setmode(soap->sendfd, _O_BINARY);
#else
@@ -7084,7 +7197,7 @@ soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const
int i;
if (!p || !a->__ptr || (!aid && !atype))
return soap_element_id(soap, tag, id, p, a, n, type, t);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid?aid:SOAP_STR_EOS, id, atype?atype:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid ? aid : SOAP_STR_EOS, id, atype ? atype : SOAP_STR_EOS));
i = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
if (!i)
{ i = soap_pointer_enter(soap, p, a, n, t, &pp);
@@ -7213,7 +7326,7 @@ soap_enter(struct soap *soap, const char *id)
ip = (struct soap_ilist*)SOAP_MALLOC(soap, sizeof(struct soap_ilist) + strlen(id));
if (ip)
{ h = soap_hash(id);
- strcpy(ip->id, id);
+ strcpy((char*)ip->id, id);
ip->next = soap->iht[h];
soap->iht[h] = ip;
}
@@ -7400,13 +7513,16 @@ soap_dealloc(struct soap *soap, void *p)
SOAP_FREE(soap, q);
}
/* we must assume these were deallocated: */
+ soap->http_content = NULL;
soap->action = NULL;
soap->fault = NULL;
soap->header = NULL;
soap->userid = NULL;
soap->passwd = NULL;
soap->authrealm = NULL;
- soap->http_content = NULL;
+#ifdef WITH_NTLM
+ soap->ntlm_challenge = NULL;
+#endif
#ifndef WITH_LEANER
soap_clr_mime(soap);
#endif
@@ -7537,32 +7653,33 @@ soap_link(struct soap *soap, void *p, int t, int n, int (*fdelete)(struct soap_c
/******************************************************************************/
#ifndef PALM_2
SOAP_FMAC1
-void
+int
SOAP_FMAC2
soap_unlink(struct soap *soap, const void *p)
{ register char **q;
register struct soap_clist **cp;
- if (!soap || !p)
- return;
- for (q = (char**)&soap->alist; *q; q = *(char***)q)
- { if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
- { *q = **(char***)q;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p));
+ if (soap && p)
+ { for (q = (char**)&soap->alist; *q; q = *(char***)q)
+ { if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
+ { *q = **(char***)q;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p));
#ifdef SOAP_MEM_DEBUG
- soap_track_unlink(soap, p);
+ soap_track_unlink(soap, p);
#endif
- return;
+ return SOAP_OK; /* found and removed from dealloc chain */
+ }
}
- }
- for (cp = &soap->clist; *cp; cp = &(*cp)->next)
- { if (p == (*cp)->ptr)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked class instance %p\n", p));
- q = (char**)*cp;
- *cp = (*cp)->next;
- SOAP_FREE(soap, q);
- return;
+ for (cp = &soap->clist; *cp; cp = &(*cp)->next)
+ { if (p == (*cp)->ptr)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked class instance %p\n", p));
+ q = (char**)*cp;
+ *cp = (*cp)->next;
+ SOAP_FREE(soap, q);
+ return SOAP_OK; /* found and removed from dealloc chain */
+ }
}
}
+ return SOAP_ERR;
}
#endif
@@ -7802,6 +7919,7 @@ SOAP_FMAC2
soap_fcopy(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
{ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Copying data type=%d (target type=%d) %p -> %p (%lu bytes)\n", st, tt, q, p, (unsigned long)n));
memcpy(p, q, n);
+ (void)soap; (void)st; (void)tt; (void)len;
}
#endif
@@ -7867,7 +7985,7 @@ soap_end_send(struct soap *soap)
soap->mode &= ~SOAP_ENC_ZLIB;
soap->zlib_state = SOAP_ZLIB_NONE;
if (deflateEnd(soap->d_stream) != Z_OK || r != Z_STREAM_END)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to end deflate: %s\n", soap->d_stream->msg?soap->d_stream->msg:SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to end deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
return soap->error = SOAP_ZLIB_ERROR;
}
#ifdef WITH_GZIP
@@ -8004,7 +8122,7 @@ soap_end_recv(struct soap *soap)
for (i = 0; i < 8; i++)
{ if ((int)(c = soap_get1(soap)) == EOF)
{ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip error: unable to read crc value\n"));
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_ZLIB_ERROR;
}
soap->z_buf[i] = (char)c;
}
@@ -8232,6 +8350,7 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
return NULL;
if (copy)
{ register struct soap_plugin *p = NULL;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying context\n"));
#ifdef __cplusplus
*copy = *soap;
#else
@@ -8241,6 +8360,9 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
copy->error = SOAP_OK;
copy->userid = NULL;
copy->passwd = NULL;
+#ifdef WITH_NTLM
+ copy->ntlm_challenge = NULL;
+#endif
copy->nlist = NULL;
copy->blist = NULL;
copy->clist = NULL;
@@ -8260,8 +8382,18 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
soap_set_sent_logfile(copy, soap->logfile[SOAP_INDEX_SENT]);
soap_set_recv_logfile(copy, soap->logfile[SOAP_INDEX_RECV]);
#endif
+ copy->namespaces = NULL;
+ copy->local_namespaces = NULL;
+ if (soap->local_namespaces)
+ soap_set_namespaces(copy, soap->local_namespaces);
+ else
+ soap_set_namespaces(copy, soap->namespaces);
#ifdef WITH_C_LOCALE
+# ifdef WIN32
+ copy->c_locale = _create_locale(LC_ALL, "C");
+# else
copy->c_locale = duplocale(soap->c_locale);
+# endif
#else
copy->c_locale = NULL;
#endif
@@ -8326,7 +8458,10 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
copy->mode = soap->mode;
copy->imode = soap->imode;
copy->omode = soap->omode;
+ copy->master = soap->master;
copy->socket = soap->socket;
+ copy->sendsk = soap->sendsk;
+ copy->recvsk = soap->recvsk;
copy->recv_timeout = soap->recv_timeout;
copy->send_timeout = soap->send_timeout;
#if defined(__cplusplus) && !defined(WITH_LEAN)
@@ -8350,23 +8485,27 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
#ifndef WITH_NOIO
copy->peer = soap->peer;
copy->peerlen = soap->peerlen;
+ copy->ip = soap->ip;
+ copy->port = soap->port;
+ memcpy(copy->host, soap->host, sizeof(soap->host));
+ memcpy(copy->endpoint, soap->endpoint, sizeof(soap->endpoint));
#endif
#ifdef WITH_OPENSSL
- copy->bio = NULL;
- copy->ctx = NULL;
- copy->ssl = NULL;
- if (soap->ssl)
- copy->ssl = SSL_dup(soap->ssl);
+ copy->bio = soap->bio;
+ copy->ctx = soap->ctx;
+ copy->ssl = soap->ssl;
#endif
#ifdef WITH_GNUTLS
- copy->session = soap->session; /* TODO: Oops, GNUTLS provides a dup? */
+ copy->session = soap->session;
#endif
#ifdef WITH_ZLIB
copy->zlib_state = soap->zlib_state;
copy->zlib_in = soap->zlib_in;
copy->zlib_out = soap->zlib_out;
- copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
- memcpy(copy->d_stream, soap->d_stream, sizeof(z_stream));
+ if (!copy->d_stream)
+ copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
+ if (copy->d_stream)
+ memcpy(copy->d_stream, soap->d_stream, sizeof(z_stream));
copy->z_crc = soap->z_crc;
copy->z_ratio_in = soap->z_ratio_in;
copy->z_ratio_out = soap->z_ratio_out;
@@ -8375,7 +8514,8 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
copy->z_level = soap->z_level;
if (soap->z_buf && soap->zlib_state != SOAP_ZLIB_NONE)
{ copy->z_buf = (char*)SOAP_MALLOC(copy, SOAP_BUFLEN);
- memcpy(copy->z_buf, soap->z_buf, sizeof(soap->z_buf));
+ if (copy->z_buf)
+ memcpy(copy->z_buf, soap->z_buf, SOAP_BUFLEN);
}
copy->z_dict = soap->z_dict;
copy->z_dict_len = soap->z_dict_len;
@@ -8411,10 +8551,18 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
SOAP_FREE(copy, nq);
}
}
- copy->level = soap->level;
+ memcpy(copy->tag, soap->tag, sizeof(copy->tag));
+ memcpy(copy->id, soap->id, sizeof(copy->id));
+ memcpy(copy->href, soap->href, sizeof(copy->href));
+ memcpy(copy->type, soap->type, sizeof(copy->type));
+ copy->other = soap->other;
+ copy->root = soap->root;
+ copy->null = soap->null;
copy->body = soap->body;
+ copy->part = soap->part;
+ copy->mustUnderstand = soap->mustUnderstand;
+ copy->level = soap->level;
copy->peeked = soap->peeked;
- memcpy(copy->tag, soap->tag, sizeof(copy->tag));
/* copy attributes */
for (tq = soap->attributes; tq; tq = tq->next)
{ struct soap_attribute *tr = tp;
@@ -8440,24 +8588,22 @@ void
SOAP_FMAC2
soap_free_stream(struct soap *soap)
{ soap->socket = SOAP_INVALID_SOCKET;
+ soap->sendsk = SOAP_INVALID_SOCKET;
+ soap->recvsk = SOAP_INVALID_SOCKET;
#ifdef WITH_OPENSSL
soap->bio = NULL;
- if (soap->ssl)
- SSL_free(soap->ssl);
+ soap->ctx = NULL;
soap->ssl = NULL;
#endif
#ifdef WITH_GNUTLS
soap->xcred = NULL;
soap->acred = NULL;
soap->cache = NULL;
- soap->session = NULL; /* TODO: GNUTLS free here when dupped */
+ soap->session = NULL;
soap->dh_params = NULL;
soap->rsa_params = NULL;
#endif
#ifdef WITH_ZLIB
- if (soap->d_stream)
- SOAP_FREE(soap, soap->d_stream);
- soap->d_stream = NULL;
if (soap->z_buf)
SOAP_FREE(soap, soap->z_buf);
soap->z_buf = NULL;
@@ -8470,7 +8616,7 @@ soap_free_stream(struct soap *soap)
SOAP_FMAC1
void
SOAP_FMAC2
-soap_init(struct soap *soap)
+soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
{ size_t i;
soap->state = SOAP_INIT;
#ifdef SOAP_MEM_DEBUG
@@ -8480,7 +8626,7 @@ soap_init(struct soap *soap)
soap_init_logs(soap);
#endif
#ifdef SOAP_DEBUG
-#ifdef TANDEM
+#ifdef TANDEM_NONSTOP
soap_set_test_logfile(soap, "TESTLOG");
soap_set_sent_logfile(soap, "SENTLOG");
soap_set_recv_logfile(soap, "RECVLOG");
@@ -8491,21 +8637,26 @@ soap_init(struct soap *soap)
#endif
#endif
soap->version = 0;
- soap_imode(soap, SOAP_IO_DEFAULT);
- soap_omode(soap, SOAP_IO_DEFAULT);
+ soap_mode(soap, imode);
+ soap_imode(soap, imode);
+ soap_omode(soap, omode);
soap->plugins = NULL;
soap->user = NULL;
for (i = 0; i < sizeof(soap->data)/sizeof(*soap->data); i++)
soap->data[i] = NULL;
soap->userid = NULL;
soap->passwd = NULL;
+ soap->authrealm = NULL;
+#ifdef WITH_NTLM
+ soap->ntlm_challenge = NULL;
+#endif
#ifndef WITH_NOHTTP
soap->fpost = http_post;
- soap->fput = http_put;
soap->fget = http_get;
+ soap->fput = http_405;
soap->fdel = http_405;
- soap->fopt = http_405;
- soap->fhead = http_405;
+ soap->fopt = http_200;
+ soap->fhead = http_200;
soap->fform = NULL;
soap->fposthdr = http_post_header;
soap->fresponse = http_response;
@@ -8611,6 +8762,8 @@ soap_init(struct soap *soap)
soap->fault = NULL;
soap->master = SOAP_INVALID_SOCKET;
soap->socket = SOAP_INVALID_SOCKET;
+ soap->sendsk = SOAP_INVALID_SOCKET;
+ soap->recvsk = SOAP_INVALID_SOCKET;
soap->os = NULL;
soap->is = NULL;
#ifndef WITH_LEANER
@@ -8639,7 +8792,6 @@ soap_init(struct soap *soap)
soap->proxy_port = 8080;
soap->proxy_userid = NULL;
soap->proxy_passwd = NULL;
- soap->authrealm = NULL;
soap->prolog = NULL;
#ifdef WITH_ZLIB
soap->zlib_state = SOAP_ZLIB_NONE;
@@ -8709,7 +8861,11 @@ soap_init(struct soap *soap)
soap->rsa_params = NULL;
#endif
#ifdef WITH_C_LOCALE
+# ifdef WIN32
+ soap->c_locale = _create_locale(LC_ALL, "C");
+# else
soap->c_locale = newlocale(LC_ALL_MASK, "C", NULL);
+# endif
#else
soap->c_locale = NULL;
#endif
@@ -8726,6 +8882,7 @@ soap_init(struct soap *soap)
soap->ns = 0;
soap->part = SOAP_END;
soap->event = 0;
+ soap->evlev = 0;
soap->alloced = 0;
soap->count = 0;
soap->length = 0;
@@ -8740,28 +8897,6 @@ soap_init(struct soap *soap)
#endif
/******************************************************************************/
-#ifndef PALM_1
-SOAP_FMAC1
-void
-SOAP_FMAC2
-soap_init1(struct soap *soap, soap_mode mode)
-{ soap_init2(soap, mode, mode);
-}
-#endif
-
-/******************************************************************************/
-#ifndef PALM_1
-SOAP_FMAC1
-void
-SOAP_FMAC2
-soap_init2(struct soap *soap, soap_mode imode, soap_mode omode)
-{ soap_init(soap);
- soap_imode(soap, imode);
- soap_omode(soap, omode);
-}
-#endif
-
-/******************************************************************************/
#ifndef PALM_2
SOAP_FMAC1
void
@@ -8772,7 +8907,6 @@ soap_begin(struct soap *soap)
{ soap->buflen = 0;
soap->bufidx = 0;
}
- soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
soap->null = 0;
soap->position = 0;
soap->encoding = 0;
@@ -8781,6 +8915,7 @@ soap_begin(struct soap *soap)
soap->ns = 0;
soap->part = SOAP_END;
soap->event = 0;
+ soap->evlev = 0;
soap->alloced = 0;
soap->count = 0;
soap->length = 0;
@@ -8903,6 +9038,8 @@ soap_set_local_namespaces(struct soap *soap)
soap->version = 2;
}
soap->local_namespaces = ns2;
+ for (; ns2->id; ns2++)
+ ns2->out = NULL;
}
}
}
@@ -8976,7 +9113,7 @@ soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
return NULL;
}
}
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Adding namespace binding (level=%u) '%s' '%s' utilized=%d\n", soap->level, id, ns?ns:"(null)", utilized));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Adding namespace binding (level=%u) '%s' '%s' utilized=%d\n", soap->level, id, ns ? ns : "(null)", utilized));
n = strlen(id);
if (ns)
k = strlen(ns);
@@ -8989,9 +9126,9 @@ soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
}
np->next = soap->nlist;
soap->nlist = np;
- strcpy(np->id, id);
+ strcpy((char*)np->id, id);
if (ns)
- np->ns = strcpy(np->id + n + 1, ns);
+ np->ns = strcpy((char*)np->id + n + 1, ns);
else
np->ns = NULL;
np->level = soap->level;
@@ -9003,8 +9140,13 @@ soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
/******************************************************************************/
#ifndef WITH_LEAN
static void
-soap_utilize_ns(struct soap *soap, const char *tag, size_t n)
-{ register struct soap_nlist *np = soap_lookup_ns(soap, tag, n);
+soap_utilize_ns(struct soap *soap, const char *tag)
+{ register struct soap_nlist *np;
+ size_t n = 0;
+ const char *t = strchr(tag, ':');
+ if (t)
+ n = t - tag;
+ np = soap_lookup_ns(soap, tag, n);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Utilizing namespace of '%s'\n", tag));
if (np)
{ if (np->index == 0)
@@ -9028,7 +9170,8 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
#ifndef WITH_LEAN
register const char *s;
#endif
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' id='%d' type='%s'\n", tag, id, type?type:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' level='%u' id='%d' type='%s'\n", tag, soap->level, id, type ? type : SOAP_STR_EOS));
+ soap->level++;
#ifdef WITH_DOM
#ifndef WITH_LEAN
if (soap->wsuid && soap_tagsearch(soap->wsuid, tag))
@@ -9039,12 +9182,20 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
if (soap_set_attr(soap, "wsu:Id", soap->tag, 1))
return soap->error;
}
- if (soap->event == SOAP_SEC_BEGIN && (soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_DOM_ASIS))
- { register struct soap_nlist *np;
- /* wsu:Id found: clear xmlns renderings, so re-emit them for exc-c14n */
- for (np = soap->nlist; np; np = np->next)
- { if (np->index == 2)
- np->index = 0;
+ if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_DOM_ASIS))
+ { if (soap->evlev >= soap->level)
+ soap->evlev = 0;
+ if (soap->event == SOAP_SEC_BEGIN && !soap->evlev)
+ { register struct soap_nlist *np;
+ /* non-nested wsu:Id found: clear xmlns, re-emit them for exc-c14n */
+ for (np = soap->nlist; np; np = np->next)
+ { if (np->index == 2)
+ { struct soap_nlist *np1 = soap_push_ns(soap, np->id, np->ns, 1);
+ if (np1)
+ np1->index = 0;
+ }
+ }
+ soap->evlev = soap->level;
}
}
#endif
@@ -9080,7 +9231,6 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
else
{
#endif
- soap->level++;
#ifndef WITH_LEAN
if (!soap->ns)
{ if (!(soap->mode & SOAP_XML_CANONICAL)
@@ -9135,26 +9285,30 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
soap->ns = 1; /* namespace table control: ns = 0 or 2 to start, then 1 to stop dumping the table */
#ifndef WITH_LEAN
if (soap->mode & SOAP_XML_CANONICAL)
- { const char *t = strchr(tag, ':');
- if (t)
- soap_utilize_ns(soap, tag, t - tag);
- }
+ soap_utilize_ns(soap, tag);
#endif
if (id > 0)
{ sprintf(soap->tmpbuf, "_%d", id);
if (soap_attribute(soap, "id", soap->tmpbuf))
return soap->error;
}
- if (type && *type && soap->part != SOAP_IN_HEADER) /* TODO: filter Header? */
- { if (soap_attribute(soap, "xsi:type", type))
- return soap->error;
+ if (type && *type && !(soap->mode & SOAP_XML_NOTYPE) && soap->part != SOAP_IN_HEADER)
+ { const char *t = type;
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
- { const char *t = strchr(type, ':');
+ if (soap->mode & SOAP_XML_DEFAULTNS)
+ { t = strchr(type, ':');
if (t)
- soap_utilize_ns(soap, type, t - type);
+ t++;
+ else
+ t = type;
}
#endif
+ if (soap->attributes ? soap_set_attr(soap, "xsi:type", t, 1) : soap_attribute(soap, "xsi:type", t))
+ return soap->error;
+#ifndef WITH_LEAN
+ if (soap->mode & SOAP_XML_CANONICAL)
+ soap_utilize_ns(soap, type);
+#endif
}
if (soap->null && soap->position > 0)
{ register int i;
@@ -9189,8 +9343,8 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
}
soap->null = 0;
soap->position = 0;
- if (soap->event == SOAP_SEC_BEGIN && (soap->mode & SOAP_XML_CANONICAL))
- soap->event = SOAP_SEC_SIGN;
+ if (soap->event == SOAP_SEC_BEGIN)
+ soap->event = 0;
return SOAP_OK;
}
#endif
@@ -9358,10 +9512,7 @@ soap_array_begin_out(struct soap *soap, const char *tag, int id, const char *typ
}
#ifndef WITH_LEAN
if ((soap->mode & SOAP_XML_CANONICAL))
- { const char *s = strchr(type, ':');
- if (s)
- soap_utilize_ns(soap, type, s - type);
- }
+ soap_utilize_ns(soap, type);
#endif
return soap_element_start_end_out(soap, NULL);
}
@@ -9379,14 +9530,11 @@ soap_element_start_end_out(struct soap *soap, const char *tag)
{ struct soap_nlist *np;
for (tp = soap->attributes; tp; tp = tp->next)
{ if (tp->visible && tp->name)
- { const char *s = strchr(tp->name, ':');
- if (s)
- soap_utilize_ns(soap, tp->name, s - tp->name);
- }
+ soap_utilize_ns(soap, tp->name);
}
for (np = soap->nlist; np; np = np->next)
{ if (np->index == 1 && np->ns)
- { sprintf(soap->tmpbuf, "xmlns:%s", np->id);
+ { sprintf(soap->tmpbuf, *(np->id) ? "xmlns:%s" : "xmlns", np->id);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s'\n", np->level, soap->tmpbuf, np->ns));
soap_set_attr(soap, soap->tmpbuf, np->ns, 1);
np->index = 2;
@@ -9636,6 +9784,7 @@ soap_check_result(struct soap *soap, const char *tag)
{ soap_instring(soap, ":result", NULL, NULL, 0, 2, -1, -1);
/* just ignore content for compliance reasons, but should compare tag to element's QName value? */
}
+ (void)tag;
}
#endif
@@ -9664,16 +9813,9 @@ soap_attribute(struct soap *soap, const char *name, const char *value)
#endif
#ifndef WITH_LEAN
if (soap->mode & SOAP_XML_CANONICAL)
- { /* TODO: consider using this code to handle default namespace bindings
+ { /* push namespace */
if (!strncmp(name, "xmlns", 5) && (name[5] == ':' || name[5] == '\0'))
- { if (name[5] == ':')
- soap_push_ns(soap, name + 6, value, 0);
- else
- soap_push_ns(soap, "", value, 0);
- }
- */
- if (!strncmp(name, "xmlns:", 6))
- soap_push_ns(soap, name + 6, value, 0);
+ soap_push_ns(soap, name + 5 + (name[5] == ':'), value, 0);
else if (soap_set_attr(soap, name, value, 1))
return soap->error;
}
@@ -9710,7 +9852,8 @@ soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const ch
return soap->error = SOAP_NULL;
if (soap->body)
soap->level++;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag?tag:SOAP_STR_EOS ));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS ));
+ soap->error = SOAP_OK;
}
}
else if (soap->error == SOAP_NO_TAG && tag && *tag == '-')
@@ -9749,7 +9892,7 @@ soap_element_end_in(struct soap *soap, const char *tag)
do
{ while (((c = soap_get(soap)) != SOAP_TT))
{ if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
if (c == SOAP_LT)
n++;
else if (c == '/')
@@ -9769,7 +9912,7 @@ soap_element_end_in(struct soap *soap, const char *tag)
}
*s = '\0';
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
while (soap_blank(c))
c = soap_get(soap);
if (c != SOAP_GT)
@@ -9784,12 +9927,12 @@ soap_element_end_in(struct soap *soap, const char *tag)
if (tag && (soap->mode & SOAP_XML_STRICT))
{ soap_pop_namespace(soap);
if (soap_match_tag(soap, soap->tag, tag))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element tag '%s' does not match '%s'\n", soap->tag, tag?tag:SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element tag '%s' does not match '%s'\n", soap->tag, tag ? tag : SOAP_STR_EOS));
return soap->error = SOAP_SYNTAX_ERROR;
}
}
#endif
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag?tag:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS));
soap->level--;
return SOAP_OK;
}
@@ -9831,7 +9974,7 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
{ register struct soap_attribute *tp;
if (*name == '-')
return SOAP_OK;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value?value:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value ? value : SOAP_STR_EOS));
for (tp = soap->attributes; tp; tp = tp->next)
{ if (!strcmp(tp->name, name))
break;
@@ -9883,7 +10026,7 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
{ tp->next = soap->attributes;
soap->attributes = tp;
}
- strcpy(tp->name, name);
+ strcpy((char*)tp->name, name);
tp->value = NULL;
}
else if (tp->visible)
@@ -9906,9 +10049,9 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
if (!strncmp(tp->name, "xmlns:", 6))
tp->ns = tp->value;
tp->visible = 2;
- tp->flag = flag;
+ tp->flag = (short)flag;
#ifndef WITH_LEAN
- if (soap->event != SOAP_SEC_SIGN && !strcmp(name, "wsu:Id"))
+ if (!strcmp(name, "wsu:Id"))
{ soap->event = SOAP_SEC_BEGIN;
strncpy(soap->id, value, sizeof(soap->id));
soap->id[sizeof(soap->id)-1] = '\0';
@@ -9996,7 +10139,7 @@ soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
}
default:
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
*s++ = (char)c;
}
}
@@ -10085,8 +10228,19 @@ soap_peek_element(struct soap *soap)
soap->position = 0;
soap->null = 0;
soap->mustUnderstand = 0;
- /* skip BOM */
- if ((c = soap_getchar(soap)) != 0xEF || (c = soap_get1(soap)) != 0xBB || (c = soap_get1(soap)) != 0xBF)
+ /* UTF-8 BOM? */
+ c = soap_getchar(soap);
+ if (c == 0xEF && soap_get0(soap) == 0xBB)
+ { c = soap_get1(soap);
+ if ((c = soap_get1(soap)) == 0xBF)
+ soap->mode &= ~SOAP_ENC_LATIN;
+ else
+ soap_unget(soap, (0x0F << 12) | (0xBB << 6) | (c & 0x3F)); /* UTF-8 */
+ }
+ else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */
+ || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */
+ return soap->error = SOAP_UTF_ERROR;
+ else
soap_unget(soap, c);
c = soap_get(soap);
#ifdef WITH_DOM
@@ -10116,7 +10270,7 @@ soap_peek_element(struct soap *soap)
if (c != SOAP_LT)
{ *soap->tag = '\0';
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
soap_unget(soap, c > 0 ? c | 0x80000000 : c);
#ifdef WITH_DOM
/* whitespace leading to end tag is significant for DOM */
@@ -10221,7 +10375,7 @@ soap_peek_element(struct soap *soap)
{ tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + strlen(soap->tmpbuf));
if (!tp)
return soap->error = SOAP_EOM;
- strcpy(tp->name, soap->tmpbuf);
+ strcpy((char*)tp->name, soap->tmpbuf);
tp->value = NULL;
tp->size = 0;
tp->ns = NULL;
@@ -10254,6 +10408,7 @@ soap_peek_element(struct soap *soap)
return soap->error;
if (tp->value)
SOAP_FREE(soap, tp->value);
+ tp->value = NULL;
for (;;)
{ if (soap_getattrval(soap, soap->labbuf + soap->labidx, soap->lablen - soap->labidx, c))
{ if (soap->error != SOAP_EOM)
@@ -10333,7 +10488,7 @@ soap_peek_element(struct soap *soap)
}
#endif
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
if (!(soap->body = (c != '/')))
do c = soap_get1(soap);
while (soap_blank(c));
@@ -10342,8 +10497,6 @@ soap_peek_element(struct soap *soap)
{ if (!soap->body && soap->dom->prnt)
soap->dom = soap->dom->prnt;
}
- if (soap->feltbegin)
- return soap->error = soap->feltbegin(soap, soap->tag);
#endif
for (tp = soap->attributes; tp; tp = tp->next)
{ if (tp->visible && tp->value)
@@ -10436,6 +10589,10 @@ soap_peek_element(struct soap *soap)
}
}
}
+#ifdef WITH_DOM
+ if (soap->feltbegin)
+ return soap->error = soap->feltbegin(soap, soap->tag);
+#endif
return soap->error = SOAP_OK;
}
#endif
@@ -10536,7 +10693,7 @@ soap_string_out(struct soap *soap, const char *s, int flag)
if (soap->mode & SOAP_C_MBSTRING)
{ wchar_t wc;
register int m = mbtowc(&wc, t - 1, MB_CUR_MAX);
- if (m > 0 && (soap_wchar)wc != c)
+ if (m > 0 && !((soap_wchar)wc == c && m == 1 && c < 0x80))
{ if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, wc))
return soap->error;
s = t += m - 1;
@@ -10649,11 +10806,11 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
if ((int)c == EOF)
goto end;
if ((c >= 0x80 || c < SOAP_AP) && state != 1 && !(soap->mode & SOAP_ENC_LATIN))
- { if (c >= 0x80)
+ { if ((c & 0x7FFFFFFF) >= 0x80)
{ soap_unget(soap, c);
c = soap_getutf8(soap);
}
- if (soap->mode & SOAP_C_UTFSTRING)
+ if ((c & 0x7FFFFFFF) >= 0x80 && (soap->mode & SOAP_C_UTFSTRING))
{ c &= 0x7FFFFFFF;
t = buf;
if (c < 0x0800)
@@ -10688,17 +10845,17 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
{ case 1:
if (c == ']')
state = 4;
- *s++ = c;
+ *s++ = (char)c;
continue;
case 2:
if (c == '-')
state = 6;
- *s++ = c;
+ *s++ = (char)c;
continue;
case 3:
if (c == '?')
state = 8;
- *s++ = c;
+ *s++ = (char)c;
continue;
/* CDATA */
case 4:
@@ -10706,14 +10863,14 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
state = 5;
else
state = 1;
- *s++ = c;
+ *s++ = (char)c;
continue;
case 5:
if (c == '>')
state = 0;
else
state = 1;
- *s++ = c;
+ *s++ = (char)c;
continue;
/* comment */
case 6:
@@ -10721,14 +10878,14 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
state = 7;
else
state = 2;
- *s++ = c;
+ *s++ = (char)c;
continue;
case 7:
if (c == '>')
state = 0;
else
state = 2;
- *s++ = c;
+ *s++ = (char)c;
continue;
/* PI */
case 8:
@@ -10736,7 +10893,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
state = 0;
else
state = 3;
- *s++ = c;
+ *s++ = (char)c;
continue;
}
switch (c)
@@ -10830,7 +10987,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
#ifndef WITH_LEANER
#ifdef HAVE_WCTOMB
if (soap->mode & SOAP_C_MBSTRING)
- { m = wctomb(buf, c & 0x7FFFFFFF);
+ { m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF));
if (m >= 1 && m <= (int)MB_CUR_MAX)
{ t = buf;
*s++ = *t++;
@@ -11001,7 +11158,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
#ifndef WITH_LEANER
#ifdef HAVE_WCTOMB
if (soap->mode & SOAP_C_MBSTRING)
- { m = wctomb(buf, c & 0x7FFFFFFF);
+ { m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF));
if (m >= 1 && m <= (int)MB_CUR_MAX)
{ t = buf;
*s++ = *t++;
@@ -11266,7 +11423,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
if ((int)c == EOF)
goto end;
if (sizeof(wchar_t) < 4 && c > 0xFFFF)
- { wchar_t c1, c2;
+ { soap_wchar c1, c2;
/* http://unicode.org/faq/utf_bom.html#utf16-2 */
c1 = 0xD800 - (0x10000 >> 10) + (c >> 10);
c2 = 0xDC00 + (c & 0x3FF);
@@ -11511,7 +11668,7 @@ soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p)
soap_reset_errno;
#endif
#endif
- *p = strtoll(s, &r, 10);
+ *p = soap_strtoll(s, &r, 10);
if (s == r || *r
#ifndef WITH_NOIO
#ifndef WITH_LEAN
@@ -11726,7 +11883,11 @@ soap_float2s(struct soap *soap, float n)
return "-INF";
s = soap->tmpbuf;
#if defined(HAVE_SPRINTF_L)
+# ifdef WIN32
+ _sprintf_s_l(s, _countof(soap->tmpbuf), soap->float_format, soap->c_locale, n);
+# else
sprintf_l(s, soap->c_locale, soap->float_format, n);
+# endif
#else
sprintf(s, soap->float_format, n);
s = strchr(s, ','); /* convert decimal comma to DP */
@@ -11772,7 +11933,11 @@ soap_s2float(struct soap *soap, const char *s, float *p)
/* On some systems strtof requires -std=c99 or does not even link: so we try to use strtod first */
#if defined(HAVE_STRTOD_L)
char *r;
+# ifdef WIN32
+ *p = (float)_strtod_l(s, &r, soap->c_locale);
+# else
*p = (float)strtod_l(s, &r, soap->c_locale);
+# endif
if (*r)
#elif defined(HAVE_STRTOD)
char *r;
@@ -11872,7 +12037,11 @@ soap_double2s(struct soap *soap, double n)
return "-INF";
s = soap->tmpbuf;
#if defined(HAVE_SPRINTF_L)
+# ifdef WIN32
+ _sprintf_s_l(s, _countof(soap->tmpbuf), soap->double_format, soap->c_locale, n);
+# else
sprintf_l(s, soap->c_locale, soap->double_format, n);
+# endif
#else
sprintf(s, soap->double_format, n);
s = strchr(s, ','); /* convert decimal comma to DP */
@@ -11917,7 +12086,11 @@ soap_s2double(struct soap *soap, const char *s, double *p)
{
#if defined(HAVE_STRTOD_L)
char *r;
+# ifdef WIN32
+ *p = _strtod_l(s, &r, soap->c_locale);
+# else
*p = strtod_l(s, &r, soap->c_locale);
+# endif
if (*r)
#elif defined(HAVE_STRTOD)
char *r;
@@ -12313,7 +12486,7 @@ soap_s2ULONG64(struct soap *soap, const char *s, ULONG64 *p)
soap_reset_errno;
#endif
#endif
- *p = strtoull(s, &r, 10);
+ *p = soap_strtoull(s, &r, 10);
if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
#ifndef WITH_NOIO
#ifndef WITH_LEAN
@@ -12414,7 +12587,7 @@ soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxle
break;
/* find next QName */
n = 1;
- while (s[n] && !soap_blank(s[n]))
+ while (s[n] && !soap_blank((soap_wchar)s[n]))
n++;
np = soap->nlist;
/* if there is no namespace stack, or prefix is "xml" then copy string */
@@ -12455,7 +12628,7 @@ soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxle
soap_append_lab(soap, "\"", 1);
}
else
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI=%s)\n", s, np->index, np->ns?np->ns:SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI=%s)\n", s, np->index, np->ns ? np->ns : SOAP_STR_EOS));
return soap->error = SOAP_NAMESPACE;
}
}
@@ -12506,10 +12679,7 @@ soap_QName2s(struct soap *soap, const char *s)
{ soap_append_lab(soap, s, n);
#ifndef WITH_LEAN
if ((soap->mode & SOAP_XML_CANONICAL))
- { const char *r = strchr(s, ':');
- if (r)
- soap_utilize_ns(soap, s, r - s);
- }
+ soap_utilize_ns(soap, s);
#endif
}
else /* URL-based string prefix */
@@ -12688,7 +12858,8 @@ SOAP_FMAC1
char **
SOAP_FMAC2
soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen)
-{ if (soap_element_begin_in(soap, tag, 1, NULL))
+{ (void)type;
+ if (soap_element_begin_in(soap, tag, 1, NULL))
{ if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG)
return NULL;
soap->error = SOAP_OK;
@@ -12754,7 +12925,8 @@ SOAP_FMAC1
wchar_t **
SOAP_FMAC2
soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type, int t, long minlen, long maxlen)
-{ if (soap_element_begin_in(soap, tag, 1, NULL))
+{ (void)type;
+ if (soap_element_begin_in(soap, tag, 1, NULL))
{ if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG)
return NULL;
soap->error = SOAP_OK;
@@ -13217,7 +13389,7 @@ soap_getline(struct soap *soap, char *s, int len)
if (c == '\r' || c == '\n')
break;
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
*s++ = (char)c;
}
if (c != '\n')
@@ -13231,7 +13403,7 @@ soap_getline(struct soap *soap, char *s, int len)
break;
}
else if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
if (i < 0)
return soap->error = SOAP_HDR;
}
@@ -13346,7 +13518,7 @@ SOAP_FMAC2
soap_putdimehdr(struct soap *soap)
{ unsigned char tmp[12];
size_t optlen = 0, idlen = 0, typelen = 0;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime.id?soap->dime.id:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS));
if (soap->dime.options)
optlen = (((unsigned char)soap->dime.options[2] << 8) | ((unsigned char)soap->dime.options[3])) + 4;
if (soap->dime.id)
@@ -13442,7 +13614,7 @@ soap_putdime(struct soap *soap)
bufsize = sizeof(soap->tmpbuf);
if (!(bufsize = soap->fdimeread(soap, handle, soap->tmpbuf, bufsize)))
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size));
- soap->error = SOAP_EOF;
+ soap->error = SOAP_CHK_EOF;
break;
}
if (soap_send_raw(soap, soap->tmpbuf, bufsize))
@@ -13484,7 +13656,7 @@ soap_getdimefield(struct soap *soap, size_t n)
{ s = p;
for (i = n; i > 0; i--)
{ if ((int)(c = soap_get1(soap)) == EOF)
- { soap->error = SOAP_EOF;
+ { soap->error = SOAP_CHK_EOF;
return NULL;
}
*s++ = (char)c;
@@ -13518,7 +13690,7 @@ soap_getdimehdr(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME header\n"));
if (soap->dime.buflen || soap->dime.chunksize)
{ if (soap_move(soap, (long)(soap->dime.size - soap_tell(soap))))
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
soap_unget(soap, soap_getchar(soap)); /* skip padding and get hdr */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... From chunked\n"));
return SOAP_OK;
@@ -13526,7 +13698,7 @@ soap_getdimehdr(struct soap *soap)
s = (char*)tmp;
for (i = 12; i > 0; i--)
{ if ((int)(c = soap_getchar(soap)) == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
*s++ = (char)c;
}
if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION)
@@ -13543,7 +13715,7 @@ soap_getdimehdr(struct soap *soap)
return soap->error;
if (!(soap->dime.type = soap_getdimefield(soap, typelen)) && soap->error)
return soap->error;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME id=%s, type=%s, options=%s\n", soap->dime.id?soap->dime.id:SOAP_STR_EOS, soap->dime.type?soap->dime.type:"", soap->dime.options?soap->dime.options+4:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME id=%s, type=%s, options=%s\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS, soap->dime.type ? soap->dime.type : "", soap->dime.options ? soap->dime.options+4 : SOAP_STR_EOS));
if (soap->dime.flags & SOAP_DIME_ME)
soap->mode &= ~SOAP_ENC_DIME;
return SOAP_OK;
@@ -13795,7 +13967,7 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
return NULL;
}
}
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing MIME content id=%s type=%s\n", content->id?content->id:SOAP_STR_EOS, content->type?content->type:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing MIME content id=%s type=%s\n", content->id ? content->id : SOAP_STR_EOS, content->type ? content->type : SOAP_STR_EOS));
if (!content->ptr && soap_new_block(soap) == NULL)
{ soap->error = SOAP_EOM;
return NULL;
@@ -13816,7 +13988,7 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
{ if (!flag)
{ c = soap_get1(soap);
if ((int)c == EOF)
- { soap->error = SOAP_EOF;
+ { soap->error = SOAP_CHK_EOF;
return NULL;
}
}
@@ -13829,7 +14001,7 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
do c = soap_getchar(soap);
while (c == *t++);
if ((int)c == EOF)
- { soap->error = SOAP_EOF;
+ { soap->error = SOAP_CHK_EOF;
return NULL;
}
if (!*--t)
@@ -13954,7 +14126,7 @@ int
SOAP_FMAC2
soap_putmimehdr(struct soap *soap, struct soap_multipart *content)
{ const char *s;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME attachment type=%s\n", content->type?content->type:SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME attachment type=%s\n", content->type ? content->type : SOAP_STR_EOS));
if (soap_send3(soap, "\r\n--", soap->mime.boundary, "\r\n"))
return soap->error;
if (content->type && soap_send3(soap, "Content-Type: ", content->type, "\r\n"))
@@ -14245,7 +14417,7 @@ soap_getgziphdr(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get gzip header\n"));
for (i = 0; i < 9; i++)
{ if ((int)(c = soap_get1(soap) == EOF))
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_ZLIB_ERROR;
if (i == 1 && c == 8)
soap->z_dict = 0;
if (i == 2)
@@ -14254,7 +14426,7 @@ soap_getgziphdr(struct soap *soap)
if (f & 0x04) /* FEXTRA */
{ for (i = soap_get1(soap) | (soap_get1(soap) << 8); i; i--)
{ if ((int)soap_get1(soap) == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_ZLIB_ERROR;
}
}
if (f & 0x08) /* skip FNAME */
@@ -14272,7 +14444,7 @@ soap_getgziphdr(struct soap *soap)
c = soap_get1(soap);
}
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_ZLIB_ERROR;
return SOAP_OK;
}
#endif
@@ -14292,7 +14464,10 @@ soap_begin_serve(struct soap *soap)
}
#endif
soap_begin(soap);
- if (soap_begin_recv(soap))
+ if (soap_begin_recv(soap)
+ || soap_envelope_begin_in(soap)
+ || soap_recv_header(soap)
+ || soap_body_begin_in(soap))
{ if (soap->error < SOAP_STOP)
{
#ifdef WITH_FASTCGI
@@ -14303,10 +14478,6 @@ soap_begin_serve(struct soap *soap)
}
return soap_closesock(soap);
}
- if (soap_envelope_begin_in(soap)
- || soap_recv_header(soap)
- || soap_body_begin_in(soap))
- return soap->error;
return SOAP_OK;
}
#endif
@@ -14317,7 +14488,7 @@ SOAP_FMAC1
int
SOAP_FMAC2
soap_begin_recv(struct soap *soap)
-{ soap_wchar c;
+{ register soap_wchar c;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for input\n"));
soap->error = SOAP_OK;
soap->filterstop = SOAP_OK;
@@ -14350,6 +14521,7 @@ soap_begin_recv(struct soap *soap)
soap->header = NULL;
soap->fault = NULL;
soap->status = 0;
+ soap->fform = NULL;
#ifndef WITH_LEANER
soap->dom = NULL;
soap->dime.chunksize = 0;
@@ -14366,7 +14538,7 @@ soap_begin_recv(struct soap *soap)
#ifdef WIN32
#ifndef UNDER_CE
#ifndef WITH_FASTCGI
- if (!soap_valid_socket(soap->socket))
+ if (!soap_valid_socket(soap->socket) && !soap->is) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
#ifdef __BORLANDC__
setmode(soap->recvfd, _O_BINARY);
#else
@@ -14433,14 +14605,24 @@ soap_begin_recv(struct soap *soap)
else
#endif
{ /* skip BOM */
- if (c == 0xEF && (c = soap_getchar(soap)) == 0xBB && (c = soap_getchar(soap)) == 0xBF)
- c = soap_getchar(soap);
+ if (c == 0xEF && soap_get0(soap) == 0xBB)
+ { c = soap_get1(soap);
+ if ((c = soap_get1(soap)) == 0xBF)
+ { soap->mode &= ~SOAP_ENC_LATIN;
+ c = soap_getchar(soap);
+ }
+ else
+ c = (0x0F << 12) | (0xBB << 6) | (c & 0x3F); /* UTF-8 */
+ }
+ else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */
+ || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */
+ return soap->error = SOAP_UTF_ERROR;
/* skip space */
while (soap_blank(c))
c = soap_getchar(soap);
}
if ((int)c == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
soap_unget(soap, c);
#ifndef WITH_NOHTTP
/* if not XML or MIME/DIME/ZLIB, assume HTTP header */
@@ -14453,7 +14635,13 @@ soap_begin_recv(struct soap *soap)
return soap->error;
}
if (soap->error == SOAP_STOP)
+ { if (soap->fform)
+ { soap->error = soap->fform(soap);
+ if (soap->error == SOAP_OK)
+ soap->error = SOAP_STOP; /* prevents further processing */
+ }
return soap->error;
+ }
soap->mode = soap->imode; /* if imode is changed, effectuate */
soap->imode = m; /* restore imode */
#ifdef WITH_ZLIB
@@ -14532,7 +14720,7 @@ soap_begin_recv(struct soap *soap)
if (soap->mode & SOAP_ENC_MIME)
{ do /* skip preamble */
{ if ((int)(c = soap_getchar(soap)) == EOF)
- return soap->error = SOAP_EOF;
+ return soap->error = SOAP_CHK_EOF;
} while (c != '-' || soap_get0(soap) != '-');
soap_unget(soap, c);
if (soap_getmimehdr(soap))
@@ -14614,7 +14802,8 @@ SOAP_FMAC1
int
SOAP_FMAC2
soap_envelope_end_out(struct soap *soap)
-{ if (soap_element_end_out(soap, "SOAP-ENV:Envelope") || soap_send_raw(soap, "\r\n", 2)) /* 2.8: always emit \r\n after SOAP Envelope */
+{ if (soap_element_end_out(soap, "SOAP-ENV:Envelope")
+ || soap_send_raw(soap, "\r\n", 2)) /* 2.8: always emit \r\n */
return soap->error;
#ifndef WITH_LEANER
if ((soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
@@ -14959,23 +15148,32 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
}
else
#endif
+ soap->action = soap_strdup(soap, action);
if (soap->fopen && *soap->host)
{ if (!soap->keep_alive || !soap_valid_socket(soap->socket) || strcmp(soap->host, host) || soap->port != port || !soap->fpoll || soap->fpoll(soap))
{ soap->error = SOAP_OK;
- soap->keep_alive = 0; /* to force close */
- soap->omode &= ~SOAP_IO_UDP; /* to force close */
- soap_closesock(soap);
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Connect/reconnect to host='%s' path='%s' port=%d\n", soap->host, soap->path, soap->port));
#ifndef WITH_LEAN
if (!strncmp(endpoint, "soap.udp:", 9))
soap->omode |= SOAP_IO_UDP;
+ else
#endif
- soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port);
- if (soap->error)
- return soap->error;
- soap->keep_alive = ((soap->omode & SOAP_IO_KEEPALIVE) != 0);
+ { soap->keep_alive = 0; /* to force close */
+ soap->omode &= ~SOAP_IO_UDP; /* to force close */
+ }
+ soap_closesock(soap);
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Connect/reconnect to '%s' host='%s' path='%s' port=%d\n", endpoint?endpoint:"(null)", soap->host, soap->path, soap->port));
+ if (!soap->keep_alive || !soap_valid_socket(soap->socket))
+ { soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port);
+ if (soap->error)
+ return soap->error;
+ soap->keep_alive = ((soap->omode & SOAP_IO_KEEPALIVE) != 0);
+ }
}
}
+#ifdef WITH_NTLM
+ if (soap_ntlm_handshake(soap, SOAP_GET, endpoint, soap->host, soap->port))
+ return soap->error;
+#endif
count = soap_count_attachments(soap);
if (soap_begin_send(soap))
return soap->error;
@@ -14984,7 +15182,6 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
soap->mode |= SOAP_IO_BUFFER;
}
#ifndef WITH_NOHTTP
- soap->action = soap_strdup(soap, action);
if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_XML) && endpoint)
{ unsigned int k = soap->mode;
soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);
@@ -15000,7 +15197,7 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
#endif
soap->mode = k;
}
- if (http_command == SOAP_GET)
+ if (http_command == SOAP_GET || http_command == SOAP_DEL)
return soap_end_send(soap);
#endif
return SOAP_OK;
@@ -15008,6 +15205,80 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
#endif
/******************************************************************************/
+#ifdef WITH_NTLM
+#ifndef PALM_1
+static int
+soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const char *host, int port)
+{ /* requires libntlm from http://www.nongnu.org/libntlm/ */
+ const char *userid = (soap->proxy_userid ? soap->proxy_userid : soap->userid);
+ const char *passwd = (soap->proxy_passwd ? soap->proxy_passwd : soap->passwd);
+ struct SOAP_ENV__Header *oldheader;
+ if (soap->ntlm_challenge && userid && passwd && soap->authrealm)
+ { tSmbNtlmAuthRequest req;
+ tSmbNtlmAuthResponse res;
+ tSmbNtlmAuthChallenge ch;
+ short k = soap->keep_alive;
+ size_t l = soap->length;
+ size_t c = soap->count;
+ soap_mode m = soap->mode, o = soap->omode;
+ int s = soap->status;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM '%s'\n", soap->ntlm_challenge));
+ if (!*soap->ntlm_challenge)
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM S->C Type 1: received NTLM authentication challenge from server\n"));
+ /* S -> C 401 Unauthorized
+ WWW-Authenticate: NTLM
+ */
+ buildSmbNtlmAuthRequest(&req, userid, soap->authrealm);
+ soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)&req, NULL, SmbLength(&req));
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM C->S Type 2: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge));
+ /* C -> S GET ...
+ Authorization: NTLM TlRMTVNTUAABAAAAA7IAAAoACgApAAAACQAJACAAAABMSUdIVENJVFlVUlNBLU1JTk9S
+ */
+ soap->omode = SOAP_IO_BUFFER;
+ if (soap_begin_send(soap))
+ return soap->error;
+ soap->keep_alive = 1;
+ soap->status = command;
+ if (soap->fpost(soap, endpoint, host, port, soap->path, soap->action, 0)
+ || soap_end_send(soap))
+ return soap->error;
+ soap->mode = m;
+ soap->keep_alive = k;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM S->C Type 2: waiting on server NTLM response\n"));
+ oldheader = soap->header;
+ if (soap_begin_recv(soap))
+ if (soap->error == SOAP_EOF)
+ return soap->error;
+ soap_end_recv(soap);
+ soap->header = oldheader;
+ soap->length = l;
+ if (soap->status != 401 && soap->status != 407)
+ return soap->error = SOAP_NTLM_ERROR;
+ soap->error = SOAP_OK;
+ }
+ /* S -> C 401 Unauthorized
+ WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==
+ */
+ soap_base642s(soap, soap->ntlm_challenge, (char*)&ch, sizeof(tSmbNtlmAuthChallenge), NULL);
+ buildSmbNtlmAuthResponse(&ch, &res, userid, passwd);
+ soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)&res, NULL, SmbLength(&res));
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM C->S Type 3: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge));
+ /* C -> S GET ...
+ Authorization: NTLM TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT
+ */
+ soap->keep_alive = k;
+ soap->length = l;
+ soap->count = c;
+ soap->mode = m;
+ soap->omode = o;
+ soap->status = s;
+ }
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
#ifndef WITH_LEAN
SOAP_FMAC1
char*
@@ -15055,7 +15326,8 @@ SOAP_FMAC1
const char*
SOAP_FMAC2
soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
-{ register int i, j, c;
+{ register size_t i, j;
+ register soap_wchar c;
register unsigned long m;
register const char *p;
if (!s || !*s)
@@ -15066,7 +15338,7 @@ soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
return SOAP_NON_NULL;
}
if (!t)
- { l = (strlen(s) + 3) / 4 * 3;
+ { l = (strlen(s) + 3) / 4 * 3 + 1; /* make sure enough space for \0 */
t = (char*)soap_malloc(soap, l);
}
if (!t)
@@ -15093,7 +15365,9 @@ soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
i += 2;
}
if (n)
- *n += i;
+ *n += (int)i;
+ if (l >= j)
+ *t = '\0';
return p;
}
c -= '+';
@@ -15111,14 +15385,15 @@ soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
return NULL;
}
}
- *t++ = (char)((m >> 16) & 0xFF);
- *t++ = (char)((m >> 8) & 0xFF);
- *t++ = (char)(m & 0xFF);
if (l < 3)
{ if (n)
- *n += i;
+ *n += (int)i;
+ *t = '\0';
return p;
}
+ *t++ = (char)((m >> 16) & 0xFF);
+ *t++ = (char)((m >> 8) & 0xFF);
+ *t++ = (char)(m & 0xFF);
l -= 3;
}
if (n)
@@ -15168,7 +15443,7 @@ soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n)
return SOAP_NON_NULL;
}
if (!t)
- { l = strlen(s) / 2;
+ { l = strlen(s) / 2 + 1; /* make sure enough space for \0 */
t = (char*)soap_malloc(soap, l);
}
if (!t)
@@ -15182,11 +15457,13 @@ soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n)
d2 = *s++;
if (!d2)
break;
- *t++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
+ *t++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0'));
l--;
}
if (n)
*n = (int)(t - p);
+ if (l)
+ *t = '\0';
return p;
}
#endif
@@ -15198,13 +15475,13 @@ SOAP_FMAC1
int
SOAP_FMAC2
soap_puthttphdr(struct soap *soap, int status, size_t count)
-{ if (soap->status != SOAP_GET)
+{ if (soap->status != SOAP_GET && soap->status != SOAP_DEL && soap->status != SOAP_CONNECT)
{ register const char *s = "text/xml; charset=utf-8";
register int err = SOAP_OK;
#ifndef WITH_LEANER
register const char *r = NULL;
#endif
- if ((status == SOAP_FILE || soap->status == SOAP_POST_FILE) && soap->http_content)
+ if ((status == SOAP_FILE || soap->status == SOAP_PUT || soap->status == SOAP_POST_FILE) && soap->http_content)
s = soap->http_content;
else if (status == SOAP_HTML)
s = "text/html; charset=utf-8";
@@ -15245,12 +15522,12 @@ soap_puthttphdr(struct soap *soap, int status, size_t count)
}
s = soap->tmpbuf;
}
- if (status == SOAP_OK && soap->version == 2 && soap->action && strlen(soap->action) < sizeof(soap->tmpbuf) - 80)
- { sprintf(soap->tmpbuf, "%s; action=\"%s\"", s, soap->action);
- s = soap->tmpbuf;
- }
+ else
+ s = strcpy(soap->tmpbuf, s);
+ if (status == SOAP_OK && soap->version == 2 && soap->action && strlen(soap->action) + strlen(s) < sizeof(soap->tmpbuf) - 80)
+ sprintf(soap->tmpbuf + strlen(s), "; action=\"%s\"", soap->action);
#endif
- if (s && (err = soap->fposthdr(soap, "Content-Type", s)))
+ if ((err = soap->fposthdr(soap, "Content-Type", s)))
return err;
#ifdef WITH_ZLIB
if ((soap->omode & SOAP_ENC_ZLIB))
@@ -15286,9 +15563,17 @@ soap_puthttphdr(struct soap *soap, int status, size_t count)
static const char*
soap_set_validation_fault(struct soap *soap, const char *s, const char *t)
{ if (*soap->tag)
- sprintf(soap->msgbuf, "Validation constraint violation: %s%s in element '%s'", s, t?t:SOAP_STR_EOS, soap->tag);
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Validation constraint violation: %s%s in element '%s'", s, t ? t : SOAP_STR_EOS, soap->tag);
+#else
+ sprintf(soap->msgbuf, "Validation constraint violation: %s%s in element '%s'", s, t ? t : SOAP_STR_EOS, soap->tag);
+#endif
else
- sprintf(soap->msgbuf, "Validation constraint violation: %s%s", s, t?t:SOAP_STR_EOS);
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Validation constraint violation: %s%s", s, t ? t : SOAP_STR_EOS);
+#else
+ sprintf(soap->msgbuf, "Validation constraint violation: %s%s", s, t ? t : SOAP_STR_EOS);
+#endif
return soap->msgbuf;
}
#endif
@@ -15330,11 +15615,15 @@ soap_set_fault(struct soap *soap)
*s = "Well-formedness violation";
break;
case SOAP_NO_TAG:
- *s = "No XML root element";
+ *s = "No tag: no XML root element or missing SOAP message body element";
break;
case SOAP_MUSTUNDERSTAND:
*c = "SOAP-ENV:MustUnderstand";
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "The data in element '%s' must be understood but cannot be handled", soap->tag);
+#else
sprintf(soap->msgbuf, "The data in element '%s' must be understood but cannot be handled", soap->tag);
+#endif
*s = soap->msgbuf;
break;
case SOAP_VERSIONMISMATCH:
@@ -15355,7 +15644,11 @@ soap_set_fault(struct soap *soap)
*s = "Fatal error";
break;
case SOAP_NO_METHOD:
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
+#else
sprintf(soap->msgbuf, "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
+#endif
*s = soap->msgbuf;
break;
case SOAP_NO_DATA:
@@ -15386,7 +15679,7 @@ soap_set_fault(struct soap *soap)
*s = soap_set_validation_fault(soap, "nil not allowed", NULL);
break;
case SOAP_DUPLICATE_ID:
- *s = soap_set_validation_fault(soap, "multiple definitions of id ", soap->id);
+ *s = soap_set_validation_fault(soap, "multiple definitions (use the SOAP_XML_TREE flag) of the same id ", soap->id);
if (soap->version == 2)
*soap_faultsubcode(soap) = "SOAP-ENC:DuplicateID";
break;
@@ -15411,6 +15704,9 @@ soap_set_fault(struct soap *soap)
case SOAP_HTTP_ERROR:
*s = "An HTTP processing error occurred";
break;
+ case SOAP_NTLM_ERROR:
+ *s = "An HTTP NTLM authentication error occurred";
+ break;
case SOAP_SSL_ERROR:
#ifdef WITH_OPENSSL
*s = "SSL/TLS error";
@@ -15444,7 +15740,11 @@ soap_set_fault(struct soap *soap)
break;
case SOAP_ZLIB_ERROR:
#ifdef WITH_ZLIB
- sprintf(soap->msgbuf, "Zlib/gzip error: '%s'", soap->d_stream->msg?soap->d_stream->msg:SOAP_STR_EOS);
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Zlib/gzip error: '%s'", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS);
+#else
+ sprintf(soap->msgbuf, "Zlib/gzip error: '%s'", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS);
+#endif
*s = soap->msgbuf;
#else
*s = "Zlib/gzip not installed for (de)compression: recompile with -DWITH_GZIP";
@@ -15465,8 +15765,11 @@ soap_set_fault(struct soap *soap)
case SOAP_FD_EXCEEDED:
*s = "Maximum number of open connections was reached (no define HAVE_POLL): increase FD_SETSIZE";
break;
+ case SOAP_UTF_ERROR:
+ *s = "UTF content encoding error";
+ break;
case SOAP_STOP:
- *s = "Stopped: no response to be sent or received (informative)";
+ *s = "Stopped: no response sent or received (informative)";
break;
#endif
case SOAP_EOF:
@@ -15488,7 +15791,12 @@ soap_set_fault(struct soap *soap)
#ifndef WITH_NOHTTP
#ifndef WITH_LEAN
if (soap->error > 200 && soap->error < 600)
- { sprintf(soap->msgbuf, "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
+ {
+#ifdef HAVE_SNPRINTF
+ soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
+#else
+ sprintf(soap->msgbuf, "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
+#endif
*s = soap->msgbuf;
}
else
@@ -15617,12 +15925,14 @@ int
SOAP_FMAC2
soap_send_empty_response(struct soap *soap, int httpstatuscode)
{ register soap_mode m = soap->omode;
- soap->count = 0;
- if ((m & SOAP_IO) == SOAP_IO_CHUNK)
- soap->omode = (m & ~SOAP_IO) | SOAP_IO_BUFFER;
- if (!soap_response(soap, httpstatuscode) && !soap_end_send(soap))
- soap->error = SOAP_STOP; /* stops the server's response */
- soap->omode = m;
+ if (!(m & SOAP_IO_UDP))
+ { soap->count = 0;
+ if ((m & SOAP_IO) == SOAP_IO_CHUNK)
+ soap->omode = (m & ~SOAP_IO) | SOAP_IO_BUFFER;
+ if (!soap_response(soap, httpstatuscode) && !soap_end_send(soap))
+ soap->error = SOAP_STOP; /* stops the server's processing of request */
+ soap->omode = m;
+ }
return soap_closesock(soap);
}
#endif
@@ -15635,10 +15945,12 @@ SOAP_FMAC1
int
SOAP_FMAC2
soap_recv_empty_response(struct soap *soap)
-{ if (!soap_begin_recv(soap))
- soap_end_recv(soap);
- else if (soap->error == SOAP_NO_DATA || soap->error == 202)
- soap->error = SOAP_OK;
+{ if (!(soap->omode & SOAP_IO_UDP))
+ { if (!soap_begin_recv(soap))
+ soap_end_recv(soap);
+ else if (soap->error == SOAP_NO_DATA || soap->error == 202)
+ soap->error = SOAP_OK;
+ }
return soap_closesock(soap);
}
#endif
@@ -15805,16 +16117,15 @@ soap_print_fault(struct soap *soap, FILE *fd)
{ if (soap_check_state(soap))
fprintf(fd, "Error: soap struct state not initialized\n");
else if (soap->error)
- { const char *c, *v = NULL, *s, **d;
- d = soap_faultcode(soap);
- if (!*d)
+ { const char **c, *v = NULL, *s, *d;
+ c = soap_faultcode(soap);
+ if (!*c)
soap_set_fault(soap);
- c = *d;
if (soap->version == 2)
- v = *soap_faultsubcode(soap);
+ v = soap_check_faultsubcode(soap);
s = *soap_faultstring(soap);
- d = soap_faultdetail(soap);
- fprintf(fd, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, c, v ? v : "no subcode", s ? s : "[no reason]", d && *d ? *d : "[no detail]");
+ d = soap_check_faultdetail(soap);
+ fprintf(fd, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
}
}
#endif
@@ -15824,6 +16135,7 @@ soap_print_fault(struct soap *soap, FILE *fd)
#ifdef __cplusplus
#ifndef WITH_LEAN
#ifndef WITH_NOSTDLIB
+#ifndef WITH_COMPAT
SOAP_FMAC1
void
SOAP_FMAC2
@@ -15831,29 +16143,29 @@ soap_stream_fault(struct soap *soap, std::ostream& os)
{ if (soap_check_state(soap))
os << "Error: soap struct state not initialized\n";
else if (soap->error)
- { const char *c, *v = NULL, *s, **d;
- d = soap_faultcode(soap);
- if (!*d)
+ { const char **c, *v = NULL, *s, *d;
+ c = soap_faultcode(soap);
+ if (!*c)
soap_set_fault(soap);
- c = *d;
if (soap->version == 2)
- v = *soap_faultsubcode(soap);
+ v = soap_check_faultsubcode(soap);
s = *soap_faultstring(soap);
- d = soap_faultdetail(soap);
+ d = soap_check_faultdetail(soap);
os << (soap->version ? "SOAP 1." : "Error ")
<< (soap->version ? (int)soap->version : soap->error)
- << " fault: " << c
+ << " fault: " << *c
<< "[" << (v ? v : "no subcode") << "]"
<< std::endl
<< "\"" << (s ? s : "[no reason]") << "\""
<< std::endl
- << "Detail: " << (d && *d ? *d : "[no detail]")
+ << "Detail: " << (d ? d : "[no detail]")
<< std::endl;
}
}
#endif
#endif
#endif
+#endif
/******************************************************************************/
#ifndef WITH_LEAN
@@ -15865,27 +16177,21 @@ soap_sprint_fault(struct soap *soap, char *buf, size_t len)
{ if (soap_check_state(soap))
strncpy(buf, "Error: soap struct not initialized", len);
else if (soap->error)
- { const char *c, *v = NULL, *s, **d;
- d = soap_faultcode(soap);
- if (!*d)
+ { const char **c, *v = NULL, *s, *d;
+ c = soap_faultcode(soap);
+ if (!*c)
soap_set_fault(soap);
- c = *d;
if (soap->version == 2)
v = *soap_faultsubcode(soap);
s = *soap_faultstring(soap);
- d = soap_faultdetail(soap);
+ d = soap_check_faultdetail(soap);
#ifdef HAVE_SNPRINTF
-# ifdef WIN32
- _snprintf
-# else
- snprintf
-# endif
- (buf, len, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, c, v ? v : "no subcode", s ? s : "[no reason]", d && *d ? *d : "[no detail]");
+ soap_snprintf(buf, len, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
#else
- if (len > 40 + (v ? strlen(v) : 0) + (s ? strlen(s) : 0) + (d && *d ? strlen(*d) : 0))
- sprintf(buf, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, c, v ? v : "no subcode", s ? s : "[no reason]", d && *d ? *d : "[no detail]");
+ if (len > 40 + (v ? strlen(v) : 0) + (s ? strlen(s) : 0) + (d ? strlen(d) : 0))
+ sprintf(buf, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
else if (len > 40)
- sprintf(buf, "%s%d fault: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, c);
+ sprintf(buf, "%s%d fault: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c);
else
buf[0] = '\0';
#endif
@@ -15920,8 +16226,8 @@ soap_print_fault_location(struct soap *soap, FILE *fd)
fprintf(fd, "%s%c\n<!-- ** HERE ** -->\n", soap->buf, c1);
if (soap->bufidx < soap->buflen)
fprintf(fd, "%s\n", soap->buf + soap->bufidx);
- soap->buf[i] = c1;
- soap->buf[j] = c2;
+ soap->buf[i] = (char)c1;
+ soap->buf[j] = (char)c2;
}
#endif
}
@@ -15949,7 +16255,7 @@ soap_register_plugin_arg(struct soap *soap, int (*fcreate)(struct soap*, struct
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Registered '%s' plugin\n", p->id));
return SOAP_OK;
}
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin returned error %d (or fdelete callback not set)\n", p->id?p->id:"?", r));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin returned error %d (or fdelete callback not set)\n", p->id ? p->id : "?", r));
SOAP_FREE(soap, p);
return r;
}
diff --git a/dep/gsoap/stdsoap2.h b/dep/gsoap/stdsoap2.h
index 238b7f175ac..87185924135 100644
--- a/dep/gsoap/stdsoap2.h
+++ b/dep/gsoap/stdsoap2.h
@@ -1,10 +1,10 @@
/*
- stdsoap2.h 2.8.2
+ stdsoap2.h 2.8.10
gSOAP runtime engine
gSOAP XML Web services tools
-Copyright (C) 2000-2011, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2012, Robert van Engelen, Genivia Inc., All Rights Reserved.
This part of the software is released under ONE of the following licenses:
GPL, or the gSOAP public license, or Genivia's license for commercial use.
--------------------------------------------------------------------------------
@@ -24,7 +24,7 @@ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Robert A. van Engelen.
-Copyright (C) 2000-2011, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2012, Robert van Engelen, Genivia Inc., All Rights Reserved.
--------------------------------------------------------------------------------
GPL license.
@@ -51,6 +51,8 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
--------------------------------------------------------------------------------
*/
+#define GSOAP_VERSION 20810
+
#ifdef WITH_SOAPDEFS_H
# include "soapdefs.h" /* include user-defined stuff */
#endif
@@ -129,6 +131,13 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
+/* for legacy purposes we use WIN32 macro even though 64 bit is supported */
+#ifdef _WIN64
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+
#ifdef _WIN32_WCE
# ifndef UNDER_CE
# define UNDER_CE _WIN32_WCE
@@ -211,8 +220,14 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
+# define HAVE_STRTOD_L
+# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
+# if _MSC_VER >= 1300
+# define HAVE_STRTOLL // use _strtoi64
+# define HAVE_STRTOULL // use _strtoui64
+# endif
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_GMTIME
@@ -293,7 +308,6 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define HAVE_ISNAN
-# define HAVE_ISINF
# elif defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD)
# define HAVE_POLL
# define HAVE_SNPRINTF
@@ -472,6 +486,19 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define ULONG64 unsigned LONG64
# define SOAP_LONG_FORMAT "%ld"
# define SOAP_ULONG_FORMAT "%lu"
+# elif defined(SUN_OS)
+# define HAVE_SNPRINTF
+# define HAVE_STRRCHR
+# define HAVE_STRTOD
+# define HAVE_SSCANF
+# define HAVE_STRTOL
+# define HAVE_STRTOUL
+# define HAVE_SYS_TIMEB_H
+# define HAVE_FTIME
+# define HAVE_RAND_R
+# define HAVE_GETHOSTBYNAME_R
+# define HAVE_GMTIME_R
+# define HAVE_LOCALTIME_R
# else
/* Default assumptions for supported functions */
# define HAVE_SNPRINTF
@@ -515,11 +542,17 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
-/* native Win and HP-UX compilers don't like empty structs */
+/* native Win, HP-UX, and AIX compilers don't like empty structs */
#if defined(WIN32) || defined(HP_UX) || defined(_AIX41) || defined(_AIX43) || defined(VXWORKS)
# define WITH_NOEMPTYSTRUCT
#endif
+#ifdef WITH_PURE_VIRTUAL
+# define SOAP_PURE_VIRTUAL = 0
+#else
+# define SOAP_PURE_VIRTUAL
+#endif
+
#ifdef HP_UX
# undef HAVE_STRTOLL
# undef HAVE_STRTOULL
@@ -534,8 +567,11 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
/* if we have xlocale.h we use it to avoid decimal point conversion issues */
#ifdef WITH_C_LOCALE
-# include <locale.h>
-# include <xlocale.h>
+# ifdef WIN32
+# include <locale.h>
+# else
+# include <xlocale.h>
+# endif
#else
# undef HAVE_STRTOF_L
# undef HAVE_STRTOD_L
@@ -543,7 +579,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# undef HAVE_SPRINTF_L
#endif
-#ifdef TANDEM
+#ifdef TANDEM_NONSTOP
# define SOAP_BUFLEN (32767)
/*# define WITH_NOSTDLIB */ /* uncommment to remove stdlib dependences */
# define WITH_NOIO /* no IO dependences, e.g. remove TCP/IP */
@@ -586,6 +622,10 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# include <limits.h>
#endif
+#ifdef WITH_NTLM
+# include <ntlm.h>
+#endif
+
#ifdef HAVE_POLL
# include <poll.h>
#endif
@@ -672,14 +712,6 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define SOAP_WINSOCKINT size_t
#endif
-#ifdef WITH_IPV6
-# ifdef IPV6_V6ONLY
-# if !defined(WITH_NO_IPV6_V6ONLY) && !defined(WITH_IPV6_V6ONLY)
-# define WITH_NO_IPV6_V6ONLY /* turn on IPv6-IPv4 switching */
-# endif
-# endif
-#endif
-
#if defined(WITH_IPV6_V6ONLY) || defined(WITH_NO_IPV6_V6ONLY)
# ifndef WITH_IPV6
# define WITH_IPV6
@@ -691,9 +723,17 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# include <io.h>
# include <fcntl.h>
# endif
-# include <winsock2.h> /* Visual Studio 2005 users: you must install the Platform SDK (R2) */
-# include <ws2tcpip.h>
-# include <wspiapi.h>
+// When you get macro redefinition errors when compiling the code below:
+// try arrange your include list that <windows.h> is included after "stdsoap2.h"
+// or define _WINSOCKAPI_ first:
+// #define _WINSOCKAPI_ // stops windows.h including winsock.h
+// #include <windows.h>
+// #include "stdsoap2.h"
+# include <winsock2.h> /* Visual Studio 2005 users: install Platform SDK (R2) */
+# include <ws2tcpip.h>
+// # define _WSPIAPI_COUNTOF /* DEV NOTE: enble to fix problems with VC6 */
+// # include <wspiapi.h>
+# include <ws2spi.h> /* DEV NOTE: replaces older wspiapi.h above */
# ifdef WITH_IPV6
# define SOAP_GAI_STRERROR gai_strerrorA
# endif
@@ -790,9 +830,9 @@ extern "C" {
# endif
#elif defined(SOCKLEN_T)
# define SOAP_SOCKLEN_T SOCKLEN_T
-#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390) || defined(HP_UX)
+#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390)
# define SOAP_SOCKLEN_T socklen_t
-#elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS)
+#elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS) || defined(HP_UX)
# define SOAP_SOCKLEN_T int
#else
# define SOAP_SOCKLEN_T size_t
@@ -822,6 +862,12 @@ extern "C" {
# define FD_SETSIZE (1024)
#endif
+#ifdef WITH_LEAN
+# define SOAP_CHK_EOF SOAP_EOF
+#else
+# define SOAP_CHK_EOF (soap->error ? soap->error : SOAP_EOF)
+#endif
+
#if defined(SYMBIAN)
# define LONG64 long
# define ULONG64 unsigned LONG64
@@ -874,7 +920,6 @@ extern "C" {
#elif defined(PALM)
# define soap_int32 Int32
#elif defined(_AIX)
-# define SOAP_NEW(type) new type /* AIX compilers don't like new (t) */
# if defined(_AIX43)
# define soap_int32 int32_t
# else
@@ -1133,6 +1178,14 @@ extern const char soap_base64o[], soap_base64i[];
#define soap_isninfd(n) ((n) < 0 && soap_isinf(n))
#define soap_isninff(n) ((n) < 0 && soap_isinf(n))
+#ifdef HAVE_SNPRINTF
+# ifdef WIN32
+# define soap_snprintf _snprintf
+# else
+# define soap_snprintf snprintf
+# endif
+#endif
+
/* gSOAP error codes */
#define SOAP_EOF EOF
@@ -1184,6 +1237,8 @@ extern const char soap_base64o[], soap_base64i[];
#define SOAP_OCCURS 44
#define SOAP_LENGTH 45
#define SOAP_FD_EXCEEDED 46
+#define SOAP_UTF_ERROR 47
+#define SOAP_NTLM_ERROR 48
#define soap_xml_error_check(e) ((e) == SOAP_TAG_MISMATCH || (e) == SOAP_NO_TAG || (e) == SOAP_SYNTAX_ERROR || (e) == SOAP_NAMESPACE || (e) == SOAP_DUPLICATE_ID || (e) == SOAP_MISSING_ID || (e) == SOAP_REQUIRED || (e) == SOAP_PROHIBITED || (e) == SOAP_OCCURS || (e) == SOAP_LENGTH || (e) == SOAP_NULL || (e) == SOAP_HREF)
#define soap_soap_error_check(e) ((e) == SOAP_CLI_FAULT || (e) == SOAP_SVR_FAULT || (e) == SOAP_VERSIONMISMATCH || (e) == SOAP_MUSTUNDERSTAND || (e) == SOAP_FAULT || (e) == SOAP_NO_METHOD)
@@ -1199,7 +1254,7 @@ extern const char soap_base64o[], soap_base64i[];
/* Exceptional gSOAP HTTP server response status codes >= 1000 */
#define SOAP_STOP 1000 /* No HTTP response */
-#define SOAP_FORM 1001 /* Form request/response */
+#define SOAP_FORM 1001 /* Request (form) data is present, no HTTP response */
#define SOAP_HTML 1002 /* Custom HTML response */
#define SOAP_FILE 1003 /* Custom file-based response */
@@ -1208,6 +1263,9 @@ extern const char soap_base64o[], soap_base64i[];
#define SOAP_POST 2000 /* POST request */
#define SOAP_POST_FILE 2001 /* Custom file-based POST request */
#define SOAP_GET 2002 /* GET request */
+#define SOAP_PUT 2003 /* PUT request */
+#define SOAP_DEL 2004 /* DELETE request */
+#define SOAP_CONNECT 2005 /* CONNECT request */
/* gSOAP DIME */
@@ -1254,21 +1312,22 @@ typedef soap_int32 soap_mode;
#define SOAP_XML_DEFAULTNS 0x00008000 /* out: emit xmlns="..." */
#define SOAP_XML_CANONICAL 0x00010000 /* out: excC14N canonical XML */
#define SOAP_XML_TREE 0x00020000 /* out: XML tree (no id/ref) */
-#define SOAP_XML_GRAPH 0x00040000 /* see DOM manual */
-#define SOAP_XML_NIL 0x00080000 /* out: NULLs as xsi:nil */
+#define SOAP_XML_NIL 0x00040000 /* out: NULLs as xsi:nil */
+#define SOAP_XML_NOTYPE 0x00080000 /* out: NULLs as xsi:nil */
-#define SOAP_C_NOIOB 0x00100000 /* don't fault on array index out of bounds (just ignore) */
-#define SOAP_C_UTFSTRING 0x00200000 /* (de)serialize strings with UTF8 content */
-#define SOAP_C_MBSTRING 0x00400000 /* (de)serialize strings with multi-byte content */
-#define SOAP_C_NILSTRING 0x00800000 /* serialize empty strings as nil (omitted) */
+#define SOAP_DOM_TREE 0x00100000 /* see DOM manual */
+#define SOAP_DOM_NODE 0x00200000
+#define SOAP_DOM_ASIS 0x00400000
-#define SOAP_XML_DOM 0x01000000
+#define SOAP_C_NOIOB 0x01000000 /* don't fault on array index out of bounds (just ignore) */
+#define SOAP_C_UTFSTRING 0x02000000 /* (de)serialize strings with UTF8 content */
+#define SOAP_C_MBSTRING 0x04000000 /* (de)serialize strings with multi-byte content */
+#define SOAP_C_NILSTRING 0x08000000 /* serialize empty strings as nil (omitted) */
-#define SOAP_DOM_TREE 0x02000000
-#define SOAP_DOM_NODE 0x04000000
-#define SOAP_DOM_ASIS 0x08000000
+#define SOAP_XML_DOM 0x10000000 /* enable internal DOM */
+#define SOAP_XML_GRAPH 0x20000000 /* id-ref graph in DOM */
-#define SOAP_MIME_POSTCHECK 0x10000000 /* MIME flag (internal) */
+#define SOAP_MIME_POSTCHECK 0x40000000 /* MIME flag (internal) */
#define SOAP_SEC_WSUID 0x80000000 /* Add Body wsu:Id */
@@ -1303,7 +1362,7 @@ typedef soap_int32 soap_mode;
#define soap_check_state(soap) (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY))
-/* parts, states, and events */
+/* parts */
#define SOAP_BEGIN 0
#define SOAP_IN_ENVELOPE 2
@@ -1315,8 +1374,11 @@ typedef soap_int32 soap_mode;
#define SOAP_END_ENVELOPE 8
#define SOAP_END 9
-#define SOAP_SEC_BEGIN 10
-#define SOAP_SEC_SIGN 11
+/* events */
+
+#define SOAP_SEC_BEGIN 1
+#define SOAP_SEC_SIGN 2
+#define SOAP_SEC_DECRYPT 3
/* DEBUG macros */
@@ -1349,13 +1411,17 @@ typedef soap_int32 soap_mode;
#endif
#ifndef SOAP_NEW /* use C++ new operator */
-# if (__GNUC__ <= 2) && !defined(__BORLANDC__) /* Borland uses GNU C? */
+# if (defined(__GNUC__) && (__GNUC__ <= 2) && !defined(__BORLANDC__)) || defined(__clang__) || defined(_AIX)
# define SOAP_NEW(type) new type /* old form w/o parenthesis */
# else
# define SOAP_NEW(type) new (type) /* prefer with parenthesis */
# endif
#endif
+#ifndef SOAP_PLACEMENT_NEW
+# define SOAP_PLACEMENT_NEW(buf, type) new (buf) type
+#endif
+
#ifndef SOAP_NEW_COPY /* use C++ new operator for ::copy() */
# define SOAP_NEW_COPY(clas) new clas /* prefer w/o parenthesis */
#endif
@@ -1792,9 +1858,15 @@ struct SOAP_STD_API soap
struct soap_plugin *plugins; /* linked list of plug-in data */
const char *userid; /* HTTP Basic authorization userid */
const char *passwd; /* HTTP Basic authorization passwd */
+ const char *authrealm; /* HTTP authentication realm (NTLM domain) */
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
+ const char *ntlm_challenge; /* HTTP NTLM challenge key string */
+ short ntlm_auth; /* HTTP NTLM authentication type */
+ short ntlm_stage; /* HTTP NTLM stage 0..3 */
+#endif
int (*fpost)(struct soap*, const char*, const char*, int, const char*, const char*, size_t);
int (*fget)(struct soap*); /* HTTP GET hook (not set by default) */
- int (*fput)(struct soap*); /* HTTP PUT hook (handled as POST) */
+ int (*fput)(struct soap*); /* HTTP PUT hook (handled as POST by default) */
int (*fdel)(struct soap*); /* HTTP DELETE hook (not set by default) */
int (*fopt)(struct soap*); /* HTTP OPTIONS hook (not set by default) */
int (*fhead)(struct soap*); /* HTTP HEAD hook (not set by default) */
@@ -1847,11 +1919,13 @@ struct SOAP_STD_API soap
size_t (*fmimeread)(struct soap*, void*, char*, size_t);
int (*fmimewrite)(struct soap*, void*, const char*, size_t);
#endif
- SOAP_SOCKET master;
- SOAP_SOCKET socket;
+ SOAP_SOCKET master; /* socket bound to TCP/IP port */
+ SOAP_SOCKET socket; /* socket to send and receive */
+ SOAP_SOCKET sendsk; /* socket to send (overrides ::socket) */
+ SOAP_SOCKET recvsk; /* socket to receive (overrides ::socket) */
#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
- std::ostream *os;
- std::istream *is;
+ std::ostream *os; /* stream to send */
+ std::istream *is; /* stream to receive */
#else
void *os; /* preserve struct size */
void *is; /* preserve struct size */
@@ -1860,8 +1934,8 @@ struct SOAP_STD_API soap
int sendfd; /* WinCE FD to send */
int recvfd; /* WinCE FD to receive */
#else
- FILE *sendfd;
- FILE *recvfd;
+ FILE *sendfd; /* FD to send */
+ FILE *recvfd; /* FD to receive */
#endif
size_t bufidx; /* index in soap.buf[] */
size_t buflen; /* length of soap.buf[] content */
@@ -1885,9 +1959,9 @@ struct SOAP_STD_API soap
char arraySize[SOAP_TAGLEN];
char arrayOffset[SOAP_TAGLEN];
short other;
- short position;
- int positions[SOAP_MAXDIMS];
short root;
+ int position;
+ int positions[SOAP_MAXDIMS];
struct soap_attribute *attributes; /* attribute list */
short encoding; /* when set, output encodingStyle */
short mustUnderstand; /* a mustUnderstand element was parsed or is output */
@@ -1895,6 +1969,7 @@ struct SOAP_STD_API soap
short ns; /* when not set, output full xmlns bindings */
short part; /* SOAP part state (header or body) */
short event; /* engine events and states for use by plugins */
+ unsigned int evlev; /* event level */
short alloced;
short peeked;
size_t chunksize;
@@ -1903,7 +1978,6 @@ struct SOAP_STD_API soap
char path[SOAP_TAGLEN];
char host[SOAP_TAGLEN];
char *action;
- char *authrealm; /* HTTP authentication realm */
char *prolog; /* XML declaration prolog */
unsigned long ip; /* IP number */
int port; /* port number */
@@ -1990,7 +2064,11 @@ struct SOAP_STD_API soap
char session_host[SOAP_TAGLEN];
int session_port;
#ifdef WITH_C_LOCALE
+# ifdef WIN32
+ _locale_t c_locale; /* set to C locale by default */
+# else
locale_t c_locale; /* set to C locale by default */
+# endif
#else
void *c_locale;
#endif
@@ -2073,13 +2151,26 @@ soap_wchar soap_get0(struct soap*);
soap_wchar soap_get1(struct soap*);
#endif
+#define soap_versioning_paste(name, ext) name##_LIBRARY_VERSION_REQUIRED_##ext
+#define soap_versioning_ext(name, ext) soap_versioning_paste(name, ext)
+#define soap_versioning(name) soap_versioning_ext(name, GSOAP_VERSION)
+
+#define soap_init(soap) soap_init1(soap, SOAP_IO_DEFAULT)
+#define soap_init1(soap, mode) soap_init2(soap, mode, mode)
+#define soap_init2(soap, imode, omode) soap_versioning(soap_init)(soap, imode, omode)
+
+#define soap_new() soap_new1(SOAP_IO_DEFAULT)
+#define soap_new1(mode) soap_new2(mode, mode)
+#define soap_new2(imode, omode) soap_versioning(soap_new)(imode, omode)
+
#define soap_revget1(soap) ((soap)->bufidx--)
#define soap_unget(soap, c) ((soap)->ahead = c)
#define soap_register_plugin(soap, plugin) soap_register_plugin_arg(soap, plugin, NULL)
-#define soap_imode(soap, n) ((soap)->mode = (soap)->imode = (n))
+#define soap_mode(soap, n) ((soap)->mode = (soap)->imode = (soap)->omode = (n))
+#define soap_imode(soap, n) ((soap)->imode = (n))
+#define soap_omode(soap, n) ((soap)->omode = (n))
#define soap_set_imode(soap, n) ((soap)->imode |= (n))
#define soap_clr_imode(soap, n) ((soap)->imode &= ~(n))
-#define soap_omode(soap, n) ((soap)->mode = (soap)->omode = (n))
#define soap_set_omode(soap, n) ((soap)->omode |= (n))
#define soap_clr_omode(soap, n) ((soap)->omode &= ~(n))
#define soap_set_mode(soap, n) ((soap)->imode |= (n), (soap)->omode |= (n))
@@ -2104,6 +2195,18 @@ soap_wchar soap_get1(struct soap*);
SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char *s, char **t, int b);
#endif
+#ifdef WIN32
+# define soap_strtoll _strtoi64
+#else
+# define soap_strtoll strtoll
+#endif
+
+#ifdef WIN32
+# define soap_strtoull _strtoui64
+#else
+# define soap_strtoull strtoull
+#endif
+
#if defined(WITH_OPENSSL)
# define soap_random soap_rand()
SOAP_FMAC1 int SOAP_FMAC2 soap_rand(void);
@@ -2131,18 +2234,29 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_rand(void);
# define soap_markelement(s, p, n) (0)
#endif
-SOAP_FMAC1 void SOAP_FMAC2 soap_header(struct soap*);
-SOAP_FMAC1 void SOAP_FMAC2 soap_fault(struct soap*);
-SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultcode(struct soap*);
-SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultsubcode(struct soap*);
-SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultstring(struct soap*);
-SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultdetail(struct soap*);
+/* soap_traverse() traversal/walker routines take walker function arguments */
+typedef void soap_walker(struct soap*, void*, int, const char*, const char*);
+
+SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap);
+SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap);
+
+#ifndef WITH_NOGLOBAL
+SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap*);
+SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap*);
+SOAP_FMAC3 const char** SOAP_FMAC4 soap_faultcode(struct soap*);
+SOAP_FMAC3 const char** SOAP_FMAC4 soap_faultsubcode(struct soap*);
+SOAP_FMAC3 const char** SOAP_FMAC4 soap_faultstring(struct soap*);
+SOAP_FMAC3 const char** SOAP_FMAC4 soap_faultdetail(struct soap*);
+SOAP_FMAC3 const char* SOAP_FMAC4 soap_check_faultsubcode(struct soap*);
+SOAP_FMAC3 const char* SOAP_FMAC4 soap_check_faultdetail(struct soap*);
+SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap*);
+#endif
+
SOAP_FMAC1 void SOAP_FMAC2 soap_serializeheader(struct soap*);
-SOAP_FMAC1 int SOAP_FMAC2 soap_putheader(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_getheader(struct soap*);
-SOAP_FMAC1 void SOAP_FMAC2 soap_serializefault(struct soap*);
-SOAP_FMAC1 int SOAP_FMAC2 soap_putfault(struct soap*);
+SOAP_FMAC1 int SOAP_FMAC2 soap_putheader(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_getfault(struct soap*);
+SOAP_FMAC1 int SOAP_FMAC2 soap_putfault(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_init(void);
SOAP_FMAC1 int SOAP_FMAC2 soap_poll(struct soap*);
@@ -2234,7 +2348,7 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_end_recv(struct soap*);
SOAP_FMAC1 void* SOAP_FMAC2 soap_malloc(struct soap*, size_t);
SOAP_FMAC1 void SOAP_FMAC2 soap_dealloc(struct soap*, void*);
SOAP_FMAC1 struct soap_clist * SOAP_FMAC2 soap_link(struct soap*, void*, int, int, int (*fdelete)(struct soap_clist*));
-SOAP_FMAC1 void SOAP_FMAC2 soap_unlink(struct soap*, const void*);
+SOAP_FMAC1 int SOAP_FMAC2 soap_unlink(struct soap*, const void*);
SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_del(struct soap*);
@@ -2262,18 +2376,15 @@ SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffset(struct soap*, int);
SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffsets(struct soap*, const int *, int);
SOAP_FMAC1 int SOAP_FMAC2 soap_closesock(struct soap*);
+SOAP_FMAC1 int SOAP_FMAC2 soap_force_closesock(struct soap*);
-SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_new(void);
-SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_new1(soap_mode);
-SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_new2(soap_mode, soap_mode);
+SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_versioning(soap_new)(soap_mode, soap_mode);
SOAP_FMAC1 void SOAP_FMAC2 soap_free(struct soap*);
SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy(const struct soap*);
SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy_context(struct soap*, const struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_copy_stream(struct soap*, struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_free_stream(struct soap*);
-SOAP_FMAC1 void SOAP_FMAC2 soap_init(struct soap*);
-SOAP_FMAC1 void SOAP_FMAC2 soap_init1(struct soap*, soap_mode);
-SOAP_FMAC1 void SOAP_FMAC2 soap_init2(struct soap*, soap_mode, soap_mode);
+SOAP_FMAC1 void SOAP_FMAC2 soap_versioning(soap_init)(struct soap*, soap_mode, soap_mode);
SOAP_FMAC1 void SOAP_FMAC2 soap_done(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_cleanup(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_begin(struct soap*);
@@ -2353,6 +2464,7 @@ SOAP_FMAC1 char* SOAP_FMAC2 soap_next_block(struct soap*, struct soap_blist*);
SOAP_FMAC1 size_t SOAP_FMAC2 soap_block_size(struct soap*, struct soap_blist*);
SOAP_FMAC1 char* SOAP_FMAC2 soap_save_block(struct soap*, struct soap_blist*, char*, int);
SOAP_FMAC1 void SOAP_FMAC2 soap_end_block(struct soap*, struct soap_blist*);
+SOAP_FMAC1 void SOAP_FMAC2 soap_update_pointers(struct soap *soap, char *start, char *end, char *p1, char *p2);
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_out(struct soap*);
SOAP_FMAC1 int soap_envelope_end_out(struct soap*);
@@ -2382,8 +2494,10 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_recv_fault(struct soap*, int check);
SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault(struct soap*, FILE*);
SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault_location(struct soap*, FILE*);
# ifndef WITH_LEAN
-# ifdef __cplusplus
+# ifndef WITH_COMPAT
+# ifdef __cplusplus
SOAP_FMAC1 void SOAP_FMAC2 soap_stream_fault(struct soap*, std::ostream&);
+# endif
# endif
SOAP_FMAC1 char* SOAP_FMAC2 soap_sprint_fault(struct soap*, char*, size_t);
# endif
diff --git a/dep/gsoap/tc_upgrades.txt b/dep/gsoap/tc_upgrades.txt
new file mode 100644
index 00000000000..04298b2ae82
--- /dev/null
+++ b/dep/gsoap/tc_upgrades.txt
@@ -0,0 +1,12 @@
+* Generate new headers based on TrinityCore soap-services stub:
+gsoap/bin/linux386/soapcpp2 -1 -S -L -w -x -y soap.stub
+
+* Copy the following files from the gsoap package:
+gsoap/stdsoap2.h
+gsoap/stdsoap2.cpp
+
+* Remove the following files after generation:
+ns1.nsmap
+soapObject.h
+
+* Test compile and see if SOAP works...
diff --git a/dep/utf8cpp/utf8/checked.h b/dep/utf8cpp/utf8/checked.h
index a1d2035364d..3b00644444c 100644
--- a/dep/utf8cpp/utf8/checked.h
+++ b/dep/utf8cpp/utf8/checked.h
@@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.
namespace utf8
{
// Base for the exceptions that may be thrown from the library
- class exception : public std::exception {
+ class exception : public ::std::exception {
};
// Exceptions that may be thrown from the library functions.
@@ -69,12 +69,38 @@ namespace utf8
/// The library API - functions intended to be called by the users
+ template <typename octet_iterator>
+ octet_iterator append(uint32_t cp, octet_iterator result)
+ {
+ if (!utf8::internal::is_code_point_valid(cp))
+ throw invalid_code_point(cp);
+
+ if (cp < 0x80) // one octet
+ *(result++) = static_cast<uint8_t>(cp);
+ else if (cp < 0x800) { // two octets
+ *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
+ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+ }
+ else if (cp < 0x10000) { // three octets
+ *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
+ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+ }
+ else { // four octets
+ *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
+ *(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f) | 0x80);
+ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+ }
+ return result;
+ }
+
template <typename octet_iterator, typename output_iterator>
output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
{
while (start != end) {
octet_iterator sequence_start = start;
- internal::utf_error err_code = internal::validate_next(start, end);
+ internal::utf_error err_code = utf8::internal::validate_next(start, end);
switch (err_code) {
case internal::UTF8_OK :
for (octet_iterator it = sequence_start; it != start; ++it)
@@ -83,16 +109,16 @@ namespace utf8
case internal::NOT_ENOUGH_ROOM:
throw not_enough_room();
case internal::INVALID_LEAD:
- append (replacement, out);
+ utf8::append (replacement, out);
++start;
break;
case internal::INCOMPLETE_SEQUENCE:
case internal::OVERLONG_SEQUENCE:
case internal::INVALID_CODE_POINT:
- append (replacement, out);
+ utf8::append (replacement, out);
++start;
// just one replacement mark for the sequence
- while (internal::is_trail(*start) && start != end)
+ while (start != end && utf8::internal::is_trail(*start))
++start;
break;
}
@@ -103,41 +129,15 @@ namespace utf8
template <typename octet_iterator, typename output_iterator>
inline output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out)
{
- static const uint32_t replacement_marker = internal::mask16(0xfffd);
- return replace_invalid(start, end, out, replacement_marker);
- }
-
- template <typename octet_iterator>
- octet_iterator append(uint32_t cp, octet_iterator result)
- {
- if (!internal::is_code_point_valid(cp))
- throw invalid_code_point(cp);
-
- if (cp < 0x80) // one octet
- *(result++) = static_cast<uint8_t>(cp);
- else if (cp < 0x800) { // two octets
- *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
- }
- else if (cp < 0x10000) { // three octets
- *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
- }
- else { // four octets
- *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
- *(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f) | 0x80);
- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
- }
- return result;
+ static const uint32_t replacement_marker = utf8::internal::mask16(0xfffd);
+ return utf8::replace_invalid(start, end, out, replacement_marker);
}
template <typename octet_iterator>
uint32_t next(octet_iterator& it, octet_iterator end)
{
uint32_t cp = 0;
- internal::utf_error err_code = internal::validate_next(it, end, &cp);
+ internal::utf_error err_code = utf8::internal::validate_next(it, end, cp);
switch (err_code) {
case internal::UTF8_OK :
break;
@@ -156,18 +156,22 @@ namespace utf8
template <typename octet_iterator>
uint32_t peek_next(octet_iterator it, octet_iterator end)
{
- return next(it, end);
+ return utf8::next(it, end);
}
template <typename octet_iterator>
uint32_t prior(octet_iterator& it, octet_iterator start)
{
+ // can't do much if it == start
+ if (it == start)
+ throw not_enough_room();
+
octet_iterator end = it;
- while (internal::is_trail(*(--it)))
- if (it < start)
+ // Go back until we hit either a lead octet or start
+ while (utf8::internal::is_trail(*(--it)))
+ if (it == start)
throw invalid_utf8(*it); // error - no lead byte in the sequence
- octet_iterator temp = it;
- return next(temp, end);
+ return utf8::peek_next(it, end);
}
/// Deprecated in versions that include "prior"
@@ -175,18 +179,18 @@ namespace utf8
uint32_t previous(octet_iterator& it, octet_iterator pass_start)
{
octet_iterator end = it;
- while (internal::is_trail(*(--it)))
+ while (utf8::internal::is_trail(*(--it)))
if (it == pass_start)
throw invalid_utf8(*it); // error - no lead byte in the sequence
octet_iterator temp = it;
- return next(temp, end);
+ return utf8::next(temp, end);
}
template <typename octet_iterator, typename distance_type>
void advance (octet_iterator& it, distance_type n, octet_iterator end)
{
for (distance_type i = 0; i < n; ++i)
- next(it, end);
+ utf8::next(it, end);
}
template <typename octet_iterator>
@@ -195,7 +199,7 @@ namespace utf8
{
typename std::iterator_traits<octet_iterator>::difference_type dist;
for (dist = 0; first < last; ++dist)
- next(first, last);
+ utf8::next(first, last);
return dist;
}
@@ -203,12 +207,12 @@ namespace utf8
octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
{
while (start != end) {
- uint32_t cp = internal::mask16(*start++);
+ uint32_t cp = utf8::internal::mask16(*start++);
// Take care of surrogate pairs first
- if (internal::is_lead_surrogate(cp)) {
+ if (utf8::internal::is_lead_surrogate(cp)) {
if (start != end) {
- uint32_t trail_surrogate = internal::mask16(*start++);
- if (internal::is_trail_surrogate(trail_surrogate))
+ uint32_t trail_surrogate = utf8::internal::mask16(*start++);
+ if (utf8::internal::is_trail_surrogate(trail_surrogate))
cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET;
else
throw invalid_utf16(static_cast<uint16_t>(trail_surrogate));
@@ -218,10 +222,10 @@ namespace utf8
}
// Lone trail surrogate
- else if (internal::is_trail_surrogate(cp))
+ else if (utf8::internal::is_trail_surrogate(cp))
throw invalid_utf16(static_cast<uint16_t>(cp));
- result = append(cp, result);
+ result = utf8::append(cp, result);
}
return result;
}
@@ -230,7 +234,7 @@ namespace utf8
u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
{
while (start != end) {
- uint32_t cp = next(start, end);
+ uint32_t cp = utf8::next(start, end);
if (cp > 0xffff) { //make a surrogate pair
*result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
*result++ = static_cast<uint16_t>((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN);
@@ -245,7 +249,7 @@ namespace utf8
octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result)
{
while (start != end)
- result = append(*(start++), result);
+ result = utf8::append(*(start++), result);
return result;
}
@@ -254,7 +258,7 @@ namespace utf8
u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
{
while (start != end)
- (*result++) = next(start, end);
+ (*result++) = utf8::next(start, end);
return result;
}
@@ -280,7 +284,7 @@ namespace utf8
uint32_t operator * () const
{
octet_iterator temp = it;
- return next(temp, range_end);
+ return utf8::next(temp, range_end);
}
bool operator == (const iterator& rhs) const
{
@@ -294,24 +298,24 @@ namespace utf8
}
iterator& operator ++ ()
{
- next(it, range_end);
+ utf8::next(it, range_end);
return *this;
}
iterator operator ++ (int)
{
iterator temp = *this;
- next(it, range_end);
+ utf8::next(it, range_end);
return temp;
}
iterator& operator -- ()
{
- prior(it, range_start);
+ utf8::prior(it, range_start);
return *this;
}
iterator operator -- (int)
{
iterator temp = *this;
- prior(it, range_start);
+ utf8::prior(it, range_start);
return temp;
}
}; // class iterator
diff --git a/dep/utf8cpp/utf8/core.h b/dep/utf8cpp/utf8/core.h
index ec709f12006..693d388c078 100644
--- a/dep/utf8cpp/utf8/core.h
+++ b/dep/utf8cpp/utf8/core.h
@@ -68,7 +68,7 @@ namespace internal
template<typename octet_type>
inline bool is_trail(octet_type oc)
{
- return ((mask8(oc) >> 6) == 0x2);
+ return ((utf8::internal::mask8(oc) >> 6) == 0x2);
}
template <typename u16>
@@ -92,14 +92,14 @@ namespace internal
template <typename u32>
inline bool is_code_point_valid(u32 cp)
{
- return (cp <= CODE_POINT_MAX && !is_surrogate(cp) && cp != 0xfffe && cp != 0xffff);
+ return (cp <= CODE_POINT_MAX && !utf8::internal::is_surrogate(cp));
}
template <typename octet_iterator>
inline typename std::iterator_traits<octet_iterator>::difference_type
sequence_length(octet_iterator lead_it)
{
- uint8_t lead = mask8(*lead_it);
+ uint8_t lead = utf8::internal::mask8(*lead_it);
if (lead < 0x80)
return 1;
else if ((lead >> 5) == 0x6)
@@ -133,123 +133,94 @@ namespace internal
enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT};
- /// get_sequence_x functions decode utf-8 sequences of the length x
+ /// Helper for get_sequence_x
+ template <typename octet_iterator>
+ utf_error increase_safely(octet_iterator& it, octet_iterator end)
+ {
+ if (++it == end)
+ return NOT_ENOUGH_ROOM;
+
+ if (!utf8::internal::is_trail(*it))
+ return INCOMPLETE_SEQUENCE;
+
+ return UTF8_OK;
+ }
+ #define UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(IT, END) {utf_error ret = increase_safely(IT, END); if (ret != UTF8_OK) return ret;}
+
+ /// get_sequence_x functions decode utf-8 sequences of the length x
template <typename octet_iterator>
- utf_error get_sequence_1(octet_iterator& it, octet_iterator end, uint32_t* code_point)
+ utf_error get_sequence_1(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
- if (it != end) {
- if (code_point)
- *code_point = mask8(*it);
- return UTF8_OK;
- }
- return NOT_ENOUGH_ROOM;
+ if (it == end)
+ return NOT_ENOUGH_ROOM;
+
+ code_point = utf8::internal::mask8(*it);
+
+ return UTF8_OK;
}
template <typename octet_iterator>
- utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t* code_point)
+ utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
- utf_error ret_code = NOT_ENOUGH_ROOM;
+ if (it == end)
+ return NOT_ENOUGH_ROOM;
+
+ code_point = utf8::internal::mask8(*it);
- if (it != end) {
- uint32_t cp = mask8(*it);
- if (++it != end) {
- if (is_trail(*it)) {
- cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
+ UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
- if (code_point)
- *code_point = cp;
- ret_code = UTF8_OK;
- }
- else
- ret_code = INCOMPLETE_SEQUENCE;
- }
- else
- ret_code = NOT_ENOUGH_ROOM;
- }
+ code_point = ((code_point << 6) & 0x7ff) + ((*it) & 0x3f);
- return ret_code;
+ return UTF8_OK;
}
template <typename octet_iterator>
- utf_error get_sequence_3(octet_iterator& it, octet_iterator end, uint32_t* code_point)
+ utf_error get_sequence_3(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
- utf_error ret_code = NOT_ENOUGH_ROOM;
-
- if (it != end) {
- uint32_t cp = mask8(*it);
- if (++it != end) {
- if (is_trail(*it)) {
- cp = ((cp << 12) & 0xffff) + ((mask8(*it) << 6) & 0xfff);
- if (++it != end) {
- if (is_trail(*it)) {
- cp += (*it) & 0x3f;
-
- if (code_point)
- *code_point = cp;
- ret_code = UTF8_OK;
- }
- else
- ret_code = INCOMPLETE_SEQUENCE;
- }
- else
- ret_code = NOT_ENOUGH_ROOM;
- }
- else
- ret_code = INCOMPLETE_SEQUENCE;
- }
- else
- ret_code = NOT_ENOUGH_ROOM;
- }
+ if (it == end)
+ return NOT_ENOUGH_ROOM;
+
+ code_point = utf8::internal::mask8(*it);
+
+ UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
+
+ code_point = ((code_point << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff);
+
+ UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
- return ret_code;
+ code_point += (*it) & 0x3f;
+
+ return UTF8_OK;
}
template <typename octet_iterator>
- utf_error get_sequence_4(octet_iterator& it, octet_iterator end, uint32_t* code_point)
+ utf_error get_sequence_4(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
- utf_error ret_code = NOT_ENOUGH_ROOM;
-
- if (it != end) {
- uint32_t cp = mask8(*it);
- if (++it != end) {
- if (is_trail(*it)) {
- cp = ((cp << 18) & 0x1fffff) + ((mask8(*it) << 12) & 0x3ffff);
- if (++it != end) {
- if (is_trail(*it)) {
- cp += (mask8(*it) << 6) & 0xfff;
- if (++it != end) {
- if (is_trail(*it)) {
- cp += (*it) & 0x3f;
-
- if (code_point)
- *code_point = cp;
- ret_code = UTF8_OK;
- }
- else
- ret_code = INCOMPLETE_SEQUENCE;
- }
- else
- ret_code = NOT_ENOUGH_ROOM;
- }
- else
- ret_code = INCOMPLETE_SEQUENCE;
- }
- else
- ret_code = NOT_ENOUGH_ROOM;
- }
- else
- ret_code = INCOMPLETE_SEQUENCE;
- }
- else
- ret_code = NOT_ENOUGH_ROOM;
- }
+ if (it == end)
+ return NOT_ENOUGH_ROOM;
- return ret_code;
+ code_point = utf8::internal::mask8(*it);
+
+ UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
+
+ code_point = ((code_point << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
+
+ UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
+
+ code_point += (utf8::internal::mask8(*it) << 6) & 0xfff;
+
+ UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
+
+ code_point += (*it) & 0x3f;
+
+ return UTF8_OK;
}
+ #undef UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR
+
template <typename octet_iterator>
- utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t* code_point)
+ utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
// Save the original value of it so we can go back in case of failure
// Of course, it does not make much sense with i.e. stream iterators
@@ -258,34 +229,33 @@ namespace internal
uint32_t cp = 0;
// Determine the sequence length based on the lead octet
typedef typename std::iterator_traits<octet_iterator>::difference_type octet_difference_type;
- octet_difference_type length = sequence_length(it);
- if (length == 0)
- return INVALID_LEAD;
+ const octet_difference_type length = utf8::internal::sequence_length(it);
- // Now that we have a valid sequence length, get trail octets and calculate the code point
+ // Get trail octets and calculate the code point
utf_error err = UTF8_OK;
switch (length) {
+ case 0:
+ return INVALID_LEAD;
case 1:
- err = get_sequence_1(it, end, &cp);
+ err = utf8::internal::get_sequence_1(it, end, cp);
break;
case 2:
- err = get_sequence_2(it, end, &cp);
+ err = utf8::internal::get_sequence_2(it, end, cp);
break;
case 3:
- err = get_sequence_3(it, end, &cp);
+ err = utf8::internal::get_sequence_3(it, end, cp);
break;
case 4:
- err = get_sequence_4(it, end, &cp);
+ err = utf8::internal::get_sequence_4(it, end, cp);
break;
}
if (err == UTF8_OK) {
// Decoding succeeded. Now, security checks...
- if (is_code_point_valid(cp)) {
- if (!is_overlong_sequence(cp, length)){
+ if (utf8::internal::is_code_point_valid(cp)) {
+ if (!utf8::internal::is_overlong_sequence(cp, length)){
// Passed! Return here.
- if (code_point)
- *code_point = cp;
+ code_point = cp;
++it;
return UTF8_OK;
}
@@ -303,7 +273,8 @@ namespace internal
template <typename octet_iterator>
inline utf_error validate_next(octet_iterator& it, octet_iterator end) {
- return validate_next(it, end, 0);
+ uint32_t ignored;
+ return utf8::internal::validate_next(it, end, ignored);
}
} // namespace internal
@@ -318,7 +289,7 @@ namespace internal
{
octet_iterator result = start;
while (result != end) {
- internal::utf_error err_code = internal::validate_next(result, end);
+ utf8::internal::utf_error err_code = utf8::internal::validate_next(result, end);
if (err_code != internal::UTF8_OK)
return result;
}
@@ -328,27 +299,27 @@ namespace internal
template <typename octet_iterator>
inline bool is_valid(octet_iterator start, octet_iterator end)
{
- return (find_invalid(start, end) == end);
+ return (utf8::find_invalid(start, end) == end);
}
template <typename octet_iterator>
inline bool starts_with_bom (octet_iterator it, octet_iterator end)
{
return (
- ((it != end) && (internal::mask8(*it++)) == bom[0]) &&
- ((it != end) && (internal::mask8(*it++)) == bom[1]) &&
- ((it != end) && (internal::mask8(*it)) == bom[2])
+ ((it != end) && (utf8::internal::mask8(*it++)) == bom[0]) &&
+ ((it != end) && (utf8::internal::mask8(*it++)) == bom[1]) &&
+ ((it != end) && (utf8::internal::mask8(*it)) == bom[2])
);
}
- //Deprecated in release 2.3
+ //Deprecated in release 2.3
template <typename octet_iterator>
inline bool is_bom (octet_iterator it)
{
return (
- (internal::mask8(*it++)) == bom[0] &&
- (internal::mask8(*it++)) == bom[1] &&
- (internal::mask8(*it)) == bom[2]
+ (utf8::internal::mask8(*it++)) == bom[0] &&
+ (utf8::internal::mask8(*it++)) == bom[1] &&
+ (utf8::internal::mask8(*it)) == bom[2]
);
}
} // namespace utf8
diff --git a/dep/utf8cpp/utf8/unchecked.h b/dep/utf8cpp/utf8/unchecked.h
index 2f3eb4d1d02..b4547fad945 100644
--- a/dep/utf8cpp/utf8/unchecked.h
+++ b/dep/utf8cpp/utf8/unchecked.h
@@ -60,7 +60,7 @@ namespace utf8
template <typename octet_iterator>
uint32_t next(octet_iterator& it)
{
- uint32_t cp = internal::mask8(*it);
+ uint32_t cp = utf8::internal::mask8(*it);
typename std::iterator_traits<octet_iterator>::difference_type length = utf8::internal::sequence_length(it);
switch (length) {
case 1:
@@ -71,15 +71,15 @@ namespace utf8
break;
case 3:
++it;
- cp = ((cp << 12) & 0xffff) + ((internal::mask8(*it) << 6) & 0xfff);
+ cp = ((cp << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff);
++it;
cp += (*it) & 0x3f;
break;
case 4:
++it;
- cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff);
+ cp = ((cp << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
++it;
- cp += (internal::mask8(*it) << 6) & 0xfff;
+ cp += (utf8::internal::mask8(*it) << 6) & 0xfff;
++it;
cp += (*it) & 0x3f;
break;
@@ -91,29 +91,29 @@ namespace utf8
template <typename octet_iterator>
uint32_t peek_next(octet_iterator it)
{
- return next(it);
+ return utf8::unchecked::next(it);
}
template <typename octet_iterator>
uint32_t prior(octet_iterator& it)
{
- while (internal::is_trail(*(--it))) ;
+ while (utf8::internal::is_trail(*(--it))) ;
octet_iterator temp = it;
- return next(temp);
+ return utf8::unchecked::next(temp);
}
// Deprecated in versions that include prior, but only for the sake of consistency (see utf8::previous)
template <typename octet_iterator>
inline uint32_t previous(octet_iterator& it)
{
- return prior(it);
+ return utf8::unchecked::prior(it);
}
template <typename octet_iterator, typename distance_type>
void advance (octet_iterator& it, distance_type n)
{
for (distance_type i = 0; i < n; ++i)
- next(it);
+ utf8::unchecked::next(it);
}
template <typename octet_iterator>
@@ -122,7 +122,7 @@ namespace utf8
{
typename std::iterator_traits<octet_iterator>::difference_type dist;
for (dist = 0; first < last; ++dist)
- next(first);
+ utf8::unchecked::next(first);
return dist;
}
@@ -130,13 +130,13 @@ namespace utf8
octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
{
while (start != end) {
- uint32_t cp = internal::mask16(*start++);
+ uint32_t cp = utf8::internal::mask16(*start++);
// Take care of surrogate pairs first
- if (internal::is_lead_surrogate(cp)) {
- uint32_t trail_surrogate = internal::mask16(*start++);
+ if (utf8::internal::is_lead_surrogate(cp)) {
+ uint32_t trail_surrogate = utf8::internal::mask16(*start++);
cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET;
}
- result = append(cp, result);
+ result = utf8::unchecked::append(cp, result);
}
return result;
}
@@ -145,7 +145,7 @@ namespace utf8
u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
{
while (start < end) {
- uint32_t cp = next(start);
+ uint32_t cp = utf8::unchecked::next(start);
if (cp > 0xffff) { //make a surrogate pair
*result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
*result++ = static_cast<uint16_t>((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN);
@@ -160,7 +160,7 @@ namespace utf8
octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result)
{
while (start != end)
- result = append(*(start++), result);
+ result = utf8::unchecked::append(*(start++), result);
return result;
}
@@ -169,7 +169,7 @@ namespace utf8
u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
{
while (start < end)
- (*result++) = next(start);
+ (*result++) = utf8::unchecked::next(start);
return result;
}
@@ -186,7 +186,7 @@ namespace utf8
uint32_t operator * () const
{
octet_iterator temp = it;
- return next(temp);
+ return utf8::unchecked::next(temp);
}
bool operator == (const iterator& rhs) const
{
@@ -198,24 +198,24 @@ namespace utf8
}
iterator& operator ++ ()
{
- std::advance(it, internal::sequence_length(it));
+ ::std::advance(it, utf8::internal::sequence_length(it));
return *this;
}
iterator operator ++ (int)
{
iterator temp = *this;
- std::advance(it, internal::sequence_length(it));
+ ::std::advance(it, utf8::internal::sequence_length(it));
return temp;
}
iterator& operator -- ()
{
- prior(it);
+ utf8::unchecked::prior(it);
return *this;
}
iterator operator -- (int)
{
iterator temp = *this;
- prior(it);
+ utf8::unchecked::prior(it);
return temp;
}
}; // class iterator
diff --git a/dep/zlib/adler32.c b/dep/zlib/adler32.c
index 65ad6a5adc4..a868f073d8a 100644
--- a/dep/zlib/adler32.c
+++ b/dep/zlib/adler32.c
@@ -1,5 +1,5 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2007 Mark Adler
+ * Copyright (C) 1995-2011 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,9 +9,9 @@
#define local static
-local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
+local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
-#define BASE 65521UL /* largest prime smaller than 65536 */
+#define BASE 65521 /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
@@ -21,39 +21,44 @@ local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
-/* use NO_DIVIDE if your processor does not do division in hardware */
+/* use NO_DIVIDE if your processor does not do division in hardware --
+ try it both ways to see which is faster */
#ifdef NO_DIVIDE
-# define MOD(a) \
+/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
+ (thank you to John Reiser for pointing this out) */
+# define CHOP(a) \
+ do { \
+ unsigned long tmp = a >> 16; \
+ a &= 0xffffUL; \
+ a += (tmp << 4) - tmp; \
+ } while (0)
+# define MOD28(a) \
do { \
- if (a >= (BASE << 16)) a -= (BASE << 16); \
- if (a >= (BASE << 15)) a -= (BASE << 15); \
- if (a >= (BASE << 14)) a -= (BASE << 14); \
- if (a >= (BASE << 13)) a -= (BASE << 13); \
- if (a >= (BASE << 12)) a -= (BASE << 12); \
- if (a >= (BASE << 11)) a -= (BASE << 11); \
- if (a >= (BASE << 10)) a -= (BASE << 10); \
- if (a >= (BASE << 9)) a -= (BASE << 9); \
- if (a >= (BASE << 8)) a -= (BASE << 8); \
- if (a >= (BASE << 7)) a -= (BASE << 7); \
- if (a >= (BASE << 6)) a -= (BASE << 6); \
- if (a >= (BASE << 5)) a -= (BASE << 5); \
- if (a >= (BASE << 4)) a -= (BASE << 4); \
- if (a >= (BASE << 3)) a -= (BASE << 3); \
- if (a >= (BASE << 2)) a -= (BASE << 2); \
- if (a >= (BASE << 1)) a -= (BASE << 1); \
+ CHOP(a); \
if (a >= BASE) a -= BASE; \
} while (0)
-# define MOD4(a) \
+# define MOD(a) \
do { \
- if (a >= (BASE << 4)) a -= (BASE << 4); \
- if (a >= (BASE << 3)) a -= (BASE << 3); \
- if (a >= (BASE << 2)) a -= (BASE << 2); \
- if (a >= (BASE << 1)) a -= (BASE << 1); \
+ CHOP(a); \
+ MOD28(a); \
+ } while (0)
+# define MOD63(a) \
+ do { /* this assumes a is not negative */ \
+ z_off64_t tmp = a >> 32; \
+ a &= 0xffffffffL; \
+ a += (tmp << 8) - (tmp << 5) + tmp; \
+ tmp = a >> 16; \
+ a &= 0xffffL; \
+ a += (tmp << 4) - tmp; \
+ tmp = a >> 16; \
+ a &= 0xffffL; \
+ a += (tmp << 4) - tmp; \
if (a >= BASE) a -= BASE; \
} while (0)
#else
# define MOD(a) a %= BASE
-# define MOD4(a) a %= BASE
+# define MOD28(a) a %= BASE
+# define MOD63(a) a %= BASE
#endif
/* ========================================================================= */
@@ -92,7 +97,7 @@ uLong ZEXPORT adler32(adler, buf, len)
}
if (adler >= BASE)
adler -= BASE;
- MOD4(sum2); /* only added so many BASE's */
+ MOD28(sum2); /* only added so many BASE's */
return adler | (sum2 << 16);
}
@@ -137,8 +142,13 @@ local uLong adler32_combine_(adler1, adler2, len2)
unsigned long sum2;
unsigned rem;
+ /* for negative len, return invalid adler32 as a clue for debugging */
+ if (len2 < 0)
+ return 0xffffffffUL;
+
/* the derivation of this formula is left as an exercise for the reader */
- rem = (unsigned)(len2 % BASE);
+ MOD63(len2); /* assumes len2 >= 0 */
+ rem = (unsigned)len2;
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
diff --git a/dep/zlib/crc32.c b/dep/zlib/crc32.c
index 91be372d224..979a7190a3c 100644
--- a/dep/zlib/crc32.c
+++ b/dep/zlib/crc32.c
@@ -1,5 +1,5 @@
/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2006, 2010 Mark Adler
+ * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
@@ -17,6 +17,8 @@
of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
first call get_crc_table() to initialize the tables before allowing more than
one thread to use crc32().
+
+ DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
*/
#ifdef MAKECRCH
@@ -30,31 +32,11 @@
#define local static
-/* Find a four-byte integer type for crc32_little() and crc32_big(). */
-#ifndef NOBYFOUR
-# ifdef STDC /* need ANSI C limits.h to determine sizes */
-# include <limits.h>
-# define BYFOUR
-# if (UINT_MAX == 0xffffffffUL)
- typedef unsigned int u4;
-# else
-# if (ULONG_MAX == 0xffffffffUL)
- typedef unsigned long u4;
-# else
-# if (USHRT_MAX == 0xffffffffUL)
- typedef unsigned short u4;
-# else
-# undef BYFOUR /* can't find a four-byte integer type! */
-# endif
-# endif
-# endif
-# endif /* STDC */
-#endif /* !NOBYFOUR */
-
/* Definitions for doing the crc four data bytes at a time. */
+#if !defined(NOBYFOUR) && defined(Z_U4)
+# define BYFOUR
+#endif
#ifdef BYFOUR
-# define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \
- (((w)&0xff00)<<8)+(((w)&0xff)<<24))
local unsigned long crc32_little OF((unsigned long,
const unsigned char FAR *, unsigned));
local unsigned long crc32_big OF((unsigned long,
@@ -68,16 +50,16 @@
local unsigned long gf2_matrix_times OF((unsigned long *mat,
unsigned long vec));
local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
-local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2);
+local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
#ifdef DYNAMIC_CRC_TABLE
local volatile int crc_table_empty = 1;
-local unsigned long FAR crc_table[TBLS][256];
+local z_crc_t FAR crc_table[TBLS][256];
local void make_crc_table OF((void));
#ifdef MAKECRCH
- local void write_table OF((FILE *, const unsigned long FAR *));
+ local void write_table OF((FILE *, const z_crc_t FAR *));
#endif /* MAKECRCH */
/*
Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
@@ -107,9 +89,9 @@ local void make_crc_table OF((void));
*/
local void make_crc_table()
{
- unsigned long c;
+ z_crc_t c;
int n, k;
- unsigned long poly; /* polynomial exclusive-or pattern */
+ z_crc_t poly; /* polynomial exclusive-or pattern */
/* terms of polynomial defining this crc (except x^32): */
static volatile int first = 1; /* flag to limit concurrent making */
static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
@@ -121,13 +103,13 @@ local void make_crc_table()
first = 0;
/* make exclusive-or pattern from polynomial (0xedb88320UL) */
- poly = 0UL;
- for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
- poly |= 1UL << (31 - p[n]);
+ poly = 0;
+ for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
+ poly |= (z_crc_t)1 << (31 - p[n]);
/* generate a crc for every 8-bit value */
for (n = 0; n < 256; n++) {
- c = (unsigned long)n;
+ c = (z_crc_t)n;
for (k = 0; k < 8; k++)
c = c & 1 ? poly ^ (c >> 1) : c >> 1;
crc_table[0][n] = c;
@@ -138,11 +120,11 @@ local void make_crc_table()
and then the byte reversal of those as well as the first table */
for (n = 0; n < 256; n++) {
c = crc_table[0][n];
- crc_table[4][n] = REV(c);
+ crc_table[4][n] = ZSWAP32(c);
for (k = 1; k < 4; k++) {
c = crc_table[0][c & 0xff] ^ (c >> 8);
crc_table[k][n] = c;
- crc_table[k + 4][n] = REV(c);
+ crc_table[k + 4][n] = ZSWAP32(c);
}
}
#endif /* BYFOUR */
@@ -164,7 +146,7 @@ local void make_crc_table()
if (out == NULL) return;
fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
- fprintf(out, "local const unsigned long FAR ");
+ fprintf(out, "local const z_crc_t FAR ");
fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
write_table(out, crc_table[0]);
# ifdef BYFOUR
@@ -184,12 +166,13 @@ local void make_crc_table()
#ifdef MAKECRCH
local void write_table(out, table)
FILE *out;
- const unsigned long FAR *table;
+ const z_crc_t FAR *table;
{
int n;
for (n = 0; n < 256; n++)
- fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n],
+ fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ",
+ (unsigned long)(table[n]),
n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
}
#endif /* MAKECRCH */
@@ -204,13 +187,13 @@ local void write_table(out, table)
/* =========================================================================
* This function can be used by asm versions of crc32()
*/
-const unsigned long FAR * ZEXPORT get_crc_table()
+const z_crc_t FAR * ZEXPORT get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
if (crc_table_empty)
make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
- return (const unsigned long FAR *)crc_table;
+ return (const z_crc_t FAR *)crc_table;
}
/* ========================================================================= */
@@ -232,7 +215,7 @@ unsigned long ZEXPORT crc32(crc, buf, len)
#ifdef BYFOUR
if (sizeof(void *) == sizeof(ptrdiff_t)) {
- u4 endian;
+ z_crc_t endian;
endian = 1;
if (*((unsigned char *)(&endian)))
@@ -266,17 +249,17 @@ local unsigned long crc32_little(crc, buf, len)
const unsigned char FAR *buf;
unsigned len;
{
- register u4 c;
- register const u4 FAR *buf4;
+ register z_crc_t c;
+ register const z_crc_t FAR *buf4;
- c = (u4)crc;
+ c = (z_crc_t)crc;
c = ~c;
while (len && ((ptrdiff_t)buf & 3)) {
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
len--;
}
- buf4 = (const u4 FAR *)(const void FAR *)buf;
+ buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
while (len >= 32) {
DOLIT32;
len -= 32;
@@ -306,17 +289,17 @@ local unsigned long crc32_big(crc, buf, len)
const unsigned char FAR *buf;
unsigned len;
{
- register u4 c;
- register const u4 FAR *buf4;
+ register z_crc_t c;
+ register const z_crc_t FAR *buf4;
- c = REV((u4)crc);
+ c = ZSWAP32((z_crc_t)crc);
c = ~c;
while (len && ((ptrdiff_t)buf & 3)) {
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
len--;
}
- buf4 = (const u4 FAR *)(const void FAR *)buf;
+ buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
buf4--;
while (len >= 32) {
DOBIG32;
@@ -333,7 +316,7 @@ local unsigned long crc32_big(crc, buf, len)
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
} while (--len);
c = ~c;
- return (unsigned long)(REV(c));
+ return (unsigned long)(ZSWAP32(c));
}
#endif /* BYFOUR */
diff --git a/dep/zlib/crc32.h b/dep/zlib/crc32.h
index 8053b6117c0..9e0c7781025 100644
--- a/dep/zlib/crc32.h
+++ b/dep/zlib/crc32.h
@@ -2,7 +2,7 @@
* Generated automatically by crc32.c
*/
-local const unsigned long FAR crc_table[TBLS][256] =
+local const z_crc_t FAR crc_table[TBLS][256] =
{
{
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
diff --git a/dep/zlib/deflate.c b/dep/zlib/deflate.c
index 5c4022f3d47..9e4c2cbc8af 100644
--- a/dep/zlib/deflate.c
+++ b/dep/zlib/deflate.c
@@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+ * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -37,7 +37,7 @@
* REFERENCES
*
* Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- * Available in http://www.ietf.org/rfc/rfc1951.txt
+ * Available in http://tools.ietf.org/html/rfc1951
*
* A description of the Rabin and Karp algorithm is given in the book
* "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
@@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
+ " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -155,6 +155,9 @@ local const config configuration_table[10] = {
struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
#endif
+/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
+#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))
+
/* ===========================================================================
* Update a hash value with the given input byte
* IN assertion: all calls to to UPDATE_HASH are made with consecutive
@@ -235,10 +238,19 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
strm->msg = Z_NULL;
if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
strm->zalloc = zcalloc;
strm->opaque = (voidpf)0;
+#endif
}
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
#ifdef FASTEST
if (level != 0) level = 1;
@@ -314,43 +326,70 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
uInt dictLength;
{
deflate_state *s;
- uInt length = dictLength;
- uInt n;
- IPos hash_head = 0;
+ uInt str, n;
+ int wrap;
+ unsigned avail;
+ unsigned char *next;
- if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
- strm->state->wrap == 2 ||
- (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
+ if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
return Z_STREAM_ERROR;
-
s = strm->state;
- if (s->wrap)
- strm->adler = adler32(strm->adler, dictionary, dictLength);
+ wrap = s->wrap;
+ if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
+ return Z_STREAM_ERROR;
- if (length < MIN_MATCH) return Z_OK;
- if (length > s->w_size) {
- length = s->w_size;
- dictionary += dictLength - length; /* use the tail of the dictionary */
+ /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+ if (wrap == 1)
+ strm->adler = adler32(strm->adler, dictionary, dictLength);
+ s->wrap = 0; /* avoid computing Adler-32 in read_buf */
+
+ /* if dictionary would fill window, just replace the history */
+ if (dictLength >= s->w_size) {
+ if (wrap == 0) { /* already empty otherwise */
+ CLEAR_HASH(s);
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->insert = 0;
+ }
+ dictionary += dictLength - s->w_size; /* use the tail */
+ dictLength = s->w_size;
}
- zmemcpy(s->window, dictionary, length);
- s->strstart = length;
- s->block_start = (long)length;
- /* Insert all strings in the hash table (except for the last two bytes).
- * s->lookahead stays null, so s->ins_h will be recomputed at the next
- * call of fill_window.
- */
- s->ins_h = s->window[0];
- UPDATE_HASH(s, s->ins_h, s->window[1]);
- for (n = 0; n <= length - MIN_MATCH; n++) {
- INSERT_STRING(s, n, hash_head);
+ /* insert dictionary into window and hash */
+ avail = strm->avail_in;
+ next = strm->next_in;
+ strm->avail_in = dictLength;
+ strm->next_in = (Bytef *)dictionary;
+ fill_window(s);
+ while (s->lookahead >= MIN_MATCH) {
+ str = s->strstart;
+ n = s->lookahead - (MIN_MATCH-1);
+ do {
+ UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+ s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+ s->head[s->ins_h] = (Pos)str;
+ str++;
+ } while (--n);
+ s->strstart = str;
+ s->lookahead = MIN_MATCH-1;
+ fill_window(s);
}
- if (hash_head) hash_head = 0; /* to make compiler happy */
+ s->strstart += s->lookahead;
+ s->block_start = (long)s->strstart;
+ s->insert = s->lookahead;
+ s->lookahead = 0;
+ s->match_length = s->prev_length = MIN_MATCH-1;
+ s->match_available = 0;
+ strm->next_in = next;
+ strm->avail_in = avail;
+ s->wrap = wrap;
return Z_OK;
}
/* ========================================================================= */
-int ZEXPORT deflateReset (strm)
+int ZEXPORT deflateResetKeep (strm)
z_streamp strm;
{
deflate_state *s;
@@ -380,12 +419,23 @@ int ZEXPORT deflateReset (strm)
s->last_flush = Z_NO_FLUSH;
_tr_init(s);
- lm_init(s);
return Z_OK;
}
/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+ z_streamp strm;
+{
+ int ret;
+
+ ret = deflateResetKeep(strm);
+ if (ret == Z_OK)
+ lm_init(strm->state);
+ return ret;
+}
+
+/* ========================================================================= */
int ZEXPORT deflateSetHeader (strm, head)
z_streamp strm;
gz_headerp head;
@@ -397,14 +447,42 @@ int ZEXPORT deflateSetHeader (strm, head)
}
/* ========================================================================= */
+int ZEXPORT deflatePending (strm, pending, bits)
+ unsigned *pending;
+ int *bits;
+ z_streamp strm;
+{
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (pending != Z_NULL)
+ *pending = strm->state->pending;
+ if (bits != Z_NULL)
+ *bits = strm->state->bi_valid;
+ return Z_OK;
+}
+
+/* ========================================================================= */
int ZEXPORT deflatePrime (strm, bits, value)
z_streamp strm;
int bits;
int value;
{
+ deflate_state *s;
+ int put;
+
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- strm->state->bi_valid = bits;
- strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
+ s = strm->state;
+ if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+ return Z_BUF_ERROR;
+ do {
+ put = Buf_size - s->bi_valid;
+ if (put > bits)
+ put = bits;
+ s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
+ s->bi_valid += put;
+ _tr_flush_bits(s);
+ value >>= put;
+ bits -= put;
+ } while (bits);
return Z_OK;
}
@@ -562,19 +640,22 @@ local void putShortMSB (s, b)
local void flush_pending(strm)
z_streamp strm;
{
- unsigned len = strm->state->pending;
+ unsigned len;
+ deflate_state *s = strm->state;
+ _tr_flush_bits(s);
+ len = s->pending;
if (len > strm->avail_out) len = strm->avail_out;
if (len == 0) return;
- zmemcpy(strm->next_out, strm->state->pending_out, len);
+ zmemcpy(strm->next_out, s->pending_out, len);
strm->next_out += len;
- strm->state->pending_out += len;
+ s->pending_out += len;
strm->total_out += len;
strm->avail_out -= len;
- strm->state->pending -= len;
- if (strm->state->pending == 0) {
- strm->state->pending_out = strm->state->pending_buf;
+ s->pending -= len;
+ if (s->pending == 0) {
+ s->pending_out = s->pending_buf;
}
}
@@ -801,7 +882,7 @@ int ZEXPORT deflate (strm, flush)
* flushes. For repeated and useless calls with Z_FINISH, we keep
* returning Z_STREAM_END instead of Z_BUF_ERROR.
*/
- } else if (strm->avail_in == 0 && flush <= old_flush &&
+ } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
flush != Z_FINISH) {
ERR_RETURN(strm, Z_BUF_ERROR);
}
@@ -850,6 +931,7 @@ int ZEXPORT deflate (strm, flush)
if (s->lookahead == 0) {
s->strstart = 0;
s->block_start = 0L;
+ s->insert = 0;
}
}
}
@@ -945,12 +1027,12 @@ int ZEXPORT deflateCopy (dest, source)
ss = source->state;
- zmemcpy(dest, source, sizeof(z_stream));
+ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
if (ds == Z_NULL) return Z_MEM_ERROR;
dest->state = (struct internal_state FAR *) ds;
- zmemcpy(ds, ss, sizeof(deflate_state));
+ zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
ds->strm = dest;
ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
@@ -966,8 +1048,8 @@ int ZEXPORT deflateCopy (dest, source)
}
/* following zmemcpy do not work for 16-bit MSDOS */
zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
- zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
- zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
+ zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
+ zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
@@ -1001,15 +1083,15 @@ local int read_buf(strm, buf, size)
strm->avail_in -= len;
+ zmemcpy(buf, strm->next_in, len);
if (strm->state->wrap == 1) {
- strm->adler = adler32(strm->adler, strm->next_in, len);
+ strm->adler = adler32(strm->adler, buf, len);
}
#ifdef GZIP
else if (strm->state->wrap == 2) {
- strm->adler = crc32(strm->adler, strm->next_in, len);
+ strm->adler = crc32(strm->adler, buf, len);
}
#endif
- zmemcpy(buf, strm->next_in, len);
strm->next_in += len;
strm->total_in += len;
@@ -1036,6 +1118,7 @@ local void lm_init (s)
s->strstart = 0;
s->block_start = 0L;
s->lookahead = 0;
+ s->insert = 0;
s->match_length = s->prev_length = MIN_MATCH-1;
s->match_available = 0;
s->ins_h = 0;
@@ -1310,6 +1393,8 @@ local void fill_window(s)
unsigned more; /* Amount of free space at the end of the window. */
uInt wsize = s->w_size;
+ Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+
do {
more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
@@ -1362,7 +1447,7 @@ local void fill_window(s)
#endif
more += wsize;
}
- if (s->strm->avail_in == 0) return;
+ if (s->strm->avail_in == 0) break;
/* If there was no sliding:
* strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
@@ -1381,12 +1466,24 @@ local void fill_window(s)
s->lookahead += n;
/* Initialize the hash value now that we have some input: */
- if (s->lookahead >= MIN_MATCH) {
- s->ins_h = s->window[s->strstart];
- UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+ if (s->lookahead + s->insert >= MIN_MATCH) {
+ uInt str = s->strstart - s->insert;
+ s->ins_h = s->window[str];
+ UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
#if MIN_MATCH != 3
Call UPDATE_HASH() MIN_MATCH-3 more times
#endif
+ while (s->insert) {
+ UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+ s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+ s->head[s->ins_h] = (Pos)str;
+ str++;
+ s->insert--;
+ if (s->lookahead + s->insert < MIN_MATCH)
+ break;
+ }
}
/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
* but this is not important since only literal bytes will be emitted.
@@ -1427,6 +1524,9 @@ local void fill_window(s)
s->high_water += init;
}
}
+
+ Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+ "not enough room for search");
}
/* ===========================================================================
@@ -1506,8 +1606,14 @@ local block_state deflate_stored(s, flush)
FLUSH_BLOCK(s, 0);
}
}
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
+ s->insert = 0;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if ((long)s->strstart > s->block_start)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
}
/* ===========================================================================
@@ -1603,8 +1709,14 @@ local block_state deflate_fast(s, flush)
}
if (bflush) FLUSH_BLOCK(s, 0);
}
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
+ s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
}
#ifndef FASTEST
@@ -1728,8 +1840,14 @@ local block_state deflate_slow(s, flush)
_tr_tally_lit(s, s->window[s->strstart-1], bflush);
s->match_available = 0;
}
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
+ s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
}
#endif /* FASTEST */
@@ -1749,11 +1867,11 @@ local block_state deflate_rle(s, flush)
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
- * for the longest encodable run.
+ * for the longest run, plus one for the unrolled loop.
*/
- if (s->lookahead < MAX_MATCH) {
+ if (s->lookahead <= MAX_MATCH) {
fill_window(s);
- if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
+ if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
return need_more;
}
if (s->lookahead == 0) break; /* flush the current block */
@@ -1776,6 +1894,7 @@ local block_state deflate_rle(s, flush)
if (s->match_length > s->lookahead)
s->match_length = s->lookahead;
}
+ Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
@@ -1796,8 +1915,14 @@ local block_state deflate_rle(s, flush)
}
if (bflush) FLUSH_BLOCK(s, 0);
}
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
+ s->insert = 0;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
}
/* ===========================================================================
@@ -1829,6 +1954,12 @@ local block_state deflate_huff(s, flush)
s->strstart++;
if (bflush) FLUSH_BLOCK(s, 0);
}
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
+ s->insert = 0;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
}
diff --git a/dep/zlib/deflate.h b/dep/zlib/deflate.h
index cbf0d1ea5d9..fbac44d908e 100644
--- a/dep/zlib/deflate.h
+++ b/dep/zlib/deflate.h
@@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
- * Copyright (C) 1995-2010 Jean-loup Gailly
+ * Copyright (C) 1995-2012 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -48,6 +48,9 @@
#define MAX_BITS 15
/* All codes must not exceed MAX_BITS bits */
+#define Buf_size 16
+/* size of bit buffer in bi_buf */
+
#define INIT_STATE 42
#define EXTRA_STATE 69
#define NAME_STATE 73
@@ -188,7 +191,7 @@ typedef struct internal_state {
int nice_match; /* Stop searching when current match exceeds this */
/* used by trees.c: */
- /* Didn't use ct_data typedef below to supress compiler warning */
+ /* Didn't use ct_data typedef below to suppress compiler warning */
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
@@ -244,7 +247,7 @@ typedef struct internal_state {
ulg opt_len; /* bit length of current block with optimal trees */
ulg static_len; /* bit length of current block with static trees */
uInt matches; /* number of string matches in current block */
- int last_eob_len; /* bit length of EOB code for last block */
+ uInt insert; /* bytes at end of window left to insert */
#ifdef DEBUG
ulg compressed_len; /* total bit length of compressed file mod 2^32 */
@@ -294,6 +297,7 @@ void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
diff --git a/dep/zlib/gzguts.h b/dep/zlib/gzguts.h
index 0f8fb79f87d..ee3f281aa57 100644
--- a/dep/zlib/gzguts.h
+++ b/dep/zlib/gzguts.h
@@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -12,7 +12,7 @@
# endif
#endif
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#ifdef HAVE_HIDDEN
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
@@ -27,13 +27,65 @@
#endif
#include <fcntl.h>
+#ifdef _WIN32
+# include <stddef.h>
+#endif
+
+#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
+# include <io.h>
+#endif
+
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
-#ifdef _MSC_VER
-# include <io.h>
-# define vsnprintf _vsnprintf
+#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#if defined(__CYGWIN__)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#ifndef HAVE_VSNPRINTF
+# ifdef MSDOS
+/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+ but for now we just assume it doesn't. */
+# define NO_vsnprintf
+# endif
+# ifdef __TURBOC__
+# define NO_vsnprintf
+# endif
+# ifdef WIN32
+/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+# if !defined(vsnprintf) && !defined(NO_vsnprintf)
+# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+# define vsnprintf _vsnprintf
+# endif
+# endif
+# endif
+# ifdef __SASC
+# define NO_vsnprintf
+# endif
+# ifdef VMS
+# define NO_vsnprintf
+# endif
+# ifdef __OS400__
+# define NO_vsnprintf
+# endif
+# ifdef __MVS__
+# define NO_vsnprintf
+# endif
#endif
#ifndef local
@@ -52,7 +104,7 @@
# include <windows.h>
# define zstrerror() gz_strwinerror((DWORD)GetLastError())
#else
-# ifdef STDC
+# ifndef NO_STRERROR
# include <errno.h>
# define zstrerror() strerror(errno)
# else
@@ -68,6 +120,13 @@
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
#endif
+/* default memLevel */
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+
/* default i/o buffer size -- double this for output when reading */
#define GZBUFSIZE 8192
@@ -84,23 +143,25 @@
/* internal gzip file state data structure */
typedef struct {
+ /* exposed contents for gzgetc() macro */
+ struct gzFile_s x; /* "x" for exposed */
+ /* x.have: number of bytes available at x.next */
+ /* x.next: next output data to deliver or write */
+ /* x.pos: current position in uncompressed data */
/* used for both reading and writing */
int mode; /* see gzip modes above */
int fd; /* file descriptor */
char *path; /* path or fd for error messages */
- z_off64_t pos; /* current position in uncompressed data */
unsigned size; /* buffer size, zero if not allocated yet */
unsigned want; /* requested buffer size, default is GZBUFSIZE */
unsigned char *in; /* input buffer */
unsigned char *out; /* output buffer (double-sized when reading) */
- unsigned char *next; /* next output data to deliver or write */
+ int direct; /* 0 if processing gzip, 1 if transparent */
/* just for reading */
- unsigned have; /* amount of output data unused at next */
- int eof; /* true if end of input file reached */
- z_off64_t start; /* where the gzip data started, for rewinding */
- z_off64_t raw; /* where the raw data started, for seeking */
int how; /* 0: get header, 1: copy, 2: decompress */
- int direct; /* true if last read direct, false if gzip */
+ z_off64_t start; /* where the gzip data started, for rewinding */
+ int eof; /* true if end of input file reached */
+ int past; /* true if read requested past end */
/* just for writing */
int level; /* compression level */
int strategy; /* compression strategy */
diff --git a/dep/zlib/gzlib.c b/dep/zlib/gzlib.c
index 603e60ed544..ca55c6ea926 100644
--- a/dep/zlib/gzlib.c
+++ b/dep/zlib/gzlib.c
@@ -1,19 +1,23 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004, 2010 Mark Adler
+ * Copyright (C) 2004, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
+#if defined(_WIN32) && !defined(__BORLANDC__)
+# define LSEEK _lseeki64
+#else
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK lseek
#endif
+#endif
/* Local functions */
local void gz_reset OF((gz_statep));
-local gzFile gz_open OF((const char *, int, const char *));
+local gzFile gz_open OF((const void *, int, const char *));
#if defined UNDER_CE
@@ -71,25 +75,37 @@ char ZLIB_INTERNAL *gz_strwinerror (error)
local void gz_reset(state)
gz_statep state;
{
+ state->x.have = 0; /* no output data available */
if (state->mode == GZ_READ) { /* for reading ... */
- state->have = 0; /* no output data available */
state->eof = 0; /* not at end of file */
+ state->past = 0; /* have not read past end yet */
state->how = LOOK; /* look for gzip header */
- state->direct = 1; /* default for empty file */
}
state->seek = 0; /* no seek request pending */
gz_error(state, Z_OK, NULL); /* clear error */
- state->pos = 0; /* no uncompressed data yet */
+ state->x.pos = 0; /* no uncompressed data yet */
state->strm.avail_in = 0; /* no input data yet */
}
/* Open a gzip file either by name or file descriptor. */
local gzFile gz_open(path, fd, mode)
- const char *path;
+ const void *path;
int fd;
const char *mode;
{
gz_statep state;
+ size_t len;
+ int oflag;
+#ifdef O_CLOEXEC
+ int cloexec = 0;
+#endif
+#ifdef O_EXCL
+ int exclusive = 0;
+#endif
+
+ /* check input */
+ if (path == NULL)
+ return NULL;
/* allocate gzFile structure to return */
state = malloc(sizeof(gz_state));
@@ -103,6 +119,7 @@ local gzFile gz_open(path, fd, mode)
state->mode = GZ_NONE;
state->level = Z_DEFAULT_COMPRESSION;
state->strategy = Z_DEFAULT_STRATEGY;
+ state->direct = 0;
while (*mode) {
if (*mode >= '0' && *mode <= '9')
state->level = *mode - '0';
@@ -124,6 +141,16 @@ local gzFile gz_open(path, fd, mode)
return NULL;
case 'b': /* ignore -- will request binary anyway */
break;
+#ifdef O_CLOEXEC
+ case 'e':
+ cloexec = 1;
+ break;
+#endif
+#ifdef O_EXCL
+ case 'x':
+ exclusive = 1;
+ break;
+#endif
case 'f':
state->strategy = Z_FILTERED;
break;
@@ -135,6 +162,8 @@ local gzFile gz_open(path, fd, mode)
break;
case 'F':
state->strategy = Z_FIXED;
+ case 'T':
+ state->direct = 1;
default: /* could consider as an error, but just ignore */
;
}
@@ -147,30 +176,67 @@ local gzFile gz_open(path, fd, mode)
return NULL;
}
+ /* can't force transparent read */
+ if (state->mode == GZ_READ) {
+ if (state->direct) {
+ free(state);
+ return NULL;
+ }
+ state->direct = 1; /* for empty file */
+ }
+
/* save the path name for error messages */
- state->path = malloc(strlen(path) + 1);
+#ifdef _WIN32
+ if (fd == -2) {
+ len = wcstombs(NULL, path, 0);
+ if (len == (size_t)-1)
+ len = 0;
+ }
+ else
+#endif
+ len = strlen(path);
+ state->path = malloc(len + 1);
if (state->path == NULL) {
free(state);
return NULL;
}
- strcpy(state->path, path);
+#ifdef _WIN32
+ if (fd == -2)
+ if (len)
+ wcstombs(state->path, path, len + 1);
+ else
+ *(state->path) = 0;
+ else
+#endif
+ strcpy(state->path, path);
- /* open the file with the appropriate mode (or just use fd) */
- state->fd = fd != -1 ? fd :
- open(path,
+ /* compute the flags for open() */
+ oflag =
#ifdef O_LARGEFILE
- O_LARGEFILE |
+ O_LARGEFILE |
#endif
#ifdef O_BINARY
- O_BINARY |
+ O_BINARY |
+#endif
+#ifdef O_CLOEXEC
+ (cloexec ? O_CLOEXEC : 0) |
#endif
- (state->mode == GZ_READ ?
- O_RDONLY :
- (O_WRONLY | O_CREAT | (
- state->mode == GZ_WRITE ?
- O_TRUNC :
- O_APPEND))),
- 0666);
+ (state->mode == GZ_READ ?
+ O_RDONLY :
+ (O_WRONLY | O_CREAT |
+#ifdef O_EXCL
+ (exclusive ? O_EXCL : 0) |
+#endif
+ (state->mode == GZ_WRITE ?
+ O_TRUNC :
+ O_APPEND)));
+
+ /* open the file with the appropriate flags (or just use fd) */
+ state->fd = fd > -1 ? fd : (
+#ifdef _WIN32
+ fd == -2 ? _wopen(path, oflag, 0666) :
+#endif
+ open(path, oflag, 0666));
if (state->fd == -1) {
free(state->path);
free(state);
@@ -225,6 +291,16 @@ gzFile ZEXPORT gzdopen(fd, mode)
}
/* -- see zlib.h -- */
+#ifdef _WIN32
+gzFile ZEXPORT gzopen_w(path, mode)
+ const wchar_t *path;
+ const char *mode;
+{
+ return gz_open(path, -2, mode);
+}
+#endif
+
+/* -- see zlib.h -- */
int ZEXPORT gzbuffer(file, size)
gzFile file;
unsigned size;
@@ -243,8 +319,8 @@ int ZEXPORT gzbuffer(file, size)
return -1;
/* check and set requested size */
- if (size == 0)
- return -1;
+ if (size < 2)
+ size = 2; /* need two bytes to check magic header */
state->want = size;
return 0;
}
@@ -261,7 +337,8 @@ int ZEXPORT gzrewind(file)
state = (gz_statep)file;
/* check that we're reading and that there's no error */
- if (state->mode != GZ_READ || state->err != Z_OK)
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* back up and start over */
@@ -289,7 +366,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
return -1;
/* check that there's no error */
- if (state->err != Z_OK)
+ if (state->err != Z_OK && state->err != Z_BUF_ERROR)
return -1;
/* can only seek from start or relative to current position */
@@ -298,31 +375,32 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
/* normalize offset to a SEEK_CUR specification */
if (whence == SEEK_SET)
- offset -= state->pos;
+ offset -= state->x.pos;
else if (state->seek)
offset += state->skip;
state->seek = 0;
/* if within raw area while reading, just go there */
if (state->mode == GZ_READ && state->how == COPY &&
- state->pos + offset >= state->raw) {
- ret = LSEEK(state->fd, offset - state->have, SEEK_CUR);
+ state->x.pos + offset >= 0) {
+ ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
if (ret == -1)
return -1;
- state->have = 0;
+ state->x.have = 0;
state->eof = 0;
+ state->past = 0;
state->seek = 0;
gz_error(state, Z_OK, NULL);
state->strm.avail_in = 0;
- state->pos += offset;
- return state->pos;
+ state->x.pos += offset;
+ return state->x.pos;
}
/* calculate skip amount, rewinding if needed for back seek when reading */
if (offset < 0) {
if (state->mode != GZ_READ) /* writing -- can't go backwards */
return -1;
- offset += state->pos;
+ offset += state->x.pos;
if (offset < 0) /* before start of file! */
return -1;
if (gzrewind(file) == -1) /* rewind, then skip to offset */
@@ -331,11 +409,11 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
/* if reading, skip what's in output buffer (one less gzgetc() check) */
if (state->mode == GZ_READ) {
- n = GT_OFF(state->have) || (z_off64_t)state->have > offset ?
- (unsigned)offset : state->have;
- state->have -= n;
- state->next += n;
- state->pos += n;
+ n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
+ (unsigned)offset : state->x.have;
+ state->x.have -= n;
+ state->x.next += n;
+ state->x.pos += n;
offset -= n;
}
@@ -344,7 +422,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
state->seek = 1;
state->skip = offset;
}
- return state->pos + offset;
+ return state->x.pos + offset;
}
/* -- see zlib.h -- */
@@ -373,7 +451,7 @@ z_off64_t ZEXPORT gztell64(file)
return -1;
/* return position */
- return state->pos + (state->seek ? state->skip : 0);
+ return state->x.pos + (state->seek ? state->skip : 0);
}
/* -- see zlib.h -- */
@@ -433,8 +511,7 @@ int ZEXPORT gzeof(file)
return 0;
/* return end-of-file state */
- return state->mode == GZ_READ ?
- (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0;
+ return state->mode == GZ_READ ? state->past : 0;
}
/* -- see zlib.h -- */
@@ -471,8 +548,10 @@ void ZEXPORT gzclearerr(file)
return;
/* clear error and end-of-file */
- if (state->mode == GZ_READ)
+ if (state->mode == GZ_READ) {
state->eof = 0;
+ state->past = 0;
+ }
gz_error(state, Z_OK, NULL);
}
@@ -494,6 +573,10 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
state->msg = NULL;
}
+ /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
+ if (err != Z_OK && err != Z_BUF_ERROR)
+ state->x.have = 0;
+
/* set error code, and if no message, then done */
state->err = err;
if (msg == NULL)
diff --git a/dep/zlib/gzread.c b/dep/zlib/gzread.c
index 548201ab009..3493d34d4ea 100644
--- a/dep/zlib/gzread.c
+++ b/dep/zlib/gzread.c
@@ -1,5 +1,5 @@
/* gzread.c -- zlib functions for reading gzip files
- * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -8,10 +8,9 @@
/* Local functions */
local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
local int gz_avail OF((gz_statep));
-local int gz_next4 OF((gz_statep, unsigned long *));
-local int gz_head OF((gz_statep));
+local int gz_look OF((gz_statep));
local int gz_decomp OF((gz_statep));
-local int gz_make OF((gz_statep));
+local int gz_fetch OF((gz_statep));
local int gz_skip OF((gz_statep, z_off64_t));
/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
@@ -46,67 +45,47 @@ local int gz_load(state, buf, len, have)
error, 0 otherwise. Note that the eof flag is set when the end of the input
file is reached, even though there may be unused data in the buffer. Once
that data has been used, no more attempts will be made to read the file.
- gz_avail() assumes that strm->avail_in == 0. */
+ If strm->avail_in != 0, then the current data is moved to the beginning of
+ the input buffer, and then the remainder of the buffer is loaded with the
+ available data from the input file. */
local int gz_avail(state)
gz_statep state;
{
+ unsigned got;
z_streamp strm = &(state->strm);
- if (state->err != Z_OK)
+ if (state->err != Z_OK && state->err != Z_BUF_ERROR)
return -1;
if (state->eof == 0) {
- if (gz_load(state, state->in, state->size,
- (unsigned *)&(strm->avail_in)) == -1)
+ if (strm->avail_in) { /* copy what's there to the start */
+ unsigned char *p = state->in, *q = strm->next_in;
+ unsigned n = strm->avail_in;
+ do {
+ *p++ = *q++;
+ } while (--n);
+ }
+ if (gz_load(state, state->in + strm->avail_in,
+ state->size - strm->avail_in, &got) == -1)
return -1;
+ strm->avail_in += got;
strm->next_in = state->in;
}
return 0;
}
-/* Get next byte from input, or -1 if end or error. */
-#define NEXT() ((strm->avail_in == 0 && gz_avail(state) == -1) ? -1 : \
- (strm->avail_in == 0 ? -1 : \
- (strm->avail_in--, *(strm->next_in)++)))
-
-/* Get a four-byte little-endian integer and return 0 on success and the value
- in *ret. Otherwise -1 is returned and *ret is not modified. */
-local int gz_next4(state, ret)
- gz_statep state;
- unsigned long *ret;
-{
- int ch;
- unsigned long val;
- z_streamp strm = &(state->strm);
-
- val = NEXT();
- val += (unsigned)NEXT() << 8;
- val += (unsigned long)NEXT() << 16;
- ch = NEXT();
- if (ch == -1)
- return -1;
- val += (unsigned long)ch << 24;
- *ret = val;
- return 0;
-}
-
-/* Look for gzip header, set up for inflate or copy. state->have must be zero.
+/* Look for gzip header, set up for inflate or copy. state->x.have must be 0.
If this is the first time in, allocate required memory. state->how will be
left unchanged if there is no more input data available, will be set to COPY
if there is no gzip header and direct copying will be performed, or it will
- be set to GZIP for decompression, and the gzip header will be skipped so
- that the next available input data is the raw deflate stream. If direct
- copying, then leftover input data from the input buffer will be copied to
- the output buffer. In that case, all further file reads will be directly to
- either the output buffer or a user buffer. If decompressing, the inflate
- state and the check value will be initialized. gz_head() will return 0 on
- success or -1 on failure. Failures may include read errors or gzip header
- errors. */
-local int gz_head(state)
+ be set to GZIP for decompression. If direct copying, then leftover input
+ data from the input buffer will be copied to the output buffer. In that
+ case, all further file reads will be directly to either the output buffer or
+ a user buffer. If decompressing, the inflate state will be initialized.
+ gz_look() will return 0 on success or -1 on failure. */
+local int gz_look(state)
gz_statep state;
{
z_streamp strm = &(state->strm);
- int flags;
- unsigned len;
/* allocate read buffers and inflate memory */
if (state->size == 0) {
@@ -129,7 +108,7 @@ local int gz_head(state)
state->strm.opaque = Z_NULL;
state->strm.avail_in = 0;
state->strm.next_in = Z_NULL;
- if (inflateInit2(&(state->strm), -15) != Z_OK) { /* raw inflate */
+ if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */
free(state->out);
free(state->in);
state->size = 0;
@@ -138,83 +117,45 @@ local int gz_head(state)
}
}
- /* get some data in the input buffer */
- if (strm->avail_in == 0) {
+ /* get at least the magic bytes in the input buffer */
+ if (strm->avail_in < 2) {
if (gz_avail(state) == -1)
return -1;
if (strm->avail_in == 0)
return 0;
}
- /* look for the gzip magic header bytes 31 and 139 */
- if (strm->next_in[0] == 31) {
- strm->avail_in--;
- strm->next_in++;
- if (strm->avail_in == 0 && gz_avail(state) == -1)
- return -1;
- if (strm->avail_in && strm->next_in[0] == 139) {
- /* we have a gzip header, woo hoo! */
- strm->avail_in--;
- strm->next_in++;
-
- /* skip rest of header */
- if (NEXT() != 8) { /* compression method */
- gz_error(state, Z_DATA_ERROR, "unknown compression method");
- return -1;
- }
- flags = NEXT();
- if (flags & 0xe0) { /* reserved flag bits */
- gz_error(state, Z_DATA_ERROR, "unknown header flags set");
- return -1;
- }
- NEXT(); /* modification time */
- NEXT();
- NEXT();
- NEXT();
- NEXT(); /* extra flags */
- NEXT(); /* operating system */
- if (flags & 4) { /* extra field */
- len = (unsigned)NEXT();
- len += (unsigned)NEXT() << 8;
- while (len--)
- if (NEXT() < 0)
- break;
- }
- if (flags & 8) /* file name */
- while (NEXT() > 0)
- ;
- if (flags & 16) /* comment */
- while (NEXT() > 0)
- ;
- if (flags & 2) { /* header crc */
- NEXT();
- NEXT();
- }
- /* an unexpected end of file is not checked for here -- it will be
- noticed on the first request for uncompressed data */
-
- /* set up for decompression */
- inflateReset(strm);
- strm->adler = crc32(0L, Z_NULL, 0);
- state->how = GZIP;
- state->direct = 0;
- return 0;
- }
- else {
- /* not a gzip file -- save first byte (31) and fall to raw i/o */
- state->out[0] = 31;
- state->have = 1;
- }
+ /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
+ a logical dilemma here when considering the case of a partially written
+ gzip file, to wit, if a single 31 byte is written, then we cannot tell
+ whether this is a single-byte file, or just a partially written gzip
+ file -- for here we assume that if a gzip file is being written, then
+ the header will be written in a single operation, so that reading a
+ single byte is sufficient indication that it is not a gzip file) */
+ if (strm->avail_in > 1 &&
+ strm->next_in[0] == 31 && strm->next_in[1] == 139) {
+ inflateReset(strm);
+ state->how = GZIP;
+ state->direct = 0;
+ return 0;
+ }
+
+ /* no gzip header -- if we were decoding gzip before, then this is trailing
+ garbage. Ignore the trailing garbage and finish. */
+ if (state->direct == 0) {
+ strm->avail_in = 0;
+ state->eof = 1;
+ state->x.have = 0;
+ return 0;
}
- /* doing raw i/o, save start of raw data for seeking, copy any leftover
- input to output -- this assumes that the output buffer is larger than
- the input buffer, which also assures space for gzungetc() */
- state->raw = state->pos;
- state->next = state->out;
+ /* doing raw i/o, copy any leftover input to output -- this assumes that
+ the output buffer is larger than the input buffer, which also assures
+ space for gzungetc() */
+ state->x.next = state->out;
if (strm->avail_in) {
- memcpy(state->next + state->have, strm->next_in, strm->avail_in);
- state->have += strm->avail_in;
+ memcpy(state->x.next, strm->next_in, strm->avail_in);
+ state->x.have = strm->avail_in;
strm->avail_in = 0;
}
state->how = COPY;
@@ -223,19 +164,15 @@ local int gz_head(state)
}
/* Decompress from input to the provided next_out and avail_out in the state.
- If the end of the compressed data is reached, then verify the gzip trailer
- check value and length (modulo 2^32). state->have and state->next are set
- to point to the just decompressed data, and the crc is updated. If the
- trailer is verified, state->how is reset to LOOK to look for the next gzip
- stream or raw data, once state->have is depleted. Returns 0 on success, -1
- on failure. Failures may include invalid compressed data or a failed gzip
- trailer verification. */
+ On return, state->x.have and state->x.next point to the just decompressed
+ data. If the gzip stream completes, state->how is reset to LOOK to look for
+ the next gzip stream or raw data, once state->x.have is depleted. Returns 0
+ on success, -1 on failure. */
local int gz_decomp(state)
gz_statep state;
{
- int ret;
+ int ret = Z_OK;
unsigned had;
- unsigned long crc, len;
z_streamp strm = &(state->strm);
/* fill output buffer up to end of deflate stream */
@@ -245,15 +182,15 @@ local int gz_decomp(state)
if (strm->avail_in == 0 && gz_avail(state) == -1)
return -1;
if (strm->avail_in == 0) {
- gz_error(state, Z_DATA_ERROR, "unexpected end of file");
- return -1;
+ gz_error(state, Z_BUF_ERROR, "unexpected end of file");
+ break;
}
/* decompress and handle errors */
ret = inflate(strm, Z_NO_FLUSH);
if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
gz_error(state, Z_STREAM_ERROR,
- "internal error: inflate stream corrupt");
+ "internal error: inflate stream corrupt");
return -1;
}
if (ret == Z_MEM_ERROR) {
@@ -262,67 +199,55 @@ local int gz_decomp(state)
}
if (ret == Z_DATA_ERROR) { /* deflate stream invalid */
gz_error(state, Z_DATA_ERROR,
- strm->msg == NULL ? "compressed data error" : strm->msg);
+ strm->msg == NULL ? "compressed data error" : strm->msg);
return -1;
}
} while (strm->avail_out && ret != Z_STREAM_END);
- /* update available output and crc check value */
- state->have = had - strm->avail_out;
- state->next = strm->next_out - state->have;
- strm->adler = crc32(strm->adler, state->next, state->have);
+ /* update available output */
+ state->x.have = had - strm->avail_out;
+ state->x.next = strm->next_out - state->x.have;
- /* check gzip trailer if at end of deflate stream */
- if (ret == Z_STREAM_END) {
- if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) {
- gz_error(state, Z_DATA_ERROR, "unexpected end of file");
- return -1;
- }
- if (crc != strm->adler) {
- gz_error(state, Z_DATA_ERROR, "incorrect data check");
- return -1;
- }
- if (len != (strm->total_out & 0xffffffffL)) {
- gz_error(state, Z_DATA_ERROR, "incorrect length check");
- return -1;
- }
- state->how = LOOK; /* ready for next stream, once have is 0 (leave
- state->direct unchanged to remember how) */
- }
+ /* if the gzip stream completed successfully, look for another */
+ if (ret == Z_STREAM_END)
+ state->how = LOOK;
/* good decompression */
return 0;
}
-/* Make data and put in the output buffer. Assumes that state->have == 0.
+/* Fetch data and put it in the output buffer. Assumes state->x.have is 0.
Data is either copied from the input file or decompressed from the input
file depending on state->how. If state->how is LOOK, then a gzip header is
- looked for (and skipped if found) to determine wither to copy or decompress.
- Returns -1 on error, otherwise 0. gz_make() will leave state->have as COPY
- or GZIP unless the end of the input file has been reached and all data has
- been processed. */
-local int gz_make(state)
+ looked for to determine whether to copy or decompress. Returns -1 on error,
+ otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the
+ end of the input file has been reached and all data has been processed. */
+local int gz_fetch(state)
gz_statep state;
{
z_streamp strm = &(state->strm);
- if (state->how == LOOK) { /* look for gzip header */
- if (gz_head(state) == -1)
- return -1;
- if (state->have) /* got some data from gz_head() */
+ do {
+ switch(state->how) {
+ case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */
+ if (gz_look(state) == -1)
+ return -1;
+ if (state->how == LOOK)
+ return 0;
+ break;
+ case COPY: /* -> COPY */
+ if (gz_load(state, state->out, state->size << 1, &(state->x.have))
+ == -1)
+ return -1;
+ state->x.next = state->out;
return 0;
- }
- if (state->how == COPY) { /* straight copy */
- if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1)
- return -1;
- state->next = state->out;
- }
- else if (state->how == GZIP) { /* decompress */
- strm->avail_out = state->size << 1;
- strm->next_out = state->out;
- if (gz_decomp(state) == -1)
- return -1;
- }
+ case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */
+ strm->avail_out = state->size << 1;
+ strm->next_out = state->out;
+ if (gz_decomp(state) == -1)
+ return -1;
+ }
+ } while (state->x.have == 0 && (!state->eof || strm->avail_in));
return 0;
}
@@ -336,12 +261,12 @@ local int gz_skip(state, len)
/* skip over len bytes or reach end-of-file, whichever comes first */
while (len)
/* skip over whatever is in output buffer */
- if (state->have) {
- n = GT_OFF(state->have) || (z_off64_t)state->have > len ?
- (unsigned)len : state->have;
- state->have -= n;
- state->next += n;
- state->pos += n;
+ if (state->x.have) {
+ n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
+ (unsigned)len : state->x.have;
+ state->x.have -= n;
+ state->x.next += n;
+ state->x.pos += n;
len -= n;
}
@@ -352,7 +277,7 @@ local int gz_skip(state, len)
/* need more data to skip -- load up output buffer */
else {
/* get more output, looking for header if required */
- if (gz_make(state) == -1)
+ if (gz_fetch(state) == -1)
return -1;
}
return 0;
@@ -374,14 +299,15 @@ int ZEXPORT gzread(file, buf, len)
state = (gz_statep)file;
strm = &(state->strm);
- /* check that we're reading and that there's no error */
- if (state->mode != GZ_READ || state->err != Z_OK)
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* since an int is returned, make sure len fits in one, otherwise return
with an error (this avoids the flaw in the interface) */
if ((int)len < 0) {
- gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
+ gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
return -1;
}
@@ -400,24 +326,26 @@ int ZEXPORT gzread(file, buf, len)
got = 0;
do {
/* first just try copying data from the output buffer */
- if (state->have) {
- n = state->have > len ? len : state->have;
- memcpy(buf, state->next, n);
- state->next += n;
- state->have -= n;
+ if (state->x.have) {
+ n = state->x.have > len ? len : state->x.have;
+ memcpy(buf, state->x.next, n);
+ state->x.next += n;
+ state->x.have -= n;
}
/* output buffer empty -- return if we're at the end of the input */
- else if (state->eof && strm->avail_in == 0)
+ else if (state->eof && strm->avail_in == 0) {
+ state->past = 1; /* tried to read past end */
break;
+ }
/* need output data -- for small len or new stream load up our output
buffer */
else if (state->how == LOOK || len < (state->size << 1)) {
/* get more output, looking for header if required */
- if (gz_make(state) == -1)
+ if (gz_fetch(state) == -1)
return -1;
- continue; /* no progress yet -- go back to memcpy() above */
+ continue; /* no progress yet -- go back to copy above */
/* the copy above assures that we will leave with space in the
output buffer, allowing at least one gzungetc() to succeed */
}
@@ -434,15 +362,15 @@ int ZEXPORT gzread(file, buf, len)
strm->next_out = buf;
if (gz_decomp(state) == -1)
return -1;
- n = state->have;
- state->have = 0;
+ n = state->x.have;
+ state->x.have = 0;
}
/* update progress */
len -= n;
buf = (char *)buf + n;
got += n;
- state->pos += n;
+ state->x.pos += n;
} while (len);
/* return number of bytes read into user buffer (will fit in int) */
@@ -450,6 +378,7 @@ int ZEXPORT gzread(file, buf, len)
}
/* -- see zlib.h -- */
+#undef gzgetc
int ZEXPORT gzgetc(file)
gzFile file;
{
@@ -462,15 +391,16 @@ int ZEXPORT gzgetc(file)
return -1;
state = (gz_statep)file;
- /* check that we're reading and that there's no error */
- if (state->mode != GZ_READ || state->err != Z_OK)
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* try output buffer (no need to check for skip request) */
- if (state->have) {
- state->have--;
- state->pos++;
- return *(state->next)++;
+ if (state->x.have) {
+ state->x.have--;
+ state->x.pos++;
+ return *(state->x.next)++;
}
/* nothing there -- try gzread() */
@@ -478,6 +408,12 @@ int ZEXPORT gzgetc(file)
return ret < 1 ? -1 : buf[0];
}
+int ZEXPORT gzgetc_(file)
+gzFile file;
+{
+ return gzgetc(file);
+}
+
/* -- see zlib.h -- */
int ZEXPORT gzungetc(c, file)
int c;
@@ -490,8 +426,9 @@ int ZEXPORT gzungetc(c, file)
return -1;
state = (gz_statep)file;
- /* check that we're reading and that there's no error */
- if (state->mode != GZ_READ || state->err != Z_OK)
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* process a skip request */
@@ -506,32 +443,34 @@ int ZEXPORT gzungetc(c, file)
return -1;
/* if output buffer empty, put byte at end (allows more pushing) */
- if (state->have == 0) {
- state->have = 1;
- state->next = state->out + (state->size << 1) - 1;
- state->next[0] = c;
- state->pos--;
+ if (state->x.have == 0) {
+ state->x.have = 1;
+ state->x.next = state->out + (state->size << 1) - 1;
+ state->x.next[0] = c;
+ state->x.pos--;
+ state->past = 0;
return c;
}
/* if no room, give up (must have already done a gzungetc()) */
- if (state->have == (state->size << 1)) {
- gz_error(state, Z_BUF_ERROR, "out of room to push characters");
+ if (state->x.have == (state->size << 1)) {
+ gz_error(state, Z_DATA_ERROR, "out of room to push characters");
return -1;
}
/* slide output data if needed and insert byte before existing data */
- if (state->next == state->out) {
- unsigned char *src = state->out + state->have;
+ if (state->x.next == state->out) {
+ unsigned char *src = state->out + state->x.have;
unsigned char *dest = state->out + (state->size << 1);
while (src > state->out)
*--dest = *--src;
- state->next = dest;
+ state->x.next = dest;
}
- state->have++;
- state->next--;
- state->next[0] = c;
- state->pos--;
+ state->x.have++;
+ state->x.next--;
+ state->x.next[0] = c;
+ state->x.pos--;
+ state->past = 0;
return c;
}
@@ -551,8 +490,9 @@ char * ZEXPORT gzgets(file, buf, len)
return NULL;
state = (gz_statep)file;
- /* check that we're reading and that there's no error */
- if (state->mode != GZ_READ || state->err != Z_OK)
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
return NULL;
/* process a skip request */
@@ -569,32 +509,31 @@ char * ZEXPORT gzgets(file, buf, len)
left = (unsigned)len - 1;
if (left) do {
/* assure that something is in the output buffer */
- if (state->have == 0) {
- if (gz_make(state) == -1)
- return NULL; /* error */
- if (state->have == 0) { /* end of file */
- if (buf == str) /* got bupkus */
- return NULL;
- break; /* got something -- return it */
- }
+ if (state->x.have == 0 && gz_fetch(state) == -1)
+ return NULL; /* error */
+ if (state->x.have == 0) { /* end of file */
+ state->past = 1; /* read past end */
+ break; /* return what we have */
}
/* look for end-of-line in current output buffer */
- n = state->have > left ? left : state->have;
- eol = memchr(state->next, '\n', n);
+ n = state->x.have > left ? left : state->x.have;
+ eol = memchr(state->x.next, '\n', n);
if (eol != NULL)
- n = (unsigned)(eol - state->next) + 1;
+ n = (unsigned)(eol - state->x.next) + 1;
/* copy through end-of-line, or remainder if not found */
- memcpy(buf, state->next, n);
- state->have -= n;
- state->next += n;
- state->pos += n;
+ memcpy(buf, state->x.next, n);
+ state->x.have -= n;
+ state->x.next += n;
+ state->x.pos += n;
left -= n;
buf += n;
} while (left && eol == NULL);
- /* found end-of-line or out of space -- terminate string and return it */
+ /* return terminated string, or if nothing, end of file */
+ if (buf == str)
+ return NULL;
buf[0] = 0;
return str;
}
@@ -610,16 +549,12 @@ int ZEXPORT gzdirect(file)
return 0;
state = (gz_statep)file;
- /* check that we're reading */
- if (state->mode != GZ_READ)
- return 0;
-
/* if the state is not known, but we can find out, then do so (this is
mainly for right after a gzopen() or gzdopen()) */
- if (state->how == LOOK && state->have == 0)
- (void)gz_head(state);
+ if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
+ (void)gz_look(state);
- /* return 1 if reading direct, 0 if decompressing a gzip stream */
+ /* return 1 if transparent, 0 if processing a gzip stream */
return state->direct;
}
@@ -627,7 +562,7 @@ int ZEXPORT gzdirect(file)
int ZEXPORT gzclose_r(file)
gzFile file;
{
- int ret;
+ int ret, err;
gz_statep state;
/* get internal structure */
@@ -645,9 +580,10 @@ int ZEXPORT gzclose_r(file)
free(state->out);
free(state->in);
}
+ err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
gz_error(state, Z_OK, NULL);
free(state->path);
ret = close(state->fd);
free(state);
- return ret ? Z_ERRNO : Z_OK;
+ return ret ? Z_ERRNO : err;
}
diff --git a/dep/zlib/gzwrite.c b/dep/zlib/gzwrite.c
index e8defc6887a..27cb3428e32 100644
--- a/dep/zlib/gzwrite.c
+++ b/dep/zlib/gzwrite.c
@@ -1,5 +1,5 @@
/* gzwrite.c -- zlib functions for writing gzip files
- * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -18,44 +18,55 @@ local int gz_init(state)
int ret;
z_streamp strm = &(state->strm);
- /* allocate input and output buffers */
+ /* allocate input buffer */
state->in = malloc(state->want);
- state->out = malloc(state->want);
- if (state->in == NULL || state->out == NULL) {
- if (state->out != NULL)
- free(state->out);
- if (state->in != NULL)
- free(state->in);
+ if (state->in == NULL) {
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
- /* allocate deflate memory, set up for gzip compression */
- strm->zalloc = Z_NULL;
- strm->zfree = Z_NULL;
- strm->opaque = Z_NULL;
- ret = deflateInit2(strm, state->level, Z_DEFLATED,
- 15 + 16, 8, state->strategy);
- if (ret != Z_OK) {
- free(state->in);
- gz_error(state, Z_MEM_ERROR, "out of memory");
- return -1;
+ /* only need output buffer and deflate state if compressing */
+ if (!state->direct) {
+ /* allocate output buffer */
+ state->out = malloc(state->want);
+ if (state->out == NULL) {
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+
+ /* allocate deflate memory, set up for gzip compression */
+ strm->zalloc = Z_NULL;
+ strm->zfree = Z_NULL;
+ strm->opaque = Z_NULL;
+ ret = deflateInit2(strm, state->level, Z_DEFLATED,
+ MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
+ if (ret != Z_OK) {
+ free(state->out);
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
}
/* mark state as initialized */
state->size = state->want;
- /* initialize write buffer */
- strm->avail_out = state->size;
- strm->next_out = state->out;
- state->next = strm->next_out;
+ /* initialize write buffer if compressing */
+ if (!state->direct) {
+ strm->avail_out = state->size;
+ strm->next_out = state->out;
+ state->x.next = strm->next_out;
+ }
return 0;
}
/* Compress whatever is at avail_in and next_in and write to the output file.
Return -1 if there is an error writing to the output file, otherwise 0.
flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH,
- then the deflate() state is reset to start a new gzip stream. */
+ then the deflate() state is reset to start a new gzip stream. If gz->direct
+ is true, then simply write to the output file without compressing, and
+ ignore flush. */
local int gz_comp(state, flush)
gz_statep state;
int flush;
@@ -68,6 +79,17 @@ local int gz_comp(state, flush)
if (state->size == 0 && gz_init(state) == -1)
return -1;
+ /* write directly if requested */
+ if (state->direct) {
+ got = write(state->fd, strm->next_in, strm->avail_in);
+ if (got < 0 || (unsigned)got != strm->avail_in) {
+ gz_error(state, Z_ERRNO, zstrerror());
+ return -1;
+ }
+ strm->avail_in = 0;
+ return 0;
+ }
+
/* run deflate() on provided input until it produces no more output */
ret = Z_OK;
do {
@@ -75,8 +97,8 @@ local int gz_comp(state, flush)
doing Z_FINISH then don't write until we get to Z_STREAM_END */
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
(flush != Z_FINISH || ret == Z_STREAM_END))) {
- have = (unsigned)(strm->next_out - state->next);
- if (have && ((got = write(state->fd, state->next, have)) < 0 ||
+ have = (unsigned)(strm->next_out - state->x.next);
+ if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
(unsigned)got != have)) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
@@ -85,7 +107,7 @@ local int gz_comp(state, flush)
strm->avail_out = state->size;
strm->next_out = state->out;
}
- state->next = strm->next_out;
+ state->x.next = strm->next_out;
}
/* compress */
@@ -131,7 +153,7 @@ local int gz_zero(state, len)
}
strm->avail_in = n;
strm->next_in = state->in;
- state->pos += n;
+ state->x.pos += n;
if (gz_comp(state, Z_NO_FLUSH) == -1)
return -1;
len -= n;
@@ -163,7 +185,7 @@ int ZEXPORT gzwrite(file, buf, len)
/* since an int is returned, make sure len fits in one, otherwise return
with an error (this avoids the flaw in the interface) */
if ((int)len < 0) {
- gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
+ gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
return 0;
}
@@ -193,7 +215,7 @@ int ZEXPORT gzwrite(file, buf, len)
n = len;
memcpy(strm->next_in + strm->avail_in, buf, n);
strm->avail_in += n;
- state->pos += n;
+ state->x.pos += n;
buf = (char *)buf + n;
len -= n;
if (len && gz_comp(state, Z_NO_FLUSH) == -1)
@@ -208,7 +230,7 @@ int ZEXPORT gzwrite(file, buf, len)
/* directly compress user buffer to file */
strm->avail_in = len;
strm->next_in = (voidp)buf;
- state->pos += len;
+ state->x.pos += len;
if (gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
}
@@ -249,15 +271,15 @@ int ZEXPORT gzputc(file, c)
if (strm->avail_in == 0)
strm->next_in = state->in;
strm->next_in[strm->avail_in++] = c;
- state->pos++;
- return c;
+ state->x.pos++;
+ return c & 0xff;
}
/* no room in buffer or not initialized, use gz_write() */
buf[0] = c;
if (gzwrite(file, buf, 1) != 1)
return -1;
- return c;
+ return c & 0xff;
}
/* -- see zlib.h -- */
@@ -274,7 +296,7 @@ int ZEXPORT gzputs(file, str)
return ret == 0 && len != 0 ? -1 : ret;
}
-#ifdef STDC
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
#include <stdarg.h>
/* -- see zlib.h -- */
@@ -316,19 +338,19 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
va_start(va, format);
#ifdef NO_vsnprintf
# ifdef HAS_vsprintf_void
- (void)vsprintf(state->in, format, va);
+ (void)vsprintf((char *)(state->in), format, va);
va_end(va);
for (len = 0; len < size; len++)
if (state->in[len] == 0) break;
# else
- len = vsprintf(state->in, format, va);
+ len = vsprintf((char *)(state->in), format, va);
va_end(va);
# endif
#else
# ifdef HAS_vsnprintf_void
- (void)vsnprintf(state->in, size, format, va);
+ (void)vsnprintf((char *)(state->in), size, format, va);
va_end(va);
- len = strlen(state->in);
+ len = strlen((char *)(state->in));
# else
len = vsnprintf((char *)(state->in), size, format, va);
va_end(va);
@@ -342,11 +364,11 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
/* update buffer and position, defer compression until needed */
strm->avail_in = (unsigned)len;
strm->next_in = state->in;
- state->pos += len;
+ state->x.pos += len;
return len;
}
-#else /* !STDC */
+#else /* !STDC && !Z_HAVE_STDARG_H */
/* -- see zlib.h -- */
int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
@@ -366,6 +388,10 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
state = (gz_statep)file;
strm = &(state->strm);
+ /* check that can really pass pointer in ints */
+ if (sizeof(int) != sizeof(void *))
+ return 0;
+
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return 0;
@@ -390,22 +416,23 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
state->in[size - 1] = 0;
#ifdef NO_snprintf
# ifdef HAS_sprintf_void
- sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
for (len = 0; len < size; len++)
if (state->in[len] == 0) break;
# else
- len = sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
- a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+ len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
# endif
#else
# ifdef HAS_snprintf_void
- snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
- len = strlen(state->in);
+ len = strlen((char *)(state->in));
# else
- len = snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
- a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+ len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,
+ a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18,
+ a19, a20);
# endif
#endif
@@ -416,7 +443,7 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
/* update buffer and position, defer compression until needed */
strm->avail_in = (unsigned)len;
strm->next_in = state->in;
- state->pos += len;
+ state->x.pos += len;
return len;
}
@@ -500,7 +527,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
int ZEXPORT gzclose_w(file)
gzFile file;
{
- int ret = 0;
+ int ret = Z_OK;
gz_statep state;
/* get internal structure */
@@ -515,17 +542,24 @@ int ZEXPORT gzclose_w(file)
/* check for seek request */
if (state->seek) {
state->seek = 0;
- ret += gz_zero(state, state->skip);
+ if (gz_zero(state, state->skip) == -1)
+ ret = state->err;
}
/* flush, free memory, and close file */
- ret += gz_comp(state, Z_FINISH);
- (void)deflateEnd(&(state->strm));
- free(state->out);
- free(state->in);
+ if (state->size) {
+ if (gz_comp(state, Z_FINISH) == -1)
+ ret = state->err;
+ if (!state->direct) {
+ (void)deflateEnd(&(state->strm));
+ free(state->out);
+ }
+ free(state->in);
+ }
gz_error(state, Z_OK, NULL);
free(state->path);
- ret += close(state->fd);
+ if (close(state->fd) == -1)
+ ret = Z_ERRNO;
free(state);
- return ret ? Z_ERRNO : Z_OK;
+ return ret;
}
diff --git a/dep/zlib/infback.c b/dep/zlib/infback.c
index af3a8c965d5..981aff17c2d 100644
--- a/dep/zlib/infback.c
+++ b/dep/zlib/infback.c
@@ -1,5 +1,5 @@
/* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2009 Mark Adler
+ * Copyright (C) 1995-2011 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -42,10 +42,19 @@ int stream_size;
return Z_STREAM_ERROR;
strm->msg = Z_NULL; /* in case we return an error */
if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
strm->zalloc = zcalloc;
strm->opaque = (voidpf)0;
+#endif
}
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
state = (struct inflate_state FAR *)ZALLOC(strm, 1,
sizeof(struct inflate_state));
if (state == Z_NULL) return Z_MEM_ERROR;
@@ -394,7 +403,6 @@ void FAR *out_desc;
PULLBYTE();
}
if (here.val < 16) {
- NEEDBITS(here.bits);
DROPBITS(here.bits);
state->lens[state->have++] = here.val;
}
diff --git a/dep/zlib/inffixed.h b/dep/zlib/inffixed.h
index 75ed4b5978d..d6283277694 100644
--- a/dep/zlib/inffixed.h
+++ b/dep/zlib/inffixed.h
@@ -2,9 +2,9 @@
* Generated automatically by makefixed().
*/
- /* WARNING: this file should *not* be used by applications. It
- is part of the implementation of the compression library and
- is subject to change. Applications should only use zlib.h.
+ /* WARNING: this file should *not* be used by applications.
+ It is part of the implementation of this library and is
+ subject to change. Applications should only use zlib.h.
*/
static const code lenfix[512] = {
diff --git a/dep/zlib/inflate.c b/dep/zlib/inflate.c
index a8431abeacf..47418a1e1e1 100644
--- a/dep/zlib/inflate.c
+++ b/dep/zlib/inflate.c
@@ -1,5 +1,5 @@
/* inflate.c -- zlib decompression
- * Copyright (C) 1995-2010 Mark Adler
+ * Copyright (C) 1995-2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -100,7 +100,7 @@ local int updatewindow OF((z_streamp strm, unsigned out));
local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
unsigned len));
-int ZEXPORT inflateReset(strm)
+int ZEXPORT inflateResetKeep(strm)
z_streamp strm;
{
struct inflate_state FAR *state;
@@ -109,15 +109,13 @@ z_streamp strm;
state = (struct inflate_state FAR *)strm->state;
strm->total_in = strm->total_out = state->total = 0;
strm->msg = Z_NULL;
- strm->adler = 1; /* to support ill-conceived Java test suite */
+ if (state->wrap) /* to support ill-conceived Java test suite */
+ strm->adler = state->wrap & 1;
state->mode = HEAD;
state->last = 0;
state->havedict = 0;
state->dmax = 32768U;
state->head = Z_NULL;
- state->wsize = 0;
- state->whave = 0;
- state->wnext = 0;
state->hold = 0;
state->bits = 0;
state->lencode = state->distcode = state->next = state->codes;
@@ -127,6 +125,19 @@ z_streamp strm;
return Z_OK;
}
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ state->wsize = 0;
+ state->whave = 0;
+ state->wnext = 0;
+ return inflateResetKeep(strm);
+}
+
int ZEXPORT inflateReset2(strm, windowBits)
z_streamp strm;
int windowBits;
@@ -180,10 +191,19 @@ int stream_size;
if (strm == Z_NULL) return Z_STREAM_ERROR;
strm->msg = Z_NULL; /* in case we return an error */
if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
strm->zalloc = zcalloc;
strm->opaque = (voidpf)0;
+#endif
}
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
state = (struct inflate_state FAR *)
ZALLOC(strm, 1, sizeof(struct inflate_state));
if (state == Z_NULL) return Z_MEM_ERROR;
@@ -321,8 +341,8 @@ void makefixed()
low = 0;
for (;;) {
if ((low % 7) == 0) printf("\n ");
- printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
- state.lencode[low].val);
+ printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+ state.lencode[low].bits, state.lencode[low].val);
if (++low == size) break;
putchar(',');
}
@@ -499,11 +519,6 @@ unsigned out;
bits -= bits & 7; \
} while (0)
-/* Reverse the bytes in a 32-bit value */
-#define REVERSE(q) \
- ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
- (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
/*
inflate() uses a state machine to process as much input data and generate as
much output data as possible before returning. The state machine is
@@ -797,7 +812,7 @@ int flush;
#endif
case DICTID:
NEEDBITS(32);
- strm->adler = state->check = REVERSE(hold);
+ strm->adler = state->check = ZSWAP32(hold);
INITBITS();
state->mode = DICT;
case DICT:
@@ -925,7 +940,6 @@ int flush;
PULLBYTE();
}
if (here.val < 16) {
- NEEDBITS(here.bits);
DROPBITS(here.bits);
state->lens[state->have++] = here.val;
}
@@ -1170,7 +1184,7 @@ int flush;
#ifdef GUNZIP
state->flags ? hold :
#endif
- REVERSE(hold)) != state->check) {
+ ZSWAP32(hold)) != state->check) {
strm->msg = (char *)"incorrect data check";
state->mode = BAD;
break;
@@ -1214,7 +1228,8 @@ int flush;
*/
inf_leave:
RESTORE();
- if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
+ if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+ (state->mode < CHECK || flush != Z_FINISH)))
if (updatewindow(strm, out)) {
state->mode = MEM;
return Z_MEM_ERROR;
@@ -1255,7 +1270,10 @@ const Bytef *dictionary;
uInt dictLength;
{
struct inflate_state FAR *state;
- unsigned long id;
+ unsigned long dictid;
+ unsigned char *next;
+ unsigned avail;
+ int ret;
/* check state */
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
@@ -1263,29 +1281,27 @@ uInt dictLength;
if (state->wrap != 0 && state->mode != DICT)
return Z_STREAM_ERROR;
- /* check for correct dictionary id */
+ /* check for correct dictionary identifier */
if (state->mode == DICT) {
- id = adler32(0L, Z_NULL, 0);
- id = adler32(id, dictionary, dictLength);
- if (id != state->check)
+ dictid = adler32(0L, Z_NULL, 0);
+ dictid = adler32(dictid, dictionary, dictLength);
+ if (dictid != state->check)
return Z_DATA_ERROR;
}
- /* copy dictionary to window */
- if (updatewindow(strm, strm->avail_out)) {
+ /* copy dictionary to window using updatewindow(), which will amend the
+ existing dictionary if appropriate */
+ next = strm->next_out;
+ avail = strm->avail_out;
+ strm->next_out = (Bytef *)dictionary + dictLength;
+ strm->avail_out = 0;
+ ret = updatewindow(strm, dictLength);
+ strm->avail_out = avail;
+ strm->next_out = next;
+ if (ret) {
state->mode = MEM;
return Z_MEM_ERROR;
}
- if (dictLength > state->wsize) {
- zmemcpy(state->window, dictionary + dictLength - state->wsize,
- state->wsize);
- state->whave = state->wsize;
- }
- else {
- zmemcpy(state->window + state->wsize - dictLength, dictionary,
- dictLength);
- state->whave = dictLength;
- }
state->havedict = 1;
Tracev((stderr, "inflate: dictionary set\n"));
return Z_OK;
@@ -1433,8 +1449,8 @@ z_streamp source;
}
/* copy state */
- zmemcpy(dest, source, sizeof(z_stream));
- zmemcpy(copy, state, sizeof(struct inflate_state));
+ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+ zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
if (state->lencode >= state->codes &&
state->lencode <= state->codes + ENOUGH - 1) {
copy->lencode = copy->codes + (state->lencode - state->codes);
diff --git a/dep/zlib/inftrees.c b/dep/zlib/inftrees.c
index 11e9c52accb..abcd7c45ed3 100644
--- a/dep/zlib/inftrees.c
+++ b/dep/zlib/inftrees.c
@@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2010 Mark Adler
+ * Copyright (C) 1995-2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
+ " inflate 1.2.7 Copyright 1995-2012 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 78, 68};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -289,38 +289,14 @@ unsigned short FAR *work;
}
}
- /*
- Fill in rest of table for incomplete codes. This loop is similar to the
- loop above in incrementing huff for table indices. It is assumed that
- len is equal to curr + drop, so there is no loop needed to increment
- through high index bits. When the current sub-table is filled, the loop
- drops back to the root table to fill in any remaining entries there.
- */
- here.op = (unsigned char)64; /* invalid code marker */
- here.bits = (unsigned char)(len - drop);
- here.val = (unsigned short)0;
- while (huff != 0) {
- /* when done with sub-table, drop back to root table */
- if (drop != 0 && (huff & mask) != low) {
- drop = 0;
- len = root;
- next = *table;
- here.bits = (unsigned char)len;
- }
-
- /* put invalid code marker in table */
- next[huff >> drop] = here;
-
- /* backwards increment the len-bit code huff */
- incr = 1U << (len - 1);
- while (huff & incr)
- incr >>= 1;
- if (incr != 0) {
- huff &= incr - 1;
- huff += incr;
- }
- else
- huff = 0;
+ /* fill in remaining table entry if code is incomplete (guaranteed to have
+ at most one remaining entry, since if the code is incomplete, the
+ maximum code length that was allowed to get this far is one bit) */
+ if (huff != 0) {
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)(len - drop);
+ here.val = (unsigned short)0;
+ next[huff] = here;
}
/* set return parameters */
diff --git a/dep/zlib/trees.c b/dep/zlib/trees.c
index 56e9bb1c115..8c32b214b1d 100644
--- a/dep/zlib/trees.c
+++ b/dep/zlib/trees.c
@@ -1,5 +1,5 @@
/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2010 Jean-loup Gailly
+ * Copyright (C) 1995-2012 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -74,11 +74,6 @@ local const uch bl_order[BL_CODES]
* probability, to avoid transmitting the lengths for unused bit length codes.
*/
-#define Buf_size (8 * 2*sizeof(char))
-/* Number of bits used within bi_buf. (bi_buf might be implemented on
- * more than 16 bits on some systems.)
- */
-
/* ===========================================================================
* Local data. These are initialized only once.
*/
@@ -399,7 +394,6 @@ void ZLIB_INTERNAL _tr_init(s)
s->bi_buf = 0;
s->bi_valid = 0;
- s->last_eob_len = 8; /* enough lookahead for inflate */
#ifdef DEBUG
s->compressed_len = 0L;
s->bits_sent = 0L;
@@ -883,15 +877,17 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
}
/* ===========================================================================
+ * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
+ */
+void ZLIB_INTERNAL _tr_flush_bits(s)
+ deflate_state *s;
+{
+ bi_flush(s);
+}
+
+/* ===========================================================================
* Send one empty static block to give enough lookahead for inflate.
* This takes 10 bits, of which 7 may remain in the bit buffer.
- * The current inflate code requires 9 bits of lookahead. If the
- * last two codes for the previous block (real code plus EOB) were coded
- * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
- * the last real code. In this case we send two empty static blocks instead
- * of one. (There are no problems if the previous block is stored or fixed.)
- * To simplify the code, we assume the worst case of last real code encoded
- * on one bit only.
*/
void ZLIB_INTERNAL _tr_align(s)
deflate_state *s;
@@ -902,20 +898,6 @@ void ZLIB_INTERNAL _tr_align(s)
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
#endif
bi_flush(s);
- /* Of the 10 bits for the empty block, we have already sent
- * (10 - bi_valid) bits. The lookahead for the last real code (before
- * the EOB of the previous block) was thus at least one plus the length
- * of the EOB plus what we have just sent of the empty static block.
- */
- if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
- s->compressed_len += 10L;
-#endif
- bi_flush(s);
- }
- s->last_eob_len = 7;
}
/* ===========================================================================
@@ -1118,7 +1100,6 @@ local void compress_block(s, ltree, dtree)
} while (lx < s->last_lit);
send_code(s, END_BLOCK, ltree);
- s->last_eob_len = ltree[END_BLOCK].Len;
}
/* ===========================================================================
@@ -1226,7 +1207,6 @@ local void copy_block(s, buf, len, header)
int header; /* true if block header must be written */
{
bi_windup(s); /* align on byte boundary */
- s->last_eob_len = 8; /* enough lookahead for inflate */
if (header) {
put_short(s, (ush)len);
diff --git a/dep/zlib/zconf.h b/dep/zlib/zconf.h
index 02ce56c4313..8a46a58b30c 100644
--- a/dep/zlib/zconf.h
+++ b/dep/zlib/zconf.h
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2012 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -15,6 +15,7 @@
* this permanently in zconf.h using "./configure --zprefix".
*/
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+# define Z_PREFIX_SET
/* all linked symbols */
# define _dist_code z__dist_code
@@ -27,9 +28,11 @@
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
+# ifndef Z_SOLO
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# endif
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
@@ -40,44 +43,52 @@
# define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
+# define deflatePending z_deflatePending
# define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset
+# define deflateResetKeep z_deflateResetKeep
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
-# define gz_error z_gz_error
-# define gz_intmax z_gz_intmax
-# define gz_strwinerror z_gz_strwinerror
-# define gzbuffer z_gzbuffer
-# define gzclearerr z_gzclearerr
-# define gzclose z_gzclose
-# define gzclose_r z_gzclose_r
-# define gzclose_w z_gzclose_w
-# define gzdirect z_gzdirect
-# define gzdopen z_gzdopen
-# define gzeof z_gzeof
-# define gzerror z_gzerror
-# define gzflush z_gzflush
-# define gzgetc z_gzgetc
-# define gzgets z_gzgets
-# define gzoffset z_gzoffset
-# define gzoffset64 z_gzoffset64
-# define gzopen z_gzopen
-# define gzopen64 z_gzopen64
-# define gzprintf z_gzprintf
-# define gzputc z_gzputc
-# define gzputs z_gzputs
-# define gzread z_gzread
-# define gzrewind z_gzrewind
-# define gzseek z_gzseek
-# define gzseek64 z_gzseek64
-# define gzsetparams z_gzsetparams
-# define gztell z_gztell
-# define gztell64 z_gztell64
-# define gzungetc z_gzungetc
-# define gzwrite z_gzwrite
+# ifndef Z_SOLO
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgetc_ z_gzgetc_
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# ifdef _WIN32
+# define gzopen_w z_gzopen_w
+# endif
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# endif
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
@@ -95,13 +106,18 @@
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
+# define inflateResetKeep z_inflateResetKeep
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
-# define uncompress z_uncompress
+# ifndef Z_SOLO
+# define uncompress z_uncompress
+# endif
# define zError z_zError
-# define zcalloc z_zcalloc
-# define zcfree z_zcfree
+# ifndef Z_SOLO
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# endif
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
@@ -111,7 +127,9 @@
# define alloc_func z_alloc_func
# define charf z_charf
# define free_func z_free_func
-# define gzFile z_gzFile
+# ifndef Z_SOLO
+# define gzFile z_gzFile
+# endif
# define gz_header z_gz_header
# define gz_headerp z_gz_headerp
# define in_func z_in_func
@@ -197,6 +215,12 @@
# endif
#endif
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
+#endif
+
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
@@ -243,6 +267,14 @@
# endif
#endif
+#ifndef Z_ARG /* function prototypes for stdarg */
+# if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# define Z_ARG(args) args
+# else
+# define Z_ARG(args) ()
+# endif
+#endif
+
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
@@ -356,12 +388,45 @@ typedef uLong FAR uLongf;
typedef Byte *voidp;
#endif
+/* ./configure may #define Z_U4 here */
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (UINT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned
+# else
+# if (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# else
+# if (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
+# endif
+# endif
+# endif
+#endif
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
+#else
+ typedef unsigned long z_crc_t;
+#endif
+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
+#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_STDARG_H
+#endif
+
#ifdef STDC
-# include <sys/types.h> /* for off_t */
+# ifndef Z_SOLO
+# include <sys/types.h> /* for off_t */
+# endif
+#endif
+
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
@@ -370,21 +435,38 @@ typedef uLong FAR uLongf;
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
-#if -_LARGEFILE64_SOURCE - -1 == 1
+#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-# include <unistd.h> /* for SEEK_* and off_t */
-# ifdef VMS
-# include <unixio.h> /* for off_t */
-# endif
-# ifndef z_off_t
-# define z_off_t off_t
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+# define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+# if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
# endif
#endif
-#ifndef SEEK_SET
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+# define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+# define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+# define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
@@ -394,18 +476,14 @@ typedef uLong FAR uLongf;
# define z_off_t long
#endif
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
-# define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-# define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-# define NO_vsnprintf
+# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# define z_off64_t __int64
+# else
+# define z_off64_t z_off_t
+# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
diff --git a/dep/zlib/zlib.h b/dep/zlib/zlib.h
index bfbba83e8ee..3edf3acdb57 100644
--- a/dep/zlib/zlib.h
+++ b/dep/zlib/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.5, April 19th, 2010
+ version 1.2.7, May 2nd, 2012
- Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -24,8 +24,8 @@
The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+ Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
*/
#ifndef ZLIB_H
@@ -37,11 +37,11 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.5"
-#define ZLIB_VERNUM 0x1250
+#define ZLIB_VERSION "1.2.7"
+#define ZLIB_VERNUM 0x1270
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_REVISION 7
#define ZLIB_VER_SUBREVISION 0
/*
@@ -83,15 +83,15 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state;
typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
+ z_const Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
+ uLong total_in; /* total number of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
+ uLong total_out; /* total number of bytes output so far */
- char *msg; /* last error message, NULL if no error */
+ z_const char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
@@ -327,8 +327,9 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
Z_FINISH can be used immediately after deflateInit if all the compression
is to be done in a single step. In this case, avail_out must be at least the
- value returned by deflateBound (see below). If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
+ value returned by deflateBound (see below). Then deflate is guaranteed to
+ return Z_STREAM_END. If not enough output space is provided, deflate will
+ not return Z_STREAM_END, and it must be called again as described above.
deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes).
@@ -451,23 +452,29 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
error. However if all decompression is to be performed in a single step (a
single call of inflate), the parameter flush should be set to Z_FINISH. In
this case all pending input is processed and all pending output is flushed;
- avail_out must be large enough to hold all the uncompressed data. (The size
- of the uncompressed data may have been saved by the compressor for this
- purpose.) The next operation on this stream must be inflateEnd to deallocate
- the decompression state. The use of Z_FINISH is never required, but can be
- used to inform inflate that a faster approach may be used for the single
- inflate() call.
+ avail_out must be large enough to hold all of the uncompressed data for the
+ operation to complete. (The size of the uncompressed data may have been
+ saved by the compressor for this purpose.) The use of Z_FINISH is not
+ required to perform an inflation in one step. However it may be used to
+ inform inflate that a faster approach can be used for the single inflate()
+ call. Z_FINISH also informs inflate to not maintain a sliding window if the
+ stream completes, which reduces inflate's memory footprint. If the stream
+ does not complete, either because not all of the stream is provided or not
+ enough output space is provided, then a sliding window will be allocated and
+ inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+ been used.
In this implementation, inflate() always flushes as much output as
possible to the output buffer, and always uses the faster approach on the
- first call. So the only effect of the flush parameter in this implementation
- is on the return value of inflate(), as noted below, or when it returns early
- because Z_BLOCK or Z_TREES is used.
+ first call. So the effects of the flush parameter in this implementation are
+ on the return value of inflate() as noted below, when inflate() returns early
+ when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+ memory for a sliding window when Z_FINISH is used.
If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm->adler to the adler32 checksum of the dictionary
+ below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
- strm->adler to the adler32 checksum of all output produced so far (that is,
+ strm->adler to the Adler-32 checksum of all output produced so far (that is,
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
below. At the end of the stream, inflate() checks that its computed adler32
checksum is equal to that saved by the compressor and returns Z_STREAM_END
@@ -478,7 +485,9 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
initializing with inflateInit2(). Any information contained in the gzip
header is not retained, so applications that need that information should
instead use raw inflate, see inflateInit2() below, or inflateBack() and
- perform their own processing of the gzip header and trailer.
+ perform their own processing of the gzip header and trailer. When processing
+ gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+ producted so far. The CRC-32 is checked against the gzip trailer.
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
@@ -580,10 +589,15 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any call
- of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
+ without producing any compressed output. When using the zlib format, this
+ function must be called immediately after deflateInit, deflateInit2 or
+ deflateReset, and before any call of deflate. When doing raw deflate, this
+ function must be called either before any call of deflate, or immediately
+ after the completion of a deflate block, i.e. after all input has been
+ consumed and all output has been delivered when using any of the flush
+ options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
+ compressor and decompressor must use exactly the same dictionary (see
+ inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
@@ -610,8 +624,8 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
+ or if not at a block boundary for raw deflate). deflateSetDictionary does
+ not perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
@@ -688,8 +702,28 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
deflation of sourceLen bytes. It must be called after deflateInit() or
deflateInit2(), and after deflateSetHeader(), if used. This would be used
to allocate an output buffer for deflation in a single pass, and so would be
- called before deflate().
-*/
+ called before deflate(). If that first deflate() call is provided the
+ sourceLen input bytes, an output buffer allocated to the size returned by
+ deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+ to return Z_STREAM_END. Note that it is possible for the compressed size to
+ be larger than the value returned by deflateBound() if flush options other
+ than Z_FINISH or Z_NO_FLUSH are used.
+*/
+
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+ unsigned *pending,
+ int *bits));
+/*
+ deflatePending() returns the number of bytes and bits of output that have
+ been generated, but not yet provided in the available output. The bytes not
+ provided would be due to the available output space having being consumed.
+ The number of bits of output not provided are between 0 and 7, where they
+ await more bits to join them in order to fill out a full byte. If pending
+ or bits are Z_NULL, then those values are not set.
+
+ deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+ */
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
int bits,
@@ -703,8 +737,9 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
than or equal to 16, and that many of the least significant bits of value
will be inserted in the output.
- deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
+ deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+ room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+ source stream state was inconsistent.
*/
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
@@ -790,10 +825,11 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the adler32 value returned by that call of inflate.
The compressor and decompressor must use exactly the same dictionary (see
- deflateSetDictionary). For raw inflate, this function can be called
- immediately after inflateInit2() or inflateReset() and before any call of
- inflate() to set the dictionary. The application must insure that the
- dictionary that was used for compression is provided.
+ deflateSetDictionary). For raw inflate, this function can be called at any
+ time to set the dictionary. If the provided dictionary is smaller than the
+ window and there is already data in the window, then the provided dictionary
+ will amend what's there. The application must insure that the dictionary
+ that was used for compression is provided.
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
@@ -805,17 +841,21 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
+ Skips invalid compressed data until a possible full flush point (see above
+ for the description of deflate with Z_FULL_FLUSH) can be found, or until all
available input is skipped. No output is provided.
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been
- found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the
- success case, the application may save the current current value of total_in
- which indicates where valid compressed data was found. In the error case,
- the application may repeatedly call inflateSync, providing more input each
- time, until success or end of the input data.
+ inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+ All full flush points have this pattern, but not all occurences of this
+ pattern are full flush points.
+
+ inflateSync returns Z_OK if a possible full flush point has been found,
+ Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+ has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+ In the success case, the application may save the current current value of
+ total_in which indicates where valid compressed data was found. In the
+ error case, the application may repeatedly call inflateSync, providing more
+ input each time, until success or end of the input data.
*/
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
@@ -962,7 +1002,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
See inflateBack() for the usage of these routines.
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
+ the parameters are invalid, Z_MEM_ERROR if the internal state could not be
allocated, or Z_VERSION_ERROR if the version of the library does not match
the version of the header file.
*/
@@ -1088,6 +1128,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
27-31: 0 (reserved)
*/
+#ifndef Z_SOLO
/* utility functions */
@@ -1149,10 +1190,11 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
+ the case where there is not enough room, uncompress() will fill the output
+ buffer with the uncompressed data up to that point.
*/
-
/* gzip file access functions */
/*
@@ -1162,7 +1204,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
wrapper, documented in RFC 1952, wrapped around a deflate stream.
*/
-typedef voidp gzFile; /* opaque gzip file descriptor */
+typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
/*
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
@@ -1172,13 +1214,28 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
for fixed code compression as in "wb9F". (See the description of
- deflateInit2 for more information about the strategy parameter.) Also "a"
- can be used instead of "w" to request that the gzip stream that will be
- written be appended to the file. "+" will result in an error, since reading
- and writing to the same gzip file is not supported.
+ deflateInit2 for more information about the strategy parameter.) 'T' will
+ request transparent writing or appending with no compression and not using
+ the gzip format.
+
+ "a" can be used instead of "w" to request that the gzip stream that will
+ be written be appended to the file. "+" will result in an error, since
+ reading and writing to the same gzip file is not supported. The addition of
+ "x" when writing will create the file exclusively, which fails if the file
+ already exists. On systems that support it, the addition of "e" when
+ reading or writing will set the flag to close the file on an execve() call.
+
+ These functions, as well as gzip, will read and decode a sequence of gzip
+ streams in a file. The append function of gzopen() can be used to create
+ such a file. (Also see gzflush() for another way to do this.) When
+ appending, gzopen does not test whether the file begins with a gzip stream,
+ nor does it look for the end of the gzip streams to begin appending. gzopen
+ will simply append a gzip stream to the existing file.
gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
+ case gzread will directly read from the file without decompression. When
+ reading, this will be detected automatically by looking for the magic two-
+ byte gzip header.
gzopen returns NULL if the file could not be opened, if there was
insufficient memory to allocate the gzFile state, or if an invalid mode was
@@ -1197,7 +1254,11 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
mode);. The duplicated descriptor should be saved to avoid a leak, since
- gzdopen does not close fd if it fails.
+ gzdopen does not close fd if it fails. If you are using fileno() to get the
+ file descriptor from a FILE *, then you will have to use dup() to avoid
+ double-close()ing the file descriptor. Both gzclose() and fclose() will
+ close the associated file descriptor, so they need to have different file
+ descriptors.
gzdopen returns NULL if there was insufficient memory to allocate the
gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
@@ -1235,14 +1296,26 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
Reads the given number of uncompressed bytes from the compressed file. If
- the input file was not in gzip format, gzread copies the given number of
- bytes into the buffer.
+ the input file is not in gzip format, gzread copies the given number of
+ bytes into the buffer directly from the file.
After reaching the end of a gzip stream in the input, gzread will continue
- to read, looking for another gzip stream, or failing that, reading the rest
- of the input file directly without decompression. The entire input file
- will be read if gzread is called until it returns less than the requested
- len.
+ to read, looking for another gzip stream. Any number of gzip streams may be
+ concatenated in the input file, and will all be decompressed by gzread().
+ If something other than a gzip stream is encountered after a gzip stream,
+ that remaining trailing garbage is ignored (and no error is returned).
+
+ gzread can be used to read a gzip file that is being concurrently written.
+ Upon reaching the end of the input, gzread will return with the available
+ data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+ gzclearerr can be used to clear the end of file indicator in order to permit
+ gzread to be tried again. Z_OK indicates that a gzip stream was completed
+ on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
+ middle of a gzip stream. Note that gzread does not return -1 in the event
+ of an incomplete gzip stream. This error is deferred until gzclose(), which
+ will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+ stream. Alternatively, gzerror can be used before gzclose to detect this
+ case.
gzread returns the number of uncompressed bytes actually read, less than
len for end of file, or -1 for error.
@@ -1256,7 +1329,7 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
error.
*/
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the arguments to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
@@ -1301,7 +1374,10 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
Reads one byte from the compressed file. gzgetc returns this byte or -1
- in case of end of file or error.
+ in case of end of file or error. This is implemented as a macro for speed.
+ As such, it does not do all of the checking the other functions do. I.e.
+ it does not check to see if file is NULL, nor whether the structure file
+ points to has been clobbered or not.
*/
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
@@ -1397,9 +1473,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
/*
Returns true (1) if file is being copied directly while reading, or false
- (0) if file is a gzip stream being decompressed. This state can change from
- false to true while reading the input file if the end of a gzip stream is
- reached, but is followed by data that is not another gzip stream.
+ (0) if file is a gzip stream being decompressed.
If the input file is empty, gzdirect() will return true, since the input
does not contain a gzip stream.
@@ -1408,6 +1482,13 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
cause buffers to be allocated to allow reading the file to determine if it
is a gzip file. Therefore if gzbuffer() is used, it should be called before
gzdirect().
+
+ When writing, gzdirect() returns true (1) if transparent writing was
+ requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
+ gzdirect() is not needed when writing. Transparent writing must be
+ explicitly requested, so the application already knows the answer. When
+ linking statically, using gzdirect() will include all of the zlib code for
+ gzip file reading and decompression, which may not be desired.)
*/
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
@@ -1419,7 +1500,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file));
must not be called more than once on the same allocation.
gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
- file operation error, or Z_OK on success.
+ file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+ last read ended in the middle of a gzip stream, or Z_OK on success.
*/
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
@@ -1457,6 +1539,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
file that is being written concurrently.
*/
+#endif /* !Z_SOLO */
/* checksum functions */
@@ -1492,16 +1575,17 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
- seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
+ that the z_off_t type (like off_t) is a signed integer. If len2 is
+ negative, the result has no meaning or utility.
*/
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running CRC-32 with the bytes buf[0..len-1] and return the
updated CRC-32. If buf is Z_NULL, this function returns the required
- initial value for the for the crc. Pre- and post-conditioning (one's
- complement) is performed within this function so it shouldn't be done by the
- application.
+ initial value for the crc. Pre- and post-conditioning (one's complement) is
+ performed within this function so it shouldn't be done by the application.
Usage example:
@@ -1544,17 +1628,42 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
const char *version,
int stream_size));
#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+ (int)sizeof(z_stream))
#define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, sizeof(z_stream))
+ ZLIB_VERSION, (int)sizeof(z_stream))
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure. Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro. The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously. They can
+ * only be used by the gzgetc() macro. You have been warned.
+ */
+struct gzFile_s {
+ unsigned have;
+ unsigned char *next;
+ z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+# define z_gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#else
+# define gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#endif
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
* change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
@@ -1562,7 +1671,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
* functions are changed to 64 bits) -- in case these are set on systems
* without large file support, _LFS64_LARGEFILE must also be true
*/
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#ifdef Z_LARGE64
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
@@ -1571,14 +1680,23 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
#endif
-#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
-# define gzopen gzopen64
-# define gzseek gzseek64
-# define gztell gztell64
-# define gzoffset gzoffset64
-# define adler32_combine adler32_combine64
-# define crc32_combine crc32_combine64
-# ifdef _LARGEFILE64_SOURCE
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+# ifdef Z_PREFIX_SET
+# define z_gzopen z_gzopen64
+# define z_gzseek z_gzseek64
+# define z_gztell z_gztell64
+# define z_gzoffset z_gzoffset64
+# define z_adler32_combine z_adler32_combine64
+# define z_crc32_combine z_crc32_combine64
+# else
+# define gzopen gzopen64
+# define gzseek gzseek64
+# define gztell gztell64
+# define gzoffset gzoffset64
+# define adler32_combine adler32_combine64
+# define crc32_combine crc32_combine64
+# endif
+# ifndef Z_LARGE64
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
@@ -1595,6 +1713,13 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
#endif
+#else /* Z_SOLO */
+
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
/* hack for buggy compilers */
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;};
@@ -1603,8 +1728,14 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
/* undocumented functions */
ZEXTERN const char * ZEXPORT zError OF((int));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
+ const char *mode));
+#endif
#ifdef __cplusplus
}
diff --git a/dep/zlib/zutil.c b/dep/zlib/zutil.c
index 898ed345b0e..65e0d3b72b0 100644
--- a/dep/zlib/zutil.c
+++ b/dep/zlib/zutil.c
@@ -1,11 +1,14 @@
/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
+#ifndef Z_SOLO
+# include "gzguts.h"
+#endif
#ifndef NO_DUMMY_DECL
struct internal_state {int dummy;}; /* for buggy compilers */
@@ -85,27 +88,27 @@ uLong ZEXPORT zlibCompileFlags()
#ifdef FASTEST
flags += 1L << 21;
#endif
-#ifdef STDC
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifdef NO_vsnprintf
- flags += 1L << 25;
+ flags += 1L << 25;
# ifdef HAS_vsprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# else
# ifdef HAS_vsnprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# endif
#else
- flags += 1L << 24;
+ flags += 1L << 24;
# ifdef NO_snprintf
- flags += 1L << 25;
+ flags += 1L << 25;
# ifdef HAS_sprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# else
# ifdef HAS_snprintf_void
- flags += 1L << 26;
+ flags += 1L << 26;
# endif
# endif
#endif
@@ -181,6 +184,7 @@ void ZLIB_INTERNAL zmemzero(dest, len)
}
#endif
+#ifndef Z_SOLO
#ifdef SYS16BIT
@@ -316,3 +320,5 @@ void ZLIB_INTERNAL zcfree (opaque, ptr)
}
#endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/dep/zlib/zutil.h b/dep/zlib/zutil.h
index 258fa88799a..4e3dcc6ae9f 100644
--- a/dep/zlib/zutil.h
+++ b/dep/zlib/zutil.h
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2012 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -13,7 +13,7 @@
#ifndef ZUTIL_H
#define ZUTIL_H
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#ifdef HAVE_HIDDEN
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
@@ -21,7 +21,7 @@
#include "zlib.h"
-#ifdef STDC
+#if defined(STDC) && !defined(Z_SOLO)
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h>
# endif
@@ -29,6 +29,10 @@
# include <stdlib.h>
#endif
+#ifdef Z_SOLO
+ typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
+#endif
+
#ifndef local
# define local static
#endif
@@ -78,16 +82,18 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
-# if defined(__TURBOC__) || defined(__BORLANDC__)
-# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
- /* Allow compilation with ANSI keywords only enabled */
- void _Cdecl farfree( void *block );
- void *_Cdecl farmalloc( unsigned long nbytes );
-# else
-# include <alloc.h>
+# ifndef Z_SOLO
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# include <malloc.h>
# endif
-# else /* MSC or DJGPP */
-# include <malloc.h>
# endif
#endif
@@ -107,18 +113,20 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef OS2
# define OS_CODE 0x06
-# ifdef M_I86
+# if defined(M_I86) && !defined(Z_SOLO)
# include <malloc.h>
# endif
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
+# ifndef Z_SOLO
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
# endif
# endif
#endif
@@ -153,14 +161,14 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__) && !defined(MSDOS)
#pragma warn -8004
#pragma warn -8008
#pragma warn -8066
#endif
/* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+#if !defined(_WIN32) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
#endif
@@ -177,42 +185,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* functions */
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#if defined(__CYGWIN__)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#ifndef HAVE_VSNPRINTF
-# ifdef MSDOS
- /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
-# define NO_vsnprintf
-# endif
-# ifdef __TURBOC__
-# define NO_vsnprintf
-# endif
-# ifdef WIN32
- /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-# if !defined(vsnprintf) && !defined(NO_vsnprintf)
-# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
-# define vsnprintf _vsnprintf
-# endif
-# endif
-# endif
-# ifdef __SASC
-# define NO_vsnprintf
-# endif
-#endif
-#ifdef VMS
-# define NO_vsnprintf
-#endif
-
-#if defined(pyr)
+#if defined(pyr) || defined(Z_SOLO)
# define NO_MEMCPY
#endif
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
@@ -261,14 +234,19 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define Tracecv(c,x)
#endif
-
-voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
- unsigned size));
-void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
+#ifndef Z_SOLO
+ voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+ unsigned size));
+ void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
+#endif
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+/* Reverse the bytes in a 32-bit value */
+#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+ (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
#endif /* ZUTIL_H */
diff --git a/doc/gpl-2.0.txt b/doc/GPL-2.0.txt
index d159169d105..d159169d105 100644
--- a/doc/gpl-2.0.txt
+++ b/doc/GPL-2.0.txt
diff --git a/doc/LoggingHOWTO.txt b/doc/LoggingHOWTO.txt
new file mode 100644
index 00000000000..79b03d3dd2f
--- /dev/null
+++ b/doc/LoggingHOWTO.txt
@@ -0,0 +1,274 @@
+Logging system "log4j-like"
+
+--- LOGGERS AND APPENDERS ---
+
+Logging system has two components: loggers and appenders. These types of
+components enable users to log messages according to message type and level and
+control at runtime where they are reported.
+
+LOGGERS
+
+The first and foremost advantage of this system resided in the ability to
+disable certain log statements while allowing others to print unhindered.
+This capability assumes that the loggers are categorized according to some
+developer-chosen criteria.
+
+Loggers follow hierarchy, if a logger is not defined a root logger will be used
+
+Loggers may be assigned levels. The set of possible levels are TRACE, DEBUG,
+INFO, WARN, ERROR AND FATAL, or be disabled using level DISABLED.
+
+By definition the printing method determines the level of a logging request.
+For example, sLog->outInfo(...) is a logging request of level INFO.
+
+A logging request is said to be enabled if its level is higher than or equal to
+the level of its logger. Otherwise, the request is said to be disabled. A logger
+without an assigned level will inherit one from the hierarchy
+
+Example
+Logger Name Assigned Level Inherited Level
+root Proot Proot
+Network None Proot
+
+As Network is not defined, it uses the root logger and it's log level.
+TRACE < DEBUG < INFO < WARN < ERROR < FATAL.
+
+
+APPENDERS
+
+The ability to selectively enable of dissable logging request based on their
+loggers is only part of the picture. This system allows logging requests to
+print to multiple destinations. An output destination is called an appender.
+Current system defines appenders for Console, files and Database, but can be
+easily extended to remote socket server, NT event loggers, syslog daemons or
+any other system.
+
+More than one appender can be attached to one logger. Each enabled logging
+request for a given logger will be forwarded to all the appenders in that
+logger
+
+
+CONFIGURATION
+
+System will read "Loggers" and "Appenders" to know the list of loggers and
+appenders to read from config file. Both are a list of elements separated
+by space.
+
+Once we have the list of appenders to read, system will try to configure a new
+appender from its config line. Appender config line follows the format:
+
+ Type,LogLevel,Flags,optional1,optional2
+
+Its a list of elements separated by comma where each element has its own meaning
+ Type: Type of the appender
+ 1 - (Console)
+ 2 - (File)
+ 3 - (DB)
+ LogLevel: Log level
+ 0 - (Disabled)
+ 1 - (Trace)
+ 2 - (Debug)
+ 3 - (Info)
+ 4 - (Warn)
+ 5 - (Error)
+ 6 - (Fatal)
+ Flags: Define some extra modifications to do to logging message
+ 1 - Prefix Timestamp to the text
+ 2 - Prefix Log Level to the text
+ 4 - Prefix Log Filter type to the text
+ 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS
+ (Only used with Type = 2)
+ 16 - Make a backup of existing file before overwrite
+ (Only used with Mode = w)
+
+Depending on the type, elements optional1 and optional2 will take different
+
+ Colors (read as optional1 if Type = Console)
+ Format: "fatal error warn info debug trace"
+ 0 - BLACK
+ 1 - RED
+ 2 - GREEN
+ 3 - BROWN
+ 4 - BLUE
+ 5 - MAGENTA
+ 6 - CYAN
+ 7 - GREY
+ 8 - YELLOW
+ 9 - LRED
+ 10 - LGREEN
+ 11 - LBLUE
+ 12 - LMAGENTA
+ 13 - LCYAN
+ 14 - WHITE
+ Example: "13 11 9 5 3 1"
+
+ File: Name of the file (read as optional1 if Type = File)
+ Allows to use one "%u" to create dynamic files
+
+ Mode: Mode to open the file (read as optional2 if Type = File)
+ a - (Append)
+ w - (Overwrite)
+
+Example:
+ Appender.Console1=1,2,6
+
+ Creates new appender to log to console any message with log level DEBUG
+ or higher and prefixes log type and level to the message.
+
+ Appender.Console2=1,5,1,13 11 9 5 3 1
+
+ Creates new appender to log to console any message with log level ERROR
+ or higher and prefixes timestamp to the message using colored text.
+
+ Appender.File=2,2,7,Auth.log,w
+
+ Creates new appender to log to file "Auth.log" any message with log level
+ DEBUG or higher and prefixes timestamp, type and level to message
+
+In the example, having two different loggers to log to console is perfectly
+legal but redundant.
+
+Once we have the list of loggers to read, system will try to configure a new
+logger from its config line. Logger config line follows the format:
+
+ Type,LogLevel,AppenderList
+
+Its a list of elements separated by comma where each element has its own meaning
+ Type: Type of the logger (
+ 0 - Default. Each type that has no config will
+ rely on this one. Core will create this logger
+ (disabled) if it's not configured
+ 1 - Units that doesn't fit in other categories
+ 2 - Pets
+ 3 - Vehicles
+ 4 - C++ AI, instance scripts, etc.
+ 5 - DB AI, such as SAI, EAI, CreatureAI
+ 6 - DB map scripts
+ 7 - Network input/output,
+ such as packet handlers and netcode logs
+ 8 - Spellsystem and aurasystem
+ 9 - Achievement system
+ 10 - Condition system
+ 11 - Pool system
+ 12 - Auction house
+ 13 - Arena's and battlegrounds
+ 14 - Outdoor PVP
+ 15 - Chat system
+ 16 - LFG system
+ 17 - Maps, instances (not scripts),
+ grids, cells, visibility, etc.
+ 18 - Player that doesn't fit in other categories.
+ 19 - Player loading from DB
+ (Player::_LoadXXX functions)
+ 20 - Items
+ 21 - Player skills (do not confuse with spells)
+ 22 - Player chat logs
+ 23 - loot
+ 24 - guilds
+ 25 - transports
+ 26 - SQL. DB errors
+ 27 - GM Commands
+ 28 - Remote Access Commands
+ 29 - Warden
+ 30 - Authserver
+ 31 - Worldserver
+ 32 - Game Events
+ 33 - Calendar
+ 34 - Character (Exclusive to login, logout, create, rename and delete)
+ 35 - Arenas
+ 36 - SQL Driver
+ 37 - SQL Dev
+ LogLevel
+ 0 - (Disabled)
+ 1 - (Trace)
+ 2 - (Debug)
+ 3 - (Info)
+ 4 - (Warn)
+ 5 - (Error)
+ 6 - (Fatal)
+ AppenderList: List of appenders linked to logger
+ (Using spaces as separator).
+
+--- EXAMPLES ---
+
+EXAMPLE 1
+
+Log errors to console and a file called server.log that only contain
+logs for this server run. File should prefix timestamp, type and log level to
+the messages. Console should prefix type and log level.
+
+ Appenders=Console Server
+ Loggers=Root
+ Appender.Console=1,5,6
+ Appender.Server=2,5,7,Server.log,w
+ Logger.Root=0,5,Console Server
+
+Lets trace how system will log two different messages:
+ 1) sLog->outError(LOG_FILTER_GUILD, "Guild 1 created");
+ System will try to find logger of type GUILD, as no logger is configured
+ for GUILD it will use Root logger. As message Log Level is equal or higher
+ than the Log level of logger the message is sent to the Appenders
+ configured in the Logger. "Console" and "Server".
+ Console will write: "ERROR [GUILD ] Guild 1 created"
+ Server will write to file "2012-08-15 ERROR [GUILD ] Guild 1 created"
+
+ 2) sLog->outInfo(LOG_FILTER_CHARACTER, "Player Name Logged in");
+ System will try to find logger of type CHARACTER, as no logger is
+ configured for CHARACTER it will use Root logger. As message Log Level is
+ not equal or higher than the Log level of logger the message its discarted.
+
+EXAMPLE 2
+
+Same example that above, but now i want to see all messages of level INFO on
+file and server file should add timestamp on creation.
+
+ Appenders=Console Server
+ Loggers=Root
+ Appender.Console=1,5,6
+ Appender.Server=2,4,15,Server.log
+ Logger.Root=0,4,Console Server
+
+Lets trace how system will log two different messages:
+ 1) sLog->outError(LOG_FILTER_GUILD, "Guild 1 created");
+ Performs exactly as example 1.
+ 2) sLog->outInfo(LOG_FILTER_CHARACTER, "Player Name Logged in");
+ System will try to find logger of type CHARACTER, as no logger is
+ configured for CHARACTER it will use Root logger. As message Log Level is
+ equal or higher than the Log level of logger the message is sent to the
+ Appenders configured in the Logger. "Console" and "Server".
+ Console will discard msg as Log Level is not higher or equal to this
+ appender
+ Server will write to file
+ "2012-08-15 INFO [CHARACTER ] Player Name Logged in"
+
+EXAMPLE 3
+As a dev, i may be interested in logging just a particular part of the core
+while i'm trying to fix something. So... i want to debug GUILDS to maximum
+and also some CHARACTER events to some point. Also im checking some Waypoints
+so i want SQLDEV to be logged to file without prefixes. All other messages
+should only be logged to console, GUILD to TRACE and CHARACTER to INFO
+
+ Appenders=Console SQLDev
+ Loggers=Guild Characters SQLDev
+ Appender.Console=1,1
+ Appender.SQLDev=2,2,0,SQLDev.log
+ Logger.Guild=24,1,Console
+ Logger.Characters=34,3,Console
+ Logger.SQLDev=37,3,SQLDev
+
+With this config, any message logger with a Log type different to GUILD,
+CHARACTER or SQLDEV will be ignored, as we didn't define a logger Root and
+system created a default Root disabled. Appender Console, log level should be
+defined to allow all possible messages of its loggers, in this case GUILD uses
+TRACE (1), so Appender should allow it. Logger Characters will limit it's own
+messages to INFO (3)
+
+--- SOME EXTRA COMMENTS ---
+why this system is better than previous one?
+- Can be extended: Anyone can easily create new appenders to log to new
+ systems as syslog or IRC, having all code related to that system in particular
+ files
+- It's asyncronous: Uses threads to write messages, so core performance wont be
+ affected by IO operations
+- Lets us select "What to log" and "Where to log" on the fly. You can log to a
+ dozen of files without having to change a single line of code
diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql
index 14aaa4658e9..a052a74c837 100644
--- a/sql/base/auth_database.sql
+++ b/sql/base/auth_database.sql
@@ -143,6 +143,7 @@ CREATE TABLE `logs` (
`time` int(10) unsigned NOT NULL,
`realm` int(10) unsigned NOT NULL,
`type` tinyint(3) unsigned NOT NULL,
+ `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
`string` text CHARACTER SET latin1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index 57e5f6f6ab7..d2ec0a94a2b 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -547,25 +547,26 @@ CREATE TABLE `character_equipmentsets` (
`setindex` tinyint(3) unsigned NOT NULL DEFAULT '0',
`name` varchar(31) NOT NULL,
`iconname` varchar(100) NOT NULL,
- `item0` int(10) unsigned NOT NULL DEFAULT '0',
- `item1` int(10) unsigned NOT NULL DEFAULT '0',
- `item2` int(10) unsigned NOT NULL DEFAULT '0',
- `item3` int(10) unsigned NOT NULL DEFAULT '0',
- `item4` int(10) unsigned NOT NULL DEFAULT '0',
- `item5` int(10) unsigned NOT NULL DEFAULT '0',
- `item6` int(10) unsigned NOT NULL DEFAULT '0',
- `item7` int(10) unsigned NOT NULL DEFAULT '0',
- `item8` int(10) unsigned NOT NULL DEFAULT '0',
- `item9` int(10) unsigned NOT NULL DEFAULT '0',
- `item10` int(10) unsigned NOT NULL DEFAULT '0',
- `item11` int(10) unsigned NOT NULL DEFAULT '0',
- `item12` int(10) unsigned NOT NULL DEFAULT '0',
- `item13` int(10) unsigned NOT NULL DEFAULT '0',
- `item14` int(10) unsigned NOT NULL DEFAULT '0',
- `item15` int(10) unsigned NOT NULL DEFAULT '0',
- `item16` int(10) unsigned NOT NULL DEFAULT '0',
- `item17` int(10) unsigned NOT NULL DEFAULT '0',
- `item18` int(10) unsigned NOT NULL DEFAULT '0',
+ `ignore_mask` int(11) unsigned NOT NULL DEFAULT '0',
+ `item0` int(11) unsigned NOT NULL DEFAULT '0',
+ `item1` int(11) unsigned NOT NULL DEFAULT '0',
+ `item2` int(11) unsigned NOT NULL DEFAULT '0',
+ `item3` int(11) unsigned NOT NULL DEFAULT '0',
+ `item4` int(11) unsigned NOT NULL DEFAULT '0',
+ `item5` int(11) unsigned NOT NULL DEFAULT '0',
+ `item6` int(11) unsigned NOT NULL DEFAULT '0',
+ `item7` int(11) unsigned NOT NULL DEFAULT '0',
+ `item8` int(11) unsigned NOT NULL DEFAULT '0',
+ `item9` int(11) unsigned NOT NULL DEFAULT '0',
+ `item10` int(11) unsigned NOT NULL DEFAULT '0',
+ `item11` int(11) unsigned NOT NULL DEFAULT '0',
+ `item12` int(11) unsigned NOT NULL DEFAULT '0',
+ `item13` int(11) unsigned NOT NULL DEFAULT '0',
+ `item14` int(11) unsigned NOT NULL DEFAULT '0',
+ `item15` int(11) unsigned NOT NULL DEFAULT '0',
+ `item16` int(11) unsigned NOT NULL DEFAULT '0',
+ `item17` int(11) unsigned NOT NULL DEFAULT '0',
+ `item18` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`setguid`),
UNIQUE KEY `idx_set` (`guid`,`setguid`,`setindex`),
KEY `Idx_setindex` (`setindex`)
@@ -1128,7 +1129,7 @@ DROP TABLE IF EXISTS `characters`;
CREATE TABLE `characters` (
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`account` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier',
- `name` varchar(12) NOT NULL DEFAULT '',
+ `name` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`race` tinyint(3) unsigned NOT NULL DEFAULT '0',
`class` tinyint(3) unsigned NOT NULL DEFAULT '0',
`gender` tinyint(3) unsigned NOT NULL DEFAULT '0',
@@ -1176,7 +1177,7 @@ CREATE TABLE `characters` (
`chosenTitle` int(10) unsigned NOT NULL DEFAULT '0',
`knownCurrencies` bigint(20) unsigned NOT NULL DEFAULT '0',
`watchedFaction` int(10) unsigned NOT NULL DEFAULT '0',
- `drunk` smallint(5) unsigned NOT NULL DEFAULT '0',
+ `drunk` tinyint(3) unsigned NOT NULL DEFAULT '0',
`health` int(10) unsigned NOT NULL DEFAULT '0',
`power1` int(10) unsigned NOT NULL DEFAULT '0',
`power2` int(10) unsigned NOT NULL DEFAULT '0',
@@ -2275,4 +2276,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2012-03-25 21:14:19
+-- Dump completed on 2012-09-08 15:27:29
diff --git a/sql/updates/world/2012_05_19_03_world_version.sql b/sql/old/3.3.5a/2012_05_19_03_world_version.sql
index 53c6821be69..53c6821be69 100644
--- a/sql/updates/world/2012_05_19_03_world_version.sql
+++ b/sql/old/3.3.5a/2012_05_19_03_world_version.sql
diff --git a/sql/updates/world/2012_05_19_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_05_19_04_world_creature_loot_template.sql
index ae996e01956..ae996e01956 100644
--- a/sql/updates/world/2012_05_19_04_world_creature_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_19_04_world_creature_loot_template.sql
diff --git a/sql/updates/world/2012_05_19_05_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_05_19_05_world_gameobject_loot_template.sql
index f95cb45efe4..f95cb45efe4 100644
--- a/sql/updates/world/2012_05_19_05_world_gameobject_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_19_05_world_gameobject_loot_template.sql
diff --git a/sql/updates/world/2012_05_19_06_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_05_19_06_world_gameobject_loot_template.sql
index 9b2dcbb9363..9b2dcbb9363 100644
--- a/sql/updates/world/2012_05_19_06_world_gameobject_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_19_06_world_gameobject_loot_template.sql
diff --git a/sql/updates/world/2012_05_20_00_world_misc.sql b/sql/old/3.3.5a/2012_05_20_00_world_misc.sql
index 5b96f9881d6..5b96f9881d6 100644
--- a/sql/updates/world/2012_05_20_00_world_misc.sql
+++ b/sql/old/3.3.5a/2012_05_20_00_world_misc.sql
diff --git a/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_05_20_01_world_spell_bonus_data.sql
index 7603f7dd938..7603f7dd938 100644
--- a/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql
+++ b/sql/old/3.3.5a/2012_05_20_01_world_spell_bonus_data.sql
diff --git a/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_05_22_00_world_spell_proc_event.sql
index ba2ea83f643..ba2ea83f643 100644
--- a/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql
+++ b/sql/old/3.3.5a/2012_05_22_00_world_spell_proc_event.sql
diff --git a/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_05_22_01_world_creature_loot_template.sql
index bcae5be9ae1..bcae5be9ae1 100644
--- a/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_22_01_world_creature_loot_template.sql
diff --git a/sql/updates/world/2012_05_23_00_world_creature.sql b/sql/old/3.3.5a/2012_05_23_00_world_creature.sql
index 8a965b7fdfe..8a965b7fdfe 100644
--- a/sql/updates/world/2012_05_23_00_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_23_00_world_creature.sql
diff --git a/sql/updates/world/2012_05_23_01_world_sai.sql b/sql/old/3.3.5a/2012_05_23_01_world_sai.sql
index af2fd5409d1..af2fd5409d1 100644
--- a/sql/updates/world/2012_05_23_01_world_sai.sql
+++ b/sql/old/3.3.5a/2012_05_23_01_world_sai.sql
diff --git a/sql/updates/world/2012_05_23_02_world_sai.sql b/sql/old/3.3.5a/2012_05_23_02_world_sai.sql
index 588f25f1568..588f25f1568 100644
--- a/sql/updates/world/2012_05_23_02_world_sai.sql
+++ b/sql/old/3.3.5a/2012_05_23_02_world_sai.sql
diff --git a/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_05_23_03_world_gameobject_loot_template.sql
index 22ecebcae31..22ecebcae31 100644
--- a/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_23_03_world_gameobject_loot_template.sql
diff --git a/sql/updates/world/2012_05_23_04_world_gameobject.sql b/sql/old/3.3.5a/2012_05_23_04_world_gameobject.sql
index afcb1e89317..afcb1e89317 100644
--- a/sql/updates/world/2012_05_23_04_world_gameobject.sql
+++ b/sql/old/3.3.5a/2012_05_23_04_world_gameobject.sql
diff --git a/sql/updates/world/2012_05_23_05_world_creature.sql b/sql/old/3.3.5a/2012_05_23_05_world_creature.sql
index bb162f927bd..bb162f927bd 100644
--- a/sql/updates/world/2012_05_23_05_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_23_05_world_creature.sql
diff --git a/sql/updates/world/2012_05_24_00_world_creature_misc.sql b/sql/old/3.3.5a/2012_05_24_00_world_creature_misc.sql
index ae35b3fba5d..ae35b3fba5d 100644
--- a/sql/updates/world/2012_05_24_00_world_creature_misc.sql
+++ b/sql/old/3.3.5a/2012_05_24_00_world_creature_misc.sql
diff --git a/sql/updates/world/2012_05_24_01_world_gameobject.sql b/sql/old/3.3.5a/2012_05_24_01_world_gameobject.sql
index 32bbc15494f..32bbc15494f 100644
--- a/sql/updates/world/2012_05_24_01_world_gameobject.sql
+++ b/sql/old/3.3.5a/2012_05_24_01_world_gameobject.sql
diff --git a/sql/updates/world/2012_05_25_00_world_sai.sql b/sql/old/3.3.5a/2012_05_25_00_world_sai.sql
index fa5682db02f..fa5682db02f 100644
--- a/sql/updates/world/2012_05_25_00_world_sai.sql
+++ b/sql/old/3.3.5a/2012_05_25_00_world_sai.sql
diff --git a/sql/updates/world/2012_05_25_01_world_waypoints.sql b/sql/old/3.3.5a/2012_05_25_01_world_waypoints.sql
index 0d2c04bc6bc..0d2c04bc6bc 100644
--- a/sql/updates/world/2012_05_25_01_world_waypoints.sql
+++ b/sql/old/3.3.5a/2012_05_25_01_world_waypoints.sql
diff --git a/sql/updates/world/2012_05_25_02_world_creature_template.sql b/sql/old/3.3.5a/2012_05_25_02_world_creature_template.sql
index fd4c1743f07..fd4c1743f07 100644
--- a/sql/updates/world/2012_05_25_02_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_25_02_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_25_03_world_template.sql b/sql/old/3.3.5a/2012_05_25_03_world_template.sql
index 6ef112f342f..6ef112f342f 100644
--- a/sql/updates/world/2012_05_25_03_world_template.sql
+++ b/sql/old/3.3.5a/2012_05_25_03_world_template.sql
diff --git a/sql/updates/world/2012_05_26_00_world_scripts.sql b/sql/old/3.3.5a/2012_05_26_00_world_scripts.sql
index 18b0fa2f6b2..18b0fa2f6b2 100644
--- a/sql/updates/world/2012_05_26_00_world_scripts.sql
+++ b/sql/old/3.3.5a/2012_05_26_00_world_scripts.sql
diff --git a/sql/updates/world/2012_05_26_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_05_26_01_world_spell_dbc.sql
index 7efebc37489..7efebc37489 100644
--- a/sql/updates/world/2012_05_26_01_world_spell_dbc.sql
+++ b/sql/old/3.3.5a/2012_05_26_01_world_spell_dbc.sql
diff --git a/sql/updates/world/2012_05_26_02_world_creature_template.sql b/sql/old/3.3.5a/2012_05_26_02_world_creature_template.sql
index e51567390b7..e51567390b7 100644
--- a/sql/updates/world/2012_05_26_02_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_26_02_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_26_03_world_page_text.sql b/sql/old/3.3.5a/2012_05_26_03_world_page_text.sql
index 9dc285cd99d..9dc285cd99d 100644
--- a/sql/updates/world/2012_05_26_03_world_page_text.sql
+++ b/sql/old/3.3.5a/2012_05_26_03_world_page_text.sql
diff --git a/sql/updates/world/2012_05_26_04_world_creature_template.sql b/sql/old/3.3.5a/2012_05_26_04_world_creature_template.sql
index 911cd45ef8c..911cd45ef8c 100644
--- a/sql/updates/world/2012_05_26_04_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_26_04_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_26_05_world_creature_template.sql b/sql/old/3.3.5a/2012_05_26_05_world_creature_template.sql
index 59d69b3fbe1..59d69b3fbe1 100644
--- a/sql/updates/world/2012_05_26_05_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_26_05_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_26_06_world_smart_scripts.sql b/sql/old/3.3.5a/2012_05_26_06_world_smart_scripts.sql
index 397a5ad517a..397a5ad517a 100644
--- a/sql/updates/world/2012_05_26_06_world_smart_scripts.sql
+++ b/sql/old/3.3.5a/2012_05_26_06_world_smart_scripts.sql
diff --git a/sql/updates/world/2012_05_27_00_world_gameobject_template.sql b/sql/old/3.3.5a/2012_05_27_00_world_gameobject_template.sql
index 5fa3c15a505..5fa3c15a505 100644
--- a/sql/updates/world/2012_05_27_00_world_gameobject_template.sql
+++ b/sql/old/3.3.5a/2012_05_27_00_world_gameobject_template.sql
diff --git a/sql/updates/world/2012_05_27_01_world_waypoints.sql b/sql/old/3.3.5a/2012_05_27_01_world_waypoints.sql
index 3685b58a629..3685b58a629 100644
--- a/sql/updates/world/2012_05_27_01_world_waypoints.sql
+++ b/sql/old/3.3.5a/2012_05_27_01_world_waypoints.sql
diff --git a/sql/updates/world/2012_05_27_02_world_creature.sql b/sql/old/3.3.5a/2012_05_27_02_world_creature.sql
index 8ca3ee75c94..8ca3ee75c94 100644
--- a/sql/updates/world/2012_05_27_02_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_27_02_world_creature.sql
diff --git a/sql/updates/world/2012_05_27_03_world_creature.sql b/sql/old/3.3.5a/2012_05_27_03_world_creature.sql
index 097f40581a7..097f40581a7 100644
--- a/sql/updates/world/2012_05_27_03_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_27_03_world_creature.sql
diff --git a/sql/updates/world/2012_05_27_04_world_smart_scripts.sql b/sql/old/3.3.5a/2012_05_27_04_world_smart_scripts.sql
index 1f7cfa3d19c..1f7cfa3d19c 100644
--- a/sql/updates/world/2012_05_27_04_world_smart_scripts.sql
+++ b/sql/old/3.3.5a/2012_05_27_04_world_smart_scripts.sql
diff --git a/sql/updates/world/2012_05_27_05_world_gameobject.sql b/sql/old/3.3.5a/2012_05_27_05_world_gameobject.sql
index 66fbfd0afca..66fbfd0afca 100644
--- a/sql/updates/world/2012_05_27_05_world_gameobject.sql
+++ b/sql/old/3.3.5a/2012_05_27_05_world_gameobject.sql
diff --git a/sql/updates/world/2012_05_27_06_world_creature.sql b/sql/old/3.3.5a/2012_05_27_06_world_creature.sql
index 1074465a0be..1074465a0be 100644
--- a/sql/updates/world/2012_05_27_06_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_27_06_world_creature.sql
diff --git a/sql/updates/world/2012_05_27_07_world_game_event.sql b/sql/old/3.3.5a/2012_05_27_07_world_game_event.sql
index eff4a9e7652..eff4a9e7652 100644
--- a/sql/updates/world/2012_05_27_07_world_game_event.sql
+++ b/sql/old/3.3.5a/2012_05_27_07_world_game_event.sql
diff --git a/sql/updates/world/2012_05_27_07_world_waypoints.sql b/sql/old/3.3.5a/2012_05_27_07_world_waypoints.sql
index bd6aa2d0fc1..bd6aa2d0fc1 100644
--- a/sql/updates/world/2012_05_27_07_world_waypoints.sql
+++ b/sql/old/3.3.5a/2012_05_27_07_world_waypoints.sql
diff --git a/sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql b/sql/old/3.3.5a/2012_05_28_00_world_creature_ai_scripts.sql
index aef4e4c6f67..aef4e4c6f67 100644
--- a/sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql
+++ b/sql/old/3.3.5a/2012_05_28_00_world_creature_ai_scripts.sql
diff --git a/sql/updates/world/2012_05_28_01_world_creature.sql b/sql/old/3.3.5a/2012_05_28_01_world_creature.sql
index d39aa7230b5..d39aa7230b5 100644
--- a/sql/updates/world/2012_05_28_01_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_28_01_world_creature.sql
diff --git a/sql/updates/world/2012_05_28_02_world_creature.sql b/sql/old/3.3.5a/2012_05_28_02_world_creature.sql
index 77da626d89e..77da626d89e 100644
--- a/sql/updates/world/2012_05_28_02_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_28_02_world_creature.sql
diff --git a/sql/updates/world/2012_05_28_03_world_waypoint_data.sql b/sql/old/3.3.5a/2012_05_28_03_world_waypoint_data.sql
index aa0e0ddd5ef..aa0e0ddd5ef 100644
--- a/sql/updates/world/2012_05_28_03_world_waypoint_data.sql
+++ b/sql/old/3.3.5a/2012_05_28_03_world_waypoint_data.sql
diff --git a/sql/updates/world/2012_05_28_04_world_creature_template.sql b/sql/old/3.3.5a/2012_05_28_04_world_creature_template.sql
index d8c9a15e412..d8c9a15e412 100644
--- a/sql/updates/world/2012_05_28_04_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_28_04_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_28_05_world_creature.sql b/sql/old/3.3.5a/2012_05_28_05_world_creature.sql
index c7d4af5b494..c7d4af5b494 100644
--- a/sql/updates/world/2012_05_28_05_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_28_05_world_creature.sql
diff --git a/sql/updates/world/2012_05_28_06_world_creature_addon.sql b/sql/old/3.3.5a/2012_05_28_06_world_creature_addon.sql
index a2b573da10a..a2b573da10a 100644
--- a/sql/updates/world/2012_05_28_06_world_creature_addon.sql
+++ b/sql/old/3.3.5a/2012_05_28_06_world_creature_addon.sql
diff --git a/sql/updates/world/2012_05_28_06_world_waypoint_data.sql b/sql/old/3.3.5a/2012_05_28_06_world_waypoint_data.sql
index 1c738cacdc9..1c738cacdc9 100644
--- a/sql/updates/world/2012_05_28_06_world_waypoint_data.sql
+++ b/sql/old/3.3.5a/2012_05_28_06_world_waypoint_data.sql
diff --git a/sql/updates/world/2012_05_28_07_world_quest_template.sql b/sql/old/3.3.5a/2012_05_28_07_world_quest_template.sql
index 3cdf1895a9d..3cdf1895a9d 100644
--- a/sql/updates/world/2012_05_28_07_world_quest_template.sql
+++ b/sql/old/3.3.5a/2012_05_28_07_world_quest_template.sql
diff --git a/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_05_30_00_world_reference_loot_template.sql
index c2cab663d4a..c2cab663d4a 100644
--- a/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_30_00_world_reference_loot_template.sql
diff --git a/sql/updates/world/2012_05_30_01_world_creature_template.sql b/sql/old/3.3.5a/2012_05_30_01_world_creature_template.sql
index 4b469a13891..4b469a13891 100644
--- a/sql/updates/world/2012_05_30_01_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_30_01_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_30_02_world_quest_template.sql b/sql/old/3.3.5a/2012_05_30_02_world_quest_template.sql
index 2b829aa0875..2b829aa0875 100644
--- a/sql/updates/world/2012_05_30_02_world_quest_template.sql
+++ b/sql/old/3.3.5a/2012_05_30_02_world_quest_template.sql
diff --git a/sql/updates/world/2012_05_30_03_world_creature_formation.sql b/sql/old/3.3.5a/2012_05_30_03_world_creature_formation.sql
index 2964415e85b..2964415e85b 100644
--- a/sql/updates/world/2012_05_30_03_world_creature_formation.sql
+++ b/sql/old/3.3.5a/2012_05_30_03_world_creature_formation.sql
diff --git a/sql/updates/world/2012_05_30_04_world_gossip.sql b/sql/old/3.3.5a/2012_05_30_04_world_gossip.sql
index 0abbea7b964..0abbea7b964 100644
--- a/sql/updates/world/2012_05_30_04_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_05_30_04_world_gossip.sql
diff --git a/sql/updates/world/2012_05_30_05_world_gossip.sql b/sql/old/3.3.5a/2012_05_30_05_world_gossip.sql
index 5e7f1375320..5e7f1375320 100644
--- a/sql/updates/world/2012_05_30_05_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_05_30_05_world_gossip.sql
diff --git a/sql/updates/world/2012_05_31_00_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_05_31_00_world_reference_loot_template.sql
index 03723c82536..03723c82536 100644
--- a/sql/updates/world/2012_05_31_00_world_reference_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_31_00_world_reference_loot_template.sql
diff --git a/sql/updates/world/2012_05_31_01_world_item_template.sql b/sql/old/3.3.5a/2012_05_31_01_world_item_template.sql
index 144ee6715a9..144ee6715a9 100644
--- a/sql/updates/world/2012_05_31_01_world_item_template.sql
+++ b/sql/old/3.3.5a/2012_05_31_01_world_item_template.sql
diff --git a/sql/updates/world/2012_05_31_01_world_sai.sql b/sql/old/3.3.5a/2012_05_31_01_world_sai.sql
index 3055e98f167..3055e98f167 100644
--- a/sql/updates/world/2012_05_31_01_world_sai.sql
+++ b/sql/old/3.3.5a/2012_05_31_01_world_sai.sql
diff --git a/sql/updates/world/2012_05_31_02_world_creature_model_info.sql b/sql/old/3.3.5a/2012_05_31_02_world_creature_model_info.sql
index a1aa1155aa6..a1aa1155aa6 100644
--- a/sql/updates/world/2012_05_31_02_world_creature_model_info.sql
+++ b/sql/old/3.3.5a/2012_05_31_02_world_creature_model_info.sql
diff --git a/sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_05_31_03_world_gameobject_loot_template.sql
index 5dcedaaf342..5dcedaaf342 100644
--- a/sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql
+++ b/sql/old/3.3.5a/2012_05_31_03_world_gameobject_loot_template.sql
diff --git a/sql/updates/world/2012_05_31_05_world_sai.sql b/sql/old/3.3.5a/2012_05_31_05_world_sai.sql
index aa95c93aae1..aa95c93aae1 100644
--- a/sql/updates/world/2012_05_31_05_world_sai.sql
+++ b/sql/old/3.3.5a/2012_05_31_05_world_sai.sql
diff --git a/sql/updates/world/2012_05_31_06_world_gameobject.sql b/sql/old/3.3.5a/2012_05_31_06_world_gameobject.sql
index 1db1d6fbd76..1db1d6fbd76 100644
--- a/sql/updates/world/2012_05_31_06_world_gameobject.sql
+++ b/sql/old/3.3.5a/2012_05_31_06_world_gameobject.sql
diff --git a/sql/updates/world/2012_05_31_07_world_gossip.sql b/sql/old/3.3.5a/2012_05_31_07_world_gossip.sql
index 9b82f333a4c..9b82f333a4c 100644
--- a/sql/updates/world/2012_05_31_07_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_05_31_07_world_gossip.sql
diff --git a/sql/updates/world/2012_05_31_08_world_gameobject_template.sql b/sql/old/3.3.5a/2012_05_31_08_world_gameobject_template.sql
index 41527e22919..41527e22919 100644
--- a/sql/updates/world/2012_05_31_08_world_gameobject_template.sql
+++ b/sql/old/3.3.5a/2012_05_31_08_world_gameobject_template.sql
diff --git a/sql/updates/world/2012_05_31_09_world_sai.sql b/sql/old/3.3.5a/2012_05_31_09_world_sai.sql
index a7eb1248905..a7eb1248905 100644
--- a/sql/updates/world/2012_05_31_09_world_sai.sql
+++ b/sql/old/3.3.5a/2012_05_31_09_world_sai.sql
diff --git a/sql/updates/world/2012_05_31_10_world_creature_template.sql b/sql/old/3.3.5a/2012_05_31_10_world_creature_template.sql
index 5499d26b0e3..5499d26b0e3 100644
--- a/sql/updates/world/2012_05_31_10_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_05_31_10_world_creature_template.sql
diff --git a/sql/updates/world/2012_05_31_11_world_creature.sql b/sql/old/3.3.5a/2012_05_31_11_world_creature.sql
index 177c6230964..177c6230964 100644
--- a/sql/updates/world/2012_05_31_11_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_31_11_world_creature.sql
diff --git a/sql/updates/world/2012_05_31_12_world_creature.sql b/sql/old/3.3.5a/2012_05_31_12_world_creature.sql
index cad0364d021..cad0364d021 100644
--- a/sql/updates/world/2012_05_31_12_world_creature.sql
+++ b/sql/old/3.3.5a/2012_05_31_12_world_creature.sql
diff --git a/sql/updates/world/2012_06_01_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_01_00_world_spell_script_names.sql
index cc024fe71cb..cc024fe71cb 100644
--- a/sql/updates/world/2012_06_01_00_world_spell_script_names.sql
+++ b/sql/old/3.3.5a/2012_06_01_00_world_spell_script_names.sql
diff --git a/sql/updates/world/2012_06_01_01_world_creature_script.sql b/sql/old/3.3.5a/2012_06_01_01_world_creature_script.sql
index d90800bd1af..d90800bd1af 100644
--- a/sql/updates/world/2012_06_01_01_world_creature_script.sql
+++ b/sql/old/3.3.5a/2012_06_01_01_world_creature_script.sql
diff --git a/sql/updates/world/2012_06_01_02_world_misc.sql b/sql/old/3.3.5a/2012_06_01_02_world_misc.sql
index 23663ef9270..23663ef9270 100644
--- a/sql/updates/world/2012_06_01_02_world_misc.sql
+++ b/sql/old/3.3.5a/2012_06_01_02_world_misc.sql
diff --git a/sql/updates/world/2012_06_01_03_world_creature_template.sql b/sql/old/3.3.5a/2012_06_01_03_world_creature_template.sql
index fb20691ad69..fb20691ad69 100644
--- a/sql/updates/world/2012_06_01_03_world_creature_template.sql
+++ b/sql/old/3.3.5a/2012_06_01_03_world_creature_template.sql
diff --git a/sql/updates/world/2012_06_01_04_world_misc.sql b/sql/old/3.3.5a/2012_06_01_04_world_misc.sql
index d5273cec233..d5273cec233 100644
--- a/sql/updates/world/2012_06_01_04_world_misc.sql
+++ b/sql/old/3.3.5a/2012_06_01_04_world_misc.sql
diff --git a/sql/updates/world/2012_06_02_00_world_sai.sql b/sql/old/3.3.5a/2012_06_02_00_world_sai.sql
index af0b12be244..af0b12be244 100644
--- a/sql/updates/world/2012_06_02_00_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_02_00_world_sai.sql
diff --git a/sql/updates/world/2012_06_02_01_world_waypoints.sql b/sql/old/3.3.5a/2012_06_02_01_world_waypoints.sql
index c50436bba8d..c50436bba8d 100644
--- a/sql/updates/world/2012_06_02_01_world_waypoints.sql
+++ b/sql/old/3.3.5a/2012_06_02_01_world_waypoints.sql
diff --git a/sql/updates/world/2012_06_02_02_world_creature_text.sql b/sql/old/3.3.5a/2012_06_02_02_world_creature_text.sql
index c38e413617d..c38e413617d 100644
--- a/sql/updates/world/2012_06_02_02_world_creature_text.sql
+++ b/sql/old/3.3.5a/2012_06_02_02_world_creature_text.sql
diff --git a/sql/updates/world/2012_06_02_03_world_creature_loot_template_hp.sql b/sql/old/3.3.5a/2012_06_02_03_world_creature_loot_template_hp.sql
index cd6015929b1..cd6015929b1 100644
--- a/sql/updates/world/2012_06_02_03_world_creature_loot_template_hp.sql
+++ b/sql/old/3.3.5a/2012_06_02_03_world_creature_loot_template_hp.sql
diff --git a/sql/updates/world/2012_06_02_03_world_creature_loot_template_zm.sql b/sql/old/3.3.5a/2012_06_02_03_world_creature_loot_template_zm.sql
index e739f81407b..e739f81407b 100644
--- a/sql/updates/world/2012_06_02_03_world_creature_loot_template_zm.sql
+++ b/sql/old/3.3.5a/2012_06_02_03_world_creature_loot_template_zm.sql
diff --git a/sql/updates/world/2012_06_02_03_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_06_02_03_world_reference_loot_template.sql
index c712cbe18bd..c712cbe18bd 100644
--- a/sql/updates/world/2012_06_02_03_world_reference_loot_template.sql
+++ b/sql/old/3.3.5a/2012_06_02_03_world_reference_loot_template.sql
diff --git a/sql/updates/world/2012_06_02_04_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_06_02_04_world_reference_loot_template.sql
index 57be9083048..57be9083048 100644
--- a/sql/updates/world/2012_06_02_04_world_reference_loot_template.sql
+++ b/sql/old/3.3.5a/2012_06_02_04_world_reference_loot_template.sql
diff --git a/sql/updates/world/2012_06_02_05_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_06_02_05_world_reference_loot_template.sql
index 51dee84ad9b..51dee84ad9b 100644
--- a/sql/updates/world/2012_06_02_05_world_reference_loot_template.sql
+++ b/sql/old/3.3.5a/2012_06_02_05_world_reference_loot_template.sql
diff --git a/sql/updates/world/2012_06_02_06_world_waypoints.sql b/sql/old/3.3.5a/2012_06_02_06_world_waypoints.sql
index 65d5d43bad2..65d5d43bad2 100644
--- a/sql/updates/world/2012_06_02_06_world_waypoints.sql
+++ b/sql/old/3.3.5a/2012_06_02_06_world_waypoints.sql
diff --git a/sql/updates/world/2012_06_02_07_world_Misc.sql b/sql/old/3.3.5a/2012_06_02_07_world_Misc.sql
index c541819841c..c541819841c 100644
--- a/sql/updates/world/2012_06_02_07_world_Misc.sql
+++ b/sql/old/3.3.5a/2012_06_02_07_world_Misc.sql
diff --git a/sql/updates/world/2012_06_02_08_world_waypoints.sql b/sql/old/3.3.5a/2012_06_02_08_world_waypoints.sql
index 60b936a7f72..60b936a7f72 100644
--- a/sql/updates/world/2012_06_02_08_world_waypoints.sql
+++ b/sql/old/3.3.5a/2012_06_02_08_world_waypoints.sql
diff --git a/sql/updates/world/2012_06_02_09_world_creature_transport.sql b/sql/old/3.3.5a/2012_06_02_09_world_creature_transport.sql
index 9a0b062f9ea..9a0b062f9ea 100644
--- a/sql/updates/world/2012_06_02_09_world_creature_transport.sql
+++ b/sql/old/3.3.5a/2012_06_02_09_world_creature_transport.sql
diff --git a/sql/updates/world/2012_06_03_00_world_sai.sql b/sql/old/3.3.5a/2012_06_03_00_world_sai.sql
index 7a5932e61fc..7a5932e61fc 100644
--- a/sql/updates/world/2012_06_03_00_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_03_00_world_sai.sql
diff --git a/sql/updates/world/2012_06_03_01_world_creature.sql b/sql/old/3.3.5a/2012_06_03_01_world_creature.sql
index 68448b31591..68448b31591 100644
--- a/sql/updates/world/2012_06_03_01_world_creature.sql
+++ b/sql/old/3.3.5a/2012_06_03_01_world_creature.sql
diff --git a/sql/updates/world/2012_06_03_02_world_misc.sql b/sql/old/3.3.5a/2012_06_03_02_world_misc.sql
index 69de8eacdf3..69de8eacdf3 100644
--- a/sql/updates/world/2012_06_03_02_world_misc.sql
+++ b/sql/old/3.3.5a/2012_06_03_02_world_misc.sql
diff --git a/sql/updates/world/2012_06_03_03_world_quest_template.sql b/sql/old/3.3.5a/2012_06_03_03_world_quest_template.sql
index 023182aaf1b..023182aaf1b 100644
--- a/sql/updates/world/2012_06_03_03_world_quest_template.sql
+++ b/sql/old/3.3.5a/2012_06_03_03_world_quest_template.sql
diff --git a/sql/updates/world/2012_06_03_04_world_misc.sql b/sql/old/3.3.5a/2012_06_03_04_world_misc.sql
index 22621d92cbd..22621d92cbd 100644
--- a/sql/updates/world/2012_06_03_04_world_misc.sql
+++ b/sql/old/3.3.5a/2012_06_03_04_world_misc.sql
diff --git a/sql/updates/world/2012_06_03_05_world_creature.sql b/sql/old/3.3.5a/2012_06_03_05_world_creature.sql
index c5bccdbf33c..c5bccdbf33c 100644
--- a/sql/updates/world/2012_06_03_05_world_creature.sql
+++ b/sql/old/3.3.5a/2012_06_03_05_world_creature.sql
diff --git a/sql/updates/world/2012_06_03_06_world_sai.sql b/sql/old/3.3.5a/2012_06_03_06_world_sai.sql
index 32d1995a092..32d1995a092 100644
--- a/sql/updates/world/2012_06_03_06_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_03_06_world_sai.sql
diff --git a/sql/updates/world/2012_06_04_00_world_sai.sql b/sql/old/3.3.5a/2012_06_04_00_world_sai.sql
index 9497f73041c..9497f73041c 100644
--- a/sql/updates/world/2012_06_04_00_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_04_00_world_sai.sql
diff --git a/sql/updates/world/2012_06_04_01_world_gossip.sql b/sql/old/3.3.5a/2012_06_04_01_world_gossip.sql
index f6246967452..f6246967452 100644
--- a/sql/updates/world/2012_06_04_01_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_06_04_01_world_gossip.sql
diff --git a/sql/updates/world/2012_06_04_02_world_gossip.sql b/sql/old/3.3.5a/2012_06_04_02_world_gossip.sql
index 0122e9b736e..0122e9b736e 100644
--- a/sql/updates/world/2012_06_04_02_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_06_04_02_world_gossip.sql
diff --git a/sql/updates/world/2012_06_04_03_world_conditions.sql b/sql/old/3.3.5a/2012_06_04_03_world_conditions.sql
index 0eadeb8542e..0eadeb8542e 100644
--- a/sql/updates/world/2012_06_04_03_world_conditions.sql
+++ b/sql/old/3.3.5a/2012_06_04_03_world_conditions.sql
diff --git a/sql/updates/world/2012_06_04_04_world_sai.sql b/sql/old/3.3.5a/2012_06_04_04_world_sai.sql
index f38cd1fe63f..f38cd1fe63f 100644
--- a/sql/updates/world/2012_06_04_04_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_04_04_world_sai.sql
diff --git a/sql/updates/world/2012_06_04_05_world_sai.sql b/sql/old/3.3.5a/2012_06_04_05_world_sai.sql
index 51d998c15ab..51d998c15ab 100644
--- a/sql/updates/world/2012_06_04_05_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_04_05_world_sai.sql
diff --git a/sql/updates/world/2012_06_04_06_world_sai.sql b/sql/old/3.3.5a/2012_06_04_06_world_sai.sql
index 455246d82b7..455246d82b7 100644
--- a/sql/updates/world/2012_06_04_06_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_04_06_world_sai.sql
diff --git a/sql/updates/world/2012_06_04_07_world_misc.sql b/sql/old/3.3.5a/2012_06_04_07_world_misc.sql
index 947ba3b31ee..947ba3b31ee 100644
--- a/sql/updates/world/2012_06_04_07_world_misc.sql
+++ b/sql/old/3.3.5a/2012_06_04_07_world_misc.sql
diff --git a/sql/updates/world/2012_06_05_00_world_sai.sql b/sql/old/3.3.5a/2012_06_05_00_world_sai.sql
index c43998b7459..c43998b7459 100644
--- a/sql/updates/world/2012_06_05_00_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_05_00_world_sai.sql
diff --git a/sql/updates/world/2012_06_05_01_world_gossip.sql b/sql/old/3.3.5a/2012_06_05_01_world_gossip.sql
index 11697eeffd4..11697eeffd4 100644
--- a/sql/updates/world/2012_06_05_01_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_06_05_01_world_gossip.sql
diff --git a/sql/updates/world/2012_06_05_01_world_gossip_sai.sql b/sql/old/3.3.5a/2012_06_05_01_world_gossip_sai.sql
index 84893613c75..84893613c75 100644
--- a/sql/updates/world/2012_06_05_01_world_gossip_sai.sql
+++ b/sql/old/3.3.5a/2012_06_05_01_world_gossip_sai.sql
diff --git a/sql/updates/world/2012_06_05_03_world_script.sql b/sql/old/3.3.5a/2012_06_05_03_world_script.sql
index d10247979d9..d10247979d9 100644
--- a/sql/updates/world/2012_06_05_03_world_script.sql
+++ b/sql/old/3.3.5a/2012_06_05_03_world_script.sql
diff --git a/sql/updates/world/2012_06_06_00_world_script.sql b/sql/old/3.3.5a/2012_06_06_00_world_script.sql
index 727d28e8ea9..727d28e8ea9 100644
--- a/sql/updates/world/2012_06_06_00_world_script.sql
+++ b/sql/old/3.3.5a/2012_06_06_00_world_script.sql
diff --git a/sql/updates/world/2012_06_06_01_world_sai.sql b/sql/old/3.3.5a/2012_06_06_01_world_sai.sql
index 97e175652d2..97e175652d2 100644
--- a/sql/updates/world/2012_06_06_01_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_06_01_world_sai.sql
diff --git a/sql/updates/world/2012_06_06_02_world_sai.sql b/sql/old/3.3.5a/2012_06_06_02_world_sai.sql
index 297409ed776..297409ed776 100644
--- a/sql/updates/world/2012_06_06_02_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_06_02_world_sai.sql
diff --git a/sql/updates/world/2012_06_06_03_world_conditions.sql b/sql/old/3.3.5a/2012_06_06_03_world_conditions.sql
index c9af2a1bcbc..c9af2a1bcbc 100644
--- a/sql/updates/world/2012_06_06_03_world_conditions.sql
+++ b/sql/old/3.3.5a/2012_06_06_03_world_conditions.sql
diff --git a/sql/updates/world/2012_06_06_04_world_sai.sql b/sql/old/3.3.5a/2012_06_06_04_world_sai.sql
index af820f418be..af820f418be 100644
--- a/sql/updates/world/2012_06_06_04_world_sai.sql
+++ b/sql/old/3.3.5a/2012_06_06_04_world_sai.sql
diff --git a/sql/updates/characters/2012_06_07_00_characters_respawn.sql b/sql/old/3.3.5a/2012_06_07_00_characters_respawn.sql
index 168aa312713..168aa312713 100644
--- a/sql/updates/characters/2012_06_07_00_characters_respawn.sql
+++ b/sql/old/3.3.5a/2012_06_07_00_characters_respawn.sql
diff --git a/sql/updates/world/2012_06_07_00_world_gossip.sql b/sql/old/3.3.5a/2012_06_07_00_world_gossip.sql
index 1fe4a23bc5a..aac3ac53e74 100644
--- a/sql/updates/world/2012_06_07_00_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_06_07_00_world_gossip.sql
@@ -9,7 +9,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_
(@NPC,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Charles Worth - On Gossip Select - Close Gossip');
-- Add missing Gossip for Charles Worth
DELETE FROM `gossip_menu` WHERE `entry` IN (10136,10138);
-DELETE FROM `gossip_menu` WHERE `entry`=14076 AND `text_id`=14076;
+DELETE FROM `gossip_menu` WHERE `entry`=10118 AND `text_id`=14076;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10136,14072),(10138,14074),(10118,14076);
-- Add Gossip Options
DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id` IN (2,3,4,5);
diff --git a/sql/updates/world/2012_06_07_01_world_gossip.sql b/sql/old/3.3.5a/2012_06_07_01_world_gossip.sql
index d77d41fa523..d77d41fa523 100644
--- a/sql/updates/world/2012_06_07_01_world_gossip.sql
+++ b/sql/old/3.3.5a/2012_06_07_01_world_gossip.sql
diff --git a/sql/updates/world/2012_06_07_02_world_item_template.sql b/sql/old/3.3.5a/2012_06_07_02_world_item_template.sql
index fdf3cce7c24..fdf3cce7c24 100644
--- a/sql/updates/world/2012_06_07_02_world_item_template.sql
+++ b/sql/old/3.3.5a/2012_06_07_02_world_item_template.sql
diff --git a/sql/updates/world/2012_06_07_03_world_item_template.sql b/sql/old/3.3.5a/2012_06_07_03_world_item_template.sql
index a6caa15632e..a6caa15632e 100644
--- a/sql/updates/world/2012_06_07_03_world_item_template.sql
+++ b/sql/old/3.3.5a/2012_06_07_03_world_item_template.sql
diff --git a/sql/updates/world/2012_06_07_04_world_spell_dbc.sql b/sql/old/3.3.5a/2012_06_07_04_world_spell_dbc.sql
index de5753fc7a6..de5753fc7a6 100644
--- a/sql/updates/world/2012_06_07_04_world_spell_dbc.sql
+++ b/sql/old/3.3.5a/2012_06_07_04_world_spell_dbc.sql
diff --git a/sql/updates/world/2012_06_07_05_world_misc.sql b/sql/old/3.3.5a/2012_06_07_05_world_misc.sql
index d45384dd3ef..d45384dd3ef 100644
--- a/sql/updates/world/2012_06_07_05_world_misc.sql
+++ b/sql/old/3.3.5a/2012_06_07_05_world_misc.sql
diff --git a/sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_06_08_00_world_spell_bonus_data.sql
index bf899421605..bf899421605 100644
--- a/sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql
+++ b/sql/old/3.3.5a/2012_06_08_00_world_spell_bonus_data.sql
diff --git a/sql/updates/world/2012_06_09_00_world_creature.sql b/sql/old/3.3.5a/2012_06_09_00_world_creature.sql
index b2454b54163..b2454b54163 100644
--- a/sql/updates/world/2012_06_09_00_world_creature.sql
+++ b/sql/old/3.3.5a/2012_06_09_00_world_creature.sql
diff --git a/sql/updates/world/2012_06_12_00_world_transport.sql b/sql/old/3.3.5a/2012_06_12_00_world_transport.sql
index 3099292f48d..d3a35c254d9 100644
--- a/sql/updates/world/2012_06_12_00_world_transport.sql
+++ b/sql/old/3.3.5a/2012_06_12_00_world_transport.sql
@@ -45,19 +45,19 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type
(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut emote'),
(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote'),
-- Script 1
-(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 1'),
-(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 0'),
-(@ENTRY*100+1,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote'),
+(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Leave Orgrimmar - Sky-Captain Blastnut Say 1'),
+(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Leave Orgrimmar - Chief Officer Ograh Say 0'),
+(@ENTRY*100+1,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Leave Orgrimmar - Chief Officer Ograh emote'),
-- Script 2
-(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 2'),
-(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 1'),
-(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34766,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Krendle Bigpockets Say 0'),
-(@ENTRY*100+2,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut emote'),
-(@ENTRY*100+2,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote'),
+(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Thunder Bluff - Sky-Captain Blastnut Say 2'),
+(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Thunder Bluff - Chief Officer Ograh Say 1'),
+(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34766,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Thunder Bluff - Krendle Bigpockets Say 0'),
+(@ENTRY*100+2,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Thunder Bluff - Sky-Captain Blastnut emote'),
+(@ENTRY*100+2,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Thunder Bluff - Chief Officer Ograh emote'),
-- Script 3
-(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 3'),
-(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 2'),
-(@ENTRY*100+3,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote');
+(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Leave Thunder Bluff - Sky-Captain Blastnut Say 3'),
+(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Leave Thunder Bluff - Chief Officer Ograh Say 2'),
+(@ENTRY*100+3,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Leave Thunder Bluff - Chief Officer Ograh emote');
-- Watcher Tolwe <The Zephyr> SAI
SET @ENTRY := 34723;
UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
@@ -76,7 +76,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr
(34715,2,0,'Watch your step! Don''t want you becoming a smudge down there. Welcome to Thunder Bluff!',12,1,100,1,0,0,'Sky-Captain Blastnut - Dock at Thunder Bluff'), -- wait 3 sec do emote 5
(34715,3,0,'Okay, boys, let''s get this baby over to Orgrimmar!',12,1,100,25,0,0,'Sky-Captain Blastnut - Leave for Orgrimmar'),
(34721,0,0,'Move it, Zippik! We don''t have all day!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Thunder Bluff'),
-(34721,1,0,'Careful. CAREFUL! Did I feel a shudder? You''re going to knock that tower down, oaf!',12,1,100,5,0,0,'Chief Officer Ograh - Dock at Thunder Bluff'), -- wait 4 sec do emote 25
+(34721,1,0,'Careful. CAREFUL! Did I feel a shudder? You''re going to knock that tower down, oaf!',12,1,100,5,0,0,'Chief Officer Ograh - Dock at Orgrimmar & Thunder Bluff'),
(34721,2,0,'We''re behind schedule! Turn this tub east! EAST!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Orgrimmar'),
(34766,0,0,'Step right up! The zeppelin to Orgrimmar has arrived! All aboard to Durotar!',14,0,100,22,0,11804,'Krendle Bigpockets - Dock at Thunder Bluff'),
(34765,0,0,'The zeppelin to Thunder Bluff has arrived! All aboard for a smooth ride across the Barrens!',14,0,100,22,0,11804,'Zelli Hotnozzle - Dock at Orgrimmar');
diff --git a/sql/old/3.3.5a/2012_06_13_00_characters_character_equipmentsets.sql b/sql/old/3.3.5a/2012_06_13_00_characters_character_equipmentsets.sql
new file mode 100644
index 00000000000..ebf12062be3
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_13_00_characters_character_equipmentsets.sql
@@ -0,0 +1,22 @@
+ALTER TABLE `character_equipmentsets`
+MODIFY COLUMN `item0` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item1` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item2` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item3` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item4` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item5` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item6` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item7` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item8` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item9` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item10` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item11` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item12` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item13` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item14` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item15` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item16` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item17` int(11) unsigned NOT NULL DEFAULT 0,
+MODIFY COLUMN `item18` int(11) unsigned NOT NULL DEFAULT 0;
+
+ALTER TABLE `character_equipmentsets` ADD COLUMN `ignore_mask` int(11) unsigned NOT NULL DEFAULT 0 AFTER `iconname`;
diff --git a/sql/old/3.3.5a/2012_06_13_00_world_creature.sql b/sql/old/3.3.5a/2012_06_13_00_world_creature.sql
new file mode 100644
index 00000000000..0d2aa74c9c7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_13_00_world_creature.sql
@@ -0,0 +1,71 @@
+-- Pathing for Violetta (32720)
+SET @NPC := 32720;
+SET @GUID := 12402;
+DELETE FROM `creature` WHERE `guid`=@GUID;
+DELETE FROM `creature` WHERE `id`=@NPC;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`)
+VALUES (@GUID,@NPC,571,1,1,0,0,5693.527,680.9248,645.9013,4.681826,300,0,0,1,0,0,0,0,0);
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@NPC,0,0,0,1,0,'');
+-- SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC*100+0,@NPC*100+1,@NPC*100+2,@NPC*100+3) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC,0,0,1,25,0,100,0,0,0,0,0,71,1670,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On reset - Equip default"),
+(@NPC,0,1,0,61,0,100,0,0,0,0,0,88,@NPC*100+0,@NPC*100+1,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On reset - Run random script"),
+(@NPC,0,2,0,40,1,100,0,8,0,0,0,80,@NPC*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp8 - Run script"),
+(@NPC,0,3,0,40,2,100,0,8,0,0,0,80,@NPC*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp8 - Run script"),
+(@NPC,0,4,0,58,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp end - Despawn"),
+(@NPC*100+0,9,0,0,0,0,100,0,0,0,0,0,53,0,@NPC*10+0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 1 - Start waypoint 1"),
+(@NPC*100+0,9,1,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 1 - Set phase 1"),
+(@NPC*100+1,9,0,0,0,0,100,0,0,0,0,0,53,0,@NPC*10+1,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 2 - Start waypoint 2"),
+(@NPC*100+1,9,1,0,0,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 2 - Set phase 2"),
+(@NPC*100+2,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Pause WP 10 seconds"),
+(@NPC*100+2,9,1,0,0,0,100,0,5000,5000,5000,5000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Emote talk"),
+(@NPC*100+2,9,2,0,0,0,100,0,3000,3000,3000,3000,71,0,0,44655,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Equip item"),
+(@NPC*100+3,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Pause WP 10 seconds"),
+(@NPC*100+3,9,1,0,0,0,100,0,5000,5000,5000,5000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Emote talk"),
+(@NPC*100+3,9,2,0,0,0,100,0,3000,3000,3000,3000,71,0,0,40020,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Equip item");
+-- Waypoints
+DELETE FROM `waypoints` WHERE `entry` IN (@NPC*10+0,@NPC*10+1);
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@NPC*10+0,1,5693.35,675.1416,645.6994,'Violetta wp1'),
+(@NPC*10+0,2,5690.851,664.07,646.2488,'Violetta wp1'),
+(@NPC*10+0,3,5686.851,656.5425,646.5913,'Violetta wp1'),
+(@NPC*10+0,4,5679.384,648.7989,646.6834,'Violetta wp1'),
+(@NPC*10+0,5,5675.498,647.6321,647.0242,'Violetta wp1'),
+(@NPC*10+0,6,5669.809,645.4785,647.9725,'Violetta wp1'),
+(@NPC*10+0,7,5664.492,643.8845,647.98,'Violetta wp1'),
+(@NPC*10+0,8,5664.87,642.0466,647.98,'Violetta wp1'),
+(@NPC*10+0,9,5669.127,645.5728,647.9717,'Violetta wp1'),
+(@NPC*10+0,10,5675.875,647.3784,647.0391,'Violetta wp1'),
+(@NPC*10+0,11,5681.011,648.9694,646.6834,'Violetta wp1'),
+(@NPC*10+0,12,5683.774,658.9824,646.6004,'Violetta wp1'),
+(@NPC*10+0,13,5682.824,671.3663,647.0424,'Violetta wp1'),
+(@NPC*10+0,14,5677.113,674.4891,649.4763,'Violetta wp1'),
+(@NPC*10+0,15,5667.89,677.9095,652.0448,'Violetta wp1'),
+(@NPC*10+0,16,5655.117,684.3335,651.9886,'Violetta wp1'),
+(@NPC*10+0,17,5649.896,690.4983,651.9928,'Violetta wp1'),
+(@NPC*10+0,18,5646.092,697.507,651.9928,'Violetta wp1'),
+(@NPC*10+0,19,5646.725,700.2504,651.9928,'Violetta wp1'),
+(@NPC*10+1,1,5693.35,675.1416,645.6994,'Violetta wp2'),
+(@NPC*10+1,2,5690.851,664.07,646.2488,'Violetta wp2'),
+(@NPC*10+1,3,5686.851,656.5425,646.5913,'Violetta wp2'),
+(@NPC*10+1,4,5679.384,648.7989,646.6834,'Violetta wp2'),
+(@NPC*10+1,5,5675.498,647.6321,647.0242,'Violetta wp2'),
+(@NPC*10+1,6,5669.809,645.4785,647.9725,'Violetta wp2'),
+(@NPC*10+1,7,5664.369,644.7076,647.9811,'Violetta wp2'),
+(@NPC*10+1,8,5661.005,643.9919,647.9821,'Violetta wp2'),
+(@NPC*10+1,9,5669.143,645.5861,647.9418,'Violetta wp2'),
+(@NPC*10+1,10,5675.875,647.3784,647.0391,'Violetta wp2'),
+(@NPC*10+1,11,5681.011,648.9694,646.6834,'Violetta wp2'),
+(@NPC*10+1,12,5683.774,658.9824,646.6004,'Violetta wp2'),
+(@NPC*10+1,13,5682.824,671.3663,647.0424,'Violetta wp2'),
+(@NPC*10+1,14,5677.113,674.4891,649.4763,'Violetta wp2'),
+(@NPC*10+1,15,5667.89,677.9095,652.0448,'Violetta wp2'),
+(@NPC*10+1,16,5655.117,684.3335,651.9886,'Violetta wp2'),
+(@NPC*10+1,17,5649.896,690.4983,651.9928,'Violetta wp2'),
+(@NPC*10+1,18,5646.092,697.507,651.9928,'Violetta wp2'),
+(@NPC*10+1,19,5646.725,700.2504,651.9928,'Violetta wp2');
diff --git a/sql/old/3.3.5a/2012_06_13_01_world_creature.sql b/sql/old/3.3.5a/2012_06_13_01_world_creature.sql
new file mode 100644
index 00000000000..5ba3e0d34a2
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_13_01_world_creature.sql
@@ -0,0 +1,11 @@
+DELETE FROM `creature_template_addon` WHERE `entry` = 29975;
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(29975, 0, 0x10000, 0x1, 54503); -- Lok'lira the Crone - Quest Invisibility 2
+
+DELETE FROM `creature` WHERE `id` = 29975 OR `guid` = 2593;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(2593, 29975, 571, 1, 1, 6922.175, -1534.575, 836.1568, 4.276057, 120, 0, 0); -- Lok'lira the Crone (Area: Brunnhildar Village)
+
+DELETE FROM `spell_area` WHERE `spell` = 54504;
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(54504,4422,12921,1,0,0,0,2,1); -- cast see quest invisibility 2 after accepting the quest from lok'lira.
diff --git a/sql/old/3.3.5a/2012_06_13_02_world_gossip.sql b/sql/old/3.3.5a/2012_06_13_02_world_gossip.sql
new file mode 100644
index 00000000000..2cac9fe2a0a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_13_02_world_gossip.sql
@@ -0,0 +1,32 @@
+-- Missing gossip for Krendle Bigpockets <Durotar Zeppelin Master> in Thunder Bluff
+UPDATE `creature_template` SET `gossip_menu_id`=10566 WHERE `entry`=34766;
+DELETE FROM `gossip_menu` WHERE `entry`=10566 AND `text_id`=14622;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10566,14622);
+-- Missing gossip
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=7368 AND `id` IN (3,4);
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES
+(7368,3,0,'Acteon, where is the best area to hunt for moongraze stags?',1,1,7423,0,0,0,''),
+(7368,4,0,'Acteon, where is the best place to hunt moongraze bucks?',1,1,7424,0,0,0,'');
+-- conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7368 AND `SourceEntry` IN (3,4);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,7368,3,0,0,9,9454,0,0,0,0,'','Acteon - Show gossip option if player has quest 9454'),
+(15,7368,4,0,0,9,10324,0,0,0,0,'','Acteon - Show gossip option if player has quest 10324');
+-- Gossip Condition for Archmage Celindra <Portal Trainer>
+SET @GOSSIP := 9777;
+SET @TEXTNO := 13455;
+SET @TEXTYES := 13456;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'),
+(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage');
+-- Update NPC 4217 Mathrengyl Bearwalker
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=1403 AND `id`=3;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES
+(1403,3,1,'I''d like to purchase more Tharlendris seeds.',3,128,0,0,0,0,'');
+-- conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1403 AND `SourceEntry`=3;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,1403,3,0,0,8,3781,0,0,0,0,'','Mathrengyl Bearwalker - Show gossip option if player has rewarded quest 3781'); -- available only for druids
+ -- Quest 3792 should only be available after quest 3791
+UPDATE `quest_template` SET `PrevQuestId`=3791 WHERE `id`=3792;
diff --git a/sql/old/3.3.5a/2012_06_13_03_world_sai.sql b/sql/old/3.3.5a/2012_06_13_03_world_sai.sql
new file mode 100644
index 00000000000..ad9642447c0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_13_03_world_sai.sql
@@ -0,0 +1,70 @@
+-- Grand Anchorite Almonen SAI
+SET @ENTRY := 19216;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,10000,10000,300000,300000,80,@ENTRY*100 ,0,0,0,0,0,1,0,0,0,0,0,0,0,'Sky-Captain Cloudkicker - OOC - Run Script'),
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.654867,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,1,0,0,0,100,0,9000,9000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - emote'),
+(@ENTRY*100,9,2,0,0,0,100,0,23000,23000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.72,5423.082,-10.45947,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,3,0,0,0,100,0,800,800,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.598,5411.999,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,4,0,0,0,100,0,5000,5000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.183628,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,5,0,0,0,100,0,100,100,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 0'),
+(@ENTRY*100,9,6,0,0,0,100,0,9000,9000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 1'),
+(@ENTRY*100,9,7,0,0,0,100,0,9000,9000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 2'),
+(@ENTRY*100,9,8,0,0,0,100,0,25000,25000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 3'),
+(@ENTRY*100,9,9,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.699,5413.06,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,10,0,0,0,100,0,100,100,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 4'),
+(@ENTRY*100,9,11,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1848.775,5412.81,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,12,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.276057,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,13,0,0,0,100,0,4000,4000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 5'),
+(@ENTRY*100,9,14,0,0,0,100,0,7000,7000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.574,5412.084,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,15,0,0,0,100,0,1900,1900,0,0,69,0,0,0,0,0,0,8,0,0,0,-1856.307,5410.266,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,16,0,0,0,100,0,1900,1900,0,0,69,0,0,0,0,0,0,8,0,0,0,-1859.002,5406.959,-12.42814,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,17,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.707227,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,18,0,0,0,100,0,100,100,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 6'),
+(@ENTRY*100,9,19,0,0,0,100,0,10000,10000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 7'),
+(@ENTRY*100,9,20,0,0,0,100,0,9000,9000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 8'),
+(@ENTRY*100,9,21,0,0,0,100,0,5000,5000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1855.089,5410.676,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,22,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1853.62,5409.833,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,23,0,0,0,100,0,3000,3000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 9'),
+(@ENTRY*100,9,24,0,0,0,100,0,11000,11000,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 10'),
+(@ENTRY*100,9,25,0,0,0,100,0,9000,9000,0,0,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 11'),
+(@ENTRY*100,9,26,0,0,0,100,0,100,100,0,0,69,0,0,0,0,0,0,8,0,0,0,-1852.503,5412.286,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,27,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1849.053,5415.075,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,28,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.340707,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,29,0,0,0,100,0,5000,5000,0,0,1,12,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 12'),
+(@ENTRY*100,9,30,0,0,0,100,0,11000,11000,0,0,1,13,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 13'),
+(@ENTRY*100,9,31,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.643,5414.012,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,32,0,0,0,100,0,1200,1200,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.913,5412.682,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,33,0,0,0,100,0,800,800,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.408,5411.227,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,34,0,0,0,100,0,1000,1000,0,0,1,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 14'),
+(@ENTRY*100,9,35,0,0,0,100,0,10000,10000,0,0,1,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 15'),
+(@ENTRY*100,9,36,0,0,0,100,0,7000,7000,0,0,1,16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 16'),
+(@ENTRY*100,9,37,0,0,0,100,0,10000,10000,0,0,1,17,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 17'),
+(@ENTRY*100,9,38,0,0,0,100,0,11000,11000,0,0,1,18,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 18'),
+(@ENTRY*100,9,39,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1853.137,5424.863,-10.47787,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,40,0,0,0,100,0,6500,6500,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.6529,'Grand Anchorite Almonen - Script - Turn to');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=19216;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(19216,0,0, 'Friends, it is my great pleasure to welcome you to the temple today.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,1,0, 'A''dal has been most generous in his revelations to me, a humble servant of the Light.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,2,0, 'In accordance with my divine calling, I must share these revealed truths to all who would hear.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,3,0, 'It has been made known to me that inside each of us, the Light resides...',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,4,0, '...that it is a gift, given freely to all naturally born beings.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,5,0, 'It manifests itself as a feeling, small at first and easily ignored, that confirms truths and subtly prods one to do good.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,6,0, 'Simple kindnesses, charitable deeds, service to those in need. These are all fruits of the Light.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,7,0, 'It rewards those who heed its promptings with blessings, both seen and unseen.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,8,0, 'Personal reservoirs of hope and faith are strengthened, and one''s capacity for greater light increases.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,9,0, 'Over the course of time, through obedience to the Light''s guidance, one becomes more sensitive to its voice, and its power.',12,0,100,273,0,0, 'Grand Anchorite Almonen'),
+(19216,10,0, 'Great is the healing and blessing power of the Light''s most diligent followers.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,11,0, 'Sadly, there are those who wander through mortality in defiance of the Light.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,12,0, 'From these the Light withdraws, until only darkness remains.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,13,0, 'Where there is no light, despair, loathing and rage thrive.',12,0,100,5,0,0, 'Grand Anchorite Almonen'),
+(19216,14,0, 'We are born into a perilous age, where the forces of darkness are determined to bring about our destruction.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,15,0, 'These are the times to find yourselves in unison with the Light.',12,0,100,5,0,0, 'Grand Anchorite Almonen'),
+(19216,16,0, 'Hear my words, and let the Light inside of you confirm the truth of them.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,17,0, 'Embrace the light that is in you, my friends! Deny yourself all darkness...',12,0,100,5,0,0, 'Grand Anchorite Almonen'),
+(19216,18,0, 'We must endure these trying times faithfully, and one day we will find ourselves victorious.',12,0,100,5,0,0, 'Grand Anchorite Almonen');
diff --git a/sql/old/3.3.5a/2012_06_14_00_world_spell_linked_spell.sql b/sql/old/3.3.5a/2012_06_14_00_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..85cae64c21d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_00_world_spell_linked_spell.sql
@@ -0,0 +1,5 @@
+-- Fix Surge of Adrenaline
+DELETE FROM `spell_linked_spell` WHERE `spell_effect`=68667;
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(-66683,68667,0, 'Icehowl - Surge of Adrenaline'),
+(-67660,68667,0, 'Icehowl - Surge of Adrenaline');
diff --git a/sql/old/3.3.5a/2012_06_14_01_world_spell_linked_spell.sql b/sql/old/3.3.5a/2012_06_14_01_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..6109c8db068
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_01_world_spell_linked_spell.sql
@@ -0,0 +1,51 @@
+-- delete 'Mangle - Remover'
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33878 AND `type`=1;
diff --git a/sql/old/3.3.5a/2012_06_14_02_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_06_14_02_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..b7f61f407b4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_02_world_spell_bonus_data.sql
@@ -0,0 +1,102 @@
+-- Death Knight
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(58621, 47632, 47633, 50444, 70890, 50526, 48982, 59754, 49184);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(58621, 0, -1, 0.08, -1, 'Death Knight - Glyph of Chains of Ice'), -- Shouldn't scale with SP.
+(47632, 0, -1, 0.15, -1, 'Death Knight - Death Coil'), -- Shouldn't scale with SP.
+(47633, 0, -1, 0.15, -1, 'Death Knight - Death Coil (Heal)'), -- Shouldn't scale with SP.
+(50444, 0, -1, 0.105, -1, 'Death Knight - Corpse Explosion (Triggered)'), -- Shouldn't scale with SP.
+(70890, 0, -1, -1, -1, 'Death Knight - Scourge Strike (Shadow)'), -- Shouldn't scale with SP.
+(50526, 0, -1, -1, -1, 'Death Knight - Wandering Plague (Triggered)'), -- Shouldn't scale with SP.
+(48982, 0, -1, -1, -1, 'Death Knight - Rune Tap'), -- Shouldn't scale with SP.
+(59754, 0, -1, -1, -1, 'Death Knight - Glyph of Rune Tap (Triggered)'), -- Shouldn't scale with SP.
+(49184, 0, -1, 0.2, -1, 'Death Knight - Howling Blast'); -- Shouldn't scale with SP.
+
+-- Druid
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(48450, 48451); -- Lifebloom Rank 2, Rank 3
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(48567, 48568); -- Lacerate Rank 2, Rank 3
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(33745, 9007);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(33745, 0, 0, 0.01, 0.01, 'Druid - Lacerate ($AP*0.05/number of ticks)'), -- Direct damage should scale with AP, based on DrDamage addon(3.3.5a).
+(9007, -1, 0, -1, 0.03, 'Druid - Pounce Bleed (Triggered)'); -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+
+-- Hunter
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(56641, 42243, 3674, 19306, 1495, 63468, 136);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(56641, 0, -1, 0.1, -1, 'Hunter - Steady Shot'), -- Shouldn't scale with SP.
+(42243, 0, -1, 0.0837, -1, 'Hunter - Volley (Triggered)'), -- Shouldn't scale with SP.
+(3674, -1, 0, -1, 0.023, 'Hunter - Black Arrow ($RAP*0.1 / number of ticks)'), -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a).
+(19306, 0, -1, 0.2, -1, 'Hunter - Counterattack'), -- Shouldn't scale with SP.
+(1495, 0, -1, 0.2, -1, 'Hunter - Mongoose Bite'), -- Shouldn't scale with SP.
+(63468, -1, 0, -1, -1, 'Hunter - Piercing Shots'), -- Shouldn't scale with SP.
+(136, -1, 0, -1, -1, 'Hunter - Mend Pet'); -- Shouldn't scale with SP.
+
+-- Mage
+DELETE FROM `spell_bonus_data` WHERE `entry`=7269; -- Arcane Missiles Triggered Spell Rank 2
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(133, 44614, 44457, 44461);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(133, 1, 0, -1, -1, 'Mage - Fireball'), -- DoT componenet shouldn't scale.
+(44614, 0.8571, 0, -1, -1, 'Mage - Frostfire Bolt'), -- DoT componenet shouldn't scale.
+(44457, -1, 0.2, -1, -1, 'Mage - Living Bomb ($SP*0.8 / number of ticks)'), -- Direct damage bonus correction.
+(44461, 0.4286, -1, -1, -1, 'Mage - Living Bomb (Triggered)'); -- Direct damage bonus correction.
+
+-- Paladin
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(633, 54158, 20467, 20187, 31803, 53742, 31804, 53733);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(633, 0, -1, -1, -1, 'Paladin - Lay on Hands'), -- Shouldn't scale with SP.
+(54158, 0.27, -1, 0.175, -1, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), -- Increase coefficient, based on Wowwiki.com.
+(20467, 0.14, -1, 0.115, -1, 'Paladin - Judgement of Command'), -- Decrease coefficient, based on Wowwiki.com.
+(20187, 0.355, -1, 0.225, -1, 'Paladin - Judgement of Righteousness'), -- Increase coefficient, based on Wowwiki.com.
+(31803, -1, 0.0132, -1, 0.0252, 'Paladin - Holy Vengeance'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(53742, -1, 0.0132, -1, 0.0252, 'Paladin - Blood Corruption'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(31804, 0.24, -1, 0.15, -1, 'Paladin - Judgement of Vengeance'), -- Increase coefficient, based on Wowwiki.com.
+(53733, 0.24, -1, 0.15, -1, 'Paladin - Judgement of Corruption'); -- Increase coefficient, based on Wowwiki.com.
+
+-- Priest
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(52983, 52954, 58985); -- Penance Heal Rank 2, Rank 3, Rank 4
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(52998, 52999, 53000); -- Penance Hurt Rank 2, Rank 3, Rank 4
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(7001);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(7001, -1, 0.626, -1, -1, 'Priest - Lightwell Renew ($SP*1.878 / number of ticks)'); -- Increase coefficient, based on DrDamage addon(3.3.5a).
+
+-- Rogue
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(819, 11353, 11354, 25349, 26968, 27187, 57969, 57970); -- Deadly Poison Rank 2, Rank 3, etc.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(8685, 8689, 11335, 11336, 11337, 26890, 57964, 57965); -- Instant Poison Rank 2, Rank 3, etc.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(13222, 13223, 13224, 27189, 57974, 57975); -- Wound Poison Rank 2, Rank 3, etc.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(32645, 2098, 703, 1776, 1943, 8680, 26688, 13218);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(32645, 0, -1, -1, -1, 'Rogue - Envenom'), -- Shouldn't scale with SP.
+(2098, 0, -1, -1, -1, 'Rogue - Eviscerate'), -- Shouldn't scale with SP.
+(703, -1, 0, -1, 0.07, 'Rogue - Garrote'), -- Shouldn't scale with SP.
+(1776, 0, -1, 0.21, -1, 'Rogue - Gouge'), -- Shouldn't scale with SP.
+(1943, -1, 0, -1, -1, 'Rogue - Rupture'), -- Shouldn't scale with SP.
+(8680, 0, -1, 0.1, -1, 'Rogue - Instant Poison'), -- Shouldn't scale with SP.
+(26688, 0, -1, 0, -1, 'Rogue - Anesthetic Poison'), -- Shouldn't scale with SP nor AP.
+(13218, 0, -1, 0.04, -1, 'Rogue - Wound Poison'); -- Shouldn't scale with SP.
+
+ -- Warlock Healthstones Shouldn't scale with SP.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (6262, 23468, 23469, 6263, 23470, 23471, 5720, 23472, 23473, 5723, 23474, 23475, 11732, 23476, 23477, 27235, 27236, 27237, 47874, 47873, 47872, 47875, 47876, 47877);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(6262, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 0/2 Improved Healthstone)'),
+(23468, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 1/2 Improved Healthstone)'),
+(23469, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 2/2 Improved Healthstone)'),
+(6263, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 0/2 Improved Healthstone)'),
+(23470, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 1/2 Improved Healthstone)'),
+(23471, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 2/2 Improved Healthstone)'),
+(5720, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 0/2 Improved Healthstone)'),
+(23472, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 1/2 Improved Healthstone)'),
+(23473, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 2/2 Improved Healthstone)'),
+(5723, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 0/2 Improved Healthstone)'),
+(23474, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 1/2 Improved Healthstone)'),
+(23475, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 2/2 Improved Healthstone)'),
+(11732, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 0/2 Improved Healthstone)'),
+(23476, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 1/2 Improved Healthstone)'),
+(23477, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 2/2 Improved Healthstone)'),
+(27235, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 0/2 Improved Healthstone)'),
+(27236, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 1/2 Improved Healthstone)'),
+(27237, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 2/2 Improved Healthstone)'),
+(47874, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 0/2 Improved Healthstone)'),
+(47873, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 1/2 Improved Healthstone)'),
+(47872, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 2/2 Improved Healthstone)'),
+(47875, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 0/2 Improved Healthstone)'),
+(47876, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 1/2 Improved Healthstone)'),
+(47877, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 2/2 Improved Healthstone)');
diff --git a/sql/old/3.3.5a/2012_06_14_03_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_06_14_03_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..dc59f152e33
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_03_world_spell_bonus_data.sql
@@ -0,0 +1,94 @@
+-- Death Knight
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (58621, 47632, 47633, 50444, 70890, 50526, 48982, 59754, 49184);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(58621, 0, 0, 0.08, 0, 'Death Knight - Glyph of Chains of Ice'), -- Shouldn't scale with SP.
+(47632, 0, 0, 0.15, 0, 'Death Knight - Death Coil'), -- Shouldn't scale with SP.
+(47633, 0, 0, 0.15, 0, 'Death Knight - Death Coil (Heal)'), -- Shouldn't scale with SP.
+(50444, 0, 0, 0.105, 0, 'Death Knight - Corpse Explosion (Triggered)'), -- Shouldn't scale with SP.
+(70890, 0, 0, 0, 0, 'Death Knight - Scourge Strike (Shadow)'), -- Shouldn't scale with SP.
+(50526, 0, 0, 0, 0, 'Death Knight - Wandering Plague (Triggered)'), -- Shouldn't scale with SP.
+(48982, 0, 0, 0, 0, 'Death Knight - Rune Tap'), -- Shouldn't scale with SP.
+(59754, 0, 0, 0, 0, 'Death Knight - Glyph of Rune Tap (Triggered)'), -- Shouldn't scale with SP.
+(49184, 0, 0, 0.2, 0, 'Death Knight - Howling Blast'); -- Shouldn't scale with SP.
+
+-- Druid
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (33745, 9007);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(33745, 0, 0, 0.01, 0.01, 'Druid - Lacerate ($AP*0.05/number of ticks)'), -- Direct damage should scale with AP, based on DrDamage addon(3.3.5a).
+(9007, 0, 0, 0, 0.03, 'Druid - Pounce Bleed (Triggered)'); -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+
+-- Hunter
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (56641, 42243, 3674, 19306, 1495, 63468, 136);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(56641, 0, 0, 0.1, 0, 'Hunter - Steady Shot'), -- Shouldn't scale with SP.
+(42243, 0, 0, 0.0837, 0, 'Hunter - Volley (Triggered)'), -- Shouldn't scale with SP.
+(3674, 0, 0, 0, 0.023, 'Hunter - Black Arrow ($RAP*0.1 / number of ticks)'), -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a).
+(19306, 0, 0, 0.2, 0, 'Hunter - Counterattack'), -- Shouldn't scale with SP.
+(1495, 0, 0, 0.2, 0, 'Hunter - Mongoose Bite'), -- Shouldn't scale with SP.
+(63468, 0, 0, 0, 0, 'Hunter - Piercing Shots'), -- Shouldn't scale with SP.
+(136, 0, 0, 0, 0, 'Hunter - Mend Pet'); -- Shouldn't scale with SP.
+
+-- Mage
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (133, 44614, 44457, 44461);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(133, 1, 0, 0, 0, 'Mage - Fireball'), -- DoT componenet shouldn't scale.
+(44614, 0.8571, 0, 0, 0, 'Mage - Frostfire Bolt'), -- DoT componenet shouldn't scale.
+(44457, 0, 0.2, 0, 0, 'Mage - Living Bomb ($SP*0.8 / number of ticks)'), -- Direct damage bonus correction.
+(44461, 0.4286, 0, 0, 0, 'Mage - Living Bomb (Triggered)'); -- Direct damage bonus correction.
+
+-- Paladin
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (633, 54158, 20467, 20187, 31803, 53742, 31804, 53733);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(633, 0, 0, 0, 0, 'Paladin - Lay on Hands'), -- Shouldn't scale with SP.
+(54158, 0.27, 0, 0.175, 0, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), -- Increase coefficient, based on Wowwiki.com.
+(20467, 0.14, 0, 0.115, 0, 'Paladin - Judgement of Command'), -- Decrease coefficient, based on Wowwiki.com.
+(20187, 0.355, 0, 0.225, 0, 'Paladin - Judgement of Righteousness'), -- Increase coefficient, based on Wowwiki.com.
+(31803, 0, 0.0132, 0, 0.0252, 'Paladin - Holy Vengeance'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(53742, 0, 0.0132, 0, 0.0252, 'Paladin - Blood Corruption'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(31804, 0.24, 0, 0.15, 0, 'Paladin - Judgement of Vengeance'), -- Increase coefficient, based on Wowwiki.com.
+(53733, 0.24, 0, 0.15, 0, 'Paladin - Judgement of Corruption'); -- Increase coefficient, based on Wowwiki.com.
+
+-- Priest
+DELETE FROM `spell_bonus_data` WHERE `entry` = 7001;
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(7001, 0, 0.626, 0, 0, 'Priest - Lightwell Renew ($SP*1.878 / number of ticks)'); -- Increase coefficient, based on DrDamage addon(3.3.5a).
+
+-- Rogue
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (32645, 2098, 703, 1776, 1943, 8680, 26688, 13218);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(32645, 0, 0, 0, 0, 'Rogue - Envenom'), -- Shouldn't scale with SP.
+(2098, 0, 0, 0, 0, 'Rogue - Eviscerate'), -- Shouldn't scale with SP.
+(703, 0, 0, 0, 0.07, 'Rogue - Garrote'), -- Shouldn't scale with SP.
+(1776, 0, 0, 0.21, 0, 'Rogue - Gouge'), -- Shouldn't scale with SP.
+(1943, 0, 0, 0, 0, 'Rogue - Rupture'), -- Shouldn't scale with SP.
+(8680, 0, 0, 0.1, 0, 'Rogue - Instant Poison'), -- Shouldn't scale with SP.
+(26688, 0, 0, 0, 0, 'Rogue - Anesthetic Poison'), -- Shouldn't scale with SP nor AP.
+(13218, 0, 0, 0.04, 0, 'Rogue - Wound Poison'); -- Shouldn't scale with SP.
+
+ -- Warlock Healthstones Shouldn't scale with SP.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (6262, 23468, 23469, 6263, 23470, 23471, 5720, 23472, 23473, 5723, 23474, 23475, 11732, 23476, 23477, 27235, 27236, 27237, 47874, 47873, 47872, 47875, 47876, 47877);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(6262, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 0/2 Improved Healthstone)'),
+(23468, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 1/2 Improved Healthstone)'),
+(23469, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 2/2 Improved Healthstone)'),
+(6263, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 0/2 Improved Healthstone)'),
+(23470, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 1/2 Improved Healthstone)'),
+(23471, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 2/2 Improved Healthstone)'),
+(5720, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 0/2 Improved Healthstone)'),
+(23472, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 1/2 Improved Healthstone)'),
+(23473, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 2/2 Improved Healthstone)'),
+(5723, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 0/2 Improved Healthstone)'),
+(23474, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 1/2 Improved Healthstone)'),
+(23475, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 2/2 Improved Healthstone)'),
+(11732, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 0/2 Improved Healthstone)'),
+(23476, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 1/2 Improved Healthstone)'),
+(23477, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 2/2 Improved Healthstone)'),
+(27235, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 0/2 Improved Healthstone)'),
+(27236, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 1/2 Improved Healthstone)'),
+(27237, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 2/2 Improved Healthstone)'),
+(47874, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 0/2 Improved Healthstone)'),
+(47873, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 1/2 Improved Healthstone)'),
+(47872, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 2/2 Improved Healthstone)'),
+(47875, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 0/2 Improved Healthstone)'),
+(47876, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 1/2 Improved Healthstone)'),
+(47877, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 2/2 Improved Healthstone)');
diff --git a/sql/old/3.3.5a/2012_06_14_03_world_spell_ranks.sql b/sql/old/3.3.5a/2012_06_14_03_world_spell_ranks.sql
new file mode 100644
index 00000000000..f6641f2f095
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_03_world_spell_ranks.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_ranks` WHERE `first_spell_id`=64694;
+INSERT INTO `spell_ranks` (`first_spell_id`,`spell_id`,`rank`) VALUES
+(64694,64694,1),
+(64694,65263,2),
+(64694,65264,3);
diff --git a/sql/old/3.3.5a/2012_06_14_04_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_14_04_world_spell_script_names.sql
new file mode 100644
index 00000000000..00ceb1df9e9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_04_world_spell_script_names.sql
@@ -0,0 +1,62 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (-633,781,-746,1515,6495,-8050,-16972,31789,-34914,-44457,-48181,-30108,34438,34439,35183,43522,65812,68154,68155,68156,52610,61336,-33763,40133,40132,43421,52551,53608,57762,59990,66093,67957,67958,67959,7057,28832,28833,28834,28835,27831,55638,31447,32960,33654,33671,50810,61546,50811,61547,52942,59837,63322,47977,48025,54729,71342,72286,74856,75614,75973);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-633, 'spell_pal_lay_on_hands'),
+(781, 'spell_hun_disengage'),
+(-746, 'spell_gen_bandage'),
+(1515, 'spell_hun_tame_beast'),
+(6495, 'spell_sha_sentry_totem'),
+(-8050, 'spell_sha_flame_shock'),
+(-16972,'spell_dru_predatory_strikes'),
+(31789, 'spell_pal_righteous_defense'),
+(-34914,'spell_pri_vampiric_touch'),
+(-44457,'spell_mage_living_bomb'),
+(-48181,'spell_warl_haunt'),
+(-30108,'spell_warl_unstable_affliction'),
+(34438, 'spell_warl_unstable_affliction'), -- using class spell script for generic spell because it uses class spell effect
+(34439, 'spell_warl_unstable_affliction'),
+(35183, 'spell_warl_unstable_affliction'),
+(43522, 'spell_hexlord_unstable_affliction'),
+(65812, 'spell_faction_champion_warl_unstable_affliction'),
+(68154, 'spell_faction_champion_warl_unstable_affliction'),
+(68155, 'spell_faction_champion_warl_unstable_affliction'),
+(68156, 'spell_faction_champion_warl_unstable_affliction'),
+(52610, 'spell_dru_savage_roar'),
+(61336, 'spell_dru_survival_instincts'),
+(-33763,'spell_dru_lifebloom'),
+(40133, 'spell_gen_summon_fire_elemental'),
+(40132, 'spell_gen_summon_earth_elemental'),
+(43421, 'spell_hexlord_lifebloom'),
+(52551, 'spell_tur_ragepaw_lifebloom'),
+(53608, 'spell_cenarion_scout_lifebloom'),
+(57762, 'spell_twisted_visage_lifebloom'),
+(59990, 'spell_twisted_visage_lifebloom'),
+(66093, 'spell_faction_champion_dru_lifebloom'),
+(67957, 'spell_faction_champion_dru_lifebloom'),
+(67958, 'spell_faction_champion_dru_lifebloom'),
+(67959, 'spell_faction_champion_dru_lifebloom'),
+(7057, 'spell_shadowfang_keep_haunting_spirits'),
+(28832, 'spell_four_horsemen_mark'),
+(28833, 'spell_four_horsemen_mark'),
+(28834, 'spell_four_horsemen_mark'),
+(28835, 'spell_four_horsemen_mark'),
+(27831, 'spell_gothik_shadow_bolt_volley'),
+(55638, 'spell_gothik_shadow_bolt_volley'),
+(31447, 'spell_mark_of_kazrogal'),
+(32960, 'spell_mark_of_kazzak'),
+(33654, 'spell_gruul_shatter'),
+(33671, 'spell_gruul_shatter_effect'),
+(50810, 'spell_krystallus_shatter'),
+(61546, 'spell_krystallus_shatter'),
+(50811, 'spell_krystallus_shatter_effect'),
+(61547, 'spell_krystallus_shatter_effect'),
+(52942, 'spell_loken_pulsing_shockwave'),
+(59837, 'spell_loken_pulsing_shockwave'),
+(63322, 'spell_general_vezax_saronite_vapors'),
+(47977, 'spell_magic_broom'),
+(48025, 'spell_headless_horseman_mount'),
+(54729, 'spell_winged_steed_of_the_ebon_blade'),
+(71342, 'spell_big_love_rocket'),
+(72286, 'spell_invincible'),
+(74856, 'spell_blazing_hippogryph'),
+(75614, 'spell_celestial_steed'),
+(75973, 'spell_x53_touring_rocket');
diff --git a/sql/old/3.3.5a/2012_06_14_05_world_spelldifficulty_dbc.sql b/sql/old/3.3.5a/2012_06_14_05_world_spelldifficulty_dbc.sql
new file mode 100644
index 00000000000..1f218027f91
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_05_world_spelldifficulty_dbc.sql
@@ -0,0 +1,6 @@
+SET @DIFF := 3268; -- set by TDB team
+DELETE FROM `spelldifficulty_dbc` WHERE `id` BETWEEN @DIFF+0 AND @DIFF+2;
+INSERT INTO `spelldifficulty_dbc` (`id`,`spellid0`,`spellid1`,`spellid2`,`spellid3`) VALUES
+(@DIFF+0,50811,61547,0,0),
+(@DIFF+1,57762,59990,0,0),
+(@DIFF+2,57763,61489,0,0);
diff --git a/sql/old/3.3.5a/2012_06_14_06_world_conditions.sql b/sql/old/3.3.5a/2012_06_14_06_world_conditions.sql
new file mode 100644
index 00000000000..43d422e9239
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_06_world_conditions.sql
@@ -0,0 +1,7 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (19938,30877);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,19938,0,0,1,1,17743,0,0,0,0,'','Awaken Peon'),
+(17,0,30877,0,0,31,1,3,17326,0,0,0,'','Tag Murloc');
+
+-- Lifebinder's Gift
+UPDATE `conditions` SET `SourceGroup`=7 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62584,64185);
diff --git a/sql/old/3.3.5a/2012_06_14_07_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_06_14_07_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..aa9c1b732c4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_07_world_spell_bonus_data.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_bonus_data` WHERE `entry`=63544;
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(63544,0,0,0,0,'Priest - Empowered Renew');
diff --git a/sql/old/3.3.5a/2012_06_14_08_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_14_08_world_spell_script_names.sql
new file mode 100644
index 00000000000..a9faa529143
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_08_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=-139;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-139,'spell_priest_renew');
diff --git a/sql/old/3.3.5a/2012_06_14_09_world_sai.sql b/sql/old/3.3.5a/2012_06_14_09_world_sai.sql
new file mode 100644
index 00000000000..3beb7c06326
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_09_world_sai.sql
@@ -0,0 +1,45 @@
+-- Fix up quest 9539 "Totem of Coo"
+-- Totem of Akida SAI
+SET @ENTRY := 17360;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,19,0,100,0,9539,0,0,0,85,30437,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Akida - Quest accepted - Cast Spell on player');
+-- Stillpine Ancestor Akida SAI
+SET @ENTRY := 17379;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Just Summoned - Run Script'),
+-- Script
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16995,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - set model'),
+(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - turn to player'),
+(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Akida - Script - Cast Spell'),
+(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - Set run on'),
+(@ENTRY*100,9,4,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - say 0'),
+(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4154.224,-12514.75,45.35527,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,6,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4123.563,-12517.23,44.9127,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,7,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4091.881,-12524,42.37354,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,8,0,0,0,100,0,5500,5500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4058.039,-12538.57,43.96096,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,9,0,0,0,100,0,4500,4500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4026.534,-12568.4,45.82222,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4000.155,-12598.55,54.19722,0,'Stillpine Ancestor Akida - Script - move to'), --
+(@ENTRY*100,9,11,0,0,0,100,0,7500,7500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3977.5,-12627.22,63.1442,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,12,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3952.254,-12660.37,74.23783,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,13,0,0,0,100,0,6500,6500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3933.183,-12698.27,85.65151,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,14,0,0,0,100,0,4500,4500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3925.843,-12718.81,89.94553,0,'Stillpine Ancestor Akida - Script - move to'), --
+(@ENTRY*100,9,15,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3915.914,-12743.41,98.56779,0,'Stillpine Ancestor Akida - Script - move to'),
+(@ENTRY*100,9,16,0,0,0,100,0,4500,4500,0,0,66,0,0,0,0,0,0,19,17361,10,0,0,0,0,0,'Stillpine Ancestor Akida - Script - turn to Totem of Coo'),
+(@ENTRY*100,9,17,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - say 1'),
+(@ENTRY*100,9,18,0,0,0,100,0,3000,3000,0,0,11,30428,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - cast spell'),
+(@ENTRY*100,9,19,0,0,0,100,0,1000,1000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - despawn');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=17379;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17379,0,0, '%s urges you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Akida'),
+(17379,1,0, '%s points to the totem of Coo.',16,0,100,25,0,0, 'Stillpine Ancestor Akida');
+-- add missing spells to db
+DELETE FROM `spell_dbc` WHERE `Id` IN (30426,30437);
+INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES
+(30426,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,15,0,0,0,4,0,0,0,0,0,0,0,17379,0,0,0,0,0,'Stillpine Ancestor Akida',0,0,0,0,0,0,0,1,1,0,64),
+(30437,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30426,0,0,'Stillpine Ancestor Akida TRIGGER',0,0,0,0,0,0,0,1,0,0,0);
diff --git a/sql/old/3.3.5a/2012_06_14_10_world_eai.sql b/sql/old/3.3.5a/2012_06_14_10_world_eai.sql
new file mode 100644
index 00000000000..355646fbd69
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_10_world_eai.sql
@@ -0,0 +1,2 @@
+-- Remove Stillpine Ancestor Akida EAI
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17379;
diff --git a/sql/old/3.3.5a/2012_06_14_11_world_sai.sql b/sql/old/3.3.5a/2012_06_14_11_world_sai.sql
new file mode 100644
index 00000000000..1d01b02f86b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_14_11_world_sai.sql
@@ -0,0 +1,48 @@
+-- Fix up quest 9540 "Totem of Tikti"
+-- Totem of Coo SAI
+SET @ENTRY := 17361;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,19,0,100,0,9540,0,0,0,85,30442,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Coo - Quest accepted - Cast Spell on player');
+-- Stillpine Ancestor Coo SAI
+SET @ENTRY := 17391;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Just Summoned - Run Script'),
+-- Script
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16995,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - set model'),
+(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - turn to player'),
+(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Coo - Script - Cast Spell'),
+(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 0'),
+(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.039,-12746.71,96.06779,0,'Stillpine Ancestor Coo - Script - move to'),
+(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.326,-12753.71,98.44279,0,'Stillpine Ancestor Coo - Script - move to'),
+(@ENTRY*100,9,6,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3924.268,-12761.45,101.6928,0,'Stillpine Ancestor Coo - Script - move to'),
+(@ENTRY*100,9,7,0,0,0,100,0,6000,6000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 1'),
+(@ENTRY*100,9,8,0,0,0,100,0,4000,4000,0,0,11,30424,0,0,0,0,0,7,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Coo - Script - Cast Spell'),
+(@ENTRY*100,9,9,0,0,0,100,0,1000,1000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 2'),
+(@ENTRY*100,9,10,0,0,0,100,0,4000,4000,0,0,11,30473,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - cast spell'),
+(@ENTRY*100,9,11,0,0,0,100,0,0,0,0,0,3,0,17019,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - set model'),
+(@ENTRY*100,9,12,0,0,0,100,0,3000,3000,0,0,60,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - Fly on'),
+(@ENTRY*100,9,13,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.068,-12767.33,104.3799,0,'Stillpine Ancestor Coo - Script - move to'),
+(@ENTRY*100,9,14,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3923.497,-12794.98,98.46323,0,'Stillpine Ancestor Coo - Script - move to'),
+(@ENTRY*100,9,15,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3922.687,-12832.4,89.24097,0,'Stillpine Ancestor Coo - Script - move to'),
+(@ENTRY*100,9,16,0,0,0,100,0,8000,8000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - despawn');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=17391;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17391,0,0, '%s motions for you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Coo'),
+(17391,1,0, '[Furbolg] Ritk kin''chikx azul azure summit...',12,0,100,0,0,0, 'Stillpine Ancestor Coo'),
+(17391,2,0, '[Furbolg] Coo xip fly... Jump ilos river. Find Tikti.',12,0,100,0,0,0, 'Stillpine Ancestor Coo');
+-- add missing spells to db
+DELETE FROM `spell_dbc` WHERE `Id` IN (30429,30442);
+INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES
+(30429,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17391,0,0,0,0,0,'Stillpine Ancestor Coo',0,0,0,0,0,0,0,1,1,0,64),
+(30442,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30429,0,0,'Stillpine Ancestor Coo TRIGGER',0,0,0,0,0,0,0,1,0,0,0);
+-- Delete bad spawn of Stillpine Ancestor Coo
+DELETE FROM `creature` WHERE `guid`=86512;
+DELETE FROM `creature_addon` WHERE `guid`=86512;
+-- Remove Stillpine Ancestor Akida EAI
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17391;
diff --git a/sql/old/3.3.5a/2012_06_15_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_15_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..040ad3c87ba
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_15_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` = 27819;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(27819, 'spell_kelthuzad_detonate_mana');
diff --git a/sql/old/3.3.5a/2012_06_15_01_world_sai.sql b/sql/old/3.3.5a/2012_06_15_01_world_sai.sql
new file mode 100644
index 00000000000..501c3aa1c40
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_15_01_world_sai.sql
@@ -0,0 +1,32 @@
+-- Fix up quest 9544 "The Prophecy of Akida"
+-- Totem of Vark SAI
+SET @ENTRY := 17364;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+UPDATE `creature_template_addon` SET `bytes2`=1,`auras`='18950' WHERE `entry`=17364;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,19,0,100,0,9544,0,0,0,85,30453,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Vark - Quest accepted - Cast Spell on player');
+-- Stillpine Ancestor Vark SAI
+SET @ENTRY := 17410;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Just Summoned - Run Script'),
+-- Script
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,17109,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - set model'),
+(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Vark - Script - Cast Spell'),
+(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - Set run on'),
+(@ENTRY*100,9,3,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - turn to player'),
+(@ENTRY*100,9,4,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - say 0'),
+(@ENTRY*100,9,5,0,0,0,100,0,8000,8000,0,0,11,30428,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - cast spell'),
+(@ENTRY*100,9,6,0,0,0,100,0,3000,3000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - despawn');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=17410;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17410,0,0, '[Furbolg] Bear witness to the savage acts of our adversaries, $N. They steal our young... our weak... Imprisoned here, they are left to the devices of the Bristlelimb. Set them free, Promised One!',12,0,100,0,0,0, 'Stillpine Ancestor Vark');
+-- add missing spells to db
+DELETE FROM `spell_dbc` WHERE `Id` IN (30453,30454);
+INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES
+(30454,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17410,0,0,0,0,0,'Stillpine Ancestor Vark',0,0,0,0,0,0,0,1,1,0,64),
+(30453,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30454,0,0,'Stillpine Ancestor Vark TRIGGER',0,0,0,0,0,0,0,1,0,0,0);
diff --git a/sql/old/3.3.5a/2012_06_15_02_world_sai.sql b/sql/old/3.3.5a/2012_06_15_02_world_sai.sql
new file mode 100644
index 00000000000..f813ae2996b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_15_02_world_sai.sql
@@ -0,0 +1,44 @@
+-- Fix up quest 9312 "The Emitter"
+-- Technician Zhanaa SAI
+SET @ENTRY := 17071;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,20,0,100,0,9312,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Quest Completed - Run Script'),
+-- Script
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - Remove npc flags'),
+(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,9,0,0,0,0,0,0,20,181286,0,0,0,0,0,0,'Technician Zhanaa - Script - Activate go'),
+(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,12,16550,1,39000,0,0,0,8,0,0,0,-4187.708,-13738.72,75.65491,1.850049,'Technician Zhanaa - Script - Spawn '),
+(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,64,2,0,0,0,0,0,7,0,0,0,0,0,0,0,'Technician Zhanaa - Script - store invoker'), -- Send target
+(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,100,2,0,0,0,0,0,19,16550,10,0,0,0,0,0,'Technician Zhanaa - Script - send target'), -- Send target
+(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,45,0,1,0,0,0,0,19,16550,10,0,0,0,0,0,'Technician Zhanaa - Script - set data'),
+(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,16550,10,0,0,0,0,0,'Technician Zhanaa - Script - turn to Image of Technician Dyvuun'),
+(@ENTRY*100,9,7,0,0,0,100,0,2000,2000,0,0,5,70,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - emote'),
+(@ENTRY*100,9,8,0,0,0,100,0,39000,39000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Technician Zhanaa - Script - turn to invoker'),
+(@ENTRY*100,9,9,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - Say 0'),
+(@ENTRY*100,9,10,0,0,0,100,0,6000,6000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.919862,'Technician Zhanaa - Script - turn to'),
+(@ENTRY*100,9,11,0,0,0,100,0,1000,1000,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - add npc flags');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@ENTRY,0,0, 'This is great news! Your efforts have indeed saved us, $N!',12,0,100,0,0,0, 'Technician Zhanaa');
+-- Image of Technician Dyvuun SAI
+SET @ENTRY := 16550;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='',`InhabitType`=4 WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,38,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - On data set - Run Script'),
+-- Script
+(@ENTRY*100,9,0,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,19,17071,10,0,0,0,0,0,'Image of Technician Dyvuun - Script - turn to Technician Zhanaa'),
+(@ENTRY*100,9,1,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - Say 0'),
+(@ENTRY*100,9,2,0,0,0,100,0,10000,10000,0,0,66,0,0,0,0,0,0,12,2,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - turn to Stored target'), -- use target
+(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - Say 1'),
+(@ENTRY*100,9,4,0,0,0,100,0,5000,5000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - Say 2');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@ENTRY,0,0, 'By the seven Ata''mal crystals! Others have survived the crash! Zhanaa, is that you? It is so good to see you again!',12,0,100,0,0,0, 'Image of Technician Dyvuun'),
+(@ENTRY,1,0, 'And who do we have here? No doubt th... crzzzk ...ade this communication possible? I give you greetings fro... psshzzzk... Azure Watch.',12,0,100,0,0,0, 'Image of Technician Dyvuun'),
+(@ENTRY,2,0, 'Judging by your signal, we put you... ust southeast of the larger part of the island we crashed onto. Cross the Crystalbrook River to ge... kshhhhk zzzt. Sorry, there''s a lot of stat...',12,0,100,0,0,0, 'Image of Technician Dyvuun');
diff --git a/sql/old/3.3.5a/2012_06_16_00_world_sai.sql b/sql/old/3.3.5a/2012_06_16_00_world_sai.sql
new file mode 100644
index 00000000000..a714e498bc9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_16_00_world_sai.sql
@@ -0,0 +1,46 @@
+-- Fix up quest 9541 "Totem of Yor"
+-- Totem of Tikti SAI
+SET @ENTRY := 17362;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,19,0,100,0,9541,0,0,0,85,30443,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Tikti - Quest accepted - Cast Spell on player');
+-- Stillpine Ancestor Tikti SAI
+SET @ENTRY := 17392;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Just Summoned - Run Script'),
+-- Script
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16999,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - set model'),
+(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - turn to player'),
+(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Cast Spell'),
+(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Set run on'),
+(@ENTRY*100,9,4,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - say 0'),
+(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,-3885.665,-13096.55,3.563835,0,'Stillpine Ancestor Tikti - Script - move to'),
+(@ENTRY*100,9,6,0,0,0,100,0,16000,16000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - say 1'),
+(@ENTRY*100,9,7,0,0,0,100,0,6000,6000,0,0,11,30430,2,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Cast Spell on player'),
+(@ENTRY*100,9,8,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - say 2'),
+(@ENTRY*100,9,9,0,0,0,100,0,1000,1000,0,0,11,30431,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Cast Spell'),
+(@ENTRY*100,9,10,0,0,0,100,0,0,0,0,0,3,0,17000,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - set model'),
+(@ENTRY*100,9,11,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3939.131,-13024.07,-5.92465,0,'Stillpine Ancestor Tikti - Script - move to'),
+(@ENTRY*100,9,12,0,0,0,100,0,25000,25000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - despawn');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=17392;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17392,0,0, '%s asks you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Tikti'),
+(17392,1,0, '[Furbolg] Far you mixik tak come. Gaze upon the kitch''kal river. Follow. Ilog to Yor.',12,0,100,0,0,0, 'Stillpine Ancestor Tikti'),
+(17392,2,0, '[Furbolg] Go... Search yitix''kil bottom river. South!',12,0,100,0,0,0, 'Stillpine Ancestor Tikti');
+-- add missing spells to db
+DELETE FROM `spell_dbc` WHERE `Id` IN (30432,30443);
+INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES
+(30432,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17392,0,0,0,0,0,'Stillpine Ancestor Tikti',0,0,0,0,0,0,0,1,1,0,64),
+(30443,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30432,0,0,'Stillpine Ancestor Tikti TRIGGER',0,0,0,0,0,0,0,1,0,0,0);
+-- Delete bad spawn of Stillpine Ancestor Tikti
+DELETE FROM `creature` WHERE `guid`=86513;
+DELETE FROM `creature_addon` WHERE `guid`=86513;
+-- Remove Stillpine Ancestor Tikti EAI
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17392;
+-- Remove Hack from quest_template
+UPDATE `quest_template` SET `SourceSpellId`=0 WHERE `Id`=9541;
diff --git a/sql/old/3.3.5a/2012_06_16_01_world_creature.sql b/sql/old/3.3.5a/2012_06_16_01_world_creature.sql
new file mode 100644
index 00000000000..d44b568f79b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_16_01_world_creature.sql
@@ -0,0 +1,6 @@
+-- Add missing Storm Totem spawn to Borean Tundra
+SET @GUID := 12925;
+DELETE FROM `creature` WHERE `guid`=@GUID;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@GUID,26048,571,1,1,0,0,3409.903,4128.829,18.13754,5.742133,300,0,0,1,0,0);
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|16777216 WHERE `entry`=26048;
diff --git a/sql/old/3.3.5a/2012_06_17_00_world_creature.sql b/sql/old/3.3.5a/2012_06_17_00_world_creature.sql
new file mode 100644
index 00000000000..53e101c5d60
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_17_00_world_creature.sql
@@ -0,0 +1,3 @@
+-- Fix Storm Totem flags
+UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry`=26048;
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`&~16777216 WHERE `entry`=26048;
diff --git a/sql/old/3.3.5a/2012_06_17_01_world_creature.sql b/sql/old/3.3.5a/2012_06_17_01_world_creature.sql
new file mode 100644
index 00000000000..c5d50fdde1e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_17_01_world_creature.sql
@@ -0,0 +1,4 @@
+-- Add aura missing aura to Nerub'ar Scarab
+DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM creature WHERE id=25652);
+DELETE FROM `creature_template_addon` WHERE `entry`=25652;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (25652,1,'45814');
diff --git a/sql/old/3.3.5a/2012_06_17_02_world_creature.sql b/sql/old/3.3.5a/2012_06_17_02_world_creature.sql
new file mode 100644
index 00000000000..a309ada3498
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_17_02_world_creature.sql
@@ -0,0 +1,9 @@
+-- Add missing Gan'jo spawn to Grizzly Hills
+SET @GUID := 42187;
+SET @ENTRY := 26924;
+DELETE FROM `creature` WHERE `guid`=@GUID;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@GUID,@ENTRY,571,1,2,0,0,4834.98,-4754.5,32.5689,3.97935,180,0,0,1,0,0);
+-- Add Aura to Gan'jo
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'17327');
diff --git a/sql/old/3.3.5a/2012_06_18_00_world_creature.sql b/sql/old/3.3.5a/2012_06_18_00_world_creature.sql
new file mode 100644
index 00000000000..23538c33f73
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_18_00_world_creature.sql
@@ -0,0 +1,26 @@
+SET @CGUID := 88615;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+00 AND @CGUID+22;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES
+(@CGUID+00,39190,631,12,1,505.1563,-2536.863,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+01,39190,631,12,1,502.6493,-2531.328,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+02,39190,631,12,1,503.8246,-2508.141,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+03,39190,631,12,1,495.3629,-2538.215,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+04,39190,631,12,1,506.8715,-2515.552,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+05,39190,631,12,1,481.3021,-2509.222,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+06,39190,631,12,1,481.5382,-2527.332,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+07,39190,631,12,1,500.0807,-2523.289,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+08,39190,631,12,1,486.6632,-2517.747,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+09,39190,631,12,1,513.8802,-2511.795,1069.596,0,10,10,1), -- Wicked Spirit
+(@CGUID+10,39190,631,12,1,499.6406,-2500.783,1069.656,0,10,10,1), -- Wicked Spirit
+(@CGUID+11,39190,631,12,1,513.7101,-2530.931,1069.596,0,10,10,1), -- Wicked Spirit
+(@CGUID+12,39190,631,12,1,502.6811,-2522.542,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+13,39190,631,12,1,518.7483,-2521.240,1069.596,0,10,10,1), -- Wicked Spirit
+(@CGUID+14,39190,631,12,1,478.9774,-2517.446,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+15,39190,631,12,1,489.0104,-2538.535,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+16,39190,631,12,1,511.6320,-2522.373,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+17,39190,631,12,1,500.8976,-2527.198,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+18,39190,631,12,1,484.7934,-2533.592,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+19,39190,631,12,1,490.4132,-2504.323,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+20,39190,631,12,1,485.0298,-2527.724,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+21,39190,631,12,1,494.2899,-2511.384,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+22,39190,631,12,1,491.7170,-2532.490,1069.598,0,10,10,1); -- Wicked Spirit
diff --git a/sql/old/3.3.5a/2012_06_18_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_18_01_world_spell_script_names.sql
new file mode 100644
index 00000000000..5f227a887d7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_18_01_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` = 23880;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(23880, 'spell_warr_bloodthirst_heal');
diff --git a/sql/old/3.3.5a/2012_06_18_02_world_sai.sql b/sql/old/3.3.5a/2012_06_18_02_world_sai.sql
new file mode 100644
index 00000000000..0c036d3d5f0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_18_02_world_sai.sql
@@ -0,0 +1,41 @@
+-- Fix quest 11895 "Master the Storm"
+-- Storm Totem SAI
+SET @ENTRY := 26048;
+UPDATE `creature_template` SET `npcflag`=`npcflag`&~16777216,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - set npcflag'),
+(@ENTRY,0,1,2,73,0,100,0,0,0,0,0,12,26045,2,300000,0,0,0,8,0,0,0,3403.829,4133.074,18.13754,5.759586,'Storm Totem - On Spellclick - Spawn Storm Tempest'),
+(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - remove npcflag');
+-- Storm Tempest SAI
+SET @ENTRY := 26045;
+UPDATE `creature_template` SET `unit_flags`=0,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=26045;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,63,0,100,0,0,0,0,0,11,8609,2,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - cast aura'),
+(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,12,23837,2,120000,0,0,0,8,0,0,0,3403.871,4133.031,18.13754,5.67232,'Storm Totem - OOC - Spawn ELM General Purpose Bunny'),
+(@ENTRY,0,2,0,60,0,100,1,1000,1000,7000,8000,11,40136,2,0,0,0,0,19,23837,5,0,0,0,0,0,'Storm Totem - Update Event - cast aura'),
+(@ENTRY,0,3,4,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - On Aggro - Say 0'),
+(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On Aggro - Prevent combat movement'),
+(@ENTRY,0,5,0,0,0,100,0,0,30,6000,7500,11,15659,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Chain Lightning'),
+(@ENTRY,0,6,0,0,0,100,0,8000,11000,9000,14000,11,31272,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Wind Shock'),
+(@ENTRY,0,7,8,6,0,100,0,0,0,0,0,51,0,0,0,0,0,0,9,23837,0,10,0,0,0,0,'Storm Totem - On death - despawn trigger'),
+(@ENTRY,0,8,9,61,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,19,26048,10,0,0,0,0,0,'Storm Totem - On death - set npc flags on totem'),
+(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,85,46424,2,0,0,0,0,16,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Power of the Storm');
+-- Sage Earth and Sky SAI
+SET @ENTRY := 25982;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,20,0,100,0,11895,0,0,0,28,46424,0,0,0,0,0,7,0,0,0,0,0,0,0,'Sage Earth and Sky - On Quest reward - remove aura from player');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=26045;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(26045,0,0, 'You will not master me, puny $r!',12,0,100,0,0,0, 'Storm Tempest');
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=26048;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22,2,26048,0,0,9,0,11895,0,0,0,0, '', 'Storm Totem - Allow sai action only if quest has been taken'),
+(22,2,26048,0,0,28,0,11895,0,0,1,0, '', 'Storm Totem - Allow sai action only if quest has not been completed');
diff --git a/sql/old/3.3.5a/2012_06_18_03_world_sai.sql b/sql/old/3.3.5a/2012_06_18_03_world_sai.sql
new file mode 100644
index 00000000000..833c64c8d9d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_18_03_world_sai.sql
@@ -0,0 +1,39 @@
+-- Fix Quest 13231 The Broken Front and 13232 Finish Me!
+-- Dying Soldier SAI
+SET @ENTRY := 31304;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,62,0,100,0,10040,0,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'),
+(@ENTRY,0,1,2,62,0,100,0,10040,3,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'),
+(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,3,4,62,0,100,0,10040,1,0,0,85,59226,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Player cast Finish It on npc'),
+(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,6,7,8,0,100,0,59226,0,0,0,11,3240,2,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spellhit - Cast Bloody Explosion on self'),
+(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,33,31312,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Give Kill credit to player');
+-- Update Gossip
+SET @GOSSIP := 10040;
+-- Add conditions for gossip text
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,@GOSSIP,13948,0,28,13231,0,0,0,0,'','Only show gossip text 13948 if player has quest 13231 Complete'),
+(14,@GOSSIP,13948,0,14,13232,0,0,0,0,'','Only show gossip text 13948 if player has quest 13232 Not Taken'),
+(14,@GOSSIP,14035,0,9,13232,0,0,0,0,'','Only show gossip text 14035 if player has quest 13232 active');
+-- Add conditions for gossip options
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,@GOSSIP,0,0,9,13231,0,0,0,0,'','Only show gossip option 0 if player has if player has quest 13231 active'),
+(15,@GOSSIP,1,0,9,13232,0,0,0,0,'','Only show gossip option 1 if player has if player has quest 13232 active'),
+(15,@GOSSIP,3,0,28,13231,0,0,0,0,'','Only show gossip option 3 if player has quest 13231 Complete'),
+(15,@GOSSIP,3,0,14,13232,0,0,0,0,'','Only show gossip option 3 if player has quest 13232 Not Taken');
+-- Update Gossip options
+UPDATE `gossip_menu_option` SET `action_menu_id`=10041 WHERE `menu_id`=10040 AND `id`=0;
+-- Fix npcflags for Dying Soldier
+UPDATE `creature_template` SET `npcflag`=1 WHERE `entry`=31304;
+UPDATE `creature` SET `npcflag`=3 WHERE `guid`=122230;
+UPDATE `creature` SET `npcflag`=0 WHERE `guid`=122233;
+-- Quest conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19,20) AND `SourceEntry`=13232;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(19,0,13232,0,28,13231,0,0,0,0, '', 'Quest 13232 Finish Me! Requires Quest 13231 The Broken Front to be complete'),
+(20,0,13232,0,28,13231,0,0,0,0, '', 'Quest 13232 Finish Me! Requires Quest 13231 The Broken Front to be complete');
diff --git a/sql/old/3.3.5a/2012_06_19_00_world_sai.sql b/sql/old/3.3.5a/2012_06_19_00_world_sai.sql
new file mode 100644
index 00000000000..fdfc5aec5f8
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_19_00_world_sai.sql
@@ -0,0 +1,25 @@
+-- Fix Quest 13231 The Broken Front and 13232 Finish Me!
+-- Dying Soldier SAI
+SET @ENTRY := 31304;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,62,0,100,0,10040,0,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'),
+(@ENTRY,0,1,2,62,0,100,0,10040,3,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Set npcflag'),
+(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,3,4,62,0,100,0,10040,1,0,0,85,59226,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Player cast Finish It on npc'),
+(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,6,7,8,0,100,0,59226,0,0,0,11,3240,2,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spellhit - Cast Bloody Explosion on self'),
+(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,33,31312,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Give Kill credit to player'),
+(@ENTRY,0,8,9,25,0,100,0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spawn - Set npcflag'),
+(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spawn - Set react state'),
+(@ENTRY,0,10,0,19,0,100,0,13232,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Quest accept - Set npcflag');
+-- Creature updates
+UPDATE `creature_template` SET `npcflag`=3,`RegenHealth`=0 WHERE `entry`=31304;
+UPDATE `creature` SET `npcflag`=0 WHERE `guid`=122230;
+UPDATE `creature` SET `curhealth`=37 WHERE `id`=31304;
+
+-- Start Fixing Quest 13228 The Broken Front and 13230 No Mercy!
+-- Creature updates
+UPDATE `creature_template` SET `npcflag`=3,`RegenHealth`=0 WHERE `entry`=31273;
+UPDATE `creature` SET `curhealth`=37 WHERE `id`=31273;
diff --git a/sql/old/3.3.5a/2012_06_19_01_world_gossip.sql b/sql/old/3.3.5a/2012_06_19_01_world_gossip.sql
new file mode 100644
index 00000000000..7800d2a9740
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_19_01_world_gossip.sql
@@ -0,0 +1,161 @@
+-- Creature Gossip_menu_id Update from sniff
+UPDATE `creature_template` SET `gossip_menu_id`=8871 WHERE `entry`=4501; -- Draz'Zilb
+UPDATE `creature_template` SET `gossip_menu_id`=4004 WHERE `entry`=4885; -- Gregor MacVince
+UPDATE `creature_template` SET `gossip_menu_id`=541 WHERE `entry`=4895; -- Smiling Jim
+UPDATE `creature_template` SET `gossip_menu_id`=4122 WHERE `entry`=4900; -- Alchemist Narett
+UPDATE `creature_template` SET `gossip_menu_id`=8840 WHERE `entry`=4921; -- Guard Byron
+UPDATE `creature_template` SET `gossip_menu_id`=1186 WHERE `entry`=4926; -- Krog
+UPDATE `creature_template` SET `gossip_menu_id`=1161 WHERE `entry`=4944; -- Captain Garran Vimes
+UPDATE `creature_template` SET `gossip_menu_id`=5301 WHERE `entry`=4967; -- Archmage Tervosh
+UPDATE `creature_template` SET `gossip_menu_id`=2465 WHERE `entry`=4968; -- Lady Jaina Proudmoore
+UPDATE `creature_template` SET `gossip_menu_id`=8793 WHERE `entry`=5086; -- Captain Wymor
+UPDATE `creature_template` SET `gossip_menu_id`=2916 WHERE `entry`=6546; -- Tabetha
+UPDATE `creature_template` SET `gossip_menu_id`=4091 WHERE `entry`=8141; -- Captain Evencane
+UPDATE `creature_template` SET `gossip_menu_id`=4355 WHERE `entry`=11052; -- Timothy Worthington
+UPDATE `creature_template` SET `gossip_menu_id`=5382 WHERE `entry`=12939; -- Doctor Gustaf VanHowzen
+UPDATE `creature_template` SET `gossip_menu_id`=8761 WHERE `entry`=23567; -- Inspector Tarem
+UPDATE `creature_template` SET `gossip_menu_id`=8788 WHERE `entry`=23568; -- Captain Darill
+UPDATE `creature_template` SET `gossip_menu_id`=8837 WHERE `entry`=23569; -- Renn McGill
+UPDATE `creature_template` SET `gossip_menu_id`=8801 WHERE `entry`=23579; -- Brogg
+UPDATE `creature_template` SET `gossip_menu_id`=8811 WHERE `entry`=23600; -- Apprentice Morlann
+UPDATE `creature_template` SET `gossip_menu_id`=8812 WHERE `entry`=23601; -- Apprentice Garion
+UPDATE `creature_template` SET `gossip_menu_id`=8762 WHERE `entry`=23602; -- Deserter Agitator
+UPDATE `creature_template` SET `gossip_menu_id`=8782 WHERE `entry`=23704; -- Cassa Crimsonwing
+UPDATE `creature_template` SET `gossip_menu_id`=8787 WHERE `entry`=23723; -- Sergeant Lukas
+UPDATE `creature_template` SET `gossip_menu_id`=8830 WHERE `entry`=23797; -- Moxie Steelgrille
+UPDATE `creature_template` SET `gossip_menu_id`=8831 WHERE `entry`=23835; -- Sergeant Amelyn
+UPDATE `creature_template` SET `gossip_menu_id`=8826 WHERE `entry`=23896; -- "Dirty" Michael Crowe
+UPDATE `creature_template` SET `gossip_menu_id`=8835 WHERE `entry`=23949; -- Lieutenant Nath
+UPDATE `creature_template` SET `gossip_menu_id`=8836 WHERE `entry`=23950; -- Lieutenant Khand
+UPDATE `creature_template` SET `gossip_menu_id`=8912 WHERE `entry`=24208; -- "Little" Logok
+UPDATE `creature_template` SET `gossip_menu_id`=9342 WHERE `entry`=26546; -- Ludin Farrow
+
+-- Gossip Menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=541 AND `text_id`=1058;
+DELETE FROM `gossip_menu` WHERE `entry`=1161 AND `text_id`=1793;
+DELETE FROM `gossip_menu` WHERE `entry`=1162 AND `text_id`=1794;
+DELETE FROM `gossip_menu` WHERE `entry`=1186 AND `text_id`=1818;
+DELETE FROM `gossip_menu` WHERE `entry`=1187 AND `text_id`=1819;
+DELETE FROM `gossip_menu` WHERE `entry`=1188 AND `text_id`=1820;
+DELETE FROM `gossip_menu` WHERE `entry`=2465 AND `text_id`=3157;
+DELETE FROM `gossip_menu` WHERE `entry`=2916 AND `text_id`=3590;
+DELETE FROM `gossip_menu` WHERE `entry`=4004 AND `text_id`=5855;
+DELETE FROM `gossip_menu` WHERE `entry`=4091 AND `text_id`=4991;
+DELETE FROM `gossip_menu` WHERE `entry`=4122 AND `text_id`=5049;
+DELETE FROM `gossip_menu` WHERE `entry`=4355 AND `text_id`=5571;
+DELETE FROM `gossip_menu` WHERE `entry`=5301 AND `text_id`=6333;
+DELETE FROM `gossip_menu` WHERE `entry`=5382 AND `text_id`=6414;
+DELETE FROM `gossip_menu` WHERE `entry`=8761 AND `text_id`=11126;
+DELETE FROM `gossip_menu` WHERE `entry`=8762 AND `text_id`=11136;
+DELETE FROM `gossip_menu` WHERE `entry`=8782 AND `text_id`=11224;
+DELETE FROM `gossip_menu` WHERE `entry`=8787 AND `text_id`=11243;
+DELETE FROM `gossip_menu` WHERE `entry`=8788 AND `text_id`=11245;
+DELETE FROM `gossip_menu` WHERE `entry`=8793 AND `text_id`=11264;
+DELETE FROM `gossip_menu` WHERE `entry`=8801 AND `text_id`=11281;
+DELETE FROM `gossip_menu` WHERE `entry`=8811 AND `text_id`=11309;
+DELETE FROM `gossip_menu` WHERE `entry`=8812 AND `text_id`=11311;
+DELETE FROM `gossip_menu` WHERE `entry`=8826 AND `text_id`=11376;
+DELETE FROM `gossip_menu` WHERE `entry`=8830 AND `text_id`=11403;
+DELETE FROM `gossip_menu` WHERE `entry`=8831 AND `text_id`=11406;
+DELETE FROM `gossip_menu` WHERE `entry`=8835 AND `text_id`=11426;
+DELETE FROM `gossip_menu` WHERE `entry`=8836 AND `text_id`=11428;
+DELETE FROM `gossip_menu` WHERE `entry`=8837 AND `text_id`=11432;
+DELETE FROM `gossip_menu` WHERE `entry`=8840 AND `text_id`=11457;
+DELETE FROM `gossip_menu` WHERE `entry`=8871 AND `text_id`=11567;
+DELETE FROM `gossip_menu` WHERE `entry`=8912 AND `text_id`=11797;
+DELETE FROM `gossip_menu` WHERE `entry`=9342 AND `text_id`=12642;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(541,1058),
+(1161,1793),
+(1162,1794),
+(1186,1818),
+(1187,1819),
+(1188,1820),
+(2465,3157),
+(2916,3590),
+(4004,5855),
+(4091,4991),
+(4122,5049),
+(4355,5571),
+(5301,6333),
+(5382,6414),
+(8761,11126),
+(8762,11136),
+(8782,11224),
+(8787,11243),
+(8788,11245),
+(8793,11264),
+(8801,11281),
+(8811,11309),
+(8812,11311),
+(8826,11376),
+(8830,11403),
+(8831,11406),
+(8835,11426),
+(8836,11428),
+(8837,11432),
+(8840,11457),
+(8871,11567),
+(8912,11797),
+(9342,12642);
+
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1161,4122,4355,5382,8761,8762) AND `id`=0;
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1186,8826,8912) AND `id` IN (0,1);
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES
+(1161,0,0,'What have you heard of the Shady Rest Inn?',1,1,1162,0,0,0,''),
+(1186,0,0,'The Burning Inn.',1,1,1187,0,0,0,''),
+(1186,1,0,'Paval Reethe.',1,1,1188,0,0,0,''),
+(4122,0,3,'Train me.',5,16,0,0,0,0,''),
+(4355,0,3,'Train me.',5,16,0,0,0,0,''),
+(5382,0,3,'Train me.',5,16,0,0,0,0,''),
+(8761,0,0,'Can you spread the reflective dust again?',1,1,0,0,0,0,''),
+(8762,0,0,'Your propaganda won''t work on me. Spout your treasonous filth elsewhere, traitor!',1,1,0,0,0,0,''),
+(8826,0,3,'Train me.',5,16,0,0,0,0,''),
+(8826,1,1,'Show me what you have for sale.',3,128,0,0,0,0,''),
+(8912,0,5,'Make this inn your home.',8,65536,0,0,0,0,''),
+(8912,1,1,'I want to browse your goods.',3,128,0,0,0,0,'');
+
+SET @NPC_DESERTER := 23602;
+SET @NPC_INSPECTOR := 23567;
+SET @SPELL_DISCOVERED_SUB := 42219;
+
+-- Insert creature_text from sniff
+DELETE FROM `creature_text` WHERE `entry`=@NPC_DESERTER;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_DESERTER,0,0,'It''s good to see you defending Theramore with pride, friend.',12,7,100,25,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,0,1,'When you''re off duty, let''s go to the inn. I''ll buy a round and we can reminisce about the good old days.',12,7,100,1,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,0,2,'Wouldn''t you like to bring those days back? I have some friends who know just the way to do that...''',12,7,100,1,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,0,'These people will know Admiral Proudmoore for the true hero he was!',12,7,100,5,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,1,'You can''t stop us from exposing the truth about Jaina''s cowardice!',12,7,100,5,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,2,'If you think you can stop us, you''re mistaken, ''friend.''',12,7,100,5,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,3,'It''s people like you who weaken the Alliance and invite the Horde to take away all we''ve fought for!',12,7,100,5,0,0,'Deserter Agitator');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=@SPELL_DISCOVERED_SUB;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8762 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,@SPELL_DISCOVERED_SUB,0,0,31,0,3,23602,0,0,0,'','Spell Discovered (Sub) only targets Deserter Agitator'),
+(15,8762,0,0,0,9,0,11126,0,0,0,0,'','Show gossip option only if player has taken quest 11126');
+
+-- SmartAI
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_INSPECTOR,@NPC_DESERTER) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_DESERTER*100,@NPC_DESERTER*100+1) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC_INSPECTOR,0,0,1,62,0,100,0,8761,0,0,0,11,42169,0,0,0,0,0,7,0,0,0,0,0,0,0,'Inspector Tarem - On Gossip option select - Cast Reflective Dust'),
+(@NPC_INSPECTOR,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Inspector Tarem - On Gossip option select - Close Gossip'),
+
+(@NPC_DESERTER,0,0,0,25,0,100,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On reset - Set faction default'),
+(@NPC_DESERTER,0,1,0,1,0,100,0,0,1,30000,40000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On update OOC - Say line'),
+(@NPC_DESERTER,0,2,3,62,0,100,0,8762,0,0,0,11,42203,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On Gossip option select - Cast Discovered'),
+(@NPC_DESERTER,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On Gossip option select - Close Gossip'),
+(@NPC_DESERTER,0,4,5,8,0,100,0,@SPELL_DISCOVERED_SUB,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Turn to invoker'),
+(@NPC_DESERTER,0,5,6,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Say line'),
+(@NPC_DESERTER,0,6,0,61,0,100,0,0,0,0,0,87,@NPC_DESERTER*100,@NPC_DESERTER*100+1,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Run script'),
+
+(@NPC_DESERTER*100,9,0,0,0,0,100,0,2000,2000,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 0 - Set faction monster'),
+(@NPC_DESERTER*100,9,1,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator''s script 0 - Attack'),
+
+(@NPC_DESERTER*100+1,9,0,0,0,0,100,0,0,0,0,0,83,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Remove npcflag gossip'),
+(@NPC_DESERTER*100+1,9,1,0,0,0,100,0,0,0,0,0,33,@NPC_DESERTER,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Credit'),
+(@NPC_DESERTER*100+1,9,2,0,0,0,100,0,30000,30000,0,0,82,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Add npcflag gossip');
diff --git a/sql/old/3.3.5a/2012_06_19_02_world_misc.sql b/sql/old/3.3.5a/2012_06_19_02_world_misc.sql
new file mode 100644
index 00000000000..32aa493f4f7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_19_02_world_misc.sql
@@ -0,0 +1,98 @@
+-- Add missing spawns
+SET @GUID := 42875;
+SET @ENTRY := 26257;
+DELETE FROM `creature` WHERE `guid` IN (@GUID,@GUID+1);
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@GUID,@ENTRY,571,1,1,0,0,3369.694,2528.735,197.4004,3.490659,180,0,0,1,0,0),
+(@GUID+1,@ENTRY,571,1,1,0,0,3346.363,2534.127,197.4004,4.258604,180,0,0,1,0,0);
+-- Add SAI
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-42875,-42876,-109574,-109575) AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(-42875,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-42875,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'),
+(-42876,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-42876,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'),
+(-109574,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-109574,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'),
+(-109575,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-109575,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim');
+-- Add missing go
+SET @GUID := 325;
+SET @ENTRY := 188448;
+DELETE FROM `gameobject` WHERE `guid` IN (@GUID);
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@GUID,@ENTRY,571,1,1,3346.398,2534.092,197.3171,2.82743,0,0,0.9876881,0.1564362,180,255,1);
+
+-- Pathing for Nexus Guardian
+SET @NPC := 111304;
+SET @PATH := @NPC*10;
+DELETE FROM `creature` WHERE `guid`=@NPC;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@NPC,26276,571,1,1,0,0,3560.472,1769.351,171.9977,1.91463,120,0,0,1,0,2);
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1);
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3560.472,1769.351,171.9977,0,0,0,100,0),
+(@PATH,2,3567.688,1720.065,171.9977,0,0,0,100,0),
+(@PATH,3,3575.305,1671.264,171.9977,0,0,0,100,0),
+(@PATH,4,3614.985,1641.572,171.9977,0,0,0,100,0),
+(@PATH,5,3661.11,1627.888,179.4142,0,0,0,100,0),
+(@PATH,6,3710.721,1625.472,184.0807,0,0,0,100,0),
+(@PATH,7,3758.05,1626.899,186.8029,0,0,0,100,0),
+(@PATH,8,3806.817,1636.863,186.8029,0,0,0,100,0),
+(@PATH,9,3855.013,1638.274,186.8029,0,0,0,100,0),
+(@PATH,10,3893.953,1607.221,186.8029,0,0,0,100,0),
+(@PATH,11,3908.07,1563.533,186.8029,0,0,0,100,0),
+(@PATH,12,3892.732,1516.304,186.8029,0,0,0,100,0),
+(@PATH,13,3853.05,1486.712,186.8029,0,0,0,100,0),
+(@PATH,14,3804.016,1484.734,186.8029,0,0,0,100,0),
+(@PATH,15,3768.95,1518.886,186.8029,0,0,0,100,0),
+(@PATH,16,3741.332,1558.961,193.6083,0,0,0,100,0),
+(@PATH,17,3735.918,1607.949,197.9415,0,0,0,100,0),
+(@PATH,18,3726.846,1656.945,201.9971,0,0,0,100,0),
+(@PATH,19,3706.031,1701.895,208.3303,0,0,0,100,0),
+(@PATH,20,3693.807,1748.982,208.3303,0,0,0,100,0),
+(@PATH,21,3686.946,1791.952,208.3303,0,0,0,100,0),
+(@PATH,22,3684.135,1840.943,208.3303,0,0,0,100,0),
+(@PATH,23,3693.31,1889.799,208.3303,0,0,0,100,0),
+(@PATH,24,3710.331,1936.957,208.3303,0,0,0,100,0),
+(@PATH,25,3708.896,1985.871,203.9415,0,0,0,100,0),
+(@PATH,26,3711.546,2034.778,199.0248,0,0,0,100,0),
+(@PATH,27,3700.25,2079.795,185.8581,0,0,0,100,0),
+(@PATH,28,3671.014,2118.18,175.6918,0,0,0,100,0),
+(@PATH,29,3627.495,2141.961,170.8588,0,0,0,100,0),
+(@PATH,30,3582.266,2162.844,165.0257,0,0,0,100,0),
+(@PATH,31,3536.079,2181.72,161.0814,0,0,0,100,0),
+(@PATH,32,3492.185,2203.827,153.3039,0,0,0,100,0),
+(@PATH,33,3449.847,2227.899,147.0816,0,0,0,100,0),
+(@PATH,34,3411.07,2258.388,138.6929,0,0,0,100,0),
+(@PATH,35,3372.244,2288.043,130.0542,0,0,0,100,0),
+(@PATH,36,3334.966,2320.363,127.8878,0,0,0,100,0),
+(@PATH,37,3302.867,2358.885,123.2211,0,0,0,100,0),
+(@PATH,38,3272.494,2397.996,120.9432,0,0,0,100,0),
+(@PATH,39,3239.637,2434.888,118.8322,0,0,0,100,0),
+(@PATH,40,3212.678,2476.519,116.0821,0,0,0,100,0),
+(@PATH,41,3211.545,2525.56,108.0818,0,0,0,100,0),
+(@PATH,42,3250.958,2578.278,107.5538,0,0,0,100,0),
+(@PATH,43,3293.958,2602.603,107.5538,0,0,0,100,0),
+(@PATH,44,3342.687,2610.276,112.9983,0,0,0,100,0),
+(@PATH,45,3386.911,2594.68,123.2483,0,0,0,100,0),
+(@PATH,46,3415.89,2554.956,128.7483,0,0,0,100,0),
+(@PATH,47,3424.978,2506.423,128.7483,0,0,0,100,0),
+(@PATH,48,3417.17,2457.855,128.7483,0,0,0,100,0),
+(@PATH,49,3403.204,2427.43,128.7483,0,0,0,100,0),
+(@PATH,50,3373.681,2392.189,128.7483,0,0,0,100,0),
+(@PATH,51,3355.053,2347.842,128.7483,0,0,0,100,0),
+(@PATH,52,3358.651,2298.717,128.7483,0,0,0,100,0),
+(@PATH,53,3365.574,2249.818,135.9983,0,0,0,100,0),
+(@PATH,54,3382.769,2202.925,136.9983,0,0,0,100,0),
+(@PATH,55,3406.081,2159.531,144.9981,0,0,0,100,0),
+(@PATH,56,3435.854,2119.649,151.8868,0,0,0,100,0),
+(@PATH,57,3465.756,2080.089,151.8868,0,0,0,100,0),
+(@PATH,58,3482.463,2041.774,142.5257,0,0,0,100,0),
+(@PATH,59,3503.596,1996.099,137.0257,0,0,0,100,0),
+(@PATH,60,3521.709,1951.099,137.0257,0,0,0,100,0),
+(@PATH,61,3531.027,1914.229,150.5535,0,0,0,100,0),
+(@PATH,62,3542.625,1866.008,158.9424,0,0,0,100,0),
+(@PATH,63,3550.662,1817.174,163.9979,0,0,0,100,0);
diff --git a/sql/old/3.3.5a/2012_06_20_00_world_gossip.sql b/sql/old/3.3.5a/2012_06_20_00_world_gossip.sql
new file mode 100644
index 00000000000..b4d61887223
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_20_00_world_gossip.sql
@@ -0,0 +1,132 @@
+-- Insert npc_text from sniff
+DELETE FROM `npc_text` WHERE `ID`=11428;
+INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES
+(11428,'Are you here to relieve me? I''m certain it''s almost time. Well, if you want to relieve me anyway, let me know. I could use a drink or three.','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,12340);
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=23567;
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=23602;
+
+-- Creature Gossip_menu_id Update from sniff
+UPDATE `creature_template` SET `gossip_menu_id`=7981 WHERE `entry`=19217; -- Ravandwyr <Kirin Tor Apprentice>
+UPDATE `creature_template` SET `gossip_menu_id`=7996 WHERE `entry`=19488; -- Custodian Dieworth <Keeper of Kirin'Var>
+UPDATE `creature_template` SET `gossip_menu_id`=7995 WHERE `entry`=19489; -- Lieutenant-Sorcerer Morran
+UPDATE `creature_template` SET `gossip_menu_id`=7991 WHERE `entry`=19569; -- Netherologist Coppernickels <B.O.O.M.>
+UPDATE `creature_template` SET `gossip_menu_id`=7994 WHERE `entry`=19578; -- Bot-Specialist Alley <B.O.O.M.>
+UPDATE `creature_template` SET `gossip_menu_id`=8001 WHERE `entry`=19617; -- Boots <B.O.O.M. Master Mixologist>
+UPDATE `creature_template` SET `gossip_menu_id`=8003 WHERE `entry`=19634; -- Lead Sapper Blastfizzle <B.O.O.M. Sap Foreman>
+UPDATE `creature_template` SET `gossip_menu_id`=8024 WHERE `entry`=19644; -- Image of Archmage Vargoth
+UPDATE `creature_template` SET `gossip_menu_id`=8008 WHERE `entry`=19645; -- Papa Wheeler <B.O.O.M. Mech Tech>
+UPDATE `creature_template` SET `gossip_menu_id`=8030 WHERE `entry`=19709; -- Chief Engineer Trep <B.O.O.M. Engineering>
+UPDATE `creature_template` SET `gossip_menu_id`=8032 WHERE `entry`=19728; -- Mama Wheeler <B.O.O.M. Mech Tech>
+UPDATE `creature_template` SET `gossip_menu_id`=8048 WHERE `entry`=19880; -- Nether-Stalker Khay'ji
+UPDATE `creature_template` SET `gossip_menu_id`=8054 WHERE `entry`=20066; -- Gahruj
+UPDATE `creature_template` SET `gossip_menu_id`=8055 WHERE `entry`=20067; -- Zuben Elgenubi
+UPDATE `creature_template` SET `gossip_menu_id`=8056 WHERE `entry`=20068; -- Zuben Eschamali
+UPDATE `creature_template` SET `gossip_menu_id`=8071 WHERE `entry`=20071; -- Wind Trader Marid
+UPDATE `creature_template` SET `gossip_menu_id`=8063 WHERE `entry`=20092; -- Dealer Hazzin <General Provisioner>
+UPDATE `creature_template` SET `gossip_menu_id`=8068 WHERE `entry`=20110; -- Tyri
+UPDATE `creature_template` SET `gossip_menu_id`=8070 WHERE `entry`=20112; -- Wind Trader Tuluman <Weapon Merchant>
+UPDATE `creature_template` SET `gossip_menu_id`=8084 WHERE `entry`=20194; -- Dealer Dunar <General Provisioner>
+UPDATE `creature_template` SET `gossip_menu_id`=8101 WHERE `entry`=20281; -- Drijya
+UPDATE `creature_template` SET `gossip_menu_id`=8106 WHERE `entry`=20389; -- Lee Sparks <The Taskmaster>
+UPDATE `creature_template` SET `gossip_menu_id`=8107 WHERE `entry`=20393; -- Foreman Sundown
+UPDATE `creature_template` SET `gossip_menu_id`=8120 WHERE `entry`=20448; -- Commander Ameer <The Protectorate>
+UPDATE `creature_template` SET `gossip_menu_id`=8180 WHERE `entry`=20449; -- Researcher Navuud <The Protectorate>
+UPDATE `creature_template` SET `gossip_menu_id`=8183 WHERE `entry`=20450; -- Flesh Handler Viridius
+UPDATE `creature_template` SET `gossip_menu_id`=8126 WHERE `entry`=20463; -- Apprentice Andrethan
+UPDATE `creature_template` SET `gossip_menu_id`=8128 WHERE `entry`=20551; -- Agent Araxes <The Protectorate>
+UPDATE `creature_template` SET `gossip_menu_id`=8231 WHERE `entry`=20810; -- Mehrdad
+UPDATE `creature_template` SET `gossip_menu_id`=8229 WHERE `entry`=20903; -- Protectorate Nether Drake
+UPDATE `creature_template` SET `gossip_menu_id`=8207 WHERE `entry`=20907; -- Professor Dabiri
+UPDATE `creature_template` SET `gossip_menu_id`=8228 WHERE `entry`=20985; -- Captain Saeed
+UPDATE `creature_template` SET `gossip_menu_id`=8308 WHERE `entry`=21493; -- Kablamm Farflinger <Transportation Engineer>
+UPDATE `creature_template` SET `gossip_menu_id`=8542 WHERE `entry`=22427; -- Zarevhi
+UPDATE `creature_template` SET `gossip_menu_id`=8710 WHERE `entry`=23396; -- Krixel Pinchwhistle <Classic Alliance Mail & Plate>
+UPDATE `creature_template` SET `gossip_menu_id`=9781 WHERE `entry`=29145; -- Pulik Swiftsnip <Barber>
+
+-- Gossip Menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=7981 AND `text_id` IN (9826,9828);
+DELETE FROM `gossip_menu` WHERE `entry`=7991 AND `text_id`=9841;
+DELETE FROM `gossip_menu` WHERE `entry`=7994 AND `text_id`=9846;
+DELETE FROM `gossip_menu` WHERE `entry`=7995 AND `text_id`=9847;
+DELETE FROM `gossip_menu` WHERE `entry`=7996 AND `text_id`=9848;
+DELETE FROM `gossip_menu` WHERE `entry`=8001 AND `text_id`=9863;
+DELETE FROM `gossip_menu` WHERE `entry`=8003 AND `text_id`=9869;
+DELETE FROM `gossip_menu` WHERE `entry`=8008 AND `text_id`=9875;
+DELETE FROM `gossip_menu` WHERE `entry`=8024 AND `text_id`=9901;
+DELETE FROM `gossip_menu` WHERE `entry`=8030 AND `text_id`=9916;
+DELETE FROM `gossip_menu` WHERE `entry`=8032 AND `text_id`=9919;
+DELETE FROM `gossip_menu` WHERE `entry`=8048 AND `text_id`=9937;
+DELETE FROM `gossip_menu` WHERE `entry`=8054 AND `text_id`=9947;
+DELETE FROM `gossip_menu` WHERE `entry`=8055 AND `text_id`=9948;
+DELETE FROM `gossip_menu` WHERE `entry`=8056 AND `text_id`=9949;
+DELETE FROM `gossip_menu` WHERE `entry`=8063 AND `text_id`=9959;
+DELETE FROM `gossip_menu` WHERE `entry`=8068 AND `text_id`=9968;
+DELETE FROM `gossip_menu` WHERE `entry`=8070 AND `text_id`=9970;
+DELETE FROM `gossip_menu` WHERE `entry`=8071 AND `text_id`=9971;
+DELETE FROM `gossip_menu` WHERE `entry`=8084 AND `text_id`=9994;
+DELETE FROM `gossip_menu` WHERE `entry`=8101 AND `text_id`=10019;
+DELETE FROM `gossip_menu` WHERE `entry`=8106 AND `text_id`=10031;
+DELETE FROM `gossip_menu` WHERE `entry`=8107 AND `text_id`=10032;
+DELETE FROM `gossip_menu` WHERE `entry`=8120 AND `text_id`=10058;
+DELETE FROM `gossip_menu` WHERE `entry`=8121 AND `text_id`=10061;
+DELETE FROM `gossip_menu` WHERE `entry`=8122 AND `text_id`=10060;
+DELETE FROM `gossip_menu` WHERE `entry`=8123 AND `text_id`=10059;
+DELETE FROM `gossip_menu` WHERE `entry`=8126 AND `text_id`=10064;
+DELETE FROM `gossip_menu` WHERE `entry`=8128 AND `text_id`=10065;
+DELETE FROM `gossip_menu` WHERE `entry`=8180 AND `text_id`=10152;
+DELETE FROM `gossip_menu` WHERE `entry`=8183 AND `text_id`=10179;
+DELETE FROM `gossip_menu` WHERE `entry`=8207 AND `text_id`=10202;
+DELETE FROM `gossip_menu` WHERE `entry`=8228 AND `text_id`=10229;
+DELETE FROM `gossip_menu` WHERE `entry`=8229 AND `text_id`=10230;
+DELETE FROM `gossip_menu` WHERE `entry`=8231 AND `text_id`=10233;
+DELETE FROM `gossip_menu` WHERE `entry`=8308 AND `text_id`=10365;
+DELETE FROM `gossip_menu` WHERE `entry`=8542 AND `text_id`=10687;
+DELETE FROM `gossip_menu` WHERE `entry`=8710 AND `text_id`=10957;
+DELETE FROM `gossip_menu` WHERE `entry`=9781 AND `text_id`=13459;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(7981,9828),(7981, 9826),(7991,9841),(7994,9846),(7995,9847),
+(7996,9848),(8001,9863),(8003,9869),(8008,9875),(8024,9901),
+(8030,9916),(8032,9919),(8048,9937),(8054,9947),(8055,9948),
+(8056,9949),(8063,9959),(8068,9968),(8070,9970),(8071,9971),
+(8084,9994),(8101,10019),(8106,10031),(8107,10032),(8120,10058),
+(8121,10061),(8122,10060),(8123,10059),(8126,10064),(8128,10065),
+(8180,10152),(8183,10179),(8207,10202),(8228,10229),(8229,10230),
+(8231,10233),(8308,10365),(8542,10687),(8710,10957),(9781,13459);
+
+-- Insert npc_text from sniff
+DELETE FROM `npc_text` WHERE `ID` IN (10059,10061);
+INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES
+(10059,'The Ethereum were the ruling class of ethereal on my homeworld of K''aresh. Tragically, we were forced to evacuate K''aresh shortly before the void lord, Dimensius, unleashed his void armies upon the world and utterly decimated all that stood in his way. For this act, the Ethereum vowed vengeance. They have been tracking Dimensius ever since...$B$BThe Protectorate, however, were not a reaction to Dimensius. We were a reaction to Ethereum.','',0,1,0,1,0,1,0,1,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340),
+(10061,'We feel that the Ethereum are as great a threat to our existence as Dimensius. Both must be stopped...','',0,1,0,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340);
+
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8001,8063,8070,8084,8103,8120,8121,8122,8123,8126,8710) AND `id`=0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(8001, 0, 1, 'Boots, what do you have back there that goes down smooth?', 3, 128, 0, 0, 0, 0, ''),
+(8063, 0, 1, 'Dealer Hazzin, what do you have to offer?', 3, 128, 0, 0, 0, 0, ''),
+(8070, 0, 1, 'What do you have to sell, Tuluman?', 3, 128, 0, 0, 0, 0, ''),
+(8084, 0, 1, 'Dealer Dunar, I wish to browse your wares.', 3, 128, 0, 0, 0, 0, ''),
+(8103, 0, 5, 'Make this inn your home.', 8, 65536, 0, 0, 0, 0, ''),
+(8120, 0, 0, 'What are Ethereum?', 1, 1, 8123, 0, 0, 0, ''),
+(8121, 0, 0, 'I think I understand now. Can I help with any of this? The Ethereum and void creatures are a threat to our survival as well.', 1, 1, 8120, 0, 0, 0, ''),
+(8122, 0, 0, 'So what is your purpose?', 1, 1, 8121, 0, 0, 0, ''),
+(8123, 0, 0, 'I don''t understand. What do you mean, Ameer?', 1, 1, 8122, 0, 0, 0, ''),
+(8126, 0, 1, 'I wish to browse your wares.', 3, 128, 0, 0, 0, 0, ''),
+(8710, 0, 1, 'Let me browse your goods.', 3, 128, 0, 0, 0, 0, '');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7981 AND `SourceEntry`=9828;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,7981,9828,0,0,9,0,10173,0,0,0,0,'','Ravandwyr - Show different gossip if player has taken quest 10173');
+
+-- Remove some old script text
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000649 AND -1000641;
+
+-- Add missing loot
+DELETE FROM `creature_loot_template` WHERE `entry`=30524 AND `item`=35490;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(30524,35490,-100,1,0,1,1);
+
+-- Add a missing gossip
+UPDATE `creature_template` SET `gossip_menu_id`=1100 WHERE `entry`=4963;
diff --git a/sql/old/3.3.5a/2012_06_20_01_world_sai.sql b/sql/old/3.3.5a/2012_06_20_01_world_sai.sql
new file mode 100644
index 00000000000..989550de185
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_20_01_world_sai.sql
@@ -0,0 +1,26 @@
+-- Razormaw SAI fixes quest 9689
+SET @ENTRY := 17592;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES (@ENTRY,50331648,1);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,6000,6000,7000,9000,11,31279,0,0,0,0,0,2,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Swipe'),
+(@ENTRY,0,1,0,0,0,100,0,26000,30000,26000,30000,11,8873,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Flame Breath'),
+(@ENTRY,0,2,0,0,0,50,0,12000,12000,12000,12000,11,14100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Terrifying Roar'),
+(@ENTRY,0,3,0,11,0,100,0,0,0,0,0,53,1,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On spawn - Load Path'),
+(@ENTRY,0,4,0,40,0,100,0,10,@ENTRY,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On Reach waypoint - Remove unitflag');
+-- Waypoints for Razormaw
+DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY);
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@ENTRY,1,-1045.958,-12583.85,111.7434, 'Razormaw'),
+(@ENTRY,2,-1045.115,-12583.31,111.7434, 'Razormaw'),
+(@ENTRY,3,-1213.006,-12663.19,200.4278, 'Razormaw'),
+(@ENTRY,4,-1204.485,-12626.66,200.4278, 'Razormaw'),
+(@ENTRY,5,-1204.906,-12599.65,188.7889, 'Razormaw'),
+(@ENTRY,6,-1206.845,-12579.84,173.2892, 'Razormaw'),
+(@ENTRY,7,-1203.169,-12555.49,160.956, 'Razormaw'),
+(@ENTRY,8,-1201.284,-12529.25,134.3167, 'Razormaw'),
+(@ENTRY,9,-1204.178,-12483.84,115.039, 'Razormaw'),
+(@ENTRY,10,-1204.349,-12465.61,104.7762, 'Razormaw'),
+(@ENTRY,11,-1205.651,-12460.52,97.53908, 'Razormaw');
diff --git a/sql/old/3.3.5a/2012_06_20_02_world_gossip.sql b/sql/old/3.3.5a/2012_06_20_02_world_gossip.sql
new file mode 100644
index 00000000000..c20cb99aa4a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_20_02_world_gossip.sql
@@ -0,0 +1,17 @@
+ -- Prince Toreth <Dragon Riders of Loreth'Aran>
+UPDATE `creature_template` SET `gossip_menu_id`=7478 WHERE `entry`=17674;
+-- Creature Gossip_menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=7474 AND `text_id`=9060;
+DELETE FROM `gossip_menu` WHERE `entry`=7475 AND `text_id`=9059;
+DELETE FROM `gossip_menu` WHERE `entry`=7476 AND `text_id`=9058;
+DELETE FROM `gossip_menu` WHERE `entry`=7477 AND `text_id`=9057;
+DELETE FROM `gossip_menu` WHERE `entry`=7478 AND `text_id`=9056;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(7474,9060),(7475, 9059),(7476,9058),(7477,9057),(7478,9056);
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7478,7477,7476,7475) AND `id`=0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(7478,0,0, 'Why do you suffer?',1,1,7477,0,0,0, ''),
+(7477,0,0, 'What is Ysera and how were you blessed?',1,1,7476,0,0,0, ''),
+(7476,0,0, 'Until what?',1,1,7475,0,0,0, ''),
+(7475,0,0, 'So why are you still here?',1,1,7474,0,0,0, '');
diff --git a/sql/old/3.3.5a/2012_06_24_00_world_gossip.sql b/sql/old/3.3.5a/2012_06_24_00_world_gossip.sql
new file mode 100644
index 00000000000..f8aa5213bf4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_24_00_world_gossip.sql
@@ -0,0 +1,296 @@
+-- Conditions for Spell "Stamp Out Bonfire"
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (45437);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+-- Alliance Bonfires
+(13,1,45437,0,0,31,0,5,187564,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,1,31,0,5,187914,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,2,31,0,5,187916,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,3,31,0,5,187917,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,4,31,0,5,187919,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,5,31,0,5,187920,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,6,31,0,5,187921,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,7,31,0,5,187922,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,8,31,0,5,187923,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,9,31,0,5,187924,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,10,31,0,5,187925,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,11,31,0,5,187926,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,12,31,0,5,187927,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,13,31,0,5,187928,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,14,31,0,5,187929,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,15,31,0,5,187930,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,16,31,0,5,187931,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,17,31,0,5,187932,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,18,31,0,5,187933,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,19,31,0,5,187934,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,20,31,0,5,187935,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,21,31,0,5,187936,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,22,31,0,5,187937,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,23,31,0,5,187938,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,24,31,0,5,187939,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,25,31,0,5,187940,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,26,31,0,5,187941,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,27,31,0,5,187942,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,28,31,0,5,187943,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,29,31,0,5,187944,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,30,31,0,5,187945,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,31,31,0,5,187946,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,32,31,0,5,194032,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,33,31,0,5,194035,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,34,31,0,5,194036,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,35,31,0,5,194038,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,36,31,0,5,194040,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,37,31,0,5,194044,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,38,31,0,5,194045,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,39,31,0,5,194049,0,0,0,'','Spell can hit go target'),
+-- Horde Bonfires
+(13,1,45437,0,40,31,0,5,187559,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,41,31,0,5,187947,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,42,31,0,5,187948,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,43,31,0,5,187949,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,44,31,0,5,187950,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,45,31,0,5,187951,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,46,31,0,5,187952,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,47,31,0,5,187953,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,48,31,0,5,187954,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,49,31,0,5,187955,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,50,31,0,5,187956,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,51,31,0,5,187957,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,52,31,0,5,187958,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,53,31,0,5,187959,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,54,31,0,5,187960,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,55,31,0,5,187961,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,56,31,0,5,187962,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,57,31,0,5,187963,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,58,31,0,5,187964,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,59,31,0,5,187965,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,60,31,0,5,187966,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,61,31,0,5,187967,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,62,31,0,5,187968,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,63,31,0,5,187969,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,64,31,0,5,187970,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,65,31,0,5,187971,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,66,31,0,5,187972,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,67,31,0,5,187973,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,68,31,0,5,187974,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,69,31,0,5,187975,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,70,31,0,5,194033,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,71,31,0,5,194034,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,72,31,0,5,194037,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,73,31,0,5,194039,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,74,31,0,5,194042,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,75,31,0,5,194043,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,76,31,0,5,194046,0,0,0,'','Spell can hit go target'),
+(13,1,45437,0,77,31,0,5,194048,0,0,0,'','Spell can hit go target');
+
+-- Add Triggered spell
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=45458;
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(45458,45437,1,'Holiday - Midsummer, Stamp Out Bonfire, Quest Complete triggers Stamp Out Bonfire');
+
+-- Add script to bonfires
+UPDATE `gameobject_template` SET `ScriptName`= 'go_midsummer_bonfire' WHERE `entry` IN (187559,187564,187914,187916,187917,187919,187920,187921,187922,187923,187924,187925,187926,187927,187928,187929,187930,187931,187932,187933,187934,187935,187936,187937,187938,187939,187940,187941,187942,187943,187944,187945,187946,187947,187948,187949,187950,187951,187952,187953,187954,187955,187956,187957,187958,187959,187960,187961,187962,187963,187964,187965,187966,187967,187968,187969,187970,187971,187972,187973,187974,187975,194032,194033,194034,194035,194036,194037,194038,194039,194040,194042,194043,194044,194045,194046,194048,194049);
+
+-- Add gossip to Horde Bonfires
+DELETE FROM `gossip_menu` WHERE `entry` IN (9370,9353,9355,9379,9380,9381,9382,9383,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9371,9372,9373,9374,9375,9376,9377,9378,10228,10231,10232,10235,10236,10239,10241,10242);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(9370,12374),(9353,12374),(9355,12374),(9379,12374),(9380,12374),(9381,12374),(9382,12374),
+(9383,12374),(9356,12374),(9357,12374),(9358,12374),(9359,12374),(9360,12374),(9361,12374),
+(9362,12374),(9363,12374),(9364,12374),(9365,12374),(9366,12374),(9367,12374),(9368,12374),
+(9369,12374),(9371,12374),(9372,12374),(9373,12374),(9374,12374),(9375,12374),(9376,12374),
+(9377,12374),(9378,12374),(10228,12374),(10231,12374),(10232,12374),(10235,12374),(10236,12374),
+(10239,12374),(10241,12374),(10242,12374);
+
+-- Creature Gossip_menu_option inserts for Horde bonfires
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9370,9353,9355,9379,9380,9381,9382,9383,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9371,9372,9373,9374,9375,9376,9377,9378,10228,10231,10232,10235,10236,10239,10241,10242) AND `id`=0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(9370,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9353,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9355,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9379,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9380,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9381,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9382,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9383,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9356,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9357,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9358,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9359,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9360,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9361,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9362,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9363,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9364,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9365,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9366,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9367,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9368,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9369,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9371,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9372,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9373,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9374,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9375,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9376,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9377,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(9378,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10228,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10231,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10232,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10235,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10236,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10239,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10241,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''),
+(10242,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, '');
+
+-- Add conditons for Horde Bonfires
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceEntry`=0 AND `SourceGroup` IN (9370,9353,9355,9379,9380,9381,9382,9383,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9371,9372,9373,9374,9375,9376,9377,9378,10228,10231,10232,10235,10236,10239,10241,10242);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9370,0,0,0,8,0,11581,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9353,0,0,0,8,0,11764,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9355,0,0,0,8,0,11765,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9379,0,0,0,8,0,11766,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9380,0,0,0,8,0,11767,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9381,0,0,0,8,0,11768,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9382,0,0,0,8,0,11769,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9383,0,0,0,8,0,11770,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9356,0,0,0,8,0,11771,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9357,0,0,0,8,0,11772,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9358,0,0,0,8,0,11773,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9359,0,0,0,8,0,11774,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9360,0,0,0,8,0,11775,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9361,0,0,0,8,0,11776,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9362,0,0,0,8,0,11777,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9363,0,0,0,8,0,11778,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9364,0,0,0,8,0,11779,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9365,0,0,0,8,0,11780,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9366,0,0,0,8,0,11781,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9367,0,0,0,8,0,11782,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9368,0,0,0,8,0,11783,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9369,0,0,0,8,0,11784,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9371,0,0,0,8,0,11785,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9372,0,0,0,8,0,11786,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9373,0,0,0,8,0,11787,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9374,0,0,0,8,0,11799,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9375,0,0,0,8,0,11800,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9376,0,0,0,8,0,11801,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9377,0,0,0,8,0,11802,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9378,0,0,0,8,0,11803,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10228,0,0,0,8,0,13441,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10231,0,0,0,8,0,13450,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10232,0,0,0,8,0,13451,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10235,0,0,0,8,0,13453,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10236,0,0,0,8,0,13454,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10239,0,0,0,8,0,13455,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10241,0,0,0,8,0,13457,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10242,0,0,0,8,0,13458,0,0,0,0,'','Show gossip option only if player has quest');
+
+-- Fix required side for Alliance quest
+UPDATE `quest_template` SET `RequiredRaces`=1101 WHERE `Id` IN (11581,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11799,11800,11801,11802,11803,13441,13450,13451,13453,13454,13455,13457,13458);
+
+-- Fix Faction for Horde bonfires
+UPDATE `gameobject_template` SET `faction`=1732 WHERE `entry` IN (187949,187955,187958,187960,187962,187965,187967,187974,194037,194039,194042,194043,194046,194048);
+
+-- Add gossip to Alliance Bonfires
+DELETE FROM `gossip_menu` WHERE `entry` IN (9406,9352,9354,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9407,9408,9409,9410,9411,9412,9413,10227,10230,10233,10234,10237,10238,10240,10243);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(9406,12377),(9352,12377),(9354,12377),(9384,12377),(9385,12377),(9386,12377),(9387,12377),(9388,12377),
+(9389,12377),(9390,12377),(9391,12377),(9392,12377),(9393,12377),(9394,12377),(9395,12377),(9396,12377),
+(9397,12377),(9398,12377),(9399,12377),(9400,12377),(9401,12377),(9402,12377),(9403,12377),(9404,12377),
+(9405,12377),(9407,12377),(9408,12377),(9409,12377),(9410,12377),(9411,12377),(9412,12377),(9413,12377),
+(10227,12377),(10230,12377),(10233,12377),(10234,12377),(10237,12377),(10238,12377),(10240,12377),(10243,12377);
+
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9406,9352,9354,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9407,9408,9409,9410,9411,9412,9413,10227,10230,10233,10234,10237,10238,10240,10243) AND `id`=0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(9406,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9352,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9354,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9384,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9385,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9386,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9387,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9388,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9389,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9390,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9391,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9392,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9393,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9394,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9395,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9396,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9397,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9398,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9399,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9400,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9401,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9402,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9403,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9404,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9405,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9407,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9408,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9409,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9410,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9411,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9412,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(9413,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10227,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10230,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10233,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10234,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10237,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10238,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10240,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''),
+(10243,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, '');
+
+-- Add conditons for Alliance Bonfires
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceEntry`=0 AND `SourceGroup` IN (9406,9352,9354,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9407,9408,9409,9410,9411,9412,9413,10227,10230,10233,10234,10237,10238,10240,10243);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9406,0,0,0,8,0,11580,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9352,0,0,0,8,0,11732,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9354,0,0,0,8,0,11734,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9384,0,0,0,8,0,11735,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9385,0,0,0,8,0,11736,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9386,0,0,0,8,0,11737,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9387,0,0,0,8,0,11738,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9388,0,0,0,8,0,11739,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9389,0,0,0,8,0,11740,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9390,0,0,0,8,0,11741,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9391,0,0,0,8,0,11742,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9392,0,0,0,8,0,11743,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9393,0,0,0,8,0,11744,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9394,0,0,0,8,0,11745,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9395,0,0,0,8,0,11746,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9396,0,0,0,8,0,11747,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9397,0,0,0,8,0,11748,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9398,0,0,0,8,0,11749,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9399,0,0,0,8,0,11750,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9400,0,0,0,8,0,11751,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9401,0,0,0,8,0,11752,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9402,0,0,0,8,0,11753,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9403,0,0,0,8,0,11754,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9404,0,0,0,8,0,11755,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9405,0,0,0,8,0,11756,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9407,0,0,0,8,0,11757,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9408,0,0,0,8,0,11758,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9409,0,0,0,8,0,11759,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9410,0,0,0,8,0,11760,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9411,0,0,0,8,0,11761,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9412,0,0,0,8,0,11762,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,9413,0,0,0,8,0,11763,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10227,0,0,0,8,0,13440,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10230,0,0,0,8,0,13442,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10233,0,0,0,8,0,13443,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10234,0,0,0,8,0,13444,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10237,0,0,0,8,0,13445,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10238,0,0,0,8,0,13446,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10240,0,0,0,8,0,13447,0,0,0,0,'','Show gossip option only if player has quest'),
+(15,10243,0,0,0,8,0,13449,0,0,0,0,'','Show gossip option only if player has quest');
+
+-- Fix required side for Horde quest
+UPDATE `quest_template` SET `RequiredRaces`=690 WHERE `Id` IN (11580,11732,11734,11735,11736,11737,11738,11739,11740,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,13440,13442,13443,13444,13445,13446,13447,13449);
+
+-- Fix Faction for Alliance bonfires
+UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry` IN (187564,187914,187916,187917);
+UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry` BETWEEN 187919 AND 187946;
+UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry` IN (194032,194035,194036,194038,194040,194044,194045,194049);
diff --git a/sql/old/3.3.5a/2012_06_24_01_world_quest.sql b/sql/old/3.3.5a/2012_06_24_01_world_quest.sql
new file mode 100644
index 00000000000..ec0d39b0c62
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_24_01_world_quest.sql
@@ -0,0 +1,167 @@
+DELETE FROM `gameobject_questrelation` WHERE `id` IN (187564,187914,187916,187917,187919,187920,187921,187922,187923,187924,187925,187926,187927,187928,187929,187930,187931,187931,187932,187933,187934,187935,187936,187937,187938,187939,187940,187941,187942,187943,187944,187945,187946,194032,194035,194036,194038,194040,194044,194045,194049);
+INSERT INTO `gameobject_questrelation` (`id`,`quest`) VALUES
+(187564,11580),
+(187914,11732),
+(187916,11734),
+(187917,11735),
+(187919,11736),
+(187920,11737),
+(187921,11738),
+(187922,11739),
+(187923,11740),
+(187924,11741),
+(187925,11742),
+(187926,11743),
+(187927,11744),
+(187928,11745),
+(187929,11746),
+(187930,11747),
+(187931,11748),
+(187932,11749),
+(187933,11750),
+(187934,11751),
+(187935,11752),
+(187936,11753),
+(187937,11754),
+(187938,11755),
+(187939,11756),
+(187940,11757),
+(187941,11758),
+(187942,11759),
+(187943,11760),
+(187944,11761),
+(187945,11762),
+(187946,11763),
+(194032,13440),
+(194035,13442),
+(194036,13443),
+(194038,13444),
+(194040,13445),
+(194044,13446),
+(194045,13447),
+(194049,13449);
+
+DELETE FROM `gameobject_involvedrelation` WHERE `id` IN (187564,187914,187916,187917,187919,187920,187921,187922,187923,187924,187925,187926,187927,187928,187929,187930,187931,187931,187932,187933,187934,187935,187936,187937,187938,187939,187940,187941,187942,187943,187944,187945,187946,194032,194035,194036,194038,194040,194044,194045,194049);
+INSERT INTO `gameobject_involvedrelation` (`id`,`quest`) VALUES
+(187564,11580),
+(187914,11732),
+(187916,11734),
+(187917,11735),
+(187919,11736),
+(187920,11737),
+(187921,11738),
+(187922,11739),
+(187923,11740),
+(187924,11741),
+(187925,11742),
+(187926,11743),
+(187927,11744),
+(187928,11745),
+(187929,11746),
+(187930,11747),
+(187931,11748),
+(187932,11749),
+(187933,11750),
+(187934,11751),
+(187935,11752),
+(187936,11753),
+(187937,11754),
+(187938,11755),
+(187939,11756),
+(187940,11757),
+(187941,11758),
+(187942,11759),
+(187943,11760),
+(187944,11761),
+(187945,11762),
+(187946,11763),
+(194032,13440),
+(194035,13442),
+(194036,13443),
+(194038,13444),
+(194040,13445),
+(194044,13446),
+(194045,13447),
+(194049,13449);
+
+DELETE FROM `gameobject_questrelation` WHERE `id` IN (187559,187947,187948,187949,187950,187951,187952,187953,187954,187955,187956,187957,187958,187959,187960,187961,187962,187963,187964,187965,187966,187967,187968,187969,187970,187971,187972,187973,187974,187975,194033,194034,194037,194039,194042,194043,194046,194048);
+INSERT INTO `gameobject_questrelation` (`id`,`quest`) VALUES
+(187559,11581),
+(187947,11764),
+(187948,11765),
+(187949,11766),
+(187950,11767),
+(187951,11768),
+(187952,11769),
+(187953,11770),
+(187954,11771),
+(187955,11772),
+(187956,11773),
+(187957,11774),
+(187958,11775),
+(187959,11776),
+(187960,11777),
+(187961,11778),
+(187962,11779),
+(187963,11780),
+(187964,11781),
+(187965,11782),
+(187966,11783),
+(187967,11784),
+(187968,11785),
+(187969,11786),
+(187970,11787),
+(187971,11799),
+(187972,11800),
+(187973,11801),
+(187974,11802),
+(187975,11803),
+(194033,13441),
+(194034,13450),
+(194037,13451),
+(194039,13453),
+(194042,13454),
+(194043,13455),
+(194046,13457),
+(194048,13458);
+
+DELETE FROM `gameobject_involvedrelation` WHERE `id` IN (187559,187947,187948,187949,187950,187951,187952,187953,187954,187955,187956,187957,187958,187959,187960,187961,187962,187963,187964,187965,187966,187967,187968,187969,187970,187971,187972,187973,187974,187975,194033,194034,194037,194039,194042,194043,194046,194048);
+INSERT INTO `gameobject_involvedrelation` (`id`,`quest`) VALUES
+(187559,11581),
+(187947,11764),
+(187948,11765),
+(187949,11766),
+(187950,11767),
+(187951,11768),
+(187952,11769),
+(187953,11770),
+(187954,11771),
+(187955,11772),
+(187956,11773),
+(187957,11774),
+(187958,11775),
+(187959,11776),
+(187960,11777),
+(187961,11778),
+(187962,11779),
+(187963,11780),
+(187964,11781),
+(187965,11782),
+(187966,11783),
+(187967,11784),
+(187968,11785),
+(187969,11786),
+(187970,11787),
+(187971,11799),
+(187972,11800),
+(187973,11801),
+(187974,11802),
+(187975,11803),
+(194033,13441),
+(194034,13450),
+(194037,13451),
+(194039,13453),
+(194042,13454),
+(194043,13455),
+(194046,13457),
+(194048,13458);
diff --git a/sql/old/3.3.5a/2012_06_24_02_world_gameobject.sql b/sql/old/3.3.5a/2012_06_24_02_world_gameobject.sql
new file mode 100644
index 00000000000..4894365462e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_24_02_world_gameobject.sql
@@ -0,0 +1,30 @@
+-- Burning Steppes Mid Summer Festival Go Spawns
+SET @OGUID := 17820;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,181302,0,1,1,-8265.07,-2627.144,135.0536,1.989672,0,0,0,1,120,255,1),
+(@OGUID+1,181302,0,1,1,-8263.305,-2627.122,134.5683,2.949595,0,0,0,1,120,255,1),
+(@OGUID+2,181305,0,1,1,-8258.544,-2624.803,133.4996,5.98648,0,0,0,1,120,255,1),
+(@OGUID+3,181306,0,1,1,-8262.327,-2628.302,134.2665,2.007128,0,0,0,1,120,255,1),
+(@OGUID+4,181307,0,1,1,-8257.901,-2625.303,134.469,1.658062,0,0,0,1,120,255,1),
+(@OGUID+5,181355,0,1,1,-8260.892,-2601.407,133.1487,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+6,181355,0,1,1,-8262.448,-2606.505,133.4136,0.2443456,0,0,0,1,120,255,1),
+(@OGUID+7,181355,0,1,1,-8245.146,-2606.867,133.1535,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+8,181355,0,1,1,-8264.143,-2611.291,133.4626,5.201083,0,0,0,1,120,255,1),
+(@OGUID+9,181355,0,1,1,-8246.274,-2611.94,133.1546,4.66003,0,0,0,1,120,255,1),
+(@OGUID+10,181355,0,1,1,-8247.434,-2616.645,133.1546,5.846854,0,0,0,1,120,255,1),
+(@OGUID+11,181355,0,1,1,-8267.189,-2635.668,134.4242,0.1745321,0,0,0,1,120,255,1),
+(@OGUID+12,181355,0,1,1,-8252.989,-2636.582,133.1547,3.211419,0,0,0,1,120,255,1),
+(@OGUID+13,181605,0,1,1,-8261.666,-2638.048,133.3969,5.777041,0,0,0,1,120,255,1),
+(@OGUID+14,187922,0,1,1,-8249.528,-2625.985,133.1546,1.727875,0,0,0,1,120,255,1),
+(@OGUID+15,188020,0,1,1,-8267.534,-2642.816,133.9444,4.555311,0,0,0,1,120,255,1),
+(@OGUID+16,188020,0,1,1,-8256.433,-2643.724,133.1869,4.468043,0,0,0,1,120,255,1),
+(@OGUID+17,188020,0,1,1,-8258.073,-2601.522,133.1487,1.274088,0,0,0,1,120,255,1),
+(@OGUID+18,188020,0,1,1,-8247.378,-2604.626,133.15,1.326448,0,0,0,1,120,255,1),
+(@OGUID+19,188021,0,1,1,-8261.987,-2623.612,133.4952,1.361356,0,0,0,1,120,255,1);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4),
+(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9),
+(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14),
+(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19);
diff --git a/sql/old/3.3.5a/2012_06_24_03_world_gameobject.sql b/sql/old/3.3.5a/2012_06_24_03_world_gameobject.sql
new file mode 100644
index 00000000000..b98ef4b6dbe
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_24_03_world_gameobject.sql
@@ -0,0 +1,28 @@
+-- Chillwind Camp Mid Summer Festival Go Spawns
+SET @OGUID := 17845;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+17;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,181300,0,1,1,945.1077,-1435.984,62.91423,5.288348,0,0,0,1,120,255,1),
+(@OGUID+1,181302,0,1,1,1004.427,-1443.667,62.28303,2.949595,0,0,0,1,120,255,1),
+(@OGUID+2,181302,0,1,1,1004.097,-1446.269,61.98349,1.989672,0,0,0,1,120,255,1),
+(@OGUID+3,181305,0,1,1,1009.866,-1446.948,62.31522,3.490667,0,0,0,1,120,255,1),
+(@OGUID+4,181306,0,1,1,1002.772,-1445.215,62.09951,2.007128,0,0,0,1,120,255,1),
+(@OGUID+5,181307,0,1,1,1009.089,-1446.896,63.24824,1.658062,0,0,0,1,120,255,1),
+(@OGUID+6,181355,0,1,1,995.8973,-1439.065,63.6682,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+7,181355,0,1,1,1010.988,-1450.932,62.06363,4.66003,0,0,0,1,120,255,1),
+(@OGUID+8,181355,0,1,1,988.3309,-1455.517,60.69862,5.846854,0,0,0,1,120,255,1),
+(@OGUID+9,181355,0,1,1,934.7761,-1439.972,63.46706,2.251473,0,0,0,1,120,255,1),
+(@OGUID+10,181605,0,1,1,1002.282,-1432.47,64.05733,5.777041,0,0,0,1,120,255,1),
+(@OGUID+11,187576,0,1,1,973.3299,-1430.872,67.15336,3.141593,0,0,0,1,120,255,1),
+(@OGUID+12,187939,0,1,1,999.0452,-1453.844,60.73637,3.68265,0,0,0,1,120,255,1),
+(@OGUID+13,188020,0,1,1,1011.989,-1434.024,63.98868,6.230826,0,0,0,1,120,255,1),
+(@OGUID+14,188020,0,1,1,1017.408,-1450.234,62.41806,5.166176,0,0,0,1,120,255,1),
+(@OGUID+15,188020,0,1,1,987.117,-1451.32,61.76295,3.717554,0,0,0,1,120,255,1),
+(@OGUID+16,188020,0,1,1,990.5877,-1460.205,60.6304,3.595379,0,0,0,1,120,255,1),
+(@OGUID+17,188021,0,1,1,1006.964,-1448.083,62.19069,5.148723,0,0,0,1,120,255,1);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4),
+(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9),
+(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14),
+(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17);
diff --git a/sql/old/3.3.5a/2012_06_24_04_world_gameobject.sql b/sql/old/3.3.5a/2012_06_24_04_world_gameobject.sql
new file mode 100644
index 00000000000..2fa34ee18c3
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_24_04_world_gameobject.sql
@@ -0,0 +1,30 @@
+-- The Forgotten Coast Alliance Mid Summer Festival Go Spawns
+SET @OGUID := 21003;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,188021,1,1,1,-4398.083,2187.373,12.25118,6.03884,0,0,0,1,120,255,1),
+(@OGUID+1,181302,1,1,1,-4396.901,2188.478,12.71206,2.949595,0,0,0,1,120,255,1),
+(@OGUID+2,181302,1,1,1,-4392.186,2182.861,12.36883,4.694937,0,0,0,1,120,255,1),
+(@OGUID+3,181305,1,1,1,-4396.205,2185.561,12.88021,2.268925,0,0,0,1,120,255,1),
+(@OGUID+4,181306,1,1,1,-4396.394,2190.134,12.45671,2.007128,0,0,0,1,120,255,1),
+(@OGUID+5,181307,1,1,1,-4397.196,2185.575,13.85373,1.658062,0,0,0,1,120,255,1),
+(@OGUID+6,181388,1,1,1,-4273.38,2246.32,10.7598,5.637414,0,0,0,1,120,255,1),
+(@OGUID+7,181355,1,1,1,-4399.59,2167.158,11.20139,5.201083,0,0,0,1,120,255,1),
+(@OGUID+8,181355,1,1,1,-4405.212,2185.207,12.17883,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+9,181355,1,1,1,-4402.662,2193.127,11.89757,5.846854,0,0,0,1,120,255,1),
+(@OGUID+10,181355,1,1,1,-4387.453,2180.198,11.91319,4.66003,0,0,0,1,120,255,1),
+(@OGUID+11,181355,1,1,1,-4385.776,2188.759,11.18229,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+12,181355,1,1,1,-4388.712,2208.042,10.41075,1.186823,0,0,0,1,120,255,1),
+(@OGUID+13,181355,1,1,1,-4289.17,2237.73,9.40999,1.675514,0,0,0,1,120,255,1),
+(@OGUID+14,181605,1,1,1,-4399.495,2171.792,11.82118,5.777041,0,0,0,1,120,255,1),
+(@OGUID+15,187929,1,1,1,-4392.564,2198.469,10.85703,2.460913,0,0,0,1,120,255,1),
+(@OGUID+16,188020,1,1,1,-4408.799,2171.87,12.71528,2.82743,0,0,0,1,120,255,1),
+(@OGUID+17,188020,1,1,1,-4392.096,2168.01,13.40625,6.0912,0,0,0,1,120,255,1),
+(@OGUID+18,188020,1,1,1,-4396.503,2207.885,9.430555,2.775069,0,0,0,1,120,255,1),
+(@OGUID+19,188020,1,1,1,-4382.582,2200.814,9.956597,5.829401,0,0,0,1,120,255,1);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4),
+(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9),
+(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14),
+(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19);
diff --git a/sql/old/3.3.5a/2012_06_25_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_25_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..51f3e19f5bc
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_25_00_world_spell_script_names.sql
@@ -0,0 +1 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` = -66188;
diff --git a/sql/old/3.3.5a/2012_06_25_01_world_gameobject.sql b/sql/old/3.3.5a/2012_06_25_01_world_gameobject.sql
new file mode 100644
index 00000000000..5cadd915990
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_25_01_world_gameobject.sql
@@ -0,0 +1,64 @@
+-- Azuremyst Isle Alliance Mid Summer Festival Go Spawns
+SET @OGUID := 70509;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+47;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,181355,530,1,1,-4196.215,-11595.27,-125.4084,1.239183,0,0,0,1,120,255,1),
+(@OGUID+1,181355,530,1,1,-4155.241,-11635.47,-98.17558,5.375615,0,0,0,1,120,255,1),
+(@OGUID+2,181355,530,1,1,-4200.809,-11604.3,-125.62,0.4712385,0,0,0,1,120,255,1),
+(@OGUID+3,181355,530,1,1,-4167.556,-11641.12,-98.394,1.134463,0,0,0,1,120,255,1),
+(@OGUID+4,181355,530,1,1,-4229.965,-11608.42,-126.2826,0.8377575,0,0,0,1,120,255,1),
+(@OGUID+5,181355,530,1,1,-4207.486,-11645.04,-143.677,0.1047193,0,0,0,1,120,255,1),
+(@OGUID+6,181355,530,1,1,-4185.567,-11653.06,-143.4488,5.044002,0,0,0,1,120,255,1),
+(@OGUID+7,181355,530,1,1,-4225.973,-11648.08,-143.8641,5.881761,0,0,0,1,120,255,1),
+(@OGUID+8,181355,530,1,1,-4244.824,-11657.96,-143.6249,1.727875,0,0,0,1,120,255,1),
+(@OGUID+9,181355,530,1,1,-4209.638,-11675.42,-143.2441,5.899214,0,0,0,1,120,255,1),
+(@OGUID+10,181355,530,1,1,-4204.821,-11678.49,-143.1916,0.4014249,0,0,0,1,120,255,1),
+(@OGUID+11,181355,530,1,1,-4163.965,-11666.74,-143.2581,4.677484,0,0,0,1,120,255,1),
+(@OGUID+12,181355,530,1,1,-4253.186,-11675.28,-143.7647,4.677484,0,0,0,1,120,255,1),
+(@OGUID+13,181355,530,1,1,-4178.041,-11713.54,-143.6017,0.7853968,0,0,0,1,120,255,1),
+(@OGUID+14,181355,530,1,1,-4154.533,-11704.79,-143.3194,5.98648,0,0,0,1,120,255,1),
+(@OGUID+15,181355,530,1,1,-4194.735,-11728.54,-143.4515,3.246347,0,0,0,1,120,255,1),
+(@OGUID+16,181355,530,1,1,-4186.29,-11803.01,-133.1742,0.6108634,0,0,0,1,120,255,1),
+(@OGUID+17,181355,530,1,1,-4228.949,-11818.94,-115.9345,0.802851,0,0,0,1,120,255,1),
+(@OGUID+18,181355,530,1,1,-4210.176,-11796.16,-133.2452,1.570796,0,0,0,1,120,255,1),
+(@OGUID+19,181355,530,1,1,-4185.515,-11746.04,-132.2725,3.036838,0,0,0,1,120,255,1),
+(@OGUID+20,181355,530,1,1,-4221.807,-11830.92,-115.8959,5.305802,0,0,0,1,120,255,1),
+(@OGUID+21,181355,530,1,1,-4161.4,-11800.58,-132.1952,4.555311,0,0,0,1,120,255,1),
+(@OGUID+22,181355,530,1,1,-4217.298,-12296.37,2.797,4.66003,0,0,0,1,120,255,1),
+(@OGUID+23,181355,530,1,1,-4208.977,-12291.46,1.564008,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+24,181355,530,1,1,-4231.342,-12311.88,4.430907,4.694937,0,0,0,1,120,255,1),
+(@OGUID+25,181355,530,1,1,-4236.268,-12321.97,3.524465,0.5410506,0,0,0,1,120,255,1),
+(@OGUID+26,181355,530,1,1,-4191.353,-12302.24,0.068963,3.211419,0,0,0,1,120,255,1),
+(@OGUID+27,181355,530,1,1,-4196.024,-12313.57,0.370297,0.1745321,0,0,0,1,120,255,1),
+(@OGUID+28,181355,530,1,1,-4215.688,-12343.17,5.164443,1.186823,0,0,0,1,120,255,1),
+(@OGUID+29,181355,530,1,1,-4234.849,-12332.25,4.627616,5.846854,0,0,0,1,120,255,1),
+(@OGUID+30,181355,530,1,1,-4207.028,-12336.08,2.900289,5.201083,0,0,0,1,120,255,1),
+(@OGUID+31,181355,530,1,1,-4214.633,-12476,45.07409,5.497789,0,0,0,1,120,255,1),
+(@OGUID+32,181302,530,1,1,-4224.03,-12301.6,4.06688,6.248279,0,0,0,1,120,255,1),
+(@OGUID+33,181302,530,1,1,-4225.604,-12301.49,4.273456,1.937312,0,0,0,1,120,255,1),
+(@OGUID+34,181305,530,1,1,-4219.088,-12304.94,2.68953,0.1396245,0,0,0,1,120,255,1),
+(@OGUID+35,181306,530,1,1,-4224.28,-12299.62,4.223075,2.478367,0,0,0,1,120,255,1),
+(@OGUID+36,181307,530,1,1,-4219.073,-12304.1,3.637502,0.01745246,0,0,0,1,120,255,1),
+(@OGUID+37,181605,530,1,1,-4204.668,-12321.07,2.198824,5.777041,0,0,0,1,120,255,1),
+(@OGUID+38,187917,530,1,1,-4223.843,-12318.37,2.47695,2.932139,0,0,0,1,120,255,1),
+(@OGUID+39,188020,530,1,1,-4205.284,-12290.93,1.317262,0.7330382,0,0,0,1,120,255,1),
+(@OGUID+40,188020,530,1,1,-4193.06,-12298.27,0.561426,0.9075702,0,0,0,1,120,255,1),
+(@OGUID+41,188020,530,1,1,-4218.465,-12342.38,5.182833,1.361356,0,0,0,1,120,255,1),
+(@OGUID+42,188020,530,1,1,-4231.875,-12334.86,4.329966,1.378809,0,0,0,1,120,255,1),
+(@OGUID+43,188021,530,1,1,-4221.665,-12306.13,2.295757,5.654869,0,0,0,1,120,255,1),
+(@OGUID+44,187667,530,1,1,-4216.924,-12483.89,48.3932,6.230826,0,0,0,1,120,255,1),
+(@OGUID+45,187667,530,1,1,-4216.502,-12480.64,48.98628,6.213374,0,0,0,1,120,255,1),
+(@OGUID+46,181392,530,1,1,-4213.729,-11685.4,-130.8234,0.9424766,0,0,0,1,120,255,1),
+(@OGUID+47,181392,530,1,1,-4145.799,-11745.62,-124.1529,2.024579,0,0,0,1,120,255,1);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+47;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4),
+(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9),
+(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14),
+(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19),
+(1,@OGUID+20),(1,@OGUID+21),(1,@OGUID+22),(1,@OGUID+23),(1,@OGUID+24),
+(1,@OGUID+25),(1,@OGUID+26),(1,@OGUID+27),(1,@OGUID+28),(1,@OGUID+29),
+(1,@OGUID+30),(1,@OGUID+31),(1,@OGUID+32),(1,@OGUID+33),(1,@OGUID+34),
+(1,@OGUID+35),(1,@OGUID+36),(1,@OGUID+37),(1,@OGUID+38),(1,@OGUID+39),
+(1,@OGUID+40),(1,@OGUID+41),(1,@OGUID+42),(1,@OGUID+43),(1,@OGUID+44),
+(1,@OGUID+45),(1,@OGUID+46),(1,@OGUID+47);
diff --git a/sql/old/3.3.5a/2012_06_25_02_world_gameobject.sql b/sql/old/3.3.5a/2012_06_25_02_world_gameobject.sql
new file mode 100644
index 00000000000..f526f071bac
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_25_02_world_gameobject.sql
@@ -0,0 +1,85 @@
+-- Blades Edge Alliance Mid Summer Festival Go Spawns
+SET @OGUID := 70557;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+37;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,187576,530,1,1,1989.314,6784.465,167.9164,4.537859,0,0,0,1,120,255,1),
+(@OGUID+1,181391,530,1,1,1989.554,6785.711,165.7517,4.607672,0,0,0,1,120,255,1),
+(@OGUID+2,181392,530,1,1,1955.625,6885.821,167.1296,4.468043,0,0,0,1,120,255,1),
+(@OGUID+3,181392,530,1,1,2032.214,6819.37,181.5125,3.874631,0,0,0,1,120,255,1),
+(@OGUID+4,181392,530,1,1,2031.963,6825.553,181.5333,2.426008,0,0,0,1,120,255,1),
+(@OGUID+5,181392,530,1,1,2038.565,6819.838,181.4885,5.550147,0,0,0,1,120,255,1),
+(@OGUID+6,181392,530,1,1,2038.027,6826.094,181.4816,0.8377575,0,0,0,1,120,255,1),
+(@OGUID+7,181392,530,1,1,2063.305,6759.898,173.2681,4.694937,0,0,0,1,120,255,1),
+(@OGUID+8,181392,530,1,1,2062.016,6825.854,184.7832,4.729844,0,0,0,1,120,255,1),
+(@OGUID+9,181393,530,1,1,2051.89,6831.638,177.0355,1.588249,0,0,0,1,120,255,1),
+(@OGUID+10,181393,530,1,1,2072.185,6832.028,176.9799,1.588249,0,0,0,1,120,255,1),
+(@OGUID+11,181401,530,1,1,2055.827,6759.792,173.2742,4.729844,0,0,0,1,120,255,1),
+(@OGUID+12,181401,530,1,1,2066.258,6730.639,181.5167,1.518436,0,0,0,1,120,255,1),
+(@OGUID+13,181401,530,1,1,2070.803,6759.671,173.2742,4.694937,0,0,0,1,120,255,1),
+(@OGUID+14,181401,530,1,1,2066.148,6726.275,181.5531,4.747296,0,0,0,1,120,255,1),
+(@OGUID+15,181401,530,1,1,1937.434,6838.64,177.4422,3.194002,0,0,0,1,120,255,1),
+(@OGUID+16,181401,530,1,1,1941.395,6838.657,177.4772,0.01745246,0,0,0,1,120,255,1),
+(@OGUID+17,181302,530,1,1,2023.801,6594.566,135.5013,2.949595,0,0,0,1,120,255,1),
+(@OGUID+18,181302,530,1,1,2021.781,6590.525,135.2787,1.989672,0,0,0,1,120,255,1),
+(@OGUID+19,181305,530,1,1,2018.895,6592.329,135.5139,6.126106,0,0,0,1,120,255,1),
+(@OGUID+20,181306,530,1,1,2022.451,6595.768,135.6441,2.007128,0,0,0,1,120,255,1),
+(@OGUID+21,181307,530,1,1,2018.828,6591.42,136.4855,1.658062,0,0,0,1,120,255,1),
+(@OGUID+22,181355,530,1,1,2021.774,6603.31,136.6191,0.1745321,0,0,0,1,120,255,1),
+(@OGUID+23,181355,530,1,1,2030.021,6607.951,137.7898,3.211419,0,0,0,1,120,255,1),
+(@OGUID+24,181355,530,1,1,2049.479,6600.245,137.5444,1.186823,0,0,0,1,120,255,1),
+(@OGUID+25,181355,530,1,1,2017.946,6573.733,135.3068,4.66003,0,0,0,1,120,255,1),
+(@OGUID+26,181355,530,1,1,2051.807,6590.619,136.7025,5.201083,0,0,0,1,120,255,1),
+(@OGUID+27,181355,530,1,1,2022.703,6566.989,133.5423,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+28,181355,530,1,1,2049.964,6570.623,135.499,0.5410506,0,0,0,1,120,255,1),
+(@OGUID+29,181355,530,1,1,2046.616,6564.632,134.1706,5.846854,0,0,0,1,120,255,1),
+(@OGUID+30,181355,530,1,1,2046.616,6564.632,134.1706,5.846854,0,0,0,1,120,255,1),
+(@OGUID+31,188020,530,1,1,2035.179,6608.052,137.9502,0.7330382,0,0,0,1,120,255,1),
+(@OGUID+32,188020,530,1,1,2045.668,6604.812,137.8742,1.518436,0,0,0,1,120,255,1),
+(@OGUID+33,188020,530,1,1,2024.833,6565.631,133.425,1.378809,0,0,0,1,120,255,1),
+(@OGUID+34,188020,530,1,1,2042.706,6563.491,133.4392,1.361356,0,0,0,1,120,255,1),
+(@OGUID+35,188021,530,1,1,2021.064,6593.522,135.1495,6.03884,0,0,0,1,120,255,1),
+(@OGUID+36,181605,530,1,1,2046.226,6579.709,135.2484,5.777041,0,0,0,1,120,255,1),
+(@OGUID+37,187919,530,1,1,2019.803,6580.186,134.3619,1.937312,0,0,0,1,120,255,1);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+37;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4),
+(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9),
+(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14),
+(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19),
+(1,@OGUID+20),(1,@OGUID+21),(1,@OGUID+22),(1,@OGUID+23),(1,@OGUID+24),
+(1,@OGUID+25),(1,@OGUID+26),(1,@OGUID+27),(1,@OGUID+28),(1,@OGUID+29),
+(1,@OGUID+30),(1,@OGUID+31),(1,@OGUID+32),(1,@OGUID+33),(1,@OGUID+34),
+(1,@OGUID+35),(1,@OGUID+36),(1,@OGUID+37);
+
+-- Blades Edge Horde Mid Summer Festival Go Spawns
+SET @OGUID := 21478;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+20;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,181302,530,1,1,2286.953,6131.723,135.8838,0.1047193,0,0,0,1,120,255,1),
+(@OGUID+1,181302,530,1,1,2286.061,6134.23,136.0696,4.782203,0,0,0,1,120,255,1),
+(@OGUID+2,181305,530,1,1,2290.526,6135.19,135.9771,4.590216,0,0,0,1,120,255,1),
+(@OGUID+3,181306,530,1,1,2289.731,6131.177,135.6796,4.956738,0,0,0,1,120,255,1),
+(@OGUID+4,181307,530,1,1,2286.542,6131.368,135.8867,0.5934101,0,0,0,1,120,255,1),
+(@OGUID+5,181355,530,1,1,2258.801,6129.346,137.7461,0.8552105,0,0,0,1,120,255,1),
+(@OGUID+6,181355,530,1,1,2268.304,6125.965,137.2221,4.66003,0,0,0,1,120,255,1),
+(@OGUID+7,181355,530,1,1,2255.936,6152.005,139.28,5.846854,0,0,0,1,120,255,1),
+(@OGUID+8,181355,530,1,1,2266.464,6158.563,138.4691,0.5410506,0,0,0,1,120,255,1),
+(@OGUID+9,181355,530,1,1,2277.704,6161.832,137.9124,0.5934101,0,0,0,1,120,255,1),
+(@OGUID+10,181355,530,1,1,2298.375,6131.026,135.5555,5.201083,0,0,0,1,120,255,1),
+(@OGUID+11,181355,530,1,1,2303.753,6135.784,135.0607,1.186823,0,0,0,1,120,255,1),
+(@OGUID+12,181355,530,1,1,2293.306,6163.847,136.1624,0.1745321,0,0,0,1,120,255,1),
+(@OGUID+13,181355,530,1,1,2302.233,6162.095,135.2117,3.211419,0,0,0,1,120,255,1),
+(@OGUID+14,188020,530,1,1,2258.107,6132.874,137.3437,3.298687,0,0,0,1,120,255,1),
+(@OGUID+15,188020,530,1,1,2255.474,6148.87,138.3934,3.717554,0,0,0,1,120,255,1),
+(@OGUID+16,188020,530,1,1,2304.146,6139.788,134.4674,0.05235888,0,0,0,1,120,255,1),
+(@OGUID+17,188020,530,1,1,2303.354,6158.675,134.4655,6.126106,0,0,0,1,120,255,1),
+(@OGUID+18,188021,530,1,1,2289.121,6132.534,135.8388,1.640607,0,0,0,1,120,255,1),
+(@OGUID+19,181605,530,1,1,2285.147,6157.909,136.2808,5.777041,0,0,0,1,120,255,1),
+(@OGUID+20,187955,530,1,1,2274.421,6133.031,136.9586,3.036838,0,0,0,1,120,255,1);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+20;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4),
+(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9),
+(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14),
+(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19),
+(1,@OGUID+20);
diff --git a/sql/old/3.3.5a/2012_06_26_00_world_sai.sql b/sql/old/3.3.5a/2012_06_26_00_world_sai.sql
new file mode 100644
index 00000000000..c6fe75be1e5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_26_00_world_sai.sql
@@ -0,0 +1,50 @@
+-- Ample Inspiration (12828)
+
+SET @GOB_UDED := 191553; -- U.D.E.D. Dispenser
+SET @GOSSIP_MENU := 10211;
+SET @NPC_MAMMOTH := 29402; -- Ironwool Mammoth
+SET @NPC_MEAT_BUNNY := 29524; -- Mammoth Meat Bunny
+SET @SPELL_THROW_UDED := 54577; -- Throw U.D.E.D.
+SET @SPELL_GIVE_UDED := 54576; -- Forceitem U.D.E.D.
+SET @SPELL_SPAWNER := 54581; -- Mammoth Explosion Spell Spawner
+SET @SPELL_MAIN_MEAT := 57444; -- Summon Main Mammoth Meat
+SET @SPELL_MEAT := 54625; -- Summon Mammoth Meat
+SET @SPELL_MEAT_BUNNY1 := 54627; -- Quest - Mammoth Explosion Summon Object
+SET @SPELL_MEAT_BUNNY2 := 54628; -- Quest - Mammoth Explosion Summon Object
+SET @SPELL_MEAT_BUNNY3 := 54623; -- Quest - Mammoth Explosion Summon Object
+
+DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_THROW_UDED;
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP_MENU;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(@GOSSIP_MENU,0,0,'<Retrieve a bomb from the dispenser.>',1,0,0,0,0,0,NULL);
+
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@GOB_UDED;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@GOB_UDED;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@GOB_UDED,1,0,1,62,0,100,0,@GOSSIP_MENU,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip - Close gossip'),
+(@GOB_UDED,1,1,0,61,0,100,0,0,0,0,0,85,@SPELL_GIVE_UDED,0,0,0,0,0,7,0,0,0,0,0,0,0,'On link - Cast Forceitem U.D.E.D.');
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC_MAMMOTH;
+UPDATE `creature_template` SET `flags_extra`=128,`AIName`='SmartAI' WHERE `entry`=@NPC_MEAT_BUNNY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@NPC_MAMMOTH;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@NPC_MAMMOTH,@NPC_MEAT_BUNNY);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+-- Ironwool Mammoth
+(@NPC_MAMMOTH,0,0,0,0,0,100,0,1000,3000,7000,10000,11,56356,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Ironwool Coat'),
+(@NPC_MAMMOTH,0,1,2,8,0,100,0,@SPELL_THROW_UDED,0,0,0,11,@SPELL_SPAWNER,0,0,0,0,0,1,0,0,0,0,0,0,0,'On spellhit - Cast Mammoth Explosion Spell Spawner'),
+(@NPC_MAMMOTH,0,2,0,61,0,100,0,0,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0,'On link - Despawn'),
+-- Mammoth Meat Bunny
+(@NPC_MEAT_BUNNY,0,0,0,54,0,100,1,0,0,0,0,11,@SPELL_MEAT,0,0,0,0,0,1,0,0,0,0,0,0,0,'On spawn - Cast');
+
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=@SPELL_SPAWNER;
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(@SPELL_SPAWNER,@SPELL_MAIN_MEAT,0,'Mammoth Explosion Spell Spawner link to Summon Main Mammoth Meat'),
+(@SPELL_SPAWNER,@SPELL_MEAT_BUNNY1,0,'Mammoth Explosion Spell Spawner link to Quest - Mammoth Explosion Summon Object'),
+(@SPELL_SPAWNER,@SPELL_MEAT_BUNNY2,0,'Mammoth Explosion Spell Spawner link to Quest - Mammoth Explosion Summon Object'),
+(@SPELL_SPAWNER,@SPELL_MEAT_BUNNY3,0,'Mammoth Explosion Spell Spawner link to Quest - Mammoth Explosion Summon Object');
+
+DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL_THROW_UDED) OR (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP_MENU);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,@SPELL_THROW_UDED,0,0,31,1,3,@NPC_MAMMOTH,0,0,0,'','Require Ironwool Mammoth as target'),
+(15,@GOSSIP_MENU,0,0,0,9,0,12828,0,0,0,0,'','Show gossip if quest taken');
diff --git a/sql/old/3.3.5a/2012_06_26_01_world_creature.sql b/sql/old/3.3.5a/2012_06_26_01_world_creature.sql
new file mode 100644
index 00000000000..1f0dfff0b04
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_26_01_world_creature.sql
@@ -0,0 +1,61 @@
+UPDATE `creature_template` SET `InhabitType`=4,`flags_extra`=128,`unit_flags`=0x2000000,`ScriptName`='npc_arthas_teleport_visual' WHERE `entry`=30298; -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_icc_soul_missile';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(72585,'spell_icc_soul_missile');
+
+DELETE FROM `creature_template_addon` WHERE `entry`=30298;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(30298,0,0x0,0x1,''); -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+
+SET @CGUID:=88653;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+47;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES
+(@CGUID+00,30298,631,15,1,4357.052,2769.421,356.1364,3.141593,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+01,30298,631,15,1,4308.511,2788.476,312.6750,3.263766,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+02,30298,631,15,1,4292.898,2793.981,310.8101,1.640610,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+03,30298,631,15,1,4306.854,2752.771,299.1382,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+04,30298,631,15,1,4317.904,2743.047,299.1328,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+05,30298,631,15,1,4319.273,2799.125,299.1442,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+06,30298,631,15,1,4312.229,2735.825,299.1255,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+07,30298,631,15,1,4295.093,2743.372,299.1294,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+08,30298,631,15,1,4342.194,2719.366,312.6750,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+09,30298,631,15,1,4284.044,2753.073,299.1465,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+10,30298,631,15,1,4331.980,2730.547,299.1442,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+11,30298,631,15,1,4331.183,2813.701,299.1328,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+12,30298,631,15,1,4292.952,2807.547,299.1372,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+13,30298,631,15,1,4284.188,2735.236,299.1377,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+14,30298,631,15,1,4323.733,2819.085,299.1255,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+15,30298,631,15,1,4308.430,2717.113,299.1333,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+16,30298,631,15,1,4304.886,2822.116,299.1333,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+17,30298,631,15,1,4336.049,2703.986,310.8101,3.176499,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+18,30298,631,15,1,4430.367,2800.603,299.1377,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+19,30298,631,15,1,4432.948,2749.438,307.1431,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+20,30298,631,15,1,4340.452,2825.148,299.1382,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+21,30298,631,15,1,4322.498,2704.592,299.1372,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+22,30298,631,15,1,4380.124,2816.074,312.6750,6.265732,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+23,30298,631,15,1,4330.582,2836.512,299.1294,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+24,30298,631,15,1,4418.384,2734.435,299.1372,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+25,30298,631,15,1,4429.439,2782.781,299.1465,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+26,30298,631,15,1,4380.205,2727.930,299.1328,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+27,30298,631,15,1,4371.056,2716.414,299.1382,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+28,30298,631,15,1,4399.571,2746.277,312.6750,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+29,30298,631,15,1,4382.944,2808.139,299.1442,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+30,30298,631,15,1,4389.698,2694.647,299.1377,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+31,30298,631,15,1,4336.760,2689.307,307.1431,3.176499,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+32,30298,631,15,1,4391.995,2742.610,299.1442,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+33,30298,631,15,1,4322.008,2847.075,299.1377,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+34,30298,631,15,1,4396.241,2794.807,299.1328,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+35,30298,631,15,1,4380.467,2834.892,310.8101,6.265732,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+36,30298,631,15,1,4337.707,2850.425,299.1465,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+37,30298,631,15,1,4392.823,2719.806,299.1255,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+38,30298,631,15,1,4406.686,2784.457,299.1382,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+39,30298,631,15,1,4381.028,2705.133,299.1294,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+40,30298,631,15,1,4371.884,2693.614,299.1465,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+41,30298,631,15,1,4405.702,2806.464,299.1255,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+42,30298,631,15,1,4418.314,2747.997,310.8101,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+43,30298,631,15,1,4380.639,2849.595,307.1431,6.265732,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+44,30298,631,15,1,4393.958,2833.470,299.1372,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+45,30298,631,15,1,4406.588,2719.758,299.1333,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+46,30298,631,15,1,4407.252,2820.139,299.1333,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI)
+(@CGUID+47,30298,631,15,1,4418.995,2793.132,299.1294,3.909538,7200,0,0); -- Invisible Stalker (Float, Uninteractible, LargeAOI)
diff --git a/sql/old/3.3.5a/2012_06_26_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_06_26_02_world_creature_loot_template.sql
new file mode 100644
index 00000000000..3a704e61bcf
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_26_02_world_creature_loot_template.sql
@@ -0,0 +1,6 @@
+-- Replace Furious Weapon drop with drop that should be in the Cache of Living Stone
+UPDATE `reference_loot_template` SET `item` =45695 WHERE (`entry` =34361 AND `item` =45965);
+-- add missing Recipe: Mighty Shadow Protection Potion on Cultist Shard Watcher
+DELETE FROM `creature_loot_template` WHERE `entry`=32349 AND `item`=44568;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(32349,44568,0.5,1,0,1,1);
diff --git a/sql/old/3.3.5a/2012_06_27_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_06_27_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..8210225de6e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_27_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (50546);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(50546,'spell_q12066_bunny_kill_credit');
diff --git a/sql/old/3.3.5a/2012_06_27_01_world_game_graveyard_zone.sql b/sql/old/3.3.5a/2012_06_27_01_world_game_graveyard_zone.sql
new file mode 100644
index 00000000000..973a1dc5296
--- /dev/null
+++ b/sql/old/3.3.5a/2012_06_27_01_world_game_graveyard_zone.sql
@@ -0,0 +1,3 @@
+-- fix graveyard for shattered halls, alliance to honor hold, horde to thrallmar, not the other way around
+UPDATE `game_graveyard_zone` SET `faction`=67 WHERE `id`=919 AND `ghost_zone`=3714;
+UPDATE `game_graveyard_zone` SET `faction`=469 WHERE `id`=920 AND `ghost_zone`=3714;
diff --git a/sql/old/3.3.5a/2012_07_01_00_world_creature_text.sql b/sql/old/3.3.5a/2012_07_01_00_world_creature_text.sql
new file mode 100644
index 00000000000..f59663ceab5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_01_00_world_creature_text.sql
@@ -0,0 +1,66 @@
+DELETE FROM `script_texts` WHERE entry IN (-1534019, -1534020, -1534021, -1534022, -1534023, -1534024, -1534025, -1534026, -1534027, -1534028, -1534029 , -1534030);
+
+-- Anetheron
+DELETE FROM `creature_text` WHERE `entry`=17808;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17808,0,0, 'The clock... is still... ticking.',14,0,100,0,0,10982, 'Anetheron - SAY_ONDEATH'),
+(17808,1,0, 'Your hopes are lost!',14,0,100,0,0,10981, 'Anetheron - SAY_ONSLAY1'),
+(17808,1,1, 'Scream for me!',14,0,100,0,0,11038, 'Anetheron - SAY_ONSLAY2'),
+(17808,1,2, 'Pity, no time for a slow death!',14,0,100,0,0,11039, 'Anetheron - SAY_ONSLAY3'),
+(17808,2,0, 'The swarm is eager to feed!',14,0,100,0,0,10979, 'Anetheron - SAY_SWARM1'),
+(17808,2,1, 'Pestilence upon you!',14,0,100,0,0,11037, 'Anetheron - SAY_SWARM2'),
+(17808,3,0, 'You look tired...',14,0,100,0,0,10978, 'Anetheron - SAY_SLEEP1'),
+(17808,3,1, 'Sweet dreams...',14,0,100,0,0,11545, 'Anetheron - SAY_SLEEP2'),
+(17808,4,0, 'Let fire rain from above!',14,0,100,0,0,10980, 'Anetheron - SAY_INFERNO1'),
+(17808,4,1, 'Earth and sky shall burn!',14,0,100,0,0,11036, 'Anetheron - SAY_INFERNO2'),
+(17808,5,0, 'You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!',14,0,100,0,0,10977, 'Anetheron - SAY_ONAGGRO');
+
+-- Azgalor
+DELETE FROM `creature_text` WHERE `entry`=17842;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17842,0,0, 'Your time is almost... up',14,0,100,0,0,11002, 'Azgalor - SAY_ONDEATH'),
+(17842,1,0, 'Reesh, hokta!',14,0,100,0,0,11001, 'Azgalor - SAY_ONSLAY1'),
+(17842,1,1, 'Don''t fight it',14,0,100,0,0,11048, 'Azgalor - SAY_ONSLAY2'),
+(17842,1,2, 'No one is going to save you',14,0,100,0,0,11047, 'Azgalor - SAY_ONSLAY3'),
+(17842,2,0, 'Just a taste... of what awaits you',14,0,100,0,0,11046, 'Azgalor - SAY_DOOM1'),
+(17842,2,1, 'Suffer you despicable insect!',14,0,100,0,0,11000, 'Azgalor - SAY_DOOM2'),
+(17842,3,0, 'Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!',14,0,100,0,0,10999, 'Azgalor - SAY_ONAGGRO');
+
+-- Kazrogal
+DELETE FROM `creature_text` WHERE `entry`=17888;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17888,0,0, 'Shaza-Kiel!',14,0,100,0,0,11017, 'Kazrogal - SAY_ONSLAY1'),
+(17888,0,1, 'You... are nothing!',14,0,100,0,0,11053, 'Kazrogal - SAY_ONSLAY2'),
+(17888,0,2, 'Miserable nuisance!',14,0,100,0,0,11054, 'Kazrogal - SAY_ONSLAY3'),
+(17888,1,0, 'Your death will be a painful one.',14,0,100,0,0,11016, 'Kazrogal - SAY_MARK1'),
+(17888,1,1, 'You... are marked.',14,0,100,0,0,11052, 'Kazrogal - SAY_MARK2'),
+(17888,2,0, 'Cry for mercy! Your meaningless lives will soon be forfeit.',14,0,100,0,0,11015, 'Kazrogal - SAY_ONAGGRO');
+
+-- Rage Winterchill
+DELETE FROM `creature_text` WHERE `entry`=17767;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17767,0,0, 'You have won this battle, but not... the... war',14,0,100,0,0,11026, 'Rage Winterchill - SAY_ONDEATH'),
+(17767,1,0, 'All life must perish!',14,0,100,0,0,11025, 'Rage Winterchill - SAY_ONSLAY1'),
+(17767,1,1, 'Victory to the Legion!',14,0,100,0,0,11057, 'Rage Winterchill - SAY_ONSLAY2'),
+(17767,2,0, 'Crumble and rot!',14,0,100,0,0,11023, 'Rage Winterchill - SAY_DECAY1'),
+(17767,2,1, 'Ashes to ashes, dust to dust',14,0,100,0,0,11055, 'Rage Winterchill - SAY_DECAY2'),
+(17767,3,0, 'Succumb to the icy chill... of death!',14,0,100,0,0,11024, 'Rage Winterchill - SAY_NOVA1'),
+(17767,3,1, 'It will be much colder in your grave',14,0,100,0,0,11058, 'Rage Winterchill - SAY_NOVA2'),
+(17767,4,0, 'The Legion''s final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!',14,0,100,0,0,11022, 'Rage Winterchill - SAY_ONAGGRO');
+
+-- Archimonde
+DELETE FROM `creature_text` WHERE `entry`=17968;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(17968,1,0, 'Your resistance is insignificant.',14,0,100,0,0,10987, 'Archimonde - SAY_AGGRO'),
+(17968,2,0, 'This world will burn!',14,0,100,0,0,10990, 'Archimonde - SAY_DOOMFIRE1'),
+(17968,2,1, 'Manach sheek-thrish!',14,0,100,0,0,11041, 'Archimonde - SAY_DOOMFIRE2'),
+(17968,3,0, 'A-kreesh!',14,0,100,0,0,11041, 'Archimonde - SAY_AIR_BURST1'),
+(17968,3,1, 'Away vermin!',14,0,100,0,0,10989, 'Archimonde - SAY_AIR_BURST2'),
+(17968,4,0, 'All creation will be devoured!',14,0,100,0,0,11044, 'Archimonde - SAY_SLAY1'),
+(17968,4,1, 'Your soul will languish for eternity.',14,0,100,0,0,10991, 'Archimonde - SAY_SLAY12'),
+(17968,4,2, 'I am the coming of the end!',14,0,100,0,0,11045, 'Archimonde - SAY_SLAY3'),
+(17968,5,0, 'At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!',14,0,100,0,0,10993, 'Archimonde - SAY_ENRAGE'),
+(17968,6,0, 'No, it cannot be! Nooo!',14,0,100,0,0,10992, 'Archimonde - SAY_DEATH'),
+(17968,7,0, 'You are mine now.',14,0,100,0,0,10988, 'Archimonde - SAY_SOUL_CHARGE1'),
+(17968,7,1, 'Bow to my will.',14,0,100,0,0,11042, 'Archimonde - SAY_SOUL_CHARGE2');
+
diff --git a/sql/old/3.3.5a/2012_07_01_01_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_07_01_01_achievement_criteria_data.sql
new file mode 100644
index 00000000000..e1c0529fffe
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_01_01_achievement_criteria_data.sql
@@ -0,0 +1,6 @@
+DELETE FROM `disables` WHERE `entry` IN (7626,7634) AND `sourceType`=4;
+
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (7626,7634);
+INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
+(7626, 11, 0, 0, 'achievement_not_even_a_scratch'),
+(7634, 11, 0, 0, 'achievement_not_even_a_scratch');
diff --git a/sql/old/3.3.5a/2012_07_02_00_world_creature_onkill_reputation.sql b/sql/old/3.3.5a/2012_07_02_00_world_creature_onkill_reputation.sql
new file mode 100644
index 00000000000..a9565d36934
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_02_00_world_creature_onkill_reputation.sql
@@ -0,0 +1,4 @@
+-- Add 10 reputation gaining from killing NPC Monstrous Kaliri towards Sha'tari Skyguard
+DELETE FROM `creature_onkill_reputation` WHERE `creature_id`=23051;
+INSERT INTO `creature_onkill_reputation` (`creature_id`,`RewOnKillRepFaction1`,`MaxStanding1`,`RewOnKillRepValue1`) VALUES
+(23051,1031,7,10);
diff --git a/sql/old/3.3.5a/2012_07_02_01_world_sai.sql b/sql/old/3.3.5a/2012_07_02_01_world_sai.sql
new file mode 100644
index 00000000000..323d9bddcb2
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_02_01_world_sai.sql
@@ -0,0 +1,7 @@
+-- Add SAI for Dark Ritualist <Cult of the Damned> ID: 34734 // timings are taken from other script finds
+SET @Ritualist := 34734;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Ritualist;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Ritualist;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Ritualist,0,0,0,0,0,100,0,3000,3000,8000,14000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Dark Ritualist - IC - Cast Mind Seer'),
+(@Ritualist,0,1,0,0,0,100,0,8000,17300,17300,17300,11,32026,0,0,0,0,0,2,0,0,0,0,0,0,0,'Dark Ritualist - IC - Cast Pain Strike');
diff --git a/sql/old/3.3.5a/2012_07_02_02_world_sai.sql b/sql/old/3.3.5a/2012_07_02_02_world_sai.sql
new file mode 100644
index 00000000000..6b6b0eb587c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_02_02_world_sai.sql
@@ -0,0 +1,189 @@
+-- Fix quest the Air Stands Still ID: 13125 + some lurking around mobs SAIs
+-- Set guids:
+SET @NPC := 43480; -- Underking Talonox in phase 2, in phase 128->@NPC+1
+SET @PATH := @NPC * 10;
+-- @NPC+2 Salranax phase 2, +3 in phase 128
+-- @NPC+4 High Priest in phase 2 and +5 in 128
+-- Add (Salranax the Flesh Render, High Priest Yath'amon and Underking Talonox -- One for each phase they are in /used @qaywsx phase data/ )
+DELETE FROM `creature` WHERE `id` IN (30829, 30830, 30831);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `MovementType`) VALUES
+(@NPC+2,30829,571,1,2,6839.024902,594.444946,427.229523,4.5,300,0,0,0),
+(@NPC+4,30831,571,1,2,6869.477539,423.287720,471.783722,1.066242,300,0,0,0),
+(@NPC,30830,571,1,2,7169.797363,664.115479,492.375793,1.129528,300,0,0,0),
+(@NPC+3,30829,571,1,128,6839.024902,594.444946,427.229523,4.5,300,0,0,0),
+(@NPC+5,30831,571,1,128,6869.477539,423.287720,471.783722,1.066242,300,0,0,0),
+(@NPC+1,30830,571,1,128,7169.797363,664.115479,492.375793,1.129528,300,0,0,0);
+-- Salranax the Flesh Render SAI
+UPDATE `creature_template` SET `faction_A`=2068, `faction_H`=2068, `mindmg`=240, `maxdmg`=270, `mechanic_immune_mask`=10685, `scale`=1.2 WHERE `entry`=30829;
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30829;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30829;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30829,0,1,0,8,0,100,1,57906,0,0,0,12,30840,4,5000,0,0,0,1,0,0,0,0,0,0,0,'Salranax the Flesh Render - Summons Munch on hit by horn'),
+(30829,0,2,0,8,0,100,1,57906,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On spellhit set aggro'),
+(30829,0,3,0,4,0,100,1,0,0,0,0,11,18100,1,0,0,0,0,1,0,0,0,0,0,0,0,'On aggro - Frost Armor'),
+(30829,0,4,0,0,0,100,0,2000,6000,4000,8000,11,15242,1,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Cast Fireball'),
+(30829,0,5,0,0,0,100,0,15000,20000,15000,20000,11,15244,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat - Cast Cone of Cold'),
+(30829,0,6,0,0,0,100,0,25000,26000,25000,26000,11,15122,1,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Cast Counterspell'),
+(30829,0,7,0,6,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset script on death'),
+(30829,0,8,0,25,0,100,0,0,0,0,0,28,18100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Remove buff on respawn');
+-- Add SAI for Munch + weapon
+UPDATE `creature_template` SET `faction_A`=290,`faction_H`=290, `equipment_id`=30840 WHERE`entry`=30840;
+DELETE FROM `creature_equip_template` WHERE `entry`=30840;
+INSERT INTO `creature_equip_template` VALUES
+(30840,44948,0,0);
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30840;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30840;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30840,0,1,0,4,0,100,1,0,0,0,0,12,30850,3,2000,0,0,0,1,0,0,0,0,0,0,0,'Summons portal'),
+(30840,0,2,0,4,0,100,1,0,0,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text'),
+(30840,0,3,0,4,0,100,1,0,0,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text 2'),
+(30840,0,4,0,4,0,100,1,0,0,0,0,12,30851,4,1000,0,0,0,1,0,0,0,0,0,0,0,'Summons Melt'),
+(30840,0,5,0,0,0,100,0,4000,6000,19000,20000,11,52372,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Icy Touch'),
+(30840,0,6,0,0,0,100,0,4000,8000,10000,11000,11,52373,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Plague Strike'),
+(30840,0,7,0,0,0,100,0,4000,7000,2000,3000,11,52374,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Blood Strike'),
+(30840,0,8,0,5,0,100,1,0,0,0,0,1,3,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Text 3'),
+(30840,0,9,0,5,0,100,1,0,0,0,0,12,30850,2,40000,0,0,0,8,0,0,0,6831.7270020,585.404990,427.168011,0.8,'On out of combat opens portal');
+-- Munch's Texts
+DELETE FROM `creature_text` WHERE `entry`=30840;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(30840,1,1,'Say hello to my little friend!',12,0,100,0,0,0,'Munch arrival'),
+(30840,2,2,'Arise Melt!',12,0,100,0,0,0,'Summon Melts'),
+(30840,3,3,'We are done here. I am out.',12,0,100,0,0,0,'Munch oppening portal');
+-- Switch Melts into helping faction
+UPDATE `creature_template` SET `faction_A`=290, `faction_H`=290 WHERE `entry`=30851;
+-- 2/3
+-- High Priest Yath'amon SAI
+UPDATE `creature_template` SET `faction_A`=2068, `faction_H`=2068, `mindmg`=240, `maxdmg`=300,`mechanic_immune_mask`=10685, `scale`=1.2 WHERE `entry`=30831; -- Mana_mod /WDB/ should be exactly 40, if want insert it
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30831;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30831;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30831,0,1,0,8,0,100,1,57906,0,0,0,12,30839,4,5000,0,0,0,1,0,0,0,0,0,0,0,'Summons Jayde on hit by horn'),
+(30831,0,2,0,8,0,100,1,57906,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On spellhit set aggro'),
+(30831,0,3,0,0,0,100,0,2000,3000,6000,8000,11,61705,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Venomous Bite'), -- the spell only targets players as it should
+(30831,0,4,0,0,0,100,0,2000,7000,10000,20000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'),
+(30831,0,5,0,0,0,100,0,2000,7000,8000,20000,11,38243,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs'),
+(30831,0,6,0,0,0,100,0,10000,15000,30000,35000,11,34322,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Psychic Scream'),
+(30831,0,7,0,6,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset script on death');
+-- Add SAI for Jayde + weapon
+UPDATE `creature_template` SET `faction_A`=290,`faction_H`=290, `mechanic_immune_mask`=20, `equipment_id`=30839,`scale`=1 WHERE `entry`=30839;
+DELETE FROM `creature_equip_template` WHERE `entry`=30839;
+INSERT INTO `creature_equip_template` VALUES
+(30839,44926,0,0);
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30839;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30839;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30839,0,1,0,4,0,100,1,0,0,0,0,12,30852,3,2000,0,0,0,1,0,0,0,0,0,0,0,'Summons portal'),
+(30839,0,2,0,4,0,100,1,0,0,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text'),
+(30839,0,3,0,0,0,100,0,4000,6000,19000,20000,11,52372,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Icy Touch'),
+(30839,0,4,0,0,0,100,0,4000,8000,10500,11000,11,52373,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Plague Strike'),
+(30839,0,5,0,0,0,100,0,4000,7000,2000,2500,11,52374,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Blood Strike'),
+(30839,0,6,0,5,0,100,1,0,0,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Text 2'),
+(30839,0,7,0,5,0,100,1,0,0,0,0,12,30852,2,40000,0,0,0,8,0,0,0,6865.674316,414.657349,472.700226,1.185621,'On out of combat opens portal');
+-- Jayde Texts
+DELETE FROM `creature_text` WHERE `entry`=30839;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(30839,1,1,'Too weak to finish your own battles? Very well then...',12,0,100,0,0,0,'Jayde arrival'),
+(30839,2,2,'Anything else you need help with before I go? Right, I thought not...',12,0,100,0,0,0,'Oppens portal and dissapears');
+-- 3/3
+-- Underking Talonox SAI
+UPDATE `creature_template` SET `exp`=2,`faction_A`=2068,`faction_H`=2068,`InhabitType`=1,`mindmg`=320, `maxdmg`=330, `minlevel`=79, `maxlevel`=79, `mechanic_immune_mask`=10685 WHERE `entry`=30830;
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30830;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30830;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30830,0,1,0,8,0,100,1,57906,0,0,0,12,30838,4,5000,0,0,0,1,0,0,0,0,0,0,0,'Summons Mograine on hit by horn'),
+(30830,0,2,0,8,0,100,1,57906,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On spellhit set aggro'),
+(30830,0,3,0,0,0,100,0,1000,2000,2000,7000,11,60802,1,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mandible Crush'),
+(30830,0,4,0,0,0,100,0,1500,2000,10000,15000,11,50283,0,0,0,0,0,0,0,2,0,0,0,0,0,'Combat - Blinding Swarm'),
+(30830,0,5,0,6,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset script on death');
+-- Add SAI for Mograine + weapon
+UPDATE `creature_template` SET `health_mod`=2401.3,`mana_mod`=1599.9,`unit_class`=2,`flags_extra`=131072, `faction_A`=290,`faction_H`=290, `minlevel`=83, `maxlevel`=83, `mindmg`=340, `maxdmg`=420, `equipment_id`=30838 WHERE`entry`=30838;
+DELETE FROM `creature_equip_template` WHERE `entry`=30838;
+INSERT INTO `creature_equip_template` VALUES
+(30838,39344,39344,0);
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30838;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30838;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30838,0,1,0,4,0,100,1,0,0,0,0,12,30850,3,2000,0,0,0,1,0,0,0,0,0,0,0,'Summons portal'),
+(30838,0,2,0,4,0,100,1,0,0,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text'),
+(30838,0,3,0,0,0,100,0,4000,6000,19000,20000,11,52372,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Icy Touch'),
+(30838,0,4,0,0,0,100,0,4000,8000,10000,11000,11,52373,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Plague Strike'),
+(30838,0,5,0,0,0,100,0,4000,7000,5000,5000,11,49020,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Obliterete'),
+(30838,0,6,0,5,0,100,1,0,0,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Text 2'),
+(30838,0,7,0,5,0,100,1,0,0,0,0,12,30841,2,40000,0,0,0,8,0,0,0,7190.895508,633.476440,488.506317,1.014229,'On out of combat opens portal');
+-- Mograine Texts
+DELETE FROM `creature_text` WHERE `entry`=30838;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(30838,1,1,'You challenge death itself! Come then, "King." Face the might of Mograine!',12,0,100,0,0,0,'Mograine"s arrival'),
+(30838,2,1,'I will see you back at the Valley of Echoes. Suffer well, ally.',12,0,100,0,0,0,'Opens portal');
+-- Underking pathing for phase 2
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7169.797363,`position_y`=664.115479,`position_z`=492.375793, `orientation`=1.129528 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7169.797363,664.115479,490.875793,0,0,0,100,0),
+(@PATH,2,7196.977051,627.252869,488.591461,0,0,0,100,0),
+(@PATH,3,7231.509277,640.110535,484.103490,0,0,0,100,0),
+(@PATH,4,7207.646484,677.654114,491.592255,0,0,0,100,0);
+-- Underking pathing for phase 128
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7169.797363,`position_y`=664.115479,`position_z`=492.375793, `orientation`=1.129528 WHERE `guid`=@NPC+1;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC+1;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC+1,@PATH,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7169.797363,664.115479,490.875793,0,0,0,100,0),
+(@PATH,2,7196.977051,627.252869,488.591461,0,0,0,100,0),
+(@PATH,3,7231.509277,640.110535,484.103490,0,0,0,100,0),
+(@PATH,4,7207.646484,677.654114,491.592255,0,0,0,100,0);
+-- 0/0 Thanks to Nay for helping with Gate's data.
+-- Add missing data for the teleport spell
+DELETE FROM `spell_target_position` WHERE `id`=57897; -- there was none, but just in case
+INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
+(57897,571,6383.445801,229.091522,397.031127,1.660376);
+-- Add info for Munch's Death Gate spell click
+UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30850;
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30850;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
+(30850,57897,2,1);
+-- Addon data for creature 30850 (Death Gate (Munch))
+DELETE FROM `creature_template_addon` WHERE `entry`=30850;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(30850,0,0,1,0, NULL); -- Death Gate (Munch)
+-- Add info for Jayde's Death Gate spell click
+UPDATE `creature_template` SET `exp`=2,`speed_run`=1,`unit_flags`=567296,`minlevel`=80, `maxlevel`=80,`unit_flags`=567296, `speed_run`=1,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30852;
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30852;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
+(30852,57897,2,1);
+-- Model data 27346 (creature 30852 (Death Gate (Jayde)))
+UPDATE `creature_model_info` SET `bounding_radius`=1.35,`combat_reach`=1.35,`gender`=2 WHERE `modelid`=27346; -- Death Gate (Jayde)
+-- Addon data for creature 30852 (Death Gate (Jayde))
+DELETE FROM `creature_template_addon` WHERE `entry`=30852;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(30852,0,0,1,0, NULL); -- Death Gate (Jayde)
+-- Add info for Mograine's Death Gate spell click
+UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30841;
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30841;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
+(30841,57897,2,1);
+-- Addon data for creature 30841 (Death Gate (Mograine))
+DELETE FROM `creature_template_addon` WHERE `entry`=30841;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(30841,0,0,1,0, NULL); -- Death Gate (Mograine)
+-- Set SAI for Forgotten Depths Priest - ID: 30203
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 30203;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30203;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30203,0,1,0,0,0,100,0,2000,7000,10000,15000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'),
+(30203,0,2,0,0,0,100,0,2000,7000,6000,12000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs');
+-- Set SAI for Forgotten Depths Priest - ID: 30543
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 30543;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30543;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(30543,0,1,0,0,0,100,0,2000,7000,10000,15000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'),
+(30543,0,2,0,0,0,100,0,2000,7000,6000,12000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs');
+-- Set SAI for Forgotten Depths Priest - ID: 31037
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 31037;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=31037;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(31037,0,1,0,0,0,100,0,2000,7000,10000,15000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'),
+(31037,0,2,0,0,0,100,0,2000,7000,6000,12000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs');
diff --git a/sql/old/3.3.5a/2012_07_02_03_world_gossip.sql b/sql/old/3.3.5a/2012_07_02_03_world_gossip.sql
new file mode 100644
index 00000000000..0c158aa7511
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_02_03_world_gossip.sql
@@ -0,0 +1,17 @@
+UPDATE `creature_template` SET `gossip_menu_id`=8074 WHERE `entry`=19466; -- Exarch Orelis
+UPDATE `creature_template` SET `gossip_menu_id`=8216 WHERE `entry`=20920; -- Magister Theledorn
+UPDATE `creature_template` SET `gossip_menu_id`=8661 WHERE `entry`=21112; -- Bossi Pentapiston <Engineering Supplies>
+
+DELETE FROM `gossip_menu` WHERE (`entry`=8074 AND `text_id`=9980) OR
+(`entry`=8216 AND `text_id`=10211) OR
+(`entry`=8304 AND `text_id`=10360) OR
+(`entry`=8370 AND `text_id`=10444) OR
+(`entry`=8385 AND `text_id`=10466) OR
+(`entry`=8661 AND `text_id`=10889);
+INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
+(8074, 9980), -- 19466
+(8216, 10211), -- 20920
+(8304, 10360), -- 21461
+(8370, 10444), -- 21755
+(8385, 10466), -- 21824
+(8661, 10889); -- 21112
diff --git a/sql/old/3.3.5a/2012_07_02_04_world_spell_script_names.sql b/sql/old/3.3.5a/2012_07_02_04_world_spell_script_names.sql
new file mode 100644
index 00000000000..9054ea7ba82
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_02_04_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=49838;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(49838, "spell_gen_stop_time"); \ No newline at end of file
diff --git a/sql/old/3.3.5a/2012_07_04_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_07_04_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..9e157261409
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_04_00_world_spell_script_names.sql
@@ -0,0 +1,2 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (52941, -52941);
+INSERT INTO `spell_script_names` VALUES (52941, 'spell_q12735_song_of_cleansing'); \ No newline at end of file
diff --git a/sql/old/3.3.5a/2012_07_05_00_world_item_template.sql b/sql/old/3.3.5a/2012_07_05_00_world_item_template.sql
new file mode 100644
index 00000000000..d4240ca65a7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_05_00_world_item_template.sql
@@ -0,0 +1 @@
+UPDATE `item_template` SET `flagsCustom` = `flagsCustom` | 4 WHERE `entry` IN (50226,50231,50274);
diff --git a/sql/old/3.3.5a/2012_07_06_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_07_06_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..676ac430a9d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_06_00_world_spell_script_names.sql
@@ -0,0 +1 @@
+UPDATE `spell_script_names` SET `spell_id` = 42787 WHERE `spell_id` = 42784;
diff --git a/sql/old/3.3.5a/2012_07_09_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_07_09_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..c97695498b8
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_09_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (42787,42784);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(42783, 'spell_astromancer_wrath_of_the_astromancer');
diff --git a/sql/old/3.3.5a/2012_07_12_00_world_version.sql b/sql/old/3.3.5a/2012_07_12_00_world_version.sql
new file mode 100644
index 00000000000..ce24fa54614
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_12_00_world_version.sql
@@ -0,0 +1 @@
+UPDATE `version` SET `db_version`='TDB 335.11.48', `cache_id`=48 LIMIT 1;
diff --git a/sql/old/3.3.5a/2012_07_13_00_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_07_13_00_world_spell_proc_event.sql
new file mode 100644
index 00000000000..952a4502b30
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_13_00_world_spell_proc_event.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc_event` SET `procFlags` = 16384 WHERE `entry` in (48492,48494,48495);
diff --git a/sql/old/3.3.5a/2012_07_13_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_07_13_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..64500418871
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_13_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE (`spell_id`='-5570');
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-5570, 'spell_dru_insect_swarm');
diff --git a/sql/old/3.3.5a/2012_07_14_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_07_14_00_world_creature_loot_template.sql
new file mode 100644
index 00000000000..f76e5519594
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_14_00_world_creature_loot_template.sql
@@ -0,0 +1,6 @@
+-- Gorilla Fang should always be able to drop (Exodius)
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = ABS(`ChanceOrQuestChance`) WHERE `item`=2799;
+-- Update "Count" Ungula's Mandible drop rate does not require quest to drop it starts one (gecko32)
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = ABS(`ChanceOrQuestChance`) WHERE `item`=25459;
+-- Tainted Hellboar Meat fix (ZxBiohazardZx)
+UPDATE `quest_template` SET `RequiredSourceItemId1`=23270,`RequiredSourceItemCount1`=8 WHERE `Id`=9361;
diff --git a/sql/old/3.3.5a/2012_07_14_01_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_07_14_01_world_creature_loot_template.sql
new file mode 100644
index 00000000000..1b9c4f4448c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_14_01_world_creature_loot_template.sql
@@ -0,0 +1,33 @@
+-- Hellboar shit always drops
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`= -100 WHERE `item`=23270;
+
+-- update Al'ar loot
+SET @gear := 34053;
+SET @talon := 34377;
+SET @Alar := 19514;
+
+DELETE FROM `creature_loot_template` WHERE `entry`=@Alar;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(@Alar,29434,100,1,0,2,2), -- Badge of Justice 2x
+(@Alar,1,100,1,0,-@gear,3), -- 3x Gear Reference
+(@Alar,2,10,1,0,-34052,1), -- Pattern Reference
+(@Alar,3,2,1,0,-34052,1); -- extra Pattern Reference (small chance)
+
+DELETE FROM `reference_loot_template` WHERE `entry` IN (@gear,@talon);
+INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- Gear Reference:
+(@gear,29918,0,1,1,1,1), -- Mindstorm Wristbands
+(@gear,29920,0,1,1,1,1), -- Phoenix-Ring of Rebirth
+(@gear,29921,0,1,1,1,1), -- Fire Crest Breastplate
+(@gear,29922,0,1,1,1,1), -- Band of Al'ar
+(@gear,29923,0,1,1,1,1), -- Talisman of the Sun King
+(@gear,29924,0,1,1,1,1), -- Netherbane
+(@gear,29925,0,1,1,1,1), -- Phoenix-Wing Cloak
+(@gear,29947,0,1,1,1,1), -- Gloves of the Searing Grip
+(@gear,29948,0,1,1,1,1), -- Claw of the Phoenix
+(@gear,29949,0,1,1,1,1), -- Arcanite Steam-Pistol
+(@gear,30447,0,1,1,1,1), -- Tome of Fiery Redemption
+(@gear,1,0,1,1,-@talon,1), -- Talonoption
+-- either of the claws is selected
+(@talon,30448,0,1,1,1,1), -- Talon of Al'ar
+(@talon,32944,0,1,1,1,1); -- Talon of the Phoenix
diff --git a/sql/old/3.3.5a/2012_07_16_00_world_creature_template.sql b/sql/old/3.3.5a/2012_07_16_00_world_creature_template.sql
new file mode 100644
index 00000000000..7ce7c546592
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_16_00_world_creature_template.sql
@@ -0,0 +1,2 @@
+-- Fix the damage for Wretched mobs in Magisters' Terrace
+UPDATE `creature_template` SET `dmg_multiplier`=0.6 WHERE `entry` IN (24688, 24689, 24690);
diff --git a/sql/old/3.3.5a/2012_07_16_01_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_07_16_01_world_reference_loot_template.sql
new file mode 100644
index 00000000000..e56dff3b0ea
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_16_01_world_reference_loot_template.sql
@@ -0,0 +1,2 @@
+-- manually set the reference% for core doesnt understand how to deal with grouped references (lame)
+UPDATE `reference_loot_template` SET `ChanceOrQuestChance`=8.33333333 WHERE `entry`=34053 AND `item`=1;
diff --git a/sql/old/3.3.5a/2012_07_22_00_world_spelldifficulty_dbc.sql b/sql/old/3.3.5a/2012_07_22_00_world_spelldifficulty_dbc.sql
new file mode 100644
index 00000000000..c90c42692b9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_00_world_spelldifficulty_dbc.sql
@@ -0,0 +1 @@
+UPDATE `spelldifficulty_dbc` SET `spellid0`= 61890 WHERE `id`= 3251 AND `spellid1`= 63498;
diff --git a/sql/old/3.3.5a/2012_07_22_01_world_conditions.sql b/sql/old/3.3.5a/2012_07_22_01_world_conditions.sql
new file mode 100644
index 00000000000..333ae7f997f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_01_world_conditions.sql
@@ -0,0 +1,10 @@
+-- Saronite Mine Slave conditions
+SET @QUEST_A := 13300;
+SET @QUEST_H := 13302;
+SET @GOSSIP := 10137;
+
+-- Only show gossip if player is on quest Slaves to Saronite
+DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP AND `ConditionValue1` IN (@QUEST_A,@QUEST_H);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15,@GOSSIP,0,0,0,9,0,@QUEST_A,0,0,0,0,'',"Only show first gossip if player is on quest Slaves to Saronite Alliance"),
+(15,@GOSSIP,0,0,1,9,0,@QUEST_H,0,0,0,0,'',"Only show first gossip if player is on quest Slaves to Saronite Horde");
diff --git a/sql/old/3.3.5a/2012_07_22_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_07_22_02_world_creature_loot_template.sql
new file mode 100644
index 00000000000..e4bc61b6fa4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_02_world_creature_loot_template.sql
@@ -0,0 +1,5 @@
+-- Item was added to the wrong NPC
+-- Source: http://old.wowhead.com/item=19364
+DELETE FROM `creature_loot_template` WHERE `entry` IN (1853, 11583) AND `item`=19364;
+INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
+(11583, 19364, 10, 1, 0, 1, 1);
diff --git a/sql/old/3.3.5a/2012_07_22_03_world_gossip.sql b/sql/old/3.3.5a/2012_07_22_03_world_gossip.sql
new file mode 100644
index 00000000000..d1aa7e50747
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_03_world_gossip.sql
@@ -0,0 +1,18 @@
+-- Keristrasza (26206)
+UPDATE `creature_template` SET `gossip_menu_id` = 9262 WHERE `entry` = 26206;
+
+DELETE FROM `gossip_menu` WHERE `entry`=9262 AND `text_id`=12576;
+INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (9262, 12576);
+
+-- from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=9262 AND `id`=0;
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=9262 AND `id`=1;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES
+(9262, 0, 0, 'I am prepared to face Saragosa!', 1, 3, 0, 0, 0, 0, NULL),
+(9262, 1, 0, 'Keristrasa, I am finished here. Please return me to the Transitus Shield.', 1, 3, 0, 0, 0, 0, NULL);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9262 AND `SourceEntry`=0;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9262 AND `SourceEntry`=1;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15, 9262, 0, 0, 0, 9, 0, 11957, 0, 0, 0, 0, '', "Only show gossip if player has quest Saragosa's End"),
+(15, 9262, 1, 0, 0, 9, 0, 11967, 0, 0, 0, 0, '', "Only show gossip if player has quest Mustering the Reds");
diff --git a/sql/old/3.3.5a/2012_07_22_04_world_gossip.sql b/sql/old/3.3.5a/2012_07_22_04_world_gossip.sql
new file mode 100644
index 00000000000..0fbf2e7508f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_04_world_gossip.sql
@@ -0,0 +1,20 @@
+-- NPC Cowlen - Missing Gossip Options
+SET @NPC := 17311;
+DELETE FROM `creature_addon` WHERE `guid`=84415;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(84415,0,0,1,0,0,NULL);
+UPDATE `creature_template` SET `gossip_menu_id`=7403, `AIName`='SmartAI' WHERE `entry`=@NPC;
+DELETE FROM `gossip_menu` WHERE `entry` IN (7403,7402,7401);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(7403,8870),
+(7402,8871),
+(7401,8872);
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7403,7402,7401) AND `id`=0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(7403,0,0, 'I have not come to kill you, night elf. And the gods did not do this...',1,1,7402,0,0,0, ''),
+(7402,0,0, 'I fear that my people are somewhat responsible for this destruction. We are refugees, displaced from our homes by the Burning Legion. This tragedy is a result of our latest evacuation. Our vessel crashed - this debris is a part of that vessel.',1,1,7401,0,0,0, ''),
+(7401,0,0, 'We have much in common, night elf. I can''t help but feel that perhaps it was fate that brought us together. Let me help you, Cowlen. Let my people help. We will right the wrongs. This I vow.',1,1,0,0,0,0, '');
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC AND `source_type`=0 AND `id` IN (0,1);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC,0,0,1,62,0,100,0,7401,0,0,0,5,18,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Cowlen - On gossip option play emote'),
+(@NPC,0,1,0,61,0,100,0,7401,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Cowlen - On gossip option Close Gossip');
diff --git a/sql/old/3.3.5a/2012_07_22_05_world_script_texts.sql b/sql/old/3.3.5a/2012_07_22_05_world_script_texts.sql
new file mode 100644
index 00000000000..2ecb1b8f130
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_05_world_script_texts.sql
@@ -0,0 +1,2 @@
+-- Fixing wrong text in Trial of the Crusader, Twin Valkyrs
+UPDATE `script_texts` SET `content_default`='%s begins to read the spell Twin''s Pact!' WHERE `entry`=-1649043;
diff --git a/sql/old/3.3.5a/2012_07_22_06_world_gossip.sql b/sql/old/3.3.5a/2012_07_22_06_world_gossip.sql
new file mode 100644
index 00000000000..0cb41937d3c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_06_world_gossip.sql
@@ -0,0 +1,85 @@
+-- gossip assignation from sniff
+UPDATE `creature_template` SET `gossip_menu_id`=4182 WHERE `entry`=1466; -- Gretta Finespindle <Apprentice Leatherworker>
+UPDATE `creature_template` SET `gossip_menu_id`=201 WHERE `entry`=3678; -- Muyoh <Disciple of Naralex>
+UPDATE `creature_template` SET `gossip_menu_id`=7406 WHERE `entry`=3848; -- Kayneth Stillwind
+UPDATE `creature_template` SET `gossip_menu_id`=8851 WHERE `entry`=4979; -- Theramore Guard
+UPDATE `creature_template` SET `gossip_menu_id`=4862 WHERE `entry`=6771; -- Ravenholdt Assassin <Assassin's League>
+UPDATE `creature_template` SET `gossip_menu_id`=3130 WHERE `entry`=10618; -- Rivern Frostwind <Wintersaber Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=3441 WHERE `entry`=10857; -- Argent Quartermaster Lightspark <The Argent Crusade>
+UPDATE `creature_template` SET `gossip_menu_id`=3074 WHERE `entry`=10922; -- Greta Mosshoof <Emerald Circle>
+UPDATE `creature_template` SET `gossip_menu_id`=3128 WHERE `entry`=11019; -- Jessir Moonbow
+UPDATE `creature_template` SET `gossip_menu_id`=3622 WHERE `entry`=11554; -- Grazle
+UPDATE `creature_template` SET `gossip_menu_id`=3602 WHERE `entry`=11609; -- Alexia Ironknife
+UPDATE `creature_template` SET `gossip_menu_id`=3963 WHERE `entry`=11626; -- Rigger Gizelton
+UPDATE `creature_template` SET `gossip_menu_id`=4003 WHERE `entry`=12245; -- Vendor-Tron 1000
+UPDATE `creature_template` SET `gossip_menu_id`=4002 WHERE `entry`=12246; -- Super-Seller 680
+UPDATE `creature_template` SET `gossip_menu_id`=4922 WHERE `entry`=13085; -- Myrokos Silentform
+UPDATE `creature_template` SET `gossip_menu_id`=6531 WHERE `entry`=15182; -- Vish Kozus <Captain of the Guard>
+UPDATE `creature_template` SET `gossip_menu_id`=7326 WHERE `entry`=16817; -- Festival Loremaster
+UPDATE `creature_template` SET `gossip_menu_id`=7405 WHERE `entry`=17287; -- Sentinel Luciel Starwhisper <Silverwing Sentinels>
+UPDATE `creature_template` SET `gossip_menu_id`=7404 WHERE `entry`=17291; -- Architect Nemos
+UPDATE `creature_template` SET `gossip_menu_id`=7407 WHERE `entry`=17303; -- Vindicator Vedaar <Hand of Argus>
+UPDATE `creature_template` SET `gossip_menu_id`=8080 WHERE `entry`=17310; -- Gnarl <Ancient of War>
+UPDATE `creature_template` SET `gossip_menu_id`=7382 WHERE `entry`=17406; -- Artificer
+UPDATE `creature_template` SET `gossip_menu_id`=7735 WHERE `entry`=18538; -- Ishanah <High Priestess of the Aldor>
+UPDATE `creature_template` SET `gossip_menu_id`=7734 WHERE `entry`=18596; -- Arcanist Adyria <The Scryers>
+UPDATE `creature_template` SET `gossip_menu_id`=7747 WHERE `entry`=18653; -- Seth
+UPDATE `creature_template` SET `gossip_menu_id`=10459 WHERE `entry`=33746; -- Silvermoon Champion
+UPDATE `creature_template` SET `gossip_menu_id`=10461 WHERE `entry`=33748; -- Thunder Bluff Champion
+UPDATE `creature_template` SET `gossip_menu_id`=10462 WHERE `entry`=33749; -- Undercity Champion
+
+-- gossip from sniff
+DELETE FROM `gossip_menu` WHERE (`entry`=201 AND `text_id`=698) OR (`entry`=3074 AND `text_id`=3807) OR (`entry`=3128 AND `text_id`=3864) OR (`entry`=3130 AND `text_id`=3854) OR (`entry`=3441 AND `text_id`=4193) OR (`entry`=3602 AND `text_id`=4354) OR (`entry`=3621 AND `text_id`=4394) OR (`entry`=3622 AND `text_id`=4393) OR (`entry`=3961 AND `text_id`=4813) OR (`entry`=3963 AND `text_id`=4815) OR (`entry`=4002 AND `text_id`=4856) OR (`entry`=4003 AND `text_id`=4857) OR (`entry`=4182 AND `text_id`=5276) OR (`entry`=4862 AND `text_id`=5938) OR (`entry`=4922 AND `text_id`=5981) OR (`entry`=6531 AND `text_id`=7733) OR (`entry`=6588 AND `text_id`=7801) OR (`entry`=6587 AND `text_id`=7802) OR (`entry`=6586 AND `text_id`=7803) OR (`entry`=6585 AND `text_id`=7804) OR (`entry`=7326 AND `text_id`=8703) OR (`entry`=7382 AND `text_id`=8838) OR (`entry`=7404 AND `text_id`=8873) OR (`entry`=7405 AND `text_id`=8874) OR (`entry`=7406 AND `text_id`=8875) OR (`entry`=7407 AND `text_id`=8876) OR (`entry`=7735 AND `text_id`=9457) OR (`entry`=7734 AND `text_id`=9452) OR (`entry`=7747 AND `text_id`=9486) OR (`entry`=8080 AND `text_id`=9986) OR (`entry`=8464 AND `text_id`=10573) OR (`entry`=8851 AND `text_id`=11492) OR (`entry`=10933 AND `text_id`=15194);
+INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
+(201, 698), -- 3678
+(3074, 3807), -- 10922
+(3128, 3864), -- 11019
+(3130, 3854), -- 10618
+(3441, 4193), -- 10857
+(3602, 4354), -- 11609
+(3621, 4394), -- 11554
+(3622, 4393), -- 11554
+(3961, 4813), -- 11625
+(3963, 4815), -- 11626
+(4002, 4856), -- 12246
+(4003, 4857), -- 12245
+(4182, 5276), -- 1466
+(4862, 5938), -- 6771
+(4922, 5981), -- 13085
+(6531, 7733), -- 15182
+(6588, 7801), -- 15169
+(6587, 7802), -- 15169
+(6586, 7803), -- 15169
+(6585, 7804), -- 15169
+(7326, 8703), -- 16817
+(7382, 8838), -- 17406
+(7404, 8873), -- 17291
+(7405, 8874), -- 17287
+(7406, 8875), -- 3848
+(7407, 8876), -- 17303
+(7735, 9457), -- 18538
+(7734, 9452), -- 18596
+(7747, 9486), -- 18653
+(8080, 9986), -- 17310
+(8464, 10573), -- 185126
+(8851, 11492), -- 4979
+(10933, 15194); -- 37200
+
+-- correct npc_flags for npc from sniff
+UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=8151; -- Nijel's Point Guard
+UPDATE `creature_template` SET `npcflag`=2 WHERE `entry`=24393; -- The Rokk <Master of Cooking>
+UPDATE `creature_template` SET `npcflag`=1 WHERE `entry`=37119; -- Highlord Tirion Fordring
+
+-- missing gossip from sniff
+DELETE FROM `gossip_menu_option` WHERE (`menu_id`=3622 AND `id`=0) OR (`menu_id`=4002 AND `id`=0) OR (`menu_id`=4003 AND `id`=0) OR (`menu_id`=6586 AND `id`=0) OR (`menu_id`=6587 AND `id`=0) OR (`menu_id`=6588 AND `id`=0) OR (`menu_id`=10456 AND `id`=0) OR (`menu_id`=10457 AND `id`=0) OR (`menu_id`=10461 AND `id`=0) OR (`menu_id`=10462 AND `id`=0);
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES
+(3622, 0, 0, 'How can I prove myself to the Timbermaw furbolg?', 1, 3, 3621, 0, 0, 0, ''), -- 11554
+(4002, 0, 1, 'Let me take a look at what you have to offer.', 3, 387, 0, 0, 0, 0, ''), -- 12246
+(4003, 0, 1, 'I am curious to see what a bucket of bolts has to offer.', 3, 131, 0, 0, 0, 0, ''), -- 12245
+(6586, 0, 0, 'And what do you say?', 1, 1, 6585, 0, 0, 0, ''), -- 15169
+(6587, 0, 0, 'What do they say?', 1, 1, 6586, 0, 0, 0, ''), -- 15169
+(6588, 0, 0, 'How do you know?', 1, 1, 6587, 0, 0, 0, ''), -- 15169
+(10456, 0, 0, 'I am ready to fight!', 1, 1, 0, 0, 0, 0, ''), -- 33743
+(10457, 0, 0, 'I am ready to fight!', 1, 1, 0, 0, 0, 0, ''), -- 33744
+(10461, 0, 0, 'I am ready to fight!', 1, 1, 0, 0, 0, 0, ''), -- 33748
+(10462, 0, 0, 'I am ready to fight!', 1, 1, 0, 0, 0, 0, ''); -- 33749
diff --git a/sql/old/3.3.5a/2012_07_22_07_world_sai.sql b/sql/old/3.3.5a/2012_07_22_07_world_sai.sql
new file mode 100644
index 00000000000..f8f42ef07da
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_07_world_sai.sql
@@ -0,0 +1,7 @@
+-- Add SAI for Liquid Pyrite ID: 33189 - remove auras to prevent exploit after used, also despawn
+SET @Pyrite := 33189;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Pyrite;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Pyrite;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Pyrite,0,0,1,8,0,100,0,67390,0,0,0,28,62494,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pyrite - On hit by spell Ride Vehicle - Remove auras from Liquid Pyrite'),
+(@Pyrite,0,1,0,61,0,100,0,0,0,0,0,41,15000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Pyrite - Linked with previous event - Despawn in 15 sec');
diff --git a/sql/old/3.3.5a/2012_07_22_08_world_sai.sql b/sql/old/3.3.5a/2012_07_22_08_world_sai.sql
new file mode 100644
index 00000000000..62b5a95f532
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_08_world_sai.sql
@@ -0,0 +1,16 @@
+-- Remove disables (instances scripts) for 10 and 25 version of achievement Dwarfageddon
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=10858 AND `type`=18;
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=10860 AND `type`=18;
+-- Insert the required spell credit markers for Dwarfageddon (10/25 player) achievements
+DELETE FROM `spell_dbc` WHERE `Id`=65387;
+INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES
+(65387, 0, 0, 545259776, 0, 5, 268697600, 128, 0, 16777216, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 0, 0, 0, 13, 0, -1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 7, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 'Steelforged Defender - Credit marker');
+-- Add SAI support for Dwarfageddon (10 and 25 player) achievement/also SAI for the NPC connected
+SET @Defender := 33236;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Defender;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Defender;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Defender,0,0,0,6,0,100,0,0,0,0,0,11,65387,0,0,0,0,0,16,0,0,0,0,0,0,0,'Steelforged Defender - On death - Cast achievement credit'),
+(@Defender,0,1,0,0,0,100,0,0,2500,9000,12000,11,62845,0,0,0,0,0,2,0,0,0,0,0,0,0,'Steelforged Defender - IC - Hamstring'),
+(@Defender,0,2,0,0,0,100,0,0,2600,13000,14000,11,50370,0,0,0,0,0,2,0,0,0,0,0,0,0,'Steelforged Defender - IC - Cast Sunder armor'),
+(@Defender,0,3,0,0,0,100,0,500,4000,4500,9000,11,57780,0,0,0,0,0,2,0,0,0,0,0,0,0,'Steelforged Defender - IC - Cast Lightening Bolt');
diff --git a/sql/old/3.3.5a/2012_07_22_09_world_creature_template.sql b/sql/old/3.3.5a/2012_07_22_09_world_creature_template.sql
new file mode 100644
index 00000000000..909b4cc238b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_09_world_creature_template.sql
@@ -0,0 +1,2 @@
+-- Add spells to Salvaged Chopper - 25 version
+UPDATE `creature_template` SET `spell1`=62974,`spell2`=62286,`spell3`=62299,`spell4`=64660, `mechanic_immune_mask`=344276858 WHERE `entry`=34045;
diff --git a/sql/old/3.3.5a/2012_07_22_10_world_creature_onkill_rep.sql b/sql/old/3.3.5a/2012_07_22_10_world_creature_onkill_rep.sql
new file mode 100644
index 00000000000..22d81bca548
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_10_world_creature_onkill_rep.sql
@@ -0,0 +1,2 @@
+-- Critter Fire Beetle should not give reputation with Honor Hold when killed
+DELETE FROM `creature_onkill_reputation` WHERE `creature_id` = 9699;
diff --git a/sql/old/3.3.5a/2012_07_22_11_world_conditions.sql b/sql/old/3.3.5a/2012_07_22_11_world_conditions.sql
new file mode 100644
index 00000000000..9ecb28307ba
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_11_world_conditions.sql
@@ -0,0 +1,4 @@
+-- Exarch Menelaous - Missing condition for gossip 7370
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7370 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,7370,0,0,0,9,9456,0,0,0,0,'','Exarch Menelaous - Show gossip option if player has quest 9456');
diff --git a/sql/old/3.3.5a/2012_07_22_12_world_creature_template.sql b/sql/old/3.3.5a/2012_07_22_12_world_creature_template.sql
new file mode 100644
index 00000000000..51e2b36d15d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_12_world_creature_template.sql
@@ -0,0 +1,2 @@
+-- Fix Night Elf Corpse (16804) so it can't be attacked
+UPDATE `creature_template` SET `unit_flags`=768, `dynamicflags`=40 WHERE `entry` = 16804;
diff --git a/sql/old/3.3.5a/2012_07_22_13_world_conditions.sql b/sql/old/3.3.5a/2012_07_22_13_world_conditions.sql
new file mode 100644
index 00000000000..896257d3f92
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_13_world_conditions.sql
@@ -0,0 +1,3 @@
+DELETE FROM conditions WHERE SourceTypeOrReferenceId=22 AND SourceEntry=160445;
+INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorTextId, ScriptName, Comment) VALUES
+(22, 1, 160445, 1, 0, 28, 0, 3821, 0, 0, 0, 0, '', 'Execute SmartAI for gameobject 160445 only if player has complete quest 3821');
diff --git a/sql/old/3.3.5a/2012_07_22_14_world_gameobject.sql b/sql/old/3.3.5a/2012_07_22_14_world_gameobject.sql
new file mode 100644
index 00000000000..bf77d1a625f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_14_world_gameobject.sql
@@ -0,0 +1,21 @@
+-- GO missing spawn
+-- Zone: Tanaris, Area: Land's End Beach or Finisterrae Beach
+SET @GO_ENTRY := 142189; -- GO Inconspicuous Landmark entry
+SET @GO_GUID := 329; -- Need one guid
+SET @POOL := 355; -- Need one entry
+
+DELETE FROM `gameobject` WHERE `id`=@GO_ENTRY;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(17499,@GO_ENTRY,1,1,1,-10249.2,-3981.8,1.66783,-0.750491,0,0,0.366501,-0.930418,900,100,1), -- Already in TDB
+(17498,@GO_ENTRY,1,1,1,-10119.7,-4052.46,5.33005,-0.366519,0,0,0.182236,-0.983255,900,100,1), -- Already in TDB
+(@GO_GUID,@GO_ENTRY,1,1,1,-10154.2,-3948.635,7.744733,2.652894,0,0,0.970295,0.241925,900,100,1);
+
+DELETE FROM `pool_template` WHERE `entry`=@POOL;
+INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES
+(@POOL,1 , 'GO Inconspicuous Landmark (142189)');
+
+DELETE FROM `pool_gameobject` WHERE `guid` IN (17498,17499,@GO_GUID);
+INSERT INTO `pool_gameobject` (`guid`,`pool_entry`,`chance`,`description`) VALUES
+(17498,@POOL,0, 'Inconspicuous Landmark'),
+(17499,@POOL,0, 'Inconspicuous Landmark'),
+(@GO_GUID,@POOL,0, 'Inconspicuous Landmark');
diff --git a/sql/old/3.3.5a/2012_07_22_15_world_sai.sql b/sql/old/3.3.5a/2012_07_22_15_world_sai.sql
new file mode 100644
index 00000000000..218eb9a3399
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_22_15_world_sai.sql
@@ -0,0 +1,27 @@
+-- SAI for quest 12150 "Reclusive Runemaster"
+SET @Dregmar := 27003;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@Dregmar;
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@Dregmar;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Dregmar AND `source_type`=0 AND `id` BETWEEN 0 AND 2;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Dregmar*100 AND `source_type`=9 AND `id` BETWEEN 0 AND 8;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Dregmar,0,0,0,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - on aggro - yell text 0'),
+(@Dregmar,0,1,0,2,0,100,1,0,50,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - at 50% HP - yell text 1'),
+(@Dregmar,0,2,0,2,0,100,0,0,20,0,0,80,@Dregmar*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - at 20% HP - run script'),
+(@Dregmar*100,9,0,0,0,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - set phase 1'),
+(@Dregmar*100,9,1,0,0,0,100,0,0,0,0,0,24,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - evade'),
+(@Dregmar*100,9,2,0,0,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - Stop combat'),
+(@Dregmar*100,9,3,0,0,0,100,0,0,0,0,0,18,33346,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - unitflags OutOfCombat'),
+(@Dregmar*100,9,4,0,0,0,100,0,0,0,0,0,75,48325,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - apply aura RUNE SHIELD'),
+(@Dregmar*100,9,5,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - yell text 2'),
+(@Dregmar*100,9,6,0,0,0,100,0,0,14000,0,0,11,48028,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - Complete quest on player range'),
+(@Dregmar*100,9,7,0,0,0,100,0,0,14000,0,0,19,514,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - unitflags reseted'),
+(@Dregmar*100,9,8,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dregmar Runebrand - force despawn');
+
+-- creature_text
+DELETE FROM `creature_ai_texts` WHERE `entry` BETWEEN -894 AND -892;
+DELETE FROM `creature_text` WHERE `entry`=@Dregmar AND `groupid` BETWEEN 0 AND 2;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@Dregmar,0,0, 'I know why you''ve come - one of those foolish Magnataur on the plains meddled and managed to get the dragons involved. Do you enjoy serving them like a dog?',14,0,100,0,0,0, 'Dregmar Runebrand - yell'),
+(@Dregmar,1,0, 'You seek their leader... little thing, you wage war against the clans of Grom''thar the Thunderbringer himself. Don''t be so eager to rush to your death.',14,0,100,0,0,0, 'Dregmar Runebrand yell'),
+(@Dregmar,2,0, 'Hah! So be it. Blow the horn of a magnataur leader at the ring of torches south of the Azure Dragonshrine. Make peace with your gods... Grom''thar will come.',14,0,100,0,0,0, 'Dregmar Runebrand yell');
diff --git a/sql/old/3.3.5a/2012_07_29_00_world_factionchange.sql b/sql/old/3.3.5a/2012_07_29_00_world_factionchange.sql
new file mode 100644
index 00000000000..ca6c36630bc
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_00_world_factionchange.sql
@@ -0,0 +1,9 @@
+-- Faction change item conversion for Reins of the Traveler's Tundra Mammoth
+DELETE FROM `player_factionchange_items` WHERE `alliance_id`=44235;
+INSERT INTO `player_factionchange_items` (`race_A`, `alliance_id`, `commentA`, `race_H`, `horde_id`, `commentH`) VALUES
+(0,44235,'Reins of the Traveler''s Tundra Mammoth',0,44234,'Reins of the Traveler''s Tundra Mammoth');
+
+-- Faction change spell conversion for Reins of the Traveler's Tundra Mammoth
+DELETE FROM `player_factionchange_spells` WHERE `alliance_id`=61425;
+INSERT INTO `player_factionchange_spells` (`alliance_id`,`horde_id`) VALUES
+(61425,61447);
diff --git a/sql/old/3.3.5a/2012_07_29_01_world_pool_quest.sql b/sql/old/3.3.5a/2012_07_29_01_world_pool_quest.sql
new file mode 100644
index 00000000000..0e0f192c8d7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_01_world_pool_quest.sql
@@ -0,0 +1,34 @@
+SET @pool_id := 356;
+
+DELETE FROM `pool_template` WHERE `entry` IN (@pool_id, @pool_id+1);
+INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES
+(@pool_id,1,'Wind Trader Zhareem - Daily Quests'),
+(@pool_id+1,1,'Nether-Stalker Mah''duun - Daily Quests');
+
+DELETE FROM `pool_quest` WHERE `entry` IN (11369,11384,11382,11363,11362,11375,11354,11386,11373,11378,11374,11372,11368,11388,11499,11370) AND `pool_entry` = @pool_id;
+DELETE FROM `pool_quest` WHERE `entry` IN (11389,11371,11376,11383,11364,11500,11385,11387) AND `pool_entry` = @pool_id+1;
+INSERT INTO `pool_quest` (`entry`,`pool_entry`,`description`) VALUES
+(11369,@pool_id,'Wanted: A Black Stalker Egg'),
+(11384,@pool_id,'Wanted: A Warp Splinter Clipping'),
+(11382,@pool_id,'Wanted: Aeonus''s Hourglass'),
+(11363,@pool_id,'Wanted: Bladefist''s Seal'),
+(11362,@pool_id,'Wanted: Keli''dan''s Feathered Stave'),
+(11375,@pool_id,'Wanted: Murmur''s Whisper'),
+(11354,@pool_id,'Wanted: Nazan''s Riding Crop'),
+(11386,@pool_id,'Wanted: Pathaleon''s Projector'),
+(11373,@pool_id,'Wanted: Shaffar''s Wondrous Pendant'),
+(11378,@pool_id,'Wanted: The Epoch Hunter''s Head'),
+(11374,@pool_id,'Wanted: The Exarch''s Soul Gem'),
+(11372,@pool_id,'Wanted: The Headfeathers of Ikiss'),
+(11368,@pool_id,'Wanted: The Heart of Quagmirran'),
+(11388,@pool_id,'Wanted: The Scroll of Skyriss'),
+(11499,@pool_id,'Wanted: The Signet Ring of Prince Kael''thas'),
+(11370,@pool_id,'Wanted: The Warlord''s Treatise'),
+(11389,@pool_id+1,'Wanted: Arcatraz Sentinels'),
+(11371,@pool_id+1,'Wanted: Coilfang Myrmidons'),
+(11376,@pool_id+1,'Wanted: Malicious Instructors'),
+(11383,@pool_id+1,'Wanted: Rift Lords'),
+(11364,@pool_id+1,'Wanted: Shattered Hand Centurions'),
+(11500,@pool_id+1,'Wanted: Sisters of Torment'),
+(11385,@pool_id+1,'Wanted: Sunseeker Channelers'),
+(11387,@pool_id+1,'Wanted: Tempest-Forge Destroyers');
diff --git a/sql/old/3.3.5a/2012_07_29_02_world_sai.sql b/sql/old/3.3.5a/2012_07_29_02_world_sai.sql
new file mode 100644
index 00000000000..1a452576139
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_02_world_sai.sql
@@ -0,0 +1,28 @@
+SET @Gossip :=9640;
+SET @NPCText :=13047;
+
+DELETE FROM `gossip_menu` WHERE `entry` = @Gossip;
+INSERT INTO `gossip_menu` VALUES
+(@Gossip,@NPCText);
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id` = @Gossip;
+INSERT INTO `gossip_menu_option` VALUES
+(@Gossip,0,0,"Soldier, you have new orders. You're to pull back and report to the sergeant!",1,1,0,0,0,0,NULL);
+
+UPDATE `creature_template` SET `gossip_menu_id` = @Gossip, AIName = 'SmartAI', `npcflag` = `npcflag`|1 WHERE `entry` = 28041;
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id` = 28041;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 28041 AND `source_type` = 0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 28041*100 AND `source_type` = 9;
+INSERT INTO `smart_scripts` VALUES
+(28041,0,0,0,0,0,100,0,8000,10000,8000,12000,11,50370,0,0,0,0,0,2,0,0,0,0,0,0,0,'Argent Soldier - Combat - Cast Sunder Armor'),
+(28041,0,1,2,62,0,100,0,@Gossip,0,0,0,33,28041,0,0,0,0,0,7,0,0,0,0,0,0,0,'Argent Soldier - On Gossip - Credit'),
+(28041,0,2,3,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Argent Soldier - Event Linked - Close Gossip'),
+(28041,0,3,4,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Argent Soldier - Event Linked - NpcFlag Remove'),
+(28041,0,4,0,61,0,100,0,0,0,0,0,80,2804100,0,2,0,0,0,1,0,0,0,0,0,0,0,'Argent Soldier - Event Linked - Run Script'),
+(28041*100,9,0,0,0,0,100,0,6000,6000,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Argent Soldier - Script 6 Seconds - Unseen'),
+(28041*100,9,1,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Argent Soldier - Script - Despawn');
+
+DELETE FROM `conditions` WHERE SourceTypeOrReferenceId= 15 AND SourceGroup=@Gossip;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15, @Gossip, 0, 0, 0, 9, 0, 12504, 0, 0, 0, 0, '', NULL);
diff --git a/sql/old/3.3.5a/2012_07_29_03_world_sai.sql b/sql/old/3.3.5a/2012_07_29_03_world_sai.sql
new file mode 100644
index 00000000000..d8ca1b12390
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_03_world_sai.sql
@@ -0,0 +1,7 @@
+-- [Q] Truce (11989)
+SET @ENTRY := 26423; -- Drakuru
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY, 0, 0, 1, 62, 0, 100, 0, 9615, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Drakuru - On Gossip Select - Close Gossip'),
+(@ENTRY, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 50016, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Drakuru - On Gossip Select - Give kill credit');
diff --git a/sql/old/3.3.5a/2012_07_29_04_world_sai.sql b/sql/old/3.3.5a/2012_07_29_04_world_sai.sql
new file mode 100644
index 00000000000..ef46c72f42c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_04_world_sai.sql
@@ -0,0 +1,17 @@
+UPDATE `creature` SET `spawntimesecs`=180 WHERE `id`=23689;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (23689,24170);
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=23689;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (23689,24170) AND `source_type`=0;
+insert into `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) values
+(23689,0,1,2,65,0,100,0,0,0,0,0,11,36809,2,0,0,0,0,1,0,0,0,0,0,0,0,'Proto-Drake - Reach Target - Cast Spell (36809)'),
+(23689,0,2,0,61,0,100,0,0,0,0,0,33,24170,0,0,0,0,0,18,35,0,0,0,0,0,0,'Draconis Gastritis Bunny - On Death - Quest Reward'),
+(23689,0,3,5,1,0,100,0,10000,10000,10000,10000,29,0,0,24170,1,1,0,19,24170,75,0,0,0,0,0,'Proto-Drake - Find Target - Follow'),
+(23689,0,4,0,65,0,100,0,0,0,0,0,51,0,0,0,0,0,0,19,24170,5,0,0,0,0,0,'Proto-Drake - Reach Target - Kill Dummy'),
+(23689,0,5,3,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Proto-Drake - On Find Target - Set Phase 1'),
+(23689,0,6,0,1,1,100,0,45000,45000,45000,45000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Proto-Drake - Idle on Ground(Phase 1) - Despawn'),
+(24170,0,0,0,54,0,100,0,0,0,0,0,50,186598,60000,0,0,0,0,1,0,0,0,0,0,0,0,'Draconis Gastritis Bunny - On Create - Spawn GO'),
+(24170,0,1,0,6,0,100,0,0,0,0,0,33,24170,0,0,0,0,0,18,20,0,0,0,0,0,0,'Draconis Gastritis Bunny - On Death - Quest Reward'),
+(24170,0,2,0,54,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Draconis Gastritis Bunny - On Create - Hide'),
+(24170,0,3,0,6,0,100,0,0,0,0,0,41,0,0,0,0,0,0,15,186598,5,0,0,0,0,0,'Draconis Gastritis Bunny - On Death - Remove Gobjects');
diff --git a/sql/old/3.3.5a/2012_07_29_05_world_sai.sql b/sql/old/3.3.5a/2012_07_29_05_world_sai.sql
new file mode 100644
index 00000000000..e1fd032eaca
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_05_world_sai.sql
@@ -0,0 +1,34 @@
+-- Life or Death (12296)
+
+SET @ENTRY := 27482; -- Wounded Westfall Infantry npc
+SET @SOURCETYPE := 0;
+SET @CREDIT := 27466; -- Kill Credit Bunny - Wounded Skirmishers npc
+SET @ITEM := 37576; -- Renewing Bandage item
+
+DELETE FROM `conditions` WHERE `SourceEntry`=@ITEM;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(18,0,@ITEM,0,24,1,@ENTRY,0,0,'', "Item Renewing Bandage target Wounded Westfall Infantry");
+
+-- Wounded Westfall Infantry SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,@SOURCETYPE,0,0,8,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"On creature spellhit - Set phasemask 1 - self"),
+(@ENTRY,@SOURCETYPE,1,0,1,1,100,0,0,0,3000,3000,1,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"On OOC - Talk - Self"),
+(@ENTRY,@SOURCETYPE,2,3,1,1,100,0,2000,2000,2000,2000,53,1,@ENTRY,0,12296,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"On OOC Update 2 sec - Start WP 1 - Self"),
+(@ENTRY,@SOURCETYPE,3,4,61,1,100,0,0,0,0,0,18,128,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Link - Set unit_flag 128 - Self"),
+(@ENTRY,@SOURCETYPE,4,5,61,1,100,0,0,0,0,0,33,@CREDIT,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"Link - Give credit - Invoker"),
+(@ENTRY,@SOURCETYPE,5,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Link - Set phasemask 2 - Self"),
+(@ENTRY,@SOURCETYPE,6,0,40,2,100,0,2,@ENTRY,0,0,41,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"On WP 2 - Force despawn - Self");
+
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@ENTRY,0,0,"I'd nearly given up.You've given me new life!",12,0,50,0,0,0,"Wounded Westfall Infantry say text"),
+(@ENTRY,0,1,"Bless you, friend.I nearly expired....",12,0,50,0,0,0,"Wounded Westfall Infantry say text"),
+(@ENTRY,0,2,"Without your help, I surely would have died....",12,0,50,0,0,0,"Wounded Westfall Infantry say text"),
+(@ENTRY,0,3,"Thank you $r.",12,0,50,0,0,0,"Wounded Westfall Infantry say text");
+
+DELETE FROM `waypoints` WHERE `entry`=@ENTRY;
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@ENTRY,1,4105.278809,-2917.963867,280.320129,'Wounded Westfall Infantry'),
+(@ENTRY,2,4048.682861,-2936.736572,275.191681,'Wounded Westfall Infantry');
diff --git a/sql/old/3.3.5a/2012_07_29_06_world_sai.sql b/sql/old/3.3.5a/2012_07_29_06_world_sai.sql
new file mode 100644
index 00000000000..03ebdfc6d0a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_06_world_sai.sql
@@ -0,0 +1,43 @@
+-- Remove previous fix
+DELETE FROM `gossip_menu` WHERE `entry` = 9640;
+DELETE FROM `gossip_menu_option` WHERE `menu_id` = 9640;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 28041 AND `source_type` = 0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 28041*100 AND `source_type` = 9;
+DELETE FROM `conditions` WHERE SourceTypeOrReferenceId= 15 AND SourceGroup = 9640;
+
+-- Argent Crusade, We Are Leaving! (12504)
+
+SET @ENTRY := 28041; -- Argent Soldier
+SET @SOURCETYPE := 0;
+SET @CREDIT := 50289; -- Argent Crusade, We Are Leaving!: Argent Soldier Quest Credit
+SET @MENUID := 9640;
+SET @OPTION := 0;
+
+UPDATE `creature_template` SET `gossip_menu_id`=@MENUID,`npcflag`=1,`AIName`='SmartAI' WHERE `entry`=@ENTRY;
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=@MENUID AND `id`=@OPTION;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES
+(@MENUID,@OPTION,0,"Soldier, you have new orders. You're to pull back and report to the sergeant!",1,1,0,0,0,0,'');
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY,@SOURCETYPE,0,0,0,0,100,0,8000,10000,8000,12000,11,50370,0,0,0,0,0,2,0,0,0,0,0,0,0,"IC - Cast Sunder Armor - Victim"),
+(@ENTRY,@SOURCETYPE,1,2,62,0,100,0,@MENUID,@OPTION,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"On gossip select - Close Gossip - Invoker"),
+(@ENTRY,@SOURCETYPE,2,3,61,0,100,0,0,0,0,0,11,@CREDIT,0,0,0,0,0,7,0,0,0,0,0,0,0,"On link - Cast credit spell - Invoker"),
+(@ENTRY,@SOURCETYPE,3,4,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"On link - Whisper - Invoker"),
+(@ENTRY,@SOURCETYPE,4,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"On link - Despawn - Self");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@MENUID AND `SourceEntry`=@OPTION;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,@MENUID,@OPTION,2,9,12504,0,0,0,'',"Show gossip option 0 if player has quest 12504 marked as taken");
+
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@ENTRY,0,0,"Careful here, $C. These trolls killed their own snake god!",15,0,50,0,0,0,"Argent Soldier whisper text"),
+(@ENTRY,0,1,"Watch your back. These Drakkari are a nasty lot.",15,0,50,0,0,0,"Argent Soldier whisper text"),
+(@ENTRY,0,2,"These Drakkari are just bad news. We need to leave and head back to Justice Keep!",15,0,50,0,0,0,"Argent Soldier whisper text"),
+(@ENTRY,0,3,"See you around.",15,0,50,0,0,0,"Argent Soldier whisper text"),
+(@ENTRY,0,4,"I wonder where we're headed to. And who's going to deal with these guys?",15,0,50,0,0,0,"Argent Soldier whisper text"),
+(@ENTRY,0,5,"Right. I'd better get back to the sergeant then.",15,0,50,0,0,0,"Argent Soldier whisper text"),
+(@ENTRY,0,6,"Are you $N? I heard you were dead.",15,0,50,0,0,0,"Argent Soldier whisper text");
diff --git a/sql/old/3.3.5a/2012_07_29_07_world_sai.sql b/sql/old/3.3.5a/2012_07_29_07_world_sai.sql
new file mode 100644
index 00000000000..18de6d15c0a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_07_world_sai.sql
@@ -0,0 +1,4 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid`=181758 AND `source_type`=1;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(181758, 1, 0, 0, 20, 0, 100, 0, 9561, 0, 0, 0, 56, 23846, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Add Nolkais Box after finishing quest: Nolkais Words');
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=181758;
diff --git a/sql/old/3.3.5a/2012_07_29_08_world_sai.sql b/sql/old/3.3.5a/2012_07_29_08_world_sai.sql
new file mode 100644
index 00000000000..796578d3f00
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_08_world_sai.sql
@@ -0,0 +1,36 @@
+-- Meeting at the Blackwing Coven quest fix
+
+-- Variables
+SET @QUEST := 10722;
+SET @ENTRY := 22019;
+SET @SPELL1:= 37704; -- Whirlwind
+SET @SPELL2:= 8599; -- Enrage
+
+-- Add SmartAI for Kolphis Darkscale
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,62,0,100,0,8439,0,0,0,15,@QUEST,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kolphis Darkscale - On Gossip Select - Quest Credit'),
+(@ENTRY,0,1,0,0,0,50,0,3000,3000,8000,8000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Kolphis Darkscale - Combat - Whirlwind'),
+(@ENTRY,0,2,3,2,0,100,1,0,25,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kolphis Darkscale - On Health level - Emote when below 25% HP'),
+(@ENTRY,0,3,0,61,0,100,1,0,0,0,0,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kolphis Darkscale - On Health level - Cast Enrage when below 25% HP');
+
+-- add missing text to Kolphis Darkscale from sniff
+DELETE FROM `npc_text` WHERE `ID`=10540;
+INSERT INTO `npc_text` (`ID`,`prob0`,`text0_0`,`text0_1`,`WDBVerified`) VALUES
+(10540,1,"Begone, overseer! We've already spoken.$B$BStop dragging your feet and execute your orders at Ruuan Weald!",'',1);
+
+-- Kolphis Darkscale emote
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@ENTRY,0,0,'%s becomes enraged!',16,0,100,0,0,0,'Kolphis Darkscale');
+
+-- Gossip menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=8436 AND `text_id`=10540;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8436,10540);
+
+-- Add gossip_menu conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=8436;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15,8436,0,0,0,9,0,@QUEST,0,0,0,0,'','Kolphis Darkscale - Show Gossip Option 0 - If on Quest Meeting at the Blackwing Coven'),
+(14,8436,10540,0,0,28,0,@QUEST,0,0,0,0,'','Kolphis Darkscale - Show Gossip Menu - If Quest Meeting at the Blackwing Coven is Completed');
diff --git a/sql/old/3.3.5a/2012_07_29_09_world_gossip_menu_option.sql b/sql/old/3.3.5a/2012_07_29_09_world_gossip_menu_option.sql
new file mode 100644
index 00000000000..66474bdb5e4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_09_world_gossip_menu_option.sql
@@ -0,0 +1,12 @@
+UPDATE `gossip_menu_option` SET
+ `npc_option_npcflag` = 65536,
+ `option_icon` = 5
+WHERE
+ `menu_id` = 1293 AND
+ `id` = 1;
+
+UPDATE `gossip_menu_option` SET
+ `npc_option_npcflag` = 128
+WHERE
+ `menu_id` = 1293 AND
+ `id` = 2;
diff --git a/sql/old/3.3.5a/2012_07_29_10_world_sai.sql b/sql/old/3.3.5a/2012_07_29_10_world_sai.sql
new file mode 100644
index 00000000000..c5513bf2f25
--- /dev/null
+++ b/sql/old/3.3.5a/2012_07_29_10_world_sai.sql
@@ -0,0 +1,23 @@
+-- [Q] Measuring Warp Energies
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN(20333,20336,20337,20338);
+UPDATE `creature_template` SET AIName='SmartAI' WHERE `entry` IN (20333,20336,20337,20338);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (20333,20336,20337,20338);
+INSERT INTO `smart_scripts` VALUES
+(20333,0,0,0,8,0,100,0,35113,0,0,0,33,20333,0,0,0,0,0,7,0,0,0,0,0,0,0,"Northern Pipe Credit Marker - Spellhit - Credit"),
+(20336,0,0,0,8,0,100,0,35113,0,0,0,33,20336,0,0,0,0,0,7,0,0,0,0,0,0,0,"Eastern Pipe Credit Marker - Spellhit - Credit"),
+(20337,0,0,0,8,0,100,0,35113,0,0,0,33,20337,0,0,0,0,0,7,0,0,0,0,0,0,0,"Southern Pipe Credit Marker - Spellhit - Credit"),
+(20338,0,0,0,8,0,100,0,35113,0,0,0,33,20338,0,0,0,0,0,7,0,0,0,0,0,0,0,"Western Pipe Credit Marker - Spellhit - Credit");
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=35113;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 35113, 0, 0, 31, 0, 3, 20333, 0, 0, 0, '', "Spell Search NPC 20333"),
+(13, 1, 35113, 0, 1, 31, 0, 3, 20336, 0, 0, 0, '', "Spell Search NPC 20336"),
+(13, 1, 35113, 0, 2, 31, 0, 3, 20337, 0, 0, 0, '', "Spell Search NPC 20337"),
+(13, 1, 35113, 0, 3, 31, 0, 3, 20338, 0, 0, 0, '', "Spell Search NPC 20338");
+
+UPDATE `creature` SET `position_x`=3214.92, `position_y`=4065.25, `position_z`=106.16 WHERE `id`=20333;
+UPDATE `creature` SET `position_x`=2755.55, `position_y`=3863.32, `position_z`=142.27 WHERE `id`=20336;
+UPDATE `creature` SET `position_x`=2819.01, `position_y`=4351.10, `position_z`=144.97 WHERE `id`=20337;
+UPDATE `creature` SET `position_x`=2947.31, `position_y`=4327.47, `position_z`=154.02 WHERE `id`=20338;
diff --git a/sql/old/3.3.5a/2012_08_01_00_world_sai.sql b/sql/old/3.3.5a/2012_08_01_00_world_sai.sql
new file mode 100644
index 00000000000..bf214cbfa9c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_01_00_world_sai.sql
@@ -0,0 +1,41 @@
+-- Fix [Qs] Words of Power /11640/11942/{A/H}
+-- 10x to Subv for giving me idea how to fix it
+SET @BEAM := 47848;
+SET @NECRO := 25378;
+SET @NECROguid := 300100;
+SET @NAFERSET := 26076;
+SET @Blast := 15587;
+SET @Renew:= 11640;
+SET @Corruption := 32063;
+SET @Shadow := 9613;
+-- Add spawns for the three necromancers
+DELETE FROM `creature` WHERE `guid` IN (@NECROguid,@NECROguid+1,@NECROguid+2);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `MovementType`) VALUES
+(@NECROguid, 25378, 571, 1, 3, 4101.931641, 3761.125000, 92.664742, 4.909590, 180, 0, 0, 0),
+(@NECROguid+1, 25378, 571, 1, 3, 4133.339355, 3743.313721, 92.670166, 3.474295, 180, 0, 0, 0),
+(@NECROguid+2, 25378, 571, 1, 3, 4121.242676, 3708.384766, 92.665283, 1.864472, 180, 0, 0, 0);
+-- Add SAI for En"kilah Necromancer
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@NECRO;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@NECRO;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@NECRO;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NECRO,0,0,0,1,0,100,0,10000,20000,180000,200000,11,@BEAM,0,0,0,0,0,11,@NAFERSET,30,0,0,0,0,0,' En"kilah Necromancer - OOC - Cast spell Purple Beam on Naferset'),
+(@NECRO,0,1,0,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,11,@NAFERSET,50,0,0,0,0,0,' En"kilah Necromancer - on death - Data set 0 1 on Hight Priest Nafarset'),
+(@NECRO,0,2,0,0,0,100,0,2000,3000,15000,16000,11,@Corruption,0,0,0,0,0,2,0,0,0,0,0,0,0,' En"kilah Necromancer - IC - Corruption'),
+(@NECRO,0,3,0,0,0,100,0,4000,6000,2000,6500,11,@Shadow,32,0,0,0,0,2,0,0,0,0,0,0,0, 'En"kilah Necromancer - Ic - Shadow Bolt');
+-- Add SAI for Hight Priest Naferset
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@NAFERSET;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@NAFERSET;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NAFERSET,0,0,0,38,0,100,0,0,1,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,' Hight Priest Nafarset - On Data set 0 1 - Increment event phase by 1'),
+(@NAFERSET,0,1,2,60,4,100,1,1000,2000,1000,2000,1,0,1000,0,0,0,0,1,0,0,0,0,0,0,0, 'Hight Priest Nafarset - On Event update /in event phase 3/ - Say text 0'),
+(@NAFERSET,0,2,3,61,4,100,0,0,0,0,0,19,33555200,0,0,0,0,0,1,0,0,0,0,0,0,0,' Hight Priest Nafarset - Linked with event 1 - Set field flags to 0'),
+(@NAFERSET,0,3,0,61,4,100,0,0,0,0,0,49,0,0,0,0,0,0,21,20,0,0,0,0,0,0,' Hight Priest Nafarset - Linked with event 2 - Attack start on closest player'),
+(@NAFERSET,0,4,0,0,4,100,0,4000,6000,5000,8000,11,@Blast,0,0,0,0,0,2,0,0,0,0,0,0,0,' Hight Priest Nafarset - IC - Cast spell Mind Blast'),
+(@NAFERSET,0,5,0,0,4,100,0,8000,12000,10000,15000,11,@Renew,0,0,0,0,0,1,0,0,0,0,0,0,0,' Hight Priest Nafarset - IC - Cast spell Renew on self'),
+(@NAFERSET,0,6,7,6,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,' Hight Priest Nafarset - On death - Data set 0 0'),
+(@NAFERSET,0,7,0,61,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,' Hight Priest Nafarset - Linked with event 6 - Reset');
+-- Hight Priest Naferset's Text
+DELETE FROM `creature_text` WHERE `entry`=@NAFERSET;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NAFERSET,0,0,'What is the meaning of this?! I have not yet finished my feast!',14,0,100,1,1000,0,'Nafarset on activation');
diff --git a/sql/old/3.3.5a/2012_08_01_01_world_creature.sql b/sql/old/3.3.5a/2012_08_01_01_world_creature.sql
new file mode 100644
index 00000000000..875a956fbd1
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_01_01_world_creature.sql
@@ -0,0 +1,9 @@
+SET @NECROguid := 300100;
+SET @NEWNECROguid := 42877;
+
+DELETE FROM `creature` WHERE `guid` IN (@NECROguid,@NECROguid+1,@NECROguid+2);
+DELETE FROM `creature` WHERE `guid` IN (@NEWNECROguid,@NEWNECROguid+1,@NEWNECROguid+2);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `MovementType`) VALUES
+(@NEWNECROguid, 25378, 571, 1, 3, 4101.931641, 3761.125000, 92.664742, 4.909590, 180, 0, 0, 0),
+(@NEWNECROguid+1, 25378, 571, 1, 3, 4133.339355, 3743.313721, 92.670166, 3.474295, 180, 0, 0, 0),
+(@NEWNECROguid+2, 25378, 571, 1, 3, 4121.242676, 3708.384766, 92.665283, 1.864472, 180, 0, 0, 0);
diff --git a/sql/old/3.3.5a/2012_08_01_02_world_loot.sql b/sql/old/3.3.5a/2012_08_01_02_world_loot.sql
new file mode 100644
index 00000000000..a27bd274acf
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_01_02_world_loot.sql
@@ -0,0 +1,4 @@
+-- Add quest item "Bleeding Hollow Torch" to "Bleeding Hollow Peon" loot template
+DELETE FROM `creature_loot_template` WHERE `entry`=16907 and `item`=31347;
+INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
+(16907,31347,-50,1,0,1,1);
diff --git a/sql/old/3.3.5a/2012_08_02_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_08_02_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..f14e44e35ff
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_02_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=-603;
+INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
+(-603,'spell_warl_curse_of_doom');
diff --git a/sql/old/3.3.5a/2012_08_04_00_world_disables.sql b/sql/old/3.3.5a/2012_08_04_00_world_disables.sql
new file mode 100644
index 00000000000..f3f197ba23a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_00_world_disables.sql
@@ -0,0 +1,219 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (73,108,241,242,259,326,327,352,390,406,462,490,497,534,548,612,636,740,774,796,797,798,799,800,801,802,803,810,811,814,820,839,856,859,904,946,987,988,989,1128,1129,1155,1156,1157,1158,1161,1162,1163,1165,1263,1272,1277,1278,1279,1280,1281,1283,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1390,1397,1441,1443,1460,1461,1533,1537,1538,1659,1660,1662,1663,1664,2020,2971,3023,3064,3241,3383,3401,3403,3404,3405,3422,3423,3424,3425,3515,3516,3529,3530,3531,3622,3623,3624,3885,3910,4323,4541,4905,5053,5205,5207,5208,5209,5303,5304,5506,5512,5516,5520,5523,5532,5653,5659,5664,5665,5666,5667,5668,5669,5670,5671,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,6003,6165,6202,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6841,6842,7069,7904,8002,8244,8245,8247,8248,8337,8339,8340,8444,8445,8448,8449,8450,8451,8452,8453,8454,8458,8459,8571,9031,9306,9307,9445,9596,9597,9599,9679,9745,10370,10402,10616,10743,10890,11127);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,73,0,'','','Deprecated quest: <TXT> No Reward'),
+(1,108,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,241,0,'','','Deprecated quest: <TEST> HEY MISTER WILSON!'),
+(1,242,0,'','','Deprecated quest: <UNUSED>'),
+(1,259,0,'','','Deprecated quest: <UNUSED>'),
+(1,326,0,'','','Deprecated quest: <UNUSED>'),
+(1,327,0,'','','Deprecated quest: <UNUSED>'),
+(1,352,0,'','','Deprecated quest: <UNUSED>'),
+(1,390,0,'','','Deprecated quest: <UNUSED>'),
+(1,406,0,'','','Deprecated quest: <UNUSED>'),
+(1,462,0,'','','Deprecated quest: <UNUSED>'),
+(1,490,0,'','','Deprecated quest: <UNUSED>'),
+(1,497,0,'','','Deprecated quest: <UNUSED>'),
+(1,534,0,'','','Deprecated quest: <UNUSED>'),
+(1,548,0,'','','Deprecated quest: <NYI> <TXT> Bloodstone Pendant'),
+(1,612,0,'','','Deprecated quest: <UNUSED>'),
+(1,636,0,'','','Deprecated quest: Legends of the Earth <NYI>'),
+(1,740,0,'','','Deprecated quest: <UNUSED>'),
+(1,774,0,'','','Deprecated quest: <UNUSED>'),
+(1,796,0,'','','Deprecated quest: <UNUSED>'),
+(1,797,0,'','','Deprecated quest: <UNUSED>'),
+(1,798,0,'','','Deprecated quest: <UNUSED>'),
+(1,799,0,'','','Deprecated quest: <UNUSED>'),
+(1,800,0,'','','Deprecated quest: <UNUSED>'),
+(1,801,0,'','','Deprecated quest: <UNUSED>'),
+(1,802,0,'','','Deprecated quest: <UNUSED>'),
+(1,803,0,'','','Deprecated quest: <UNUSED>'),
+(1,810,0,'','','Deprecated quest: <UNUSED>'),
+(1,811,0,'','','Deprecated quest: <UNUSED>'),
+(1,814,0,'','','Deprecated quest: <UNUSED>'),
+(1,820,0,'','','Deprecated quest: <UNUSED>'),
+(1,839,0,'','','Deprecated quest: <UNUSED>'),
+(1,856,0,'','','Deprecated quest: <UNUSED>'),
+(1,859,0,'','','Deprecated quest: <UNUSED>'),
+(1,904,0,'','','Deprecated quest: <UNUSED>'),
+(1,946,0,'','','Deprecated quest: <UNUSED>'),
+(1,987,0,'','','Deprecated quest: <UNUSED>'),
+(1,988,0,'','','Deprecated quest: <UNUSED>'),
+(1,989,0,'','','Deprecated quest: <UNUSED>'),
+(1,1128,0,'','','Deprecated quest: <NYI> The Gnome Pit Crew is Thirsty'),
+(1,1129,0,'','','Deprecated quest: <NYI> The Goblin Pit Crew is Thirsty'),
+(1,1155,0,'','','Deprecated quest: <NYI> <TXT> bug crystal side quest'),
+(1,1156,0,'','','Deprecated quest: <NYI> <TXT> speak to alchemist pestlezugg'),
+(1,1157,0,'','','Deprecated quest: <NYI> <TXT> pestlezugg needs items'),
+(1,1158,0,'','','Deprecated quest: <NYI> <TXT> speak to rabine saturna'),
+(1,1161,0,'','','Deprecated quest: <NYI> <TXT> gossip shade of ambermoon'),
+(1,1162,0,'','','Deprecated quest: <NYI> <TXT> speak to hamuul runetotem'),
+(1,1163,0,'','','Deprecated quest: <NYI> <TXT> speak to tyrande whisperwind'),
+(1,1165,0,'','','Deprecated quest: <NYI> Ore for the Races'),
+(1,1263,0,'','','Deprecated quest: The Burning Inn <CHANGE TO GOSSIP>'),
+(1,1272,0,'','','Deprecated quest: Finding Reethe <CHANGE INTO GOSSIP>'),
+(1,1277,0,'','','Deprecated quest: <nyi> <TXT> The Centaur Hoofprints'),
+(1,1278,0,'','','Deprecated quest: <nyi> <TXT> The Grim Totem Clan'),
+(1,1279,0,'','','Deprecated quest: <nyi> <TXT>The Centaur Hoofprints'),
+(1,1280,0,'','','Deprecated quest: <nyi> <TXT>The Centaur Hoofprints'),
+(1,1281,0,'','','Deprecated quest: Jim''s Song <CHANGE TO GOSSIP>'),
+(1,1283,0,'','','Deprecated quest: Fire at the Shady Rest <CHANGE TO GOSSIP>'),
+(1,1289,0,'','','Deprecated quest: <nyi> Vimes''s Report'),
+(1,1290,0,'','','Deprecated quest: <nyi> Investigating Mosarn'),
+(1,1291,0,'','','Deprecated quest: <nyi> <TXT> Centaur Hoofprints'),
+(1,1292,0,'','','Deprecated quest: <nyi><TXT> Centaur Hoofprints'),
+(1,1293,0,'','','Deprecated quest: <nyi> <TXT> Centaur Hoofprints'),
+(1,1294,0,'','','Deprecated quest: <nyi> <TXT>Centaur Sympathies'),
+(1,1295,0,'','','Deprecated quest: <nyi> <TXT> Course of Action'),
+(1,1296,0,'','','Deprecated quest: <nyi> <TXT> Course of Action'),
+(1,1297,0,'','','Deprecated quest: <nyi> <TXT> Course of Action'),
+(1,1298,0,'','','Deprecated quest: <nyi> <TXT> Thrall''s Dirty Work'),
+(1,1299,0,'','','Deprecated quest: <nyi> <TXT> Thrall''s Dirty Work'),
+(1,1300,0,'','','Deprecated quest: <nyi> <TXT> Lorn Grim Totem'),
+(1,1390,0,'','','Deprecated quest: <nyi> Oops, We Killed Them Again.'),
+(1,1397,0,'','','Deprecated quest: <nyi> Saved!'),
+(1,1441,0,'','','Deprecated quest: <UNUSED>'),
+(1,1443,0,'','','Deprecated quest: <nyi> The Shakedown'),
+(1,1460,0,'','','Deprecated quest: <UNUSED>'),
+(1,1461,0,'','','Deprecated quest: <UNUSED>'),
+(1,1533,0,'','','Deprecated quest: <NYI> Call of Air'),
+(1,1537,0,'','','Deprecated quest: <NYI> Call of Air'),
+(1,1538,0,'','','Deprecated quest: <NYI> Call of Air'),
+(1,1659,0,'','','Deprecated quest: <UNUSED>'),
+(1,1660,0,'','','Deprecated quest: <UNUSED>'),
+(1,1662,0,'','','Deprecated quest: <UNUSED>'),
+(1,1663,0,'','','Deprecated quest: <UNUSED>'),
+(1,1664,0,'','','Deprecated quest: <UNUSED>'),
+(1,2020,0,'','','Deprecated quest: <UNUSED>'),
+(1,2971,0,'','','Deprecated quest: <UNUSED>'),
+(1,3023,0,'','','Deprecated quest: <UNUSED>'),
+(1,3064,0,'','','Deprecated quest: <NYI> <TXT> Pirate Hats'),
+(1,3241,0,'','','Deprecated quest: <NYI> <TXT><redux> Dreadmist Peak'),
+(1,3383,0,'','','Deprecated quest: <UNUSED>'),
+(1,3401,0,'','','Deprecated quest: <UNUSED>'),
+(1,3403,0,'','','Deprecated quest: <UNUSED>'),
+(1,3404,0,'','','Deprecated quest: <UNUSED>'),
+(1,3405,0,'','','Deprecated quest: <UNUSED>'),
+(1,3422,0,'','','Deprecated quest: <UNUSED>'),
+(1,3423,0,'','','Deprecated quest: <UNUSED>'),
+(1,3424,0,'','','Deprecated quest: <UNUSED>'),
+(1,3425,0,'','','Deprecated quest: <UNUSED>'),
+(1,3515,0,'','','Deprecated quest: <UNUSED>'),
+(1,3516,0,'','','Deprecated quest: <UNUSED>'),
+(1,3529,0,'','','Deprecated quest: <UNUSED>'),
+(1,3530,0,'','','Deprecated quest: <UNUSED>'),
+(1,3531,0,'','','Deprecated quest: <UNUSED>'),
+(1,3622,0,'','','Deprecated quest: <UNUSED>'),
+(1,3623,0,'','','Deprecated quest: <UNUSED>'),
+(1,3624,0,'','','Deprecated quest: <UNUSED>'),
+(1,3885,0,'','','Deprecated quest: <NYI> <TXT> The Gadgetzan Run'),
+(1,3910,0,'','','Deprecated quest: <NYI> <TXT> The Un''Goro Run'),
+(1,4323,0,'','','Deprecated quest: <NYI> <TXT> Get those Hyenas!!!'),
+(1,4541,0,'','','Deprecated quest: <NYI> <TXT>'),
+(1,4905,0,'','','Deprecated quest: <UNUSED>'),
+(1,5053,0,'','','Deprecated quest: <UNUSED>'),
+(1,5205,0,'','','Deprecated quest: <UNUSED>'),
+(1,5207,0,'','','Deprecated quest: <NYI> <TXT> The True Summoner'),
+(1,5208,0,'','','Deprecated quest: <NYI> <TXT> The Blessing of Evil'),
+(1,5209,0,'','','Deprecated quest: <UNUSED>'),
+(1,5303,0,'','','Deprecated quest: <UNUSED>'),
+(1,5304,0,'','','Deprecated quest: <UNUSED>'),
+(1,5506,0,'','','Deprecated quest: <UNUSED>'),
+(1,5512,0,'','','Deprecated quest: <UNUSED>'),
+(1,5516,0,'','','Deprecated quest: <UNUSED>'),
+(1,5520,0,'','','Deprecated quest: <UNUSED>'),
+(1,5523,0,'','','Deprecated quest: <UNUSED>'),
+(1,5532,0,'','','Deprecated quest: <NYI> <TXT> Ring of the Dawn'),
+(1,5653,0,'','','Deprecated quest: <NYI> Hex of Weakness'),
+(1,5659,0,'','','Deprecated quest: <NYI> Touch of Weakness'),
+(1,5664,0,'','','Deprecated quest: <UNUSED>'),
+(1,5665,0,'','','Deprecated quest: <UNUSED>'),
+(1,5666,0,'','','Deprecated quest: <UNUSED>'),
+(1,5667,0,'','','Deprecated quest: <UNUSED>'),
+(1,5668,0,'','','Deprecated quest: <NYI> A Blessing of Light'),
+(1,5669,0,'','','Deprecated quest: <NYI> A Blessing of Light'),
+(1,5670,0,'','','Deprecated quest: <NYI> A Blessing of Light'),
+(1,5671,0,'','','Deprecated quest: <NYI> A Blessing of Light'),
+(1,5681,0,'','','Deprecated quest: <UNUSED>'),
+(1,5682,0,'','','Deprecated quest: <UNUSED>'),
+(1,5683,0,'','','Deprecated quest: <UNUSED>'),
+(1,5684,0,'','','Deprecated quest: <UNUSED>'),
+(1,5685,0,'','','Deprecated quest: <NYI> <TXT> The Light Protects You'),
+(1,5686,0,'','','Deprecated quest: <NYI> The Light Protects You'),
+(1,5687,0,'','','Deprecated quest: <NYI> The Light Protects You'),
+(1,5688,0,'','','Deprecated quest: <NYI> <TXT> A Touch of Voodoo'),
+(1,5689,0,'','','Deprecated quest: <NYI> A Touch of Voodoo'),
+(1,5690,0,'','','Deprecated quest: <NYI> <TXT> A Touch of Voodoo'),
+(1,5691,0,'','','Deprecated quest: <NYI> <TXT> In the Dark it was Created'),
+(1,5692,0,'','','Deprecated quest: <NYI> In the Dark It was Created'),
+(1,5693,0,'','','Deprecated quest: <NYI> In the Dark It was Created'),
+(1,5694,0,'','','Deprecated quest: <UNUSED>'),
+(1,5695,0,'','','Deprecated quest: <UNUSED>'),
+(1,5696,0,'','','Deprecated quest: <UNUSED>'),
+(1,5697,0,'','','Deprecated quest: <UNUSED>'),
+(1,5698,0,'','','Deprecated quest: <NYI> <TXT> A Small Amount of Hope'),
+(1,5699,0,'','','Deprecated quest: <NYI> A Small Amount of Hope'),
+(1,5700,0,'','','Deprecated quest: <NYI> A Small Amount of Hope'),
+(1,5701,0,'','','Deprecated quest: <NYI> <TXT> The Rites of Old'),
+(1,5702,0,'','','Deprecated quest: <NYI> The Rites of Old'),
+(1,5703,0,'','','Deprecated quest: <NYI> The Rites of Old'),
+(1,5704,0,'','','Deprecated quest: <NYI> <TXT> Undead Priest Robe'),
+(1,5705,0,'','','Deprecated quest: <NYI> No Longer a Shadow'),
+(1,5706,0,'','','Deprecated quest: <NYI> No Longer a Shadow'),
+(1,5707,0,'','','Deprecated quest: <NYI> <TXT> Flirting With Darkness'),
+(1,5708,0,'','','Deprecated quest: <NYI> Flirting With Darkness'),
+(1,5709,0,'','','Deprecated quest: <NYI> Flirting With Darkness'),
+(1,5710,0,'','','Deprecated quest: <NYI> <TXT> Troll Priest Robe'),
+(1,5711,0,'','','Deprecated quest: <NYI> The Lost Ways'),
+(1,5712,0,'','','Deprecated quest: <NYI> The Lost Ways'),
+(1,6003,0,'','','Deprecated quest: <nyi> <txt> Green With Envy'),
+(1,6165,0,'','','Deprecated quest: <NYI> <TXT> Archmage Timolain''s Remains'),
+(1,6202,0,'','','Deprecated quest: <UNUSED> Good and Evil'),
+(1,6702,0,'','','Deprecated quest: <TXT> SF,RFK,GNOMER,BF'),
+(1,6703,0,'','','Deprecated quest: <TXT> SF,RFK,GNOMER,BF - Repeatable'),
+(1,6704,0,'','','Deprecated quest: <TXT> SM,RFD,ULD'),
+(1,6705,0,'','','Deprecated quest: <TXT> SM,RFD,ULD - Repeatable'),
+(1,6706,0,'','','Deprecated quest: <TXT> ZUL,ST,MAR'),
+(1,6707,0,'','','Deprecated quest: <TXT> ZUL,ST,MAR - Repeatable'),
+(1,6708,0,'','','Deprecated quest: <TXT> BRD,DM,BRS'),
+(1,6709,0,'','','Deprecated quest: <TXT> BRD,DM,BRS - Repeatable'),
+(1,6710,0,'','','Deprecated quest: <TXT> UBRS,STRATH,SCHOL'),
+(1,6711,0,'','','Deprecated quest: <TXT> UBRS,STRATH,SCHOL - Repeatable'),
+(1,6841,0,'','','Deprecated quest: <UNUSED>'),
+(1,6842,0,'','','Deprecated quest: <UNUSED>'),
+(1,7069,0,'','','Deprecated quest: <UNUSED>'),
+(1,7904,0,'','','Deprecated quest: <UNUSED>'),
+(1,8002,0,'','','Deprecated quest: Silverwing Sentinels <NYI> <TXT>'),
+(1,8244,0,'','','Deprecated quest: <UNUSED>'),
+(1,8245,0,'','','Deprecated quest: <UNUSED>'),
+(1,8247,0,'','','Deprecated quest: <UNUSED>'),
+(1,8248,0,'','','Deprecated quest: <UNUSED>'),
+(1,8337,0,'','','Deprecated quest: <UNUSED>'),
+(1,8339,0,'','','Deprecated quest: Royalty of the Council <NYI> <TXT> UNUSED'),
+(1,8340,0,'','','Deprecated quest: Twilight Signet Ring <NYI> <TXT>'),
+(1,8444,0,'','','Deprecated quest: <NYI> <TXT> gossip shade of ambermoon'),
+(1,8445,0,'','','Deprecated quest: <NYI> <TXT> gossip shade of ambermoon'),
+(1,8448,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8449,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8450,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8451,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8452,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8453,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8454,0,'','','Deprecated quest: <TXT> Mystery Reward'),
+(1,8458,0,'','','Deprecated quest: <UNUSED>'),
+(1,8459,0,'','','Deprecated quest: <UNUSED>'),
+(1,8571,0,'','','Deprecated quest: <UNUSED> Armor Kits'),
+(1,9031,0,'','','Deprecated quest: <TXT>Anthion''s Parting Words'),
+(1,9306,0,'','','Deprecated quest: <DEPRECATED>Speak with Vindicator Aldar'),
+(1,9307,0,'','','Deprecated quest: <DEPRECATED>Compassion'),
+(1,9445,0,'','','Deprecated quest: <NYI><TXT>Placeholder: A Worthy Offering'),
+(1,9596,0,'','','Deprecated quest: <DEPRECATED>Control'),
+(1,9597,0,'','','Deprecated quest: <UNUSED>'),
+(1,9599,0,'','','Deprecated quest: <UNUSED>'),
+(1,9679,0,'','','Deprecated quest: <NYI>Return to Knight-Lord Bloodvalor'),
+(1,9745,0,'','','Deprecated quest: <DEPRECATED>Suppressing the Flame'),
+(1,10370,0,'','','Deprecated quest: Nazgrel''s Command <TXT>'),
+(1,10402,0,'','','Deprecated quest: <TXT>'),
+(1,10616,0,'','','Deprecated quest: <nyi>Breadcrumb'),
+(1,10743,0,'','','Deprecated quest: [DEPRECATED]<txt>Hero of the Mok''Nathal'),
+(1,10890,0,'','','Deprecated quest: [UNUSED] <NYI> '),
+(1,11127,0,'','','Deprecated quest: <NYI>Thunderbrew Secrets');
diff --git a/sql/old/3.3.5a/2012_08_04_01_world_disables.sql b/sql/old/3.3.5a/2012_08_04_01_world_disables.sql
new file mode 100644
index 00000000000..ca9f62564d5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_01_world_disables.sql
@@ -0,0 +1,50 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (3631,4487,4488,4489,4490,4183,4184,4185,4186,4223,4224,402,550,620,785,908,909,9662,11179,11461,12087,12103,12108,12156,12426,12682,12764,12765,24222,24227,10452,10453,11125,11179,11437,11438,11444,11445,11974,12179,12228,12233,12590,14119,14147,14148,14149,14150);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1, 402,0,'','','Deprecated quest: Sirra is Busy'),
+(1, 550,0,'','','Deprecated quest: Battle of Hillsbrad'),
+(1, 620,0,'','','Deprecated quest: The Monogrammed Sash'),
+(1, 785,0,'','','Deprecated quest: A Strategic Alliance'),
+(1, 908,0,'','','Deprecated quest: A Strategic Alliance'),
+(1, 909,0,'','','Deprecated quest: A Strategic Alliance'),
+(1,3631,0,'','','Deprecated quest: Summon Felsteed'),
+(1,4487,0,'','','Deprecated quest: Summon Felsteed'),
+(1,4488,0,'','','Deprecated quest: Summon Felsteed'),
+(1,4489,0,'','','Deprecated quest: Summon Felsteed'),
+(1,4490,0,'','','Deprecated quest: Summon Felsteed'),
+(1,4183,0,'','','Deprecated quest: The True Masters'),
+(1,4184,0,'','','Deprecated quest: The True Masters'),
+(1,4185,0,'','','Deprecated quest: The True Masters'),
+(1,4186,0,'','','Deprecated quest: The True Masters'),
+(1,4223,0,'','','Deprecated quest: The True Masters'),
+(1,4224,0,'','','Deprecated quest: The True Masters'),
+-- some random ones:
+(1, 9662,0,'','','Deprecated quest:Deprecated: Keanna''s Freedom'),
+(1,11179,0,'','','Deprecated quest:[Temporarily Deprecated Awaiting a New Mob]Finlay Is Gutless'),
+(1,11461,0,'','','Deprecated quest:DEPRECATED'),
+(1,12087,0,'','','Deprecated quest:A Little Help Here? DEPRECATED'),
+(1,12103,0,'','','Deprecated quest:DEPRECATED'),
+(1,12108,0,'','','Deprecated quest:DEPRECATED'),
+(1,12156,0,'','','Deprecated quest:DEPRECAED'),
+(1,12426,0,'','','Deprecated quest:DEPRECATED'),
+(1,12682,0,'','','Deprecated quest:Uncharted Territory (DEPRECATED)'),
+(1,12764,0,'','','Deprecated quest:The Secret to Kungaloosh (DEPRECATED)'),
+(1,12765,0,'','','Deprecated quest:Kungaloosh (DEPRECATED)'),
+(1,24222,0,'','','Deprecated quest:Call to Arms: Eye of the Storm DEPRECATED'),
+(1,24227,0,'','','Deprecated quest:DEPRECATED'),
+(1,10452,0,'','','Deprecated quest:DON''T USE [PH] Fel Orc 1'),
+(1,10453,0,'','','Deprecated quest:DON''T USE [PH] Fel Orc bread'),
+(1,11125,0,'','','Deprecated quest:[PH] New Hinterlands Quest'),
+(1,11437,0,'','','Deprecated quest:[PH] Beer Garden A'),
+(1,11438,0,'','','Deprecated quest:[PH] Beer Garden B'),
+(1,11444,0,'','','Deprecated quest:[PH] Beer Garden A'),
+(1,11445,0,'','','Deprecated quest:[PH] Beer Garden B'),
+(1,11974,0,'','','Deprecated quest:[ph] Now, When I Grow Up...'),
+(1,12179,0,'','','Deprecated quest:Specialization 1 [PH]'),
+(1,12228,0,'','','Deprecated quest:Reacquiring the Magic [PH]'),
+(1,12233,0,'','','Deprecated quest:[Depricated]Sewing Your Seed'),
+(1,12590,0,'','','Deprecated quest:Blahblah[PH]'),
+(1,14119,0,'','','Deprecated quest:Blank [PH]'),
+(1,14147,0,'','','Deprecated quest:Blank [PH]'),
+(1,14148,0,'','','Deprecated quest:Blank [PH]'),
+(1,14149,0,'','','Deprecated quest:Blank [PH]'),
+(1,14150,0,'','','Deprecated quest:Blank [PH]');
diff --git a/sql/old/3.3.5a/2012_08_04_02_world_disables.sql b/sql/old/3.3.5a/2012_08_04_02_world_disables.sql
new file mode 100644
index 00000000000..cccc7141d68
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_02_world_disables.sql
@@ -0,0 +1,23 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (7790,8152,8237,8971,8972,8973,8974,8975,8976,9296,9750,10145,10207,10549,11493,11588,11589,11997,12313,13840,24797);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,7790,0,'','','Deprecated quest: REUSE'),
+(1,8152,0,'','','Deprecated quest: REUSE'),
+(1,8237,0,'','','Deprecated quest: REUSE'),
+(1,8971,0,'','','Deprecated quest: REUSE'),
+(1,8972,0,'','','Deprecated quest: REUSE'),
+(1,8973,0,'','','Deprecated quest: REUSE'),
+(1,8974,0,'','','Deprecated quest: REUSE'),
+(1,8975,0,'','','Deprecated quest: REUSE'),
+(1,8976,0,'','','Deprecated quest: REUSE'),
+(1,9296,0,'','','Deprecated quest: reuse'),
+(1,9750,0,'','','Deprecated quest: UNUSED Urgent Delivery'),
+(1,10145,0,'','','Deprecated quest: Mission: Sever the Tie UNUSED'),
+(1,10207,0,'','','Deprecated quest: Forward Base: Reaver''s Fall REUSE'),
+(1,10549,0,'','','Deprecated quest: REUSE'),
+(1,11493,0,'','','Deprecated quest: UNUSED'),
+(1,11588,0,'','','Deprecated quest: REUSE'),
+(1,11589,0,'','','Deprecated quest: REUSE'),
+(1,11997,0,'','','Deprecated quest: REUSE'),
+(1,12313,0,'','','Deprecated quest: UNUSED Save Brewfest!'),
+(1,13840,0,'','','Deprecated quest: REUSE'),
+(1,24797,0,'','','Deprecated quest: REUSE');
diff --git a/sql/old/3.3.5a/2012_08_04_03_world_disables.sql b/sql/old/3.3.5a/2012_08_04_03_world_disables.sql
new file mode 100644
index 00000000000..e2d1ca1ff6b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_03_world_disables.sql
@@ -0,0 +1,38 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (9754,9755,10215,11522,12445,12731,12923,13541,7797,7869,7870,7906,9378,9611,9880,9881,9908,9909,9949,9950,10088,10181,10214,10454,11197,11226,11577,11874,11937,12485,12600,13123,13210,13317,13990);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,9754,0,'','','Deprecated quest: '),
+(1,9755,0,'','','Deprecated quest: '),
+(1,10215,0,'','','Deprecated quest: '),
+(1,11522,0,'','','Deprecated quest: '),
+(1,12445,0,'','','Deprecated quest: '),
+(1,12731,0,'','','Deprecated quest: '),
+(1,12923,0,'','','Deprecated quest: '),
+(1,13541,0,'','','Deprecated quest: '),
+-- some others that contain a -
+(1,7797,0,'','','Deprecated quest: Dimensional Ripper - Everlook'),
+(1,7869,0,'','','Deprecated quest: test quest - do not use'),
+(1,7870,0,'','','Deprecated quest: test quest2 - do not use'),
+(1,7906,0,'','','Deprecated quest: Darkmoon Cards - Beasts'),
+(1,9378,0,'','','Deprecated quest: DND FLAG The Dread Citadel - Naxxramas'),
+(1,9611,0,'','','Deprecated quest: Azuremyst: aa - A - Quest Flag 000'),
+(1,9880,0,'','','Deprecated quest: Hellfire Penninsula: -pn - A - ToWoW - Hellfire Turnin Cap'),
+(1,9881,0,'','','Deprecated quest: Hellfire Penninsula: -pn - H - ToWoW - Hellfire Turnin Cap'),
+(1,9908,0,'','','Deprecated quest: Hellfire Penninsula: -pn - A - ToWoW - Hellfire Turnin'),
+(1,9909,0,'','','Deprecated quest: Hellfire Penninsula: -pn - H - ToWoW - Hellfire Turnin'),
+(1,9949,0,'','','Deprecated quest: A Bird''s-Eye View'),
+(1,9950,0,'','','Deprecated quest: A Bird''s-Eye View'),
+(1,10088,0,'','','Deprecated quest: When This Mine''s a-Rockin'''),
+(1,10181,0,'','','Deprecated quest: Collector''s Edition: -pn - E - FLAG'),
+(1,10214,0,'','','Deprecated quest: When This Mine''s a-Rockin'''),
+(1,10454,0,'','','Deprecated quest: FLAG - OFF THE RAILS'),
+(1,11197,0,'','','Deprecated quest: ZZOLD Upper Deck Promo - Ghost Wolf Mount OLD'),
+(1,11226,0,'','','Deprecated quest: Upper Deck Promo - Spectral Tiger Mount'),
+(1,11577,0,'','','Deprecated quest: WoW Collector''s Edition: - DEM - E - FLAG'),
+(1,11874,0,'','','Deprecated quest: Upper Deck Promo - Rocket Mount'),
+(1,11937,0,'','','Deprecated quest: FLAG - all torch return quests are complete'),
+(1,12485,0,'','','Deprecated quest: Howling Fjord: aa - A - LK FLAG'),
+(1,12600,0,'','','Deprecated quest: Upper Deck Promo - Bear Mount'),
+(1,13123,0,'','','Deprecated quest: WotLK Collector''s Edition: - DEM - E - FLAG'),
+(1,13210,0,'','','Deprecated quest: Blizzard Account: - DEM - E - FLAG'),
+(1,13317,0,'','','Deprecated quest: ----'),
+(1,13990,0,'','','Deprecated quest: Upper Deck Promo - Chicken Mount');
diff --git a/sql/old/3.3.5a/2012_08_04_04_world_disables.sql b/sql/old/3.3.5a/2012_08_04_04_world_disables.sql
new file mode 100644
index 00000000000..14a0d6f94aa
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_04_world_disables.sql
@@ -0,0 +1,34 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (11335,11336,11337,11338,11339,11340,11341,11342,13405,13407,13427,13428,14163,14164,14178,14179,14180,14181,14182,14183,24216,24217,24218,24219,24220,24221,24223,24224,24225,24226,24426,24427);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,11335,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,11336,0,'','','Deprecated quest: Call to Arms: Alterac Valley'),
+(1,11337,0,'','','Deprecated quest: Call to Arms: Eye of the Storm'),
+(1,11338,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,11339,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,11340,0,'','','Deprecated quest: Call to Arms: Alterac Valley'),
+(1,11341,0,'','','Deprecated quest: Call to Arms: Eye of the Storm'),
+(1,11342,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,13405,0,'','','Deprecated quest: Call to Arms: Strand of the Ancients'),
+(1,13407,0,'','','Deprecated quest: Call to Arms: Strand of the Ancients'),
+(1,13427,0,'','','Deprecated quest: Call to Arms: Alterac Valley'),
+(1,13428,0,'','','Deprecated quest: Call to Arms: Alterac Valley'),
+(1,14163,0,'','','Deprecated quest: Call to Arms: Isle of Conquest'),
+(1,14164,0,'','','Deprecated quest: Call to Arms: Isle of Conquest'),
+(1,14178,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,14179,0,'','','Deprecated quest: Call to Arms: Eye of the Storm'),
+(1,14180,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,14181,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,14182,0,'','','Deprecated quest: Call to Arms: Eye of the Storm'),
+(1,14183,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24216,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24217,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24218,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24219,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24220,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,24221,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,24223,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,24224,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24225,0,'','','Deprecated quest: Call to Arms: Warsong Gulch'),
+(1,24226,0,'','','Deprecated quest: Call to Arms: Arathi Basin'),
+(1,24426,0,'','','Deprecated quest: Call to Arms: Alterac Valley'),
+(1,24427,0,'','','Deprecated quest: Call to Arms: Alterac Valley');
diff --git a/sql/old/3.3.5a/2012_08_04_05_world_disables.sql b/sql/old/3.3.5a/2012_08_04_05_world_disables.sql
new file mode 100644
index 00000000000..ce123e4e5be
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_05_world_disables.sql
@@ -0,0 +1,28 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (8384,8386,8389,8390,8391,8392,8397,8398,8404,8405,8406,8407,8408,8431,8432,8433,8434,8435,8440,8441,8442,8443,8567,8568,8569,8570);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,8384,0,'','','Deprecated quest: Claiming Arathi Basin'),
+(1,8386,0,'','','Deprecated quest: Fight for Warsong Gulch'),
+(1,8389,0,'','','Deprecated quest: Battle of Warsong Gulch'),
+(1,8390,0,'','','Deprecated quest: Conquering Arathi Basin'),
+(1,8391,0,'','','Deprecated quest: Claiming Arathi Basin'),
+(1,8392,0,'','','Deprecated quest: Claiming Arathi Basin'),
+(1,8397,0,'','','Deprecated quest: Claiming Arathi Basin'),
+(1,8398,0,'','','Deprecated quest: Claiming Arathi Basin'),
+(1,8404,0,'','','Deprecated quest: Fight for Warsong Gulch'),
+(1,8405,0,'','','Deprecated quest: Fight for Warsong Gulch'),
+(1,8406,0,'','','Deprecated quest: Fight for Warsong Gulch'),
+(1,8407,0,'','','Deprecated quest: Fight for Warsong Gulch'),
+(1,8408,0,'','','Deprecated quest: Fight for Warsong Gulch'),
+(1,8431,0,'','','Deprecated quest: Battle of Warsong Gulch'),
+(1,8432,0,'','','Deprecated quest: Battle of Warsong Gulch'),
+(1,8433,0,'','','Deprecated quest: Battle of Warsong Gulch'),
+(1,8434,0,'','','Deprecated quest: Battle of Warsong Gulch'),
+(1,8435,0,'','','Deprecated quest: Battle of Warsong Gulch'),
+(1,8440,0,'','','Deprecated quest: Conquering Arathi Basin'),
+(1,8441,0,'','','Deprecated quest: Conquering Arathi Basin'),
+(1,8442,0,'','','Deprecated quest: Conquering Arathi Basin'),
+(1,8443,0,'','','Deprecated quest: Conquering Arathi Basin'),
+(1,8567,0,'','','Deprecated quest: Past Victories in Warsong Gulch'),
+(1,8568,0,'','','Deprecated quest: Past Victories in Warsong Gulch'),
+(1,8569,0,'','','Deprecated quest: Past Efforts in Warsong Gulch'),
+(1,8570,0,'','','Deprecated quest: Past Efforts in Warsong Gulch');
diff --git a/sql/old/3.3.5a/2012_08_04_06_world_quest_template.sql b/sql/old/3.3.5a/2012_08_04_06_world_quest_template.sql
new file mode 100644
index 00000000000..fe48c887ae0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_06_world_quest_template.sql
@@ -0,0 +1,10 @@
+UPDATE `quest_template` SET `specialflags`= `specialflags`|8 WHERE `id` IN (
+24889, -- Classic Random 5-15 (Nth)
+24890, -- Classic Random 15-25 (Nth)
+24891, -- Classic Random 24-34 (Nth)
+24892, -- Classic Random 35-45 (Nth)
+24893, -- Classic Random 46-55 (Nth)
+24894, -- Classic Random 56-60 (Nth)
+24895, -- Classic Random 60-64 (Nth)
+24896); -- Classic Random 65-70 (Nth)
+
diff --git a/sql/old/3.3.5a/2012_08_04_07_world_game_event_creature_quest.sql b/sql/old/3.3.5a/2012_08_04_07_world_game_event_creature_quest.sql
new file mode 100644
index 00000000000..b72f8edd46d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_07_world_game_event_creature_quest.sql
@@ -0,0 +1,110 @@
+-- Hordes's Honor the Flame
+-- Add missing creature_quesrelation and involvedrealation that were blocking quests
+DELETE FROM `game_event_creature_quest` WHERE `quest` IN (11846,11845,11852,11839,11859,11841,11851,11855,11835,11858,11863,13500,13493,13494,13495,13496,13497,13498,13499,11850,11848,11853,11857,11837,11844,11860,11584,11862,11842,11840);
+INSERT INTO `game_event_creature_quest` (`eventEntry`,`id`, `quest`) VALUES
+-- Flame Keeper of Eastern Kingdom? {Achievement=1025}
+(1,25933, 11850), -- Ghostland
+(1,25931, 11848), -- Eversong woods
+(1,25935, 11853), -- Hillsbrad Foothills
+(1,25941, 11857), -- Swamp of sorrows
+(1,25920, 11837), -- Cape of Stranglethorn
+(1,25927, 11844), -- Burning Steppes
+(1,25944, 11860), -- The Hinterlands
+(1,25939, 11584), -- Silverpine Forest
+(1,25946, 11862), -- Tirisfal Glades
+(1,25925, 11842), -- Badlands
+(1,25923, 11840), -- Arathi Highlands
+-- The Flame Keeper of Kalimdore - {Achievement=1026}
+(1,25929, 11846), -- Durotar
+(1,25928, 11845), -- Desolace
+(1,25936, 11852), -- Mulgore
+(1,25922, 11839), -- Winterspring
+(1,25943, 11859), -- Barrens
+(1,25884, 11841), -- Ashenvale
+-- The Flame Keeper of Outland - {Achievement=1027}
+(1,25934, 11851), -- Hellfire Peninsula
+(1,25938, 11855), -- Shadowmoon Valley
+(1,25918, 11835), -- Netherstorm
+(1,25942, 11858), -- Terokkar
+(1,25947, 11863), -- Terokkar
+-- Flame Keeper of Northrend - {Achievement=6009}
+(1,32816, 13500), -- Zul'Drak
+(1,32809, 13493), -- Borean Tundra
+(1,32810, 13494), -- Sholazar Basin
+(1,32811, 13495), -- Dragonblight
+(1,32815, 13499), -- Crystalsong Forest
+(1,32814, 13498), -- Storm Peaks
+(1,32813, 13497), -- Grizzly Hills
+(1,32812, 13496); -- Howling Fjords
+-- add missing quest-involved relations
+DELETE FROM `creature_involvedrelation` WHERE `quest` IN (11846,11845,11852,11839,11859,11841,11851,11855,11835,11858,11863,13500,13493,13494,13495,13496,13497,13498,13499,11850,11848,11853,11857,11837,11844,11860,11584,11862,11842,11840);
+INSERT INTO `creature_involvedrelation` (`id`, `quest`) VALUES
+(25929, 11846), -- Durotar
+(25928, 11845), -- Desolace
+(25936, 11852), -- Mulgore
+(25922, 11839), -- Winterspring
+(25943, 11859), -- Barrens
+(25884, 11841), -- Ashenvale
+(25934, 11851), -- Hellfire Peninsula
+(25938, 11855), -- Shadowmoon Valley
+(25918, 11835), -- Netherstorm
+(25942, 11858), -- Terokkar
+(25947, 11863), -- Terokkar
+(32816, 13500), -- Zul'Drak
+(32809, 13493), -- Borean Tundra
+(32810, 13494), -- Sholazar Basin
+(32811, 13495), -- Dragonblight
+(32815, 13499), -- Crystalsong Forest
+(32814, 13498), -- Storm Peaks
+(32813, 13497), -- Grizzly Hills
+(32812, 13496), -- Howling Fjords
+(25933, 11850), -- Ghostland
+(25931, 11848), -- Eversong woods
+(25935, 11853), -- Hillsbrad Foothills
+(25941, 11857), -- Swamp of sorrows
+(25920, 11837), -- Cape of Stranglethorn
+(25927, 11844), -- Burning Steppes
+(25944, 11860), -- The Hinterlands
+(25939, 11584), -- Silverpine Forest
+(25946, 11862), -- Tirisfal Glades
+(25925, 11842), -- Badlands
+(25923, 11840); -- Arathi Highlands
+-- update quest texts and rewardcash
+UPDATE `quest_template` SET `RewardOrRequiredMoney`=37000,`RewardMoneyMaxLevel`=66300, `OfferRewardText`='Honor the Durotar flame!' WHERE `Id`=11846;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Mulgore flame!' WHERE `Id`=11852;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Barrens flame!',`RewardOrRequiredMoney`=37000, `RewardMoneyMaxLevel`=66300 WHERE `Id`=11859; -- Barrens
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Tanaris flame!',`RequestItemsText`='' WHERE `Id`=11838 LIMIT 1;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Ashenvale flame!' WHERE `Id`=11841;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Winterspring flame!' WHERE `Id`=11839;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Desolace flame!' WHERE `Id`=11845;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Thousand Needles flame!' WHERE `Id`=11861;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Feralas flame!' WHERE `Id`=11849;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Dustwallow Marsh flame!' WHERE `Id`=11847;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Silithus flame!' WHERE `Id`=11836;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Stonetalon Mountains flame!' WHERE `Id`=11856;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Hellfire Peninsula flame!' WHERE `Id`=11851;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Shadowmoon Valley flame!' WHERE `Id`=11855;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Nagrand flame!', `RequestItemsText`='' WHERE `Id`=11821;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Netherstorm flame!' WHERE `Id`=11835;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Blades Edge Mountains flame! ', `RequestItemsText`='' WHERE `Id`=11843;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Terokkar flame!' WHERE `Id`=11858;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Zangarmarsh flame!' WHERE `Id`=11863;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Zul''Drak flame!' WHERE `Id`=13500;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Borean Tundra flame!' WHERE `Id`=13493;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Sholazar Basin flame!' WHERE `Id`=13494;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Dragonblight flame!' WHERE `Id`=13495;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Crystalsong Forest flame!' WHERE `Id`=13499;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Storm Peaks flame!' WHERE `Id`=13498;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Grizzly Hills flame!' WHERE `Id`=13497;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Howling Fjords flame!' WHERE `Id`=13496;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Ghostland flame!' WHERE `Id`=11850;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Eversong woods flame!' WHERE `Id`=11848;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Hillsbrad Foothills flame!' WHERE `Id`=11853;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Swamp of sorrows flame!' WHERE `Id`=11857;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Cape of Stranglethorn flame!' WHERE `Id`=11837;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Burning Steppes flame!' WHERE `Id`=11844;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Hinterlands flame!' WHERE `Id`=11860;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Silverpine Forest flame!' WHERE `Id`=11584;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Tirisfal Glades flame!' WHERE `Id`=11862;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Badlands flame!' WHERE `Id`=11842;
+UPDATE `quest_template` SET `OfferRewardText`='Honor the Arathi Highlands flame!' WHERE `Id`=11840;
diff --git a/sql/old/3.3.5a/2012_08_04_08_world_disables.sql b/sql/old/3.3.5a/2012_08_04_08_world_disables.sql
new file mode 100644
index 00000000000..6944c45f1f4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_08_world_disables.sql
@@ -0,0 +1,65 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (9034,9036,9037,9038,9039,9040,9041,9042,9043,9044,9046,9047,9048,9049,9050,9054,9055,9056,9057,9058,9059,9060,9061,9068,9069,9070,9071,9072,9073,9074,9075,9077,9078,9079,9080,9081,9082,9083,9084,9086,9087,9088,9089,9090,9091,9092,9093,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,9034,0,'','','Deprecated quest: Dreadnaught Breastplate'),
+(1,9036,0,'','','Deprecated quest: Dreadnaught Legplates'),
+(1,9037,0,'','','Deprecated quest: Dreadnaught Helmet'),
+(1,9038,0,'','','Deprecated quest: Dreadnaught Pauldrons'),
+(1,9039,0,'','','Deprecated quest: Dreadnaught Sabatons'),
+(1,9040,0,'','','Deprecated quest: Dreadnaught Gauntlets'),
+(1,9041,0,'','','Deprecated quest: Dreadnaught Waistguard'),
+(1,9042,0,'','','Deprecated quest: Dreadnaught Bracers'),
+(1,9043,0,'','','Deprecated quest: Redemption Tunic'),
+(1,9044,0,'','','Deprecated quest: Redemption Legguards'),
+(1,9046,0,'','','Deprecated quest: Redemption Spaulders'),
+(1,9047,0,'','','Deprecated quest: Redemption Boots'),
+(1,9048,0,'','','Deprecated quest: Redemption Handguards'),
+(1,9049,0,'','','Deprecated quest: Redemption Girdle'),
+(1,9050,0,'','','Deprecated quest: Redemption Wristguards'),
+(1,9054,0,'','','Deprecated quest: Cryptstalker Tunic'),
+(1,9055,0,'','','Deprecated quest: Cryptstalker Legguards'),
+(1,9056,0,'','','Deprecated quest: Cryptstalker Headpiece'),
+(1,9057,0,'','','Deprecated quest: Cryptstalker Spaulders'),
+(1,9058,0,'','','Deprecated quest: Cryptstalker Boots'),
+(1,9059,0,'','','Deprecated quest: Cryptstalker Handguards'),
+(1,9060,0,'','','Deprecated quest: Cryptstalker Girdle'),
+(1,9061,0,'','','Deprecated quest: Cryptstalker Wristguards'),
+(1,9068,0,'','','Deprecated quest: Earthshatter Tunic'),
+(1,9069,0,'','','Deprecated quest: Earthshatter Legguards'),
+(1,9070,0,'','','Deprecated quest: Earthshatter Headpiece'),
+(1,9071,0,'','','Deprecated quest: Earthshatter Spaulders'),
+(1,9072,0,'','','Deprecated quest: Earthshatter Boots'),
+(1,9073,0,'','','Deprecated quest: Earthshatter Handguards'),
+(1,9074,0,'','','Deprecated quest: Earthshatter Girdle'),
+(1,9075,0,'','','Deprecated quest: Earthshatter Wristguards'),
+(1,9077,0,'','','Deprecated quest: Bonescythe Breastplate'),
+(1,9078,0,'','','Deprecated quest: Bonescythe Legplates'),
+(1,9079,0,'','','Deprecated quest: Bonescythe Helmet'),
+(1,9080,0,'','','Deprecated quest: Bonescythe Pauldrons'),
+(1,9081,0,'','','Deprecated quest: Bonescythe Sabatons'),
+(1,9082,0,'','','Deprecated quest: Bonescythe Gauntlets'),
+(1,9083,0,'','','Deprecated quest: Bonescythe Waistguard'),
+(1,9084,0,'','','Deprecated quest: Bonescythe Bracers'),
+(1,9086,0,'','','Deprecated quest: Dreamwalker Tunic'),
+(1,9087,0,'','','Deprecated quest: Dreamwalker Legguards'),
+(1,9088,0,'','','Deprecated quest: Dreamwalker Headpiece'),
+(1,9089,0,'','','Deprecated quest: Dreamwalker Spaulders'),
+(1,9090,0,'','','Deprecated quest: Dreamwalker Boots'),
+(1,9091,0,'','','Deprecated quest: Dreamwalker Handguards'),
+(1,9092,0,'','','Deprecated quest: Dreamwalker Girdle'),
+(1,9093,0,'','','Deprecated quest: Dreamwalker Wristguards'),
+(1,9095,0,'','','Deprecated quest: Frostfire Robe'),
+(1,9096,0,'','','Deprecated quest: Frostfire Leggings'),
+(1,9097,0,'','','Deprecated quest: Frostfire Circlet'),
+(1,9098,0,'','','Deprecated quest: Frostfire Shoulderpads'),
+(1,9099,0,'','','Deprecated quest: Frostfire Sandals'),
+(1,9100,0,'','','Deprecated quest: Frostfire Gloves'),
+(1,9101,0,'','','Deprecated quest: Frostfire Belt'),
+(1,9102,0,'','','Deprecated quest: Frostfire Bindings'),
+(1,9103,0,'','','Deprecated quest: Plagueheart Robe'),
+(1,9104,0,'','','Deprecated quest: Plagueheart Leggings'),
+(1,9105,0,'','','Deprecated quest: Plagueheart Circlet'),
+(1,9106,0,'','','Deprecated quest: Plagueheart Shoulderpads'),
+(1,9107,0,'','','Deprecated quest: Plagueheart Sandals'),
+(1,9108,0,'','','Deprecated quest: Plagueheart Gloves'),
+(1,9109,0,'','','Deprecated quest: Plagueheart Belt'),
+(1,9110,0,'','','Deprecated quest: Plagueheart Bindings');
diff --git a/sql/old/3.3.5a/2012_08_04_09_world_disables.sql b/sql/old/3.3.5a/2012_08_04_09_world_disables.sql
new file mode 100644
index 00000000000..3023625410e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_09_world_disables.sql
@@ -0,0 +1,10 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (9111,9112,9113,9114,9115,9116,9117,9118);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,9111,0,'','','Deprecated quest: Robe of Faith'),
+(1,9112,0,'','','Deprecated quest: Leggings of Faith'),
+(1,9113,0,'','','Deprecated quest: Circlet of Faith'),
+(1,9114,0,'','','Deprecated quest: Shoulderpads of Faith'),
+(1,9115,0,'','','Deprecated quest: Sandals of Faith'),
+(1,9116,0,'','','Deprecated quest: Gloves of Faith'),
+(1,9117,0,'','','Deprecated quest: Belt of Faith'),
+(1,9118,0,'','','Deprecated quest: Bindings of Faith');
diff --git a/sql/old/3.3.5a/2012_08_04_10_world_disables.sql b/sql/old/3.3.5a/2012_08_04_10_world_disables.sql
new file mode 100644
index 00000000000..1d991eafef5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_10_world_disables.sql
@@ -0,0 +1,43 @@
+DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN (2018,5101,7681,7682,8230,8270,8274,9284,9285,9286,9577,9583,11121,11994,12015,12493,12911,13649,14106,9713,9926,11087,11115,11116,11353,11518,12186,12187,12494,12845,13807,14185,14186,14187,24808,24809,24810,24811,25238);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+-- containing "test"
+(1,2018,0,'','','Deprecated quest: Rokar''s Test'),
+(1,5101,0,'','','Deprecated quest: Lee''s Ultimate Test Quest... of Doom!'),
+(1,7681,0,'','','Deprecated quest: Hunter test quest'),
+(1,7682,0,'','','Deprecated quest: Hunter test quest2'),
+(1,8230,0,'','','Deprecated quest: Collin''s Test Quest'),
+(1,8270,0,'','','Deprecated quest: test copy quest'),
+(1,8274,0,'','','Deprecated quest: Test Kill Quest'),
+(1,9284,0,'','','Deprecated quest: Aldor Faction Test'),
+(1,9285,0,'','','Deprecated quest: Consortium Faction Test'),
+(1,9286,0,'','','Deprecated quest: Scryers Faction Test'),
+(1,9577,0,'','','Deprecated quest: DAILY TEST QUEST (PVP)'),
+(1,9583,0,'','','Deprecated quest: Omar''s Test Quest'),
+(1,11121,0,'','','Deprecated quest: DAILY TEST QUEST (RAID)'),
+(1,11994,0,'','','Deprecated quest: Juno''s Flag Tester'),
+(1,12015,0,'','','Deprecated quest: Test Quest for Craig'),
+(1,12493,0,'','','Deprecated quest: PvP Test'),
+(1,12911,0,'','','Deprecated quest: Kill Credit Test'),
+(1,13649,0,'','','Deprecated quest: Justin''s Fun Test'),
+(1,14106,0,'','','Deprecated quest: Na Kada''s Quest Test'),
+-- containing "flag"
+(1,9713,0,'','','Deprecated quest: Glowcap Harvesting Enabling Flag'),
+(1,9926,0,'','','Deprecated quest: FLAG Shadow Council/Warmaul Questline'),
+(1,11087,0,'','','Deprecated quest: HYJAL FLAG'),
+(1,11115,0,'','','Deprecated quest: The Mark of Vashj (FLAG ONLY)'),
+(1,11116,0,'','','Deprecated quest: Trial of the Naaru: (QUEST FLAG)'),
+(1,11353,0,'','','Deprecated quest: FLAG: Got the work shirt'),
+(1,11518,0,'','','Deprecated quest: Sunwell Daily Portal Flag'),
+(1,12186,0,'','','Deprecated quest: FLAG: Winner'),
+(1,12187,0,'','','Deprecated quest: FLAG: Participant'),
+(1,12494,0,'','','Deprecated quest: FLAG: Riding Trainer Advertisement (20)'),
+(1,12845,0,'','','Deprecated quest: Dalaran Teleport Crystal Flag'),
+(1,13807,0,'','','Deprecated quest: FLAG: Tournament Invitation'),
+(1,14185,0,'','','Deprecated quest: FLAG: Riding Trainer Advertisement (40)'),
+(1,14186,0,'','','Deprecated quest: FLAG: Riding Trainer Advertisement (60)'),
+(1,14187,0,'','','Deprecated quest: FLAG: Riding Trainer Advertisement (70)'),
+(1,24808,0,'','','Deprecated quest: Tank Ring Flag'),
+(1,24809,0,'','','Deprecated quest: Healer Ring Flag'),
+(1,24810,0,'','','Deprecated quest: Melee Ring Flag'),
+(1,24811,0,'','','Deprecated quest: Caster Ring Flag'),
+(1,25238,0,'','','Deprecated quest: Strength Ring Flag');
diff --git a/sql/old/3.3.5a/2012_08_04_11_world_game_event_creature_quest.sql b/sql/old/3.3.5a/2012_08_04_11_world_game_event_creature_quest.sql
new file mode 100644
index 00000000000..224749c7e10
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_04_11_world_game_event_creature_quest.sql
@@ -0,0 +1,365 @@
+-- Add all quests connected with Midsummer Fire Festival that are to be reseted on each next year to game_event_seasonal_questrelation, so players can complete them on and on... /as of different festivals/.
+DELETE FROM `game_event_seasonal_questrelation` WHERE `questId` IN (11846,11845,11852,11839,11859,11841,11849,11861,11847,11836,11838,11856,11850,11848,11853,11857,11837,11844,11860,11584,11862,11842,11840,11851,11855,11835,11858,11863,11821,11854,11843,13500,13493,13494,13495,13496,13497,13498,13499,11805,11812,11815,11834,11833,11831,11817,11811,11806,11809,11826,11824,11826,11827,11819,11583,11828,11816,11810,11808,11804,11832,11813,11814,11820,11822,11823,11821,11830,11818,11825,11807,11829,13485,13487,13489,13488,13490,13486,13491,13492,11770,11769,11777,11803,11783,11773,11765,11771,11785,11800,11780,11802,11774,11772,11776,11781,11801,11768,11784,11580,11786,11766,11764,11775,11779,11799,11782,11787,11767,11778,13458,13441,13450,13451,13457,13455,13454,13453,11734,11741,11744,11763,11762,11760,11746,11740,11735,11738,11753,11755,11756,11748,11581,11757,11745,11739,11737,11732,11761,11742,11743,11749,11751,11752,11750,11759,11747,11754,11736,11758,13440,13443,13445,13444,13449,13446,13442,13447,13431,9324,11935,9326,9325,9332,9331,9330,11933,11972);
+INSERT INTO `game_event_seasonal_questrelation` (`questId`, `eventEntry`) VALUES
+(11846,1), -- Durotar // Honor the Flame (Horde) - Kalimdor
+(11845,1), -- Desolace
+(11852,1), -- Mulgore
+(11839,1), -- Winterspring
+(11859,1), -- Barrens
+(11849,1), -- Feralas
+(11841,1), -- Ashenvale
+(11847,1), -- Dustwallow marsh
+(11861,1), -- Thousand Needles
+(11856,1), -- Stonetalon Mountains
+(11836,1), -- Silithus
+(11838,1), -- Tanaris
+(11850,1), -- Ghostland // Honor the Flame (Horde) - Eeastern Kingdoms
+(11848,1), -- Eversong woods
+(11853,1), -- Hillsbrad Foothills
+(11857,1), -- Swamp of sorrows
+(11837,1), -- Cape of Stranglethorn
+(11844,1), -- Burning Steppes
+(11860,1), -- The Hinterlands
+(11584,1), -- Silverpine Forest
+(11862,1), -- Tirisfal Glades
+(11842,1), -- Badlands
+(11840,1), -- Arathi Highlands
+(11851,1), -- Hellfire Peninsula // Honor the Flame (Horde) - Outland
+(11855,1), -- Shadowmoon Valley
+(11835,1), -- Netherstorm
+(11858,1), -- Terokkar
+(11863,1), -- Zangarmarsh
+(11854,1), -- Nagrand
+(11843,1), -- Blade''s Edge Mountains
+(13500,1), -- Zul'Drak // Honor the Flame (Horde) - Northrend
+(13493,1), -- Borean Tundra
+(13494,1), -- Sholazar Basin
+(13495,1), -- Dragonblight
+(13499,1), -- Crystalsong Forest
+(13498,1), -- Storm Peaks
+(13497,1), -- Grizzly Hills
+(13496,1), -- Howling Fjords
+(11805,1), -- Ashenvale // Honor the Flame (Alliance) - Kalimdor
+(11812,1), -- Desolace
+(11815,1), -- Dustwallow Marsh
+(11834,1), -- Winterspring
+(11833,1), -- Tanaris
+(11831,1), -- Silithus
+(11817,1), -- Feralas
+(11811,1), -- Darkshore
+(11806,1), -- Azuremyst Isle
+(11809,1), -- Bloodmyst Isle
+(11824,1), -- Teldrassil
+(11826,1), -- The Hinterlands // Honor the Flame (Alliance) - Eeastern Kingdoms
+(11827,1), -- The Western Plaguelands
+(11819,1), -- Hillsbrad Foothills
+(11583,1), -- Westfall
+(11828,1), -- Wetlands
+(11816,1), -- Elwynn Forest
+(11810,1), -- Burning Steppes
+(11808,1), -- Blasted Lands
+(11804,1), -- Arathi Highlands
+(11832,1), -- Cape of Stranglethorn
+(11813,1), -- Dun Morogh
+(11814,1), -- Duskwood
+(11820,1), -- Loch Modan
+(11822,1), -- Redridge Mountains
+(11823,1), -- Shadowmoon Valley // Honor the Flame (Alliance) - Outland
+(11821,1), -- Nagrand
+(11830,1), -- Netherstorm
+(11818,1), -- Hellfire Peninsula
+(11825,1), -- Terokkar
+(11807,1), -- Blade's Edge
+(11829,1), -- Zangarmarsh
+(13485,1), -- Borean Tundra // Honor the Flame (Alliance) - Northrend
+(13487,1), -- Dragonblight
+(13489,1), -- Grizzly Hills
+(13488,1), -- Howling Fjord
+(13492,1), -- Zul'Drak
+(13490,1), -- The Storm Peaks
+(13486,1), -- Sholazar Basin
+(13491,1), -- Crystalsong Forest
+(11770,1), -- Durotar // Desecrate the Flame (Alliance) - Kalimdor
+(11769,1), -- Desolace
+(11777,1), -- Mulgore
+(11803,1), -- Winterspring
+(11783,1), -- Barrens
+(11773,1), -- Feralas
+(11765,1), -- Ashenvale
+(11771,1), -- Dustwallow marsh
+(11785,1), -- Thousand Needles
+(11800,1), -- Silithus
+(11780,1), -- Stonetalon Mountains
+(11802,1), -- Tanaris
+(11774,1), -- Ghostland // Desecrate the Flame (Alliance) - Eastern Kingdoms
+(11772,1), -- Eversong woods
+(11776,1), -- Hillsbrad Foothills
+(11781,1), -- Swamp of sorrows
+(11801,1), -- Cape of Stranglethorn
+(11768,1), -- Burning Steppes
+(11784,1), -- The Hinterlands
+(11580,1), -- Silverpine Forest
+(11786,1), -- Tirisfal Glades
+(11766,1), -- Badlands
+(11764,1), -- Arathi Highlands
+(11775,1), -- Hellfire Peninsula // Desecrate the Flame (Alliance) - Outland
+(11779,1), -- Shadowmoon Valley
+(11799,1), -- Netherstorm
+(11782,1), -- Terokkar
+(11787,1), -- Zangarmarsh
+(11767,1), -- Blade' Edge
+(11778,1), -- Nagrand
+(13458,1), -- Zul'Drak // Desecrate the Flame (Alliance) - Northrend
+(13441,1), -- Borean Tundra
+(13450,1), -- Sholazar Basin
+(13451,1), -- Dragonblight
+(13457,1), -- Crystalsong Forest
+(13455,1), -- Storm Peaks
+(13454,1), -- Grizzly Hills
+(13453,1), -- Howling Fjords
+(11734,1), -- Ashenvale // Desecrate the Flame (Horde) - Kalimdor
+(11741,1), -- Desolace
+(11744,1), -- Dustwallow Marsh
+(11763,1), -- Winterspring
+(11762,1), -- Tanaris
+(11760,1), -- Silithus
+(11746,1), -- Feralas
+(11740,1), -- Darkshore
+(11735,1), -- Azuremyst Isle
+(11738,1), -- Bloodmyst Isle
+(11753,1), -- Teldrassil
+(11755,1), -- The Hinterlands // Desecrate the Flame (Horde) - Eastern Kingdoms
+(11756,1), -- The Western Plaguelands
+(11748,1), -- Hillsbrad Foothills
+(11581,1), -- Westfall
+(11757,1), -- Wetlands
+(11745,1), -- Elwynn Forest
+(11739,1), -- Burning Steppes
+(11737,1), -- Blasted Lands
+(11732,1), -- Arathi Highlands
+(11761,1), -- Cape of Stranglethorn
+(11742,1), -- Dun Morogh
+(11743,1), -- Duskwood
+(11749,1), -- Loch Modan
+(11751,1), -- Redridge Mountains
+(11752,1), -- Shadowmoon Valley // Desecrate the Flame (Horde) - Outland
+(11750,1), -- Nagrand
+(11759,1), -- Netherstorm
+(11747,1), -- Hellfire Peninsula
+(11754,1), -- Terokkar
+(11736,1), -- Blade's Edge
+(11758,1), -- Zangarmarsh
+(13440,1), -- Borean Tundra // Desecrate the Flame (Horde) - Northrend
+(13443,1), -- Dragonblight
+(13445,1), -- Grizzly
+(13444,1), -- Howling Fjord
+(13449,1), -- Zul'Drak
+(13446,1), -- The Storm Peaks
+(13442,1), -- Sholazar Basin
+(13447,1), -- Crystalsong Forest
+(11972,1), -- Shards of Ahune
+(9324,1), -- Stealing Orgrimmar''s Flame
+(11935,1), -- Stealing Silvermoon''s Flame
+(9326,1), -- Stealing the Undercity''s Flame
+(9325,1), -- Stealing Thunder Bluff''s Flame
+(9332,1), -- Stealing Darnassus''s Flame
+(9331,1), -- Stealing Ironforge''s Flame
+(9330,1), -- Stealing Stormwind''s Flame
+(11933,1); -- Stealing the Exodar''s Flame
+-- Add quest relations to game_event_gameobject_quest and game_event_creature_quest
+DELETE FROM `game_event_creature_quest` WHERE `quest` IN (11846,11845,11852,11839,11859,11841,11849,11861,11847,11836,11838,11856,11850,11848,11853,11857,11837,11844,11860,11584,11862,11842,11840,11851,11855,11835,11858,11863,11821,11854,11843,13500,13493,13494,13495,13496,13497,13498,13499,11805,11812,11815,11834,11833,11831,11817,11811,11806,11809,11826,11824,11826,11827,11819,11583,11828,11816,11810,11808,11804,11832,11813,11814,11820,11822,11823,11821,11830,11818,11825,11807,11829,13485,13487,13489,13488,13490,13486,13491,13492,11805,11812,11815,11834,11833,11831,11817,11811,11806,11809,11824,11826,11827,11819,11583,11828,11816,11810,11808,11804,11832,11813,11814,11820,11822,13485,13487,13489,13488,13490,13486,13491,13490,11823,11821,11830,11818,11825,11807,11829,11775,11917,11947,11948,11952,11953,11954,11886,11891,12012,11955,11696,11691,11971,11970,11966,11964,11922,11923,11926,11925,11731,11657,11921,11924,9339,9365);
+INSERT INTO `game_event_creature_quest` (`eventEntry`,`id`, `quest`) VALUES
+(1,25929, 11846), -- Durotar // Honor the Flame (Horde) - Kalimdor
+(1,25928, 11845), -- Desolace
+(1,25936, 11852), -- Mulgore
+(1,25922, 11839), -- Winterspring
+(1,25943, 11859), -- Barrens
+(1,25932, 11849), -- Feralas
+(1,25884, 11841), -- Ashenvale
+(1,25930, 11847), -- Dustwallow marsh
+(1,25945, 11861), -- Thousand Needles
+(1,25919, 11836), -- Silithus
+(1,25921, 11838), -- Tanaris
+(1,25940, 11856), -- Stonetalon Mountains
+(1,25934, 11851), -- Hellfire Peninsula // Honor the Flame (Horde) - Outland
+(1,25938, 11855), -- Shadowmoon Valley
+(1,25918, 11835), -- Netherstorm
+(1,25942, 11858), -- Terokkar
+(1,25947, 11863), -- Zangarmarsh
+(1,25937, 11854), -- Nagrand
+(1,25926, 11843), -- Blade''s Edge Mountains
+(1,32816, 13500), -- Zul'Drak // Honor the Flame (Horde) - Northrend
+(1,32809, 13493), -- Borean Tundra
+(1,32810, 13494), -- Sholazar Basin
+(1,32811, 13495), -- Dragonblight
+(1,32815, 13499), -- Crystalsong Forest
+(1,32814, 13498), -- Storm Peaks
+(1,32813, 13497), -- Grizzly Hills
+(1,32812, 13496), -- Howling Fjords
+(1,25933, 11850), -- Ghostland // Honor the Flame (Horde) - Eastern Kingdoms
+(1,25931, 11848), -- Eversong woods
+(1,25935, 11853), -- Hillsbrad Foothills
+(1,25941, 11857), -- Swamp of sorrows
+(1,25920, 11837), -- Cape of Stranglethorn
+(1,25927, 11844), -- Burning Steppes
+(1,25944, 11860), -- The Hinterlands
+(1,25939, 11584), -- Silverpine Forest
+(1,25946, 11862), -- Tirisfal Glades
+(1,25925, 11842), -- Badlands
+(1,25923, 11840), -- Arathi Highlands
+(1,25883, 11805), -- Ashenvale // Honor the Flame (Alliance) - Kalimdor
+(1,25894, 11812), -- Desolace
+(1,25897, 11815), -- Dustwallow Marsh
+(1,25917, 11834), -- Winterspring
+(1,25916, 11833), -- Tanaris
+(1,25914, 11831), -- Silithus
+(1,25899, 11817), -- Feralas
+(1,25893, 11811), -- Darkshore
+(1,25888, 11806), -- Azuremyst Isle
+(1,25891, 11809), -- Bloodmyst Isle
+(1,25906, 11824), -- Teldrassil
+(1,25908, 11826), -- The Hinterlands // Honor the Flame (Alliance) - Eeastern Kingdoms
+(1,25909, 11827), -- The Western Plaguelands
+(1,25901, 11819), -- Hillsbrad Foothills
+(1,25910, 11583), -- Westfall
+(1,25911, 11828), -- Wetlands
+(1,25898, 11816), -- Elwynn Forest
+(1,25892, 11810), -- Burning Steppes
+(1,25890, 11808), -- Blasted Lands
+(1,25887, 11804), -- Arathi Highlands
+(1,25915, 11832), -- Cape of Stranglethorn
+(1,25895, 11813), -- Dun Morogh
+(1,25896, 11814), -- Duskwood
+(1,25902, 11820), -- Loch Modan
+(1,25904, 11822), -- Redridge Mountains
+(1,32801, 13485), -- Borean Tundra // Honor the Flame (Alliance) - Northrend
+(1,32803, 13487), -- Dragonblight
+(1,32805, 13489), -- Grizzly
+(1,32804, 13488), -- Howling Fjord
+(1,32808, 13492), -- Zul'Drak
+(1,32806, 13490), -- The Storm Peaks
+(1,32802, 13486), -- Sholazar Basin
+(1,32807, 13491), -- Crystalsong Forest
+(1,25905, 11823), -- Shadowmoon Valley // Honor the Flame (Alliance) - Outland
+(1,25903, 11821), -- Nagrand
+(1,25913, 11830), -- Netherstorm
+(1,25900, 11818), -- Hellfire Peninsula
+(1,25907, 11825), -- Terokkar
+(1,25889, 11807), -- Blade's Edge
+(1,25912, 11829), -- Zangarmarsh
+(1,26221, 11917), -- Striking Back
+(1,26221, 11947), -- Striking Back
+(1,26221, 11948), -- Striking Back
+(1,26221, 11952), -- Striking Back
+(1,26221, 11953), -- Striking Back
+(1,26221, 11954), -- Striking Back
+(1,26221, 11886), -- Unusual Activity
+(1,25324, 11891), -- An Innocent Disguise
+(1,25324, 12012), -- Inform the Elder
+(1,26221, 11955), -- Ahune, the Frost Lord
+(1,25710, 11696), -- Ahune is Here!
+(1,25697, 11691), -- Summon Ahune
+(1,19169, 11971), -- The Spinner of Summer Tales /Horde/
+(1,19178, 11971), -- The Spinner of Summer Tales
+(1,19175, 11971), -- The Spinner of Summer Tales
+(1,19176, 11971), -- The Spinner of Summer Tales
+(1,19177, 11971), -- The Spinner of Summer Tales
+(1,20102, 11971), -- The Spinner of Summer Tales
+(1,19171, 11970), -- The Master of Summer Lore /Alliance/
+(1,19148, 11970), -- The Master of Summer Lore
+(1,19172, 11970), -- The Master of Summer Lore
+(1,18927, 11970), -- The Master of Summer Lore
+(1,19173, 11970), -- The Master of Summer Lore
+(1,20102, 11970), -- The Master of Summer Lore
+(1,16818, 11966), -- Incense for the Festival Scorchlings
+(1,16817, 11964), -- Incense for the Summer Scorchlings
+(1,26113, 11922), -- Torch Tossing /H/
+(1,26113, 11923), -- Torch Catching /H/
+(1,26113, 11926), -- More Torch Tossing /H/
+(1,26113, 11925), -- More Torch Catching /H/
+(1,25975, 11731), -- Torch Tossing /A/
+(1,25975, 11657), -- Torch Catching /A/
+(1,25975, 11921), -- More Torch Tossing /A/
+(1,25975, 11924), -- More Torch Catching /A/
+(1,16818, 9339), -- A Thief''s Reward /H/
+(1,16817, 9365); -- A Thief''s Reward /A/
+DELETE FROM `game_event_gameobject_quest` WHERE `quest` IN (11767,11778,11787,11782,11799,11779,11775,11734,11741,11744,11763,11762,11760,11746,11740,11735,11738,11753,11755,11756,11748,11581,11757,11745,11739,11737,11732,11761,11742,11743,11749,11751,13440,13443,13445,13444,13449,13446,13442,13447,11752,11750,11759,11747,11754,11736,11758,11770,11769,11777,11803,11783,11773,11765,11771,11785,11800,11780,11802,11774,11772,11776,11781,11801,11768,11784,11580,11786,11766,11764,13458,13441,13450,13451,13457,13455,13454,13453);
+INSERT INTO `game_event_gameobject_quest` (`eventEntry`,`id`, `quest`) VALUES
+(1,187916, 11734), -- Ashenvale // Desecrate the Flame (Horde) - Kalimdor
+(1,187924, 11741), -- Desolace
+(1,187927, 11744), -- Dustwallow Marsh
+(1,187946, 11763), -- Winterspring
+(1,187945, 11762), -- Tanaris
+(1,187943, 11760), -- Silithus
+(1,187929, 11746), -- Feralas
+(1,187923, 11740), -- Darkshore
+(1,187917, 11735), -- Azuremyst Isle
+(1,187921, 11738), -- Bloodmyst Isle
+(1,187936, 11753), -- Teldrassil
+(1,187938, 11755), -- The Hinterlands // Desecrate the Flame (Horde) - Eeastern Kingdoms
+(1,187939, 11756), -- The Western Plaguelands
+(1,187931, 11748), -- Hillsbrad Foothills
+(1,187564, 11581), -- Westfall
+(1,187940, 11757), -- Wetlands
+(1,187928, 11745), -- Elwynn Forest
+(1,187922, 11739), -- Burning Steppes
+(1,187920, 11737), -- Blasted Lands
+(1,187914, 11732), -- Arathi Highlands
+(1,187944, 11761), -- Cape of Stranglethorn
+(1,187925, 11742), -- Dun Morogh
+(1,187926, 11743), -- Duskwood
+(1,187932, 11749), -- Loch Modan
+(1,187934, 11751), -- Redridge Mountains
+(1,194032, 13440), -- Borean Tundra // Desecrate the Flame (Horde) - Northrend
+(1,194036, 13443), -- Dragonblight
+(1,194040, 13445), -- Grizzly
+(1,194038, 13444), -- Howling Fjord
+(1,194049, 13449), -- Zul'Drak
+(1,194044, 13446), -- The Storm Peaks
+(1,194035, 13442), -- Sholazar Basin
+(1,194045, 13447), -- Crystalsong Forest
+(1,187935, 11752), -- Shadowmoon Valley // Desecrate the Flame (Horde) - Outland
+(1,187933, 11750), -- Nagrand
+(1,187942, 11759), -- Netherstorm
+(1,187930, 11747), -- Hellfire Peninsula
+(1,187937, 11754), -- Terokkar
+(1,187919, 11736), -- Blade's Edge
+(1,187941, 11758), -- Zangarmarsh
+(1,187958, 11770), -- Durotar // Desecrate the Flame (Alliance) - Kalimdor
+(1,187957, 11769), -- Desolace
+(1,187965, 11777), -- Mulgore
+(1,187953, 11803), -- Winterspring
+(1,187971, 11783), -- Barrens
+(1,187961, 11773), -- Feralas
+(1,187948, 11765), -- Ashenvale
+(1,187959, 11771), -- Dustwallow marsh
+(1,187973, 11785), -- Thousand Needles
+(1,187950, 11800), -- Silithus
+(1,187968, 11780), -- Stonetalon Mountains
+(1,187952, 11802), -- Tanaris
+(1,187962, 11774), -- Ghostland // Desecrate the Flame (Alliance) - Eeastern Kingdoms
+(1,187960, 11772), -- Eversong woods
+(1,187964, 11776), -- Hillsbrad Foothills
+(1,187969, 11781), -- Swamp of sorrows
+(1,187951, 11801), -- Cape of Stranglethorn
+(1,187956, 11768), -- Burning Steppes
+(1,187972, 11784), -- The Hinterlands
+(1,187559, 11580), -- Silverpine Forest
+(1,187974, 11786), -- Tirisfal Glades
+(1,187954, 11766), -- Badlands
+(1,187947, 11764), -- Arathi Highlands
+(1,187963, 11775), -- Hellfire Peninsula // Desecrate the Flame (Alliance) - Outland
+(1,187967, 11779), -- Shadowmoon Valley
+(1,187949, 11799), -- Netherstorm
+(1,187970, 11782), -- Terokkar
+(1,187975, 11787), -- Zangarmarsh
+(1,187955, 11767), -- Blade' Edge
+(1,187966, 11778), -- Nagrand
+(1,194048, 13458), -- Zul'Drak // Desecrate the Flame (Alliance) - Northend
+(1,194033, 13441), -- Borean Tundra
+(1,194034, 13450), -- Sholazar Basin
+(1,194037, 13451), -- Dragonblight
+(1,194046, 13457), -- Crystalsong Forest
+(1,194043, 13455), -- Storm Peaks
+(1,194042, 13454), -- Grizzly Hills
+(1,194039, 13453); -- Howling Fjords
diff --git a/sql/old/3.3.5a/2012_08_05_00_world_trinity_string.sql b/sql/old/3.3.5a/2012_08_05_00_world_trinity_string.sql
new file mode 100644
index 00000000000..e432f598c02
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_05_00_world_trinity_string.sql
@@ -0,0 +1,5 @@
+DELETE FROM `trinity_string` WHERE `entry` IN (5032,5033,5034);
+INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES
+(5032,'No battleground found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(5033,'No achievement criteria found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(5034,'No outdoor PvP found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
diff --git a/sql/old/3.3.5a/2012_08_05_01_world_command.sql b/sql/old/3.3.5a/2012_08_05_01_world_command.sql
new file mode 100644
index 00000000000..f19bfe1c0d0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_05_01_world_command.sql
@@ -0,0 +1,19 @@
+DELETE FROM `command` WHERE `name` IN (
+'disable add quest','disable add map','disable add battleground','disable add achievement_criteria','disable add spell','disable add outdoorpvp','disable add vmap',
+'disable remove quest','disable remove map','disable remove battleground','disable remove achievement_criteria','disable remove spell','disable remove outdoorpvp','disable remove vmap'
+);
+INSERT INTO `command` (`name`,`security`,`help`) VALUES
+('disable add quest',3,'Syntax: .disable add quest $entry $flag $comment'),
+('disable add map',3,'Syntax: .disable add map $entry $flag $comment'),
+('disable add battleground',3,'Syntax: .disable add battleground $entry $flag $comment'),
+('disable add achievement_criteria',3,'Syntax: .disable add achievement_criteria $entry $flag $comment'),
+('disable add spell',3,'Syntax: .disable add spell $entry $flag $comment'),
+('disable add outdoorpvp',3,'Syntax: .disable add outdoorpvp $entry $flag $comment'),
+('disable add vmap',3,'Syntax: .disable add vmap $entry $flag $comment'),
+('disable remove quest',3,'Syntax: .disable remove quest $entry'),
+('disable remove map',3,'Syntax: .disable remove map $entry'),
+('disable remove battleground',3,'Syntax: .disable remove battleground $entry'),
+('disable remove achievement_criteria',3,'Syntax: .disable remove achievement_criteria $entry'),
+('disable remove spell',3,'Syntax: .disable remove spell $entry'),
+('disable remove outdoorpvp',3,'Syntax: .disable remove outdoorpvp $entry'),
+('disable remove vmap',3,'Syntax: .disable remove vmap $entry');
diff --git a/sql/old/3.3.5a/2012_08_06_00_auth_logs.sql b/sql/old/3.3.5a/2012_08_06_00_auth_logs.sql
new file mode 100644
index 00000000000..04e90e7d208
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_06_00_auth_logs.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `logs` ADD COLUMN `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `type`;
+
diff --git a/sql/old/3.3.5a/2012_08_06_00_world_command.sql b/sql/old/3.3.5a/2012_08_06_00_world_command.sql
new file mode 100644
index 00000000000..50628aaa589
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_06_00_world_command.sql
@@ -0,0 +1,4 @@
+DELETE FROM `command` WHERE `name` IN ('server togglequerylog', 'server set loglevel');
+
+INSERT INTO `command` (`name`,`security`,`help`) VALUES
+('server set loglevel',4,'Syntax: .server set loglevel $facility $name $loglevel. $facility can take the values: appender (a) or logger (l). $loglevel can take the values: disabled (0), trace (1), debug (2), info (3), warn (4), error (5) or fatal (6)');
diff --git a/sql/old/3.3.5a/2012_08_07_00_characters_characters.sql b/sql/old/3.3.5a/2012_08_07_00_characters_characters.sql
new file mode 100644
index 00000000000..e9bea82ad4b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_07_00_characters_characters.sql
@@ -0,0 +1,2 @@
+UPDATE characters SET drunk = (drunk / 256) & 0xFF;
+ALTER TABLE characters CHANGE drunk drunk tinyint(3) unsigned NOT NULL DEFAULT '0';
diff --git a/sql/old/3.3.5a/2012_08_09_00_world_creature_template.sql b/sql/old/3.3.5a/2012_08_09_00_world_creature_template.sql
new file mode 100644
index 00000000000..8d04c13dc87
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_09_00_world_creature_template.sql
@@ -0,0 +1,6 @@
+UPDATE `creature_template` SET `npcflag`=`npcflag` |2 WHERE `entry` IN (25918,25929,25931,25933,25936,25938,25946,32811,32812,32813,32816);
+
+DELETE FROM `creature_loot_template` WHERE `entry` IN(17465,20583) AND `item`=22554;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(17465,22554,15,1,0,1,1), -- Formula: Enchant 2H Weapon - Savagery
+(20583,22554,15,1,0,1,1); -- Formula: Enchant 2H Weapon - Savagery
diff --git a/sql/old/3.3.5a/2012_08_09_01_world_sai.sql b/sql/old/3.3.5a/2012_08_09_01_world_sai.sql
new file mode 100644
index 00000000000..94dce1bcc2c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_09_01_world_sai.sql
@@ -0,0 +1,48 @@
+-- Territorial Trespass (13051)
+
+SET @NPC_VERANUS := 30461;
+SET @QUEST := 13051;
+SET @EVENT := 19714;
+SET @NPC_THORIM := 30462;
+SET @SPELL_MOUNT := 43671;
+
+UPDATE `creature_template` SET `HoverHeight`=10.8,`speed_walk`=3.2,`speed_run`=1.42857146263123,`VehicleId`=237,`minlevel`=80,`faction_A`=14,`faction_H`=14,`unit_flags`=0x8140,`InhabitType`=5 WHERE `entry`=@NPC_VERANUS;
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_VERANUS;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_VERANUS,0,0x3000000,0x1,'');
+
+DELETE FROM `creature_text` WHERE `entry` IN (@NPC_VERANUS,@NPC_THORIM);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_VERANUS,0,0,'%s lets out a bellowing roar as she descends upon the nest.',16,0,100,15,0,0,'Veranus'),
+(@NPC_THORIM,0,0,'Look out below!',14,0,100,0,0,0,'Thorim'),
+(@NPC_THORIM,1,0,'Easy there, girl! Don''t you recognize your old master?',12,0,100,0,0,0,'Thorim'),
+(@NPC_THORIM,2,0,'I will see you at the Temple of Storms. Looks like I''m going to have to break her in again.',12,0,100,0,0,0,'Thorim');
+
+-- Veranus SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@NPC_VERANUS,@NPC_THORIM);
+DELETE FROM `smart_scripts` WHERE (`entryorguid` IN (@NPC_VERANUS,@NPC_THORIM) AND `source_type`=0) OR (`entryorguid`=@NPC_THORIM*100 AND `source_type`=9);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC_VERANUS,0,0,0,54,0,100,0,0,0,0,0,53,1,@NPC_VERANUS,0,@QUEST,0,0,1,0,0,0,0,0,0,0,'Veranus - On Summoned - Start WP-Movement'),
+(@NPC_VERANUS,0,1,2,58,0,100,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Veranus - On WP-End - Talk(emote)'),
+(@NPC_VERANUS,0,2,3,61,0,100,0,1,0,0,0,33,@NPC_VERANUS,0,0,0,0,0,7,0,0,0,0,0,0,0,'Veranus - On WP-End - Give quest credit'),
+(@NPC_VERANUS,0,3,0,61,0,100,0,0,0,0,0,12,@NPC_THORIM,8,0,0,0,0,8,0,0,0,7096.863,-904.658,1119.904,2.338741,'Veranus - On WP-End - Summon Thorim'),
+(@NPC_VERANUS,0,4,5,38,0,100,0,1,1,0,0,46,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Veranus - On data - Move forward'),
+(@NPC_VERANUS,0,5,0,61,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Veranus - On data - despawn'),
+--
+(@NPC_THORIM,0,0,0,54,0,100,0,0,0,0,0,80,@NPC_THORIM*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim - On Summoned - Start script'),
+(@NPC_THORIM,0,1,0,38,0,100,0,1,1,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim - On data - despawn'),
+(@NPC_THORIM*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim - On Script - Talk(yell)'),
+(@NPC_THORIM*100,9,1,0,0,0,100,0,0,0,0,0,11,@SPELL_MOUNT,0,0,0,0,0,7,0,0,0,0,0,0,0,'Thorim - On Script - Cast spell mount'),
+(@NPC_THORIM*100,9,2,0,0,0,100,0,10000,10000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim - On Script - Talk(say)'),
+(@NPC_THORIM*100,9,3,0,0,0,100,0,5000,5000,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim - On Script - Talk(say)'),
+(@NPC_THORIM*100,9,4,0,0,0,100,0,0,0,0,0,45,1,1,0,0,0,0,7,0,0,0,0,0,0,0,'Thorim - On Script - Set data'),
+(@NPC_THORIM*100,9,5,0,0,0,100,0,0,0,0,0,45,1,1,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim - On Script - Set data');
+
+DELETE FROM `waypoints` WHERE `entry`=@NPC_VERANUS;
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@NPC_VERANUS,1,7083.224,-912.2372,1090.213,'Veranus - WP1');
+
+DELETE FROM `event_scripts` WHERE `id`=@EVENT;
+INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
+(@EVENT,0,10,@NPC_VERANUS,600000,0,6947.481,-859.5176,1147.604,5.674867);
diff --git a/sql/old/3.3.5a/2012_08_10_00_world_conditions.sql b/sql/old/3.3.5a/2012_08_10_00_world_conditions.sql
new file mode 100644
index 00000000000..14c5c570b6e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_00_world_conditions.sql
@@ -0,0 +1,7 @@
+SET @ENTRY := 27482; -- Wounded Westfall Infantry npc
+SET @SPELL := 48845; -- Renew Infantry spell
+SET @ITEM := 37576; -- Renewing Bandage item
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=@ITEM;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,@SPELL,0,31,1,3,@ENTRY,0,0,0,'', "Item Renewing Bandage target Wounded Westfall Infantry");
diff --git a/sql/old/3.3.5a/2012_08_10_01_world_loot_template.sql b/sql/old/3.3.5a/2012_08_10_01_world_loot_template.sql
new file mode 100644
index 00000000000..07d400dc0d7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_01_world_loot_template.sql
@@ -0,0 +1,25 @@
+-- Emperor Vek'nilash update loot chance based on http://old.wowhead.com/npc=15275#drops:0+1-15 by nelegalno
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=11 WHERE `entry`=15275 AND `item`=21606; -- Belt of the Fallen Emperor
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=12 WHERE `entry`=15275 AND `item`=21604; -- Bracelets of Royal Redemption
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=11 WHERE `entry`=15275 AND `item`=21605; -- Gloves of the Hidden Temple
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=11 WHERE `entry`=15275 AND `item`=21607; -- Grasp of the Fallen Emperor
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`= 7 WHERE `entry`=15275 AND `item`=21679; -- Kalimdor's Revenge
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=11 WHERE `entry`=15275 AND `item`=21609; -- Regenerating Belt of Vek'nilash
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=63 WHERE `entry`=15275 AND `item`=20726; -- Formula: Enchant Gloves - Threat
+
+-- Emperor Vek'lor update loot chance based on http://old.wowhead.com/npc=15276#drops:0+1-15 by nelegalno
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=11 WHERE `entry`=15276 AND `item`=21600; -- Boots of Epiphany
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=13 WHERE `entry`=15276 AND `item`=21602; -- Qiraji Execution Bracers
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=13 WHERE `entry`=15276 AND `item`=21601; -- Ring of Emperor Vek'lor
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=14 WHERE `entry`=15276 AND `item`=21598; -- Royal Qiraji Belt
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`= 7 WHERE `entry`=15276 AND `item`=21597; -- Royal Scepter of Vek'lor
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=13 WHERE `entry`=15276 AND `item`=21599; -- Vek'lor's Gloves of Devastation
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=64 WHERE `entry`=15276 AND `item`=20735; -- Formula: Enchant Cloak - Subtlety
+
+-- Princess Huhuran update loot chance based on http://old.wowhead.com/npc=15509#drops:0+1-15 by nelegalno
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=15 WHERE `entry`=15509 AND `item`=21621; -- Cloak of the Golden Hive
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=15 WHERE `entry`=15509 AND `item`=21619; -- Gloves of the Messiah
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=16 WHERE `entry`=15509 AND `item`=21618; -- Hive Defiler Wristguards
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`= 8 WHERE `entry`=15509 AND `item`=21616; -- Huhuran's Stinger
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=17 WHERE `entry`=15509 AND `item`=21620; -- Ring of the Martyr
+UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=14 WHERE `entry`=15509 AND `item`=21617; -- Wasphide Gauntlets
diff --git a/sql/old/3.3.5a/2012_08_10_02_world_script_texts.sql b/sql/old/3.3.5a/2012_08_10_02_world_script_texts.sql
new file mode 100644
index 00000000000..0b97df592e1
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_02_world_script_texts.sql
@@ -0,0 +1,6 @@
+UPDATE `script_texts` SET `sound`=14036 WHERE `entry` = -1619015;
+UPDATE `script_texts` SET `sound`=14037 WHERE `entry` = -1619016;
+UPDATE `script_texts` SET `sound`=14038 WHERE `entry` = -1619017;
+UPDATE `script_texts` SET `sound`=14039 WHERE `entry` = -1619018;
+UPDATE `script_texts` SET `sound`=14034 WHERE `entry` = -1619019;
+UPDATE `script_texts` SET `sound`=14035 WHERE `entry` = -1619020;
diff --git a/sql/old/3.3.5a/2012_08_10_03_world_quest_template.sql b/sql/old/3.3.5a/2012_08_10_03_world_quest_template.sql
new file mode 100644
index 00000000000..c4aebf5ba16
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_03_world_quest_template.sql
@@ -0,0 +1,18 @@
+-- Zandalar Tribe Quests Required Class/Race fix by nelegalno
+
+-- Maywiki of Zuldazar Quests Required Class
+UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` IN (8056,8074,8075,8116,8117,8118,8119); -- Shaman
+UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` IN (8057,8064,8065,8110,8111,8112,8113); -- Druid
+
+-- Al'tabim the All-Seeing Quests Required Class
+UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` IN (8049,8050,8051,8052,8061,8070,8071); -- Priest
+UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` IN (8060,8068,8069,8101,8102,8103,8104); -- Mage
+UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` IN (8059,8076,8077,8106,8107,8108,8109); -- Warlock
+
+-- Falthir the Sightless Quests Required Class
+UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` IN (8062,8066,8067,8145,8146,8147,8148); -- Hunter
+UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` IN (8063,8072,8073,8141,8142,8143,8144); -- Rogue
+UPDATE `quest_template` SET `RequiredRaces` = 152 WHERE `Id` = 8144; -- Night Elf, Undead and Troll
+
+-- Jin'rokh the Breaker
+UPDATE `quest_template` SET `RequiredRaces` = 513 WHERE `Id` = 8048; -- Human and Blood Elf
diff --git a/sql/old/3.3.5a/2012_08_10_04_world_gossip.sql b/sql/old/3.3.5a/2012_08_10_04_world_gossip.sql
new file mode 100644
index 00000000000..a2082447dfc
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_04_world_gossip.sql
@@ -0,0 +1,5 @@
+-- -18754 Barim Splithoof Leather working trainer
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=7816;
+INSERT INTO `gossip_menu_option` VALUES
+(7816,0,3, 'I would like to train.', 5,16,0,0,0,0,NULL),
+(7816,1,1, 'Let me browse your goods.', 3,128,0,0,0,0,NULL);
diff --git a/sql/old/3.3.5a/2012_08_10_05_world_quest_template.sql b/sql/old/3.3.5a/2012_08_10_05_world_quest_template.sql
new file mode 100644
index 00000000000..a65e7e76a44
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_05_world_quest_template.sql
@@ -0,0 +1,2 @@
+-- Change $B$$B at end of details text to $B$B
+UPDATE `quest_template` SET `Details`='Brave traveler, the centaurs have increased their attacks in this area. Freewind Post must know about this renewed harassment immediately! Seek Cliffwatcher Longhorn at Freewind Post to the southeast and give him this urgent message.$b$bBe warned, avoid the Grimtotem Clan nearby... they have been acting strange toward us lately.$B$B' WHERE `Id`=4542;
diff --git a/sql/old/3.3.5a/2012_08_10_06_world_creature.sql b/sql/old/3.3.5a/2012_08_10_06_world_creature.sql
new file mode 100644
index 00000000000..3d59f06db78
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_10_06_world_creature.sql
@@ -0,0 +1,16 @@
+SET @CGUID:=42571; -- Need 2
+DELETE FROM `creature` WHERE `id` IN (30395,30469);
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
+(@CGUID+0,30395,571,1,1,0,0,8348.886,-2509.476,1147.369,3.700098,120,0,0,12600,0,0,0,0,0),
+(@CGUID+1,30469,571,1,1,0,0,7620.369,-1609.421,969.6507,0.767944,120,0,0,12600,0,0,0,0,0);
+
+-- Template updates
+UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=30395; -- Chieftain Swiftspear
+UPDATE `creature_template` SET `faction_A`=1978,`faction_H`=1978 WHERE `entry`=30469; -- Tracker Val'zij
+-- Model data
+UPDATE `creature_model_info` SET `bounding_radius`=0.6076385,`combat_reach`=2.625,`gender`=0 WHERE `modelid`=27004; -- Chieftain Swiftspear
+-- Addon data
+DELETE FROM `creature_template_addon` WHERE `entry`IN (30395,30469);
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(30395,0,0,1,0, NULL), -- Chieftain Swiftspear
+(30469,0,8,1,0, NULL); -- Tracker Val'zij
diff --git a/sql/old/3.3.5a/2012_08_11_00_world_creature_template.sql b/sql/old/3.3.5a/2012_08_11_00_world_creature_template.sql
new file mode 100644
index 00000000000..972b125d247
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_11_00_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (17465,20583);
diff --git a/sql/old/3.3.5a/2012_08_11_01_world_quest_poi.sql b/sql/old/3.3.5a/2012_08_11_01_world_quest_poi.sql
new file mode 100644
index 00000000000..6672df2bc98
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_11_01_world_quest_poi.sql
@@ -0,0 +1,60 @@
+-- PK and new index for quest_poi
+ALTER TABLE `quest_poi` DROP INDEX `questId`;
+ALTER TABLE `quest_poi` DROP INDEX `id`;
+ALTER TABLE `quest_poi` ADD PRIMARY KEY (`questId`, `id`);
+ALTER TABLE `quest_poi` ADD INDEX `idx` (`questId`, `id`);
+
+-- Correct data for quest_poi_points that violate the PK
+UPDATE `quest_poi_points` SET `idx`=0 WHERE `questId`=25446 AND `id`=0 AND `x`=-1041 AND `y`=-5585;
+UPDATE `quest_poi_points` SET `idx`=1 WHERE `questId`=25446 AND `id`=0 AND `x`=-1062 AND `y`=-5631;
+UPDATE `quest_poi_points` SET `idx`=2 WHERE `questId`=25446 AND `id`=0 AND `x`=-1066 AND `y`=-5375;
+UPDATE `quest_poi_points` SET `idx`=3 WHERE `questId`=25446 AND `id`=0 AND `x`=-1189 AND `y`=-5343;
+UPDATE `quest_poi_points` SET `idx`=4 WHERE `questId`=25446 AND `id`=0 AND `x`=-1195 AND `y`=-5618;
+UPDATE `quest_poi_points` SET `idx`=5 WHERE `questId`=25446 AND `id`=0 AND `x`=-1269 AND `y`=-5386;
+UPDATE `quest_poi_points` SET `idx`=6 WHERE `questId`=25446 AND `id`=0 AND `x`=-1289 AND `y`=-5571;
+UPDATE `quest_poi_points` SET `idx`=7 WHERE `questId`=25446 AND `id`=0 AND `x`=-1320 AND `y`=-5477;
+UPDATE `quest_poi_points` SET `idx`=8 WHERE `questId`=25446 AND `id`=0 AND `x`=-1322 AND `y`=-5527;
+UPDATE `quest_poi_points` SET `idx`=0 WHERE `questId`=25446 AND `id`=1 AND `x`=-1502 AND `y`=-5263;
+UPDATE `quest_poi_points` SET `idx`=1 WHERE `questId`=25446 AND `id`=1 AND `x`=-1532 AND `y`=-5341;
+UPDATE `quest_poi_points` SET `idx`=2 WHERE `questId`=25446 AND `id`=1 AND `x`=-1589 AND `y`=-5340;
+UPDATE `quest_poi_points` SET `idx`=3 WHERE `questId`=25446 AND `id`=1 AND `x`=-1611 AND `y`=-5276;
+UPDATE `quest_poi_points` SET `idx`=4 WHERE `questId`=25446 AND `id`=2 AND `x`=-1020 AND `y`=-5153;
+UPDATE `quest_poi_points` SET `idx`=5 WHERE `questId`=25446 AND `id`=2 AND `x`=-1089 AND `y`=-5174;
+UPDATE `quest_poi_points` SET `idx`=6 WHERE `questId`=25446 AND `id`=2 AND `x`=-1128 AND `y`=-5131;
+UPDATE `quest_poi_points` SET `idx`=7 WHERE `questId`=25446 AND `id`=2 AND `x`=-0955 AND `y`=-5186;
+UPDATE `quest_poi_points` SET `idx`=0 WHERE `questId`=25446 AND `id`=3 AND `x`=-0654 AND `y`=-5627;
+UPDATE `quest_poi_points` SET `idx`=1 WHERE `questId`=25446 AND `id`=3 AND `x`=-0688 AND `y`=-5518;
+UPDATE `quest_poi_points` SET `idx`=2 WHERE `questId`=25446 AND `id`=3 AND `x`=-0730 AND `y`=-5656;
+UPDATE `quest_poi_points` SET `idx`=3 WHERE `questId`=25446 AND `id`=3 AND `x`=-0732 AND `y`=-5499;
+UPDATE `quest_poi_points` SET `idx`=4 WHERE `questId`=25446 AND `id`=3 AND `x`=-0795 AND `y`=-5544;
+UPDATE `quest_poi_points` SET `idx`=5 WHERE `questId`=25446 AND `id`=3 AND `x`=-0806 AND `y`=-5674;
+UPDATE `quest_poi_points` SET `idx`=6 WHERE `questId`=25446 AND `id`=3 AND `x`=-0835 AND `y`=-5606;
+UPDATE `quest_poi_points` SET `idx`=0 WHERE `questId`=25446 AND `id`=4 AND `x`=-0747 AND `y`=-5004;
+
+UPDATE `quest_poi_points` SET `idx`=0 WHERE `questId`=25461 AND `x`=246 AND `y`=-4715;
+UPDATE `quest_poi_points` SET `idx`=1 WHERE `questId`=25461 AND `x`=247 AND `y`=-4675;
+UPDATE `quest_poi_points` SET `idx`=2 WHERE `questId`=25461 AND `x`=248 AND `y`=-4673;
+UPDATE `quest_poi_points` SET `idx`=3 WHERE `questId`=25461 AND `x`=266 AND `y`=-4830;
+UPDATE `quest_poi_points` SET `idx`=4 WHERE `questId`=25461 AND `x`=284 AND `y`=-4628;
+UPDATE `quest_poi_points` SET `idx`=5 WHERE `questId`=25461 AND `x`=302 AND `y`=-4612;
+UPDATE `quest_poi_points` SET `idx`=6 WHERE `questId`=25461 AND `x`=343 AND `y`=-4831;
+UPDATE `quest_poi_points` SET `idx`=7 WHERE `questId`=25461 AND `x`=345 AND `y`=-4831;
+UPDATE `quest_poi_points` SET `idx`=8 WHERE `questId`=25461 AND `x`=376 AND `y`=-4778;
+UPDATE `quest_poi_points` SET `idx`=9 WHERE `questId`=25461 AND `x`=380 AND `y`=-4661;
+UPDATE `quest_poi_points` SET `idx`=10 WHERE `questId`=25461 AND `x`=411 AND `y`=-4704;
+
+UPDATE `quest_poi_points` SET `idx`=0 WHERE `questId`=25444 AND `x`=-1014 AND `y`=-4911;
+UPDATE `quest_poi_points` SET `idx`=1 WHERE `questId`=25444 AND `x`=-0644 AND `y`=-4999;
+UPDATE `quest_poi_points` SET `idx`=2 WHERE `questId`=25444 AND `x`=-0673 AND `y`=-4932;
+UPDATE `quest_poi_points` SET `idx`=3 WHERE `questId`=25444 AND `x`=-0673 AND `y`=-5062;
+UPDATE `quest_poi_points` SET `idx`=4 WHERE `questId`=25444 AND `x`=-0736 AND `y`=-5100;
+UPDATE `quest_poi_points` SET `idx`=5 WHERE `questId`=25444 AND `x`=-0740 AND `y`=-4873;
+UPDATE `quest_poi_points` SET `idx`=6 WHERE `questId`=25444 AND `x`=-0808 AND `y`=-4831;
+UPDATE `quest_poi_points` SET `idx`=7 WHERE `questId`=25444 AND `x`=-0808 AND `y`=-5100;
+UPDATE `quest_poi_points` SET `idx`=8 WHERE `questId`=25444 AND `x`=-0887 AND `y`=-5062;
+UPDATE `quest_poi_points` SET `idx`=9 WHERE `questId`=25444 AND `x`=-0892 AND `y`=-4776;
+UPDATE `quest_poi_points` SET `idx`=10 WHERE `questId`=25444 AND `x`=-0959 AND `y`=-4995;
+UPDATE `quest_poi_points` SET `idx`=11 WHERE `questId`=25444 AND `x`=-0984 AND `y`=-4785;
+
+-- PK for quest_poi_points
+ALTER TABLE `quest_poi_points` ADD PRIMARY KEY (`questId`, `id`, `idx`);
diff --git a/sql/old/3.3.5a/2012_08_12_00_world_conditions.sql b/sql/old/3.3.5a/2012_08_12_00_world_conditions.sql
new file mode 100644
index 00000000000..6e1fd0ac1db
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_12_00_world_conditions.sql
@@ -0,0 +1,3 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=58124;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,58124,0,0,32,0,0x90,0,0,0,0,'','Mal''Ganis Kill Credit - Player target');
diff --git a/sql/old/3.3.5a/2012_08_12_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_08_12_01_world_spell_script_names.sql
new file mode 100644
index 00000000000..980aceff519
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_12_01_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=36554;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(36554,'spell_rog_shadowstep');
diff --git a/sql/old/3.3.5a/2012_08_12_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_08_12_02_world_spell_script_names.sql
new file mode 100644
index 00000000000..15ca9c43cc5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_12_02_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=-32379;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-32379,'spell_pri_shadow_word_death');
diff --git a/sql/old/3.3.5a/2012_08_13_00_world_creature_text.sql b/sql/old/3.3.5a/2012_08_13_00_world_creature_text.sql
new file mode 100644
index 00000000000..aeb24dbfe90
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_13_00_world_creature_text.sql
@@ -0,0 +1,133 @@
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1649999 AND -1649000;
+DELETE FROM `creature_text` WHERE `entry` IN (34996,34990,34995,36095,34796,35144,34799,34797,34780,35458,34496,34497,16980,35877,34564,34660);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+-- Highlord Tirion Fordring
+ -- Northrend Beasts
+(34996, 0, 0, 'Welcome, champions! You have heard the call of the Argent Crusade and you have boldly answered! It is here, in the Crusaders'' Coliseum, that you will face your greatest challenges. Those of you who survive the rigors of the coliseum will join the Argent Crusade on its march to Icecrown Citadel.', 14, 0, 100, 0, 0, 16036, 'Highlord Tirion Fordring - Welcome'),
+(34996, 1, 0, 'Hailing from the deepest, darkest caverns of the Storm Peaks, Gormok the Impaler! Battle on, heroes!', 14, 0, 100, 0, 0, 16038, 'Highlord Tirion Fordring - Summing Gormok the Impaler'),
+(34996, 2, 0, 'Steel yourselves, heroes, for the twin terrors, Acidmaw and Dreadscale, enter the arena!', 14, 0, 100, 0, 0, 16039, 'Highlord Tirion Fordring - Summing Acidmaw and Dreadscale'),
+(34996, 3, 0, 'The air itself freezes with the introduction of our next combatant, Icehowl! Kill or be killed, champions!', 14, 0, 100, 0, 0, 16040, 'Highlord Tirion Fordring Summing Icehowl'),
+(34996, 4, 0, 'The monstrous menagerie has been vanquished!', 14, 0, 100, 0, 0, 16041, 'Highlord Tirion Fordring - Northrend Beasts Done'),
+(34996, 5, 0, 'Tragic... They fought valiantly, but the beasts of Northrend triumphed. Let us observe a moment of silence for our fallen heroes.', 14, 0, 0, 0, 0, 16042, 'Highlord Tirion Fordring - Northrend Beasts FAIL'),
+ -- Lord Jaraxxus
+(34996, 6, 0, 'Grand Warlock Wilfred Fizzlebang will summon forth your next challenge. Stand by for his entry.', 14, 0, 100, 0, 0, 16043, 'Highlord Tirion Fordring - Summing Wilfred Fizzlebang'),
+(34996, 7, 0, 'Quickly, heroes, destroy the demon lord before it can open a portal to its twisted demonic realm!', 14, 0, 100, 5, 0, 16044, 'Highlord Tirion Fordring to Wilfred Fizzlebang - Lord Jaraxxus Intro'),
+(34996, 8, 0, 'The loss of Wilfred Fizzlebang, while unfortunate, should be a lesson to those that dare dabble in dark magic. Alas, you are victorious and must now face the next challenge.', 14, 0, 100, 0, 0, 16045, 'Highlord Tirion Fordring - Lord Jaraxxus Outro'),
+(34996, 9, 0, 'Everyone calm down! Compose yourselves! There is no conspiracy at play here! The warlock acted on his own volition, outside of influences from the Alliance. The tournament must go on!', 14, 0, 100, 5, 0, 16046, 'Highlord Tirion Fordring - Lord Jaraxxus Outro'),
+ -- Faction Champions
+(34996, 10, 0, 'The next battle will be against the Argent Crusade''s most powerful knights! Only by defeating them will you be deemed worthy...', 14, 0, 100, 0, 0, 16047, 'Highlord Tirion Fordring - Faction Champions Intro'),
+(34996, 11, 0, 'Very well. I will allow it. Fight with honor!', 14, 0, 100, 1, 0, 16048, 'Highlord Tirion Fordring - Faction Champions Intro'),
+(34996, 12, 0, 'A shallow and tragic victory. We are weaker as a whole from the losses suffered today. Who but the Lich King could benefit from such foolishness? Great warriors have lost their lives. And for what? The true threat looms ahead - the Lich King awaits us all in death.', 14, 0, 100, 0, 0, 16049, 'Highlord Tirion Fordring - Faction Champions Outro'),
+ -- Twin Val'kyr
+(34996, 13, 0, 'Only by working together will you overcome the final challenge. From the depths of Icecrown come two of the Scourge''s most powerful lieutenants: fearsome val''kyr, winged harbingers of the Lich King!', 14, 0, 100, 0, 0, 16050, 'Highlord Tirion Fordring - Twin Val''kyr Intro'),
+(34996, 14, 0, 'Let the games begin!', 14, 0, 100, 0, 0, 16037, 'Highlord Tirion Fordring - Twin Val''kyr Intro'),
+ -- Anub''arak
+(34996, 15, 0, 'A mighty blow has been dealt to the Lich King! You have proven yourselves as able bodied champions of the Argent Crusade. Together we will strike against Icecrown Citadel and destroy what remains of the Scourge! There is no challenge that we cannot face united!', 14, 0, 100, 5, 0, 16051, 'Highlord Tirion Fordring - Anub''arak Intro'),
+(34996, 16, 0, 'Arthas! You are hopelessly outnumbered! Lay down Frostmourne and I will grant you a just death.', 14, 0, 100, 25, 0, 16052, 'Highlord Tirion Fordring'),
+
+-- King Varian Wrynn
+(34990, 0, 0, 'Your beasts will be no match for my champions, Tirion!', 14, 0, 0, 0, 0, 16069, 'King Varian Wrynn'),
+(34990, 1, 0, 'The Alliance doesn''t need the help of a demon lord to deal with Horde filth! Come, pig!', 14, 0, 100, 5, 0, 16064, 'King Varian Wrynn'),
+(34990, 2, 0, 'Our honor has been besmirched! They make wild claims and false accusations against us. I demand justice! Allow my champions to fight in place of your knights, Tirion. We challenge the Horde!', 14, 0, 100, 5, 0, 16066, 'King Varian Wrynn'),
+(34990, 3, 0, 'Fight for the glory of the Alliance, heroes! Honor your king and your people!', 14, 0, 100, 5, 0, 16065, 'King Varian Wrynn'),
+(34990, 4, 0, 'GLORY TO THE ALLIANCE!', 14, 0, 0, 0, 0, 16067, 'King Varian Wrynn'),
+(34990, 5, 0, 'Not even the Lich King most powerful minions can stand against the Alliance! All hail our victors!', 14, 0, 0, 0, 0, 16068, 'King Varian Wrynn'),
+(34990, 6, 0, 'Hardly a challenge.', 14, 0, 100, 274, 0, 16061, 'King Varian Wrynn - Faction Champions Kill Player'),
+(34990, 6, 1, 'HAH!', 14, 0, 100, 5, 0, 16060, 'King Varian Wrynn - Faction Champions Kill Player'),
+(34990, 6, 2, 'Is this the best the Horde has to offer?', 14, 0, 100, 6, 0, 16063, 'King Varian Wrynn - Faction Champions Kill Player'),
+(34990, 6, 3, 'Worthless scrub.', 14, 0, 100, 25, 0, 16062, 'King Varian Wrynn - Faction Champions Kill Player'),
+
+-- Garrosh Hellscream
+(34995, 0, 0, 'The Horde demands justice! We challenge the Alliance. Allow us to battle in place of your knights, paladin. We will show these dogs what it means to insult the Horde!', 14, 0, 100, 1, 0, 16023, 'Garrosh Hellscream'),
+(34995, 1, 0, 'I''ve seen more worthy challenges in the Ring of Blood. You waste our time, paladin.', 14, 0, 100, 1, 0, 16026, 'Garrosh Hellscream'),
+(34995, 2, 0, 'Treacherous Alliance dogs! You summon a demon lord against warriors of the Horde? Your deaths will be swift!', 14, 0, 100, 5, 0, 16021, 'Garrosh Hellscream'),
+(34995, 3, 0, 'That was just a taste of what the future brings. FOR THE HORDE!', 14, 0, 100, 1, 0, 16024, 'Garrosh Hellscream'),
+(34995, 4, 0, 'Show them no mercy, Horde champions! LOK''TAR OGAR!', 14, 0, 0, 0, 0, 16022, 'Garrosh - Faction Champions Intro'),
+(34995, 5, 0, 'Do you still question the might of the Horde, paladin? We will take on all comers!', 14, 0, 100, 1, 0, 16025, 'Garrosh Hellscream'),
+(34995, 6, 0, 'Weakling!', 14, 0, 0, 0, 0, 16017, 'Garrosh Hellscream - Faction Champions Kill Player'),
+(34995, 6, 1, 'Pathetic!', 14, 0, 0, 0, 0, 16018, 'Garrosh Hellscream - Faction Champions Kill Player'),
+(34995, 6, 2, 'Overpowered.', 14, 0, 0, 0, 0, 16019, 'Garrosh Hellscream - Faction Champions Kill Player'),
+(34995, 6, 3, 'Lok''tar!', 14, 0, 0, 0, 0, 16020, 'Garrosh Hellscream - Faction Champions Kill Player'),
+
+-- Highlord Tirion Fordring
+(36095, 0, 0, 'Champions, you''re alive! Not only have you defeated every challenge of the Trial of the Crusader, but also thwarted Arthas'' plans! Your skill and cunning will prove to be a powerful weapon against the Scourge. Well done! Allow one of the Crusade''s mages to transport you to the surface!', 14, 0, 100, 5, 0, 16053, 'Highlord Tirion Fordring'),
+(36095, 1, 0, 'Let me hand you the chests as a reward, and let its contents will serve you faithfully in the campaign against Arthas in the heart of the Icecrown Citadel!', 41, 0, 0, 0, 0, 0, 'Highlord Tirion Fordring'),
+
+-- Gormok
+(34796, 0, 0, 'My slaves! Destroy the enemy!', 41, 0, 0, 0, 0, 0, 'Gormok the Impaler - Snowball'),
+
+-- Acidmaw
+(35144, 0, 0, 'Upon seeing its companion perish, %s becomes enraged!', 41, 0, 100, 0, 0, 0, 'Acidmaw to Beasts Controller - Enrage'),
+
+-- Dreadscale
+(34799, 0, 0, 'Upon seeing its companion perish, %s becomes enraged!', 41, 0, 100, 0, 0, 0, 'Dreadscale to Beasts Controller - Enrage'),
+
+-- Icehowl
+(34797, 0, 0, '%s glares at $n and lets out a bellowing roar!', 41, 0, 100, 0, 0, 0, 'Icehowl - Start'),
+(34797, 1, 0, '%s crashes into the Coliseum wall and is stunned!', 41, 0, 100, 0, 0, 0, 'Icehowl - Crash'),
+(34797, 2, 0, 'Trampling combatants underfoot, %s goes into a frothing rage!', 41, 0, 100, 0, 0, 0, 'Icehowl - Fail'),
+
+-- Wilfred Fizzlebang
+(35458, 0, 0, 'Thank you, Highlord. Now, challengers, I will begin the ritual of summoning. When I am done a fearsome doomguard will appear!', 14, 0, 100, 2, 0, 16268, 'Wilfred Fizzlebang - Intro'),
+(35458, 1, 0, 'Prepare for oblivion!', 14, 0, 100, 0, 0, 16269, 'Wilfred Fizzlebang - Intro'),
+(35458, 2, 0, 'A-HA! I''ve done it! Behold the absolute power of Wilfred Fizzlebang, master summoner! You are bound to me, demon!', 14, 0, 100, 5, 0, 16270, 'Wilfred Fizzlebang to Wilfred Fizzlebang - Intro'),
+(35458, 3, 0, 'But I''m in charge here...', 14, 0, 100, 5, 0, 16271, 'Wilfred Fizzlebang to Wilfred Fizzlebang - Death'),
+
+-- Lord Jaraxxus
+(34780, 0, 0, 'Trifling gnome! Your arrogance will be your undoing!', 14, 0, 100, 397, 0, 16143, 'Lord Jaraxxus to Wilfred Fizzlebang - Intro'),
+(34780, 1, 0, 'You face Jaraxxus, Eredar Lord of the Burning Legion!', 14, 0, 100, 0, 0, 16144, 'Lord Jaraxxus - Aggro'),
+(34780, 2, 0, '$n has |cFFFF0000Legion Flames!|r', 41, 0, 100, 0, 0, 0, 'Lord Jaraxxus - Legion Flame'),
+(34780, 3, 0, '%s creates a Nether Portal!', 41, 0, 100, 0, 0, 16150, 'Lord Jaraxxus - Summing Nether Portal'),
+(34780, 4, 0, 'Come forth, sister! Your master calls!', 14, 0, 100, 0, 0, 16150, 'Lord Jaraxxus - Summoning Mistress of Pain'),
+(34780, 5, 0, '$n has |cFF00FFFFIncinerate Flesh!|r Heal $g him:her;!', 41, 0, 100, 0, 0, 16149, 'Lord Jaraxxus - Incinerate Flesh'),
+(34780, 6, 0, 'FLESH FROM BONE!', 14, 0, 100, 0, 0, 16149, 'Lord Jaraxxus - Incinerate Flesh'),
+(34780, 7, 0, '%s creates an |cFF00FF00Infernal Volcano!|r', 41, 0, 100, 0, 0, 16151, 'Lord Jaraxxus - Summoning Infernal Volcano emote'),
+(34780, 8, 0, 'IN-FER-NO!', 14, 0, 100, 0, 0, 16151, 'Lord Jaraxxus - Summoning Infernals'),
+(34780, 9, 0, 'Insignificant gnat!', 14, 0, 0, 0, 0, 16145, 'Lord Jaraxxus - Killing a player'),
+(34780, 9, 1, 'Banished to the Nether!', 14, 0, 0, 0, 0, 16146, 'Lord Jaraxxus - Killing a player'),
+(34780, 10, 0, 'Another will take my place. Your world is doomed...', 14, 0, 100, 0, 0, 16147, 'Lord Jaraxxus - Death'),
+(34780, 11, 0,'<Laughs>', 14, 0, 0, 0, 0, 16148, 'Lord Jaraxxus - Berserk'),
+
+-- Eydis Darkban
+(34496, 0, 0, 'In the name of our dark master. For the Lich King. You. Will. Die.', 14, 0, 100, 0, 0, 16272, 'Eydis Darkbane - Aggro'),
+(34496, 1, 0, 'Let the light consume you!', 14, 0, 100, 0, 0, 16279, 'Eydis Darkbane to Fjola Lightbane - Light Vortex'),
+(34496, 2, 0, 'Let the dark consume you!', 14, 0, 100, 0, 0, 16278, 'Eydis Darkbane to Fjola Lightbane - Dark Vortex'),
+(34496, 3, 0, '%s begins to cast |cFF9932CDDark Vortex!|r Switch to |cFF9932CDDark|r Essence!', 41, 0, 100, 0, 0, 16278, 'Eydis Darkbane to Fjola Lightbane - Dark Vortex emote'),
+(34496, 4, 0, '%s begins to cast |cFFFF0000Twin''s Pact!|r', 41, 0, 100, 0, 0, 16274, 'Eydis Darkbane to Fjola Lightbane - Twin''s Pact emote'),
+(34496, 5, 0, 'CHAOS!', 14, 0, 100, 0, 0, 16274, 'Eydis Darkbane to Fjola Lightbane - Twin''s Pact'),
+(34496, 6, 0, 'You have been measured and found wanting.', 14, 0, 100, 0, 0, 16276, 'Eydis Darkbane - Killing a player'),
+(34496, 6, 1, 'UNWORTHY!', 14, 0, 100, 0, 0, 16276, 'Eydis Darkbane - Killing a player'),
+(34496, 7, 0, 'YOU ARE FINISHED!', 14, 0, 0, 0, 0, 16273, 'Eydis Darkbane - Berserk'),
+(34496, 8, 0, 'The Scourge cannot be stopped...', 14, 0, 100, 0, 0, 16275, 'Eydis Darkbane - Death'),
+
+-- Fjola Lightbane
+(34497, 0, 0, 'In the name of our dark master. For the Lich King. You. Will. Die.', 14, 0, 100, 0, 0, 16272, 'Fjola Lightbane - Aggro'),
+(34497, 1, 0, 'Let the light consume you!', 14, 0, 100, 0, 0, 16279, 'Fjola Lightbane to Fjola Lightbane - Light Vortex'),
+(34497, 2, 0, 'Let the dark consume you!', 14, 0, 100, 0, 0, 16278, 'Fjola Lightbane to Fjola Lightbane - Dark Vortex'),
+(34497, 3, 0, '%s begins to cast |cFFFFFFFFLight Vortex!|r Switch to |cFFFFFFFFLight|r Essence!', 41, 0, 100, 0, 0, 16279, 'Fjola Lightbane to Fjola Lightbane - Light Vortex emote'),
+(34497, 4, 0, '%s begins to cast Twin''s Pact!', 41, 0, 100, 0, 0, 16274, 'Fjola Lightbane to Fjola Lightbane - Twin''s Pact emote'),
+(34497, 5, 0, 'CHAOS!', 14, 0, 100, 0, 0, 16274, 'Fjola Lightbane to Fjola Lightbane - Twin''s Pact'),
+(34497, 6, 0, 'You have been measured and found wanting.', 14, 0, 100, 0, 0, 16276, 'Fjola Lightbane - Killing a player'),
+(34497, 6, 1, 'UNWORTHY!', 14, 0, 100, 0, 0, 16276, 'Fjola Lightbane - Killing a player'),
+(34497, 7, 0, 'YOU ARE FINISHED!', 14, 0, 0, 0, 0, 16273, 'Fjola Lightbane - Berserk'),
+(34497, 8, 0, 'The Scourge cannot be stopped...', 14, 0, 100, 0, 0, 16275, 'Fjola Lightbane - Death'),
+
+-- The Lich King
+(35877, 0, 0, 'You will have your challenge, Fordring.', 14, 0, 100, 0, 0, 16321, 'The Lich King'),
+(35877, 1, 0, 'The souls of your fallen champions will be mine, Fordring.', 14, 0, 100, 0, 0, 16323, 'The Lich King'),
+(35877, 2, 0, 'The Nerubians built an empire beneath the frozen wastes of Northrend. An empire that you so foolishly built your structures upon. MY EMPIRE.', 14, 0, 100, 11, 0, 16322, 'The Lich King'),
+
+-- Anub''arak
+(34564, 0, 0, 'Ahhh, our guests have arrived, just as the master promised.', 14, 0, 100, 0, 0, 16235, 'Anub''arak - Intro'),
+(34564, 1, 0, 'This place will serve as your tomb!', 14, 0, 100, 0, 0, 16234, 'Anub''arak - Aggro'),
+(34564, 2, 0, 'Auum na-l ak-k-k-k, isshhh. Rise, minions. Devour...', 14, 0, 100, 0, 0, 16240, 'Anub''arak - Submerge'),
+(34564, 3, 0, '%s burrows into the ground!', 41, 0, 100, 0, 0, 16240, 'Anub''arak - Burrows'),
+(34564, 4, 0, '%s emerges from the ground!', 41, 0, 100, 0, 0, 0, 'Anub''arak - Emerge emote'),
+(34564, 5, 0, 'The swarm shall overtake you!', 14, 0, 100, 0, 0, 16241, 'Anub''arak - Leeching Swarm'),
+(34564, 6, 0, '%s unleashes a Leeching Swarm to heal himself!', 41, 0, 100, 0, 0, 16241, 'Anub''arak - Leeching Swarm emote'),
+(34564, 7, 0, 'F-lakkh shir!', 14, 0, 100, 0, 0, 16236, 'Anub''arak - Killing a player'),
+(34564, 7, 1, 'Another soul to sate the host.', 14, 0, 100, 0, 0, 16237, 'Anub''arak - Killing a player'),
+(34564, 8, 0, 'I have failed you, master...', 14, 0, 100, 0, 0, 16238, 'Anub''arak - Death'),
+
+-- Anub''arak Spike
+(34660, 0, 0, '%s''s spikes pursue $n!', 41, 0, 100, 0, 0, 0, 'Anub''arak - Spike target');
diff --git a/sql/old/3.3.5a/2012_08_13_01_world_creature.sql b/sql/old/3.3.5a/2012_08_13_01_world_creature.sql
new file mode 100644
index 00000000000..4d8544206dd
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_13_01_world_creature.sql
@@ -0,0 +1,10 @@
+SET @GUID := 42575;
+SET @ENTRY := 36095; -- Highlord Tirion Fordring
+
+DELETE FROM `creature` WHERE `id`=@ENTRY;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES
+(@GUID,@ENTRY,649,15,1,648.9167,131.0208,141.6161,0,7200,0,0);
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(@ENTRY,0,0x0,0x1,'57545');
diff --git a/sql/old/3.3.5a/2012_08_14_00_world_creature_text.sql b/sql/old/3.3.5a/2012_08_14_00_world_creature_text.sql
new file mode 100644
index 00000000000..bd0f3531937
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_14_00_world_creature_text.sql
@@ -0,0 +1,24 @@
+DELETE FROM `creature_text` WHERE `entry` IN (34990,34995);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+-- King Varian Wrynn
+(34990, 0, 0, 'Your beasts will be no match for my champions, Tirion!', 14, 0, 0, 0, 0, 16069, 'King Varian Wrynn - Northrend Beasts Outro'),
+(34990, 1, 0, 'The Alliance doesn''t need the help of a demon lord to deal with Horde filth! Come, pig!', 14, 0, 100, 5, 0, 16064, 'King Varian Wrynn - Lord Jaraxxus Outro'),
+(34990, 2, 0, 'Our honor has been besmirched! They make wild claims and false accusations against us. I demand justice! Allow my champions to fight in place of your knights, Tirion. We challenge the Horde!', 14, 0, 100, 5, 0, 16066, 'King Varian Wrynn - Faction Champions Intro'),
+(34990, 3, 0, 'Fight for the glory of the Alliance, heroes! Honor your king and your people!', 14, 0, 100, 5, 0, 16065, 'King Varian Wrynn - Faction Champions Intro'),
+(34990, 4, 0, 'GLORY TO THE ALLIANCE!', 14, 0, 100, 0, 0, 16067, 'King Varian Wrynn - Victory'),
+(34990, 5, 0, 'Not even the Lich King most powerful minions can stand against the Alliance! All hail our victors!', 14, 0, 0, 0, 0, 16068, 'King Varian Wrynn - Faction Champions Outro'),
+(34990, 6, 0, 'Hardly a challenge.', 14, 0, 100, 274, 0, 16061, 'King Varian Wrynn - Faction Champions Kill Player'),
+(34990, 6, 1, 'HAH!', 14, 0, 100, 5, 0, 16060, 'King Varian Wrynn - Faction Champions Kill Player'),
+(34990, 6, 2, 'Is this the best the Horde has to offer?', 14, 0, 100, 6, 0, 16063, 'King Varian Wrynn - Faction Champions Kill Player'),
+(34990, 6, 3, 'Worthless scrub.', 14, 0, 100, 25, 0, 16062, 'King Varian Wrynn - Faction Champions Kill Player'),
+-- Garrosh Hellscream
+(34995, 0, 0, 'I''ve seen more worthy challenges in the Ring of Blood. You waste our time, paladin.', 14, 0, 100, 1, 0, 16026, 'Garrosh Hellscream - Northrend Beasts Outro'),
+(34995, 1, 0, 'Treacherous Alliance dogs! You summon a demon lord against warriors of the Horde? Your deaths will be swift!', 14, 0, 100, 5, 0, 16021, 'Garrosh Hellscream - Lord Jaraxxus Outro'),
+(34995, 2, 0, 'The Horde demands justice! We challenge the Alliance. Allow us to battle in place of your knights, paladin. We will show these dogs what it means to insult the Horde!', 14, 0, 100, 1, 0, 16023, 'Garrosh Hellscream - Faction Champions Intro'),
+(34995, 3, 0, 'Show them no mercy, Horde champions! LOK''TAR OGAR!', 14, 0, 0, 0, 0, 16022, 'Garrosh - Faction Champions Intro'),
+(34995, 4, 0, 'That was just a taste of what the future brings. FOR THE HORDE!', 14, 0, 100, 1, 0, 16024, 'Garrosh Hellscream - Faction Champions Victory'),
+(34995, 5, 0, 'Do you still question the might of the Horde, paladin? We will take on all comers!', 14, 0, 100, 1, 0, 16025, 'Garrosh Hellscream - Faction Champions Outro'),
+(34995, 6, 0, 'Weakling!', 14, 0, 100, 0, 0, 16017, 'Garrosh Hellscream - Faction Champions Kill Player'),
+(34995, 6, 1, 'Pathetic!', 14, 0, 100, 0, 0, 16018, 'Garrosh Hellscream - Faction Champions Kill Player'),
+(34995, 6, 2, 'Overpowered.', 14, 0, 100, 0, 0, 16019, 'Garrosh Hellscream - Faction Champions Kill Player'),
+(34995, 6, 3, 'Lok''tar!', 14, 0, 100, 0, 0, 16020, 'Garrosh Hellscream - Faction Champions Kill Player');
diff --git a/sql/old/3.3.5a/2012_08_14_01_world_creature_text.sql b/sql/old/3.3.5a/2012_08_14_01_world_creature_text.sql
new file mode 100644
index 00000000000..0f182ae098e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_14_01_world_creature_text.sql
@@ -0,0 +1,8 @@
+DELETE FROM `script_texts` WHERE `npc_entry`=10184;
+DELETE FROM `creature_text` WHERE `entry`=10184;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+(10184, 0, 0, 'How fortuitous. Usually, I must leave my lair in order to feed.', 14, 0, 100, 0, 0, 0, 'Onyxia - Aggro'),
+(10184, 1, 0, 'Learn your place mortal!', 14, 0, 100, 0, 0, 0, 'Onyxia - Kill Player'),
+(10184, 2, 0, 'This meaningless exertion bores me. I''ll incinerate you all from above!', 14, 0, 100, 0, 0, 0, 'Onyxia - Phase 2'),
+(10184, 3, 0, 'It seems you''ll need another lesson, mortals!', 14, 0, 100, 0, 0, 0, 'Onyxia - Phase 3'),
+(10184, 4, 0, '%s takes in a deep breath...', 41, 0, 100, 0, 0, 0, 'Onyxia - Deep Breath Emote');
diff --git a/sql/old/3.3.5a/2012_08_14_02_world_creature.sql b/sql/old/3.3.5a/2012_08_14_02_world_creature.sql
new file mode 100644
index 00000000000..5096c7d6b49
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_14_02_world_creature.sql
@@ -0,0 +1,12 @@
+SET @GUID := 42613;
+SET @ENTRY := 28114; -- Mistcaller Soo-gan
+
+DELETE FROM `creature` WHERE `id`=@ENTRY;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@GUID,@ENTRY,571,1,1,0,0,6165.004,5092.975,-97.29356,0.7504916,120,0,0,117700,3809,0);
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(@ENTRY,0,0,0x10000,0x1,0,'51589 52215');
+
+UPDATE `creature_template` SET `npcflag`=`npcflag` |1 WHERE `entry`=@ENTRY;
diff --git a/sql/old/3.3.5a/2012_08_16_00_world_creature_template.sql b/sql/old/3.3.5a/2012_08_16_00_world_creature_template.sql
new file mode 100644
index 00000000000..732f647d7b7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_16_00_world_creature_template.sql
@@ -0,0 +1,3 @@
+-- Added trigger flags to triggers
+UPDATE `creature_template` SET `flags_extra` = flags_extra | 128 WHERE `entry` = 34862;
+UPDATE `creature_template` SET `unit_flags` = unit_flags | 256 WHERE `entry` = 34862;
diff --git a/sql/old/3.3.5a/2012_08_16_00_world_spell_dbc.sql b/sql/old/3.3.5a/2012_08_16_00_world_spell_dbc.sql
new file mode 100644
index 00000000000..248674d17a5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_16_00_world_spell_dbc.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_dbc` WHERE `Id`=35009;
+INSERT INTO `spell_dbc` (`Id`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`Targets`,`CastingTimeIndex`,`ProcCharges`,`SpellLevel`,`RangeIndex`,`Effect1`,`EffectDieSides1`,`EffectBasePoints1`,`EffectImplicitTargetA1`,`EffectImplicitTargetB1`,`EffectRadiusIndex1`,`SpellFamilyName`,`SpellFamilyFlags2`,`DmgMultiplier1`,`SchoolMask`,`Comment`) VALUES
+(35009,134545792,1024,268435460,65536,64,1,101,1,13,125,1,-11,22,16,27,10,4,1,6,'Invisibility - Reducing threat');
diff --git a/sql/old/3.3.5a/2012_08_17_00_world_spell_dbc.sql b/sql/old/3.3.5a/2012_08_17_00_world_spell_dbc.sql
new file mode 100644
index 00000000000..ee6d2d2f3b6
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_17_00_world_spell_dbc.sql
@@ -0,0 +1 @@
+UPDATE `spell_dbc` SET `ProcChance`=101,`ProcCharges`=0,`SpellFamilyName`=3,`SpellFamilyFlags2`=0 WHERE `Id`=35009;
diff --git a/sql/old/3.3.5a/2012_08_19_00_world_pickpocketing_loot_template.sql b/sql/old/3.3.5a/2012_08_19_00_world_pickpocketing_loot_template.sql
new file mode 100644
index 00000000000..773ad9b6ebc
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_19_00_world_pickpocketing_loot_template.sql
@@ -0,0 +1,11 @@
+-- Pickpocketing_loot_template
+UPDATE creature_template SET pickpocketloot=entry WHERE entry=28200;
+DELETE FROM `pickpocketing_loot_template` WHERE entry=28200;
+INSERT INTO `pickpocketing_loot_template` (`entry`,`item`,`ChanceorQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- Dark Necromance
+(28200,37467,100,1,0,1,1),-- A Steamy Romance Novel: Forbidden Love
+(28200,43575,100,1,0,1,1),-- Reinforced Junkbox
+(28200,35952,30,1,0,1,1),-- Briny Hardcheese
+(28200,33447,22,1,0,1,1),-- Runic Healing Potion
+(28200,35948,10,1,0,1,1),-- Savory Snowplum
+(28200,35950,10,1,0,1,1);-- Sweet Potato Bread
diff --git a/sql/old/3.3.5a/2012_08_19_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_08_19_01_world_spell_dbc.sql
new file mode 100644
index 00000000000..69a9c2a8336
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_19_01_world_spell_dbc.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_dbc` WHERE `Id` IN (68184,68620);
+INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES
+(68184, 0, 0, 545259904, 0, 5, 268697856, 128, 0, 16777216, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 7, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Faction Champions - credit marker'),
+(68620, 0, 0, 545259904, 0, 5, 268697856, 128, 0, 16777216, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 7, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Resilience Will Fix It - achievement credit marker');
diff --git a/sql/old/3.3.5a/2012_08_20_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_08_20_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..d0aa185ea3a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE (`spell_id`='33695');
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(33695, 'spell_pal_exorcism_and_holy_wrath_damage');
diff --git a/sql/old/3.3.5a/2012_08_20_01_world_wintergrasp_conditions.sql b/sql/old/3.3.5a/2012_08_20_01_world_wintergrasp_conditions.sql
new file mode 100644
index 00000000000..c97c753afa8
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_01_world_wintergrasp_conditions.sql
@@ -0,0 +1,31 @@
+-- Conditions
+-- Add gossip_menu condition for 9904 Horde
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (9904,9923);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES
+(14,9904,13759,0,1,33280), -- Must have Rank 1: Corporal
+(14,9904,13759,1,1,55629), -- Or must have Rank 2: First Lieutenant
+(14,9904,13761,0,11,33280), -- Must not have Rank 1: Corporal
+(14,9904,13761,0,11,55629), -- Must not have Rank 2: First Lieutenant
+-- Add gossip_menu condition for 9923 Alliance
+(14,9923,13798,0,1,33280), -- Must have Rank 1: Corporal
+(14,9923,13798,1,1,55629), -- Or must have Rank 2: First Lieutenant
+(14,9923,14172,0,11,33280), -- Must not have Rank 1: Corporal
+(14,9923,14172,0,11,55629), -- Must not have Rank 2: First Lieutenant
+-- Add conditions to gossip options horde
+(15,9904,0,0,1,33280), -- Must have reached Rank 1: Corporal
+(15,9904,0,1,1,55629), -- Or must have reached Rank 2: First Lieutenant
+(15,9904,1,0,1,55629), -- Must have reached Rank 2: First Lieutenant
+(15,9904,2,0,1,55629), -- Must have reached Rank 2: First Lieutenant
+-- Add conditions to gossip options alliance
+(15,9923,0,0,1,33280), -- Must have reached Rank 1: Corporal
+(15,9923,0,1,1,55629), -- Or must have reached Rank 2: First Lieutenant
+(15,9923,1,0,1,55629), -- Must have reached Rank 2: First Lieutenant
+(15,9923,2,0,1,55629); -- Must have reached Rank 2: First Lieutenant
+
+/* Spell target conditions for spawning WG siege machines in proper place while building it */
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (56575,56661,56663,61408);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 56575, 0, 0, 31, 0, 3, 27852, 0, 0, 0, '', NULL),
+(13, 1, 56661, 0, 0, 31, 0, 3, 27852, 0, 0, 0, '', NULL),
+(13, 1, 56663, 0, 0, 31, 0, 3, 27852, 0, 0, 0, '', NULL),
+(13, 1, 61408, 0, 0, 31, 0, 3, 27852, 0, 0, 0, '', NULL);
diff --git a/sql/old/3.3.5a/2012_08_20_02_world_wintergrasp_creatures.sql b/sql/old/3.3.5a/2012_08_20_02_world_wintergrasp_creatures.sql
new file mode 100644
index 00000000000..1e75f37d32f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_02_world_wintergrasp_creatures.sql
@@ -0,0 +1,64 @@
+UPDATE `creature_template` SET `exp`=0, `ScriptName`= 'npc_wg_spirit_guide' WHERE `entry`=31841; -- Taunka Spirit Guide
+UPDATE `creature_template` SET `exp`=0, `ScriptName`= 'npc_wg_spirit_guide' WHERE `entry`=31842; -- Dwarven Spirit Guide
+UPDATE `creature_template` SET `exp`=0, `ScriptName`= 'npc_wg_quest_giver' WHERE `entry`=31052; -- Bowyer Randolph
+UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768 WHERE `entry`=39172; -- Marshal Magruder
+UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=30488; -- Travis Day
+UPDATE `creature_template` SET `exp`=0, `ScriptName`= 'npc_wg_quest_giver' WHERE `entry`=31053; -- Primalist Mulfort
+UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|4, `ScriptName`= 'npc_wg_quest_giver' WHERE `entry`=31107; -- Lieutenant Murp (?)
+UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|768 WHERE `entry`=39173; -- Champion Ros'slai
+UPDATE `creature_template` SET `unit_flags`=`unit_flags`|16 WHERE `entry`=30740; -- Valiance Expedition Champion (?)
+UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=27852; -- Wintergrasp Control Arms
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216, `spell1`=51421, /* Fire Cannon */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28366; -- Wintergrasp Tower Cannon
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2,`spell1`=57609, /* Fire Cannon */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=32629; -- Wintergrasp Siege Turret (H)
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2, `spell1`=57609, /* Fire Cannon */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28319; -- Wintergrasp Siege Turret (A)
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2,`speed_run`=1, `spell1`=54109, /* Ram */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=32627; -- Wintergrasp Siege Engine (H)
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2,`speed_run`=1, `spell1`=54109, /* Ram */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28312; -- Wintergrasp Siege Engine (A)
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216,`unit_flags`=16384,`speed_walk`=1.2,`speed_run`=1, `spell1`=54107, /* Ram */ `spell2`=50896, /* Hurl Boulder */ `spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28094; -- Wintergrasp Demolisher
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=2.8,`speed_run`=1.71429, `spell1`=57606, /* Plague Barrel */ `spell2`=50989, /* Flame Breath */ `spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=27881; -- Wintergrasp Catapult
+UPDATE `creature_template` SET `ScriptName`= 'npc_wg_queue' WHERE `entry` IN (32169,32170,35599,35596,35600,35601,35598,35603,35602,35597,35612,35611); -- <Wintergrasp Battle-Master>
+UPDATE `creature_template` SET `ScriptName`= 'npc_wg_demolisher_engineer' WHERE `entry` IN (30400,30499); -- Goblin Mechanic, Gnomish Engineer
+UPDATE `creature_template` SET `ScriptName`= 'npc_wg_quest_giver' WHERE `entry` IN (31054,31091,31036,31101,31051,31153,31151,31102,31106);
+UPDATE `creature_template` SET `gossip_menu_id`=9904 WHERE `entry`=30400;
+UPDATE `creature_template` SET `gossip_menu_id`=10229 WHERE `entry`=31091;
+
+UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1.65,`gender`=0 WHERE `modelid`=27894; -- Knight Dameron
+UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1.65,`gender`=0 WHERE `modelid`=31346; -- Marshal Magruder
+UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1.65,`gender`=0 WHERE `modelid`=31347; -- Champion Ros'slai
+UPDATE `creature_model_info` SET `bounding_radius`=0.305,`combat_reach`=5,`gender`=2 WHERE `modelid`=25301; -- Wintergrasp Siege Turret
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (31841,31842,30400,30499,30489,30869,31036,31051,31052,31054,31108,31109,31153,32294,39172,30870,31053,31091,31101,31102,31106,31107,31151,32296,39173,30740,32629,28319,28366,32627,28312,28094,27881,30739);
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(31841,0,0,1,0, '58729'), -- Taunka Spirit Guide (Spiritual Immunity, Spirit Heal Channel) FIX: Do we need the spell that revives players here (22011)? It has a duration (found in sniffs).
+(31842,0,0,1,0, '58729'), -- Dwarven Spirit Guide This spell (and the spell it triggers, are used in the "ressurect system" in Battleground.cpp
+(30400,0,0,1,0, NULL), -- Goblin Mechanic
+(30499,0,0,1,0, NULL), -- Gnomish Engineer
+(30489,0,0,1,0, NULL), -- Morgan Day
+(30869,0,0,1,0, NULL), -- Arzo Safeflight
+(31036,14337,0,257,0, NULL), -- Commander Zanneth
+(31051,0,0,1,0, NULL), -- Sorceress Kaylana
+(31052,0,0,257,0, NULL), -- Bowyer Randolph
+(31054,0,0,257,0, NULL), -- Anchorite Tessa
+(31108,0,0,257,0, NULL), -- Siege Master Stouthandle
+(31109,0,0,257,0, NULL), -- Senior Demolitionist Legoso
+(31153,6569,0,257,0, NULL), -- Tactical Officer Ahbramis
+(32294,27247,0,1,0, NULL), -- Knight Dameron
+(39172,28912,0,1,0, NULL), -- Marshal Magruder
+(30870,0,0,1,0, NULL), -- Herzo Safeflight
+(31053,0,0,257,0, '18950'), -- Primalist Mulfort (Invisibility and Stealth Detection ... why?)
+(31091,0,0,257,0, '18950'), -- Commander Dardosh (Invisibility and Stealth Detection)
+(31101,0,0,1,0, NULL), -- Hoodoo Master Fu'jin
+(31102,0,0,1,0, NULL), -- Vieron Blazefeather
+(31106,0,0,257,0, NULL), -- Siegesmith Stronghoof
+(31107,0,0,257,0, NULL), -- Lieutenant Murp
+(31151,0,0,257,0, NULL), -- Tactical Officer Kilrath
+(32296,27245,0,1,0, NULL), -- Stone Guard Mukar
+(39173,29261,0,1,0, NULL), -- Champion Ros'slai
+(30740,0,0,257,375, NULL), -- Valiance Expedition Champion
+(32629,0,0,257,0, NULL), -- Wintergrasp Siege Turret
+(28319,0,0,257,0, NULL), -- Wintergrasp Siege Turret
+(28366,0,0,257,0, NULL), -- Wintergrasp Tower Cannon
+(32627,0,0,257,0, NULL), -- Wintergrasp Siege Engine
+(28312,0,0,257,0, NULL), -- Wintergrasp Siege Engine
+(28094,0,0,257,0, NULL), -- Wintergrasp Demolisher
+(27881,0,0,257,0, NULL), -- Wintergrasp Catapult
+(30739,0,0,257,375, NULL); -- Warsong Champion
diff --git a/sql/old/3.3.5a/2012_08_20_03_world_wintergrasp_gameobjects.sql b/sql/old/3.3.5a/2012_08_20_03_world_wintergrasp_gameobjects.sql
new file mode 100644
index 00000000000..c309bf1d9dd
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_03_world_wintergrasp_gameobjects.sql
@@ -0,0 +1,86 @@
+UPDATE `gameobject_template` SET `faction`=114 WHERE `entry` IN (192310,192312,192313,192314,192316,192317,192318,192319,192320,192321,192322,192323,192324,192325,192326,192327,192328,192329,
+192330,192331,192332,192333,192334,192335,192286,192287,192292,192299,192304,192305,192306,192307,192308,192309); -- Alliance Banner
+
+UPDATE `gameobject_template` SET `faction`=114 WHERE `entry` IN (192269,192284,192285,192338,192339,192349,192350,192351,192352,192353,192354,192355,192356,192357,192358,192359,192360,192361,
+192362,192363,192364,192366,192367,192368,192369,192370,192371,192372,192373,192374,192375,192376,192377,192378,192379,192254,
+192255,192336); -- Horde Banner
+
+UPDATE `gameobject_template` SET `faction`=114 WHERE `entry` IN (193096,193097,193098,193099,193100,193101,193102,193103,193104,193105,193106,193107,193108,193109,193124,193125,193126,193127,
+193128,193129,193130,193131,193132,193133,193134,193135,193136,193137,193138,193139,193140,193141,193142,193143,193144,193145,
+193146,193147,193148,193149,193150,193151,193152,193153,193154,193155,193156,193157,193158,193159,193160,193161,193162,193163,
+193164,193165); -- nameless GOs
+
+UPDATE `gameobject_template` SET `ScriptName`= 'go_wg_vehicle_teleporter' WHERE `entry`=192951; -- Vehicle Teleporter
+
+-- Before pushing to master check if guids are free.
+-- Spawns Workshop Capture Points
+SET @GUID := 71385;
+DELETE FROM gameobject WHERE id IN (190475,190487,194959,194962);
+DELETE FROM gameobject WHERE guid BETWEEN @GUID AND @GUID+3;
+INSERT INTO gameobject (guid,id,position_x,position_y,position_z,orientation,map) VALUES
+(@GUID+0, 190475, 4949.344238, 2432.585693, 320.176971, 1.386214, 571), -- ne
+(@GUID+1, 190487, 4948.524414, 3342.337891, 376.875366, 4.400566, 571), -- nw
+(@GUID+2, 194959, 4398.076660, 2356.503662, 376.190491, 0.525406, 571), -- se
+(@GUID+3, 194962, 4390.776367, 3304.094482, 372.429077, 6.097023, 571); -- sw
+
+-- Misc objects in fortress phased properly
+SET @OGUID := 71389;
+DELETE FROM `gameobject` WHERE `id` IN (193096,193097,193098,193099,193100,193101,193102,193103,193104,193105,193106,193107,193108,193109,193124,193125,193126,193127,193128,193129,193130,193131,193132,193133,193134,193135,193136,193137,193138,193139,193140,193141,193142,193143,193144,193145,193146,193147,193148,193149,193150,193151,193152,193153,193154,193155,193156,193157,193158,193159,193160,193161,193162,193163,193164,193165);
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+55;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,193096,571,1,128,5379.885,3008.093,409.181915,-3.124123,0,0,0,0,120,0,1),
+(@OGUID+1,193097,571,1,128,5381.73975,3008.15454,409.181915,2.98449826,0,0,0,0,120,0,1),
+(@OGUID+2,193098,571,1,128,5383.672,3008.02783,409.181915,-3.115388,0,0,0,0,120,0,1),
+(@OGUID+3,193099,571,1,128,5386.25342,3007.79614,409.181915,2.932139,0,0,0,0,120,0,1),
+(@OGUID+4,193100,571,1,128,5387.354,3009.64941,409.181915,-1.30899549,0,0,0,0,120,0,1),
+(@OGUID+5,193101,571,1,128,5381.12744,3010.09717,409.181915,-2.72271276,0,0,0,0,120,0,1),
+(@OGUID+6,193102,571,1,128,5383.12061,3007.90967,410.8231,-2.530723,0,0,0,0,120,0,1),
+(@OGUID+7,193103,571,1,128,5381.105,3007.89575,410.8231,-3.09791875,0,0,0,0,120,0,1),
+(@OGUID+8,193104,571,1,128,5376.777,3010.619,409.191742,-2.60926127,0,0,0,0,120,0,1),
+(@OGUID+9,193105,571,1,128,5381.47559,3010.24731,410.8231,-2.80997539,0,0,0,0,120,0,1),
+(@OGUID+10,193106,571,1,128,5381.059,3009.85864,410.8231,2.66161919,0,0,0,0,120,0,1),
+(@OGUID+11,193107,571,1,128,5381.038,3010.44263,410.8157,-2.0507617,0,0,0,0,120,0,1),
+(@OGUID+12,193108,571,1,128,5379.83154,3007.82373,410.8161,-2.02457881,0,0,0,0,120,0,1),
+(@OGUID+13,193109,571,1,128,5379.99463,3008.40356,410.815918,-3.03687477,0,0,0,0,120,0,1),
+(@OGUID+14,193124,571,1,128,5293.65869,2924.44019,409.29306,1.20427489,0,0,0,0,120,0,1),
+(@OGUID+15,193125,571,1,1,5293.28,2932.32813,409.065247,-2.49581814,0,0,0,0,120,0,1),
+(@OGUID+16,193126,571,1,1,5292.30469,2930.5105,409.157135,-3.06302428,0,0,0,0,120,0,1),
+(@OGUID+17,193127,571,1,64,5293.349,2923.712,409.844757,-1.8762306,0,0,0,0,120,0,1),
+(@OGUID+18,193128,571,1,128,5293.12256,2895.22754,409.208771,-0.9861096,0,0,0,0,120,0,1),
+(@OGUID+19,193129,571,1,128,5292.913,2895.54346,410.419617,-0.122171074,0,0,0,0,120,0,1),
+(@OGUID+20,193130,571,1,128,5294.09473,2894.191,409.164063,-0.7330382,0,0,0,0,120,0,1),
+(@OGUID+21,193131,571,1,128,5295.1875,2895.382,409.143219,-0.349065244,0,0,0,0,120,0,1),
+(@OGUID+22,193132,571,1,128,5294.527,2895.57471,410.6591,-1.92858779,0,0,0,0,120,0,1),
+(@OGUID+23,193133,571,1,128,5295.3916,2895.05737,410.6686,0.6894028,0,0,0,0,120,0,1),
+(@OGUID+24,193134,571,1,128,5295.13525,2895.68481,410.618866,-2.22529364,0,0,0,0,120,0,1),
+(@OGUID+25,193135,571,1,128,5294.97559,2895.33521,410.657684,-2.73143482,0,0,0,0,120,0,1),
+(@OGUID+26,193136,571,1,128,5293.22559,2895.46436,410.413483,-0.802850962,0,0,0,0,120,0,1),
+(@OGUID+27,193137,571,1,128,5295.56,2895.24146,410.628052,-2.11184788,0,0,0,0,120,0,1),
+(@OGUID+28,193138,571,1,128,5293.741,2894.48169,409.183167,-2.72271276,0,0,0,0,120,0,1),
+(@OGUID+29,193139,571,1,64,5294.599,2786.85254,409.8877,-2.356195,0,0,0,0,120,0,1),
+(@OGUID+30,193140,571,1,64,5294.37939,2785.03833,409.175018,-2.33873963,0,0,0,0,120,0,1),
+(@OGUID+31,193141,571,1,64,5293.205,2787.03052,409.218872,3.03687477,0,0,0,0,120,0,1),
+(@OGUID+32,193142,571,1,64,5294.241,2786.42456,409.174347,0.0174524616,0,0,0,0,120,0,1),
+(@OGUID+33,193143,571,1,64,5291.705,2785.86646,409.282135,-2.03330517,0,0,0,0,120,0,1),
+(@OGUID+34,193144,571,1,64,5293.03369,2785.632,409.22522,-1.2915417,0,0,0,0,120,0,1),
+(@OGUID+35,193145,571,1,64,5295.866,2787.7666,409.1923,2.155478,0,0,0,0,120,0,1),
+(@OGUID+36,193146,571,1,64,5293.56445,2787.31079,410.55954,0.261798173,0,0,0,0,120,0,1),
+(@OGUID+37,193147,571,1,128,5233.12061,2920.362,409.163544,-0.7243115,0,0,0,0,120,0,1),
+(@OGUID+38,193148,571,1,128,5238.27539,2920.67358,409.256439,-0.418878615,0,0,0,0,120,0,1),
+(@OGUID+39,193149,571,1,128,5235.902,2920.751,409.224457,-0.951203167,0,0,0,0,120,0,1),
+(@OGUID+40,193150,571,1,128,5237.36963,2919.89771,409.556641,0.8202983,0,0,0,0,120,0,1),
+(@OGUID+41,193151,571,1,128,5234.19775,2918.99731,409.322754,-2.33873963,0,0,0,0,120,0,1),
+(@OGUID+42,193152,571,1,128,5234.52344,2921.76221,409.175781,-2.2165668,0,0,0,0,120,0,1),
+(@OGUID+43,193153,571,1,128,5234.119,2918.93921,409.1339,-3.098036,0,0,0,0,120,0,1),
+(@OGUID+44,193154,571,1,128,5234.26758,2919.40015,409.502869,-2.18166113,0,0,0,0,120,0,1),
+(@OGUID+45,193155,571,1,128,5293.37939,2746.05566,409.22052,-0.06981169,0,0,0,0,120,0,1),
+(@OGUID+46,193156,571,1,128,5293.65039,2755.67529,409.1913,-0.43633157,0,0,0,0,120,0,1),
+(@OGUID+47,193157,571,1,128,5292.23535,2753.59473,409.0867,-0.357789934,0,0,0,0,120,0,1),
+(@OGUID+48,193158,571,1,128,5292.42969,2748.62427,409.131042,0.253072351,0,0,0,0,120,0,1),
+(@OGUID+49,193159,571,1,128,5293.384,2750.90283,409.234924,-0.0610866137,0,0,0,0,120,0,1),
+(@OGUID+50,193160,571,1,64,5371.89746,2805.47583,409.3072,0.0610866137,0,0,0,0,120,0,1),
+(@OGUID+51,193161,571,1,64,5376.616,2875.105,409.254822,1.59697616,0,0,0,0,120,0,1),
+(@OGUID+52,193162,571,1,128,5377.54932,2870.92456,409.239166,-0.549776852,0,0,0,0,120,0,1),
+(@OGUID+53,193163,571,1,128,5378.068,2813.61719,409.239166,1.55334139,0,0,0,0,120,0,1),
+(@OGUID+54,193164,571,1,128,5378.921,2805.43677,409.239166,1.53588688,0,0,0,0,120,0,1),
+(@OGUID+55,193165,571,1,128,5378.452,2876.67456,409.239166,1.54461825,0,0,0,0,120,0,1);
diff --git a/sql/old/3.3.5a/2012_08_20_04_world_wintergrasp_gossips.sql b/sql/old/3.3.5a/2012_08_20_04_world_wintergrasp_gossips.sql
new file mode 100644
index 00000000000..87b96b765a6
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_04_world_wintergrasp_gossips.sql
@@ -0,0 +1,20 @@
+-- Gossip Menu
+DELETE FROM `gossip_menu` WHERE `entry`=9904 AND `text_id`=13759;
+DELETE FROM `gossip_menu` WHERE `entry`=9904 AND `text_id`=13761;
+DELETE FROM `gossip_menu` WHERE `entry`=9923 AND `text_id`=14172;
+DELETE FROM `gossip_menu` WHERE `entry`=10229 AND `text_id`=14221;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(9904,13759),
+(9904,13761),
+(9923,14172),
+(10229,14221);
+
+-- Gossip Menu Option
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=9904;
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=10129 AND `id` IN (2,4);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(9904,0,0, 'I would like to build a catapult.',1,1,0,0,0,0, ''),
+(9904,1,0, 'I would like to build a demolisher.',1,1,0,0,0,0, ''),
+(9904,2,0, 'I would like to build a siege engine.',1,1,0,0,0,0, ''),
+(10129,2,0, 'Guide me to the Broken Temple Graveyard.',1,1,0,0,0,0, ''),
+(10129,4,0, 'Guide me to the Eastspark Graveyard.',1,1,0,0,0,0, '');
diff --git a/sql/old/3.3.5a/2012_08_20_05_world_wintergrasp_quests.sql b/sql/old/3.3.5a/2012_08_20_05_world_wintergrasp_quests.sql
new file mode 100644
index 00000000000..d456f5d5e71
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_05_world_wintergrasp_quests.sql
@@ -0,0 +1,16 @@
+-- Wintergrasp Quests - Horde
+UPDATE `quest_template` SET `ExclusiveGroup`=13180 WHERE `id` IN (13180,13178); -- Slay them all!
+UPDATE `quest_template` SET `ExclusiveGroup`=13185 WHERE `id` IN (13185,13223); -- Stop/Defend the Siege
+UPDATE `quest_template` SET `ExclusiveGroup`=13201 WHERE `id` IN (13201,13194); -- Healing with Roses
+UPDATE `quest_template` SET `ExclusiveGroup`=13199 WHERE `id` IN (13193,13199); -- Bones and Arrows
+UPDATE `quest_template` SET `ExclusiveGroup`=13192 WHERE `id` IN (13192,13202); -- Warding/Jinxing the Walls
+UPDATE `quest_template` SET `ExclusiveGroup`=13200 WHERE `id` IN (13200,13191); -- Fueling the Demolishers
+
+-- Wintergrasp Quests - Alliance
+UPDATE `quest_template` SET `ExclusiveGroup`=13179 WHERE `id` IN (13179,13177); -- No Mercy for the Merciless
+UPDATE `quest_template` SET `ExclusiveGroup`=13186 WHERE `id` IN (13186,13222); -- Stop/Defend the Siege
+UPDATE `quest_template` SET `ExclusiveGroup`=13195 WHERE `id` IN (13195,13156); -- A Rare Herb
+UPDATE `quest_template` SET `ExclusiveGroup`=13196 WHERE `id` IN (13196,13154); -- Bones and Arrows
+UPDATE `quest_template` SET `ExclusiveGroup`=13198 WHERE `id` IN (13198,13153); -- Warding the Warriors
+
+-- Note: The offered quests (they are in pairs) depend on who controls the keep. npc_wg_quest_giver does that already?
diff --git a/sql/old/3.3.5a/2012_08_20_06_world_wintergrasp_spells.sql b/sql/old/3.3.5a/2012_08_20_06_world_wintergrasp_spells.sql
new file mode 100644
index 00000000000..cb2bd219e40
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_06_world_wintergrasp_spells.sql
@@ -0,0 +1,81 @@
+-- 54640 Teleport (Teleports defenders behind the walls on the Isle of Ulduran, Strand of the Ancients) - FIX THIS?
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=54640;
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(54640,54643,0, 'WG teleporter');
+
+-- Spell area
+DELETE FROM `spell_area` WHERE `spell` IN (58730,57940);
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(58730,4581,0,0,0,0,0,2,1), -- Restricted Flight Area (Wintergrasp Eject)
+(58730,4539,0,0,0,0,0,2,1),
+(58730,4197,0,0,0,0,0,2,1),
+(58730,4585,0,0,0,0,0,2,1),
+(58730,4612,0,0,0,0,0,2,1),
+(58730,4582,0,0,0,0,0,2,1),
+(58730,4583,0,0,0,0,0,2,1),
+(58730,4589,0,0,0,0,0,2,1),
+(58730,4575,0,0,0,0,0,2,1),
+(58730,4538,0,0,0,0,0,2,1),
+(58730,4577,0,0,0,0,0,2,1),
+(57940,65,0,0,0,0,0,2,1), -- Essence of Wintergrasp
+(57940,66,0,0,0,0,0,2,1),
+(57940,67,0,0,0,0,0,2,1),
+(57940,206,0,0,0,0,0,2,1),
+(57940,210,0,0,0,0,0,2,1),
+(57940,394,0,0,0,0,0,2,1),
+(57940,395,0,0,0,0,0,2,1),
+(57940,1196,0,0,0,0,0,2,1),
+(57940,2817,0,0,0,0,0,2,1),
+(57940,3456,0,0,0,0,0,2,1),
+(57940,3477,0,0,0,0,0,2,1),
+(57940,3537,0,0,0,0,0,2,1),
+(57940,3711,0,0,0,0,0,2,1),
+(57940,4100,0,0,0,0,0,2,1),
+(57940,4196,0,0,0,0,0,2,1),
+(57940,4228,0,0,0,0,0,2,1),
+(57940,4264,0,0,0,0,0,2,1),
+(57940,4265,0,0,0,0,0,2,1),
+(57940,4272,0,0,0,0,0,2,1),
+(57940,4273,0,0,0,0,0,2,1),
+(57940,4395,0,0,0,0,0,2,1),
+(57940,4415,0,0,0,0,0,2,1),
+(57940,4416,0,0,0,0,0,2,1),
+(57940,4493,0,0,0,0,0,2,1),
+(57940,4494,0,0,0,0,0,2,1),
+(57940,4603,0,0,0,0,0,2,1);
+
+DELETE FROM `spell_area` WHERE `spell` IN (56618, 56617);
+INSERT INTO `spell_area` (`spell`,`area`,`autocast`) VALUES
+(56618, 4538, 1),
+(56617, 4538, 1),
+(56618, 4539, 1),
+(56617, 4539, 1),
+(56618, 4611, 1),
+(56617, 4611, 1),
+(56618, 4612, 1),
+(56617, 4612, 1);
+
+-- Spell scripts. replace with SAI
+DELETE FROM `spell_scripts` WHERE `id`=49899;
+INSERT INTO `spell_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
+(49899,0,1,406,0,0,0,0,0,0); -- Activate Robotic Arms
+
+-- Spell Target position for Wintergrasp Graveyard spells
+DELETE FROM `spell_target_position` WHERE `id` IN (59760,59762,59763,59765,59766,59767,59769);
+INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
+(59760,571,5537.986,2897.493,517.057,4.819249), -- Teleport: Fortress Graveyard
+(59762,571,5104.750,2300.940,368.579,0.733038), -- Teleport: Sunken Ring "area 4538"
+(59763,571,5099.120,3466.036,368.484,5.317802), -- Teleport: Broken Temple "area 4539 & 4589"
+(59765,571,5032.454,3711.382,372.468,3.971623), -- Teleport: Horde Landing Zone
+(59766,571,4331.716,3235.695,390.251,0.008500), -- Teleport: Westspark Factory Graveyard "area 4611"
+(59767,571,4314.648,2408.522,392.642,6.268125), -- Teleport: Eastspark Factory Graveyard "area 4612"
+(59769,571,5140.790,2179.120,390.950,1.972220); -- Teleport: Alliance Landing Zone
+
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (61409, 56662, 56664, 56659, 49899, 61178);
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(61409, 'spell_wintergrasp_force_building'),
+(56659, 'spell_wintergrasp_force_building'),
+(56662, 'spell_wintergrasp_force_building'),
+(56664, 'spell_wintergrasp_force_building'),
+(49899, 'spell_wintergrasp_force_building'),
+(61178, 'spell_wintergrasp_grab_passenger');
diff --git a/sql/old/3.3.5a/2012_08_20_07_world_wintergrasp_texts.sql b/sql/old/3.3.5a/2012_08_20_07_world_wintergrasp_texts.sql
new file mode 100644
index 00000000000..090c5350c74
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_07_world_wintergrasp_texts.sql
@@ -0,0 +1,108 @@
+-- Unused yet:
+-- Wintergrasp is under attack!
+-- Wintergrasp Fortress is under attack!
+-- Winter's Edge Tower is under attack!
+-- Eastern Bridge is under attack!
+-- Western Bridge is under attack!
+-- Westspark Bridge is under attack!
+-- Flamewatch Tower is under attack!
+
+-- 'You have reached Rank 1: Corporal' Sent to player by raid leader
+-- 'You have reached Rank 2: First Lieutenant' Sent to player by raid leader
+
+-- Wintergrasp coreside texts
+DELETE FROM `trinity_string` WHERE `entry` BETWEEN 12050 AND 12072;
+INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`)VALUES
+(12050, '%s has been captured by %s ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12051, '%s is under attack by %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12052, 'The Broken Temple siege workshop', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12053, 'Eastspark siege workshop', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12054, 'Westspark siege workshop', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12055, 'The Sunken Ring siege workshop', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12057, 'Alliance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12056, 'Horde', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12058, 'The battle for Wintergrasp is about to begin!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12059, 'You have reached Rank 1: Corporal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12060, 'You have reached Rank 2: First Lieutenant', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12061, 'The south-eastern keep tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12062, 'The north-eastern keep tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12063, 'The south-western keep tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12064, 'The north-western keep tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12065, '%s has been damaged !', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12066, '%s has been destroyed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12067, 'The battle for Wintergrasp begin!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12068, '%s has successfully defended the Wintergrasp fortress!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12069, 'The southern tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12070, 'The eastern tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12071, 'The western tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12072, 'The Wintergrasp fortress has been captured by %s !', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+-- Wintergrasp script texts
+DELETE FROM `script_texts` WHERE entry BETWEEN -1850507 AND -1850500;
+INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`,`sound`,`type`,`language`,`emote`,`comment`)VALUES
+(0, -1850500, 'Guide me to the Fortress Graveyard.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850501, 'Guide me to the Sunken Ring Graveyard.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850502, 'Guide me to the Broken Temple Graveyard.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850503, 'Guide me to the Westspark Graveyard.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850504, 'Guide me to the Eastspark Graveyard.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850505, 'Guide me back to the Horde landing camp.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850506, 'Guide me back to the Alliance landing camp.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''),
+(0, -1850507, 'Se mettre dans la file pour le Joug-d''hiver.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''); -- (Needs proper english text, maybe "Get in the queue for Wintergrasp."?)
+
+-- New support-commands for battlefield class
+DELETE FROM `command` WHERE name IN ('bf start', 'bf stop', 'bf enable', 'bf switch', 'bf timer');
+INSERT INTO `command` (`name`,`security`,`help`) VALUES
+('bf start',3,'Syntax: .bf start #battleid'),
+('bf stop',3,'Syntax: .bf stop #battleid'),
+('bf enable',3,'Syntax: .bf enable #battleid'),
+('bf switch',3,'Syntax: .bf switch #battleid'),
+('bf timer',3,'Syntax: .bf timer #battleid #timer');
+
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=15214 AND `groupid` BETWEEN 0 AND 30;
+DELETE FROM `creature_text` WHERE `entry` IN (31036,31091) AND `groupid` BETWEEN 0 AND 3;
+DELETE FROM `creature_text` WHERE `entry` IN (31108,31109,34924) AND `groupid`=0;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(15214,0,0, 'Let the battle begin!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,1,0, 'The southern tower has been damaged!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,2,0, 'The southern tower has been destroyed!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,3,0, 'The eastern tower has been damaged!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,4,0, 'The eastern tower has been destroyed!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,5,0, 'The western tower has been damaged!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,6,0, 'The western tower has been destroyed!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,7,0, 'The north-western keep tower has been damaged!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,8,0, 'The north-western keep tower has been destroyed!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,9,0, 'The south-eastern keep tower has been damaged!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,10,0, 'The south-eastern keep tower has been destroyed!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,11,0, 'The Broken Temple siege workshop has been attacked by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,12,0, 'The Broken Temple siege workshop has been captured by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,13,0, 'The Broken Temple siege workshop has been attacked by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,14,0, 'The Broken Temple siege workshop has been captured by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,15,0, 'The Eastspark siege workshop has been attacked by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,16,0, 'The Eastspark siege workshop has been captured by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,17,0, 'The Eastspark siege workshop has been attacked by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,18,0, 'The Eastspark siege workshop has been captured by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,19,0, 'The Sunken Ring siege workshop has been attacked by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,20,0, 'The Sunken Ring siege workshop has been captured by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,21,0, 'The Sunken Ring siege workshop has been attacked by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,22,0, 'The Sunken Ring siege workshop has been captured by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,23,0, 'The Westspark siege workshop has been attacked by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,24,0, 'The Westspark siege workshop has been captured by the Alliance!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,25,0, 'The Westspark siege workshop has been attacked by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,26,0, 'The Westspark siege workshop has been captured by the Horde!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,27,0, 'The Alliance has defended Wintergrasp Fortress!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,28,0, 'The Alliance has captured Wintergrasp Fortress!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,29,0, 'The Horde has defended Wintergrasp Fortress!',3,0,100,0,0,0, 'Invisible Stalker'),
+(15214,30,0, 'The Horde has captured Wintergrasp Fortress!',3,0,100,0,0,0, 'Invisible Stalker'),
+-- Not sure if all Alliance text is here, need horde text
+(31036,0,0, 'The first of the Horde towers has fallen! Destroy all three and we will hasten their retreat!',1,7,100,0,0,0, 'Commander Zanneth'),
+(31036,1,0, 'The second tower has fallen! Destroy the final tower and we will hasten their retreat!',1,7,100,0,0,0, 'Commander Zanneth'),
+(31036,2,0, 'The Horde towers have fallen! We have forced their hand. Finish off the remaining forces!',1,7,100,0,0,0, 'Commander Zanneth'),
+(31036,3,0, 'Show those animals no mercy, $n!',0,7,100,0,0,0, 'Commander Zanneth'),
+(31091,0,0, 'The first of the Alliance towers has fallen! Destroy all three and we will hasten their retreat!',1,7,100,0,0,0, 'Commander Dardosh'),
+(31091,1,0, 'Lok''tar! The second tower falls! Destroy the final tower and we will hasten their retreat!',1,7,100,0,0,0, 'Commander Dardosh'),
+(31091,2,0, 'The Alliance towers have fallen! We have forced their hand. Finish off the remaining forces!',1,7,100,0,0,0, 'Commander Dardosh'),
+(31091,3,0, 'Show those animals no mercy, $n!',0,7,100,0,0,0, 'Commander Dardosh'), -- ???
+(31108,0,0, 'Stop the Horde from retrieving the embers, $n. We cannot risk them having the advantage when the battle resumes!',0,7,100,0,0,0, 'Siege Master Stouthandle'),
+(31109,0,0, 'Destroy their foul machines of war, $n!',0,7,100,0,0,0, 'Senior Demolitionist Legoso'),
+(34924,0,0, 'The gates have been breached! Defend the keep!',1,0,100,0,0,0, 'High Commander Halford Wyrmbane');
diff --git a/sql/old/3.3.5a/2012_08_20_08_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_08_20_08_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..fa995e7804f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_08_world_achievement_criteria_data.sql
@@ -0,0 +1,4 @@
+DELETE FROM `achievement_criteria_data` WHERE criteria_id = 7703;
+INSERT INTO `achievement_criteria_data` VALUES
+(7703, 6, 4197, 0, ''),
+(7703, 11, 0, 0, 'achievement_wg_didnt_stand_a_chance');
diff --git a/sql/old/3.3.5a/2012_08_20_09_world_disables.sql b/sql/old/3.3.5a/2012_08_20_09_world_disables.sql
new file mode 100644
index 00000000000..fa5010b669f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_20_09_world_disables.sql
@@ -0,0 +1 @@
+DELETE FROM `disables` WHERE `entry` = 7703 AND `sourceType` = 4;
diff --git a/sql/old/3.3.5a/2012_08_21_00_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_08_21_00_world_spell_proc_event.sql
new file mode 100644
index 00000000000..e1a8b59acae
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_21_00_world_spell_proc_event.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_proc_event` WHERE `entry`=64752;
+INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES
+(64752,0,7,8392704,256,2097152,0,0,0,0,0);
diff --git a/sql/old/3.3.5a/2012_08_21_01_world_command.sql b/sql/old/3.3.5a/2012_08_21_01_world_command.sql
new file mode 100644
index 00000000000..df833d2d246
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_21_01_world_command.sql
@@ -0,0 +1,3 @@
+DELETE FROM `command` WHERE name='quest reward';
+INSERT INTO `command` (`name`,`security`,`help`) VALUES
+('quest reward',3,'Syntax: .quest reward #questId\n\n\Grants quest reward to selected player and removes quest from his log (quest must be in completed state).');
diff --git a/sql/old/3.3.5a/2012_08_21_02_world_wintergrasp_conditions.sql b/sql/old/3.3.5a/2012_08_21_02_world_wintergrasp_conditions.sql
new file mode 100644
index 00000000000..caf8a0cc1e4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_21_02_world_wintergrasp_conditions.sql
@@ -0,0 +1,23 @@
+-- Conditions
+-- Add gossip_menu condition for 9904 Horde
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (9904,9923);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`NegativeCondition`) VALUES
+(14,9904,13759,0,1,33280,0), -- Must have Rank 1: Corporal
+(14,9904,13759,1,1,55629,0), -- Or must have Rank 2: First Lieutenant
+(14,9904,13761,0,1,33280,1), -- Must not have Rank 1: Corporal
+(14,9904,13761,0,1,55629,1), -- Must not have Rank 2: First Lieutenant
+-- Add gossip_menu condition for 9923 Alliance
+(14,9923,13798,0,1,33280,0), -- Must have Rank 1: Corporal
+(14,9923,13798,1,1,55629,0), -- Or must have Rank 2: First Lieutenant
+(14,9923,14172,0,1,33280,1), -- Must not have Rank 1: Corporal
+(14,9923,14172,0,1,55629,1), -- Must not have Rank 2: First Lieutenant
+-- Add conditions to gossip options horde
+(15,9904,0,0,1,33280,0), -- Must have reached Rank 1: Corporal
+(15,9904,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant
+(15,9904,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant
+(15,9904,2,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant
+-- Add conditions to gossip options alliance
+(15,9923,0,0,1,33280,0), -- Must have reached Rank 1: Corporal
+(15,9923,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant
+(15,9923,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant
+(15,9923,2,0,1,55629,0); -- Must have reached Rank 2: First Lieutenant
diff --git a/sql/old/3.3.5a/2012_08_23_00_world_wintergrasp_spell_script_names.sql b/sql/old/3.3.5a/2012_08_23_00_world_wintergrasp_spell_script_names.sql
new file mode 100644
index 00000000000..a3dbf81d425
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_23_00_world_wintergrasp_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` = 54640;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(54640, 'spell_wintergrasp_defender_teleport');
diff --git a/sql/old/3.3.5a/2012_08_23_01_world_wintergrasp_gameobject.sql b/sql/old/3.3.5a/2012_08_23_01_world_wintergrasp_gameobject.sql
new file mode 100644
index 00000000000..27f7b4027f1
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_23_01_world_wintergrasp_gameobject.sql
@@ -0,0 +1 @@
+DELETE FROM `gameobject` WHERE `guid` IN (67259,67135,60476,66674,66675,67127,67128,66728,66731,67125,66730,66732,67126,67256,67132,67133,66733,67134,67251,67255,67129,67130,67131,67253,67258,67259,67260,75975,75976,76021,76022,66729,66718,66719,66720,66721,66722,66723,66724,66725,66726);
diff --git a/sql/old/3.3.5a/2012_08_25_00_world_creature_template.sql b/sql/old/3.3.5a/2012_08_25_00_world_creature_template.sql
new file mode 100644
index 00000000000..f7ec4c87fb9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_25_00_world_creature_template.sql
@@ -0,0 +1,3 @@
+-- Wintergrasp Siege Turret
+UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1732 WHERE `entry`=28319; -- Alliance
+UPDATE `creature_template` SET `faction_A`=1735,`faction_H`=1735 WHERE `entry`=32629; -- Horde
diff --git a/sql/old/3.3.5a/2012_08_25_01_world_creature_template.sql b/sql/old/3.3.5a/2012_08_25_01_world_creature_template.sql
new file mode 100644
index 00000000000..ef8e5bdd8fc
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_25_01_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `faction_A`=103,`faction_H`=103 WHERE `entry` IN (30890,31540); -- Twilight Whelp
diff --git a/sql/old/3.3.5a/2012_08_26_00_world_conditions.sql b/sql/old/3.3.5a/2012_08_26_00_world_conditions.sql
new file mode 100644
index 00000000000..c33d9bfc878
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_26_00_world_conditions.sql
@@ -0,0 +1,5 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=61632;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,7,61632,0,0,31,0,3,30449,0,0,0,'','Sartharion Berserk - Only hit Tenebron, Shadron & Vesperon'),
+(13,7,61632,0,1,31,0,3,30451,0,0,0,'','Sartharion Berserk - Only hit Tenebron, Shadron & Vesperon'),
+(13,7,61632,0,2,31,0,3,30452,0,0,0,'','Sartharion Berserk - Only hit Tenebron, Shadron & Vesperon');
diff --git a/sql/old/3.3.5a/2012_08_26_01_world_creature.sql b/sql/old/3.3.5a/2012_08_26_01_world_creature.sql
new file mode 100644
index 00000000000..af14886850d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_26_01_world_creature.sql
@@ -0,0 +1 @@
+UPDATE `creature` SET `phaseMask`=256 WHERE `id`=34300;
diff --git a/sql/old/3.3.5a/2012_08_26_02_world_spell_area.sql b/sql/old/3.3.5a/2012_08_26_02_world_spell_area.sql
new file mode 100644
index 00000000000..c4eae68e3c4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_26_02_world_spell_area.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_area` WHERE spell=58045;
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(58045,4197,0,0,0,0,0,2,1);
diff --git a/sql/old/3.3.5a/2012_08_26_03_world_spell_area.sql b/sql/old/3.3.5a/2012_08_26_03_world_spell_area.sql
new file mode 100644
index 00000000000..65072d2b4a7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_26_03_world_spell_area.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_area` WHERE spell=74411 AND `area`=4197;
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(74411,4197,0,0,0,0,0,2,1);
diff --git a/sql/old/3.3.5a/2012_08_27_00_world_creature_template.sql b/sql/old/3.3.5a/2012_08_27_00_world_creature_template.sql
new file mode 100644
index 00000000000..804d7b5c61d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_00_world_creature_template.sql
@@ -0,0 +1,2 @@
+-- NPC script linking for Wyrmrest Defender ID: 27629
+UPDATE `creature_template` SET `ScriptName`='npc_wyrmrest_defender' WHERE `entry`=27629;
diff --git a/sql/old/3.3.5a/2012_08_27_00_world_spell_script_name.sql b/sql/old/3.3.5a/2012_08_27_00_world_spell_script_name.sql
new file mode 100644
index 00000000000..1d036df0a65
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_00_world_spell_script_name.sql
@@ -0,0 +1,4 @@
+-- Spell script name linking for Defending Wyrmrest Temple: Character Script Cast From Gossip ID: 49123
+DELETE FROM `spell_script_names` WHERE `spell_id`=49213;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(49213,'spell_q12372_cast_from_gossip_trigger');
diff --git a/sql/old/3.3.5a/2012_08_27_01_world_sai.sql b/sql/old/3.3.5a/2012_08_27_01_world_sai.sql
new file mode 100644
index 00000000000..302c3ac1942
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_01_world_sai.sql
@@ -0,0 +1,13 @@
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17398;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=17398;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-85712,-85717,-85719,-85724);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(-85724, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 9, 29607, 0, 0, 0, 0, 0, 14, 22299, 0, 0, 0, 0, 0, 0, 'Blood Furnace - First Cell'),
+(-85719, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 9, 29607, 0, 0, 0, 0, 0, 14, 22297, 0, 0, 0, 0, 0, 0, 'Blood Furnace - Second Cell'),
+(-85717, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 9, 29607, 0, 0, 0, 0, 0, 14, 22298, 0, 0, 0, 0, 0, 0, 'Blood Furnace - Third Cell'),
+(-85712, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 9, 29607, 0, 0, 0, 0, 0, 14, 22296, 0, 0, 0, 0, 0, 0, 'Blood Furnace - Fourth Cell');
+
+DELETE FROM `gameobject_scripts` WHERE `id`=150441;
+INSERT INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
+(150441, 3, 11, 22295, 0, 0, 0, 0, 0, 0);
diff --git a/sql/old/3.3.5a/2012_08_27_02_world_creature.sql b/sql/old/3.3.5a/2012_08_27_02_world_creature.sql
new file mode 100644
index 00000000000..3595ea7b576
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_02_world_creature.sql
@@ -0,0 +1,4 @@
+SET @GUID = 42638; -- Set by TDB team (need X)
+DELETE FROM `creature` WHERE `guid`=@GUID AND `id`=7172;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(@GUID,7172,70,1,1,0,0,150.466,306.014,-49.543,5.2359,300,0,0,1,0,0,0,0,0);
diff --git a/sql/old/3.3.5a/2012_08_27_02_world_playercreateinfo_spell.sql b/sql/old/3.3.5a/2012_08_27_02_world_playercreateinfo_spell.sql
new file mode 100644
index 00000000000..9c664142bba
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_02_world_playercreateinfo_spell.sql
@@ -0,0 +1,9 @@
+DELETE FROM `playercreateinfo_spell` WHERE `Spell` IN (59221,59535,59536,59538,59539,59540,59541);
+INSERT INTO `playercreateinfo_spell` (`race`, `class`, `Spell`, `Note`) VALUES
+(11,1,59221,'Shadow Resistance'),
+(11,2,59535,'Shadow Resistance'),
+(11,3,59536,'Shadow Resistance'),
+(11,5,59538,'Shadow Resistance'),
+(11,6,59539,'Shadow Resistance'),
+(11,7,59540,'Shadow Resistance'),
+(11,8,59541,'Shadow Resistance');
diff --git a/sql/old/3.3.5a/2012_08_27_03_world_gameobject.sql b/sql/old/3.3.5a/2012_08_27_03_world_gameobject.sql
new file mode 100644
index 00000000000..1bf836c96e0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_03_world_gameobject.sql
@@ -0,0 +1,6 @@
+-- Spawn Blackened Urn (194092) GO based on sniff by Aokromes
+SET @GUID := 334; -- Set by TDB team
+
+DELETE FROM `gameobject` WHERE `id`=194092;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@GUID,194092,532,1,1,-11126.87,-1874.455,91.47264,6.056293,0,0,-0.113203,0.9935719,180,100,1);
diff --git a/sql/old/3.3.5a/2012_08_27_04_world_quest_template.sql b/sql/old/3.3.5a/2012_08_27_04_world_quest_template.sql
new file mode 100644
index 00000000000..9169a6e5862
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_04_world_quest_template.sql
@@ -0,0 +1 @@
+UPDATE `quest_template` SET `NextQuestId`=12257 WHERE `ID`=12468;
diff --git a/sql/old/3.3.5a/2012_08_27_05_world_sai.sql b/sql/old/3.3.5a/2012_08_27_05_world_sai.sql
new file mode 100644
index 00000000000..3da0143e6e6
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_05_world_sai.sql
@@ -0,0 +1,56 @@
+-- A Race Against Time (11671)
+
+SET @NPC_SALRAND := 25584; -- Inquisitor Salrand
+SET @NPC_BERYL_INVISMAN := 25594; -- Beryl Point InvisMan
+SET @GOB_BERYL_SHIELD := 187773; -- Beryl Shield
+SET @GOB_BERYL_SHIELD_FOCUS := 300176; -- TEMP Beryl Force Shield
+SET @SPELL_BEAM := 45777; -- Salrand's Beam
+SET @SPELL_THROW_DETONATOR := 45780; -- Throw Beryl Shield Detonator
+SET @SPELL_SUMMON_DETONATOR := 45791; -- Summon Beryl Detonator
+SET @SPELL_EXPLOSION := 45796; -- Beryl Shield Explosion
+SET @SPELL_LOCKBOX := 45809; -- Summon Salrand's Lockbox
+SET @GUID := 60441; -- used for a wrong go spawn,will reuse
+
+UPDATE `gameobject_template` SET `data1`=80 WHERE `entry`=300176; -- spell focus radius
+UPDATE `gameobject_template` SET `flags`=32 WHERE `entry`=187773; -- shield:nodespawn flag
+
+-- missing spell focus
+DELETE FROM `gameobject` WHERE `guid`=@GUID;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@GUID,@GOB_BERYL_SHIELD_FOCUS,571,1,1,3392.85,6161.089,79.8313,0,0,0,0,0,300,0,1);
+
+UPDATE `creature_template` SET `InhabitType`=0x4,`unit_flags`=0x100,`AIName`='SmartAI' WHERE `entry`=@NPC_SALRAND;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC_BERYL_INVISMAN;
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_SALRAND;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_SALRAND,0,0x0,0x1,'45775');
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@NPC_SALRAND;
+DELETE FROM `smart_scripts` WHERE (`source_type`=0 AND `entryorguid` IN (@NPC_SALRAND,@NPC_BERYL_INVISMAN)) OR (`source_type`=9 AND `entryorguid` IN (@NPC_SALRAND*100,@NPC_BERYL_INVISMAN*100));
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC_SALRAND,0,0,0,38,0,100,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'On data 1 1 - Say'),
+(@NPC_SALRAND,0,1,2,38,0,100,1,1,2,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'On data 1 2 - Say'),
+(@NPC_SALRAND,0,2,0,61,0,100,1,0,0,0,0,80,@NPC_SALRAND*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'On link - Run script'),
+(@NPC_SALRAND,0,3,4,6,0,100,1,0,0,0,0,11,@SPELL_LOCKBOX,0,0,0,0,0,1,0,0,0,0,0,0,0,'On death - Cast spell'),
+(@NPC_SALRAND,0,4,0,61,0,100,1,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'On death - Say'),
+(@NPC_SALRAND,0,5,0,11,0,100,1,0,0,0,0,24,0,0,0,0,0,0,15,0,0,0,0,0,0,0,'On respawn - Evade'),
+(@NPC_SALRAND*100,9,0,0,0,0,100,0,0,0,0,0,60,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'On script - set fly off'),
+(@NPC_SALRAND*100,9,1,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,3392.852,6161.092,79.83095,0,'On script - Move to pos'),
+(@NPC_SALRAND*100,9,2,0,0,0,100,0,3000,3000,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'On script - Set unit flags'),
+--
+(@NPC_BERYL_INVISMAN,0,0,0,8,0,100,0,@SPELL_THROW_DETONATOR,0,0,0,80,@NPC_BERYL_INVISMAN*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'On spellhit - Run Script'),
+(@NPC_BERYL_INVISMAN*100,9,0,0,0,0,100,0,0,0,0,0,11,@SPELL_SUMMON_DETONATOR,0,0,0,0,0,1,0,0,0,0,0,0,0,'On script - Cast Spell'),
+(@NPC_BERYL_INVISMAN*100,9,1,0,0,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,@NPC_SALRAND,100,0,0,0,0,0,'On script - Set Data'),
+(@NPC_BERYL_INVISMAN*100,9,2,0,0,0,100,0,8000,8000,0,0,45,1,2,0,0,0,0,19,@NPC_SALRAND,100,0,0,0,0,0,'On script - Set Data'),
+(@NPC_BERYL_INVISMAN*100,9,3,0,0,0,100,0,2000,2000,0,0,11,@SPELL_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0,'On script - Cast Spell');
+
+DELETE FROM `creature_text` WHERE `entry`=@NPC_SALRAND;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_SALRAND,0,0,'What is the meaning of this disturbance?!',14,0,100,0,0,0,'Inquisitor Salrand to Beryl Point InvisMan'),
+(@NPC_SALRAND,1,0,'Who dares interrupt my work!? Show yourself, coward!',14,0,100,0,0,0,'Inquisitor Salrand to Beryl Point InvisMan'),
+(@NPC_SALRAND,2,0,'I''ve destroyed the key! Your cherished archmage belongs to Malygos!',12,0,100,0,0,0,'Inquisitor Salrand');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_THROW_DETONATOR;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,@SPELL_THROW_DETONATOR,0,0,31,0,3,@NPC_BERYL_INVISMAN,0,0,0,'','Throw Beryl Shield Detonator target npc');
diff --git a/sql/old/3.3.5a/2012_08_27_06_world_sai.sql b/sql/old/3.3.5a/2012_08_27_06_world_sai.sql
new file mode 100644
index 00000000000..8b1aafd1558
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_06_world_sai.sql
@@ -0,0 +1,43 @@
+-- Fix {Q/A} The Shining Light ID: 11288
+-- Makes it blizzlike timed 10 minutes
+UPDATE `quest_template` SET `LimitTime`=600 WHERE `id`=11288;
+-- Decomposing Ghoul SAI
+SET @Ghoul := 24177;
+SET @SpellTrigger := 43202;
+SET @Spell := 43203;
+SET @Ares := 24189;
+UPDATE `creature_template` SET `AIname`='SmartAI' WHERE `entry`=@Ghoul;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Ghoul;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Ghoul,0,0,0,1,0,100,0,20000,300000,50000,350000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Decomposing Ghoul - Occ - Say random text'),
+(@Ghoul,0,1,2,8,0,100,0,@Spell,0,0,0,18,33685506,0,0,0,0,0,1,0,0,0,0,0,0,0,'Decomposing Ghoul - On hit by spell - Set unit flag for not targetable'),
+(@Ghoul,0,2,3,61,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,'Decomposing Ghoul - Linked with previous event - Switch faction to clear aggro'),
+(@Ghoul,0,3,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Decomposing Ghoul - Linked with previous event - Say random text'),
+(@Ghoul,0,4,5,1,0,100,0,3500,3500,3500,3500,19,33685506,0,0,0,0,0,1,0,0,0,0,0,0,0,'Decomposing Ghoul - OOC for 3,5 sec - Remove unit flag'),
+(@Ghoul,0,5,0,61,0,100,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Decomposing Ghoul - Linked with previous event - Change faction back to 14');
+-- Add SAI for Ares - quest giver
+UPDATE `creature_template` SET `AIname`='SmartAI' WHERE `entry`=@Ares;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Ares;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Ares,0,0,0,19,0,100,0,11288,0,0,0,85,@SpellTrigger,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ares - On target quest accepted 11288 - Cast spell Shining Light');
+-- Decomposing Ghoul texts
+DELETE FROM `creature_text` WHERE `entry`=@Ghoul;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@Ghoul,0,1,'Light... light so bright...',12,0,50,0,0,0,'Decomposing Ghoul - On spell hit'),
+(@Ghoul,0,2,'ARGHHHH...',12,0,50,0,0,0,'Decomposing Ghoul - On spell hit'),
+(@Ghoul,0,3,'Away... go...',12,0,50,0,0,0,'Decomposing Ghoul - On spell hit'),
+(@Ghoul,0,4,'Bad light... hurt...',12,0,50,0,0,0,'Decomposing Ghoul - On spell hit'),
+(@Ghoul,0,5,'BURNS! IT BURNS!',12,0,50,0,0,0,'Decomposing Ghoul - On spell hit'),
+(@Ghoul,1,1,'So... Hungry...',12,0,50,0,0,0,'Decomposing Ghoul - OOC'),
+(@Ghoul,1,2,'Closer... come closer...',12,0,50,0,0,0,'Decomposing Ghoul - OOC'),
+(@Ghoul,1,3,'FEED ME...',12,0,50,0,0,0,'Decomposing Ghoul - OOC'),
+(@Ghoul,1,4,'FOOD! EAT YOU!',12,0,50,0,0,0,'Decomposing Ghoul - OOC'),
+(@Ghoul,1,5,'BRAINNNS!',12,0,50,0,0,0,'Decomposing Ghoul - OOC');
+-- Add conditions for spell Shining Light to hit only Ghouls
+DELETE FROM `conditions` WHERE `SourceEntry`=@Spell AND `SourceTypeOrReferenceId`=13;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,@Spell,0,0,31,0,3,@Ghoul,0,0,0,'', 'Shinning Light can only hit Decomposing Ghouls');
+-- Add conditions for spell Shining Light to be available only, if on quest
+DELETE FROM `conditions` WHERE `SourceEntry`=@Spell AND `SourceTypeOrReferenceId`=17;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17,0,@Spell,0,0,9,0,11288,0,0,0,0,'', 'Shinning Light can only hit targets on the quest');
diff --git a/sql/old/3.3.5a/2012_08_27_07_world_spell_area.sql b/sql/old/3.3.5a/2012_08_27_07_world_spell_area.sql
new file mode 100644
index 00000000000..18be6ff0dbe
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_07_world_spell_area.sql
@@ -0,0 +1,4 @@
+-- Fix quest - The Angry Gorloc ID: 12578
+DELETE FROM `spell_area` WHERE `spell`=54057;
+INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_start_active`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`) VALUES
+(54057, 4297, 12578, 1, 12578, 0, 0, 2, 1);
diff --git a/sql/old/3.3.5a/2012_08_27_08_world_misc.sql b/sql/old/3.3.5a/2012_08_27_08_world_misc.sql
new file mode 100644
index 00000000000..62a57cd42de
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_08_world_misc.sql
@@ -0,0 +1,29 @@
+-- Fire Upon the Waters (12243) quest fix
+-- add Fire Upon the Waters Kill Credit Bunny at sail locations
+SET @GUID =42887;
+DELETE FROM `creature` WHERE `id`=28013;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
+(@GUID+0,28013,571,1,1,0,0,2488.86,-400.017,19.0803,2.99498,300,0,0,42,0,0,0,33554432,0),
+(@GUID+1,28013,571,1,1,0,0,2458.96,-401.066,20.7778,0.108631,300,0,0,42,0,0,0,33554432,0);
+
+-- SAI
+UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28013;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=28013 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(28013,0,0,0,8,0,100,0,48455,0,0,0,33,28013,0,0,0,0,0,7,0,0,0,0,0,0,0,"Fire Upon the Waters Kill Credit Bunny - On SpellHit Apothecary's Burning Water - Call KilledMonster Fire Upon the Waters Kill Credit Bunny");
+
+-- Ensure spell only works on Fire Upon the Waters Kill Credit Bunny
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=48455;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,48455,0,0,31,0,3,28013,0,0,0,'',"Fire Upon the Waters - spell to Fire Upon the Waters Kill Credit Bunny");
+
+-- add quest item loot to Captain Shely
+DELETE FROM `creature_loot_template` WHERE `entry`=27232;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(27232,37305,-100,1,0,1,1), -- Captain Shely's Rutters
+(27232,43851,25,1,0,1,1), -- Fur Clothing Scraps
+(27232,33470,10,1,0,1,3), -- Frostweave Cloth
+(27232,33443,5,1,0,1,1), -- Sour Goat Cheese
+(27232,33444,2,1,0,1,1), -- Pungent Seal Whey
+(27232,22829,1,1,0,1,1), -- Super Healing Potion
+(27232,45912,0.05,1,0,1,1); -- Book Glyph of Mastery
diff --git a/sql/old/3.3.5a/2012_08_27_09_world_conditions.sql b/sql/old/3.3.5a/2012_08_27_09_world_conditions.sql
new file mode 100644
index 00000000000..6d536859060
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_09_world_conditions.sql
@@ -0,0 +1,8 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62973,62991);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,3,62973,0,0, 1,0,62972,0,0,0,0,'','Foam Sword Attack'),
+(13,3,62973,0,0,31,0,4,0,0,0,0,'','Foam Sword Attack'),
+(13,3,62973,0,0,33,0,1,0,0,1,0,'','Foam Sword Attack'),
+(13,3,62991,0,0, 1,0,62972,0,0,0,0,'','Bonked!'),
+(13,3,62991,0,0,31,0,4,0,0,0,0,'','Bonked!'),
+(13,3,62991,0,0,33,0,1,0,0,1,0,'','Bonked!');
diff --git a/sql/old/3.3.5a/2012_08_27_10_world_spell_script_names.sql b/sql/old/3.3.5a/2012_08_27_10_world_spell_script_names.sql
new file mode 100644
index 00000000000..9ffb153f498
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_27_10_world_spell_script_names.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`IN (64142,62991);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(64142,'spell_gen_upper_deck_create_foam_sword'),
+(62991,'spell_gen_bonked');
diff --git a/sql/old/3.3.5a/2012_08_28_00_world_spell_script_name.sql b/sql/old/3.3.5a/2012_08_28_00_world_spell_script_name.sql
new file mode 100644
index 00000000000..01cfeb35f1f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_28_00_world_spell_script_name.sql
@@ -0,0 +1,4 @@
+-- Spell script name linking for Defending Wyrmrest Temple: Destabilize Azure Dragonshrine Effect
+DELETE FROM `spell_script_names` WHERE `spell_id`=49370 ;
+INSERT INTO `spell_script_names` VALUES
+(49370,'spell_q12372_destabilize_azure_dragonshrine_dummy');
diff --git a/sql/old/3.3.5a/2012_08_28_01_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_08_28_01_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..bf247399553
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_28_01_world_achievement_criteria_data.sql
@@ -0,0 +1,6 @@
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (11478,11479,12827,12828);
+INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
+(11478, 12, 0, 0, ''), -- Koralon the Flame Watcher (10 player)
+(11479, 12, 1, 0, ''), -- Koralon the Flame Watcher (25 player)
+(12827, 12, 0, 0, ''), -- Toravon the Ice Watcher (10 player)
+(12828, 12, 1, 0, ''); -- Toravon the Ice Watcher (25 player)
diff --git a/sql/old/3.3.5a/2012_08_29_00_world_blood_furnace.sql b/sql/old/3.3.5a/2012_08_29_00_world_blood_furnace.sql
new file mode 100644
index 00000000000..85b493da202
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_29_00_world_blood_furnace.sql
@@ -0,0 +1,290 @@
+SET @GUID := 138106; -- 149
+
+-- Delete old data before inserting new data. This could make trouble later on.
+DELETE `creature_addon` FROM `creature_addon` INNER JOIN `creature` ON `creature`.`guid`=`creature_addon`.`guid` WHERE `map`=542;
+DELETE `creature_formations` FROM `creature_formations` INNER JOIN `creature` ON `creature`.`guid`=`creature_formations`.`memberGUID` OR `creature`.`guid`=`creature_formations`.`leaderGUID` WHERE `map`=542;
+DELETE `linked_respawn` FROM `linked_respawn` INNER JOIN `creature` ON `creature`.`guid`=`linked_respawn`.`linkedGuid` WHERE `map`=542;
+
+
+-- CREATURE_TEMPLATE
+-- Trash
+UPDATE `creature_template` SET `speed_walk`=1.1 WHERE `entry`=17624;
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=17398;
+-- Broggok
+UPDATE `creature_template` SET `unit_flags`=`unit_flags`|256|512|2 WHERE `entry` IN(17380,18601);
+
+-- CREATURE
+DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+148 OR `map`=542;
+INSERT INTO `creature`(`guid`,`id`,`map`,`spawnMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@GUID+88,17414,542,3,317.15,189.009,10.0509,1.88412,7200,10472,5875,0),
+(@GUID+92,17414,542,3,436.311,198.522,11.4389,1.34468,7200,10472,5875,0),
+(@GUID+91,17414,542,3,345.706,198.519,11.139,1.6879,7200,10472,5875,0),
+(@GUID+96,17398,542,3,379.741,192.233,9.59787,3.36158,7200,7210,0,0),
+(@GUID+103,17414,542,3,448.428,190.764,9.6054,1.01795,7200,10472,5875,0),
+(@GUID+97,17395,542,3,373.636,184.777,9.59848,1.15697,7200,10472,17625,0),
+(@GUID+95,17371,542,3,371.98,194.243,9.59956,5.36434,7200,10472,5875,0),
+(@GUID+94,17491,542,3,480.502,180.017,9.61526,3.42991,7200,7479,0,0),
+(@GUID+26,17398,542,3,412.728,85.7323,9.65141,0.141552,7200,6963,0,0),
+(@GUID+125,17477,542,3,485.76,8.63405,9.54898,1.43024,7200,4126,9944,0),
+(@GUID+68,17371,542,3,327.262,30.5611,9.61686,4.68833,7200,10472,5875,2),
+(@GUID+124,17477,542,3,490.168,11.6964,9.54898,1.13336,7200,4126,9944,0),
+(@GUID+123,17477,542,3,489.518,5.51373,9.54353,1.96038,7200,4126,9944,0),
+(@GUID+122,17371,542,3,494.46,7.58925,9.54249,2.87616,7200,10472,5875,0),
+(@GUID+112,17414,542,3,479.898,98.2961,9.62183,6.09707,7200,10472,5875,0),
+(@GUID+120,17491,542,3,433.6,-18.2301,9.55216,0.450845,7200,7479,0,0),
+(@GUID+126,17477,542,3,484.202,13.9732,9.5505,6.25258,7200,4126,9944,0),
+(@GUID+128,17371,542,3,465.905,-19.9126,9.55319,5.19624,7200,10472,5875,2),
+(@GUID+129,17371,542,3,476.506,-63.3028,9.54636,0,7200,10472,5875,2),
+(@GUID+131,17491,542,3,495.566,-43.8895,9.5591,2.9343,7200,7479,0,0),
+(@GUID+46,17477,542,3,-10.8822,-85.2033,-41.3341,2.09342,7200,4126,9944,0),
+(@GUID+55,17397,542,3,224.587,-96.0037,9.61879,0.647748,7200,11965,2486,0),
+(@GUID+54,17397,542,3,231.512,-91.5716,9.62435,3.65189,7200,11965,2486,0),
+(@GUID+56,17477,542,3,227.94,-93.8952,9.61879,0.561355,7200,4126,9944,0),
+(@GUID+53,17491,542,3,234.022,-106.406,9.61037,1.88867,7200,7479,0,0),
+(@GUID+52,17477,542,3,28.2572,-85.4531,-41.0542,4.63284,7200,4126,9944,0),
+(@GUID+59,17477,542,3,241.827,-68.3783,9.61987,1.82585,7200,4126,9944,0),
+(@GUID+58,17397,542,3,242.883,-72.4289,9.61514,1.81799,7200,11965,2486,0),
+(@GUID+57,17397,542,3,240.674,-64.4904,9.62484,5.05383,7200,11965,2486,0),
+(@GUID+14,21174,542,3,320.912,-83.0625,-133.307,3.00197,7200,8338000,0,0),
+(@GUID+136,17477,542,3,412.944,-83.971,9.61695,5.1156,7200,4126,9944,0),
+(@GUID+137,17477,542,3,420.081,-88.5245,9.62061,0.206074,7200,4126,9944,0),
+(@GUID+139,17491,542,3,404.193,-62.5071,9.61827,5.54913,7200,7479,0,0),
+(@GUID+134,17477,542,3,432.656,-78.7667,9.62296,1.5821,7200,4126,9944,0),
+(@GUID+140,17477,542,3,419.961,-76.9838,9.62318,5.67087,7200,4126,9944,0),
+(@GUID+135,17477,542,3,427.911,-69.9011,9.61668,4.99622,7200,4126,9944,0),
+(@GUID+142,18894,542,3,355.194,-175.571,-25.5497,0.0701911,7200,14958,0,0),
+(@GUID+144,18894,542,3,325.278,-191.535,-25.5078,1.49412,7200,14958,0,0),
+(@GUID+145,17371,542,3,312.396,-174.925,-25.5082,6.21829,7200,10472,5875,0),
+(@GUID+146,18894,542,3,312.116,-179.382,-25.5071,6.20258,7200,14958,0,0),
+(@GUID+147,18894,542,3,313.392,-170.618,-25.5086,6.20651,7200,14958,0,0),
+(@GUID+78,17371,542,3,331.268,69.7599,9.61402,1.77024,7200,10472,5875,0),
+(@GUID+70,17397,542,3,313.949,13.7401,9.61652,4.38997,7200,11965,2486,0),
+(@GUID+69,17395,542,3,311.261,7.92634,9.62195,0.656179,7200,10472,17625,0),
+(@GUID+71,17397,542,3,317.184,8.72084,9.6192,2.67896,7200,11965,2486,0),
+(@GUID+75,17491,542,3,314.564,-7.67602,9.6169,2.30511,7200,7479,0,0),
+(@GUID+77,17370,542,3,331.076,28.8939,9.62118,4.2576,7200,14958,0,0),
+(@GUID+73,17395,542,3,338.84,8.10661,9.61679,5.05086,7200,10472,17625,0),
+(@GUID+72,17395,542,3,338.242,1.09978,9.61664,1.01391,7200,10472,17625,0),
+(@GUID+25,17398,542,3,413.285,81.8238,9.65038,0.154642,7200,6963,0,0),
+(@GUID+24,17398,542,3,500.076,84.7778,9.65474,3.08941,7200,6963,0,0),
+(@GUID+23,17398,542,3,502.724,82.8731,9.65935,3.08941,7200,6963,0,0),
+(@GUID+22,17398,542,3,498.962,83.0695,9.6524,3.08941,7200,6963,0,0),
+(@GUID+21,17398,542,3,498.393,86.641,9.65219,3.19309,7200,6963,0,0),
+(@GUID+104,17414,542,3,327.172,188.393,9.61882,1.09492,7200,10472,5875,0),
+(@GUID+27,17398,542,3,409.226,83.2983,9.65786,0.141552,7200,6963,0,0),
+(@GUID+28,17398,542,3,412.081,112.626,9.65613,6.1865,7200,6963,0,0),
+(@GUID+29,17398,542,3,412.462,116.555,9.65317,6.1865,7200,6963,0,0),
+(@GUID+30,17398,542,3,411.735,114.446,9.65571,0.00803471,7200,6963,0,0),
+(@GUID+31,17398,542,3,409.699,113.048,9.65731,0.0185067,7200,6963,0,0),
+(@GUID+32,17398,542,3,407.17,115.172,9.66061,0.0185067,7200,6963,0,0),
+(@GUID+33,17398,542,3,495.677,116.285,9.64388,3.14963,7200,6963,0,0),
+(@GUID+34,17398,542,3,495.696,113.877,9.64425,3.14963,7200,6963,0,0),
+(@GUID+35,17398,542,3,499.774,112.283,9.65334,3.14963,7200,6963,0,0),
+(@GUID+36,17398,542,3,503.042,114.321,9.65788,3.14963,7200,6963,0,0),
+(@GUID+37,17398,542,3,503.024,116.589,9.65788,3.14963,7200,6963,0,0),
+(@GUID+38,17398,542,3,499.499,118.085,9.65347,3.14963,7200,6963,0,0),
+(@GUID+111,17414,542,3,482.454,103.335,9.61156,5.27398,7200,10472,5875,0),
+(@GUID+110,17414,542,3,458.068,92.7015,9.61519,1.89206,7200,10472,5875,0),
+(@GUID+109,17414,542,3,452.317,94.5807,9.61519,0.545102,7200,10843,6015,0),
+(@GUID+108,17395,542,3,457.121,99.2828,9.61496,4.44777,7200,10472,17625,0),
+(@GUID+102,17370,542,3,466.171,176.663,9.6201,2.8927,7200,14958,0,2),
+(@GUID+98,17371,542,3,412.814,195.493,9.60144,3.55951,7200,10472,5875,0),
+(@GUID+100,17395,542,3,403.447,190.68,9.59739,0.0770466,7200,10472,17625,0),
+(@GUID+99,17398,542,3,411.319,185.388,9.60154,2.28952,7200,6963,0,0),
+(@GUID+101,17370,542,3,466.657,179.674,9.61915,2.88877,7200,14958,0,2),
+(@GUID+76,17370,542,3,323.216,28.6452,9.62206,4.92205,7200,14958,0,0),
+(@GUID+74,17397,542,3,344.219,5.00403,9.62297,3.2955,7200,11965,2486,0),
+(@GUID+67,17370,542,3,286.75,-7.12364,9.33158,3.50552,7200,14958,0,0),
+(@GUID+65,17370,542,3,258.511,-30.4009,6.95261,4.07258,7200,14958,0,0),
+(@GUID+63,17371,542,3,246.377,-85.311,9.61661,3.04947,7200,10472,5875,2),
+(@GUID+62,17477,542,3,226.371,-71.3008,9.61766,2.01394,7200,4126,9944,0),
+(@GUID+60,17397,542,3,224.497,-68.0896,9.62108,5.19786,7200,11965,2486,0),
+(@GUID+61,17397,542,3,227.979,-74.6894,9.61909,1.96987,7200,11965,2486,0),
+(@GUID+106,17626,542,3,458.614,116.989,9.61455,3.07559,7200,14958,0,0),
+(@GUID+43,17491,542,3,182.461,-68.9882,9.62108,3.98337,7200,7479,0,0),
+(@GUID+42,17491,542,3,107.083,-96.6171,-14.2289,0.930522,7200,7479,0,0),
+(@GUID+51,17397,542,3,27.6779,-90.5785,-40.7088,1.48496,7200,11965,2486,0),
+(@GUID+82,17414,542,3,304.249,103.356,9.62076,5.61477,7200,10843,6015,0),
+(@GUID+83,17371,542,3,308.919,100.519,9.62138,2.61455,7200,10472,5875,0),
+(@GUID+86,17626,542,3,356.154,108.175,9.62332,4.06125,7200,14958,0,0),
+(@GUID+85,17371,542,3,343.419,102.651,9.6201,5.16709,7200,10472,5875,0),
+(@GUID+93,17414,542,3,346.912,193.875,9.60419,1.74602,7200,10472,5875,0),
+(@GUID+115,17414,542,3,476.291,65.9018,9.60985,3.98357,7200,10472,5875,0),
+(@GUID+114,17414,542,3,469.409,65.9985,9.61271,5.036,7200,10843,6015,0),
+(@GUID+116,17371,542,3,472.66,59.4292,9.6097,1.58025,7200,10472,5875,0),
+(@GUID+105,17624,542,3,456.429,118.903,9.61496,3.16198,7200,16023,0,0),
+(@GUID+107,17626,542,3,458.704,120.842,9.61456,3.1619,7200,14958,0,2),
+(@GUID+127,18894,542,3,462.905,-19.9126,9.55215,5.18053,7200,14958,0,0),
+(@GUID+41,17377,542,3,325.862,-87.2087,-24.6512,5.87314,43200,34830,6156,0),
+(@GUID+143,18894,542,3,333.631,-192.252,-25.5027,1.51768,7200,14958,0,0),
+(@GUID+148,17371,542,3,329.584,-189.111,-25.5067,1.50511,7200,10472,5875,0),
+(@GUID+132,17371,542,3,424.675,-83.9057,9.6166,0.059993,7200,10472,5875,0),
+(@GUID+130,18894,542,3,475.417,-66.3289,9.54527,0,7200,14958,0,0),
+(@GUID+40,18894,542,3,455.566,-79.108,9.61164,0.09548,7200,14958,0,0),
+(@GUID+39,18894,542,3,455.793,-89.9999,9.60743,0.09548,7200,14958,0,0),
+(@GUID+121,17371,542,3,487.933,17.2848,9.55353,4.54905,7200,10472,5875,0),
+(@GUID+119,17414,542,3,445.422,63.6577,9.61209,3.54218,7200,10472,5875,0),
+(@GUID+118,17371,542,3,442.237,56.965,9.61104,1.84965,7200,10472,5875,0),
+(@GUID+117,17371,542,3,437.232,64.7644,9.60927,5.1656,7200,10472,5875,0),
+(@GUID+113,17414,542,3,483.48,91.8948,9.62303,1.14828,7200,10472,5875,0),
+(@GUID+20,17398,542,3,437.158,201.984,11.6815,4.639,7200,6963,0,0),
+(@GUID+19,17398,542,3,345.078,202.309,11.6826,4.90708,7200,6963,0,0),
+(@GUID+18,17398,542,3,314.478,195.642,11.6815,5.01966,7200,6963,0,0),
+(@GUID+17,17381,542,3,327.17,137.816,9.61546,4.72121,43200,38722,0,0),
+(@GUID+90,17370,542,3,372.443,187.252,9.59815,3.08144,7200,14958,0,2),
+(@GUID+87,17491,542,3,301.987,172.031,9.61921,0.398146,7200,7479,0,0),
+(@GUID+89,17370,542,3,372.443,191.252,9.59815,3.3214,7200,14958,0,2),
+(@GUID+80,17626,542,3,343.075,57.8455,9.6156,0,7200,14958,0,0),
+(@GUID+81,17624,542,3,327.255,54.8455,9.61645,0,7200,16023,0,2),
+(@GUID+15,17414,542,3,352.426,85.7746,9.6222,6.27838,7200,10472,5875,0),
+(@GUID+84,17414,542,3,346.54,96.449,9.6201,2.21792,7200,10472,5875,0),
+(@GUID+16,17414,542,3,302.425,61.1739,9.61642,3.14962,7200,10472,5875,0),
+(@GUID+79,17414,542,3,328.075,76.9842,9.61402,5.19851,7200,10472,5875,0),
+(@GUID+133,17477,542,3,433.797,-90.9604,9.62448,1.93317,7200,4126,9944,0),
+(@GUID+141,18894,542,3,355.299,-163.451,-25.5338,6.16881,7200,14958,0,0),
+(@GUID+138,17477,542,3,423.255,-96.3954,9.61869,1.21688,7200,4126,9944,0),
+(@GUID+66,17626,542,3,279.674,1.44232,8.11077,3.8723,7200,14958,0,0),
+(@GUID+64,17626,542,3,250.468,-24.7817,6.95538,4.23202,7200,14958,0,0),
+(@GUID+50,17397,542,3,29.672,-80.5135,-40.787,4.36738,7200,11965,2486,0),
+(@GUID+44,17397,542,3,-12.9018,-81.3588,-41.3358,5.36252,7200,11965,2486,0),
+(@GUID+47,17397,542,3,6.99569,-89.3037,-41.3305,1.28394,7200,11965,2486,0),
+(@GUID+45,17397,542,3,-9.04048,-88.5931,-41.3341,1.99081,7200,11965,2486,0),
+(@GUID+49,17477,542,3,8.90866,-85.0585,-41.3294,1.02944,7200,4126,9944,0),
+(@GUID+48,17397,542,3,10.3856,-81.342,-41.3294,4.24882,7200,11965,2486,0),
+(@GUID+9,17380,542,3,455.336,-1.82919,9.6299,1.43117,43200,30960,18468,0),
+(@GUID+8,17370,542,3,7.83757,-54.6224,-41.258,1.62316,7200,14958,0,0),
+(@GUID+7,17370,542,3,-4.06964,-56.7616,-41.258,1.41372,7200,14958,0,0),
+(@GUID+6,17370,542,3,49.3209,-93.3478,-40.1855,2.86234,7200,14958,0,0),
+(@GUID+5,17370,542,3,49.2232,-75.6242,-40.1856,2.98451,7200,14958,0,0),
+(@GUID+4,17256,542,3,369.461,-118.757,-137.368,2.54818,604800,152964,1016100,0),
+(@GUID+3,17256,542,3,369.15,-55.5658,-137.368,3.71755,604800,152964,1016100,0),
+(@GUID+2,17256,542,3,307.784,-31.8502,-137.368,4.95674,604800,152964,1016100,0),
+(@GUID+1,17256,542,3,274.133,-87.1647,-137.368,0.017453,604800,152964,1016100,0),
+(@GUID+0,17256,542,3,308.203,-141.769,-137.368,1.36136,604800,152964,1016100,0);
+
+-- GAMEOBJECT_TEMPLATE
+UPDATE `gameobject_template` SET `ScriptName`='go_broggok_lever' WHERE `entry`=181982;
+
+-- CREATURE_MODEL_INFO
+-- Old modelid_other_gender 12471. Need to do this because modelid in creature uses creature_model_info, too... so it would still bug.
+UPDATE `creature_model_info` SET `modelid_other_gender`=0 WHERE `modelid`=16332;
+
+-- CREATURE_ADDON
+DELETE FROM `creature_addon` WHERE `guid` BETWEEN @GUID AND @GUID+144;
+INSERT INTO `creature_addon`(`guid`,`path_id`,`bytes2`) VALUES
+(@GUID+0,0,4097),
+(@GUID+1,0,4097),
+(@GUID+2,0,4097),
+(@GUID+3,0,4097),
+(@GUID+4,0,4097),
+(@GUID+15,856820,0),
+(@GUID+63,(@GUID+63)*10,0),
+(@GUID+68,(@GUID+68)*10,0),
+(@GUID+81,(@GUID+81)*10,0),
+(@GUID+89,(@GUID+89)*10,0),
+(@GUID+90,(@GUID+90)*10,0),
+(@GUID+101,(@GUID+101)*10,0),
+(@GUID+102,(@GUID+102)*10,0),
+(@GUID+107,(@GUID+107)*10,0),
+(@GUID+128,(@GUID+128)*10,0),
+(@GUID+129,(@GUID+129)*10,0);
+
+-- CREATURE_FORMATIONS
+DELETE FROM `creature_formations` WHERE `leaderGUID` BETWEEN @GUID AND @GUID+148 OR `memberGUID` BETWEEN @GUID AND @GUID+148;
+INSERT INTO `creature_formations`(`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES
+(@GUID+81,@GUID+81,0,0,2),
+(@GUID+81,@GUID+80,3,290,2),
+(@GUID+107,@GUID+107,0,0,2),
+(@GUID+107,@GUID+105,4,220,2),
+(@GUID+107,@GUID+106,3,285,2),
+(@GUID+129,@GUID+129,0,0,2),
+(@GUID+129,@GUID+130,3,90,2),
+(@GUID+143,@GUID+143,0,0,2),
+(@GUID+143,@GUID+148,3,120,2),
+(@GUID+143,@GUID+144,3,240,2),
+(@GUID+146,@GUID+146,0,0,2),
+(@GUID+146,@GUID+145,3,120,2),
+(@GUID+146,@GUID+147,3,240,2),
+(@GUID+128,@GUID+128,0,0,2),
+(@GUID+128,@GUID+127,4,45,2);
+
+-- WAYPOINT_DATA
+DELETE FROM `waypoint_data` WHERE `id` BETWEEN @GUID*10 AND (@GUID+148)*10;
+INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES
+((@GUID+63 )*10,1,247.229,-66.59,9.62258),
+((@GUID+63 )*10,2,246.245,-85.1909,9.61548),
+((@GUID+63 )*10,3,219.765,-84.577,9.58612),
+((@GUID+63 )*10,4,246.377,-85.311,9.61661),
+((@GUID+68 )*10,1,328.417,-4.58593,9.61603),
+((@GUID+68 )*10,2,327.28,24.0565,9.61603),
+((@GUID+81 )*10,1,327.255,54.8455,9.61346),
+((@GUID+81 )*10,18,322.72,55.3961,9.6137),
+((@GUID+81 )*10,17,317.328,58.7127,9.6137),
+((@GUID+81 )*10,16,315.042,62.5956,9.61509),
+((@GUID+81 )*10,15,312.513,72.6059,9.6179),
+((@GUID+81 )*10,14,311.755,83.2112,9.6179),
+((@GUID+81 )*10,13,312.519,89.5342,9.6179),
+((@GUID+81 )*10,12,313.959,93.8532,9.61756),
+((@GUID+81 )*10,11,317.588,98.5635,9.61631),
+((@GUID+81 )*10,10,322.28,101.14,9.61572),
+((@GUID+81 )*10,9,328.8,102.991,9.61528),
+((@GUID+81 )*10,8,334.164,102.162,9.61808),
+((@GUID+81 )*10,7,339.203,99.0606,9.61948),
+((@GUID+81 )*10,6,342.812,94.2829,9.61948),
+((@GUID+81 )*10,5,345.611,85.8321,9.61948),
+((@GUID+81 )*10,4,344.882,74.8707,9.61869),
+((@GUID+81 )*10,3,343.069,64.3213,9.61614),
+((@GUID+81 )*10,2,340.959,59.932,9.61435),
+((@GUID+89 )*10,1,372.443,191.252,9.59815),
+((@GUID+89 )*10,2,329.021,185.273,9.61524),
+((@GUID+90 )*10,1,372.443,187.252,9.59815),
+((@GUID+90 )*10,2,329.021,181.273,9.61524),
+((@GUID+101)*10,1,416.026,191.714,9.59825),
+((@GUID+101)*10,2,466.657,179.674,9.61915),
+((@GUID+102)*10,1,415.314,187.668,9.59825),
+((@GUID+102)*10,2,466.171,176.663,9.6201),
+((@GUID+107)*10,18,464.47,117.962,9.62),
+((@GUID+107)*10,17,471.688,113.794,9.62),
+((@GUID+107)*10,16,477.046,107.409,9.62),
+((@GUID+107)*10,15,479.897,99.5768,9.62),
+((@GUID+107)*10,14,479.897,91.2417,9.62),
+((@GUID+107)*10,13,477.046,83.4093,9.62),
+((@GUID+107)*10,12,471.688,77.0242,9.62),
+((@GUID+107)*10,11,464.47,72.8567,9.62),
+((@GUID+107)*10,10,456.261,71.4093,9.62),
+((@GUID+107)*10,9,448.053,72.8567,9.62),
+((@GUID+107)*10,8,440.834,77.0242,9.62),
+((@GUID+107)*10,7,435.477,83.4093,9.62),
+((@GUID+107)*10,6,432.626,91.2417,9.62),
+((@GUID+107)*10,5,432.626,99.5768,9.62),
+((@GUID+107)*10,4,435.477,107.409,9.62),
+((@GUID+107)*10,3,440.834,113.794,9.62),
+((@GUID+107)*10,2,448.053,117.962,9.62),
+((@GUID+107)*10,1,456.261,119.409,9.62),
+((@GUID+128)*10,1,475.83,-58.5353,9.5419),
+((@GUID+128)*10,2,474.83,-54.6723,9.5419),
+((@GUID+128)*10,3,465.9,-19.9126,9.55319),
+((@GUID+128)*10,4,466.89,-23.7756,9.55319),
+((@GUID+129)*10,1,482.43,-67.1466,9.56),
+((@GUID+129)*10,2,486.942,-69.7513,9.56),
+((@GUID+129)*10,3,490.29,-73.742,9.56),
+((@GUID+129)*10,4,492.072,-78.6373,9.56),
+((@GUID+129)*10,5,492.072,-83.8467,9.56),
+((@GUID+129)*10,6,490.29,-88.742,9.56),
+((@GUID+129)*10,7,486.942,-92.7327,9.56),
+((@GUID+129)*10,8,482.43,-95.3374,9.56),
+((@GUID+129)*10,9,477.3,-96.242,9.56),
+((@GUID+129)*10,10,472.17,-95.3374,9.56),
+((@GUID+129)*10,11,467.658,-92.7327,9.56),
+((@GUID+129)*10,12,464.31,-88.742,9.56),
+((@GUID+129)*10,13,462.528,-83.8467,9.56),
+((@GUID+129)*10,14,462.528,-78.6373,9.56),
+((@GUID+129)*10,15,464.31,-73.742,9.56),
+((@GUID+129)*10,16,467.658,-69.7513,9.56),
+((@GUID+129)*10,17,472.17,-67.1466,9.56),
+((@GUID+129)*10,18,477.3,-66.242,9.56);
+
+-- Revert a previous bad fix
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17398;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-85712,-85717,-85719,-85724) AND `source_type`=0;
+DELETE FROM `gameobject_scripts` WHERE `id`=150441;
diff --git a/sql/old/3.3.5a/2012_08_30_00_world_creature_template.sql b/sql/old/3.3.5a/2012_08_30_00_world_creature_template.sql
new file mode 100644
index 00000000000..27c1c1dedd4
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_30_00_world_creature_template.sql
@@ -0,0 +1 @@
+ALTER TABLE `creature_template` ADD `unit_flags2` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `unit_flags`;
diff --git a/sql/old/3.3.5a/2012_08_30_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_08_30_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..d7602dd8c79
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_30_00_world_spell_script_names.sql
@@ -0,0 +1,8 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (41054, 63418, 69893, 45205, 69896, 57594);
+INSERT INTO `spell_script_names` VALUES
+(41054, "spell_gen_clone_weapon_aura"),
+(63418, "spell_gen_clone_weapon_aura"),
+(69893, "spell_gen_clone_weapon_aura"),
+(45205, "spell_gen_clone_weapon_aura"),
+(69896, "spell_gen_clone_weapon_aura"),
+(57594, "spell_gen_clone_weapon_aura");
diff --git a/sql/old/3.3.5a/2012_08_31_00_world_command.sql b/sql/old/3.3.5a/2012_08_31_00_world_command.sql
new file mode 100644
index 00000000000..c0686d6d907
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_31_00_world_command.sql
@@ -0,0 +1,14 @@
+DELETE FROM `command` WHERE `name`='explorecheat';
+DELETE FROM `command` WHERE `name`='taxicheat';
+DELETE FROM `command` WHERE `name`='waterwalk';
+
+DELETE FROM `command` WHERE `name`='cheat' OR `name` LIKE 'cheat%';
+INSERT INTO `command` (`name`, `security`, `help`) VALUES
+('cheat', 2, 'Syntax: .cheat $subcommand\r\nType .cheat to see the list of possible subcommands or .help cheat $subcommand to see info on subcommands'),
+('cheat god', 2, 'Syntax: .cheat god [on/off]\r\nEnables or disables your character''s ability to take damage.'),
+('cheat casttime', 2, 'Syntax: .cheat casttime [on/off]\r\nEnables or disables your character''s spell cast times.'),
+('cheat cooldown', 2, 'Syntax: .cheat cooldown [on/off]\r\nEnables or disables your character''s spell cooldowns.'),
+('cheat power', 2, 'Syntax: .cheat power [on/off]\r\nEnables or disables your character''s spell cost (e.g mana).'),
+('cheat waterwalk', 2, 'Syntax: .cheat waterwalk on/off\r\nSet on/off waterwalk state for selected player or self if no player selected.'),
+('cheat explore', 2, 'Syntax: .cheat explore #flag\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'),
+('cheat taxi', 2, 'Syntax: .cheat taxi on/off\r\nTemporary grant access or remove to all taxi routes for the selected character.\r\n If no character is selected, hide or reveal all routes to you.Visited taxi nodes sill accessible after removing access.');
diff --git a/sql/old/3.3.5a/2012_08_31_00_world_sai.sql b/sql/old/3.3.5a/2012_08_31_00_world_sai.sql
new file mode 100644
index 00000000000..fd7e0d7810f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_08_31_00_world_sai.sql
@@ -0,0 +1,50 @@
+-- Defending Your Title (13423)
+-- Taking on All Challengers (12971)
+
+SET @NPC_CHALLENGER := 30012; -- Victorious Challenger
+SET @QUEST1 := 12971;
+SET @QUEST2 := 13423;
+SET @GOSSIP_MENUID := 9865;
+SET @SPELL_SUNDER := 11971; -- Sunder Armor
+SET @SPELL_REND := 11977; -- Rend
+
+UPDATE `creature_template` SET `faction_A`=2109,`faction_H`=2109,`unit_flags`=0x8000,`npcflag`=0x1,`gossip_menu_id`=@GOSSIP_MENUID,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@NPC_CHALLENGER;
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_CHALLENGER;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_CHALLENGER,0,0x0,0x1,'');
+
+DELETE FROM `creature_text` WHERE `entry`=@NPC_CHALLENGER;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_CHALLENGER,0,0,'You will not defeat me!',12,0,100,0,0,0,'Victorious Challenger'),
+(@NPC_CHALLENGER,0,1,'You''re not worthy of Thorim!',12,0,100,0,0,0,'Victorious Challenger'),
+(@NPC_CHALLENGER,0,2,'Good luck... You''ll need it!',12,0,100,0,0,0,'Victorious Challenger'),
+(@NPC_CHALLENGER,0,3,'May the best win!',12,0,100,0,0,0,'Victorious Challenger');
+
+DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP_MENUID;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(@GOSSIP_MENUID,13660);
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP_MENUID;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(@GOSSIP_MENUID,0,0,'Let''s do this, sister.',1,1,0,0,0,0,'');
+
+DELETE FROM `creature_equip_template` WHERE `entry`=@NPC_CHALLENGER;
+INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES
+(@NPC_CHALLENGER,40542,39288,0);
+
+DELETE FROM `smart_scripts` WHERE (`source_type`=0 AND `entryorguid`=@NPC_CHALLENGER) OR (`source_type`=9 AND `entryorguid`=@NPC_CHALLENGER*100);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC_CHALLENGER,0,0,0,25,0,100,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - On Reset - Set Default Faction'),
+(@NPC_CHALLENGER,0,1,2,62,0,100,0,@GOSSIP_MENUID,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Victorious Challenger - On Gossip - Close Gossip'),
+(@NPC_CHALLENGER,0,2,0,61,0,100,0,0,0,0,0,80,@NPC_CHALLENGER*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - On Gossip - Run Timed Script'),
+(@NPC_CHALLENGER,0,3,0,9,0,100,0,0,5,5000,10000,11,@SPELL_SUNDER,0,0,0,0,0,2,0,0,0,0,0,0,0,'Victorious Challenger - On Range - Cast Sunder Armor'),
+(@NPC_CHALLENGER,0,4,0,0,0,100,0,10000,15000,15000,20000,11,@SPELL_REND,0,0,0,0,0,2,0,0,0,0,0,0,0,'Victorious Challenger - IC - Cast Rend'),
+(@NPC_CHALLENGER*100,9,0,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - Timed - Talk'),
+(@NPC_CHALLENGER*100,9,1,0,0,0,100,0,3000,3000,3000,3000,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - Timed - Set Faction Hostile'),
+(@NPC_CHALLENGER*100,9,2,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Victorious Challenger - Timed - Attack Invoker');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP_MENUID;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,@GOSSIP_MENUID,0,0,0,9,0,@QUEST1,0,0,0,0,'','Show gossip option 0 if player has quest Taking on All Challengers'),
+(15,@GOSSIP_MENUID,0,0,1,9,0,@QUEST2,0,0,0,0,'','Show gossip option 0 if player has quest Defending Your Title');
diff --git a/sql/old/3.3.5a/2012_09_01_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_09_01_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..add7621b74c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_01_00_world_spell_script_names.sql
@@ -0,0 +1,4 @@
+-- Unlocking zuluhed chains
+DELETE FROM `spell_script_names` WHERE `spell_id`=38790;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(38790, 'spell_unlocking_zuluheds_chains');
diff --git a/sql/old/3.3.5a/2012_09_02_00_world_quest_template.sql b/sql/old/3.3.5a/2012_09_02_00_world_quest_template.sql
new file mode 100644
index 00000000000..d7e3948ef4f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_02_00_world_quest_template.sql
@@ -0,0 +1,49 @@
+-- Kandrostrasz <Brood of Alexstrasza> (15503) quests RequiredClasses fix by nelegalno
+UPDATE `quest_template` SET `RequiredClasses` = 1 WHERE `Id` IN (8559,8560); -- Warrior
+UPDATE `quest_template` SET `RequiredClasses` = 2 WHERE `Id` IN (8629,8655); -- Paladin
+UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` IN (8626,8658); -- Hunter
+UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` IN (8637,8640); -- Rogue
+UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` IN (8593,8596); -- Priest
+UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` IN (8621,8624); -- Shaman
+UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` IN (8631,8634); -- Mage
+UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` IN (8660,8663); -- Warlock
+UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` IN (8665,8668); -- Druid
+
+-- Andorgos <Brood of Malygos> (15502) quests RequiredClasses fix by nelegalno
+UPDATE `quest_template` SET `RequiredClasses` = 1 WHERE `Id` IN (8544,8561); -- Warrior
+UPDATE `quest_template` SET `RequiredClasses` = 2 WHERE `Id` IN (8628,8630); -- Paladin
+UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` IN (8657,8659); -- Hunter
+UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` IN (8639,8641); -- Rogue
+UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` IN (8592,8594); -- Priest
+UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` IN (8602,8623); -- Shaman
+UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` IN (8625,8632); -- Mage
+UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` IN (8662,8664); -- Warlock
+UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` IN (8667,8669); -- Druid
+
+-- Craftsman Wilhelm <Brotherhood of the Light> (16376) NPCs quests
+UPDATE `quest_template` SET `RequiredClasses` = 3 WHERE `Id` IN (9234,9235,9236); -- Warrior, Paladin
+UPDATE `quest_template` SET `RequiredClasses` = 68 WHERE `Id` IN (9244,9245,9246); -- Hunter, Shaman
+UPDATE `quest_template` SET `RequiredClasses` = 400 WHERE `Id` IN (9238,9239,9240); -- Priest, Mage, Warlock
+UPDATE `quest_template` SET `RequiredClasses` = 1032 WHERE `Id` IN (9241,9242,9243); -- Rogue, Druid
+
+-- Zanza the Restless (15042) NPCs quests
+UPDATE `quest_template` SET `RequiredClasses` = 1 WHERE `Id` = 8184; -- Warrior
+UPDATE `quest_template` SET `RequiredClasses` = 2 WHERE `Id` = 8185; -- Paladin
+UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` = 8187; -- Hunter
+UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` = 8186; -- Rogue
+UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` = 8191; -- Priest
+UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` = 8188; -- Shaman
+UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` = 8189; -- Mage
+UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` = 8190; -- Warlock
+UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` = 8192; -- Druid
+
+-- Vethsera <Brood of Ysera> (15504) quests RequiredClasses fix by nelegalno
+UPDATE `quest_template` SET `RequiredClasses` = 1 WHERE `Id` = 8562; -- Warrior
+UPDATE `quest_template` SET `RequiredClasses` = 2 WHERE `Id` = 8627; -- Paladin
+UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` = 8656; -- Hunter
+UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` = 8638; -- Rogue
+UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` = 8603; -- Priest
+UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` = 8622; -- Shaman
+UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` = 8633; -- Mage
+UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` = 8661; -- Warlock
+UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` = 8666; -- Druid
diff --git a/sql/old/3.3.5a/2012_09_02_01_world_sai.sql b/sql/old/3.3.5a/2012_09_02_01_world_sai.sql
new file mode 100644
index 00000000000..971c50d9c05
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_02_01_world_sai.sql
@@ -0,0 +1,36 @@
+-- Lok'lira the Crone
+SET @ENTRY := 29975;
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,62,0,100,0,9910,0,0,0,33,30467,0,0,0,0,0,7,0,0,0,0,0,0,0,'Loklira - gossip select 4 - The Hyldsmeet Kill credit'),
+(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Loklira - gossip select 4 - Close gossip');
+
+UPDATE `gossip_menu_option` SET `action_menu_id`=9908 WHERE `menu_id`=9907;
+UPDATE `gossip_menu_option` SET `action_menu_id`=9909 WHERE `menu_id`=9908;
+UPDATE `gossip_menu_option` SET `action_menu_id`=9910 WHERE `menu_id`=9909;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9907;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9907,0,0,9,12970,0,0,0,'','Loklira - Show gossip if quest accepted');
+
+-- Thorim
+SET @THORIM :=29445;
+UPDATE `creature` SET `modelid`=0 WHERE `id`=@THORIM;
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@THORIM;
+DELETE FROM `creature_addon` WHERE `guid`=97128;
+DELETE FROM `creature_template_addon` WHERE `entry`=@THORIM;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@THORIM,0,0,1,0,0,'');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@THORIM AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@THORIM,0,0,0,62,0,100,0,9926,0,0,0,33,30514,0,0,0,0,0,7,0,0,0,0,0,0,0,'Thorim - gossip select - give quest credit');
+
+UPDATE `gossip_menu_option` SET `action_menu_id`=9927 WHERE `menu_id`=9924;
+UPDATE `gossip_menu_option` SET `action_menu_id`=9926 WHERE `menu_id`=9927;
+UPDATE `gossip_menu_option` SET `action_menu_id`=9925 WHERE `menu_id`=9926;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9924;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9924,0,0,9,13064,0,0,0,'','Thorim - Show gossip if quest accepted');
diff --git a/sql/old/3.3.5a/2012_09_03_00_world_misc.sql b/sql/old/3.3.5a/2012_09_03_00_world_misc.sql
new file mode 100644
index 00000000000..e8910c78b40
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_03_00_world_misc.sql
@@ -0,0 +1,36 @@
+-- Cold Hearted (12856)
+
+SET @NPC_CAPTIVE_DRAKE := 29708; -- Captive Proto-Drake
+SET @NPC_FREED_DRAKE := 29709; -- Freed Proto-Drake
+SET @NPC_PRISONER := 29639; -- Brunnhildar Prisoner
+SET @NPC_LIBERATED := 29734; -- Liberated Brunnhildar
+
+SET @SPELL_SUM_FREE_DRAKE := 55028; -- Summon Freed Proto-Drake
+SET @SPELL_ICE_SHARD := 55046; -- Ice Shard (Rank 3)
+SET @SPELL_FREE_PRISONER := 55048; -- Free Brunnhildar Prisoner
+SET @AURA_IMPRISONMENT := 54894; -- Icy Imprisonment
+
+
+UPDATE `creature_template` SET `speed_walk`=1,`speed_run`=1.14286,`spell1`=@SPELL_ICE_SHARD,`HoverHeight`=4,`unit_flags`=0x1000008,`InhabitType`=4,`ScriptName`='npc_freed_protodrake' WHERE `entry`=@NPC_FREED_DRAKE;
+UPDATE `creature_template` SET `unit_flags`=33554432,`AIName`='SmartAI' WHERE `entry`=@NPC_LIBERATED;
+
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@NPC_CAPTIVE_DRAKE;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
+(@NPC_CAPTIVE_DRAKE,@SPELL_SUM_FREE_DRAKE,1,0);
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_FREED_DRAKE;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_FREED_DRAKE,0,0x3000000,0x1,'55034 61183');
+
+DELETE FROM `creature_text` WHERE `entry`=@NPC_FREED_DRAKE;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_FREED_DRAKE,0,0,'Return to Brunnhildar Village!',42,0,100,0,0,0,'Freed Proto-Drake'),
+(@NPC_FREED_DRAKE,0,1,'The proto-drake smells freedom and flies homeward!',41,0,100,0,0,0,'Freed Proto-Drake');
+
+DELETE FROM `spell_scripts` WHERE `id`=@SPELL_FREE_PRISONER;
+INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
+(@SPELL_FREE_PRISONER,0,0,14,@AURA_IMPRISONMENT,0,0,0,0,0,0);
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@NPC_LIBERATED;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC_LIBERATED,0,0,0,54,0,100,0,0,0,0,0,41,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Liberated Brunnhildar - On Spawn - Despawn in 30 seconds');
diff --git a/sql/old/3.3.5a/2012_09_03_01_world_gameobject_template.sql b/sql/old/3.3.5a/2012_09_03_01_world_gameobject_template.sql
new file mode 100644
index 00000000000..ff0907eee6e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_03_01_world_gameobject_template.sql
@@ -0,0 +1 @@
+UPDATE `gameobject_template` SET `flags`=40 WHERE `entry`=186371; -- Zeppelin
diff --git a/sql/old/3.3.5a/2012_09_03_02_world_quest_template.sql b/sql/old/3.3.5a/2012_09_03_02_world_quest_template.sql
new file mode 100644
index 00000000000..0c0a7ce4e40
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_03_02_world_quest_template.sql
@@ -0,0 +1,2 @@
+-- Stalk the Stalker (9719) quest requirements fix
+UPDATE `quest_template` SET `RequiredRaces` = 0 WHERE `Id` = 9719;
diff --git a/sql/old/3.3.5a/2012_09_07_00_characters_characters.sql b/sql/old/3.3.5a/2012_09_07_00_characters_characters.sql
new file mode 100644
index 00000000000..26ad904b4a0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_07_00_characters_characters.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `characters` MODIFY `name`
+ VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
diff --git a/sql/old/3.3.5a/2012_09_07_00_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_09_07_00_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..3d39c06051a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_07_00_world_spell_bonus_data.sql
@@ -0,0 +1,4 @@
+SET @Spell := 28715; -- Flamecap Fire
+DELETE FROM `spell_bonus_data` WHERE `entry`=@Spell;
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(@Spell,0,0,0,0, 'Flamecap Fire');
diff --git a/sql/old/3.3.5a/2012_09_07_01_world_creature_template.sql b/sql/old/3.3.5a/2012_09_07_01_world_creature_template.sql
new file mode 100644
index 00000000000..16e4f670fd2
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_07_01_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `unit_flags2`=`unit_flags2`|0x800; -- UNIT_FLAG2_REGENERATE_POWER
diff --git a/sql/old/3.3.5a/2012_09_07_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_09_07_02_world_spell_script_names.sql
new file mode 100644
index 00000000000..652d45543e3
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_07_02_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM spell_script_names WHERE spell_id = -755;
+INSERT IGNORE INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(-755, 'spell_warl_health_funnel');
diff --git a/sql/old/3.3.5a/2012_09_08_00_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_09_08_00_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..cce5745dee9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_08_00_world_achievement_criteria_data.sql
@@ -0,0 +1,6 @@
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10304,10313);
+INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
+(10304,5,62320,0,''),
+(10304,12,0,0,''),
+(10313,5,62320,0,''),
+(10313,12,1,0,'');
diff --git a/sql/old/3.3.5a/2012_09_08_01_world_creature_template.sql b/sql/old/3.3.5a/2012_09_08_01_world_creature_template.sql
new file mode 100644
index 00000000000..fb34f345f2d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_08_01_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (32930,33909); -- Kologarn
diff --git a/sql/old/3.3.5a/2012_09_08_02_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_09_08_02_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..2f25f6f20fa
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_08_02_world_achievement_criteria_data.sql
@@ -0,0 +1,10 @@
+-- Criteria data for achievement 'Wrecking Ball'
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (3368, 3369, 3370, 12578, 7623, 3371);
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3368, 3369, 3370, 12578, 7623, 3371);
+INSERT INTO `achievement_criteria_data`(`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
+(3368,2,0,0,''),
+(3369,2,0,0,''),
+(3370,2,0,0,''),
+(12578,2,0,0,''),
+(7623,2,0,0,''),
+(3371,2,0,0,'');
diff --git a/sql/old/3.3.5a/2012_09_09_00_world_command.sql b/sql/old/3.3.5a/2012_09_09_00_world_command.sql
new file mode 100644
index 00000000000..1fb3247bfbb
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_09_00_world_command.sql
@@ -0,0 +1,4 @@
+DELETE FROM `command` WHERE `name` = 'start';
+DELETE FROM `command` WHERE `name` = 'unstuck';
+INSERT INTO `command` (`name`, `security`, `help`) VALUES
+('unstuck', 0, 'Syntax: .unstuck $playername [inn/graveyard/startzone]\n\nTeleports specified player to specified location. Default location is player\'s current hearth location.');
diff --git a/sql/old/3.3.5a/2012_09_09_01_world_trinity_string.sql b/sql/old/3.3.5a/2012_09_09_01_world_trinity_string.sql
new file mode 100644
index 00000000000..2f3c0aa1938
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_09_01_world_trinity_string.sql
@@ -0,0 +1,3 @@
+DELETE FROM `trinity_string` WHERE `entry`=63; -- Existing entry 63 is not present in Language.h. It's safe to remove it.
+INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
+(63, 'You can''t do that right now.');
diff --git a/sql/old/3.3.5a/2012_09_09_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_09_09_02_world_spell_script_names.sql
new file mode 100644
index 00000000000..36e5b08c36d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_09_02_world_spell_script_names.sql
@@ -0,0 +1,10 @@
+-- Gift of the Naaru
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_gift_of_naaru';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(28880,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_WARRIOR
+(59542,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_PALADIN
+(59543,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_HUNTER
+(59544,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_PRIEST
+(59545,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_DEATHKNIGHT
+(59547,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_SHAMAN
+(59548,'spell_gen_gift_of_naaru'); -- SPELLFAMILY_MAGE
diff --git a/sql/old/3.3.5a/2012_09_09_03_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_09_09_03_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..a08c494da1b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_09_03_world_spell_bonus_data.sql
@@ -0,0 +1,9 @@
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (28880,59542,59543,59544,59545,59547,59548);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(28880,0,0,0,0,'Warrior - Gift of the Naaru'),
+(59542,0,0,0,0,'Paladin - Gift of the Naaru'),
+(59543,0,0,0,0,'Hunter - Gift of the Naaru'),
+(59544,0,0,0,0,'Priest - Gift of the Naaru'),
+(59545,0,0,0,0,'Deathknight - Gift of the Naaru'),
+(59547,0,0,0,0,'Shaman - Gift of the Naaru'),
+(59548,0,0,0,0,'Mage - Gift of the Naaru');
diff --git a/sql/old/3.3.5a/2012_09_09_04_world_quest_template.sql b/sql/old/3.3.5a/2012_09_09_04_world_quest_template.sql
new file mode 100644
index 00000000000..418c5badb36
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_09_04_world_quest_template.sql
@@ -0,0 +1 @@
+UPDATE `quest_template` SET `OfferRewardText`='Excellent, $N. You''ve saved me a lot of work!$b$bBut don''t think that I''m not grateful!' WHERE `Id`=6571;
diff --git a/sql/old/3.3.5a/2012_09_10_00_world_game_event.sql b/sql/old/3.3.5a/2012_09_10_00_world_game_event.sql
new file mode 100644
index 00000000000..edd6413379c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_00_world_game_event.sql
@@ -0,0 +1,3 @@
+UPDATE `game_event` SET `start_time`='2012-11-04 00:01:00' WHERE `eventEntry`=3; -- Darkmoon Faire - Terrokkar
+UPDATE `game_event` SET `start_time`='2012-12-02 00:01:00' WHERE `eventEntry`=4; -- Darkmoon Faire - Elwynn
+UPDATE `game_event` SET `start_time`='2012-10-07 00:01:00' WHERE `eventEntry`=5; -- Darkmoon Faire - Mulgore
diff --git a/sql/old/3.3.5a/2012_09_10_01_world_quest_template.sql b/sql/old/3.3.5a/2012_09_10_01_world_quest_template.sql
new file mode 100644
index 00000000000..2db8883d92c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_01_world_quest_template.sql
@@ -0,0 +1 @@
+UPDATE `quest_template` SET `OfferRewardText`="What!? If I knew that Pao'ka Swiftmountain was going to snoop around Highperch, I would have chained him to a totem! His father was reluctant allowing him to come with me to Thousand Needles. We came here to study the different creatures that inhabit these beautiful lands.$b$bI appreciate the help you have shown Pao'ka. I hope this covers any misfortunes this deed has cost you." WHERE `Id`=4770;
diff --git a/sql/old/3.3.5a/2012_09_10_02_world_creature_text.sql b/sql/old/3.3.5a/2012_09_10_02_world_creature_text.sql
new file mode 100644
index 00000000000..7a3b1a2d86f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_02_world_creature_text.sql
@@ -0,0 +1 @@
+UPDATE `creature_text` SET `text`='Good news, everyone! I think I''ve perfected a plague that will destroy all life on Azeroth!' WHERE `entry`=36678 AND `groupid`=4 AND `id`=0;
diff --git a/sql/old/3.3.5a/2012_09_10_03_world_quest_template.sql b/sql/old/3.3.5a/2012_09_10_03_world_quest_template.sql
new file mode 100644
index 00000000000..aae769ced71
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_03_world_quest_template.sql
@@ -0,0 +1,3 @@
+-- Grark Lorkrub should be available only when Kill On Sight: High Ranking Dark Iron Officials is complete
+UPDATE `quest_template` SET `NextQuestId`=4122 WHERE `Id`=4082;
+UPDATE `quest_template` SET `PrevQuestId`=4082 WHERE `Id`=4122;
diff --git a/sql/old/3.3.5a/2012_09_10_04_world_quest_template.sql b/sql/old/3.3.5a/2012_09_10_04_world_quest_template.sql
new file mode 100644
index 00000000000..5805debd094
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_04_world_quest_template.sql
@@ -0,0 +1,2 @@
+-- Fix some quest requirements
+UPDATE `quest_template` SET `PrevQuestId`=3906 WHERE `Id` IN (3907,7201); -- Disharmony of Fire and The Last Element are available only, if Disharmony of Flame is completed
diff --git a/sql/old/3.3.5a/2012_09_10_06_world_creature_template.sql b/sql/old/3.3.5a/2012_09_10_06_world_creature_template.sql
new file mode 100644
index 00000000000..24a60b107ec
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_06_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|256 WHERE `entry` IN (36897, 38138); -- Little Ooze
diff --git a/sql/old/3.3.5a/2012_09_10_07_world_go_loot_template.sql b/sql/old/3.3.5a/2012_09_10_07_world_go_loot_template.sql
new file mode 100644
index 00000000000..a5e30edfe2c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_07_world_go_loot_template.sql
@@ -0,0 +1,2 @@
+-- Vic's Keys drop chance ( http://old.wowhead.com/object=190778 ) by nelegalno
+UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance` = -100 WHERE `entry`=24861 AND `item`=39264;
diff --git a/sql/old/3.3.5a/2012_09_10_08_world_spell_area.sql b/sql/old/3.3.5a/2012_09_10_08_world_spell_area.sql
new file mode 100644
index 00000000000..4e4e36051c9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_08_world_spell_area.sql
@@ -0,0 +1,5 @@
+-- Cast Armistice in front of the pavillions as well
+DELETE FROM `spell_area` WHERE `spell`=64373 AND `area` IN (4676, 4677);
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(64373,4676,0,0,0,0,0,2,1), -- Sunreaver Pavillion
+(64373,4677,0,0,0,0,0,2,1); -- SIlver Covenant Pavillion
diff --git a/sql/old/3.3.5a/2012_09_10_09_world_creature_involvedrelation.sql b/sql/old/3.3.5a/2012_09_10_09_world_creature_involvedrelation.sql
new file mode 100644
index 00000000000..e30e1559c54
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_09_world_creature_involvedrelation.sql
@@ -0,0 +1,4 @@
+DELETE FROM creature_involvedrelation WHERE quest IN (25500, 25286);
+INSERT INTO creature_involvedrelation (id, quest) VALUES
+(39675, 25500),
+(39675, 25286);
diff --git a/sql/old/3.3.5a/2012_09_10_10_world_gossips.sql b/sql/old/3.3.5a/2012_09_10_10_world_gossips.sql
new file mode 100644
index 00000000000..042b05dc83a
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_10_world_gossips.sql
@@ -0,0 +1,111 @@
+-- gossip assignation from sniff
+UPDATE `creature_template` SET `gossip_menu_id`=4534 WHERE `entry`=3047; -- Archmage Shymm <Mage Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=4536 WHERE `entry`=3048; -- Ursyn Ghull <Mage Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=12670 WHERE `entry`=6328; -- Dannie Fizzwizzle <Demon Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=12670 WHERE `entry`=6373; -- Dane Winslow <Demon Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=12670 WHERE `entry`=6374; -- Cylina Darkheart <Demon Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=1622 WHERE `entry`=8965; -- Shawn
+UPDATE `creature_template` SET `gossip_menu_id`=4119 WHERE `entry`=11047; -- Kray <Apprentice Alchemist>
+UPDATE `creature_template` SET `gossip_menu_id`=4266 WHERE `entry`=11051; -- Vhan <Apprentice Tailor>
+UPDATE `creature_template` SET `gossip_menu_id`=4154 WHERE `entry`=11065; -- Thonys Pillarstone <Apprentice Enchanter>
+UPDATE `creature_template` SET `gossip_menu_id`=4158 WHERE `entry`=11071; -- Mot Dawnstrider <Apprentice Enchanter>
+UPDATE `creature_template` SET `gossip_menu_id`=4204 WHERE `entry`=11081; -- Faldron <Apprentice Leatherworker>
+UPDATE `creature_template` SET `gossip_menu_id`=4181 WHERE `entry`=11083; -- Darianna <Apprentice Leatherworker>
+UPDATE `creature_template` SET `gossip_menu_id`=4207 WHERE `entry`=11084; -- Tarn <Apprentice Leatherworker>
+UPDATE `creature_template` SET `gossip_menu_id`=5142 WHERE `entry`=13442; -- Arch Druid Renferal
+UPDATE `creature_template` SET `gossip_menu_id`=5141 WHERE `entry`=13443; -- Druid of the Grove
+UPDATE `creature_template` SET `gossip_menu_id`=5081 WHERE `entry`=13447; -- Corporal Noreg Stormpike
+UPDATE `creature_template` SET `gossip_menu_id`=5281 WHERE `entry`=13577; -- Stormpike Ram Rider Commander
+UPDATE `creature_template` SET `gossip_menu_id`=7993 WHERE `entry`=15991; -- Lady Dena Kennedy
+UPDATE `creature_template` SET `gossip_menu_id`=7471 WHERE `entry`=17421; -- Clopper Wizbang <Explorers' League>
+UPDATE `creature_template` SET `gossip_menu_id`=7455 WHERE `entry`=17424; -- Anchorite Paetheus <First Aid Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=7459 WHERE `entry`=17434; -- Morae <Herbalism Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=7461 WHERE `entry`=17599; -- Aonar
+UPDATE `creature_template` SET `gossip_menu_id`=7462 WHERE `entry`=17649; -- Kessel <Elekk Lord>
+UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=17666; -- Astur <Stable Master>
+UPDATE `creature_template` SET `gossip_menu_id`=7463 WHERE `entry`=17676; -- Achelus
+UPDATE `creature_template` SET `gossip_menu_id`=7464 WHERE `entry`=17703; -- Messenger Hermesius
+UPDATE `creature_template` SET `gossip_menu_id`=8298 WHERE `entry`=17712; -- Captain Edward Hanes
+UPDATE `creature_template` SET `gossip_menu_id`=7835 WHERE `entry`=17927; -- Scout Jorli
+UPDATE `creature_template` SET `gossip_menu_id`=7738 WHERE `entry`=18252; -- Andarl
+UPDATE `creature_template` SET `gossip_menu_id`=7753 WHERE `entry`=18387; -- Bertelm
+UPDATE `creature_template` SET `gossip_menu_id`=7743 WHERE `entry`=18389; -- Thander
+UPDATE `creature_template` SET `gossip_menu_id`=7752 WHERE `entry`=18390; -- Ros'eleth
+UPDATE `creature_template` SET `gossip_menu_id`=7695 WHERE `entry`=18416; -- Huntress Kima
+UPDATE `creature_template` SET `gossip_menu_id`=7698 WHERE `entry`=18459; -- Jenai Starwhisper
+UPDATE `creature_template` SET `gossip_menu_id`=7745 WHERE `entry`=18704; -- Taela Everstride
+UPDATE `creature_template` SET `gossip_menu_id`=7773 WHERE `entry`=18713; -- Lieutenant Gravelhammer
+UPDATE `creature_template` SET `gossip_menu_id`=7814 WHERE `entry`=18745; -- Captain Auric Sunchaser
+UPDATE `creature_template` SET `gossip_menu_id`=7833 WHERE `entry`=18804; -- Prospector Nachlan <Explorers' League>
+UPDATE `creature_template` SET `gossip_menu_id`=7940 WHERE `entry`=19137; -- "Shotgun" Jones <Nesingwary Safari>
+UPDATE `creature_template` SET `gossip_menu_id`=8433 WHERE `entry`=19340; -- Mi'irku Farstep <Portal Trainer>
+UPDATE `creature_template` SET `gossip_menu_id`=7973 WHERE `entry`=19375; -- Eli Thunderstrike <Sky'ree's Keeper>
+UPDATE `creature_template` SET `gossip_menu_id`=8251 WHERE `entry`=21151; -- Borgrim Stouthammer <Explorers' League>
+UPDATE `creature_template` SET `gossip_menu_id`=8247 WHERE `entry`=21158; -- Commander Skyshadow
+UPDATE `creature_template` SET `gossip_menu_id`=8252 WHERE `entry`=21197; -- Bronwyn Stouthammer <Explorers' League>
+UPDATE `creature_template` SET `gossip_menu_id`=8566 WHERE `entry`=22832; -- Morthis Whisperwing <Druid of the Talon>
+
+-- gossip from sniff
+DELETE FROM `gossip_menu` WHERE (`entry`=1621 AND `text_id`=2273) OR (`entry`=1622 AND `text_id`=2276) OR (`entry`=4119 AND `text_id`=5040) OR (`entry`=4154 AND `text_id`=5184) OR (`entry`=4158 AND `text_id`=5196) OR (`entry`=4181 AND `text_id`=5273) OR (`entry`=4204 AND `text_id`=5325) OR (`entry`=4207 AND `text_id`=5340) OR (`entry`=4266 AND `text_id`=5428) OR (`entry`=4534 AND `text_id`=563) OR (`entry`=4536 AND `text_id`=563) OR (`entry`=5081 AND `text_id`=6288) OR (`entry`=5141 AND `text_id`=6173) OR (`entry`=5142 AND `text_id`=6174) OR (`entry`=5281 AND `text_id`=6313) OR (`entry`=7455 AND `text_id`=9029) OR (`entry`=7459 AND `text_id`=9034) OR (`entry`=7461 AND `text_id`=9037) OR (`entry`=7462 AND `text_id`=9041) OR (`entry`=7463 AND `text_id`=9042) OR (`entry`=7464 AND `text_id`=9043) OR (`entry`=7471 AND `text_id`=9054) OR (`entry`=7695 AND `text_id`=9389) OR (`entry`=7698 AND `text_id`=9393) OR (`entry`=7738 AND `text_id`=9471) OR (`entry`=7743 AND `text_id`=9481) OR (`entry`=7745 AND `text_id`=9484) OR (`entry`=7752 AND `text_id`=9492) OR (`entry`=7753 AND `text_id`=9493) OR (`entry`=7773 AND `text_id`=9521) OR (`entry`=7814 AND `text_id`=9566) OR (`entry`=7833 AND `text_id`=9586) OR (`entry`=7835 AND `text_id`=9591) OR (`entry`=7940 AND `text_id`=9733) OR (`entry`=7973 AND `text_id`=9805) OR (`entry`=7993 AND `text_id`=9845) OR (`entry`=8247 AND `text_id`=10264) OR (`entry`=8251 AND `text_id`=10270) OR (`entry`=8252 AND `text_id`=10271) OR (`entry`=8298 AND `text_id`=10352) OR (`entry`=8432 AND `text_id`=10538) OR (`entry`=8433 AND `text_id`=10291) OR (`entry`=8433 AND `text_id`=10292) OR (`entry`=8566 AND `text_id`=10735);
+INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
+(1621, 2273), -- 8962
+(1622, 2276), -- 8965
+(4119, 5040), -- 11047
+(4154, 5184), -- 11065
+(4158, 5196), -- 11071
+(4181, 5273), -- 11083
+(4204, 5325), -- 11081
+(4207, 5340), -- 11084
+(4266, 5428), -- 11051
+(4534, 563), -- 3047
+(4536, 563), -- 3048
+(5081, 6288), -- 13447
+(5141, 6173), -- 13443
+(5142, 6174), -- 13442
+(5281, 6313), -- 13577
+(7455, 9029), -- 17424
+(7459, 9034), -- 17434
+(7461, 9037), -- 17599
+(7462, 9041), -- 17649
+(7463, 9042), -- 17676
+(7464, 9043), -- 17703
+(7471, 9054), -- 17421
+(7695, 9389), -- 18416
+(7698, 9393), -- 18459
+(7738, 9471), -- 18252
+(7743, 9481), -- 18389
+(7745, 9484), -- 18704
+(7752, 9492), -- 18390
+(7753, 9493), -- 18387
+(7773, 9521), -- 18713
+(7814, 9566), -- 18745
+(7833, 9586), -- 18804
+(7835, 9591), -- 17927
+(7940, 9733), -- 19137
+(7973, 9805), -- 19375
+(7993, 9845), -- 15991
+(8247, 10264), -- 21158
+(8251, 10270), -- 21151
+(8252, 10271), -- 21197
+(8298, 10352), -- 17712
+(8432, 10538), -- 21983
+(8433, 10291), -- 19340
+(8433, 10292), -- 19340
+(8566, 10735); -- 22832
+
+-- correct npc_flags for npc from sniff
+UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=3210; -- Brave Proudsnout
+UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=3211; -- Brave Lightninghorn
+UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=3213; -- Brave Running Wolf
+UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=3214; -- Brave Greathoof
+UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=3502; -- Ratchet Bruiser
+UPDATE `creature_template` SET `npcflag`=3 WHERE `entry`=21151; -- Borgrim Stouthammer <Explorers' League>
+UPDATE `creature_template` SET `npcflag`=3 WHERE `entry`=21197; -- Bronwyn Stouthammer <Explorers' League>
+UPDATE `creature_template` SET `npcflag`=2 WHERE `entry`=21469; -- Daranelle
+
+-- Add condition
+DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=14 AND `SourceGroup`=8433 AND `SourceEntry`=10291) OR (`SourceTypeOrReferenceId`=14 AND `SourceGroup`=8433 AND `SourceEntry`=10292) OR (`SourceTypeOrReferenceId`=14 AND `SourceGroup`=12670 AND `SourceEntry`=12549);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(14,8433,10291,0,0,15,0,128,0,0,1,0,'','Show gossip text if player is not a mage'),
+(14,8433,10292,0,0,15,0,128,0,0,0,0,'','Show gossip text if player is a mage'),
+(14,12670,12549,0,0,15,0,256,0,0,1,0,'','Show gossip text if player is not a Warlock');
diff --git a/sql/old/3.3.5a/2012_09_10_11_world_event_scripts.sql b/sql/old/3.3.5a/2012_09_10_11_world_event_scripts.sql
new file mode 100644
index 00000000000..e0b122ede05
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_11_world_event_scripts.sql
@@ -0,0 +1,7 @@
+-- Finding the Keymaster by nelegalno
+
+UPDATE `quest_template` SET `SpecialFlags` = 0, `RequiredSpellCast1` = 0 WHERE `ID` = 10256;
+DELETE FROM `event_scripts` WHERE id=12857;
+INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
+(12857,0,10,19938,3000000,0,2248.43,2227.97,138.56,2.48121),
+(12857,1,8,19938,1,0,0,0,0,0);
diff --git a/sql/old/3.3.5a/2012_09_10_12_world_sai.sql b/sql/old/3.3.5a/2012_09_10_12_world_sai.sql
new file mode 100644
index 00000000000..99111fb5961
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_12_world_sai.sql
@@ -0,0 +1,4 @@
+UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry`=20243;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=20243 AND `id`=0 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(20243,0,0,0,8,0,100,0,256,0,0,0,19,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Scrapped Fel Reaver - On Spellhit - Remove - OOC Not attackable - flags");
diff --git a/sql/old/3.3.5a/2012_09_10_13_world_creature_model_info.sql b/sql/old/3.3.5a/2012_09_10_13_world_creature_model_info.sql
new file mode 100644
index 00000000000..339072d0502
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_10_13_world_creature_model_info.sql
@@ -0,0 +1,4 @@
+UPDATE `creature_model_info` SET `modelid_other_gender`=4264 WHERE `modelid`=4261; -- Female orc grunt
+UPDATE `creature_model_info` SET `modelid_other_gender`=4263 WHERE `modelid`=4262; -- Female tauren
+UPDATE `creature_model_info` SET `modelid_other_gender`=4262 WHERE `modelid`=4263; -- Male tauren
+UPDATE `creature_model_info` SET `modelid_other_gender`=4261 WHERE `modelid`=4264; -- Male orc grunt
diff --git a/sql/old/3.3.5a/2012_09_11_00_world_misc.sql b/sql/old/3.3.5a/2012_09_11_00_world_misc.sql
new file mode 100644
index 00000000000..0f47f1bf2e9
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_11_00_world_misc.sql
@@ -0,0 +1,11 @@
+-- ToCr orbs
+
+SET @NPC_ORB1 := 34606; -- Frost Sphere
+SET @NPC_ORB2 := 34649; -- Frost Sphere
+
+UPDATE `creature_template` SET `speed_walk`=1.2,`speed_run`=1.42,`InhabitType`=7 WHERE `entry` IN (@NPC_ORB1,@NPC_ORB2);
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (@NPC_ORB1,@NPC_ORB2);
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_ORB1,0,0x3000000,0x1,''),
+(@NPC_ORB2,0,0x3000000,0x1,'');
diff --git a/sql/old/3.3.5a/2012_09_12_00_world_misc.sql b/sql/old/3.3.5a/2012_09_12_00_world_misc.sql
new file mode 100644
index 00000000000..50896ce414c
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_12_00_world_misc.sql
@@ -0,0 +1,9 @@
+-- East Porticullis(195648): close and corrections
+UPDATE `gameobject` SET `phaseMask`=1,`rotation2`=0.7071065,`rotation3`=0.707107,`spawntimesecs`=7200,`animprogress`=255,`state`=0 WHERE `guid`=151176;
+
+-- North Portcullis(195650): delete extra spawn and corrections
+DELETE FROM `gameobject` WHERE `guid`=150080;
+UPDATE `gameobject` SET `phaseMask`=1,`rotation2`=0.7071065,`rotation3`=0.707107,`spawntimesecs`=7200,`animprogress`=255,`state`=1 WHERE `guid`=151178;
+
+-- Web Door(195485): corrections
+UPDATE `gameobject` SET `spawnMask`=15,`rotation2`=0.7071067,`rotation3`=0.7071068,`spawntimesecs`=7200,`animprogress`=255 WHERE `guid`=151192;
diff --git a/sql/old/3.3.5a/2012_09_12_01_world_creature.sql b/sql/old/3.3.5a/2012_09_12_01_world_creature.sql
new file mode 100644
index 00000000000..1b7fa2d78ef
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_12_01_world_creature.sql
@@ -0,0 +1 @@
+DELETE FROM `creature` WHERE `id`=36095;
diff --git a/sql/old/3.3.5a/2012_09_13_00_world_item_template.sql b/sql/old/3.3.5a/2012_09_13_00_world_item_template.sql
new file mode 100644
index 00000000000..48b9d3a107f
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_13_00_world_item_template.sql
@@ -0,0 +1 @@
+ALTER TABLE `item_template` CHANGE unk0 SoundOverrideSubclass tinyint(3) NOT NULL DEFAULT '-1';
diff --git a/sql/old/3.3.5a/2012_09_13_01_world_fires_over_skettis.sql b/sql/old/3.3.5a/2012_09_13_01_world_fires_over_skettis.sql
new file mode 100644
index 00000000000..de9ba5a78fe
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_13_01_world_fires_over_skettis.sql
@@ -0,0 +1,91 @@
+-- Add support for quest ID: 11008 - "Fires Over Skettis" based on Warpten fix and Nelegalno/shlomi1515 updates
+-- Also add support for achievement - http://www.wowhead.com/achievement=1275/bombs-away
+SET @TRIGGER := 22991;
+SET @EGG := 185549;
+SET @SKYBLAST := 39844;
+SET @SUMMEGG := 39843;
+-- Adds SAI support for Monstrous Kaliri Egg Trigger and the GO
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@TRIGGER;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@TRIGGER AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@TRIGGER*100 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@TRIGGER,0,0,0,25,0,100,0,0,0,0,0,11,@SUMMEGG,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - On spawn/reset - Summon Monstrous Kaliri Egg (object wild)'),
+(@TRIGGER,0,1,2,8,0,100,0,@SKYBLAST,0,0,0,33,@TRIGGER,0,0,0,0,0,16,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - On Skyguard Blasting Charge hit - Give kill credit to invoker party'),
+(@TRIGGER,0,2,3,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,20,@EGG,1,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - Linked with previous event - Despawn'),
+(@TRIGGER,0,3,0,61,0,100,0,0,0,0,0,80,@TRIGGER*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - Linked with previous event - Start script 0'),
+(@TRIGGER*100,9,0,0,0,0,100,0,44000,44000,0,0,11,@SUMMEGG,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger /On actionlist/ - Action 0 - Cast Summon Monstrous Kaliri Egg');
+-- Add SAI for Cannonball Stack
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@EGG;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@EGG;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@EGG,1,0,0,38,0,100,0,0,1,0,0,70,45,0,0,0,0,0,1,0,0,0,0,0,0,0,' Monstrous Kaliri Egg - On data set 0 1 - Respawn object /make it reappear after 45 secs/');
+-- Remove achievement from disabled
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=3922;
+-- Insert GO spawns taken directly from already spawned triggers coordinates = no need to sniff them
+SET @guid := 74685;
+DELETE FROM `gameobject` WHERE `id`=@EGG;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`) VALUES
+(@guid+0,@EGG,530,1,1,-3857.69,3426.25,363.733,-0.087267,180),
+(@guid+1,@EGG,530,1,1,-3845.16,3332.2,338.59,2.9147,180),
+(@guid+2,@EGG,530,1,1,-3965.16,3232.7,347.552,-0.122173,180),
+(@guid+3,@EGG,530,1,1,-3955.86,3222.16,347.503,0.244346,180),
+(@guid+4,@EGG,530,1,1,-3953.3,3227.94,347.564,-0.244346,180),
+(@guid+5,@EGG,530,1,1,-4044.66,3287.29,348.362,0.349066,180),
+(@guid+6,@EGG,530,1,1,-4041.39,3271,346.642,-2.09439,180),
+(@guid+7,@EGG,530,1,1,-4049.31,3285.9,348.335,1.43117,180),
+(@guid+8,@EGG,530,1,1,-4076.99,3415.22,334.008,-2.33874,180),
+(@guid+9,@EGG,530,1,1,-4076.79,3412.91,334.617,-1.0821,180),
+(@guid+10,@EGG,530,1,1,-4077.92,3412.57,334.768,-0.733038,180),
+(@guid+11,@EGG,530,1,1,-4107.93,3121.5,357.427,1.01229,180),
+(@guid+12,@EGG,530,1,1,-4108.31,3123.66,357.633,-0.680679,180),
+(@guid+13,@EGG,530,1,1,-4110.19,3122.64,358.083,-0.034907,180),
+(@guid+14,@EGG,530,1,1,-3996.89,3142.12,372.729,3.05433,180),
+(@guid+15,@EGG,530,1,1,-4109.06,3019.1,352.24,0.261799,180),
+(@guid+16,@EGG,530,1,1,-4018.35,3076.7,375.29,-0.733038,180),
+(@guid+17,@EGG,530,1,1,-4184.98,3044.71,352.394,1.81514,180),
+(@guid+18,@EGG,530,1,1,-4187.52,3040.39,352.071,-0.017453,180),
+(@guid+19,@EGG,530,1,1,-4189.67,3039.9,352.247,-0.785398,180),
+(@guid+20,@EGG,530,1,1,-4192.61,3045.1,352.096,3.14159,180),
+(@guid+21,@EGG,530,1,1,-4192.02,3046.91,352.297,2.46091,180),
+(@guid+22,@EGG,530,1,1,-4186.47,3047.19,352.316,2.60054,180),
+(@guid+23,@EGG,530,1,1,-3915.67,2983.4,396.957,-1.91986,180),
+(@guid+24,@EGG,530,1,1,-3883.21,3004.11,399.738,-1.64061,180),
+(@guid+25,@EGG,530,1,1,-3883.26,3001.55,399.431,-2.3911,180),
+(@guid+26,@EGG,530,1,1,-3884.29,3003.3,400.063,-1.88496,180),
+(@guid+27,@EGG,530,1,1,-3903.02,3095.85,383.783,-2.28638,180),
+(@guid+28,@EGG,530,1,1,-3898.45,3093.06,383.667,2.53073,180),
+(@guid+29,@EGG,530,1,1,-3900.75,3100.75,383.795,-0.436333,180),
+(@guid+30,@EGG,530,1,1,-4107.81,3023.42,352.142,1.06465,180),
+(@guid+31,@EGG,530,1,1,-4113.58,3022.4,352.157,-0.645772,180),
+(@guid+32,@EGG,530,1,1,-3893.09,3677.17,374.516,-1.23918,180),
+(@guid+33,@EGG,530,1,1,-3892.47,3674,374.478,-2.14675,180),
+(@guid+34,@EGG,530,1,1,-4198.53,3168.91,355.847,-0.383972,180),
+(@guid+35,@EGG,530,1,1,-4197.01,3170.04,356.117,-1.15192,180),
+(@guid+36,@EGG,530,1,1,-4196.54,3167.69,356.348,-0.541052,180),
+(@guid+37,@EGG,530,1,1,-4020.07,3077.84,374.391,1.53589,180),
+(@guid+38,@EGG,530,1,1,-4019.32,3079.74,375.109,-1.25664,180),
+(@guid+39,@EGG,530,1,1,-3917.21,2981.62,396.483,0.733038,180),
+(@guid+40,@EGG,530,1,1,-3918.45,2982.44,397.24,-1.72788,180),
+(@guid+41,@EGG,530,1,1,-3839.35,3344.85,337.834,2.75762,180),
+(@guid+42,@EGG,530,1,1,-3835.3,3344.77,338.155,-0.767945,180),
+(@guid+43,@EGG,530,1,1,-3846.43,3430.29,363.729,0.488692,180),
+(@guid+44,@EGG,530,1,1,-3864.13,3439.06,363.679,-0.05236,180),
+(@guid+45,@EGG,530,1,1,-3863.24,3440.42,363.655,0.349066,180),
+(@guid+46,@EGG,530,1,1,-3846.35,3439.34,363.628,-0.122173,180),
+(@guid+47,@EGG,530,1,1,-3847.32,3441.39,363.648,0.453786,180),
+(@guid+48,@EGG,530,1,1,-3686.21,3301,320.513,0.837758,180),
+(@guid+49,@EGG,530,1,1,-3687.77,3299.85,320.307,2.75762,180),
+(@guid+50,@EGG,530,1,1,-3692.64,3302.07,320.396,-0.226893,180),
+(@guid+51,@EGG,530,1,1,-3661.91,3379.15,320.377,0.890118,180),
+(@guid+52,@EGG,530,1,1,-3660.65,3381.9,320.182,1.18682,180),
+(@guid+53,@EGG,530,1,1,-3665.48,3380.11,320.365,-0.471239,180),
+(@guid+54,@EGG,530,1,1,-3685.07,3305.97,320.198,-2.87979,180),
+(@guid+55,@EGG,530,1,1,-3688.3,3308.93,320.337,1.65806,180),
+(@guid+56,@EGG,530,1,1,-3690.65,3306.77,320.43,-2.79253,180),
+(@guid+57,@EGG,530,1,1,-3879.37,3665.22,374.393,-2.30383,180),
+(@guid+58,@EGG,530,1,1,-3990.42,3139.13,372.878,-2.61799,180),
+(@guid+59,@EGG,530,1,1,-3991.59,3134.33,372.703,-0.017453,180),
+(@guid+60,@EGG,530,1,1,-3884.89,3684.98,374.492,-2.53073,180),
+(@guid+61,@EGG,530,1,1,-3800.8,3789.62,314,6.0912,180),
+(@guid+62,@EGG,530,1,1,-3799.02,3788.06,314.158,3.19395,180),
+(@guid+63,@EGG,530,1,1,-3798.91,3790.61,313.852,3.63029,180);
diff --git a/sql/old/3.3.5a/2012_09_13_01_world_ogrila.sql b/sql/old/3.3.5a/2012_09_13_01_world_ogrila.sql
new file mode 100644
index 00000000000..4ccb02e02e5
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_13_01_world_ogrila.sql
@@ -0,0 +1,158 @@
+-- Quest support for http://www.wowhead.com/quest=11010 "Bombing Run", http://www.wowhead.com/quest=11102 "Bombing Run" /druid/ and http://www.wowhead.com/quest=11023 "Bomb Them Again!"
+-- Achievement support for http://www.wowhead.com/achievement=1282 and http://www.wowhead.com/achievement=1276,
+-- Based on Warpten Script
+SET @SKYGUARD_BOMB := 32456;
+SET @Run_Dummy := 23118;
+SET @Explosion_Bunny := 23119;
+SET @Flak_Cannon := 23076;
+SET @Flak_Cannon2 := 23082;
+SET @Fel_Cannon_Dummy := 23077;
+SET @RUN_MARK := 40196;
+SET @THROW_BOMB := 40160;
+SET @EXPLOSION_VISUAL := 40162;
+SET @See_Invisibility := 40195;
+SET @Invisibility := 40194;
+SET @CANNONBALL_STACK := 185861;
+-- Add class requirements for druid version of "Bombing Run"
+UPDATE `quest_template` SET `RequiredClasses`=1024 WHERE `Id`=11102;
+-- Add SAI support for Bombing Run Target Dummy
+UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|128 WHERE `entry`=@Run_Dummy;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@Run_Dummy;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Run_Dummy;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Run_Dummy*100;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Run_Dummy,0,0,1,8,0,100,0,@THROW_BOMB,0,1000,1000,33,@Run_Dummy,0,0,0,0,0,16,0,0,0,0,0,0,0, 'Run Target Dummy - On spell Throw Bomb hit - Give kill credit to invoker party'),
+(@Run_Dummy,0,1,2,61,0,100,0,0,0,0,0,28,@RUN_MARK,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Run Target Dummy - Linked with previous event - Remove auras from hunter mark'),
+(@Run_Dummy,0,2,3,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,20,@CANNONBALL_STACK,3,0,0,0,0,0, 'Run Target Dummy - Linked with previous event - Data set 0 1 on Cannonball Stack'),
+(@Run_Dummy,0,3,4,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,@Explosion_Bunny,3,0,0,0,0,0, 'Run Target Dummy - Linked with previous event - Data set 0 1 on Explosion Bunny'),
+(@Run_Dummy,0,4,0,61,0,100,0,0,0,0,0,80,@Run_Dummy*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Run Target Dummy - Linked with previous event - Start script 0'),
+(@Run_Dummy*100,9,0,0,0,0,100,0,29000,29000,0,0,11,@RUN_MARK,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Run Target Dummy - Action 0 - Cast run mark on self');
+-- Add SAI for Cannonball Stack
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@CANNONBALL_STACK;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@CANNONBALL_STACK;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@CANNONBALL_STACK,1,0,0,38,0,100,0,0,1,0,0,70,30,0,0,0,0,0,1,0,0,0,0,0,0,0,' Cannonball Stack - On data set 0 1 - Respawn object /make it reappear after 30 secs/');
+-- Add SAI support for Bombing Run Fel Cannon Dummy
+UPDATE `creature_template` SET `AIName`='SmartAI',`unit_flags`=4,`flags_extra`=`flags_extra`|128 WHERE `entry`=@Fel_Cannon_Dummy;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Fel_Cannon_Dummy;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Fel_Cannon_Dummy,0,0,0,8,0,100,0,40110,0,4350,5000,11,40119,0,0,0,0,0,19,@Flak_Cannon,5,0,0,0,0,0, 'Fel Cannon Dummy - On spell hit by Cannon trigger - Cast Aggro Burst on Flak Cannon');
+-- Add SAI support for Bombing Run Flak Cannon
+UPDATE `creature_template` SET `AIName`='SmartAI',`unit_flags`=`unit_flags`|4|256|131072,`flags_extra`=`flags_extra`|2 WHERE `entry`=@Flak_Cannon;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Flak_Cannon;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Flak_Cannon,0,0,0,25,0,100,0,0,0,0,0,11,40111,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Flak Cannon - On reset - Cast The Aggro Bunnies'),
+(@Flak_Cannon,0,1,2,8,0,100,0,41598,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Flak Cannon - On hit by Bolt Pair - Set orientation to invoker'),
+(@Flak_Cannon,0,2,0,61,0,100,0,0,0,0,0,11,40109,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Flak Cannon - Linked with previous event - Cast spell The Bolt');
+-- Add SAI support for Bombing Run Flak Cannon 2 /target bunny/
+UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|128,`InhabitType`=4 WHERE `entry`=@Flak_Cannon2;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Flak_Cannon2;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Flak_Cannon2,0,0,0,54,0,100,0,0,0,0,0,11,41598,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Flak Cannon 2 - On just summoned - Cast The Bolt Pair on invoker'),
+(@Flak_Cannon2,0,1,2,8,0,100,0,40109,0,0,0,11,40075,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Flak Cannon 2 - On spell hit Cannon Bolt - Cast on self Fel Flak Fire'),
+(@Flak_Cannon2,0,2,0,61,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Flak Cannon 2 - Linked with previous event - Despawn in 5 sec');
+-- Add SAI support for Explosion Bunny
+UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=`flags_extra`|128,`unit_flags`=0 WHERE `entry`=@Explosion_Bunny;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Explosion_Bunny;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Explosion_Bunny,0,0,0,38,0,100,0,0,1,0,0,11,@EXPLOSION_VISUAL,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Explosion Bunny - On data set 0 1 - Cast Explosion Visual on self');
+-- Add conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (@THROW_BOMB,40110,40112,40075);
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (@THROW_BOMB,40200,41598,40111);
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@Fel_Cannon_Dummy;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`Comment`) VALUES
+(17,0,@THROW_BOMB,0,29,0,@Run_Dummy,35,0,0,0,'Throw Bomb requires Run Target Dummy within 35y'),
+(13,1,@THROW_BOMB,0,31,0,3,@Run_Dummy,0,0,0,'Throw Bomb implicit effect 0 can hit only Run Target Dummy'),
+(13,1,@THROW_BOMB,0,1,0,@RUN_MARK,0,0,0,0,'Throw Bomb can hit only targets under the aura of 40196'),
+(17,0,40200,0,9,0,11010,0,0,1,0,'To cast remove see invisibility player must not be on quest 11010'),
+(17,0,40200,0,9,0,11102,0,0,1,0,'To cast remove see invisibility player must not be on quest 11102'),
+(17,0,40200,0,9,0,11023,0,0,1,0,'To cast remove see invisibility player must not be on quest 11023'),
+(13,1,40110,0,31,0,3,23077,0,0,0,'Cannon Trigger implicit targets can be only Fel Cannon Dummies'),
+(13,1,40110,0,35,0,1,65,2,0,0,'Cannon Trigger implicit hit can happen only on targets under 65 yards range'),
+(17,0,40111,0,29,0,@Fel_Cannon_Dummy,10,0,1,0,'The Aggro Bunnies caster should not be around Fel Cannon Dummies to cast'),
+(13,1,40112,0,31,0,4,0,0,0,0,'Bombing Run Dummy aggro check can hit players'),
+(13,3,40075,0,31,0,4,0,0,0,0,'Fel Flak Fire effect 2 can hit only players'),
+(22,1,@Fel_Cannon_Dummy,0,1,1,40119,0,0,1,0,'Fel Cannon Dummy event 0 will happen only if target is missing aura from aggro burst');
+-- Insert addon data
+DELETE FROM `creature_template_addon` WHERE `entry` IN (@Run_Dummy,@Explosion_Bunny,@Fel_Cannon_Dummy);
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@Run_Dummy,0,0,0,0,'40196 40194 40195'), -- Mark, See Invisibility, Invisibility
+(@Explosion_Bunny,0,0,0,0,'40194 40195'), -- See Invisibility, Invisibility
+(@Fel_Cannon_Dummy,0,0,0,0,'40113'); -- The Aggro Check Aura
+-- Remove achievement from disabled
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=3923;
+-- Add missing spell from dbc
+DELETE FROM `spell_dbc` WHERE `Id`=40200;
+INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES
+(40200,0,0,256,0,0,0,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,26,1,0,-1,0,0,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,'Bombing Run: See Invisibility Aura Remover');
+-- Spell area - Check to cast remove aura /against see invisibility aura/, if having it and not on quest
+DELETE FROM `spell_area` WHERE `spell`=40200;
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(40200,3522,0,0,0,@See_Invisibility,0,2,1);
+-- Insert cannonballs spawns /based on sniffs/
+SET @guid := 14811;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @guid+0 AND @guid+13;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@guid+0,@CANNONBALL_STACK,530,1,1,2825.11,7024.05,369.982,5.69617,0,0,0.289313,-0.957235,300,0,1),
+(@guid+1,@CANNONBALL_STACK,530,1,1,2938.26,7094.72,369.413,2.78314,0,0,0.983982,0.178267,300,0,1),
+(@guid+2,@CANNONBALL_STACK,530,1,1,2924.84,7031.46,367.857,4.26205,0,0,0.847134,-0.53138,300,0,1),
+(@guid+3,@CANNONBALL_STACK,530,1,1,2938.02,7015.59,365.75,3.65778,0,0,0.966879,-0.255237,300,0,1),
+(@guid+4,@CANNONBALL_STACK,530,1,1,2998.57,7043.55,368.539,5.91266,0,0,0.184206,-0.982888,300,0,1),
+(@guid+5,@CANNONBALL_STACK,530,1,1,2982,7054.94,368.32,4.99766,0,0,0.599411,-0.800442,300,0,1),
+(@guid+6,@CANNONBALL_STACK,530,1,1,2978.73,6889.19,369.701,0.689745,0,0,0.338077,0.941119,300,0,1),
+(@guid+7,@CANNONBALL_STACK,530,1,1,2941.56,6827.17,367.3,4.08109,0,0,0.891683,-0.452661,300,0,1),
+(@guid+8,@CANNONBALL_STACK,530,1,1,2953.55,6859.3,369.954,6.14433,0,0,0.0693712,-0.997591,300,0,1),
+(@guid+9,@CANNONBALL_STACK,530,1,1,3023.13,6799.74,374.46,1.58666,0,0,0.712695,0.701474,300,0,1),
+(@guid+10,@CANNONBALL_STACK,530,1,1,3028.3,6824.84,373.591,5.0275,0,0,0.587401,-0.809296,300,0,1),
+(@guid+11,@CANNONBALL_STACK,530,1,1,3022.15,6859.05,369.546,3.44885,0,0,0.988222,-0.153025,300,0,1),
+(@guid+12,@CANNONBALL_STACK,530,1,1,3016.28,6876.11,370.188,3.47791,0,0,0.985895,-0.167365,300,0,1),
+(@guid+13,@CANNONBALL_STACK,530,1,1,2940.6,7106.65,370.123,0.88561,0,0,0.428475,0.903553,300,0,1);
+-- Insert spawns for Fel Flak Cannons, Run Target Dummies and Explosion Bunnies /based on sniffs/
+SET @guid := 85656;
+DELETE FROM `creature` WHERE `guid` BETWEEN @guid+0 AND @guid+44;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
+(@guid+0,23118,530,1,1,0,0,2764.71,7024.45,370.203,0,300,0,0,42,0,0,0,33554432,0),
+(@guid+1,23119,530,1,1,0,0,2764.71,7024.45,370.203,0,300,0,0,6986,0,0,0,33554432,0),
+(@guid+2,23118,530,1,1,0,0,2786.61,7036.28,370.686,0,300,0,0,42,0,0,0,33554432,0),
+(@guid+3,23119,530,1,1,0,0,2786.61,7036.28,370.686,0,300,0,0,6986,0,0,0,33554432,0),
+(@guid+4,23118,530,1,1,0,0,2824.71,7044.79,369.877,0,300,0,0,42,0,0,0,33554432,0),
+(@guid+5,23119,530,1,1,0,0,2824.71,7044.79,369.877,0,300,0,0,6986,0,0,0,33554432,0),
+(@guid+6,23076,530,1,1,0,0,2775.81,7030.75,370.337,1.85606,300,0,0,22140,0,0,0,0,0),
+(@guid+7,23076,530,1,1,0,0,2933.28,7103.93,369.209,2.58129,300,0,0,21543,0,0,0,0,0),
+(@guid+8,23119,530,1,1,0,0,2940.82,7107.17,370.115,4.65944,300,0,0,6986,0,0,0,33554432,0),
+(@guid+9,23118,530,1,1,0,0,2940.82,7107.17,370.115,4.65944,300,0,0,42,0,0,0,33554432,0),
+(@guid+10,23118,530,1,1,0,0,2825.11,7024.05,369.982,5.69617,300,0,0,42,0,0,0,33554432,0),
+(@guid+11,23119,530,1,1,0,0,2825.11,7024.05,369.982,5.69617,300,0,0,6986,0,0,0,33554432,0),
+(@guid+12,23076,530,1,1,0,0,2834.14,7018.43,368.459,5.42992,300,0,0,21543,0,0,0,0,0),
+(@guid+13,23119,530,1,1,0,0,2938.84,7094.48,371.493,0.242375,300,0,0,6986,0,0,0,33554432,0),
+(@guid+14,23118,530,1,1,0,0,2938.84,7094.48,371.493,0.242375,300,0,0,42,0,0,0,33554432,0),
+(@guid+15,23076,530,1,1,0,0,2925.49,7021.72,367.007,3.59446,300,0,0,22140,0,0,0,0,0),
+(@guid+16,23119,530,1,1,0,0,2924.84,7031.46,367.857,4.26205,300,0,0,6986,0,0,0,33554432,0),
+(@guid+17,23118,530,1,1,0,0,2924.84,7031.46,367.857,4.26205,300,0,0,42,0,0,0,33554432,0),
+(@guid+18,23119,530,1,1,0,0,2938.02,7015.59,366.54,3.65778,300,0,0,6986,0,0,0,33554432,0),
+(@guid+19,23118,530,1,1,0,0,2938.02,7015.59,366.54,3.65778,300,0,0,42,0,0,0,33554432,0),
+(@guid+20,23076,530,1,1,0,0,2994.48,7039.91,369.42,5.26077,300,0,0,22140,0,0,0,0,0),
+(@guid+21,23119,530,1,1,0,0,2998.57,7043.55,368.539,5.91266,300,0,0,6986,0,0,0,33554432,0),
+(@guid+22,23118,530,1,1,0,0,2998.57,7043.55,368.539,5.91266,300,0,0,42,0,0,0,33554432,0),
+(@guid+23,23119,530,1,1,0,0,2982,7054.94,368.82,4.99766,300,0,0,6986,0,0,0,33554432,0),
+(@guid+24,23118,530,1,1,0,0,2982,7054.94,368.82,4.99766,300,0,0,42,0,0,0,33554432,0),
+(@guid+25,23076,530,1,1,0,0,2982.59,6886.5,370.082,0.831123,300,0,0,22140,0,0,0,0,0),
+(@guid+26,23118,530,1,1,0,0,2978.74,6889.12,371.288,0.897875,300,0,0,42,0,0,0,33554432,0),
+(@guid+27,23119,530,1,1,0,0,2978.74,6889.12,371.288,0.897875,300,0,0,6986,0,0,0,33554432,0),
+(@guid+28,23118,530,1,1,0,0,2941.56,6827.17,367.3,4.54054,300,0,0,42,0,0,0,33554432,0),
+(@guid+29,23119,530,1,1,0,0,2941.56,6827.17,367.3,4.54054,300,0,0,6986,0,0,0,33554432,0),
+(@guid+30,23076,530,1,1,0,0,2938.19,6818.01,366.959,3.31926,300,0,0,21543,0,0,0,0,0),
+(@guid+31,23076,530,1,1,0,0,2946.3,6875.71,370.04,3.2148,300,0,0,22140,0,0,0,0,0),
+(@guid+32,23118,530,1,1,0,0,2953.55,6859.3,369.954,6.14433,300,0,0,42,0,0,0,33554432,0),
+(@guid+33,23119,530,1,1,0,0,2953.55,6859.3,369.954,6.14433,300,0,0,6986,0,0,0,33554432,0),
+(@guid+34,23119,530,1,1,0,0,3023.13,6799.74,374.46,1.58666,300,0,0,6986,0,0,0,33554432,0),
+(@guid+35,23118,530,1,1,0,0,3023.13,6799.74,374.46,1.58666,300,0,0,42,0,0,0,33554432,0),
+(@guid+36,23076,530,1,1,0,0,3028.22,6807.09,374.075,5.94641,300,0,0,22140,0,0,0,0,0),
+(@guid+37,23118,530,1,1,0,0,3028.3,6824.84,373.591,5.0275,300,0,0,42,0,0,0,33554432,0),
+(@guid+38,23119,530,1,1,0,0,3028.3,6824.84,373.591,5.0275,300,0,0,6986,0,0,0,33554432,0),
+(@guid+39,23119,530,1,1,0,0,3022.15,6859.05,369.546,3.44885,300,0,0,6986,0,0,0,33554432,0),
+(@guid+40,23118,530,1,1,0,0,3022.15,6859.05,369.546,3.44885,300,0,0,42,0,0,0,33554432,0),
+(@guid+41,23076,530,1,1,0,0,3022.21,6864.61,369.93,0.100696,300,0,0,22140,0,0,0,0,0),
+(@guid+42,23118,530,1,1,0,0,3016.28,6876.11,370.188,3.47791,300,0,0,42,0,0,0,33554432,0),
+(@guid+43,23119,530,1,1,0,0,3016.28,6876.11,370.188,3.47791,300,0,0,6986,0,0,0,33554432,0),
+(@guid+44,23076,530,1,1,0,0,2816.74,7057.61,369.779,1.4555,300,0,0,21543,0,0,0,0,0);
diff --git a/sql/old/3.3.5a/2012_09_13_01_world_spell_script_name.sql b/sql/old/3.3.5a/2012_09_13_01_world_spell_script_name.sql
new file mode 100644
index 00000000000..61e4067c544
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_13_01_world_spell_script_name.sql
@@ -0,0 +1,14 @@
+-- Add spell script name for Fires Over Skettis and Bombing Run quests
+DELETE FROM `spell_script_names` WHERE `spell_id`=40113;
+DELETE FROM `spell_script_names` WHERE `spell_id`=40160;
+DELETE FROM `spell_script_names` WHERE `spell_id`=39844;
+DELETE FROM `spell_script_names` WHERE `spell_id`=40056;
+DELETE FROM `spell_script_names` WHERE `spell_id`=40112;
+DELETE FROM `spell_script_names` WHERE `spell_id`=40119;
+INSERT INTO `spell_script_names` VALUES
+(39844,'spell_q11010_q11102_q11023_q11008_check_fly_mount'),
+(40160,'spell_q11010_q11102_q11023_q11008_check_fly_mount'),
+(40113,'spell_q11010_q11102_q11023_aggro_check_aura'),
+(40056,'spell_q11010_q11102_q11023_choose_loc'),
+(40112,'spell_q11010_q11102_q11023_aggro_check'),
+(40119,'spell_q11010_q11102_q11023_aggro_burst');
diff --git a/sql/old/3.3.5a/2012_09_13_01_world_spell_target_position.sql b/sql/old/3.3.5a/2012_09_13_01_world_spell_target_position.sql
new file mode 100644
index 00000000000..0879dbbbda0
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_13_01_world_spell_target_position.sql
@@ -0,0 +1,15 @@
+DELETE FROM `spell_target_position` WHERE `id` IN (60323,60324,60325,60326,60327,60328,60329,60330,60331,60332,60333,60334,60335);
+INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES
+(60323,0,-5506.339,-704.348,392.686,0.595), -- Steelgrills Depot
+(60324,0,-9470.760,3.909,49.794,4.802), -- Lions Pride Inn, Goldshire
+(60325,1,-3721.306,-4411.906,25.247,0.831), -- Theramore isle, Dustwallow Marsh
+(60326,0,286.314,-2184.086,122.612,2.271), -- Aerie Peak, The Hinterlands
+(60327,1,6395.708,433.256,33.260,0.566), -- Auberdine, Darkshore
+(60328,0,-14412.923,692.017,22.248,1.231), -- Boote Bay
+(60329,1,-7135.717,-3787.769,8.799,5.992), -- Tanaris, Gadgetzan
+(60330,0,-10336.138,-2934.057,116.723,4.523), -- Swamp of Sorrows, Z coord is intended
+(60331,0,-10446.900,-3261.909,20.179,5.875), -- Stonard, Swamp of Sorrows
+(60332,0,-103.988,-902.795,55.534,5.924), -- Tarren Mill, Hillsbrad Foothils
+(60333,0,1804.836,196.322,70.399,1.572), -- Undercity
+(60334,1,-1060.266,23.137,141.455,5.967), -- Thunder Bluff
+(60335,1,-506.224,-2590.084,113.150,2.445); -- Barrens, The Crossroads
diff --git a/sql/old/3.3.5a/2012_09_13_02_world_trinity_string.sql b/sql/old/3.3.5a/2012_09_13_02_world_trinity_string.sql
new file mode 100644
index 00000000000..f7214ad127b
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_13_02_world_trinity_string.sql
@@ -0,0 +1,12 @@
+DELETE FROM `command` WHERE `name` = 'cheat status';
+INSERT INTO `command` (`name`, `security`, `help`) VALUES
+('cheat status', 2, 'Syntax: .cheat status \n\nShows the cheats you currently have enabled.');
+
+DELETE FROM `trinity_string` WHERE `entry` BETWEEN 357 AND 362;
+INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
+(357, 'Cheat Command Status:'),
+(358, 'Godmode: %s.'),
+(359, 'Casttime: %s.'),
+(360, 'Cooldown: %s.'),
+(361, 'Power: %s.'),
+(362, 'Waterwalk: %s.');
diff --git a/sql/old/3.3.5a/2012_09_14_00_world_creature_template.sql b/sql/old/3.3.5a/2012_09_14_00_world_creature_template.sql
new file mode 100644
index 00000000000..335b92e9af7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_14_00_world_creature_template.sql
@@ -0,0 +1,287 @@
+UPDATE `creature_template` SET `lootid`=18604 WHERE `entry`=17400;
+UPDATE `creature_template` SET `lootid`=18605 WHERE `entry`=17401;
+UPDATE `creature_template` SET `lootid`=19884 WHERE `entry`=17816;
+UPDATE `creature_template` SET `lootid`=19885 WHERE `entry`=17957;
+UPDATE `creature_template` SET `lootid`=19886 WHERE `entry`=17958;
+UPDATE `creature_template` SET `lootid`=19887 WHERE `entry`=17961;
+UPDATE `creature_template` SET `lootid`=19888 WHERE `entry`=17938;
+UPDATE `creature_template` SET `lootid`=19889 WHERE `entry`=17959;
+UPDATE `creature_template` SET `lootid`=19890 WHERE `entry`=17960;
+UPDATE `creature_template` SET `lootid`=19891 WHERE `entry`=17940;
+UPDATE `creature_template` SET `lootid`=19892 WHERE `entry`=17817;
+UPDATE `creature_template` SET `lootid`=19902 WHERE `entry`=17963;
+UPDATE `creature_template` SET `lootid`=19903 WHERE `entry`=17962;
+UPDATE `creature_template` SET `lootid`=19904 WHERE `entry`=17964;
+UPDATE `creature_template` SET `lootid`=20164 WHERE `entry`=17723;
+UPDATE `creature_template` SET `lootid`=20173 WHERE `entry`=17731;
+UPDATE `creature_template` SET `lootid`=20174 WHERE `entry`=19632;
+UPDATE `creature_template` SET `lootid`=20175 WHERE `entry`=17732;
+UPDATE `creature_template` SET `lootid`=20177 WHERE `entry`=17730;
+UPDATE `creature_template` SET `lootid`=20179 WHERE `entry`=17771;
+UPDATE `creature_template` SET `lootid`=20180 WHERE `entry`=17729;
+UPDATE `creature_template` SET `lootid`=20181 WHERE `entry`=17728;
+UPDATE `creature_template` SET `lootid`=20185 WHERE `entry`=17724;
+UPDATE `creature_template` SET `lootid`=20187 WHERE `entry`=17734;
+UPDATE `creature_template` SET `lootid`=20188 WHERE `entry`=17725;
+UPDATE `creature_template` SET `lootid`=20190 WHERE `entry`=17871;
+UPDATE `creature_template` SET `lootid`=20191 WHERE `entry`=17726;
+UPDATE `creature_template` SET `lootid`=20192 WHERE `entry`=17727;
+UPDATE `creature_template` SET `lootid`=20193 WHERE `entry`=17735;
+UPDATE `creature_template` SET `lootid`=20255 WHERE `entry`=18311;
+UPDATE `creature_template` SET `lootid`=20256 WHERE `entry`=18331;
+UPDATE `creature_template` SET `lootid`=20257 WHERE `entry`=18317;
+UPDATE `creature_template` SET `lootid`=20258 WHERE `entry`=18309;
+UPDATE `creature_template` SET `lootid`=20259 WHERE `entry`=18313;
+UPDATE `creature_template` SET `lootid`=20260 WHERE `entry`=18312;
+UPDATE `creature_template` SET `lootid`=20261 WHERE `entry`=18315;
+UPDATE `creature_template` SET `lootid`=20263 WHERE `entry`=19306;
+UPDATE `creature_template` SET `lootid`=20264 WHERE `entry`=18314;
+UPDATE `creature_template` SET `lootid`=20265 WHERE `entry`=19307;
+UPDATE `creature_template` SET `lootid`=20298 WHERE `entry`=18524;
+UPDATE `creature_template` SET `lootid`=20299 WHERE `entry`=18497;
+UPDATE `creature_template` SET `lootid`=20300 WHERE `entry`=18702;
+UPDATE `creature_template` SET `lootid`=20301 WHERE `entry`=18493;
+UPDATE `creature_template` SET `lootid`=20302 WHERE `entry`=18495;
+UPDATE `creature_template` SET `lootid`=20309 WHERE `entry`=18503;
+UPDATE `creature_template` SET `lootid`=20310 WHERE `entry`=18557;
+UPDATE `creature_template` SET `lootid`=20311 WHERE `entry`=18556;
+UPDATE `creature_template` SET `lootid`=20312 WHERE `entry`=18558;
+UPDATE `creature_template` SET `lootid`=20313 WHERE `entry`=18559;
+UPDATE `creature_template` SET `lootid`=20315 WHERE `entry`=18521;
+UPDATE `creature_template` SET `lootid`=20320 WHERE `entry`=18500;
+UPDATE `creature_template` SET `lootid`=20321 WHERE `entry`=18498;
+UPDATE `creature_template` SET `lootid`=20322 WHERE `entry`=18499;
+UPDATE `creature_template` SET `lootid`=20323 WHERE `entry`=18501;
+UPDATE `creature_template` SET `lootid`=20525 WHERE `entry`=18934;
+UPDATE `creature_template` SET `lootid`=20526 WHERE `entry`=17820;
+UPDATE `creature_template` SET `lootid`=20527 WHERE `entry`=17819;
+UPDATE `creature_template` SET `lootid`=20528 WHERE `entry`=17840;
+UPDATE `creature_template` SET `lootid`=20529 WHERE `entry`=17860;
+UPDATE `creature_template` SET `lootid`=20530 WHERE `entry`=17833;
+UPDATE `creature_template` SET `lootid`=20532 WHERE `entry`=18171;
+UPDATE `creature_template` SET `lootid`=20533 WHERE `entry`=18172;
+UPDATE `creature_template` SET `lootid`=20534 WHERE `entry`=18170;
+UPDATE `creature_template` SET `lootid`=20537 WHERE `entry`=17815;
+UPDATE `creature_template` SET `lootid`=20538 WHERE `entry`=17814;
+UPDATE `creature_template` SET `lootid`=20543 WHERE `entry`=17846;
+UPDATE `creature_template` SET `lootid`=20545 WHERE `entry`=18092;
+UPDATE `creature_template` SET `lootid`=20546 WHERE `entry`=18094;
+UPDATE `creature_template` SET `lootid`=20547 WHERE `entry`=18093;
+UPDATE `creature_template` SET `lootid`=20620 WHERE `entry`=17721;
+UPDATE `creature_template` SET `lootid`=20621 WHERE `entry`=17800;
+UPDATE `creature_template` SET `lootid`=20622 WHERE `entry`=17803;
+UPDATE `creature_template` SET `lootid`=20623 WHERE `entry`=17801;
+UPDATE `creature_template` SET `lootid`=20624 WHERE `entry`=17805;
+UPDATE `creature_template` SET `lootid`=20625 WHERE `entry`=17722;
+UPDATE `creature_template` SET `lootid`=20626 WHERE `entry`=17802;
+UPDATE `creature_template` SET `lootid`=20627 WHERE `entry`=17917;
+UPDATE `creature_template` SET `lootid`=20628 WHERE `entry`=17799;
+UPDATE `creature_template` SET `lootid`=20638 WHERE `entry`=18633;
+UPDATE `creature_template` SET `lootid`=20639 WHERE `entry`=18636;
+UPDATE `creature_template` SET `lootid`=20640 WHERE `entry`=18631;
+UPDATE `creature_template` SET `lootid`=20641 WHERE `entry`=18635;
+UPDATE `creature_template` SET `lootid`=20642 WHERE `entry`=18632;
+UPDATE `creature_template` SET `lootid`=20643 WHERE `entry`=18641;
+UPDATE `creature_template` SET `lootid`=20644 WHERE `entry`=18830;
+UPDATE `creature_template` SET `lootid`=20645 WHERE `entry`=18794;
+UPDATE `creature_template` SET `lootid`=20646 WHERE `entry`=18637;
+UPDATE `creature_template` SET `lootid`=20647 WHERE `entry`=18639;
+UPDATE `creature_template` SET `lootid`=20648 WHERE `entry`=18634;
+UPDATE `creature_template` SET `lootid`=20649 WHERE `entry`=18640;
+UPDATE `creature_template` SET `lootid`=20650 WHERE `entry`=18638;
+UPDATE `creature_template` SET `lootid`=20651 WHERE `entry`=18642;
+UPDATE `creature_template` SET `lootid`=20652 WHERE `entry`=18796;
+UPDATE `creature_template` SET `lootid`=20655 WHERE `entry`=18663;
+UPDATE `creature_template` SET `lootid`=20656 WHERE `entry`=18848;
+UPDATE `creature_template` SET `lootid`=20660 WHERE `entry`=19208;
+UPDATE `creature_template` SET `lootid`=20661 WHERE `entry`=19209;
+UPDATE `creature_template` SET `lootid`=20686 WHERE `entry`=19429;
+UPDATE `creature_template` SET `lootid`=20688 WHERE `entry`=19428;
+UPDATE `creature_template` SET `lootid`=20691 WHERE `entry`=18327;
+UPDATE `creature_template` SET `lootid`=20692 WHERE `entry`=18323;
+UPDATE `creature_template` SET `lootid`=20693 WHERE `entry`=18318;
+UPDATE `creature_template` SET `lootid`=20694 WHERE `entry`=18328;
+UPDATE `creature_template` SET `lootid`=20695 WHERE `entry`=18325;
+UPDATE `creature_template` SET `lootid`=20696 WHERE `entry`=18322;
+UPDATE `creature_template` SET `lootid`=20697 WHERE `entry`=18319;
+UPDATE `creature_template` SET `lootid`=20698 WHERE `entry`=18320;
+UPDATE `creature_template` SET `lootid`=20699 WHERE `entry`=18326;
+UPDATE `creature_template` SET `lootid`=20701 WHERE `entry`=18321;
+UPDATE `creature_template` SET `lootid`=20993 WHERE `entry`=20923;
+UPDATE `creature_template` SET `lootid`=21522 WHERE `entry`=19510;
+UPDATE `creature_template` SET `lootid`=21523 WHERE `entry`=20990;
+UPDATE `creature_template` SET `lootid`=21524 WHERE `entry`=19167;
+UPDATE `creature_template` SET `lootid`=21527 WHERE `entry`=19231;
+UPDATE `creature_template` SET `lootid`=21528 WHERE `entry`=19712;
+UPDATE `creature_template` SET `lootid`=21531 WHERE `entry`=19716;
+UPDATE `creature_template` SET `lootid`=21532 WHERE `entry`=19713;
+UPDATE `creature_template` SET `lootid`=21539 WHERE `entry`=19168;
+UPDATE `creature_template` SET `lootid`=21540 WHERE `entry`=20988;
+UPDATE `creature_template` SET `lootid`=21541 WHERE `entry`=20059;
+UPDATE `creature_template` SET `lootid`=21542 WHERE `entry`=19735;
+UPDATE `creature_template` SET `lootid`=21543 WHERE `entry`=19166;
+UPDATE `creature_template` SET `lootid`=21585 WHERE `entry`=20857;
+UPDATE `creature_template` SET `lootid`=21586 WHERE `entry`=20869;
+UPDATE `creature_template` SET `lootid`=21587 WHERE `entry`=20859;
+UPDATE `creature_template` SET `lootid`=21588 WHERE `entry`=20911;
+UPDATE `creature_template` SET `lootid`=21589 WHERE `entry`=20905;
+UPDATE `creature_template` SET `lootid`=21591 WHERE `entry`=20867;
+UPDATE `creature_template` SET `lootid`=21593 WHERE `entry`=20868;
+UPDATE `creature_template` SET `lootid`=21594 WHERE `entry`=20880;
+UPDATE `creature_template` SET `lootid`=21595 WHERE `entry`=20879;
+UPDATE `creature_template` SET `lootid`=21596 WHERE `entry`=20896;
+UPDATE `creature_template` SET `lootid`=21597 WHERE `entry`=20897;
+UPDATE `creature_template` SET `lootid`=21598 WHERE `entry`=20898;
+UPDATE `creature_template` SET `lootid`=21601 WHERE `entry`=20912;
+UPDATE `creature_template` SET `lootid`=21604 WHERE `entry`=20875;
+UPDATE `creature_template` SET `lootid`=21605 WHERE `entry`=20873;
+UPDATE `creature_template` SET `lootid`=21606 WHERE `entry`=20906;
+UPDATE `creature_template` SET `lootid`=21607 WHERE `entry`=20865;
+UPDATE `creature_template` SET `lootid`=21608 WHERE `entry`=20864;
+UPDATE `creature_template` SET `lootid`=21610 WHERE `entry`=20901;
+UPDATE `creature_template` SET `lootid`=21611 WHERE `entry`=20902;
+UPDATE `creature_template` SET `lootid`=21613 WHERE `entry`=20882;
+UPDATE `creature_template` SET `lootid`=21614 WHERE `entry`=20866;
+UPDATE `creature_template` SET `lootid`=21615 WHERE `entry`=20883;
+UPDATE `creature_template` SET `lootid`=21616 WHERE `entry`=20909;
+UPDATE `creature_template` SET `lootid`=21617 WHERE `entry`=20908;
+UPDATE `creature_template` SET `lootid`=21618 WHERE `entry`=20910;
+UPDATE `creature_template` SET `lootid`=21619 WHERE `entry`=20881;
+UPDATE `creature_template` SET `lootid`=21621 WHERE `entry`=20900;
+UPDATE `creature_template` SET `lootid`=21842 WHERE `entry`=21126;
+UPDATE `creature_template` SET `lootid`=21843 WHERE `entry`=21127;
+UPDATE `creature_template` SET `lootid`=21914 WHERE `entry`=21694;
+UPDATE `creature_template` SET `lootid`=21916 WHERE `entry`=21696;
+UPDATE `creature_template` SET `lootid`=21917 WHERE `entry`=21695;
+UPDATE `creature_template` SET `lootid`=21989 WHERE `entry`=21891;
+UPDATE `creature_template` SET `lootid`=21990 WHERE `entry`=21904;
+UPDATE `creature_template` SET `lootid`=22129 WHERE `entry`=22128;
+UPDATE `creature_template` SET `lootid`=22162 WHERE `entry`=18983;
+UPDATE `creature_template` SET `lootid`=22163 WHERE `entry`=17952;
+UPDATE `creature_template` SET `lootid`=22173 WHERE `entry`=18982;
+UPDATE `creature_template` SET `lootid`=22346 WHERE `entry`=21702;
+UPDATE `creature_template` SET `lootid`=22530 WHERE `entry`=13536;
+UPDATE `creature_template` SET `lootid`=22532 WHERE `entry`=13539;
+UPDATE `creature_template` SET `lootid`=22533 WHERE `entry`=13424;
+UPDATE `creature_template` SET `lootid`=22534 WHERE `entry`=13542;
+UPDATE `creature_template` SET `lootid`=22535 WHERE `entry`=13554;
+UPDATE `creature_template` SET `lootid`=22536 WHERE `entry`=13545;
+UPDATE `creature_template` SET `lootid`=22537 WHERE `entry`=13557;
+UPDATE `creature_template` SET `lootid`=22538 WHERE `entry`=13425;
+UPDATE `creature_template` SET `lootid`=22539 WHERE `entry`=13155;
+UPDATE `creature_template` SET `lootid`=22543 WHERE `entry`=14770;
+UPDATE `creature_template` SET `lootid`=22547 WHERE `entry`=14768;
+UPDATE `creature_template` SET `lootid`=22550 WHERE `entry`=13378;
+UPDATE `creature_template` SET `lootid`=22555 WHERE `entry`=603;
+UPDATE `creature_template` SET `lootid`=22565 WHERE `entry`=13377;
+UPDATE `creature_template` SET `lootid`=22576 WHERE `entry`=13416;
+UPDATE `creature_template` SET `lootid`=22578 WHERE `entry`=13151;
+UPDATE `creature_template` SET `lootid`=22579 WHERE `entry`=14767;
+UPDATE `creature_template` SET `lootid`=22587 WHERE `entry`=13526;
+UPDATE `creature_template` SET `lootid`=22592 WHERE `entry`=13530;
+UPDATE `creature_template` SET `lootid`=22595 WHERE `entry`=14769;
+UPDATE `creature_template` SET `lootid`=22607 WHERE `entry`=13527;
+UPDATE `creature_template` SET `lootid`=22612 WHERE `entry`=13531;
+UPDATE `creature_template` SET `lootid`=22613 WHERE `entry`=13140;
+UPDATE `creature_template` SET `lootid`=22614 WHERE `entry`=13319;
+UPDATE `creature_template` SET `lootid`=22615 WHERE `entry`=13320;
+UPDATE `creature_template` SET `lootid`=22616 WHERE `entry`=13154;
+UPDATE `creature_template` SET `lootid`=22617 WHERE `entry`=13152;
+UPDATE `creature_template` SET `lootid`=22618 WHERE `entry`=13318;
+UPDATE `creature_template` SET `lootid`=22619 WHERE `entry`=13153;
+UPDATE `creature_template` SET `lootid`=22620 WHERE `entry`=13139;
+UPDATE `creature_template` SET `lootid`=22621 WHERE `entry`=13446;
+UPDATE `creature_template` SET `lootid`=22623 WHERE `entry`=13597;
+UPDATE `creature_template` SET `lootid`=22624 WHERE `entry`=13357;
+UPDATE `creature_template` SET `lootid`=22628 WHERE `entry`=13841;
+UPDATE `creature_template` SET `lootid`=22634 WHERE `entry`=13598;
+UPDATE `creature_template` SET `lootid`=22635 WHERE `entry`=13356;
+UPDATE `creature_template` SET `lootid`=22639 WHERE `entry`=13449;
+UPDATE `creature_template` SET `lootid`=22640 WHERE `entry`=13840;
+UPDATE `creature_template` SET `lootid`=22645 WHERE `entry`=12048;
+UPDATE `creature_template` SET `lootid`=22649 WHERE `entry`=12052;
+UPDATE `creature_template` SET `lootid`=22657 WHERE `entry`=12047;
+UPDATE `creature_template` SET `lootid`=22662 WHERE `entry`=13325;
+UPDATE `creature_template` SET `lootid`=22663 WHERE `entry`=13327;
+UPDATE `creature_template` SET `lootid`=22664 WHERE `entry`=13330;
+UPDATE `creature_template` SET `lootid`=22667 WHERE `entry`=13335;
+UPDATE `creature_template` SET `lootid`=22668 WHERE `entry`=13336;
+UPDATE `creature_template` SET `lootid`=22669 WHERE `entry`=13337;
+UPDATE `creature_template` SET `lootid`=22671 WHERE `entry`=13426;
+UPDATE `creature_template` SET `lootid`=22672 WHERE `entry`=13427;
+UPDATE `creature_template` SET `lootid`=22673 WHERE `entry`=13428;
+UPDATE `creature_template` SET `lootid`=22676 WHERE `entry`=13528;
+UPDATE `creature_template` SET `lootid`=22679 WHERE `entry`=13440;
+UPDATE `creature_template` SET `lootid`=22687 WHERE `entry`=13324;
+UPDATE `creature_template` SET `lootid`=22688 WHERE `entry`=13329;
+UPDATE `creature_template` SET `lootid`=22689 WHERE `entry`=13524;
+UPDATE `creature_template` SET `lootid`=22691 WHERE `entry`=13576;
+UPDATE `creature_template` SET `lootid`=22700 WHERE `entry`=13298;
+UPDATE `creature_template` SET `lootid`=22701 WHERE `entry`=13145;
+UPDATE `creature_template` SET `lootid`=22702 WHERE `entry`=13296;
+UPDATE `creature_template` SET `lootid`=22703 WHERE `entry`=13147;
+UPDATE `creature_template` SET `lootid`=22704 WHERE `entry`=13299;
+UPDATE `creature_template` SET `lootid`=22705 WHERE `entry`=13300;
+UPDATE `creature_template` SET `lootid`=22706 WHERE `entry`=13146;
+UPDATE `creature_template` SET `lootid`=22707 WHERE `entry`=13137;
+UPDATE `creature_template` SET `lootid`=22708 WHERE `entry`=13138;
+UPDATE `creature_template` SET `lootid`=22709 WHERE `entry`=13297;
+UPDATE `creature_template` SET `lootid`=22710 WHERE `entry`=13143;
+UPDATE `creature_template` SET `lootid`=22711 WHERE `entry`=13144;
+UPDATE `creature_template` SET `lootid`=22713 WHERE `entry`=13525;
+UPDATE `creature_template` SET `lootid`=22718 WHERE `entry`=13529;
+UPDATE `creature_template` SET `lootid`=22719 WHERE `entry`=13333;
+UPDATE `creature_template` SET `lootid`=22725 WHERE `entry`=10984;
+UPDATE `creature_template` SET `lootid`=22736 WHERE `entry`=13776;
+UPDATE `creature_template` SET `lootid`=22754 WHERE `entry`=13537;
+UPDATE `creature_template` SET `lootid`=22759 WHERE `entry`=13777;
+UPDATE `creature_template` SET `lootid`=22764 WHERE `entry`=13676;
+UPDATE `creature_template` SET `lootid`=22765 WHERE `entry`=13618;
+UPDATE `creature_template` SET `lootid`=22768 WHERE `entry`=13150;
+UPDATE `creature_template` SET `lootid`=22769 WHERE `entry`=13149;
+UPDATE `creature_template` SET `lootid`=22774 WHERE `entry`=13541;
+UPDATE `creature_template` SET `lootid`=22776 WHERE `entry`=13544;
+UPDATE `creature_template` SET `lootid`=22788 WHERE `entry`=12156;
+UPDATE `creature_template` SET `lootid`=22789 WHERE `entry`=12158;
+UPDATE `creature_template` SET `lootid`=22790 WHERE `entry`=13956;
+UPDATE `creature_template` SET `lootid`=22791 WHERE `entry`=13958;
+UPDATE `creature_template` SET `lootid`=22792 WHERE `entry`=12157;
+UPDATE `creature_template` SET `lootid`=22794 WHERE `entry`=10983;
+UPDATE `creature_template` SET `lootid`=22795 WHERE `entry`=13957;
+UPDATE `creature_template` SET `lootid`=22796 WHERE `entry`=11679;
+UPDATE `creature_template` SET `lootid`=25548 WHERE `entry`=24976;
+UPDATE `creature_template` SET `lootid`=25551 WHERE `entry`=24698;
+UPDATE `creature_template` SET `lootid`=29274 WHERE `entry`=16506;
+UPDATE `creature_template` SET `lootid`=29833 WHERE `entry`=16156;
+UPDATE `creature_template` SET `lootid`=30759 WHERE `entry`=22262;
+UPDATE `creature_template` SET `lootid`=30760 WHERE `entry`=22261;
+UPDATE `creature_template` SET `lootid`=30761 WHERE `entry`=22263;
+UPDATE `creature_template` SET `lootid`=30763 WHERE `entry`=23174;
+UPDATE `creature_template` SET `lootid`=30773 WHERE `entry`=23386;
+UPDATE `creature_template` SET `lootid`=30822 WHERE `entry`=26690;
+UPDATE `creature_template` SET `lootid`=30823 WHERE `entry`=26691;
+UPDATE `creature_template` SET `lootid`=31178 WHERE `entry`=27729;
+UPDATE `creature_template` SET `lootid`=31179 WHERE `entry`=28249;
+UPDATE `creature_template` SET `lootid`=31180 WHERE `entry`=27732;
+UPDATE `creature_template` SET `lootid`=31184 WHERE `entry`=28200;
+UPDATE `creature_template` SET `lootid`=31187 WHERE `entry`=27734;
+UPDATE `creature_template` SET `lootid`=31188 WHERE `entry`=28199;
+UPDATE `creature_template` SET `lootid`=31199 WHERE `entry`=27736;
+UPDATE `creature_template` SET `lootid`=31200 WHERE `entry`=28201;
+UPDATE `creature_template` SET `lootid`=31201 WHERE `entry`=27731;
+UPDATE `creature_template` SET `lootid`=31202 WHERE `entry`=27742;
+UPDATE `creature_template` SET `lootid`=31203 WHERE `entry`=27744;
+UPDATE `creature_template` SET `lootid`=31206 WHERE `entry`=27743;
+UPDATE `creature_template` SET `lootid`=33391 WHERE `entry`=32915;
+UPDATE `creature_template` SET `lootid`=33773 WHERE `entry`=33772;
+UPDATE `creature_template` SET `lootid`=34106 WHERE `entry`=33432;
+UPDATE `creature_template` SET `lootid`=34108 WHERE `entry`=33651;
+UPDATE `creature_template` SET `lootid`=35306 WHERE `entry`=35305;
+UPDATE `creature_template` SET `lootid`=35308 WHERE `entry`=35307;
+UPDATE `creature_template` SET `lootid`=35310 WHERE `entry`=35309;
+UPDATE `creature_template` SET `lootid`=35359 WHERE `entry`=35143;
+UPDATE `creature_template` SET `lootid`=38151 WHERE `entry`=37532;
+UPDATE `creature_template` SET `lootid`=39805 WHERE `entry`=39946;
+UPDATE `creature_template` SET `lootid`=39823 WHERE `entry`=39948;
+UPDATE `creature_template` SET `lootid`=39920 WHERE `entry`=39947;
+UPDATE `creature_template` SET `lootid`=40420 WHERE `entry`=40419;
diff --git a/sql/old/3.3.5a/2012_09_14_00_world_sai.sql b/sql/old/3.3.5a/2012_09_14_00_world_sai.sql
new file mode 100644
index 00000000000..13f11b7a795
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_14_00_world_sai.sql
@@ -0,0 +1 @@
+UPDATE `smart_scripts` SET `event_param1` = 35282, `action_param1` = 256, `comment` = 'Scrapped Fel Reaver - On Spellhit - Remove - OOC Not attackable - flags' WHERE `entryorguid` = 20243;
diff --git a/sql/old/3.3.5a/2012_09_14_01_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_09_14_01_world_creature_loot_template.sql
new file mode 100644
index 00000000000..77ab9e89b04
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_14_01_world_creature_loot_template.sql
@@ -0,0 +1,5 @@
+DELETE FROM `creature_loot_template` WHERE `entry` = 37126;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(37126, 49426, 100, 1, 0, 1, 1),
+(37126, 1, 100, 1, 0, -100002, 1);
+UPDATE `creature_template` SET `lootid` = 37126 WHERE `entry` IN (37126,38258);
diff --git a/sql/old/3.3.5a/2012_09_15_00_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_09_15_00_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..a30eff7024e
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_15_00_world_achievement_criteria_data.sql
@@ -0,0 +1,6 @@
+-- Insert achievement instance criteria data scripts
+DELETE FROM `achievement_criteria_data` WHERE `type`=11 and `criteria_id` IN (7323,7324,7325);
+INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
+(7323,11,0,0,'achievement_ruby_void'),
+(7324,11,0,0,'achievement_emerald_void'),
+(7325,11,0,0,'achievement_amber_void');
diff --git a/sql/old/3.3.5a/2012_09_15_00_world_creature_template.sql b/sql/old/3.3.5a/2012_09_15_00_world_creature_template.sql
new file mode 100644
index 00000000000..3db5a598c1d
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_15_00_world_creature_template.sql
@@ -0,0 +1,288 @@
+UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (17400,17401,17816,17957,17958,17961,17938,17959,17960,17940,17817,17963,17962,17964,17723,17731,19632,17732,17730,17771,17729,17728,17724,17734,17725,17871,17726,17727,17735,18311,18331,18317,18309,18313,18312,18315,19306,18314,19307,18524,18497,18702,18493,18495,18503,18557,18556,18558,18559,18521,18500,18498,18499,18501,18934,17820,17819,17840,17860,17833,18171,18172,18170,17815,17814,17846,18092,18094,18093,17721,17800,17803,17801,17805,17722,17802,17917,17799,18633,18636,18631,18635,18632,18641,18830,18794,18637,18639,18634,18640,18638,18642,18796,18663,18848,19208,19209,19429,19428,18327,18323,18318,18328,18325,18322,18319,18320,18326,18321,20923,19510,20990,19167,19231,19712,19716,19713,19168,20988,20059,19735,19166,20857,20869,20859,20911,20905,20867,20868,20880,20879,20896,20897,20898,20912,20875,20873,20906,20865,20864,20901,20902,20882,20866,20883,20909,20908,20910,20881,20900,21126,21127,21694,21696,21695,21891,21904,22128,18983,17952,18982,21702,13536,13539,13424,13542,13554,13545,13557,13425,13155,14770,14768,13378,603,13377,13416,13151,14767,13526,13530,14769,13527,13531,13140,13319,13320,13154,13152,13318,13153,13139,13446,13597,13357,13841,13598,13356,13449,13840,12048,12052,12047,13325,13327,13330,13335,13336,13337,13426,13427,13428,13528,13440,13324,13329,13524,13576,13298,13145,13296,13147,13299,13300,13146,13137,13138,13297,13143,13144,13525,13529,13333,10984,13776,13537,13777,13676,13618,13150,13149,13541,13544,12156,12158,13956,13958,12157,10983,13957,11679,24976,24698,16506,16156,22262,22261,22263,23174,23386,26690,26691,27729,28249,27732,28200,27734,28199,27736,28201,27731,27742,27744,27743,32915,33772,33432,33651,35305,35307,35309,35143,37532,39946,39948,39947,40419);
+UPDATE `creature_template` SET `lootid`=17400 WHERE `entry`=18604;
+UPDATE `creature_template` SET `lootid`=17401 WHERE `entry`=18605;
+UPDATE `creature_template` SET `lootid`=17816 WHERE `entry`=19884;
+UPDATE `creature_template` SET `lootid`=17957 WHERE `entry`=19885;
+UPDATE `creature_template` SET `lootid`=17958 WHERE `entry`=19886;
+UPDATE `creature_template` SET `lootid`=17961 WHERE `entry`=19887;
+UPDATE `creature_template` SET `lootid`=17938 WHERE `entry`=19888;
+UPDATE `creature_template` SET `lootid`=17959 WHERE `entry`=19889;
+UPDATE `creature_template` SET `lootid`=17960 WHERE `entry`=19890;
+UPDATE `creature_template` SET `lootid`=17940 WHERE `entry`=19891;
+UPDATE `creature_template` SET `lootid`=17817 WHERE `entry`=19892;
+UPDATE `creature_template` SET `lootid`=17963 WHERE `entry`=19902;
+UPDATE `creature_template` SET `lootid`=17962 WHERE `entry`=19903;
+UPDATE `creature_template` SET `lootid`=17964 WHERE `entry`=19904;
+UPDATE `creature_template` SET `lootid`=17723 WHERE `entry`=20164;
+UPDATE `creature_template` SET `lootid`=17731 WHERE `entry`=20173;
+UPDATE `creature_template` SET `lootid`=19632 WHERE `entry`=20174;
+UPDATE `creature_template` SET `lootid`=17732 WHERE `entry`=20175;
+UPDATE `creature_template` SET `lootid`=17730 WHERE `entry`=20177;
+UPDATE `creature_template` SET `lootid`=17771 WHERE `entry`=20179;
+UPDATE `creature_template` SET `lootid`=17729 WHERE `entry`=20180;
+UPDATE `creature_template` SET `lootid`=17728 WHERE `entry`=20181;
+UPDATE `creature_template` SET `lootid`=17724 WHERE `entry`=20185;
+UPDATE `creature_template` SET `lootid`=17734 WHERE `entry`=20187;
+UPDATE `creature_template` SET `lootid`=17725 WHERE `entry`=20188;
+UPDATE `creature_template` SET `lootid`=17871 WHERE `entry`=20190;
+UPDATE `creature_template` SET `lootid`=17726 WHERE `entry`=20191;
+UPDATE `creature_template` SET `lootid`=17727 WHERE `entry`=20192;
+UPDATE `creature_template` SET `lootid`=17735 WHERE `entry`=20193;
+UPDATE `creature_template` SET `lootid`=18311 WHERE `entry`=20255;
+UPDATE `creature_template` SET `lootid`=18331 WHERE `entry`=20256;
+UPDATE `creature_template` SET `lootid`=18317 WHERE `entry`=20257;
+UPDATE `creature_template` SET `lootid`=18309 WHERE `entry`=20258;
+UPDATE `creature_template` SET `lootid`=18313 WHERE `entry`=20259;
+UPDATE `creature_template` SET `lootid`=18312 WHERE `entry`=20260;
+UPDATE `creature_template` SET `lootid`=18315 WHERE `entry`=20261;
+UPDATE `creature_template` SET `lootid`=19306 WHERE `entry`=20263;
+UPDATE `creature_template` SET `lootid`=18314 WHERE `entry`=20264;
+UPDATE `creature_template` SET `lootid`=19307 WHERE `entry`=20265;
+UPDATE `creature_template` SET `lootid`=18524 WHERE `entry`=20298;
+UPDATE `creature_template` SET `lootid`=18497 WHERE `entry`=20299;
+UPDATE `creature_template` SET `lootid`=18702 WHERE `entry`=20300;
+UPDATE `creature_template` SET `lootid`=18493 WHERE `entry`=20301;
+UPDATE `creature_template` SET `lootid`=18495 WHERE `entry`=20302;
+UPDATE `creature_template` SET `lootid`=18503 WHERE `entry`=20309;
+UPDATE `creature_template` SET `lootid`=18557 WHERE `entry`=20310;
+UPDATE `creature_template` SET `lootid`=18556 WHERE `entry`=20311;
+UPDATE `creature_template` SET `lootid`=18558 WHERE `entry`=20312;
+UPDATE `creature_template` SET `lootid`=18559 WHERE `entry`=20313;
+UPDATE `creature_template` SET `lootid`=18521 WHERE `entry`=20315;
+UPDATE `creature_template` SET `lootid`=18500 WHERE `entry`=20320;
+UPDATE `creature_template` SET `lootid`=18498 WHERE `entry`=20321;
+UPDATE `creature_template` SET `lootid`=18499 WHERE `entry`=20322;
+UPDATE `creature_template` SET `lootid`=18501 WHERE `entry`=20323;
+UPDATE `creature_template` SET `lootid`=18934 WHERE `entry`=20525;
+UPDATE `creature_template` SET `lootid`=17820 WHERE `entry`=20526;
+UPDATE `creature_template` SET `lootid`=17819 WHERE `entry`=20527;
+UPDATE `creature_template` SET `lootid`=17840 WHERE `entry`=20528;
+UPDATE `creature_template` SET `lootid`=17860 WHERE `entry`=20529;
+UPDATE `creature_template` SET `lootid`=17833 WHERE `entry`=20530;
+UPDATE `creature_template` SET `lootid`=18171 WHERE `entry`=20532;
+UPDATE `creature_template` SET `lootid`=18172 WHERE `entry`=20533;
+UPDATE `creature_template` SET `lootid`=18170 WHERE `entry`=20534;
+UPDATE `creature_template` SET `lootid`=17815 WHERE `entry`=20537;
+UPDATE `creature_template` SET `lootid`=17814 WHERE `entry`=20538;
+UPDATE `creature_template` SET `lootid`=17846 WHERE `entry`=20543;
+UPDATE `creature_template` SET `lootid`=18092 WHERE `entry`=20545;
+UPDATE `creature_template` SET `lootid`=18094 WHERE `entry`=20546;
+UPDATE `creature_template` SET `lootid`=18093 WHERE `entry`=20547;
+UPDATE `creature_template` SET `lootid`=17721 WHERE `entry`=20620;
+UPDATE `creature_template` SET `lootid`=17800 WHERE `entry`=20621;
+UPDATE `creature_template` SET `lootid`=17803 WHERE `entry`=20622;
+UPDATE `creature_template` SET `lootid`=17801 WHERE `entry`=20623;
+UPDATE `creature_template` SET `lootid`=17805 WHERE `entry`=20624;
+UPDATE `creature_template` SET `lootid`=17722 WHERE `entry`=20625;
+UPDATE `creature_template` SET `lootid`=17802 WHERE `entry`=20626;
+UPDATE `creature_template` SET `lootid`=17917 WHERE `entry`=20627;
+UPDATE `creature_template` SET `lootid`=17799 WHERE `entry`=20628;
+UPDATE `creature_template` SET `lootid`=18633 WHERE `entry`=20638;
+UPDATE `creature_template` SET `lootid`=18636 WHERE `entry`=20639;
+UPDATE `creature_template` SET `lootid`=18631 WHERE `entry`=20640;
+UPDATE `creature_template` SET `lootid`=18635 WHERE `entry`=20641;
+UPDATE `creature_template` SET `lootid`=18632 WHERE `entry`=20642;
+UPDATE `creature_template` SET `lootid`=18641 WHERE `entry`=20643;
+UPDATE `creature_template` SET `lootid`=18830 WHERE `entry`=20644;
+UPDATE `creature_template` SET `lootid`=18794 WHERE `entry`=20645;
+UPDATE `creature_template` SET `lootid`=18637 WHERE `entry`=20646;
+UPDATE `creature_template` SET `lootid`=18639 WHERE `entry`=20647;
+UPDATE `creature_template` SET `lootid`=18634 WHERE `entry`=20648;
+UPDATE `creature_template` SET `lootid`=18640 WHERE `entry`=20649;
+UPDATE `creature_template` SET `lootid`=18638 WHERE `entry`=20650;
+UPDATE `creature_template` SET `lootid`=18642 WHERE `entry`=20651;
+UPDATE `creature_template` SET `lootid`=18796 WHERE `entry`=20652;
+UPDATE `creature_template` SET `lootid`=18663 WHERE `entry`=20655;
+UPDATE `creature_template` SET `lootid`=18848 WHERE `entry`=20656;
+UPDATE `creature_template` SET `lootid`=19208 WHERE `entry`=20660;
+UPDATE `creature_template` SET `lootid`=19209 WHERE `entry`=20661;
+UPDATE `creature_template` SET `lootid`=19429 WHERE `entry`=20686;
+UPDATE `creature_template` SET `lootid`=19428 WHERE `entry`=20688;
+UPDATE `creature_template` SET `lootid`=18327 WHERE `entry`=20691;
+UPDATE `creature_template` SET `lootid`=18323 WHERE `entry`=20692;
+UPDATE `creature_template` SET `lootid`=18318 WHERE `entry`=20693;
+UPDATE `creature_template` SET `lootid`=18328 WHERE `entry`=20694;
+UPDATE `creature_template` SET `lootid`=18325 WHERE `entry`=20695;
+UPDATE `creature_template` SET `lootid`=18322 WHERE `entry`=20696;
+UPDATE `creature_template` SET `lootid`=18319 WHERE `entry`=20697;
+UPDATE `creature_template` SET `lootid`=18320 WHERE `entry`=20698;
+UPDATE `creature_template` SET `lootid`=18326 WHERE `entry`=20699;
+UPDATE `creature_template` SET `lootid`=18321 WHERE `entry`=20701;
+UPDATE `creature_template` SET `lootid`=20923 WHERE `entry`=20993;
+UPDATE `creature_template` SET `lootid`=19510 WHERE `entry`=21522;
+UPDATE `creature_template` SET `lootid`=20990 WHERE `entry`=21523;
+UPDATE `creature_template` SET `lootid`=19167 WHERE `entry`=21524;
+UPDATE `creature_template` SET `lootid`=19231 WHERE `entry`=21527;
+UPDATE `creature_template` SET `lootid`=19712 WHERE `entry`=21528;
+UPDATE `creature_template` SET `lootid`=19716 WHERE `entry`=21531;
+UPDATE `creature_template` SET `lootid`=19713 WHERE `entry`=21532;
+UPDATE `creature_template` SET `lootid`=19168 WHERE `entry`=21539;
+UPDATE `creature_template` SET `lootid`=20988 WHERE `entry`=21540;
+UPDATE `creature_template` SET `lootid`=20059 WHERE `entry`=21541;
+UPDATE `creature_template` SET `lootid`=19735 WHERE `entry`=21542;
+UPDATE `creature_template` SET `lootid`=19166 WHERE `entry`=21543;
+UPDATE `creature_template` SET `lootid`=20857 WHERE `entry`=21585;
+UPDATE `creature_template` SET `lootid`=20869 WHERE `entry`=21586;
+UPDATE `creature_template` SET `lootid`=20859 WHERE `entry`=21587;
+UPDATE `creature_template` SET `lootid`=20911 WHERE `entry`=21588;
+UPDATE `creature_template` SET `lootid`=20905 WHERE `entry`=21589;
+UPDATE `creature_template` SET `lootid`=20867 WHERE `entry`=21591;
+UPDATE `creature_template` SET `lootid`=20868 WHERE `entry`=21593;
+UPDATE `creature_template` SET `lootid`=20880 WHERE `entry`=21594;
+UPDATE `creature_template` SET `lootid`=20879 WHERE `entry`=21595;
+UPDATE `creature_template` SET `lootid`=20896 WHERE `entry`=21596;
+UPDATE `creature_template` SET `lootid`=20897 WHERE `entry`=21597;
+UPDATE `creature_template` SET `lootid`=20898 WHERE `entry`=21598;
+UPDATE `creature_template` SET `lootid`=20912 WHERE `entry`=21601;
+UPDATE `creature_template` SET `lootid`=20875 WHERE `entry`=21604;
+UPDATE `creature_template` SET `lootid`=20873 WHERE `entry`=21605;
+UPDATE `creature_template` SET `lootid`=20906 WHERE `entry`=21606;
+UPDATE `creature_template` SET `lootid`=20865 WHERE `entry`=21607;
+UPDATE `creature_template` SET `lootid`=20864 WHERE `entry`=21608;
+UPDATE `creature_template` SET `lootid`=20901 WHERE `entry`=21610;
+UPDATE `creature_template` SET `lootid`=20902 WHERE `entry`=21611;
+UPDATE `creature_template` SET `lootid`=20882 WHERE `entry`=21613;
+UPDATE `creature_template` SET `lootid`=20866 WHERE `entry`=21614;
+UPDATE `creature_template` SET `lootid`=20883 WHERE `entry`=21615;
+UPDATE `creature_template` SET `lootid`=20909 WHERE `entry`=21616;
+UPDATE `creature_template` SET `lootid`=20908 WHERE `entry`=21617;
+UPDATE `creature_template` SET `lootid`=20910 WHERE `entry`=21618;
+UPDATE `creature_template` SET `lootid`=20881 WHERE `entry`=21619;
+UPDATE `creature_template` SET `lootid`=20900 WHERE `entry`=21621;
+UPDATE `creature_template` SET `lootid`=21126 WHERE `entry`=21842;
+UPDATE `creature_template` SET `lootid`=21127 WHERE `entry`=21843;
+UPDATE `creature_template` SET `lootid`=21694 WHERE `entry`=21914;
+UPDATE `creature_template` SET `lootid`=21696 WHERE `entry`=21916;
+UPDATE `creature_template` SET `lootid`=21695 WHERE `entry`=21917;
+UPDATE `creature_template` SET `lootid`=21891 WHERE `entry`=21989;
+UPDATE `creature_template` SET `lootid`=21904 WHERE `entry`=21990;
+UPDATE `creature_template` SET `lootid`=22128 WHERE `entry`=22129;
+UPDATE `creature_template` SET `lootid`=18983 WHERE `entry`=22162;
+UPDATE `creature_template` SET `lootid`=17952 WHERE `entry`=22163;
+UPDATE `creature_template` SET `lootid`=18982 WHERE `entry`=22173;
+UPDATE `creature_template` SET `lootid`=21702 WHERE `entry`=22346;
+UPDATE `creature_template` SET `lootid`=13536 WHERE `entry`=22530;
+UPDATE `creature_template` SET `lootid`=13539 WHERE `entry`=22532;
+UPDATE `creature_template` SET `lootid`=13424 WHERE `entry`=22533;
+UPDATE `creature_template` SET `lootid`=13542 WHERE `entry`=22534;
+UPDATE `creature_template` SET `lootid`=13554 WHERE `entry`=22535;
+UPDATE `creature_template` SET `lootid`=13545 WHERE `entry`=22536;
+UPDATE `creature_template` SET `lootid`=13557 WHERE `entry`=22537;
+UPDATE `creature_template` SET `lootid`=13425 WHERE `entry`=22538;
+UPDATE `creature_template` SET `lootid`=13155 WHERE `entry`=22539;
+UPDATE `creature_template` SET `lootid`=14770 WHERE `entry`=22543;
+UPDATE `creature_template` SET `lootid`=14768 WHERE `entry`=22547;
+UPDATE `creature_template` SET `lootid`=13378 WHERE `entry`=22550;
+UPDATE `creature_template` SET `lootid`=603 WHERE `entry`=22555;
+UPDATE `creature_template` SET `lootid`=13377 WHERE `entry`=22565;
+UPDATE `creature_template` SET `lootid`=13416 WHERE `entry`=22576;
+UPDATE `creature_template` SET `lootid`=13151 WHERE `entry`=22578;
+UPDATE `creature_template` SET `lootid`=14767 WHERE `entry`=22579;
+UPDATE `creature_template` SET `lootid`=13526 WHERE `entry`=22587;
+UPDATE `creature_template` SET `lootid`=13530 WHERE `entry`=22592;
+UPDATE `creature_template` SET `lootid`=14769 WHERE `entry`=22595;
+UPDATE `creature_template` SET `lootid`=13527 WHERE `entry`=22607;
+UPDATE `creature_template` SET `lootid`=13531 WHERE `entry`=22612;
+UPDATE `creature_template` SET `lootid`=13140 WHERE `entry`=22613;
+UPDATE `creature_template` SET `lootid`=13319 WHERE `entry`=22614;
+UPDATE `creature_template` SET `lootid`=13320 WHERE `entry`=22615;
+UPDATE `creature_template` SET `lootid`=13154 WHERE `entry`=22616;
+UPDATE `creature_template` SET `lootid`=13152 WHERE `entry`=22617;
+UPDATE `creature_template` SET `lootid`=13318 WHERE `entry`=22618;
+UPDATE `creature_template` SET `lootid`=13153 WHERE `entry`=22619;
+UPDATE `creature_template` SET `lootid`=13139 WHERE `entry`=22620;
+UPDATE `creature_template` SET `lootid`=13446 WHERE `entry`=22621;
+UPDATE `creature_template` SET `lootid`=13597 WHERE `entry`=22623;
+UPDATE `creature_template` SET `lootid`=13357 WHERE `entry`=22624;
+UPDATE `creature_template` SET `lootid`=13841 WHERE `entry`=22628;
+UPDATE `creature_template` SET `lootid`=13598 WHERE `entry`=22634;
+UPDATE `creature_template` SET `lootid`=13356 WHERE `entry`=22635;
+UPDATE `creature_template` SET `lootid`=13449 WHERE `entry`=22639;
+UPDATE `creature_template` SET `lootid`=13840 WHERE `entry`=22640;
+UPDATE `creature_template` SET `lootid`=12048 WHERE `entry`=22645;
+UPDATE `creature_template` SET `lootid`=12052 WHERE `entry`=22649;
+UPDATE `creature_template` SET `lootid`=12047 WHERE `entry`=22657;
+UPDATE `creature_template` SET `lootid`=13325 WHERE `entry`=22662;
+UPDATE `creature_template` SET `lootid`=13327 WHERE `entry`=22663;
+UPDATE `creature_template` SET `lootid`=13330 WHERE `entry`=22664;
+UPDATE `creature_template` SET `lootid`=13335 WHERE `entry`=22667;
+UPDATE `creature_template` SET `lootid`=13336 WHERE `entry`=22668;
+UPDATE `creature_template` SET `lootid`=13337 WHERE `entry`=22669;
+UPDATE `creature_template` SET `lootid`=13426 WHERE `entry`=22671;
+UPDATE `creature_template` SET `lootid`=13427 WHERE `entry`=22672;
+UPDATE `creature_template` SET `lootid`=13428 WHERE `entry`=22673;
+UPDATE `creature_template` SET `lootid`=13528 WHERE `entry`=22676;
+UPDATE `creature_template` SET `lootid`=13440 WHERE `entry`=22679;
+UPDATE `creature_template` SET `lootid`=13324 WHERE `entry`=22687;
+UPDATE `creature_template` SET `lootid`=13329 WHERE `entry`=22688;
+UPDATE `creature_template` SET `lootid`=13524 WHERE `entry`=22689;
+UPDATE `creature_template` SET `lootid`=13576 WHERE `entry`=22691;
+UPDATE `creature_template` SET `lootid`=13298 WHERE `entry`=22700;
+UPDATE `creature_template` SET `lootid`=13145 WHERE `entry`=22701;
+UPDATE `creature_template` SET `lootid`=13296 WHERE `entry`=22702;
+UPDATE `creature_template` SET `lootid`=13147 WHERE `entry`=22703;
+UPDATE `creature_template` SET `lootid`=13299 WHERE `entry`=22704;
+UPDATE `creature_template` SET `lootid`=13300 WHERE `entry`=22705;
+UPDATE `creature_template` SET `lootid`=13146 WHERE `entry`=22706;
+UPDATE `creature_template` SET `lootid`=13137 WHERE `entry`=22707;
+UPDATE `creature_template` SET `lootid`=13138 WHERE `entry`=22708;
+UPDATE `creature_template` SET `lootid`=13297 WHERE `entry`=22709;
+UPDATE `creature_template` SET `lootid`=13143 WHERE `entry`=22710;
+UPDATE `creature_template` SET `lootid`=13144 WHERE `entry`=22711;
+UPDATE `creature_template` SET `lootid`=13525 WHERE `entry`=22713;
+UPDATE `creature_template` SET `lootid`=13529 WHERE `entry`=22718;
+UPDATE `creature_template` SET `lootid`=13333 WHERE `entry`=22719;
+UPDATE `creature_template` SET `lootid`=10984 WHERE `entry`=22725;
+UPDATE `creature_template` SET `lootid`=13776 WHERE `entry`=22736;
+UPDATE `creature_template` SET `lootid`=13537 WHERE `entry`=22754;
+UPDATE `creature_template` SET `lootid`=13777 WHERE `entry`=22759;
+UPDATE `creature_template` SET `lootid`=13676 WHERE `entry`=22764;
+UPDATE `creature_template` SET `lootid`=13618 WHERE `entry`=22765;
+UPDATE `creature_template` SET `lootid`=13150 WHERE `entry`=22768;
+UPDATE `creature_template` SET `lootid`=13149 WHERE `entry`=22769;
+UPDATE `creature_template` SET `lootid`=13541 WHERE `entry`=22774;
+UPDATE `creature_template` SET `lootid`=13544 WHERE `entry`=22776;
+UPDATE `creature_template` SET `lootid`=12156 WHERE `entry`=22788;
+UPDATE `creature_template` SET `lootid`=12158 WHERE `entry`=22789;
+UPDATE `creature_template` SET `lootid`=13956 WHERE `entry`=22790;
+UPDATE `creature_template` SET `lootid`=13958 WHERE `entry`=22791;
+UPDATE `creature_template` SET `lootid`=12157 WHERE `entry`=22792;
+UPDATE `creature_template` SET `lootid`=10983 WHERE `entry`=22794;
+UPDATE `creature_template` SET `lootid`=13957 WHERE `entry`=22795;
+UPDATE `creature_template` SET `lootid`=11679 WHERE `entry`=22796;
+UPDATE `creature_template` SET `lootid`=24976 WHERE `entry`=25548;
+UPDATE `creature_template` SET `lootid`=24698 WHERE `entry`=25551;
+UPDATE `creature_template` SET `lootid`=16506 WHERE `entry`=29274;
+UPDATE `creature_template` SET `lootid`=16156 WHERE `entry`=29833;
+UPDATE `creature_template` SET `lootid`=22262 WHERE `entry`=30759;
+UPDATE `creature_template` SET `lootid`=22261 WHERE `entry`=30760;
+UPDATE `creature_template` SET `lootid`=22263 WHERE `entry`=30761;
+UPDATE `creature_template` SET `lootid`=23174 WHERE `entry`=30763;
+UPDATE `creature_template` SET `lootid`=23386 WHERE `entry`=30773;
+UPDATE `creature_template` SET `lootid`=26690 WHERE `entry`=30822;
+UPDATE `creature_template` SET `lootid`=26691 WHERE `entry`=30823;
+UPDATE `creature_template` SET `lootid`=27729 WHERE `entry`=31178;
+UPDATE `creature_template` SET `lootid`=28249 WHERE `entry`=31179;
+UPDATE `creature_template` SET `lootid`=27732 WHERE `entry`=31180;
+UPDATE `creature_template` SET `lootid`=28200 WHERE `entry`=31184;
+UPDATE `creature_template` SET `lootid`=27734 WHERE `entry`=31187;
+UPDATE `creature_template` SET `lootid`=28199 WHERE `entry`=31188;
+UPDATE `creature_template` SET `lootid`=27736 WHERE `entry`=31199;
+UPDATE `creature_template` SET `lootid`=28201 WHERE `entry`=31200;
+UPDATE `creature_template` SET `lootid`=27731 WHERE `entry`=31201;
+UPDATE `creature_template` SET `lootid`=27742 WHERE `entry`=31202;
+UPDATE `creature_template` SET `lootid`=27744 WHERE `entry`=31203;
+UPDATE `creature_template` SET `lootid`=27743 WHERE `entry`=31206;
+UPDATE `creature_template` SET `lootid`=32915 WHERE `entry`=33391;
+UPDATE `creature_template` SET `lootid`=33772 WHERE `entry`=33773;
+UPDATE `creature_template` SET `lootid`=33432 WHERE `entry`=34106;
+UPDATE `creature_template` SET `lootid`=33651 WHERE `entry`=34108;
+UPDATE `creature_template` SET `lootid`=35305 WHERE `entry`=35306;
+UPDATE `creature_template` SET `lootid`=35307 WHERE `entry`=35308;
+UPDATE `creature_template` SET `lootid`=35309 WHERE `entry`=35310;
+UPDATE `creature_template` SET `lootid`=35143 WHERE `entry`=35359;
+UPDATE `creature_template` SET `lootid`=37532 WHERE `entry`=38151;
+UPDATE `creature_template` SET `lootid`=39946 WHERE `entry`=39805;
+UPDATE `creature_template` SET `lootid`=39948 WHERE `entry`=39823;
+UPDATE `creature_template` SET `lootid`=39947 WHERE `entry`=39920;
+UPDATE `creature_template` SET `lootid`=40419 WHERE `entry`=40420;
diff --git a/sql/old/3.3.5a/2012_09_15_00_world_disables.sql b/sql/old/3.3.5a/2012_09_15_00_world_disables.sql
new file mode 100644
index 00000000000..371315b5be7
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_15_00_world_disables.sql
@@ -0,0 +1,4 @@
+-- Remove achievements from disables
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=7323; -- Ruby Void
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=7324; -- Emerald Void
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=7325; -- Amber Void
diff --git a/sql/old/3.3.5a/2012_09_15_01_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_09_15_01_world_creature_loot_template.sql
new file mode 100644
index 00000000000..71068d95bde
--- /dev/null
+++ b/sql/old/3.3.5a/2012_09_15_01_world_creature_loot_template.sql
@@ -0,0 +1,19 @@
+SET @SisterSvalna := 37126; -- Sister Svalna
+
+CALL `sp_get_ref_id`('RAID_CRE',@Reference);
+SET @RefSisterSvalna := @Reference+1;
+
+DELETE FROM `creature_loot_template` WHERE `entry`=@SisterSvalna;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(@SisterSvalna,49426,100,1,0,1,1),-- Sister Svalna dropping 1 Emblem of Frost
+(@SisterSvalna,1,100,1,0,-@RefSisterSvalna,1);
+
+DELETE FROM `reference_loot_template` WHERE `entry`=@RefSisterSvalna;
+INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(@RefSisterSvalna,50452,6,1,1,1,1), -- Wodin's Lucky Necklace
+(@RefSisterSvalna,50453,5,1,1,1,1); -- Ring of Rotting Sinew
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup`=@RefSisterSvalna;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(10,@RefSisterSvalna,50452,0,0,19,0,3,0,0,0,0,'', 'Wodin''s Lucky Necklace only 25 heroic'),
+(10,@RefSisterSvalna,50453,0,0,19,0,3,0,0,0,0,'', 'Ring of Rotting Sinew only 25 heroic');
diff --git a/sql/updates/world/2012_09_16_00_world_version.sql b/sql/updates/world/2012_09_16_00_world_version.sql
new file mode 100644
index 00000000000..74a1cf67499
--- /dev/null
+++ b/sql/updates/world/2012_09_16_00_world_version.sql
@@ -0,0 +1 @@
+UPDATE `version` SET `db_version`='TDB 335.49', `cache_id`=49 LIMIT 1;
diff --git a/sql/updates/world/2012_09_16_01_world_conditions.sql b/sql/updates/world/2012_09_16_01_world_conditions.sql
new file mode 100644
index 00000000000..64f87262d0e
--- /dev/null
+++ b/sql/updates/world/2012_09_16_01_world_conditions.sql
@@ -0,0 +1,4 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup`=34379;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(10,34379,50452,0,0,19,0,8,0,0,0,0,'', 'Wodin''s Lucky Necklace only 25 heroic'),
+(10,34379,50453,0,0,19,0,8,0,0,0,0,'', 'Ring of Rotting Sinew only 25 heroic');
diff --git a/sql/updates/world/2012_09_16_01_world_creature_loot_template.sql b/sql/updates/world/2012_09_16_01_world_creature_loot_template.sql
new file mode 100644
index 00000000000..2d87ad3aa16
--- /dev/null
+++ b/sql/updates/world/2012_09_16_01_world_creature_loot_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_loot_template` SET `item`=39657 WHERE `entry`=28546 AND `item`=36657;
diff --git a/sql/updates/world/2012_09_16_01_world_creature_template_addon.sql b/sql/updates/world/2012_09_16_01_world_creature_template_addon.sql
new file mode 100644
index 00000000000..15415e856f3
--- /dev/null
+++ b/sql/updates/world/2012_09_16_01_world_creature_template_addon.sql
@@ -0,0 +1,3 @@
+DELETE FROM `creature_template_addon` WHERE `entry`=28670; -- Frostbrood Vanquisher
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(28670,0,0,0x3000000,0x1,0,'53112');
diff --git a/sql/updates/world/2012_09_16_02_world_fires_over_skettis.sql b/sql/updates/world/2012_09_16_02_world_fires_over_skettis.sql
new file mode 100644
index 00000000000..d50f45bb020
--- /dev/null
+++ b/sql/updates/world/2012_09_16_02_world_fires_over_skettis.sql
@@ -0,0 +1,26 @@
+-- Add support for quest ID: 11008 - "Fires Over Skettis" Warpten fix and Nelegalno/shlomi1515 updates
+-- Also add support for achievement - http://www.wowhead.com/achievement=1275/bombs-away
+-- Fix previous SQL what is not changed is not included
+SET @TRIGGER := 22991;
+SET @EGG := 185549;
+SET @SKYBLAST := 39844;
+SET @SUMMEGG := 39843;
+-- Adds SAI support for Monstrous Kaliri Egg Trigger and the GO
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@TRIGGER;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@TRIGGER AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@TRIGGER*100 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@TRIGGER,0,0,0,25,0,100,0,0,0,0,0,11,@SUMMEGG,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - On spawn/reset - Summon Monstrous Kaliri Egg (object wild)'),
+(@TRIGGER,0,1,2,8,0,100,0,@SKYBLAST,0,0,0,33,@TRIGGER,0,0,0,0,0,16,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - On Skyguard Blasting Charge hit - Give kill credit to invoker party'),
+(@TRIGGER,0,2,0,61,0,100,0,0,0,0,0,80,@TRIGGER*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger - Linked with previous event - Start script 0'),
+(@TRIGGER*100,9,0,0,0,0,100,0,44000,44000,0,0,11,@SUMMEGG,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Monstrous Kaliri Egg Trigger /On actionlist/ - Action 0 - Cast Summon Monstrous Kaliri Egg');
+-- Add conditions (thanks to Vincent-Michael for adding and Shauren for noticing my failure miss)
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SKYBLAST;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,@SKYBLAST,0,0,31,0,3,22991,0,0,0,'','Skyguard Blasting Charge can hit only Monstrous Kaliri Egg Trigger'),
+(13,2,@SKYBLAST,0,0,31,0,5,185549,0,0,0,'','Skyguard Blasting can hit only Monstrous Kaliri Egg');
+-- Remove SAI for Cannonball Stack
+UPDATE `gameobject_template` SET `AIName`='' WHERE `entry`=@EGG;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@EGG AND `source_type`=1;
+-- Delete GO spawns that are not needed
+DELETE FROM `gameobject` WHERE `id`=@EGG;
diff --git a/sql/updates/world/2012_09_16_03_world_spell_script_names.sql b/sql/updates/world/2012_09_16_03_world_spell_script_names.sql
new file mode 100644
index 00000000000..8b7e6aa92ba
--- /dev/null
+++ b/sql/updates/world/2012_09_16_03_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM spell_script_names WHERE scriptName="spell_dru_savage_roar";
+INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
+(52610, 'spell_dru_savage_roar');
diff --git a/sql/updates/world/2012_09_17_00_world_spell_bonus_data.sql b/sql/updates/world/2012_09_17_00_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..0d16742393e
--- /dev/null
+++ b/sql/updates/world/2012_09_17_00_world_spell_bonus_data.sql
@@ -0,0 +1,4 @@
+DELETE FROM spell_bonus_data WHERE entry IN (33778,33763);
+INSERT INTO spell_bonus_data (entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus, comments) VALUES
+(33778, 0, 0, 0, 0, 'Druid - Lifebloom final heal'),
+(33763, 0.516, 0.0952, 0, 0, 'Druid - Lifebloom HoT(rank 1)');
diff --git a/sql/updates/world/2012_09_17_01_world_spell_bonus_data.sql b/sql/updates/world/2012_09_17_01_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..f9283233c8e
--- /dev/null
+++ b/sql/updates/world/2012_09_17_01_world_spell_bonus_data.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_bonus_data` WHERE `entry` = 61840;
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`, `dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(61840, 0, 0, 0, 0, 'No bonus for Righteous Vengance DoT');
diff --git a/sql/updates/world/2012_09_17_01_world_spell_script_names.sql b/sql/updates/world/2012_09_17_01_world_spell_script_names.sql
new file mode 100644
index 00000000000..255c76e6b70
--- /dev/null
+++ b/sql/updates/world/2012_09_17_01_world_spell_script_names.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (48492,48494,48495);
+DELETE FROM `spell_script_names` WHERE `spell_id` IN(-5217, -5229);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-5217, "spell_dru_tiger_s_fury"),
+(-5229, "spell_dru_enrage");
diff --git a/sql/updates/world/2012_09_17_02_world_misc.sql b/sql/updates/world/2012_09_17_02_world_misc.sql
new file mode 100644
index 00000000000..0b6a3b2237c
--- /dev/null
+++ b/sql/updates/world/2012_09_17_02_world_misc.sql
@@ -0,0 +1,320 @@
+-- The Call to Command (6144, 6145, 6146, 14349, 14350) quest chain fix by nelegalno
+-- The first 2 quests in the chain ware replaced with new ones after the removal of Varimathras (2425) but players that completed
+-- the old quests shouldn't get the new ones and the third quest Nathanos' Ruse (6146) should require 6145 or 14350 completed
+
+-- The Call to Command ExclusiveGroup
+UPDATE `quest_template` SET `ExclusiveGroup` = 6144 WHERE `Id` = 6144; -- The Call to Command (6144) quest
+UPDATE `quest_template` SET `ExclusiveGroup` = 6144 WHERE `Id` = 14349; -- The Call to Command (14349) quest
+
+-- You should be able to take the quest from Varimathras (2425) or Lady Sylvanas Windrunner (10181) [proof http://old.wowhead.com/quest=6145]
+DELETE FROM `creature_questrelation` WHERE `quest` = 6145;
+INSERT INTO `creature_questrelation` (`id`,`quest`) VALUES (2425, 6145);
+INSERT INTO `creature_questrelation` (`id`,`quest`) VALUES (10181, 6145);
+
+-- The Crimson Courier ExclusiveGroup
+UPDATE `quest_template` SET `ExclusiveGroup` = 6145 WHERE `Id` = 6145; -- The Crimson Courier (6145) quest
+UPDATE `quest_template` SET `ExclusiveGroup` = 6145 WHERE `Id` = 14350; -- The Crimson Courier (14350) quest
+
+-- Nathanos' Ruse PrevQuestId conditions
+UPDATE `quest_template` SET `PrevQuestId` = 0 WHERE `Id` = 6146;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry`=6146;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(19,0,6146,0,1,8,0, 6145,0,0,0,0,'',"Nathanos' Ruse requires quest The Crimson Courier (6145)"),
+(19,0,6146,0,2,8,0,14350,0,0,0,0,'',"Nathanos' Ruse requires quest The Crimson Courier (14350)");
+
+
+-- The Scarlet Oracle, Demetria (6148) quest fix by nelegalno
+-- TODO: NPC must spawn when the quest is acepted
+SET @ID := 12339;
+SET @GUID := 42575; -- set by TDB team
+
+DELETE FROM `creature` WHERE `id`=@ID;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
+(@GUID,@ID,0,1,1,0,0,1567.16,-5611,114.19,1.084,900,0,1,26412,35250,2,0,0,0);
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@ID;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@ID,@ID,0,0,0,0,'');
+
+DELETE FROM `waypoint_data` WHERE `id`=@ID;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@ID,1,1567.42,-5610.38,114.189,0,0,0,0,100,0),
+(@ID,2,1564.17,-5609.18,114.183,0,0,0,0,100,0),
+(@ID,3,1566.34,-5605.47,114.183,0,0,0,0,100,0),
+(@ID,4,1569.38,-5606.32,114.188,0,0,0,0,100,0),
+(@ID,5,1573.89,-5597.87,111.171,0,0,0,0,100,0),
+(@ID,6,1578.76,-5588.57,111.171,0,0,0,0,100,0),
+(@ID,7,1585.31,-5576.2,111.171,0,0,0,0,100,0),
+(@ID,8,1594.85,-5557.49,111.171,0,0,0,0,100,0),
+(@ID,9,1603.55,-5557.01,111.171,0,0,0,0,100,0),
+(@ID,10,1610.81,-5541.87,111.171,0,0,0,0,100,0),
+(@ID,11,1604.87,-5538.01,111.171,0,0,0,0,100,0),
+(@ID,12,1612.66,-5523.97,111.147,0,0,0,0,100,0),
+(@ID,13,1618.32,-5514.03,107.117,0,0,0,0,100,0),
+(@ID,14,1627.73,-5496.36,100.729,0,0,0,0,100,0),
+(@ID,15,1633,-5484.04,100.729,0,0,0,0,100,0),
+(@ID,16,1638.35,-5469.5,98.6581,0,0,0,0,100,0),
+(@ID,17,1645.41,-5450.02,92.1866,0,0,0,0,100,0),
+(@ID,18,1652.78,-5430.76,84.4578,0,0,0,0,100,0),
+(@ID,19,1657.93,-5416.62,79.8772,0,0,0,0,100,0),
+(@ID,20,1661.83,-5406.66,76.2934,0,0,0,0,100,0),
+(@ID,21,1669.8,-5383.78,73.6196,0,0,0,0,100,0),
+(@ID,22,1677.99,-5358.84,73.6117,0,0,0,0,100,0),
+(@ID,23,1695.25,-5350.09,73.6118,0,0,0,0,100,0),
+(@ID,24,1687.04,-5321.94,73.6112,0,0,0,0,100,0),
+(@ID,25,1688.58,-5304.51,73.6112,0,0,0,0,100,0),
+(@ID,26,1691,-5283.65,73.6122,0,0,0,0,100,0),
+(@ID,27,1691.91,-5262.08,73.6113,0,0,0,0,100,0),
+(@ID,28,1692.66,-5241.1,73.6185,0,0,0,0,100,0),
+(@ID,29,1692.85,-5206.13,74.6546,0,0,0,0,100,0),
+(@ID,30,1690.64,-5185.28,73.9301,0,0,0,0,100,0),
+(@ID,31,1688.08,-5167.96,73.9937,0,0,0,0,100,0),
+(@ID,32,1690.38,-5149.03,74.0396,0,0,0,0,100,0),
+(@ID,33,1697.51,-5118.86,73.6245,0,0,0,0,100,0),
+(@ID,34,1704.67,-5099.13,74.6873,0,0,0,0,100,0),
+(@ID,35,1711.01,-5080.54,77.301,0,0,0,0,100,0),
+(@ID,36,1718.55,-5057.22,80.1628,0,0,0,0,100,0),
+(@ID,37,1730.24,-5032.73,80.6236,0,0,0,0,100,0),
+(@ID,38,1742.91,-5011.79,79.9012,0,0,0,0,100,0),
+(@ID,39,1754.95,-4994.6,80.643,0,0,0,0,100,0),
+(@ID,40,1766.67,-4977.18,81.2274,0,0,0,0,100,0),
+(@ID,41,1773.03,-4950.42,81.449,0,0,0,0,100,0),
+(@ID,42,1777.47,-4922.77,81.5212,0,0,0,0,100,0),
+(@ID,43,1782.09,-4902.3,84.2517,0,0,0,0,100,0),
+(@ID,44,1788.34,-4877.56,87.4965,0,0,0,0,100,0),
+(@ID,45,1796.57,-4845.8,89.4469,0,0,0,0,100,0),
+(@ID,46,1809.45,-4798.58,91.0304,0,0,0,0,100,0),
+(@ID,47,1816.93,-4777.84,90.0115,0,0,0,0,100,0),
+(@ID,48,1831.75,-4734.83,90.0915,0,0,0,0,100,0),
+(@ID,49,1862.63,-4701.05,93.0158,0,0,0,0,100,0),
+(@ID,50,1889.08,-4684.05,92.355,0,0,0,0,100,0),
+(@ID,51,1910.74,-4672.59,91.1087,0,0,0,0,100,0),
+(@ID,52,1927.94,-4658.95,87.5957,0,0,0,0,100,0),
+(@ID,53,1935.76,-4647.33,84.3063,0,0,0,0,100,0),
+(@ID,54,1944.66,-4632.27,79.9795,0,0,0,0,100,0),
+(@ID,55,1954.98,-4609.24,74.7545,0,0,0,0,100,0),
+(@ID,56,1958.16,-4599.23,73.7161,0,0,0,0,100,0),
+(@ID,57,1968.46,-4572.57,73.6229,0,0,0,0,100,0),
+(@ID,58,1979.44,-4555.29,73.6229,0,0,0,0,100,0),
+(@ID,59,1984,-4549.99,73.6229,0,0,0,0,100,0),
+(@ID,60,1996.94,-4538.24,73.6229,0,0,0,0,100,0),
+(@ID,61,2005.36,-4531.97,73.6229,0,0,0,0,100,0),
+(@ID,62,2016.76,-4523.84,73.6213,0,0,0,0,100,0),
+(@ID,63,2027.83,-4517.97,73.6213,0,0,0,0,100,0),
+(@ID,64,2045.28,-4518.38,73.6213,0,0,0,0,100,0),
+(@ID,65,2061.31,-4534.8,73.6213,0,0,0,0,100,0),
+(@ID,66,2086.08,-4561.88,73.6213,0,0,0,0,100,0),
+(@ID,67,2105.32,-4580.45,73.6238,0,0,0,0,100,0),
+(@ID,68,2121.3,-4594.16,73.6238,0,0,0,0,100,0),
+(@ID,69,2146.73,-4612.71,73.6218,0,0,0,0,100,0),
+(@ID,70,2177.86,-4627.43,73.6067,0,0,0,0,100,0),
+(@ID,71,2197.77,-4633.93,73.6226,0,0,0,0,100,0),
+(@ID,72,2219.97,-4633.96,73.6226,0,0,0,0,100,0),
+(@ID,73,2250.74,-4627.66,73.6226,0,0,0,0,100,0),
+(@ID,74,2274.12,-4620.36,73.6226,0,0,0,0,100,0),
+(@ID,75,2304.25,-4611.22,73.6227,0,0,0,0,100,0),
+(@ID,76,2338.64,-4604.74,73.6227,0,0,0,0,100,0),
+(@ID,77,2389.36,-4603.99,73.6227,0,0,0,0,100,0),
+(@ID,78,2457.27,-4631.39,74.092,0,0,0,0,100,0),
+(@ID,79,2493.9,-4652.17,75.2848,0,0,0,0,100,0),
+(@ID,80,2535.82,-4654.52,77.3071,0,0,0,0,100,0),
+(@ID,81,2567.1,-4644.61,79.4072,0,0,0,0,100,0),
+(@ID,82,2594.36,-4628.84,81.876,0,0,0,0,100,0),
+(@ID,83,2617.07,-4615.06,84.1387,0,0,0,0,100,0),
+(@ID,84,2689.76,-4571.94,87.2045,0,0,0,0,100,0),
+(@ID,85,2745.8,-4539.07,88.764,0,0,0,0,100,0),
+(@ID,86,2839.33,-4436.83,89.7157,0,0,0,0,100,0),
+(@ID,87,2880.41,-4361.54,90.2576,0,0,0,0,100,0),
+(@ID,88,2923.76,-4110.16,96.3698,0,0,0,0,100,0),
+(@ID,89,2947.2,-4033.15,99.8002,0,0,0,0,100,0),
+(@ID,90,2968.64,-3982.02,104.423,0,0,0,0,100,0),
+(@ID,91,2976.9,-3964.26,107.058,0,0,0,0,100,0),
+(@ID,92,2983.54,-3937.96,111.717,0,0,0,0,100,0),
+(@ID,93,3000.21,-3877.74,118.93,0,0,0,0,100,0),
+(@ID,94,3011.92,-3842.22,119.306,0,0,0,0,100,0),
+(@ID,95,3021.88,-3813.28,118.955,0,0,0,0,100,0),
+(@ID,96,3028.71,-3797.17,120.17,0,0,0,0,100,0),
+(@ID,97,3042.19,-3764.47,119.971,0,0,0,0,100,0),
+(@ID,98,3057.23,-3724.98,119.568,0,0,0,0,100,0),
+(@ID,99,3062.31,-3690.16,121.125,0,0,0,0,100,0),
+(@ID,100,3048.16,-3659.65,122.811,0,0,0,0,100,0),
+(@ID,101,3041.49,-3641.07,125.02,0,0,0,0,100,0),
+(@ID,102,3039.91,-3617.72,123.977,0,0,0,0,100,0),
+(@ID,103,3040.67,-3597.35,124.377,0,0,0,0,100,0),
+(@ID,104,3042.45,-3556.22,126.571,0,0,0,0,100,0),
+(@ID,105,3046.02,-3530.23,129.898,0,0,0,0,100,0),
+(@ID,106,3057.06,-3493.26,131.601,0,0,0,0,100,0),
+(@ID,107,3076.38,-3462.24,134.709,0,0,0,0,100,0),
+(@ID,108,3086.02,-3451.18,136,0,0,0,0,100,0),
+(@ID,109,3097.45,-3438.57,136.842,0,0,0,0,100,0),
+(@ID,110,3133.22,-3404.77,139.345,0,0,0,0,100,0),
+(@ID,111,3150.28,-3401.16,140.105,0,0,0,0,100,0),
+(@ID,112,3172.46,-3393.09,142.015,0,0,0,0,100,0),
+(@ID,113,3191.09,-3389.1,143.607,0,0,0,0,100,0),
+(@ID,114,3210.72,-3387.02,144.24,0,0,0,0,100,0),
+(@ID,115,3250.95,-3382.95,143.581,0,0,0,0,100,0),
+(@ID,116,3269.06,-3382.33,143.195,0,0,0,0,100,0),
+(@ID,117,3286.95,-3382.42,142.377,0,0,0,0,100,0),
+(@ID,118,3307.89,-3382.95,144.951,0,0,0,0,100,0),
+(@ID,119,3329.2,-3382.28,144.845,0,0,0,0,100,0),
+(@ID,120,3347.55,-3381.64,144.779,0,0,0,0,100,0),
+(@ID,121,3361.09,-3380.75,144.781,0,0,0,0,100,0),
+(@ID,122,3339.81,-3380.58,144.774,0,0,0,0,100,0),
+(@ID,123,3311.44,-3380.27,145.017,0,0,0,0,100,0),
+(@ID,124,3296.01,-3380.1,143.741,0,0,0,0,100,0),
+(@ID,125,3274.59,-3380.86,142.727,0,0,0,0,100,0),
+(@ID,126,3274.59,-3380.86,142.727,0,0,0,0,100,0),
+(@ID,127,3251.44,-3382.31,143.585,0,0,0,0,100,0),
+(@ID,128,3217.38,-3385.87,144.301,0,0,0,0,100,0),
+(@ID,129,3189.08,-3389.3,143.545,0,0,0,0,100,0),
+(@ID,130,3168.36,-3392.69,141.758,0,0,0,0,100,0),
+(@ID,131,3128.73,-3405.3,139.154,0,0,0,0,100,0),
+(@ID,132,3104.29,-3429.73,137.697,0,0,0,0,100,0),
+(@ID,133,3079.44,-3458.29,135.39,0,0,0,0,100,0),
+(@ID,134,3062.03,-3484.05,132.59,0,0,0,0,100,0),
+(@ID,135,3051.15,-3508.73,131.122,0,0,0,0,100,0),
+(@ID,136,3044.5,-3543.07,128.53,0,0,0,0,100,0),
+(@ID,137,3040.58,-3585.59,124.369,0,0,0,0,100,0),
+(@ID,138,3040.05,-3618.85,124.055,0,0,0,0,100,0),
+(@ID,139,3041.87,-3636.23,125.378,0,0,0,0,100,0),
+(@ID,140,3048.01,-3656.25,122.83,0,0,0,0,100,0),
+(@ID,141,3059.89,-3685.41,121.254,0,0,0,0,100,0),
+(@ID,142,3063.62,-3704.59,120.885,0,0,0,0,100,0),
+(@ID,143,3049.97,-3743.53,120.437,0,0,0,0,100,0),
+(@ID,144,3038.77,-3773.26,119.728,0,0,0,0,100,0),
+(@ID,145,3029.37,-3797.56,120.123,0,0,0,0,100,0),
+(@ID,146,3017.78,-3822.93,118.882,0,0,0,0,100,0),
+(@ID,147,3011.9,-3841.29,119.307,0,0,0,0,100,0),
+(@ID,148,2999.1,-3881.4,118.595,0,0,0,0,100,0),
+(@ID,149,2992.82,-3899.77,116.742,0,0,0,0,100,0),
+(@ID,150,2987.35,-3919.01,114.686,0,0,0,0,100,0),
+(@ID,151,2979.54,-3951.23,108.575,0,0,0,0,100,0),
+(@ID,152,2974.35,-3965.01,106.582,0,0,0,0,100,0),
+(@ID,153,2965.39,-3989.01,103.564,0,0,0,0,100,0),
+(@ID,154,2947.58,-4032.49,99.8551,0,0,0,0,100,0),
+(@ID,155,2940.68,-4050.84,98.8149,0,0,0,0,100,0),
+(@ID,156,2927.47,-4095.16,96.9418,0,0,0,0,100,0),
+(@ID,157,2922.28,-4117.41,96.1034,0,0,0,0,100,0),
+(@ID,158,2916.91,-4141.33,95.1063,0,0,0,0,100,0),
+(@ID,159,2912.33,-4161.43,94.1942,0,0,0,0,100,0),
+(@ID,160,2906.67,-4194.05,92.8009,0,0,0,0,100,0),
+(@ID,161,2902.22,-4224.72,91.8676,0,0,0,0,100,0),
+(@ID,162,2898.62,-4254.12,91.3725,0,0,0,0,100,0),
+(@ID,163,2896.84,-4270.08,91.1643,0,0,0,0,100,0),
+(@ID,164,2892.88,-4300.96,90.6728,0,0,0,0,100,0),
+(@ID,165,2882.86,-4347.85,90.3236,0,0,0,0,100,0),
+(@ID,166,2875.88,-4369.2,90.0259,0,0,0,0,100,0),
+(@ID,167,2866.06,-4388.72,89.6369,0,0,0,0,100,0),
+(@ID,168,2855.15,-4407.04,89.3003,0,0,0,0,100,0),
+(@ID,169,2844.51,-4424.87,89.4741,0,0,0,0,100,0),
+(@ID,170,2835.01,-4439.19,89.6752,0,0,0,0,100,0),
+(@ID,171,2825.9,-4452.37,89.8312,0,0,0,0,100,0),
+(@ID,172,2781.37,-4503.54,89.6992,0,0,0,0,100,0),
+(@ID,173,2768.3,-4516.57,89.4068,0,0,0,0,100,0),
+(@ID,174,2751.64,-4531.98,88.9045,0,0,0,0,100,0),
+(@ID,175,2738.52,-4542.49,88.4996,0,0,0,0,100,0),
+(@ID,176,2714.09,-4557.62,87.6424,0,0,0,0,100,0),
+(@ID,177,2699.67,-4566.29,87.4294,0,0,0,0,100,0),
+(@ID,178,2684.52,-4575.58,87.001,0,0,0,0,100,0),
+(@ID,179,2667.22,-4586.17,85.7211,0,0,0,0,100,0),
+(@ID,180,2630.76,-4606.45,84.5909,0,0,0,0,100,0),
+(@ID,181,2618.07,-4614.37,84.1965,0,0,0,0,100,0),
+(@ID,182,2592.51,-4629.78,81.6831,0,0,0,0,100,0),
+(@ID,183,2570.53,-4643.56,79.6884,0,0,0,0,100,0),
+(@ID,184,2558.75,-4648.16,78.7332,0,0,0,0,100,0),
+(@ID,185,2544.22,-4651.95,77.8191,0,0,0,0,100,0),
+(@ID,186,2528.11,-4654.63,76.8986,0,0,0,0,100,0),
+(@ID,187,2511.76,-4655.66,76.0362,0,0,0,0,100,0),
+(@ID,188,2487.63,-4647.41,75.1608,0,0,0,0,100,0),
+(@ID,189,2467.38,-4636.04,74.6576,0,0,0,0,100,0),
+(@ID,190,2453.17,-4627.91,73.6226,0,0,0,0,100,0),
+(@ID,191,2437.83,-4620.44,73.6179,0,0,0,0,100,0),
+(@ID,192,2425.09,-4614.63,73.613,0,0,0,0,100,0),
+(@ID,193,2401.34,-4604.92,73.6229,0,0,0,0,100,0),
+(@ID,194,2367.28,-4602.14,73.6229,0,0,0,0,100,0),
+(@ID,195,2348.43,-4603.85,73.6229,0,0,0,0,100,0),
+(@ID,196,2312.07,-4610.25,73.6226,0,0,0,0,100,0),
+(@ID,197,2289.67,-4616.1,73.6237,0,0,0,0,100,0),
+(@ID,198,2270.18,-4621.81,73.6232,0,0,0,0,100,0),
+(@ID,199,2237.91,-4633.07,73.623,0,0,0,0,100,0),
+(@ID,200,2211.17,-4636.19,73.623,0,0,0,0,100,0),
+(@ID,201,2185.27,-4631.85,73.6238,0,0,0,0,100,0),
+(@ID,202,2161.67,-4621.89,73.6227,0,0,0,0,100,0),
+(@ID,203,2149.52,-4615.7,73.6227,0,0,0,0,100,0),
+(@ID,204,2128.18,-4600.53,73.6227,0,0,0,0,100,0),
+(@ID,205,2110.23,-4586.01,73.6227,0,0,0,0,100,0),
+(@ID,206,2094.4,-4570.16,73.6232,0,0,0,0,100,0),
+(@ID,207,2059.78,-4531.27,73.6232,0,0,0,0,100,0),
+(@ID,208,2025.92,-4515.28,73.6218,0,0,0,0,100,0),
+(@ID,209,1981.81,-4549.69,73.6228,0,0,0,0,100,0),
+(@ID,210,1968.69,-4574.04,73.6228,0,0,0,0,100,0),
+(@ID,211,1957.36,-4608.7,74.4979,0,0,0,0,100,0),
+(@ID,212,1948.95,-4627.72,78.4405,0,0,0,0,100,0),
+(@ID,213,1940.18,-4642.16,82.8813,0,0,0,0,100,0),
+(@ID,214,1932.32,-4651.64,85.6817,0,0,0,0,100,0),
+(@ID,215,1923.41,-4662.78,88.4994,0,0,0,0,100,0),
+(@ID,216,1912.89,-4671.55,90.7472,0,0,0,0,100,0),
+(@ID,217,1904.98,-4676.2,91.9429,0,0,0,0,100,0),
+(@ID,218,1880.51,-4687.26,92.3027,0,0,0,0,100,0),
+(@ID,219,1854.01,-4707.87,93.1035,0,0,0,0,100,0),
+(@ID,220,1840.53,-4719.99,92.1716,0,0,0,0,100,0),
+(@ID,221,1833.29,-4732.42,90.4734,0,0,0,0,100,0),
+(@ID,222,1825.75,-4748.92,88.8841,0,0,0,0,100,0),
+(@ID,223,1822.27,-4758.66,89.1826,0,0,0,0,100,0),
+(@ID,224,1817.98,-4771.4,89.7992,0,0,0,0,100,0),
+(@ID,225,1813.98,-4783.45,90.3784,0,0,0,0,100,0),
+(@ID,226,1810.56,-4794.25,91.0151,0,0,0,0,100,0),
+(@ID,227,1805.81,-4811.34,90.581,0,0,0,0,100,0),
+(@ID,228,1801.15,-4827.95,90.0279,0,0,0,0,100,0),
+(@ID,229,1791.34,-4861.33,88.9552,0,0,0,0,100,0),
+(@ID,230,1787.86,-4875.91,87.5166,0,0,0,0,100,0),
+(@ID,231,1780.76,-4905.48,84.0821,0,0,0,0,100,0),
+(@ID,232,1776.19,-4928.71,81.4626,0,0,0,0,100,0),
+(@ID,233,1774.3,-4938.49,81.4626,0,0,0,0,100,0),
+(@ID,234,1771.16,-4965.22,81.2126,0,0,0,0,100,0),
+(@ID,235,1757.6,-4990.9,80.8461,0,0,0,0,100,0),
+(@ID,236,1748.01,-5004.46,79.9039,0,0,0,0,100,0),
+(@ID,237,1738.94,-5016.73,79.9039,0,0,0,0,100,0),
+(@ID,238,1730.81,-5028.28,80.3151,0,0,0,0,100,0),
+(@ID,239,1720.51,-5053.17,80.4197,0,0,0,0,100,0),
+(@ID,240,1713.61,-5072.05,78.6081,0,0,0,0,100,0),
+(@ID,241,1704.71,-5094.96,75.245,0,0,0,0,100,0),
+(@ID,242,1692.75,-5131.78,73.8809,0,0,0,0,100,0),
+(@ID,243,1689.73,-5148.36,74.0206,0,0,0,0,100,0),
+(@ID,244,1688.35,-5178.24,73.7731,0,0,0,0,100,0),
+(@ID,245,1692.81,-5201.48,74.6409,0,0,0,0,100,0),
+(@ID,246,1690.74,-5274.98,73.6232,0,0,0,0,100,0),
+(@ID,247,1687.05,-5306.95,73.6112,0,0,0,0,100,0),
+(@ID,248,1686.21,-5322.85,73.6114,0,0,0,0,100,0),
+(@ID,249,1688.3,-5343.87,74.2449,0,0,0,0,100,0),
+(@ID,250,1672.16,-5377.38,73.6118,0,0,0,0,100,0),
+(@ID,251,1667.54,-5388.89,73.6137,0,0,0,0,100,0),
+(@ID,252,1664.18,-5398.35,74.3809,0,0,0,0,100,0),
+(@ID,253,1659.56,-5411.51,78.0987,0,0,0,0,100,0),
+(@ID,254,1657.63,-5416.96,80.0233,0,0,0,0,100,0),
+(@ID,255,1654.7,-5425.03,82.2941,0,0,0,0,100,0),
+(@ID,256,1652.04,-5432.05,84.9364,0,0,0,0,100,0),
+(@ID,257,1649.05,-5439.55,87.5085,0,0,0,0,100,0),
+(@ID,258,1646.61,-5446.01,90.2014,0,0,0,0,100,0),
+(@ID,259,1644.44,-5452.14,93.1195,0,0,0,0,100,0),
+(@ID,260,1641.84,-5459.95,95.4057,0,0,0,0,100,0),
+(@ID,261,1639.43,-5466.45,97.7334,0,0,0,0,100,0),
+(@ID,262,1635.2,-5476.15,100.195,0,0,0,0,100,0),
+(@ID,263,1631.56,-5485.27,100.73,0,0,0,0,100,0),
+(@ID,264,1627.96,-5493.81,100.73,0,0,0,0,100,0),
+(@ID,265,1623.74,-5501.82,102.308,0,0,0,0,100,0),
+(@ID,266,1621.54,-5506.67,104.154,0,0,0,0,100,0),
+(@ID,267,1619.31,-5510.5,105.706,0,0,0,0,100,0),
+(@ID,268,1617.2,-5514.39,107.478,0,0,0,0,100,0),
+(@ID,269,1615.11,-5518.38,108.951,0,0,0,0,100,0),
+(@ID,270,1613.27,-5521.97,110.422,0,0,0,0,100,0),
+(@ID,271,1610.31,-5527.82,111.163,0,0,0,0,100,0),
+(@ID,272,1606.59,-5535.3,111.171,0,0,0,0,100,0),
+(@ID,273,1596.95,-5537.16,111.171,0,0,0,0,100,0),
+(@ID,274,1591.5,-5546.99,111.171,0,0,0,0,100,0),
+(@ID,275,1594.64,-5559.12,111.171,0,0,0,0,100,0),
+(@ID,276,1587.05,-5573.4,111.171,0,0,0,0,100,0),
+(@ID,277,1576.47,-5592.38,111.171,0,0,0,0,100,0),
+(@ID,278,1569.09,-5606.81,114.19,0,0,0,0,100,0);
+
+UPDATE `script_texts` SET `sound`=5802 WHERE `npc_entry`=4832 AND `entry`='-1048002';
diff --git a/sql/updates/world/2012_09_18_00_world_creature_template.sql b/sql/updates/world/2012_09_18_00_world_creature_template.sql
new file mode 100644
index 00000000000..5ead9430d60
--- /dev/null
+++ b/sql/updates/world/2012_09_18_00_world_creature_template.sql
@@ -0,0 +1,4 @@
+UPDATE `creature_template` SET `unit_flags2`=0 WHERE `entry`=33109; -- Salvaged Demolisher
+UPDATE `creature_template` SET `unit_flags2`=2049 WHERE `entry`=33063; -- Wrecked Siege Engine
+UPDATE `creature_template` SET `unit_flags2`=1 WHERE `entry`=33059; -- Wrecked Demolisher
+UPDATE `creature_template` SET `unit_flags2`=0 WHERE `entry`=33167; -- Salvaged Demolisher Mechanic Seat
diff --git a/sql/updates/world/2012_09_18_01_world_creature_template.sql b/sql/updates/world/2012_09_18_01_world_creature_template.sql
new file mode 100644
index 00000000000..4e31e7f6f68
--- /dev/null
+++ b/sql/updates/world/2012_09_18_01_world_creature_template.sql
@@ -0,0 +1,7 @@
+-- Razorscale
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (33186,33724);
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (33186,33724);
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(33186, 0, 0x3000000, 0x1, ''),
+(33724, 0, 0x3000000, 0x1, '');
diff --git a/sql/updates/world/2012_09_18_02_world_spell_script_names.sql b/sql/updates/world/2012_09_18_02_world_spell_script_names.sql
new file mode 100644
index 00000000000..00734753691
--- /dev/null
+++ b/sql/updates/world/2012_09_18_02_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM spell_script_names WHERE spell_id = 6940;
+INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
+(6940, 'spell_pal_hand_of_sacrifice');
diff --git a/sql/updates/world/2012_09_19_00_world_dwarfageddon.sql b/sql/updates/world/2012_09_19_00_world_dwarfageddon.sql
new file mode 100644
index 00000000000..1eda383b67d
--- /dev/null
+++ b/sql/updates/world/2012_09_19_00_world_dwarfageddon.sql
@@ -0,0 +1,16 @@
+-- Edit the required spell credit markers for Dwarfageddon (10/25 player) achievements
+UPDATE `spell_dbc` SET `attributes`=0x00800100,`DmgMultiplier1`=0, `DmgMultiplier2`=0, `DmgMultiplier3`=0,`RangeIndex`=12 WHERE `ID`=65387; -- (SPELL_ATTR0_HIDE_IN_COMBAT_LOG, SPELL_ATTR0_CASTABLE_WHILE_DEAD)
+-- Edit SAI support for Dwarfageddon (10 and 25 player) achievement /required changes since attribute castable_while_dead is not working/
+SET @Defender := 33236;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Defender AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Defender,0,0,0,25,0,100,0,0,0,0,0,42,0,1,0,0,0,0,1,0,0,0,0,0,0,0,'Steelforged Defender - On reset - Set Invincibility for 1%'),
+(@Defender,0,1,2,2,0,100,0,1,1,0,0,11,65387,0,0,0,0,0,1,0,0,0,0,0,0,0,'Steelforged Defender - Health Percentage (1%) - Cast spell for achievement credit'),
+(@Defender,0,2,0,61,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Steelforged Defender - Linked with previous event - Die'),
+(@Defender,0,3,0,0,0,100,0,0,2500,9000,12000,11,62845,0,0,0,0,0,2,0,0,0,0,0,0,0,'Steelforged Defender - IC - Hamstring'),
+(@Defender,0,4,0,0,0,100,0,0,2600,13000,14000,11,50370,0,0,0,0,0,2,0,0,0,0,0,0,0,'Steelforged Defender - IC - Cast Sunder armor'),
+(@Defender,0,5,0,0,0,100,0,500,4000,4500,9000,11,57780,0,0,0,0,0,2,0,0,0,0,0,0,0,'Steelforged Defender - IC - Cast Lightening Bolt');
+-- Add conditions to prevent lag and for the sake of logic
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (65387);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,65387,0,1,31,0,4,0,0,0,0,'','Steelforged Defender kill credit for achievement can hit only players');
diff --git a/sql/updates/world/2012_09_19_00_world_reference_loot_template.sql b/sql/updates/world/2012_09_19_00_world_reference_loot_template.sql
new file mode 100644
index 00000000000..7db30ede52b
--- /dev/null
+++ b/sql/updates/world/2012_09_19_00_world_reference_loot_template.sql
@@ -0,0 +1,449 @@
+-- Changes To VOA Loot
+-- Update gold drops for bosses
+-- Archavon 10 & 25
+UPDATE `creature_template` SET `mingold`=1700000,`maxgold`=1800000 WHERE `entry` IN (31125,31722);
+-- Emalon & koralon 10 & 25
+UPDATE `creature_template` SET `mingold`=1800000,`maxgold`=1900000 WHERE `entry` IN (33993,33994,35013,35360);
+-- Toravon 10 & 25
+UPDATE `creature_template` SET `mingold`=1900000,`maxgold`=2000000 WHERE `entry` IN (38433,38462);
+-- Combine PVP and PVE ref templates so loot has chance to be all pvp or all pve not one of each
+-- Revome deadly items other than chest lega and hands from Archavon 25 loot
+-- Toravon 25 drops 3 items
+SET @ARCHAVON10 = 34209;
+SET @ARCHAVON25 = 34216;
+SET @EMALON10 = 34208;
+SET @EMALON25 = 34215;
+SET @TORAVON10 = 34206;
+SET @TORAVON25 = 34207;
+SET @KORALON10 = 34204;
+SET @KORALON25 = 34205;
+-- Create Reference loot template for @ARCHAVON25 T7(25) & Deadly Chest,Legs,Hands
+DELETE FROM `reference_loot_template` WHERE `entry` IN (@ARCHAVON25,@KORALON25,@EMALON25);
+INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(@ARCHAVON25,40550,0,1,1,1,1), -- Valorous Scourgeborne Battleplate
+(@ARCHAVON25,40552,0,1,1,1,1), -- Valorous Scourgeborne Gauntlets
+(@ARCHAVON25,40556,0,1,1,1,1), -- Valorous Scourgeborne Legplates
+(@ARCHAVON25,40559,0,1,1,1,1), -- Valorous Scourgeborne Chestguard
+(@ARCHAVON25,40563,0,1,1,1,1), -- Valorous Scourgeborne Handguards
+(@ARCHAVON25,40567,0,1,1,1,1), -- Valorous Scourgeborne Legguards
+(@ARCHAVON25,40463,0,1,1,1,1), -- Valorous Dreamwalker Robe
+(@ARCHAVON25,40460,0,1,1,1,1), -- Valorous Dreamwalker Handguards
+(@ARCHAVON25,40462,0,1,1,1,1), -- Valorous Dreamwalker Leggings
+(@ARCHAVON25,40503,0,1,1,1,1), -- Valorous Cryptstalker Tunic
+(@ARCHAVON25,40504,0,1,1,1,1), -- Valorous Cryptstalker Handguards
+(@ARCHAVON25,40506,0,1,1,1,1), -- Valorous Cryptstalker Legguards
+(@ARCHAVON25,40418,0,1,1,1,1), -- Valorous Frostfire Robe
+(@ARCHAVON25,40415,0,1,1,1,1), -- Valorous Frostfire Gloves
+(@ARCHAVON25,40417,0,1,1,1,1), -- Valorous Frostfire Leggings
+(@ARCHAVON25,40569,0,1,1,1,1), -- Valorous Redemption Tunic
+(@ARCHAVON25,40570,0,1,1,1,1), -- Valorous Redemption Gloves
+(@ARCHAVON25,40572,0,1,1,1,1), -- Valorous Redemption Greaves
+(@ARCHAVON25,40579,0,1,1,1,1), -- Valorous Redemption Breastplate
+(@ARCHAVON25,40580,0,1,1,1,1), -- Valorous Redemption Handguards
+(@ARCHAVON25,40583,0,1,1,1,1), -- Valorous Redemption Legguards
+(@ARCHAVON25,40574,0,1,1,1,1), -- Valorous Redemption Chestpiece
+(@ARCHAVON25,40575,0,1,1,1,1), -- Valorous Redemption Gauntlets
+(@ARCHAVON25,40577,0,1,1,1,1), -- Valorous Redemption Legplates
+(@ARCHAVON25,40449,0,1,1,1,1), -- Valorous Robe of Faith
+(@ARCHAVON25,40445,0,1,1,1,1), -- Valorous Gloves of Faith
+(@ARCHAVON25,40448,0,1,1,1,1), -- Valorous Leggings of Faith
+(@ARCHAVON25,40458,0,1,1,1,1), -- Valorous Raiments of Faith
+(@ARCHAVON25,40454,0,1,1,1,1), -- Valorous Handwraps of Faith
+(@ARCHAVON25,40457,0,1,1,1,1), -- Valorous Pants of Faith
+(@ARCHAVON25,40495,0,1,1,1,1), -- Valorous Bonescythe Breastplate
+(@ARCHAVON25,40496,0,1,1,1,1), -- Valorous Bonescythe Gauntlets
+(@ARCHAVON25,40500,0,1,1,1,1), -- Valorous Bonescythe Legplates
+(@ARCHAVON25,40514,0,1,1,1,1), -- Valorous Earthshatter Hauberk
+(@ARCHAVON25,40515,0,1,1,1,1), -- Valorous Earthshatter Gloves
+(@ARCHAVON25,40517,0,1,1,1,1), -- Valorous Earthshatter Kilt
+(@ARCHAVON25,40523,0,1,1,1,1), -- Valorous Earthshatter Chestguard
+(@ARCHAVON25,40520,0,1,1,1,1), -- Valorous Earthshatter Grips
+(@ARCHAVON25,40522,0,1,1,1,1), -- Valorous Earthshatter War-Kilt
+(@ARCHAVON25,40508,0,1,1,1,1), -- Valorous Earthshatter Tunic
+(@ARCHAVON25,40509,0,1,1,1,1), -- Valorous Earthshatter Handguards
+(@ARCHAVON25,40512,0,1,1,1,1), -- Valorous Earthshatter Legguards
+(@ARCHAVON25,40423,0,1,1,1,1), -- Valorous Plagueheart Robe
+(@ARCHAVON25,40420,0,1,1,1,1), -- Valorous Plagueheart Gloves
+(@ARCHAVON25,40422,0,1,1,1,1), -- Valorous Plagueheart Leggings
+(@ARCHAVON25,40525,0,1,1,1,1), -- Valorous Dreadnaught Battleplate
+(@ARCHAVON25,40527,0,1,1,1,1), -- Valorous Dreadnaught Gauntlets
+(@ARCHAVON25,40529,0,1,1,1,1), -- Valorous Dreadnaught Legplates
+(@ARCHAVON25,40544,0,1,1,1,1), -- Valorous Dreadnaught Breastplate
+(@ARCHAVON25,40545,0,1,1,1,1), -- Valorous Dreadnaught Handguards
+(@ARCHAVON25,40547,0,1,1,1,1), -- Valorous Dreadnaught Legguards
+(@ARCHAVON25,40469,0,1,1,1,1), -- Valorous Dreamwalker Vestments
+(@ARCHAVON25,40466,0,1,1,1,1), -- Valorous Dreamwalker Gloves
+(@ARCHAVON25,40468,0,1,1,1,1), -- Valorous Dreamwalker Trousers
+(@ARCHAVON25,40471,0,1,1,1,1), -- Valorous Dreamwalker Raiments
+(@ARCHAVON25,40472,0,1,1,1,1), -- Valorous Dreamwalker Handgrips
+(@ARCHAVON25,40493,0,1,1,1,1), -- Valorous Dreamwalker Legguards
+(@ARCHAVON25,40786,0,1,1,1,1), -- Deadly Gladiator's Plate Chestpiece
+(@ARCHAVON25,41951,0,1,1,1,1), -- Deadly Gladiator's Silk Raiment
+(@ARCHAVON25,41997,0,1,1,1,1), -- Deadly Gladiator's Felweave Raiment
+(@ARCHAVON25,41649,0,1,1,1,1), -- Deadly Gladiator's Leather Tunic
+(@ARCHAVON25,40784,0,1,1,1,1), -- Deadly Gladiator's Dreadplate Chestpiece
+(@ARCHAVON25,41086,0,1,1,1,1), -- Deadly Gladiator's Chain Armor
+(@ARCHAVON25,41920,0,1,1,1,1), -- Deadly Gladiator's Satin Robe
+(@ARCHAVON25,40785,0,1,1,1,1), -- Deadly Gladiator's Scaled Chestpiece
+(@ARCHAVON25,41660,0,1,1,1,1), -- Deadly Gladiator's Dragonhide Robes
+(@ARCHAVON25,41858,0,1,1,1,1), -- Deadly Gladiator's Mooncloth Robe
+(@ARCHAVON25,40905,0,1,1,1,1), -- Deadly Gladiator's Ornamented Chestguard
+(@ARCHAVON25,40990,0,1,1,1,1), -- Deadly Gladiator's Ringmail Armor
+(@ARCHAVON25,41315,0,1,1,1,1), -- Deadly Gladiator's Wyrmhide Robes
+(@ARCHAVON25,41309,0,1,1,1,1), -- Deadly Gladiator's Kodohide Robes
+(@ARCHAVON25,41080,0,1,1,1,1), -- Deadly Gladiator's Linked Armor
+(@ARCHAVON25,40991,0,1,1,1,1), -- Deadly Gladiator's Mail Armor
+(@ARCHAVON25,40926,0,1,1,1,1), -- Deadly Gladiator's Ornamented Gloves
+(@ARCHAVON25,40938,0,1,1,1,1), -- Deadly Gladiator's Ornamented Legplates
+(@ARCHAVON25,40846,0,1,1,1,1), -- Deadly Gladiator's Scaled Legguards
+(@ARCHAVON25,41863,0,1,1,1,1), -- Deadly Gladiator's Mooncloth Leggings
+(@ARCHAVON25,41926,0,1,1,1,1), -- Deadly Gladiator's Satin Leggings
+(@ARCHAVON25,41873,0,1,1,1,1), -- Deadly Gladiator's Mooncloth Gloves
+(@ARCHAVON25,41032,0,1,1,1,1), -- Deadly Gladiator's Mail Leggings
+(@ARCHAVON25,41006,0,1,1,1,1), -- Deadly Gladiator's Mail Gauntlets
+(@ARCHAVON25,41198,0,1,1,1,1), -- Deadly Gladiator's Linked Leggings
+(@ARCHAVON25,41666,0,1,1,1,1), -- Deadly Gladiator's Dragonhide Legguards
+(@ARCHAVON25,41772,0,1,1,1,1), -- Deadly Gladiator's Dragonhide Gloves
+(@ARCHAVON25,41000,0,1,1,1,1), -- Deadly Gladiator's Ringmail Gauntlets
+(@ARCHAVON25,41136,0,1,1,1,1), -- Deadly Gladiator's Linked Gauntlets
+(@ARCHAVON25,41286,0,1,1,1,1), -- Deadly Gladiator's Kodohide Gloves
+(@ARCHAVON25,40805,0,1,1,1,1), -- Deadly Gladiator's Scaled Gauntlets
+(@ARCHAVON25,41939,0,1,1,1,1), -- Deadly Gladiator's Satin Gloves
+(@ARCHAVON25,41297,0,1,1,1,1), -- Deadly Gladiator's Kodohide Legguards
+(@ARCHAVON25,41026,0,1,1,1,1), -- Deadly Gladiator's Ringmail Leggings
+(@ARCHAVON25,41958,0,1,1,1,1), -- Deadly Gladiator's Silk Trousers
+(@ARCHAVON25,41970,0,1,1,1,1), -- Deadly Gladiator's Silk Handguards
+(@ARCHAVON25,40844,0,1,1,1,1), -- Deadly Gladiator's Plate Legguards
+(@ARCHAVON25,41303,0,1,1,1,1), -- Deadly Gladiator's Wyrmhide Legguards
+(@ARCHAVON25,41292,0,1,1,1,1), -- Deadly Gladiator's Wyrmhide Gloves
+(@ARCHAVON25,42004,0,1,1,1,1), -- Deadly Gladiator's Felweave Trousers
+(@ARCHAVON25,41142,0,1,1,1,1), -- Deadly Gladiator's Chain Gauntlets
+(@ARCHAVON25,40845,0,1,1,1,1), -- Deadly Gladiator's Dreadplate Legguards
+(@ARCHAVON25,40804,0,1,1,1,1), -- Deadly Gladiator's Plate Gauntlets
+(@ARCHAVON25,42016,0,1,1,1,1), -- Deadly Gladiator's Felweave Handguards
+(@ARCHAVON25,40806,0,1,1,1,1), -- Deadly Gladiator's Dreadplate Gauntlets
+(@ARCHAVON25,41654,0,1,1,1,1), -- Deadly Gladiator's Leather Legguards
+(@ARCHAVON25,41766,0,1,1,1,1), -- Deadly Gladiator's Leather Gloves
+(@ARCHAVON25,41204,0,1,1,1,1), -- Deadly Gladiator's Chain Leggings
+-- Create Ref for Emalon 25 furious PVP + T8(25) (chest,hands,legs)
+(@EMALON25,41640,0,1,1,1,1), -- Furious Gladiator's Armwraps of Dominance
+(@EMALON25,41625,0,1,1,1,1), -- Furious Gladiator's Armwraps of Salvation
+(@EMALON25,41840,0,1,1,1,1), -- Furious Gladiator's Armwraps of Triumph
+(@EMALON25,42116,0,1,1,1,1), -- Furious Gladiator's Band of Dominance
+(@EMALON25,42117,0,1,1,1,1), -- Furious Gladiator's Band of Triumph
+(@EMALON25,41630,0,1,1,1,1), -- Furious Gladiator's Belt of Dominance
+(@EMALON25,41617,0,1,1,1,1), -- Furious Gladiator's Belt of Salvation
+(@EMALON25,41832,0,1,1,1,1), -- Furious Gladiator's Belt of Triumph
+(@EMALON25,41635,0,1,1,1,1), -- Furious Gladiator's Boots of Dominance
+(@EMALON25,41621,0,1,1,1,1), -- Furious Gladiator's Boots of Salvation
+(@EMALON25,41836,0,1,1,1,1), -- Furious Gladiator's Boots of Triumph
+(@EMALON25,40983,0,1,1,1,1), -- Furious Gladiator's Bracers of Salvation
+(@EMALON25,40889,0,1,1,1,1), -- Furious Gladiator's Bracers of Triumph
+(@EMALON25,41143,0,1,1,1,1), -- Furious Gladiator's Chain Gauntlets
+(@EMALON25,41205,0,1,1,1,1), -- Furious Gladiator's Chain Leggings
+(@EMALON25,42071,0,1,1,1,1), -- Furious Gladiator's Cloak of Ascendancy
+(@EMALON25,42073,0,1,1,1,1), -- Furious Gladiator's Cloak of Deliverance
+(@EMALON25,42069,0,1,1,1,1), -- Furious Gladiator's Cloak of Dominance
+(@EMALON25,42072,0,1,1,1,1), -- Furious Gladiator's Cloak of Salvation
+(@EMALON25,42070,0,1,1,1,1), -- Furious Gladiator's Cloak of Subjugation
+(@EMALON25,42074,0,1,1,1,1), -- Furious Gladiator's Cloak of Triumph
+(@EMALON25,42075,0,1,1,1,1), -- Furious Gladiator's Cloak of Victory
+(@EMALON25,41898,0,1,1,1,1), -- Furious Gladiator's Cord of Dominance
+(@EMALON25,41881,0,1,1,1,1), -- Furious Gladiator's Cord of Salvation
+(@EMALON25,41909,0,1,1,1,1), -- Furious Gladiator's Cuffs of Dominance
+(@EMALON25,41893,0,1,1,1,1), -- Furious Gladiator's Cuffs of Salvation
+(@EMALON25,41773,0,1,1,1,1), -- Furious Gladiator's Dragonhide Gloves
+(@EMALON25,41667,0,1,1,1,1), -- Furious Gladiator's Dragonhide Legguards
+(@EMALON25,40809,0,1,1,1,1), -- Furious Gladiator's Dreadplate Gauntlets
+(@EMALON25,42017,0,1,1,1,1), -- Furious Gladiator's Felweave Handguards
+(@EMALON25,42005,0,1,1,1,1), -- Furious Gladiator's Felweave Trousers
+(@EMALON25,40976,0,1,1,1,1), -- Furious Gladiator's Girdle of Salvation
+(@EMALON25,40881,0,1,1,1,1), -- Furious Gladiator's Girdle of Triumph
+(@EMALON25,40977,0,1,1,1,1), -- Furious Gladiator's Greaves of Salvation
+(@EMALON25,40882,0,1,1,1,1), -- Furious Gladiator's Greaves of Triumph
+(@EMALON25,41287,0,1,1,1,1), -- Furious Gladiator's Kodohide Gloves
+(@EMALON25,41298,0,1,1,1,1), -- Furious Gladiator's Kodohide Legguards
+(@EMALON25,41767,0,1,1,1,1), -- Furious Gladiator's Leather Gloves
+(@EMALON25,41655,0,1,1,1,1), -- Furious Gladiator's Leather Legguards
+(@EMALON25,41137,0,1,1,1,1), -- Furious Gladiator's Linked Gauntlets
+(@EMALON25,41199,0,1,1,1,1), -- Furious Gladiator's Linked Leggings
+(@EMALON25,41007,0,1,1,1,1), -- Furious Gladiator's Mail Gauntlets
+(@EMALON25,41033,0,1,1,1,1), -- Furious Gladiator's Mail Leggings
+(@EMALON25,41874,0,1,1,1,1), -- Furious Gladiator's Mooncloth Gloves
+(@EMALON25,41864,0,1,1,1,1), -- Furious Gladiator's Mooncloth Leggings
+(@EMALON25,40927,0,1,1,1,1), -- Furious Gladiator's Ornamented Gloves
+(@EMALON25,40939,0,1,1,1,1), -- Furious Gladiator's Ornamented Legplates
+(@EMALON25,42037,0,1,1,1,1), -- Furious Gladiator's Pendant of Ascendancy
+(@EMALON25,42039,0,1,1,1,1), -- Furious Gladiator's Pendant of Deliverance
+(@EMALON25,42036,0,1,1,1,1), -- Furious Gladiator's Pendant of Dominance
+(@EMALON25,42040,0,1,1,1,1), -- Furious Gladiator's Pendant of Salvation
+(@EMALON25,42038,0,1,1,1,1), -- Furious Gladiator's Pendant of Subjugation
+(@EMALON25,46373,0,1,1,1,1), -- Furious Gladiator's Pendant of Sundering
+(@EMALON25,42034,0,1,1,1,1), -- Furious Gladiator's Pendant of Triumph
+(@EMALON25,42035,0,1,1,1,1), -- Furious Gladiator's Pendant of Victory
+(@EMALON25,40807,0,1,1,1,1), -- Furious Gladiator's Plate Gauntlets
+(@EMALON25,40847,0,1,1,1,1), -- Furious Gladiator's Plate Legguards
+(@EMALON25,41001,0,1,1,1,1), -- Furious Gladiator's Ringmail Gauntlets
+(@EMALON25,41027,0,1,1,1,1), -- Furious Gladiator's Ringmail Leggings
+(@EMALON25,41075,0,1,1,1,1), -- Furious Gladiator's Sabatons of Dominance
+(@EMALON25,41055,0,1,1,1,1), -- Furious Gladiator's Sabatons of Salvation
+(@EMALON25,41230,0,1,1,1,1), -- Furious Gladiator's Sabatons of Triumph
+(@EMALON25,41940,0,1,1,1,1), -- Furious Gladiator's Satin Gloves
+(@EMALON25,41927,0,1,1,1,1), -- Furious Gladiator's Satin Leggings
+(@EMALON25,40808,0,1,1,1,1), -- Furious Gladiator's Scaled Gauntlets
+(@EMALON25,40849,0,1,1,1,1), -- Furious Gladiator's Scaled Legguards
+(@EMALON25,41971,0,1,1,1,1), -- Furious Gladiator's Silk Handguards
+(@EMALON25,41959,0,1,1,1,1), -- Furious Gladiator's Silk Trousers
+(@EMALON25,41903,0,1,1,1,1), -- Furious Gladiator's Slippers of Dominance
+(@EMALON25,41885,0,1,1,1,1), -- Furious Gladiator's Slippers of Salvation
+(@EMALON25,41070,0,1,1,1,1), -- Furious Gladiator's Waistguard of Dominance
+(@EMALON25,41051,0,1,1,1,1), -- Furious Gladiator's Waistguard of Salvation
+(@EMALON25,41235,0,1,1,1,1), -- Furious Gladiator's Waistguard of Triumph
+(@EMALON25,41065,0,1,1,1,1), -- Furious Gladiator's Wristguards of Dominance
+(@EMALON25,41060,0,1,1,1,1), -- Furious Gladiator's Wristguards of Salvation
+(@EMALON25,41225,0,1,1,1,1), -- Furious Gladiator's Wristguards of Triumph
+(@EMALON25,41293,0,1,1,1,1), -- Furious Gladiator's Wyrmhide Gloves
+(@EMALON25,41304,0,1,1,1,1), -- Furious Gladiator's Wyrmhide Legguards
+(@EMALON25,40811,0,1,1,1,1), -- Furious Gladiator's Girdle of Triumph
+(@EMALON25,46155,0,1,1,1,1), -- Conqueror's Aegis Gauntlets
+(@EMALON25,46179,0,1,1,1,1), -- Conqueror's Aegis Gloves
+(@EMALON25,46181,0,1,1,1,1), -- Conqueror's Aegis Greaves
+(@EMALON25,46174,0,1,1,1,1), -- Conqueror's Aegis Handguards
+(@EMALON25,46176,0,1,1,1,1), -- Conqueror's Aegis Legguards
+(@EMALON25,46153,0,1,1,1,1), -- Conqueror's Aegis Legplates
+(@EMALON25,46113,0,1,1,1,1), -- Conqueror's Darkruned Gauntlets
+(@EMALON25,46119,0,1,1,1,1), -- Conqueror's Darkruned Handguards
+(@EMALON25,46121,0,1,1,1,1), -- Conqueror's Darkruned Legguards
+(@EMALON25,46116,0,1,1,1,1), -- Conqueror's Darkruned Legplates
+(@EMALON25,46135,0,1,1,1,1), -- Conqueror's Deathbringer Gloves
+(@EMALON25,46139,0,1,1,1,1), -- Conqueror's Deathbringer Leggings
+(@EMALON25,46188,0,1,1,1,1), -- Conqueror's Gloves of Sanctification
+(@EMALON25,46163,0,1,1,1,1), -- Conqueror's Handwraps of Sanctification
+(@EMALON25,46132,0,1,1,1,1), -- Conqueror's Kirin Tor Gauntlets
+(@EMALON25,46133,0,1,1,1,1), -- Conqueror's Kirin Tor Leggings
+(@EMALON25,46195,0,1,1,1,1), -- Conqueror's Leggings of Sanctification
+(@EMALON25,46189,0,1,1,1,1), -- Conqueror's Nightsong Gloves
+(@EMALON25,46158,0,1,1,1,1), -- Conqueror's Nightsong Handgrips
+(@EMALON25,46183,0,1,1,1,1), -- Conqueror's Nightsong Handguards
+(@EMALON25,46185,0,1,1,1,1), -- Conqueror's Nightsong Leggings
+(@EMALON25,46160,0,1,1,1,1), -- Conqueror's Nightsong Legguards
+(@EMALON25,46192,0,1,1,1,1), -- Conqueror's Nightsong Trousers
+(@EMALON25,46170,0,1,1,1,1), -- Conqueror's Pants of Sanctification
+(@EMALON25,46142,0,1,1,1,1), -- Conqueror's Scourgestalker Handguards
+(@EMALON25,46144,0,1,1,1,1), -- Conqueror's Scourgestalker Legguards
+(@EMALON25,46148,0,1,1,1,1), -- Conqueror's Siegebreaker Gauntlets
+(@EMALON25,46164,0,1,1,1,1), -- Conqueror's Siegebreaker Handguards
+(@EMALON25,46169,0,1,1,1,1), -- Conqueror's Siegebreaker Legguards
+(@EMALON25,46150,0,1,1,1,1), -- Conqueror's Siegebreaker Legplates
+(@EMALON25,46124,0,1,1,1,1), -- Conqueror's Terrorblade Gauntlets
+(@EMALON25,46126,0,1,1,1,1), -- Conqueror's Terrorblade Legplates
+(@EMALON25,46207,0,1,1,1,1), -- Conqueror's Worldbreaker Gloves
+(@EMALON25,46200,0,1,1,1,1), -- Conqueror's Worldbreaker Grips
+(@EMALON25,46199,0,1,1,1,1), -- Conqueror's Worldbreaker Handguards
+(@EMALON25,46210,0,1,1,1,1), -- Conqueror's Worldbreaker Kilt
+(@EMALON25,46202,0,1,1,1,1), -- Conqueror's Worldbreaker Legguards
+(@EMALON25,46208,0,1,1,1,1), -- Conqueror's Worldbreaker War-Kilt
+-- Create Ref for koralon 25 relentless + T9.5 (hands,legs)
+(@KORALON25,41641,0,1,1,1,1), -- Relentless Gladiator's Armwraps of Dominance
+(@KORALON25,41626,0,1,1,1,1), -- Relentless Gladiator's Armwraps of Salvation
+(@KORALON25,41841,0,1,1,1,1), -- Relentless Gladiator's Armwraps of Triumph
+(@KORALON25,42118,0,1,1,1,1), -- Relentless Gladiator's Band of Ascendancy
+(@KORALON25,42119,0,1,1,1,1), -- Relentless Gladiator's Band of Victory
+(@KORALON25,41631,0,1,1,1,1), -- Relentless Gladiator's Belt of Dominance
+(@KORALON25,41618,0,1,1,1,1), -- Relentless Gladiator's Belt of Salvation
+(@KORALON25,41833,0,1,1,1,1), -- Relentless Gladiator's Belt of Triumph
+(@KORALON25,41636,0,1,1,1,1), -- Relentless Gladiator's Boots of Dominance
+(@KORALON25,41622,0,1,1,1,1), -- Relentless Gladiator's Boots of Salvation
+(@KORALON25,41837,0,1,1,1,1), -- Relentless Gladiator's Boots of Triumph
+(@KORALON25,40984,0,1,1,1,1), -- Relentless Gladiator's Bracers of Salvation
+(@KORALON25,40890,0,1,1,1,1), -- Relentless Gladiator's Bracers of Triumph
+(@KORALON25,41144,0,1,1,1,1), -- Relentless Gladiator's Chain Gauntlets
+(@KORALON25,41206,0,1,1,1,1), -- Relentless Gladiator's Chain Leggings
+(@KORALON25,42078,0,1,1,1,1), -- Relentless Gladiator's Cloak of Ascendancy
+(@KORALON25,42080,0,1,1,1,1), -- Relentless Gladiator's Cloak of Deliverance
+(@KORALON25,42076,0,1,1,1,1), -- Relentless Gladiator's Cloak of Dominance
+(@KORALON25,42079,0,1,1,1,1), -- Relentless Gladiator's Cloak of Salvation
+(@KORALON25,42077,0,1,1,1,1), -- Relentless Gladiator's Cloak of Subjugation
+(@KORALON25,42081,0,1,1,1,1), -- Relentless Gladiator's Cloak of Triumph
+(@KORALON25,42082,0,1,1,1,1), -- Relentless Gladiator's Cloak of Victory
+(@KORALON25,41899,0,1,1,1,1), -- Relentless Gladiator's Cord of Dominance
+(@KORALON25,41882,0,1,1,1,1), -- Relentless Gladiator's Cord of Salvation
+(@KORALON25,41910,0,1,1,1,1), -- Relentless Gladiator's Cuffs of Dominance
+(@KORALON25,41894,0,1,1,1,1), -- Relentless Gladiator's Cuffs of Salvation
+(@KORALON25,41774,0,1,1,1,1), -- Relentless Gladiator's Dragonhide Gloves
+(@KORALON25,41668,0,1,1,1,1), -- Relentless Gladiator's Dragonhide Legguards
+(@KORALON25,40851,0,1,1,1,1), -- Relentless Gladiator's Dreadplate Legguards
+(@KORALON25,42018,0,1,1,1,1), -- Relentless Gladiator's Felweave Handguards
+(@KORALON25,42006,0,1,1,1,1), -- Relentless Gladiator's Felweave Trousers
+(@KORALON25,40978,0,1,1,1,1), -- Relentless Gladiator's Girdle of Salvation
+(@KORALON25,40883,0,1,1,1,1), -- Relentless Gladiator's Girdle of Triumph
+(@KORALON25,40979,0,1,1,1,1), -- Relentless Gladiator's Greaves of Salvation
+(@KORALON25,40884,0,1,1,1,1), -- Relentless Gladiator's Greaves of Triumph
+(@KORALON25,41288,0,1,1,1,1), -- Relentless Gladiator's Kodohide Gloves
+(@KORALON25,41299,0,1,1,1,1), -- Relentless Gladiator's Kodohide Legguards
+(@KORALON25,41768,0,1,1,1,1), -- Relentless Gladiator's Leather Gloves
+(@KORALON25,41656,0,1,1,1,1), -- Relentless Gladiator's Leather Legguards
+(@KORALON25,41138,0,1,1,1,1), -- Relentless Gladiator's Linked Gauntlets
+(@KORALON25,41200,0,1,1,1,1), -- Relentless Gladiator's Linked Leggings
+(@KORALON25,41008,0,1,1,1,1), -- Relentless Gladiator's Mail Gauntlets
+(@KORALON25,41034,0,1,1,1,1), -- Relentless Gladiator's Mail Leggings
+(@KORALON25,41875,0,1,1,1,1), -- Relentless Gladiator's Mooncloth Gloves
+(@KORALON25,41865,0,1,1,1,1), -- Relentless Gladiator's Mooncloth Leggings
+(@KORALON25,40928,0,1,1,1,1), -- Relentless Gladiator's Ornamented Gloves
+(@KORALON25,40940,0,1,1,1,1), -- Relentless Gladiator's Ornamented Legplates
+(@KORALON25,42044,0,1,1,1,1), -- Relentless Gladiator's Pendant of Ascendancy
+(@KORALON25,42046,0,1,1,1,1), -- Relentless Gladiator's Pendant of Deliverance
+(@KORALON25,42043,0,1,1,1,1), -- Relentless Gladiator's Pendant of Dominance
+(@KORALON25,42047,0,1,1,1,1), -- Relentless Gladiator's Pendant of Salvation
+(@KORALON25,42045,0,1,1,1,1), -- Relentless Gladiator's Pendant of Subjugation
+(@KORALON25,46374,0,1,1,1,1), -- Relentless Gladiator's Pendant of Sundering
+(@KORALON25,42041,0,1,1,1,1), -- Relentless Gladiator's Pendant of Triumph
+(@KORALON25,42042,0,1,1,1,1), -- Relentless Gladiator's Pendant of Victory
+(@KORALON25,40810,0,1,1,1,1), -- Relentless Gladiator's Plate Gauntlets
+(@KORALON25,40850,0,1,1,1,1), -- Relentless Gladiator's Plate Legguards
+(@KORALON25,41002,0,1,1,1,1), -- Relentless Gladiator's Ringmail Gauntlets
+(@KORALON25,41028,0,1,1,1,1), -- Relentless Gladiator's Ringmail Leggings
+(@KORALON25,41076,0,1,1,1,1), -- Relentless Gladiator's Sabatons of Dominance
+(@KORALON25,41056,0,1,1,1,1), -- Relentless Gladiator's Sabatons of Salvation
+(@KORALON25,41231,0,1,1,1,1), -- Relentless Gladiator's Sabatons of Triumph
+(@KORALON25,41941,0,1,1,1,1), -- Relentless Gladiator's Satin Gloves
+(@KORALON25,41928,0,1,1,1,1), -- Relentless Gladiator's Satin Leggings
+(@KORALON25,40812,0,1,1,1,1), -- Relentless Gladiator's Scaled Gauntlets
+(@KORALON25,40852,0,1,1,1,1), -- Relentless Gladiator's Scaled Legguards
+(@KORALON25,41972,0,1,1,1,1), -- Relentless Gladiator's Silk Handguards
+(@KORALON25,41960,0,1,1,1,1), -- Relentless Gladiator's Silk Trousers
+(@KORALON25,41904,0,1,1,1,1), -- Relentless Gladiator's Treads of Dominance
+(@KORALON25,41886,0,1,1,1,1), -- Relentless Gladiator's Treads of Salvation
+(@KORALON25,41071,0,1,1,1,1), -- Relentless Gladiator's Waistguard of Dominance
+(@KORALON25,41052,0,1,1,1,1), -- Relentless Gladiator's Waistguard of Salvation
+(@KORALON25,41236,0,1,1,1,1), -- Relentless Gladiator's Waistguard of Triumph
+(@KORALON25,41066,0,1,1,1,1), -- Relentless Gladiator's Wristguards of Dominance
+(@KORALON25,41061,0,1,1,1,1), -- Relentless Gladiator's Wristguards of Salvation
+(@KORALON25,41226,0,1,1,1,1), -- Relentless Gladiator's Wristguards of Triumph
+(@KORALON25,41294,0,1,1,1,1), -- Relentless Gladiator's Wyrmhide Gloves
+(@KORALON25,41305,0,1,1,1,1), -- Relentless Gladiator's Wyrmhide Legguards
+(@KORALON25,48094,0,1,1,1,1), -- Zabra's Pants of Triumph
+(@KORALON25,48064,0,1,1,1,1), -- Zabra's Leggings of Triumph
+(@KORALON25,48096,0,1,1,1,1), -- Zabra's Handwraps of Triumph
+(@KORALON25,48066,0,1,1,1,1), -- Zabra's Gloves of Triumph
+(@KORALON25,48271,0,1,1,1,1), -- Windrunner's Legguards of Triumph
+(@KORALON25,48273,0,1,1,1,1), -- Windrunner's Handguards of Triumph
+(@KORALON25,48362,0,1,1,1,1), -- Thrall's War-Kilt of Triumph
+(@KORALON25,48303,0,1,1,1,1), -- Thrall's Legguards of Triumph
+(@KORALON25,48332,0,1,1,1,1), -- Thrall's Kilt of Triumph
+(@KORALON25,48301,0,1,1,1,1), -- Thrall's Handguards of Triumph
+(@KORALON25,48364,0,1,1,1,1), -- Thrall's Grips of Triumph
+(@KORALON25,48334,0,1,1,1,1), -- Thrall's Gloves of Triumph
+(@KORALON25,47770,0,1,1,1,1), -- Sunstrider's Leggings of Triumph
+(@KORALON25,47772,0,1,1,1,1), -- Sunstrider's Gauntlets of Triumph
+(@KORALON25,48180,0,1,1,1,1), -- Runetotem's Trousers of Triumph
+(@KORALON25,48195,0,1,1,1,1), -- Runetotem's Legguards of Triumph
+(@KORALON25,48150,0,1,1,1,1), -- Runetotem's Leggings of Triumph
+(@KORALON25,48152,0,1,1,1,1), -- Runetotem's Handguards of Triumph
+(@KORALON25,48193,0,1,1,1,1), -- Runetotem's Handgrips of Triumph
+(@KORALON25,48182,0,1,1,1,1), -- Runetotem's Gloves of Triumph
+(@KORALON25,48623,0,1,1,1,1), -- Liadrin's Legplates of Triumph
+(@KORALON25,48660,0,1,1,1,1), -- Liadrin's Legguards of Triumph
+(@KORALON25,48658,0,1,1,1,1), -- Liadrin's Handguards of Triumph
+(@KORALON25,48591,0,1,1,1,1), -- Liadrin's Greaves of Triumph
+(@KORALON25,48593,0,1,1,1,1), -- Liadrin's Gloves of Triumph
+(@KORALON25,48625,0,1,1,1,1), -- Liadrin's Gauntlets of Triumph
+(@KORALON25,48497,0,1,1,1,1), -- Koltira's Legplates of Triumph
+(@KORALON25,48554,0,1,1,1,1), -- Koltira's Legguards of Triumph
+(@KORALON25,48556,0,1,1,1,1), -- Koltira's Handguards of Triumph
+(@KORALON25,48499,0,1,1,1,1), -- Koltira's Gauntlets of Triumph
+(@KORALON25,48394,0,1,1,1,1), -- Hellscream's Legplates of Triumph
+(@KORALON25,48464,0,1,1,1,1), -- Hellscream's Legguards of Triumph
+(@KORALON25,48462,0,1,1,1,1), -- Hellscream's Handguards of Triumph
+(@KORALON25,48392,0,1,1,1,1), -- Hellscream's Gauntlets of Triumph
+(@KORALON25,47805,0,1,1,1,1), -- Gul'dan's Leggings of Triumph
+(@KORALON25,47803,0,1,1,1,1), -- Gul'dan's Gloves of Triumph
+(@KORALON25,48239,0,1,1,1,1), -- Garona's Legplates of Triumph
+(@KORALON25,48241,0,1,1,1,1), -- Garona's Gauntlets of Triumph
+(@KORALON25,48379,0,1,2,1,1), -- Wrynn's Legplates of Triumph
+(@KORALON25,48446,0,1,2,1,1), -- Wrynn's Legguards of Triumph
+(@KORALON25,48452,0,1,2,1,1), -- Wrynn's Handguards of Triumph
+(@KORALON25,48377,0,1,2,1,1), -- Wrynn's Gauntlets of Triumph
+(@KORALON25,48258,0,1,2,1,1), -- Windrunner's Legguards of Triumph
+(@KORALON25,48256,0,1,2,1,1), -- Windrunner's Handguards of Triumph
+(@KORALON25,48079,0,1,2,1,1), -- Velen's Pants of Triumph
+(@KORALON25,48077,0,1,2,1,1), -- Velen's Handwraps of Triumph
+(@KORALON25,47983,0,1,2,1,1), -- Velen's Gloves of Triumph
+(@KORALON25,48226,0,1,2,1,1), -- VanCleef's Legplates of Triumph
+(@KORALON25,48224,0,1,2,1,1), -- VanCleef's Gauntlets of Triumph
+(@KORALON25,48610,0,1,2,1,1), -- Turalyon's Legplates of Triumph
+(@KORALON25,48638,0,1,2,1,1), -- Turalyon's Legguards of Triumph
+(@KORALON25,48640,0,1,2,1,1), -- Turalyon's Handguards of Triumph
+(@KORALON25,48578,0,1,2,1,1), -- Turalyon's Greaves of Triumph
+(@KORALON25,48576,0,1,2,1,1), -- Turalyon's Gloves of Triumph
+(@KORALON25,48608,0,1,2,1,1), -- Turalyon's Gauntlets of Triumph
+(@KORALON25,48484,0,1,2,1,1), -- Thassarian's Legplates of Triumph
+(@KORALON25,48541,0,1,2,1,1), -- Thassarian's Legguards of Triumph
+(@KORALON25,48539,0,1,2,1,1), -- Thassarian's Handguards of Triumph
+(@KORALON25,48482,0,1,2,1,1), -- Thassarian's Gauntlets of Triumph
+(@KORALON25,48349,0,1,2,1,1), -- Nobundo's War-Kilt of Triumph
+(@KORALON25,48288,0,1,2,1,1), -- Nobundo's Legguards of Triumph
+(@KORALON25,48319,0,1,2,1,1), -- Nobundo's Kilt of Triumph
+(@KORALON25,48286,0,1,2,1,1), -- Nobundo's Handguards of Triumph
+(@KORALON25,48347,0,1,2,1,1), -- Nobundo's Grips of Triumph
+(@KORALON25,48317,0,1,2,1,1), -- Nobundo's Gloves of Triumph
+(@KORALON25,48165,0,1,2,1,1), -- Malfurion's Trousers of Triumph
+(@KORALON25,48210,0,1,2,1,1), -- Malfurion's Legguards of Triumph
+(@KORALON25,48135,0,1,2,1,1), -- Malfurion's Leggings of Triumph
+(@KORALON25,48133,0,1,2,1,1), -- Malfurion's Handguards of Triumph
+(@KORALON25,48212,0,1,2,1,1), -- Malfurion's Handgrips of Triumph
+(@KORALON25,48163,0,1,2,1,1), -- Malfurion's Gloves of Triumph
+(@KORALON25,47755,0,1,2,1,1), -- Khadgar's Leggings of Triumph
+(@KORALON25,47753,0,1,2,1,1), -- Khadgar's Gauntlets of Triumph
+(@KORALON25,47780,0,1,2,1,1), -- Kel'Thuzad's Leggings of Triumph
+(@KORALON25,47782,0,1,2,1,1), -- Kel'Thuzad's Gloves of Triumph
+(@KORALON25,47985,0,1,2,1,1); -- Velen's Leggings of Triumph
+-- Merge PVP and PVE items to one ref
+UPDATE `reference_loot_template` SET `entry`=@TORAVON25 WHERE `entry`=34214; -- 25 Toravon
+UPDATE `reference_loot_template` SET `entry`=@TORAVON10 WHERE `entry`=34213; -- 10 Toravon
+UPDATE `reference_loot_template` SET `entry`=@ARCHAVON10 WHERE `entry`=34210; -- 10 Archavon
+UPDATE `reference_loot_template` SET `entry`=@EMALON10 WHERE `entry`=34211; -- 10 Emalon
+UPDATE `reference_loot_template` SET `entry`=@KORALON10 WHERE `entry`=34212; -- 10 Koralon
+-- Assign to cratures
+SET @Tora10 =38433;
+SET @Tora25 =38462;
+SET @Arch10 =31125;
+SET @Arch25 =31722;
+SET @Emal10 =33993;
+SET @Emal25 =33994;
+SET @Kora10 =35013;
+SET @Kora25 =35360;
+DELETE FROM `creature_loot_template` WHERE `entry`IN (@Tora10,@Tora25,@Arch10,@Arch25,@Emal10,@Emal25,@Kora10,@Kora25);
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- Update loot template for Toravon 10
+(@Tora10,47241,100,1,0,2,2), -- Emblem of triumph
+(@Tora10,1,100,1,0,-@TORAVON10,2), -- Gear(Relentless PVP,T10 PVE)
+(@Tora10,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Toravon 25 to drop 3 items
+(@Tora25,49426,100,1,0,2,2), -- Emblem of frost
+(@Tora25,1,100,1,0,-@TORAVON25,3), -- Gear(Wrathful PVP,T10.5 PVE)
+(@Tora25,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Archavon 10
+(@Arch10,47241,100,1,0,2,2), -- Emblem of triumph
+(@Arch10,1,100,1,0,-@ARCHAVON10,2), -- Gear(Hate PVP,T7 PVE)
+(@Arch10,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Archavon 25
+(@Arch25,47241,100,1,0,2,2), -- Emblem of triumph
+(@Arch25,1,100,1,0,-@ARCHAVON25,4), -- Gear(Deadly PVP,T7(25) PVE)
+(@Arch25,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Emalon 10
+(@Emal10,47241,100,1,0,2,2), -- Emblem of triumph
+(@Emal10,1,100,1,0,-@EMALON10,2), -- Gear(Deadly PVP,T8 PVE)
+(@Emal10,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Emalon 25
+(@Emal25,47241,100,1,0,2,2), -- Emblem of triumph
+(@Emal25,1,100,1,0,-@EMALON25,4), -- Gear(Deadly PVP,T8(25) PVE)
+(@Emal25,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Koralon 10
+(@Kora10,47241,100,1,0,2,2), -- Emblem of triumph
+(@Kora10,1,100,1,0,-@KORALON10,2), -- Gear(Furious PVP,T9 PVE)
+(@Kora10,2,1,1,0,-34203,1), -- Mount
+-- Update loot template for Koralon 25
+(@Kora25,47241,100,1,0,2,2), -- Emblem of triumph
+(@Kora25,1,100,1,0,-@KORALON25,4), -- Gear(Relentless PVP,T9.5 PVE)
+(@Kora25,2,1,1,0,-34203,1); -- Mount
diff --git a/sql/updates/world/2012_09_22_00_world_utgarde.sql b/sql/updates/world/2012_09_22_00_world_utgarde.sql
new file mode 100644
index 00000000000..83cc227f9cd
--- /dev/null
+++ b/sql/updates/world/2012_09_22_00_world_utgarde.sql
@@ -0,0 +1,102 @@
+-- Frenzied geist
+DELETE FROM `creature_loot_template` WHERE `entry`=31671;
+-- Savage worg
+DELETE FROM `creature_loot_template` WHERE `entry`=31678 AND `item` IN(39211,39212,33454);
+INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `mincountOrRef`, `maxcount`) VALUES
+(31678,39211,70,3,5),
+(31678,39212,16,2,4),
+(31678,33454, 3,1,1);
+
+-- Keleseth
+UPDATE `creature_template` SET `mechanic_immune_mask`=617289692 WHERE `entry` IN(23953,30748);
+-- Tunneling ghoul
+DELETE FROM `creature_loot_template` WHERE `entry`=31681;
+-- Dalronn heartsplitter
+UPDATE `creature_template` SET `mindmg`=380,`maxdmg`=580,`attackpower`=0,`dmg_multiplier`=10 WHERE `entry`=31660;
+-- Frenzied geist
+UPDATE `creature_template` SET `lootid`=28419 WHERE `entry`=31671;
+UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=28419;
+-- Skarvald the constructor - On level 81 health fits/is blizzlike, depending on wowhead his level range is 72 - 81
+UPDATE `creature_template` SET `minlevel`=81,`maxlevel`=81 WHERE `entry`=31679;
+-- Tunneling ghoul
+UPDATE `creature_template` SET `lootid`=24084 WHERE `entry`=31681;
+-- Dragonflayer runecaster
+UPDATE `creature_template` SET `ScriptName`='',`AIName`='SmartAI' WHERE `entry`=23960;
+-- Dragonflayer strategist
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_flags`=`unit_flags`|131072 WHERE `entry`=32246;
+-- Ingvar and undead Ingvar
+UPDATE `creature_template` SET `mindmg`=650,`maxdmg`=900,`attackpower`=200, `dmg_multiplier`=10 WHERE `entry` IN(31673,31674);
+UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|1 WHERE `entry` IN(23954,31673,23980,31674);
+-- Throw axe dummy
+UPDATE `creature_template` SET `unit_flags`=2|131072|33554432, `flags_extra`=`flags_extra`|2, `equipment_id`=720 WHERE `entry` IN(23997,31835);
+-- Throw axe target
+UPDATE `creature_template` SET `unit_flags`=2|4|256|512, `faction_A`=35, `faction_H`=35, `flags_extra`=`flags_extra`|128 WHERE `entry`=23996;
+
+-- Dragonflayer runecaster
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=23960;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=23960 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `id`, `event_type`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `target_type`, `target_param2`, `comment`) VALUES
+(23960,1,0,2,5000,7000,14000,17000,11,42740,11,30,'Dragonflayer Runecaster - In combat - Cast Njords Rune of Protection'),
+(23960,2,0,4,5000,7000,14000,17000,11,59616,11,30,'Dragonflayer Runecaster - In combat - Cast Njords Rune of Protection'),
+(23960,3,0,2,1000,2000,15000,18000,11,54965, 1, 0,'Dragonflayer Runecaster - In combat - Cast Bolthorns Rune of Flame'),
+(23960,4,0,4,1000,2000,15000,18000,11,59617, 1, 0,'Dragonflayer Runecaster - In combat - Cast Bolthorns Rune of Flame');
+
+-- Frenzied geist
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=28419;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=28419 AND `source_type`=0;
+INSERT INTO `smart_scripts`(`entryorguid`,`event_type`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`target_type`,`comment`) VALUES
+(28419,0,5000,5000,30000,30000,11,40414,5,'Frenzied geist - In combat - Cast Fixate');
+
+-- Difficulty data for spells used in utgarde keep
+DELETE FROM `spelldifficulty_dbc` WHERE `id` IN(42669,42708,42750,42723,42729,43667,42702) OR `spellid0` IN(42669,42708,42750,42723,42729,43667,42702);
+INSERT INTO `spelldifficulty_dbc`(`id`,`spellid0`,`spellid1`) VALUES
+(42669,42669,59706), -- Smash
+(42708,42708,59708), -- Staggering Roar
+(42750,42750,59719), -- Throw Axe
+(42723,42723,59709), -- Dark Smash
+(42729,42729,59734), -- Dreadful Roar
+(43667,43667,59389), -- Shadow Bolt
+(42702,42702,59397); -- Decrepify
+
+-- Ticking Time Bomb, Fixate
+DELETE FROM `spell_script_names` WHERE `spell_id` IN(59686,40414);
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(59686,'spell_ticking_time_bomb'),
+(40414,'spell_fixate');
+
+-- Proto-drake striders
+UPDATE `creature` SET `position_x`=212.429,`position_y`=-127.793,`position_z`=256.101,`MovementType`=2 WHERE `guid`=125914;
+UPDATE `creature` SET `position_x`=211.854,`position_y`=-112.602,`position_z`=262.188,`MovementType`=2 WHERE `guid`=125915;
+UPDATE `creature` SET `position_x`=211.024,`position_y`=-100.299,`position_z`=266.201,`MovementType`=2 WHERE `guid`=125920;
+UPDATE `creature` SET `position_x`=213.777,`position_y`=-140.709,`position_z`=251.048,`MovementType`=2 WHERE `guid`=125922;
+UPDATE `creature` SET `position_x`=252.247,`position_y`=-350.532,`position_z`=185.813,`MovementType`=2 WHERE `guid`=125934;
+UPDATE `creature` SET `position_x`=243.964,`position_y`=-194.833,`position_z`=227.126,`MovementType`=2 WHERE `guid`=125936;
+UPDATE `creature` SET `position_x`=221.534,`position_y`=-239.809,`position_z`=196.459,`MovementType`=2 WHERE `guid`=125937;
+UPDATE `creature` SET `position_x`=238.382,`position_y`=-353.086,`position_z`=188.785,`MovementType`=2 WHERE `guid`=125940;
+
+-- Waypoint assignments
+DELETE FROM `creature_addon` WHERE `guid` IN (125940,125934,125915,125920,125914,125936,125937,125922);
+INSERT INTO `creature_addon`(`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(125914,1259140,22657,50331648,1,'54775'),
+(125915,1259150,22657,50331648,1,'54775'),
+(125920,1259200,22657,50331648,1,'54775'),
+(125922,1259220,22657,50331648,1,'54775'),
+(125934,1259340,22657,50331648,1,'54775'),
+(125936,1259360,22657,50331648,1,'54775'),
+(125937,1259370,22657,50331648,1,'54775'),
+(125940,1259400,22657,50331648,1,'54775');
+
+-- Waypoint data
+DELETE FROM `waypoint_data` WHERE `id` IN (1259400,1259340,1259150,1259200,1259140,1259360,1259370,1259220);
+INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES
+(1259400,1,211.864,-352.629,196.144),
+(1259340,1,271.911,-318.506,185.049),
+(1259150,1,265.478,-199.246,186.812),
+(1259200,1,346.765,-99.2527,220.519),
+(1259140,1,295.597,-181.162,207.374),
+(1259360,1,271.68,-194.911,220.248),
+(1259370,1,238.947,-255.704,191.639),
+(1259220,1,149.42,-247.696,194.145);
+
+INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`)
+SELECT `guid`*10,2,`position_x`,`position_y`,`position_z` FROM `creature` WHERE `guid` IN (125940,125934,125915,125920,125914,125936,125937,125922);
diff --git a/sql/updates/world/2012_09_22_01_world_i_was_a_lot_of_things.sql b/sql/updates/world/2012_09_22_01_world_i_was_a_lot_of_things.sql
new file mode 100644
index 00000000000..1682d9f699b
--- /dev/null
+++ b/sql/updates/world/2012_09_22_01_world_i_was_a_lot_of_things.sql
@@ -0,0 +1,32 @@
+-- Quest: I was a lot of things
+UPDATE `creature_template` SET `AIName`='',`ScriptName`='npc_shadowmoon_tuber_node',`flags_extra`=`flags_extra`|128 WHERE `entry`=21347;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=36652;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES
+(13,1,36652,31,3,21347,'Tuber Whistle targets Shadowmoon Valley Tuber Node');
+
+UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=21195;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=21195;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=21195 AND `source_type`=0;
+INSERT INTO `smart_scripts`(`entryorguid`,`id`,`link`,`event_type`,`event_param2`,`action_type`,`action_param1`,`action_param2`,`target_type`,`target_param1`,`target_param2`,`comment`) VALUES
+(21195,1,0,34,1,24,0,0, 1, 0,0, 'Domesticated Felboar - Movementinform - Evade (Required for core script npc_shadowmoon_tuber_node)'),
+(21195,2,0,34,1,45,1,1,11,21347,5, 'Domesticated Felboar - Movementinform - Set data (Required for core script npc_shadowmoon_tuber_node)');
+
+SET @TRIGGER_GUID = 77821; -- 10
+SET @BOAR_GUID = 77832; -- 8
+
+DELETE FROM `creature` WHERE `id`=21347 OR `guid` BETWEEN @TRIGGER_GUID AND @TRIGGER_GUID + 9;
+SET @TRIGGER_GUID = @TRIGGER_GUID - 1;
+INSERT INTO `creature`(`guid`,`id`,`map`,`phaseMask`,`position_x`,`position_y`,`position_z`)
+SELECT (SELECT @TRIGGER_GUID:=@TRIGGER_GUID+1),21347,`map`,3,`position_x`,`position_y`,`position_z` FROM `gameobject` WHERE `id`=184701 LIMIT 10;
+
+DELETE FROM `creature` WHERE (`id`=21195 AND `map`=530) OR `guid` BETWEEN @BOAR_GUID AND @BOAR_GUID + 7;
+INSERT INTO `creature`(`guid`,`id`,`map`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`curhealth`,`MovementType`) VALUES
+(@BOAR_GUID ,21195,530,-2506.78,1190.22,55.9496,4.15084,300,5,6116,1),
+(@BOAR_GUID+1,21195,530,-2486.92,1326.49,64.4239,5.31872,300,5,6116,1),
+(@BOAR_GUID+2,21195,530,-2476.05,1284.68,48.0809,1.20087,300,5,5914,1),
+(@BOAR_GUID+3,21195,530,-2476.74,1228.44,40.4087,3.72907,300,5,5914,1),
+(@BOAR_GUID+4,21195,530,-2549.03,1162.94,78.8947,1.48754,300,5,6116,1),
+(@BOAR_GUID+5,21195,530,-2553.91,1186.80,78.5604,1.17575,300,5,6116,1),
+(@BOAR_GUID+6,21195,530,-2694.88,1495.00,19.2922,2.33106,300,5,5914,1),
+(@BOAR_GUID+7,21195,530,-2706.26,1538.41,16.6343,1.96146,300,5,5914,1);
diff --git a/sql/updates/world/2012_09_22_03_world_game_event.sql b/sql/updates/world/2012_09_22_03_world_game_event.sql
new file mode 100644
index 00000000000..5e05ba03898
--- /dev/null
+++ b/sql/updates/world/2012_09_22_03_world_game_event.sql
@@ -0,0 +1,2 @@
+-- Brewfest (372) duration fix by nelegalno
+UPDATE `game_event` SET `length` = 21600 WHERE `eventEntry` = 24;
diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp
index ace18e7b45c..bdb96ca0d25 100644
--- a/src/server/authserver/Authentication/AuthCodes.cpp
+++ b/src/server/authserver/Authentication/AuthCodes.cpp
@@ -16,15 +16,36 @@
*/
#include "AuthCodes.h"
+#include <cstddef>
namespace AuthHelper
{
- bool IsPreBCAcceptedClientBuild(int build)
+ static RealmBuildInfo const PostBcAcceptedClientBuilds[] =
+ {
+ {15595, 4, 3, 4, ' '},
+ {14545, 4, 2, 2, ' '},
+ {13623, 4, 0, 6, 'a'},
+ {12340, 3, 3, 5, 'a'},
+ {11723, 3, 3, 3, 'a'},
+ {11403, 3, 3, 2, ' '},
+ {11159, 3, 3, 0, 'a'},
+ {10505, 3, 2, 2, 'a'},
+ {9947, 3, 1, 3, ' '},
+ {8606, 2, 4, 3, ' '},
+ {0, 0, 0, 0, ' '} // terminator
+ };
+
+ static RealmBuildInfo const PreBcAcceptedClientBuilds[] =
{
- int accepted_versions[] = PRE_BC_ACCEPTED_CLIENT_BUILD;
+ {6005, 1, 12, 2, ' '},
+ {5875, 1, 12, 1, ' '},
+ {0, 0, 0, 0, ' '} // terminator
+ };
- for (int i = 0; accepted_versions[i]; ++i)
- if (build == accepted_versions[i])
+ bool IsPreBCAcceptedClientBuild(int build)
+ {
+ for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i)
+ if (PreBcAcceptedClientBuilds[i].Build == build)
return true;
return false;
@@ -32,10 +53,8 @@ namespace AuthHelper
bool IsPostBCAcceptedClientBuild(int build)
{
- int accepted_versions[] = POST_BC_ACCEPTED_CLIENT_BUILD;
-
- for (int i = 0; accepted_versions[i]; ++i)
- if (build == accepted_versions[i])
+ for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i)
+ if (PostBcAcceptedClientBuilds[i].Build == build)
return true;
return false;
@@ -45,4 +64,17 @@ namespace AuthHelper
{
return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build));
}
+
+ RealmBuildInfo const* GetBuildInfo(int build)
+ {
+ for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i)
+ if (PostBcAcceptedClientBuilds[i].Build == build)
+ return &PostBcAcceptedClientBuilds[i];
+
+ for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i)
+ if (PreBcAcceptedClientBuilds[i].Build == build)
+ return &PreBcAcceptedClientBuilds[i];
+
+ return NULL;
+ }
};
diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h
index f940d459d40..148225377ff 100755
--- a/src/server/authserver/Authentication/AuthCodes.h
+++ b/src/server/authserver/Authentication/AuthCodes.h
@@ -65,9 +65,6 @@ enum LoginResult
LOGIN_LOCKED_ENFORCED = 0x10,
};
-#define POST_BC_ACCEPTED_CLIENT_BUILD {12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0}
-#define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0}
-
enum ExpansionFlags
{
POST_BC_EXP_FLAG = 0x2,
@@ -75,8 +72,18 @@ enum ExpansionFlags
NO_VALID_EXP_FLAG = 0x0
};
+struct RealmBuildInfo
+{
+ int Build;
+ int MajorVersion;
+ int MinorVersion;
+ int BugfixVersion;
+ int HotfixVersion;
+};
+
namespace AuthHelper
{
+ RealmBuildInfo const* GetBuildInfo(int build);
bool IsAcceptedClientBuild(int build);
bool IsPostBCAcceptedClientBuild(int build);
bool IsPreBCAcceptedClientBuild(int build);
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 01a33d836d6..ed0fa9ab06a 100755
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -63,7 +63,7 @@ public:
/// Print out the usage string for this program on the console.
void usage(const char *prog)
{
- sLog->outString("Usage: \n %s [<options>]\n"
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Usage: \n %s [<options>]\n"
" -c config_file use config_file as configuration file\n\r",
prog);
}
@@ -71,7 +71,6 @@ void usage(const char *prog)
// Launch the auth server
extern int main(int argc, char **argv)
{
- sLog->SetLogDB(false);
// Command line parsing to get the configuration file name
char const* cfg_file = _TRINITY_REALM_CONFIG;
int c = 1;
@@ -81,7 +80,7 @@ extern int main(int argc, char **argv)
{
if (++c >= argc)
{
- sLog->outError("Runtime-Error: -c option requires an input argument");
+ printf("Runtime-Error: -c option requires an input argument");
usage(argv[0]);
return 1;
}
@@ -93,17 +92,16 @@ extern int main(int argc, char **argv)
if (!ConfigMgr::Load(cfg_file))
{
- sLog->outError("Invalid or missing configuration file : %s", cfg_file);
- sLog->outError("Verify that the file exists and has \'[authserver]\' written in the top of the file!");
+ printf("Invalid or missing configuration file : %s", cfg_file);
+ printf("Verify that the file exists and has \'[authserver]\' written in the top of the file!");
return 1;
}
- sLog->Initialize();
- sLog->outString("%s (authserver)", _FULLVERSION);
- sLog->outString("<Ctrl-C> to stop.\n");
- sLog->outString("Using configuration file %s.", cfg_file);
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "%s (authserver)", _FULLVERSION);
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "<Ctrl-C> to stop.\n");
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Using configuration file %s.", cfg_file);
- sLog->outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
+ sLog->outWarn(LOG_FILTER_AUTHSERVER, "%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
#if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL)
ACE_Reactor::instance(new ACE_Reactor(new ACE_Dev_Poll_Reactor(ACE::max_handles(), 1), 1), true);
@@ -111,7 +109,7 @@ extern int main(int argc, char **argv)
ACE_Reactor::instance(new ACE_Reactor(new ACE_TP_Reactor(), true), true);
#endif
- sLog->outBasic("Max allowed open files is %d", ACE::max_handles());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Max allowed open files is %d", ACE::max_handles());
// authserver PID file creation
std::string pidfile = ConfigMgr::GetStringDefault("PidFile", "");
@@ -120,41 +118,43 @@ extern int main(int argc, char **argv)
uint32 pid = CreatePIDFile(pidfile);
if (!pid)
{
- sLog->outError("Cannot create PID file %s.\n", pidfile.c_str());
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Cannot create PID file %s.\n", pidfile.c_str());
return 1;
}
-
- sLog->outString("Daemon PID: %u\n", pid);
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Daemon PID: %u\n", pid);
}
// Initialize the database connection
if (!StartDB())
return 1;
- // Initialize the log database
- sLog->SetLogDBLater(ConfigMgr::GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished.
- sLog->SetLogDB(false);
sLog->SetRealmID(0); // ensure we've set realm to 0 (authserver realmid)
// Get the list of realms for the server
sRealmList->Initialize(ConfigMgr::GetIntDefault("RealmsStateUpdateDelay", 20));
if (sRealmList->size() == 0)
{
- sLog->outError("No valid realms specified.");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "No valid realms specified.");
return 1;
}
// Launch the listening network socket
RealmAcceptor acceptor;
- uint16 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724);
+ int32 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724);
+ if (rmport < 0 || rmport > 0xFFFF)
+ {
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Specified port out of allowed range (1-65535)");
+ return 1;
+ }
+
std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
- ACE_INET_Addr bind_addr(rmport, bind_ip.c_str());
+ ACE_INET_Addr bind_addr(uint16(rmport), bind_ip.c_str());
if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1)
{
- sLog->outError("Auth server can not bind to %s:%d", bind_ip.c_str(), rmport);
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Auth server can not bind to %s:%d", bind_ip.c_str(), rmport);
return 1;
}
@@ -182,13 +182,13 @@ extern int main(int argc, char **argv)
ULONG_PTR curAff = Aff & appAff; // remove non accessible processors
if (!curAff)
- sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for authserver. Accessible processors bitmask (hex): %x", Aff, appAff);
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Processors marked in UseProcessors bitmask (hex) %x not accessible for authserver. Accessible processors bitmask (hex): %x", Aff, appAff);
else if (SetProcessAffinityMask(hProcess, curAff))
- sLog->outString("Using processors (bitmask, hex): %x", curAff);
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Using processors (bitmask, hex): %x", curAff);
else
- sLog->outError("Can't set used processors (hex): %x", curAff);
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Can't set used processors (hex): %x", curAff);
}
- sLog->outString();
+
}
bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false);
@@ -196,10 +196,10 @@ extern int main(int argc, char **argv)
if (Prio)
{
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
- sLog->outString("The auth server process priority class has been set to HIGH");
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "The auth server process priority class has been set to HIGH");
else
- sLog->outError("Can't set auth server process priority class.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Can't set auth server process priority class.");
+
}
}
#endif
@@ -208,17 +208,6 @@ extern int main(int argc, char **argv)
uint32 numLoops = (ConfigMgr::GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000));
uint32 loopCounter = 0;
- // possibly enable db logging; avoid massive startup spam by doing it here.
- if (sLog->GetLogDBLater())
- {
- sLog->outString("Enabling database logging...");
- sLog->SetLogDBLater(false);
- // login db needs thread for logging
- sLog->SetLogDB(true);
- }
- else
- sLog->SetLogDB(false);
-
// Wait for termination signal
while (!stopEvent)
{
@@ -231,7 +220,7 @@ extern int main(int argc, char **argv)
if ((++loopCounter) == numLoops)
{
loopCounter = 0;
- sLog->outDetail("Ping MySQL to keep connection alive");
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Ping MySQL to keep connection alive");
LoginDatabase.KeepAlive();
}
}
@@ -239,7 +228,7 @@ extern int main(int argc, char **argv)
// Close the Database Pool and library
StopDB();
- sLog->outString("Halting process...");
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Halting process...");
return 0;
}
@@ -251,31 +240,33 @@ bool StartDB()
std::string dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("Database not specified");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Database not specified");
return false;
}
- uint8 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
+ int32 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (worker_threads < 1 || worker_threads > 32)
{
- sLog->outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
worker_threads = 1;
}
- uint8 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1);
+ int32 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1);
if (synch_threads < 1 || synch_threads > 32)
{
- sLog->outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
synch_threads = 1;
}
// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever.
- if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads))
+ if (!LoginDatabase.Open(dbstring.c_str(), uint8(worker_threads), uint8(synch_threads)))
{
- sLog->outError("Cannot connect to database");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Cannot connect to database");
return false;
}
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Started auth database connection pool.");
+ sLog->EnableDBAppenders();
return true;
}
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
index d988b940809..453efd5bf72 100755
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -68,7 +68,7 @@ void RealmList::UpdateIfNeed()
void RealmList::UpdateRealms(bool init)
{
- sLog->outDetail("Updating Realm List...");
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Updating Realm List...");
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -93,7 +93,7 @@ void RealmList::UpdateRealms(bool init)
UpdateRealm(realmId, name, address, port, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
if (init)
- sLog->outString("Added realm \"%s\".", fields[1].GetCString());
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Added realm \"%s\".", fields[1].GetCString());
}
while (result->NextRow());
}
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index 15555e4d607..fc4d4dfcc9b 100755
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -196,7 +196,7 @@ const AuthHandler table[] =
Patcher PatchesCache;
// Constructor - set the N and g values for SRP6
-AuthSocket::AuthSocket(RealmSocket& socket) : socket_(socket)
+AuthSocket::AuthSocket(RealmSocket& socket) : pPatch(NULL), socket_(socket)
{
N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
g.SetDword(7);
@@ -210,12 +210,12 @@ AuthSocket::~AuthSocket(void) {}
// Accept the connection and set the s random value for SRP6
void AuthSocket::OnAccept(void)
{
- sLog->outBasic("'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort());
}
void AuthSocket::OnClose(void)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "AuthSocket::OnClose");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "AuthSocket::OnClose");
}
// Read the packet from the client
@@ -234,11 +234,11 @@ void AuthSocket::OnRead()
{
if ((uint8)table[i].cmd == _cmd && (table[i].status == STATUS_CONNECTED || (_authed && table[i].status == STATUS_AUTHED)))
{
- sLog->outStaticDebug("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
if (!(*this.*table[i].handler)())
{
- sLog->outStaticDebug("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
return;
}
break;
@@ -248,7 +248,7 @@ void AuthSocket::OnRead()
// Report unknown packets in the error log
if (i == AUTH_TOTAL_COMMANDS)
{
- sLog->outError("[Auth] got unknown packet from '%s'", socket().getRemoteAddress().c_str());
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Got unknown packet from '%s'", socket().getRemoteAddress().c_str());
socket().shutdown();
return;
}
@@ -297,7 +297,7 @@ void AuthSocket::_SetVSFields(const std::string& rI)
// Logon Challenge command handler
bool AuthSocket::_HandleLogonChallenge()
{
- sLog->outStaticDebug("Entering _HandleLogonChallenge");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleLogonChallenge");
if (socket().recv_len() < sizeof(sAuthLogonChallenge_C))
return false;
@@ -312,7 +312,7 @@ bool AuthSocket::_HandleLogonChallenge()
#endif
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
- sLog->outStaticDebug("[AuthChallenge] got header, body is %#04x bytes", remaining);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] got header, body is %#04x bytes", remaining);
if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining))
return false;
@@ -324,8 +324,8 @@ bool AuthSocket::_HandleLogonChallenge()
// Read the remaining of the packet
socket().recv((char *)&buf[4], remaining);
- sLog->outStaticDebug("[AuthChallenge] got full packet, %#04x bytes", ch->size);
- sLog->outStaticDebug("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] got full packet, %#04x bytes", ch->size);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
// BigEndian code, nop in little endian case
// size already converted
@@ -343,7 +343,7 @@ bool AuthSocket::_HandleLogonChallenge()
_login = (const char*)ch->I;
_build = ch->build;
- _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG);
+ _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG));
_os = (const char*)ch->os;
if (_os.size() > 4)
@@ -352,20 +352,20 @@ bool AuthSocket::_HandleLogonChallenge()
// Restore string order as its byte order is reversed
std::reverse(_os.begin(), _os.end());
- pkt << (uint8)AUTH_LOGON_CHALLENGE;
- pkt << (uint8)0x00;
+ pkt << uint8(AUTH_LOGON_CHALLENGE);
+ pkt << uint8(0x00);
// Verify that this IP is not in the ip_banned table
LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
- const std::string& ip_address = socket().getRemoteAddress();
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED);
+ std::string const& ip_address = socket().getRemoteAddress();
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED);
stmt->setString(0, ip_address);
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
{
- pkt << (uint8)WOW_FAIL_BANNED;
- sLog->outBasic("'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort());
+ pkt << uint8(WOW_FAIL_BANNED);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort());
}
else
{
@@ -383,20 +383,20 @@ bool AuthSocket::_HandleLogonChallenge()
bool locked = false;
if (fields[2].GetUInt8() == 1) // if ip is locked
{
- sLog->outStaticDebug("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString());
- sLog->outStaticDebug("[AuthChallenge] Player address is '%s'", ip_address.c_str());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Player address is '%s'", ip_address.c_str());
if (strcmp(fields[3].GetCString(), ip_address.c_str()))
{
- sLog->outStaticDebug("[AuthChallenge] Account IP differs");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP differs");
pkt << (uint8) WOW_FAIL_SUSPENDED;
locked = true;
}
else
- sLog->outStaticDebug("[AuthChallenge] Account IP matches");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP matches");
}
else
- sLog->outStaticDebug("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
if (!locked)
{
@@ -409,15 +409,15 @@ bool AuthSocket::_HandleLogonChallenge()
PreparedQueryResult banresult = LoginDatabase.Query(stmt);
if (banresult)
{
- if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64())
+ if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32())
{
- pkt << (uint8)WOW_FAIL_BANNED;
- sLog->outBasic("'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
+ pkt << uint8(WOW_FAIL_BANNED);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
}
else
{
- pkt << (uint8)WOW_FAIL_SUSPENDED;
- sLog->outBasic("'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
+ pkt << uint8(WOW_FAIL_SUSPENDED);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
}
}
else
@@ -450,7 +450,10 @@ bool AuthSocket::_HandleLogonChallenge()
unk3.SetRand(16 * 8);
// Fill the response packet with the result
- pkt << uint8(WOW_SUCCESS);
+ if (AuthHelper::IsAcceptedClientBuild(_build))
+ pkt << uint8(WOW_SUCCESS);
+ else
+ pkt << uint8(WOW_FAIL_VERSION_INVALID);
// B may be calculated < 32B so we force minimal length to 32B
pkt.append(B.AsByteArray(32), 32); // 32 bytes
@@ -488,7 +491,7 @@ bool AuthSocket::_HandleLogonChallenge()
for (int i = 0; i < 4; ++i)
_localizationName[i] = ch->country[4-i-1];
- sLog->outBasic("'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(),
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(),
_login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName)
);
}
@@ -505,7 +508,7 @@ bool AuthSocket::_HandleLogonChallenge()
// Logon Proof command handler
bool AuthSocket::_HandleLogonProof()
{
- sLog->outStaticDebug("Entering _HandleLogonProof");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleLogonProof");
// Read the packet
sAuthLogonProof_C lp;
@@ -600,7 +603,7 @@ bool AuthSocket::_HandleLogonProof()
// Check if SRP6 results match (password is correct), else send an error
if (!memcmp(M.AsByteArray(), lp.M1, 20))
{
- sLog->outBasic("'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
// Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account
// No SQL injection (escaped user name) and IP address as received by socket
@@ -649,7 +652,7 @@ bool AuthSocket::_HandleLogonProof()
char data[4] = { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0 };
socket().send(data, sizeof(data));
- sLog->outBasic("'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
uint32 MaxWrongPassCount = ConfigMgr::GetIntDefault("WrongPass.MaxCount", 0);
if (MaxWrongPassCount > 0)
@@ -679,7 +682,7 @@ bool AuthSocket::_HandleLogonProof()
stmt->setUInt32(1, WrongPassBanTime);
LoginDatabase.Execute(stmt);
- sLog->outBasic("'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins);
}
else
@@ -689,7 +692,7 @@ bool AuthSocket::_HandleLogonProof()
stmt->setUInt32(1, WrongPassBanTime);
LoginDatabase.Execute(stmt);
- sLog->outBasic("'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times",
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times",
socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins);
}
}
@@ -703,7 +706,7 @@ bool AuthSocket::_HandleLogonProof()
// Reconnect Challenge command handler
bool AuthSocket::_HandleReconnectChallenge()
{
- sLog->outStaticDebug("Entering _HandleReconnectChallenge");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleReconnectChallenge");
if (socket().recv_len() < sizeof(sAuthLogonChallenge_C))
return false;
@@ -718,7 +721,7 @@ bool AuthSocket::_HandleReconnectChallenge()
#endif
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
- sLog->outStaticDebug("[ReconnectChallenge] got header, body is %#04x bytes", remaining);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[ReconnectChallenge] got header, body is %#04x bytes", remaining);
if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining))
return false;
@@ -730,8 +733,8 @@ bool AuthSocket::_HandleReconnectChallenge()
// Read the remaining of the packet
socket().recv((char *)&buf[4], remaining);
- sLog->outStaticDebug("[ReconnectChallenge] got full packet, %#04x bytes", ch->size);
- sLog->outStaticDebug("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[ReconnectChallenge] got full packet, %#04x bytes", ch->size);
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I);
_login = (const char*)ch->I;
@@ -742,14 +745,14 @@ bool AuthSocket::_HandleReconnectChallenge()
// Stop if the account is not found
if (!result)
{
- sLog->outError("'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
+ sLog->outError(LOG_FILTER_AUTHSERVER, "'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
socket().shutdown();
return false;
}
// Reinitialize build, expansion and the account securitylevel
_build = ch->build;
- _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG);
+ _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG));
_os = (const char*)ch->os;
if (_os.size() > 4)
@@ -766,11 +769,11 @@ bool AuthSocket::_HandleReconnectChallenge()
// Sending response
ByteBuffer pkt;
- pkt << (uint8)AUTH_RECONNECT_CHALLENGE;
- pkt << (uint8)0x00;
+ pkt << uint8(AUTH_RECONNECT_CHALLENGE);
+ pkt << uint8(0x00);
_reconnectProof.SetRand(16 * 8);
pkt.append(_reconnectProof.AsByteArray(16), 16); // 16 bytes random
- pkt << (uint64)0x00 << (uint64)0x00; // 16 bytes zeros
+ pkt << uint64(0x00) << uint64(0x00); // 16 bytes zeros
socket().send((char const*)pkt.contents(), pkt.size());
return true;
}
@@ -778,7 +781,7 @@ bool AuthSocket::_HandleReconnectChallenge()
// Reconnect Proof command handler
bool AuthSocket::_HandleReconnectProof()
{
- sLog->outStaticDebug("Entering _HandleReconnectProof");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleReconnectProof");
// Read the packet
sAuthReconnectProof_C lp;
if (!socket().recv((char *)&lp, sizeof(sAuthReconnectProof_C)))
@@ -800,16 +803,16 @@ bool AuthSocket::_HandleReconnectProof()
{
// Sending response
ByteBuffer pkt;
- pkt << (uint8)AUTH_RECONNECT_PROOF;
- pkt << (uint8)0x00;
- pkt << (uint16)0x00; // 2 bytes zeros
+ pkt << uint8(AUTH_RECONNECT_PROOF);
+ pkt << uint8(0x00);
+ pkt << uint16(0x00); // 2 bytes zeros
socket().send((char const*)pkt.contents(), pkt.size());
_authed = true;
return true;
}
else
{
- sLog->outError("'%s:%d' [ERROR] user %s tried to login, but session is invalid.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
+ sLog->outError(LOG_FILTER_AUTHSERVER, "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
socket().shutdown();
return false;
}
@@ -818,7 +821,7 @@ bool AuthSocket::_HandleReconnectProof()
// Realm List command handler
bool AuthSocket::_HandleRealmList()
{
- sLog->outStaticDebug("Entering _HandleRealmList");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleRealmList");
if (socket().recv_len() < 5)
return false;
@@ -831,7 +834,7 @@ bool AuthSocket::_HandleRealmList()
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (!result)
{
- sLog->outError("'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
+ sLog->outError(LOG_FILTER_AUTHSERVER, "'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
socket().shutdown();
return false;
}
@@ -849,73 +852,87 @@ bool AuthSocket::_HandleRealmList()
for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i)
{
// don't work with realms which not compatible with the client
- if ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild != _build)
- continue;
- else if ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild))
+ bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild));
+
+ // No SQL injection. id of realm is controlled by the database.
+ uint32 flag = i->second.flag;
+ RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(i->second.gamebuild);
+ if (!okBuild)
+ {
+ if (!buildInfo)
continue;
- uint8 AmountOfCharacters;
+ flag |= REALM_FLAG_OFFLINE | REALM_FLAG_SPECIFYBUILD; // tell the client what build the realm is for
+ }
- // No SQL injection. id of realm is controlled by the database.
+ if (!buildInfo)
+ flag &= ~REALM_FLAG_SPECIFYBUILD;
+
+ std::string name = i->first;
+ if (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
+ {
+ std::ostringstream ss;
+ ss << name << " (" << buildInfo->MajorVersion << '.' << buildInfo->MinorVersion << '.' << buildInfo->BugfixVersion << ')';
+ name = ss.str();
+ }
+
+ uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0;
+
+ uint8 AmountOfCharacters = 0;
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM);
stmt->setUInt32(0, i->second.m_ID);
stmt->setUInt32(1, id);
result = LoginDatabase.Query(stmt);
if (result)
AmountOfCharacters = (*result)[0].GetUInt8();
- else
- AmountOfCharacters = 0;
-
- uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0;
pkt << i->second.icon; // realm type
- if ( _expversion & POST_BC_EXP_FLAG ) // only 2.x and 3.x clients
+ if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients
pkt << lock; // if 1, then realm locked
- pkt << uint8(i->second.flag); // RealmFlags
- pkt << i->first;
+ pkt << uint8(flag); // RealmFlags
+ pkt << name;
pkt << i->second.address;
pkt << i->second.populationLevel;
pkt << AmountOfCharacters;
pkt << i->second.timezone; // realm category
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
- pkt << (uint8)0x2C; // unk, may be realm number/id?
+ pkt << uint8(0x2C); // unk, may be realm number/id?
else
- pkt << (uint8)0x0; // 1.12.1 and 1.12.2 clients
+ pkt << uint8(0x0); // 1.12.1 and 1.12.2 clients
- if (i->second.flag & REALM_FLAG_SPECIFYBUILD)
+ if (_expversion & POST_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
{
- // TODO: Make this customizable
- pkt << uint8(3);
- pkt << uint8(3);
- pkt << uint8(5);
- pkt << uint16(12340);
+ pkt << uint8(buildInfo->MajorVersion);
+ pkt << uint8(buildInfo->MinorVersion);
+ pkt << uint8(buildInfo->BugfixVersion);
+ pkt << uint16(buildInfo->Build);
}
++RealmListSize;
}
- if ( _expversion & POST_BC_EXP_FLAG ) // 2.x and 3.x clients
+ if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
{
- pkt << (uint8)0x10;
- pkt << (uint8)0x00;
+ pkt << uint8(0x10);
+ pkt << uint8(0x00);
}
else // 1.12.1 and 1.12.2 clients
{
- pkt << (uint8)0x00;
- pkt << (uint8)0x02;
+ pkt << uint8(0x00);
+ pkt << uint8(0x02);
}
// make a ByteBuffer which stores the RealmList's size
ByteBuffer RealmListSizeBuffer;
- RealmListSizeBuffer << (uint32)0;
+ RealmListSizeBuffer << uint32(0);
if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients
- RealmListSizeBuffer << (uint16)RealmListSize;
+ RealmListSizeBuffer << uint16(RealmListSize);
else
- RealmListSizeBuffer << (uint32)RealmListSize;
+ RealmListSizeBuffer << uint32(RealmListSize);
ByteBuffer hdr;
- hdr << (uint8) REALM_LIST;
- hdr << (uint16)(pkt.size() + RealmListSizeBuffer.size());
+ hdr << uint8(REALM_LIST);
+ hdr << uint16(pkt.size() + RealmListSizeBuffer.size());
hdr.append(RealmListSizeBuffer); // append RealmList's size buffer
hdr.append(pkt); // append realms in the realmlist
@@ -927,11 +944,11 @@ bool AuthSocket::_HandleRealmList()
// Resume patch transfer
bool AuthSocket::_HandleXferResume()
{
- sLog->outStaticDebug("Entering _HandleXferResume");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleXferResume");
// Check packet length and patch existence
- if (socket().recv_len() < 9 || !pPatch)
+ if (socket().recv_len() < 9 || !pPatch) // FIXME: pPatch is never used
{
- sLog->outError("Error while resuming patch transfer (wrong packet)");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Error while resuming patch transfer (wrong packet)");
return false;
}
@@ -948,7 +965,7 @@ bool AuthSocket::_HandleXferResume()
// Cancel patch transfer
bool AuthSocket::_HandleXferCancel()
{
- sLog->outStaticDebug("Entering _HandleXferCancel");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleXferCancel");
// Close and delete the socket
socket().recv_skip(1); //clear input buffer
@@ -960,12 +977,12 @@ bool AuthSocket::_HandleXferCancel()
// Accept patch transfer
bool AuthSocket::_HandleXferAccept()
{
- sLog->outStaticDebug("Entering _HandleXferAccept");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleXferAccept");
// Check packet length and patch existence
if (!pPatch)
{
- sLog->outError("Error while accepting patch transfer (wrong packet)");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Error while accepting patch transfer (wrong packet)");
return false;
}
@@ -983,7 +1000,9 @@ PatcherRunnable::PatcherRunnable(class AuthSocket* as)
}
// Send content of patch file to the client
-void PatcherRunnable::run() {}
+void PatcherRunnable::run()
+{
+}
// Preload MD5 hashes of existing patch files on server
#ifndef _WIN32
@@ -1050,7 +1069,7 @@ void Patcher::LoadPatchMD5(char *szFileName)
if (!pPatch)
{
- sLog->outError("Error loading patch %s\n", path.c_str());
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Error loading patch %s\n", path.c_str());
return;
}
diff --git a/src/server/authserver/Server/RealmAcceptor.h b/src/server/authserver/Server/RealmAcceptor.h
index 32f4f3e4122..b764e4d2494 100755
--- a/src/server/authserver/Server/RealmAcceptor.h
+++ b/src/server/authserver/Server/RealmAcceptor.h
@@ -48,7 +48,7 @@ protected:
virtual int handle_timeout(const ACE_Time_Value& /*current_time*/, const void* /*act = 0*/)
{
- sLog->outBasic("Resuming acceptor");
+ sLog->outDebug(LOG_FILTER_AUTHSERVER, "Resuming acceptor");
reactor()->cancel_timer(this, 1);
return reactor()->register_handler(this, ACE_Event_Handler::ACCEPT_MASK);
}
@@ -58,7 +58,7 @@ protected:
#if defined(ENFILE) && defined(EMFILE)
if (errno == ENFILE || errno == EMFILE)
{
- sLog->outError("Out of file descriptors, suspending incoming connections for 10 seconds");
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Out of file descriptors, suspending incoming connections for 10 seconds");
reactor()->remove_handler(this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
reactor()->schedule_timer(this, NULL, ACE_Time_Value(10));
}
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp
index e839457d1c9..c868bb43777 100755
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -59,7 +59,7 @@ int RealmSocket::open(void * arg)
if (peer().get_remote_addr(addr) == -1)
{
- sLog->outError("Error %s while opening realm socket!", ACE_OS::strerror(errno));
+ sLog->outError(LOG_FILTER_AUTHSERVER, "Error %s while opening realm socket!", ACE_OS::strerror(errno));
return -1;
}
diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist
index e9ed4bd752d..67d22c49da1 100644
--- a/src/server/authserver/authserver.conf.dist
+++ b/src/server/authserver/authserver.conf.dist
@@ -9,6 +9,7 @@
# EXAMPLE CONFIG
# AUTH SERVER SETTINGS
# MYSQL SETTINGS
+# LOGGING SYSTEM SETTINGS
#
###################################################################################################
@@ -69,116 +70,6 @@ BindIP = "0.0.0.0"
PidFile = ""
#
-# LogLevel
-# Description: Server console level of logging
-# Default: 0 - (Minimum)
-# 1 - (Basic)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-LogLevel = 0
-
-#
-# LogFile
-# Description: Log file for main server log.
-# Default: "Auth.log" - (Enabled)
-# "" - (Disabled)
-
-LogFile = "Auth.log"
-
-#
-# Debug Log Mask
-# Description: Bitmask that determines which debug log output (level 3)
-# will be logged.
-# Possible flags:
-#
-# 64 - Anything related to network input/output,
-# such as packet handlers and netcode logs
-#
-# Simply add the values together to create a bitmask.
-# For more info see enum DebugLogFilters in Log.h
-#
-# Default: 0 (nothing)
-
-DebugLogMask = 64
-
-#
-# SQLDriverLogFile
-# Description: Log file for SQL driver events.
-# Example: "SQLDriver.log" - (Enabled)
-# Default: "" - (Disabled)
-
-SQLDriverLogFile = ""
-
-#
-# SQLDriverQueryLogging
-# Description: Log SQL queries to the SQLDriverLogFile and console.
-# Default: 0 - (Disabled, Query errors only)
-# 1 - (Enabled, Full query logging - may have performance impact)
-
-SQLDriverQueryLogging = 0
-
-#
-# LogTimestamp
-# Description: Append timestamp to the server log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogTimestamp = 0
-
-#
-# LogFileLevel
-# Description: Server file level of logging
-# Default: 0 - (Minimum)
-# 1 - (Basic)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-LogFileLevel = 0
-
-#
-# LogColors
-# Description: Colors for log messages (Format: "normal basic detail debug").
-# Colors: 0 - Black
-# 1 - Red
-# 2 - Green
-# 3 - Brown
-# 4 - Blue
-# 5 - Magenta
-# 6 - Cyan
-# 7 - Grey
-# 8 - Yellow
-# 9 - Lred
-# 10 - Lgreen
-# 11 - Lblue
-# 12 - Lmagenta
-# 13 - Lcyan
-# 14 - White
-# Example: "13 11 9 5" - (Enabled)
-# Default: "" - (Disabled)
-
-LogColors = ""
-
-#
-# EnableLogDB
-# Description: Write log messages to database (LogDatabaseInfo).
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-EnableLogDB = 0
-
-#
-# DBLogLevel
-# Description: Log level of databases logging.
-# Default: 1 - (Basic)
-# 0 - (Minimum)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-DBLogLevel = 1
-
-#
# UseProcessors
# Description: Processors mask for Windows based multi-processor systems.
# Default: 0 - (Selected by OS)
@@ -255,3 +146,108 @@ LoginDatabase.WorkerThreads = 1
#
###################################################################################################
+
+###################################################################################################
+#
+# LOGGING SYSTEM SETTINGS
+#
+# Appender config values: Given a appender "name"
+# Appender.name
+# Description: Defines 'where to log'
+# Format: Type,LogLevel,Flags,optional1,optional2
+#
+# Type
+# 0 - (None)
+# 1 - (Console)
+# 2 - (File)
+# 3 - (DB)
+#
+# LogLevel
+# 0 - (Disabled)
+# 1 - (Trace)
+# 2 - (Debug)
+# 3 - (Info)
+# 4 - (Warn)
+# 5 - (Error)
+# 6 - (Fatal)
+#
+# Flags:
+# 0 - None
+# 1 - Prefix Timestamp to the text
+# 2 - Prefix Log Level to the text
+# 4 - Prefix Log Filter type to the text
+# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS (Only used with Type = 2)
+# 16 - Make a backup of existing file before overwrite (Only used with Mode = w)
+#
+# Colors (read as optional1 if Type = Console)
+# Format: "fatal error warn info debug trace"
+# 0 - BLACK
+# 1 - RED
+# 2 - GREEN
+# 3 - BROWN
+# 4 - BLUE
+# 5 - MAGENTA
+# 6 - CYAN
+# 7 - GREY
+# 8 - YELLOW
+# 9 - LRED
+# 10 - LGREEN
+# 11 - LBLUE
+# 12 - LMAGENTA
+# 13 - LCYAN
+# 14 - WHITE
+# Example: "13 11 9 5 3 1"
+#
+# File: Name of the file (read as optional1 if Type = File)
+# Allows to use one "%s" to create dynamic files
+#
+# Mode: Mode to open the file (read as optional2 if Type = File)
+# a - (Append)
+# w - (Overwrite)
+#
+
+Appender.Console=1,2,0
+Appender.Auth=2,2,0,Auth.log,w
+
+# LogLevel
+# 0 - (Disabled)
+# 1 - (Trace)
+# 2 - (Debug)
+# 3 - (Info)
+# 4 - (Warn)
+# 5 - (Error)
+# 6 - (Fatal)
+#
+# AppenderList: List of appenders linked to logger
+# (Using spaces as separator).
+#
+# Appenders
+# Description: List of Appenders to read from config
+# (Using spaces as separator).
+# Default: "Console Server"
+
+Appenders=Console Auth
+
+# Logger config values: Given a logger "name"
+# Logger.name
+# Description: Defines 'What to log'
+# Format: Type,LogLevel,AppenderList
+# Type
+# 0 - Default. Each type that has no config will
+# rely on this one. Core will create this logger
+# (disabled) if it's not configured
+# 7 - Network input/output,
+# 30 - Authserver
+
+Logger.Root=0,3,Console Auth
+
+#
+# Loggers
+# Description: List of Loggers to read from config
+# (Using spaces as separator).
+# Default: "root"
+
+Loggers=Root
+
+#
+################################################################################################### \ No newline at end of file
diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h
index ea70fc3e322..a4bbe21006a 100755
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -128,7 +128,7 @@ class BIH
delete[] dat.primBound;
delete[] dat.indices;
}
- uint32 primCount() { return objects.size(); }
+ uint32 primCount() const { return objects.size(); }
template<typename RayCallback>
void intersectRay(const Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const
@@ -400,7 +400,8 @@ class BIH
void buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats);
- void createNode(std::vector<uint32> &tempTree, int nodeIndex, uint32 left, uint32 right) {
+ void createNode(std::vector<uint32> &tempTree, int nodeIndex, uint32 left, uint32 right) const
+ {
// write leaf node
tempTree[nodeIndex + 0] = (3 << 30) | left;
tempTree[nodeIndex + 1] = right - left + 1;
diff --git a/src/server/collision/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h
index a645e88ef05..7cf296625f4 100755
--- a/src/server/collision/Management/IVMapManager.h
+++ b/src/server/collision/Management/IVMapManager.h
@@ -35,7 +35,7 @@ namespace VMAP
{
VMAP_LOAD_RESULT_ERROR,
VMAP_LOAD_RESULT_OK,
- VMAP_LOAD_RESULT_IGNORED,
+ VMAP_LOAD_RESULT_IGNORED
};
#define VMAP_INVALID_HEIGHT -100000.0f // for check
diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp
index b9f0f25c2f9..81328d31d7b 100644
--- a/src/server/collision/Management/VMapManager2.cpp
+++ b/src/server/collision/Management/VMapManager2.cpp
@@ -257,7 +257,7 @@ namespace VMAP
WorldModel* worldmodel = new WorldModel();
if (!worldmodel->readFile(basepath + filename + ".vmo"))
{
- sLog->outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str());
delete worldmodel;
return NULL;
}
@@ -277,7 +277,7 @@ namespace VMAP
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
if (model == iLoadedModelFiles.end())
{
- sLog->outError("VMapManager2: trying to unload non-loaded file '%s'", filename.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "VMapManager2: trying to unload non-loaded file '%s'", filename.c_str());
return;
}
if (model->second.decRefCount() == 0)
diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp
index f4a3f1c7b30..89412a69c33 100644
--- a/src/server/collision/Maps/MapTree.cpp
+++ b/src/server/collision/Maps/MapTree.cpp
@@ -124,8 +124,8 @@ namespace VMAP
return intersectionCallBack.result;
}
- StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath):
- iMapID(mapID), iTreeValues(0), iBasePath(basePath)
+ StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath)
+ : iMapID(mapID), iIsTiled(false), iTreeValues(0), iBasePath(basePath)
{
if (iBasePath.length() > 0 && iBasePath[iBasePath.length()-1] != '/' && iBasePath[iBasePath.length()-1] != '\\')
{
@@ -320,7 +320,7 @@ namespace VMAP
else
{
success = false;
- sLog->outError("StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str());
}
}
@@ -356,7 +356,7 @@ namespace VMAP
}
if (!iTreeValues)
{
- sLog->outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY);
+ sLog->outError(LOG_FILTER_GENERAL, "StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY);
return false;
}
bool result = true;
@@ -382,7 +382,7 @@ namespace VMAP
// acquire model instance
WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
if (!model)
- sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
+ sLog->outError(LOG_FILTER_GENERAL, "StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
// update tree
uint32 referencedVal;
@@ -432,7 +432,7 @@ namespace VMAP
loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
if (tile == iLoadedTiles.end())
{
- sLog->outError("StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY);
+ sLog->outError(LOG_FILTER_GENERAL, "StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY);
return;
}
if (tile->second) // file associated with tile
@@ -466,7 +466,7 @@ namespace VMAP
else
{
if (!iLoadedSpawns.count(referencedNode))
- sLog->outError("StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID);
+ sLog->outError(LOG_FILTER_GENERAL, "StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID);
else if (--iLoadedSpawns[referencedNode] == 0)
{
iTreeValues[referencedNode].setUnloaded();
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index e7693a70de4..434522d3515 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -54,11 +54,8 @@ namespace VMAP
//=================================================================
TileAssembler::TileAssembler(const std::string& pSrcDirName, const std::string& pDestDirName)
+ : iDestDir(pDestDirName), iSrcDir(pSrcDirName), iFilterMethod(NULL), iCurrentUniqueNameId(0)
{
- iCurrentUniqueNameId = 0;
- iFilterMethod = NULL;
- iSrcDir = pSrcDirName;
- iDestDir = pDestDirName;
//mkdir(iDestDir);
//init();
}
@@ -312,7 +309,7 @@ namespace VMAP
// write WorldModel
WorldModel model;
model.setRootWmoID(raw_model.RootWMOID);
- if (raw_model.groupsArray.size())
+ if (!raw_model.groupsArray.empty())
{
std::vector<GroupModel> groupsArray;
@@ -336,9 +333,15 @@ namespace VMAP
void TileAssembler::exportGameobjectModels()
{
FILE* model_list = fopen((iSrcDir + "/" + "temp_gameobject_models").c_str(), "rb");
+ if (!model_list)
+ return;
+
FILE* model_list_copy = fopen((iDestDir + "/" + GAMEOBJECT_MODELS).c_str(), "wb");
- if (!model_list || !model_list_copy)
+ if (!model_list_copy)
+ {
+ fclose(model_list);
return;
+ }
uint32 name_length, displayId;
char buff[500];
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 84c736c22e8..d8c39925dc6 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -53,7 +53,7 @@ void LoadGameObjectModelList()
FILE* model_list_file = fopen((sWorld->GetDataPath() + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb");
if (!model_list_file)
{
- sLog->outError("Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS);
+ sLog->outError(LOG_FILTER_GENERAL, "Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS);
return;
}
@@ -72,7 +72,7 @@ void LoadGameObjectModelList()
|| fread(&v1, sizeof(Vector3), 1, model_list_file) != 1
|| fread(&v2, sizeof(Vector3), 1, model_list_file) != 1)
{
- sLog->outError("File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS);
+ sLog->outError(LOG_FILTER_GENERAL, "File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS);
break;
}
@@ -83,8 +83,8 @@ void LoadGameObjectModelList()
}
fclose(model_list_file);
- sLog->outString(">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime));
+
}
GameObjectModel::~GameObjectModel()
@@ -103,7 +103,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn
// ignore models with no bounds
if (mdl_box == G3D::AABox::zero())
{
- sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "GameObject model %s has zero bounds, loading skipped", it->second.name.c_str());
return false;
}
@@ -148,7 +148,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn
GameObjectModel* GameObjectModel::Create(const GameObject& go)
{
- const GameObjectDisplayInfoEntry* info = sGameObjectDisplayInfoStore.LookupEntry(go.GetGOInfo()->displayId);
+ const GameObjectDisplayInfoEntry* info = sGameObjectDisplayInfoStore.LookupEntry(go.GetDisplayId());
if (!info)
return NULL;
@@ -176,7 +176,7 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
Ray modRay(p, iInvRot * ray.direction());
float distance = MaxDist * iInvScale;
bool hit = iModel->IntersectRay(modRay, distance, StopAtFirstHit);
- if(hit)
+ if (hit)
{
distance *= iScale;
MaxDist = distance;
diff --git a/src/server/collision/Models/GameObjectModel.h b/src/server/collision/Models/GameObjectModel.h
index 0bb6c0f47bc..78a0e876676 100644
--- a/src/server/collision/Models/GameObjectModel.h
+++ b/src/server/collision/Models/GameObjectModel.h
@@ -61,6 +61,8 @@ public:
void disable() { phasemask = 0;}
void enable(uint32 ph_mask) { phasemask = ph_mask;}
+ bool isEnabled() const {return phasemask != 0;}
+
bool intersectRay(const G3D::Ray& Ray, float& MaxDist, bool StopAtFirstHit, uint32 ph_mask) const;
static GameObjectModel* Create(const GameObject& go);
diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h
index 1118b654578..b0189ad8542 100755
--- a/src/server/collision/Models/ModelInstance.h
+++ b/src/server/collision/Models/ModelInstance.h
@@ -63,7 +63,7 @@ namespace VMAP
class ModelInstance: public ModelSpawn
{
public:
- ModelInstance(): iModel(0) {}
+ ModelInstance(): iInvScale(0.0f), iModel(0) {}
ModelInstance(const ModelSpawn &spawn, WorldModel* model);
void setUnloaded() { iModel = 0; }
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const;
diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp
index b818232fb32..b4f3f73fc98 100644
--- a/src/server/collision/Models/WorldModel.cpp
+++ b/src/server/collision/Models/WorldModel.cpp
@@ -42,7 +42,7 @@ namespace VMAP
const Vector3 p(ray.direction().cross(e2));
const float a = e1.dot(p);
- if (abs(a) < EPS) {
+ if (fabs(a) < EPS) {
// Determinant is ill-conditioned; abort early
return false;
}
diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h
index 2867b29cfc1..00d7b0cd209 100644
--- a/src/server/collision/RegularGrid.h
+++ b/src/server/collision/RegularGrid.h
@@ -176,7 +176,7 @@ public:
}
if (cell == last_cell)
break;
- if(tMaxX < tMaxY)
+ if (tMaxX < tMaxY)
{
tMaxX += tDeltaX;
cell.x += stepX;
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 86f2c6a28b7..5ab5f99310a 100755
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -111,6 +111,11 @@ void CombatAI::UpdateAI(const uint32 diff)
DoMeleeAttackIfReady();
}
+void CombatAI::SpellInterrupted(uint32 spellId, uint32 unTimeMs)
+{
+ events.RescheduleEvent(spellId, unTimeMs);
+}
+
/////////////////
//CasterAI
/////////////////
@@ -182,7 +187,7 @@ void CasterAI::UpdateAI(const uint32 diff)
ArcherAI::ArcherAI(Creature* c) : CreatureAI(c)
{
if (!me->m_spells[0])
- sLog->outError("ArcherAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "ArcherAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->m_spells[0]);
m_minRange = spellInfo ? spellInfo->GetMinRange(false) : 0;
@@ -231,7 +236,7 @@ void ArcherAI::UpdateAI(const uint32 /*diff*/)
TurretAI::TurretAI(Creature* c) : CreatureAI(c)
{
if (!me->m_spells[0])
- sLog->outError("TurretAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "TurretAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->m_spells[0]);
m_minRange = spellInfo ? spellInfo->GetMinRange(false) : 0;
diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h
index ad98cec0779..fa31e57d780 100755
--- a/src/server/game/AI/CoreAI/CombatAI.h
+++ b/src/server/game/AI/CoreAI/CombatAI.h
@@ -46,6 +46,7 @@ class CombatAI : public CreatureAI
void EnterCombat(Unit* who);
void JustDied(Unit* killer);
void UpdateAI(const uint32 diff);
+ void SpellInterrupted(uint32 spellId, uint32 unTimeMs);
static int Permissible(const Creature*);
protected:
EventMap events;
diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h
index 21466f8c796..6dfea9ac158 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.h
+++ b/src/server/game/AI/CoreAI/GameObjectAI.h
@@ -39,6 +39,11 @@ class GameObjectAI
virtual void Reset() {};
+ // Pass parameters between AI
+ virtual void DoAction(const int32 /*param = 0 */) {}
+ virtual void SetGUID(const uint64& /*guid*/, int32 /*id = 0 */) {}
+ virtual uint64 GetGUID(int32 /*id = 0 */) { return 0; }
+
static int Permissible(GameObject const* go);
virtual bool GossipHello(Player* /*player*/) { return false; }
@@ -54,7 +59,7 @@ class GameObjectAI
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {}
virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {}
- virtual void EventInform(uint32 eventId) {}
+ virtual void EventInform(uint32 /*eventId*/) {}
};
class NullGameObjectAI : public GameObjectAI
diff --git a/src/server/game/AI/CoreAI/PassiveAI.h b/src/server/game/AI/CoreAI/PassiveAI.h
index d7bf8656f23..b4fd579d693 100755
--- a/src/server/game/AI/CoreAI/PassiveAI.h
+++ b/src/server/game/AI/CoreAI/PassiveAI.h
@@ -20,7 +20,6 @@
#define TRINITY_PASSIVEAI_H
#include "CreatureAI.h"
-//#include "CreatureAIImpl.h"
class PassiveAI : public CreatureAI
{
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 97ae0581a18..99cf1cda4fc 100755
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -61,7 +61,7 @@ void PetAI::_stopAttack()
{
if (!me->isAlive())
{
- sLog->outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->CombatStop();
@@ -100,7 +100,7 @@ void PetAI::UpdateAI(const uint32 diff)
if (_needToStop())
{
- sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Pet AI stopped attacking [guid=%u]", me->GetGUIDLow());
_stopAttack();
return;
}
@@ -430,7 +430,6 @@ void PetAI::HandleReturnMovement()
}
}
}
-
}
void PetAI::DoAttack(Unit* target, bool chase)
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index bf50909eeee..e159c1a7d9b 100755
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -130,7 +130,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
void UnitAI::DoCast(uint32 spellId)
{
Unit* target = NULL;
- //sLog->outError("aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target);
+ //sLog->outError(LOG_FILTER_GENERAL, "aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target);
switch (AISpellInfo[spellId].target)
{
default:
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 593f0d15e18..119cfd3d35e 100755
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -35,7 +35,7 @@ enum GeneralScriptTexts
EMOTE_GENERIC_FRENZY = -1000002,
EMOTE_GENERIC_ENRAGED = -1000003,
EMOTE_GENERIC_BERSERK = -1000004,
- EMOTE_GENERIC_BERSERK_RAID = -1000005, // RaidBossEmote version of the previous one
+ EMOTE_GENERIC_BERSERK_RAID = -1000005 // RaidBossEmote version of the previous one
};
//Selection method used by SelectTarget
@@ -45,7 +45,7 @@ enum SelectAggroTarget
SELECT_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
SELECT_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
SELECT_TARGET_NEAREST,
- SELECT_TARGET_FARTHEST,
+ SELECT_TARGET_FARTHEST
};
// default predicate function to select target based on distance, player and/or aura criteria
@@ -242,6 +242,10 @@ class UnitAI
// Called when the unit heals
virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {}
+ /// Called when a spell is interrupted by Spell::EffectInterruptCast
+ /// Use to reschedule next planned cast of spell.
+ virtual void SpellInterrupted(uint32 /*spellId*/, uint32 /*unTimeMs*/) {}
+
void AttackStartCaster(Unit* victim, float dist);
void DoAddAuraToAllHostilePlayers(uint32 spellid);
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 9c236cbd039..e5868117da8 100755
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -54,7 +54,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
Map* map = creature->GetMap();
if (!map->IsDungeon()) //use IsDungeon instead of Instanceable, in case battlegrounds will be instantiated
{
- sLog->outError("DoZoneInCombat call for map that isn't an instance (creature entry = %d)", creature->GetTypeId() == TYPEID_UNIT ? creature->ToCreature()->GetEntry() : 0);
+ sLog->outError(LOG_FILTER_GENERAL, "DoZoneInCombat call for map that isn't an instance (creature entry = %d)", creature->GetTypeId() == TYPEID_UNIT ? creature->ToCreature()->GetEntry() : 0);
return;
}
@@ -77,7 +77,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim())
{
- sLog->outError("DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
return;
}
@@ -153,13 +153,20 @@ void CreatureAI::EnterEvadeMode()
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
}
else
+ {
+ // Required to prevent attacking creatures that are evading and cause them to reenter combat
+ // Does not apply to MoveFollow
+ me->AddUnitState(UNIT_STATE_EVADE);
me->GetMotionMaster()->MoveTargetedHome();
+ }
}
Reset();
if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
me->GetVehicleKit()->Reset(true);
+
+ me->SetLastDamagedTime(0);
}
/*void CreatureAI::AttackedBy(Unit* attacker)
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 94ac452b9f3..d3ad27935ca 100755
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -45,7 +45,7 @@ enum SelectTargetType
SELECT_TARGET_SINGLE_FRIEND, //Only Single Friend
SELECT_TARGET_AOE_FRIEND, //Only AoE Friend
- SELECT_TARGET_ANY_FRIEND, //AoE or Single Friend
+ SELECT_TARGET_ANY_FRIEND //AoE or Single Friend
};
//Spell Effects used by SelectSpell
@@ -54,7 +54,7 @@ enum SelectEffect
SELECT_EFFECT_DONTCARE = 0, //All spell effects allowed
SELECT_EFFECT_DAMAGE, //Spell does damage
SELECT_EFFECT_HEALING, //Spell does healing
- SELECT_EFFECT_AURA, //Spell applies an aura
+ SELECT_EFFECT_AURA //Spell applies an aura
};
enum SCEquip
@@ -128,8 +128,6 @@ class CreatureAI : public UnitAI
void OnCharmed(bool apply);
- //virtual void SpellClick(Player* player) {}
-
// Called at reaching home after evade
virtual void JustReachedHome() {}
@@ -171,6 +169,8 @@ class CreatureAI : public UnitAI
virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {}
+ virtual void OnSpellClick(Unit* /*clicker*/) { }
+
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
protected:
virtual void MoveInLineOfSight(Unit* /*who*/);
diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h
index d097adf38ec..981ac1f5f16 100755
--- a/src/server/game/AI/CreatureAIImpl.h
+++ b/src/server/game/AI/CreatureAIImpl.h
@@ -505,14 +505,14 @@ enum AITarget
AITARGET_ENEMY,
AITARGET_ALLY,
AITARGET_BUFF,
- AITARGET_DEBUFF,
+ AITARGET_DEBUFF
};
enum AICondition
{
AICOND_AGGRO,
AICOND_COMBAT,
- AICOND_DIE,
+ AICOND_DIE
};
#define AI_DEFAULT_COOLDOWN 5000
diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp
index e4cb62c56de..e5c689da339 100755
--- a/src/server/game/AI/CreatureAIRegistry.cpp
+++ b/src/server/game/AI/CreatureAIRegistry.cpp
@@ -30,7 +30,6 @@
#include "CreatureAIFactory.h"
#include "SmartAI.h"
-//#include "CreatureAIImpl.h"
namespace AIRegistry
{
void Initialize()
diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp
index 1a0c6652e74..4ccaa174e67 100755
--- a/src/server/game/AI/CreatureAISelector.cpp
+++ b/src/server/game/AI/CreatureAISelector.cpp
@@ -125,7 +125,6 @@ namespace FactorySelector
}*/
return (mv_factory == NULL ? NULL : mv_factory->Create(creature));
-
}
GameObjectAI* SelectGameObjectAI(GameObject* go)
@@ -138,6 +137,11 @@ namespace FactorySelector
ai_factory = ai_registry.GetRegistryItem(go->GetAIName());
+ // scriptname in db
+ if (!ai_factory)
+ if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go))
+ return scriptedAI;
+
//future goAI types go here
std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index 835705a0d7c..951a035628a 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -40,7 +40,7 @@ bool CreatureEventAIHolder::UpdateRepeatTimer(Creature* creature, uint32 repeatM
Time = urand(repeatMin, repeatMax);
else
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", creature->GetEntry(), Event.event_id, Event.event_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", creature->GetEntry(), Event.event_id, Event.event_type);
Enabled = false;
return false;
}
@@ -64,7 +64,6 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
std::vector<CreatureEventAI_Event>::const_iterator i;
for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
{
-
//Debug check
#ifndef TRINITY_DEBUG
if ((*i).event_flags & EFLAG_DEBUG_ONLY)
@@ -83,10 +82,10 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
}
//EventMap had events but they were not added because they must be for instance
if (m_CreatureEventAIList.empty())
- sLog->outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", me->GetEntry());
}
else
- sLog->outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry());
m_bEmptyList = m_CreatureEventAIList.empty();
m_Phase = 0;
@@ -319,7 +318,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& holder, Unit* actionIn
break;
}
default:
- sLog->outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), holder.Event.event_id, holder.Event.event_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), holder.Event.event_id, holder.Event.event_type);
break;
}
@@ -492,10 +491,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
caster->CastSpell(target, action.cast.spellId, (action.cast.castFlags & CAST_TRIGGERED));
}
-
}
else
- sLog->outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", eventId, me->GetEntry(), action.cast.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", eventId, me->GetEntry(), action.cast.spellId);
}
break;
}
@@ -511,7 +509,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
creature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!creature)
- sLog->outErrorDb("CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, eventId, me->GetEntry());
else if (action.summon.target != TARGET_T_SELF && target)
creature->AI()->AttackStart(target);
break;
@@ -607,12 +605,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
int32 new_phase = int32(m_Phase)+action.set_inc_phase.step;
if (new_phase < 0)
{
- sLog->outErrorDb("CreatureEventAI: Event %d decrease m_Phase under 0. CreatureEntry = %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d decrease m_Phase under 0. CreatureEntry = %d", eventId, me->GetEntry());
m_Phase = 0;
}
else if (new_phase >= MAX_PHASE)
{
- sLog->outErrorDb("CreatureEventAI: Event %d incremented m_Phase above %u. m_Phase mask cannot be used with phases past %u. CreatureEntry = %d", eventId, MAX_PHASE-1, MAX_PHASE-1, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d incremented m_Phase above %u. m_Phase mask cannot be used with phases past %u. CreatureEntry = %d", eventId, MAX_PHASE-1, MAX_PHASE-1, me->GetEntry());
m_Phase = MAX_PHASE-1;
}
else
@@ -663,7 +661,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
if (action.random_phase_range.phaseMin <= action.random_phase_range.phaseMax)
m_Phase = urand(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
else
- sLog->outErrorDb("CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", eventId, me->GetEntry());
break;
case ACTION_T_SUMMON_ID:
{
@@ -672,7 +670,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr->GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
if (i == sEventAIMgr->GetCreatureEventAISummonMap().end())
{
- sLog->outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, eventId, me->GetEntry());
return;
}
@@ -683,7 +681,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
creature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!creature)
- sLog->outErrorDb("CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, eventId, me->GetEntry());
else if (action.summon_id.target != TARGET_T_SELF && target)
creature->AI()->AttackStart(target);
@@ -703,10 +701,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break;
case ACTION_T_SET_INST_DATA:
{
- InstanceScript* instance = (InstanceScript*)me->GetInstanceScript();
+ InstanceScript* instance = me->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", eventId, me->GetEntry());
return;
}
@@ -718,14 +716,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Unit* target = GetTargetByType(action.set_inst_data64.target, actionInvoker);
if (!target)
{
- sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", eventId, me->GetEntry());
return;
}
- InstanceScript* instance = (InstanceScript*)me->GetInstanceScript();
+ InstanceScript* instance = me->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", eventId, me->GetEntry());
return;
}
@@ -735,8 +733,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_UPDATE_TEMPLATE:
if (me->GetEntry() == action.update_template.creatureId)
{
-
- sLog->outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", eventId, me->GetEntry());
return;
}
@@ -745,8 +742,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_DIE:
if (me->isDead())
{
-
- sLog->outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", eventId, me->GetEntry());
return;
}
me->Kill(me);
@@ -798,7 +794,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
object = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2);
if (!object)
{
- sLog->outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_TSCR, "EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, eventId, me->GetEntry());
}
break;
}
@@ -843,6 +839,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break;
}
+ default:
+ break;
}
}
@@ -1048,7 +1046,6 @@ void CreatureEventAI::MoveInLineOfSight(Unit* who)
void CreatureEventAI::SpellHit(Unit* unit, const SpellInfo* spell)
{
-
if (m_bEmptyList)
return;
@@ -1111,6 +1108,8 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist))
ProcessEvent(*i);
break;
+ default:
+ break;
}
}
@@ -1230,13 +1229,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
{
if (!source)
{
- sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry);
return;
}
if (textEntry >= 0)
{
- sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
return;
}
@@ -1244,7 +1243,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
if (i == sEventAIMgr->GetCreatureEventAITextMap().end())
{
- sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
return;
}
@@ -1255,7 +1254,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
if (sSoundEntriesStore.LookupEntry((*i).second.SoundId))
source->PlayDirectSound((*i).second.SoundId);
else
- sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId);
}
if ((*i).second.Emote)
@@ -1265,7 +1264,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
((Unit*)source)->HandleEmoteCommand((*i).second.Emote);
}
else
- sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, source->GetTypeId());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, source->GetTypeId());
}
switch ((*i).second.Type)
@@ -1286,13 +1285,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
{
if (target && target->GetTypeId() == TYPEID_PLAYER)
source->MonsterWhisper(textEntry, target->GetGUID());
- else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
+ else sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
}break;
case CHAT_TYPE_BOSS_WHISPER:
{
if (target && target->GetTypeId() == TYPEID_PLAYER)
source->MonsterWhisper(textEntry, target->GetGUID(), true);
- else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
+ else sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
}break;
case CHAT_TYPE_ZONE_YELL:
source->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
@@ -1318,6 +1317,10 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger
if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false)))
return false;
+ //Spell is on cooldown
+ if (me->HasSpellCooldown(spell->Id))
+ return false;
+
return true;
}
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h
index 3d2bcf888c8..da5f0b084cf 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.h
+++ b/src/server/game/AI/EventAI/CreatureEventAI.h
@@ -60,7 +60,7 @@ enum EventAI_Type
EVENT_T_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 Repeat Min/Max
EVENT_T_RESET = 35, // Is it called after combat, when the creature respawn and spawn. -- TRINITY ONLY
- EVENT_T_END,
+ EVENT_T_END
};
enum EventAI_ActionType
@@ -119,7 +119,7 @@ enum EventAI_ActionType
ACTION_T_ATTACK_START_PULSE = 103, //Distance
ACTION_T_SUMMON_GO = 104, //GameObjectID, DespawnTime in ms
- ACTION_T_END = 105,
+ ACTION_T_END = 105
};
enum Target
@@ -156,7 +156,7 @@ enum CastFlags
CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
- CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
+ CAST_AURA_NOT_PRESENT = 0x20 //Only casts the spell if the target does not have an aura from the spell
};
enum EventFlags
@@ -589,7 +589,6 @@ struct CreatureEventAIHolder
class CreatureEventAI : public CreatureAI
{
-
public:
explicit CreatureEventAI(Creature* c);
~CreatureEventAI()
diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
index a863f2f89cf..728b17b0bbf 100755
--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
@@ -38,13 +38,13 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
// Load EventAI Text
sObjectMgr->LoadTrinityStrings("creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
- // Gather Additional data from EventAI Texts 0 1 2 3 4
+ // Gather Additional data from EventAI Texts 0 1 2 3 4
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
if (!result)
{
- sLog->outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
+
return;
}
@@ -64,33 +64,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
// range negative
if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID)
{
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
continue;
}
// range negative (must not happen, loaded from same table)
if (!sObjectMgr->GetTrinityStringLocale(i))
{
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i);
continue;
}
if (temp.SoundId)
{
if (!sSoundEntriesStore.LookupEntry(temp.SoundId))
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId);
}
if (!GetLanguageDescByID(temp.Language))
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language);
if (temp.Type > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type);
if (temp.Emote)
{
if (!sEmotesStore.LookupEntry(temp.Emote))
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote);
}
m_CreatureEventAI_TextMap[i] = temp;
@@ -98,11 +98,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
-// -------------------
void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
{
uint32 oldMSTime = getMSTime();
@@ -115,8 +114,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
if (!result)
{
- sLog->outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
+
return;
}
@@ -137,7 +136,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
if (!Trinity::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation))
{
- sLog->outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation);
continue;
}
@@ -147,11 +146,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
-// -------------------
void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
uint32 oldMSTime = getMSTime();
@@ -169,8 +167,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (!result)
{
- sLog->outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");
+
return;
}
@@ -191,7 +189,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
//Report any errors in event
if (e_type >= EVENT_T_END)
{
- sLog->outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type);
continue;
}
temp.event_type = EventAI_Type(e_type);
@@ -208,21 +206,21 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
//Creature does not exist in database
if (!cInfo)
{
- sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id);
continue;
}
-
+
// Only on the first script
if (cInfo->AIName != "EventAI" && m_CreatureEventAI_Event_Map[creature_id].empty())
- sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id);
+ sLog->outError(LOG_FILTER_SQL, "Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id);
//No chance of this event occuring
if (temp.event_chance == 0)
- sLog->outErrorDb("CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i);
//Chance above 100, force it to be 100
else if (temp.event_chance > 100)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
temp.event_chance = 100;
}
@@ -232,23 +230,23 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
case EVENT_T_TIMER:
case EVENT_T_TIMER_OOC:
if (temp.timer.initialMax < temp.timer.initialMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
if (temp.timer.repeatMax < temp.timer.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_HP:
case EVENT_T_MANA:
case EVENT_T_TARGET_HP:
case EVENT_T_TARGET_MANA:
if (temp.percent_range.percentMax > 100)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i);
if (temp.percent_range.percentMax <= temp.percent_range.percentMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i);
if (temp.event_flags & EFLAG_REPEATABLE && !temp.percent_range.repeatMin && !temp.percent_range.repeatMax)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i);
temp.event_flags &= ~EFLAG_REPEATABLE;
}
break;
@@ -258,29 +256,29 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.spell_hit.spellId);
if (!spell)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
continue;
}
if ((temp.spell_hit.schoolMask & spell->SchoolMask) != spell->SchoolMask)
- sLog->outErrorDb("CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i);
}
if (!temp.spell_hit.schoolMask)
- sLog->outErrorDb("CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.spell_hit.schoolMask, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.spell_hit.schoolMask, i);
if (temp.spell_hit.repeatMax < temp.spell_hit.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_RANGE:
if (temp.range.maxDist < temp.range.minDist)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (MaxDist < MinDist). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (MaxDist < MinDist). Event will never repeat.", temp.creature_id, i);
if (temp.range.repeatMax < temp.range.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_OOC_LOS:
if (temp.ooc_los.repeatMax < temp.ooc_los.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_SPAWNED:
switch (temp.spawned.condition)
@@ -289,55 +287,55 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
case SPAWNED_EVENT_MAP:
if (!sMapStore.LookupEntry(temp.spawned.conditionValue1))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but with not existed map (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but with not existed map (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
break;
case SPAWNED_EVENT_ZONE:
if (!GetAreaEntryByAreaID(temp.spawned.conditionValue1))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but with not existed area (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but with not existed area (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
default:
- sLog->outErrorDb("CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition);
break;
}
break;
case EVENT_T_FRIENDLY_HP:
if (temp.friendly_hp.repeatMax < temp.friendly_hp.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_FRIENDLY_IS_CC:
if (temp.friendly_is_cc.repeatMax < temp.friendly_is_cc.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_FRIENDLY_MISSING_BUFF:
{
SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.spell_hit.spellId);
if (!spell)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
continue;
}
if (temp.friendly_buff.repeatMax < temp.friendly_buff.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
}
case EVENT_T_KILL:
if (temp.kill.repeatMax < temp.kill.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_TARGET_CASTING:
if (temp.target_casting.repeatMax < temp.target_casting.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_SUMMONED_UNIT:
if (!sObjectMgr->GetCreatureTemplate(temp.summon_unit.creatureId))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summon_unit.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with not existed creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summon_unit.creatureId);
if (temp.summon_unit.repeatMax < temp.summon_unit.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_QUEST_ACCEPT:
case EVENT_T_QUEST_COMPLETE:
if (!sObjectMgr->GetQuestTemplate(temp.quest.questId))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId);
- sLog->outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
continue;
case EVENT_T_AGGRO:
@@ -347,7 +345,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (temp.event_flags & EFLAG_REPEATABLE)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i);
temp.event_flags &= ~EFLAG_REPEATABLE;
}
@@ -358,7 +356,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (!sEmotesTextStore.LookupEntry(temp.receive_emote.emoteId))
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId);
continue;
}
if (temp.receive_emote.condition)
@@ -369,14 +367,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
cond.ConditionValue2 = temp.receive_emote.conditionValue2;
if (!sConditionMgr->isConditionTypeValid(&cond))
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition);
continue;
}
}
if (!(temp.event_flags & EFLAG_REPEATABLE))
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: EFLAG_REPEATABLE not set. Event must always be repeatable. Flag applied.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: EFLAG_REPEATABLE not set. Event must always be repeatable. Flag applied.", temp.creature_id, i);
temp.event_flags |= EFLAG_REPEATABLE;
}
@@ -389,16 +387,16 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.buffed.spellId);
if (!spell)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
continue;
}
if (temp.buffed.repeatMax < temp.buffed.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
}
default:
- sLog->outErrorDb("CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i);
break;
}
@@ -407,7 +405,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
uint16 action_type = fields[10+(j*4)].GetUInt8();
if (action_type >= ACTION_T_END)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type);
temp.action[j].type = ACTION_T_NONE;
continue;
}
@@ -429,30 +427,30 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (action.text.TextId1 < 0)
{
if (m_CreatureEventAI_TextMap.find(action.text.TextId1) == m_CreatureEventAI_TextMap.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1);
}
if (action.text.TextId2 < 0)
{
if (m_CreatureEventAI_TextMap.find(action.text.TextId2) == m_CreatureEventAI_TextMap.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1);
if (!action.text.TextId1)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1);
}
if (action.text.TextId3 < 0)
{
if (m_CreatureEventAI_TextMap.find(action.text.TextId3) == m_CreatureEventAI_TextMap.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1);
if (!action.text.TextId1 || !action.text.TextId2)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1);
}
break;
}
case ACTION_T_SET_FACTION:
if (action.set_faction.factionId !=0 && !sFactionStore.LookupEntry(action.set_faction.factionId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent FactionId %u.", i, j+1, action.set_faction.factionId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent FactionId %u.", i, j+1, action.set_faction.factionId);
action.set_faction.factionId = 0;
}
break;
@@ -461,7 +459,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.morph.creatureId && !sObjectMgr->GetCreatureTemplate(action.morph.creatureId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId);
action.morph.creatureId = 0;
}
@@ -469,12 +467,12 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.morph.creatureId)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId, action.morph.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId, action.morph.creatureId);
action.morph.modelId = 0;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, action.morph.modelId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, action.morph.modelId);
action.morph.modelId = 0;
}
}
@@ -482,33 +480,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
case ACTION_T_SOUND:
if (!sSoundEntriesStore.LookupEntry(action.sound.soundId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SoundID %u.", i, j+1, action.sound.soundId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant SoundID %u.", i, j+1, action.sound.soundId);
break;
case ACTION_T_EMOTE:
if (!sEmotesStore.LookupEntry(action.emote.emoteId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.emote.emoteId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.emote.emoteId);
break;
case ACTION_T_RANDOM_SOUND:
if (!sSoundEntriesStore.LookupEntry(action.random_sound.soundId1))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId1);
if (action.random_sound.soundId2 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId2))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId2);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId2);
if (action.random_sound.soundId3 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId3))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId3);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId3);
break;
case ACTION_T_RANDOM_EMOTE:
if (!sEmotesStore.LookupEntry(action.random_emote.emoteId1))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId1);
if (action.random_emote.emoteId2 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId2))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId2);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId2);
if (action.random_emote.emoteId3 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId3))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3);
break;
case ACTION_T_CAST:
{
const SpellInfo* spell = sSpellMgr->GetSpellInfo(action.cast.spellId);
if (!spell)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast.spellId);
/* FIXME: temp.raw.param3 not have event tipes with recovery time in it....
else
{
@@ -526,143 +524,143 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
action.cast.castFlags |= CAST_TRIGGERED;
if (action.cast.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
}
case ACTION_T_SUMMON:
if (!sObjectMgr->GetCreatureTemplate(action.summon.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId);
if (action.summon.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_THREAT_SINGLE_PCT:
if (std::abs(action.threat_single_pct.percent) > 100)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_single_pct.percent);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_single_pct.percent);
if (action.threat_single_pct.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_THREAT_ALL_PCT:
if (std::abs(action.threat_all_pct.percent) > 100)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
break;
case ACTION_T_QUEST_EVENT:
if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event.questId))
{
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
}
else
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event.questId);
if (action.quest_event.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_CAST_EVENT:
if (!sObjectMgr->GetCreatureTemplate(action.cast_event.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId);
if (!sSpellMgr->GetSpellInfo(action.cast_event.spellId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId);
if (action.cast_event.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_UNIT_FIELD:
if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
if (action.set_unit_field.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_UNIT_FLAG:
case ACTION_T_REMOVE_UNIT_FLAG:
if (action.unit_flag.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_PHASE:
if (action.set_phase.phase >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
break;
case ACTION_T_INC_PHASE:
if (action.set_inc_phase.step == 0)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
else if (std::abs(action.set_inc_phase.step) > MAX_PHASE-1)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
break;
case ACTION_T_QUEST_EVENT_ALL:
if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event_all.questId))
{
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
}
else
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId);
break;
case ACTION_T_CAST_EVENT_ALL:
if (!sObjectMgr->GetCreatureTemplate(action.cast_event_all.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId);
if (!sSpellMgr->GetSpellInfo(action.cast_event_all.spellId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId);
break;
case ACTION_T_REMOVEAURASFROMSPELL:
if (!sSpellMgr->GetSpellInfo(action.remove_aura.spellId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId);
if (action.remove_aura.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3
if (action.random_phase.phase1 >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase.phase2 >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase.phase3 >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
break;
case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax
if (action.random_phase_range.phaseMin >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase_range.phaseMin >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase_range.phaseMin >= action.random_phase_range.phaseMax)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1);
std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
// equal case processed at call
}
break;
case ACTION_T_SUMMON_ID:
if (!sObjectMgr->GetCreatureTemplate(action.summon_id.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.summon_id.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.summon_id.creatureId);
if (action.summon_id.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
if (m_CreatureEventAI_Summon_Map.find(action.summon_id.spawnId) == m_CreatureEventAI_Summon_Map.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId);
break;
case ACTION_T_KILLED_MONSTER:
if (!sObjectMgr->GetCreatureTemplate(action.killed_monster.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.killed_monster.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.killed_monster.creatureId);
if (action.killed_monster.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_INST_DATA:
if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
if (action.set_inst_data.value > 4/*SPECIAL*/)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
break;
case ACTION_T_SET_INST_DATA64:
if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
if (action.set_inst_data64.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_UPDATE_TEMPLATE:
if (!sObjectMgr->GetCreatureTemplate(action.update_template.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.update_template.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.update_template.creatureId);
break;
case ACTION_T_SET_SHEATH:
if (action.set_sheath.sheath >= MAX_SHEATH_STATE)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j+1, action.set_sheath.sheath);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j+1, action.set_sheath.sheath);
action.set_sheath.sheath = SHEATH_STATE_UNARMED;
}
break;
@@ -671,7 +669,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.invincibility_hp_level.hp_level > 100)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
action.invincibility_hp_level.hp_level = 100;
}
}
@@ -681,7 +679,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.mount.creatureId && !sObjectMgr->GetCreatureTemplate(action.mount.creatureId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId);
action.morph.creatureId = 0;
}
@@ -689,12 +687,12 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.mount.creatureId)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId);
action.mount.modelId = 0;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(action.mount.modelId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId);
action.mount.modelId = 0;
}
}
@@ -714,7 +712,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
case ACTION_T_RANDOM_SAY:
case ACTION_T_RANDOM_YELL:
case ACTION_T_RANDOM_TEXTEMOTE:
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
break;
case ACTION_T_MOVE_RANDOM_POINT:
@@ -728,7 +726,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
default:
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, action.type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, action.type);
break;
}
}
@@ -740,6 +738,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 6d27d251579..76bb3aaa76a 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -5,9 +5,13 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
-#include "ScriptPCH.h"
+#include "ScriptedCreature.h"
#include "Item.h"
#include "Spell.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
@@ -153,7 +157,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
if (!sSoundEntriesStore.LookupEntry(soundId))
{
- sLog->outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow());
+ sLog->outError(LOG_FILTER_TSCR, "Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow());
return;
}
@@ -246,7 +250,7 @@ void ScriptedAI::DoResetThreat()
{
if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty())
{
- sLog->outError("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry());
+ sLog->outError(LOG_FILTER_TSCR, "DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry());
return;
}
@@ -295,7 +299,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o
if (Player* player = unit->ToPlayer())
player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
else
- sLog->outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
+ sLog->outError(LOG_FILTER_TSCR, "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
}
void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
@@ -427,7 +431,7 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(uint32 const diff)
return false;
break;
default: // For most of creatures that certain area is their home area.
- sLog->outDetail("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition. Using the default one.", me->GetEntry());
+ sLog->outInfo(LOG_FILTER_GENERAL, "TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition. Using the default one.", me->GetEntry());
uint32 homeAreaId = me->GetMap()->GetAreaId(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ());
if (me->GetAreaId() == homeAreaId)
return false;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index 4fac8b3cba5..aa46d555b7d 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -41,8 +41,10 @@ class SummonList : public std::list<uint64>
template <class Predicate> void DoAction(int32 info, Predicate& predicate, uint16 max = 0)
{
- Trinity::Containers::RandomResizeList<uint64, Predicate>(*this, predicate, max);
- for (iterator i = begin(); i != end(); )
+ // We need to use a copy of SummonList here, otherwise original SummonList would be modified
+ std::list<uint64> listCopy = *this;
+ Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
+ for (iterator i = listCopy.begin(); i != listCopy.end(); )
{
Creature* summon = Unit::GetCreature(*me, *i++);
if (summon && summon->IsAIEnabled)
@@ -191,7 +193,7 @@ struct ScriptedAI : public CreatureAI
//Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims
void SetCombatMovement(bool allowMovement);
- bool IsCombatMovementAllowed() { return _isCombatMovementAllowed; }
+ bool IsCombatMovementAllowed() const { return _isCombatMovementAllowed; }
bool EnterEvadeIfOutOfCombatArea(uint32 const diff);
@@ -200,16 +202,16 @@ struct ScriptedAI : public CreatureAI
// - for raid in mode 10-Heroic
// - for raid in mode 25-heroic
// DO NOT USE to check raid in mode 25-normal.
- bool IsHeroic() { return _isHeroic; }
+ bool IsHeroic() const { return _isHeroic; }
// return the dungeon or raid difficulty
- Difficulty GetDifficulty() { return _difficulty; }
+ Difficulty GetDifficulty() const { return _difficulty; }
// return true for 25 man or 25 man heroic mode
- bool Is25ManRaid() { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; }
+ bool Is25ManRaid() const { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; }
template<class T> inline
- const T& DUNGEON_MODE(const T& normal5, const T& heroic10)
+ const T& DUNGEON_MODE(const T& normal5, const T& heroic10) const
{
switch (_difficulty)
{
@@ -225,7 +227,7 @@ struct ScriptedAI : public CreatureAI
}
template<class T> inline
- const T& RAID_MODE(const T& normal10, const T& normal25)
+ const T& RAID_MODE(const T& normal10, const T& normal25) const
{
switch (_difficulty)
{
@@ -241,7 +243,7 @@ struct ScriptedAI : public CreatureAI
}
template<class T> inline
- const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25)
+ const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25) const
{
switch (_difficulty)
{
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 2243734f642..003c9ac9d1c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -9,7 +9,7 @@ SDComment:
SDCategory: Npc
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "Group.h"
@@ -32,7 +32,8 @@ npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
m_bCanReturnToStart(false),
DespawnAtEnd(true),
DespawnAtFar(true),
- ScriptWP(false)
+ ScriptWP(false),
+ HasImmuneToNPCFlags(false)
{}
void npc_escortAI::AttackStart(Unit* who)
@@ -174,11 +175,13 @@ void npc_escortAI::EnterEvadeMode()
{
AddEscortState(STATE_ESCORT_RETURNING);
ReturnToLastPoint();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI has left combat and is now returning to last point");
}
else
{
me->GetMotionMaster()->MoveTargetedHome();
+ if (HasImmuneToNPCFlags)
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
Reset();
}
}
@@ -213,7 +216,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
{
if (DespawnAtEnd)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI reached end of waypoints");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI reached end of waypoints");
if (m_bCanReturnToStart)
{
@@ -224,7 +227,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
m_uiWPWaitTimer = 0;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ);
return;
}
@@ -240,7 +243,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
}
else
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI reached end of waypoints with Despawn off");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI reached end of waypoints with Despawn off");
return;
}
@@ -249,7 +252,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
if (!HasEscortState(STATE_ESCORT_PAUSED))
{
me->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
WaypointStart(CurrentWP->id);
@@ -267,7 +270,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
{
if (DespawnAtFar && !IsPlayerOrGroupInRange())
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI failed because player/group was to far away or not found");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI failed because player/group was to far away or not found");
if (m_bCanInstantRespawn)
{
@@ -305,7 +308,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
//Combat start position reached, continue waypoint movement
if (pointId == POINT_LAST_POINT)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI has returned to original position before combat");
me->SetWalk(!m_bIsRunning);
RemoveEscortState(STATE_ESCORT_RETURNING);
@@ -315,7 +318,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
}
else if (pointId == POINT_HOME)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI has returned to original home location and will continue from beginning of waypoint list.");
CurrentWP = WaypointList.begin();
m_uiWPWaitTimer = 1;
@@ -325,11 +328,11 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
//Make sure that we are still on the right waypoint
if (CurrentWP->id != pointId)
{
- sLog->outError("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", pointId, CurrentWP->id, me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", pointId, CurrentWP->id, me->GetEntry());
return;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI Waypoint %u reached", CurrentWP->id);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI Waypoint %u reached", CurrentWP->id);
//Call WP function
WaypointReached(CurrentWP->id);
@@ -398,14 +401,14 @@ void npc_escortAI::SetRun(bool on)
if (!m_bIsRunning)
me->SetWalk(false);
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
me->SetWalk(true);
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI attempt to set walk mode, but is already walking.");
}
m_bIsRunning = on;
@@ -416,13 +419,13 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
{
if (me->getVictim())
{
- sLog->outError("TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
return;
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- sLog->outError("TSCR: EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry());
+ sLog->outError(LOG_FILTER_TSCR, "EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry());
return;
}
@@ -435,7 +438,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
if (WaypointList.empty())
{
- sLog->outErrorDb("TSCR: EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).",
+ sLog->outError(LOG_FILTER_SQL, "TSCR: EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).",
me->GetScriptName().c_str(), me->GetEntry(), quest ? quest->GetQuestId() : 0);
return;
}
@@ -451,19 +454,24 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
m_bCanReturnToStart = canLoopPath;
if (m_bCanReturnToStart && m_bCanInstantRespawn)
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
}
//disable npcflags
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
+ {
+ HasImmuneToNPCFlags = true;
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ }
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
CurrentWP = WaypointList.begin();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 24d15f9079b..4b4f3656a8d 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -120,6 +120,6 @@ struct npc_escortAI : public ScriptedAI
bool DespawnAtEnd;
bool DespawnAtFar;
bool ScriptWP;
+ bool HasImmuneToNPCFlags;
};
#endif
-
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 13bbbe2c338..1e83c203553 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -9,7 +9,7 @@ SDComment: This AI is under development
SDCategory: Npc
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptedCreature.h"
#include "ScriptedFollowerAI.h"
#include "Group.h"
@@ -165,7 +165,7 @@ void FollowerAI::EnterEvadeMode()
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI left combat, returning to CombatStartPosition.");
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
{
@@ -191,7 +191,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is set completed, despawns.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI is set completed, despawns.");
me->DespawnOrUnsummon();
return;
}
@@ -202,7 +202,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_RETURNING))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is returning to leader.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI is returning to leader.");
RemoveFollowState(STATE_FOLLOW_RETURNING);
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
@@ -231,7 +231,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
if (bIsMaxRangeExceeded)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI failed because player/group was to far away or not found");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI failed because player/group was to far away or not found");
me->DespawnOrUnsummon();
return;
}
@@ -274,13 +274,13 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
{
if (me->getVictim())
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI attempt to StartFollow while in combat.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while in combat.");
return;
}
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
- sLog->outError("TSCR: FollowerAI attempt to StartFollow while already following.");
+ sLog->outError(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while already following.");
return;
}
@@ -296,7 +296,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
{
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
}
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
@@ -305,7 +305,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName(), m_uiLeaderGUID);
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName(), m_uiLeaderGUID);
}
Player* FollowerAI::GetLeaderForFollower()
@@ -324,17 +324,16 @@ Player* FollowerAI::GetLeaderForFollower()
if (member && member->isAlive() && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI GetLeader changed and returned new leader.");
m_uiLeaderGUID = member->GetGUID();
return member;
- break;
}
}
}
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI GetLeader can not find suitable leader.");
return NULL;
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 98b5c0a6ba3..7dd4053b82f 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -27,9 +27,8 @@
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "Group.h"
-
#include "SmartAI.h"
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
SmartAI::SmartAI(Creature* c) : CreatureAI(c)
{
@@ -108,7 +107,7 @@ WayPoint* SmartAI::GetNextWayPoint()
mLastWP = (*itr).second;
if (mLastWP->id != mCurrentWPID)
{
- sLog->outError("SmartAI::GetNextWayPoint: Got not expected waypoint id %u, expected %u", mLastWP->id, mCurrentWPID);
+ sLog->outError(LOG_FILTER_GENERAL, "SmartAI::GetNextWayPoint: Got not expected waypoint id %u, expected %u", mLastWP->id, mCurrentWPID);
}
return (*itr).second;
}
@@ -119,7 +118,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/)
{
if (me->isInCombat())// no wp movement in combat
{
- sLog->outError("SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
return;
}
if (HasEscortState(SMART_ESCORT_ESCORTING))
@@ -135,8 +134,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/)
SetRun(run);
- WayPoint* wp = GetNextWayPoint();
- if (wp)
+ if (WayPoint* wp = GetNextWayPoint())
{
me->GetPosition(&mLastOOCPos);
me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
@@ -164,7 +162,7 @@ void SmartAI::PausePath(uint32 delay, bool forced)
return;
if (HasEscortState(SMART_ESCORT_PAUSED))
{
- sLog->outError("SmartAI::StartPath: Creature entry %u wanted to pause waypoint movement while already paused, ignoring.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "SmartAI::StartPath: Creature entry %u wanted to pause waypoint movement while already paused, ignoring.", me->GetEntry());
return;
}
mForcedPaused = forced;
@@ -302,7 +300,6 @@ void SmartAI::UpdatePath(const uint32 diff)
mWPPauseTimer = 0;
} else {
mWPPauseTimer -= diff;
-
}
}
if (HasEscortState(SMART_ESCORT_RETURNING))
@@ -324,15 +321,12 @@ void SmartAI::UpdatePath(const uint32 diff)
if (mCurrentWPID == GetWPCount())
{
EndPath();
- } else {
- WayPoint* wp = GetNextWayPoint();
- if (wp)
- {
- SetRun(mRun);
- me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
- }
}
-
+ else if (WayPoint* wp = GetNextWayPoint())
+ {
+ SetRun(mRun);
+ me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
+ }
}
}
@@ -640,8 +634,11 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
- if ((me->GetHealth() - damage) <= mInvincibilityHpLevel)
- damage = me->GetHealth() - mInvincibilityHpLevel;
+ if (mInvincibilityHpLevel && (damage >= me->GetHealth() - mInvincibilityHpLevel))
+ {
+ damage = 0;
+ me->SetHealth(mInvincibilityHpLevel);
+ }
}
void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth)
@@ -696,8 +693,9 @@ void SmartAI::OnCharmed(bool apply)
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
}
-void SmartAI::DoAction(const int32 /*param*/)
+void SmartAI::DoAction(const int32 param)
{
+ GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, NULL, param);
}
uint32 SmartAI::GetData(uint32 /*id*/)
@@ -825,27 +823,10 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId)
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
}
-/*
-SMART_EVENT_UPDATE_OOC
-SMART_EVENT_SPELLHIT
-SMART_EVENT_RANGE
-SMART_EVENT_RESPAWN
-SMART_EVENT_SUMMONED_UNIT
-SMART_EVENT_ACCEPTED_QUEST
-SMART_EVENT_REWARD_QUEST
-SMART_EVENT_TARGET_BUFFED
-SMART_EVENT_SUMMON_DESPAWNED
-SMART_EVENT_AI_INIT
-SMART_EVENT_DATA_SET
-SMART_EVENT_TEXT_OVER
-SMART_EVENT_TIMED_EVENT_TRIGGERED
-SMART_EVENT_UPDATE
-SMART_EVENT_LINK
-SMART_EVENT_GOSSIP_SELECT
-SMART_EVENT_JUST_CREATED
-SMART_EVENT_GOSSIP_HELLO
-SMART_EVENT_DEATH
-*/
+void SmartAI::OnSpellClick(Unit* clicker)
+{
+ GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);
+}
int SmartGameObjectAI::Permissible(const GameObject* g)
{
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 3a3a7dc9510..f81d6e86850 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -40,7 +40,7 @@ enum SmartEscortState
enum SmartEscortVars
{
SMART_ESCORT_MAX_PLAYER_DIST = 50,
- SMART_MAX_AID_DIST = SMART_ESCORT_MAX_PLAYER_DIST / 2,
+ SMART_MAX_AID_DIST = SMART_ESCORT_MAX_PLAYER_DIST / 2
};
class SmartAI : public CreatureAI
@@ -198,6 +198,8 @@ class SmartAI : public CreatureAI
void RemoveAuras();
+ void OnSpellClick(Unit* clicker);
+
private:
uint32 mFollowCreditType;
uint32 mFollowArrivedTimer;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 1b414029366..32b9f8b5903 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -79,6 +79,7 @@ SmartScript::SmartScript()
{
go = NULL;
me = NULL;
+ trigger = NULL;
mEventPhase = 0;
mPathId = 0;
mTargetStorage = new ObjectListMap();
@@ -92,6 +93,7 @@ SmartScript::SmartScript()
meOrigGUID = 0;
goOrigGUID = 0;
mLastInvoker = 0;
+ mScriptType = SMART_SCRIPT_TYPE_CREATURE;
}
SmartScript::~SmartScript()
@@ -910,7 +912,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
InstanceScript* instance = obj->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
break;
}
@@ -931,7 +933,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
InstanceScript* instance = obj->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
break;
}
@@ -1117,10 +1119,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_SUMMON_CREATURE:
{
- float x, y, z, o;
ObjectList* targets = GetTargets(e, unit);
if (targets)
{
+ float x, y, z, o;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
(*itr)->GetPosition(x, y, z, o);
@@ -1149,10 +1151,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!GetBaseObject())
break;
- float x, y, z, o;
ObjectList* targets = GetTargets(e, unit);
if (targets)
{
+ float x, y, z, o;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (!IsUnit(*itr))
@@ -1438,7 +1440,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(e.action.equip.entry);
if (!einfo)
{
- sLog->outErrorDb("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry);
return;
}
npc->SetCurrentEquipmentId(e.action.equip.entry);
@@ -1543,8 +1545,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsSmart())
break;
- float attackDistance = (float)e.action.setRangedMovement.distance;
- float attackAngle = e.action.setRangedMovement.angle / 180.0f * M_PI;
+ float attackDistance = float(e.action.setRangedMovement.distance);
+ float attackAngle = float(e.action.setRangedMovement.angle) / 180.0f * M_PI;
ObjectList* targets = GetTargets(e, unit);
if (targets)
@@ -1563,7 +1565,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (e.GetTargetType() == SMART_TARGET_NONE)
{
- sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
break;
}
@@ -1687,7 +1689,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
uint32 id = temp[urand(0, count)];
if (e.GetTargetType() == SMART_TARGET_NONE)
{
- sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
break;
}
@@ -1717,7 +1719,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
uint32 id = urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2);
if (e.GetTargetType() == SMART_TARGET_NONE)
{
- sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
break;
}
@@ -1782,7 +1784,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
- (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.setunitByte.byte1);
+ (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, e.action.setunitByte.type, e.action.setunitByte.byte1);
delete targets;
break;
@@ -1795,7 +1797,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
- (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.delunitByte.byte1);
+ (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, e.action.delunitByte.type, e.action.delunitByte.byte1);
delete targets;
break;
@@ -1909,14 +1911,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()))
ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list
else
- sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
}
else if (IsGameObject(*itr))
{
if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI()))
ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list
else
- sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
}
}
@@ -1949,8 +1951,29 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
break;
}
+ case SMART_ACTION_SET_HOME_POS:
+ {
+ if (!me)
+ break;
+
+ if (e.GetTargetType() == SMART_TARGET_SELF)
+ me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ else if (e.GetTargetType() == SMART_TARGET_POSITION)
+ me->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o);
+ else
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SET_HOME_POS is not using SMART_TARGET_SELF or SMART_TARGET_POSITION, skipping");
+
+ break;
+ }
+ case SMART_ACTION_SET_HEALTH_REGEN:
+ {
+ if (!me || me->GetTypeId() != TYPEID_UNIT)
+ break;
+ me->setRegeneratingHealth(e.action.setHealthRegen.regenHealth ? true : false);
+ break;
+ }
default:
- sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;
}
@@ -1960,7 +1983,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK)
ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
else
- sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
}
}
@@ -1970,7 +1993,7 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e)
return;
if (mTemplate)
{
- sLog->outErrorDb("SmartScript::InstallTemplate: Entry %d SourceType %u AI Template can not be set more then once, skipped.", e.entryOrGuid, e.GetScriptType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::InstallTemplate: Entry %d SourceType %u AI Template can not be set more then once, skipped.", e.entryOrGuid, e.GetScriptType());
return;
}
mTemplate = (SMARTAI_TEMPLATE)e.action.installTtemplate.id;
@@ -2227,7 +2250,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
{
if (!trigger && !GetBaseObject())
{
- sLog->outErrorDb("SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry");
+ sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry");
break;
}
@@ -2250,7 +2273,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
{
if (!trigger && !GetBaseObject())
{
- sLog->outErrorDb("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry");
+ sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry");
break;
}
@@ -2534,6 +2557,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
case SMART_EVENT_JUST_CREATED:
case SMART_EVENT_GOSSIP_HELLO:
case SMART_EVENT_FOLLOW_COMPLETED:
+ case SMART_EVENT_ON_SPELLCLICK:
ProcessAction(e, unit, var0, var1, bvar, spell, gob);
break;
case SMART_EVENT_IS_BEHIND_TARGET:
@@ -2778,8 +2802,15 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
ProcessAction(e, NULL, var0);
break;
}
+ case SMART_EVENT_ACTION_DONE:
+ {
+ if (e.event.doAction.eventId != var0)
+ return;
+ ProcessAction(e, unit, var0);
+ break;
+ }
default:
- sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
break;
}
}
@@ -2894,23 +2925,6 @@ void SmartScript::InstallEvents()
}
}
-bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3)
-{
- if (c == 0)
- return true;
-
- if (!u || !u->ToPlayer())
- return false;
-
- Condition cond;
- cond.ConditionType = ConditionTypes(uint32(c));
- cond.ConditionValue1 = uint32(v1);
- cond.ConditionValue1 = uint32(v2);
- cond.ConditionValue1 = uint32(v3);
- ConditionSourceInfo srcInfo = ConditionSourceInfo(u->ToPlayer());
- return cond.Meets(srcInfo);
-}
-
void SmartScript::OnUpdate(uint32 const diff)
{
if ((mScriptType == SMART_SCRIPT_TYPE_CREATURE || mScriptType == SMART_SCRIPT_TYPE_GAMEOBJECT) && !GetBaseObject())
@@ -2993,9 +3007,9 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
mEvents.push_back((*i));//NOTE: 'world(0)' events still get processed in ANY instance mode
}
if (mEvents.empty() && obj)
- sLog->outErrorDb("SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
if (mEvents.empty() && at)
- sLog->outErrorDb("SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
}
void SmartScript::GetScript()
@@ -3039,7 +3053,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at)
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry());
break;
default:
- sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!");
+ sLog->outError(LOG_FILTER_GENERAL, "SmartScript::OnInitialize: Unhandled TypeID !WARNING!");
return;
}
} else if (at)
@@ -3050,7 +3064,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at)
}
else
{
- sLog->outError("SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
+ sLog->outError(LOG_FILTER_GENERAL, "SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
return;
}
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 5fb691c87f2..2a0eceb574a 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -83,8 +83,6 @@ class SmartScript
return obj && obj->GetTypeId() == TYPEID_GAMEOBJECT;
}
- bool ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3);
-
void OnUpdate(const uint32 diff);
void OnMoveInLineOfSight(Unit* who);
@@ -119,7 +117,7 @@ class SmartScript
smart = false;
if (!smart)
- sLog->outErrorDb("SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetEntry() : (me ? me->GetEntry() : 0));
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetEntry() : (me ? me->GetEntry() : 0));
return smart;
}
@@ -133,7 +131,7 @@ class SmartScript
if (!go || go->GetAIName() != "SmartGameObjectAI")
smart = false;
if (!smart)
- sLog->outErrorDb("SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0));
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0));
return smart;
}
@@ -256,7 +254,6 @@ class SmartScript
mStoredEvents.erase(i);
return;
}
-
}
}
}
@@ -270,7 +267,6 @@ class SmartScript
{
return (*i);
}
-
}
}
SmartScriptHolder s;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index bf84f39747a..4e2c51e50c8 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -50,8 +50,8 @@ void SmartWaypointMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
+
return;
}
@@ -78,7 +78,7 @@ void SmartWaypointMgr::LoadFromDB()
}
if (last_id != id)
- sLog->outErrorDb("SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id);
+ sLog->outError(LOG_FILTER_SQL, "SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id);
last_id++;
(*waypoint_map[entry])[id] = new WayPoint(id, x, y, z);
@@ -88,8 +88,8 @@ void SmartWaypointMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total, GetMSTimeDiffToNow(oldMSTime));
+
}
SmartWaypointMgr::~SmartWaypointMgr()
@@ -117,8 +117,8 @@ void SmartAIMgr::LoadSmartAIFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty.");
+
return;
}
@@ -134,7 +134,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt8();
if (source_type >= SMART_SCRIPT_TYPE_MAX)
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type));
continue;
}
if (temp.entryOrGuid >= 0)
@@ -145,7 +145,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
break;
@@ -154,7 +154,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sObjectMgr->GetGameObjectTemplate((uint32)temp.entryOrGuid))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
break;
@@ -163,7 +163,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sAreaTriggerStore.LookupEntry((uint32)temp.entryOrGuid))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
break;
@@ -171,7 +171,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
case SMART_SCRIPT_TYPE_TIMED_ACTIONLIST:
break;//nothing to check, really
default:
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (uint32)source_type);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (uint32)source_type);
continue;
}
}
@@ -179,7 +179,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sObjectMgr->GetCreatureData(uint32(abs(temp.entryOrGuid))))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid)));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid)));
continue;
}
}
@@ -234,8 +234,8 @@ void SmartAIMgr::LoadSmartAIFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
@@ -249,7 +249,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
if (e.target.unitDistance.creature && !sObjectMgr->GetCreatureTemplate(e.target.unitDistance.creature))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
return false;
}
break;
@@ -259,7 +259,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
if (e.target.goDistance.entry && !sObjectMgr->GetGameObjectTemplate(e.target.goDistance.entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
return false;
}
break;
@@ -281,7 +281,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
if (e.target.playerDistance.dist == 0)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
break;
@@ -305,7 +305,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
case SMART_TARGET_STORED:
break;
default:
- sLog->outErrorDb("SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
return true;
@@ -315,28 +315,28 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.event.type >= SMART_EVENT_END)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
return false;
}
// in SMART_SCRIPT_TYPE_TIMED_ACTIONLIST all event types are overriden by core
if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && !(SmartAIEventMask[e.event.type][1] & SmartAITypeMask[e.GetScriptType()][1]))
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
return false;
}
if (e.action.type <= 0 || e.action.type >= SMART_ACTION_END)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
return false;
}
if (e.event.event_phase_mask > SMART_EVENT_PHASE_ALL)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
return false;
}
if (e.event.event_flags > SMART_EVENT_FLAGS_ALL)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
return false;
}
if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST)
@@ -377,12 +377,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.event.spellHit.spell);
if (!spellInfo)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
return false;
}
if (e.event.spellHit.school && (e.event.spellHit.school & spellInfo->SchoolMask) != spellInfo->SchoolMask)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses Spell entry %u with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses Spell entry %u with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
return false;
}
}
@@ -397,12 +397,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_RESPAWN:
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
return false;
}
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_AREA && !GetAreaEntryByAreaID(e.event.respawn.area))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Area entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Area entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
return false;
}
break;
@@ -475,63 +475,76 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_EVENT_TRANSPORT_ADDCREATURE:
- {
- if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature))
- return false;
- break;
- }
+ {
+ if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature))
+ return false;
+ break;
+ }
case SMART_EVENT_MOVEMENTINFORM:
+ {
+ if (e.event.movementInform.type > NULL_MOTION_TYPE)
{
- if (e.event.movementInform.type > NULL_MOTION_TYPE)
- {
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
- return false;
- }
- break;
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
+ return false;
}
+ break;
+ }
case SMART_EVENT_DATA_SET:
- {
- if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax))
- return false;
- break;
- }
+ {
+ if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax))
+ return false;
+ break;
+ }
case SMART_EVENT_AREATRIGGER_ONTRIGGER:
- {
- if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id))
- return false;
- break;
- }
+ {
+ if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id))
+ return false;
+ break;
+ }
case SMART_EVENT_TEXT_OVER:
//if (e.event.textOver.textGroupID && !IsTextValid(e, e.event.textOver.textGroupID)) return false;// 0 is a valid text group!
break;
case SMART_EVENT_LINK:
+ {
+ if (e.link && e.link == e.event_id)
{
- if (e.link && e.link == e.event_id)
- {
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
- return false;
- }
- break;
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
+ return false;
}
+ break;
+ }
case SMART_EVENT_DUMMY_EFFECT:
+ {
if (!IsSpellValid(e, e.event.dummy.spell))
return false;
if (e.event.dummy.effIndex > EFFECT_2)
return false;
break;
+ }
case SMART_EVENT_IS_BEHIND_TARGET:
+ {
if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax))
return false;
break;
+ }
case SMART_EVENT_GAME_EVENT_START:
case SMART_EVENT_GAME_EVENT_END:
+ {
+ GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
+ if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid())
+ return false;
+ break;
+ }
+ case SMART_EVENT_ACTION_DONE:
+ {
+ if (e.event.doAction.eventId > EVENT_CHARGE)
{
- GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
- if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid())
- return false;
- break;
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
+ return false;
}
+ break;
+ }
case SMART_EVENT_GO_STATE_CHANGED:
case SMART_EVENT_GO_EVENT_INFORM:
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
@@ -564,9 +577,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_GOSSIP_HELLO:
case SMART_EVENT_JUST_CREATED:
case SMART_EVENT_FOLLOW_COMPLETED:
+ case SMART_EVENT_ON_SPELLCLICK:
break;
default:
- sLog->outErrorDb("SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
}
@@ -576,7 +590,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SET_FACTION:
if (e.action.faction.factionID && !sFactionTemplateStore.LookupEntry(e.action.faction.factionID))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Faction %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Faction %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
return false;
}
break;
@@ -586,7 +600,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.action.morphOrMount.creature > 0 && !sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
return false;
}
@@ -594,12 +608,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.action.morphOrMount.creature)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(e.action.morphOrMount.model))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Model id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Model id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
return false;
}
}
@@ -610,7 +624,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
if (e.action.sound.range > TEXT_RANGE_WORLD)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Text Range %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.sound.range);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Text Range %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.sound.range);
return false;
}
break;
@@ -628,7 +642,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!sTaxiPathStore.LookupEntry(e.action.taxi.id))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Taxi path ID %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Taxi path ID %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
return false;
}
break;
@@ -664,13 +678,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
return false;
}
}
else
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
return false;
}
break;
@@ -681,24 +695,22 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsSpellValid(e, e.action.castCreatureOrGO.spell))
return false;
break;
-
-
case SMART_ACTION_SET_EVENT_PHASE:
if (e.action.setEventPhase.phase >= SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set phase %u. Phase mask cannot be used past phase %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX-1);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set phase %u. Phase mask cannot be used past phase %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX-1);
return false;
}
break;
case SMART_ACTION_INC_EVENT_PHASE:
if (!e.action.incEventPhase.inc && !e.action.incEventPhase.dec)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
else if (e.action.incEventPhase.inc > SMART_EVENT_PHASE_MAX || e.action.incEventPhase.dec > SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
break;
@@ -722,7 +734,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
e.action.randomPhase.phase5 >= SMART_EVENT_PHASE_MAX ||
e.action.randomPhase.phase6 >= SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
}
@@ -732,7 +744,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (e.action.randomPhaseRange.phaseMin >= SMART_EVENT_PHASE_MAX ||
e.action.randomPhaseRange.phaseMax >= SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax))
@@ -744,7 +756,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
return false;
}
break;
@@ -759,7 +771,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SET_SHEATH:
if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect Sheath state %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect Sheath state %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
return false;
}
break;
@@ -767,7 +779,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.action.react.state > REACT_AGGRESSIVE)
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
return false;
}
break;
@@ -787,14 +799,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_TELEPORT:
if (!sMapStore.LookupEntry(e.action.teleport.mapID))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
return false;
}
break;
case SMART_ACTION_INSTALL_AI_TEMPLATE:
if (e.action.installTtemplate.id >= SMARTAI_TEMPLATE_END)
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent AI template id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses non-existent AI template id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
return false;
}
break;
@@ -806,14 +818,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!sSmartWaypointMgr->GetPath(e.action.wpStart.pathID))
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
return false;
}
if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest))
return false;
if (e.action.wpStart.reactState > REACT_AGGRESSIVE)
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
return false;
}
break;
@@ -892,16 +904,18 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SEND_GOSSIP_MENU:
case SMART_ACTION_GO_SET_LOOT_STATE:
case SMART_ACTION_SEND_TARGET_TO_TARGET:
+ case SMART_ACTION_SET_HOME_POS:
+ case SMART_ACTION_SET_HEALTH_REGEN:
break;
default:
- sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
return false;
}
return true;
}
-bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
+/*bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id) // unused
{
bool error = false;
uint32 entry = 0;
@@ -912,7 +926,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
CreatureData const* data = sObjectMgr->GetCreatureData(entry);
if (!data)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Creature guid %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Creature guid %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
else
@@ -922,8 +936,8 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
error = true;
if (error)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
return false;
}
return true;
-}
+}*/
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index b82d0724f53..cccf5c2ce10 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -22,7 +22,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Unit.h"
-#include "ConditionMgr.h"
#include "Spell.h"
//#include "SmartScript.h"
@@ -55,7 +54,7 @@ enum SMART_EVENT_PHASE
SMART_EVENT_PHASE_6 = 6,
SMART_EVENT_PHASE_MAX = 7,
- SMART_EVENT_PHASE_COUNT = 6,
+ SMART_EVENT_PHASE_COUNT = 6
};
enum SMART_EVENT_PHASE_BITS
@@ -67,7 +66,7 @@ enum SMART_EVENT_PHASE_BITS
SMART_EVENT_PHASE_4_BIT = 8,
SMART_EVENT_PHASE_5_BIT = 16,
SMART_EVENT_PHASE_6_BIT = 32,
- SMART_EVENT_PHASE_ALL = SMART_EVENT_PHASE_1_BIT + SMART_EVENT_PHASE_2_BIT + SMART_EVENT_PHASE_3_BIT + SMART_EVENT_PHASE_4_BIT + SMART_EVENT_PHASE_5_BIT + SMART_EVENT_PHASE_6_BIT,
+ SMART_EVENT_PHASE_ALL = SMART_EVENT_PHASE_1_BIT + SMART_EVENT_PHASE_2_BIT + SMART_EVENT_PHASE_3_BIT + SMART_EVENT_PHASE_4_BIT + SMART_EVENT_PHASE_5_BIT + SMART_EVENT_PHASE_6_BIT
};
const uint32 SmartPhaseMask[SMART_EVENT_PHASE_COUNT][2] =
@@ -77,86 +76,87 @@ const uint32 SmartPhaseMask[SMART_EVENT_PHASE_COUNT][2] =
{SMART_EVENT_PHASE_3, SMART_EVENT_PHASE_3_BIT },
{SMART_EVENT_PHASE_4, SMART_EVENT_PHASE_4_BIT },
{SMART_EVENT_PHASE_5, SMART_EVENT_PHASE_5_BIT },
- {SMART_EVENT_PHASE_6, SMART_EVENT_PHASE_6_BIT },
+ {SMART_EVENT_PHASE_6, SMART_EVENT_PHASE_6_BIT }
};
enum SMART_EVENT
{
- SMART_EVENT_UPDATE_IC = 0, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax
- SMART_EVENT_UPDATE_OOC = 1, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax
- SMART_EVENT_HEALT_PCT = 2, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax
- SMART_EVENT_MANA_PCT = 3, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax
- SMART_EVENT_AGGRO = 4, //1 // NONE
- SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3
- SMART_EVENT_DEATH = 6, //1 // NONE
- SMART_EVENT_EVADE = 7, //1 // NONE
- SMART_EVENT_SPELLHIT = 8, //1 // SpellID, School, CooldownMin, CooldownMax
- SMART_EVENT_RANGE = 9, //1 // MinDist, MaxDist, RepeatMin, RepeatMax
- SMART_EVENT_OOC_LOS = 10, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax
- SMART_EVENT_RESPAWN = 11, //1 // type, MapId, ZoneId
- SMART_EVENT_TARGET_HEALTH_PCT = 12, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax
- SMART_EVENT_TARGET_CASTING = 13, //1 // RepeatMin, RepeatMax
- SMART_EVENT_FRIENDLY_HEALTH = 14, //1 // HPDeficit, Radius, RepeatMin, RepeatMax
- SMART_EVENT_FRIENDLY_IS_CC = 15, //1 // Radius, RepeatMin, RepeatMax
- SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, //1 // SpellId, Radius, RepeatMin, RepeatMax
- SMART_EVENT_SUMMONED_UNIT = 17, //1 // CreatureId(0 all), CooldownMin, CooldownMax
- SMART_EVENT_TARGET_MANA_PCT = 18, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax
- SMART_EVENT_ACCEPTED_QUEST = 19, //1 // QuestID(0any)
- SMART_EVENT_REWARD_QUEST = 20, //1 // QuestID(0any)
- SMART_EVENT_REACHED_HOME = 21, //1 // NONE
- SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
- SMART_EVENT_HAS_AURA = 23, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
- SMART_EVENT_TARGET_BUFFED = 24, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
- SMART_EVENT_RESET = 25, //1 // Called after combat, when the creature respawn and spawn.
-
- SMART_EVENT_IC_LOS = 26, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax
- SMART_EVENT_PASSENGER_BOARDED = 27, //1 // CooldownMin, CooldownMax
- SMART_EVENT_PASSENGER_REMOVED = 28, //1 // CooldownMin, CooldownMax
- SMART_EVENT_CHARMED = 29, //1 // NONE
- SMART_EVENT_CHARMED_TARGET = 30, //1 // NONE
- SMART_EVENT_SPELLHIT_TARGET = 31, //1 // SpellID, School, CooldownMin, CooldownMax
- SMART_EVENT_DAMAGED = 32, //1 // MinDmg, MaxDmg, CooldownMin, CooldownMax
- SMART_EVENT_DAMAGED_TARGET = 33, //1 // MinDmg, MaxDmg, CooldownMin, CooldownMax
- SMART_EVENT_MOVEMENTINFORM = 34, //1 // MovementType(any), PointID
- SMART_EVENT_SUMMON_DESPAWNED = 35, //1 // Entry, CooldownMin, CooldownMax
- SMART_EVENT_CORPSE_REMOVED = 36, //1 // NONE
- SMART_EVENT_AI_INIT = 37, //1 // NONE
- SMART_EVENT_DATA_SET = 38, //1 // Id, Value, CooldownMin, CooldownMax
- SMART_EVENT_WAYPOINT_START = 39, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_REACHED = 40, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_TRANSPORT_ADDPLAYER = 41, //1 // NONE
- SMART_EVENT_TRANSPORT_ADDCREATURE = 42, //1 // Entry (0 any)
- SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, //1 // NONE
- SMART_EVENT_TRANSPORT_RELOCATE = 44, //1 // PointId
- SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, //1 // Team (0 any), CooldownMin, CooldownMax
- SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, //1 // TriggerId(0 any)
- SMART_EVENT_QUEST_ACCEPTED = 47, //1 // none
- SMART_EVENT_QUEST_OBJ_COPLETETION = 48, //1 // none
- SMART_EVENT_QUEST_COMPLETION = 49, //1 // none
- SMART_EVENT_QUEST_REWARDED = 50, //1 // none
- SMART_EVENT_QUEST_FAIL = 51, //1 // none
- SMART_EVENT_TEXT_OVER = 52, //1 // GroupId from creature_text, creature entry who talks (0 any)
- SMART_EVENT_RECEIVE_HEAL = 53, //1 // MinHeal, MaxHeal, CooldownMin, CooldownMax
- SMART_EVENT_JUST_SUMMONED = 54, //1 // none
- SMART_EVENT_WAYPOINT_PAUSED = 55, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_RESUMED = 56, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_STOPPED = 57, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_ENDED = 58, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, //1 // id
- SMART_EVENT_UPDATE = 60, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax
- SMART_EVENT_LINK = 61, //1 // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly
- SMART_EVENT_GOSSIP_SELECT = 62, //1 // menuID, actionID
- SMART_EVENT_JUST_CREATED = 63, //1 // none
- SMART_EVENT_GOSSIP_HELLO = 64, //1 // none
- SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none
- SMART_EVENT_DUMMY_EFFECT = 66, //1 // spellId, effectIndex
- SMART_EVENT_IS_BEHIND_TARGET = 67, //1 // cooldownMin, CooldownMax
- SMART_EVENT_GAME_EVENT_START = 68, //1 // game_event.Entry
- SMART_EVENT_GAME_EVENT_END = 69, //1 // game_event.Entry
- SMART_EVENT_GO_STATE_CHANGED = 70, //1 // go state
- SMART_EVENT_GO_EVENT_INFORM = 71, //1 // eventId
-
- SMART_EVENT_END = 72,
+ SMART_EVENT_UPDATE_IC = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ SMART_EVENT_UPDATE_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ SMART_EVENT_HEALT_PCT = 2, // HPMin%, HPMax%, RepeatMin, RepeatMax
+ SMART_EVENT_MANA_PCT = 3, // ManaMin%, ManaMax%, RepeatMin, RepeatMax
+ SMART_EVENT_AGGRO = 4, // NONE
+ SMART_EVENT_KILL = 5, // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3
+ SMART_EVENT_DEATH = 6, // NONE
+ SMART_EVENT_EVADE = 7, // NONE
+ SMART_EVENT_SPELLHIT = 8, // SpellID, School, CooldownMin, CooldownMax
+ SMART_EVENT_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax
+ SMART_EVENT_OOC_LOS = 10, // NoHostile, MaxRnage, CooldownMin, CooldownMax
+ SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId
+ SMART_EVENT_TARGET_HEALTH_PCT = 12, // HPMin%, HPMax%, RepeatMin, RepeatMax
+ SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax
+ SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax
+ SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax
+ SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax
+ SMART_EVENT_SUMMONED_UNIT = 17, // CreatureId(0 all), CooldownMin, CooldownMax
+ SMART_EVENT_TARGET_MANA_PCT = 18, // ManaMin%, ManaMax%, RepeatMin, RepeatMax
+ SMART_EVENT_ACCEPTED_QUEST = 19, // QuestID(0any)
+ SMART_EVENT_REWARD_QUEST = 20, // QuestID(0any)
+ SMART_EVENT_REACHED_HOME = 21, // NONE
+ SMART_EVENT_RECEIVE_EMOTE = 22, // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
+ SMART_EVENT_HAS_AURA = 23, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
+ SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
+ SMART_EVENT_RESET = 25, // Called after combat, when the creature respawn and spawn.
+ SMART_EVENT_IC_LOS = 26, // NoHostile, MaxRnage, CooldownMin, CooldownMax
+ SMART_EVENT_PASSENGER_BOARDED = 27, // CooldownMin, CooldownMax
+ SMART_EVENT_PASSENGER_REMOVED = 28, // CooldownMin, CooldownMax
+ SMART_EVENT_CHARMED = 29, // NONE
+ SMART_EVENT_CHARMED_TARGET = 30, // NONE
+ SMART_EVENT_SPELLHIT_TARGET = 31, // SpellID, School, CooldownMin, CooldownMax
+ SMART_EVENT_DAMAGED = 32, // MinDmg, MaxDmg, CooldownMin, CooldownMax
+ SMART_EVENT_DAMAGED_TARGET = 33, // MinDmg, MaxDmg, CooldownMin, CooldownMax
+ SMART_EVENT_MOVEMENTINFORM = 34, // MovementType(any), PointID
+ SMART_EVENT_SUMMON_DESPAWNED = 35, // Entry, CooldownMin, CooldownMax
+ SMART_EVENT_CORPSE_REMOVED = 36, // NONE
+ SMART_EVENT_AI_INIT = 37, // NONE
+ SMART_EVENT_DATA_SET = 38, // Id, Value, CooldownMin, CooldownMax
+ SMART_EVENT_WAYPOINT_START = 39, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_REACHED = 40, // PointId(0any), pathID(0any)
+ SMART_EVENT_TRANSPORT_ADDPLAYER = 41, // NONE
+ SMART_EVENT_TRANSPORT_ADDCREATURE = 42, // Entry (0 any)
+ SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, // NONE
+ SMART_EVENT_TRANSPORT_RELOCATE = 44, // PointId
+ SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, // Team (0 any), CooldownMin, CooldownMax
+ SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, // TriggerId(0 any)
+ SMART_EVENT_QUEST_ACCEPTED = 47, // none
+ SMART_EVENT_QUEST_OBJ_COPLETETION = 48, // none
+ SMART_EVENT_QUEST_COMPLETION = 49, // none
+ SMART_EVENT_QUEST_REWARDED = 50, // none
+ SMART_EVENT_QUEST_FAIL = 51, // none
+ SMART_EVENT_TEXT_OVER = 52, // GroupId from creature_text, creature entry who talks (0 any)
+ SMART_EVENT_RECEIVE_HEAL = 53, // MinHeal, MaxHeal, CooldownMin, CooldownMax
+ SMART_EVENT_JUST_SUMMONED = 54, // none
+ SMART_EVENT_WAYPOINT_PAUSED = 55, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_RESUMED = 56, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_STOPPED = 57, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_ENDED = 58, // PointId(0any), pathID(0any)
+ SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, // id
+ SMART_EVENT_UPDATE = 60, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ SMART_EVENT_LINK = 61, // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly
+ SMART_EVENT_GOSSIP_SELECT = 62, // menuID, actionID
+ SMART_EVENT_JUST_CREATED = 63, // none
+ SMART_EVENT_GOSSIP_HELLO = 64, // none
+ SMART_EVENT_FOLLOW_COMPLETED = 65, // none
+ SMART_EVENT_DUMMY_EFFECT = 66, // spellId, effectIndex
+ SMART_EVENT_IS_BEHIND_TARGET = 67, // cooldownMin, CooldownMax
+ SMART_EVENT_GAME_EVENT_START = 68, // game_event.Entry
+ SMART_EVENT_GAME_EVENT_END = 69, // game_event.Entry
+ SMART_EVENT_GO_STATE_CHANGED = 70, // go state
+ SMART_EVENT_GO_EVENT_INFORM = 71, // eventId
+ SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId)
+ SMART_EVENT_ON_SPELLCLICK = 73, // clicker (unit)
+
+ SMART_EVENT_END = 74
};
struct SmartEvent
@@ -358,6 +358,11 @@ struct SmartEvent
struct
{
+ uint32 eventId;
+ } doAction;
+
+ struct
+ {
uint32 param1;
uint32 param2;
uint32 param3;
@@ -371,7 +376,7 @@ enum SMART_SCRIPT_RESPAWN_CONDITION
SMART_SCRIPT_RESPAWN_CONDITION_NONE = 0,
SMART_SCRIPT_RESPAWN_CONDITION_MAP = 1,
SMART_SCRIPT_RESPAWN_CONDITION_AREA = 2,
- SMART_SCRIPT_RESPAWN_CONDITION_END = 3,
+ SMART_SCRIPT_RESPAWN_CONDITION_END = 3
};
enum SMART_ACTION
@@ -479,8 +484,10 @@ enum SMART_ACTION
SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId
SMART_ACTION_GO_SET_LOOT_STATE = 99, // state
SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id
+ SMART_ACTION_SET_HOME_POS = 101, // none
+ SMART_ACTION_SET_HEALTH_REGEN = 102, // 0/1
- SMART_ACTION_END = 101,
+ SMART_ACTION_END = 103
};
struct SmartAction
@@ -529,7 +536,6 @@ struct SmartAction
struct
{
-
uint32 emote1;
uint32 emote2;
uint32 emote3;
@@ -822,11 +828,13 @@ struct SmartAction
struct
{
uint32 byte1;
+ uint32 type;
} setunitByte;
struct
{
uint32 byte1;
+ uint32 type;
} delunitByte;
struct
@@ -852,9 +860,9 @@ struct SmartAction
struct
{
- bool withDelayed;
+ uint32 withDelayed;
uint32 spell_id;
- bool withInstant;
+ uint32 withInstant;
} interruptSpellCasting;
struct
@@ -880,7 +888,7 @@ struct SmartAction
struct
{
- uint8 pointId;
+ uint32 pointId;
} MoveToPos;
struct
@@ -901,12 +909,20 @@ struct SmartAction
struct
{
- float distance;
- float angle;
+ uint32 distance;
+ uint32 angle;
} setRangedMovement;
struct
{
+ uint32 regenHealth;
+ } setHealthRegen;
+
+ //! Note for any new future actions
+ //! All parameters must have type uint32
+
+ struct
+ {
uint32 param1;
uint32 param2;
uint32 param3;
@@ -925,7 +941,7 @@ enum SMARTAI_TEMPLATE
SMARTAI_TEMPLATE_PASSIVE = 3,
SMARTAI_TEMPLATE_CAGED_GO_PART = 4, //creatureID, give credit at point end?,
SMARTAI_TEMPLATE_CAGED_NPC_PART = 5, //gameObjectID, despawntime, run?, dist, TextGroupID
- SMARTAI_TEMPLATE_END = 6,
+ SMARTAI_TEMPLATE_END = 6
};
enum SMARTAI_TARGETS
@@ -955,7 +971,7 @@ enum SMARTAI_TARGETS
SMART_TARGET_ACTION_INVOKER_VEHICLE = 22, // Unit's vehicle who caused this Event to occur
SMART_TARGET_OWNER_OR_SUMMONER = 23, // Unit's owner or summoner
SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list
- SMART_TARGET_END = 25,
+ SMART_TARGET_END = 25
};
struct SmartTarget
@@ -1048,12 +1064,12 @@ struct SmartTarget
enum eSmartAI
{
- SMART_EVENT_PARAM_COUNT = 4,
- SMART_ACTION_PARAM_COUNT = 6,
- SMART_SUMMON_COUNTER = 0xFFFFFF,
+ SMART_EVENT_PARAM_COUNT = 4,
+ SMART_ACTION_PARAM_COUNT = 6,
+ SMART_SUMMON_COUNTER = 0xFFFFFF,
SMART_ESCORT_LAST_OOC_POINT = 0xFFFFFF,
- SMART_RANDOM_POINT = 0xFFFFFE,
- SMART_ESCORT_TARGETS = 0xFFFFFF
+ SMART_RANDOM_POINT = 0xFFFFFE,
+ SMART_ESCORT_TARGETS = 0xFFFFFF
};
enum SmartScriptType
@@ -1082,7 +1098,7 @@ enum SmartAITypeMaskId
SMART_SCRIPT_TYPE_MASK_SPELL = 64,
SMART_SCRIPT_TYPE_MASK_TRANSPORT = 128,
SMART_SCRIPT_TYPE_MASK_INSTANCE = 256,
- SMART_SCRIPT_TYPE_MASK_TIMED_ACTIONLIST = 512,
+ SMART_SCRIPT_TYPE_MASK_TIMED_ACTIONLIST = 512
};
const uint32 SmartAITypeMask[SMART_SCRIPT_TYPE_MAX][2] =
@@ -1173,6 +1189,8 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =
{SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
+ {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE },
+ {SMART_EVENT_ON_SPELLCLICK, SMART_SCRIPT_TYPE_MASK_CREATURE }
};
enum SmartEventFlags
@@ -1198,22 +1216,16 @@ enum SmartCastFlags
//CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
//CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
//CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
- SMARTCAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
+ SMARTCAST_AURA_NOT_PRESENT = 0x20 //Only casts the spell if the target does not have an aura from the spell
};
// one line in DB is one event
struct SmartScriptHolder
{
- SmartScriptHolder()
- {
- timer = 0;
- active = false;
- runOnce = false;
- link = 0;
- entryOrGuid = 0;
- event_id = 0;
- enableTimed = false;
- }
+ SmartScriptHolder() : entryOrGuid(0), source_type(SMART_SCRIPT_TYPE_CREATURE)
+ , event_id(0), link(0), timer(0), active(false), runOnce(false)
+ , enableTimed(false) {}
+
int32 entryOrGuid;
SmartScriptType source_type;
uint32 event_id;
@@ -1233,7 +1245,6 @@ struct SmartScriptHolder
bool active;
bool runOnce;
bool enableTimed;
-
};
typedef UNORDERED_MAP<uint32, WayPoint*> WPPath;
@@ -1300,7 +1311,7 @@ class SmartAIMgr
{
if (target < SMART_TARGET_NONE || target >= SMART_TARGET_END)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Target type %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), target);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Target type %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), target);
return false;
}
return true;
@@ -1310,7 +1321,7 @@ class SmartAIMgr
{
if (max < min)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses min/max params wrong (%u/%u), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), min, max);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses min/max params wrong (%u/%u), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), min, max);
return false;
}
return true;
@@ -1320,7 +1331,7 @@ class SmartAIMgr
{
if (pct < -100 || pct > 100)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invalid Percent set (%d), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), pct);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invalid Percent set (%d), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), pct);
return false;
}
return true;
@@ -1330,7 +1341,7 @@ class SmartAIMgr
{
if (!data)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u Parameter can not be NULL, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u Parameter can not be NULL, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
return true;
@@ -1340,7 +1351,7 @@ class SmartAIMgr
{
if (!sObjectMgr->GetCreatureTemplate(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1350,7 +1361,7 @@ class SmartAIMgr
{
if (!sObjectMgr->GetQuestTemplate(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1360,7 +1371,7 @@ class SmartAIMgr
{
if (!sObjectMgr->GetGameObjectTemplate(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1370,7 +1381,7 @@ class SmartAIMgr
{
if (!sSpellMgr->GetSpellInfo(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1380,37 +1391,17 @@ class SmartAIMgr
{
if (!sItemStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Item entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Item entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
}
- /*inline bool IsConditionValid(SmartScriptHolder e, int32 t, int32 v1, int32 v2, int32 v3)
- {
- bool error = false;
- if (t > 0 && v1 >= 0 && v2 >= 0 && v3 >= 0)
- {
- Condition cond;
- cond.mConditionType = ConditionType(t);
- cond.mConditionValue1 = uint32(v1);
- cond.mConditionValue2 = uint32(v2);
- cond.mConditionValue3 = uint32(v3);
- if (!sConditionMgr->isConditionTypeValid(&cond))
- error = true;
- }
- if (error)
- {
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Condition, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
- return false;
- }
- return true;
- }*/
bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry)
{
if (!sEmotesTextStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Text Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Text Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1420,7 +1411,7 @@ class SmartAIMgr
{
if (!sEmotesStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1430,7 +1421,7 @@ class SmartAIMgr
{
if (!sAreaTriggerStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent AreaTrigger entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent AreaTrigger entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1440,13 +1431,13 @@ class SmartAIMgr
{
if (!sSoundEntriesStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Sound entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Sound entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
}
- bool IsTextValid(SmartScriptHolder const& e, uint32 id);
+ //bool IsTextValid(SmartScriptHolder const& e, uint32 id);
};
#define sSmartScriptMgr ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance()
diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h
index c69f3c0a6f3..aaaf4f4f603 100755
--- a/src/server/game/Accounts/AccountMgr.h
+++ b/src/server/game/Accounts/AccountMgr.h
@@ -55,6 +55,6 @@ namespace AccountMgr
bool IsGMAccount(uint32 gmlevel);
bool IsAdminAccount(uint32 gmlevel);
bool IsConsoleAccount(uint32 gmlevel);
-};
+}
#endif
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index 2a9f4212f46..93a3378c3c5 100755
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -75,7 +75,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{
if (dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE)
{
- sLog->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType);
return false;
}
@@ -107,7 +107,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
default:
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
{
- sLog->outErrorDb("Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
return false;
}
break;
@@ -122,27 +122,21 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE:
if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id))
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, creature.id);
return false;
}
return true;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
- if (!classRace.class_id && !classRace.race_id)
- {
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
- criteria->ID, criteria->requiredType, dataType);
- return false;
- }
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
@@ -150,7 +144,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
if (health.percent < 1 || health.percent > 100)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, health.percent);
return false;
}
@@ -158,7 +152,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD:
if (player_dead.own_team_flag > 1)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).",
criteria->ID, criteria->requiredType, dataType, player_dead.own_team_flag);
return false;
}
@@ -169,19 +163,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(aura.spell_id);
if (!spellEntry)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id);
return false;
}
if (aura.effect_idx >= 3)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx);
return false;
}
if (!spellEntry->Effects[aura.effect_idx].ApplyAuraName)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx);
return false;
}
@@ -190,7 +184,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA:
if (!GetAreaEntryByAreaID(area.id))
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, area.id);
return false;
}
@@ -198,7 +192,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL:
if (level.minlevel > STRONG_MAX_LEVEL)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, level.minlevel);
return false;
}
@@ -206,7 +200,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER:
if (gender.gender > GENDER_NONE)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, gender.gender);
return false;
}
@@ -214,7 +208,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT:
if (!ScriptId)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have ScriptName set, ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have ScriptName set, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
@@ -222,7 +216,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
if (difficulty.difficulty >= MAX_DIFFICULTY)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, difficulty.difficulty);
return false;
}
@@ -230,7 +224,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
if (map_players.maxcount <= 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, map_players.maxcount);
return false;
}
@@ -238,7 +232,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
if (team.team != ALLIANCE && team.team != HORDE)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, team.team);
return false;
}
@@ -246,7 +240,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
if (drunk.state >= MAX_DRUNKEN)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, drunk.state);
return false;
}
@@ -254,7 +248,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY:
if (!sHolidaysStore.LookupEntry(holiday.id))
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, holiday.id);
return false;
}
@@ -264,7 +258,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM:
if (equipped_item.item_quality >= MAX_ITEM_QUALITY)
{
- sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, equipped_item.item_quality);
return false;
}
@@ -272,7 +266,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID:
if (!sMapStore.LookupEntry(map_id.mapId))
{
- sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) has unknown map id in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) has unknown map id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, map_id.mapId);
return false;
}
@@ -280,25 +274,25 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE:
if (!classRace.class_id && !classRace.race_id)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
return true;
default:
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
return false;
}
}
@@ -364,7 +358,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
return sScriptMgr->OnCriteriaCheck(this, const_cast<Player*>(source), const_cast<Unit*>(target));
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
if (source->GetMap()->IsRaid())
- if (source->GetMap()->Is25ManRaid() != (difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN))
+ if (source->GetMap()->Is25ManRaid() != ((difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN) != 0))
return false;
return source->GetMap()->GetSpawnMode() >= difficulty.difficulty;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
@@ -391,14 +385,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
Map* map = source->GetMap();
if (!map->IsDungeon())
{
- sLog->outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
+ sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
return false;
}
InstanceScript* instance = ((InstanceMap*)map)->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
+ sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
return false;
}
@@ -634,8 +628,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ
if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement))
if (uint32 titleId = reward->titleId[Player::TeamForRace(GetPlayer()->getRace()) == ALLIANCE ? 0 : 1])
if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
- if (!GetPlayer()->HasTitle(titleEntry))
- GetPlayer()->SetTitle(titleEntry);
+ GetPlayer()->SetTitle(titleEntry);
} while (achievementResult->NextRow());
}
@@ -653,7 +646,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ
if (!criteria)
{
// we will remove not existed criteria for all characters
- sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id);
+ sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
@@ -723,7 +716,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
data.append(GetPlayer()->GetPackGUID());
data << uint32(achievement->ID);
- data << uint32(secsToTimeBitFields(time(NULL)));
+ data.AppendPackedTime(time(NULL));
data << uint32(0);
GetPlayer()->SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true);
}
@@ -741,7 +734,7 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, C
data << uint32(0);
else
data << uint32(timedCompleted ? 0 : 1); // this are some flags, 1 is for keeping the counter at 0 in client
- data << uint32(secsToTimeBitFields(progress->date));
+ data.AppendPackedTime(progress->date);
data << uint32(timeElapsed); // time elapsed in seconds
data << uint32(0); // unk
GetPlayer()->SendDirectMessage(&data);
@@ -2029,7 +2022,7 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type,
void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
{
- sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u)", achievement->ID);
// disable for gamemasters with GM-mode enabled
if (m_player->isGameMaster())
@@ -2132,7 +2125,7 @@ void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const
continue;
*data << uint32(iter->first);
- *data << uint32(secsToTimeBitFields(iter->second.date));
+ data->AppendPackedTime(iter->second.date);
}
*data << int32(-1);
@@ -2142,7 +2135,7 @@ void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const
data->appendPackGUID(iter->second.counter);
data->append(GetPlayer()->GetPackGUID());
*data << uint32(0);
- *data << uint32(secsToTimeBitFields(iter->second.date));
+ data->AppendPackedTime(iter->second.date);
*data << uint32(0);
*data << uint32(0);
}
@@ -2201,14 +2194,12 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
if (sAchievementCriteriaStore.GetNumRows() == 0)
{
- sLog->outErrorDb(">> Loaded 0 achievement criteria.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement criteria.");
return;
}
for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId)
{
-
AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId);
if (!criteria)
continue;
@@ -2220,8 +2211,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria);
}
- sLog->outString(">> Loaded %lu achievement criteria in %u ms", (unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu achievement criteria in %u ms", (unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadAchievementReferenceList()
@@ -2230,8 +2220,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
if (sAchievementStore.GetNumRows() == 0)
{
- sLog->outString(">> Loaded 0 achievement references.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement references.");
return;
}
@@ -2239,7 +2228,6 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId)
{
-
AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId);
if (!achievement || !achievement->refAchievement)
continue;
@@ -2248,8 +2236,11 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
++count;
}
- sLog->outString(">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ // Once Bitten, Twice Shy (10 player) - Icecrown Citadel
+ if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539))
+ const_cast<AchievementEntry*>(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar)
+
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadAchievementCriteriaData()
@@ -2262,8 +2253,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!result)
{
- sLog->outString(">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
return;
}
@@ -2278,7 +2268,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!criteria)
{
- sLog->outErrorDb("Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id);
continue;
}
@@ -2288,7 +2278,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (strcmp(scriptName, "")) // not empty
{
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
- sLog->outErrorDb("Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
else
scriptId = sObjectMgr->GetScriptId(scriptName);
}
@@ -2391,11 +2381,10 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
}
if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL))
- sLog->outErrorDb("Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
}
- sLog->outString(">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadCompletedAchievements()
@@ -2406,8 +2395,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!result)
{
- sLog->outString(">> Loaded 0 completed achievements. DB table `character_achievement` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty.");
return;
}
@@ -2420,7 +2408,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!achievement)
{
// Remove non existent achievements from all characters
- sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.", achievementId);
+ sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement %u data removed from table `character_achievement`.", achievementId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEVMENT);
@@ -2434,8 +2422,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
m_allCompletedAchievements.insert(achievementId);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadRewards()
@@ -2449,8 +2436,7 @@ void AchievementGlobalMgr::LoadRewards()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
return;
}
@@ -2463,7 +2449,7 @@ void AchievementGlobalMgr::LoadRewards()
const AchievementEntry* pAchievement = sAchievementStore.LookupEntry(entry);
if (!pAchievement)
{
- sLog->outErrorDb("Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry);
continue;
}
@@ -2478,19 +2464,19 @@ void AchievementGlobalMgr::LoadRewards()
// must be title or mail at least
if (!reward.titleId[0] && !reward.titleId[1] && !reward.sender)
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry);
continue;
}
if (pAchievement->requiredFaction == ACHIEVEMENT_FACTION_ANY && ((reward.titleId[0] == 0) != (reward.titleId[1] == 0)))
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
if (reward.titleId[0])
{
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[0]);
if (!titleEntry)
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
reward.titleId[0] = 0;
}
}
@@ -2500,7 +2486,7 @@ void AchievementGlobalMgr::LoadRewards()
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[1]);
if (!titleEntry)
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]);
reward.titleId[1] = 0;
}
}
@@ -2510,27 +2496,27 @@ void AchievementGlobalMgr::LoadRewards()
{
if (!sObjectMgr->GetCreatureTemplate(reward.sender))
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
reward.sender = 0;
}
}
else
{
if (reward.itemId)
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has item reward, item will not be rewarded.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have sender data but has item reward, item will not be rewarded.", entry);
if (!reward.subject.empty())
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has mail subject.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have sender data but has mail subject.", entry);
if (!reward.text.empty())
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has mail text.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have sender data but has mail text.", entry);
}
if (reward.itemId)
{
if (!sObjectMgr->GetItemTemplate(reward.itemId))
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId);
reward.itemId = 0;
}
}
@@ -2541,8 +2527,7 @@ void AchievementGlobalMgr::LoadRewards()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadRewardLocales()
@@ -2557,8 +2542,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (!result)
{
- sLog->outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty");
return;
}
@@ -2570,7 +2554,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (m_achievementRewards.find(entry) == m_achievementRewards.end())
{
- sLog->outErrorDb("Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry);
continue;
}
@@ -2584,6 +2568,5 @@ void AchievementGlobalMgr::LoadRewardLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h
index c7d838fcb44..3215b4196f7 100755
--- a/src/server/game/Achievements/AchievementMgr.h
+++ b/src/server/game/Achievements/AchievementMgr.h
@@ -63,7 +63,7 @@ enum AchievementCriteriaDataType
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, // map_id 0 player must be on map with id in map_id
- ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21, // class_id race_id
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21 // class_id race_id
};
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 22 // maximum value in AchievementCriteriaDataType enum
diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp
index 528e682e8d4..a0789040e9a 100755
--- a/src/server/game/Addons/AddonMgr.cpp
+++ b/src/server/game/Addons/AddonMgr.cpp
@@ -43,8 +43,8 @@ void LoadFromDB()
QueryResult result = CharacterDatabase.Query("SELECT name, crc FROM addons");
if (!result)
{
- sLog->outString(">> Loaded 0 known addons. DB table `addons` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 known addons. DB table `addons` is empty!");
+
return;
}
@@ -63,8 +63,8 @@ void LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u known addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u known addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SaveAddon(AddonInfo const& addon)
diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h
index 38338b3980f..fd227b258c5 100755
--- a/src/server/game/Addons/AddonMgr.h
+++ b/src/server/game/Addons/AddonMgr.h
@@ -25,13 +25,7 @@
struct AddonInfo
{
AddonInfo(const std::string& name, uint8 enabled, uint32 crc, uint8 state, bool crcOrPubKey)
- {
- Name = name;
- Enabled = enabled;
- CRC = crc;
- State = state;
- UsePublicKeyOrCRC = crcOrPubKey;
- }
+ : Name(name), Enabled(enabled), CRC(crc), State(state), UsePublicKeyOrCRC(crcOrPubKey) {}
std::string Name;
uint8 Enabled;
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index 683a269f508..940f1f8beb7 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -34,7 +34,7 @@
enum eAuctionHouse
{
- AH_MINIMUM_DEPOSIT = 100,
+ AH_MINIMUM_DEPOSIT = 100
};
AuctionHouseMgr::AuctionHouseMgr()
@@ -134,15 +134,6 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
// receiver exist
if (bidder || bidder_accId)
{
- std::ostringstream msgAuctionWonSubject;
- msgAuctionWonSubject << auction->item_template << ":0:" << AUCTION_WON;
-
- std::ostringstream msgAuctionWonBody;
- msgAuctionWonBody.width(16);
- msgAuctionWonBody << std::right << std::hex << auction->owner;
- msgAuctionWonBody << std::dec << ':' << auction->bid << ':' << auction->buyout;
- sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionWon body string : %s", msgAuctionWonBody.str().c_str());
-
// set owner to bidder (to prevent delete item with sender char deleting)
// owner in `data` will set at mail receive and item extracting
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
@@ -154,10 +145,10 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
{
bidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, bidder_guid, 0, 0, auction->item_template);
// FIXME: for offline player need also
- bidder->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, 1);
+ bidder->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, 1);
}
- MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str())
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_WON), AuctionEntry::BuildAuctionMailBody(auction->owner, auction->bid, auction->buyout, 0, 0))
.AddItem(pItem)
.SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
}
@@ -170,26 +161,8 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTrans
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
// owner exist (online or offline)
if (owner || owner_accId)
- {
- std::ostringstream msgAuctionSalePendingSubject;
- msgAuctionSalePendingSubject << auction->item_template << ":0:" << AUCTION_SALE_PENDING;
-
- std::ostringstream msgAuctionSalePendingBody;
- uint32 auctionCut = auction->GetAuctionCut();
-
- time_t distrTime = time(NULL) + sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY);
-
- msgAuctionSalePendingBody.width(16);
- msgAuctionSalePendingBody << std::right << std::hex << auction->bidder;
- msgAuctionSalePendingBody << std::dec << ':' << auction->bid << ':' << auction->buyout;
- msgAuctionSalePendingBody << ':' << auction->deposit << ':' << auctionCut << ":0:";
- msgAuctionSalePendingBody << secsToTimeBitFields(distrTime);
-
- sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str());
-
- MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str())
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_SALE_PENDING), AuctionEntry::BuildAuctionMailBody(auction->bidder, auction->bid, auction->buyout, auction->deposit, auction->GetAuctionCut()))
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED);
- }
}
//call this method to send mail to auction owner, when auction is successful, it does not clear ram
@@ -201,30 +174,18 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa
// owner exist
if (owner || owner_accId)
{
- std::ostringstream msgAuctionSuccessfulSubject;
- msgAuctionSuccessfulSubject << auction->item_template << ":0:" << AUCTION_SUCCESSFUL;
-
- std::ostringstream auctionSuccessfulBody;
- uint32 auctionCut = auction->GetAuctionCut();
-
- auctionSuccessfulBody.width(16);
- auctionSuccessfulBody << std::right << std::hex << auction->bidder;
- auctionSuccessfulBody << std::dec << ':' << auction->bid << ':' << auction->buyout;
- auctionSuccessfulBody << ':' << auction->deposit << ':' << auctionCut;
-
- sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str());
-
- uint32 profit = auction->bid + auction->deposit - auctionCut;
+ uint32 profit = auction->bid + auction->deposit - auction->GetAuctionCut();
//FIXME: what do if owner offline
if (owner)
{
- owner->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, profit);
- owner->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, auction->bid);
+ owner->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, profit);
+ owner->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, auction->bid);
//send auction owner notification, bidder must be current!
owner->GetSession()->SendAuctionOwnerNotification(auction);
}
- MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str())
+
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_SUCCESSFUL), AuctionEntry::BuildAuctionMailBody(auction->bidder, auction->bid, auction->buyout, auction->deposit, auction->GetAuctionCut()))
.AddMoney(profit)
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY));
}
@@ -244,13 +205,10 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
// owner exist
if (owner || owner_accId)
{
- std::ostringstream subject;
- subject << auction->item_template << ":0:" << AUCTION_EXPIRED << ":0:0";
-
if (owner)
owner->GetSession()->SendAuctionOwnerNotification(auction);
- MailDraft(subject.str(), "") // TODO: fix body
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_EXPIRED), AuctionEntry::BuildAuctionMailBody(0, 0, auction->buyout, auction->deposit, 0))
.AddItem(pItem)
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0);
}
@@ -269,13 +227,10 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 new
// old bidder exist
if (oldBidder || oldBidder_accId)
{
- std::ostringstream msgAuctionOutbiddedSubject;
- msgAuctionOutbiddedSubject << auction->item_template << ":0:" << AUCTION_OUTBIDDED << ":0:0";
-
if (oldBidder && newBidder)
oldBidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, newBidder->GetGUID(), newPrice, auction->GetAuctionOutBid(), auction->item_template);
- MailDraft(msgAuctionOutbiddedSubject.str(), "") // TODO: fix body
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_OUTBIDDED), AuctionEntry::BuildAuctionMailBody(auction->owner, auction->bid, auction->buyout, auction->deposit, auction->GetAuctionCut()))
.AddMoney(auction->bid)
.SendMailTo(trans, MailReceiver(oldBidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
}
@@ -293,14 +248,9 @@ void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQ
// bidder exist
if (bidder || bidder_accId)
- {
- std::ostringstream msgAuctionCancelledSubject;
- msgAuctionCancelledSubject << auction->item_template << ":0:" << AUCTION_CANCELLED_TO_BIDDER << ":0:0";
-
- MailDraft(msgAuctionCancelledSubject.str(), "") // TODO: fix body
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_CANCELLED_TO_BIDDER), AuctionEntry::BuildAuctionMailBody(auction->owner, auction->bid, auction->buyout, auction->deposit, 0))
.AddMoney(auction->bid)
.SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
- }
}
void AuctionHouseMgr::LoadAuctionItems()
@@ -313,8 +263,8 @@ void AuctionHouseMgr::LoadAuctionItems()
if (!result)
{
- sLog->outString(">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!");
+
return;
}
@@ -322,7 +272,6 @@ void AuctionHouseMgr::LoadAuctionItems()
do
{
-
Field* fields = result->Fetch();
uint32 item_guid = fields[11].GetUInt32();
@@ -331,7 +280,7 @@ void AuctionHouseMgr::LoadAuctionItems()
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item_template);
if (!proto)
{
- sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template);
continue;
}
@@ -347,8 +296,8 @@ void AuctionHouseMgr::LoadAuctionItems()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AuctionHouseMgr::LoadAuctions()
@@ -360,8 +309,8 @@ void AuctionHouseMgr::LoadAuctions()
if (!result)
{
- sLog->outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
+
return;
}
@@ -386,8 +335,8 @@ void AuctionHouseMgr::LoadAuctions()
CharacterDatabase.CommitTransaction(trans);
- sLog->outString(">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AuctionHouseMgr::AddAItem(Item* it)
@@ -655,7 +604,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
Item* item = sAuctionMgr->GetAItem(item_guidlow);
if (!item)
{
- sLog->outError("AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
return false;
}
data << uint32(Id);
@@ -726,25 +675,26 @@ bool AuctionEntry::LoadFromDB(Field* fields)
auctioneer = fields[1].GetUInt32();
item_guidlow = fields[2].GetUInt32();
item_template = fields[3].GetUInt32();
- owner = fields[4].GetUInt32();
- buyout = fields[5].GetUInt32();
- expire_time = fields[6].GetUInt32();
- bidder = fields[7].GetUInt32();
- bid = fields[8].GetUInt32();
- startbid = fields[9].GetUInt32();
- deposit = fields[10].GetUInt32();
+ itemCount = fields[4].GetUInt32();
+ owner = fields[5].GetUInt32();
+ buyout = fields[6].GetUInt32();
+ expire_time = fields[7].GetUInt32();
+ bidder = fields[8].GetUInt32();
+ bid = fields[9].GetUInt32();
+ startbid = fields[10].GetUInt32();
+ deposit = fields[11].GetUInt32();
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer);
if (!auctioneerData)
{
- sLog->outError("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
return false;
}
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
if (!auctioneerInfo)
{
- sLog->outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
return false;
}
@@ -752,7 +702,7 @@ bool AuctionEntry::LoadFromDB(Field* fields)
auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(factionTemplateId);
if (!auctionHouseEntry)
{
- sLog->outError("Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
return false;
}
@@ -760,7 +710,7 @@ bool AuctionEntry::LoadFromDB(Field* fields)
// and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems)
if (!sAuctionMgr->GetAItem(item_guidlow))
{
- sLog->outError("Auction %u has not a existing item : %u", Id, item_guidlow);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing item : %u", Id, item_guidlow);
return false;
}
return true;
@@ -784,8 +734,8 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
if (!expAuctions)
{
- sLog->outString(">> No expired auctions to delete");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> No expired auctions to delete");
+
return;
}
@@ -832,8 +782,8 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
} while (expAuctions->NextRow());
- sLog->outString(">> Deleted %u expired auctions in %u ms", expirecount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Deleted %u expired auctions in %u ms", expirecount, GetMSTimeDiffToNow(oldMSTime));
+
}
@@ -847,25 +797,26 @@ bool AuctionEntry::LoadFromFieldList(Field* fields)
auctioneer = fields[1].GetUInt32();
item_guidlow = fields[2].GetUInt32();
item_template = fields[3].GetUInt32();
- owner = fields[4].GetUInt32();
- buyout = fields[5].GetUInt32();
- expire_time = fields[6].GetUInt32();
- bidder = fields[7].GetUInt32();
- bid = fields[8].GetUInt32();
- startbid = fields[9].GetUInt32();
- deposit = fields[10].GetUInt32();
+ itemCount = fields[4].GetUInt32();
+ owner = fields[5].GetUInt32();
+ buyout = fields[6].GetUInt32();
+ expire_time = fields[7].GetUInt32();
+ bidder = fields[8].GetUInt32();
+ bid = fields[9].GetUInt32();
+ startbid = fields[10].GetUInt32();
+ deposit = fields[11].GetUInt32();
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer);
if (!auctioneerData)
{
- sLog->outError("AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
return false;
}
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
if (!auctioneerInfo)
{
- sLog->outError("AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
return false;
}
@@ -874,9 +825,26 @@ bool AuctionEntry::LoadFromFieldList(Field* fields)
if (!auctionHouseEntry)
{
- sLog->outError("AuctionEntry::LoadFromFieldList() - Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::LoadFromFieldList() - Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
return false;
}
return true;
}
+
+std::string AuctionEntry::BuildAuctionMailSubject(MailAuctionAnswers response) const
+{
+ std::ostringstream strm;
+ strm << item_template << ":0:" << response << ':' << Id << ':' << itemCount;
+ return strm.str();
+}
+
+std::string AuctionEntry::BuildAuctionMailBody(uint32 lowGuid, uint32 bid, uint32 buyout, uint32 deposit, uint32 cut)
+{
+ std::ostringstream strm;
+ strm.width(16);
+ strm << std::right << std::hex << MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER); // HIGHGUID_PLAYER always present, even for empty guids
+ strm << std::dec << ':' << bid << ':' << buyout;
+ strm << ':' << deposit << ':' << cut;
+ return strm.str();
+}
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h
index 190fbcc5107..049440f99d0 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.h
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h
@@ -48,12 +48,24 @@ enum AuctionAction
AUCTION_PLACE_BID = 2
};
+enum MailAuctionAnswers
+{
+ AUCTION_OUTBIDDED = 0,
+ AUCTION_WON = 1,
+ AUCTION_SUCCESSFUL = 2,
+ AUCTION_EXPIRED = 3,
+ AUCTION_CANCELLED_TO_BIDDER = 4,
+ AUCTION_CANCELED = 5,
+ AUCTION_SALE_PENDING = 6
+};
+
struct AuctionEntry
{
uint32 Id;
uint32 auctioneer; // creature low guid
uint32 item_guidlow;
uint32 item_template;
+ uint32 itemCount;
uint32 owner;
uint32 startbid; //maybe useless
uint32 bid;
@@ -74,6 +86,8 @@ struct AuctionEntry
void SaveToDB(SQLTransaction& trans) const;
bool LoadFromDB(Field* fields);
bool LoadFromFieldList(Field* fields);
+ std::string BuildAuctionMailSubject(MailAuctionAnswers response) const;
+ static std::string BuildAuctionMailBody(uint32 lowGuid, uint32 bid, uint32 buyout, uint32 deposit, uint32 cut);
};
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
new file mode 100644
index 00000000000..ae58f3504b4
--- /dev/null
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -0,0 +1,1118 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+#include "Map.h"
+#include "MapManager.h"
+#include "Group.h"
+#include "WorldPacket.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "CellImpl.h"
+#include "CreatureTextMgr.h"
+#include "GroupMgr.h"
+
+Battlefield::Battlefield()
+{
+ m_Timer = 0;
+ m_IsEnabled = true;
+ m_isActive = false;
+ m_DefenderTeam = TEAM_NEUTRAL;
+
+ m_TypeId = 0;
+ m_BattleId = 0;
+ m_ZoneId = 0;
+ m_MapId = 0;
+ m_MaxPlayer = 0;
+ m_MinPlayer = 0;
+ m_BattleTime = 0;
+ m_NoWarBattleTime = 0;
+ m_TimeForAcceptInvite = 20;
+ m_uiKickDontAcceptTimer = 1000;
+
+ m_uiKickAfkPlayersTimer = 1000;
+
+ m_LastResurectTimer = 30 * IN_MILLISECONDS;
+ m_StartGroupingTimer = 0;
+ m_StartGrouping = false;
+ StalkerGuid = 0;
+}
+
+Battlefield::~Battlefield()
+{
+ for (BfCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
+ delete itr->second;
+
+ for (GraveyardVect::const_iterator itr = m_GraveyardList.begin(); itr != m_GraveyardList.end(); ++itr)
+ delete *itr;
+
+ m_capturePoints.clear();
+}
+
+// Called when a player enters the zone
+void Battlefield::HandlePlayerEnterZone(Player* player, uint32 /*zone*/)
+{
+ // If battle is started,
+ // If not full of players > invite player to join the war
+ // If full of players > announce to player that BF is full and kick him after a few second if he desn't leave
+ if (IsWarTime())
+ {
+ if (m_PlayersInWar[player->GetTeamId()].size() + m_InvitedPlayers[player->GetTeamId()].size() < m_MaxPlayer) // Vacant spaces
+ InvitePlayerToWar(player);
+ else // No more vacant places
+ {
+ // TODO: Send a packet to announce it to player
+ m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
+ InvitePlayerToQueue(player);
+ }
+ }
+ else
+ {
+ // If time left is < 15 minutes invite player to join queue
+ if (m_Timer <= m_StartGroupingTimer)
+ InvitePlayerToQueue(player);
+ }
+
+ // Add player in the list of player in zone
+ m_players[player->GetTeamId()].insert(player->GetGUID());
+ OnPlayerEnterZone(player);
+}
+
+// Called when a player leave the zone
+void Battlefield::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/)
+{
+ if (IsWarTime())
+ {
+ // If the player is participating to the battle
+ if (m_PlayersInWar[player->GetTeamId()].find(player->GetGUID()) != m_PlayersInWar[player->GetTeamId()].end())
+ {
+ m_PlayersInWar[player->GetTeamId()].erase(player->GetGUID());
+ player->GetSession()->SendBfLeaveMessage(m_BattleId);
+ if (Group* group = player->GetGroup()) // Remove the player from the raid group
+ group->RemoveMember(player->GetGUID());
+
+ OnPlayerLeaveWar(player);
+ }
+ }
+
+ for (BfCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
+ itr->second->HandlePlayerLeave(player);
+
+ m_InvitedPlayers[player->GetTeamId()].erase(player->GetGUID());
+ m_PlayersWillBeKick[player->GetTeamId()].erase(player->GetGUID());
+ m_players[player->GetTeamId()].erase(player->GetGUID());
+ SendRemoveWorldStates(player);
+ RemovePlayerFromResurrectQueue(player->GetGUID());
+ OnPlayerLeaveZone(player);
+}
+
+bool Battlefield::Update(uint32 diff)
+{
+ if (m_Timer <= diff)
+ {
+ // Battlefield ends on time
+ if (IsWarTime())
+ EndBattle(true);
+ else // Time to start a new battle!
+ StartBattle();
+ }
+ else
+ m_Timer -= diff;
+
+ // Invite players a few minutes before the battle's beginning
+ if (!IsWarTime() && !m_StartGrouping && m_Timer <= m_StartGroupingTimer)
+ {
+ m_StartGrouping = true;
+ InvitePlayersInZoneToQueue();
+ OnStartGrouping();
+ }
+
+ bool objective_changed = false;
+ if (IsWarTime())
+ {
+ if (m_uiKickAfkPlayersTimer <= diff)
+ {
+ m_uiKickAfkPlayersTimer = 1000;
+ KickAfkPlayers();
+ }
+ else
+ m_uiKickAfkPlayersTimer -= diff;
+
+ // Kick players who chose not to accept invitation to the battle
+ if (m_uiKickDontAcceptTimer <= diff)
+ {
+ for (int team = 0; team < 2; team++)
+ for (PlayerTimerMap::iterator itr = m_InvitedPlayers[team].begin(); itr != m_InvitedPlayers[team].end(); ++itr)
+ if ((*itr).second <= time(NULL))
+ KickPlayerFromBattlefield((*itr).first);
+
+ InvitePlayersInZoneToWar();
+ for (int team = 0; team < 2; team++)
+ for (PlayerTimerMap::iterator itr = m_PlayersWillBeKick[team].begin(); itr != m_PlayersWillBeKick[team].end(); ++itr)
+ if ((*itr).second <= time(NULL))
+ KickPlayerFromBattlefield((*itr).first);
+
+ m_uiKickDontAcceptTimer = 1000;
+ }
+ else
+ m_uiKickDontAcceptTimer -= diff;
+
+ for (BfCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
+ if (itr->second->Update(diff))
+ objective_changed = true;
+ }
+
+
+ if (m_LastResurectTimer <= diff)
+ {
+ for (uint8 i = 0; i < m_GraveyardList.size(); i++)
+ if (GetGraveyardById(i))
+ m_GraveyardList[i]->Resurrect();
+ m_LastResurectTimer = RESURRECTION_INTERVAL;
+ }
+ else
+ m_LastResurectTimer -= diff;
+
+ return objective_changed;
+}
+
+void Battlefield::InvitePlayersInZoneToQueue()
+{
+ for (uint8 team = 0; team < 2; ++team)
+ for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ InvitePlayerToQueue(player);
+}
+
+void Battlefield::InvitePlayerToQueue(Player* player)
+{
+ if (m_PlayersInQueue[player->GetTeamId()].count(player->GetGUID()))
+ return;
+
+ if (m_PlayersInQueue[player->GetTeamId()].size() <= m_MinPlayer || m_PlayersInQueue[GetOtherTeam(player->GetTeamId())].size() >= m_MinPlayer)
+ player->GetSession()->SendBfInvitePlayerToQueue(m_BattleId);
+}
+
+void Battlefield::InvitePlayersInQueueToWar()
+{
+ for (uint8 team = 0; team < BG_TEAMS_COUNT; ++team)
+ {
+ for (GuidSet::const_iterator itr = m_PlayersInQueue[team].begin(); itr != m_PlayersInQueue[team].end(); ++itr)
+ {
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ if (m_PlayersInWar[player->GetTeamId()].size() + m_InvitedPlayers[player->GetTeamId()].size() < m_MaxPlayer)
+ InvitePlayerToWar(player);
+ else
+ {
+ //Full
+ }
+ }
+ }
+ m_PlayersInQueue[team].clear();
+ }
+}
+
+void Battlefield::InvitePlayersInZoneToWar()
+{
+ for (uint8 team = 0; team < BG_TEAMS_COUNT; ++team)
+ for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ {
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ if (m_PlayersInWar[player->GetTeamId()].count(player->GetGUID()) || m_InvitedPlayers[player->GetTeamId()].count(player->GetGUID()))
+ continue;
+ if (m_PlayersInWar[player->GetTeamId()].size() + m_InvitedPlayers[player->GetTeamId()].size() < m_MaxPlayer)
+ InvitePlayerToWar(player);
+ else // Battlefield is full of players
+ m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
+ }
+ }
+}
+
+void Battlefield::InvitePlayerToWar(Player* player)
+{
+ if (!player)
+ return;
+
+ // TODO : needed ?
+ if (player->isInFlight())
+ return;
+
+ if (player->InArena() || player->GetBattleground())
+ {
+ m_PlayersInQueue[player->GetTeamId()].erase(player->GetGUID());
+ return;
+ }
+
+ // If the player does not match minimal level requirements for the battlefield, kick him
+ if (player->getLevel() < m_MinLevel)
+ {
+ if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)
+ m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
+ return;
+ }
+
+ // Check if player is not already in war
+ if (m_PlayersInWar[player->GetTeamId()].count(player->GetGUID()) || m_InvitedPlayers[player->GetTeamId()].count(player->GetGUID()))
+ return;
+
+ m_PlayersWillBeKick[player->GetTeamId()].erase(player->GetGUID());
+ m_InvitedPlayers[player->GetTeamId()][player->GetGUID()] = time(NULL) + m_TimeForAcceptInvite;
+ player->GetSession()->SendBfInvitePlayerToWar(m_BattleId, m_ZoneId, m_TimeForAcceptInvite);
+}
+
+void Battlefield::InitStalker(uint32 entry, float x, float y, float z, float o)
+{
+ if (Creature* creature = SpawnCreature(entry, x, y, z, o, TEAM_NEUTRAL))
+ StalkerGuid = creature->GetGUID();
+ else
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry);
+}
+
+void Battlefield::KickAfkPlayers()
+{
+ for (uint8 team = 0; team < BG_TEAMS_COUNT; ++team)
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ if (player->isAFK())
+ KickPlayerFromBattlefield(*itr);
+}
+
+void Battlefield::KickPlayerFromBattlefield(uint64 guid)
+{
+ if (Player* player = sObjectAccessor->FindPlayer(guid))
+ if (player->GetZoneId() == GetZoneId())
+ player->TeleportTo(KickPosition);
+}
+
+void Battlefield::StartBattle()
+{
+ if (m_isActive)
+ return;
+
+ for (int team = 0; team < BG_TEAMS_COUNT; team++)
+ {
+ m_PlayersInWar[team].clear();
+ m_Groups[team].clear();
+ }
+
+ m_Timer = m_BattleTime;
+ m_isActive = true;
+
+ InvitePlayersInZoneToWar();
+ InvitePlayersInQueueToWar();
+
+ DoPlaySoundToAll(BF_START);
+
+ OnBattleStart();
+}
+
+void Battlefield::EndBattle(bool endByTimer)
+{
+ if (!m_isActive)
+ return;
+
+ m_isActive = false;
+
+ m_StartGrouping = false;
+
+ if (!endByTimer)
+ SetDefenderTeam(GetAttackerTeam());
+
+ if (GetDefenderTeam() == TEAM_ALLIANCE)
+ DoPlaySoundToAll(BF_ALLIANCE_WINS);
+ else
+ DoPlaySoundToAll(BF_HORDE_WINS);
+
+ OnBattleEnd(endByTimer);
+
+ // Reset battlefield timer
+ m_Timer = m_NoWarBattleTime;
+ SendInitWorldStatesToAll();
+}
+
+void Battlefield::DoPlaySoundToAll(uint32 SoundID)
+{
+ WorldPacket data;
+ data.Initialize(SMSG_PLAY_SOUND, 4);
+ data << uint32(SoundID);
+
+ for (int team = 0; team < BG_TEAMS_COUNT; team++)
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->GetSession()->SendPacket(&data);
+}
+
+bool Battlefield::HasPlayer(Player* player) const
+{
+ return m_players[player->GetTeamId()].find(player->GetGUID()) != m_players[player->GetTeamId()].end();
+}
+
+// Called in WorldSession::HandleBfQueueInviteResponse
+void Battlefield::PlayerAcceptInviteToQueue(Player* player)
+{
+ // Add player in queue
+ m_PlayersInQueue[player->GetTeamId()].insert(player->GetGUID());
+ // Send notification
+ player->GetSession()->SendBfQueueInviteResponse(m_BattleId, m_ZoneId);
+}
+
+// Called in WorldSession::HandleBfExitRequest
+void Battlefield::AskToLeaveQueue(Player* player)
+{
+ // Remove player from queue
+ m_PlayersInQueue[player->GetTeamId()].erase(player->GetGUID());
+}
+
+// Called in WorldSession::HandleBfEntryInviteResponse
+void Battlefield::PlayerAcceptInviteToWar(Player* player)
+{
+ if (!IsWarTime())
+ return;
+
+ if (AddOrSetPlayerToCorrectBfGroup(player))
+ {
+ player->GetSession()->SendBfEntered(m_BattleId);
+ m_PlayersInWar[player->GetTeamId()].insert(player->GetGUID());
+ m_InvitedPlayers[player->GetTeamId()].erase(player->GetGUID());
+
+ if (player->isAFK())
+ player->ToggleAFK();
+
+ OnPlayerJoinWar(player); //for scripting
+ }
+}
+
+void Battlefield::TeamCastSpell(TeamId team, int32 spellId)
+{
+ if (spellId > 0)
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->CastSpell(player, uint32(spellId), true);
+ else
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->RemoveAuraFromStack(uint32(-spellId));
+}
+
+void Battlefield::BroadcastPacketToZone(WorldPacket& data) const
+{
+ for (uint8 team = 0; team < BG_TEAMS_COUNT; ++team)
+ for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->GetSession()->SendPacket(&data);
+}
+
+void Battlefield::BroadcastPacketToQueue(WorldPacket& data) const
+{
+ for (uint8 team = 0; team < BG_TEAMS_COUNT; ++team)
+ for (GuidSet::const_iterator itr = m_PlayersInQueue[team].begin(); itr != m_PlayersInQueue[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->GetSession()->SendPacket(&data);
+}
+
+void Battlefield::BroadcastPacketToWar(WorldPacket& data) const
+{
+ for (uint8 team = 0; team < BG_TEAMS_COUNT; ++team)
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->GetSession()->SendPacket(&data);
+}
+
+WorldPacket Battlefield::BuildWarningAnnPacket(std::string msg)
+{
+ WorldPacket data(SMSG_MESSAGECHAT, 200);
+
+ data << uint8(CHAT_MSG_RAID_BOSS_EMOTE);
+ data << uint32(LANG_UNIVERSAL);
+ data << uint64(0);
+ data << uint32(0); // 2.1.0
+ data << uint32(1);
+ data << uint8(0);
+ data << uint64(0);
+ data << uint32(msg.length() + 1);
+ data << msg;
+ data << uint8(0);
+
+ return data;
+}
+
+void Battlefield::SendWarningToAllInZone(uint32 entry)
+{
+ if (Unit* unit = sObjectAccessor->FindUnit(StalkerGuid))
+ if (Creature* stalker = unit->ToCreature())
+ // FIXME: replaced CHAT_TYPE_END with CHAT_MSG_BG_SYSTEM_NEUTRAL to fix compile, it's a guessed change :/
+ sCreatureTextMgr->SendChat(stalker, (uint8) entry, 0, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE);
+}
+
+/*void Battlefield::SendWarningToAllInWar(int32 entry,...)
+{
+ const char *format = sObjectMgr->GetTrinityStringForDBCLocale(entry);
+ va_list ap;
+ char str [1024];
+ va_start(ap, entry);
+ vsnprintf(str,1024,format, ap);
+ va_end(ap);
+ std::string msg = (std::string)str;
+
+ WorldPacket data = BuildWarningAnnPacket(msg);
+ BroadcastPacketWar(data);
+}*/
+
+void Battlefield::SendWarningToPlayer(Player* player, uint32 entry)
+{
+ if (player)
+ if (Unit* unit = sObjectAccessor->FindUnit(StalkerGuid))
+ if (Creature* stalker = unit->ToCreature())
+ sCreatureTextMgr->SendChat(stalker, (uint8)entry, player->GetGUID());
+}
+
+void Battlefield::SendUpdateWorldState(uint32 field, uint32 value)
+{
+ for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
+ for (GuidSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->SendUpdateWorldState(field, value);
+}
+
+void Battlefield::RegisterZone(uint32 zoneId)
+{
+ sBattlefieldMgr->AddZone(zoneId, this);
+}
+
+void Battlefield::HideNpc(Creature* creature)
+{
+ creature->CombatStop();
+ creature->SetReactState(REACT_PASSIVE);
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ creature->SetPhaseMask(2, true);
+ creature->DisappearAndDie();
+ creature->SetVisible(false);
+}
+
+void Battlefield::ShowNpc(Creature* creature, bool aggressive)
+{
+ creature->SetPhaseMask(1, true);
+ creature->SetVisible(true);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ if (!creature->isAlive())
+ creature->Respawn(true);
+ if (aggressive)
+ creature->SetReactState(REACT_AGGRESSIVE);
+ else
+ {
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ creature->SetReactState(REACT_PASSIVE);
+ }
+}
+
+// ****************************************************
+// ******************* Group System *******************
+// ****************************************************
+Group* Battlefield::GetFreeBfRaid(TeamId TeamId)
+{
+ for (GuidSet::const_iterator itr = m_Groups[TeamId].begin(); itr != m_Groups[TeamId].end(); ++itr)
+ if (Group* group = sGroupMgr->GetGroupByGUID(*itr))
+ if (!group->IsFull())
+ return group;
+
+ return NULL;
+}
+
+Group* Battlefield::GetGroupPlayer(uint64 guid, TeamId TeamId)
+{
+ for (GuidSet::const_iterator itr = m_Groups[TeamId].begin(); itr != m_Groups[TeamId].end(); ++itr)
+ if (Group* group = sGroupMgr->GetGroupByGUID(*itr))
+ if (group->IsMember(guid))
+ return group;
+
+ return NULL;
+}
+
+bool Battlefield::AddOrSetPlayerToCorrectBfGroup(Player* player)
+{
+ if (!player->IsInWorld())
+ return false;
+
+ if (Group* group = player->GetGroup())
+ group->RemoveMember(player->GetGUID());
+
+ Group* group = GetFreeBfRaid(player->GetTeamId());
+ if (!group)
+ {
+ group = new Group;
+ group->SetBattlefieldGroup(this);
+ group->Create(player);
+ sGroupMgr->AddGroup(group);
+ m_Groups[player->GetTeamId()].insert(group->GetGUID());
+ }
+ else if (group->IsMember(player->GetGUID()))
+ {
+ uint8 subgroup = group->GetMemberGroup(player->GetGUID());
+ player->SetBattlegroundOrBattlefieldRaid(group, subgroup);
+ }
+ else
+ group->AddMember(player);
+
+ return true;
+}
+
+//***************End of Group System*******************
+
+//*****************************************************
+//***************Spirit Guide System*******************
+//*****************************************************
+
+//--------------------
+//-Battlefield Method-
+//--------------------
+BfGraveyard* Battlefield::GetGraveyardById(uint32 id)
+{
+ if (id < m_GraveyardList.size())
+ {
+ if (m_GraveyardList[id])
+ return m_GraveyardList[id];
+ else
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u not existed", id);
+ }
+ else
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u cant be found", id);
+
+ return NULL;
+}
+
+WorldSafeLocsEntry const * Battlefield::GetClosestGraveYard(Player* player)
+{
+ BfGraveyard* closestGY = NULL;
+ float maxdist = -1;
+ for (uint8 i = 0; i < m_GraveyardList.size(); i++)
+ {
+ if (m_GraveyardList[i])
+ {
+ if (m_GraveyardList[i]->GetControlTeamId() != player->GetTeamId())
+ continue;
+
+ float dist = m_GraveyardList[i]->GetDistance(player);
+ if (dist < maxdist || maxdist < 0)
+ {
+ closestGY = m_GraveyardList[i];
+ maxdist = dist;
+ }
+ }
+ }
+
+ if (closestGY)
+ return sWorldSafeLocsStore.LookupEntry(closestGY->GetGraveyardId());
+
+ return NULL;
+}
+
+void Battlefield::AddPlayerToResurrectQueue(uint64 npcGuid, uint64 playerGuid)
+{
+ for (uint8 i = 0; i < m_GraveyardList.size(); i++)
+ {
+ if (!m_GraveyardList[i])
+ continue;
+
+ if (m_GraveyardList[i]->HasNpc(npcGuid))
+ {
+ m_GraveyardList[i]->AddPlayer(playerGuid);
+ break;
+ }
+ }
+}
+
+void Battlefield::RemovePlayerFromResurrectQueue(uint64 playerGuid)
+{
+ for (uint8 i = 0; i < m_GraveyardList.size(); i++)
+ {
+ if (!m_GraveyardList[i])
+ continue;
+
+ if (m_GraveyardList[i]->HasPlayer(playerGuid))
+ {
+ m_GraveyardList[i]->RemovePlayer(playerGuid);
+ break;
+ }
+ }
+}
+
+void Battlefield::SendAreaSpiritHealerQueryOpcode(Player* player, const uint64 &guid)
+{
+ WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 12);
+ uint32 time = m_LastResurectTimer; // resurrect every 30 seconds
+
+ data << guid << time;
+ ASSERT(player && player->GetSession());
+ player->GetSession()->SendPacket(&data);
+}
+
+// ----------------------
+// - BfGraveyard Method -
+// ----------------------
+BfGraveyard::BfGraveyard(Battlefield* battlefield)
+{
+ m_Bf = battlefield;
+ m_GraveyardId = 0;
+ m_ControlTeam = TEAM_NEUTRAL;
+ m_SpiritGuide[0] = 0;
+ m_SpiritGuide[1] = 0;
+ m_ResurrectQueue.clear();
+}
+
+void BfGraveyard::Initialize(TeamId startControl, uint32 graveyardId)
+{
+ m_ControlTeam = startControl;
+ m_GraveyardId = graveyardId;
+}
+
+void BfGraveyard::SetSpirit(Creature* spirit, TeamId team)
+{
+ if (!spirit)
+ {
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "BfGraveyard::SetSpirit: Invalid Spirit.");
+ return;
+ }
+
+ m_SpiritGuide[team] = spirit->GetGUID();
+ spirit->SetReactState(REACT_PASSIVE);
+}
+
+float BfGraveyard::GetDistance(Player* player)
+{
+ const WorldSafeLocsEntry* safeLoc = sWorldSafeLocsStore.LookupEntry(m_GraveyardId);
+ return player->GetDistance2d(safeLoc->x, safeLoc->y);
+}
+
+void BfGraveyard::AddPlayer(uint64 playerGuid)
+{
+ if (!m_ResurrectQueue.count(playerGuid))
+ {
+ m_ResurrectQueue.insert(playerGuid);
+
+ if (Player* player = sObjectAccessor->FindPlayer(playerGuid))
+ player->CastSpell(player, SPELL_WAITING_FOR_RESURRECT, true);
+ }
+}
+
+void BfGraveyard::RemovePlayer(uint64 playerGuid)
+{
+ m_ResurrectQueue.erase(m_ResurrectQueue.find(playerGuid));
+
+ if (Player* player = sObjectAccessor->FindPlayer(playerGuid))
+ player->RemoveAurasDueToSpell(SPELL_WAITING_FOR_RESURRECT);
+}
+
+void BfGraveyard::Resurrect()
+{
+ if (m_ResurrectQueue.empty())
+ return;
+
+ for (GuidSet::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
+ {
+ // Get player object from his guid
+ Player* player = sObjectAccessor->FindPlayer(*itr);
+ if (!player)
+ continue;
+
+ // Check if the player is in world and on the good graveyard
+ if (player->IsInWorld())
+ if (Unit* spirit = sObjectAccessor->FindUnit(m_SpiritGuide[m_ControlTeam]))
+ spirit->CastSpell(spirit, SPELL_SPIRIT_HEAL, true);
+
+ // Resurect player
+ player->CastSpell(player, SPELL_RESURRECTION_VISUAL, true);
+ player->ResurrectPlayer(1.0f);
+ player->CastSpell(player, 6962, true);
+ player->CastSpell(player, SPELL_SPIRIT_HEAL_MANA, true);
+
+ sObjectAccessor->ConvertCorpseForPlayer(player->GetGUID());
+ }
+
+ m_ResurrectQueue.clear();
+}
+
+// For changing graveyard control
+void BfGraveyard::GiveControlTo(TeamId team)
+{
+ // Guide switching
+ // Note: Visiblity changes are made by phasing
+ /*if (m_SpiritGuide[1 - team])
+ m_SpiritGuide[1 - team]->SetVisible(false);
+ if (m_SpiritGuide[team])
+ m_SpiritGuide[team]->SetVisible(true);*/
+
+ m_ControlTeam = team;
+ // Teleport to other graveyard, player witch were on this graveyard
+ RelocateDeadPlayers();
+}
+
+void BfGraveyard::RelocateDeadPlayers()
+{
+ WorldSafeLocsEntry const* closestGrave = NULL;
+ for (GuidSet::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
+ {
+ Player* player = sObjectAccessor->FindPlayer(*itr);
+ if (!player)
+ continue;
+
+ if (closestGrave)
+ player->TeleportTo(player->GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation());
+ else
+ {
+ closestGrave = m_Bf->GetClosestGraveYard(player);
+ if (closestGrave)
+ player->TeleportTo(player->GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation());
+ }
+ }
+}
+
+// *******************************************************
+// *************** End Spirit Guide system ***************
+// *******************************************************
+// ********************** Misc ***************************
+// *******************************************************
+
+Creature* Battlefield::SpawnCreature(uint32 entry, Position pos, TeamId team)
+{
+ return SpawnCreature(entry, pos.m_positionX, pos.m_positionY, pos.m_positionZ, pos.m_orientation, team);
+}
+
+Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team)
+{
+ //Get map object
+ Map* map = const_cast < Map * >(sMapMgr->CreateBaseMap(m_MapId));
+ if (!map)
+ {
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry);
+ return 0;
+ }
+
+ Creature* creature = new Creature;
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o))
+ {
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry);
+ delete creature;
+ return NULL;
+ }
+
+ creature->SetHomePosition(x, y, z, o);
+
+ CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
+ if (!cinfo)
+ {
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: entry %u does not exist.", entry);
+ return NULL;
+ }
+ // force using DB speeds -- do we really need this?
+ creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
+ creature->SetSpeed(MOVE_RUN, cinfo->speed_run);
+
+ // Set creature in world
+ map->AddToMap(creature);
+ creature->setActive(true);
+
+ return creature;
+}
+
+// Method for spawning gameobject on map
+GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z, float o)
+{
+ // Get map object
+ Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(571)); // *vomits*
+ if (!map)
+ return 0;
+
+ // Create gameobject
+ GameObject* go = new GameObject;
+ if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, PHASEMASK_NORMAL, x, y, z, o, 0, 0, 0, 0, 100, GO_STATE_READY))
+ {
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnGameObject: Gameobject template %u not found in database! Battlefield not created!", entry);
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnGameObject: Cannot create gameobject template %u! Battlefield not created!", entry);
+ delete go;
+ return NULL;
+ }
+
+ // Add to world
+ map->AddToMap(go);
+ go->setActive(true);
+
+ return go;
+}
+
+// *******************************************************
+// ******************* CapturePoint **********************
+// *******************************************************
+
+BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_capturePoint(NULL)
+{
+ m_team = TEAM_NEUTRAL;
+ m_value = 0;
+ m_minValue = 0.0f;
+ m_maxValue = 0.0f;
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL;
+ m_OldState = BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL;
+ m_capturePointEntry = 0;
+ m_neutralValuePct = 0;
+ m_maxSpeed = 0;
+}
+
+bool BfCapturePoint::HandlePlayerEnter(Player* player)
+{
+ if (m_capturePoint)
+ {
+ player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 1);
+ player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, uint32(ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f)));
+ player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct);
+ }
+ return m_activePlayers[player->GetTeamId()].insert(player->GetGUID()).second;
+}
+
+GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player)
+{
+ if (m_capturePoint)
+ player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 0);
+
+ GuidSet::iterator current = m_activePlayers[player->GetTeamId()].find(player->GetGUID());
+
+ if (current == m_activePlayers[player->GetTeamId()].end())
+ return current; // return end()
+
+ m_activePlayers[player->GetTeamId()].erase(current++);
+ return current;
+}
+
+void BfCapturePoint::SendChangePhase()
+{
+ if (!m_capturePoint)
+ return;
+
+ // send this too, sometimes the slider disappears, dunno why :(
+ SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 1);
+ // send these updates to only the ones in this objective
+ SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32) ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f));
+ // send this too, sometimes it resets :S
+ SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct);
+}
+
+bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint)
+{
+ ASSERT(capturePoint);
+
+ sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", capturePoint->GetEntry());
+
+ m_capturePoint = capturePoint;
+
+ // check info existence
+ GameObjectTemplate const* goinfo = capturePoint->GetGOInfo();
+ if (goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
+ {
+ sLog->outError(LOG_FILTER_GENERAL, "OutdoorPvP: GO %u is not capture point!", capturePoint->GetEntry());
+ return false;
+ }
+
+ // get the needed values from goinfo
+ m_maxValue = goinfo->capturePoint.maxTime;
+ m_maxSpeed = m_maxValue / (goinfo->capturePoint.minTime ? goinfo->capturePoint.minTime : 60);
+ m_neutralValuePct = goinfo->capturePoint.neutralPercent;
+ m_minValue = m_maxValue * goinfo->capturePoint.neutralPercent / 100;
+ m_capturePointEntry = capturePoint->GetEntry();
+ if (m_team == TEAM_ALLIANCE)
+ {
+ m_value = m_maxValue;
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE;
+ }
+ else
+ {
+ m_value = -m_maxValue;
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE;
+ }
+
+ return true;
+}
+
+bool BfCapturePoint::DelCapturePoint()
+{
+ if (m_capturePoint)
+ {
+ m_capturePoint->SetRespawnTime(0); // not save respawn time
+ m_capturePoint->Delete();
+ m_capturePoint = NULL;
+ }
+
+ return true;
+}
+
+bool BfCapturePoint::Update(uint32 diff)
+{
+ if (!m_capturePoint)
+ return false;
+
+ float radius = m_capturePoint->GetGOInfo()->capturePoint.radius;
+
+ for (uint8 team = 0; team < 2; ++team)
+ {
+ for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end();)
+ {
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ if (!m_capturePoint->IsWithinDistInMap(player, radius) || !player->IsOutdoorPvPActive())
+ itr = HandlePlayerLeave(player);
+ else
+ ++itr;
+ }
+ else
+ ++itr;
+ }
+ }
+
+ std::list<Player*> players;
+ Trinity::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius);
+ Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(m_capturePoint, players, checker);
+ m_capturePoint->VisitNearbyWorldObject(radius, searcher);
+
+ for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
+ if ((*itr)->IsOutdoorPvPActive())
+ if (m_activePlayers[(*itr)->GetTeamId()].insert((*itr)->GetGUID()).second)
+ HandlePlayerEnter(*itr);
+
+ // get the difference of numbers
+ float fact_diff = ((float) m_activePlayers[0].size() - (float) m_activePlayers[1].size()) * diff / BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL;
+ if (!fact_diff)
+ return false;
+
+ uint32 Challenger = 0;
+ float maxDiff = m_maxSpeed * diff;
+
+ if (fact_diff < 0)
+ {
+ // horde is in majority, but it's already horde-controlled -> no change
+ if (m_State == BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE && m_value <= -m_maxValue)
+ return false;
+
+ if (fact_diff < -maxDiff)
+ fact_diff = -maxDiff;
+
+ Challenger = HORDE;
+ }
+ else
+ {
+ // ally is in majority, but it's already ally-controlled -> no change
+ if (m_State == BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE && m_value >= m_maxValue)
+ return false;
+
+ if (fact_diff > maxDiff)
+ fact_diff = maxDiff;
+
+ Challenger = ALLIANCE;
+ }
+
+ float oldValue = m_value;
+ TeamId oldTeam = m_team;
+
+ m_OldState = m_State;
+
+ m_value += fact_diff;
+
+ if (m_value < -m_minValue) // red
+ {
+ if (m_value < -m_maxValue)
+ m_value = -m_maxValue;
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE;
+ m_team = TEAM_HORDE;
+ }
+ else if (m_value > m_minValue) // blue
+ {
+ if (m_value > m_maxValue)
+ m_value = m_maxValue;
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE;
+ m_team = TEAM_ALLIANCE;
+ }
+ else if (oldValue * m_value <= 0) // grey, go through mid point
+ {
+ // if challenger is ally, then n->a challenge
+ if (Challenger == ALLIANCE)
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE;
+ // if challenger is horde, then n->h challenge
+ else if (Challenger == HORDE)
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE;
+ m_team = TEAM_NEUTRAL;
+ }
+ else // grey, did not go through mid point
+ {
+ // old phase and current are on the same side, so one team challenges the other
+ if (Challenger == ALLIANCE && (m_OldState == BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE || m_OldState == BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE))
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE;
+ else if (Challenger == HORDE && (m_OldState == BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE || m_OldState == BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE))
+ m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE;
+ m_team = TEAM_NEUTRAL;
+ }
+
+ if (m_value != oldValue)
+ SendChangePhase();
+
+ if (m_OldState != m_State)
+ {
+ //sLog->outError(LOG_FILTER_BATTLEFIELD, "%u->%u", m_OldState, m_State);
+ if (oldTeam != m_team)
+ ChangeTeam(oldTeam);
+ return true;
+ }
+
+ return false;
+}
+
+void BfCapturePoint::SendUpdateWorldState(uint32 field, uint32 value)
+{
+ for (uint8 team = 0; team < 2; ++team)
+ for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr) // send to all players present in the area
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->SendUpdateWorldState(field, value);
+}
+
+void BfCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
+{
+ uint8 team;
+ switch (m_State)
+ {
+ case BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE:
+ team = 0;
+ break;
+ case BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE:
+ team = 1;
+ break;
+ default:
+ return;
+ }
+
+ // send to all players present in the area
+ for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->KilledMonsterCredit(id, guid);
+}
+
+bool BfCapturePoint::IsInsideObjective(Player* player) const
+{
+ return m_activePlayers[player->GetTeamId()].find(player->GetGUID()) != m_activePlayers[player->GetTeamId()].end();
+}
diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h
new file mode 100644
index 00000000000..480aafbeb42
--- /dev/null
+++ b/src/server/game/Battlefield/Battlefield.h
@@ -0,0 +1,430 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef BATTLEFIELD_H_
+#define BATTLEFIELD_H_
+
+#include "Utilities/Util.h"
+#include "SharedDefines.h"
+#include "ZoneScript.h"
+#include "WorldPacket.h"
+#include "GameObject.h"
+#include "Battleground.h"
+#include "ObjectAccessor.h"
+
+enum BattlefieldTypes
+{
+ BATTLEFIELD_WG // Wintergrasp
+};
+
+enum BattlefieldIDs
+{
+ BATTLEFIELD_BATTLEID_WG = 1 // Wintergrasp battle
+};
+
+enum BattlefieldObjectiveStates
+{
+ BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL = 0,
+ BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE,
+ BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE,
+ BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE,
+ BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE,
+ BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE,
+ BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE
+};
+
+enum BattlefieldSounds
+{
+ BF_HORDE_WINS = 8454,
+ BF_ALLIANCE_WINS = 8455,
+ BF_START = 3439
+};
+
+enum BattlefieldTimers
+{
+ BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL = 1000
+};
+
+// some class predefs
+class Player;
+class GameObject;
+class WorldPacket;
+class Creature;
+class Unit;
+
+class Battlefield;
+class BfGraveyard;
+
+typedef std::set<uint64> GuidSet;
+typedef std::vector<BfGraveyard*> GraveyardVect;
+typedef std::map<uint64, uint32> PlayerTimerMap;
+
+class BfCapturePoint
+{
+ public:
+ BfCapturePoint(Battlefield* bf);
+
+ virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
+
+ // Send world state update to all players present
+ void SendUpdateWorldState(uint32 field, uint32 value);
+
+ // Send kill notify to players in the controlling faction
+ void SendObjectiveComplete(uint32 id, uint64 guid);
+
+ // Used when player is activated/inactivated in the area
+ virtual bool HandlePlayerEnter(Player* player);
+ virtual GuidSet::iterator HandlePlayerLeave(Player* player);
+ //virtual void HandlePlayerActivityChanged(Player* player);
+
+ // Checks if player is in range of a capture credit marker
+ bool IsInsideObjective(Player* player) const;
+
+ // Returns true if the state of the objective has changed, in this case, the OutdoorPvP must send a world state ui update.
+ virtual bool Update(uint32 diff);
+ virtual void ChangeTeam(TeamId /*oldTeam*/) {}
+ virtual void SendChangePhase();
+
+ bool SetCapturePointData(GameObject* capturePoint);
+ GameObject* GetCapturePointGo() { return m_capturePoint; }
+
+ TeamId GetTeamId() { return m_team; }
+ protected:
+ bool DelCapturePoint();
+
+ // active Players in the area of the objective, 0 - alliance, 1 - horde
+ GuidSet m_activePlayers[2];
+
+ // Total shift needed to capture the objective
+ float m_maxValue;
+ float m_minValue;
+
+ // Maximum speed of capture
+ float m_maxSpeed;
+
+ // The status of the objective
+ float m_value;
+ TeamId m_team;
+
+ // Objective states
+ BattlefieldObjectiveStates m_OldState;
+ BattlefieldObjectiveStates m_State;
+
+ // Neutral value on capture bar
+ uint32 m_neutralValuePct;
+
+ // Pointer to the Battlefield this objective belongs to
+ Battlefield* m_Bf;
+
+ // Capture point entry
+ uint32 m_capturePointEntry;
+
+ // Gameobject related to that capture point
+ GameObject* m_capturePoint;
+};
+
+class BfGraveyard
+{
+ public:
+ BfGraveyard(Battlefield* Bf);
+
+ // Method to changing who controls the graveyard
+ void GiveControlTo(TeamId team);
+ TeamId GetControlTeamId() { return m_ControlTeam; }
+
+ // Find the nearest graveyard to a player
+ float GetDistance(Player* player);
+
+ // Initialize the graveyard
+ void Initialize(TeamId startcontrol, uint32 gy);
+
+ // Set spirit service for the graveyard
+ void SetSpirit(Creature* spirit, TeamId team);
+
+ // Add a player to the graveyard
+ void AddPlayer(uint64 player_guid);
+
+ // Remove a player from the graveyard
+ void RemovePlayer(uint64 player_guid);
+
+ // Resurrect players
+ void Resurrect();
+
+ // Move players waiting to that graveyard on the nearest one
+ void RelocateDeadPlayers();
+
+ // Check if this graveyard has a spirit guide
+ bool HasNpc(uint64 guid)
+ {
+ if (!m_SpiritGuide[0] || !m_SpiritGuide[1])
+ return false;
+
+ if (!sObjectAccessor->FindUnit(m_SpiritGuide[0]) ||
+ !sObjectAccessor->FindUnit(m_SpiritGuide[1]))
+ return false;
+
+ return (m_SpiritGuide[0] == guid || m_SpiritGuide[1] == guid);
+ }
+
+ // Check if a player is in this graveyard's ressurect queue
+ bool HasPlayer(uint64 guid) { return m_ResurrectQueue.find(guid) != m_ResurrectQueue.end(); }
+
+ // Get the graveyard's ID.
+ uint32 GetGraveyardId() { return m_GraveyardId; }
+
+ protected:
+ TeamId m_ControlTeam;
+ uint32 m_GraveyardId;
+ uint64 m_SpiritGuide[2];
+ GuidSet m_ResurrectQueue;
+ Battlefield* m_Bf;
+};
+
+class Battlefield : public ZoneScript
+{
+ friend class BattlefieldMgr;
+
+ public:
+ /// Constructor
+ Battlefield();
+ /// Destructor
+ virtual ~Battlefield();
+
+ /// typedef of map witch store capturepoint and the associate gameobject entry
+ typedef std::map<uint32 /*lowguid */, BfCapturePoint*> BfCapturePointMap;
+
+ /// Call this to init the Battlefield
+ virtual bool SetupBattlefield() { return true; }
+
+ /// Generate packet which contain all worldstatedata of area
+ virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
+
+ /// Update data of a worldstate to all players present in zone
+ void SendUpdateWorldState(uint32 field, uint32 value);
+
+ /**
+ * \brief Called every time for update bf data and time
+ * - Update timer for start/end battle
+ * - Invite player in zone to queue m_StartGroupingTimer minutes before start
+ * - Kick Afk players
+ * \param diff : time ellapsed since last call (in ms)
+ */
+ virtual bool Update(uint32 diff);
+
+ /// Invite all players in zone to join the queue, called x minutes before battle start in Update()
+ void InvitePlayersInZoneToQueue();
+ /// Invite all players in queue to join battle on battle start
+ void InvitePlayersInQueueToWar();
+ /// Invite all players in zone to join battle on battle start
+ void InvitePlayersInZoneToWar();
+
+ /// Called when a Unit is kill in battlefield zone
+ virtual void HandleKill(Player* /*killer*/, Unit* /*killed*/) {};
+
+ uint32 GetTypeId() { return m_TypeId; }
+ uint32 GetZoneId() { return m_ZoneId; }
+
+ void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2 = 0);
+
+ /// Return true if battle is start, false if battle is not started
+ bool IsWarTime() { return m_isActive; }
+
+ /// Enable or Disable battlefield
+ void ToggleBattlefield(bool enable) { m_IsEnabled = enable; }
+ /// Return if battlefield is enable
+ bool IsEnabled() { return m_IsEnabled; }
+
+ /**
+ * \brief Kick player from battlefield and teleport him to kick-point location
+ * \param guid : guid of player who must be kick
+ */
+ void KickPlayerFromBattlefield(uint64 guid);
+
+ /// Called when player (player) enter in zone
+ void HandlePlayerEnterZone(Player* player, uint32 zone);
+ /// Called when player (player) leave the zone
+ void HandlePlayerLeaveZone(Player* player, uint32 zone);
+
+ // All-purpose data storage 64 bit
+ virtual uint64 GetData64(uint32 dataId) { return m_Data64[dataId]; }
+ virtual void SetData64(uint32 dataId, uint64 value) { m_Data64[dataId] = value; }
+
+ // All-purpose data storage 32 bit
+ virtual uint32 GetData(uint32 dataId) { return m_Data32[dataId]; }
+ virtual void SetData(uint32 dataId, uint32 value) { m_Data32[dataId] = value; }
+ virtual void UpdateData(uint32 index, int32 pad) { m_Data32[index] += pad; }
+
+ // Battlefield - generic methods
+ TeamId GetDefenderTeam() { return m_DefenderTeam; }
+ TeamId GetAttackerTeam() { return TeamId(1 - m_DefenderTeam); }
+ TeamId GetOtherTeam(TeamId team) { return (team == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE); }
+ void SetDefenderTeam(TeamId team) { m_DefenderTeam = team; }
+
+ // Group methods
+ /**
+ * \brief Find a not full battlefield group, if there is no, create one
+ * \param TeamId : Id of player team for who we search a group (player->GetTeamId())
+ */
+ Group* GetFreeBfRaid(TeamId TeamId);
+ /// Return battlefield group where player is.
+ Group* GetGroupPlayer(uint64 guid, TeamId TeamId);
+ /// Force player to join a battlefield group
+ bool AddOrSetPlayerToCorrectBfGroup(Player* player);
+
+ // Graveyard methods
+ // Find which graveyard the player must be teleported to to be resurrected by spiritguide
+ WorldSafeLocsEntry const * GetClosestGraveYard(Player* player);
+
+ virtual void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
+ void RemovePlayerFromResurrectQueue(uint64 player_guid);
+ void SetGraveyardNumber(uint32 number) { m_GraveyardList.resize(number); }
+ BfGraveyard* GetGraveyardById(uint32 id);
+
+ // Misc methods
+ Creature* SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team);
+ Creature* SpawnCreature(uint32 entry, Position pos, TeamId team);
+ GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
+
+ // Script-methods
+
+ /// Called on start
+ virtual void OnBattleStart() {};
+ /// Called at the end of battle
+ virtual void OnBattleEnd(bool /*endByTimer*/) {};
+ /// Called x minutes before battle start when player in zone are invite to join queue
+ virtual void OnStartGrouping() {};
+ /// Called when a player accept to join the battle
+ virtual void OnPlayerJoinWar(Player* /*player*/) {};
+ /// Called when a player leave the battle
+ virtual void OnPlayerLeaveWar(Player* /*player*/) {};
+ /// Called when a player leave battlefield zone
+ virtual void OnPlayerLeaveZone(Player* /*player*/) {};
+ /// Called when a player enter in battlefield zone
+ virtual void OnPlayerEnterZone(Player* /*player*/) {};
+
+ WorldPacket BuildWarningAnnPacket(std::string msg);
+ void SendWarningToAllInZone(uint32 entry);
+ //void SendWarningToAllInWar(int32 entry, ...); -- UNUSED
+ void SendWarningToPlayer(Player* player, uint32 entry);
+
+ void PlayerAcceptInviteToQueue(Player* player);
+ void PlayerAcceptInviteToWar(Player* player);
+ uint32 GetBattleId() { return m_BattleId; }
+ void AskToLeaveQueue(Player* player);
+
+ virtual void DoCompleteOrIncrementAchievement(uint32 /*achievement*/, Player* /*player*/, uint8 /*incrementNumber = 1*/) {};
+
+ /// Send all worldstate data to all player in zone.
+ virtual void SendInitWorldStatesToAll() {};
+
+ /// Return if we can use mount in battlefield
+ bool CanFlyIn() { return !m_isActive; }
+
+ void SendAreaSpiritHealerQueryOpcode(Player* player, const uint64 & guid);
+
+ void StartBattle();
+ void EndBattle(bool endByTimer);
+
+ void HideNpc(Creature* creature);
+ void ShowNpc(Creature* creature, bool aggressive);
+
+ GraveyardVect GetGraveyardVector() { return m_GraveyardList; }
+
+ uint32 GetTimer() { return m_Timer; }
+ void SetTimer(uint32 timer) { m_Timer = timer; }
+
+ void DoPlaySoundToAll(uint32 SoundID);
+
+ void InvitePlayerToQueue(Player* player);
+ void InvitePlayerToWar(Player* player);
+
+ void InitStalker(uint32 entry, float x, float y, float z, float o);
+
+ protected:
+ uint64 StalkerGuid;
+ uint32 m_Timer; // Global timer for event
+ bool m_IsEnabled;
+ bool m_isActive;
+ TeamId m_DefenderTeam;
+
+ // Map of the objectives belonging to this OutdoorPvP
+ BfCapturePointMap m_capturePoints;
+
+ // Players info maps
+ GuidSet m_players[BG_TEAMS_COUNT]; // Players in zone
+ GuidSet m_PlayersInQueue[BG_TEAMS_COUNT]; // Players in the queue
+ GuidSet m_PlayersInWar[BG_TEAMS_COUNT]; // Players in WG combat
+ PlayerTimerMap m_InvitedPlayers[BG_TEAMS_COUNT];
+ PlayerTimerMap m_PlayersWillBeKick[BG_TEAMS_COUNT];
+
+ // Variables that must exist for each battlefield
+ uint32 m_TypeId; // See enum BattlefieldTypes
+ uint32 m_BattleId; // BattleID (for packet)
+ uint32 m_ZoneId; // ZoneID of Wintergrasp = 4197
+ uint32 m_MapId; // MapId where is Battlefield
+ uint32 m_MaxPlayer; // Maximum number of player that participated to Battlefield
+ uint32 m_MinPlayer; // Minimum number of player for Battlefield start
+ uint32 m_MinLevel; // Required level to participate at Battlefield
+ uint32 m_BattleTime; // Length of a battle
+ uint32 m_NoWarBattleTime; // Time between two battles
+ uint32 m_RestartAfterCrash; // Delay to restart Wintergrasp if the server crashed during a running battle.
+ uint32 m_TimeForAcceptInvite;
+ uint32 m_uiKickDontAcceptTimer;
+ WorldLocation KickPosition; // Position where players are teleported if they switch to afk during the battle or if they don't accept invitation
+
+ uint32 m_uiKickAfkPlayersTimer; // Timer for check Afk in war
+
+ // Graveyard variables
+ GraveyardVect m_GraveyardList; // Vector witch contain the different GY of the battle
+ uint32 m_LastResurectTimer; // Timer for resurect player every 30 sec
+
+ uint32 m_StartGroupingTimer; // Timer for invite players in area 15 minute before start battle
+ bool m_StartGrouping; // bool for know if all players in area has been invited
+
+ GuidSet m_Groups[BG_TEAMS_COUNT]; // Contain different raid group
+
+ std::vector<uint64> m_Data64;
+ std::vector<uint32> m_Data32;
+
+ void KickAfkPlayers();
+
+ // use for switch off all worldstate for client
+ virtual void SendRemoveWorldStates(Player* /*player*/) {}
+
+ // use for send a packet for all player list
+ void BroadcastPacketToZone(WorldPacket& data) const;
+ void BroadcastPacketToQueue(WorldPacket& data) const;
+ void BroadcastPacketToWar(WorldPacket& data) const;
+
+ // CapturePoint system
+ void AddCapturePoint(BfCapturePoint* cp) { m_capturePoints[cp->GetCapturePointGo()->GetEntry()] = cp; }
+
+ BfCapturePoint* GetCapturePoint(uint32 lowguid) const
+ {
+ Battlefield::BfCapturePointMap::const_iterator itr = m_capturePoints.find(lowguid);
+ if (itr != m_capturePoints.end())
+ return itr->second;
+ return NULL;
+ }
+
+ void RegisterZone(uint32 zoneid);
+ bool HasPlayer(Player* player) const;
+ void TeamCastSpell(TeamId team, int32 spellId);
+};
+
+#endif
diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp
new file mode 100644
index 00000000000..b852082d582
--- /dev/null
+++ b/src/server/game/Battlefield/BattlefieldHandler.cpp
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Common.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
+
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
+#include "Opcodes.h"
+
+//This send to player windows for invite player to join the war
+//Param1:(BattleId) the BattleId of Bf
+//Param2:(ZoneId) the zone where the battle is (4197 for wg)
+//Param3:(time) Time in second that the player have for accept
+void WorldSession::SendBfInvitePlayerToWar(uint32 BattleId, uint32 ZoneId, uint32 p_time)
+{
+ //Send packet
+ WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 12);
+ data << uint32(BattleId);
+ data << uint32(ZoneId);
+ data << uint32((time(NULL) + p_time));
+
+ //Sending the packet to player
+ SendPacket(&data);
+}
+
+//This send invitation to player to join the queue
+//Param1:(BattleId) the BattleId of Bf
+void WorldSession::SendBfInvitePlayerToQueue(uint32 BattleId)
+{
+ WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, 5);
+
+ data << uint32(BattleId);
+ data << uint8(1); //warmup ? used ?
+
+ //Sending packet to player
+ SendPacket(&data);
+}
+
+//This send packet for inform player that he join queue
+//Param1:(BattleId) the BattleId of Bf
+//Param2:(ZoneId) the zone where the battle is (4197 for wg)
+//Param3:(CanQueue) if able to queue
+//Param4:(Full) on log in is full
+void WorldSession::SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue, bool Full)
+{
+ WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 11);
+ data << uint32(BattleId);
+ data << uint32(ZoneId);
+ data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued
+ data << uint8((Full ? 0 : 1)); //Logging In //0 wg full //1 queue for upcoming
+ data << uint8(1); //Warmup
+ SendPacket(&data);
+}
+
+//This is call when player accept to join war
+//Param1:(BattleId) the BattleId of Bf
+void WorldSession::SendBfEntered(uint32 BattleId)
+{
+// m_PlayerInWar[player->GetTeamId()].insert(player->GetGUID());
+ WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTERED, 7);
+ data << uint32(BattleId);
+ data << uint8(1); //unk
+ data << uint8(1); //unk
+ data << uint8(_player->isAFK() ? 1 : 0); //Clear AFK
+ SendPacket(&data);
+}
+
+void WorldSession::SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason)
+{
+ WorldPacket data(SMSG_BATTLEFIELD_MGR_EJECTED, 7);
+ data << uint32(BattleId);
+ data << uint8(reason);//byte Reason
+ data << uint8(2);//byte BattleStatus
+ data << uint8(0);//bool Relocated
+ SendPacket(&data);
+}
+
+//Send by client when he click on accept for queue
+void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recv_data)
+{
+ uint32 BattleId;
+ uint8 Accepted;
+
+ recv_data >> BattleId >> Accepted;
+ sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
+ Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
+ if (!Bf)
+ return;
+
+ if (Accepted)
+ {
+ Bf->PlayerAcceptInviteToQueue(_player);
+ }
+}
+
+//Send by client on clicking in accept or refuse of invitation windows for join game
+void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recv_data)
+{
+ uint32 BattleId;
+ uint8 Accepted;
+
+ recv_data >> BattleId >> Accepted;
+ sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
+ Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
+ if (!Bf)
+ return;
+
+ //If player accept invitation
+ if (Accepted)
+ {
+ Bf->PlayerAcceptInviteToWar(_player);
+ }
+ else
+ {
+ if (_player->GetZoneId() == Bf->GetZoneId())
+ Bf->KickPlayerFromBattlefield(_player->GetGUID());
+ }
+}
+
+void WorldSession::HandleBfExitRequest(WorldPacket & recv_data)
+{
+ uint32 BattleId;
+
+ recv_data >> BattleId;
+ sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: BattleID:%u ", BattleId);
+ Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
+ if (!Bf)
+ return;
+
+ Bf->AskToLeaveQueue(_player);
+}
diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp
new file mode 100644
index 00000000000..6122b25e8e8
--- /dev/null
+++ b/src/server/game/Battlefield/BattlefieldMgr.cpp
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "BattlefieldMgr.h"
+#include "Zones/BattlefieldWG.h"
+#include "ObjectMgr.h"
+#include "Player.h"
+
+BattlefieldMgr::BattlefieldMgr()
+{
+ m_UpdateTimer = 0;
+ //sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Instantiating BattlefieldMgr");
+}
+
+BattlefieldMgr::~BattlefieldMgr()
+{
+ //sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Deleting BattlefieldMgr");
+ for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr)
+ delete *itr;
+}
+
+void BattlefieldMgr::InitBattlefield()
+{
+ Battlefield* pBf = new BattlefieldWG;
+ // respawn, init variables
+ if (!pBf->SetupBattlefield())
+ {
+ sLog->outInfo(LOG_FILTER_GENERAL, "Battlefield : Wintergrasp init failed.");
+ delete pBf;
+ }
+ else
+ {
+ m_BattlefieldSet.push_back(pBf);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Battlefield : Wintergrasp successfully initiated.");
+ }
+
+ /* For Cataclysm: Tol Barad
+ pBf = new BattlefieldTB;
+ // respawn, init variables
+ if(!pBf->SetupBattlefield())
+ {
+ sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad init failed.");
+ delete pBf;
+ }
+ else
+ {
+ m_BattlefieldSet.push_back(pBf);
+ sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad successfully initiated.");
+ } */
+}
+
+void BattlefieldMgr::AddZone(uint32 zoneid, Battlefield *handle)
+{
+ m_BattlefieldMap[zoneid] = handle;
+}
+
+void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid)
+{
+ BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
+ if (itr == m_BattlefieldMap.end())
+ return;
+
+ if (itr->second->HasPlayer(player) || !itr->second->IsEnabled())
+ return;
+
+ itr->second->HandlePlayerEnterZone(player, zoneid);
+ sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
+}
+
+void BattlefieldMgr::HandlePlayerLeaveZone(Player * player, uint32 zoneid)
+{
+ BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
+ if (itr == m_BattlefieldMap.end())
+ return;
+
+ // teleport: remove once in removefromworld, once in updatezone
+ if (!itr->second->HasPlayer(player))
+ return;
+ itr->second->HandlePlayerLeaveZone(player, zoneid);
+ sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
+}
+
+Battlefield *BattlefieldMgr::GetBattlefieldToZoneId(uint32 zoneid)
+{
+ BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
+ if (itr == m_BattlefieldMap.end())
+ {
+ // no handle for this zone, return
+ return NULL;
+ }
+ if (!itr->second->IsEnabled())
+ return NULL;
+ return itr->second;
+}
+
+Battlefield *BattlefieldMgr::GetBattlefieldByBattleId(uint32 battleid)
+{
+ for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr)
+ {
+ if ((*itr)->GetBattleId() == battleid)
+ return (*itr);
+ }
+ return NULL;
+}
+
+void BattlefieldMgr::Update(uint32 diff)
+{
+ m_UpdateTimer += diff;
+ if (m_UpdateTimer > BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL)
+ {
+ for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr)
+ if ((*itr)->IsEnabled())
+ (*itr)->Update(m_UpdateTimer);
+ m_UpdateTimer = 0;
+ }
+}
+
+ZoneScript *BattlefieldMgr::GetZoneScript(uint32 zoneId)
+{
+ BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneId);
+ if (itr != m_BattlefieldMap.end())
+ return itr->second;
+ else
+ return NULL;
+}
diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h
new file mode 100644
index 00000000000..4ee37e424fd
--- /dev/null
+++ b/src/server/game/Battlefield/BattlefieldMgr.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef BATTLEFIELD_MGR_H_
+#define BATTLEFIELD_MGR_H_
+
+#include "Battlefield.h"
+#include "ace/Singleton.h"
+
+class Player;
+class GameObject;
+class Creature;
+class ZoneScript;
+struct GossipMenuItems;
+
+// class to handle player enter / leave / areatrigger / GO use events
+class BattlefieldMgr
+{
+ public:
+ // ctor
+ BattlefieldMgr();
+ // dtor
+ ~BattlefieldMgr();
+
+ // create battlefield events
+ void InitBattlefield();
+ // called when a player enters an battlefield area
+ void HandlePlayerEnterZone(Player * player, uint32 areaflag);
+ // called when player leaves an battlefield area
+ void HandlePlayerLeaveZone(Player * player, uint32 areaflag);
+ // called when player resurrects
+ void HandlePlayerResurrects(Player * player, uint32 areaflag);
+ // return assigned battlefield
+ Battlefield *GetBattlefieldToZoneId(uint32 zoneid);
+ Battlefield *GetBattlefieldByBattleId(uint32 battleid);
+
+ ZoneScript *GetZoneScript(uint32 zoneId);
+
+ void AddZone(uint32 zoneid, Battlefield * handle);
+
+ void Update(uint32 diff);
+
+ void HandleGossipOption(Player * player, uint64 guid, uint32 gossipid);
+
+ bool CanTalkTo(Player * player, Creature * creature, GossipMenuItems gso);
+
+ void HandleDropFlag(Player * player, uint32 spellId);
+
+ typedef std::vector < Battlefield * >BattlefieldSet;
+ typedef std::map < uint32 /* zoneid */ , Battlefield * >BattlefieldMap;
+ private:
+ // contains all initiated battlefield events
+ // used when initing / cleaning up
+ BattlefieldSet m_BattlefieldSet;
+ // maps the zone ids to an battlefield event
+ // used in player event handling
+ BattlefieldMap m_BattlefieldMap;
+ // update interval
+ uint32 m_UpdateTimer;
+};
+
+#define sBattlefieldMgr ACE_Singleton<BattlefieldMgr, ACE_Null_Mutex>::instance()
+
+#endif
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
new file mode 100644
index 00000000000..2270bcf7927
--- /dev/null
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -0,0 +1,1102 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// TODO: Implement proper support for vehicle+player teleportation
+// TODO: Use spell victory/defeat in wg instead of RewardMarkOfHonor() && RewardHonor
+// TODO: Add proper implement of achievement
+
+#include "ObjectMgr.h"
+#include "BattlefieldWG.h"
+#include "SpellAuras.h"
+#include "Vehicle.h"
+
+enum WGVehicles
+{
+ NPC_WG_SEIGE_ENGINE_ALLIANCE = 28312,
+ NPC_WG_SEIGE_ENGINE_HORDE = 32627,
+ NPC_WG_DEMOLISHER = 28094,
+ NPC_WG_CATAPULT = 27881
+};
+
+BattlefieldWG::~BattlefieldWG()
+{
+ for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
+ delete *itr;
+
+ for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
+ delete *itr;
+}
+
+bool BattlefieldWG::SetupBattlefield()
+{
+ InitStalker(BATTLEFIELD_WG_NPC_STALKER, WintergraspStalkerPos[0], WintergraspStalkerPos[1], WintergraspStalkerPos[2], WintergraspStalkerPos[3]);
+
+ m_TypeId = BATTLEFIELD_WG; // See enum BattlefieldTypes
+ m_BattleId = BATTLEFIELD_BATTLEID_WG;
+ m_ZoneId = BATTLEFIELD_WG_ZONEID;
+ m_MapId = BATTLEFIELD_WG_MAPID;
+
+ m_MaxPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MAX);
+ m_IsEnabled = sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE);
+ m_MinPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MIN);
+ m_MinLevel = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MIN_LVL);
+ m_BattleTime = sWorld->getIntConfig(CONFIG_WINTERGRASP_BATTLETIME) * MINUTE * IN_MILLISECONDS;
+ m_NoWarBattleTime = sWorld->getIntConfig(CONFIG_WINTERGRASP_NOBATTLETIME) * MINUTE * IN_MILLISECONDS;
+ m_RestartAfterCrash = sWorld->getIntConfig(CONFIG_WINTERGRASP_RESTART_AFTER_CRASH) * MINUTE * IN_MILLISECONDS;
+
+ m_TimeForAcceptInvite = 20;
+ m_StartGroupingTimer = 15 * MINUTE * IN_MILLISECONDS;
+ m_StartGrouping = false;
+
+ m_tenacityStack = 0;
+
+ KickPosition.Relocate(5728.117f, 2714.346f, 697.733f, 0);
+ KickPosition.m_mapId = m_MapId;
+
+ RegisterZone(m_ZoneId);
+
+ m_Data32.resize(BATTLEFIELD_WG_DATA_MAX);
+
+ m_saveTimer = 60000;
+
+ // Init GraveYards
+ SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX);
+
+ // Load from db
+ if ((sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) == 0) && (sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) == 0)
+ && (sWorld->getWorldState(ClockWorldState[0]) == 0))
+ {
+ sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, uint64(false));
+ sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, uint64(urand(0, 1)));
+ sWorld->setWorldState(ClockWorldState[0], uint64(m_NoWarBattleTime));
+ }
+
+ m_isActive = bool(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE));
+ m_DefenderTeam = TeamId(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER));
+
+ m_Timer = sWorld->getWorldState(ClockWorldState[0]);
+ if (m_isActive)
+ {
+ m_isActive = false;
+ m_Timer = m_RestartAfterCrash;
+ }
+
+ for (uint8 i = 0; i < BATTLEFIELD_WG_GRAVEYARD_MAX; i++)
+ {
+ BfGraveyardWG* graveyard = new BfGraveyardWG(this);
+
+ // When between games, the graveyard is controlled by the defending team
+ if (WGGraveYard[i].startcontrol == TEAM_NEUTRAL)
+ graveyard->Initialize(m_DefenderTeam, WGGraveYard[i].gyid);
+ else
+ graveyard->Initialize(WGGraveYard[i].startcontrol, WGGraveYard[i].gyid);
+
+ graveyard->SetTextId(WGGraveYard[i].textid);
+ m_GraveyardList[i] = graveyard;
+ }
+
+
+ // Spawn workshop creatures and gameobjects
+ for (uint8 i = 0; i < WG_MAX_WORKSHOP; i++)
+ {
+ WGWorkshop* workshop = new WGWorkshop(this, i);
+ if (i < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
+ workshop->GiveControlTo(GetAttackerTeam(), true);
+ else
+ workshop->GiveControlTo(GetDefenderTeam(), true);
+
+ // Note: Capture point is added once the gameobject is created.
+ WorkshopsList.insert(workshop);
+ }
+
+ // Spawn NPCs in the defender's keep, both Horde and Alliance
+ for (uint8 i = 0; i < WG_MAX_KEEP_NPC; i++)
+ {
+ // Horde npc
+ if (Creature* creature = SpawnCreature(WGKeepNPC[i].entryHorde, WGKeepNPC[i].x, WGKeepNPC[i].y, WGKeepNPC[i].z, WGKeepNPC[i].o, TEAM_HORDE))
+ KeepCreature[TEAM_HORDE].insert(creature->GetGUID());
+ // Alliance npc
+ if (Creature* creature = SpawnCreature(WGKeepNPC[i].entryAlliance, WGKeepNPC[i].x, WGKeepNPC[i].y, WGKeepNPC[i].z, WGKeepNPC[i].o, TEAM_ALLIANCE))
+ KeepCreature[TEAM_ALLIANCE].insert(creature->GetGUID());
+ }
+
+ // Hide NPCs from the Attacker's team in the keep
+ for (GuidSet::const_iterator itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ HideNpc(creature);
+
+ // Spawn Horde NPCs outside the keep
+ for (uint8 i = 0; i < WG_OUTSIDE_ALLIANCE_NPC; i++)
+ if (Creature* creature = SpawnCreature(WGOutsideNPC[i].entryHorde, WGOutsideNPC[i].x, WGOutsideNPC[i].y, WGOutsideNPC[i].z, WGOutsideNPC[i].o, TEAM_HORDE))
+ OutsideCreature[TEAM_HORDE].insert(creature->GetGUID());
+
+ // Spawn Alliance NPCs outside the keep
+ for (uint8 i = WG_OUTSIDE_ALLIANCE_NPC; i < WG_MAX_OUTSIDE_NPC; i++)
+ if (Creature* creature = SpawnCreature(WGOutsideNPC[i].entryAlliance, WGOutsideNPC[i].x, WGOutsideNPC[i].y, WGOutsideNPC[i].z, WGOutsideNPC[i].o, TEAM_ALLIANCE))
+ OutsideCreature[TEAM_ALLIANCE].insert(creature->GetGUID());
+
+ // Hide units outside the keep that are defenders
+ for (GuidSet::const_iterator itr = OutsideCreature[GetDefenderTeam()].begin(); itr != OutsideCreature[GetDefenderTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ HideNpc(creature);
+
+ // Spawn turrets and hide them per default
+ for (uint8 i = 0; i < WG_MAX_TURRET; i++)
+ {
+ Position towerCannonPos;
+ WGTurret[i].GetPosition(&towerCannonPos);
+ if (Creature* creature = SpawnCreature(NPC_TOWER_CANNON, towerCannonPos, TEAM_ALLIANCE))
+ {
+ CanonList.insert(creature->GetGUID());
+ HideNpc(creature);
+ }
+ }
+
+ // Spawn all gameobjects
+ for (uint8 i = 0; i < WG_MAX_OBJ; i++)
+ {
+ GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o);
+ BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this);
+ b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId);
+ if (!IsEnabled() && go->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
+ go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED);
+ BuildingsInZone.insert(b);
+ }
+
+ // Spawning portal defender
+ for (uint8 i = 0; i < WG_MAX_TELEPORTER; i++)
+ {
+ GameObject* go = SpawnGameObject(WGPortalDefenderData[i].entry, WGPortalDefenderData[i].x, WGPortalDefenderData[i].y, WGPortalDefenderData[i].z, WGPortalDefenderData[i].o);
+ DefenderPortalList.insert(go);
+ go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]);
+ }
+
+ // Spawn banners in the keep
+ for (uint8 i = 0; i < WG_KEEPGAMEOBJECT_MAX; i++)
+ {
+ if (GameObject* go = SpawnGameObject(WGKeepGameObject[i].entryHorde, WGKeepGameObject[i].x, WGKeepGameObject[i].y, WGKeepGameObject[i].z, WGKeepGameObject[i].o))
+ {
+ go->SetRespawnTime(GetDefenderTeam()? RESPAWN_ONE_DAY : RESPAWN_IMMEDIATELY);
+ m_KeepGameObject[1].insert(go);
+ }
+ if (GameObject* go = SpawnGameObject(WGKeepGameObject[i].entryAlliance, WGKeepGameObject[i].x, WGKeepGameObject[i].y, WGKeepGameObject[i].z, WGKeepGameObject[i].o))
+ {
+ go->SetRespawnTime(GetDefenderTeam()? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
+ m_KeepGameObject[0].insert(go);
+ }
+ }
+
+ // Show defender banner in keep
+ for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetDefenderTeam()].begin(); itr != m_KeepGameObject[GetDefenderTeam()].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY);
+
+ // Hide attackant banner in keep
+ for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetAttackerTeam()].begin(); itr != m_KeepGameObject[GetAttackerTeam()].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_ONE_DAY);
+
+ UpdateCounterVehicle(true);
+ return true;
+}
+
+bool BattlefieldWG::Update(uint32 diff)
+{
+ bool m_return = Battlefield::Update(diff);
+ if (m_saveTimer <= diff)
+ {
+ sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, m_isActive);
+ sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, m_DefenderTeam);
+ sWorld->setWorldState(ClockWorldState[0], m_Timer);
+ m_saveTimer = 60 * IN_MILLISECONDS;
+ }
+ else
+ m_saveTimer -= diff;
+
+ return m_return;
+}
+
+void BattlefieldWG::OnBattleStart()
+{
+ // Spawn titan relic
+ m_titansRelic = SpawnGameObject(GO_WINTERGRASP_TITAN_S_RELIC, 5440.0f, 2840.8f, 430.43f, 0);
+ if (m_titansRelic)
+ {
+ // Update faction of relic, only attacker can click on
+ m_titansRelic->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetAttackerTeam()]);
+ // Set in use (not allow to click on before last door is broken)
+ m_titansRelic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
+ else
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "WG: Failed to spawn titan relic.");
+
+
+ // Update tower visibility and update faction
+ for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr)
+ {
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ {
+ if (Creature* creature = unit->ToCreature())
+ {
+ ShowNpc(creature, true);
+ creature->setFaction(WintergraspFaction[GetDefenderTeam()]);
+ }
+ }
+ }
+
+ // Rebuild all wall
+ for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
+ {
+ if (*itr)
+ {
+ (*itr)->Rebuild();
+ (*itr)->UpdateTurretAttack(false);
+ }
+ }
+
+ SetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT, 0);
+ SetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_DEF, 0);
+ SetData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT, 0);
+ SetData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF, 0);
+
+ // Update graveyard (in no war time all graveyard is to deffender, in war time, depend of base)
+ for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
+ if (*itr)
+ (*itr)->UpdateGraveyardAndWorkshop();
+
+ for (uint8 team = 0; team < 2; ++team)
+ for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ {
+ // Kick player in orb room, TODO: offline player ?
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ float x, y, z;
+ player->GetPosition(x, y, z);
+ if (5500 > x && x > 5392 && y < 2880 && y > 2800 && z < 480)
+ player->TeleportTo(571, 5349.8686f, 2838.481f, 409.240f, 0.046328f);
+ SendInitWorldStatesTo(player);
+ }
+ }
+ // Initialize vehicle counter
+ UpdateCounterVehicle(true);
+ // Send start warning to all players
+ SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_START);
+}
+
+void BattlefieldWG::UpdateCounterVehicle(bool init)
+{
+ if (init)
+ {
+ SetData(BATTLEFIELD_WG_DATA_VEHICLE_H, 0);
+ SetData(BATTLEFIELD_WG_DATA_VEHICLE_A, 0);
+ }
+ SetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H, 0);
+ SetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A, 0);
+
+ for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
+ {
+ if (WGWorkshop* workshop = (*itr))
+ {
+ if (workshop->teamControl == TEAM_ALLIANCE)
+ UpdateData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A, 4);
+ else if (workshop->teamControl == TEAM_HORDE)
+ UpdateData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H, 4);
+ }
+ }
+
+ UpdateVehicleCountWG();
+}
+
+void BattlefieldWG::OnBattleEnd(bool endByTimer)
+{
+ // Remove relic
+ if (m_titansRelic)
+ m_titansRelic->RemoveFromWorld();
+ m_titansRelic = NULL;
+
+ // Remove turret
+ for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr)
+ {
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ {
+ if (Creature* creature = unit->ToCreature())
+ {
+ if (!endByTimer)
+ creature->setFaction(WintergraspFaction[GetDefenderTeam()]);
+ HideNpc(creature);
+ }
+ }
+ }
+
+ if (!endByTimer) // One player triggered the relic
+ {
+ // Change all npc in keep
+ for (GuidSet::const_iterator itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ HideNpc(creature);
+
+ for (GuidSet::const_iterator itr = KeepCreature[GetDefenderTeam()].begin(); itr != KeepCreature[GetDefenderTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ ShowNpc(creature, true);
+
+ // Change all npc out of keep
+ for (GuidSet::const_iterator itr = OutsideCreature[GetDefenderTeam()].begin(); itr != OutsideCreature[GetDefenderTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ HideNpc(creature);
+
+ for (GuidSet::const_iterator itr = OutsideCreature[GetAttackerTeam()].begin(); itr != OutsideCreature[GetAttackerTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ ShowNpc(creature, true);
+ }
+
+ // Update all graveyard, control is to defender when no wartime
+ for (uint8 i = 0; i < BATTLEFIELD_WG_GY_HORDE; i++)
+ if (BfGraveyard* graveyard = GetGraveyardById(i))
+ graveyard->GiveControlTo(GetDefenderTeam());
+
+ for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetDefenderTeam()].begin(); itr != m_KeepGameObject[GetDefenderTeam()].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY);
+
+ for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetAttackerTeam()].begin(); itr != m_KeepGameObject[GetAttackerTeam()].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_ONE_DAY);
+
+ // Update portal defender faction
+ for (GameObjectSet::const_iterator itr = DefenderPortalList.begin(); itr != DefenderPortalList.end(); ++itr)
+ (*itr)->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]);
+
+ // Saving data
+ for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
+ (*itr)->Save();
+ for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
+ (*itr)->Save();
+
+ for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
+ {
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ player->CastSpell(player, SPELL_ESSENCE_OF_WINTERGRASP, true);
+ player->CastSpell(player, SPELL_VICTORY_REWARD, true);
+ // Send Wintergrasp victory achievement
+ DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WIN_WG, player);
+ // Award achievement for succeeding in Wintergrasp in 10 minutes or less
+ if (!endByTimer && GetTimer() <= 10000)
+ DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WIN_WG_TIMER_10, player);
+ }
+ }
+
+ for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->CastSpell(player, SPELL_DEFEAT_REWARD, true);
+
+ for (uint8 team = 0; team < 2; ++team)
+ {
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ RemoveAurasFromPlayer(player);
+
+ m_PlayersInWar[team].clear();
+
+ for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ if (creature->IsVehicle())
+ creature->GetVehicleKit()->Dismiss();
+
+ m_vehicles[team].clear();
+ }
+
+ if (!endByTimer)
+ {
+ for (uint8 team = 0; team < 2; ++team)
+ {
+ for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ {
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ player->RemoveAurasDueToSpell(m_DefenderTeam == TEAM_ALLIANCE ? SPELL_HORDE_CONTROL_PHASE_SHIFT : SPELL_ALLIANCE_CONTROL_PHASE_SHIFT, player->GetGUID());
+ player->AddAura(m_DefenderTeam == TEAM_HORDE ? SPELL_HORDE_CONTROL_PHASE_SHIFT : SPELL_ALLIANCE_CONTROL_PHASE_SHIFT, player);
+ }
+ }
+ }
+ }
+
+ if (!endByTimer) // win alli/horde
+ SendWarningToAllInZone((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : BATTLEFIELD_WG_TEXT_WIN_KEEP + 1);
+ else // defend alli/horde
+ SendWarningToAllInZone((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 1);
+}
+
+// *******************************************************
+// ******************* Reward System *********************
+// *******************************************************
+void BattlefieldWG::DoCompleteOrIncrementAchievement(uint32 achievement, Player* player, uint8 /*incrementNumber*/)
+{
+ AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievement);
+
+ if (!achievementEntry)
+ return;
+
+ switch (achievement)
+ {
+ case ACHIEVEMENTS_WIN_WG_100:
+ {
+ // player->UpdateAchievementCriteria();
+ }
+ default:
+ {
+ if (player)
+ player->CompletedAchievement(achievementEntry);
+ break;
+ }
+ }
+
+}
+
+void BattlefieldWG::OnStartGrouping()
+{
+ SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_WILL_START);
+}
+
+uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId)
+{
+ switch (areaId)
+ {
+ case AREA_WINTERGRASP_FORTRESS:
+ return BATTLEFIELD_WG_GY_KEEP;
+ case AREA_THE_SUNKEN_RING:
+ return BATTLEFIELD_WG_GY_WORKSHOP_NE;
+ case AREA_THE_BROKEN_TEMPLATE:
+ return BATTLEFIELD_WG_GY_WORKSHOP_NW;
+ case AREA_WESTPARK_WORKSHOP:
+ return BATTLEFIELD_WG_GY_WORKSHOP_SW;
+ case AREA_EASTPARK_WORKSHOP:
+ return BATTLEFIELD_WG_GY_WORKSHOP_SE;
+ case AREA_WINTERGRASP:
+ return BATTLEFIELD_WG_GY_ALLIANCE;
+ case AREA_THE_CHILLED_QUAGMIRE:
+ return BATTLEFIELD_WG_GY_HORDE;
+ default:
+ sLog->outError(LOG_FILTER_BATTLEFIELD, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId);
+ break;
+ }
+
+ return 0;
+}
+
+void BattlefieldWG::OnCreatureCreate(Creature* creature)
+{
+ // Accessing to db spawned creatures
+ switch (creature->GetEntry())
+ {
+ case NPC_DWARVEN_SPIRIT_GUIDE:
+ case NPC_TAUNKA_SPIRIT_GUIDE:
+ {
+ TeamId teamId = (creature->GetEntry() == NPC_DWARVEN_SPIRIT_GUIDE ? TEAM_ALLIANCE : TEAM_HORDE);
+ uint8 graveyardId = GetSpiritGraveyardId(creature->GetAreaId());
+ if (m_GraveyardList[graveyardId])
+ m_GraveyardList[graveyardId]->SetSpirit(creature, teamId);
+ break;
+ }
+ }
+
+ // untested code - not sure if it is valid.
+ if (IsWarTime())
+ {
+ switch (creature->GetEntry())
+ {
+ case NPC_WINTERGRASP_SIEGE_ENGINE_ALLIANCE:
+ case NPC_WINTERGRASP_SIEGE_ENGINE_HORDE:
+ case NPC_WINTERGRASP_CATAPULT:
+ case NPC_WINTERGRASP_DEMOLISHER:
+ {
+ if (!creature->ToTempSummon()->GetSummonerGUID() || !sObjectAccessor->FindPlayer(creature->ToTempSummon()->GetSummonerGUID()))
+ {
+ creature->setDeathState(DEAD);
+ creature->RemoveFromWorld();
+ return;
+ }
+ Player* creator = sObjectAccessor->FindPlayer(creature->ToTempSummon()->GetSummonerGUID());
+ TeamId team = creator->GetTeamId();
+
+ if (team == TEAM_HORDE)
+ {
+ if (GetData(BATTLEFIELD_WG_DATA_VEHICLE_H) < GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H))
+ {
+ UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_H, 1);
+ creature->AddAura(SPELL_HORDE_FLAG, creature);
+ m_vehicles[team].insert(creature->GetGUID());
+ UpdateVehicleCountWG();
+ }
+ else
+ {
+ creature->setDeathState(DEAD);
+ creature->RemoveFromWorld();
+ return;
+ }
+ }
+ else
+ {
+ if (GetData(BATTLEFIELD_WG_DATA_VEHICLE_A) < GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A))
+ {
+ UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_A, 1);
+ creature->AddAura(SPELL_ALLIANCE_FLAG, creature);
+ m_vehicles[team].insert(creature->GetGUID());
+ UpdateVehicleCountWG();
+ }
+ else
+ {
+ creature->setDeathState(DEAD);
+ creature->RemoveFromWorld();
+ return;
+ }
+ }
+
+ creature->CastSpell(creator, SPELL_GRAB_PASSENGER, true);
+ break;
+ }
+ }
+ }
+}
+
+void BattlefieldWG::OnCreatureRemove(Creature* /*creature*/)
+{
+/* possibly can be used later
+ if (IsWarTime())
+ {
+ switch (creature->GetEntry())
+ {
+ case NPC_WINTERGRASP_SIEGE_ENGINE_ALLIANCE:
+ case NPC_WINTERGRASP_SIEGE_ENGINE_HORDE:
+ case NPC_WINTERGRASP_CATAPULT:
+ case NPC_WINTERGRASP_DEMOLISHER:
+ {
+ uint8 team;
+ if (creature->getFaction() == WintergraspFaction[TEAM_ALLIANCE])
+ team = TEAM_ALLIANCE;
+ else if (creature->getFaction() == WintergraspFaction[TEAM_HORDE])
+ team = TEAM_HORDE;
+ else
+ return;
+
+ m_vehicles[team].erase(creature->GetGUID());
+ if (team == TEAM_HORDE)
+ UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_H, -1);
+ else
+ UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_A, -1);
+ UpdateVehicleCountWG();
+
+ break;
+ }
+ }
+ }*/
+}
+
+void BattlefieldWG::OnGameObjectCreate(GameObject* go)
+{
+ bool isWorkshop = false;
+ uint8 workshopId = 0;
+
+ switch (go->GetEntry())
+ {
+ case GO_WINTERGRASP_FACTORY_BANNER_NE:
+ isWorkshop = true;
+ workshopId = BATTLEFIELD_WG_WORKSHOP_NE;
+ break;
+ case GO_WINTERGRASP_FACTORY_BANNER_NW:
+ isWorkshop = true;
+ workshopId = BATTLEFIELD_WG_WORKSHOP_NW;
+ break;
+ case GO_WINTERGRASP_FACTORY_BANNER_SE:
+ isWorkshop = true;
+ workshopId = BATTLEFIELD_WG_WORKSHOP_SE;
+ break;
+ case GO_WINTERGRASP_FACTORY_BANNER_SW:
+ isWorkshop = true;
+ workshopId = BATTLEFIELD_WG_WORKSHOP_SW;
+ break;
+
+ }
+
+ if (!isWorkshop)
+ return;
+
+ for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
+ {
+ if (WGWorkshop* workshop = (*itr))
+ {
+ if (workshop->workshopId == workshopId)
+ {
+ WintergraspCapturePoint* capturePoint = new WintergraspCapturePoint(this, GetAttackerTeam());
+
+ capturePoint->SetCapturePointData(go);
+ capturePoint->LinkToWorkshop(workshop);
+ AddCapturePoint(capturePoint);
+ break;
+ }
+ }
+ }
+}
+
+// Called when player kill a unit in wg zone
+void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
+{
+ if (killer == victim)
+ return;
+
+ bool again = false;
+ TeamId killerTeam = killer->GetTeamId();
+
+ if (victim->GetTypeId() == TYPEID_PLAYER)
+ {
+ for (GuidSet::const_iterator itr = m_PlayersInWar[killerTeam].begin(); itr != m_PlayersInWar[killerTeam].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ if (player->GetDistance2d(killer) < 40)
+ PromotePlayer(player);
+ return;
+ }
+
+ for (GuidSet::const_iterator itr = KeepCreature[GetOtherTeam(killerTeam)].begin();
+ itr != KeepCreature[GetOtherTeam(killerTeam)].end(); ++itr)
+ {
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ {
+ if (Creature* creature = unit->ToCreature())
+ {
+ if (victim->GetEntry() == creature->GetEntry() && !again)
+ {
+ again = true;
+ for (GuidSet::const_iterator iter = m_PlayersInWar[killerTeam].begin(); iter != m_PlayersInWar[killerTeam].end(); ++iter)
+ if (Player* player = sObjectAccessor->FindPlayer(*iter))
+ if (player->GetDistance2d(killer) < 40.0f)
+ PromotePlayer(player);
+ }
+ }
+ }
+ }
+ // TODO:Recent PvP activity worldstate
+}
+
+bool BattlefieldWG::FindAndRemoveVehicleFromList(Unit* vehicle)
+{
+ for (uint32 itr = 0; itr < 2; ++itr)
+ {
+ if (m_vehicles[itr].find(vehicle->GetGUID()) != m_vehicles[itr].end())
+ {
+ m_vehicles[itr].erase(vehicle->GetGUID());
+ if (itr == TEAM_HORDE)
+ UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_H, -1);
+ else
+ UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_A, -1);
+ return true;
+ }
+ }
+ return false;
+}
+
+void BattlefieldWG::OnUnitDeath(Unit* unit)
+{
+ if (IsWarTime())
+ if (unit->IsVehicle())
+ if (FindAndRemoveVehicleFromList(unit))
+ UpdateVehicleCountWG();
+}
+
+// Update rank for player
+void BattlefieldWG::PromotePlayer(Player* killer)
+{
+ if (!m_isActive)
+ return;
+ // Updating rank of player
+ if (Aura* aur = killer->GetAura(SPELL_RECRUIT))
+ {
+ if (aur->GetStackAmount() >= 5)
+ {
+ killer->RemoveAura(SPELL_RECRUIT);
+ killer->CastSpell(killer, SPELL_CORPORAL, true);
+ SendWarningToPlayer(killer, BATTLEFIELD_WG_TEXT_FIRSTRANK);
+ }
+ else
+ killer->CastSpell(killer, SPELL_RECRUIT, true);
+ }
+ else if (Aura* aur = killer->GetAura(SPELL_CORPORAL))
+ {
+ if (aur->GetStackAmount() >= 5)
+ {
+ killer->RemoveAura(SPELL_CORPORAL);
+ killer->CastSpell(killer, SPELL_LIEUTENANT, true);
+ SendWarningToPlayer(killer, BATTLEFIELD_WG_TEXT_SECONDRANK);
+ }
+ else
+ killer->CastSpell(killer, SPELL_CORPORAL, true);
+ }
+}
+
+void BattlefieldWG::RemoveAurasFromPlayer(Player* player)
+{
+ player->RemoveAurasDueToSpell(SPELL_RECRUIT);
+ player->RemoveAurasDueToSpell(SPELL_CORPORAL);
+ player->RemoveAurasDueToSpell(SPELL_LIEUTENANT);
+ player->RemoveAurasDueToSpell(SPELL_TOWER_CONTROL);
+ player->RemoveAurasDueToSpell(SPELL_SPIRITUAL_IMMUNITY);
+ player->RemoveAurasDueToSpell(SPELL_TENACITY);
+ player->RemoveAurasDueToSpell(SPELL_ESSENCE_OF_WINTERGRASP);
+ player->RemoveAurasDueToSpell(SPELL_WINTERGRASP_RESTRICTED_FLIGHT_AREA);
+}
+
+void BattlefieldWG::OnPlayerJoinWar(Player* player)
+{
+ RemoveAurasFromPlayer(player);
+
+ player->CastSpell(player, SPELL_RECRUIT, true);
+
+ if (player->GetZoneId() != m_ZoneId)
+ {
+ if (player->GetTeamId() == GetDefenderTeam())
+ player->TeleportTo(571, 5345, 2842, 410, 3.14f);
+ else
+ {
+ if (player->GetTeamId() == TEAM_HORDE)
+ player->TeleportTo(571, 5025.857422f, 3674.628906f, 362.737122f, 4.135169f);
+ else
+ player->TeleportTo(571, 5101.284f, 2186.564f, 373.549f, 3.812f);
+ }
+ }
+
+ UpdateTenacity();
+
+ if (player->GetTeamId() == GetAttackerTeam())
+ {
+ if (GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT) < 3)
+ player->SetAuraStack(SPELL_TOWER_CONTROL, player, 3 - GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT));
+ }
+ else
+ {
+ if (GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT) > 0)
+ player->SetAuraStack(SPELL_TOWER_CONTROL, player, GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT));
+ }
+ SendInitWorldStatesTo(player);
+}
+
+void BattlefieldWG::OnPlayerLeaveWar(Player* player)
+{
+ // Remove all aura from WG // TODO: false we can go out of this zone on retail and keep Rank buff, remove on end of WG
+ if (!player->GetSession()->PlayerLogout())
+ {
+ if (player->GetVehicle()) // Remove vehicle of player if he go out.
+ player->GetVehicle()->Dismiss();
+ RemoveAurasFromPlayer(player);
+ }
+
+ player->RemoveAurasDueToSpell(SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT);
+ player->RemoveAurasDueToSpell(SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT);
+ player->RemoveAurasDueToSpell(SPELL_HORDE_CONTROL_PHASE_SHIFT);
+ player->RemoveAurasDueToSpell(SPELL_ALLIANCE_CONTROL_PHASE_SHIFT);
+}
+
+void BattlefieldWG::OnPlayerLeaveZone(Player* player)
+{
+ if (!m_isActive)
+ RemoveAurasFromPlayer(player);
+
+ player->RemoveAurasDueToSpell(SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT);
+ player->RemoveAurasDueToSpell(SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT);
+ player->RemoveAurasDueToSpell(SPELL_HORDE_CONTROL_PHASE_SHIFT);
+ player->RemoveAurasDueToSpell(SPELL_ALLIANCE_CONTROL_PHASE_SHIFT);
+}
+
+void BattlefieldWG::OnPlayerEnterZone(Player* player)
+{
+ if (!m_isActive)
+ RemoveAurasFromPlayer(player);
+
+ player->AddAura(m_DefenderTeam == TEAM_HORDE ? SPELL_HORDE_CONTROL_PHASE_SHIFT : SPELL_ALLIANCE_CONTROL_PHASE_SHIFT, player);
+ // Send worldstate to player
+ SendInitWorldStatesTo(player);
+}
+
+uint32 BattlefieldWG::GetData(uint32 data)
+{
+ switch (data)
+ {
+ // Used to determine when the phasing spells must be casted
+ // See: SpellArea::IsFitToRequirements
+ case AREA_THE_SUNKEN_RING:
+ case AREA_THE_BROKEN_TEMPLATE:
+ case AREA_WESTPARK_WORKSHOP:
+ case AREA_EASTPARK_WORKSHOP:
+ // Graveyards and Workshops are controlled by the same team.
+ if (m_GraveyardList[GetSpiritGraveyardId(data)])
+ return m_GraveyardList[GetSpiritGraveyardId(data)]->GetControlTeamId();
+ }
+
+ return Battlefield::GetData(data);
+}
+
+// Method sending worldsate to player
+WorldPacket BattlefieldWG::BuildInitWorldStates()
+{
+ WorldPacket data(SMSG_INIT_WORLD_STATES, (4 + 4 + 4 + 2 + (BuildingsInZone.size() * 8) + (WorkshopsList.size() * 8)));
+
+ data << uint32(m_MapId);
+ data << uint32(m_ZoneId);
+ data << uint32(0);
+ data << uint16(4 + 2 + 4 + BuildingsInZone.size() + WorkshopsList.size());
+
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_ATTACKER) << uint32(GetAttackerTeam());
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) << uint32(GetDefenderTeam());
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime()? 0 : 1); // Note: cleanup these two, their names look awkward
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime()? 1 : 0);
+
+ for (uint32 i = 0; i < 2; ++i)
+ data << ClockWorldState[i] << uint32(time(NULL) + (m_Timer / 1000));
+
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H);
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
+ data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A);
+
+ for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
+ data << (*itr)->m_WorldState << (*itr)->m_State;
+
+ for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
+ if (*itr)
+ data << WorkshopsData[(*itr)->workshopId].worldstate << (*itr)->state;
+
+ return data;
+}
+
+void BattlefieldWG::SendInitWorldStatesTo(Player* player)
+{
+ WorldPacket data = BuildInitWorldStates();
+ player->GetSession()->SendPacket(&data);
+}
+
+void BattlefieldWG::SendInitWorldStatesToAll()
+{
+ WorldPacket data = BuildInitWorldStates();
+ for (uint8 team = 0; team < 2; team++)
+ for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->GetSession()->SendPacket(&data);
+}
+
+void BattlefieldWG::BrokenWallOrTower(TeamId /*team*/)
+{
+// might be some use for this in the future. old code commented out below. KL
+/* if (team == GetDefenderTeam())
+ {
+ for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
+ {
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ IncrementQuest(player, WGQuest[player->GetTeamId()][2], true);
+ }
+ }*/
+}
+
+// Called when a tower is broke
+void BattlefieldWG::UpdatedDestroyedTowerCount(TeamId team)
+{
+ // Destroy an attack tower
+ if (team == GetAttackerTeam())
+ {
+ // Update counter
+ UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT, -1);
+ UpdateData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT, 1);
+
+ // Remove buff stack on attackers
+ for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->RemoveAuraFromStack(SPELL_TOWER_CONTROL);
+
+ // Add buff stack to defenders
+ for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ {
+ player->CastSpell(player, SPELL_TOWER_CONTROL, true);
+ DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WG_TOWER_DESTROY, player);
+ }
+
+ // If all three south towers are destroyed (ie. all attack towers), remove ten minutes from battle time
+ if (GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT) == 3)
+ {
+ if (int32(m_Timer - 600000) < 0)
+ m_Timer = 0;
+ else
+ m_Timer -= 600000;
+ SendInitWorldStatesToAll();
+ }
+ }
+ else
+ {
+ UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF, -1);
+ UpdateData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_DEF, 1);
+ }
+}
+
+void BattlefieldWG::ProcessEvent(WorldObject *obj, uint32 eventId)
+{
+ if (!obj || !IsWarTime())
+ return;
+
+ // We handle only gameobjects here
+ GameObject* go = obj->ToGameObject();
+ if (!go)
+ return;
+
+ // On click on titan relic
+ if (go->GetEntry() == GO_WINTERGRASP_TITAN_S_RELIC)
+ {
+ if (CanInteractWithRelic())
+ EndBattle(false);
+ else
+ GetRelic()->SetRespawnTime(RESPAWN_IMMEDIATELY);
+ }
+
+ // if destroy or damage event, search the wall/tower and update worldstate/send warning message
+ for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
+ {
+ if (go->GetEntry() == (*itr)->m_Build->GetEntry())
+ {
+ if ((*itr)->m_Build->GetGOInfo()->building.damagedEvent == eventId)
+ (*itr)->Damaged();
+
+ if ((*itr)->m_Build->GetGOInfo()->building.destroyedEvent == eventId)
+ (*itr)->Destroyed();
+
+ break;
+ }
+ }
+}
+
+// Called when a tower is damaged, used for honor reward calcul
+void BattlefieldWG::UpdateDamagedTowerCount(TeamId team)
+{
+ if (team == GetAttackerTeam())
+ UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT, 1);
+ else
+ UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF, 1);
+}
+
+// Update vehicle count WorldState to player
+void BattlefieldWG::UpdateVehicleCountWG()
+{
+ SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
+ SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
+ SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
+ SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A));
+}
+
+void BattlefieldWG::UpdateTenacity()
+{
+ TeamId team = TEAM_NEUTRAL;
+ uint32 alliancePlayers = m_PlayersInWar[TEAM_ALLIANCE].size();
+ uint32 hordePlayers = m_PlayersInWar[TEAM_HORDE].size();
+ int32 newStack = 0;
+
+ if (alliancePlayers && hordePlayers)
+ {
+ if (alliancePlayers < hordePlayers)
+ newStack = int32((float(hordePlayers / alliancePlayers) - 1) * 4); // positive, should cast on alliance
+ else if (alliancePlayers > hordePlayers)
+ newStack = int32((1 - float(alliancePlayers / hordePlayers)) * 4); // negative, should cast on horde
+ }
+
+ if (newStack == int32(m_tenacityStack))
+ return;
+
+ if (m_tenacityStack > 0 && newStack <= 0) // old buff was on alliance
+ team = TEAM_ALLIANCE;
+ else if (newStack >= 0) // old buff was on horde
+ team = TEAM_HORDE;
+
+ m_tenacityStack = newStack;
+ // Remove old buff
+ if (team != TEAM_NEUTRAL)
+ {
+ for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ if (player->getLevel() >= m_MinLevel)
+ player->RemoveAurasDueToSpell(SPELL_TENACITY);
+
+ for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ creature->RemoveAurasDueToSpell(SPELL_TENACITY_VEHICLE);
+ }
+
+ // Apply new buff
+ if (newStack)
+ {
+ team = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE;
+
+ if (newStack < 0)
+ newStack = -newStack;
+ if (newStack > 20)
+ newStack = 20;
+
+ uint32 buff_honor = SPELL_GREATEST_HONOR;
+ if (newStack < 15)
+ buff_honor = SPELL_GREATER_HONOR;
+ if (newStack < 10)
+ buff_honor = SPELL_GREAT_HONOR;
+ if (newStack < 5)
+ buff_honor = 0;
+
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->SetAuraStack(SPELL_TENACITY, player, newStack);
+
+ for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ creature->SetAuraStack(SPELL_TENACITY_VEHICLE, creature, newStack);
+
+ if (buff_honor != 0)
+ {
+ for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ if (Player* player = sObjectAccessor->FindPlayer(*itr))
+ player->CastSpell(player, buff_honor, true);
+ for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ creature->CastSpell(creature, buff_honor, true);
+ }
+ }
+}
+
+WintergraspCapturePoint::WintergraspCapturePoint(BattlefieldWG* battlefield, TeamId teamInControl) : BfCapturePoint(battlefield)
+{
+ m_Bf = battlefield;
+ m_team = teamInControl;
+ m_Workshop = NULL;
+}
+
+void WintergraspCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
+{
+ ASSERT(m_Workshop);
+ m_Workshop->GiveControlTo(m_team, false);
+}
+
+BfGraveyardWG::BfGraveyardWG(BattlefieldWG* battlefield) : BfGraveyard(battlefield)
+{
+ m_Bf = battlefield;
+}
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h
new file mode 100644
index 00000000000..11510e1ea98
--- /dev/null
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -0,0 +1,1784 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef BATTLEFIELD_WG_
+#define BATTLEFIELD_WG_
+
+#include "ObjectAccessor.h"
+#include "WorldPacket.h"
+#include "World.h"
+#include "Group.h"
+#include "GroupMgr.h"
+#include "Battlefield.h"
+
+uint32 const VehNumWorldState[2] = { 3680, 3490 };
+uint32 const MaxVehNumWorldState[2] = { 3681, 3491 };
+uint32 const ClockWorldState[2] = { 3781, 4354 };
+uint32 const WintergraspFaction[3] = { 1732, 1735, 35 };
+float const WintergraspStalkerPos[4] = { 0, 0, 0, 0 };
+
+class BattlefieldWG;
+class WintergraspCapturePoint;
+
+struct BfWGGameObjectBuilding;
+struct WGWorkshop;
+
+typedef std::set<GameObject*> GameObjectSet;
+typedef std::set<BfWGGameObjectBuilding*> GameObjectBuilding;
+typedef std::set<WGWorkshop*> Workshop;
+typedef std::set<Group*> GroupSet;
+//typedef std::set<WintergraspCapturePoint *> CapturePointSet; unused ?
+
+enum WintergrastData
+{
+ BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp
+ BATTLEFIELD_WG_MAPID = 571 // Northrend
+};
+
+enum WintergraspSpells
+{
+ // Wartime auras
+ SPELL_RECRUIT = 37795,
+ SPELL_CORPORAL = 33280,
+ SPELL_LIEUTENANT = 55629,
+ SPELL_TENACITY = 58549,
+ SPELL_TENACITY_VEHICLE = 59911,
+ SPELL_TOWER_CONTROL = 62064,
+ SPELL_SPIRITUAL_IMMUNITY = 58729,
+ SPELL_GREAT_HONOR = 58555,
+ SPELL_GREATER_HONOR = 58556,
+ SPELL_GREATEST_HONOR = 58557,
+ SPELL_ALLIANCE_FLAG = 14268,
+ SPELL_HORDE_FLAG = 14267,
+ SPELL_GRAB_PASSENGER = 61178,
+
+ // Reward spells
+ SPELL_VICTORY_REWARD = 56902,
+ SPELL_DEFEAT_REWARD = 58494,
+ SPELL_DAMAGED_TOWER = 59135,
+ SPELL_DESTROYED_TOWER = 59136,
+ SPELL_DAMAGED_BUILDING = 59201,
+ SPELL_INTACT_BUILDING = 59203,
+
+ SPELL_TELEPORT_BRIDGE = 59096,
+ SPELL_TELEPORT_FORTRESS = 60035,
+
+ SPELL_TELEPORT_DALARAN = 53360,
+ SPELL_VICTORY_AURA = 60044,
+
+ // Other spells
+ SPELL_WINTERGRASP_WATER = 36444,
+ SPELL_ESSENCE_OF_WINTERGRASP = 58045,
+ SPELL_WINTERGRASP_RESTRICTED_FLIGHT_AREA = 58730,
+
+ // Phasing spells
+ SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT = 56618, // ADDS PHASE 16
+ SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT = 56617, // ADDS PHASE 32
+
+ SPELL_HORDE_CONTROL_PHASE_SHIFT = 55773, // ADDS PHASE 64
+ SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 55774 // ADDS PHASE 128
+};
+
+enum WintergraspData
+{
+ BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF,
+ BATTLEFIELD_WG_DATA_BROKEN_TOWER_DEF,
+ BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT,
+ BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT,
+ BATTLEFIELD_WG_DATA_MAX_VEHICLE_A,
+ BATTLEFIELD_WG_DATA_MAX_VEHICLE_H,
+ BATTLEFIELD_WG_DATA_VEHICLE_A,
+ BATTLEFIELD_WG_DATA_VEHICLE_H,
+ BATTLEFIELD_WG_DATA_MAX
+};
+
+enum WintergraspAchievements
+{
+ ACHIEVEMENTS_WIN_WG = 1717,
+ ACHIEVEMENTS_WIN_WG_100 = 1718, // todo
+ ACHIEVEMENTS_WG_GNOMESLAUGHTER = 1723, // todo
+ ACHIEVEMENTS_WG_TOWER_DESTROY = 1727,
+ ACHIEVEMENTS_DESTRUCTION_DERBY_A = 1737, // todo
+ ACHIEVEMENTS_WG_TOWER_CANNON_KILL = 1751, // todo
+ ACHIEVEMENTS_WG_MASTER_A = 1752, // todo
+ ACHIEVEMENTS_WIN_WG_TIMER_10 = 1755,
+ ACHIEVEMENTS_STONE_KEEPER_50 = 2085, // todo
+ ACHIEVEMENTS_STONE_KEEPER_100 = 2086, // todo
+ ACHIEVEMENTS_STONE_KEEPER_250 = 2087, // todo
+ ACHIEVEMENTS_STONE_KEEPER_500 = 2088, // todo
+ ACHIEVEMENTS_STONE_KEEPER_1000 = 2089, // todo
+ ACHIEVEMENTS_WG_RANGER = 2199, // todo
+ ACHIEVEMENTS_DESTRUCTION_DERBY_H = 2476, // todo
+ ACHIEVEMENTS_WG_MASTER_H = 2776 // todo
+};
+
+enum WintergraspWorldStates
+{
+ BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H = 3490,
+ BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H = 3491,
+ BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A = 3680,
+ BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A = 3681,
+ BATTLEFIELD_WG_WORLD_STATE_ACTIVE = 3801,
+ BATTLEFIELD_WG_WORLD_STATE_DEFENDER = 3802,
+ BATTLEFIELD_WG_WORLD_STATE_ATTACKER = 3803,
+ BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE = 3710
+};
+
+enum WintergraspAreaIds
+{
+ AREA_WINTERGRASP_FORTRESS = 4575,
+ AREA_THE_SUNKEN_RING = 4538,
+ AREA_THE_BROKEN_TEMPLATE = 4539,
+ AREA_WESTPARK_WORKSHOP = 4611,
+ AREA_EASTPARK_WORKSHOP = 4612,
+ AREA_WINTERGRASP = 4197,
+ AREA_THE_CHILLED_QUAGMIRE = 4589
+};
+
+/*#########################
+ *####### Graveyards ######
+ *#########################*/
+
+class BfGraveyardWG : public BfGraveyard
+{
+ public:
+ BfGraveyardWG(BattlefieldWG* Bf);
+
+ void SetTextId(uint32 textid) { m_GossipTextId = textid; }
+ uint32 GetTextId() { return m_GossipTextId; }
+ protected:
+ uint32 m_GossipTextId;
+};
+
+enum WGGraveyardId
+{
+ BATTLEFIELD_WG_GY_WORKSHOP_NE,
+ BATTLEFIELD_WG_GY_WORKSHOP_NW,
+ BATTLEFIELD_WG_GY_WORKSHOP_SE,
+ BATTLEFIELD_WG_GY_WORKSHOP_SW,
+ BATTLEFIELD_WG_GY_KEEP,
+ BATTLEFIELD_WG_GY_HORDE,
+ BATTLEFIELD_WG_GY_ALLIANCE,
+ BATTLEFIELD_WG_GRAVEYARD_MAX
+};
+
+enum WGGossipText
+{
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_NE = -1850501,
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_NW = -1850502,
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_SE = -1850504,
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_SW = -1850503,
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_KEEP = -1850500,
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_HORDE = -1850505,
+ BATTLEFIELD_WG_GOSSIPTEXT_GY_ALLIANCE = -1850506
+};
+
+enum WintergraspNpcs
+{
+ BATTLEFIELD_WG_NPC_GUARD_H = 30739,
+ BATTLEFIELD_WG_NPC_GUARD_A = 30740,
+ BATTLEFIELD_WG_NPC_STALKER = 15214,
+
+ BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER = 31102,
+ BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR = 32296, // <WINTERGRASP QUARTERMASTER>
+ BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN = 31101, // <MASTER HEXXER>
+ BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI = 39173, // <WINTERGRASP QUARTERMASTER>
+ BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH = 31091,
+ BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH = 31151,
+ BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF = 31106,
+ BATTLEFIELD_WG_NPC_PRIMALIST_MULFORT = 31053,
+ BATTLEFIELD_WG_NPC_LIEUTENANT_MURP = 31107,
+
+ BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH = 31052,
+ BATTLEFIELD_WG_NPC_KNIGHT_DAMERON = 32294, // <WINTERGRASP QUARTERMASTER>
+ BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA = 31051, // <ENCHANTRESS>
+ BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER = 39172, // <WINTERGRASP QUARTERMASTER>
+ BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH = 31036,
+ BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS = 31153,
+ BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE = 31108,
+ BATTLEFIELD_WG_NPC_ANCHORITE_TESSA = 31054,
+ BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO = 31109,
+
+ NPC_TAUNKA_SPIRIT_GUIDE = 31841, // Horde spirit guide for Wintergrasp
+ NPC_DWARVEN_SPIRIT_GUIDE = 31842, // Alliance spirit guide for Wintergrasp
+ NPC_TOWER_CANNON = 28366,
+
+ NPC_WINTERGRASP_SIEGE_ENGINE_ALLIANCE = 28312,
+ NPC_WINTERGRASP_SIEGE_ENGINE_HORDE = 32627,
+ NPC_WINTERGRASP_CATAPULT = 27881,
+ NPC_WINTERGRASP_DEMOLISHER = 28094,
+ NPC_WINTERGRASP_TOWER_CANNON = 28366
+};
+
+struct BfWGCoordGY
+{
+ float x;
+ float y;
+ float z;
+ float o;
+ uint32 gyid;
+ uint8 type;
+ uint32 textid; // for gossip menu
+ TeamId startcontrol;
+};
+
+uint32 const WGQuest[2][6] =
+{
+ { 13186, 13181, 13222, 13538, 13177, 13179 },
+ { 13185, 13183, 13223, 13539, 13178, 13180 },
+};
+// 7 in sql, 7 in header
+BfWGCoordGY const WGGraveYard[BATTLEFIELD_WG_GRAVEYARD_MAX] =
+{
+ { 5104.750f, 2300.940f, 368.579f, 0.733038f, 1329, BATTLEFIELD_WG_GY_WORKSHOP_NE, BATTLEFIELD_WG_GOSSIPTEXT_GY_NE, TEAM_NEUTRAL },
+ { 5099.120f, 3466.036f, 368.484f, 5.317802f, 1330, BATTLEFIELD_WG_GY_WORKSHOP_NW, BATTLEFIELD_WG_GOSSIPTEXT_GY_NW, TEAM_NEUTRAL },
+ { 4314.648f, 2408.522f, 392.642f, 6.268125f, 1333, BATTLEFIELD_WG_GY_WORKSHOP_SE, BATTLEFIELD_WG_GOSSIPTEXT_GY_SE, TEAM_NEUTRAL },
+ { 4331.716f, 3235.695f, 390.251f, 0.008500f, 1334, BATTLEFIELD_WG_GY_WORKSHOP_SW, BATTLEFIELD_WG_GOSSIPTEXT_GY_SW, TEAM_NEUTRAL },
+ { 5537.986f, 2897.493f, 517.057f, 4.819249f, 1285, BATTLEFIELD_WG_GY_KEEP, BATTLEFIELD_WG_GOSSIPTEXT_GY_KEEP, TEAM_NEUTRAL },
+ { 5032.454f, 3711.382f, 372.468f, 3.971623f, 1331, BATTLEFIELD_WG_GY_HORDE, BATTLEFIELD_WG_GOSSIPTEXT_GY_HORDE, TEAM_HORDE },
+ { 5140.790f, 2179.120f, 390.950f, 1.972220f, 1332, BATTLEFIELD_WG_GY_ALLIANCE, BATTLEFIELD_WG_GOSSIPTEXT_GY_ALLIANCE, TEAM_ALLIANCE },
+};
+
+/* ######################### *
+ * WintergraspCapturePoint *
+ * ######################### */
+
+class WintergraspCapturePoint : public BfCapturePoint
+{
+ public:
+ WintergraspCapturePoint(BattlefieldWG* battlefield, TeamId teamInControl);
+
+ void LinkToWorkshop(WGWorkshop* workshop) { m_Workshop = workshop; }
+
+ void ChangeTeam(TeamId oldteam);
+ TeamId GetTeam() const { return m_team; }
+
+ protected:
+ WGWorkshop* m_Workshop;
+};
+
+/* ######################### *
+ * WinterGrasp Battlefield *
+ * ######################### */
+
+class BattlefieldWG : public Battlefield
+{
+ public:
+ ~BattlefieldWG();
+ /**
+ * \brief Called when the battle start
+ * - Spawn relic and turret
+ * - Rebuild tower and wall
+ * - Invite player to war
+ */
+ void OnBattleStart();
+
+ /**
+ * \brief Called when battle end
+ * - Remove relic and turret
+ * - Change banner/npc in keep if it needed
+ * - Saving battlestate
+ * - Reward honor/mark to player
+ * - Remove vehicle
+ * \param endByTimer : true if battle ended when timer is at 00:00, false if battle ended by clicking on relic
+ */
+ void OnBattleEnd(bool endByTimer);
+
+ /**
+ * \brief Called when grouping starts (15 minutes before battlestart)
+ * - Invite all player in zone to join queue
+ */
+ void OnStartGrouping();
+
+ /**
+ * \brief Called when player accept invite to join battle
+ * - Update aura
+ * - Teleport if it needed
+ * - Update worldstate
+ * - Update tenacity
+ * \param player: Player who accepted invite
+ */
+ void OnPlayerJoinWar(Player* player);
+
+ /**
+ * \brief Called when player left the battle
+ * - Update player aura
+ * \param player : Player who left the battle
+ */
+ void OnPlayerLeaveWar(Player* player);
+
+ /**
+ * \brief Called when player left the WG zone
+ * \param player : Player who left the zone
+ */
+ void OnPlayerLeaveZone(Player* player);
+
+ /**
+ * \brief Called when player enters in WG zone
+ * - Update aura
+ * - Update worldstate
+ * \param player : Player who enters the zone
+ */
+ void OnPlayerEnterZone(Player* player);
+
+ /**
+ * \brief Called for update battlefield data
+ * - Save battle timer in database every minutes
+ * - Update imunity aura from graveyard
+ * \param diff : time elapsed since the last call (in ms)
+ */
+ bool Update(uint32 diff);
+
+ /**
+ * \brief Called when a creature is created
+ * - Update vehicle count
+ */
+ void OnCreatureCreate(Creature* creature);
+
+ /**
+ * \brief Called when a creature is removed
+ * - Update vehicle count
+ */
+ void OnCreatureRemove(Creature* creature);
+
+ /**
+ * \brief Called when a gameobject is created
+ */
+ void OnGameObjectCreate(GameObject* go);
+
+ /**
+ * \brief Called when a wall/tower is broken
+ * - Update quest
+ */
+ void BrokenWallOrTower(TeamId team);
+
+ /**
+ * \brief Called when a tower is damaged
+ * - Update tower count (for reward calcul)
+ */
+ void UpdateDamagedTowerCount(TeamId team);
+
+ /**
+ * \brief Called when tower is broken
+ * - Update tower buff
+ * - check if three south tower is down for remove 10 minutes to wg
+ */
+ void UpdatedDestroyedTowerCount(TeamId team);
+
+ void DoCompleteOrIncrementAchievement(uint32 achievement, Player* player, uint8 incrementNumber = 1);
+
+ void RemoveAurasFromPlayer(Player* player);
+
+ /**
+ * \brief Called when battlefield is setup, at server start
+ */
+ bool SetupBattlefield();
+
+ /// Return pointer to relic object
+ GameObject* GetRelic() { return m_titansRelic; }
+
+ /// Define relic object
+ void SetRelic(GameObject* relic) { m_titansRelic = relic; }
+
+ /// Check if players can interact with the relic (Only if the last door has been broken)
+ bool CanInteractWithRelic() { return m_isRelicInteractible; }
+
+ /// Define if player can interact with the relic
+ void SetRelicInteractible(bool allow) { m_isRelicInteractible = allow; }
+
+ void UpdateVehicleCountWG();
+ void UpdateCounterVehicle(bool init);
+
+ WorldPacket BuildInitWorldStates();
+ void SendInitWorldStatesTo(Player* player);
+ void SendInitWorldStatesToAll();
+
+ void HandleKill(Player* killer, Unit* victim);
+ void OnUnitDeath(Unit* unit);
+ void PromotePlayer(Player* killer);
+
+ void UpdateTenacity();
+ void ProcessEvent(WorldObject *obj, uint32 eventId);
+
+ bool FindAndRemoveVehicleFromList(Unit* vehicle);
+
+ // returns the graveyardId in the specified area.
+ uint8 GetSpiritGraveyardId(uint32 areaId);
+
+ uint32 GetData(uint32 data);
+ protected:
+ bool m_isRelicInteractible;
+
+ Workshop WorkshopsList;
+
+ GameObjectSet DefenderPortalList;
+ GameObjectSet m_KeepGameObject[2];
+ GameObjectBuilding BuildingsInZone;
+
+ GuidSet m_vehicles[2];
+ GuidSet CanonList;
+ GuidSet KeepCreature[2];
+ GuidSet OutsideCreature[2];
+
+ uint32 m_tenacityStack;
+ uint32 m_saveTimer;
+
+ GameObject* m_titansRelic;
+};
+
+uint8 const WG_MAX_OBJ = 32;
+uint8 const WG_KEEPGAMEOBJECT_MAX = 44;
+uint8 const WG_MAX_TURRET = 15;
+uint8 const WG_MAX_KEEP_NPC = 39;
+uint8 const WG_MAX_OUTSIDE_NPC = 14;
+uint8 const WG_OUTSIDE_ALLIANCE_NPC = 7;
+uint8 const WG_MAX_TELEPORTER = 12;
+
+enum WintergraspGameObjectBuildingType
+{
+ BATTLEFIELD_WG_OBJECTTYPE_DOOR,
+ BATTLEFIELD_WG_OBJECTTYPE_TITANRELIC,
+ BATTLEFIELD_WG_OBJECTTYPE_WALL,
+ BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST,
+ BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER,
+ BATTLEFIELD_WG_OBJECTTYPE_TOWER
+};
+
+enum WintergraspGameObjectState
+{
+ BATTLEFIELD_WG_OBJECTSTATE_NONE,
+ BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_INTACT,
+ BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_DAMAGE,
+ BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_DESTROY,
+ BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT,
+ BATTLEFIELD_WG_OBJECTSTATE_HORDE_DAMAGE,
+ BATTLEFIELD_WG_OBJECTSTATE_HORDE_DESTROY,
+ BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT,
+ BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DAMAGE,
+ BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DESTROY
+};
+
+enum WintergraspWorkshopIds
+{
+ BATTLEFIELD_WG_WORKSHOP_NE,
+ BATTLEFIELD_WG_WORKSHOP_NW,
+ BATTLEFIELD_WG_WORKSHOP_SE,
+ BATTLEFIELD_WG_WORKSHOP_SW,
+ BATTLEFIELD_WG_WORKSHOP_KEEP_WEST,
+ BATTLEFIELD_WG_WORKSHOP_KEEP_EAST
+};
+
+enum WintergraspWorldstates
+{
+ WORLDSTATE_WORKSHOP_NE = 3701,
+ WORLDSTATE_WORKSHOP_NW = 3700,
+ WORLDSTATE_WORKSHOP_SE = 3703,
+ WORLDSTATE_WORKSHOP_SW = 3702,
+ WORLDSTATE_WORKSHOP_K_W = 3698,
+ WORLDSTATE_WORKSHOP_K_E = 3699
+};
+
+enum WintergraspTeamControl
+{
+ BATTLEFIELD_WG_TEAM_ALLIANCE,
+ BATTLEFIELD_WG_TEAM_HORDE,
+ BATTLEFIELD_WG_TEAM_NEUTRAL
+};
+
+// TODO: Handle this with creature_text ?
+enum WintergraspText
+{
+ BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NE = 12055,
+ BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NW = 12052,
+ BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_SE = 12053,
+ BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_SW = 12054,
+ BATTLEFIELD_WG_TEXT_WORKSHOP_ATTACK = 12051,
+ BATTLEFIELD_WG_TEXT_WORKSHOP_TAKEN = 12050,
+ BATTLEFIELD_WG_TEXT_ALLIANCE = 12057,
+ BATTLEFIELD_WG_TEXT_HORDE = 12056,
+ BATTLEFIELD_WG_TEXT_WILL_START = 12058,
+ BATTLEFIELD_WG_TEXT_START = 12067,
+ BATTLEFIELD_WG_TEXT_FIRSTRANK = 12059,
+ BATTLEFIELD_WG_TEXT_SECONDRANK = 12060,
+ BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_NE = 12062,
+ BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_NW = 12064,
+ BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_SE = 12061,
+ BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_SW = 12063,
+ BATTLEFIELD_WG_TEXT_TOWER_DAMAGE = 12065,
+ BATTLEFIELD_WG_TEXT_TOWER_DESTROY = 12066,
+ BATTLEFIELD_WG_TEXT_TOWER_NAME_S = 12069,
+ BATTLEFIELD_WG_TEXT_TOWER_NAME_E = 12070,
+ BATTLEFIELD_WG_TEXT_TOWER_NAME_W = 12071,
+ BATTLEFIELD_WG_TEXT_DEFEND_KEEP = 12068,
+ BATTLEFIELD_WG_TEXT_WIN_KEEP = 12072
+};
+
+enum WintergraspGameObject
+{
+ GO_WINTERGRASP_FACTORY_BANNER_NE = 190475,
+ GO_WINTERGRASP_FACTORY_BANNER_NW = 190487,
+ GO_WINTERGRASP_FACTORY_BANNER_SE = 194959,
+ GO_WINTERGRASP_FACTORY_BANNER_SW = 194962,
+
+ GO_WINTERGRASP_TITAN_S_RELIC = 192829,
+
+ GO_WINTERGRASP_FORTRESS_TOWER_1 = 190221,
+ GO_WINTERGRASP_FORTRESS_TOWER_2 = 190373,
+ GO_WINTERGRASP_FORTRESS_TOWER_3 = 190377,
+ GO_WINTERGRASP_FORTRESS_TOWER_4 = 190378,
+
+ GO_WINTERGRASP_SHADOWSIGHT_TOWER = 190356,
+ GO_WINTERGRASP_WINTER_S_EDGE_TOWER = 190357,
+ GO_WINTERGRASP_FLAMEWATCH_TOWER = 190358,
+
+ GO_WINTERGRASP_FORTRESS_GATE = 190375,
+ GO_WINTERGRASP_VAULT_GATE = 191810,
+
+ GO_WINTERGRASP_KEEP_COLLISION_WALL = 194323
+};
+
+struct WintergraspObjectPositionData
+{
+ float x;
+ float y;
+ float z;
+ float o;
+ uint32 entryHorde;
+ uint32 entryAlliance;
+};
+
+// *****************************************************
+// ************ Destructible (Wall,Tower..) ************
+// *****************************************************
+
+struct WintergraspBuildingSpawnData
+{
+ uint32 entry;
+ uint32 WorldState;
+ float x;
+ float y;
+ float z;
+ float o;
+ uint32 type;
+ uint32 nameId;
+};
+
+const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] =
+{
+ // Wall (Not spawned in db)
+ // Entry WS X Y Z O type NameID
+ { 190219, 3749, 5371.46f, 3047.47f, 407.571f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190220, 3750, 5331.26f, 3047.1f, 407.923f, 0.052359f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191795, 3764, 5385.84f, 2909.49f, 409.713f, 0.00872f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191796, 3772, 5384.45f, 2771.84f, 410.27f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191799, 3762, 5371.44f, 2630.61f, 408.816f, 3.13286f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191800, 3766, 5301.84f, 2909.09f, 409.866f, 0.008724f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191801, 3770, 5301.06f, 2771.41f, 409.901f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191802, 3751, 5280.2f, 2995.58f, 408.825f, 1.61443f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191803, 3752, 5279.14f, 2956.02f, 408.604f, 1.5708f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191804, 3767, 5278.69f, 2882.51f, 409.539f, 1.5708f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191806, 3769, 5279.5f, 2798.94f, 409.998f, 1.5708f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191807, 3759, 5279.94f, 2724.77f, 409.945f, 1.56207f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191808, 3760, 5279.6f, 2683.79f, 409.849f, 1.55334f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191809, 3761, 5330.96f, 2630.78f, 409.283f, 3.13286f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190369, 3753, 5256.08f, 2933.96f, 409.357f, 3.13286f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190370, 3758, 5257.46f, 2747.33f, 409.743f, -3.13286f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190371, 3754, 5214.96f, 2934.09f, 409.19f, -0.008724f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190372, 3757, 5215.82f, 2747.57f, 409.188f, -3.13286f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190374, 3755, 5162.27f, 2883.04f, 410.256f, 1.57952f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 190376, 3756, 5163.72f, 2799.84f, 409.227f, 1.57952f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+
+ // Tower of keep (Not spawned in db)
+ { 190221, 3711, 5281.15f, 3044.59f, 407.843f, 3.11539f, BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER, BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_NW },
+ { 190373, 3713, 5163.76f, 2932.23f, 409.19f, 3.12412f, BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER, BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_SW },
+ { 190377, 3714, 5166.4f, 2748.37f, 409.188f, -1.5708f, BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER, BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_SE },
+ { 190378, 3712, 5281.19f, 2632.48f, 409.099f, -1.58825f, BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER, BATTLEFIELD_WG_TEXT_KEEPTOWER_NAME_NE },
+
+ // Wall (with passage) (Not spawned in db)
+ { 191797, 3765, 5343.29f, 2908.86f, 409.576f, 0.008724f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191798, 3771, 5342.72f, 2771.39f, 409.625f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+ { 191805, 3768, 5279.13f, 2840.8f, 409.783f, 1.57952f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 },
+
+ // South tower (Not spawned in db)
+ { 190356, 3704, 4557.17f, 3623.94f, 395.883f, 1.67552f, BATTLEFIELD_WG_OBJECTTYPE_TOWER, BATTLEFIELD_WG_TEXT_TOWER_NAME_W },
+ { 190357, 3705, 4398.17f, 2822.5f, 405.627f, -3.12412f, BATTLEFIELD_WG_OBJECTTYPE_TOWER, BATTLEFIELD_WG_TEXT_TOWER_NAME_S },
+ { 190358, 3706, 4459.1f, 1944.33f, 434.991f, -2.00276f, BATTLEFIELD_WG_OBJECTTYPE_TOWER, BATTLEFIELD_WG_TEXT_TOWER_NAME_E },
+
+ // Door of forteress (Not spawned in db)
+ { GO_WINTERGRASP_FORTRESS_GATE, 3763, 5162.99f, 2841.23f, 410.162f, -3.13286f, BATTLEFIELD_WG_OBJECTTYPE_DOOR, 0 },
+
+ // Last door (Not spawned in db)
+ { GO_WINTERGRASP_VAULT_GATE, 3773, 5397.11f, 2841.54f, 425.899f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST, 0 },
+};
+
+
+// *********************************************************
+// **********Keep Element(GameObject,Creature)**************
+// *********************************************************
+
+// Keep gameobject
+// 192488 : 10 in sql, 19 in header
+// 192501 : 12 in sql, 17 in header
+// 192416 : 1 in sql, 33 in header
+// 192374 : 1 in sql, 1 in header
+// 192375 : 1 in sql, 1 in header
+// 192336 : 1 in sql, 1 in header
+// 192255 : 1 in sql, 1 in header
+// 192269 : 1 in sql, 7 in header
+// 192254 : 1 in sql, 1 in header
+// 192349 : 1 in sql, 1 in header
+// 192366 : 1 in sql, 3 in header
+// 192367 : 1 in sql, 1 in header
+// 192364 : 1 in sql, 1 in header
+// 192370 : 1 in sql, 1 in header
+// 192369 : 1 in sql, 1 in header
+// 192368 : 1 in sql, 1 in header
+// 192362 : 1 in sql, 1 in header
+// 192363 : 1 in sql, 1 in header
+// 192379 : 1 in sql, 1 in header
+// 192378 : 1 in sql, 1 in header
+// 192355 : 1 in sql, 1 in header
+// 192354 : 1 in sql, 1 in header
+// 192358 : 1 in sql, 1 in header
+// 192359 : 1 in sql, 1 in header
+// 192338 : 1 in sql, 1 in header
+// 192339 : 1 in sql, 1 in header
+// 192284 : 1 in sql, 1 in header
+// 192285 : 1 in sql, 1 in header
+// 192371 : 1 in sql, 1 in header
+// 192372 : 1 in sql, 1 in header
+// 192373 : 1 in sql, 1 in header
+// 192360 : 1 in sql, 1 in header
+// 192361 : 1 in sql, 1 in header
+// 192356 : 1 in sql, 1 in header
+// 192352 : 1 in sql, 1 in header
+// 192353 : 1 in sql, 1 in header
+// 192357 : 1 in sql, 1 in header
+// 192350 : 1 in sql, 1 in header
+// 192351 : 1 in sql, 1 in header
+const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] =
+{
+ { 5262.540039f, 3047.949951f, 432.054993f, 3.106650f, 192488, 192501 }, // Flag on tower
+ { 5272.939941f, 2976.550049f, 444.492004f, 3.124120f, 192374, 192416 }, // Flag on Wall Intersect
+ { 5235.189941f, 2941.899902f, 444.278015f, 1.588250f, 192375, 192416 }, // Flag on Wall Intersect
+ { 5163.129883f, 2952.590088f, 433.502991f, 1.535890f, 192488, 192501 }, // Flag on tower
+ { 5145.109863f, 2935.000000f, 433.385986f, 3.141590f, 192488, 192501 }, // Flag on tower
+ { 5158.810059f, 2883.129883f, 431.618011f, 3.141590f, 192488, 192416 }, // Flag on wall
+ { 5154.490234f, 2862.149902f, 445.011993f, 3.141590f, 192336, 192416 }, // Flag on Wall Intersect
+ { 5154.520020f, 2853.310059f, 409.183014f, 3.141590f, 192255, 192269 }, // Flag on the floor
+ { 5154.459961f, 2828.939941f, 409.188995f, 3.141590f, 192254, 192269 }, // Flag on the floor
+ { 5155.310059f, 2820.739990f, 444.979004f, -3.13286f, 192349, 192416 }, // Flag on wall intersect
+ { 5160.339844f, 2798.610107f, 430.769012f, 3.141590f, 192488, 192416 }, // Flag on wall
+ { 5146.040039f, 2747.209961f, 433.584015f, 3.071770f, 192488, 192501 }, // Flag on tower
+ { 5163.779785f, 2729.679932f, 433.394012f, -1.58825f, 192488, 192501 }, // Flag on tower
+ { 5236.270020f, 2739.459961f, 444.992004f, -1.59698f, 192366, 192416 }, // Flag on wall intersect
+ { 5271.799805f, 2704.870117f, 445.183014f, -3.13286f, 192367, 192416 }, // Flag on wall intersect
+ { 5260.819824f, 2631.800049f, 433.324005f, 3.054330f, 192488, 192501 }, // Flag on tower
+ { 5278.379883f, 2613.830078f, 433.408997f, -1.58825f, 192488, 192501 }, // Flag on tower
+ { 5350.879883f, 2622.719971f, 444.686005f, -1.57080f, 192364, 192416 }, // Flag on wall intersect
+ { 5392.270020f, 2639.739990f, 435.330994f, 1.509710f, 192370, 192416 }, // Flag on wall intersect
+ { 5350.950195f, 2640.360107f, 435.407990f, 1.570800f, 192369, 192416 }, // Flag on wall intersect
+ { 5289.459961f, 2704.679932f, 435.875000f, -0.01745f, 192368, 192416 }, // Flag on wall intersect
+ { 5322.120117f, 2763.610107f, 444.973999f, -1.55334f, 192362, 192416 }, // Flag on wall intersect
+ { 5363.609863f, 2763.389893f, 445.023987f, -1.54462f, 192363, 192416 }, // Flag on wall intersect
+ { 5363.419922f, 2781.030029f, 435.763000f, 1.570800f, 192379, 192416 }, // Flag on wall intersect
+ { 5322.020020f, 2781.129883f, 435.811005f, 1.570800f, 192378, 192416 }, // Flag on wall intersect
+ { 5288.919922f, 2820.219971f, 435.721008f, 0.017452f, 192355, 192416 }, // Flag on wall intersect
+ { 5288.410156f, 2861.790039f, 435.721008f, 0.017452f, 192354, 192416 }, // Flag on wall intersect
+ { 5322.229980f, 2899.429932f, 435.808014f, -1.58825f, 192358, 192416 }, // Flag on wall intersect
+ { 5364.350098f, 2899.399902f, 435.838989f, -1.57080f, 192359, 192416 }, // Flag on wall intersect
+ { 5397.759766f, 2873.080078f, 455.460999f, 3.106650f, 192338, 192416 }, // Flag on keep
+ { 5397.390137f, 2809.330078f, 455.343994f, 3.106650f, 192339, 192416 }, // Flag on keep
+ { 5372.479980f, 2862.500000f, 409.049011f, 3.141590f, 192284, 192269 }, // Flag on floor
+ { 5371.490234f, 2820.800049f, 409.177002f, 3.141590f, 192285, 192269 }, // Flag on floor
+ { 5364.290039f, 2916.939941f, 445.330994f, 1.579520f, 192371, 192416 }, // Flag on wall intersect
+ { 5322.859863f, 2916.949951f, 445.153992f, 1.562070f, 192372, 192416 }, // Flag on wall intersect
+ { 5290.350098f, 2976.560059f, 435.221008f, 0.017452f, 192373, 192416 }, // Flag on wall intersect
+ { 5352.370117f, 3037.090088f, 435.252014f, -1.57080f, 192360, 192416 }, // Flag on wall intersect
+ { 5392.649902f, 3037.110107f, 433.713013f, -1.52716f, 192361, 192416 }, // Flag on wall intersect
+ { 5237.069824f, 2757.030029f, 435.795990f, 1.518440f, 192356, 192416 }, // Flag on wall intersect
+ { 5173.020020f, 2820.929932f, 435.720001f, 0.017452f, 192352, 192416 }, // Flag on wall intersect
+ { 5172.109863f, 2862.570068f, 435.721008f, 0.017452f, 192353, 192416 }, // Flag on wall intersect
+ { 5235.339844f, 2924.340088f, 435.040009f, -1.57080f, 192357, 192416 }, // Flag on wall intersect
+ { 5270.689941f, 2861.780029f, 445.058014f, -3.11539f, 192350, 192416 }, // Flag on wall intersect
+ { 5271.279785f, 2820.159912f, 445.200989f, -3.13286f, 192351, 192416 } // Flag on wall intersect
+};
+
+const Position WGTurret[WG_MAX_TURRET] =
+{
+ { 5391.19f, 3060.8f, 419.616f, 1.69557f },
+ { 5266.75f, 2976.5f, 421.067f, 3.20354f },
+ { 5234.86f, 2948.8f, 420.88f, 1.61311f },
+ { 5323.05f, 2923.7f, 421.645f, 1.5817f },
+ { 5363.82f, 2923.87f, 421.709f, 1.60527f },
+ { 5264.04f, 2861.34f, 421.587f, 3.21142f },
+ { 5264.68f, 2819.78f, 421.656f, 3.15645f },
+ { 5322.16f, 2756.69f, 421.646f, 4.69978f },
+ { 5363.78f, 2756.77f, 421.629f, 4.78226f },
+ { 5236.2f, 2732.68f, 421.649f, 4.72336f },
+ { 5265.02f, 2704.63f, 421.7f, 3.12507f },
+ { 5350.87f, 2616.03f, 421.243f, 4.72729f },
+ { 5390.95f, 2615.5f, 421.126f, 4.6409f },
+ { 5148.8f, 2820.24f, 421.621f, 3.16043f },
+ { 5147.98f, 2861.93f, 421.63f, 3.18792f },
+};
+
+// Here there is all npc keeper spawn point
+const WintergraspObjectPositionData WGKeepNPC[WG_MAX_KEEP_NPC] =
+{
+ // X Y Z O horde alliance
+ // North East
+ { 5326.203125f, 2660.026367f, 409.100891f, 2.543383f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Roaming Guard
+ { 5298.430176f, 2738.760010f, 409.316010f, 3.971740f, BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER, BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH }, // Vieron Blazefeather
+ { 5335.310059f, 2764.110107f, 409.274994f, 4.834560f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5349.810059f, 2763.629883f, 409.333008f, 4.660030f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ // North
+ { 5373.470215f, 2789.060059f, 409.322998f, 2.600540f, BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR, BATTLEFIELD_WG_NPC_KNIGHT_DAMERON }, // Stone Guard Mukar
+ { 5296.560059f, 2789.870117f, 409.274994f, 0.733038f, BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN, BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA }, // Voodoo Master Fu'jin
+ { 5372.670000f, 2786.740000f, 409.442000f, 2.809980f, BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI, BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER }, // Wintergrasp Quartermaster
+ { 5368.709961f, 2856.360107f, 409.322998f, 2.949610f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5367.910156f, 2826.520020f, 409.322998f, 3.333580f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5389.270020f, 2847.370117f, 418.759003f, 3.106690f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5388.560059f, 2834.770020f, 418.759003f, 3.071780f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5359.129883f, 2837.989990f, 409.364014f, 4.698930f, BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH, BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH }, // Commander Dardosh
+ { 5366.129883f, 2833.399902f, 409.322998f, 3.141590f, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS }, // Tactical Officer Kilrath
+ // X Y Z O horde alliance
+ // North West
+ { 5350.680176f, 2917.010010f, 409.274994f, 1.466080f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5335.120117f, 2916.800049f, 409.444000f, 1.500980f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5295.560059f, 2926.669922f, 409.274994f, 0.872665f, BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF, BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE }, // Stronghoof
+ { 5371.399902f, 3026.510010f, 409.205994f, 3.250030f, BATTLEFIELD_WG_NPC_PRIMALIST_MULFORT, BATTLEFIELD_WG_NPC_ANCHORITE_TESSA }, // Primalist Mulfort
+ { 5392.123535f, 3031.110352f, 409.187683f, 3.677212f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Roaming Guard
+ // South
+ { 5270.060059f, 2847.550049f, 409.274994f, 3.071780f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5270.160156f, 2833.479980f, 409.274994f, 3.124140f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5179.109863f, 2837.129883f, 409.274994f, 3.211410f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5179.669922f, 2846.600098f, 409.274994f, 3.089230f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5234.970215f, 2883.399902f, 409.274994f, 4.293510f, BATTLEFIELD_WG_NPC_LIEUTENANT_MURP, BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO }, // Lieutenant Murp
+ // X Y Z O horde alliance
+ // Portal guards (from around the fortress)
+ { 5319.209473f, 3055.947754f, 409.176636f, 1.020201f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5311.612305f, 3061.207275f, 408.734161f, 0.965223f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5264.713379f, 3017.283447f, 408.479706f, 3.482424f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5269.096191f, 3008.315918f, 408.826294f, 3.843706f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5201.414551f, 2945.096924f, 409.190735f, 0.945592f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5193.386230f, 2949.617188f, 409.190735f, 1.145859f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5148.116211f, 2904.761963f, 409.193756f, 3.368532f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5153.355957f, 2895.501465f, 409.199310f, 3.549174f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5154.353027f, 2787.349365f, 409.250183f, 2.555644f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5150.066406f, 2777.876953f, 409.343903f, 2.708797f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5193.706543f, 2732.882812f, 409.189514f, 4.845073f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5202.126953f, 2737.570557f, 409.189514f, 5.375215f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5269.181152f, 2671.174072f, 409.098999f, 2.457459f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5264.960938f, 2662.332520f, 409.098999f, 2.598828f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5307.111816f, 2616.006836f, 409.095734f, 5.355575f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 5316.770996f, 2619.430176f, 409.027740f, 5.363431f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A } // Standing Guard
+};
+
+const WintergraspObjectPositionData WGOutsideNPC[WG_MAX_OUTSIDE_NPC] =
+{
+ { 5032.04f, 3681.79f, 362.980f, 4.210f, BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER, 0 },
+ { 5020.71f, 3626.19f, 360.150f, 4.640f, BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN, 0 },
+ { 4994.85f, 3660.51f, 359.150f, 2.260f, BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH, 0 },
+ { 5015.46f, 3677.11f, 362.970f, 6.009f, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH, 0 },
+ { 5031.12f, 3663.77f, 363.500f, 3.110f, BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF, 0 },
+ { 5042.74f, 3675.82f, 363.060f, 3.358f, BATTLEFIELD_WG_NPC_PRIMALIST_MULFORT, 0 },
+ { 5014.45f, 3640.87f, 361.390f, 3.280f, BATTLEFIELD_WG_NPC_LIEUTENANT_MURP, 0 },
+ { 5100.07f, 2168.89f, 365.779f, 1.972f, 0, BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH },
+ { 5081.70f, 2173.73f, 365.878f, 0.855f, 0, BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA },
+ { 5078.28f, 2183.70f, 365.029f, 1.466f, 0, BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH },
+ { 5088.49f, 2188.18f, 365.647f, 5.253f, 0, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS },
+ { 5095.67f, 2193.28f, 365.924f, 4.939f, 0, BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE },
+ { 5088.61f, 2167.66f, 365.689f, 0.680f, 0, BATTLEFIELD_WG_NPC_ANCHORITE_TESSA },
+ { 5080.40f, 2199.00f, 359.489f, 2.967f, 0, BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO },
+};
+
+struct WintergraspTeleporterData
+{
+ uint32 entry;
+ float x;
+ float y;
+ float z;
+ float o;
+};
+
+const WintergraspTeleporterData WGPortalDefenderData[WG_MAX_TELEPORTER] =
+{
+ // Player teleporter
+ { 190763, 5153.41f, 2901.35f, 409.191f, -0.069f },
+ { 190763, 5268.70f, 2666.42f, 409.099f, -0.715f },
+ { 190763, 5197.05f, 2944.81f, 409.191f, 2.3387f },
+ { 190763, 5196.67f, 2737.34f, 409.189f, -2.932f },
+ { 190763, 5314.58f, 3055.85f, 408.862f, 0.5410f },
+ { 190763, 5391.28f, 2828.09f, 418.675f, -2.164f },
+ { 190763, 5153.93f, 2781.67f, 409.246f, 1.6580f },
+ { 190763, 5311.44f, 2618.93f, 409.092f, -2.373f },
+ { 190763, 5269.21f, 3013.84f, 408.828f, -1.762f },
+ { 190763, 5401.62f, 2853.66f, 418.674f, 2.6354f },
+ // Vehicle teleporter
+ { 192951, 5314.51f, 2703.69f, 408.550f, -0.890f },
+ { 192951, 5316.25f, 2977.04f, 408.539f, -0.820f },
+};
+
+// *********************************************************
+// **********Tower Element(GameObject,Creature)*************
+// *********************************************************
+
+struct WintergraspTowerData
+{
+ uint32 towerEntry; // Gameobject id of tower
+ uint8 nbObject; // Number of gameobjects spawned on this point
+ WintergraspObjectPositionData GameObject[6]; // Gameobject position and entry (Horde/Alliance)
+
+ // Creature : Turrets and Guard, TODO: check if killed on tower destruction? tower damage?
+ uint8 nbCreatureBottom;
+ WintergraspObjectPositionData CreatureBottom[9];
+ uint8 nbCreatureTop;
+ WintergraspObjectPositionData CreatureTop[5];
+};
+
+uint8 const WG_MAX_ATTACKTOWERS = 3;
+// 192414 : 0 in sql, 1 in header
+// 192278 : 0 in sql, 3 in header
+const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] =
+{
+ // West tower
+ {
+ 190356,
+ 6,
+ {
+ { 4559.109863f, 3606.219971f, 419.998993f, -1.483530f, 192488, 192501 }, // Flag on tower
+ { 4539.419922f, 3622.489990f, 420.033997f, -3.071770f, 192488, 192501 }, // Flag on tower
+ { 4555.259766f, 3641.649902f, 419.973999f, 1.675510f, 192488, 192501 }, // Flag on tower
+ { 4574.870117f, 3625.909912f, 420.079010f, 0.080117f, 192488, 192501 }, // Flag on tower
+ { 4433.899902f, 3534.139893f, 360.274994f, -1.850050f, 192269, 192278 }, // Flag near workshop
+ { 4572.930176f, 3475.520020f, 363.009003f, 1.42240f, 192269, 192278 } // Flag near bridge
+ },
+ 1,
+ {
+ { 4418.688477f, 3506.251709f, 358.975494f, 4.293305f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Roaming Guard
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ },
+ 0,
+ {
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ }
+ },
+
+ // South Tower
+ {
+ 190357,
+ 5,
+ {
+ { 4416.000000f, 2822.669922f, 429.851013f, -0.017452f, 192488, 192501 }, // Flag on tower
+ { 4398.819824f, 2804.699951f, 429.791992f, -1.588250f, 192488, 192501 }, // Flag on tower
+ { 4387.620117f, 2719.570068f, 389.934998f, -1.544620f, 192366, 192414 }, // Flag near tower
+ { 4464.120117f, 2855.449951f, 406.110992f, 0.829032f, 192366, 192429 }, // Flag near tower
+ { 4526.459961f, 2810.179932f, 391.200012f, -2.993220f, 192269, 192278 }, // Flag near bridge
+ { 0, 0, 0, 0, 0, 0 },
+ },
+ 6,
+ {
+ { 4452.859863f, 2808.870117f, 402.604004f, 6.056290f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4455.899902f, 2835.958008f, 401.122559f, 0.034907f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4412.649414f, 2953.792236f, 374.799957f, 0.980838f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Roaming Guard
+ { 4362.089844f, 2811.510010f, 407.337006f, 3.193950f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4412.290039f, 2753.790039f, 401.015015f, 5.829400f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4421.939941f, 2773.189941f, 400.894989f, 5.707230f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0, 0, 0},
+ },
+ 0,
+ {
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ },
+ },
+
+ // East Tower
+ {
+ 190358,
+ 4,
+ {
+ { 4466.790039f, 1960.420044f, 459.144012f, 1.151920f, 192488, 192501 }, // Flag on tower
+ { 4475.350098f, 1937.030029f, 459.070007f, -0.43633f, 192488, 192501 }, // Flag on tower
+ { 4451.759766f, 1928.099976f, 459.075989f, -2.00713f, 192488, 192501 }, // Flag on tower
+ { 4442.990234f, 1951.900024f, 459.092987f, 2.740160f, 192488, 192501 }, // Flag on tower
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ },
+ 5,
+ {
+ { 4501.060059f, 1990.280029f, 431.157013f, 1.029740f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4463.830078f, 2015.180054f, 430.299988f, 1.431170f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4494.580078f, 1943.760010f, 435.627014f, 6.195920f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4450.149902f, 1897.579956f, 435.045013f, 4.398230f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 4428.870117f, 1906.869995f, 432.648010f, 3.996800f, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ },
+ 0,
+ {
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
+ },
+ },
+};
+
+struct WintergraspTowerCannonData
+{
+ uint32 towerEntry;
+ uint8 nbTowerCannonBottom;
+ Position TowerCannonBottom[5];
+ uint8 nbTurretTop;
+ Position TurretTop[5];
+};
+
+const uint8 WG_MAX_TOWER_CANNON = 7;
+
+const WintergraspTowerCannonData TowerCannon[WG_MAX_TOWER_CANNON] =
+{
+ {
+ 190221,
+ 0,
+ {
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ 2,
+ {
+ { 5255.88f, 3047.63f, 438.499f, 3.13677f },
+ { 5280.9f, 3071.32f, 438.499f, 1.62879f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ },
+ {
+ 190373,
+ 0,
+ {
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ 2,
+ {
+ { 5138.59f, 2935.16f, 439.845f, 3.11723f },
+ { 5163.06f, 2959.52f, 439.846f, 1.47258f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ },
+ {
+ 190377,
+ 0,
+ {
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ 2,
+ {
+ { 5163.84f, 2723.74f, 439.844f, 1.3994f },
+ { 5139.69f, 2747.4f, 439.844f, 3.17221f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ },
+ {
+ 190378,
+ 0,
+ {
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ 2,
+ {
+ { 5278.21f, 2607.23f, 439.755f, 4.71944f },
+ { 5255.01f, 2631.98f, 439.755f, 3.15257f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ },
+ {
+ 190356,
+ 2,
+ {
+ {4537.380371f, 3599.531738f, 402.886993f, 3.998462f},
+ {4581.497559f, 3604.087158f, 402.886963f, 5.651723f},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ },
+ 2,
+ {
+ {4469.448242f, 1966.623779f, 465.647217f, 1.153573f},
+ {4581.895996f, 3626.438477f, 426.539062f, 0.117806f},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ },
+ },
+ {
+ 190357,
+ 2,
+ {
+ { 4421.640137f, 2799.935791f, 412.630920f, 5.459298f },
+ { 4420.263184f, 2845.340332f, 412.630951f, 0.742197f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ 3,
+ {
+ { 4423.430664f, 2822.762939f, 436.283142f, 6.223487f },
+ { 4397.825684f, 2847.629639f, 436.283325f, 1.579430f },
+ { 4398.814941f, 2797.266357f, 436.283051f, 4.703747f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ },
+ {
+ 190358,
+ 2,
+ {
+ { 4448.138184f, 1974.998779f, 441.995911f, 1.967238f },
+ { 4448.713379f, 1955.148682f, 441.995178f, 0.380733f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ 2,
+ {
+ { 4469.448242f, 1966.623779f, 465.647217f, 1.153573f },
+ { 4481.996582f, 1933.658325f, 465.647186f, 5.873029f },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 0 },
+ },
+ },
+};
+
+// *********************************************************
+// *****************WorkShop Data & Element*****************
+// *********************************************************
+
+uint8 const WG_MAX_WORKSHOP = 6;
+
+struct WGWorkshopData
+{
+ uint8 id;
+ uint32 worldstate;
+ uint32 text;
+};
+
+const WGWorkshopData WorkshopsData[WG_MAX_WORKSHOP] =
+{
+ // NE
+ {BATTLEFIELD_WG_WORKSHOP_NE, WORLDSTATE_WORKSHOP_NE, BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NE},
+ // NW
+ {BATTLEFIELD_WG_WORKSHOP_NW, WORLDSTATE_WORKSHOP_NW, BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NW},
+ // SE
+ {BATTLEFIELD_WG_WORKSHOP_SE, WORLDSTATE_WORKSHOP_SE, BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_SE},
+ // SW
+ {BATTLEFIELD_WG_WORKSHOP_SW, WORLDSTATE_WORKSHOP_SW, BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_SW},
+ // KEEP WEST - It can't be taken, so it doesn't have a textid
+ {BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, WORLDSTATE_WORKSHOP_K_W, 0},
+ // KEEP EAST - It can't be taken, so it doesn't have a textid
+ {BATTLEFIELD_WG_WORKSHOP_KEEP_EAST, WORLDSTATE_WORKSHOP_K_E, 0}
+};
+
+// ********************************************************************
+// * Structs using for Building,Graveyard,Workshop *
+// ********************************************************************
+// Structure for different buildings that can be destroyed during battle
+struct BfWGGameObjectBuilding
+{
+ BfWGGameObjectBuilding(BattlefieldWG* WG)
+ {
+ m_WG = WG;
+ m_Team = 0;
+ m_Build = NULL;
+ m_Type = 0;
+ m_WorldState = 0;
+ m_State = 0;
+ m_NameId = 0;
+ }
+
+ // the team that controls this point
+ uint8 m_Team;
+
+ // WG object
+ BattlefieldWG* m_WG;
+
+ // Linked gameobject
+ GameObject* m_Build;
+
+ // eWGGameObjectBuildingType
+ uint32 m_Type;
+
+ // WorldState
+ uint32 m_WorldState;
+
+ // eWGGameObjectState
+ uint32 m_State;
+
+ // Name id for warning text
+ uint32 m_NameId;
+
+ // GameObject associations
+ GameObjectSet m_GameObjectList[2];
+
+ // Creature associations
+ GuidSet m_CreatureBottomList[2];
+ GuidSet m_CreatureTopList[2];
+ GuidSet m_TowerCannonBottomList;
+ GuidSet m_TurretTopList;
+
+ void Rebuild()
+ {
+ switch (m_Type)
+ {
+ case BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER:
+ case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST:
+ case BATTLEFIELD_WG_OBJECTTYPE_DOOR:
+ case BATTLEFIELD_WG_OBJECTTYPE_WALL:
+ m_Team = m_WG->GetDefenderTeam(); // Objects that are part of the keep should be the defender's
+ break;
+ case BATTLEFIELD_WG_OBJECTTYPE_TOWER:
+ m_Team = m_WG->GetAttackerTeam(); // The towers in the south should be the attacker's
+ break;
+ default:
+ m_Team = TEAM_NEUTRAL;
+ break;
+ }
+
+ // Rebuild gameobject
+ if (m_Build->IsDestructibleBuilding())
+ {
+ m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
+ if (m_Build->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
+ if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f))
+ go->EnableCollision(true);
+
+ // Update worldstate
+ m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3);
+ m_WG->SendUpdateWorldState(m_WorldState, m_State);
+ }
+ UpdateCreatureAndGo();
+ m_Build->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]);
+ }
+
+ // Called when associated gameobject is damaged
+ void Damaged()
+ {
+ // Update worldstate
+ m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DAMAGE - (m_Team * 3);
+ m_WG->SendUpdateWorldState(m_WorldState, m_State);
+
+ // Send warning message
+ if (m_NameId) // tower damage + name
+ m_WG->SendWarningToAllInZone(m_NameId);
+
+ for (GuidSet::const_iterator itr = m_CreatureTopList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureTopList[m_WG->GetAttackerTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->HideNpc(creature);
+
+ for (GuidSet::const_iterator itr = m_TurretTopList.begin(); itr != m_TurretTopList.end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->HideNpc(creature);
+
+ if (m_Type == BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER)
+ m_WG->UpdateDamagedTowerCount(m_WG->GetDefenderTeam());
+ else if (m_Type == BATTLEFIELD_WG_OBJECTTYPE_TOWER)
+ m_WG->UpdateDamagedTowerCount(m_WG->GetAttackerTeam());
+ }
+
+ // Called when associated gameobject is destroyed
+ void Destroyed()
+ {
+ // Update worldstate
+ m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DESTROY - (m_Team * 3);
+ m_WG->SendUpdateWorldState(m_WorldState, m_State);
+
+ // Warn players
+ if (m_NameId)
+ m_WG->SendWarningToAllInZone(m_NameId);
+
+ switch (m_Type)
+ {
+ // Inform the global wintergrasp script of the destruction of this object
+ case BATTLEFIELD_WG_OBJECTTYPE_TOWER:
+ case BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER:
+ m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team));
+ break;
+ case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST:
+ if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f))
+ go->EnableCollision(false);
+ m_WG->SetRelicInteractible(true);
+ if (m_WG->GetRelic())
+ m_WG->GetRelic()->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ else
+ sLog->outError(LOG_FILTER_GENERAL, "BattlefieldWG: Relic not found.");
+ break;
+ }
+
+ m_WG->BrokenWallOrTower(TeamId(m_Team));
+ }
+
+ void Init(GameObject* go, uint32 type, uint32 worldstate, uint32 nameid)
+ {
+ // GameObject associated to object
+ m_Build = go;
+
+ // Type of building (WALL/TOWER/DOOR)
+ m_Type = type;
+
+ // WorldState for client (icon on map)
+ m_WorldState = worldstate;
+
+ // NameId for Warning text
+ m_NameId = nameid;
+
+ switch (m_Type)
+ {
+ case BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER:
+ case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST:
+ case BATTLEFIELD_WG_OBJECTTYPE_DOOR:
+ case BATTLEFIELD_WG_OBJECTTYPE_WALL:
+ m_Team = m_WG->GetDefenderTeam(); // Objects that are part of the keep should be the defender's
+ break;
+ case BATTLEFIELD_WG_OBJECTTYPE_TOWER:
+ m_Team = m_WG->GetAttackerTeam(); // The towers in the south should be the attacker's
+ break;
+ default:
+ m_Team = TEAM_NEUTRAL;
+ break;
+ }
+
+ m_State = sWorld->getWorldState(m_WorldState);
+ if (m_Build)
+ {
+ switch (m_State)
+ {
+ case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT:
+ case BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT:
+ m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
+ break;
+ case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DESTROY:
+ case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DESTROY:
+ m_Build->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED);
+ break;
+ case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DAMAGE:
+ case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DAMAGE:
+ m_Build->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED);
+ break;
+ }
+ }
+
+ int32 towerid = -1;
+ switch (go->GetEntry())
+ {
+ case GO_WINTERGRASP_FORTRESS_TOWER_1:
+ towerid = 0;
+ break;
+ case GO_WINTERGRASP_FORTRESS_TOWER_2:
+ towerid = 1;
+ break;
+ case GO_WINTERGRASP_FORTRESS_TOWER_3:
+ towerid = 2;
+ break;
+ case GO_WINTERGRASP_FORTRESS_TOWER_4:
+ towerid = 3;
+ break;
+ case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
+ towerid = 4;
+ break;
+ case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
+ towerid = 5;
+ break;
+ case GO_WINTERGRASP_FLAMEWATCH_TOWER:
+ towerid = 6;
+ break;
+ }
+
+ if (towerid > 3) // Attacker towers
+ {
+ // Spawn associate gameobjects
+ for (uint8 i = 0; i < AttackTowers[towerid - 4].nbObject; i++)
+ {
+ WintergraspObjectPositionData gobData = AttackTowers[towerid - 4].GameObject[i];
+ if (GameObject* go = m_WG->SpawnGameObject(gobData.entryHorde, gobData.x, gobData.y, gobData.z, gobData.o))
+ m_GameObjectList[TEAM_HORDE].insert(go);
+ if (GameObject* go = m_WG->SpawnGameObject(gobData.entryAlliance, gobData.x, gobData.y, gobData.z, gobData.o))
+ m_GameObjectList[TEAM_ALLIANCE].insert(go);
+ }
+
+ // Spawn associate npc bottom
+ for (uint8 i = 0; i < AttackTowers[towerid - 4].nbCreatureBottom; i++)
+ {
+ WintergraspObjectPositionData creatureData = AttackTowers[towerid - 4].CreatureBottom[i];
+ if (Creature* creature = m_WG->SpawnCreature(creatureData.entryHorde, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_HORDE))
+ m_CreatureBottomList[TEAM_HORDE].insert(creature->GetGUID());
+ if (Creature* creature = m_WG->SpawnCreature(creatureData.entryAlliance, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_ALLIANCE))
+ m_CreatureBottomList[TEAM_ALLIANCE].insert(creature->GetGUID());
+ }
+
+ // Spawn associate npc top
+ for (uint8 i = 0; i < AttackTowers[towerid - 4].nbCreatureTop; i++)
+ {
+ WintergraspObjectPositionData creatureData = AttackTowers[towerid - 4].CreatureTop[i];
+ if (Creature* creature = m_WG->SpawnCreature(creatureData.entryHorde, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_HORDE))
+ m_CreatureTopList[TEAM_HORDE].insert(creature->GetGUID());
+ if (Creature* creature = m_WG->SpawnCreature(creatureData.entryAlliance, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_ALLIANCE))
+ m_CreatureTopList[TEAM_ALLIANCE].insert(creature->GetGUID());
+ }
+ }
+
+ if (towerid >= 0)
+ {
+ // Spawn Turret bottom
+ for (uint8 i = 0; i < TowerCannon[towerid].nbTowerCannonBottom; i++)
+ {
+ Position turretPos;
+ TowerCannon[towerid].TowerCannonBottom[i].GetPosition(&turretPos);
+ if (Creature* turret = m_WG->SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, turretPos, TEAM_ALLIANCE))
+ {
+ m_TowerCannonBottomList.insert(turret->GetGUID());
+ switch (go->GetEntry())
+ {
+ case GO_WINTERGRASP_FORTRESS_TOWER_1:
+ case GO_WINTERGRASP_FORTRESS_TOWER_2:
+ case GO_WINTERGRASP_FORTRESS_TOWER_3:
+ case GO_WINTERGRASP_FORTRESS_TOWER_4:
+ turret->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]);
+ break;
+ case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
+ case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
+ case GO_WINTERGRASP_FLAMEWATCH_TOWER:
+ turret->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]);
+ break;
+ }
+ m_WG->HideNpc(turret);
+ }
+ }
+
+ // Spawn Turret top
+ for (uint8 i = 0; i < TowerCannon[towerid].nbTurretTop; i++)
+ {
+ Position towerCannonPos;
+ TowerCannon[towerid].TurretTop[i].GetPosition(&towerCannonPos);
+ if (Creature* turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0)))
+ {
+ m_TurretTopList.insert(turret->GetGUID());
+ switch (go->GetEntry())
+ {
+ case GO_WINTERGRASP_FORTRESS_TOWER_1:
+ case GO_WINTERGRASP_FORTRESS_TOWER_2:
+ case GO_WINTERGRASP_FORTRESS_TOWER_3:
+ case GO_WINTERGRASP_FORTRESS_TOWER_4:
+ turret->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]);
+ break;
+ case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
+ case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
+ case GO_WINTERGRASP_FLAMEWATCH_TOWER:
+ turret->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]);
+ break;
+ }
+ m_WG->HideNpc(turret);
+ }
+ }
+ UpdateCreatureAndGo();
+ }
+ }
+
+ void UpdateCreatureAndGo()
+ {
+ for (GuidSet::const_iterator itr = m_CreatureTopList[m_WG->GetDefenderTeam()].begin(); itr != m_CreatureTopList[m_WG->GetDefenderTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->HideNpc(creature);
+
+ for (GuidSet::const_iterator itr = m_CreatureTopList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureTopList[m_WG->GetAttackerTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->ShowNpc(creature, true);
+
+ for (GuidSet::const_iterator itr = m_CreatureBottomList[m_WG->GetDefenderTeam()].begin(); itr != m_CreatureBottomList[m_WG->GetDefenderTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->HideNpc(creature);
+
+ for (GuidSet::const_iterator itr = m_CreatureBottomList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureBottomList[m_WG->GetAttackerTeam()].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->ShowNpc(creature, true);
+
+ for (GameObjectSet::const_iterator itr = m_GameObjectList[m_WG->GetDefenderTeam()].begin(); itr != m_GameObjectList[m_WG->GetDefenderTeam()].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_ONE_DAY);
+
+ for (GameObjectSet::const_iterator itr = m_GameObjectList[m_WG->GetAttackerTeam()].begin(); itr != m_GameObjectList[m_WG->GetAttackerTeam()].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY);
+ }
+
+ void UpdateTurretAttack(bool disable)
+ {
+ for (GuidSet::const_iterator itr = m_TowerCannonBottomList.begin(); itr != m_TowerCannonBottomList.end(); ++itr)
+ {
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ {
+ if (Creature* creature = unit->ToCreature())
+ {
+ if (m_Build)
+ {
+ if (disable)
+ m_WG->HideNpc(creature);
+ else
+ m_WG->ShowNpc(creature, true);
+
+ switch (m_Build->GetEntry())
+ {
+ case GO_WINTERGRASP_FORTRESS_TOWER_1:
+ case GO_WINTERGRASP_FORTRESS_TOWER_2:
+ case GO_WINTERGRASP_FORTRESS_TOWER_3:
+ case GO_WINTERGRASP_FORTRESS_TOWER_4:
+ {
+ creature->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]);
+ break;
+ }
+ case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
+ case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
+ case GO_WINTERGRASP_FLAMEWATCH_TOWER:
+ {
+ creature->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ for (GuidSet::const_iterator itr = m_TurretTopList.begin(); itr != m_TurretTopList.end(); ++itr)
+ {
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ {
+ if (Creature* creature = unit->ToCreature())
+ {
+ if (m_Build)
+ {
+ if (disable)
+ m_WG->HideNpc(creature);
+ else
+ m_WG->ShowNpc(creature, true);
+
+ switch (m_Build->GetEntry())
+ {
+ case GO_WINTERGRASP_FORTRESS_TOWER_1:
+ case GO_WINTERGRASP_FORTRESS_TOWER_2:
+ case GO_WINTERGRASP_FORTRESS_TOWER_3:
+ case GO_WINTERGRASP_FORTRESS_TOWER_4:
+ {
+ creature->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]);
+ break;
+ }
+ case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
+ case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
+ case GO_WINTERGRASP_FLAMEWATCH_TOWER:
+ {
+ creature->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ void Save()
+ {
+ sWorld->setWorldState(m_WorldState, m_State);
+ }
+};
+
+struct WGWorkshop
+{
+ // pointer to the battlefield that the workshop belongs to
+ BattlefieldWG* bf;
+ // id of the workshop, useful to retrieve data of the WorkshopsData array
+ uint8 workshopId;
+ // team that controls the node
+ uint8 teamControl;
+ // for worldstate
+ uint32 state;
+
+ WGWorkshop(BattlefieldWG* _bf, uint8 _workshopId)
+ {
+ ASSERT(_bf || _workshopId < WG_MAX_WORKSHOP);
+
+ bf = _bf;
+ workshopId = _workshopId;
+ }
+
+ void GiveControlTo(uint8 team, bool init /* for first call in setup*/)
+ {
+ switch (team)
+ {
+ case BATTLEFIELD_WG_TEAM_NEUTRAL:
+ {
+ // Send warning message to all player to inform a faction attack to a workshop
+ // alliance / horde attacking a workshop
+ bf->SendWarningToAllInZone(teamControl ? WorkshopsData[workshopId].text : WorkshopsData[workshopId].text + 1);
+ break;
+ }
+ case BATTLEFIELD_WG_TEAM_ALLIANCE:
+ case BATTLEFIELD_WG_TEAM_HORDE:
+ {
+ // Updating worldstate
+ state = team == BATTLEFIELD_WG_TEAM_ALLIANCE ? BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT : BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT;
+ bf->SendUpdateWorldState(WorkshopsData[workshopId].worldstate, state);
+
+ // Warning message
+ if (!init) // workshop taken - alliance
+ bf->SendWarningToAllInZone(team == BATTLEFIELD_WG_TEAM_ALLIANCE ? WorkshopsData[workshopId].text : WorkshopsData[workshopId].text+1);
+
+ // Found associate graveyard and update it
+ if (workshopId < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
+ if (bf->GetGraveyardById(workshopId))
+ bf->GetGraveyardById(workshopId)->GiveControlTo(team == BATTLEFIELD_WG_TEAM_ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE);
+
+ teamControl = team;
+ break;
+ }
+ }
+
+ if (!init)
+ bf->UpdateCounterVehicle(false);
+ }
+
+ void UpdateGraveyardAndWorkshop()
+ {
+ if (workshopId < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
+ bf->GetGraveyardById(workshopId)->GiveControlTo(TeamId(teamControl));
+ else
+ GiveControlTo(bf->GetDefenderTeam(), true);
+ }
+
+ void Save()
+ {
+ sWorld->setWorldState(WorkshopsData[workshopId].worldstate, state);
+ }
+};
+
+// Structure for the 6 workshop
+struct WintergraspWorkshopData
+{
+ BattlefieldWG* m_WG; // Pointer to wintergrasp
+ GameObject* m_Build;
+ uint32 m_Type;
+ uint32 m_State; // For worldstate
+ uint32 m_WorldState;
+ uint32 m_TeamControl; // Team witch control the workshop
+ GuidSet m_CreatureOnPoint[2]; // Contain all Creature associate to this point
+ GameObjectSet m_GameObjectOnPoint[2]; // Contain all Gameobject associate to this point
+ uint32 m_NameId; // Id of trinity_string witch contain name of this node, using for alert message
+
+ WintergraspWorkshopData(BattlefieldWG* WG)
+ {
+ m_WG = WG;
+ m_Build = NULL;
+ m_Type = 0;
+ m_State = 0;
+ m_WorldState = 0;
+ m_TeamControl = 0;
+ m_NameId = 0;
+ }
+
+ // Spawning associate creature and store them
+ void AddCreature(WintergraspObjectPositionData obj)
+ {
+ if (Creature* creature = m_WG->SpawnCreature(obj.entryHorde, obj.x, obj.y, obj.z, obj.o, TEAM_HORDE))
+ m_CreatureOnPoint[TEAM_HORDE].insert(creature->GetGUID());
+
+ if (Creature* creature = m_WG->SpawnCreature(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o, TEAM_ALLIANCE))
+ m_CreatureOnPoint[TEAM_ALLIANCE].insert(creature->GetGUID());
+ }
+
+ // Spawning Associate gameobject and store them
+ void AddGameObject(WintergraspObjectPositionData obj)
+ {
+ if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o))
+ m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject);
+ if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o))
+ m_GameObjectOnPoint[TEAM_ALLIANCE].insert(gameobject);
+ }
+
+ // Init method, setup variable
+ void Init(uint32 worldstate, uint32 type, uint32 nameid)
+ {
+ m_WorldState = worldstate;
+ m_Type = type;
+ m_NameId = nameid;
+ }
+
+ // Called on change faction in CapturePoint class
+ void GiveControlTo(uint8 team, bool init /* for first call in setup*/)
+ {
+ switch (team)
+ {
+ case BATTLEFIELD_WG_TEAM_NEUTRAL:
+ {
+ // Send warning message to all player for inform a faction attack a workshop
+ // alliance / horde attacking workshop
+ m_WG->SendWarningToAllInZone(m_TeamControl ? m_NameId : m_NameId + 1);
+ break;
+ }
+ case BATTLEFIELD_WG_TEAM_ALLIANCE:
+ {
+ // Show Alliance creature
+ for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_ALLIANCE].begin(); itr != m_CreatureOnPoint[TEAM_ALLIANCE].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->ShowNpc(creature, creature->GetEntry() != 30499);
+
+ // Hide Horde creature
+ for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_HORDE].begin(); itr != m_CreatureOnPoint[TEAM_HORDE].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->HideNpc(creature);
+
+ // Show Alliance gameobject
+ for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_ALLIANCE].begin(); itr != m_GameObjectOnPoint[TEAM_ALLIANCE].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY);
+
+ // Hide Horde gameobject
+ for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_HORDE].begin(); itr != m_GameObjectOnPoint[TEAM_HORDE].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_ONE_DAY);
+
+
+ // Updating worldstate
+ m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT;
+ m_WG->SendUpdateWorldState(m_WorldState, m_State);
+
+ // Warning message
+ if (!init) // workshop taken - alliance
+ m_WG->SendWarningToAllInZone(m_NameId);
+
+ // Found associate graveyard and update it
+ if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
+ if (m_WG && m_WG->GetGraveyardById(m_Type))
+ m_WG->GetGraveyardById(m_Type)->GiveControlTo(TEAM_ALLIANCE);
+
+ m_TeamControl = team;
+ break;
+ }
+ case BATTLEFIELD_WG_TEAM_HORDE:
+ {
+ // Show Horde creature
+ for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_HORDE].begin(); itr != m_CreatureOnPoint[TEAM_HORDE].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->ShowNpc(creature, creature->GetEntry() != 30400);
+
+ // Hide Alliance creature
+ for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_ALLIANCE].begin(); itr != m_CreatureOnPoint[TEAM_ALLIANCE].end(); ++itr)
+ if (Unit* unit = sObjectAccessor->FindUnit(*itr))
+ if (Creature* creature = unit->ToCreature())
+ m_WG->HideNpc(creature);
+
+ // Hide Alliance gameobject
+ for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_ALLIANCE].begin(); itr != m_GameObjectOnPoint[TEAM_ALLIANCE].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_ONE_DAY);
+
+ // Show Horde gameobject
+ for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_HORDE].begin(); itr != m_GameObjectOnPoint[TEAM_HORDE].end(); ++itr)
+ (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY);
+
+ // Update worlstate
+ m_State = BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT;
+ m_WG->SendUpdateWorldState(m_WorldState, m_State);
+
+ // Warning message
+ if (!init) // workshop taken - horde
+ m_WG->SendWarningToAllInZone(m_NameId + 1);
+
+ // Update graveyard control
+ if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
+ if (m_WG && m_WG->GetGraveyardById(m_Type))
+ m_WG->GetGraveyardById(m_Type)->GiveControlTo(TEAM_HORDE);
+
+ m_TeamControl = team;
+ break;
+ }
+ }
+ if (!init)
+ m_WG->UpdateCounterVehicle(false);
+ }
+
+ void UpdateGraveyardAndWorkshop()
+ {
+ if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
+ m_WG->GetGraveyardById(m_Type)->GiveControlTo(TeamId(m_TeamControl));
+ else
+ GiveControlTo(m_WG->GetDefenderTeam(), true);
+ }
+
+ void Save()
+ {
+ sWorld->setWorldState(m_WorldState, m_State);
+ }
+};
+
+#endif
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 89151b6395c..e88c501398e 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -24,16 +24,9 @@
#include "ArenaTeamMgr.h"
ArenaTeam::ArenaTeam()
+ : TeamId(0), Type(0), TeamName(), CaptainGuid(0), BackgroundColor(0), EmblemStyle(0), EmblemColor(0),
+ BorderStyle(0), BorderColor(0)
{
- TeamId = 0;
- Type = 0;
- TeamName = "";
- CaptainGuid = 0;
- BackgroundColor = 0;
- EmblemStyle = 0;
- EmblemColor = 0;
- BorderStyle = 0;
- BorderColor = 0;
Stats.WeekGames = 0;
Stats.SeasonGames = 0;
Stats.Rank = 0;
@@ -87,7 +80,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string teamName, uin
// Add captain as member
AddMember(CaptainGuid);
- sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
+ sLog->outInfo(LOG_FILTER_ARENAS, "New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
return true;
}
@@ -125,7 +118,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
// Check if player is already in a similar arena team
if ((player && player->GetArenaTeamId(GetSlot())) || Player::GetArenaTeamIdFromDB(playerGuid, GetType()) != 0)
{
- sLog->outError("Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());
+ sLog->outDebug(LOG_FILTER_ARENAS, "Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());
return false;
}
@@ -184,7 +177,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
}
- sLog->outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId());
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId());
return true;
}
@@ -250,8 +243,8 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
// Delete member if character information is missing
if (newMember.Name.empty())
{
- sLog->outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
- this->DelMember(newMember.Guid, true);
+ sLog->outError(LOG_FILTER_SQL, "ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
+ DelMember(newMember.Guid, true);
continue;
}
@@ -267,7 +260,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
if (Empty() || !captainPresentInTeam)
{
// Arena team is empty or captain is not in team, delete from db
- sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
+ sLog->outDebug(LOG_FILTER_ARENAS, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
return false;
}
@@ -297,7 +290,7 @@ void ArenaTeam::SetCaptain(uint64 guid)
newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
char const* oldCaptainName = oldCaptain ? oldCaptain->GetName() : "";
uint32 oldCaptainLowGuid = oldCaptain ? oldCaptain->GetGUIDLow() : 0;
- sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].",
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].",
oldCaptainName, oldCaptainLowGuid, newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType());
}
}
@@ -321,7 +314,7 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
- sLog->outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
@@ -346,7 +339,7 @@ void ArenaTeam::Disband(WorldSession* session)
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
if (Player* player = session->GetPlayer())
- sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
// Update database
@@ -507,7 +500,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun
data << str1 << str2 << str3;
break;
default:
- sLog->outError("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
+ sLog->outError(LOG_FILTER_ARENAS, "Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
return;
}
@@ -529,7 +522,7 @@ uint8 ArenaTeam::GetSlotByType(uint32 type)
default:
break;
}
- sLog->outError("FATAL: Unknown arena team type %u for some arena team", type);
+ sLog->outError(LOG_FILTER_ARENAS, "FATAL: Unknown arena team type %u for some arena team", type);
return 0xFF;
}
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index 1c24dfc061d..55de445345b 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -81,7 +81,7 @@ uint32 ArenaTeamMgr::GenerateArenaTeamId()
{
if (NextArenaTeamId >= 0xFFFFFFFE)
{
- sLog->outError("Arena team ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Arena team ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return NextArenaTeamId++;
@@ -101,8 +101,7 @@ void ArenaTeamMgr::LoadArenaTeams()
if (!result)
{
- sLog->outString(">> Loaded 0 arena teams. DB table `arena_team` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 arena teams. DB table `arena_team` is empty!");
return;
}
@@ -132,8 +131,7 @@ void ArenaTeamMgr::LoadArenaTeams()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ArenaTeamMgr::DistributeArenaPoints()
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 85bbd2f3b89..647f55c4ffa 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -440,7 +440,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
if (!FindBgMap())
{
- sLog->outError("Battleground::_ProcessJoin: map (map id: %u, instance id: %u) is not created!", m_MapId, m_InstanceID);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::_ProcessJoin: map (map id: %u, instance id: %u) is not created!", m_MapId, m_InstanceID);
EndNow();
return;
}
@@ -550,7 +550,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
if (dist >= maxDist)
{
- sLog->outError("BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", plr->GetName(), GetMapId());
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", plr->GetName(), GetMapId());
plr->TeleportTo(GetMapId(), x, y, z, o);
}
}
@@ -588,7 +588,7 @@ inline Player* Battleground::_GetPlayer(uint64 guid, bool offlineRemove, const c
{
player = ObjectAccessor::FindPlayer(guid);
if (!player)
- sLog->outError("Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!",
context, GUID_LOPART(guid), m_MapId, m_InstanceID);
}
return player;
@@ -771,17 +771,17 @@ void Battleground::EndBattleground(uint32 winner)
winner_matchmaker_rating = GetArenaMatchmakerRating(winner);
winner_matchmaker_change = winner_arena_team->WonAgainst(winner_matchmaker_rating, loser_matchmaker_rating, winner_change);
loser_matchmaker_change = loser_arena_team->LostAgainst(loser_matchmaker_rating, winner_matchmaker_rating, loser_change);
- sLog->outArena("match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", m_ArenaType, winner_team_rating, winner_change, winner_matchmaker_rating,
+ sLog->outDebug(LOG_FILTER_ARENAS, "match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", m_ArenaType, winner_team_rating, winner_change, winner_matchmaker_rating,
winner_matchmaker_change, loser_team_rating, loser_change, loser_matchmaker_rating, loser_matchmaker_change);
SetArenaMatchmakerRating(winner, winner_matchmaker_rating + winner_matchmaker_change);
SetArenaMatchmakerRating(GetOtherTeam(winner), loser_matchmaker_rating + loser_matchmaker_change);
SetArenaTeamRatingChangeForTeam(winner, winner_change);
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
- sLog->outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
+ sLog->outDebug(LOG_FILTER_ARENAS, "Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
- sLog->outArena("Statistics match Type: %u for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", m_ArenaType, player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
+ sLog->outDebug(LOG_FILTER_ARENAS, "Statistics match Type: %u for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", m_ArenaType, player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
}
// Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes
else
@@ -851,7 +851,7 @@ void Battleground::EndBattleground(uint32 winner)
{
// update achievement BEFORE personal rating update
uint32 rating = player->GetArenaPersonalRating(winner_arena_team->GetSlot());
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1);
winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change);
}
@@ -860,7 +860,7 @@ void Battleground::EndBattleground(uint32 winner)
loser_arena_team->MemberLost(player, winner_matchmaker_rating, loser_matchmaker_change);
// Arena lost => reset the win_rated_arena having the "no_lose" condition
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE);
}
}
@@ -880,7 +880,7 @@ void Battleground::EndBattleground(uint32 winner)
player->SetRandomWinner(true);
}
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1);
}
else
{
@@ -899,7 +899,7 @@ void Battleground::EndBattleground(uint32 winner)
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType());
player->GetSession()->SendPacket(&data);
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1);
}
if (isArena() && isRated() && winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
@@ -1055,7 +1055,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (Transport)
player->TeleportToBGEntryPoint();
- sLog->outDetail("BATTLEGROUND: Removed player %s from Battleground.", player->GetName());
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Removed player %s from Battleground.", player->GetName());
}
//battleground object will be deleted next Battleground::Update() call
@@ -1075,7 +1075,7 @@ void Battleground::Reset()
m_Events = 0;
if (m_InvitedAlliance > 0 || m_InvitedHorde > 0)
- sLog->outError("Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!",
m_InvitedAlliance, m_InvitedHorde, m_MapId, m_InstanceID);
m_InvitedAlliance = 0;
@@ -1103,7 +1103,7 @@ void Battleground::StartBattleground()
// and it doesn't matter if we call StartBattleground() more times, because m_Battlegrounds is a map and instance id never changes
sBattlegroundMgr->AddBattleground(GetInstanceID(), GetTypeID(), this);
if (m_IsRated)
- sLog->outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
+ sLog->outDebug(LOG_FILTER_ARENAS, "Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
}
void Battleground::AddPlayer(Player* player)
@@ -1177,24 +1177,24 @@ void Battleground::AddPlayer(Player* player)
player->CastSpell(player, SPELL_PREPARATION, true); // reduces all mana cost of spells.
}
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
- player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
+ player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
// setup BG group membership
PlayerAddedToBGCheckIfBGIsRunning(player);
AddOrSetPlayerToCorrectBgGroup(player, team);
// Log
- sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", player->GetName());
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Player %s joined the battle.", player->GetName());
}
// this method adds player to his team's bg group, or sets his correct group if player is already in bg group
@@ -1213,7 +1213,7 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team)
if (group->IsMember(playerGuid))
{
uint8 subgroup = group->GetMemberGroup(playerGuid);
- player->SetBattlegroundRaid(group, subgroup);
+ player->SetBattlegroundOrBattlefieldRaid(group, subgroup);
}
else
{
@@ -1392,7 +1392,7 @@ void Battleground::UpdatePlayerScore(Player* Source, uint32 type, uint32 value,
itr->second->HealingDone += value;
break;
default:
- sLog->outError("Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
type, m_MapId, m_InstanceID);
break;
}
@@ -1441,9 +1441,9 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(),
PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
- sLog->outErrorDb("Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_SQL, "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
- sLog->outError("Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete go;
return false;
@@ -1494,7 +1494,7 @@ void Battleground::DoorClose(uint32 type)
}
}
else
- sLog->outError("Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
}
@@ -1506,7 +1506,7 @@ void Battleground::DoorOpen(uint32 type)
obj->SetGoState(GO_STATE_ACTIVE);
}
else
- sLog->outError("Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
}
@@ -1514,7 +1514,7 @@ GameObject* Battleground::GetBGObject(uint32 type)
{
GameObject* obj = GetBgMap()->GetGameObject(BgObjects[type]);
if (!obj)
- sLog->outError("Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
return obj;
}
@@ -1523,7 +1523,7 @@ Creature* Battleground::GetBGCreature(uint32 type)
{
Creature* creature = GetBgMap()->GetCreature(BgCreatures[type]);
if (!creature)
- sLog->outError("Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
return creature;
}
@@ -1556,7 +1556,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
Creature* creature = new Creature;
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
{
- sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete creature;
return NULL;
@@ -1567,7 +1567,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cinfo)
{
- sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete creature;
return NULL;
@@ -1602,7 +1602,7 @@ bool Battleground::DelCreature(uint32 type)
return true;
}
- sLog->outError("Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
BgCreatures[type] = 0;
return false;
@@ -1620,7 +1620,7 @@ bool Battleground::DelObject(uint32 type)
BgObjects[type] = 0;
return true;
}
- sLog->outError("Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
BgObjects[type] = 0;
return false;
@@ -1646,7 +1646,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
//creature->CastSpell(creature, SPELL_SPIRIT_HEAL_CHANNEL, true);
return true;
}
- sLog->outError("Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
type, entry, m_MapId, m_InstanceID);
EndNow();
return false;
@@ -1745,7 +1745,7 @@ void Battleground::HandleTriggerBuff(uint64 go_guid)
index--;
if (index < 0)
{
- sLog->outError("Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!",
GUID_LOPART(go_guid), obj->GetEntry(), obj->GetGoType(), m_MapId, m_InstanceID);
return;
}
@@ -1769,15 +1769,19 @@ void Battleground::HandleTriggerBuff(uint64 go_guid)
SpawnBGObject(index, BUFF_RESPAWN_TIME);
}
-void Battleground::HandleKillPlayer(Player* player, Player* killer)
+void Battleground::HandleKillPlayer(Player* victim, Player* killer)
{
// Keep in mind that for arena this will have to be changed a bit
// Add +1 deaths
- UpdatePlayerScore(player, SCORE_DEATHS, 1);
+ UpdatePlayerScore(victim, SCORE_DEATHS, 1);
// Add +1 kills to group and +1 killing_blows to killer
if (killer)
{
+ // Don't reward credit for killing ourselves, like fall damage of hellfire (warlock)
+ if (killer == victim)
+ return;
+
UpdatePlayerScore(killer, SCORE_HONORABLE_KILLS, 1);
UpdatePlayerScore(killer, SCORE_KILLING_BLOWS, 1);
@@ -1787,7 +1791,7 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer)
if (!creditedPlayer || creditedPlayer == killer)
continue;
- if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(player))
+ if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(victim))
UpdatePlayerScore(creditedPlayer, SCORE_HONORABLE_KILLS, 1);
}
}
@@ -1795,8 +1799,8 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer)
if (!isArena())
{
// To be able to remove insignia -- ONLY IN Battlegrounds
- player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
- RewardXPAtKill(killer, player);
+ victim->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
+ RewardXPAtKill(killer, victim);
}
}
@@ -1865,7 +1869,7 @@ int32 Battleground::GetObjectType(uint64 guid)
for (uint32 i = 0; i < BgObjects.size(); ++i)
if (BgObjects[i] == guid)
return i;
- sLog->outError("Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
GUID_LOPART(guid), m_MapId, m_InstanceID);
return -1;
}
@@ -1919,7 +1923,7 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
- player->GetAchievementMgr().StartTimedAchievement(type, entry);
+ player->StartTimedAchievement(type, entry);
}
void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry)
@@ -1933,3 +1937,11 @@ void Battleground::RewardXPAtKill(Player* killer, Player* victim)
if (sWorld->getBoolConfig(CONFIG_BG_XP_FOR_KILL) && killer && victim)
killer->RewardPlayerAndGroupAtKill(victim, true);
}
+
+void Battleground::HandleAreaTrigger(Player* player, uint32 trigger)
+{
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger %u in Battleground %u. Player coords (x: %f, y: %f, z: %f)",
+ trigger, player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+ if (player->isGameMaster())
+ player->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger);
+}
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
index 01dfbb23033..fc292aa5bc1 100755
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -38,7 +38,7 @@ enum BattlegroundSounds
SOUND_HORDE_WINS = 8454,
SOUND_ALLIANCE_WINS = 8455,
SOUND_BG_START = 3439,
- SOUND_BG_START_L70ETC = 11803,
+ SOUND_BG_START_L70ETC = 11803
};
enum BattlegroundQuests
@@ -79,7 +79,7 @@ enum BattlegroundMarksCount
enum BattlegroundCreatures
{
BG_CREATURE_ENTRY_A_SPIRITGUIDE = 13116, // alliance
- BG_CREATURE_ENTRY_H_SPIRITGUIDE = 13117, // horde
+ BG_CREATURE_ENTRY_H_SPIRITGUIDE = 13117 // horde
};
enum BattlegroundSpells
@@ -99,7 +99,7 @@ enum BattlegroundSpells
SPELL_AURA_PLAYER_INACTIVE = 43681, // Inactive
SPELL_HONORABLE_DEFENDER_25Y = 68652, // +50% honor when standing at a capture point that you control, 25yards radius (added in 3.2)
SPELL_HONORABLE_DEFENDER_60Y = 66157, // +50% honor when standing at a capture point that you control, 60yards radius (added in 3.2), probably for 40+ player battlegrounds
- SPELL_THE_LAST_STANDING = 26549, // Arena achievement related
+ SPELL_THE_LAST_STANDING = 26549 // Arena achievement related
};
enum BattlegroundTimeIntervals
@@ -112,7 +112,7 @@ enum BattlegroundTimeIntervals
MAX_OFFLINE_TIME = 300, // secs
RESPAWN_ONE_DAY = 86400, // secs
RESPAWN_IMMEDIATELY = 0, // secs
- BUFF_RESPAWN_TIME = 180, // secs
+ BUFF_RESPAWN_TIME = 180 // secs
};
enum BattlegroundStartTimeIntervals
@@ -121,7 +121,7 @@ enum BattlegroundStartTimeIntervals
BG_START_DELAY_1M = 60000, // ms (1 minute)
BG_START_DELAY_30S = 30000, // ms (30 seconds)
BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
- BG_START_DELAY_NONE = 0, // ms
+ BG_START_DELAY_NONE = 0 // ms
};
enum BattlegroundBuffObjects
@@ -137,8 +137,8 @@ enum BattlegroundRandomRewards
BG_REWARD_WINNER_ARENA_FIRST = 25,
BG_REWARD_WINNER_HONOR_LAST = 15,
BG_REWARD_WINNER_ARENA_LAST = 0,
- BG_REWARD_LOSER_HONOR_FIRST = 5,
- BG_REWARD_LOSER_HONOR_LAST = 5
+ BG_REWARD_LOSER_HONOR_FIRST = 5,
+ BG_REWARD_LOSER_HONOR_LAST = 5
};
const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY };
@@ -209,7 +209,7 @@ enum ScoreType
SCORE_SECONDARY_OBJECTIVES = 17,
//SOTA
SCORE_DESTROYED_DEMOLISHER = 18,
- SCORE_DESTROYED_WALL = 19,
+ SCORE_DESTROYED_WALL = 19
};
enum ArenaType
@@ -275,7 +275,7 @@ enum GroupJoinBattlegroundResult
ERR_BATTLEGROUND_JOIN_FAILED = -12, // Join as a group failed (uint64 guid doesn't exist in client cache)
ERR_LFG_CANT_USE_BATTLEGROUND = -13, // You cannot queue for a battleground or arena while using the dungeon system.
ERR_IN_RANDOM_BG = -14, // Can't do that while in a Random Battleground queue.
- ERR_IN_NON_RANDOM_BG = -15, // Can't queue for Random Battleground while in another Battleground queue.
+ ERR_IN_NON_RANDOM_BG = -15 // Can't queue for Random Battleground while in another Battleground queue.
};
class BattlegroundScore
@@ -507,7 +507,7 @@ class Battleground
// Triggers handle
// must be implemented in BG subclass
- virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
+ virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/);
// must be implemented in BG subclass if need AND call base class generic code
virtual void HandleKillPlayer(Player* player, Player* killer);
virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/);
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index a106f11ae82..0b107983379 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -55,7 +55,7 @@ BattlegroundMgr::BattlegroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
{
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
m_Battlegrounds[i].clear();
- m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
+ m_NextRatedArenaUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER);
m_Testing=false;
}
@@ -143,10 +143,10 @@ void BattlegroundMgr::Update(uint32 diff)
}
// if rating difference counts, maybe force-update queues
- if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
+ if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER))
{
// it's time to force update
- if (m_NextRatingDiscardUpdate < diff)
+ if (m_NextRatedArenaUpdate < diff)
{
// forced update for rated arenas (scan all, but skipped non rated)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundMgr: UPDATING ARENA QUEUES");
@@ -156,10 +156,10 @@ void BattlegroundMgr::Update(uint32 diff)
BATTLEGROUND_AA, BattlegroundBracketId(bracket),
BattlegroundMgr::BGArenaType(BattlegroundQueueTypeId(qtype)), true, 0);
- m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
+ m_NextRatedArenaUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER);
}
else
- m_NextRatingDiscardUpdate -= diff;
+ m_NextRatedArenaUpdate -= diff;
}
if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
{
@@ -226,7 +226,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket* data, Battlegro
*data << uint8(uiFrame);
break;
default:
- sLog->outError("Unknown BG status!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Unknown BG status!");
break;
}
}
@@ -281,7 +281,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
itr2 = itr++;
if (!bg->IsPlayerInBattleground(itr2->first))
{
- sLog->outError("Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
continue;
}
@@ -391,7 +391,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
// should never happen
if (++scoreCount >= bg->GetMaxPlayers() && itr != bg->GetPlayerScoresEnd())
{
- sLog->outError("Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers());
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers());
break;
}
}
@@ -508,7 +508,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
if (!bg_template)
{
- sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
return NULL;
}
bool isRandom = false;
@@ -550,7 +550,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
bg_template = GetBattlegroundTemplate(bgTypeId);
if (!bg_template)
{
- sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
return NULL;
}
}
@@ -683,8 +683,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 battlegrounds. DB table `battleground_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battlegrounds. DB table `battleground_template` is empty.");
return;
}
@@ -702,7 +701,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
if (!bl)
{
- sLog->outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
continue;
}
@@ -717,14 +716,14 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
// check values from DB
if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam)
{
- sLog->outErrorDb("Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)",
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)",
data.bgTypeId, data.MinPlayersPerTeam, data.MaxPlayersPerTeam);
continue;
}
if (data.LevelMin == 0 || data.LevelMax == 0 || data.LevelMin > data.LevelMax)
{
- sLog->outErrorDb("Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)",
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)",
data.bgTypeId, data.LevelMin, data.LevelMax);
continue;
}
@@ -746,7 +745,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
}
else
{
- sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
continue;
}
@@ -767,12 +766,12 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
}
else
{
- sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
continue;
}
data.StartMaxDist = fields[9].GetFloat();
-
+
selectionWeight = fields[10].GetUInt8();
data.scriptId = sObjectMgr->GetScriptId(fields[11].GetCString());
data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()];
@@ -792,8 +791,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void BattlegroundMgr::InitAutomaticArenaPointDistribution()
@@ -890,12 +888,12 @@ void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, Batt
team = player->GetTeam();
bg->GetTeamStartLoc(team, x, y, z, O);
- sLog->outDetail("BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", player->GetName(), mapid, x, y, z, O);
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", player->GetName(), mapid, x, y, z, O);
player->TeleportTo(mapid, x, y, z, O);
}
else
{
- sLog->outError("player %u is trying to port to non-existent bg instance %u", player->GetGUIDLow(), instanceId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "player %u is trying to port to non-existent bg instance %u", player->GetGUIDLow(), instanceId);
}
}
@@ -1077,8 +1075,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
if (!result)
{
- sLog->outString(">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
return;
}
@@ -1094,7 +1091,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
uint32 bgTypeId = fields[1].GetUInt32();
if (!sBattlemasterListStore.LookupEntry(bgTypeId))
{
- sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
+ sLog->outError(LOG_FILTER_SQL, "Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
continue;
}
@@ -1102,8 +1099,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId)
@@ -1137,4 +1133,4 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday)
bool BattlegroundMgr::IsBGWeekend(BattlegroundTypeId bgTypeId)
{
return IsHolidayActive(BGTypeToWeekendHolidayId(bgTypeId));
-} \ No newline at end of file
+}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index 7afb83da0a6..10a49408c06 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -141,7 +141,7 @@ class BattlegroundMgr
BattlegroundSelectionWeightMap m_BGSelectionWeights;
std::vector<uint64> m_QueueUpdateScheduler;
std::set<uint32> m_ClientBattlegroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; //the instanceids just visible for the client
- uint32 m_NextRatingDiscardUpdate;
+ uint32 m_NextRatedArenaUpdate;
time_t m_NextAutoDistributionTime;
uint32 m_AutoDistributionTimeChecker;
bool m_ArenaTesting;
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 6f4264c0faf..f36b4d49a35 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -294,7 +294,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
itr = m_QueuedPlayers.find(guid);
if (itr == m_QueuedPlayers.end())
{
- sLog->outError("BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
return;
}
@@ -309,7 +309,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
{
//we must check premade and normal team's queue - because when players from premade are joining bg,
//they leave groupinfo so we can't use its players size to find out index
- for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_QUEUE_NORMAL_ALLIANCE)
+ for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_TEAMS_COUNT)
{
for (group_itr_tmp = m_QueuedGroups[bracket_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[bracket_id_tmp][j].end(); ++group_itr_tmp)
{
@@ -328,7 +328,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
//player can't be in queue without group, but just in case
if (bracket_id == -1)
{
- sLog->outError("BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
return;
}
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id);
@@ -780,14 +780,14 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
if (!bg_template)
{
- sLog->outError("Battleground: Update: bg template not found for %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: Update: bg template not found for %u", bgTypeId);
return;
}
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(), bracket_id);
if (!bracketEntry)
{
- sLog->outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
return;
}
@@ -838,7 +838,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false);
if (!bg2)
{
- sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
return;
}
//invite those selection pools
@@ -864,7 +864,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false);
if (!bg2)
{
- sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
return;
}
@@ -962,7 +962,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* arena = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, true);
if (!arena)
{
- sLog->outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
return;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index d28f5ddfe6a..dfd7af583a5 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -210,24 +210,24 @@ void BattlegroundAB::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*
}
-void BattlegroundAB::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundAB::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- switch (Trigger)
+ switch (trigger)
{
case 3948: // Arathi Basin Alliance Exit.
- if (Source->GetTeam() != ALLIANCE)
- Source->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
+ if (player->GetTeam() != ALLIANCE)
+ player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
else
- Source->LeaveBattleground();
+ player->LeaveBattleground();
break;
case 3949: // Arathi Basin Horde Exit.
- if (Source->GetTeam() != HORDE)
- Source->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
+ if (player->GetTeam() != HORDE)
+ player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
else
- Source->LeaveBattleground();
+ player->LeaveBattleground();
break;
case 3866: // Stables
case 3869: // Gold Mine
@@ -238,8 +238,7 @@ void BattlegroundAB::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 4021: // Unk2
//break;
default:
- //sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- //Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
}
@@ -356,7 +355,7 @@ void BattlegroundAB::_SendNodeUpdate(uint8 node)
void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
{
if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
- sLog->outError("Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
uint8 capturedNodes = 0;
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
@@ -371,9 +370,10 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
return;
- Creature* trigger = GetBGCreature(node+7);//0-6 spirit guides
+
+ Creature* trigger = BgCreatures[node+7] ? GetBGCreature(node+7) : NULL;//0-6 spirit guides
if (!trigger)
- trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]);
+ trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]);
//add bonus honor aura trigger creature when node is accupied
//cast bonus aura (+50% honor in 25yards)
@@ -561,7 +561,7 @@ bool BattlegroundAB::SetupBattleground()
|| !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i, BG_AB_OBJECTID_AURA_C, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
)
{
- sLog->outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAB: Failed to spawn some object Battleground not created!");
return false;
}
}
@@ -569,7 +569,7 @@ bool BattlegroundAB::SetupBattleground()
|| !AddObject(BG_AB_OBJECT_GATE_H, BG_AB_OBJECTID_GATE_H, BG_AB_DoorPositions[1][0], BG_AB_DoorPositions[1][1], BG_AB_DoorPositions[1][2], BG_AB_DoorPositions[1][3], BG_AB_DoorPositions[1][4], BG_AB_DoorPositions[1][5], BG_AB_DoorPositions[1][6], BG_AB_DoorPositions[1][7], RESPAWN_IMMEDIATELY)
)
{
- sLog->outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAB: Failed to spawn door object Battleground not created!");
return false;
}
//buffs
@@ -579,7 +579,7 @@ bool BattlegroundAB::SetupBattleground()
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
)
- sLog->outErrorDb("BatteGroundAB: Failed to spawn buff object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAB: Failed to spawn buff object!");
}
return true;
@@ -681,11 +681,11 @@ void BattlegroundAB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
{
case SCORE_BASES_ASSAULTED:
((BattlegroundABScore*)itr->second)->BasesAssaulted += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_ASSAULT_BASE);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_ASSAULT_BASE);
break;
case SCORE_BASES_DEFENDED:
((BattlegroundABScore*)itr->second)->BasesDefended += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE);
break;
default:
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
index 2cac5df73a9..870b3965522 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
@@ -102,7 +102,7 @@ enum BG_AB_ObjectType
BG_AB_OBJECT_SPEEDBUFF_GOLD_MINE = 54,
BG_AB_OBJECT_REGENBUFF_GOLD_MINE = 55,
BG_AB_OBJECT_BERSERKBUFF_GOLD_MINE = 56,
- BG_AB_OBJECT_MAX = 57,
+ BG_AB_OBJECT_MAX = 57
};
/* Object id templates from DB */
@@ -123,7 +123,7 @@ enum BG_AB_ObjectTypes
enum BG_AB_Timers
{
- BG_AB_FLAG_CAPTURING_TIME = 60000,
+ BG_AB_FLAG_CAPTURING_TIME = 60000
};
enum BG_AB_Score
@@ -146,7 +146,7 @@ enum BG_AB_BattlegroundNodes
BG_AB_SPIRIT_ALIANCE = 5,
BG_AB_SPIRIT_HORDE = 6,
- BG_AB_ALL_NODES_COUNT = 7, // all nodes (dynamic and static)
+ BG_AB_ALL_NODES_COUNT = 7 // all nodes (dynamic and static)
};
enum BG_AB_NodeStatus
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index d2cbab2be54..aeebfb945f9 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -93,7 +93,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
{
if (!m_CaptainAlive[0])
{
- sLog->outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
return;
}
m_CaptainAlive[0]=false;
@@ -112,7 +112,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
{
if (!m_CaptainAlive[1])
{
- sLog->outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
return;
}
m_CaptainAlive[1]=false;
@@ -480,7 +480,7 @@ void BattlegroundAV::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team
{
if (!player)
{
- sLog->outError("bg_AV no player at remove");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "bg_AV no player at remove");
return;
}
//TODO search more buffs
@@ -489,27 +489,25 @@ void BattlegroundAV::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team
player->RemoveAurasDueToSpell(AV_BUFF_H_CAPTAIN);
}
-void BattlegroundAV::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundAV::HandleAreaTrigger(Player* player, uint32 trigger)
{
- // this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- uint32 SpellId = 0;
- switch (Trigger)
+ switch (trigger)
{
case 95:
case 2608:
- if (Source->GetTeam() != ALLIANCE)
- Source->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
+ if (player->GetTeam() != ALLIANCE)
+ player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
else
- Source->LeaveBattleground();
+ player->LeaveBattleground();
break;
case 2606:
- if (Source->GetTeam() != HORDE)
- Source->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
+ if (player->GetTeam() != HORDE)
+ player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
else
- Source->LeaveBattleground();
+ player->LeaveBattleground();
break;
case 3326:
case 3327:
@@ -520,13 +518,9 @@ void BattlegroundAV::HandleAreaTrigger(Player* Source, uint32 Trigger)
//Source->Unmount();
break;
default:
- sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
-// Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
-
- if (SpellId)
- Source->CastSpell(Source, SpellId, true);
}
void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
@@ -540,19 +534,19 @@ void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
{
case SCORE_GRAVEYARDS_ASSAULTED:
((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_GRAVEYARD);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_GRAVEYARD);
break;
case SCORE_GRAVEYARDS_DEFENDED:
((BattlegroundAVScore*)itr->second)->GraveyardsDefended += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_GRAVEYARD);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_GRAVEYARD);
break;
case SCORE_TOWERS_ASSAULTED:
((BattlegroundAVScore*)itr->second)->TowersAssaulted += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_TOWER);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_TOWER);
break;
case SCORE_TOWERS_DEFENDED:
((BattlegroundAVScore*)itr->second)->TowersDefended += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_TOWER);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_TOWER);
break;
case SCORE_MINES_CAPTURED:
((BattlegroundAVScore*)itr->second)->MinesCaptured += value;
@@ -588,7 +582,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
if (BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp])
DelCreature(AV_CPLACE_A_MARSHAL_SOUTH + tmp);
else
- sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
//spawn destroyed aura
for (uint8 i=0; i <= 9; i++)
SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10), RESPAWN_IMMEDIATELY);
@@ -753,7 +747,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
if (BgCreatures[node])
DelCreature(node);
if (!AddSpiritGuide(node, BG_AV_CreaturePos[node][0], BG_AV_CreaturePos[node][1], BG_AV_CreaturePos[node][2], BG_AV_CreaturePos[node][3], owner))
- sLog->outError("AV: couldn't spawn spiritguide at node %i", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "AV: couldn't spawn spiritguide at node %i", node);
}
for (uint8 i=0; i<4; i++)
@@ -811,7 +805,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
return BG_AV_Nodes(object - 29);
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE)
return BG_AV_NODES_SNOWFALL_GRAVE;
- sLog->outError("BattlegroundAV: ERROR! GetPlace got a wrong object :(");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundAV: ERROR! GetPlace got a wrong object :(");
ASSERT(false);
return BG_AV_Nodes(0);
}
@@ -849,7 +843,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
}
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
- sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
ASSERT(false);
return 0;
}
@@ -903,7 +897,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node);
if (m_Nodes[node].PrevOwner != team)
{
- sLog->outError("BG_AV: player defends point which doesn't belong to his team %i", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_AV: player defends point which doesn't belong to his team %i", node);
return;
}
@@ -1124,7 +1118,7 @@ uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used
if (state == POINT_ASSAULTED)
return 3;
}
- sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i", state, team);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_AV: should update a strange worldstate state:%i team:%i", state, team);
return 5; //this will crash the game, but i want to know if something is wrong here
}
@@ -1203,7 +1197,7 @@ bool BattlegroundAV::SetupBattleground()
// horde gates
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0], BG_AV_DoorPositons[1][1], BG_AV_DoorPositons[1][2], BG_AV_DoorPositons[1][3], 0, 0, sin(BG_AV_DoorPositons[1][3]/2), cos(BG_AV_DoorPositons[1][3]/2), RESPAWN_IMMEDIATELY))
{
- sLog->outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAV: Failed to spawn some object Battleground not created!1");
return false;
}
@@ -1221,7 +1215,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!2");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!2");
return false;
}
}
@@ -1236,7 +1230,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_A, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PH, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!3");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!3");
return false;
}
}
@@ -1249,7 +1243,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PA, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_H, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!4");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!4");
return false;
}
}
@@ -1257,7 +1251,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
return false;
}
}
@@ -1271,7 +1265,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_SMOKE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
return false;
}
}
@@ -1279,7 +1273,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
return false;
}
}
@@ -1289,7 +1283,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i, BG_AV_OBJECTID_MINE_N, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
return false;
}
}
@@ -1297,14 +1291,14 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
return false;
}
}
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N, BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3], 0, 0, sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!8");
return false;
}
for (uint8 i = 0; i < 4; i++)
@@ -1314,7 +1308,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H, BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH, BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
return false;
}
}
@@ -1402,7 +1396,7 @@ const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
case BG_AV_NODES_FROSTWOLF_WTOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_W);
case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
default:
- sLog->outError("tried to get name for node %u", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "tried to get name for node %u", node);
break;
}
@@ -1413,22 +1407,22 @@ void BattlegroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
{
if (m_Nodes[node].TotalOwner == team)
{
- sLog->outCrash("Assaulting team is TotalOwner of node");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Assaulting team is TotalOwner of node");
ASSERT (false);
}
if (m_Nodes[node].Owner == team)
{
- sLog->outCrash("Assaulting team is owner of node");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Assaulting team is owner of node");
ASSERT (false);
}
if (m_Nodes[node].State == POINT_DESTROYED)
{
- sLog->outCrash("Destroyed node is being assaulted");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Destroyed node is being assaulted");
ASSERT (false);
}
if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwner) //only assault an assaulted node if no totalowner exists
{
- sLog->outCrash("Assault on an not assaulted node with total owner");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Assault on an not assaulted node with total owner");
ASSERT (false);
}
//the timer gets another time, if the previous owner was 0 == Neutral
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
index f073b69a779..b71b3476fcc 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
@@ -95,7 +95,7 @@ horde:
AV_SOUND_BOTH_TOWER_DEFEND = 8192,
AV_SOUND_ALLIANCE_CAPTAIN = 8232, //gets called when someone attacks them and at the beginning after 3min+rand(x)*10sec (maybe buff)
- AV_SOUND_HORDE_CAPTAIN = 8333,
+ AV_SOUND_HORDE_CAPTAIN = 8333
};
@@ -1359,7 +1359,7 @@ enum BG_AV_WorldStates
//Neutral
//Snowfall Grave
*/
- AV_SNOWFALL_N = 1966, //over aa
+ AV_SNOWFALL_N = 1966 //over aa
/*
AV_SNOWFALL_A_C = 1341, //over hc
AV_SNOWFALL_A_A = 1343, //over ha
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
index c7eddbb67a9..4b34422f31b 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
@@ -89,7 +89,7 @@ void BattlegroundBE::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killer player not found");
return;
}
@@ -105,30 +105,20 @@ bool BattlegroundBE::HandlePlayerUnderMap(Player* player)
return true;
}
-void BattlegroundBE::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundBE::HandleAreaTrigger(Player* player, uint32 trigger)
{
- // this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- //uint32 SpellId = 0;
- //uint64 buff_guid = 0;
- switch (Trigger)
+ switch (trigger)
{
case 4538: // buff trigger?
- //buff_guid = BgObjects[BG_BE_OBJECT_BUFF_1];
- break;
case 4539: // buff trigger?
- //buff_guid = BgObjects[BG_BE_OBJECT_BUFF_2];
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
-
- //if (buff_guid)
- // HandleTriggerBuff(buff_guid, Source);
}
void BattlegroundBE::FillInitialWorldStates(WorldPacket &data)
@@ -154,7 +144,7 @@ bool BattlegroundBE::SetupBattleground()
|| !AddObject(BG_BE_OBJECT_BUFF_1, BG_BE_OBJECT_TYPE_BUFF_1, 6249.042f, 275.3239f, 11.22033f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|| !AddObject(BG_BE_OBJECT_BUFF_2, BG_BE_OBJECT_TYPE_BUFF_2, 6228.26f, 249.566f, 11.21812f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
{
- sLog->outErrorDb("BatteGroundBE: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundBE: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
index ccc6a2305b4..be947458964 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
@@ -171,7 +171,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("BattlegroundDS: Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundDS: Killer player not found");
return;
}
@@ -181,18 +181,18 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
CheckArenaWinConditions();
}
-void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundDS::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- switch (Trigger)
+ switch (trigger)
{
case 5347:
case 5348:
// Remove effects of Demonic Circle Summon
- if (Source->HasAura(48018))
- Source->RemoveAurasDueToSpell(48018);
+ if (player->HasAura(48018))
+ player->RemoveAurasDueToSpell(48018);
// Someone has get back into the pipes and the knockback has already been performed,
// so we reset the knockback count for kicking the player again into the arena.
@@ -200,8 +200,7 @@ void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger)
setPipeKnockBackCount(0);
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
}
@@ -240,7 +239,7 @@ bool BattlegroundDS::SetupBattleground()
|| !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_1, 0, 1369.977f, 817.2882f, 16.08718f, 3.106686f, RESPAWN_IMMEDIATELY)
|| !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_2, 0, 1212.833f, 765.3871f, 16.09484f, 0.0f, RESPAWN_IMMEDIATELY))
{
- sLog->outErrorDb("BatteGroundDS: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundDS: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
index aaf08ba1313..d9e60079bf6 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
@@ -52,14 +52,14 @@ enum BattlegroundDSCreatureTypes
enum BattlegroundDSCreatures
{
- BG_DS_NPC_TYPE_WATER_SPOUT = 28567,
+ BG_DS_NPC_TYPE_WATER_SPOUT = 28567
};
enum BattlegroundDSSpells
{
BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe
BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not need to be casted)
- BG_DS_SPELL_WATER_SPOUT = 58873, // Knockback effect of the central waterfall
+ BG_DS_SPELL_WATER_SPOUT = 58873 // Knockback effect of the central waterfall
};
enum BattlegroundDSData
@@ -76,7 +76,7 @@ enum BattlegroundDSData
BG_DS_WATERFALL_STATUS_WARNING = 1, // Water starting to fall, but no LoS Blocking nor movement blocking
BG_DS_WATERFALL_STATUS_ON = 2, // LoS and Movement blocking active
- BG_DS_WATERFALL_STATUS_OFF = 3,
+ BG_DS_WATERFALL_STATUS_OFF = 3
};
class BattlegroundDSScore : public BattlegroundScore
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index 8269a04a383..bad56a95cfb 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -153,7 +153,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
if (!player)
{
- sLog->outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
++j;
continue;
}
@@ -193,7 +193,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
if (!player)
{
- sLog->outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
@@ -368,35 +368,35 @@ void BattlegroundEY::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
}
}
-void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundEY::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- if (!Source->isAlive()) //hack code, must be removed later
+ if (!player->isAlive()) //hack code, must be removed later
return;
- switch (Trigger)
+ switch (trigger)
{
case TR_BLOOD_ELF_POINT:
- if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
- if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
- EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_BLOOD_ELF);
+ if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == player->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
+ EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_BLOOD_ELF);
break;
case TR_FEL_REAVER_POINT:
- if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == Source->GetTeam())
- if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
- EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_FEL_REAVER);
+ if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == player->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
+ EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER);
break;
case TR_MAGE_TOWER_POINT:
- if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
- if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
- EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_MAGE_TOWER);
+ if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == player->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
+ EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
- if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
- if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
- EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
+ if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == player->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
+ EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
break;
case 4512:
case 4515:
@@ -411,8 +411,7 @@ void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 5866:
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
}
@@ -474,7 +473,7 @@ bool BattlegroundEY::SetupBattleground()
|| !AddObject(BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, 2282.121582f, 1760.006958f, 1189.707153f, 1.919862f, 0, 0, 0.819152f, 0.573576f, RESPAWN_ONE_DAY)
)
{
- sLog->outErrorDb("BatteGroundEY: Failed to spawn some object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundEY: Failed to spawn some object Battleground not created!");
return false;
}
@@ -484,28 +483,28 @@ bool BattlegroundEY::SetupBattleground()
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
if (!at)
{
- sLog->outError("BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
continue;
}
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
)
- sLog->outError("BattlegroundEY: Cannot spawn buff");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Cannot spawn buff");
}
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
- sLog->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
{
- sLog->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
return false;
}
@@ -570,7 +569,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
if (obj)
obj->Delete();
else
- sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID()));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID()));
SetDroppedFlagGUID(0);
}
@@ -742,7 +741,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point)
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
- sLog->outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
// SpawnBGCreature(Point, RESPAWN_IMMEDIATELY);
@@ -816,7 +815,7 @@ void BattlegroundEY::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
{
case SCORE_FLAG_CAPTURES: // flags captured
((BattlegroundEYScore*)itr->second)->FlagCaptures += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG);
break;
default:
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
@@ -894,7 +893,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
if (!entry)
{
- sLog->outError("BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
return NULL;
}
@@ -911,7 +910,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
{
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
if (!entry)
- sLog->outError("BattlegroundEY: Not found graveyard: %u", m_CapturingPointTypes[i].GraveYardId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Not found graveyard: %u", m_CapturingPointTypes[i].GraveYardId);
else
{
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
index 534a40484ce..c7ee4c62504 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
@@ -26,7 +26,7 @@ class Battleground;
enum BG_EY_Misc
{
BG_EY_FLAG_RESPAWN_TIME = (8*IN_MILLISECONDS),
- BG_EY_FPOINTS_TICK_TIME = (2*IN_MILLISECONDS),
+ BG_EY_FPOINTS_TICK_TIME = (2*IN_MILLISECONDS)
};
enum BG_EY_WorldStates
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index ccc9493e234..90571dfb758 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -57,7 +57,8 @@ BattlegroundIC::BattlegroundIC()
BattlegroundIC::~BattlegroundIC()
{
-
+ delete gunshipHorde;
+ delete gunshipAlliance;
}
void BattlegroundIC::HandlePlayerResurrect(Player* player)
@@ -275,7 +276,7 @@ void BattlegroundIC::StartingEventOpenDoors()
BG_IC_Teleporters[i].x, BG_IC_Teleporters[i].y,
BG_IC_Teleporters[i].z, BG_IC_Teleporters[i].o,
0, 0, 0, 0, RESPAWN_ONE_DAY))
- sLog->outError("Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
}
}
@@ -372,7 +373,7 @@ bool BattlegroundIC::SetupBattleground()
BG_IC_ObjSpawnlocs[i].z, BG_IC_ObjSpawnlocs[i].o,
0, 0, 0, 0, RESPAWN_ONE_DAY))
{
- sLog->outError("Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry);
return false;
}
}
@@ -384,7 +385,7 @@ bool BattlegroundIC::SetupBattleground()
BG_IC_NpcSpawnlocs[i].z, BG_IC_NpcSpawnlocs[i].o,
RESPAWN_ONE_DAY))
{
- sLog->outError("Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry);
return false;
}
}
@@ -394,7 +395,7 @@ bool BattlegroundIC::SetupBattleground()
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+3, BG_IC_SpiritGuidePos[7][0], BG_IC_SpiritGuidePos[7][1], BG_IC_SpiritGuidePos[7][2], BG_IC_SpiritGuidePos[7][3], ALLIANCE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+4, BG_IC_SpiritGuidePos[8][0], BG_IC_SpiritGuidePos[8][1], BG_IC_SpiritGuidePos[8][2], BG_IC_SpiritGuidePos[8][3], HORDE))
{
- sLog->outError("Isle of Conquest: Failed to spawn initial spirit guide!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: Failed to spawn initial spirit guide!");
return false;
}
@@ -403,7 +404,7 @@ bool BattlegroundIC::SetupBattleground()
if (!gunshipAlliance || !gunshipHorde)
{
- sLog->outError("Isle of Conquest: There was an error creating gunships!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error creating gunships!");
return false;
}
@@ -615,7 +616,7 @@ uint32 BattlegroundIC::GetNextBanner(ICNodePoint* nodePoint, uint32 team, bool r
return nodePoint->last_entry;
// we should never be here...
- sLog->outError("Isle Of Conquest: Unexpected return in GetNextBanner function");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle Of Conquest: Unexpected return in GetNextBanner function");
return 0;
}
@@ -639,7 +640,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
BG_IC_SpiritGuidePos[nodePoint->nodeType][0], BG_IC_SpiritGuidePos[nodePoint->nodeType][1],
BG_IC_SpiritGuidePos[nodePoint->nodeType][2], BG_IC_SpiritGuidePos[nodePoint->nodeType][3],
(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)))
- sLog->outError("Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", nodePoint->nodeType, nodePoint->faction);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", nodePoint->nodeType, nodePoint->faction);
}
switch (nodePoint->gameobject_type)
@@ -658,7 +659,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
0, 0, 0, 0, RESPAWN_ONE_DAY);
}
- //sLog->outError("BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
+ //sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
(nodePoint->faction == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->BuildStartMovePacket(GetBgMap());
(nodePoint->faction == TEAM_ALLIANCE ? gunshipHorde : gunshipAlliance)->BuildStopMovePacket(GetBgMap());
@@ -908,7 +909,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
if (!goinfo)
{
- sLog->outErrorDb("Transport ID: %u will not be loaded, gameobject_template missing", goEntry);
+ sLog->outError(LOG_FILTER_SQL, "Transport ID: %u will not be loaded, gameobject_template missing", goEntry);
delete t;
return NULL;
}
@@ -918,7 +919,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
- sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
+ sLog->outError(LOG_FILTER_SQL, "Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
delete t;
return NULL;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
index 90f39a61e12..20f44acc14f 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
@@ -178,7 +178,7 @@ enum gameobjectsIC
GO_HORDE_BANNER_GRAVEYARD_H_CONT = 195394,
GO_HORDE_GUNSHIP = 195276,
- GO_ALLIANCE_GUNSHIP = 195121,
+ GO_ALLIANCE_GUNSHIP = 195121
};
#define MAX_REINFORCEMENTS 300
@@ -336,7 +336,7 @@ enum BG_IC_GOs
BG_IC_GO_TELEPORTER_EFFECTS_H_3,
BG_IC_GO_TELEPORTER_EFFECTS_H_4,
BG_IC_GO_TELEPORTER_EFFECTS_H_5,
- BG_IC_GO_TELEPORTER_EFFECTS_H_6,
+ BG_IC_GO_TELEPORTER_EFFECTS_H_6
};
enum BG_IC_NPCs
@@ -411,7 +411,7 @@ enum BG_IC_NPCs
BG_IC_NPC_SPIRIT_GUIDE_4,
BG_IC_NPC_SPIRIT_GUIDE_5,
BG_IC_NPC_SPIRIT_GUIDE_6,
- BG_IC_NPC_SPIRIT_GUIDE_7,
+ BG_IC_NPC_SPIRIT_GUIDE_7
};
enum BannersTypes
@@ -751,7 +751,7 @@ enum ICDoorList
BG_IC_A_FRONT,
BG_IC_A_WEST,
BG_IC_A_EAST,
- BG_IC_MAXDOOR,
+ BG_IC_MAXDOOR
};
enum ICNodePointType
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
index 0974c96a991..6c45d4a8873 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
@@ -86,7 +86,7 @@ void BattlegroundNA::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("BattlegroundNA: Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundNA: Killer player not found");
return;
}
@@ -102,26 +102,20 @@ bool BattlegroundNA::HandlePlayerUnderMap(Player* player)
return true;
}
-void BattlegroundNA::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- //uint32 SpellId = 0;
- //uint64 buff_guid = 0;
- switch (Trigger)
+ switch (trigger)
{
case 4536: // buff trigger?
case 4537: // buff trigger?
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
-
- //if (buff_guid)
- // HandleTriggerBuff(buff_guid, Source);
}
void BattlegroundNA::FillInitialWorldStates(WorldPacket &data)
@@ -147,7 +141,7 @@ bool BattlegroundNA::SetupBattleground()
|| !AddObject(BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_TYPE_BUFF_1, 4009.189941f, 2895.250000f, 13.052700f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|| !AddObject(BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_TYPE_BUFF_2, 4103.330078f, 2946.350098f, 13.051300f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
{
- sLog->outErrorDb("BatteGroundNA: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundNA: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
index 6a626217a4e..3dd4fb32da4 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
@@ -86,7 +86,7 @@ void BattlegroundRL::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killer player not found");
return;
}
@@ -102,27 +102,20 @@ bool BattlegroundRL::HandlePlayerUnderMap(Player* player)
return true;
}
-void BattlegroundRL::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundRL::HandleAreaTrigger(Player* player, uint32 trigger)
{
- // this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- //uint32 SpellId = 0;
- //uint64 buff_guid = 0;
- switch (Trigger)
+ switch (trigger)
{
case 4696: // buff trigger?
case 4697: // buff trigger?
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
-
- //if (buff_guid)
- // HandleTriggerBuff(buff_guid, Source);
}
void BattlegroundRL::FillInitialWorldStates(WorldPacket &data)
@@ -146,7 +139,7 @@ bool BattlegroundRL::SetupBattleground()
|| !AddObject(BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_1, 1328.719971f, 1632.719971f, 36.730400f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|| !AddObject(BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_TYPE_BUFF_2, 1243.300049f, 1699.170044f, 34.872601f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
{
- sLog->outErrorDb("BatteGroundRL: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundRL: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
index 6869a899305..2cc48648022 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
@@ -130,7 +130,7 @@ void BattlegroundRV::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("BattlegroundRV: Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundRV: Killer player not found");
return;
}
@@ -148,12 +148,12 @@ bool BattlegroundRV::HandlePlayerUnderMap(Player* player)
return true;
}
-void BattlegroundRV::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundRV::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
- switch (Trigger)
+ switch (trigger)
{
case 5224:
case 5226:
@@ -162,8 +162,7 @@ void BattlegroundRV::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 5474:
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
}
@@ -214,7 +213,7 @@ bool BattlegroundRV::SetupBattleground()
)
{
- sLog->outErrorDb("BatteGroundRV: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundRV: Failed to spawn some object!");
return false;
}
return true;
@@ -245,6 +244,6 @@ void BattlegroundRV::TogglePillarCollision()
gob->SendUpdateToPlayer(player);
}
}
-
+
SetPillarCollision(!apply);
-} \ No newline at end of file
+}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
index 8c5746931e3..d8ac082ec19 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
@@ -46,7 +46,7 @@ enum BattlegroundRVObjectTypes
BG_RV_OBJECT_ELEVATOR_1,
BG_RV_OBJECT_ELEVATOR_2,
- BG_RV_OBJECT_MAX,
+ BG_RV_OBJECT_MAX
};
enum BattlegroundRVObjects
@@ -73,7 +73,7 @@ enum BattlegroundRVObjects
BG_RV_OBJECT_TYPE_PILAR_1 = 194583, // axe
BG_RV_OBJECT_TYPE_PILAR_2 = 194584, // arena
BG_RV_OBJECT_TYPE_PILAR_3 = 194585, // lightning
- BG_RV_OBJECT_TYPE_PILAR_4 = 194587, // ivory
+ BG_RV_OBJECT_TYPE_PILAR_4 = 194587 // ivory
};
enum BattlegroundRVData
@@ -88,7 +88,7 @@ enum BattlegroundRVData
BG_RV_FIRST_TIMER = 20133,
BG_RV_WORLD_STATE_A = 0xe10,
BG_RV_WORLD_STATE_H = 0xe11,
- BG_RV_WORLD_STATE = 0xe1a,
+ BG_RV_WORLD_STATE = 0xe1a
};
class BattlegroundRVScore : public BattlegroundScore
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 133a0aec560..58f7cabc72d 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -56,6 +56,8 @@ void BattlegroundSA::Reset()
GateStatus[i] = BG_SA_GATE_OK;
ShipsStarted = false;
gateDestroyed = false;
+ _notEvenAScratch[BG_TEAM_ALLIANCE] = true;
+ _notEvenAScratch[BG_TEAM_HORDE] = true;
Status = BG_SA_WARMUP;
}
@@ -160,7 +162,7 @@ bool BattlegroundSA::ResetObjs()
if (!sg)
{
- sLog->outError("SOTA: Can't find GY entry %u", BG_SA_GYEntries[i]);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "SOTA: Can't find GY entry %u", BG_SA_GYEntries[i]);
return false;
}
@@ -173,7 +175,7 @@ bool BattlegroundSA::ResetObjs()
{
GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE);
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((Attackers == TEAM_HORDE)? ALLIANCE : HORDE)))
- sLog->outError("SOTA: couldn't spawn GY: %u", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "SOTA: couldn't spawn GY: %u", i);
}
}
@@ -553,13 +555,13 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui
SendWarningToAll(LANG_BG_SA_IS_UNDER_ATTACK, go->GetGOInfo()->name.c_str());
}
-void BattlegroundSA::HandleKillUnit(Creature* unit, Player* killer)
+void BattlegroundSA::HandleKillUnit(Creature* creature, Player* killer)
{
- if (!unit)
- return;
-
- if (unit->GetEntry() == NPC_DEMOLISHER_SA)
+ if (creature->GetEntry() == NPC_DEMOLISHER_SA)
+ {
UpdatePlayerScore(killer, SCORE_DESTROYED_DEMOLISHER, 1);
+ _notEvenAScratch[Attackers] = false;
+ }
}
/*
@@ -723,7 +725,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
if (!sg)
{
- sLog->outError("BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]);
return;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
index c18806490f2..78653a993a0 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
@@ -104,7 +104,7 @@ enum BG_SA_WorldStates
BG_SA_LEFT_GY_HORDE = 3633,
BG_SA_CENTER_GY_HORDE = 3634,
BG_SA_BONUS_TIMER = 0xdf3,
- BG_SA_ENABLE_TIMER = 3564,
+ BG_SA_ENABLE_TIMER = 3564
};
enum npc
@@ -112,7 +112,7 @@ enum npc
NPC_ANTI_PERSONNAL_CANNON = 27894,
NPC_DEMOLISHER_SA = 28781,
NPC_RIGGER_SPARKLIGHT = 29260,
- NPC_GORGRIL_RIGSPARK = 29262,
+ NPC_GORGRIL_RIGSPARK = 29262
};
enum BG_SA_NPCs
@@ -146,7 +146,7 @@ enum BG_SA_Boat
BG_SA_BOAT_ONE_A = 193182,
BG_SA_BOAT_TWO_H = 193183,
BG_SA_BOAT_ONE_H = 193184,
- BG_SA_BOAT_TWO_A = 193185,
+ BG_SA_BOAT_TWO_A = 193185
};
uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] =
@@ -456,7 +456,7 @@ class BattlegroundSA : public Battleground
/// Called when a player deal damage to building (door)
virtual void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType);
/// Called when a player kill a unit in bg
- virtual void HandleKillUnit(Creature* unit, Player* killer);
+ virtual void HandleKillUnit(Creature* creature, Player* killer);
/// Return the nearest graveyard where player can respawn
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
/// Called when a player click on flag (graveyard flag)
@@ -531,9 +531,12 @@ class BattlegroundSA : public Battleground
/// Update score board
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
- // Achievement Defense of the Ancients
+ // Achievement: Defense of the Ancients
bool gateDestroyed;
+ // Achievement: Not Even a Scratch
+ bool notEvenAScratch(uint32 team) const { return _notEvenAScratch[GetTeamIndexByTeamId(team)]; }
+
/// Id of attacker team
TeamId Attackers;
@@ -615,5 +618,7 @@ class BattlegroundSA : public Battleground
bool InitSecondRound;
std::map<uint32/*id*/, uint32/*timer*/> DemoliserRespawnList;
+ // Achievement: Not Even a Scratch
+ bool _notEvenAScratch[BG_TEAMS_COUNT];
};
#endif
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
index d100dc645a2..a50553d2fa3 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -52,6 +52,8 @@ BattlegroundWS::BattlegroundWS()
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
+ _flagSpellForceTimer = 0;
+ _bothFlagsKept = false;
_flagDebuffState = 0;
}
@@ -251,7 +253,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
if (GameObject* obj = GetBgMap()->GetGameObject(GetDroppedFlagGUID(team)))
obj->Delete();
else
- sLog->outError("unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
SetDroppedFlagGUID(0, team);
_bothFlagsKept = false;
@@ -451,7 +453,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER);
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1);
Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true);
- Source->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_SILVERWING_FLAG_PICKED);
+ Source->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_SILVERWING_FLAG_PICKED);
if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER)
_bothFlagsKept = true;
}
@@ -470,7 +472,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1);
Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true);
- Source->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_WARSONG_FLAG_PICKED);
+ Source->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_WARSONG_FLAG_PICKED);
if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER)
_bothFlagsKept = true;
}
@@ -557,7 +559,7 @@ void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
{
if (!player)
{
- sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundWS: Removing offline player who has the FLAG!!");
this->SetAllianceFlagPicker(0);
this->RespawnFlag(ALLIANCE, false);
}
@@ -568,7 +570,7 @@ void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
{
if (!player)
{
- sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundWS: Removing offline player who has the FLAG!!");
this->SetHordeFlagPicker(0);
this->RespawnFlag(HORDE, false);
}
@@ -593,15 +595,14 @@ void BattlegroundWS::UpdateTeamScore(uint32 team)
UpdateWorldState(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(team));
}
-void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
+void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger)
{
- // this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
//uint64 buff_guid = 0;
- switch (Trigger)
+ switch (trigger)
{
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
@@ -623,13 +624,13 @@ void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
break;
case 3646: // Alliance Flag spawn
if (_flagState[BG_TEAM_HORDE] && !_flagState[BG_TEAM_ALLIANCE])
- if (GetFlagPickerGUID(BG_TEAM_HORDE) == Source->GetGUID())
- EventPlayerCapturedFlag(Source);
+ if (GetFlagPickerGUID(BG_TEAM_HORDE) == player->GetGUID())
+ EventPlayerCapturedFlag(player);
break;
case 3647: // Horde Flag spawn
if (_flagState[BG_TEAM_ALLIANCE] && !_flagState[BG_TEAM_HORDE])
- if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
- EventPlayerCapturedFlag(Source);
+ if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == player->GetGUID())
+ EventPlayerCapturedFlag(player);
break;
case 3649: // unk1
case 3688: // unk2
@@ -637,8 +638,7 @@ void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 4629: // unk4
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
- Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ Battleground::HandleAreaTrigger(player, trigger);
break;
}
@@ -672,21 +672,21 @@ bool BattlegroundWS::SetupBattleground()
|| !AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY)
)
{
- sLog->outErrorDb("BatteGroundWS: Failed to spawn some object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundWS: Failed to spawn some object Battleground not created!");
return false;
}
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
- sLog->outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
{
- sLog->outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
return false;
}
@@ -700,28 +700,39 @@ void BattlegroundWS::Reset()
//call parent's class reset
Battleground::Reset();
- m_FlagKeepers[BG_TEAM_ALLIANCE] = 0;
- m_FlagKeepers[BG_TEAM_HORDE] = 0;
+ m_FlagKeepers[BG_TEAM_ALLIANCE] = 0;
+ m_FlagKeepers[BG_TEAM_HORDE] = 0;
+
m_DroppedFlagGUID[BG_TEAM_ALLIANCE] = 0;
- m_DroppedFlagGUID[BG_TEAM_HORDE] = 0;
- _flagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
- _flagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
- m_TeamScores[BG_TEAM_ALLIANCE] = 0;
- m_TeamScores[BG_TEAM_HORDE] = 0;
- bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID());
- m_ReputationCapture = (isBGWeekend) ? 45 : 35;
- m_HonorWinKills = (isBGWeekend) ? 3 : 1;
- m_HonorEndKills = (isBGWeekend) ? 4 : 2;
- // For WorldState
- _minutesElapsed = 0;
- _lastFlagCaptureTeam = 0;
-
- /* Spirit nodes is static at this BG and then not required deleting at BG reset.
- if (BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])
- DelCreature(WS_SPIRIT_MAIN_ALLIANCE);
- if (BgCreatures[WS_SPIRIT_MAIN_HORDE])
- DelCreature(WS_SPIRIT_MAIN_HORDE);
- */
+ m_DroppedFlagGUID[BG_TEAM_HORDE] = 0;
+
+ _flagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
+ _flagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
+
+ m_TeamScores[BG_TEAM_ALLIANCE] = 0;
+ m_TeamScores[BG_TEAM_HORDE] = 0;
+
+ if (sBattlegroundMgr->IsBGWeekend(GetTypeID()))
+ {
+ m_ReputationCapture = 45;
+ m_HonorWinKills = 3;
+ m_HonorEndKills = 4;
+ }
+ else
+ {
+ m_ReputationCapture = 35;
+ m_HonorWinKills = 1;
+ m_HonorEndKills = 2;
+ }
+ _minutesElapsed = 0;
+ _lastFlagCaptureTeam = 0;
+ _bothFlagsKept = false;
+ _flagDebuffState = 0;
+ _flagSpellForceTimer = 0;
+ _flagsDropTimer[BG_TEAM_ALLIANCE] = 0;
+ _flagsDropTimer[BG_TEAM_HORDE] = 0;
+ _flagsTimer[BG_TEAM_ALLIANCE] = 0;
+ _flagsTimer[BG_TEAM_HORDE] = 0;
}
void BattlegroundWS::EndBattleground(uint32 winner)
@@ -759,11 +770,11 @@ void BattlegroundWS::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
{
case SCORE_FLAG_CAPTURES: // flags captured
((BattlegroundWGScore*)itr->second)->FlagCaptures += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG);
break;
case SCORE_FLAG_RETURNS: // flags returned
((BattlegroundWGScore*)itr->second)->FlagReturns += value;
- Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG);
+ Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG);
break;
default:
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt
index 8b81a48c33b..68ae2d8ea38 100644
--- a/src/server/game/CMakeLists.txt
+++ b/src/server/game/CMakeLists.txt
@@ -17,6 +17,7 @@ file(GLOB_RECURSE sources_Achievements Achievements/*.cpp Achievements/*.h)
file(GLOB_RECURSE sources_Addons Addons/*.cpp Addons/*.h)
file(GLOB_RECURSE sources_AI AI/*.cpp AI/*.h)
file(GLOB_RECURSE sources_AuctionHouse AuctionHouse/*.cpp AuctionHouse/*.h)
+file(GLOB_RECURSE sources_Battlefield Battlefield/*.cpp Battlefield/*.h)
file(GLOB_RECURSE sources_Battlegrounds Battlegrounds/*.cpp Battlegrounds/*.h)
file(GLOB_RECURSE sources_Calendar Calendar/*.cpp Calendar/*.h)
file(GLOB_RECURSE sources_Chat Chat/*.cpp Chat/*.h)
@@ -68,6 +69,7 @@ set(game_STAT_SRCS
${sources_Addons}
${sources_AI}
${sources_AuctionHouse}
+ ${sources_Battlefield}
${sources_Battlegrounds}
${sources_Calendar}
${sources_Chat}
@@ -136,12 +138,13 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/AI/ScriptedAI
${CMAKE_CURRENT_SOURCE_DIR}/AI/SmartScripts
${CMAKE_CURRENT_SOURCE_DIR}/AuctionHouse
+ ${CMAKE_CURRENT_SOURCE_DIR}/Battlefield
+ ${CMAKE_CURRENT_SOURCE_DIR}/Battlefield/Zones
${CMAKE_CURRENT_SOURCE_DIR}/Battlegrounds
${CMAKE_CURRENT_SOURCE_DIR}/Battlegrounds/Zones
${CMAKE_CURRENT_SOURCE_DIR}/Calendar
${CMAKE_CURRENT_SOURCE_DIR}/Chat
${CMAKE_CURRENT_SOURCE_DIR}/Chat/Channels
- ${CMAKE_CURRENT_SOURCE_DIR}/Chat/Commands
${CMAKE_CURRENT_SOURCE_DIR}/Combat
${CMAKE_CURRENT_SOURCE_DIR}/Conditions
${CMAKE_CURRENT_SOURCE_DIR}/DataStores
diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp
index 62bc0ab3205..80de42c0ce2 100644
--- a/src/server/game/Calendar/CalendarMgr.cpp
+++ b/src/server/game/Calendar/CalendarMgr.cpp
@@ -99,7 +99,7 @@ CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId)
if (itr != _invites.end())
return &(itr->second);
- sLog->outError("CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId);
return NULL;
}
@@ -109,7 +109,7 @@ CalendarEvent* CalendarMgr::GetEvent(uint64 eventId)
if (itr != _events.end())
return &(itr->second);
- sLog->outError("CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId);
return NULL;
}
@@ -149,7 +149,7 @@ void CalendarMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u calendar events", count);
+ sLog->outInfo(LOG_FILTER_CALENDAR, ">> Loaded %u calendar events", count);
count = 0;
// 0 1 2 3 4 5 6 7
@@ -176,7 +176,7 @@ void CalendarMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u calendar Invites", count);
+ sLog->outInfo(LOG_FILTER_CALENDAR, ">> Loaded %u calendar Invites", count);
*/
}
@@ -442,7 +442,7 @@ bool CalendarMgr::AddEvent(CalendarEvent const& newEvent)
uint64 eventId = newEvent.GetEventId();
if (_events.find(eventId) != _events.end())
{
- sLog->outError("CalendarMgr::AddEvent: Event [" UI64FMTD "] exists", eventId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::AddEvent: Event [" UI64FMTD "] exists", eventId);
return false;
}
@@ -455,7 +455,7 @@ bool CalendarMgr::RemoveEvent(uint64 eventId)
CalendarEventMap::iterator itr = _events.find(eventId);
if (itr == _events.end())
{
- sLog->outError("CalendarMgr::RemoveEvent: Event [" UI64FMTD "] does not exist", eventId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::RemoveEvent: Event [" UI64FMTD "] does not exist", eventId);
return false;
}
@@ -494,13 +494,13 @@ bool CalendarMgr::AddInvite(CalendarInvite const& newInvite)
uint64 inviteId = newInvite.GetInviteId();
if (!inviteId)
{
- sLog->outError("CalendarMgr::AddInvite: Cant add Invite 0");
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::AddInvite: Cant add Invite 0");
return false;
}
if (_invites.find(inviteId) != _invites.end())
{
- sLog->outError("CalendarMgr::AddInvite: Invite [" UI64FMTD "] exists", inviteId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::AddInvite: Invite [" UI64FMTD "] exists", inviteId);
return false;
}
@@ -516,7 +516,7 @@ uint64 CalendarMgr::RemoveInvite(uint64 inviteId)
CalendarInviteMap::iterator itr = _invites.find(inviteId);
if (itr == _invites.end())
{
- sLog->outError("CalendarMgr::RemoveInvite: Invite [" UI64FMTD "] does not exist", inviteId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::RemoveInvite: Invite [" UI64FMTD "] does not exist", inviteId);
return 0;
}
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 0e89601e987..c3845f16826 100755
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -36,13 +36,13 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
m_flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
- if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
+ if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
m_flags |= CHANNEL_FLAG_TRADE;
- if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
+ if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
m_flags |= CHANNEL_FLAG_CITY;
- if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
+ if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
m_flags |= CHANNEL_FLAG_LFG;
else // for all other channels
m_flags |= CHANNEL_FLAG_NOT_LFG;
diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h
index 9564dbb381e..04bb4ae2916 100755
--- a/src/server/game/Chat/Channels/Channel.h
+++ b/src/server/game/Chat/Channels/Channel.h
@@ -68,7 +68,7 @@ enum ChatNotify
CHAT_NOT_IN_AREA_NOTICE = 0x20, //+ "[%s] You are not in the correct area for this channel."; -- The user is trying to send a chat to a zone specific channel, and they're not physically in that zone.
CHAT_NOT_IN_LFG_NOTICE = 0x21, //+ "[%s] You must be queued in looking for group before joining this channel."; -- The user must be in the looking for group system to join LFG chat channels.
CHAT_VOICE_ON_NOTICE = 0x22, //+ "[%s] Channel voice enabled by %s.";
- CHAT_VOICE_OFF_NOTICE = 0x23, //+ "[%s] Channel voice disabled by %s.";
+ CHAT_VOICE_OFF_NOTICE = 0x23 //+ "[%s] Channel voice disabled by %s.";
};
enum ChannelFlags
@@ -101,7 +101,7 @@ enum ChannelDBCFlags
CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense
CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment
CHANNEL_DBC_FLAG_LFG = 0x40000, // LFG
- CHANNEL_DBC_FLAG_UNK1 = 0x80000, // General
+ CHANNEL_DBC_FLAG_UNK1 = 0x80000 // General
};
enum ChannelMemberFlags
@@ -112,7 +112,7 @@ enum ChannelMemberFlags
MEMBER_FLAG_VOICED = 0x04,
MEMBER_FLAG_MUTED = 0x08,
MEMBER_FLAG_CUSTOM = 0x10,
- MEMBER_FLAG_MIC_MUTED = 0x20,
+ MEMBER_FLAG_MIC_MUTED = 0x20
// 0x40
// 0x80
};
diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h
index ac030ffb73f..887e53f49a5 100755
--- a/src/server/game/Chat/Channels/ChannelMgr.h
+++ b/src/server/game/Chat/Channels/ChannelMgr.h
@@ -49,4 +49,3 @@ class HordeChannelMgr : public ChannelMgr {};
ChannelMgr* channelMgr(uint32 team);
#endif
-
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index cc64a8e22dd..b5bad419c98 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -38,13 +38,6 @@
bool ChatHandler::load_command_table = true;
-// wrapper for old-style handlers
-template<bool (ChatHandler::*F)(const char*)>
-bool OldHandler(ChatHandler* chatHandler, const char* args)
-{
- return (chatHandler->*F)(args);
-}
-
// get number of commands in table
static size_t getCommandTableSize(const ChatCommand* commands)
{
@@ -67,355 +60,6 @@ static size_t appendCommandTable(ChatCommand* target, const ChatCommand* source)
ChatCommand* ChatHandler::getCommandTable()
{
- static ChatCommand banCommandTable[] =
- {
- { "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanAccountCommand>, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanCharacterCommand>, "", NULL },
- { "playeraccount", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanAccountByCharCommand>, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanIPCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand baninfoCommandTable[] =
- {
- { "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanInfoAccountCommand>, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanInfoCharacterCommand>, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanInfoIPCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand banlistCommandTable[] =
- {
- { "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanListAccountCommand>, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanListCharacterCommand>, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleBanListIPCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand castCommandTable[] =
- {
- { "back", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastBackCommand>, "", NULL },
- { "dist", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDistCommand>, "", NULL },
- { "self", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastSelfCommand>, "", NULL },
- { "target", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastTargetCommand>, "", NULL },
- { "dest", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDestCommand>, "", NULL },
- { "", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand characterDeletedCommandTable[] =
- {
- { "delete", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedDeleteCommand>, "", NULL },
- { "list", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedListCommand>, "", NULL },
- { "restore", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedRestoreCommand>, "", NULL },
- { "old", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedOldCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand characterCommandTable[] =
- {
- { "customize", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterCustomizeCommand>, "", NULL },
- { "changefaction", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeFactionCommand>, "", NULL },
- { "changerace", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeRaceCommand>, "", NULL },
- { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable},
- { "erase", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterEraseCommand>, "", NULL },
- { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterLevelCommand>, "", NULL },
- { "rename", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterRenameCommand>, "", NULL },
- { "reputation", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterReputationCommand>, "", NULL },
- { "titles", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterTitlesCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand channelSetCommandTable[] =
- {
- { "ownership", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChannelSetOwnership>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand channelCommandTable[] =
- {
- { "set", SEC_ADMINISTRATOR, true, NULL, "", channelSetCommandTable },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand groupCommandTable[] =
- {
- { "leader", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupLeaderCommand>, "", NULL },
- { "disband", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupDisbandCommand>, "", NULL },
- { "remove", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupRemoveCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand guildCommandTable[] =
- {
- { "create", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGuildCreateCommand>, "", NULL },
- { "delete", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGuildDeleteCommand>, "", NULL },
- { "invite", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGuildInviteCommand>, "", NULL },
- { "uninvite", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGuildUninviteCommand>, "", NULL },
- { "rank", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGuildRankCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand instanceCommandTable[] =
- {
- { "listbinds", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceListBindsCommand>, "", NULL },
- { "unbind", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceUnbindCommand>, "", NULL },
- { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleInstanceStatsCommand>, "", NULL },
- { "savedata", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceSaveDataCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand listCommandTable[] =
- {
- { "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListCreatureCommand>, "", NULL },
- { "item", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListItemCommand>, "", NULL },
- { "object", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListObjectCommand>, "", NULL },
- { "auras", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleListAurasCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand lookupPlayerCommandTable[] =
- {
- { "ip", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupPlayerIpCommand>, "", NULL },
- { "account", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupPlayerAccountCommand>, "", NULL },
- { "email", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupPlayerEmailCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand lookupCommandTable[] =
- {
- { "area", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleLookupAreaCommand>, "", NULL },
- { "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupCreatureCommand>, "", NULL },
- { "event", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupEventCommand>, "", NULL },
- { "faction", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupFactionCommand>, "", NULL },
- { "item", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupItemCommand>, "", NULL },
- { "itemset", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupItemSetCommand>, "", NULL },
- { "object", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupObjectCommand>, "", NULL },
- { "quest", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupQuestCommand>, "", NULL },
- { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
- { "skill", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupSkillCommand>, "", NULL },
- { "spell", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupSpellCommand>, "", NULL },
- { "taxinode", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupTaxiNodeCommand>, "", NULL },
- { "tele", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleLookupTeleCommand>, "", NULL },
- { "title", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupTitleCommand>, "", NULL },
- { "map", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleLookupMapCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand petCommandTable[] =
- {
- { "create", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCreatePetCommand>, "", NULL },
- { "learn", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandlePetLearnCommand>, "", NULL },
- { "unlearn", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandlePetUnlearnCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand pdumpCommandTable[] =
- {
- { "load", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandlePDumpLoadCommand>, "", NULL },
- { "write", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandlePDumpWriteCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand resetCommandTable[] =
- {
- { "achievements", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetAchievementsCommand>, "", NULL },
- { "honor", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetHonorCommand>, "", NULL },
- { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetLevelCommand>, "", NULL },
- { "spells", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetSpellsCommand>, "", NULL },
- { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetStatsCommand>, "", NULL },
- { "talents", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetTalentsCommand>, "", NULL },
- { "all", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetAllCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand sendCommandTable[] =
- {
- { "items", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendItemsCommand>, "", NULL },
- { "mail", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleSendMailCommand>, "", NULL },
- { "message", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendMessageCommand>, "", NULL },
- { "money", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendMoneyCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverIdleRestartCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverIdleShutdownCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverRestartCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverShutdownCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverSetCommandTable[] =
- {
- { "difftime", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetDiffTimeCommand>, "", NULL },
- { "loglevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogLevelCommand>, "", NULL },
- { "logfilelevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogFileLevelCommand>, "", NULL },
- { "motd", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetMotdCommand>, "", NULL },
- { "closed", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetClosedCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverCommandTable[] =
- {
- { "corpses", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleServerCorpsesCommand>, "", NULL },
- { "exit", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerExitCommand>, "", NULL },
- { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
- { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
- { "info", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerInfoCommand>, "", NULL },
- { "motd", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerMotdCommand>, "", NULL },
- { "plimit", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerPLimitCommand>, "", NULL },
- { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
- { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
- { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
- { "togglequerylog", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerToggleQueryLogging>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand unbanCommandTable[] =
- {
- { "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanAccountCommand>, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanCharacterCommand>, "", NULL },
- { "playeraccount", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanAccountByCharCommand>, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanIPCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand ticketResponseCommandTable[] =
- {
- { "append", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketResponseAppendCommand>, "", NULL },
- { "appendln", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketResponseAppendLnCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand ticketCommandTable[] =
- {
- { "list", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketListCommand>, "", NULL },
- { "onlinelist", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketListOnlineCommand>, "", NULL },
- { "viewname", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketGetByNameCommand>, "", NULL },
- { "viewid", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketGetByIdCommand>, "", NULL },
- { "close", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketCloseByIdCommand>, "", NULL },
- { "closedlist", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketListClosedCommand>, "", NULL },
- { "escalatedlist", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGMTicketListEscalatedCommand>, "", NULL },
- { "delete", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleGMTicketDeleteByIdCommand>, "", NULL },
- { "reset", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleGMTicketResetCommand>, "", NULL },
- { "assign", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGMTicketAssignToCommand>, "", NULL },
- { "unassign", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGMTicketUnAssignCommand>, "", NULL },
- { "comment", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketCommentCommand>, "", NULL },
- { "togglesystem", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleToggleGMTicketSystem>, "", NULL },
- { "escalate", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketEscalateCommand>, "", NULL },
- { "response", SEC_MODERATOR, true, NULL, "", ticketResponseCommandTable },
- { "complete", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketCompleteCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand commandTable[] =
- {
- { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable},
- { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
- { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
- { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
- { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
- { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable },
- { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
- { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable },
- { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
- { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
-
- { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable },
-
- { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
- { "ticket", SEC_MODERATOR, false, NULL, "", ticketCommandTable },
-
- { "aura", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleAuraCommand>, "", NULL },
- { "unaura", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnAuraCommand>, "", NULL },
- { "nameannounce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleNameAnnounceCommand>, "", NULL },
- { "gmnameannounce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMNameAnnounceCommand>, "", NULL },
- { "announce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleAnnounceCommand>, "", NULL },
- { "gmannounce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMAnnounceCommand>, "", NULL },
- { "notify", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleNotifyCommand>, "", NULL },
- { "gmnotify", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMNotifyCommand>, "", NULL },
- { "appear", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleAppearCommand>, "", NULL },
- { "summon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleSummonCommand>, "", NULL },
- { "groupsummon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGroupSummonCommand>, "", NULL },
- { "commands", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleCommandsCommand>, "", NULL },
- { "die", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDieCommand>, "", NULL },
- { "revive", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleReviveCommand>, "", NULL },
- { "dismount", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleDismountCommand>, "", NULL },
- { "guid", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleGUIDCommand>, "", NULL },
- { "help", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleHelpCommand>, "", NULL },
- { "itemmove", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleItemMoveCommand>, "", NULL },
- { "cooldown", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCooldownCommand>, "", NULL },
- { "unlearn", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnLearnCommand>, "", NULL },
- { "distance", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGetDistanceCommand>, "", NULL },
- { "recall", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleRecallCommand>, "", NULL },
- { "save", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleSaveCommand>, "", NULL },
- { "saveall", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleSaveAllCommand>, "", NULL },
- { "kick", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleKickPlayerCommand>, "", NULL },
- { "ban", SEC_ADMINISTRATOR, true, NULL, "", banCommandTable },
- { "unban", SEC_ADMINISTRATOR, true, NULL, "", unbanCommandTable },
- { "baninfo", SEC_ADMINISTRATOR, false, NULL, "", baninfoCommandTable },
- { "banlist", SEC_ADMINISTRATOR, true, NULL, "", banlistCommandTable },
- { "start", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleStartCommand>, "", NULL },
- { "taxicheat", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleTaxiCheatCommand>, "", NULL },
- { "linkgrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLinkGraveCommand>, "", NULL },
- { "neargrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleNearGraveCommand>, "", NULL },
- { "explorecheat", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleExploreCheatCommand>, "", NULL },
- { "levelup", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLevelUpCommand>, "", NULL },
- { "showarea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleShowAreaCommand>, "", NULL },
- { "hidearea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleHideAreaCommand>, "", NULL },
- { "additem", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleAddItemCommand>, "", NULL },
- { "additemset", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleAddItemSetCommand>, "", NULL },
- { "bank", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleBankCommand>, "", NULL },
- { "wchange", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChangeWeather>, "", NULL },
- { "maxskill", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMaxSkillCommand>, "", NULL },
- { "setskill", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleSetSkillCommand>, "", NULL },
- { "whispers", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleWhispersCommand>, "", NULL },
- { "pinfo", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandlePInfoCommand>, "", NULL },
- { "respawn", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleRespawnCommand>, "", NULL },
- { "send", SEC_MODERATOR, true, NULL, "", sendCommandTable },
- { "mute", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleMuteCommand>, "", NULL },
- { "unmute", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleUnmuteCommand>, "", NULL },
- { "movegens", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMovegensCommand>, "", NULL },
- { "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL },
- { "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL },
- { "combatstop", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL },
- { "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL },
- { "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL },
- { "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL },
-
- { "freeze", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleFreezeCommand>, "", NULL },
- { "unfreeze", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleUnFreezeCommand>, "", NULL },
- { "listfreeze", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleListFreezeCommand>, "", NULL },
-
- { "possess", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandlePossessCommand>, "", NULL },
- { "unpossess", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnPossessCommand>, "", NULL },
- { "bindsight", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleBindSightCommand>, "", NULL },
- { "unbindsight", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnbindSightCommand>, "", NULL },
- { "playall", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandlePlayAllCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
// cache for commands, needed because some commands are loaded dynamically through ScriptMgr
// cache is never freed and will show as a memory leak in diagnostic tools
// can't use vector as vector storage is implementation-dependent, eg, there can be alignment gaps between elements
@@ -427,25 +71,23 @@ ChatCommand* ChatHandler::getCommandTable()
{
// count total number of top-level commands
- size_t total = getCommandTableSize(commandTable);
+ size_t total = 0;
std::vector<ChatCommand*> const& dynamic = sScriptMgr->GetChatCommands();
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
total += getCommandTableSize(*it);
total += 1; // ending zero
// cache top-level commands
+ size_t added = 0;
commandTableCache = (ChatCommand*)malloc(sizeof(ChatCommand) * total);
memset(commandTableCache, 0, sizeof(ChatCommand) * total);
ACE_ASSERT(commandTableCache);
- size_t added = appendCommandTable(commandTableCache, commandTable);
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
added += appendCommandTable(commandTableCache + added, *it);
}
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS);
-
PreparedQueryResult result = WorldDatabase.Query(stmt);
-
if (result)
{
do
@@ -455,7 +97,8 @@ ChatCommand* ChatHandler::getCommandTable()
SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt8(), fields[2].GetString(), name);
- } while (result->NextRow());
+ }
+ while (result->NextRow());
}
}
@@ -758,12 +401,12 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, const char* text,
// expected subcommand by full name DB content
else if (*text)
{
- sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
return false;
}
if (table[i].SecurityLevel != security)
- sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
table[i].SecurityLevel = security;
table[i].Help = help;
@@ -774,9 +417,9 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, const char* text,
if (!cmd.empty())
{
if (table == getCommandTable())
- sLog->outErrorDb("Table `command` have not existed command '%s', skip.", cmd.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Table `command` have not existed command '%s', skip.", cmd.c_str());
else
- sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
}
return false;
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index e88914a2daf..d4701b10ce1 100755
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -47,8 +47,8 @@ class ChatHandler
{
public:
WorldSession* GetSession() { return m_session; }
- explicit ChatHandler(WorldSession* session) : m_session(session) {}
- explicit ChatHandler(Player* player) : m_session(player->GetSession()) {}
+ explicit ChatHandler(WorldSession* session) : m_session(session), sentErrorMessage(false) {}
+ explicit ChatHandler(Player* player) : m_session(player->GetSession()), sentErrorMessage(false) {}
virtual ~ChatHandler() {}
static void FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker);
@@ -119,263 +119,19 @@ class ChatHandler
GameObject* GetNearbyGameObject();
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry);
- bool HasSentErrorMessage() const { return sentErrorMessage;}
- void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
- static bool LoadCommandTable() { return load_command_table;}
- static void SetLoadCommandTable(bool val){ load_command_table = val;};
+ bool HasSentErrorMessage() const { return sentErrorMessage; }
+ void SetSentErrorMessage(bool val){ sentErrorMessage = val; }
+ static bool LoadCommandTable() { return load_command_table; }
+ static void SetLoadCommandTable(bool val) { load_command_table = val; }
+ bool ShowHelpForCommand(ChatCommand* table, const char* cmd);
protected:
- explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
+ explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) {} // for CLI subclass
static bool SetDataForCommandInTable(ChatCommand* table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand);
bool ExecuteCommandInTable(ChatCommand* table, const char* text, const std::string& fullcmd);
- bool ShowHelpForCommand(ChatCommand* table, const char* cmd);
bool ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd);
- bool HandleNameAnnounceCommand(const char* args);
- bool HandleGMNameAnnounceCommand(const char* args);
- bool HandleGMAnnounceCommand(const char* args);
- bool HandleGMNotifyCommand(const char* args);
-
- bool HandleBanAccountCommand(const char* args);
- bool HandleBanAccountByCharCommand(const char* args);
- bool HandleBanCharacterCommand(const char* args);
- bool HandleBanIPCommand(const char* args);
- bool HandleBanInfoAccountCommand(const char* args);
- bool HandleBanInfoCharacterCommand(const char* args);
- bool HandleBanInfoIPCommand(const char* args);
- bool HandleBanListAccountCommand(const char* args);
- bool HandleBanListCharacterCommand(const char* args);
- bool HandleBanListIPCommand(const char* args);
-
- bool HandleCastCommand(const char *args);
- bool HandleCastBackCommand(const char *args);
- bool HandleCastDistCommand(const char *args);
- bool HandleCastSelfCommand(const char *args);
- bool HandleCastTargetCommand(const char *args);
- bool HandleCastDestCommand(const char *args);
-
- bool HandleCharacterCustomizeCommand(const char* args);
- bool HandleCharacterChangeFactionCommand(const char* args);
- bool HandleCharacterChangeRaceCommand(const char * args);
- bool HandleCharacterDeletedDeleteCommand(const char* args);
- bool HandleCharacterDeletedListCommand(const char* args);
- bool HandleCharacterDeletedRestoreCommand(const char* args);
- bool HandleCharacterDeletedOldCommand(const char* args);
- bool HandleCharacterEraseCommand(const char* args);
- bool HandleCharacterLevelCommand(const char* args);
- bool HandleCharacterRenameCommand(const char* args);
- bool HandleCharacterReputationCommand(const char* args);
- bool HandleCharacterTitlesCommand(const char* args);
-
- bool HandleChannelSetOwnership(const char *args);
-
- bool HandlePossessCommand(const char* args);
- bool HandleUnPossessCommand(const char* args);
- bool HandleBindSightCommand(const char* args);
- bool HandleUnbindSightCommand(const char* args);
-
- bool HandleGuildCreateCommand(const char* args);
- bool HandleGuildInviteCommand(const char* args);
- bool HandleGuildUninviteCommand(const char* args);
- bool HandleGuildRankCommand(const char* args);
- bool HandleGuildDeleteCommand(const char* args);
-
- bool HandleInstanceListBindsCommand(const char* args);
- bool HandleInstanceUnbindCommand(const char* args);
- bool HandleInstanceStatsCommand(const char* args);
- bool HandleInstanceSaveDataCommand(const char * args);
-
- bool HandleListAurasCommand(const char * args);
- bool HandleListCreatureCommand(const char* args);
- bool HandleListItemCommand(const char* args);
- bool HandleListObjectCommand(const char* args);
-
- bool HandleLookupAreaCommand(const char* args);
- bool HandleLookupCreatureCommand(const char* args);
- bool HandleLookupEventCommand(const char* args);
- bool HandleLookupFactionCommand(const char * args);
- bool HandleLookupItemCommand(const char * args);
- bool HandleLookupItemSetCommand(const char * args);
- bool HandleLookupObjectCommand(const char* args);
- bool HandleLookupPlayerIpCommand(const char* args);
- bool HandleLookupPlayerAccountCommand(const char* args);
- bool HandleLookupPlayerEmailCommand(const char* args);
- bool HandleLookupQuestCommand(const char* args);
- bool HandleLookupSkillCommand(const char* args);
- bool HandleLookupSpellCommand(const char* args);
- bool HandleLookupTaxiNodeCommand(const char * args);
- bool HandleLookupTeleCommand(const char * args);
- bool HandleLookupMapCommand(const char* args);
- bool HandleLookupTitleCommand(const char * args);
-
- bool HandlePDumpLoadCommand(const char *args);
- bool HandlePDumpWriteCommand(const char *args);
-
- bool HandleResetAchievementsCommand(const char * args);
- bool HandleResetAllCommand(const char * args);
- bool HandleResetHonorCommand(const char * args);
- bool HandleResetLevelCommand(const char * args);
- bool HandleResetSpellsCommand(const char* args);
- bool HandleResetStatsCommand(const char * args);
- bool HandleResetTalentsCommand(const char* args);
-
- bool HandleSendItemsCommand(const char* args);
- bool HandleSendMailCommand(const char* args);
- bool HandleSendMessageCommand(const char * args);
- bool HandleSendMoneyCommand(const char* args);
-
- bool HandleServerCorpsesCommand(const char* args);
- bool HandleServerExitCommand(const char* args);
- bool HandleServerIdleRestartCommand(const char* args);
- bool HandleServerIdleShutDownCommand(const char* args);
- bool HandleServerInfoCommand(const char* args);
- bool HandleServerMotdCommand(const char* args);
- bool HandleServerPLimitCommand(const char* args);
- bool HandleServerRestartCommand(const char* args);
- bool HandleServerSetLogLevelCommand(const char* args);
- bool HandleServerSetMotdCommand(const char* args);
- bool HandleServerShutDownCommand(const char* args);
- bool HandleServerShutDownCancelCommand(const char* args);
- bool HandleServerSetClosedCommand(const char* args);
- bool HandleServerToggleQueryLogging(const char* args);
-
- bool HandleServerSetLogFileLevelCommand(const char* args);
- bool HandleServerSetDiffTimeCommand(const char* args);
-
- bool HandleUnBanAccountCommand(const char* args);
- bool HandleUnBanAccountByCharCommand(const char* args);
- bool HandleUnBanCharacterCommand(const char* args);
- bool HandleUnBanIPCommand(const char* args);
-
- bool HandleHelpCommand(const char* args);
- bool HandleCommandsCommand(const char* args);
- bool HandleStartCommand(const char* args);
- bool HandleDismountCommand(const char* args);
- bool HandleSaveCommand(const char* args);
-
- bool HandleSummonCommand(const char* args);
- bool HandleAppearCommand(const char* args);
- bool HandleGroupSummonCommand(const char* args);
- bool HandleRecallCommand(const char* args);
- bool HandleAnnounceCommand(const char* args);
- bool HandleNotifyCommand(const char* args);
- bool HandleTaxiCheatCommand(const char* args);
- bool HandleWhispersCommand(const char* args);
-
- bool HandleGUIDCommand(const char* args);
- bool HandleItemMoveCommand(const char* args);
- bool HandleDeMorphCommand(const char* args);
- bool HandlePInfoCommand(const char* args);
- bool HandleMuteCommand(const char* args);
- bool HandleUnmuteCommand(const char* args);
- bool HandleMovegensCommand(const char* args);
- bool HandleFreezeCommand(const char *args);
- bool HandleUnFreezeCommand(const char *args);
- bool HandleListFreezeCommand(const char* args);
-
- bool HandleCooldownCommand(const char* args);
- bool HandleUnLearnCommand(const char* args);
- bool HandleGetDistanceCommand(const char* args);
- bool HandleDieCommand(const char* args);
- bool HandleDamageCommand(const char *args);
- bool HandleReviveCommand(const char* args);
- bool HandleAuraCommand(const char* args);
- bool HandleUnAuraCommand(const char* args);
- bool HandleLinkGraveCommand(const char* args);
- bool HandleNearGraveCommand(const char* args);
- bool HandleActivateObjectCommand(const char* args);
- bool HandleSpawnTransportCommand(const char* args);
- bool HandleExploreCheatCommand(const char* args);
- bool HandleWaterwalkCommand(const char* args);
- bool HandleLevelUpCommand(const char* args);
- bool HandleShowAreaCommand(const char* args);
- bool HandleHideAreaCommand(const char* args);
- bool HandleAddItemCommand(const char* args);
- bool HandleAddItemSetCommand(const char* args);
- bool HandlePetUnlearnCommand(const char* args);
- bool HandlePetLearnCommand(const char* args);
- bool HandleCreatePetCommand(const char* args);
-
- bool HandleGroupLeaderCommand(const char* args);
- bool HandleGroupDisbandCommand(const char* args);
- bool HandleGroupRemoveCommand(const char* args);
-
- bool HandleBankCommand(const char* args);
- bool HandleChangeWeather(const char* args);
- bool HandleKickPlayerCommand(const char * args);
-
- // GM ticket command handlers
- bool HandleGMTicketListCommand(const char* args);
- bool HandleGMTicketListOnlineCommand(const char* args);
- bool HandleGMTicketListClosedCommand(const char* args);
- bool HandleGMTicketListEscalatedCommand(const char* args);
- bool HandleGMTicketGetByIdCommand(const char* args);
- bool HandleGMTicketGetByNameCommand(const char* args);
- bool HandleGMTicketCloseByIdCommand(const char* args);
- bool HandleGMTicketAssignToCommand(const char* args);
- bool HandleGMTicketUnAssignCommand(const char* args);
- bool HandleGMTicketCommentCommand(const char* args);
- bool HandleGMTicketDeleteByIdCommand(const char* args);
- bool HandleGMTicketResetCommand(const char* /* args */);
- bool HandleGMTicketReloadCommand(const char*);
- bool HandleToggleGMTicketSystem(const char* args);
- bool HandleGMTicketEscalateCommand(const char* args);
- bool HandleGMTicketCompleteCommand(const char* args);
- bool HandleGMTicketResponseAppendCommand(const char* args);
- bool HandleGMTicketResponseAppendLnCommand(const char* args);
-
- bool HandleMaxSkillCommand(const char* args);
- bool HandleSetSkillCommand(const char* args);
- bool HandleRespawnCommand(const char* args);
- bool HandleComeToMeCommand(const char *args);
- bool HandleCombatStopCommand(const char *args);
-
- /*bool HandleCharDeleteCommand(const char *args);
- bool HandleSendMessageCommand(const char * args);*/
-
- bool HandleFlushArenaPointsCommand(const char *args);
- bool HandlePlayAllCommand(const char* args);
- bool HandleRepairitemsCommand(const char* args);
-
- bool HandleTempGameObjectCommand(const char* args);
-
- //! Development Commands
-
- /*bool HandleQuestAdd(const char * args);
- bool HandleQuestRemove(const char * args);
- bool HandleQuestComplete(const char * args);*/
-
- //bool HandleSet32Bit(const char* args);
- bool HandleSaveAllCommand(const char* args);
-
- // Utility methods for commands
- bool LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit);
- bool HandleBanListHelper(PreparedQueryResult result);
- bool HandleBanHelper(BanMode mode, char const* args);
- bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
- bool HandleUnBanHelper(BanMode mode, char const* args);
- void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel);
- void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id);
-
- // Stores informations about a deleted character
- struct DeletedInfo
- {
- uint32 lowguid; ///< the low GUID from the character
- std::string name; ///< the character name
- uint32 accountId; ///< the account id
- std::string accountName; ///< the account name
- time_t deleteDate; ///< the date at which the character has been deleted
- };
-
- typedef std::list<DeletedInfo> DeletedInfoList;
- bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString = "");
- std::string GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end);
- void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList);
- void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo);
-
private:
- bool _HandleGMTicketResponseAppendCommand(const char* args, bool newLine);
-
WorldSession* m_session; // != NULL for chat command call and NULL for CLI command
// common global flag
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
deleted file mode 100755
index b2ac090c313..00000000000
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "World.h"
-#include "Player.h"
-#include "Chat.h"
-#include "ObjectAccessor.h"
-#include "Language.h"
-#include "AccountMgr.h"
-#include "SystemConfig.h"
-#include "revision.h"
-#include "Util.h"
-
-bool ChatHandler::HandleHelpCommand(const char* args)
-{
- char* cmd = strtok((char*)args, " ");
- if (!cmd)
- {
- ShowHelpForCommand(getCommandTable(), "help");
- ShowHelpForCommand(getCommandTable(), "");
- }
- else
- {
- if (!ShowHelpForCommand(getCommandTable(), cmd))
- SendSysMessage(LANG_NO_HELP_CMD);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleCommandsCommand(const char* /*args*/)
-{
- ShowHelpForCommand(getCommandTable(), "");
- return true;
-}
-
-bool ChatHandler::HandleStartCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- if (player->isInFlight())
- {
- SendSysMessage(LANG_YOU_IN_FLIGHT);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->isInCombat())
- {
- SendSysMessage(LANG_YOU_IN_COMBAT);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
- {
- // if player is dead and stuck, send ghost to graveyard
- player->RepopAtGraveyard();
- return true;
- }
-
- // cast spell Stuck
- player->CastSpell(player, 7355, false);
- return true;
-}
-
-bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
-{
- uint32 playersNum = sWorld->GetPlayerCount();
- uint32 maxPlayersNum = sWorld->GetMaxPlayerCount();
- uint32 activeClientsNum = sWorld->GetActiveSessionCount();
- uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
- uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
- uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount();
- std::string uptime = secsToTimeString(sWorld->GetUptime());
- uint32 updateTime = sWorld->GetUpdateTime();
-
- SendSysMessage(_FULLVERSION);
- PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
- PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
- PSendSysMessage(LANG_UPTIME, uptime.c_str());
- PSendSysMessage(LANG_UPDATE_DIFF, updateTime);
- //! Can't use sWorld->ShutdownMsg here in case of console command
- if (sWorld->IsShuttingDown())
- PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str());
-
- return true;
-}
-
-bool ChatHandler::HandleDismountCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- //If player is not mounted, so go out :)
- if (!player->IsMounted())
- {
- SendSysMessage(LANG_CHAR_NON_MOUNTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->isInFlight())
- {
- SendSysMessage(LANG_YOU_IN_FLIGHT);
- SetSentErrorMessage(true);
- return false;
- }
-
- player->Dismount();
- player->RemoveAurasByType(SPELL_AURA_MOUNTED);
- return true;
-}
-
-bool ChatHandler::HandleSaveCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- // save GM account without delay and output message
- if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
- {
- if (Player* target = getSelectedPlayer())
- target->SaveToDB();
- else
- player->SaveToDB();
- SendSysMessage(LANG_PLAYER_SAVED);
- return true;
- }
-
- // save if the player has last been saved over 20 seconds ago
- uint32 save_interval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
- if (save_interval == 0 || (save_interval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20 * IN_MILLISECONDS))
- player->SaveToDB();
-
- return true;
-}
-
-/// Display the 'Message of the day' for the realm
-bool ChatHandler::HandleServerMotdCommand(const char* /*args*/)
-{
- PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd());
- return true;
-}
-
diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp
deleted file mode 100755
index a10a78a35ff..00000000000
--- a/src/server/game/Chat/Commands/Level1.cpp
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "TicketMgr.h"
-#include "Player.h"
-#include "AccountMgr.h"
-#include "Opcodes.h"
-#include "Chat.h"
-#include "Log.h"
-#include "MapManager.h"
-#include "ObjectAccessor.h"
-#include "Language.h"
-#include "CellImpl.h"
-#include "InstanceSaveMgr.h"
-#include "Util.h"
-#include "Group.h"
-
-#ifdef _DEBUG_VMAPS
-#include "VMapFactory.h"
-#endif
-
-bool ChatHandler::HandleNameAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string name("Console");
- if (WorldSession* session = GetSession())
- name = session->GetPlayer()->GetName();
-
- sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, name.c_str(), args);
- return true;
-}
-
-bool ChatHandler::HandleGMNameAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string name("Console");
- if (WorldSession* session = GetSession())
- name = session->GetPlayer()->GetName();
-
- sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), args);
- return true;
-}
-
-// global announce
-bool ChatHandler::HandleAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- char buff[2048];
- sprintf(buff, GetTrinityString(LANG_SYSTEMMESSAGE), args);
- sWorld->SendServerMessage(SERVER_MSG_STRING, buff);
- return true;
-}
-
-// announce to logged in GMs
-bool ChatHandler::HandleGMAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- sWorld->SendGMText(LANG_GM_BROADCAST, args);
- return true;
-}
-
-//notification player at the screen
-bool ChatHandler::HandleNotifyCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string str = GetTrinityString(LANG_GLOBAL_NOTIFY);
- str += args;
-
- WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
- data << str;
- sWorld->SendGlobalMessage(&data);
-
- return true;
-}
-
-//notification GM at the screen
-bool ChatHandler::HandleGMNotifyCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string str = GetTrinityString(LANG_GM_NOTIFY);
- str += args;
-
- WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
- data << str;
- sWorld->SendGlobalGMMessage(&data);
-
- return true;
-}
-
-//Summon Player
-bool ChatHandler::HandleSummonCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- Player* _player = m_session->GetPlayer();
- if (target == _player || target_guid == _player->GetGUID())
- {
- PSendSysMessage(LANG_CANT_TELEPORT_SELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target)
- {
- std::string nameLink = playerLink(target_name);
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- if (target->IsBeingTeleported())
- {
- PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- Map* map = m_session->GetPlayer()->GetMap();
-
- if (map->IsBattlegroundOrArena())
- {
- // only allow if gm mode is on
- if (!_player->isGameMaster())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- // if both players are in different bgs
- else if (target->GetBattlegroundId() && m_session->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId())
- target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff
-
- // all's well, set bg id
- // when porting out from the bg, it will be reset to 0
- target->SetBattlegroundId(m_session->GetPlayer()->GetBattlegroundId(), m_session->GetPlayer()->GetBattlegroundTypeId());
- // remember current position as entry point for return at bg end teleportation
- if (!target->GetMap()->IsBattlegroundOrArena())
- target->SetBattlegroundEntryPoint();
- }
- else if (map->IsDungeon())
- {
- Map* cMap = target->GetMap();
-
- if (cMap->Instanceable() && cMap->GetInstanceId() != map->GetInstanceId())
- target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true);
-
- // we are in instance, and can summon only player in our group with us as lead
- if (!m_session->GetPlayer()->GetGroup() || !target->GetGroup() ||
- (target->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()) ||
- (m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()))
- // the last check is a bit excessive, but let it be, just in case
- {
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
- if (needReportToTarget(target))
- ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str());
-
- // stop flight if need
- if (target->isInFlight())
- {
- target->GetMotionMaster()->MovementExpired();
- target->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- target->SaveRecallPosition();
-
- // before GM
- float x, y, z;
- m_session->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
- target->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
- target->SetPhaseMask(m_session->GetPlayer()->GetPhaseMask(), true);
- }
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, target_guid))
- return false;
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetTrinityString(LANG_OFFLINE));
-
- // in point where GM stay
- Player::SavePositionInDB(m_session->GetPlayer()->GetMapId(),
- m_session->GetPlayer()->GetPositionX(),
- m_session->GetPlayer()->GetPositionY(),
- m_session->GetPlayer()->GetPositionZ(),
- m_session->GetPlayer()->GetOrientation(),
- m_session->GetPlayer()->GetZoneId(),
- target_guid);
- }
-
- return true;
-}
-
-//Teleport to Player
-bool ChatHandler::HandleAppearCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- Player* _player = m_session->GetPlayer();
- if (target == _player || target_guid == _player->GetGUID())
- {
- SendSysMessage(LANG_CANT_TELEPORT_SELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target)
- {
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- std::string chrNameLink = playerLink(target_name);
-
- Map* cMap = target->GetMap();
- if (cMap->IsBattlegroundOrArena())
- {
- // only allow if gm mode is on
- if (!_player->isGameMaster())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- // if both players are in different bgs
- else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId())
- _player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff
-
- // all's well, set bg id
- // when porting out from the bg, it will be reset to 0
- _player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId());
- // remember current position as entry point for return at bg end teleportation
- if (!_player->GetMap()->IsBattlegroundOrArena())
- _player->SetBattlegroundEntryPoint();
- }
- else if (cMap->IsDungeon())
- {
- // we have to go to instance, and can go to player only if:
- // 1) we are in his group (either as leader or as member)
- // 2) we are not bound to any group and have GM mode on
- if (_player->GetGroup())
- {
- // we are in group, we can go only if we are in the player group
- if (_player->GetGroup() != target->GetGroup())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
- else
- {
- // we are not in group, let's verify our GM mode
- if (!_player->isGameMaster())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- // if the player or the player's group is bound to another instance
- // the player will not be bound to another one
- InstancePlayerBind* pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(cMap->IsRaid()));
- if (!pBind)
- {
- Group* group = _player->GetGroup();
- // if no bind exists, create a solo bind
- InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
- if (!gBind)
- if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
- _player->BindToInstance(save, !save->CanReset());
- }
-
- if (cMap->IsRaid())
- _player->SetRaidDifficulty(target->GetRaidDifficulty());
- else
- _player->SetDungeonDifficulty(target->GetDungeonDifficulty());
- }
-
- PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
-
- // stop flight if need
- if (_player->isInFlight())
- {
- _player->GetMotionMaster()->MovementExpired();
- _player->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- _player->SaveRecallPosition();
-
- // to point to see at target with same orientation
- float x, y, z;
- target->GetContactPoint(_player, x, y, z);
-
- _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
- _player->SetPhaseMask(target->GetPhaseMask(), true);
- }
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, target_guid))
- return false;
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
-
- // to point where player stay (if loaded)
- float x, y, z, o;
- uint32 map;
- bool in_flight;
- if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, target_guid))
- return false;
-
- // stop flight if need
- if (_player->isInFlight())
- {
- _player->GetMotionMaster()->MovementExpired();
- _player->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- _player->SaveRecallPosition();
-
- _player->TeleportTo(map, x, y, z, _player->GetOrientation());
- }
-
- return true;
-}
-
-// Teleport player to last position
-bool ChatHandler::HandleRecallCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- if (target->IsBeingTeleported())
- {
- PSendSysMessage(LANG_IS_TELEPORTED, GetNameLink(target).c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- // stop flight if need
- if (target->isInFlight())
- {
- target->GetMotionMaster()->MovementExpired();
- target->CleanupAfterTaxiFlight();
- }
-
- target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
- return true;
-}
-
-//Enable On\OFF all taxi paths
-bool ChatHandler::HandleTaxiCheatCommand(const char* args)
-{
- if (!*args)
- {
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string argstr = (char*)args;
-
- Player* chr = getSelectedPlayer();
-
- if (!chr)
- chr = m_session->GetPlayer();
- else if (HasLowerSecurity(chr, 0)) // check online security
- return false;
-
- if (argstr == "on")
- {
- chr->SetTaxiCheater(true);
- PSendSysMessage(LANG_YOU_GIVE_TAXIS, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, GetNameLink().c_str());
- return true;
- }
-
- if (argstr == "off")
- {
- chr->SetTaxiCheater(false);
- PSendSysMessage(LANG_YOU_REMOVE_TAXIS, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, GetNameLink().c_str());
-
- return true;
- }
-
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
-}
-
-bool ChatHandler::HandleLookupAreaCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr (namepart, wnamepart))
- return false;
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // converting string that we try to find to lower case
- wstrToLower (wnamepart);
-
- // Search in AreaTable.dbc
- for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows(); ++areaflag)
- {
- AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag);
- if (areaEntry)
- {
- int loc = GetSessionDbcLocale();
- std::string name = areaEntry->area_name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo (name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = areaEntry->area_name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo (name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- // send area in "id - [name]" format
- std::ostringstream ss;
- if (m_session)
- ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[loc]<< "]|h|r";
- else
- ss << areaEntry->ID << " - " << name << ' ' << localeNames[loc];
-
- SendSysMessage(ss.str().c_str());
-
- if (!found)
- found = true;
- }
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_NOAREAFOUND);
-
- return true;
-}
-
-//Find tele in game_tele order by name
-bool ChatHandler::HandleLookupTeleCommand(const char * args)
-{
- if (!*args)
- {
- SendSysMessage(LANG_COMMAND_TELE_PARAMETER);
- SetSentErrorMessage(true);
- return false;
- }
-
- char const* str = strtok((char*)args, " ");
- if (!str)
- return false;
-
- std::string namepart = str;
- std::wstring wnamepart;
-
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower(wnamepart);
-
- std::ostringstream reply;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
- bool limitReached = false;
-
- GameTeleContainer const & teleMap = sObjectMgr->GetGameTeleMap();
- for (GameTeleContainer::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
- {
- GameTele const* tele = &itr->second;
-
- if (tele->wnameLow.find(wnamepart) == std::wstring::npos)
- continue;
-
- if (maxResults && count++ == maxResults)
- {
- limitReached = true;
- break;
- }
-
- if (m_session)
- reply << " |cffffffff|Htele:" << itr->first << "|h[" << tele->name << "]|h|r\n";
- else
- reply << " " << itr->first << ' ' << tele->name << "\n";
- }
-
- if (reply.str().empty())
- SendSysMessage(LANG_COMMAND_TELE_NOLOCATION);
- else
- PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str().c_str());
-
- if (limitReached)
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
-
- return true;
-}
-
-//Enable\Dissable accept whispers (for GM)
-bool ChatHandler::HandleWhispersCommand(const char* args)
-{
- if (!*args)
- {
- PSendSysMessage(LANG_COMMAND_WHISPERACCEPTING, m_session->GetPlayer()->isAcceptWhispers() ? GetTrinityString(LANG_ON) : GetTrinityString(LANG_OFF));
- return true;
- }
-
- std::string argstr = (char*)args;
- // whisper on
- if (argstr == "on")
- {
- m_session->GetPlayer()->SetAcceptWhispers(true);
- SendSysMessage(LANG_COMMAND_WHISPERON);
- return true;
- }
-
- // whisper off
- if (argstr == "off")
- {
- // Remove all players from the Gamemaster's whisper whitelist
- m_session->GetPlayer()->ClearWhisperWhiteList();
- m_session->GetPlayer()->SetAcceptWhispers(false);
- SendSysMessage(LANG_COMMAND_WHISPEROFF);
- return true;
- }
-
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
-}
-
-//Save all players in the world
-bool ChatHandler::HandleSaveAllCommand(const char* /*args*/)
-{
- sObjectAccessor->SaveAllPlayers();
- SendSysMessage(LANG_PLAYERS_SAVED);
- return true;
-}
-
-//Send mail by command
-bool ChatHandler::HandleSendMailCommand(const char* args)
-{
- // format: name "subject text" "mail text"
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- char* tail1 = strtok(NULL, "");
- if (!tail1)
- return false;
-
- char* msgSubject = extractQuotedArg(tail1);
- if (!msgSubject)
- return false;
-
- char* tail2 = strtok(NULL, "");
- if (!tail2)
- return false;
-
- char* msgText = extractQuotedArg(tail2);
- if (!msgText)
- return false;
-
- // msgSubject, msgText isn't NUL after prev. check
- std::string subject = msgSubject;
- std::string text = msgText;
-
- // from console show not existed sender
- MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
-
- //- TODO: Fix poor design
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
- MailDraft(subject, text)
- .SendMailTo(trans, MailReceiver(target, GUID_LOPART(target_guid)), sender);
-
- CharacterDatabase.CommitTransaction(trans);
-
- std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
- return true;
-}
-
-//Summon group of player
-bool ChatHandler::HandleGroupSummonCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- Group* grp = target->GetGroup();
-
- std::string nameLink = GetNameLink(target);
-
- if (!grp)
- {
- PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- Map* gmMap = m_session->GetPlayer()->GetMap();
- bool to_instance = gmMap->Instanceable();
-
- // we are in instance, and can summon only player in our group with us as lead
- if (to_instance && (
- !m_session->GetPlayer()->GetGroup() || (grp->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()) ||
- (m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID())))
- // the last check is a bit excessive, but let it be, just in case
- {
- SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
- SetSentErrorMessage(true);
- return false;
- }
-
- for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player* player = itr->getSource();
-
- if (!player || player == m_session->GetPlayer() || !player->GetSession())
- continue;
-
- // check online security
- if (HasLowerSecurity(player, 0))
- return false;
-
- std::string plNameLink = GetNameLink(player);
-
- if (player->IsBeingTeleported() == true)
- {
- PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- if (to_instance)
- {
- Map* plMap = player->GetMap();
-
- if (plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId())
- {
- // cannot summon from instance to instance
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
- if (needReportToTarget(player))
- ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
-
- // stop flight if need
- if (player->isInFlight())
- {
- player->GetMotionMaster()->MovementExpired();
- player->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- player->SaveRecallPosition();
-
- // before GM
- float x, y, z;
- m_session->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize());
- player->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation());
- }
-
- return true;
-}
diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
deleted file mode 100755
index 52bdcd15163..00000000000
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ /dev/null
@@ -1,1170 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "DBCStores.h"
-#include "ObjectMgr.h"
-#include "Player.h"
-#include "Item.h"
-#include "GameObject.h"
-#include "Opcodes.h"
-#include "Chat.h"
-#include "MapManager.h"
-#include "Language.h"
-#include "World.h"
-#include "GameEventMgr.h"
-#include "SpellMgr.h"
-#include "PoolMgr.h"
-#include "AccountMgr.h"
-#include "WaypointManager.h"
-#include "Util.h"
-#include <cctype>
-#include <iostream>
-#include <fstream>
-#include <map>
-#include "OutdoorPvPMgr.h"
-#include "Transport.h"
-#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
-#include "CreatureGroups.h"
-#include "ace/INET_Addr.h"
-
-//mute player for some times
-bool ChatHandler::HandleMuteCommand(const char* args)
-{
- char* nameStr;
- char* delayStr;
- extractOptFirstArg((char*)args, &nameStr, &delayStr);
- if (!delayStr)
- return false;
-
- char *mutereason = strtok(NULL, "\r");
- std::string mutereasonstr = "No reason";
- if (mutereason != NULL)
- mutereasonstr = mutereason;
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
-
- // find only player from same account if any
- if (!target)
- if (WorldSession* session = sWorld->FindSession(accountId))
- target = session->GetPlayer();
-
- uint32 notspeaktime = (uint32) atoi(delayStr);
-
- // must have strong lesser security level
- if (HasLowerSecurity (target, target_guid, true))
- return false;
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
-
- if (target)
- {
- // Target is online, mute will be in effect right away.
- int64 muteTime = time(NULL) + notspeaktime * MINUTE;
- target->GetSession()->m_muteTime = muteTime;
-
- stmt->setInt64(0, muteTime);
-
- ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str());
- }
- else
- {
- // Target is offline, mute will be in effect starting from the next login.
- int32 muteTime = -int32(notspeaktime * MINUTE);
-
- stmt->setInt64(0, muteTime);
- }
-
- stmt->setUInt32(1, accountId);
-
- LoginDatabase.Execute(stmt);
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notspeaktime, mutereasonstr.c_str());
-
- return true;
-}
-
-//unmute player
-bool ChatHandler::HandleUnmuteCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
-
- // find only player from same account if any
- if (!target)
- if (WorldSession* session = sWorld->FindSession(accountId))
- target = session->GetPlayer();
-
- // must have strong lesser security level
- if (HasLowerSecurity (target, target_guid, true))
- return false;
-
- if (target)
- {
- if (target->CanSpeak())
- {
- SendSysMessage(LANG_CHAT_ALREADY_ENABLED);
- SetSentErrorMessage(true);
- return false;
- }
-
- target->GetSession()->m_muteTime = 0;
- }
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
-
- stmt->setInt64(0, 0);
- stmt->setUInt32(1, accountId);
-
- LoginDatabase.Execute(stmt);
-
- if (target)
- ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str());
- return true;
-}
-
-bool ChatHandler::HandleGUIDCommand(const char* /*args*/)
-{
- uint64 guid = m_session->GetPlayer()->GetSelection();
-
- if (guid == 0)
- {
- SendSysMessage(LANG_NO_SELECTION);
- SetSentErrorMessage(true);
- return false;
- }
-
- PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
- return true;
-}
-
- //move item to other slot
-bool ChatHandler::HandleItemMoveCommand(const char* args)
-{
- if (!*args)
- return false;
-
- char* pParam1 = strtok((char*)args, " ");
- if (!pParam1)
- return false;
-
- char* pParam2 = strtok(NULL, " ");
- if (!pParam2)
- return false;
-
- uint8 srcslot = (uint8)atoi(pParam1);
- uint8 dstslot = (uint8)atoi(pParam2);
-
- if (srcslot == dstslot)
- return true;
-
- if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcslot, true))
- return false;
-
- if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, false))
- return false;
-
- uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);
- uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstslot);
-
- m_session->GetPlayer()->SwapItem(src, dst);
-
- return true;
-}
-
-//kick player
-bool ChatHandler::HandleKickPlayerCommand(const char *args)
-{
- Player* target = NULL;
- std::string playerName;
- if (!extractPlayerTarget((char*)args, &target, NULL, &playerName))
- return false;
-
- if (m_session && target == m_session->GetPlayer())
- {
- SendSysMessage(LANG_COMMAND_KICKSELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
- sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
- else
- PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
-
- target->GetSession()->KickPlayer();
- return true;
-}
-
-//show info of player
-bool ChatHandler::HandlePInfoCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
-
- uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
-
- if (sObjectMgr->GetPlayerNameByGUID(parseGUID, target_name))
- {
- target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
- target_guid = parseGUID;
- }
- else if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- uint32 accId = 0;
- uint32 money = 0;
- uint32 total_player_time = 0;
- uint8 level = 0;
- uint32 latency = 0;
- uint8 race;
- uint8 Class;
- int64 muteTime = 0;
- int64 banTime = -1;
- uint32 mapId;
- uint32 areaId;
- uint32 phase = 0;
-
- // get additional information from Player object
- if (target)
- {
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- accId = target->GetSession()->GetAccountId();
- money = target->GetMoney();
- total_player_time = target->GetTotalPlayedTime();
- level = target->getLevel();
- latency = target->GetSession()->GetLatency();
- race = target->getRace();
- Class = target->getClass();
- muteTime = target->GetSession()->m_muteTime;
- mapId = target->GetMapId();
- areaId = target->GetAreaId();
- phase = target->GetPhaseMask();
- }
- // get additional information from DB
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, target_guid))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO);
- stmt->setUInt32(0, GUID_LOPART(target_guid));
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- return false;
-
- Field* fields = result->Fetch();
- total_player_time = fields[0].GetUInt32();
- level = fields[1].GetUInt8();
- money = fields[2].GetUInt32();
- accId = fields[3].GetUInt32();
- race = fields[4].GetUInt8();
- Class = fields[5].GetUInt8();
- mapId = fields[6].GetUInt16();
- areaId = fields[7].GetUInt16();
- }
-
- std::string username = GetTrinityString(LANG_ERROR);
- std::string email = GetTrinityString(LANG_ERROR);
- std::string last_ip = GetTrinityString(LANG_ERROR);
- uint32 security = 0;
- std::string last_login = GetTrinityString(LANG_ERROR);
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
- stmt->setInt32(0, int32(realmID));
- stmt->setUInt32(1, accId);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- if (result)
- {
- Field* fields = result->Fetch();
- username = fields[0].GetString();
- security = fields[1].GetUInt8();
- email = fields[2].GetString();
- muteTime = fields[5].GetUInt64();
-
- if (email.empty())
- email = "-";
-
- if (!m_session || m_session->GetSecurity() >= AccountTypes(security))
- {
- last_ip = fields[3].GetString();
- last_login = fields[4].GetString();
-
- uint32 ip = inet_addr(last_ip.c_str());
-#if TRINITY_ENDIAN == BIGENDIAN
- EndianConvertReverse(ip);
-#endif
-
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY);
-
- stmt->setUInt32(0, ip);
-
- PreparedQueryResult result2 = WorldDatabase.Query(stmt);
-
- if (result2)
- {
- Field* fields2 = result2->Fetch();
- last_ip.append(" (");
- last_ip.append(fields2[0].GetString());
- last_ip.append(")");
- }
- }
- else
- {
- last_ip = "-";
- last_login = "-";
- }
- }
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(target_guid), username.c_str(), accId, email.c_str(), security, last_ip.c_str(), last_login.c_str(), latency);
-
- std::string bannedby = "unknown";
- std::string banreason = "";
-
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
- stmt->setUInt32(0, accId);
- PreparedQueryResult result2 = LoginDatabase.Query(stmt);
- if (!result2)
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
- stmt->setUInt32(0, GUID_LOPART(target_guid));
- result2 = CharacterDatabase.Query(stmt);
- }
-
- if (result2)
- {
- Field* fields = result2->Fetch();
- banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32());
- bannedby = fields[2].GetString();
- banreason = fields[3].GetString();
- }
-
- if (muteTime > 0)
- PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str());
-
- if (banTime >= 0)
- PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str());
-
- std::string race_s, Class_s;
- switch (race)
- {
- case RACE_HUMAN: race_s = "Human"; break;
- case RACE_ORC: race_s = "Orc"; break;
- case RACE_DWARF: race_s = "Dwarf"; break;
- case RACE_NIGHTELF: race_s = "Night Elf"; break;
- case RACE_UNDEAD_PLAYER: race_s = "Undead"; break;
- case RACE_TAUREN: race_s = "Tauren"; break;
- case RACE_GNOME: race_s = "Gnome"; break;
- case RACE_TROLL: race_s = "Troll"; break;
- case RACE_BLOODELF: race_s = "Blood Elf"; break;
- case RACE_DRAENEI: race_s = "Draenei"; break;
- }
- switch (Class)
- {
- case CLASS_WARRIOR: Class_s = "Warrior"; break;
- case CLASS_PALADIN: Class_s = "Paladin"; break;
- case CLASS_HUNTER: Class_s = "Hunter"; break;
- case CLASS_ROGUE: Class_s = "Rogue"; break;
- case CLASS_PRIEST: Class_s = "Priest"; break;
- case CLASS_DEATH_KNIGHT: Class_s = "Death Knight"; break;
- case CLASS_SHAMAN: Class_s = "Shaman"; break;
- case CLASS_MAGE: Class_s = "Mage"; break;
- case CLASS_WARLOCK: Class_s = "Warlock"; break;
- case CLASS_DRUID: Class_s = "Druid"; break;
- }
-
- std::string timeStr = secsToTimeString(total_player_time, true, true);
- uint32 gold = money /GOLD;
- uint32 silv = (money % GOLD) / SILVER;
- uint32 copp = (money % GOLD) % SILVER;
- PSendSysMessage(LANG_PINFO_LEVEL, race_s.c_str(), Class_s.c_str(), timeStr.c_str(), level, gold, silv, copp);
-
- // Add map, zone, subzone and phase to output
- int locale = GetSessionDbcLocale();
- std::string areaName = "<unknown>";
- std::string zoneName = "";
-
- MapEntry const* map = sMapStore.LookupEntry(mapId);
-
- AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
- if (area)
- {
- areaName = area->area_name[locale];
-
- AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
-
- if (zone)
- zoneName = zone->area_name[locale];
- }
-
- if (target)
- {
- if (!zoneName.empty())
- PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
- else
- PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
- }
- else
- PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
-
- return true;
-}
-
-//rename characters
-bool ChatHandler::HandleCharacterRenameCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- if (target)
- {
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_RENAME);
- }
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, targetGuid))
- return false;
-
- std::string oldNameLink = playerLink(targetName);
-
- PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
-
- CharacterDatabase.Execute(stmt);
- }
-
- return true;
-}
-
-// customize characters
-bool ChatHandler::HandleCharacterCustomizeCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
-
- if (target)
- {
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
-
- stmt->setUInt32(1, target->GetGUIDLow());
- }
- else
- {
- std::string oldNameLink = playerLink(targetName);
-
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
-
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
- }
-
- CharacterDatabase.Execute(stmt);
-
- return true;
-}
-
-bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
-
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
-
- if (target)
- {
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
-
- stmt->setUInt32(1, target->GetGUIDLow());
- }
- else
- {
- std::string oldNameLink = playerLink(targetName);
-
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
-
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
- }
-
- CharacterDatabase.Execute(stmt);
-
- return true;
-}
-
-bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
-
- if (target)
- {
- // TODO : add text into database
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
-
- stmt->setUInt32(1, target->GetGUIDLow());
- }
- else
- {
- std::string oldNameLink = playerLink(targetName);
-
- // TODO : add text into database
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
-
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
- }
-
- CharacterDatabase.Execute(stmt);
-
- return true;
-}
-
-bool ChatHandler::HandleCharacterReputationCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- LocaleConstant loc = GetSessionDbcLocale();
-
- FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
- for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
- {
- const FactionState& faction = itr->second;
- FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
- char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
- ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
- std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
- std::ostringstream ss;
- if (m_session)
- ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r";
- else
- ss << faction.ID << " - " << factionName << ' ' << localeNames[loc];
-
- ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
-
- if (faction.Flags & FACTION_FLAG_VISIBLE)
- ss << GetTrinityString(LANG_FACTION_VISIBLE);
- if (faction.Flags & FACTION_FLAG_AT_WAR)
- ss << GetTrinityString(LANG_FACTION_ATWAR);
- if (faction.Flags & FACTION_FLAG_PEACE_FORCED)
- ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if (faction.Flags & FACTION_FLAG_HIDDEN)
- ss << GetTrinityString(LANG_FACTION_HIDDEN);
- if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED)
- ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if (faction.Flags & FACTION_FLAG_INACTIVE)
- ss << GetTrinityString(LANG_FACTION_INACTIVE);
-
- SendSysMessage(ss.str().c_str());
- }
- return true;
-}
-
-bool ChatHandler::HandleLookupEventCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- // converting string that we try to find to lower case
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
- GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
-
- for (uint32 id = 0; id < events.size(); ++id)
- {
- GameEventData const& eventData = events[id];
-
- std::string descr = eventData.description;
- if (descr.empty())
- continue;
-
- if (Utf8FitTo(descr, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
-
- if (m_session)
- PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active);
- else
- PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active);
-
- if (!found)
- found = true;
- }
- }
-
- if (!found)
- SendSysMessage(LANG_NOEVENTFOUND);
-
- return true;
-}
-
-bool ChatHandler::HandleCombatStopCommand(const char* args)
-{
- Player* target = NULL;
-
- if (args && strlen(args) > 0)
- {
- target = sObjectAccessor->FindPlayerByName(args);
- if (!target)
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- if (!target)
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- target->CombatStop();
- target->getHostileRefManager().deleteReferences();
- return true;
-}
-
-bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
-{
- std::string ip;
- int32 limit;
- char* limit_str;
-
- Player *chr = getSelectedPlayer();
- if (!*args)
- {
- // NULL only if used from console
- if (!chr || chr == GetSession()->GetPlayer())
- return false;
-
- ip = chr->GetSession()->GetRemoteAddress();
- limit = -1;
- }
- else
- {
- ip = strtok ((char*)args, " ");
- limit_str = strtok (NULL, " ");
- limit = limit_str ? atoi (limit_str) : -1;
- }
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
- stmt->setString(0, ip);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- return LookupPlayerSearchCommand(result, limit);
-}
-
-bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string account = strtok ((char*)args, " ");
- char* limit_str = strtok (NULL, " ");
- int32 limit = limit_str ? atoi (limit_str) : -1;
-
- if (!AccountMgr::normalizeString (account))
- return false;
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
- stmt->setString(0, account);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- return LookupPlayerSearchCommand (result, limit);
-}
-
-bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string email = strtok ((char*)args, " ");
- char* limit_str = strtok (NULL, " ");
- int32 limit = limit_str ? atoi (limit_str) : -1;
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
- stmt->setString(0, email);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- return LookupPlayerSearchCommand(result, limit);
-}
-
-bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit)
-{
- if (!result)
- {
- PSendSysMessage(LANG_NO_PLAYERS_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- int i = 0;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
- do
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- Field* fields = result->Fetch();
- uint32 acc_id = fields[0].GetUInt32();
- std::string acc_name = fields[1].GetString();
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
- stmt->setUInt32(0, acc_id);
- PreparedQueryResult result2 = CharacterDatabase.Query(stmt);
-
- if (result2)
- {
- PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id);
-
- uint64 guid = 0;
- std::string name;
-
- do
- {
- Field* charfields = result2->Fetch();
- guid = charfields[0].GetUInt64();
- name = charfields[1].GetString();
-
- PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
- ++i;
-
- } while (result2->NextRow() && (limit == -1 || i < limit));
- }
- } while (result->NextRow());
-
- if (i == 0) // empty accounts only
- {
- PSendSysMessage(LANG_NO_PLAYERS_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-/// Triggering corpses expire check in world
-bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
-{
- sObjectAccessor->RemoveOldCorpses();
- return true;
-}
-
-bool ChatHandler::HandleRepairitemsCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- // Repair items
- target->DurabilityRepairAll(false, 0, false);
-
- PSendSysMessage(LANG_YOU_REPAIR_ITEMS, GetNameLink(target).c_str());
- if (needReportToTarget(target))
- ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetNameLink().c_str());
- return true;
-}
-
-bool ChatHandler::HandleWaterwalkCommand(const char* args)
-{
- if (!*args)
- return false;
-
- Player* player = getSelectedPlayer();
-
- if (!player)
- {
- PSendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- // check online security
- if (HasLowerSecurity(player, 0))
- return false;
-
- if (strncmp(args, "on", 3) == 0)
- player->SetMovement(MOVE_WATER_WALK); // ON
- else if (strncmp(args, "off", 4) == 0)
- player->SetMovement(MOVE_LAND_WALK); // OFF
- else
- {
- SendSysMessage(LANG_USE_BOL);
- return false;
- }
-
- PSendSysMessage(LANG_YOU_SET_WATERWALK, args, GetNameLink(player).c_str());
- if (needReportToTarget(player))
- ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetNameLink().c_str());
- return true;
-}
-
-bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
- Creature* creatureTarget = getSelectedCreature();
-
- if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
- {
- PSendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry());
- // Creatures with family 0 crashes the server
- if (cInfo->family == 0)
- {
- PSendSysMessage("This creature cannot be tamed. (family id: 0).");
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->GetPetGUID())
- {
- PSendSysMessage("You already have a pet");
- SetSentErrorMessage(true);
- return false;
- }
-
- // Everything looks OK, create new pet
- Pet* pet = new Pet(player, HUNTER_PET);
- if (!pet->CreateBaseAtCreature(creatureTarget))
- {
- delete pet;
- PSendSysMessage("Error 1");
- return false;
- }
-
- creatureTarget->setDeathState(JUST_DIED);
- creatureTarget->RemoveCorpse();
- creatureTarget->SetHealth(0); // just for nice GM-mode view
-
- pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
- pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
-
- if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
- {
- sLog->outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
- PSendSysMessage("Error 2");
- delete pet;
- return false;
- }
-
- // prepare visual effect for levelup
- pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
-
- pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
- // this enables pet details window (Shift+P)
- pet->InitPetCreateSpells();
- pet->SetFullHealth();
-
- pet->GetMap()->AddToMap(pet->ToCreature());
-
- // visual effect for levelup
- pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
-
- player->SetMinion(pet, true);
- pet->SavePetToDB(PET_SAVE_AS_CURRENT);
- player->PetSpellInitialize();
-
- return true;
-}
-
-bool ChatHandler::HandlePetLearnCommand(const char* args)
-{
- if (!*args)
- return false;
-
- Player* player = m_session->GetPlayer();
- Pet* pet = player->GetPet();
-
- if (!pet)
- {
- PSendSysMessage("You have no pet");
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 spellId = extractSpellIdFromLink((char*)args);
-
- if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
- return false;
-
- // Check if pet already has it
- if (pet->HasSpell(spellId))
- {
- PSendSysMessage("Pet already has spell: %u", spellId);
- SetSentErrorMessage(true);
- return false;
- }
-
- // Check if spell is valid
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
- if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
- SetSentErrorMessage(true);
- return false;
- }
-
- pet->learnSpell(spellId);
-
- PSendSysMessage("Pet has learned spell %u", spellId);
- return true;
-}
-
-bool ChatHandler::HandlePetUnlearnCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* player = m_session->GetPlayer();
- Pet* pet = player->GetPet();
-
- if (!pet)
- {
- PSendSysMessage("You have no pet");
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 spellId = extractSpellIdFromLink((char*)args);
-
- if (pet->HasSpell(spellId))
- pet->removeSpell(spellId, false);
- else
- PSendSysMessage("Pet doesn't have that spell");
-
- return true;
-}
-
-bool ChatHandler::HandleLookupTitleCommand(const char* args)
-{
- if (!*args)
- return false;
-
- // can be NULL in console call
- Player* target = getSelectedPlayer();
-
- // title name have single string arg for player name
- char const* targetName = target ? target->GetName() : "NAME";
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower(wnamepart);
-
- uint32 counter = 0; // Counter for figure out that we found smth.
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // Search in CharTitles.dbc
- for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
- {
- CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
- if (titleInfo)
- {
- int loc = GetSessionDbcLocale();
- std::string name = titleInfo->name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = titleInfo->name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && counter == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char const* knownStr = target && target->HasTitle(titleInfo) ? GetTrinityString(LANG_KNOWN) : "";
-
- char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
- ? GetTrinityString(LANG_ACTIVE)
- : "";
-
- char titleNameStr[80];
- snprintf(titleNameStr, 80, name.c_str(), targetName);
-
- // send title in "id (idx:idx) - [namedlink locale]" format
- if (m_session)
- PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
- else
- PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[loc], knownStr, activeStr);
-
- ++counter;
- }
- }
- }
- if (counter == 0) // if counter == 0 then we found nth
- SendSysMessage(LANG_COMMAND_NOTITLEFOUND);
- return true;
-}
-
-bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
-{
- if (!*args)
- return false;
-
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- LocaleConstant loc = GetSessionDbcLocale();
- char const* targetName = target->GetName();
- char const* knownStr = GetTrinityString(LANG_KNOWN);
-
- // Search in CharTitles.dbc
- for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
- {
- CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
- if (titleInfo && target->HasTitle(titleInfo))
- {
- std::string name = titleInfo->name[loc];
- if (name.empty())
- continue;
-
- char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
- ? GetTrinityString(LANG_ACTIVE)
- : "";
-
- char titleNameStr[80];
- snprintf(titleNameStr, 80, name.c_str(), targetName);
-
- // send title in "id (idx:idx) - [namedlink locale]" format
- if (m_session)
- PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
- else
- PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
- }
- }
- return true;
-}
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
deleted file mode 100755
index 4b2f1c5e7bb..00000000000
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ /dev/null
@@ -1,4763 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "GuildMgr.h"
-#include "AuctionHouseMgr.h"
-#include "AccountMgr.h"
-#include "PlayerDump.h"
-#include "SpellMgr.h"
-#include "Player.h"
-#include "Opcodes.h"
-#include "GameObject.h"
-#include "Chat.h"
-#include "Log.h"
-#include "Guild.h"
-#include "ObjectAccessor.h"
-#include "MapManager.h"
-#include "Language.h"
-#include "GridNotifiersImpl.h"
-#include "CellImpl.h"
-#include "Weather.h"
-#include "PointMovementGenerator.h"
-#include "TargetedMovementGenerator.h"
-#include "SkillDiscovery.h"
-#include "SkillExtraItems.h"
-#include "SystemConfig.h"
-#include "Config.h"
-#include "Util.h"
-#include "ItemEnchantmentMgr.h"
-#include "BattlegroundMgr.h"
-#include "InstanceSaveMgr.h"
-#include "InstanceScript.h"
-#include "CreatureEventAIMgr.h"
-#include "SpellAuraEffects.h"
-#include "DBCEnums.h"
-#include "ConditionMgr.h"
-#include "DisableMgr.h"
-#include "Transport.h"
-#include "WeatherMgr.h"
-#include "ScriptMgr.h"
-#include "CreatureTextMgr.h"
-#include "SmartAI.h"
-#include "Group.h"
-#include "ChannelMgr.h"
-
-bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/)
-{
- Player* SelectedPlayer = getSelectedPlayer();
- if (!SelectedPlayer)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- // each skills that have max skill value dependent from level seted to current level max skill value
- SelectedPlayer->UpdateSkillsToMaxSkillsForLevel();
- return true;
-}
-
-bool ChatHandler::HandleSetSkillCommand(const char *args)
-{
- // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r
- char* skill_p = extractKeyFromLink((char*)args, "Hskill");
- if (!skill_p)
- return false;
-
- char *level_p = strtok (NULL, " ");
- if (!level_p)
- return false;
-
- char *max_p = strtok (NULL, " ");
-
- int32 skill = atoi(skill_p);
- if (skill <= 0)
- {
- PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
- SetSentErrorMessage(true);
- return false;
- }
-
- int32 level = atol(level_p);
-
- Player* target = getSelectedPlayer();
- if (!target)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- SkillLineEntry const* sl = sSkillLineStore.LookupEntry(skill);
- if (!sl)
- {
- PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string tNameLink = GetNameLink(target);
-
- if (!target->GetSkillValue(skill))
- {
- PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, sl->name[GetSessionDbcLocale()]);
- SetSentErrorMessage(true);
- return false;
- }
-
- int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill);
-
- if (level <= 0 || level > max || max <= 0)
- return false;
-
- target->SetSkill(skill, target->GetSkillStep(skill), level, max);
- PSendSysMessage(LANG_SET_SKILL, skill, sl->name[GetSessionDbcLocale()], tNameLink.c_str(), level, max);
-
- return true;
-}
-
-bool ChatHandler::HandleUnLearnCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- uint32 spell_id = extractSpellIdFromLink((char*)args);
- if (!spell_id)
- return false;
-
- char const* allStr = strtok(NULL, " ");
- bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
-
- Player* target = getSelectedPlayer();
- if (!target)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (allRanks)
- spell_id = sSpellMgr->GetFirstSpellInChain (spell_id);
-
- if (target->HasSpell(spell_id))
- target->removeSpell(spell_id, false, !allRanks);
- else
- SendSysMessage(LANG_FORGET_SPELL);
-
- if (GetTalentSpellCost(spell_id))
- target->SendTalentsInfoData(false);
-
- return true;
-}
-
-bool ChatHandler::HandleCooldownCommand(const char *args)
-{
- Player* target = getSelectedPlayer();
- if (!target)
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string tNameLink = GetNameLink(target);
-
- if (!*args)
- {
- target->RemoveAllSpellCooldown();
- PSendSysMessage(LANG_REMOVEALL_COOLDOWN, tNameLink.c_str());
- }
- else
- {
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell_id = extractSpellIdFromLink((char*)args);
- if (!spell_id)
- return false;
-
- if (!sSpellMgr->GetSpellInfo(spell_id))
- {
- PSendSysMessage(LANG_UNKNOWN_SPELL, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- target->RemoveSpellCooldown(spell_id, true);
- PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
- }
- return true;
-}
-
-bool ChatHandler::HandleAddItemCommand(const char *args)
-{
- if (!*args)
- return false;
-
- uint32 itemId = 0;
-
- if (args[0] == '[') // [name] manual form
- {
- char* citemName = strtok((char*)args, "]");
-
- if (citemName && citemName[0])
- {
- std::string itemName = citemName+1;
- WorldDatabase.EscapeString(itemName);
-
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME);
- stmt->setString(0, itemName);
- PreparedQueryResult result = WorldDatabase.Query(stmt);
-
- if (!result)
- {
- PSendSysMessage(LANG_COMMAND_COULDNOTFIND, citemName+1);
- SetSentErrorMessage(true);
- return false;
- }
- itemId = result->Fetch()->GetUInt16();
- }
- else
- return false;
- }
- else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r
- {
- char* cId = extractKeyFromLink((char*)args, "Hitem");
- if (!cId)
- return false;
- itemId = atol(cId);
- }
-
- char* ccount = strtok(NULL, " ");
-
- int32 count = 1;
-
- if (ccount)
- count = strtol(ccount, NULL, 10);
-
- if (count == 0)
- count = 1;
-
- Player* player = m_session->GetPlayer();
- Player* plTarget = getSelectedPlayer();
- if (!plTarget)
- plTarget = player;
-
- sLog->outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
-
- ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemId);
- if (!pProto)
- {
- PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
- SetSentErrorMessage(true);
- return false;
- }
-
- //Subtract
- if (count < 0)
- {
- plTarget->DestroyItemCount(itemId, -count, true, false);
- PSendSysMessage(LANG_REMOVEITEM, itemId, -count, GetNameLink(plTarget).c_str());
- return true;
- }
-
- //Adding items
- uint32 noSpaceForCount = 0;
-
- // check space and find places
- ItemPosCountVec dest;
- InventoryResult msg = plTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount);
- if (msg != EQUIP_ERR_OK) // convert to possible store amount
- count -= noSpaceForCount;
-
- if (count == 0 || dest.empty()) // can't add any
- {
- PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
- SetSentErrorMessage(true);
- return false;
- }
-
- Item* item = plTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
-
- // remove binding (let GM give it to another player later)
- if (player == plTarget)
- for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
- if (Item* item1 = player->GetItemByPos(itr->pos))
- item1->SetBinding(false);
-
- if (count > 0 && item)
- {
- player->SendNewItem(item, count, false, true);
- if (player != plTarget)
- plTarget->SendNewItem(item, count, true, false);
- }
-
- if (noSpaceForCount > 0)
- PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
-
- return true;
-}
-
-bool ChatHandler::HandleAddItemSetCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cId = extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r
- if (!cId)
- return false;
-
- uint32 itemsetId = atol(cId);
-
- // prevent generation all items with itemset field value '0'
- if (itemsetId == 0)
- {
- PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemsetId);
- SetSentErrorMessage(true);
- return false;
- }
-
- Player* player = m_session->GetPlayer();
- Player* playerTarget = getSelectedPlayer();
- if (!playerTarget)
- playerTarget = player;
-
- sLog->outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId);
-
- bool found = false;
- ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
- for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
- {
- if (itr->second.ItemSet == itemsetId)
- {
- found = true;
- ItemPosCountVec dest;
- InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itr->second.ItemId, 1);
- if (msg == EQUIP_ERR_OK)
- {
- Item* item = playerTarget->StoreNewItem(dest, itr->second.ItemId, true);
-
- // remove binding (let GM give it to another player later)
- if (player == playerTarget)
- item->SetBinding(false);
-
- player->SendNewItem(item, 1, false, true);
- if (player != playerTarget)
- playerTarget->SendNewItem(item, 1, true, false);
- }
- else
- {
- player->SendEquipError(msg, NULL, NULL, itr->second.ItemId);
- PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1);
- }
- }
- }
-
- if (!found)
- {
- PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemsetId);
-
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleListItemCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cId = extractKeyFromLink((char*)args, "Hitem");
- if (!cId)
- return false;
-
- uint32 item_id = atol(cId);
- if (!item_id)
- {
- PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
- if (!itemProto)
- {
- PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* c_count = strtok(NULL, " ");
- int _count = c_count ? atol(c_count) : 10;
-
- if (_count < 0)
- return false;
- uint32 count = uint32(_count);
-
- PreparedQueryResult result;
-
- // inventory case
- uint32 inv_count = 0;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM);
- stmt->setUInt32(0, item_id);
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- inv_count = (*result)[0].GetUInt64();
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY);
- stmt->setUInt32(0, item_id);
- stmt->setUInt32(1, count);
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 item_guid = fields[0].GetUInt32();
- uint32 item_bag = fields[1].GetUInt32();
- uint8 item_slot = fields[2].GetUInt8();
- uint32 owner_guid = fields[3].GetUInt32();
- uint32 owner_acc = fields[4].GetUInt32();
- std::string owner_name = fields[5].GetString();
-
- char const* item_pos = 0;
- if (Player::IsEquipmentPos(item_bag, item_slot))
- item_pos = "[equipped]";
- else if (Player::IsInventoryPos(item_bag, item_slot))
- item_pos = "[in inventory]";
- else if (Player::IsBankPos(item_bag, item_slot))
- item_pos = "[in bank]";
- else
- item_pos = "";
-
- PSendSysMessage(LANG_ITEMLIST_SLOT, item_guid, owner_name.c_str(), owner_guid, owner_acc, item_pos);
- }
- while (result->NextRow());
-
- uint32 res_count = uint32(result->GetRowCount());
-
- if (count > res_count)
- count -= res_count;
- else if (count)
- count = 0;
- }
-
- // mail case
- uint32 mail_count = 0;
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM);
- stmt->setUInt32(0, item_id);
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- mail_count = (*result)[0].GetUInt64();
-
- if (count > 0)
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY);
- stmt->setUInt32(0, item_id);
- stmt->setUInt32(1, count);
- result = CharacterDatabase.Query(stmt);
- }
- else
- result = PreparedQueryResult(NULL);
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 item_guid = fields[0].GetUInt32();
- uint32 item_s = fields[1].GetUInt32();
- uint32 item_r = fields[2].GetUInt32();
- uint32 item_s_acc = fields[3].GetUInt32();
- std::string item_s_name = fields[4].GetString();
- uint32 item_r_acc = fields[5].GetUInt32();
- std::string item_r_name = fields[6].GetString();
-
- char const* item_pos = "[in mail]";
-
- PSendSysMessage(LANG_ITEMLIST_MAIL, item_guid, item_s_name.c_str(), item_s, item_s_acc, item_r_name.c_str(), item_r, item_r_acc, item_pos);
- }
- while (result->NextRow());
-
- uint32 res_count = uint32(result->GetRowCount());
-
- if (count > res_count)
- count -= res_count;
- else if (count)
- count = 0;
- }
-
- // auction case
- uint32 auc_count = 0;
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM);
- stmt->setUInt32(0, item_id);
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- auc_count = (*result)[0].GetUInt64();
-
- if (count > 0)
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY);
- stmt->setUInt32(0, item_id);
- stmt->setUInt32(1, count);
- result = CharacterDatabase.Query(stmt);
- }
- else
- result = PreparedQueryResult(NULL);
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 item_guid = fields[0].GetUInt32();
- uint32 owner = fields[1].GetUInt32();
- uint32 owner_acc = fields[2].GetUInt32();
- std::string owner_name = fields[3].GetString();
-
- char const* item_pos = "[in auction]";
-
- PSendSysMessage(LANG_ITEMLIST_AUCTION, item_guid, owner_name.c_str(), owner, owner_acc, item_pos);
- }
- while (result->NextRow());
- }
-
- // guild bank case
- uint32 guild_count = 0;
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM);
- stmt->setUInt32(0, item_id);
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- guild_count = (*result)[0].GetUInt64();
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY);
- stmt->setUInt32(0, item_id);
- stmt->setUInt32(1, count);
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 item_guid = fields[0].GetUInt32();
- uint32 guild_guid = fields[1].GetUInt32();
- std::string guild_name = fields[2].GetString();
-
- char const* item_pos = "[in guild bank]";
-
- PSendSysMessage(LANG_ITEMLIST_GUILD, item_guid, guild_name.c_str(), guild_guid, item_pos);
- }
- while (result->NextRow());
-
- uint32 res_count = uint32(result->GetRowCount());
-
- if (count > res_count)
- count -= res_count;
- else if (count)
- count = 0;
- }
-
- if (inv_count + mail_count + auc_count + guild_count == 0)
- {
- SendSysMessage(LANG_COMMAND_NOITEMFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE, item_id, inv_count + mail_count + auc_count + guild_count, inv_count, mail_count, auc_count, guild_count);
- return true;
-}
-
-bool ChatHandler::HandleListObjectCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
- char* cId = extractKeyFromLink((char*)args, "Hgameobject_entry");
- if (!cId)
- return false;
-
- uint32 go_id = atol(cId);
- if (!go_id)
- {
- PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(go_id);
- if (!gInfo)
- {
- PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* c_count = strtok(NULL, " ");
- int count = c_count ? atol(c_count) : 10;
-
- if (count < 0)
- return false;
-
- QueryResult result;
-
- uint32 obj_count = 0;
- result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id);
- if (result)
- obj_count = (*result)[0].GetUInt64();
-
- if (m_session)
- {
- Player* player = m_session->GetPlayer();
- result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
- player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), go_id, uint32(count));
- }
- else
- result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u",
- go_id, uint32(count));
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
- float x = fields[1].GetFloat();
- float y = fields[2].GetFloat();
- float z = fields[3].GetFloat();
- int mapid = fields[4].GetUInt16();
- uint32 entry = fields[5].GetUInt32();
-
- if (m_session)
- PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapid);
- else
- PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapid);
- } while (result->NextRow());
- }
-
- PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, go_id, obj_count);
- return true;
-}
-
-bool ChatHandler::HandleListCreatureCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
- char* cId = extractKeyFromLink((char*)args, "Hcreature_entry");
- if (!cId)
- return false;
-
- uint32 cr_id = atol(cId);
- if (!cr_id)
- {
- PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(cr_id);
- if (!cInfo)
- {
- PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* c_count = strtok(NULL, " ");
- int count = c_count ? atol(c_count) : 10;
-
- if (count < 0)
- return false;
-
- QueryResult result;
-
- uint32 cr_count = 0;
- result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id);
- if (result)
- cr_count = (*result)[0].GetUInt64();
-
- if (m_session)
- {
- Player* player = m_session->GetPlayer();
- result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
- player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), cr_id, uint32(count));
- }
- else
- result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u",
- cr_id, uint32(count));
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
- float x = fields[1].GetFloat();
- float y = fields[2].GetFloat();
- float z = fields[3].GetFloat();
- int mapid = fields[4].GetUInt16();
-
- if (m_session)
- PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapid);
- else
- PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapid);
- } while (result->NextRow());
- }
-
- PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, cr_id, cr_count);
- return true;
-}
-
-bool ChatHandler::HandleLookupItemCommand(const char *args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- // converting string that we try to find to lower case
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // Search in `item_template`
- ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
- for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
- {
- int loc_idx = GetSessionDbLocaleIndex();
- if (loc_idx >= 0)
- {
- uint8 uloc_idx = uint8(loc_idx);
- if (ItemLocale const* il = sObjectMgr->GetItemLocale(itr->second.ItemId))
- {
- if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty())
- {
- std::string name = il->Name[uloc_idx];
-
- if (Utf8FitTo(name, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- if (m_session)
- PSendSysMessage(LANG_ITEM_LIST_CHAT, itr->second.ItemId, itr->second.ItemId, name.c_str());
- else
- PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itr->second.ItemId, name.c_str());
-
- if (!found)
- found = true;
-
- continue;
- }
- }
- }
- }
-
- std::string name = itr->second.Name1;
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- if (m_session)
- PSendSysMessage(LANG_ITEM_LIST_CHAT, itr->second.ItemId, itr->second.ItemId, name.c_str());
- else
- PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itr->second.ItemId, name.c_str());
-
- if (!found)
- found = true;
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_NOITEMFOUND);
-
- return true;
-}
-
-bool ChatHandler::HandleLookupItemSetCommand(const char *args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // Search in ItemSet.dbc
- for (uint32 id = 0; id < sItemSetStore.GetNumRows(); id++)
- {
- ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
- if (set)
- {
- int loc = GetSessionDbcLocale();
- std::string name = set->name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = set->name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- // send item set in "id - [namedlink locale]" format
- if (m_session)
- PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[loc]);
- else
- PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[loc]);
-
- if (!found)
- found = true;
- }
- }
- }
- if (!found)
- SendSysMessage(LANG_COMMAND_NOITEMSETFOUND);
- return true;
-}
-
-bool ChatHandler::HandleLookupSkillCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // can be NULL in console call
- Player* target = getSelectedPlayer();
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // Search in SkillLine.dbc
- for (uint32 id = 0; id < sSkillLineStore.GetNumRows(); id++)
- {
- SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
- if (skillInfo)
- {
- int loc = GetSessionDbcLocale();
- std::string name = skillInfo->name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = skillInfo->name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char valStr[50] = "";
- char const* knownStr = "";
- if (target && target->HasSkill(id))
- {
- knownStr = GetTrinityString(LANG_KNOWN);
- uint32 curValue = target->GetPureSkillValue(id);
- uint32 maxValue = target->GetPureMaxSkillValue(id);
- uint32 permValue = target->GetSkillPermBonusValue(id);
- uint32 tempValue = target->GetSkillTempBonusValue(id);
-
- char const* valFormat = GetTrinityString(LANG_SKILL_VALUES);
- snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue);
- }
-
- // send skill in "id - [namedlink locale]" format
- if (m_session)
- PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), localeNames[loc], knownStr, valStr);
- else
- PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), localeNames[loc], knownStr, valStr);
-
- if (!found)
- found = true;
- }
- }
- }
- if (!found)
- SendSysMessage(LANG_COMMAND_NOSKILLFOUND);
- return true;
-}
-
-bool ChatHandler::HandleLookupSpellCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // can be NULL at console call
- Player* target = getSelectedPlayer();
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // Search in Spell.dbc
- for (uint32 id = 0; id < sSpellMgr->GetSpellInfoStoreSize(); id++)
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
- if (spellInfo)
- {
- int loc = GetSessionDbcLocale();
- std::string name = spellInfo->SpellName[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = spellInfo->SpellName[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- bool known = target && target->HasSpell(id);
- bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
-
- SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
-
- uint32 talentCost = GetTalentSpellCost(id);
-
- bool talent = (talentCost > 0);
- bool passive = spellInfo->IsPassive();
- bool active = target && target->HasAura(id);
-
- // unit32 used to prevent interpreting uint8 as char at output
- // find rank of learned spell for learning spell, or talent rank
- uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
-
- // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
- std::ostringstream ss;
- if (m_session)
- ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name;
- else
- ss << id << " - " << name;
-
- // include rank in link name
- if (rank)
- ss << GetTrinityString(LANG_SPELL_RANK) << rank;
-
- if (m_session)
- ss << ' ' << localeNames[loc] << "]|h|r";
- else
- ss << ' ' << localeNames[loc];
-
- if (talent)
- ss << GetTrinityString(LANG_TALENT);
- if (passive)
- ss << GetTrinityString(LANG_PASSIVE);
- if (learn)
- ss << GetTrinityString(LANG_LEARN);
- if (known)
- ss << GetTrinityString(LANG_KNOWN);
- if (active)
- ss << GetTrinityString(LANG_ACTIVE);
-
- SendSysMessage(ss.str().c_str());
-
- if (!found)
- found = true;
- }
- }
- }
- if (!found)
- SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- return true;
-}
-
-bool ChatHandler::HandleLookupQuestCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // can be NULL at console call
- Player* target = getSelectedPlayer();
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- // converting string that we try to find to lower case
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates();
- for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
- {
- Quest * qinfo = iter->second;
-
- int loc_idx = GetSessionDbLocaleIndex();
- if (loc_idx >= 0)
- {
- uint8 uloc_idx = uint8(loc_idx);
- if (QuestLocale const* il = sObjectMgr->GetQuestLocale(qinfo->GetQuestId()))
- {
- if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty())
- {
- std::string title = il->Title[uloc_idx];
-
- if (Utf8FitTo(title, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char const* statusStr = "";
-
- if (target)
- {
- QuestStatus status = target->GetQuestStatus(qinfo->GetQuestId());
-
- switch (status)
- {
- case QUEST_STATUS_COMPLETE:
- statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
- break;
- case QUEST_STATUS_INCOMPLETE:
- statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
- break;
- case QUEST_STATUS_REWARDED:
- statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
- break;
- default:
- break;
- }
- }
-
- if (m_session)
- PSendSysMessage(LANG_QUEST_LIST_CHAT, qinfo->GetQuestId(), qinfo->GetQuestId(), qinfo->GetQuestLevel(), title.c_str(), statusStr);
- else
- PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qinfo->GetQuestId(), title.c_str(), statusStr);
-
- if (!found)
- found = true;
-
- continue;
- }
- }
- }
- }
-
- std::string title = qinfo->GetTitle();
- if (title.empty())
- continue;
-
- if (Utf8FitTo(title, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char const* statusStr = "";
-
- if (target)
- {
- QuestStatus status = target->GetQuestStatus(qinfo->GetQuestId());
-
- switch (status)
- {
- case QUEST_STATUS_COMPLETE:
- statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
- break;
- case QUEST_STATUS_INCOMPLETE:
- statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
- break;
- case QUEST_STATUS_REWARDED:
- statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
- break;
- default:
- break;
- }
- }
-
- if (m_session)
- PSendSysMessage(LANG_QUEST_LIST_CHAT, qinfo->GetQuestId(), qinfo->GetQuestId(), qinfo->GetQuestLevel(), title.c_str(), statusStr);
- else
- PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qinfo->GetQuestId(), title.c_str(), statusStr);
-
- if (!found)
- found = true;
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_NOQUESTFOUND);
-
- return true;
-}
-
-bool ChatHandler::HandleLookupCreatureCommand(const char *args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- // converting string that we try to find to lower case
- if (!Utf8toWStr (namepart, wnamepart))
- return false;
-
- wstrToLower (wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
- for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
- {
- uint32 id = itr->second.Entry;
- uint8 localeIndex = GetSessionDbLocaleIndex();
- if (CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(id))
- {
- if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty())
- {
- std::string name = cl->Name[localeIndex];
-
- if (Utf8FitTo (name, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- if (m_session)
- PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
- else
- PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
-
- if (!found)
- found = true;
-
- continue;
- }
- }
- }
-
- std::string name = itr->second.Name;
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- if (m_session)
- PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
- else
- PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
-
- if (!found)
- found = true;
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_NOCREATUREFOUND);
-
- return true;
-}
-
-bool ChatHandler::HandleLookupObjectCommand(const char *args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- // converting string that we try to find to lower case
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates();
- for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
- {
- uint8 localeIndex = GetSessionDbLocaleIndex();
- if (GameObjectLocale const* gl = sObjectMgr->GetGameObjectLocale(itr->second.entry))
- {
- if (gl->Name.size() > localeIndex && !gl->Name[localeIndex].empty())
- {
- std::string name = gl->Name[localeIndex];
-
- if (Utf8FitTo(name, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- if (m_session)
- PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
- else
- PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
-
- if (!found)
- found = true;
-
- continue;
- }
- }
- }
-
- std::string name = itr->second.name;
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- if (m_session)
- PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
- else
- PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
-
- if (!found)
- found = true;
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_NOGAMEOBJECTFOUND);
-
- return true;
-}
-
-bool ChatHandler::HandleLookupFactionCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // Can be NULL at console call
- Player* target = getSelectedPlayer();
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr (namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower (wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
- {
- FactionEntry const* factionEntry = sFactionStore.LookupEntry (id);
- if (factionEntry)
- {
- FactionState const* repState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
-
- int loc = GetSessionDbcLocale();
- std::string name = factionEntry->name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = factionEntry->name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
- // or "id - [faction] [no reputation]" format
- std::ostringstream ss;
- if (m_session)
- ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[loc] << "]|h|r";
- else
- ss << id << " - " << name << ' ' << localeNames[loc];
-
- if (repState) // and then target != NULL also
- {
- uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
- std::string rankName = GetTrinityString(index);
-
- ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
-
- if (repState->Flags & FACTION_FLAG_VISIBLE)
- ss << GetTrinityString(LANG_FACTION_VISIBLE);
- if (repState->Flags & FACTION_FLAG_AT_WAR)
- ss << GetTrinityString(LANG_FACTION_ATWAR);
- if (repState->Flags & FACTION_FLAG_PEACE_FORCED)
- ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if (repState->Flags & FACTION_FLAG_HIDDEN)
- ss << GetTrinityString(LANG_FACTION_HIDDEN);
- if (repState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
- ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if (repState->Flags & FACTION_FLAG_INACTIVE)
- ss << GetTrinityString(LANG_FACTION_INACTIVE);
- }
- else
- ss << GetTrinityString(LANG_FACTION_NOREPUTATION);
-
- SendSysMessage(ss.str().c_str());
-
- if (!found)
- found = true;
- }
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_FACTION_NOTFOUND);
- return true;
-}
-
-bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
-{
- if (!*args)
- return false;
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- // converting string that we try to find to lower case
- wstrToLower(wnamepart);
-
- bool found = false;
- uint32 count = 0;
- uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
-
- // Search in TaxiNodes.dbc
- for (uint32 id = 0; id < sTaxiNodesStore.GetNumRows(); id++)
- {
- TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id);
- if (nodeEntry)
- {
- int loc = GetSessionDbcLocale();
- std::string name = nodeEntry->name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for (; loc < TOTAL_LOCALES; ++loc)
- {
- if (loc == GetSessionDbcLocale())
- continue;
-
- name = nodeEntry->name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
- if (m_session)
- PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc],
- nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
- else
- PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc],
- nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
-
- if (!found)
- found = true;
- }
- }
- }
- if (!found)
- SendSysMessage(LANG_COMMAND_NOTAXINODEFOUND);
- return true;
-}
-
-bool ChatHandler::HandleLookupMapCommand(const char *args)
-{
- if (!*args)
- return false;
-
- /*std::string namepart = args;
- std::wstring wnamepart;
-
- // converting string that we try to find to lower case
- if (!Utf8toWStr(namepart, wnamepart))
- return false;
-
- wstrToLower(wnamepart);
-
- bool found = false;
-
- // search in Map.dbc
- for (uint32 id = 0; id < sMapStore.GetNumRows(); id++)
- {
- MapEntry const* MapInfo = sMapStore.LookupEntry(id);
- if (MapInfo)
- {
- uint8 loc = m_session ? m_session->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale();
-
- std::string name = MapInfo->name[loc];
- if (name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = LOCALE_enUS;
- for (; loc < TOTAL_LOCALES; loc++)
- {
- if (m_session && loc == m_session->GetSessionDbcLocale())
- continue;
-
- name = MapInfo->name[loc];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if (loc < TOTAL_LOCALES)
- {
- // send map in "id - [name][Continent][Instance/Battleground/Arena][Raid reset time:][Heroic reset time:][Mountable]" format
- std::ostringstream ss;
-
- if (m_session)
- ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << ']';
- else // console
- ss << id << " - [" << name << ']';
-
- if (MapInfo->IsContinent())
- ss << GetTrinityString(LANG_CONTINENT);
-
- switch (MapInfo->map_type)
- {
- case MAP_INSTANCE: ss << GetTrinityString(LANG_INSTANCE); break;
- case MAP_BATTLEGROUND: ss << GetTrinityString(LANG_BATTLEGROUND); break;
- case MAP_ARENA: ss << GetTrinityString(LANG_ARENA); break;
- }
-
- if (MapInfo->IsRaid())
- ss << GetTrinityString(LANG_RAID);
-
- if (MapInfo->SupportsHeroicMode())
- ss << GetTrinityString(LANG_HEROIC);
-
- uint32 ResetTimeRaid = MapInfo->resetTimeRaid;
-
- std::string ResetTimeRaidStr;
- if (ResetTimeRaid)
- ResetTimeRaidStr = secsToTimeString(ResetTimeRaid, true, false);
-
- uint32 ResetTimeHeroic = MapInfo->resetTimeHeroic;
- std::string ResetTimeHeroicStr;
- if (ResetTimeHeroic)
- ResetTimeHeroicStr = secsToTimeString(ResetTimeHeroic, true, false);
-
- if (MapInfo->IsMountAllowed())
- ss << GetTrinityString(LANG_MOUNTABLE);
-
- if (ResetTimeRaid && !ResetTimeHeroic)
- PSendSysMessage(ss.str().c_str(), ResetTimeRaidStr.c_str());
- else if (!ResetTimeRaid && ResetTimeHeroic)
- PSendSysMessage(ss.str().c_str(), ResetTimeHeroicStr.c_str());
- else if (ResetTimeRaid && ResetTimeHeroic)
- PSendSysMessage(ss.str().c_str(), ResetTimeRaidStr.c_str(), ResetTimeHeroicStr.c_str());
- else
- SendSysMessage(ss.str().c_str());
-
- if (!found)
- found = true;
- }
- }
- }
-
- if (!found)
- SendSysMessage(LANG_COMMAND_NOMAPFOUND);
- */
- return true;
-}
-
-/** \brief GM command level 3 - Create a guild.
- *
- * This command allows a GM (level 3) to create a guild.
- *
- * The "args" parameter contains the name of the guild leader
- * and then the name of the guild.
- *
- */
-bool ChatHandler::HandleGuildCreateCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // if not guild name only (in "") then player name
- Player* target;
- if (!extractPlayerTarget(*args != '"' ? (char*)args : NULL, &target))
- return false;
-
- char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
- if (!tailStr)
- return false;
-
- char* guildStr = extractQuotedArg(tailStr);
- if (!guildStr)
- return false;
-
- std::string guildname = guildStr;
-
- if (target->GetGuildId())
- {
- SendSysMessage(LANG_PLAYER_IN_GUILD);
- return true;
- }
-
- Guild* guild = new Guild;
- if (!guild->Create(target, guildname))
- {
- delete guild;
- SendSysMessage(LANG_GUILD_NOT_CREATED);
- SetSentErrorMessage(true);
- return false;
- }
-
- sGuildMgr->AddGuild(guild);
- return true;
-}
-
-bool ChatHandler::HandleGuildInviteCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // if not guild name only (in "") then player name
- uint64 target_guid;
- if (!extractPlayerTarget(*args != '"' ? (char*)args : NULL, NULL, &target_guid))
- return false;
-
- char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
- if (!tailStr)
- return false;
-
- char* guildStr = extractQuotedArg(tailStr);
- if (!guildStr)
- return false;
-
- std::string glName = guildStr;
- Guild* targetGuild = sGuildMgr->GetGuildByName(glName);
- if (!targetGuild)
- return false;
-
- // player's guild membership checked in AddMember before add
- return targetGuild->AddMember(target_guid);
-}
-
-bool ChatHandler::HandleGuildUninviteCommand(const char *args)
-{
- Player* target;
- uint64 target_guid;
- if (!extractPlayerTarget((char*)args, &target, &target_guid))
- return false;
-
- uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(target_guid);
- if (!glId)
- return false;
-
- Guild* targetGuild = sGuildMgr->GetGuildById(glId);
- if (!targetGuild)
- return false;
-
- targetGuild->DeleteMember(target_guid, false, true);
- return true;
-}
-
-bool ChatHandler::HandleGuildRankCommand(const char *args)
-{
- char* nameStr;
- char* rankStr;
- extractOptFirstArg((char*)args, &nameStr, &rankStr);
- if (!rankStr)
- return false;
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(target_guid);
- if (!glId)
- return false;
-
- Guild* targetGuild = sGuildMgr->GetGuildById (glId);
- if (!targetGuild)
- return false;
-
- uint32 newrank = uint32 (atoi (rankStr));
- return targetGuild->ChangeMemberRank(target_guid, newrank);
-}
-
-bool ChatHandler::HandleGuildDeleteCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* guildStr = extractQuotedArg((char*)args);
- if (!guildStr)
- return false;
-
- std::string gld = guildStr;
-
- Guild* targetGuild = sGuildMgr->GetGuildByName(gld);
- if (!targetGuild)
- return false;
-
- targetGuild->Disband();
-
- return true;
-}
-
-bool ChatHandler::HandleGetDistanceCommand(const char *args)
-{
- WorldObject* obj = NULL;
-
- if (*args)
- {
- uint64 guid = extractGuidFromLink((char*)args);
- if (guid)
- obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
-
- if (!obj)
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
- }
- else
- {
- obj = getSelectedUnit();
-
- if (!obj)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- PSendSysMessage(LANG_DISTANCE, m_session->GetPlayer()->GetDistance(obj), m_session->GetPlayer()->GetDistance2d(obj), m_session->GetPlayer()->GetExactDist(obj), m_session->GetPlayer()->GetExactDist2d(obj));
- return true;
-}
-
-bool ChatHandler::HandleDieCommand(const char* /*args*/)
-{
- Unit* target = getSelectedUnit();
-
- if (!target || !m_session->GetPlayer()->GetSelection())
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (HasLowerSecurity((Player*)target, 0, false))
- return false;
- }
-
- if (target->isAlive())
- {
- if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
- m_session->GetPlayer()->Kill(target);
- else
- m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleDamageCommand(const char * args)
-{
- if (!*args)
- return false;
-
- Unit* target = getSelectedUnit();
-
- if (!target || !m_session->GetPlayer()->GetSelection())
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (HasLowerSecurity((Player*)target, 0, false))
- return false;
- }
-
- if (!target->isAlive())
- return true;
-
- char* damageStr = strtok((char*)args, " ");
- if (!damageStr)
- return false;
-
- int32 damage_int = atoi((char*)damageStr);
- if (damage_int <= 0)
- return true;
-
- uint32 damage = damage_int;
-
- char* schoolStr = strtok((char*)NULL, " ");
-
- // flat melee damage without resistence/etc reduction
- if (!schoolStr)
- {
- m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- if (target != m_session->GetPlayer())
- m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
- return true;
- }
-
- uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL;
- if (school >= MAX_SPELL_SCHOOL)
- return false;
-
- SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
-
- if (Unit::IsDamageReducedByArmor(schoolmask))
- damage = m_session->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK);
-
- char* spellStr = strtok((char*)NULL, " ");
-
- // melee damage by specific school
- if (!spellStr)
- {
- uint32 absorb = 0;
- uint32 resist = 0;
-
- m_session->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
-
- if (damage <= absorb + resist)
- return true;
-
- damage -= absorb + resist;
-
- m_session->GetPlayer()->DealDamageMods(target, damage, &absorb);
- m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
- m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
- return true;
- }
-
- // non-melee damage
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spellid = extractSpellIdFromLink((char*)args);
- if (!spellid || !sSpellMgr->GetSpellInfo(spellid))
- return false;
-
- m_session->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
- return true;
-}
-
-bool ChatHandler::HandleReviveCommand(const char *args)
-{
- Player* target;
- uint64 target_guid;
- if (!extractPlayerTarget((char*)args, &target, &target_guid))
- return false;
-
- if (target)
- {
- target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f);
- target->SpawnCorpseBones();
- target->SaveToDB();
- }
- else
- // will resurrected at login without corpse
- sObjectAccessor->ConvertCorpseForPlayer(target_guid);
-
- return true;
-}
-
-bool ChatHandler::HandleAuraCommand(const char *args)
-{
- Unit* target = getSelectedUnit();
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spellID = extractSpellIdFromLink((char*)args);
-
- if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID))
- Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target);
-
- return true;
-}
-
-bool ChatHandler::HandleUnAuraCommand(const char *args)
-{
- Unit* target = getSelectedUnit();
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string argstr = args;
- if (argstr == "all")
- {
- target->RemoveAllAuras();
- return true;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spellID = extractSpellIdFromLink((char*)args);
- if (!spellID)
- return false;
-
- target->RemoveAurasDueToSpell(spellID);
-
- return true;
-}
-
-bool ChatHandler::HandleLinkGraveCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* px = strtok((char*)args, " ");
- if (!px)
- return false;
-
- uint32 g_id = (uint32)atoi(px);
-
- uint32 g_team;
-
- char* px2 = strtok(NULL, " ");
-
- if (!px2)
- g_team = 0;
- else if (strncmp(px2, "horde", 6) == 0)
- g_team = HORDE;
- else if (strncmp(px2, "alliance", 9) == 0)
- g_team = ALLIANCE;
- else
- return false;
-
- WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id);
-
- if (!graveyard)
- {
- PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, g_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- Player* player = m_session->GetPlayer();
-
- uint32 zoneId = player->GetZoneId();
-
- AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
- if (!areaEntry || areaEntry->zone !=0)
- {
- PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, g_id, zoneId);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (sObjectMgr->AddGraveYardLink(g_id, zoneId, g_team))
- PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id, zoneId);
- else
- PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id, zoneId);
-
- return true;
-}
-
-bool ChatHandler::HandleNearGraveCommand(const char *args)
-{
- uint32 g_team;
-
- size_t argslen = strlen(args);
-
- if (!*args)
- g_team = 0;
- else if (strncmp((char*)args, "horde", argslen) == 0)
- g_team = HORDE;
- else if (strncmp((char*)args, "alliance", argslen) == 0)
- g_team = ALLIANCE;
- else
- return false;
-
- Player* player = m_session->GetPlayer();
- uint32 zone_id = player->GetZoneId();
-
- WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
- player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), g_team);
-
- if (graveyard)
- {
- uint32 g_id = graveyard->ID;
-
- GraveYardData const* data = sObjectMgr->FindGraveYardData(g_id, zone_id);
- if (!data)
- {
- PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, g_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- g_team = data->team;
-
- std::string team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM);
-
- if (g_team == 0)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
- else if (g_team == HORDE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
- else if (g_team == ALLIANCE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
-
- PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id, team_name.c_str(), zone_id);
- }
- else
- {
- std::string team_name;
-
- if (g_team == 0)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
- else if (g_team == HORDE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
- else if (g_team == ALLIANCE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
-
- if (g_team == ~uint32(0))
- PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
- else
- PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str());
- }
-
- return true;
-}
-
-bool ChatHandler::HandleExploreCheatCommand(const char *args)
-{
- if (!*args)
- return false;
-
- int flag = atoi((char*)args);
-
- Player* chr = getSelectedPlayer();
- if (chr == NULL)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (flag != 0)
- {
- PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, GetNameLink().c_str());
- }
- else
- {
- PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, GetNameLink().c_str());
- }
-
- for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
- {
- if (flag != 0)
- m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
- else
- m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
- }
-
- return true;
-}
-
-void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel)
-{
- if (player)
- {
- player->GiveLevel(newLevel);
- player->InitTalentForLevel();
- player->SetUInt32Value(PLAYER_XP, 0);
-
- if (needReportToTarget(player))
- {
- if (oldLevel == newLevel)
- ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, GetNameLink().c_str());
- else if (oldLevel < newLevel)
- ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, GetNameLink().c_str(), newLevel);
- else // if (oldlevel > newlevel)
- ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, GetNameLink().c_str(), newLevel);
- }
- }
- else
- {
- // Update level and reset XP, everything else will be updated at login
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
-
- stmt->setUInt8(0, uint8(newLevel));
- stmt->setUInt32(1, GUID_LOPART(playerGuid));
-
- CharacterDatabase.Execute(stmt);
- }
-}
-
-bool ChatHandler::HandleCharacterLevelCommand(const char *args)
-{
- char* nameStr;
- char* levelStr;
- extractOptFirstArg((char*)args, &nameStr, &levelStr);
- if (!levelStr)
- return false;
-
- // exception opt second arg: .character level $name
- if (isalpha(levelStr[0]))
- {
- nameStr = levelStr;
- levelStr = NULL; // current level will used
- }
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid);
- int32 newlevel = levelStr ? atoi(levelStr) : oldlevel;
-
- if (newlevel < 1)
- return false; // invalid level
-
- if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
- newlevel = STRONG_MAX_LEVEL;
-
- HandleCharacterLevel(target, target_guid, oldlevel, newlevel);
-
- if (!m_session || m_session->GetPlayer() != target) // including player == NULL
- {
- std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleLevelUpCommand(const char *args)
-{
- char* nameStr;
- char* levelStr;
- extractOptFirstArg((char*)args, &nameStr, &levelStr);
-
- // exception opt second arg: .character level $name
- if (levelStr && isalpha(levelStr[0]))
- {
- nameStr = levelStr;
- levelStr = NULL; // current level will used
- }
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid);
- int32 addlevel = levelStr ? atoi(levelStr) : 1;
- int32 newlevel = oldlevel + addlevel;
-
- if (newlevel < 1)
- newlevel = 1;
-
- if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
- newlevel = STRONG_MAX_LEVEL;
-
- HandleCharacterLevel(target, target_guid, oldlevel, newlevel);
-
- if (!m_session || m_session->GetPlayer() != target) // including chr == NULL
- {
- std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleShowAreaCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* chr = getSelectedPlayer();
- if (chr == NULL)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- int area = GetAreaFlagByAreaID(atoi((char*)args));
- int offset = area / 32;
- uint32 val = (uint32)(1 << (area % 32));
-
- if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
- {
- SendSysMessage(LANG_BAD_VALUE);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 currFields = chr->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
- chr->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields | val));
-
- SendSysMessage(LANG_EXPLORE_AREA);
- return true;
-}
-
-bool ChatHandler::HandleHideAreaCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* chr = getSelectedPlayer();
- if (chr == NULL)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- int area = GetAreaFlagByAreaID(atoi((char*)args));
- int offset = area / 32;
- uint32 val = (uint32)(1 << (area % 32));
-
- if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
- {
- SendSysMessage(LANG_BAD_VALUE);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 currFields = chr->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
- chr->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields ^ val));
-
- SendSysMessage(LANG_UNEXPLORE_AREA);
- return true;
-}
-
-bool ChatHandler::HandleBankCommand(const char* /*args*/)
-{
- m_session->SendShowBank(m_session->GetPlayer()->GetGUID());
-
- return true;
-}
-
-bool ChatHandler::HandleChangeWeather(const char *args)
-{
- if (!*args)
- return false;
-
- //Weather is OFF
- if (!sWorld->getBoolConfig(CONFIG_WEATHER))
- {
- SendSysMessage(LANG_WEATHER_DISABLED);
- SetSentErrorMessage(true);
- return false;
- }
-
- // *Change the weather of a cell
- char* px = strtok((char*)args, " ");
- char* py = strtok(NULL, " ");
-
- if (!px || !py)
- return false;
-
- uint32 type = (uint32)atoi(px); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
- float grade = (float)atof(py); //0 to 1, sending -1 is instand good weather
-
- Player* player = m_session->GetPlayer();
- uint32 zoneid = player->GetZoneId();
-
- Weather* wth = WeatherMgr::FindWeather(zoneid);
-
- if (!wth)
- wth = WeatherMgr::AddWeather(zoneid);
- if (!wth)
- {
- SendSysMessage(LANG_NO_WEATHER);
- SetSentErrorMessage(true);
- return false;
- }
-
- wth->SetWeather(WeatherType(type), grade);
-
- return true;
-}
-
-bool ChatHandler::HandleListAurasCommand (const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- char const* talentStr = GetTrinityString(LANG_TALENT);
- char const* passiveStr = GetTrinityString(LANG_PASSIVE);
-
- Unit::AuraApplicationMap const& uAuras = unit->GetAppliedAuras();
- PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, uAuras.size());
- for (Unit::AuraApplicationMap::const_iterator itr = uAuras.begin(); itr != uAuras.end(); ++itr)
- {
- bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0;
-
- AuraApplication const* aurApp = itr->second;
- Aura const* aura = aurApp->GetBase();
- char const* name = aura->GetSpellInfo()->SpellName[GetSessionDbcLocale()];
-
- std::ostringstream ss_name;
- ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";
-
- PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (m_session ? ss_name.str().c_str() : name),
- aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
- aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
- (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
- GUID_LOPART(aura->GetCasterGUID()));
- }
- for (uint16 i = 0; i < TOTAL_AURAS; ++i)
- {
- Unit::AuraEffectList const& uAuraList = unit->GetAuraEffectsByType(AuraType(i));
- if (uAuraList.empty())
- continue;
-
- PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i);
- for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
- {
- PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(),
- (*itr)->GetAmount());
- }
- }
- return true;
-}
-
-bool ChatHandler::HandleResetAchievementsCommand (const char * args)
-{
- Player* target;
- uint64 target_guid;
- if (!extractPlayerTarget((char*)args, &target, &target_guid))
- return false;
-
- if (target)
- target->GetAchievementMgr().Reset();
- else
- AchievementMgr::DeleteFromDB(GUID_LOPART(target_guid));
-
- return true;
-}
-
-bool ChatHandler::HandleResetHonorCommand (const char * args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- target->SetHonorPoints(0);
- target->SetUInt32Value(PLAYER_FIELD_KILLS, 0);
- target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0);
- target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
- target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
- target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
-
- return true;
-}
-
-static bool HandleResetStatsOrLevelHelper(Player* player)
-{
- ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass());
- if (!cEntry)
- {
- sLog->outError("Class %u not found in DBC (Wrong DBC files?)", player->getClass());
- return false;
- }
-
- uint8 powertype = cEntry->powerType;
-
- // reset m_form if no aura
- if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
- player->SetShapeshiftForm(FORM_NONE);
-
- player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
- player->SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH);
-
- player->setFactionForRace(player->getRace());
-
- player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powertype << 24)));
-
- // reset only if player not in some form;
- if (player->GetShapeshiftForm() == FORM_NONE)
- player->InitDisplayIds();
-
- player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
-
- player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
-
- //-1 is default value
- player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1));
-
- //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000);
- return true;
-}
-
-bool ChatHandler::HandleResetLevelCommand(const char * args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- if (!HandleResetStatsOrLevelHelper(target))
- return false;
-
- uint8 oldLevel = target->getLevel();
-
- // set starting level
- uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT
- ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
- : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
-
- target->_ApplyAllLevelScaleItemMods(false);
- target->SetLevel(start_level);
- target->InitRunes();
- target->InitStatsForLevel(true);
- target->InitTaxiNodesForLevel();
- target->InitGlyphsForLevel();
- target->InitTalentForLevel();
- target->SetUInt32Value(PLAYER_XP, 0);
-
- target->_ApplyAllLevelScaleItemMods(true);
-
- // reset level for pet
- if (Pet* pet = target->GetPet())
- pet->SynchronizeLevelWithOwner();
-
- sScriptMgr->OnPlayerLevelChanged(target, oldLevel);
-
- return true;
-}
-
-bool ChatHandler::HandleResetStatsCommand(const char * args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- if (!HandleResetStatsOrLevelHelper(target))
- return false;
-
- target->InitRunes();
- target->InitStatsForLevel(true);
- target->InitTaxiNodesForLevel();
- target->InitGlyphsForLevel();
- target->InitTalentForLevel();
-
- return true;
-}
-
-bool ChatHandler::HandleResetSpellsCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- if (target)
- {
- target->resetSpells(/* bool myClassOnly */);
-
- ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS);
- if (!m_session || m_session->GetPlayer() != target)
- PSendSysMessage(LANG_RESET_SPELLS_ONLINE, GetNameLink(target).c_str());
- }
- else
- {
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
-
- CharacterDatabase.Execute(stmt);
-
- PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str());
- }
-
- return true;
-}
-
-bool ChatHandler::HandleResetTalentsCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- {
- // Try reset talents as Hunter Pet
- Creature* creature = getSelectedCreature();
- if (!*args && creature && creature->isPet())
- {
- Unit* owner = creature->GetOwner();
- if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer()))
- {
- creature->ToPet()->resetTalents();
- owner->ToPlayer()->SendTalentsInfoData(true);
-
- ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS);
- if (!m_session || m_session->GetPlayer() != owner->ToPlayer())
- PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, GetNameLink(owner->ToPlayer()).c_str());
- }
- return true;
- }
-
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target)
- {
- target->resetTalents(true);
- target->SendTalentsInfoData(false);
- ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
- if (!m_session || m_session->GetPlayer() != target)
- PSendSysMessage(LANG_RESET_TALENTS_ONLINE, GetNameLink(target).c_str());
-
- Pet* pet = target->GetPet();
- Pet::resetTalentsForAllPetsOf(target, pet);
- if (pet)
- target->SendTalentsInfoData(true);
- return true;
- }
- else if (targetGuid)
- {
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
-
- CharacterDatabase.Execute(stmt);
-
- std::string nameLink = playerLink(targetName);
- PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str());
- return true;
- }
-
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
-}
-
-bool ChatHandler::HandleResetAllCommand(const char * args)
-{
- if (!*args)
- return false;
-
- std::string casename = args;
-
- AtLoginFlags atLogin;
-
- // Command specially created as single command to prevent using short case names
- if (casename == "spells")
- {
- atLogin = AT_LOGIN_RESET_SPELLS;
- sWorld->SendWorldText(LANG_RESETALL_SPELLS);
- if (!m_session)
- SendSysMessage(LANG_RESETALL_SPELLS);
- }
- else if (casename == "talents")
- {
- atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS);
- sWorld->SendWorldText(LANG_RESETALL_TALENTS);
- if (!m_session)
- SendSysMessage(LANG_RESETALL_TALENTS);
- }
- else
- {
- PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args);
- SetSentErrorMessage(true);
- return false;
- }
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
-
- stmt->setUInt16(0, uint16(atLogin));
-
- CharacterDatabase.Execute(stmt);
-
- TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
- HashMapHolder<Player>::MapType const& plist = sObjectAccessor->GetPlayers();
- for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
- itr->second->SetAtLoginFlag(atLogin);
-
- return true;
-}
-
-bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/)
-{
- sWorld->ShutdownCancel();
- return true;
-}
-
-bool ChatHandler::HandleServerShutDownCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, 0, exitcode);
- }
- else
- sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleServerRestartCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode);
- }
- else
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleServerIdleRestartCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
- }
- else
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleServerIdleShutDownCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode);
- }
- else
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleBanAccountCommand(const char *args)
-{
- return HandleBanHelper(BAN_ACCOUNT, args);
-}
-
-bool ChatHandler::HandleBanAccountByCharCommand(const char *args)
-{
- return HandleBanHelper(BAN_CHARACTER, args);
-}
-
-bool ChatHandler::HandleBanCharacterCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cname = strtok((char*)args, " ");
- if (!cname)
- return false;
-
- std::string name = cname;
-
- char* duration = strtok(NULL, " ");
- if (!duration || !atoi(duration))
- return false;
-
- char* reason = strtok(NULL, "");
- if (!reason)
- return false;
-
- if (!normalizePlayerName(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- switch (sWorld->BanCharacter(name, duration, reason, m_session ? m_session->GetPlayerName() : ""))
- {
- case BAN_SUCCESS:
- {
- if (atoi(duration) > 0)
- PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(duration), true).c_str(), reason);
- else
- PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reason);
- break;
- }
- case BAN_NOTFOUND:
- {
- PSendSysMessage(LANG_BAN_NOTFOUND, "character", name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- default:
- break;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleBanIPCommand(const char *args)
-{
- return HandleBanHelper(BAN_IP, args);
-}
-
-bool ChatHandler::HandleBanHelper(BanMode mode, const char *args)
-{
- if (!*args)
- return false;
-
- char* cnameOrIP = strtok ((char*)args, " ");
- if (!cnameOrIP)
- return false;
-
- std::string nameOrIP = cnameOrIP;
-
- char* duration = strtok (NULL, " ");
- if (!duration || !atoi(duration))
- return false;
-
- char* reason = strtok (NULL, "");
- if (!reason)
- return false;
-
- switch (mode)
- {
- case BAN_ACCOUNT:
- if (!AccountMgr::normalizeString(nameOrIP))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- break;
- case BAN_CHARACTER:
- if (!normalizePlayerName(nameOrIP))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
- break;
- case BAN_IP:
- if (!IsIPAddress(nameOrIP.c_str()))
- return false;
- break;
- }
-
- switch (sWorld->BanAccount(mode, nameOrIP, duration, reason, m_session ? m_session->GetPlayerName() : ""))
- {
- case BAN_SUCCESS:
- if (atoi(duration)>0)
- PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(duration), true).c_str(), reason);
- else
- PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reason);
- break;
- case BAN_SYNTAX_ERROR:
- return false;
- case BAN_NOTFOUND:
- switch (mode)
- {
- default:
- PSendSysMessage(LANG_BAN_NOTFOUND, "account", nameOrIP.c_str());
- break;
- case BAN_CHARACTER:
- PSendSysMessage(LANG_BAN_NOTFOUND, "character", nameOrIP.c_str());
- break;
- case BAN_IP:
- PSendSysMessage(LANG_BAN_NOTFOUND, "ip", nameOrIP.c_str());
- break;
- }
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleUnBanAccountCommand(const char *args)
-{
- return HandleUnBanHelper(BAN_ACCOUNT, args);
-}
-
-bool ChatHandler::HandleUnBanAccountByCharCommand(const char *args)
-{
- return HandleUnBanHelper(BAN_CHARACTER, args);
-}
-
-bool ChatHandler::HandleUnBanCharacterCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cname = strtok((char*)args, " ");
- if (!cname)
- return false;
-
- std::string name = cname;
-
- if (!normalizePlayerName(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!sWorld->RemoveBanCharacter(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleUnBanIPCommand(const char *args)
-{
- return HandleUnBanHelper(BAN_IP, args);
-}
-
-bool ChatHandler::HandleUnBanHelper(BanMode mode, const char *args)
-{
- if (!*args)
- return false;
-
- char* cnameOrIP = strtok ((char*)args, " ");
- if (!cnameOrIP)
- return false;
-
- std::string nameOrIP = cnameOrIP;
-
- switch (mode)
- {
- case BAN_ACCOUNT:
- if (!AccountMgr::normalizeString(nameOrIP))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- break;
- case BAN_CHARACTER:
- if (!normalizePlayerName(nameOrIP))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
- break;
- case BAN_IP:
- if (!IsIPAddress(nameOrIP.c_str()))
- return false;
- break;
- }
-
- if (sWorld->RemoveBanAccount(mode, nameOrIP))
- PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
- else
- PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
-
- return true;
-}
-
-bool ChatHandler::HandleBanInfoAccountCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cname = strtok((char*)args, "");
- if (!cname)
- return false;
-
- std::string account_name = cname;
- if (!AccountMgr::normalizeString(account_name))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 accountid = AccountMgr::GetId(account_name);
- if (!accountid)
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- return true;
- }
-
- return HandleBanInfoHelper(accountid, account_name.c_str());
-}
-
-bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* target = sObjectAccessor->FindPlayerByName(args);
- uint32 target_guid = 0;
- std::string name(args);
-
- if (!target)
- {
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
- stmt->setString(0, name);
- PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
-
- if (!resultCharacter)
- {
- PSendSysMessage(LANG_BANINFO_NOCHARACTER);
- return false;
- }
-
- target_guid = (*resultCharacter)[0].GetUInt32();
- }
- else
- target_guid = target->GetGUIDLow();
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
- stmt->setUInt32(0, target_guid);
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
- if (!result)
- {
- PSendSysMessage(LANG_CHAR_NOT_BANNED, name.c_str());
- return true;
- }
-
- PSendSysMessage(LANG_BANINFO_BANHISTORY, name.c_str());
- do
- {
- Field* fields = result->Fetch();
- time_t unbandate = time_t(fields[3].GetUInt32());
- bool active = false;
- if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbandate >= time(NULL)))
- active = true;
- bool permanent = (fields[1].GetUInt32() == uint32(0));
- std::string bantime = permanent ? GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true);
- PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
- fields[0].GetCString(), bantime.c_str(), active ? GetTrinityString(LANG_BANINFO_YES) : GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
- }
- while (result->NextRow());
-
- return true;
-}
-
-bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname)
-{
- QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC", accountid);
- if (!result)
- {
- PSendSysMessage(LANG_BANINFO_NOACCOUNTBAN, accountname);
- return true;
- }
-
- PSendSysMessage(LANG_BANINFO_BANHISTORY, accountname);
- do
- {
- Field* fields = result->Fetch();
-
- time_t unbandate = time_t(fields[3].GetUInt64());
- bool active = false;
- if (fields[2].GetBool() && (fields[1].GetUInt64() == (uint64)0 ||unbandate >= time(NULL)))
- active = true;
- bool permanent = (fields[1].GetUInt64() == (uint64)0);
- std::string bantime = permanent ? GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
- PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
- fields[0].GetCString(), bantime.c_str(), active ? GetTrinityString(LANG_BANINFO_YES) : GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
- } while (result->NextRow());
-
- return true;
-}
-
-bool ChatHandler::HandleBanInfoIPCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cIP = strtok ((char*)args, "");
- if (!cIP)
- return false;
-
- if (!IsIPAddress(cIP))
- return false;
-
- std::string IP = cIP;
-
- LoginDatabase.EscapeString(IP);
- QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason, bannedby, unbandate-bandate FROM ip_banned WHERE ip = '%s'", IP.c_str());
- if (!result)
- {
- PSendSysMessage(LANG_BANINFO_NOIP);
- return true;
- }
-
- Field* fields = result->Fetch();
- bool permanent = !fields[6].GetUInt64();
- PSendSysMessage(LANG_BANINFO_IPENTRY,
- fields[0].GetCString(), fields[1].GetCString(), permanent ? GetTrinityString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
- permanent ? GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetCString(), fields[5].GetCString());
-
- return true;
-}
-
-bool ChatHandler::HandleBanListCharacterCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cFilter = strtok((char*)args, " ");
- if (!cFilter)
- return false;
-
- std::string filter(cFilter);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
- stmt->setString(0, filter);
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
- if (!result)
- {
- PSendSysMessage(LANG_BANLIST_NOCHARACTER);
- return true;
- }
-
- PSendSysMessage(LANG_BANLIST_MATCHINGCHARACTER);
-
- // Chat short output
- if (m_session)
- {
- do
- {
- Field* fields = result->Fetch();
- PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
- stmt2->setUInt32(0, fields[0].GetUInt32());
- PreparedQueryResult banresult = CharacterDatabase.Query(stmt2);
- if (banresult)
- PSendSysMessage("%s", (*banresult)[0].GetCString());
- }
- while (result->NextRow());
- }
- // Console wide output
- else
- {
- SendSysMessage(LANG_BANLIST_CHARACTERS);
- SendSysMessage(" =============================================================================== ");
- SendSysMessage(LANG_BANLIST_CHARACTERS_HEADER);
- do
- {
- SendSysMessage("-------------------------------------------------------------------------------");
-
- Field* fields = result->Fetch();
-
- std::string char_name = fields[1].GetString();
-
- PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
- stmt2->setUInt32(0, fields[0].GetUInt32());
- PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
- if (banInfo)
- {
- Field* banFields = banInfo->Fetch();
- do
- {
- time_t t_ban = time_t(banFields[0].GetUInt32());
- tm* aTm_ban = localtime(&t_ban);
-
- if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
- {
- PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
- char_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
- banFields[2].GetCString(), banFields[3].GetCString());
- }
- else
- {
- time_t t_unban = time_t(banFields[1].GetUInt32());
- tm* aTm_unban = localtime(&t_unban);
- PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
- char_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
- aTm_unban->tm_year%100, aTm_unban->tm_mon+1, aTm_unban->tm_mday, aTm_unban->tm_hour, aTm_unban->tm_min,
- banFields[2].GetCString(), banFields[3].GetCString());
- }
- }
- while (banInfo->NextRow());
- }
- }
- while (result->NextRow());
- SendSysMessage(" =============================================================================== ");
- }
-
- return true;
-}
-
-bool ChatHandler::HandleBanListAccountCommand(const char *args)
-{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
- LoginDatabase.Execute(stmt);
-
- char* cFilter = strtok((char*)args, " ");
- std::string filter = cFilter ? cFilter : "";
-
- PreparedQueryResult result;
-
- if (filter.empty())
- {
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL);
-
- result = LoginDatabase.Query(stmt);
- }
- else
- {
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME);
-
- stmt->setString(0, filter);
-
- result = LoginDatabase.Query(stmt);
- }
-
- if (!result)
- {
- PSendSysMessage(LANG_BANLIST_NOACCOUNT);
- return true;
- }
-
- return HandleBanListHelper(result);
-}
-
-bool ChatHandler::HandleBanListHelper(PreparedQueryResult result)
-{
- PSendSysMessage(LANG_BANLIST_MATCHINGACCOUNT);
-
- // Chat short output
- if (m_session)
- {
- do
- {
- Field* fields = result->Fetch();
- uint32 accountid = fields[0].GetUInt32();
-
- QueryResult banresult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id", accountid);
- if (banresult)
- {
- Field* fields2 = banresult->Fetch();
- PSendSysMessage("%s", fields2[0].GetCString());
- }
- } while (result->NextRow());
- }
- // Console wide output
- else
- {
- SendSysMessage(LANG_BANLIST_ACCOUNTS);
- SendSysMessage(" ===============================================================================");
- SendSysMessage(LANG_BANLIST_ACCOUNTS_HEADER);
- do
- {
- SendSysMessage("-------------------------------------------------------------------------------");
- Field* fields = result->Fetch();
- uint32 account_id = fields[0].GetUInt32();
-
- std::string account_name;
-
- // "account" case, name can be get in same query
- if (result->GetFieldCount() > 1)
- account_name = fields[1].GetString();
- // "character" case, name need extract from another DB
- else
- AccountMgr::GetName (account_id, account_name);
-
- // No SQL injection. id is uint32.
- QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
- if (banInfo)
- {
- Field* fields2 = banInfo->Fetch();
- do
- {
- time_t t_ban = fields2[0].GetUInt64();
- tm* aTm_ban = localtime(&t_ban);
-
- if (fields2[0].GetUInt64() == fields2[1].GetUInt64())
- {
- PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
- account_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
- fields2[2].GetCString(), fields2[3].GetCString());
- }
- else
- {
- time_t t_unban = fields2[1].GetUInt64();
- tm* aTm_unban = localtime(&t_unban);
- PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
- account_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
- aTm_unban->tm_year%100, aTm_unban->tm_mon+1, aTm_unban->tm_mday, aTm_unban->tm_hour, aTm_unban->tm_min,
- fields2[2].GetCString(), fields2[3].GetCString());
- }
- } while (banInfo->NextRow());
- }
- }while (result->NextRow());
- SendSysMessage(" ===============================================================================");
- }
- return true;
-}
-
-bool ChatHandler::HandleBanListIPCommand(const char *args)
-{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
- LoginDatabase.Execute(stmt);
-
- char* cFilter = strtok((char*)args, " ");
- std::string filter = cFilter ? cFilter : "";
- LoginDatabase.EscapeString(filter);
-
- PreparedQueryResult result;
-
- if (filter.empty())
- {
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_ALL);
-
- result = LoginDatabase.Query(stmt);
- }
- else
- {
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_BY_IP);
-
- stmt->setString(0, filter);
-
- result = LoginDatabase.Query(stmt);
- }
-
- if (!result)
- {
- PSendSysMessage(LANG_BANLIST_NOIP);
- return true;
- }
-
- PSendSysMessage(LANG_BANLIST_MATCHINGIP);
- // Chat short output
- if (m_session)
- {
- do
- {
- Field* fields = result->Fetch();
- PSendSysMessage("%s", fields[0].GetCString());
- } while (result->NextRow());
- }
- // Console wide output
- else
- {
- SendSysMessage(LANG_BANLIST_IPS);
- SendSysMessage(" ===============================================================================");
- SendSysMessage(LANG_BANLIST_IPS_HEADER);
- do
- {
- SendSysMessage("-------------------------------------------------------------------------------");
- Field* fields = result->Fetch();
- time_t t_ban = fields[1].GetUInt64();
- tm* aTm_ban = localtime(&t_ban);
- if (fields[1].GetUInt64() == fields[2].GetUInt64())
- {
- PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
- fields[0].GetCString(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
- fields[3].GetCString(), fields[4].GetCString());
- }
- else
- {
- time_t t_unban = fields[2].GetUInt64();
- tm* aTm_unban = localtime(&t_unban);
- PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
- fields[0].GetCString(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
- aTm_unban->tm_year%100, aTm_unban->tm_mon+1, aTm_unban->tm_mday, aTm_unban->tm_hour, aTm_unban->tm_min,
- fields[3].GetCString(), fields[4].GetCString());
- }
- }while (result->NextRow());
- SendSysMessage(" ===============================================================================");
- }
-
- return true;
-}
-
-bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- // accept only explicitly selected target (not implicitly self targeting case)
- Unit* target = getSelectedUnit();
- if (player->GetSelection() && target)
- {
- if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target->isDead())
- target->ToCreature()->Respawn();
- return true;
- }
-
- CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
- Cell cell(p);
- cell.SetNoCreate();
-
- Trinity::RespawnDo u_do;
- Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(player, u_do);
-
- TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
- cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange());
-
- return true;
-}
-
-bool ChatHandler::HandlePDumpLoadCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char * file = strtok((char*)args, " ");
- if (!file)
- return false;
-
- char * account = strtok(NULL, " ");
- if (!account)
- return false;
-
- std::string account_name = account;
- if (!AccountMgr::normalizeString(account_name))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 account_id = AccountMgr::GetId(account_name);
- if (!account_id)
- {
- account_id = atoi(account); // use original string
- if (!account_id)
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- if (!AccountMgr::GetName(account_id, account_name))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- char* guid_str = NULL;
- char* name_str = strtok(NULL, " ");
-
- std::string name;
- if (name_str)
- {
- name = name_str;
- // normalize the name if specified and check if it exists
- if (!normalizePlayerName(name))
- {
- PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (ObjectMgr::CheckPlayerName(name, true) != CHAR_NAME_SUCCESS)
- {
- PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
- SetSentErrorMessage(true);
- return false;
- }
-
- guid_str = strtok(NULL, " ");
- }
-
- uint32 guid = 0;
-
- if (guid_str)
- {
- guid = atoi(guid_str);
- if (!guid)
- {
- PSendSysMessage(LANG_INVALID_CHARACTER_GUID);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (sObjectMgr->GetPlayerAccountIdByGUID(guid))
- {
- PSendSysMessage(LANG_CHARACTER_GUID_IN_USE, guid);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- switch (PlayerDumpReader().LoadDump(file, account_id, name, guid))
- {
- case DUMP_SUCCESS:
- PSendSysMessage(LANG_COMMAND_IMPORT_SUCCESS);
- break;
- case DUMP_FILE_OPEN_ERROR:
- PSendSysMessage(LANG_FILE_OPEN_FAIL, file);
- SetSentErrorMessage(true);
- return false;
- case DUMP_FILE_BROKEN:
- PSendSysMessage(LANG_DUMP_BROKEN, file);
- SetSentErrorMessage(true);
- return false;
- case DUMP_TOO_MANY_CHARS:
- PSendSysMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account_name.c_str(), account_id);
- SetSentErrorMessage(true);
- return false;
- default:
- PSendSysMessage(LANG_COMMAND_IMPORT_FAILED);
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandlePDumpWriteCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* file = strtok((char*)args, " ");
- char* p2 = strtok(NULL, " ");
-
- if (!file || !p2)
- return false;
-
- uint64 guid;
- // character name can't start from number
- if (isNumeric(p2))
- guid = MAKE_NEW_GUID(atoi(p2), 0, HIGHGUID_PLAYER);
- else
- {
- std::string name = extractPlayerNameFromLink(p2);
- if (name.empty())
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- guid = sObjectMgr->GetPlayerGUIDByName(name);
- }
-
- if (!sObjectMgr->GetPlayerAccountIdByGUID(guid))
- {
- PSendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- switch (PlayerDumpWriter().WriteDump(file, uint32(guid)))
- {
- case DUMP_SUCCESS:
- PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS);
- break;
- case DUMP_FILE_OPEN_ERROR:
- PSendSysMessage(LANG_FILE_OPEN_FAIL, file);
- SetSentErrorMessage(true);
- return false;
- case DUMP_CHARACTER_DELETED:
- PSendSysMessage(LANG_COMMAND_EXPORT_DELETED_CHAR);
- SetSentErrorMessage(true);
- return false;
- default:
- PSendSysMessage(LANG_COMMAND_EXPORT_FAILED);
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow());
-
- MotionMaster* mm = unit->GetMotionMaster();
- float x,y,z;
- mm->GetDestination(x,y,z);
-
- for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
- {
- MovementGenerator* mg = mm->GetMotionSlot(i);
- if (!mg)
- {
- SendSysMessage("Empty");
- continue;
- }
- switch (mg->GetMovementGeneratorType())
- {
- case IDLE_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_IDLE); break;
- case RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_RANDOM); break;
- case WAYPOINT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_WAYPOINT); break;
- case ANIMAL_RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM); break;
- case CONFUSED_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_CONFUSED); break;
- case CHASE_MOTION_TYPE:
- {
- Unit* target = NULL;
- if (unit->GetTypeId() == TYPEID_PLAYER)
- target = static_cast<ChaseMovementGenerator<Player> const*>(mg)->GetTarget();
- else
- target = static_cast<ChaseMovementGenerator<Creature> const*>(mg)->GetTarget();
-
- if (!target)
- SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
- else if (target->GetTypeId() == TYPEID_PLAYER)
- PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow());
- else
- PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow());
- break;
- }
- case FOLLOW_MOTION_TYPE:
- {
- Unit* target = NULL;
- if (unit->GetTypeId() == TYPEID_PLAYER)
- target = static_cast<FollowMovementGenerator<Player> const*>(mg)->GetTarget();
- else
- target = static_cast<FollowMovementGenerator<Creature> const*>(mg)->GetTarget();
-
- if (!target)
- SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
- else if (target->GetTypeId() == TYPEID_PLAYER)
- PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow());
- else
- PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow());
- break;
- }
- case HOME_MOTION_TYPE:
- {
- if (unit->GetTypeId() == TYPEID_UNIT)
- PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
- else
- SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
- break;
- }
- case FLIGHT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FLIGHT); break;
- case POINT_MOTION_TYPE:
- {
- PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
- break;
- }
- case FLEEING_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FEAR); break;
- case DISTRACT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_DISTRACT); break;
- case EFFECT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_EFFECT); break;
- default:
- PSendSysMessage(LANG_MOVEGENS_UNKNOWN, mg->GetMovementGeneratorType());
- break;
- }
- }
- return true;
-}
-
-bool ChatHandler::HandleServerPLimitCommand(const char *args)
-{
- if (*args)
- {
- char* param = strtok((char*)args, " ");
- if (!param)
- return false;
-
- int l = strlen(param);
-
- if (strncmp(param, "player", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_PLAYER);
- else if (strncmp(param, "moderator", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_MODERATOR);
- else if (strncmp(param, "gamemaster", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER);
- else if (strncmp(param, "administrator", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
- else if (strncmp(param, "reset", l) == 0)
- {
- sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100));
- sWorld->LoadDBAllowedSecurityLevel();
- }
- else
- {
- int val = atoi(param);
- if (val < 0)
- sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
- else
- sWorld->SetPlayerAmountLimit(uint32(val));
- }
- }
-
- uint32 pLimit = sWorld->GetPlayerAmountLimit();
- AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
- char const* secName = "";
- switch (allowedAccountType)
- {
- case SEC_PLAYER: secName = "Player"; break;
- case SEC_MODERATOR: secName = "Moderator"; break;
- case SEC_GAMEMASTER: secName = "Gamemaster"; break;
- case SEC_ADMINISTRATOR: secName = "Administrator"; break;
- default: secName = "<unknown>"; break;
- }
-
- PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName);
-
- return true;
-}
-
-bool ChatHandler::HandleCastCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Unit* target = getSelectedUnit();
-
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell)
- return false;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (!spellInfo)
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- m_session->GetPlayer()->CastSpell(target, spell, triggered);
-
- return true;
-}
-
-bool ChatHandler::HandleCastBackCommand(const char *args)
-{
- Creature* caster = getSelectedCreature();
-
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellMgr->GetSpellInfo(spell))
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- caster->CastSpell(m_session->GetPlayer(), spell, triggered);
-
- return true;
-}
-
-bool ChatHandler::HandleCastDistCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell)
- return false;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (!spellInfo)
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
- SetSentErrorMessage(true);
- return false;
- }
-
- char *distStr = strtok(NULL, " ");
-
- float dist = 0;
-
- if (distStr)
- sscanf(distStr, "%f", &dist);
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- float x, y, z;
- m_session->GetPlayer()->GetClosePoint(x, y, z, dist);
-
- m_session->GetPlayer()->CastSpell(x, y, z, spell, triggered);
- return true;
-}
-
-bool ChatHandler::HandleCastTargetCommand(const char *args)
-{
- Creature* caster = getSelectedCreature();
-
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!caster->getVictim())
- {
- SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellMgr->GetSpellInfo(spell))
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- caster->CastSpell(caster->getVictim(), spell, triggered);
-
- return true;
-}
-
-bool ChatHandler::HandleCastDestCommand(const char *args)
-{
- Unit* caster = getSelectedUnit();
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellMgr->GetSpellInfo(spell))
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* px = strtok(NULL, " ");
- char* py = strtok(NULL, " ");
- char* pz = strtok(NULL, " ");
-
- if (!px || !py || !pz)
- return false;
-
- float x = (float)atof(px);
- float y = (float)atof(py);
- float z = (float)atof(pz);
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- caster->CastSpell(x, y, z, spell, triggered);
-
- return true;
-}
-
-/*
-ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
-Without this function 3rd party scripting library will get linking errors (unresolved external)
-when attempting to use the PointMovementGenerator
-*/
-bool ChatHandler::HandleComeToMeCommand(const char *args)
-{
- char* newFlagStr = strtok((char*)args, " ");
-
- if (!newFlagStr)
- return false;
-
- Creature* caster = getSelectedCreature();
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- Player* player = m_session->GetPlayer();
-
- caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
- return true;
-}
-
-bool ChatHandler::HandleCastSelfCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Unit* target = getSelectedUnit();
-
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell)
- return false;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (!spellInfo)
- return false;
-
- if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
- SetSentErrorMessage(true);
- return false;
- }
-
- target->CastSpell(target, spell, false);
-
- return true;
-}
-
-std::string GetTimeString(uint64 time)
-{
- uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE;
- std::ostringstream ss;
- if (days) ss << days << "d ";
- if (hours) ss << hours << "h ";
- ss << minute << 'm';
- return ss.str();
-}
-
-bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
-{
- Player* player = getSelectedPlayer();
- if (!player) player = m_session->GetPlayer();
- uint32 counter = 0;
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
- for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
- {
- InstanceSave* save = itr->second.save;
- std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
- PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
- counter++;
- }
- }
- PSendSysMessage("player binds: %d", counter);
- counter = 0;
- Group* group = player->GetGroup();
- if (group)
- {
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i));
- for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
- {
- InstanceSave* save = itr->second.save;
- std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
- PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
- counter++;
- }
- }
- }
- PSendSysMessage("group binds: %d", counter);
-
- return true;
-}
-
-bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* player = getSelectedPlayer();
- if (!player)
- player = m_session->GetPlayer();
-
- char* map = strtok((char*)args, " ");
- char* pDiff = strtok(NULL, " ");
- int8 diff = -1;
- if (pDiff)
- diff = atoi(pDiff);
- uint16 counter = 0;
- uint16 MapId = 0;
-
- if (strcmp(map, "all"))
- {
- MapId = uint16(atoi(map));
- if (!MapId)
- return false;
- }
-
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
- for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
- {
- InstanceSave* save = itr->second.save;
- if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
- {
- std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
- PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
- player->UnbindInstance(itr, Difficulty(i));
- counter++;
- }
- else
- ++itr;
- }
- }
- PSendSysMessage("instances unbound: %d", counter);
- return true;
-}
-
-bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
-{
- PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances());
- PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances());
- PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves());
- PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal());
- PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal());
- return true;
-}
-
-bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- Map* map = player->GetMap();
- if (!map->IsDungeon())
- {
- PSendSysMessage("Map is not a dungeon.");
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!((InstanceMap*)map)->GetInstanceScript())
- {
- PSendSysMessage("Map has no instance data.");
- SetSentErrorMessage(true);
- return false;
- }
-
- ((InstanceMap*)map)->GetInstanceScript()->SaveToDB();
- return true;
-}
-
-/// Define the 'Message of the day' for the realm
-bool ChatHandler::HandleServerSetMotdCommand(const char *args)
-{
- sWorld->SetMotd(args);
- PSendSysMessage(LANG_MOTD_NEW, args);
- return true;
-}
-
-/// Set whether we accept new clients
-bool ChatHandler::HandleServerSetClosedCommand(const char *args)
-{
- if (strncmp(args, "on", 3) == 0)
- {
- SendSysMessage(LANG_WORLD_CLOSED);
- sWorld->SetClosed(true);
- return true;
- }
- else if (strncmp(args, "off", 4) == 0)
- {
- SendSysMessage(LANG_WORLD_OPENED);
- sWorld->SetClosed(false);
- return true;
- }
-
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
-}
-
-//Send items by mail
-bool ChatHandler::HandleSendItemsCommand(const char *args)
-{
- // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
- Player* receiver;
- uint64 receiver_guid;
- std::string receiver_name;
- if (!extractPlayerTarget((char*)args, &receiver, &receiver_guid, &receiver_name))
- return false;
-
- char* tail1 = strtok(NULL, "");
- if (!tail1)
- return false;
-
- char* msgSubject = extractQuotedArg(tail1);
- if (!msgSubject)
- return false;
-
- char* tail2 = strtok(NULL, "");
- if (!tail2)
- return false;
-
- char* msgText = extractQuotedArg(tail2);
- if (!msgText)
- return false;
-
- // msgSubject, msgText isn't NUL after prev. check
- std::string subject = msgSubject;
- std::string text = msgText;
-
- // extract items
- typedef std::pair<uint32, uint32> ItemPair;
- typedef std::list< ItemPair > ItemPairs;
- ItemPairs items;
-
- // get all tail string
- char* tail = strtok(NULL, "");
-
- // get from tail next item str
- while (char* itemStr = strtok(tail, " "))
- {
- // and get new tail
- tail = strtok(NULL, "");
-
- // parse item str
- char* itemIdStr = strtok(itemStr, ":");
- char* itemCountStr = strtok(NULL, " ");
-
- uint32 item_id = atoi(itemIdStr);
- if (!item_id)
- return false;
-
- ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(item_id);
- if (!item_proto)
- {
- PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1;
- if (item_count < 1 || (item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount)))
- {
- PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count, item_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- while (item_count > item_proto->GetMaxStackSize())
- {
- items.push_back(ItemPair(item_id, item_proto->GetMaxStackSize()));
- item_count -= item_proto->GetMaxStackSize();
- }
-
- items.push_back(ItemPair(item_id, item_count));
-
- if (items.size() > MAX_MAIL_ITEMS)
- {
- PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- // from console show not existed sender
- MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
-
- // fill mail
- MailDraft draft(subject, text);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
-
- for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
- {
- if (Item* item = Item::CreateItem(itr->first, itr->second, m_session ? m_session->GetPlayer() : 0))
- {
- item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted
- draft.AddItem(item);
- }
- }
-
- draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiver_guid)), sender);
- CharacterDatabase.CommitTransaction(trans);
-
- std::string nameLink = playerLink(receiver_name);
- PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
- return true;
-}
-
-///Send money by mail
-bool ChatHandler::HandleSendMoneyCommand(const char *args)
-{
- /// format: name "subject text" "mail text" money
-
- Player* receiver;
- uint64 receiver_guid;
- std::string receiver_name;
- if (!extractPlayerTarget((char*)args, &receiver, &receiver_guid, &receiver_name))
- return false;
-
- char* tail1 = strtok(NULL, "");
- if (!tail1)
- return false;
-
- char* msgSubject = extractQuotedArg(tail1);
- if (!msgSubject)
- return false;
-
- char* tail2 = strtok(NULL, "");
- if (!tail2)
- return false;
-
- char* msgText = extractQuotedArg(tail2);
- if (!msgText)
- return false;
-
- char* money_str = strtok(NULL, "");
- int32 money = money_str ? atoi(money_str) : 0;
- if (money <= 0)
- return false;
-
- // msgSubject, msgText isn't NUL after prev. check
- std::string subject = msgSubject;
- std::string text = msgText;
-
- // from console show not existed sender
- MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
-
- MailDraft(subject, text)
- .AddMoney(money)
- .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiver_guid)), sender);
-
- CharacterDatabase.CommitTransaction(trans);
-
- std::string nameLink = playerLink(receiver_name);
- PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
- return true;
-}
-
-/// Send a message to a player in game
-bool ChatHandler::HandleSendMessageCommand(const char *args)
-{
- ///- Find the player
- Player* rPlayer;
- if (!extractPlayerTarget((char*)args, &rPlayer))
- return false;
-
- char* msg_str = strtok(NULL, "");
- if (!msg_str)
- return false;
-
- ///- Check that he is not logging out.
- if (rPlayer->GetSession()->isLogingOut())
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- ///- Send the message
- //Use SendAreaTriggerMessage for fastest delivery.
- rPlayer->GetSession()->SendAreaTriggerMessage("%s", msg_str);
- rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
-
- //Confirmation message
- std::string nameLink = GetNameLink(rPlayer);
- PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msg_str);
- return true;
-}
-
-bool ChatHandler::HandleFlushArenaPointsCommand(const char * /*args*/)
-{
- sArenaTeamMgr->DistributeArenaPoints();
- return true;
-}
-
-bool ChatHandler::HandleChannelSetOwnership(const char *args)
-{
- if (!*args)
- return false;
- char *channel = strtok((char*)args, " ");
- char *argstr = strtok(NULL, "");
-
- if (!channel || !argstr)
- return false;
-
- Player* player = m_session->GetPlayer();
- Channel* chn = NULL;
-
- if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
- chn = cMgr->GetChannel(channel, player);
-
- if (strcmp(argstr, "on") == 0)
- {
- if (chn)
- chn->SetOwnership(true);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
- stmt->setUInt8 (0, 1);
- stmt->setString(1, channel);
- CharacterDatabase.Execute(stmt);
- PSendSysMessage(LANG_CHANNEL_ENABLE_OWNERSHIP, channel);
- }
- else if (strcmp(argstr, "off") == 0)
- {
- if (chn)
- chn->SetOwnership(false);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
- stmt->setUInt8 (0, 0);
- stmt->setString(1, channel);
- CharacterDatabase.Execute(stmt);
- PSendSysMessage(LANG_CHANNEL_DISABLE_OWNERSHIP, channel);
- }
- else
- return false;
-
- return true;
-}
-
-bool ChatHandler::HandlePlayAllCommand(const char *args)
-{
- if (!*args)
- return false;
-
- uint32 soundId = atoi((char*)args);
-
- if (!sSoundEntriesStore.LookupEntry(soundId))
- {
- PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId);
- SetSentErrorMessage(true);
- return false;
- }
-
- WorldPacket data(SMSG_PLAY_SOUND, 4);
- data << uint32(soundId) << m_session->GetPlayer()->GetGUID();
- sWorld->SendGlobalMessage(&data);
-
- PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId);
- return true;
-}
-
-bool ChatHandler::HandleFreezeCommand(const char *args)
-{
- std::string name;
- Player* player;
- char *TargetName = strtok((char*)args, " "); //get entered name
- if (!TargetName) //if no name entered use target
- {
- player = getSelectedPlayer();
- if (player) //prevent crash with creature as target
- {
- name = player->GetName();
- normalizePlayerName(name);
- }
- }
- else // if name entered
- {
- name = TargetName;
- normalizePlayerName(name);
- player = sObjectAccessor->FindPlayerByName(name.c_str());
- }
-
- if (!player)
- {
- SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
- return true;
- }
-
- if (player == m_session->GetPlayer())
- {
- SendSysMessage(LANG_COMMAND_FREEZE_ERROR);
- return true;
- }
-
- //effect
- if (player && player != m_session->GetPlayer())
- {
- PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str());
-
- //stop combat + make player unattackable + duel stop + stop some spells
- player->setFaction(35);
- player->CombatStop();
- if (player->IsNonMeleeSpellCasted(true))
- player->InterruptNonMeleeSpells(true);
- player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- //if player class = hunter || warlock remove pet if alive
- if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
- {
- if (Pet* pet = player->GetPet())
- {
- pet->SavePetToDB(PET_SAVE_AS_CURRENT);
- // not let dismiss dead pet
- if (pet && pet->isAlive())
- player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
- }
- }
-
- //m_session->GetPlayer()->CastSpell(player, spellID, false);
- if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454))
- Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player);
-
- //save player
- player->SaveToDB();
- }
- return true;
-}
-
-bool ChatHandler::HandleUnFreezeCommand(const char *args)
-{
- std::string name;
- Player* player;
- char* targetName = strtok((char*)args, " "); // Get entered name
-
- if (targetName)
- {
- name = targetName;
- normalizePlayerName(name);
- player = sObjectAccessor->FindPlayerByName(name.c_str());
- }
- else // If no name was entered - use target
- {
- player = getSelectedPlayer();
- if (player)
- name = player->GetName();
- }
-
- if (player)
- {
- PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
-
- // Reset player faction + allow combat + allow duels
- player->setFactionForRace(player->getRace());
- player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- // Remove Freeze spell (allowing movement and spells)
- player->RemoveAurasDueToSpell(9454);
-
- // Save player
- player->SaveToDB();
- }
- else
- {
- if (targetName)
- {
- // Check for offline players
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME);
- stmt->setString(0, name);
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- {
- SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
- return true;
- }
-
- // If player found: delete his freeze aura
- Field* fields = result->Fetch();
- uint32 lowGuid = fields[0].GetUInt32();
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
- stmt->setUInt32(0, lowGuid);
- CharacterDatabase.Execute(stmt);
-
- PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
- return true;
- }
- else
- {
- SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
- return true;
- }
- }
-
- return true;
-}
-
-bool ChatHandler::HandleListFreezeCommand(const char * /*args*/)
-{
- // Get names from DB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
-
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- {
- SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS);
- return true;
- }
- //Header of the names
- PSendSysMessage(LANG_COMMAND_LIST_FREEZE);
-
- //Output of the results
- do
- {
- Field* fields = result->Fetch();
- std::string fplayers = fields[0].GetString();
- PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, fplayers.c_str());
- } while (result->NextRow());
-
- return true;
-}
-
-bool ChatHandler::HandleGroupLeaderCommand(const char *args)
-{
- Player* player = NULL;
- Group* group = NULL;
- uint64 guid = 0;
- char* cname = strtok((char*)args, " ");
-
- if (GetPlayerGroupAndGUIDByName(cname, player, group, guid))
- if (group && group->GetLeaderGUID() != guid)
- {
- group->ChangeLeader(guid);
- group->SendUpdate();
- }
-
- return true;
-}
-
-bool ChatHandler::HandleGroupDisbandCommand(const char *args)
-{
- Player* player = NULL;
- Group* group = NULL;
- uint64 guid = 0;
- char* cname = strtok((char*)args, " ");
-
- if (GetPlayerGroupAndGUIDByName(cname, player, group, guid))
- if (group)
- group->Disband();
-
- return true;
-}
-
-bool ChatHandler::HandleGroupRemoveCommand(const char *args)
-{
- Player* player = NULL;
- Group* group = NULL;
- uint64 guid = 0;
- char* cname = strtok((char*)args, " ");
-
- if (GetPlayerGroupAndGUIDByName(cname, player, group, guid, true))
- if (group)
- group->RemoveMember(guid);
-
- return true;
-}
-
-bool ChatHandler::HandlePossessCommand(const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- return false;
-
- m_session->GetPlayer()->CastSpell(unit, 530, true);
- return true;
-}
-
-bool ChatHandler::HandleUnPossessCommand(const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- unit = m_session->GetPlayer();
-
- unit->RemoveCharmAuras();
-
- return true;
-}
-
-bool ChatHandler::HandleBindSightCommand(const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- return false;
-
- m_session->GetPlayer()->CastSpell(unit, 6277, true);
- return true;
-}
-
-bool ChatHandler::HandleUnbindSightCommand(const char * /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- if (player->isPossessing())
- return false;
-
- player->StopCastingBindSight();
- return true;
-}
diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp
deleted file mode 100755
index 177899efbf0..00000000000
--- a/src/server/game/Chat/Commands/TicketCommands.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "ObjectMgr.h"
-#include "TicketMgr.h"
-#include "AccountMgr.h"
-#include "Chat.h"
-#include "Player.h"
-
-bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
-{
- sTicketMgr->ShowList(*this, false);
- return true;
-}
-
-bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
-{
- sTicketMgr->ShowList(*this, true);
- return true;
-}
-
-bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
-{
- sTicketMgr->ShowClosedList(*this);
- return true;
-}
-
-bool ChatHandler::HandleGMTicketListEscalatedCommand(const char* /*args*/)
-{
- sTicketMgr->ShowEscalatedList(*this);
- return true;
-}
-
-bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 ticketId = atoi(args);
- GmTicket *ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetViewed();
- ticket->SaveToDB(trans);
-
- SendSysMessage(ticket->FormatMessageString(*this, true).c_str());
- return true;
-}
-
-bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string name(args);
- if (!normalizePlayerName(name))
- return false;
-
- // Detect target's GUID
- uint64 guid = 0;
- if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str()))
- guid = player->GetGUID();
- else
- guid = sObjectMgr->GetPlayerGUIDByName(name);
-
- // Target must exist
- if (!guid)
- {
- SendSysMessage(LANG_NO_PLAYERS_FOUND);
- return true;
- }
-
- // Ticket must exist
- GmTicket *ticket = sTicketMgr->GetTicketByPlayer(guid);
- if (!ticket)
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetViewed();
- ticket->SaveToDB(trans);
-
- SendSysMessage(ticket->FormatMessageString(*this, true).c_str());
- return true;
-}
-
-bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 ticketId = atoi(args);
- GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- // Ticket should be assigned to the player who tries to close it.
- // Console can override though
- Player* player = m_session ? m_session->GetPlayer() : NULL;
- if (player && ticket->IsAssignedNotTo(player->GetGUID()))
- {
- PSendSysMessage(LANG_COMMAND_TICKETCANNOTCLOSE, ticket->GetId());
- return true;
- }
-
- sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
- sTicketMgr->UpdateLastChange();
-
- std::string msg = ticket->FormatMessageString(*this, player ? player->GetName() : "Console", NULL, NULL, NULL);
- SendGlobalGMSysMessage(msg.c_str());
-
- // Inform player, who submitted this ticket, that it is closed
- if (Player* submitter = ticket->GetPlayer())
- {
- if (submitter->IsInWorld())
- {
- WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
- data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
- submitter->GetSession()->SendPacket(&data);
- }
- }
- return true;
-}
-
-bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
-{
- if (!*args)
- return false;
-
- char* sTicketId = strtok((char*)args, " ");
- uint32 ticketId = atoi(sTicketId);
-
- char* sTarget = strtok(NULL, " ");
- if (!sTarget)
- return false;
-
- std::string target(sTarget);
- if (!normalizePlayerName(target))
- return false;
-
- GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || ticket->IsClosed())
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- // Get target information
- uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
- uint64 targetAccId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
- uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccId, realmID);
-
- // Target must exist and have administrative rights
- if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel))
- {
- SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
- return true;
- }
-
- // If already assigned, leave
- if (ticket->IsAssignedTo(targetGuid))
- {
- PSendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_B, ticket->GetId());
- return true;
- }
-
- // If assigned to different player other than current, leave
- //! Console can override though
- Player* player = m_session ? m_session->GetPlayer() : NULL;
- if (player && ticket->IsAssignedNotTo(player->GetGUID()))
- {
- PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId(), target.c_str());
- return true;
- }
-
- // Assign ticket
- SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel));
- ticket->SaveToDB(trans);
- sTicketMgr->UpdateLastChange();
-
- std::string msg = ticket->FormatMessageString(*this, NULL, target.c_str(), NULL, NULL);
- SendGlobalGMSysMessage(msg.c_str());
- return true;
-}
-
-bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 ticketId = atoi(args);
- GmTicket *ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || ticket->IsClosed())
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
- // Ticket must be assigned
- if (!ticket->IsAssigned())
- {
- PSendSysMessage(LANG_COMMAND_TICKETNOTASSIGNED, ticket->GetId());
- return true;
- }
-
- // Get security level of player, whom this ticket is assigned to
- uint32 security = SEC_PLAYER;
- Player* assignedPlayer = ticket->GetAssignedPlayer();
- if (assignedPlayer && assignedPlayer->IsInWorld())
- security = assignedPlayer->GetSession()->GetSecurity();
- else
- {
- uint64 guid = ticket->GetAssignedToGUID();
- uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
- security = AccountMgr::GetSecurity(accountId, realmID);
- }
-
- // Check security
- //! If no m_session present it means we're issuing this command from the console
- uint32 mySecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
- if (security > mySecurity)
- {
- SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
- return true;
- }
-
- SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetUnassigned();
- ticket->SaveToDB(trans);
- sTicketMgr->UpdateLastChange();
-
- std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(),
- m_session ? m_session->GetPlayer()->GetName() : "Console", NULL);
- SendGlobalGMSysMessage(msg.c_str());
- return true;
-}
-
-bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
-{
- if (!*args)
- return false;
-
- char* tguid = strtok((char*)args, " ");
- uint32 ticketId = atoi(tguid);
-
- char* comment = strtok(NULL, "\n");
- if (!comment)
- return false;
-
- GmTicket *ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || ticket->IsClosed())
- {
- PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- // Cannot comment ticket assigned to someone else
- //! Console excluded
- Player* player = m_session ? m_session->GetPlayer() : NULL;
- if (player && ticket->IsAssignedNotTo(player->GetGUID()))
- {
- PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
- return true;
- }
-
- SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetComment(comment);
- ticket->SaveToDB(trans);
- sTicketMgr->UpdateLastChange();
-
- std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL);
- msg += PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName() : "Console", comment);
- SendGlobalGMSysMessage(msg.c_str());
-
- return true;
-}
-
-bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 ticketId = atoi(args);
- GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket)
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- if (!ticket->IsClosed())
- {
- SendSysMessage(LANG_COMMAND_TICKETCLOSEFIRST);
- return true;
- }
-
- std::string msg = ticket->FormatMessageString(*this, NULL, NULL, NULL, m_session ? m_session->GetPlayer()->GetName() : "Console");
- SendGlobalGMSysMessage(msg.c_str());
-
- sTicketMgr->RemoveTicket(ticket->GetId());
- sTicketMgr->UpdateLastChange();
-
- if (Player* player = ticket->GetPlayer())
- {
- if (player->IsInWorld())
- {
- // Force abandon ticket
- WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
- data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
- player->GetSession()->SendPacket(&data);
- }
- }
- return true;
-}
-
-bool ChatHandler::HandleGMTicketResetCommand(const char* /* args */)
-{
- if (sTicketMgr->GetOpenTicketCount() > 0)
- {
- SendSysMessage(LANG_COMMAND_TICKETPENDING);
- return true;
- }
- else
- {
- sTicketMgr->ResetTickets();
- SendSysMessage(LANG_COMMAND_TICKETRESET);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleToggleGMTicketSystem(const char* /* args */)
-{
- bool status = !sTicketMgr->GetStatus();
- sTicketMgr->SetStatus(status);
- PSendSysMessage(status ? LANG_ALLOW_TICKETS : LANG_DISALLOW_TICKETS);
- return true;
-}
-
-bool ChatHandler::HandleGMTicketEscalateCommand(const char *args)
-{
- if (!*args)
- return false;
-
- uint32 ticketId = atoi(args);
- GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || !ticket->IsClosed() || ticket->IsCompleted() || ticket->GetEscalatedStatus() != TICKET_UNASSIGNED)
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- ticket->SetEscalatedStatus(TICKET_IN_ESCALATION_QUEUE);
-
- if (Player* player = ticket->GetPlayer())
- if (player->IsInWorld())
- sTicketMgr->SendTicket(player->GetSession(), ticket);
-
- sTicketMgr->UpdateLastChange();
- return true;
-}
-
-bool ChatHandler::HandleGMTicketCompleteCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 ticketId = atoi(args);
- GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || !ticket->IsClosed() || ticket->IsCompleted())
- {
- SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- if (Player* player = ticket->GetPlayer())
- if (player->IsInWorld())
- ticket->SendResponse(player->GetSession());
-
- sTicketMgr->UpdateLastChange();
- return true;
-}
-
-inline bool ChatHandler::_HandleGMTicketResponseAppendCommand(const char* args, bool newLine)
-{
- if (!*args)
- return false;
-
- char* sTicketId = strtok((char*)args, " ");
- uint32 ticketId = atoi(sTicketId);
-
- char* response = strtok(NULL, "\n");
- if (!response)
- return false;
-
- GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
- if (!ticket || !ticket->IsClosed())
- {
- PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
- return true;
- }
-
- // Cannot add response to ticket, assigned to someone else
- //! Console excluded
- Player* player = m_session ? m_session->GetPlayer() : NULL;
- if (player && ticket->IsAssignedNotTo(player->GetGUID()))
- {
- PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
- return true;
- }
-
- SQLTransaction trans = SQLTransaction(NULL);
- ticket->AppendResponse(response);
- if (newLine)
- ticket->AppendResponse("\n");
- ticket->SaveToDB(trans);
-
- return true;
-}
-
-bool ChatHandler::HandleGMTicketResponseAppendCommand(const char* args)
-{
- return _HandleGMTicketResponseAppendCommand(args, false);
-}
-
-bool ChatHandler::HandleGMTicketResponseAppendLnCommand(const char* args)
-{
- return _HandleGMTicketResponseAppendCommand(args, true);
-}
diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h
index 8a49d230161..b8991d8faf8 100755
--- a/src/server/game/Combat/HostileRefManager.h
+++ b/src/server/game/Combat/HostileRefManager.h
@@ -71,4 +71,3 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
};
//=================================================
#endif
-
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 9737d4584ea..87853a53b6c 100755
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -194,7 +194,6 @@ void HostileReference::updateOnlineStatus()
}
else
accessible = true;
-
}
setAccessibleState(accessible);
setOnlineOfflineState(online);
@@ -354,7 +353,9 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
// list sorted and and we check current target, then this is best case
if (currentVictim == currentRef || currentRef->getThreat() <= 1.1f * currentVictim->getThreat())
{
- currentRef = currentVictim; // for second case
+ if (currentVictim != currentRef && attacker->canCreatureAttack(currentVictim->getTarget()))
+ currentRef = currentVictim; // for second case, if currentvictim is attackable
+
found = true;
break;
}
diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h
index 39c79b8273a..8d57ef6c59c 100755
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -49,7 +49,7 @@ enum UNIT_EVENT_TYPE
UEV_THREAT_SET_NEXT_TARGET = 1<<5,
// A new victim (target) was set. Could be NULL
- UEV_THREAT_VICTIM_CHANGED = 1<<6,
+ UEV_THREAT_VICTIM_CHANGED = 1<<6
// Future use
//UEV_UNIT_KILLED = 1<<7,
@@ -77,7 +77,6 @@ class UnitBaseEvent
bool matchesTypeMask(uint32 pMask) const { return iType & pMask; }
void setType(uint32 pType) { iType = pType; }
-
};
//==============================================================
@@ -124,8 +123,8 @@ class ThreatManagerEvent : public ThreatRefStatusChangeEvent
private:
ThreatContainer* iThreatContainer;
public:
- ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType) {}
- ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference) {}
+ ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(NULL) {}
+ ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(NULL) {}
void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; }
@@ -134,4 +133,3 @@ class ThreatManagerEvent : public ThreatRefStatusChangeEvent
//==============================================================
#endif
-
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 4176d9f605b..7dc4b57d188 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -16,7 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#include "Player.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
@@ -84,7 +83,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
case CONDITION_ACHIEVEMENT:
{
if (Player* player = object->ToPlayer())
- condMeets = player->GetAchievementMgr().HasAchieved(ConditionValue1);
+ condMeets = player->HasAchieved(ConditionValue1);
break;
}
case CONDITION_TEAM:
@@ -224,6 +223,9 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
case RELATION_PASSENGER_OF:
condMeets = unit->IsOnVehicle(toUnit);
break;
+ case RELATION_CREATED_BY:
+ condMeets = unit->GetCreatorGUID() == toUnit->GetGUID();
+ break;
}
}
}
@@ -280,6 +282,11 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
condMeets = player->HasTitle(ConditionValue1);
break;
}
+ case CONDITION_SPAWNMASK:
+ {
+ condMeets = ((1 << object->GetMap()->GetSpawnMode()) & ConditionValue1);
+ break;
+ }
default:
condMeets = false;
break;
@@ -431,6 +438,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
case CONDITION_TITLE:
mask |= GRID_MAP_TYPE_MASK_PLAYER;
break;
+ case CONDITION_SPAWNMASK:
+ mask |= GRID_MAP_TYPE_MASK_ALL;
+ break;
default:
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -441,7 +451,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
uint32 Condition::GetMaxAvailableConditionTargets()
{
// returns number of targets which are available for given source type
- switch(SourceType)
+ switch (SourceType)
{
case CONDITION_SOURCE_TYPE_SPELL:
case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
@@ -686,7 +696,7 @@ void ConditionMgr::LoadConditions(bool isReload)
//must clear all custom handled cases (groupped types) before reload
if (isReload)
{
- sLog->outString("Reseting Loot Conditions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reseting Loot Conditions...");
LootTemplates_Creature.ResetConditions();
LootTemplates_Fishing.ResetConditions();
LootTemplates_Gameobject.ResetConditions();
@@ -700,10 +710,10 @@ void ConditionMgr::LoadConditions(bool isReload)
LootTemplates_Prospecting.ResetConditions();
LootTemplates_Spell.ResetConditions();
- sLog->outString("Re-Loading `gossip_menu` Table for Conditions!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `gossip_menu` Table for Conditions!");
sObjectMgr->LoadGossipMenu();
- sLog->outString("Re-Loading `gossip_menu_option` Table for Conditions!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `gossip_menu_option` Table for Conditions!");
sObjectMgr->LoadGossipMenuItems();
sSpellMgr->UnloadSpellInfoImplicitTargetConditionLists();
}
@@ -713,8 +723,8 @@ void ConditionMgr::LoadConditions(bool isReload)
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 conditions. DB table `conditions` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 conditions. DB table `conditions` is empty!");
+
return;
}
@@ -722,7 +732,6 @@ void ConditionMgr::LoadConditions(bool isReload)
do
{
-
Field* fields = result->Fetch();
Condition* cond = new Condition();
@@ -750,7 +759,7 @@ void ConditionMgr::LoadConditions(bool isReload)
{
if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip
{
- sLog->outErrorDb("Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId);
+ sLog->outError(LOG_FILTER_SQL, "Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId);
delete cond;
continue;
}
@@ -761,19 +770,19 @@ void ConditionMgr::LoadConditions(bool isReload)
rowType = "reference";
//check for useless data
if (cond->ConditionTarget)
- sLog->outErrorDb("Condition %s %i has useless data in ConditionTarget (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionTarget);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in ConditionTarget (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionTarget);
if (cond->ConditionValue1)
- sLog->outErrorDb("Condition %s %i has useless data in value1 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in value1 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue1);
if (cond->ConditionValue2)
- sLog->outErrorDb("Condition %s %i has useless data in value2 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in value2 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Condition %s %i has useless data in value3 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in value3 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue3);
if (cond->NegativeCondition)
- sLog->outErrorDb("Condition %s %i has useless data in NegativeCondition (%u)!", rowType, iSourceTypeOrReferenceId, cond->NegativeCondition);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in NegativeCondition (%u)!", rowType, iSourceTypeOrReferenceId, cond->NegativeCondition);
if (cond->SourceGroup && iSourceTypeOrReferenceId < 0)
- sLog->outErrorDb("Condition %s %i has useless data in SourceGroup (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in SourceGroup (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceGroup);
if (cond->SourceEntry && iSourceTypeOrReferenceId < 0)
- sLog->outErrorDb("Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceEntry);
}
else if (!isConditionTypeValid(cond))//doesn't have reference, validate ConditionType
{
@@ -804,13 +813,13 @@ void ConditionMgr::LoadConditions(bool isReload)
//Grouping is only allowed for some types (loot templates, gossip menus, gossip items)
if (cond->SourceGroup && !CanHaveSourceGroupSet(cond->SourceType))
{
- sLog->outErrorDb("Condition type %u has not allowed value of SourceGroup = %u!", uint32(cond->SourceType), cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "Condition type %u has not allowed value of SourceGroup = %u!", uint32(cond->SourceType), cond->SourceGroup);
delete cond;
continue;
}
if (cond->SourceId && !CanHaveSourceIdSet(cond->SourceType))
{
- sLog->outErrorDb("Condition type %u has not allowed value of SourceId = %u!", uint32(cond->SourceType), cond->SourceId);
+ sLog->outError(LOG_FILTER_SQL, "Condition type %u has not allowed value of SourceId = %u!", uint32(cond->SourceType), cond->SourceId);
delete cond;
continue;
}
@@ -869,7 +878,6 @@ void ConditionMgr::LoadConditions(bool isReload)
valid = true;
++count;
continue; // do not add to m_AllocatedMemory to avoid double deleting
- break;
}
case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
valid = addToSpellImplicitTargetConditions(cond);
@@ -896,7 +904,7 @@ void ConditionMgr::LoadConditions(bool isReload)
if (!valid)
{
- sLog->outErrorDb("Not handled grouped condition, SourceGroup %u", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "Not handled grouped condition, SourceGroup %u", cond->SourceGroup);
delete cond;
}
else
@@ -928,22 +936,22 @@ void ConditionMgr::LoadConditions(bool isReload)
}
while (result->NextRow());
- sLog->outString(">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot)
{
if (!loot)
{
- sLog->outErrorDb("ConditionMgr: LootTemplate %u not found", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "ConditionMgr: LootTemplate %u not found", cond->SourceGroup);
return false;
}
if (loot->addConditionItem(cond))
return true;
- sLog->outErrorDb("ConditionMgr: Item %u not found in LootTemplate %u", cond->SourceEntry, cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "ConditionMgr: Item %u not found in LootTemplate %u", cond->SourceEntry, cond->SourceGroup);
return false;
}
@@ -963,7 +971,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
}
}
- sLog->outErrorDb("addToGossipMenus: GossipMenu %u not found", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "addToGossipMenus: GossipMenu %u not found", cond->SourceGroup);
return false;
}
@@ -982,7 +990,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
}
}
- sLog->outErrorDb("addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->SourceGroup, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->SourceGroup, cond->SourceEntry);
return false;
}
@@ -1037,7 +1045,7 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
// we have overlapping masks in db
if (conditionEffMask != *itr)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
"effect masks are overlapping (all SourceGroup values having given bit set must be equal) - ignoring.", cond->SourceEntry, cond->SourceGroup);
return false;
}
@@ -1062,7 +1070,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (cond->SourceType == CONDITION_SOURCE_TYPE_NONE || cond->SourceType >= CONDITION_SOURCE_TYPE_MAX)
{
- sLog->outErrorDb("Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->SourceType));
+ sLog->outError(LOG_FILTER_SQL, "Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->SourceType));
return false;
}
@@ -1072,7 +1080,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Creature.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1080,7 +1088,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1089,7 +1097,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Disenchant.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1097,7 +1105,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1106,7 +1114,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Fishing.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1114,7 +1122,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1123,7 +1131,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Gameobject.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1131,7 +1139,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1140,7 +1148,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Item.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1148,7 +1156,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1157,7 +1165,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Mail.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1165,7 +1173,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1174,7 +1182,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Milling.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1182,7 +1190,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1191,7 +1199,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Pickpocketing.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1199,7 +1207,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1208,7 +1216,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Prospecting.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1216,7 +1224,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1225,7 +1233,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Reference.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1233,7 +1241,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1242,7 +1250,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Skinning.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1250,7 +1258,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1259,7 +1267,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Spell.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1267,7 +1275,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1277,13 +1285,13 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(cond->SourceEntry);
if (!spellInfo)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
if ((cond->SourceGroup > MAX_EFFECT_MASK) || !cond->SourceGroup)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup);
return false;
}
@@ -1314,7 +1322,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
break;
}
- sLog->outErrorDb("SourceEntry %u SourceGroup %u in `condition` table - spell %u does not have implicit targets of types: _AREA_, _CONE_, _NEARBY_ for effect %u, SourceGroup needs correction, ignoring.", cond->SourceEntry, origGroup, cond->SourceEntry, uint32(i));
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u SourceGroup %u in `condition` table - spell %u does not have implicit targets of types: _AREA_, _CONE_, _NEARBY_ for effect %u, SourceGroup needs correction, ignoring.", cond->SourceEntry, origGroup, cond->SourceEntry, uint32(i));
cond->SourceGroup &= ~(1<<i);
}
// all effects were removed, no need to add the condition at all
@@ -1326,7 +1334,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!sObjectMgr->GetCreatureTemplate(cond->SourceEntry))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceEntry);
return false;
}
break;
@@ -1336,7 +1344,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->SourceEntry);
if (!spellProto)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
break;
@@ -1344,40 +1352,40 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
- sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->SourceEntry);
return false;
}
break;
case CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
- sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->SourceEntry);
return false;
}
break;
case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
return false;
}
if (!sSpellMgr->GetSpellInfo(cond->SourceEntry))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
break;
case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT:
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
return false;
}
if (!sSpellMgr->GetSpellInfo(cond->SourceEntry))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
break;
@@ -1395,13 +1403,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (cond->ConditionType == CONDITION_NONE || cond->ConditionType >= CONDITION_MAX)
{
- sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->ConditionType), cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->ConditionType), cond->SourceEntry);
return false;
}
if (cond->ConditionTarget >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
@@ -1411,17 +1419,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
{
- sLog->outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Aura condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 > EFFECT_2)
{
- sLog->outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Aura condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Aura condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ITEM:
@@ -1429,13 +1437,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->ConditionValue1);
if (!proto)
{
- sLog->outErrorDb("Item condition has non existing item (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Item condition has non existing item (%u), skipped", cond->ConditionValue1);
return false;
}
if (!cond->ConditionValue2)
{
- sLog->outErrorDb("Item condition has 0 set for item count in value2 (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Item condition has 0 set for item count in value2 (%u), skipped", cond->ConditionValue2);
return false;
}
break;
@@ -1445,14 +1453,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->ConditionValue1);
if (!proto)
{
- sLog->outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ItemEquipped condition has non existing item (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("ItemEquipped condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ItemEquipped condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("ItemEquipped condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ItemEquipped condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ZONEID:
@@ -1460,20 +1468,20 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(cond->ConditionValue1);
if (!areaEntry)
{
- sLog->outErrorDb("ZoneID condition has non existing area (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition has non existing area (%u), skipped", cond->ConditionValue1);
return false;
}
if (areaEntry->zone != 0)
{
- sLog->outErrorDb("ZoneID condition requires to be in area (%u) which is a subzone but zone expected, skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition requires to be in area (%u) which is a subzone but zone expected, skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("ZoneID condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("ZoneID condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_REPUTATION_RANK:
@@ -1481,25 +1489,25 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
FactionEntry const* factionEntry = sFactionStore.LookupEntry(cond->ConditionValue1);
if (!factionEntry)
{
- sLog->outErrorDb("Reputation condition has non existing faction (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Reputation condition has non existing faction (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Reputation condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Reputation condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_TEAM:
{
if (cond->ConditionValue1 != ALLIANCE && cond->ConditionValue1 != HORDE)
{
- sLog->outErrorDb("Team condition specifies unknown team (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Team condition specifies unknown team (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Team condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Team condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Team condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Team condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_SKILL:
@@ -1507,17 +1515,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(cond->ConditionValue1);
if (!pSkill)
{
- sLog->outErrorDb("Skill condition specifies non-existing skill (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Skill condition specifies non-existing skill (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 < 1 || cond->ConditionValue2 > sWorld->GetConfigMaxSkillValue())
{
- sLog->outErrorDb("Skill condition specifies invalid skill value (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Skill condition specifies invalid skill value (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Skill condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Skill condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_QUESTREWARDED:
@@ -1527,14 +1535,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (!sObjectMgr->GetQuestTemplate(cond->ConditionValue1))
{
- sLog->outErrorDb("Quest condition specifies non-existing quest (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Quest condition specifies non-existing quest (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 > 1)
- sLog->outErrorDb("Quest condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Quest condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Quest condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Quest condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ACTIVE_EVENT:
@@ -1542,14 +1550,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
if (cond->ConditionValue1 >=events.size() || !events[cond->ConditionValue1].isValid())
{
- sLog->outErrorDb("ActiveEvent condition has non existing event id (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ActiveEvent condition has non existing event id (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("ActiveEvent condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ActiveEvent condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("ActiveEvent condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ActiveEvent condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ACHIEVEMENT:
@@ -1557,42 +1565,42 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1);
if (!achievement)
{
- sLog->outErrorDb("Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Achivement condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Achivement condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Achivement condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Achivement condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_CLASS:
{
if (!(cond->ConditionValue1 & CLASSMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Class condition has non existing classmask (%u), skipped", cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
+ sLog->outError(LOG_FILTER_SQL, "Class condition has non existing classmask (%u), skipped", cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Class condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Class condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Class condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Class condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_RACE:
{
if (!(cond->ConditionValue1 & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Race condition has non existing racemask (%u), skipped", cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
+ sLog->outError(LOG_FILTER_SQL, "Race condition has non existing racemask (%u), skipped", cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Race condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Race condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Race condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Race condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_MAPID:
@@ -1600,77 +1608,77 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1);
if (!me)
{
- sLog->outErrorDb("Map condition has non existing map (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Map condition has non existing map (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Map condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Map condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Map condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Map condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_SPELL:
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
{
- sLog->outErrorDb("Spell condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Spell condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Spell condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Spell condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Spell condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Spell condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_LEVEL:
{
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("Level condition has invalid option (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Level condition has invalid option (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Level condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Level condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_DRUNKENSTATE:
{
if (cond->ConditionValue1 > DRUNKEN_SMASHED)
{
- sLog->outErrorDb("DrunkState condition has invalid state (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "DrunkState condition has invalid state (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
{
- sLog->outErrorDb("DrunkState condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "DrunkState condition has useless data in value2 (%u)!", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("DrunkState condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "DrunkState condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_NEAR_CREATURE:
{
if (!sObjectMgr->GetCreatureTemplate(cond->ConditionValue1))
{
- sLog->outErrorDb("NearCreature condition has non existing creature template entry (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "NearCreature condition has non existing creature template entry (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("NearCreature condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "NearCreature condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_NEAR_GAMEOBJECT:
{
if (!sObjectMgr->GetGameObjectTemplate(cond->ConditionValue1))
{
- sLog->outErrorDb("NearGameObject condition has non existing gameobject template entry (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "NearGameObject condition has non existing gameobject template entry (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("NearGameObject condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "NearGameObject condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_OBJECT_ENTRY:
@@ -1680,79 +1688,79 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
case TYPEID_UNIT:
if (cond->ConditionValue2 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue2))
{
- sLog->outErrorDb("ObjectEntry condition has non existing creature template entry (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has non existing creature template entry (%u), skipped", cond->ConditionValue2);
return false;
}
break;
case TYPEID_GAMEOBJECT:
if (cond->ConditionValue2 && !sObjectMgr->GetGameObjectTemplate(cond->ConditionValue2))
{
- sLog->outErrorDb("ObjectEntry condition has non existing game object template entry (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has non existing game object template entry (%u), skipped", cond->ConditionValue2);
return false;
}
break;
case TYPEID_PLAYER:
case TYPEID_CORPSE:
if (cond->ConditionValue2)
- sLog->outErrorDb("ObjectEntry condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has useless data in value2 (%u)!", cond->ConditionValue2);
break;
default:
- sLog->outErrorDb("ObjectEntry condition has wrong typeid set (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has wrong typeid set (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("ObjectEntry condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_TYPE_MASK:
{
if (!cond->ConditionValue1 || (cond->ConditionValue1 & ~(TYPEMASK_UNIT | TYPEMASK_PLAYER | TYPEMASK_GAMEOBJECT | TYPEMASK_CORPSE)))
{
- sLog->outErrorDb("TypeMask condition has invalid typemask set (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "TypeMask condition has invalid typemask set (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("TypeMask condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "TypeMask condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("TypeMask condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "TypeMask condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_RELATION_TO:
{
if (cond->ConditionValue1 >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("RelationTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
- sLog->outErrorDb("RelationTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 >= RELATION_MAX)
{
- sLog->outErrorDb("RelationTo condition has invalid ConditionValue2(RelationType) (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has invalid ConditionValue2(RelationType) (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("RelationTo condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_REACTION_TO:
{
if (cond->ConditionValue1 >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("ReactionTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ReactionTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
- sLog->outErrorDb("ReactionTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ReactionTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
return false;
}
if (!cond->ConditionValue2)
{
- sLog->outErrorDb("mConditionValue2 condition has invalid ConditionValue2(rankMask) (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "mConditionValue2 condition has invalid ConditionValue2(rankMask) (%u), skipped", cond->ConditionValue2);
return false;
}
break;
@@ -1761,17 +1769,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (cond->ConditionValue1 >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("DistanceTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "DistanceTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
- sLog->outErrorDb("DistanceTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "DistanceTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("DistanceTo condition has invalid ComparisionType (%u), skipped", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "DistanceTo condition has invalid ComparisionType (%u), skipped", cond->ConditionValue3);
return false;
}
break;
@@ -1779,38 +1787,38 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
case CONDITION_ALIVE:
{
if (cond->ConditionValue1)
- sLog->outErrorDb("Alive condition has useless data in value1 (%u)!", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Alive condition has useless data in value1 (%u)!", cond->ConditionValue1);
if (cond->ConditionValue2)
- sLog->outErrorDb("Alive condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Alive condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Alive condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Alive condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_HP_VAL:
{
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("HpVal condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "HpVal condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("HpVal condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "HpVal condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_HP_PCT:
{
if (cond->ConditionValue1 > 100)
{
- sLog->outErrorDb("HpPct condition has too big percent value (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "HpPct condition has too big percent value (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("HpPct condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "HpPct condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("HpPct condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "HpPct condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_AREAID:
@@ -1820,19 +1828,19 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (!sWorld->getWorldState(cond->ConditionValue1))
{
- sLog->outErrorDb("World state condition has non existing world state in value1 (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "World state condition has non existing world state in value1 (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("World state condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "World state condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_PHASEMASK:
{
if (cond->ConditionValue2)
- sLog->outErrorDb("Phasemask condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Phasemask condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_TITLE:
@@ -1840,22 +1848,28 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(cond->ConditionValue1);
if (!titleEntry)
{
- sLog->outErrorDb("Title condition has non existing title in value1 (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Title condition has non existing title in value1 (%u), skipped", cond->ConditionValue1);
+ return false;
+ }
+ break;
+ }
+ case CONDITION_SPAWNMASK:
+ {
+ if (cond->ConditionValue1 > SPAWNMASK_RAID_ALL)
+ {
+ sLog->outError(LOG_FILTER_SQL, "SpawnMask condition has non existing SpawnMask in value1 (%u), skipped", cond->ConditionValue1);
return false;
}
break;
}
- case CONDITION_UNUSED_19:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
- return false;
case CONDITION_UNUSED_20:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_20 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_20 in `conditions` table - ignoring");
return false;
case CONDITION_UNUSED_21:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_21 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_21 in `conditions` table - ignoring");
return false;
case CONDITION_UNUSED_24:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring");
return false;
default:
break;
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 130a23a0cb0..57af0562dcd 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -49,7 +49,7 @@ enum ConditionTypes
CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race
CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete
CONDITION_TITLE = 18, // title id 0 0 true if player has title
- CONDITION_UNUSED_19 = 19, //
+ CONDITION_SPAWNMASK = 19, // spawnMask 0 0 true if in spawnMask
CONDITION_UNUSED_20 = 20, //
CONDITION_UNUSED_21 = 21, //
CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
@@ -144,12 +144,13 @@ enum RelationType
RELATION_IN_RAID_OR_PARTY,
RELATION_OWNED_BY,
RELATION_PASSENGER_OF,
+ RELATION_CREATED_BY,
RELATION_MAX
};
enum
{
- MAX_CONDITION_TARGETS = 3,
+ MAX_CONDITION_TARGETS = 3
};
struct ConditionSourceInfo
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
index d7a769d3f5c..27695f3eafa 100755
--- a/src/server/game/Conditions/DisableMgr.cpp
+++ b/src/server/game/Conditions/DisableMgr.cpp
@@ -59,8 +59,8 @@ void LoadDisables()
if (!result)
{
- sLog->outString(">> Loaded 0 disables. DB table `disables` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 disables. DB table `disables` is empty!");
+
return;
}
@@ -71,7 +71,7 @@ void LoadDisables()
DisableType type = DisableType(fields[0].GetUInt32());
if (type >= MAX_DISABLE_TYPES)
{
- sLog->outErrorDb("Invalid type %u specified in `disables` table, skipped.", type);
+ sLog->outError(LOG_FILTER_SQL, "Invalid type %u specified in `disables` table, skipped.", type);
continue;
}
@@ -88,13 +88,13 @@ void LoadDisables()
case DISABLE_TYPE_SPELL:
if (!(sSpellMgr->GetSpellInfo(entry) || flags & SPELL_DISABLE_DEPRECATED_SPELL))
{
- sLog->outErrorDb("Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
if (!flags || flags > MAX_SPELL_DISABLE_TYPE)
{
- sLog->outErrorDb("Disable flags for spell %u are invalid, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags for spell %u are invalid, skipped.", entry);
continue;
}
@@ -121,7 +121,7 @@ void LoadDisables()
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
if (!mapEntry)
{
- sLog->outErrorDb("Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
bool isFlagInvalid = false;
@@ -142,12 +142,12 @@ void LoadDisables()
break;
case MAP_BATTLEGROUND:
case MAP_ARENA:
- sLog->outErrorDb("Battleground map %u specified to be disabled in map case, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Battleground map %u specified to be disabled in map case, skipped.", entry);
continue;
}
if (isFlagInvalid)
{
- sLog->outErrorDb("Disable flags for map %u are invalid, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags for map %u are invalid, skipped.", entry);
continue;
}
break;
@@ -155,64 +155,64 @@ void LoadDisables()
case DISABLE_TYPE_BATTLEGROUND:
if (!sBattlemasterListStore.LookupEntry(entry))
{
- sLog->outErrorDb("Battleground entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Battleground entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
if (flags)
- sLog->outErrorDb("Disable flags specified for battleground %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for battleground %u, useless data.", entry);
break;
case DISABLE_TYPE_OUTDOORPVP:
if (entry > MAX_OUTDOORPVP_TYPES)
{
- sLog->outErrorDb("OutdoorPvPTypes value %u from `disables` is invalid, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "OutdoorPvPTypes value %u from `disables` is invalid, skipped.", entry);
continue;
}
if (flags)
- sLog->outErrorDb("Disable flags specified for outdoor PvP %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for outdoor PvP %u, useless data.", entry);
break;
case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
if (!sAchievementCriteriaStore.LookupEntry(entry))
{
- sLog->outErrorDb("Achievement Criteria entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Achievement Criteria entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
if (flags)
- sLog->outErrorDb("Disable flags specified for Achievement Criteria %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for Achievement Criteria %u, useless data.", entry);
break;
case DISABLE_TYPE_VMAP:
{
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
if (!mapEntry)
{
- sLog->outErrorDb("Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
switch (mapEntry->map_type)
{
case MAP_COMMON:
if (flags & VMAP_DISABLE_AREAFLAG)
- sLog->outString("Areaflag disabled for world map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Areaflag disabled for world map %u.", entry);
if (flags & VMAP_DISABLE_LIQUIDSTATUS)
- sLog->outString("Liquid status disabled for world map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Liquid status disabled for world map %u.", entry);
break;
case MAP_INSTANCE:
case MAP_RAID:
if (flags & VMAP_DISABLE_HEIGHT)
- sLog->outString("Height disabled for instance map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Height disabled for instance map %u.", entry);
if (flags & VMAP_DISABLE_LOS)
- sLog->outString("LoS disabled for instance map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "LoS disabled for instance map %u.", entry);
break;
case MAP_BATTLEGROUND:
if (flags & VMAP_DISABLE_HEIGHT)
- sLog->outString("Height disabled for battleground map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Height disabled for battleground map %u.", entry);
if (flags & VMAP_DISABLE_LOS)
- sLog->outString("LoS disabled for battleground map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "LoS disabled for battleground map %u.", entry);
break;
case MAP_ARENA:
if (flags & VMAP_DISABLE_HEIGHT)
- sLog->outString("Height disabled for arena map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Height disabled for arena map %u.", entry);
if (flags & VMAP_DISABLE_LOS)
- sLog->outString("LoS disabled for arena map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "LoS disabled for arena map %u.", entry);
break;
default:
break;
@@ -228,8 +228,8 @@ void LoadDisables()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime));
+
}
void CheckQuestDisables()
@@ -239,8 +239,8 @@ void CheckQuestDisables()
uint32 count = m_DisableMap[DISABLE_TYPE_QUEST].size();
if (!count)
{
- sLog->outString(">> Checked 0 quest disables.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Checked 0 quest disables.");
+
return;
}
@@ -250,17 +250,17 @@ void CheckQuestDisables()
const uint32 entry = itr->first;
if (!sObjectMgr->GetQuestTemplate(entry))
{
- sLog->outErrorDb("Quest entry %u from `disables` doesn't exist, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Quest entry %u from `disables` doesn't exist, skipped.", entry);
m_DisableMap[DISABLE_TYPE_QUEST].erase(itr++);
continue;
}
if (itr->second.flags)
- sLog->outErrorDb("Disable flags specified for quest %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for quest %u, useless data.", entry);
++itr;
}
- sLog->outString(">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags)
diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h
index 0f9310ace3b..b1bb43315bd 100755
--- a/src/server/game/Conditions/DisableMgr.h
+++ b/src/server/game/Conditions/DisableMgr.h
@@ -31,7 +31,7 @@ enum DisableType
DISABLE_TYPE_BATTLEGROUND = 3,
DISABLE_TYPE_ACHIEVEMENT_CRITERIA = 4,
DISABLE_TYPE_OUTDOORPVP = 5,
- DISABLE_TYPE_VMAP = 6,
+ DISABLE_TYPE_VMAP = 6
};
enum SpellDisableTypes
@@ -43,7 +43,7 @@ enum SpellDisableTypes
SPELL_DISABLE_MAP = 0x10,
SPELL_DISABLE_AREA = 0x20,
MAX_SPELL_DISABLE_TYPE = ( SPELL_DISABLE_PLAYER | SPELL_DISABLE_CREATURE | SPELL_DISABLE_PET |
- SPELL_DISABLE_DEPRECATED_SPELL | SPELL_DISABLE_MAP | SPELL_DISABLE_AREA),
+ SPELL_DISABLE_DEPRECATED_SPELL | SPELL_DISABLE_MAP | SPELL_DISABLE_AREA)
};
enum VmapDisableTypes
@@ -51,7 +51,7 @@ enum VmapDisableTypes
VMAP_DISABLE_AREAFLAG = 0x1,
VMAP_DISABLE_HEIGHT = 0x2,
VMAP_DISABLE_LOS = 0x4,
- VMAP_DISABLE_LIQUIDSTATUS = 0x8,
+ VMAP_DISABLE_LIQUIDSTATUS = 0x8
};
namespace DisableMgr
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
index e73480cb4de..12ec7206141 100755
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -53,7 +53,7 @@ enum AchievementFaction
{
ACHIEVEMENT_FACTION_HORDE = 0,
ACHIEVEMENT_FACTION_ALLIANCE = 1,
- ACHIEVEMENT_FACTION_ANY = -1,
+ ACHIEVEMENT_FACTION_ANY = -1
};
enum AchievementFlags
@@ -67,7 +67,7 @@ enum AchievementFlags
ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value)
ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value)
ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, //
- ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, //
+ ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200 //
};
#define MAX_CRITERIA_REQUIREMENTS 2
@@ -81,7 +81,7 @@ enum AchievementCriteriaCondition
ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE = 4, // only used in "Win 10 arenas without losing"
ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT = 9, // requires the player not to be hit by specific spell
ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP = 10, // requires the player not to be in group
- ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13, // unk
+ ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13 // unk
};
enum AchievementCriteriaFlags
@@ -91,7 +91,7 @@ enum AchievementCriteriaFlags
ACHIEVEMENT_CRITERIA_FLAG_UNK3 = 0x00000004, // BG related??
ACHIEVEMENT_CRITERIA_FLAG_UNK4 = 0x00000008, //
ACHIEVEMENT_CRITERIA_FLAG_UNK5 = 0x00000010, // not used
- ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER = 0x00000020, // Displays counter as money
+ ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER = 0x00000020 // Displays counter as money
};
enum AchievementCriteriaTimedTypes
@@ -103,7 +103,7 @@ enum AchievementCriteriaTimedTypes
ACHIEVEMENT_TIMED_TYPE_CREATURE = 7, // Timer is started by killing creature with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_ITEM = 9, // Timer is started by using item with entry in timerStartEvent
- ACHIEVEMENT_TIMED_TYPE_MAX,
+ ACHIEVEMENT_TIMED_TYPE_MAX
};
enum AchievementCriteriaTypes
@@ -223,12 +223,12 @@ enum AchievementCriteriaTypes
// 122
// 123
// 0..123 => 124 criteria types total
- ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124,
+ ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124
};
enum AchievementCategory
{
- CATEGORY_CHILDRENS_WEEK = 163,
+ CATEGORY_CHILDRENS_WEEK = 163
};
enum AreaFlags
@@ -275,7 +275,7 @@ enum Difficulty
RAID_DIFFICULTY_10MAN_NORMAL = 0,
RAID_DIFFICULTY_25MAN_NORMAL = 1,
RAID_DIFFICULTY_10MAN_HEROIC = 2,
- RAID_DIFFICULTY_25MAN_HEROIC = 3,
+ RAID_DIFFICULTY_25MAN_HEROIC = 3
};
#define RAID_DIFFICULTY_MASK_25MAN 1 // since 25man difficulties are 1 and 3, we can check them like that
@@ -300,14 +300,14 @@ enum SpawnMask
SPAWNMASK_RAID_25MAN_HEROIC = (1 << RAID_DIFFICULTY_25MAN_HEROIC),
SPAWNMASK_RAID_HEROIC_ALL = (SPAWNMASK_RAID_10MAN_HEROIC | SPAWNMASK_RAID_25MAN_HEROIC),
- SPAWNMASK_RAID_ALL = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL),
+ SPAWNMASK_RAID_ALL = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL)
};
enum FactionTemplateFlags
{
FACTION_TEMPLATE_FLAG_PVP = 0x00000800, // flagged for PvP
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
- FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT= 0x00002000,
+ FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT= 0x00002000
};
enum FactionMasks
@@ -350,7 +350,7 @@ enum ItemEnchantmentType
enum ItemLimitCategoryMode
{
ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank
- ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1, // limit applied to amount equipped items (including used gems)
+ ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1 // limit applied to amount equipped items (including used gems)
};
enum TotemCategoryType
@@ -411,7 +411,7 @@ enum SummonPropFlags
SUMMON_PROP_FLAG_UNK13 = 0x00001000, // Lightwell, Jeeves, Gnomish Alarm-o-bot, Build vehicles(wintergrasp)
SUMMON_PROP_FLAG_UNK14 = 0x00002000, // Guides, player follows
SUMMON_PROP_FLAG_UNK15 = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental
- SUMMON_PROP_FLAG_UNK16 = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related?
+ SUMMON_PROP_FLAG_UNK16 = 0x00008000 // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related?
};
enum VehicleSeatFlags
@@ -436,7 +436,7 @@ enum VehicleSeatFlags
VEHICLE_SEAT_FLAG_HAS_START_WARITING_FOR_VEH_TRANSITION_ANIM_EXIT = 0x10000000,
VEHICLE_SEAT_FLAG_CAN_CAST = 0x20000000, // Lua_UnitHasVehicleUI
VEHICLE_SEAT_FLAG_UNK2 = 0x40000000, // checked in conjunction with 0x800 in CastSpell2
- VEHICLE_SEAT_FLAG_ALLOWS_INTERACTION = 0x80000000,
+ VEHICLE_SEAT_FLAG_ALLOWS_INTERACTION = 0x80000000
};
enum VehicleSeatFlagsB
@@ -449,7 +449,7 @@ enum VehicleSeatFlagsB
VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3 = 0x00000100,
VEHICLE_SEAT_FLAG_B_USABLE_FORCED_4 = 0x02000000,
VEHICLE_SEAT_FLAG_B_CAN_SWITCH = 0x04000000,
- VEHICLE_SEAT_FLAG_B_VEHICLE_PLAYERFRAME_UI = 0x80000000, // Lua_UnitHasVehiclePlayerFrameUI - actually checked for flagsb &~ 0x80000000
+ VEHICLE_SEAT_FLAG_B_VEHICLE_PLAYERFRAME_UI = 0x80000000 // Lua_UnitHasVehiclePlayerFrameUI - actually checked for flagsb &~ 0x80000000
};
#endif
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 4be6c33db79..850c58bdf93 100755
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -200,7 +200,7 @@ uint32 DBCFileCount = 0;
static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename)
{
- sLog->outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
+ sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
// ASSERT must fail after function call
return false;
@@ -457,7 +457,7 @@ void LoadDBCStores(const std::string& dataPath)
if (spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x]))
{
if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
- sLog->outErrorDb("spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
+ sLog->outError(LOG_FILTER_SQL, "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
}
else
@@ -610,7 +610,7 @@ void LoadDBCStores(const std::string& dataPath)
// error checks
if (bad_dbc_files.size() >= DBCFileCount)
{
- sLog->outError("Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFileCount, dataPath.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFileCount, dataPath.c_str());
exit(1);
}
else if (!bad_dbc_files.empty())
@@ -619,7 +619,7 @@ void LoadDBCStores(const std::string& dataPath)
for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
str += *i + "\n";
- sLog->outError("Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
exit(1);
}
@@ -632,12 +632,12 @@ void LoadDBCStores(const std::string& dataPath)
!sMapStore.LookupEntry(724) || // last map added in 3.3.5a
!sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a
{
- sLog->outError("You have _outdated_ DBC files. Please extract correct versions from current using client.");
+ sLog->outError(LOG_FILTER_GENERAL, "You have _outdated_ DBC files. Please extract correct versions from current using client.");
exit(1);
}
- sLog->outString(">> Initialized %d data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Initialized %d data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
+
}
SimpleFactionsList const* GetFactionTeamList(uint32 faction)
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 15792fd57da..ef949f43f49 100755
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1052,7 +1052,7 @@ struct GtRegenMPPerSptEntry
/* no used
struct HolidayDescriptionsEntry
{
- uint32 ID; // 0, this is NOT holiday id
+ uint32 ID; // 0, m_holidayDescriptionID
//char* name[16] // 1-16 m_name_lang
// 17 name flags
};
@@ -1061,7 +1061,7 @@ struct HolidayDescriptionsEntry
/* no used
struct HolidayNamesEntry
{
- uint32 ID; // 0, this is NOT holiday id
+ uint32 ID; // 0, m_holidayNameID
//char* name[16] // 1-16 m_name_lang
// 17 name flags
};
@@ -1092,7 +1092,7 @@ struct ItemEntry
uint32 ID; // 0
uint32 Class; // 1
uint32 SubClass; // 2 some items have strange subclasses
- int32 Unk0; // 3
+ int32 SoundOverrideSubclass; // 3
int32 Material; // 4
uint32 DisplayId; // 5
uint32 InventoryType; // 6
@@ -1203,7 +1203,7 @@ struct LFGDungeonEntry
uint32 recmaxlevel; // 22
int32 map; // 23
uint32 difficulty; // 24
- //uint32 flags; // 25
+ //uint32 flags; // 25 (flags & 4) = IsHoliday
uint32 type; // 26
//uint32 unk; // 27
//char* iconname; // 28
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index a5ff89136b8..618032e5f97 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -135,8 +135,7 @@ void LFGMgr::LoadRewards()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
return;
}
@@ -157,25 +156,25 @@ void LFGMgr::LoadRewards()
if (!sLFGDungeonStore.LookupEntry(dungeonId))
{
- sLog->outErrorDb("Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
continue;
}
if (!maxLevel || maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
- sLog->outErrorDb("Level %u specified for dungeon %u in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "Level %u specified for dungeon %u in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
}
if (firstQuestId && !sObjectMgr->GetQuestTemplate(firstQuestId))
{
- sLog->outErrorDb("First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
firstQuestId = 0;
}
if (otherQuestId && !sObjectMgr->GetQuestTemplate(otherQuestId))
{
- sLog->outErrorDb("Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
otherQuestId = 0;
}
@@ -183,8 +182,7 @@ void LFGMgr::LoadRewards()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void LFGMgr::Update(uint32 diff)
@@ -310,7 +308,7 @@ void LFGMgr::Update(uint32 diff)
LfgQueueInfo* queue = itQueue->second;
if (!queue)
{
- sLog->outError("LFGMgr::Update: [" UI64FMTD "] queued with null queue info!", itQueue->first);
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::Update: [" UI64FMTD "] queued with null queue info!", itQueue->first);
continue;
}
uint32 dungeonId = (*queue->dungeons.begin());
@@ -433,8 +431,8 @@ void LFGMgr::InitializeLockedDungeons(Player* player)
locktype = LFG_LOCKSTATUS_RAID_LOCKED;
else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
{
- if (!player->GetGroup() || !player->GetGroup()->isLFGGroup() || GetDungeon(player->GetGroup()->GetGUID(), true) != dungeon->ID || GetState(player->GetGroup()->GetGUID()) != LFG_STATE_DUNGEON)
- locktype = LFG_LOCKSTATUS_RAID_LOCKED;
+ //if (!player->GetGroup() || !player->GetGroup()->isLFGGroup() || GetDungeon(player->GetGroup()->GetGUID(), true) != dungeon->ID || GetState(player->GetGroup()->GetGUID()) != LFG_STATE_DUNGEON)
+ locktype = LFG_LOCKSTATUS_RAID_LOCKED;
}
else if (dungeon->minlevel > level)
locktype = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
@@ -442,7 +440,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player)
locktype = LFG_LOCKSTATUS_TOO_HIGH_LEVEL;
else if (locktype == LFG_LOCKSTATUS_OK && ar)
{
- if (ar->achievement && !player->GetAchievementMgr().HasAchieved(ar->achievement))
+ if (ar->achievement && !player->HasAchieved(ar->achievement))
locktype = LFG_LOCKSTATUS_RAID_LOCKED; // FIXME: Check the correct lock value
else if (player->GetTeam() == ALLIANCE && ar->quest_A && !player->GetQuestRewardStatus(ar->quest_A))
locktype = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
@@ -791,7 +789,7 @@ LfgProposal* LFGMgr::FindNewGroups(LfgGuidList& check, LfgGuidList& all)
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FindNewGroup: (%s) - all(%s)", ConcatenateGuids(check).c_str(), ConcatenateGuids(all).c_str());
LfgProposal* pProposal = NULL;
- if (!check.size() || check.size() > MAXGROUPSIZE || !CheckCompatibility(check, pProposal))
+ if (check.empty() || check.size() > MAXGROUPSIZE || !CheckCompatibility(check, pProposal))
return NULL;
// Try to match with queued groups
@@ -863,7 +861,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid);
if (itQueue == m_QueueInfoMap.end() || GetState(guid) != LFG_STATE_QUEUED)
{
- sLog->outError("LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it));
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it));
RemoveFromQueue(guid);
return false;
}
@@ -1241,11 +1239,11 @@ LfgAnswer LFGMgr::GetCompatibles(std::string key)
void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& players, LfgLockPartyMap& lockMap)
{
lockMap.clear();
- for (PlayerSet::const_iterator it = players.begin(); it != players.end() && dungeons.size(); ++it)
+ for (PlayerSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it)
{
uint64 guid = (*it)->GetGUID();
LfgLockMap cachedLockMap = GetLockedDungeons(guid);
- for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && dungeons.size(); ++it2)
+ for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && !dungeons.empty(); ++it2)
{
uint32 dungeonId = (it2->first & 0x00FFFFFF); // Compare dungeon ids
LfgDungeonSet::iterator itDungeon = dungeons.find(dungeonId);
@@ -1404,13 +1402,13 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
LfgProposalPlayer* player = pProposal->players[(*it)->GetGUID()];
uint32 lowgroupguid = (*it)->GetGroup() ? (*it)->GetGroup()->GetLowGUID() : 0;
if (player->groupLowGuid != lowgroupguid)
- sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid);
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid);
uint64 guid2 = player->groupLowGuid ? MAKE_NEW_GUID(player->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID();
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid2);
if (itQueue == m_QueueInfoMap.end())
{
- sLog->outError("LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid);
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid);
waitTimesMap[(*it)->GetGUID()] = -1;
}
else
@@ -1813,7 +1811,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(dungeon->map);
if (!at)
{
- sLog->outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "]: No areatrigger found for map: %u difficulty: %u", player->GetGUID(), dungeon->map, dungeon->difficulty);
+ sLog->outError(LOG_FILTER_LFG, "LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "]: No areatrigger found for map: %u difficulty: %u", player->GetGUID(), dungeon->map, dungeon->difficulty);
error = LFG_TELEPORTERROR_INVALID_LOCATION;
}
else
@@ -1843,7 +1841,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
else
{
error = LFG_TELEPORTERROR_INVALID_LOCATION;
- sLog->outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", player->GetGUID(), mapid);
+ sLog->outError(LOG_FILTER_LFG, "LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", player->GetGUID(), mapid);
}
}
}
@@ -1901,7 +1899,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
// Update achievements
if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC)
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1);
LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel());
if (!reward)
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index f21818deb64..e341b21706f 100755
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -29,7 +29,7 @@ class Player;
enum LFGenum
{
- LFG_TIME_ROLECHECK = 2*MINUTE,
+ LFG_TIME_ROLECHECK = 40*IN_MILLISECONDS,
LFG_TIME_BOOT = 2*MINUTE,
LFG_TIME_PROPOSAL = 2*MINUTE,
LFG_TANKS_NEEDED = 1,
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 1fa7fe0ca9f..e4b67e22221 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -23,9 +23,10 @@
#include "SharedDefines.h"
#include "Player.h"
#include "Group.h"
-#include "ScriptPCH.h"
#include "LFGScripts.h"
#include "LFGMgr.h"
+#include "ScriptMgr.h"
+#include "ObjectAccessor.h"
LFGPlayerScript::LFGPlayerScript() : PlayerScript("LFGPlayerScript")
{
diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h
index 4b332c7d731..ac1f66abbda 100644
--- a/src/server/game/DungeonFinding/LFGScripts.h
+++ b/src/server/game/DungeonFinding/LFGScripts.h
@@ -21,7 +21,7 @@
#include "Common.h"
#include "SharedDefines.h"
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
class Player;
class Group;
diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp
index 4613a3554db..9359581e3a0 100755
--- a/src/server/game/Entities/Corpse/Corpse.cpp
+++ b/src/server/game/Entities/Corpse/Corpse.cpp
@@ -26,8 +26,7 @@
#include "GossipDef.h"
#include "World.h"
-Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES)
-, m_type(type)
+Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type)
{
m_objectType |= TYPEMASK_CORPSE;
m_objectTypeId = TYPEID_CORPSE;
@@ -39,6 +38,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES)
m_time = time(NULL);
lootForBody = false;
+ lootRecipient = NULL;
}
Corpse::~Corpse()
@@ -78,7 +78,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
if (!IsPositionValid())
{
- sLog->outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_PLAYER, "Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow, owner->GetName(), owner->GetPositionX(), owner->GetPositionY());
return false;
}
@@ -134,7 +134,7 @@ void Corpse::DeleteBonesFromWorld()
if (!corpse)
{
- sLog->outError("Bones %u not found in world.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Bones %u not found in world.", GetGUIDLow());
return;
}
@@ -194,7 +194,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
if (!IsPositionValid())
{
- sLog->outError("Corpse (guid: %u, owner: %u) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
+ sLog->outError(LOG_FILTER_PLAYER, "Corpse (guid: %u, owner: %u) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
GetGUIDLow(), GUID_LOPART(GetOwnerGUID()), posX, posY, posZ);
return false;
}
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 07e8e37e82a..b92c3048b45 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -173,7 +173,7 @@ Creature::~Creature()
i_AI = NULL;
//if (m_uint32Values)
- // sLog->outError("Deconstruct Creature Entry = %u", GetEntry());
+ // sLog->outError(LOG_FILTER_UNITS, "Deconstruct Creature Entry = %u", GetEntry());
}
void Creature::AddToWorld()
@@ -261,7 +261,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!normalInfo)
{
- sLog->outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature::InitEntry creature entry %u does not exist.", Entry);
return false;
}
@@ -299,7 +299,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
// Cancel load if no model defined
if (!(cinfo->GetFirstValidModelId()))
{
- sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
return false;
}
@@ -307,7 +307,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (!minfo) // Cancel load if no model defined
{
- sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
return false;
}
@@ -380,6 +380,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime);
SetUInt32Value(UNIT_FIELD_FLAGS, unit_flags);
+ SetUInt32Value(UNIT_FIELD_FLAGS_2, cInfo->unit_flags2);
SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynamicflags);
@@ -470,11 +471,11 @@ void Creature::Update(uint32 diff)
{
case JUST_RESPAWNED:
// Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting.
- sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry());
break;
case JUST_DIED:
// Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
- sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry());
break;
case DEAD:
{
@@ -523,7 +524,7 @@ void Creature::Update(uint32 diff)
else if (m_corpseRemoveTime <= time(NULL))
{
RemoveCorpse(false);
- sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
+ sLog->outDebug(LOG_FILTER_UNITS, "Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
}
break;
}
@@ -755,7 +756,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
- sLog->outErrorDb("Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
return false;
}
@@ -769,7 +770,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
if (!IsPositionValid())
{
- sLog->outError("Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
+ sLog->outError(LOG_FILTER_UNITS, "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
return false;
}
@@ -836,7 +837,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const
if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS)
{
- sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
+ sLog->outError(LOG_FILTER_SQL, "Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
GetGUIDLow(), GetEntry());
return false;
}
@@ -1038,7 +1039,7 @@ void Creature::SaveToDB()
CreatureData const* data = sObjectMgr->GetCreatureData(m_DBTableGuid);
if (!data)
{
- sLog->outError("Creature::SaveToDB failed, cannot get creature data!");
+ sLog->outError(LOG_FILTER_UNITS, "Creature::SaveToDB failed, cannot get creature data!");
return;
}
@@ -1252,7 +1253,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
- sLog->outErrorDb("Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
return false;
}
@@ -1278,7 +1279,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap)
if (!data)
{
- sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ", guid);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) not found in table `creature`, can't load. ", guid);
return false;
}
@@ -1394,7 +1395,7 @@ void Creature::DeleteFromDB()
{
if (!m_DBTableGuid)
{
- sLog->outError("Trying to delete not saved creature! LowGUID: %u, Entry: %u", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Trying to delete not saved creature! LowGUID: %u, Entry: %u", GetGUIDLow(), GetEntry());
return;
}
@@ -1600,7 +1601,7 @@ void Creature::Respawn(bool force)
if (m_DBTableGuid)
GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid);
- sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry());
+ sLog->outDebug(LOG_FILTER_UNITS, "Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry());
m_respawnTime = 0;
lootForPickPocketed = false;
lootForBody = false;
@@ -1676,11 +1677,15 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
// the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
bool immunedToAllEffects = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (!spellInfo->Effects[i].IsEffect())
+ continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immunedToAllEffects = false;
break;
}
+ }
if (immunedToAllEffects)
return true;
@@ -1710,7 +1715,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
+ sLog->outError(LOG_FILTER_UNITS, "WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1758,7 +1763,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
+ sLog->outError(LOG_FILTER_UNITS, "WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1830,7 +1835,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
if (dist > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > MAX_VISIBILITY_DISTANCE. Distance set to ATTACK_DISTANCE.", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > MAX_VISIBILITY_DISTANCE. Distance set to ATTACK_DISTANCE.", GetGUIDLow(), GetEntry());
dist = ATTACK_DISTANCE;
}
@@ -2114,7 +2119,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
if (!AdditionalSpellInfo)
{
- sLog->outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
continue;
}
@@ -2122,7 +2127,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
if (HasAura(*itr))
{
if (!reload)
- sLog->outErrorDb("Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
continue;
}
@@ -2149,7 +2154,7 @@ void Creature::SetInCombatWithZone()
{
if (!CanHaveThreatList())
{
- sLog->outError("Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
return;
}
@@ -2157,7 +2162,7 @@ void Creature::SetInCombatWithZone()
if (!map->IsDungeon())
{
- sLog->outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
+ sLog->outError(LOG_FILTER_UNITS, "Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
return;
}
@@ -2226,6 +2231,38 @@ bool Creature::HasSpellCooldown(uint32 spell_id) const
return (itr != m_CreatureSpellCooldowns.end() && itr->second > time(NULL)) || HasCategoryCooldown(spell_id);
}
+void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
+{
+ time_t curTime = time(NULL);
+ for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ {
+ if (m_spells[i] == 0)
+ continue;
+
+ uint32 unSpellId = m_spells[i];
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
+ if (!spellInfo)
+ {
+ ASSERT(spellInfo);
+ continue;
+ }
+
+ // Not send cooldown for this spells
+ if (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
+ continue;
+
+ if (spellInfo->PreventionType != SPELL_PREVENTION_TYPE_SILENCE)
+ continue;
+
+ if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetCreatureSpellCooldownDelay(unSpellId) < unTimeMs)
+ {
+ _AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
+ if (UnitAI* ai = GetAI())
+ ai->SpellInterrupted(unSpellId, unTimeMs);
+ }
+ }
+}
+
bool Creature::HasSpell(uint32 spellID) const
{
uint8 i;
@@ -2443,7 +2480,7 @@ void Creature::SetPosition(float x, float y, float z, float o)
GetMap()->CreatureRelocation(ToCreature(), x, y, z, o);
if (IsVehicle())
- GetVehicleKit()->RelocatePassengers(x, y, z, o);
+ GetVehicleKit()->RelocatePassengers();
}
bool Creature::IsDungeonBoss() const
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index c8ebf1aa13b..b9fb5c8831c 100755
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -54,7 +54,7 @@ enum CreatureFlagsExtra
CREATURE_FLAG_EXTRA_NO_SKILLGAIN = 0x00040000, // creature won't increase weapon skills
CREATURE_FLAG_EXTRA_TAUNT_DIMINISH = 0x00080000, // Taunt is a subject to diminishing returns on this creautre
CREATURE_FLAG_EXTRA_ALL_DIMINISH = 0x00100000, // Creature is subject to all diminishing returns as player are
- CREATURE_FLAG_EXTRA_DUNGEON_BOSS = 0x10000000, // creature is a dungeon boss (SET DYNAMICALLY, DO NOT ADD IN DB)
+ CREATURE_FLAG_EXTRA_DUNGEON_BOSS = 0x10000000 // creature is a dungeon boss (SET DYNAMICALLY, DO NOT ADD IN DB)
};
#define CREATURE_FLAG_EXTRA_DB_ALLOWED (CREATURE_FLAG_EXTRA_INSTANCE_BIND | CREATURE_FLAG_EXTRA_CIVILIAN | \
@@ -111,6 +111,7 @@ struct CreatureTemplate
uint32 rangeattacktime;
uint32 unit_class; // enum Classes. Note only 4 classes are known for creatures.
uint32 unit_flags; // enum UnitFlags mask values
+ uint32 unit_flags2; // enum UnitFlags2 mask values
uint32 dynamicflags;
uint32 family; // enum CreatureFamily values (optional)
uint32 trainer_type;
@@ -411,15 +412,15 @@ typedef std::map<uint32, time_t> CreatureSpellCooldowns;
enum CreatureCellMoveState
{
- CREATURE_CELL_MOVE_NONE, //not in move list
- CREATURE_CELL_MOVE_ACTIVE, //in move list
- CREATURE_CELL_MOVE_INACTIVE, //in move list but should not move
+ CREATURE_CELL_MOVE_NONE, // not in move list
+ CREATURE_CELL_MOVE_ACTIVE, // in move list
+ CREATURE_CELL_MOVE_INACTIVE // in move list but should not move
};
class MapCreature
{
- friend class Map; //map for moving creatures
- friend class ObjectGridLoader; //grid loader for loading creatures
+ friend class Map; // map for moving creatures
+ friend class ObjectGridLoader; // grid loader for loading creatures
protected:
MapCreature() : _moveState(CREATURE_CELL_MOVE_NONE) {}
@@ -539,6 +540,13 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
void AddCreatureSpellCooldown(uint32 spellid);
bool HasSpellCooldown(uint32 spell_id) const;
bool HasCategoryCooldown(uint32 spell_id) const;
+ uint32 GetCreatureSpellCooldownDelay(uint32 spellId) const
+ {
+ CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spellId);
+ time_t t = time(NULL);
+ return uint32(itr != m_CreatureSpellCooldowns.end() && itr->second > t ? itr->second - t : 0);
+ }
+ virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
bool HasSpell(uint32 spellID) const;
@@ -660,6 +668,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
bool hasInvolvedQuest(uint32 quest_id) const;
bool isRegeneratingHealth() { return m_regenHealth; }
+ void setRegeneratingHealth(bool regenHealth) { m_regenHealth = regenHealth; }
virtual uint8 GetPetAutoSpellSize() const { return MAX_SPELL_CHARM; }
virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const
{
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index 54953ef5420..8823a788555 100755
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -84,8 +84,7 @@ void FormationMgr::LoadCreatureFormations()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
return;
}
@@ -118,14 +117,14 @@ void FormationMgr::LoadCreatureFormations()
{
if (!sObjectMgr->GetCreatureData(group_member->leaderGUID))
{
- sLog->outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
+ sLog->outError(LOG_FILTER_SQL, "creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
delete group_member;
continue;
}
if (!sObjectMgr->GetCreatureData(memberGUID))
{
- sLog->outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID);
+ sLog->outError(LOG_FILTER_SQL, "creature_formations table member guid %u incorrect (not exist)", memberGUID);
delete group_member;
continue;
}
@@ -136,8 +135,7 @@ void FormationMgr::LoadCreatureFormations()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void CreatureGroup::AddMember(Creature* member)
diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp
index 836fbe8c7bf..ec196280d99 100755
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -177,7 +177,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poiId) const
PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poiId);
if (!poi)
{
- sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.", poiId);
+ sLog->outError(LOG_FILTER_SQL, "Request to send non-existing POI (Id: %u), ignored.", poiId);
return;
}
@@ -367,8 +367,8 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
}
// rewarded honor points. Multiply with 10 to satisfy client
- data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier());
- data << float(0.0f); // new 3.3.0, honor multiplier?
+ data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest)));
+ data << float(0.0f); // unk, honor multiplier?
data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
data << int32(quest->GetRewSpellCast()); // casted spell
data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
@@ -454,8 +454,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
data << int32(quest->GetRewSpellCast()); // casted spell
// rewarded honor points
- data << Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier());
- data << float(0); // new reward honor (multipled by ~62 at client side)
+ data << uint32(quest->GetRewHonorAddition());
+ data << float(quest->GetRewHonorMultiplier());
data << uint32(quest->GetSrcItemId()); // source item id
data << uint32(quest->GetFlags() & 0xFFFF); // quest flags
data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
@@ -598,8 +598,8 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST));
// rewarded honor points. Multiply with 10 to satisfy client
- data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier());
- data << float(0); // unk, honor multiplier?
+ data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest)));
+ data << float(0.0f); // unk, honor multiplier?
data << uint32(0x08); // unused by client?
data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
data << int32(quest->GetRewSpellCast()); // casted spell
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 2af6b4c04fd..43b29c600d6 100755
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -159,7 +159,7 @@ void TempSummon::Update(uint32 diff)
}
default:
UnSummon();
- sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
+ sLog->outError(LOG_FILTER_UNITS, "Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
break;
}
}
@@ -267,7 +267,7 @@ void TempSummon::RemoveFromWorld()
owner->m_SummonSlot[slot] = 0;
//if (GetOwnerGUID())
- // sLog->outError("Unit %u has owner guid when removed from world", GetEntry());
+ // sLog->outError(LOG_FILTER_UNITS, "Unit %u has owner guid when removed from world", GetEntry());
Creature::RemoveFromWorld();
}
diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h
index 537bbd9c099..ba7faf60ddf 100755
--- a/src/server/game/Entities/Creature/TemporarySummon.h
+++ b/src/server/game/Entities/Creature/TemporarySummon.h
@@ -29,7 +29,7 @@ class TempSummon : public Creature
void Update(uint32 time);
virtual void InitStats(uint32 lifetime);
virtual void InitSummon();
- void UnSummon(uint32 msTime = 0);
+ virtual void UnSummon(uint32 msTime = 0);
void RemoveFromWorld();
void SetTempSummonType(TempSummonType type);
void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) {}
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index 76d4cb6624b..cd4a9443867 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -85,7 +85,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe
Relocate(pos);
if (!IsPositionValid())
{
- sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
+ sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
return false;
}
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h
index 7e68f6acd38..68da99ac668 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -29,7 +29,7 @@ enum DynamicObjectType
{
DYNAMIC_OBJECT_PORTAL = 0x0, // unused
DYNAMIC_OBJECT_AREA_SPELL = 0x1,
- DYNAMIC_OBJECT_FARSIGHT_FOCUS = 0x2,
+ DYNAMIC_OBJECT_FARSIGHT_FOCUS = 0x2
};
class DynamicObject : public WorldObject, public GridObject<DynamicObject>
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 1d9958a6524..c28ff21bfa5 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -119,7 +119,7 @@ void GameObject::RemoveFromOwner()
else if (IS_PET_GUID(ownerGUID))
ownerType = "pet";
- sLog->outCrash("Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
+ sLog->outFatal(LOG_FILTER_GENERAL, "Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
GetGUIDLow(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), GUID_LOPART(ownerGUID), ownerType);
SetOwnerGUID(0);
}
@@ -133,14 +133,13 @@ void GameObject::AddToWorld()
m_zoneScript->OnGameObjectCreate(this);
sObjectAccessor->AddObject(this);
- bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
+
// The state can be changed after GameObject::Create but before GameObject::AddToWorld
- bool toggledState = GetGOData() ? GetGOData()->go_state == GO_STATE_READY : false;
+ bool toggledState = GetGoType() == GAMEOBJECT_TYPE_CHEST ? getLootState() == GO_READY : GetGoState() == GO_STATE_READY;
if (m_model)
- GetMap()->Insert(*m_model);
- if (startOpen ^ toggledState)
- EnableCollision(false);
+ GetMap()->InsertGameObjectModel(*m_model);
+ EnableCollision(toggledState);
WorldObject::AddToWorld();
}
}
@@ -155,8 +154,8 @@ void GameObject::RemoveFromWorld()
RemoveFromOwner();
if (m_model)
- if (GetMap()->Contains(*m_model))
- GetMap()->Remove(*m_model);
+ if (GetMap()->ContainsGameObjectModel(*m_model))
+ GetMap()->RemoveGameObjectModel(*m_model);
WorldObject::RemoveFromWorld();
sObjectAccessor->RemoveObject(this);
}
@@ -170,7 +169,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
Relocate(x, y, z, ang);
if (!IsPositionValid())
{
- sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
+ sLog->outError(LOG_FILTER_GENERAL, "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
return false;
}
@@ -187,7 +186,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
if (!goinfo)
{
- sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
return false;
}
@@ -197,7 +196,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
{
- sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
return false;
}
@@ -268,7 +267,7 @@ void GameObject::Update(uint32 diff)
if (!AI())
{
if (!AIM_Initialize())
- sLog->outError("Could not initialize GameObjectAI");
+ sLog->outError(LOG_FILTER_GENERAL, "Could not initialize GameObjectAI");
} else
AI()->UpdateAI(diff);
@@ -647,7 +646,7 @@ void GameObject::SaveToDB()
GameObjectData const* data = sObjectMgr->GetGOData(m_DBTableGuid);
if (!data)
{
- sLog->outError("GameObject::SaveToDB failed, cannot get gameobject data!");
+ sLog->outError(LOG_FILTER_GENERAL, "GameObject::SaveToDB failed, cannot get gameobject data!");
return;
}
@@ -721,7 +720,7 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
if (!data)
{
- sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
return false;
}
@@ -855,6 +854,13 @@ bool GameObject::IsDynTransport() const
return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause);
}
+bool GameObject::IsDestructibleBuilding() const
+{
+ GameObjectTemplate const* gInfo = GetGOInfo();
+ if (!gInfo) return false;
+ return gInfo->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING;
+}
+
Unit* GameObject::GetOwner() const
{
return ObjectAccessor::GetUnit(*this, GetOwnerGUID());
@@ -871,7 +877,7 @@ bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const
if (WorldObject::IsAlwaysVisibleFor(seer))
return true;
- if (IsTransport())
+ if (IsTransport() || IsDestructibleBuilding())
return true;
if (!seer)
@@ -1302,7 +1308,7 @@ void GameObject::Use(Unit* user)
//provide error, no fishable zone or area should be 0
if (!zone_skill)
- sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
+ sLog->outError(LOG_FILTER_SQL, "Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
int32 skill = player->GetSkillValue(SKILL_FISHING);
@@ -1318,7 +1324,7 @@ void GameObject::Use(Unit* user)
int32 roll = irand(1, 100);
- sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
if (chance >= roll)
@@ -1412,7 +1418,8 @@ void GameObject::Use(Unit* user)
// full amount unique participants including original summoner
if (GetUniqueUseCount() == info->summoningRitual.reqParticipants)
{
- spellCaster = m_ritualOwner ? m_ritualOwner : spellCaster;
+ if (m_ritualOwner)
+ spellCaster = m_ritualOwner;
spellId = info->summoningRitual.spellId;
@@ -1612,7 +1619,7 @@ void GameObject::Use(Unit* user)
}
default:
if (GetGoType() >= MAX_GAMEOBJECT_TYPE)
- sLog->outError("GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
+ sLog->outError(LOG_FILTER_GENERAL, "GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
user->GetTypeId(), user->GetGUIDLow(), user->GetName(), GetGUIDLow(), GetEntry(), GetGOInfo()->name.c_str(), GetGoType());
break;
}
@@ -1624,7 +1631,7 @@ void GameObject::Use(Unit* user)
if (!spellInfo)
{
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this))
- sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
+ sLog->outError(LOG_FILTER_GENERAL, "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
else
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
return;
@@ -1700,6 +1707,11 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
float dy = y - GetPositionY();
float dz = z - GetPositionZ();
float dist = sqrt(dx*dx + dy*dy);
+ //! Check if the distance between the 2 objects is 0, can happen if both objects are on the same position.
+ //! The code below this check wont crash if dist is 0 because 0/0 in float operations is valid, and returns infinite
+ if (G3D::fuzzyEq(dist, 0.0f))
+ return true;
+
float sinB = dx / dist;
float cosB = dy / dist;
dx = dist * (cosA * cosB + sinA * sinB);
@@ -1919,17 +1931,12 @@ void GameObject::SetLootState(LootState state, Unit* unit)
sScriptMgr->OnGameObjectLootStateChanged(this, state, unit);
if (m_model)
{
- // startOpen determines whether we are going to add or remove the LoS on activation
- bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
-
+ bool collision = false;
// Use the current go state
- if (GetGoState() == GO_STATE_ACTIVE)
- startOpen = !startOpen;
+ if ((GetGoState() != GO_STATE_READY && (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED)) || state == GO_READY)
+ collision = !collision;
- if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED)
- EnableCollision(startOpen);
- else if (state == GO_READY)
- EnableCollision(!startOpen);
+ EnableCollision(collision);
}
}
@@ -1943,15 +1950,11 @@ void GameObject::SetGoState(GOState state)
return;
// startOpen determines whether we are going to add or remove the LoS on activation
- bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
-
- if (GetGOData() && GetGOData()->go_state == GO_STATE_READY)
- startOpen = !startOpen;
+ bool collision = false;
+ if (state == GO_STATE_READY)
+ collision = !collision;
- if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE)
- EnableCollision(startOpen);
- else if (state == GO_STATE_READY)
- EnableCollision(!startOpen);
+ EnableCollision(collision);
}
}
@@ -1964,7 +1967,8 @@ void GameObject::SetDisplayId(uint32 displayid)
void GameObject::SetPhaseMask(uint32 newPhaseMask, bool update)
{
WorldObject::SetPhaseMask(newPhaseMask, update);
- EnableCollision(true);
+ if (m_model && m_model->isEnabled())
+ EnableCollision(true);
}
void GameObject::EnableCollision(bool enable)
@@ -1972,8 +1976,8 @@ void GameObject::EnableCollision(bool enable)
if (!m_model)
return;
- /*if (enable && !GetMap()->Contains(*m_model))
- GetMap()->Insert(*m_model);*/
+ /*if (enable && !GetMap()->ContainsGameObjectModel(*m_model))
+ GetMap()->InsertGameObjectModel(*m_model);*/
m_model->enable(enable ? GetPhaseMask() : 0);
}
@@ -1983,12 +1987,12 @@ void GameObject::UpdateModel()
if (!IsInWorld())
return;
if (m_model)
- if (GetMap()->Contains(*m_model))
- GetMap()->Remove(*m_model);
+ if (GetMap()->ContainsGameObjectModel(*m_model))
+ GetMap()->RemoveGameObjectModel(*m_model);
delete m_model;
m_model = GameObjectModel::Create(*this);
if (m_model)
- GetMap()->Insert(*m_model);
+ GetMap()->InsertGameObjectModel(*m_model);
}
Player* GameObject::GetLootRecipient() const
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index a8035043543..8fb81a0e021 100755
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -632,6 +632,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
bool IsTransport() const;
bool IsDynTransport() const;
+ bool IsDestructibleBuilding() const;
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
@@ -801,6 +802,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
std::string GetAIName() const;
void SetDisplayId(uint32 displayid);
+ uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); }
GameObjectModel * m_model;
protected:
diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp
index c4d4adeb6f2..db563c712cd 100755
--- a/src/server/game/Entities/Item/Container/Bag.cpp
+++ b/src/server/game/Entities/Item/Container/Bag.cpp
@@ -41,7 +41,7 @@ Bag::~Bag()
{
if (item->IsInWorld())
{
- sLog->outCrash("Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
+ sLog->outFatal(LOG_FILTER_PLAYER_ITEMS, "Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
item->GetEntry(), (uint32)item->GetSlot(), (uint32)item->GetBagSlot(),
GetEntry(), (uint32)GetSlot(), (uint32)GetBagSlot(), (uint32)i);
item->RemoveFromWorld();
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 209fdae8ce6..58cc1d027a3 100755
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -36,7 +36,7 @@ void AddItemsSetItem(Player* player, Item* item)
if (!set)
{
- sLog->outErrorDb("Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
+ sLog->outError(LOG_FILTER_SQL, "Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
return;
}
@@ -96,7 +96,7 @@ void AddItemsSetItem(Player* player, Item* item)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
break;
}
@@ -117,7 +117,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
if (!set)
{
- sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
+ sLog->outError(LOG_FILTER_SQL, "Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
return;
}
@@ -597,7 +597,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
// item can have not null only one from field values
if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
{
- sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
+ sLog->outError(LOG_FILTER_SQL, "Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
return 0;
}
@@ -608,7 +608,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomPropertiesEntry const* random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (!random_id)
{
- sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
+ sLog->outError(LOG_FILTER_SQL, "Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
return 0;
}
@@ -621,7 +621,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomSuffixEntry const* random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
if (!random_id)
{
- sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
+ sLog->outError(LOG_FILTER_SQL, "Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
return 0;
}
@@ -1019,7 +1019,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
if (count > pProto->GetMaxStackSize())
count = pProto->GetMaxStackSize();
- ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
+ ASSERT(count != 0 && "pProto->Stackable == 0 but checked at loading already");
Item* pItem = NewItemOrBag(pProto);
if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player))
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index 1d5fcae7d28..a5f9ed5c008 100755
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -240,6 +240,7 @@ class Item : public Object
bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); }
bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; }
+ bool IsCurrencyToken() const { return GetTemplate()->IsCurrencyToken(); }
bool IsNotEmptyBag() const;
bool IsBroken() const { return GetUInt32Value(ITEM_FIELD_MAXDURABILITY) > 0 && GetUInt32Value(ITEM_FIELD_DURABILITY) == 0; }
bool CanBeTraded(bool mail = false, bool trade = false) const;
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
index f3d7d7fd56c..f85bf80e145 100755
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -70,14 +70,10 @@ void LoadRandomEnchantmentsTable()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
else
- {
- sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
- sLog->outString();
- }
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
}
uint32 GetItemEnchantMod(int32 entry)
@@ -91,7 +87,7 @@ uint32 GetItemEnchantMod(int32 entry)
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
if (tab == RandomItemEnch.end())
{
- sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
return 0;
}
diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h
index 1b5eec7fbaf..f2f41d6a8b9 100755
--- a/src/server/game/Entities/Item/ItemPrototype.h
+++ b/src/server/game/Entities/Item/ItemPrototype.h
@@ -181,7 +181,7 @@ enum ItemFieldFlags
ITEM_FLAG_UNK25 = 0x40000000, // ?
ITEM_FLAG_UNK26 = 0x80000000, // ?
- ITEM_FLAG_MAIL_TEXT_MASK = ITEM_FLAG_READABLE | ITEM_FLAG_UNK13 | ITEM_FLAG_UNK14,
+ ITEM_FLAG_MAIL_TEXT_MASK = ITEM_FLAG_READABLE | ITEM_FLAG_UNK13 | ITEM_FLAG_UNK14
};
enum ItemFlagsExtra
@@ -196,6 +196,7 @@ enum ItemFlagsCustom
{
ITEM_FLAGS_CU_DURATION_REAL_TIME = 0x0001, // Item duration will tick even if player is offline
ITEM_FLAGS_CU_IGNORE_QUEST_STATUS = 0x0002, // No quest status will be checked when this item drops
+ ITEM_FLAGS_CU_FOLLOW_LOOT_RULES = 0x0004 // Item will always follow group/master/need before greed looting rules
};
enum BAG_FAMILY_MASK
@@ -587,7 +588,7 @@ struct ItemTemplate
uint32 ItemId;
uint32 Class; // id from ItemClass.dbc
uint32 SubClass; // id from ItemSubClass.dbc
- int32 Unk0;
+ int32 SoundOverrideSubclass; // < 0: id from ItemSubClass.dbc, used to override weapon sound from actual SubClass
std::string Name1;
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
uint32 Quality;
@@ -681,6 +682,8 @@ struct ItemTemplate
return false;
}
+ bool IsCurrencyToken() const { return BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS; }
+
uint32 GetMaxStackSize() const
{
return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable);
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index fc1b56c4b8c..cbdae9de0bf 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -41,12 +41,15 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "SpellAuraEffects.h"
-
+#include "UpdateFieldFlags.h"
#include "TemporarySummon.h"
#include "Totem.h"
#include "OutdoorPvPMgr.h"
#include "MovementPacketBuilder.h"
#include "DynamicTree.h"
+#include "Group.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
uint32 GuidHigh2TypeId(uint32 guid_hi)
{
@@ -74,6 +77,7 @@ Object::Object() : m_PackGUID(sizeof(uint64)+1)
m_uint32Values = NULL;
_changedFields = NULL;
m_valuesCount = 0;
+ _fieldNotifyFlags = UF_FLAG_DYNAMIC;
m_inWorld = false;
m_objectUpdated = false;
@@ -88,7 +92,7 @@ WorldObject::~WorldObject()
{
if (GetTypeId() == TYPEID_CORPSE)
{
- sLog->outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
ASSERT(false);
}
ResetMap();
@@ -99,16 +103,16 @@ Object::~Object()
{
if (IsInWorld())
{
- sLog->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
if (isType(TYPEMASK_ITEM))
- sLog->outCrash("Item slot %u", ((Item*)this)->GetSlot());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Item slot %u", ((Item*)this)->GetSlot());
ASSERT(false);
RemoveFromWorld();
}
if (m_objectUpdated)
{
- sLog->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
ASSERT(false);
sObjectAccessor->RemoveUpdateObject(this);
}
@@ -463,17 +467,13 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
if (((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster())
IsActivateToQuest = true;
- updateMask->SetBit(GAMEOBJECT_DYNAMIC);
-
if (((GameObject*)this)->GetGoArtKit())
updateMask->SetBit(GAMEOBJECT_BYTES_1);
}
else if (isType(TYPEMASK_UNIT))
{
if (((Unit*)this)->HasFlag(UNIT_FIELD_AURASTATE, PER_CASTER_AURA_STATE_MASK))
- {
updateMask->SetBit(UNIT_FIELD_AURASTATE);
- }
}
}
else // case UPDATETYPE_VALUES
@@ -481,10 +481,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport())
{
if (((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster())
- {
IsActivateToQuest = true;
- }
- updateMask->SetBit(GAMEOBJECT_DYNAMIC);
+
updateMask->SetBit(GAMEOBJECT_BYTES_1);
if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST && ToGameObject()->GetGOInfo()->chest.groupLootRules &&
@@ -494,9 +492,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
else if (isType(TYPEMASK_UNIT))
{
if (((Unit*)this)->HasFlag(UNIT_FIELD_AURASTATE, PER_CASTER_AURA_STATE_MASK))
- {
updateMask->SetBit(UNIT_FIELD_AURASTATE);
- }
}
}
@@ -788,26 +784,98 @@ void Object::_LoadIntoDataField(char const* data, uint32 startOffset, uint32 cou
}
}
-void Object::_SetUpdateBits(UpdateMask* updateMask, Player* /*target*/) const
+void Object::GetUpdateFieldData(Player const* target, uint32*& flags, bool& isOwner, bool& isItemOwner, bool& hasSpecialInfo, bool& isPartyMember) const
+{
+ // This function assumes updatefield index is always valid
+ switch (GetTypeId())
+ {
+ case TYPEID_ITEM:
+ case TYPEID_CONTAINER:
+ flags = ItemUpdateFieldFlags;
+ isOwner = isItemOwner = ((Item*)this)->GetOwnerGUID() == target->GetGUID();
+ break;
+ case TYPEID_UNIT:
+ case TYPEID_PLAYER:
+ {
+ Player* plr = ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself();
+ flags = UnitUpdateFieldFlags;
+ isOwner = ToUnit()->GetOwnerGUID() == target->GetGUID();
+ hasSpecialInfo = ToUnit()->HasAuraTypeWithCaster(SPELL_AURA_EMPATHY, target->GetGUID());
+ isPartyMember = plr && plr->IsInSameGroupWith(target);
+ break;
+ }
+ case TYPEID_GAMEOBJECT:
+ flags = GameObjectUpdateFieldFlags;
+ isOwner = ToGameObject()->GetOwnerGUID() == target->GetGUID();
+ break;
+ case TYPEID_DYNAMICOBJECT:
+ flags = DynamicObjectUpdateFieldFlags;
+ isOwner = ((DynamicObject*)this)->GetCasterGUID() == target->GetGUID();
+ break;
+ case TYPEID_CORPSE:
+ flags = CorpseUpdateFieldFlags;
+ isOwner = ToCorpse()->GetOwnerGUID() == target->GetGUID();
+ break;
+ case TYPEID_OBJECT:
+ break;
+ }
+}
+
+bool Object::IsUpdateFieldVisible(uint32 flags, bool isSelf, bool isOwner, bool isItemOwner, bool isPartyMember) const
+{
+ if (flags == UF_FLAG_NONE)
+ return false;
+
+ if (flags & UF_FLAG_PUBLIC)
+ return true;
+
+ if (flags & UF_FLAG_PRIVATE && isSelf)
+ return true;
+
+ if (flags & UF_FLAG_OWNER && isOwner)
+ return true;
+
+ if (flags & UF_FLAG_ITEM_OWNER && isItemOwner)
+ return true;
+
+ if (flags & UF_FLAG_PARTY_MEMBER && isPartyMember)
+ return true;
+
+ return false;
+}
+
+void Object::_SetUpdateBits(UpdateMask* updateMask, Player* target) const
{
bool* indexes = _changedFields;
+ uint32* flags = NULL;
+ bool isSelf = target == this;
+ bool isOwner = false;
+ bool isItemOwner = false;
+ bool hasSpecialInfo = false;
+ bool isPartyMember = false;
+
+ GetUpdateFieldData(target, flags, isOwner, isItemOwner, hasSpecialInfo, isPartyMember);
for (uint16 index = 0; index < m_valuesCount; ++index, ++indexes)
- {
- if (*indexes)
+ if (_fieldNotifyFlags & flags[index] || (flags[index] & UF_FLAG_SPECIAL_INFO && hasSpecialInfo) || (*indexes && IsUpdateFieldVisible(flags[index], isSelf, isOwner, isItemOwner, isPartyMember)))
updateMask->SetBit(index);
- }
}
-void Object::_SetCreateBits(UpdateMask* updateMask, Player* /*target*/) const
+void Object::_SetCreateBits(UpdateMask* updateMask, Player* target) const
{
uint32* value = m_uint32Values;
+ uint32* flags = NULL;
+ bool isSelf = target == this;
+ bool isOwner = false;
+ bool isItemOwner = false;
+ bool hasSpecialInfo = false;
+ bool isPartyMember = false;
+
+ GetUpdateFieldData(target, flags, isOwner, isItemOwner, hasSpecialInfo, isPartyMember);
for (uint16 index = 0; index < m_valuesCount; ++index, ++value)
- {
- if (*value)
+ if (_fieldNotifyFlags & flags[index] || (flags[index] & UF_FLAG_SPECIAL_INFO && hasSpecialInfo) || (*value && IsUpdateFieldVisible(flags[index], isSelf, isOwner, isItemOwner, isPartyMember)))
updateMask->SetBit(index);
- }
}
void Object::SetInt32Value(uint16 index, int32 value)
@@ -937,7 +1005,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value)
if (offset > 4)
{
- sLog->outError("Object::SetByteValue: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::SetByteValue: wrong offset %u", offset);
return;
}
@@ -961,7 +1029,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
if (offset > 2)
{
- sLog->outError("Object::SetUInt16Value: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::SetUInt16Value: wrong offset %u", offset);
return;
}
@@ -1073,7 +1141,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
if (offset > 4)
{
- sLog->outError("Object::SetByteFlag: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::SetByteFlag: wrong offset %u", offset);
return;
}
@@ -1096,7 +1164,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
if (offset > 4)
{
- sLog->outError("Object::RemoveByteFlag: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::RemoveByteFlag: wrong offset %u", offset);
return;
}
@@ -1115,7 +1183,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
bool Object::PrintIndexError(uint32 index, bool set) const
{
- sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
+ sLog->outError(LOG_FILTER_GENERAL, "Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
// ASSERT must fail after function call
return false;
@@ -1170,32 +1238,32 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st
void MovementInfo::OutDebug()
{
- sLog->outString("MOVEMENT INFO");
- sLog->outString("guid " UI64FMTD, guid);
- sLog->outString("flags %u", flags);
- sLog->outString("flags2 %u", flags2);
- sLog->outString("time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
- sLog->outString("position: `%s`", pos.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "MOVEMENT INFO");
+ sLog->outInfo(LOG_FILTER_GENERAL, "guid " UI64FMTD, guid);
+ sLog->outInfo(LOG_FILTER_GENERAL, "flags %u", flags);
+ sLog->outInfo(LOG_FILTER_GENERAL, "flags2 %u", flags2);
+ sLog->outInfo(LOG_FILTER_GENERAL, "time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
+ sLog->outInfo(LOG_FILTER_GENERAL, "position: `%s`", pos.ToString().c_str());
if (flags & MOVEMENTFLAG_ONTRANSPORT)
{
- sLog->outString("TRANSPORT:");
- sLog->outString("guid: " UI64FMTD, t_guid);
- sLog->outString("position: `%s`", t_pos.ToString().c_str());
- sLog->outString("seat: %i", t_seat);
- sLog->outString("time: %u", t_time);
+ sLog->outInfo(LOG_FILTER_GENERAL, "TRANSPORT:");
+ sLog->outInfo(LOG_FILTER_GENERAL, "guid: " UI64FMTD, t_guid);
+ sLog->outInfo(LOG_FILTER_GENERAL, "position: `%s`", t_pos.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "seat: %i", t_seat);
+ sLog->outInfo(LOG_FILTER_GENERAL, "time: %u", t_time);
if (flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)
- sLog->outString("time2: %u", t_time2);
+ sLog->outInfo(LOG_FILTER_GENERAL, "time2: %u", t_time2);
}
if ((flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))
- sLog->outString("pitch: %f", pitch);
+ sLog->outInfo(LOG_FILTER_GENERAL, "pitch: %f", pitch);
- sLog->outString("fallTime: %u", fallTime);
+ sLog->outInfo(LOG_FILTER_GENERAL, "fallTime: %u", fallTime);
if (flags & MOVEMENTFLAG_FALLING)
- sLog->outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
+ sLog->outInfo(LOG_FILTER_GENERAL, "j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
if (flags & MOVEMENTFLAG_SPLINE_ELEVATION)
- sLog->outString("splineElevation: %f", splineElevation);
+ sLog->outInfo(LOG_FILTER_GENERAL, "splineElevation: %f", splineElevation);
}
WorldObject::WorldObject(bool isWorldObject): WorldLocation(),
@@ -1696,10 +1764,10 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
if (obj->IsAlwaysVisibleFor(this) || CanAlwaysSee(obj))
return true;
- bool corpseCheck = false;
bool corpseVisibility = false;
if (distanceCheck)
{
+ bool corpseCheck = false;
if (Player const* thisPlayer = ToPlayer())
{
if (thisPlayer->isDead() && thisPlayer->GetHealth() > 0 && // Cheap way to check for ghost state
@@ -2115,7 +2183,7 @@ void WorldObject::SetMap(Map* map)
return;
if (m_currMap)
{
- sLog->outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
+ sLog->outFatal(LOG_FILTER_GENERAL, "WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
ASSERT(false);
}
m_currMap = map;
@@ -2150,7 +2218,7 @@ void WorldObject::AddObjectToRemoveList()
Map* map = FindMap();
if (!map)
{
- sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).", GetTypeId(), GetEntry(), GetGUIDLow(), GetMapId());
+ sLog->outError(LOG_FILTER_GENERAL, "Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).", GetTypeId(), GetEntry(), GetGUIDLow(), GetMapId());
return;
}
@@ -2263,7 +2331,17 @@ void WorldObject::SetZoneScript()
if (map->IsDungeon())
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
else if (!map->IsBattlegroundOrArena())
- m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
+ {
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
+ m_zoneScript = bf;
+ else
+ {
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
+ m_zoneScript = bf;
+ else
+ m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
+ }
+ }
}
}
@@ -2316,7 +2394,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
- sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
+ sLog->outError(LOG_FILTER_GENERAL, "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
return NULL;
}
@@ -2325,7 +2403,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
- sLog->outError("no such creature entry %u", entry);
+ sLog->outError(LOG_FILTER_GENERAL, "no such creature entry %u", entry);
delete pet;
return NULL;
}
@@ -2402,7 +2480,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
if (!goinfo)
{
- sLog->outErrorDb("Gameobject template %u not found in database!", entry);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject template %u not found in database!", entry);
return NULL;
}
Map* map = GetMap();
@@ -2459,6 +2537,15 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
return go;
}
+GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
+{
+ GameObject* go = NULL;
+ Trinity::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
+ Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
+ VisitNearbyGridObject(range, searcher);
+ return go;
+}
+
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
{
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
@@ -2704,7 +2791,7 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle)
// Prevent invalid coordinates here, position is unchanged
if (!Trinity::IsValidMapCoord(destx, desty))
{
- sLog->outCrash("WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
+ sLog->outFatal(LOG_FILTER_GENERAL, "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
return;
}
@@ -2750,7 +2837,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
// Prevent invalid coordinates here, position is unchanged
if (!Trinity::IsValidMapCoord(destx, desty))
{
- sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
+ sLog->outFatal(LOG_FILTER_GENERAL, "WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
return;
}
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 5a6a5799fee..410903f6619 100755
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -300,6 +300,9 @@ class Object
virtual void BuildUpdate(UpdateDataMapType&) {}
void BuildFieldsUpdate(Player*, UpdateDataMapType &) const;
+ void SetFieldNotifyFlag(uint16 flag) { _fieldNotifyFlags |= flag; }
+ void RemoveFieldNotifyFlag(uint16 flag) { _fieldNotifyFlags &= ~flag; }
+
// FG: some hacky helpers
void ForceValuesUpdateAtIndex(uint32);
@@ -320,13 +323,16 @@ class Object
Object();
void _InitValues();
- void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh);
+ void _Create(uint32 guidlow, uint32 entry, HighGuid guidhigh);
std::string _ConcatFields(uint16 startIndex, uint16 size) const;
void _LoadIntoDataField(const char* data, uint32 startOffset, uint32 count);
- virtual void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
+ void GetUpdateFieldData(Player const* target, uint32*& flags, bool& isOwner, bool& isItemOwner, bool& hasSpecialInfo, bool& isPartyMember) const;
+
+ bool IsUpdateFieldVisible(uint32 flags, bool isSelf, bool isOwner, bool isItemOwner, bool isPartyMember) const;
- virtual void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
+ void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
+ void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
void _BuildMovementUpdate(ByteBuffer * data, uint16 flags) const;
void _BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask* updateMask, Player* target) const;
@@ -346,6 +352,8 @@ class Object
uint16 m_valuesCount;
+ uint16 _fieldNotifyFlags;
+
bool m_objectUpdated;
private:
@@ -500,13 +508,13 @@ struct MovementInfo
t_seat = -1;
}
- uint32 GetMovementFlags() { return flags; }
+ uint32 GetMovementFlags() const { return flags; }
void SetMovementFlags(uint32 flag) { flags = flag; }
void AddMovementFlag(uint32 flag) { flags |= flag; }
void RemoveMovementFlag(uint32 flag) { flags &= ~flag; }
bool HasMovementFlag(uint32 flag) const { return flags & flag; }
- uint16 GetExtraMovementFlags() { return flags2; }
+ uint16 GetExtraMovementFlags() const { return flags2; }
void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; }
bool HasExtraMovementFlag(uint16 flag) const { return flags2 & flag; }
@@ -791,6 +799,7 @@ class WorldObject : public Object, public WorldLocation
Creature* FindNearestCreature(uint32 entry, float range, bool alive = true) const;
GameObject* FindNearestGameObject(uint32 entry, float range) const;
+ GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const;
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h
index c227d081d8b..a3c8901880f 100755
--- a/src/server/game/Entities/Object/ObjectDefines.h
+++ b/src/server/game/Entities/Object/ObjectDefines.h
@@ -44,7 +44,7 @@ enum HighGuid
HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100
HIGHGUID_CORPSE = 0xF101, // blizz F100
HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT)
- HIGHGUID_GROUP = 0x1F50,
+ HIGHGUID_GROUP = 0x1F50
};
#define IS_EMPTY_GUID(Guid) (Guid == 0)
diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp
index 8f480ab3235..45464f19083 100755
--- a/src/server/game/Entities/Object/Updates/UpdateData.cpp
+++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp
@@ -57,7 +57,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION));
if (z_res != Z_OK)
{
- sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
+ sLog->outError(LOG_FILTER_GENERAL, "Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
@@ -70,14 +70,14 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflate(&c_stream, Z_NO_FLUSH);
if (z_res != Z_OK)
{
- sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res));
+ sLog->outError(LOG_FILTER_GENERAL, "Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
if (c_stream.avail_in != 0)
{
- sLog->outError("Can't compress update packet (zlib: deflate not greedy)");
+ sLog->outError(LOG_FILTER_GENERAL, "Can't compress update packet (zlib: deflate not greedy)");
*dst_size = 0;
return;
}
@@ -85,7 +85,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflate(&c_stream, Z_FINISH);
if (z_res != Z_STREAM_END)
{
- sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res));
+ sLog->outError(LOG_FILTER_GENERAL, "Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
@@ -93,7 +93,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflateEnd(&c_stream);
if (z_res != Z_OK)
{
- sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
+ sLog->outError(LOG_FILTER_GENERAL, "Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp
new file mode 100644
index 00000000000..95bdaef221b
--- /dev/null
+++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp
@@ -0,0 +1,1568 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "UpdateFieldFlags.h"
+
+uint32 ItemUpdateFieldFlags[CONTAINER_END] =
+{
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID+1
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_ENTRY
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE_X
+ UF_FLAG_NONE, // OBJECT_FIELD_PADDING
+ UF_FLAG_PUBLIC, // ITEM_FIELD_OWNER
+ UF_FLAG_PUBLIC, // ITEM_FIELD_OWNER+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_CONTAINED
+ UF_FLAG_PUBLIC, // ITEM_FIELD_CONTAINED+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_CREATOR
+ UF_FLAG_PUBLIC, // ITEM_FIELD_CREATOR+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_GIFTCREATOR
+ UF_FLAG_PUBLIC, // ITEM_FIELD_GIFTCREATOR+1
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_STACK_COUNT
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_DURATION
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_SPELL_CHARGES
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_SPELL_CHARGES+1
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_SPELL_CHARGES+2
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_SPELL_CHARGES+3
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_SPELL_CHARGES+4
+ UF_FLAG_PUBLIC, // ITEM_FIELD_FLAGS
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_1_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_1_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_1_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_2_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_2_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_2_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_3_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_3_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_3_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_4_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_4_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_4_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_5_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_5_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_5_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_6_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_6_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_6_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_7_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_7_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_7_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_8_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_8_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_8_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_9_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_9_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_9_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_10_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_10_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_10_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_11_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_11_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_11_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_12_1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_12_1+1
+ UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT_12_3
+ UF_FLAG_PUBLIC, // ITEM_FIELD_PROPERTY_SEED
+ UF_FLAG_PUBLIC, // ITEM_FIELD_RANDOM_PROPERTIES_ID
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_DURABILITY
+ UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER, // ITEM_FIELD_MAXDURABILITY
+ UF_FLAG_PUBLIC, // ITEM_FIELD_CREATE_PLAYED_TIME
+ UF_FLAG_NONE, // ITEM_FIELD_PAD
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_NUM_SLOTS
+ UF_FLAG_NONE, // CONTAINER_ALIGN_PAD
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+1
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+2
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+3
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+4
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+5
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+6
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+7
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+8
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+9
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+10
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+11
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+12
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+13
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+14
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+15
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+16
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+17
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+18
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+19
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+20
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+21
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+22
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+23
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+24
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+25
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+26
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+27
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+28
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+29
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+30
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+31
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+32
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+33
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+34
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+35
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+36
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+37
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+38
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+39
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+40
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+41
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+42
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+43
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+44
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+45
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+46
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+47
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+48
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+49
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+50
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+51
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+52
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+53
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+54
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+55
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+56
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+57
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+58
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+59
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+60
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+61
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+62
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+63
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+64
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+65
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+66
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+67
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+68
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+69
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+70
+ UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOT_1+71
+};
+
+uint32 UnitUpdateFieldFlags[PLAYER_END] =
+{
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID+1
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_ENTRY
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE_X
+ UF_FLAG_NONE, // OBJECT_FIELD_PADDING
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CHARM
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CHARM+1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMON
+ UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMON+1
+ UF_FLAG_PRIVATE, // UNIT_FIELD_CRITTER
+ UF_FLAG_PRIVATE, // UNIT_FIELD_CRITTER+1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CHARMEDBY
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CHARMEDBY+1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONEDBY
+ UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONEDBY+1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CREATEDBY
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CREATEDBY+1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_TARGET
+ UF_FLAG_PUBLIC, // UNIT_FIELD_TARGET+1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CHANNEL_OBJECT
+ UF_FLAG_PUBLIC, // UNIT_FIELD_CHANNEL_OBJECT+1
+ UF_FLAG_PUBLIC, // UNIT_CHANNEL_SPELL
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BYTES_0
+ UF_FLAG_PUBLIC, // UNIT_FIELD_HEALTH
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER2
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER3
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER4
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER5
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER6
+ UF_FLAG_PUBLIC, // UNIT_FIELD_POWER7
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXHEALTH
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER2
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER3
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER4
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER5
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER6
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MAXPOWER7
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER+6
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER+6
+ UF_FLAG_PUBLIC, // UNIT_FIELD_LEVEL
+ UF_FLAG_PUBLIC, // UNIT_FIELD_FACTIONTEMPLATE
+ UF_FLAG_PUBLIC, // UNIT_VIRTUAL_ITEM_SLOT_ID
+ UF_FLAG_PUBLIC, // UNIT_VIRTUAL_ITEM_SLOT_ID+1
+ UF_FLAG_PUBLIC, // UNIT_VIRTUAL_ITEM_SLOT_ID+2
+ UF_FLAG_PUBLIC, // UNIT_FIELD_FLAGS
+ UF_FLAG_PUBLIC, // UNIT_FIELD_FLAGS_2
+ UF_FLAG_PUBLIC, // UNIT_FIELD_AURASTATE
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BASEATTACKTIME
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BASEATTACKTIME+1
+ UF_FLAG_PRIVATE, // UNIT_FIELD_RANGEDATTACKTIME
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BOUNDINGRADIUS
+ UF_FLAG_PUBLIC, // UNIT_FIELD_COMBATREACH
+ UF_FLAG_PUBLIC, // UNIT_FIELD_DISPLAYID
+ UF_FLAG_PUBLIC, // UNIT_FIELD_NATIVEDISPLAYID
+ UF_FLAG_PUBLIC, // UNIT_FIELD_MOUNTDISPLAYID
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_MINDAMAGE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_MAXDAMAGE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_MINOFFHANDDAMAGE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_MAXOFFHANDDAMAGE
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BYTES_1
+ UF_FLAG_PUBLIC, // UNIT_FIELD_PETNUMBER
+ UF_FLAG_PUBLIC, // UNIT_FIELD_PET_NAME_TIMESTAMP
+ UF_FLAG_OWNER, // UNIT_FIELD_PETEXPERIENCE
+ UF_FLAG_OWNER, // UNIT_FIELD_PETNEXTLEVELEXP
+ UF_FLAG_DYNAMIC, // UNIT_DYNAMIC_FLAGS
+ UF_FLAG_PUBLIC, // UNIT_MOD_CAST_SPEED
+ UF_FLAG_PUBLIC, // UNIT_CREATED_BY_SPELL
+ UF_FLAG_DYNAMIC, // UNIT_NPC_FLAGS
+ UF_FLAG_PUBLIC, // UNIT_NPC_EMOTESTATE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT0
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POSSTAT0
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POSSTAT1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POSSTAT2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POSSTAT3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POSSTAT4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_NEGSTAT0
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_NEGSTAT1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_NEGSTAT2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_NEGSTAT3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_NEGSTAT4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_SPECIAL_INFO, // UNIT_FIELD_RESISTANCES+6
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+6
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+6
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BASE_MANA
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_BASE_HEALTH
+ UF_FLAG_PUBLIC, // UNIT_FIELD_BYTES_2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MODS
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MULTIPLIER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MODS
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MINRANGEDDAMAGE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MAXRANGEDDAMAGE
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER+6
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER+1
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER+2
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER+3
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER+4
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER+5
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER+6
+ UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MAXHEALTHMODIFIER
+ UF_FLAG_PUBLIC, // UNIT_FIELD_HOVERHEIGHT
+ UF_FLAG_NONE, // UNIT_FIELD_PADDING
+ UF_FLAG_PUBLIC, // PLAYER_DUEL_ARBITER
+ UF_FLAG_PUBLIC, // PLAYER_DUEL_ARBITER+1
+ UF_FLAG_PUBLIC, // PLAYER_FLAGS
+ UF_FLAG_PUBLIC, // PLAYER_GUILDID
+ UF_FLAG_PUBLIC, // PLAYER_GUILDRANK
+ UF_FLAG_PUBLIC, // PLAYER_BYTES
+ UF_FLAG_PUBLIC, // PLAYER_BYTES_2
+ UF_FLAG_PUBLIC, // PLAYER_BYTES_3
+ UF_FLAG_PUBLIC, // PLAYER_DUEL_TEAM
+ UF_FLAG_PUBLIC, // PLAYER_GUILD_TIMESTAMP
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_1_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_1_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_1_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_1_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_1_4
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_2_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_2_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_2_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_2_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_2_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_3_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_3_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_3_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_3_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_3_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_4_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_4_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_4_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_4_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_4_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_5_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_5_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_5_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_5_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_5_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_6_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_6_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_6_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_6_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_6_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_7_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_7_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_7_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_7_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_7_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_8_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_8_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_8_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_8_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_8_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_9_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_9_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_9_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_9_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_9_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_10_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_10_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_10_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_10_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_10_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_11_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_11_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_11_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_11_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_11_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_12_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_12_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_12_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_12_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_12_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_13_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_13_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_13_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_13_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_13_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_14_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_14_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_14_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_14_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_14_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_15_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_15_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_15_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_15_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_15_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_16_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_16_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_16_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_16_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_16_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_17_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_17_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_17_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_17_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_17_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_18_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_18_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_18_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_18_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_18_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_19_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_19_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_19_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_19_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_19_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_20_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_20_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_20_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_20_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_20_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_21_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_21_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_21_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_21_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_21_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_22_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_22_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_22_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_22_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_22_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_23_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_23_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_23_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_23_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_23_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_24_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_24_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_24_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_24_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_24_5
+ UF_FLAG_PARTY_MEMBER, // PLAYER_QUEST_LOG_25_1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_25_2
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_25_3
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_25_3+1
+ UF_FLAG_PRIVATE, // PLAYER_QUEST_LOG_25_5
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_1_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_1_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_2_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_2_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_3_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_3_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_4_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_4_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_5_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_5_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_6_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_6_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_7_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_7_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_8_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_8_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_9_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_9_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_10_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_10_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_11_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_11_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_12_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_12_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_13_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_13_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_14_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_14_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_15_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_15_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_16_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_16_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_17_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_17_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_18_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_18_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_19_ENTRYID
+ UF_FLAG_PUBLIC, // PLAYER_VISIBLE_ITEM_19_ENCHANTMENT
+ UF_FLAG_PUBLIC, // PLAYER_CHOSEN_TITLE
+ UF_FLAG_PUBLIC, // PLAYER_FAKE_INEBRIATION
+ UF_FLAG_NONE, // PLAYER_FIELD_PAD_0
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+24
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+25
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+26
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+27
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+28
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+29
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+30
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+31
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+32
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+33
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+34
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+35
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+36
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+37
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+38
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+39
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+40
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+41
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+42
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+43
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+44
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOT_HEAD+45
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+24
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+25
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+26
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+27
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+28
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+29
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+30
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PACK_SLOT_1+31
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+24
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+25
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+26
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+27
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+28
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+29
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+30
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+31
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+32
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+33
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+34
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+35
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+36
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+37
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+38
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+39
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+40
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+41
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+42
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+43
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+44
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+45
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+46
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+47
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+48
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+49
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+50
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+51
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+52
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+53
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+54
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANK_SLOT_1+55
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BANKBAG_SLOT_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_VENDORBUYBACK_SLOT_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+24
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+25
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+26
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+27
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+28
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+29
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+30
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+31
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+32
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+33
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+34
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+35
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+36
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+37
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+38
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+39
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+40
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+41
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+42
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+43
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+44
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+45
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+46
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+47
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+48
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+49
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+50
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+51
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+52
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+53
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+54
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+55
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+56
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+57
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+58
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+59
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+60
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+61
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+62
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KEYRING_SLOT_1+63
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+24
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+25
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+26
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+27
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+28
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+29
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+30
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+31
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+32
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+33
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+34
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+35
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+36
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+37
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+38
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+39
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+40
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+41
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+42
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+43
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+44
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+45
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+46
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+47
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+48
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+49
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+50
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+51
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+52
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+53
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+54
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+55
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+56
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+57
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+58
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+59
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+60
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+61
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+62
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_CURRENCYTOKEN_SLOT_1+63
+ UF_FLAG_PRIVATE, // PLAYER_FARSIGHT
+ UF_FLAG_PRIVATE, // PLAYER_FARSIGHT+1
+ UF_FLAG_PRIVATE, // PLAYER__FIELD_KNOWN_TITLES
+ UF_FLAG_PRIVATE, // PLAYER__FIELD_KNOWN_TITLES+1
+ UF_FLAG_PRIVATE, // PLAYER__FIELD_KNOWN_TITLES1
+ UF_FLAG_PRIVATE, // PLAYER__FIELD_KNOWN_TITLES1+1
+ UF_FLAG_PRIVATE, // PLAYER__FIELD_KNOWN_TITLES2
+ UF_FLAG_PRIVATE, // PLAYER__FIELD_KNOWN_TITLES2+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_CURRENCIES
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_CURRENCIES+1
+ UF_FLAG_PRIVATE, // PLAYER_XP
+ UF_FLAG_PRIVATE, // PLAYER_NEXT_LEVEL_XP
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+1
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+2
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+3
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+4
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+5
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+6
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+7
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+8
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+9
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+10
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+11
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+12
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+13
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+14
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+15
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+16
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+17
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+18
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+19
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+20
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+21
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+22
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+23
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+24
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+25
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+26
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+27
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+28
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+29
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+30
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+31
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+32
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+33
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+34
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+35
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+36
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+37
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+38
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+39
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+40
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+41
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+42
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+43
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+44
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+45
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+46
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+47
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+48
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+49
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+50
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+51
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+52
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+53
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+54
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+55
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+56
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+57
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+58
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+59
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+60
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+61
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+62
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+63
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+64
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+65
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+66
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+67
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+68
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+69
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+70
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+71
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+72
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+73
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+74
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+75
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+76
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+77
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+78
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+79
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+80
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+81
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+82
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+83
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+84
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+85
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+86
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+87
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+88
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+89
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+90
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+91
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+92
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+93
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+94
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+95
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+96
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+97
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+98
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+99
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+100
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+101
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+102
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+103
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+104
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+105
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+106
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+107
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+108
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+109
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+110
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+111
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+112
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+113
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+114
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+115
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+116
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+117
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+118
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+119
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+120
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+121
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+122
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+123
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+124
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+125
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+126
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+127
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+128
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+129
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+130
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+131
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+132
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+133
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+134
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+135
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+136
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+137
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+138
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+139
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+140
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+141
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+142
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+143
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+144
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+145
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+146
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+147
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+148
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+149
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+150
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+151
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+152
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+153
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+154
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+155
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+156
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+157
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+158
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+159
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+160
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+161
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+162
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+163
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+164
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+165
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+166
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+167
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+168
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+169
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+170
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+171
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+172
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+173
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+174
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+175
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+176
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+177
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+178
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+179
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+180
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+181
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+182
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+183
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+184
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+185
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+186
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+187
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+188
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+189
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+190
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+191
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+192
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+193
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+194
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+195
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+196
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+197
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+198
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+199
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+200
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+201
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+202
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+203
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+204
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+205
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+206
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+207
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+208
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+209
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+210
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+211
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+212
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+213
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+214
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+215
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+216
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+217
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+218
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+219
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+220
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+221
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+222
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+223
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+224
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+225
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+226
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+227
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+228
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+229
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+230
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+231
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+232
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+233
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+234
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+235
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+236
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+237
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+238
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+239
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+240
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+241
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+242
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+243
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+244
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+245
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+246
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+247
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+248
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+249
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+250
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+251
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+252
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+253
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+254
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+255
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+256
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+257
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+258
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+259
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+260
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+261
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+262
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+263
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+264
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+265
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+266
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+267
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+268
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+269
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+270
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+271
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+272
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+273
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+274
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+275
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+276
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+277
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+278
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+279
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+280
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+281
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+282
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+283
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+284
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+285
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+286
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+287
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+288
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+289
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+290
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+291
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+292
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+293
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+294
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+295
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+296
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+297
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+298
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+299
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+300
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+301
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+302
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+303
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+304
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+305
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+306
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+307
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+308
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+309
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+310
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+311
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+312
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+313
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+314
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+315
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+316
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+317
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+318
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+319
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+320
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+321
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+322
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+323
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+324
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+325
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+326
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+327
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+328
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+329
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+330
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+331
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+332
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+333
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+334
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+335
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+336
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+337
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+338
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+339
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+340
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+341
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+342
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+343
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+344
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+345
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+346
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+347
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+348
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+349
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+350
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+351
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+352
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+353
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+354
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+355
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+356
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+357
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+358
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+359
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+360
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+361
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+362
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+363
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+364
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+365
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+366
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+367
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+368
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+369
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+370
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+371
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+372
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+373
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+374
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+375
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+376
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+377
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+378
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+379
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+380
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+381
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+382
+ UF_FLAG_PRIVATE, // PLAYER_SKILL_INFO_1_1+383
+ UF_FLAG_PRIVATE, // PLAYER_CHARACTER_POINTS1
+ UF_FLAG_PRIVATE, // PLAYER_CHARACTER_POINTS2
+ UF_FLAG_PRIVATE, // PLAYER_TRACK_CREATURES
+ UF_FLAG_PRIVATE, // PLAYER_TRACK_RESOURCES
+ UF_FLAG_PRIVATE, // PLAYER_BLOCK_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_DODGE_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_PARRY_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_EXPERTISE
+ UF_FLAG_PRIVATE, // PLAYER_OFFHAND_EXPERTISE
+ UF_FLAG_PRIVATE, // PLAYER_CRIT_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_RANGED_CRIT_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_OFFHAND_CRIT_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1+1
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1+2
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1+3
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1+4
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1+5
+ UF_FLAG_PRIVATE, // PLAYER_SPELL_CRIT_PERCENTAGE1+6
+ UF_FLAG_PRIVATE, // PLAYER_SHIELD_BLOCK
+ UF_FLAG_PRIVATE, // PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+1
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+2
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+3
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+4
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+5
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+6
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+7
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+8
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+9
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+10
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+11
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+12
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+13
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+14
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+15
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+16
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+17
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+18
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+19
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+20
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+21
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+22
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+23
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+24
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+25
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+26
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+27
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+28
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+29
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+30
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+31
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+32
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+33
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+34
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+35
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+36
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+37
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+38
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+39
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+40
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+41
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+42
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+43
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+44
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+45
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+46
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+47
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+48
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+49
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+50
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+51
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+52
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+53
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+54
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+55
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+56
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+57
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+58
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+59
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+60
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+61
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+62
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+63
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+64
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+65
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+66
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+67
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+68
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+69
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+70
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+71
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+72
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+73
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+74
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+75
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+76
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+77
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+78
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+79
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+80
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+81
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+82
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+83
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+84
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+85
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+86
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+87
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+88
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+89
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+90
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+91
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+92
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+93
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+94
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+95
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+96
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+97
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+98
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+99
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+100
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+101
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+102
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+103
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+104
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+105
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+106
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+107
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+108
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+109
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+110
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+111
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+112
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+113
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+114
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+115
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+116
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+117
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+118
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+119
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+120
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+121
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+122
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+123
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+124
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+125
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+126
+ UF_FLAG_PRIVATE, // PLAYER_EXPLORED_ZONES_1+127
+ UF_FLAG_PRIVATE, // PLAYER_REST_STATE_EXPERIENCE
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COINAGE
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_HEALING_DONE_POS
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_HEALING_PCT
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_HEALING_DONE_PCT
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_TARGET_RESISTANCE
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BYTES
+ UF_FLAG_PRIVATE, // PLAYER_AMMO_ID
+ UF_FLAG_PRIVATE, // PLAYER_SELF_RES_SPELL
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_MEDALS
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_KILLS
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_TODAY_CONTRIBUTION
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_YESTERDAY_CONTRIBUTION
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_LIFETIME_HONORBALE_KILLS
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_BYTES2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_WATCHED_FACTION_INDEX
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_1+24
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_TEAM_INFO_1_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_HONOR_CURRENCY
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_ARENA_CURRENCY
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_MAX_LEVEL
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+6
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+7
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+8
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+9
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+10
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+11
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+12
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+13
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+14
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+15
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+16
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+17
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+18
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+19
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+20
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+21
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+22
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+23
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_DAILY_QUESTS_1+24
+ UF_FLAG_PRIVATE, // PLAYER_RUNE_REGEN_1
+ UF_FLAG_PRIVATE, // PLAYER_RUNE_REGEN_1+1
+ UF_FLAG_PRIVATE, // PLAYER_RUNE_REGEN_1+2
+ UF_FLAG_PRIVATE, // PLAYER_RUNE_REGEN_1+3
+ UF_FLAG_PRIVATE, // PLAYER_NO_REAGENT_COST_1
+ UF_FLAG_PRIVATE, // PLAYER_NO_REAGENT_COST_1+1
+ UF_FLAG_PRIVATE, // PLAYER_NO_REAGENT_COST_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_1+5
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS_1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS_1+1
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS_1+2
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS_1+3
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS_1+4
+ UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS_1+5
+ UF_FLAG_PRIVATE, // PLAYER_GLYPHS_ENABLED
+ UF_FLAG_PRIVATE, // PLAYER_PET_SPELL_POWER
+};
+
+uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END] =
+{
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID+1
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_ENTRY
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE_X
+ UF_FLAG_NONE, // OBJECT_FIELD_PADDING
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_CREATED_BY
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_CREATED_BY+1
+ UF_FLAG_PUBLIC, // GAMEOBJECT_DISPLAYID
+ UF_FLAG_PUBLIC, // GAMEOBJECT_FLAGS
+ UF_FLAG_PUBLIC, // GAMEOBJECT_PARENTROTATION
+ UF_FLAG_PUBLIC, // GAMEOBJECT_PARENTROTATION+1
+ UF_FLAG_PUBLIC, // GAMEOBJECT_PARENTROTATION+2
+ UF_FLAG_PUBLIC, // GAMEOBJECT_PARENTROTATION+3
+ UF_FLAG_DYNAMIC, // GAMEOBJECT_DYNAMIC
+ UF_FLAG_PUBLIC, // GAMEOBJECT_FACTION
+ UF_FLAG_PUBLIC, // GAMEOBJECT_LEVEL
+ UF_FLAG_PUBLIC, // GAMEOBJECT_BYTES_1
+};
+
+uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END] =
+{
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID+1
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_ENTRY
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE_X
+ UF_FLAG_NONE, // OBJECT_FIELD_PADDING
+ UF_FLAG_PUBLIC, // DYNAMICOBJECT_CASTER
+ UF_FLAG_PUBLIC, // DYNAMICOBJECT_CASTER+1
+ UF_FLAG_PUBLIC, // DYNAMICOBJECT_BYTES
+ UF_FLAG_PUBLIC, // DYNAMICOBJECT_SPELLID
+ UF_FLAG_PUBLIC, // DYNAMICOBJECT_RADIUS
+ UF_FLAG_PUBLIC, // DYNAMICOBJECT_CASTTIME
+};
+
+uint32 CorpseUpdateFieldFlags[CORPSE_END] =
+{
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID+1
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_ENTRY
+ UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE_X
+ UF_FLAG_NONE, // OBJECT_FIELD_PADDING
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_OWNER
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_OWNER+1
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_PARTY
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_PARTY+1
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_DISPLAY_ID
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+1
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+2
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+3
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+4
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+5
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+6
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+7
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+8
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+9
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+10
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+11
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+12
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+13
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+14
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+15
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+16
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+17
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEM+18
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_BYTES_1
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_BYTES_2
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_GUILD
+ UF_FLAG_PUBLIC, // CORPSE_FIELD_FLAGS
+ UF_FLAG_DYNAMIC, // CORPSE_FIELD_DYNAMIC_FLAGS
+ UF_FLAG_NONE, // CORPSE_FIELD_PAD
+};
diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
new file mode 100644
index 00000000000..2cd303d5fc5
--- /dev/null
+++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _UPDATEFIELDFLAGS_H
+#define _UPDATEFIELDFLAGS_H
+
+#include "UpdateFields.h"
+#include "Define.h"
+
+enum UpdatefieldFlags
+{
+ UF_FLAG_NONE = 0x000,
+ UF_FLAG_PUBLIC = 0x001,
+ UF_FLAG_PRIVATE = 0x002,
+ UF_FLAG_OWNER = 0x004,
+ UF_FLAG_UNUSED1 = 0x008,
+ UF_FLAG_ITEM_OWNER = 0x010,
+ UF_FLAG_SPECIAL_INFO = 0x020,
+ UF_FLAG_PARTY_MEMBER = 0x040,
+ UF_FLAG_UNUSED2 = 0x080,
+ UF_FLAG_DYNAMIC = 0x100
+};
+
+extern uint32 ItemUpdateFieldFlags[CONTAINER_END];
+extern uint32 UnitUpdateFieldFlags[PLAYER_END];
+extern uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END];
+extern uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END];
+extern uint32 CorpseUpdateFieldFlags[CORPSE_END];
+
+#endif // _UPDATEFIELDFLAGS_H
diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h
index 825bda98ae6..7e4aa9aaab8 100755
--- a/src/server/game/Entities/Object/Updates/UpdateFields.h
+++ b/src/server/game/Entities/Object/Updates/UpdateFields.h
@@ -28,7 +28,7 @@ enum EObjectFields
OBJECT_FIELD_ENTRY = 0x0003, // Size: 1, Type: INT, Flags: PUBLIC
OBJECT_FIELD_SCALE_X = 0x0004, // Size: 1, Type: FLOAT, Flags: PUBLIC
OBJECT_FIELD_PADDING = 0x0005, // Size: 1, Type: INT, Flags: NONE
- OBJECT_END = 0x0006,
+ OBJECT_END = 0x0006
};
enum EItemFields
@@ -71,7 +71,7 @@ enum EItemFields
ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: OWNER, ITEM_OWNER
ITEM_FIELD_CREATE_PLAYED_TIME = OBJECT_END + 0x0038, // Size: 1, Type: INT, Flags: PUBLIC
ITEM_FIELD_PAD = OBJECT_END + 0x0039, // Size: 1, Type: INT, Flags: NONE
- ITEM_END = OBJECT_END + 0x003A,
+ ITEM_END = OBJECT_END + 0x003A
};
enum EContainerFields
@@ -79,7 +79,7 @@ enum EContainerFields
CONTAINER_FIELD_NUM_SLOTS = ITEM_END + 0x0000, // Size: 1, Type: INT, Flags: PUBLIC
CONTAINER_ALIGN_PAD = ITEM_END + 0x0001, // Size: 1, Type: BYTES, Flags: NONE
CONTAINER_FIELD_SLOT_1 = ITEM_END + 0x0002, // Size: 72, Type: LONG, Flags: PUBLIC
- CONTAINER_END = ITEM_END + 0x004A,
+ CONTAINER_END = ITEM_END + 0x004A
};
enum EUnitFields
@@ -333,9 +333,9 @@ enum EUnitFields
PLAYER_FIELD_KEYRING_SLOT_1 = UNIT_END + 0x015C, // Size: 64, Type: LONG, Flags: PRIVATE
PLAYER_FIELD_CURRENCYTOKEN_SLOT_1 = UNIT_END + 0x019C, // Size: 64, Type: LONG, Flags: PRIVATE
PLAYER_FARSIGHT = UNIT_END + 0x01DC, // Size: 2, Type: LONG, Flags: PRIVATE
- PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE
- PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE
- PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E2, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E2, // Size: 2, Type: LONG, Flags: PRIVATE
PLAYER_FIELD_KNOWN_CURRENCIES = UNIT_END + 0x01E4, // Size: 2, Type: LONG, Flags: PRIVATE
PLAYER_XP = UNIT_END + 0x01E6, // Size: 1, Type: INT, Flags: PRIVATE
PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01E7, // Size: 1, Type: INT, Flags: PRIVATE
@@ -390,7 +390,7 @@ enum EUnitFields
PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x0492, // Size: 6, Type: INT, Flags: PRIVATE
PLAYER_GLYPHS_ENABLED = UNIT_END + 0x0498, // Size: 1, Type: INT, Flags: PRIVATE
PLAYER_PET_SPELL_POWER = UNIT_END + 0x0499, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_END = UNIT_END + 0x049A,
+ PLAYER_END = UNIT_END + 0x049A
};
enum EGameObjectFields
@@ -403,7 +403,7 @@ enum EGameObjectFields
GAMEOBJECT_FACTION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC
GAMEOBJECT_LEVEL = OBJECT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC
GAMEOBJECT_BYTES_1 = OBJECT_END + 0x000B, // Size: 1, Type: BYTES, Flags: PUBLIC
- GAMEOBJECT_END = OBJECT_END + 0x000C,
+ GAMEOBJECT_END = OBJECT_END + 0x000C
};
enum EDynamicObjectFields
@@ -413,7 +413,7 @@ enum EDynamicObjectFields
DYNAMICOBJECT_SPELLID = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC
DYNAMICOBJECT_RADIUS = OBJECT_END + 0x0004, // Size: 1, Type: FLOAT, Flags: PUBLIC
DYNAMICOBJECT_CASTTIME = OBJECT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC
- DYNAMICOBJECT_END = OBJECT_END + 0x0006,
+ DYNAMICOBJECT_END = OBJECT_END + 0x0006
};
enum ECorpseFields
@@ -428,6 +428,6 @@ enum ECorpseFields
CORPSE_FIELD_FLAGS = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC
CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: DYNAMIC
CORPSE_FIELD_PAD = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: NONE
- CORPSE_END = OBJECT_END + 0x001E,
+ CORPSE_END = OBJECT_END + 0x001E
};
#endif
diff --git a/src/server/game/Entities/Object/Updates/UpdateMask.h b/src/server/game/Entities/Object/Updates/UpdateMask.h
index d4ecd42819c..ad70936b81d 100755
--- a/src/server/game/Entities/Object/Updates/UpdateMask.h
+++ b/src/server/game/Entities/Object/Updates/UpdateMask.h
@@ -26,26 +26,26 @@ class UpdateMask
{
public:
UpdateMask() : mCount(0), mBlocks(0), mUpdateMask(0) { }
- UpdateMask(const UpdateMask& mask) : mUpdateMask(0) { *this = mask; }
+ UpdateMask(UpdateMask const& mask) : mUpdateMask(0) { *this = mask; }
~UpdateMask()
{
- delete [] mUpdateMask;
+ delete[] mUpdateMask;
}
- void SetBit (uint32 index)
+ void SetBit(uint32 index)
{
- ((uint8 *)mUpdateMask)[ index >> 3 ] |= 1 << (index & 0x7);
+ ((uint8*)mUpdateMask)[index >> 3] |= 1 << (index & 0x7);
}
- void UnsetBit (uint32 index)
+ void UnsetBit(uint32 index)
{
- ((uint8 *)mUpdateMask)[ index >> 3 ] &= (0xff ^ (1 << (index & 0x7)));
+ ((uint8*)mUpdateMask)[index >> 3] &= (0xff ^ (1 << (index & 0x7)));
}
- bool GetBit (uint32 index) const
+ bool GetBit(uint32 index) const
{
- return (((uint8 *)mUpdateMask)[ index >> 3 ] & (1 << (index & 0x7))) != 0;
+ return (((uint8*)mUpdateMask)[index >> 3] & (1 << (index & 0x7))) != 0;
}
uint32 GetBlockCount() const { return mBlocks; }
@@ -70,7 +70,7 @@ class UpdateMask
memset(mUpdateMask, 0, mBlocks << 2);
}
- UpdateMask& operator = (const UpdateMask& mask)
+ UpdateMask& operator=(UpdateMask const& mask)
{
if (this == &mask)
return *this;
@@ -81,21 +81,21 @@ class UpdateMask
return *this;
}
- void operator &= (const UpdateMask& mask)
+ void operator&=(UpdateMask const& mask)
{
ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; ++i)
mUpdateMask[i] &= mask.mUpdateMask[i];
}
- void operator |= (const UpdateMask& mask)
+ void operator|=(UpdateMask const& mask)
{
ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; ++i)
mUpdateMask[i] |= mask.mUpdateMask[i];
}
- UpdateMask operator & (const UpdateMask& mask) const
+ UpdateMask operator&(UpdateMask const& mask) const
{
ASSERT(mask.mCount <= mCount);
@@ -106,7 +106,7 @@ class UpdateMask
return newmask;
}
- UpdateMask operator | (const UpdateMask& mask) const
+ UpdateMask operator|(UpdateMask const& mask) const
{
ASSERT(mask.mCount <= mCount);
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 75deb8b4216..ead018ac620 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -183,7 +183,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
if (!IsPositionValid())
{
- sLog->outError("Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_PETS, "Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -229,7 +229,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
break;
default:
if (!IsPetGhoul())
- sLog->outError("Pet have incorrect type (%u) for pet loading.", getPetType());
+ sLog->outError(LOG_FILTER_PETS, "Pet have incorrect type (%u) for pet loading.", getPetType());
break;
}
@@ -562,7 +562,7 @@ void Pet::Update(uint32 diff)
{
if (owner->GetPetGUID() != GetGUID())
{
- sLog->outError("Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
+ sLog->outError(LOG_FILTER_PETS, "Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
Remove(getPetType() == HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
return;
}
@@ -760,7 +760,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
if (!IsPositionValid())
{
- sLog->outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_PETS, "Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -768,7 +768,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
CreatureTemplate const* cinfo = GetCreatureTemplate();
if (!cinfo)
{
- sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
+ sLog->outError(LOG_FILTER_PETS, "CreateBaseAtCreature() failed, creatureInfo is missing!");
return false;
}
@@ -843,7 +843,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
m_unitTypeMask |= UNIT_MASK_HUNTER_PET;
}
else
- sLog->outError("Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
+ sLog->outError(LOG_FILTER_PETS, "Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
}
uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry;
@@ -1120,7 +1120,7 @@ void Pet::_LoadSpellCooldowns()
if (!sSpellMgr->GetSpellInfo(spell_id))
{
- sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
+ sLog->outError(LOG_FILTER_PETS, "Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
continue;
}
@@ -1271,7 +1271,7 @@ void Pet::_LoadAuras(uint32 timediff)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- sLog->outError("Unknown aura (spellid %u), ignore.", spellid);
+ sLog->outError(LOG_FILTER_PETS, "Unknown aura (spellid %u), ignore.", spellid);
continue;
}
@@ -1302,7 +1302,7 @@ void Pet::_LoadAuras(uint32 timediff)
}
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
aura->ApplyForTargets();
- sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
+ sLog->outInfo(LOG_FILTER_PETS, "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
}
}
while (result->NextRow());
@@ -1378,7 +1378,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
// do pet spell book cleanup
if (state == PETSPELL_UNCHANGED) // spell load case
{
- sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
+ sLog->outError(LOG_FILTER_PETS, "Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_PET_SPELL);
@@ -1387,7 +1387,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ sLog->outError(LOG_FILTER_PETS, "Pet::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
return false;
}
@@ -2033,3 +2033,40 @@ void Pet::SynchronizeLevelWithOwner()
break;
}
}
+
+void Pet::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
+{
+ WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+m_spells.size()*8);
+ data << uint64(GetGUID());
+ data << uint8(0x0); // flags (0x1, 0x2)
+ time_t curTime = time(NULL);
+ for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
+ {
+ if (itr->second.state == PETSPELL_REMOVED)
+ continue;
+ uint32 unSpellId = itr->first;
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
+ if (!spellInfo)
+ {
+ ASSERT(spellInfo);
+ continue;
+ }
+
+ // Not send cooldown for this spells
+ if (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
+ continue;
+
+ if (spellInfo->PreventionType != SPELL_PREVENTION_TYPE_SILENCE)
+ continue;
+
+ if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetCreatureSpellCooldownDelay(unSpellId) < unTimeMs)
+ {
+ data << uint32(unSpellId);
+ data << uint32(unTimeMs); // in m.secs
+ _AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
+ }
+ }
+
+ if (Player* owner = GetOwner())
+ owner->GetSession()->SendPacket(&data);
+} \ No newline at end of file
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index 3475817816d..6e080263862 100755
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -27,7 +27,7 @@ enum PetType
{
SUMMON_PET = 0,
HUNTER_PET = 1,
- MAX_PET_TYPE = 4,
+ MAX_PET_TYPE = 4
};
#define MAX_PET_STABLES 4
@@ -61,7 +61,7 @@ enum PetSpellType
{
PETSPELL_NORMAL = 0,
PETSPELL_FAMILY = 1,
- PETSPELL_TALENT = 2,
+ PETSPELL_TALENT = 2
};
struct PetSpell
@@ -200,6 +200,7 @@ class Pet : public Guardian
bool unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
void CleanupActionBar();
+ virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
PetSpellMap m_spells;
AutoSpellList m_autospells;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 42d342cbcf9..c498350c78c 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -74,6 +74,8 @@
#include "InstanceScript.h"
#include <cmath>
#include "AccountMgr.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -630,8 +632,6 @@ void KillRewarder::Reward()
// == Player ====================================================
-UpdateMask Player::updateVisualBits;
-
// we can disable this warning for this since it only
// causes undefined behavior when passed to the base class constructor
#ifdef _MSC_VER
@@ -728,7 +728,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
m_isInWater = false;
m_drunkTimer = 0;
- m_drunk = 0;
m_restTime = 0;
m_deathTimer = 0;
m_deathExpireTime = 0;
@@ -862,6 +861,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
m_SeasonalQuestChanged = false;
SetPendingBind(0, 0);
+
+ _activeCheats = CHEAT_NONE;
}
Player::~Player()
@@ -931,7 +932,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class);
if (!info)
{
- sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class);
return false;
}
@@ -944,7 +945,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(createInfo->Class);
if (!cEntry)
{
- sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Class);
return false;
}
@@ -960,7 +961,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
if (!IsValidGender(createInfo->Gender))
{
- sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Gender);
return false;
}
@@ -1230,7 +1231,7 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
}
// item can't be added
- sLog->outError("STORAGE: Can't equip or store initial item %u for race %u class %u, error msg = %u", titem_id, getRace(), getClass(), msg);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Can't equip or store initial item %u for race %u class %u, error msg = %u", titem_id, getRace(), getClass(), msg);
return false;
}
@@ -1297,14 +1298,14 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{
if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
{
- sLog->outStaticDebug("We are fall to death, loosing 10 percents durability");
+ sLog->outDebug(LOG_FILTER_PLAYER, "We are fall to death, loosing 10 percents durability");
DurabilityLossAll(0.10f, false);
// durability lost message
WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0);
GetSession()->SendPacket(&data2);
}
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
}
return final_damage;
@@ -1460,49 +1461,51 @@ void Player::HandleDrowning(uint32 time_diff)
m_MirrorTimerFlagsLast = m_MirrorTimerFlags;
}
-///The player sobers by 256 every 10 seconds
+///The player sobers by 1% every 9 seconds
void Player::HandleSobering()
{
m_drunkTimer = 0;
- uint32 drunk = (m_drunk <= 256) ? 0 : (m_drunk - 256);
+ uint8 currentDrunkValue = GetDrunkValue();
+ uint8 drunk = currentDrunkValue ? --currentDrunkValue : 0;
SetDrunkValue(drunk);
}
-DrunkenState Player::GetDrunkenstateByValue(uint16 value)
+DrunkenState Player::GetDrunkenstateByValue(uint8 value)
{
- if (value >= 23000)
+ if (value >= 90)
return DRUNKEN_SMASHED;
- if (value >= 12800)
+ if (value >= 50)
return DRUNKEN_DRUNK;
- if (value & 0xFFFE)
+ if (value)
return DRUNKEN_TIPSY;
return DRUNKEN_SOBER;
}
-void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
+void Player::SetDrunkValue(uint8 newDrunkValue, uint32 itemId /*= 0*/)
{
- uint32 oldDrunkenState = Player::GetDrunkenstateByValue(m_drunk);
+ bool isSobering = newDrunkValue < GetDrunkValue();
+ uint32 oldDrunkenState = Player::GetDrunkenstateByValue(GetDrunkValue());
+ if (newDrunkValue > 100)
+ newDrunkValue = 100;
// select drunk percent or total SPELL_AURA_MOD_FAKE_INEBRIATE amount, whichever is higher for visibility updates
- int32 drunkPercent = newDrunkenValue * 100 / 0xFFFF;
- drunkPercent = std::max(drunkPercent, GetTotalAuraModifier(SPELL_AURA_MOD_FAKE_INEBRIATE));
-
+ int32 drunkPercent = std::max<int32>(newDrunkValue, GetTotalAuraModifier(SPELL_AURA_MOD_FAKE_INEBRIATE));
if (drunkPercent)
{
m_invisibilityDetect.AddFlag(INVISIBILITY_DRUNK);
m_invisibilityDetect.SetValue(INVISIBILITY_DRUNK, drunkPercent);
}
- else if (!HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE) && !newDrunkenValue)
+ else if (!HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE) && !newDrunkValue)
m_invisibilityDetect.DelFlag(INVISIBILITY_DRUNK);
- m_drunk = newDrunkenValue;
- SetUInt32Value(PLAYER_BYTES_3, (GetUInt32Value(PLAYER_BYTES_3) & 0xFFFF0001) | (m_drunk & 0xFFFE));
-
- uint32 newDrunkenState = Player::GetDrunkenstateByValue(m_drunk);
-
+ uint32 newDrunkenState = Player::GetDrunkenstateByValue(newDrunkValue);
+ SetByteValue(PLAYER_BYTES_3, 1, newDrunkValue);
UpdateObjectVisibility();
+ if (!isSobering)
+ m_drunkTimer = 0; // reset sobering timer
+
if (newDrunkenState == oldDrunkenState)
return;
@@ -1510,7 +1513,6 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
data << uint64(GetGUID());
data << uint32(newDrunkenState);
data << uint32(itemId);
-
SendMessageToSet(&data, true);
}
@@ -1534,9 +1536,9 @@ void Player::Update(uint32 p_time)
//ASSERT (!m_spellModTakingSpell);
if (m_spellModTakingSpell)
{
- //sLog->outCrash("Player has m_pad %u during update!", m_pad);
+ //sLog->outFatal(LOG_FILTER_PLAYER, "Player has m_pad %u during update!", m_pad);
//if (m_spellModTakingSpell)
- sLog->outCrash("Player has m_spellModTakingSpell %u during update!", m_spellModTakingSpell->m_spellInfo->Id);
+ sLog->outFatal(LOG_FILTER_SPELLS_AURAS, "Player has m_spellModTakingSpell %u during update!", m_spellModTakingSpell->m_spellInfo->Id);
m_spellModTakingSpell = NULL;
}
@@ -1591,7 +1593,7 @@ void Player::Update(uint32 p_time)
}
}
- GetAchievementMgr().UpdateTimedAchievements(p_time);
+ m_achievementMgr.UpdateTimedAchievements(p_time);
if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
{
@@ -1733,7 +1735,7 @@ void Player::Update(uint32 p_time)
{
// m_nextSave reseted in SaveToDB call
SaveToDB();
- sLog->outDetail("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_PLAYER, "Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
}
else
m_nextSave -= p_time;
@@ -1751,11 +1753,10 @@ void Player::Update(uint32 p_time)
m_Last_tick = now;
}
- if (m_drunk)
+ if (GetDrunkValue())
{
m_drunkTimer += p_time;
-
- if (m_drunkTimer > 10*IN_MILLISECONDS)
+ if (m_drunkTimer > 9 * IN_MILLISECONDS)
HandleSobering();
}
@@ -1823,7 +1824,7 @@ void Player::setDeathState(DeathState s)
{
if (!cur)
{
- sLog->outError("setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow());
return;
}
@@ -1843,12 +1844,12 @@ void Player::setDeathState(DeathState s)
// passive spell
if (!ressSpellId)
ressSpellId = GetResurrectionSpellId();
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1);
- GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH);
- GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH);
- GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1);
+ ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH);
+ ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH);
+ ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH);
}
Unit::setDeathState(s);
@@ -1881,12 +1882,12 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(plrRace, plrClass);
if (!info)
{
- sLog->outError("Player %u has incorrect race/class pair. Don't build enum.", guid);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Player %u has incorrect race/class pair. Don't build enum.", guid);
return false;
}
else if (!IsValidGender(gender))
{
- sLog->outError("Player (%u) has incorrect gender (%hu), don't build enum.", guid, gender);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Player (%u) has incorrect gender (%hu), don't build enum.", guid, gender);
return false;
}
@@ -2068,14 +2069,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))
{
- sLog->outError("TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
+ sLog->outError(LOG_FILTER_MAPS, "TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
mapid, x, y, z, orientation, GetGUIDLow(), GetName(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
if (AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()) && DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
{
- sLog->outError("Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
+ sLog->outError(LOG_FILTER_MAPS, "Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED);
return false;
}
@@ -2408,6 +2409,7 @@ void Player::RemoveFromWorld()
StopCastingBindSight();
UnsummonPetTemporaryIfAny();
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
+ sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
}
///- Do not add/remove the player from the object storage
@@ -2428,7 +2430,7 @@ void Player::RemoveFromWorld()
{
if (WorldObject* viewpoint = GetViewpoint())
{
- sLog->outCrash("Player %s has viewpoint %u %u when removed from world", GetName(), viewpoint->GetEntry(), viewpoint->GetTypeId());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has viewpoint %u %u when removed from world", GetName(), viewpoint->GetEntry(), viewpoint->GetTypeId());
SetViewpoint(viewpoint, false);
}
}
@@ -3074,7 +3076,7 @@ void Player::GiveLevel(uint8 level)
CharacterDatabase.CommitTransaction(trans);
}
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
// Refer-A-Friend
if (GetSession()->GetRecruiterId())
@@ -3357,7 +3359,7 @@ void Player::SendInitialSpells()
GetSession()->SendPacket(&data);
- sLog->outDetail("CHARACTER: Sent Initial Spells");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CHARACTER: Sent Initial Spells");
}
void Player::RemoveMail(uint32 id)
@@ -3438,7 +3440,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3447,7 +3449,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
return false;
}
@@ -3457,7 +3459,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3466,7 +3468,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addTalent: Broken spell #%u learning not allowed.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addTalent: Broken spell #%u learning not allowed.", spellId);
return false;
}
@@ -3511,7 +3513,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3520,7 +3522,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
return false;
}
@@ -3530,7 +3532,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3539,7 +3541,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addSpell: Broken spell #%u learning not allowed.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Broken spell #%u learning not allowed.", spellId);
return false;
}
@@ -3864,11 +3866,11 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
// not ranked skills
for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx)
{
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId);
}
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId);
}
// return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell
@@ -4293,7 +4295,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result)
if (!sSpellMgr->GetSpellInfo(spell_id))
{
- sLog->outError("Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id);
continue;
}
@@ -4459,8 +4461,8 @@ bool Player::resetTalents(bool no_cost)
if (!no_cost)
{
ModifyMoney(-(int32)cost);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1);
m_resetTalentsCost = cost;
m_resetTalentsTime = time(NULL);
@@ -4492,119 +4494,6 @@ Mail* Player::GetMail(uint32 id)
return NULL;
}
-void Player::_SetCreateBits(UpdateMask* updateMask, Player* target) const
-{
- if (target == this)
- Object::_SetCreateBits(updateMask, target);
- else
- {
- for (uint16 index = 0; index < m_valuesCount; index++)
- if (GetUInt32Value(index) != 0 && updateVisualBits.GetBit(index))
- updateMask->SetBit(index);
- }
-}
-
-void Player::_SetUpdateBits(UpdateMask* updateMask, Player* target) const
-{
- if (target == this)
- Object::_SetUpdateBits(updateMask, target);
- else
- {
- Object::_SetUpdateBits(updateMask, target);
- *updateMask &= updateVisualBits;
- }
-}
-
-void Player::InitVisibleBits()
-{
- updateVisualBits.SetCount(PLAYER_END);
-
- updateVisualBits.SetBit(OBJECT_FIELD_GUID);
- updateVisualBits.SetBit(OBJECT_FIELD_TYPE);
- updateVisualBits.SetBit(OBJECT_FIELD_ENTRY);
- updateVisualBits.SetBit(OBJECT_FIELD_SCALE_X);
- updateVisualBits.SetBit(UNIT_FIELD_CHARM + 0);
- updateVisualBits.SetBit(UNIT_FIELD_CHARM + 1);
- updateVisualBits.SetBit(UNIT_FIELD_SUMMON + 0);
- updateVisualBits.SetBit(UNIT_FIELD_SUMMON + 1);
- updateVisualBits.SetBit(UNIT_FIELD_CHARMEDBY + 0);
- updateVisualBits.SetBit(UNIT_FIELD_CHARMEDBY + 1);
- updateVisualBits.SetBit(UNIT_FIELD_TARGET + 0);
- updateVisualBits.SetBit(UNIT_FIELD_TARGET + 1);
- updateVisualBits.SetBit(UNIT_FIELD_CHANNEL_OBJECT + 0);
- updateVisualBits.SetBit(UNIT_FIELD_CHANNEL_OBJECT + 1);
- updateVisualBits.SetBit(UNIT_FIELD_BYTES_0);
- updateVisualBits.SetBit(UNIT_FIELD_HEALTH);
- updateVisualBits.SetBit(UNIT_FIELD_POWER1);
- updateVisualBits.SetBit(UNIT_FIELD_POWER2);
- updateVisualBits.SetBit(UNIT_FIELD_POWER3);
- updateVisualBits.SetBit(UNIT_FIELD_POWER4);
- updateVisualBits.SetBit(UNIT_FIELD_POWER5);
- updateVisualBits.SetBit(UNIT_FIELD_POWER6);
- updateVisualBits.SetBit(UNIT_FIELD_POWER7);
- updateVisualBits.SetBit(UNIT_FIELD_MAXHEALTH);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER1);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER2);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER3);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER4);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER5);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER6);
- updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER7);
- updateVisualBits.SetBit(UNIT_FIELD_LEVEL);
- updateVisualBits.SetBit(UNIT_FIELD_FACTIONTEMPLATE);
- updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 0);
- updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 1);
- updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 2);
- updateVisualBits.SetBit(UNIT_FIELD_FLAGS);
- updateVisualBits.SetBit(UNIT_FIELD_FLAGS_2);
- updateVisualBits.SetBit(UNIT_FIELD_AURASTATE);
- updateVisualBits.SetBit(UNIT_FIELD_BASEATTACKTIME + 0);
- updateVisualBits.SetBit(UNIT_FIELD_BASEATTACKTIME + 1);
- updateVisualBits.SetBit(UNIT_FIELD_BOUNDINGRADIUS);
- updateVisualBits.SetBit(UNIT_FIELD_COMBATREACH);
- updateVisualBits.SetBit(UNIT_FIELD_DISPLAYID);
- updateVisualBits.SetBit(UNIT_FIELD_NATIVEDISPLAYID);
- updateVisualBits.SetBit(UNIT_FIELD_MOUNTDISPLAYID);
- updateVisualBits.SetBit(UNIT_FIELD_BYTES_1);
- updateVisualBits.SetBit(UNIT_FIELD_PETNUMBER);
- updateVisualBits.SetBit(UNIT_FIELD_PET_NAME_TIMESTAMP);
- updateVisualBits.SetBit(UNIT_DYNAMIC_FLAGS);
- updateVisualBits.SetBit(UNIT_CHANNEL_SPELL);
- updateVisualBits.SetBit(UNIT_MOD_CAST_SPEED);
- updateVisualBits.SetBit(UNIT_FIELD_BASE_MANA);
- updateVisualBits.SetBit(UNIT_FIELD_BYTES_2);
- updateVisualBits.SetBit(UNIT_FIELD_HOVERHEIGHT);
-
- updateVisualBits.SetBit(PLAYER_DUEL_ARBITER + 0);
- updateVisualBits.SetBit(PLAYER_DUEL_ARBITER + 1);
- updateVisualBits.SetBit(PLAYER_FLAGS);
- updateVisualBits.SetBit(PLAYER_GUILDID);
- updateVisualBits.SetBit(PLAYER_GUILDRANK);
- updateVisualBits.SetBit(PLAYER_BYTES);
- updateVisualBits.SetBit(PLAYER_BYTES_2);
- updateVisualBits.SetBit(PLAYER_BYTES_3);
- updateVisualBits.SetBit(PLAYER_DUEL_TEAM);
- updateVisualBits.SetBit(PLAYER_GUILD_TIMESTAMP);
- updateVisualBits.SetBit(UNIT_NPC_FLAGS);
-
- // PLAYER_QUEST_LOG_x also visible bit on official (but only on party/raid)...
- for (uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_25_2; i += MAX_QUEST_OFFSET)
- updateVisualBits.SetBit(i);
-
- // Players visible items are not inventory stuff
- for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
- {
- uint16 offset = i * 2;
-
- // item entry
- updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_ENTRYID + offset);
- // enchant
- updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + offset);
- }
-
- updateVisualBits.SetBit(PLAYER_CHOSEN_TITLE);
-}
-
void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
@@ -5080,7 +4969,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
break;
}
default:
- sLog->outError("Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
}
if (updateRealmChars)
@@ -5110,7 +4999,7 @@ void Player::DeleteOldCharacters()
*/
void Player::DeleteOldCharacters(uint32 keepDays)
{
- sLog->outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays);
+ sLog->outInfo(LOG_FILTER_PLAYER, "Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS);
stmt->setUInt32(0, uint32(time(NULL) - time_t(keepDays * DAY)));
@@ -5118,7 +5007,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
if (result)
{
- sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", result->GetRowCount());
+ sLog->outDebug(LOG_FILTER_PLAYER, "Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", result->GetRowCount());
do
{
Field* fields = result->Fetch();
@@ -5138,7 +5027,7 @@ void Player::SetMovement(PlayerMovementType pType)
case MOVE_WATER_WALK: data.Initialize(SMSG_MOVE_WATER_WALK, GetPackGUID().size()+4); break;
case MOVE_LAND_WALK: data.Initialize(SMSG_MOVE_LAND_WALK, GetPackGUID().size()+4); break;
default:
- sLog->outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.", pType);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::SetMovement: Unsupported move type (%d), data not sent to client.", pType);
return;
}
data.append(GetPackGUID());
@@ -5167,7 +5056,7 @@ void Player::BuildPlayerRepop()
// the player cannot have a corpse already, only bones which are not returned by GetCorpse
if (GetCorpse())
{
- sLog->outError("BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow());
return;
}
@@ -5176,7 +5065,7 @@ void Player::BuildPlayerRepop()
Corpse* corpse = GetCorpse();
if (!corpse)
{
- sLog->outError("Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow());
return;
}
GetMap()->AddToMap(corpse);
@@ -5533,7 +5422,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityCostsEntry const* dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel);
if (!dcost)
{
- sLog->outError("RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
return TotalCost;
}
@@ -5541,7 +5430,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityQualityEntry const* dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId);
if (!dQualitymodEntry)
{
- sLog->outError("RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
return TotalCost;
}
@@ -5557,7 +5446,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
{
if (GetGuildId() == 0)
{
- sLog->outStaticDebug("You are not member of a guild");
+ sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "You are not member of a guild");
return TotalCost;
}
@@ -5572,7 +5461,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
}
else if (!HasEnoughMoney(costs))
{
- sLog->outStaticDebug("You do not have enough money");
+ sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "You do not have enough money");
return TotalCost;
}
else
@@ -5609,7 +5498,17 @@ void Player::RepopAtGraveyard()
if (Battleground* bg = GetBattleground())
ClosestGrave = bg->GetClosestGraveYard(this);
else
- ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
+ {
+ if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
+ ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this);
+ else
+ {
+ if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
+ ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this);
+ else
+ ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
+ }
+ }
// stop countdown until repop
m_deathTimer = 0;
@@ -5780,7 +5679,7 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa
{
if (modGroup >= BASEMOD_END || modType >= MOD_END)
{
- sLog->outError("ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!");
return;
}
@@ -5811,7 +5710,7 @@ float Player::GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const
{
if (modGroup >= BASEMOD_END || modType > MOD_END)
{
- sLog->outError("trial to access non existed BaseModGroup or wrong BaseModType!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "trial to access non existed BaseModGroup or wrong BaseModType!");
return 0.0f;
}
@@ -5825,7 +5724,7 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
{
if (modGroup >= BASEMOD_END)
{
- sLog->outError("wrong BaseModGroup in GetTotalBaseModValue()!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "wrong BaseModGroup in GetTotalBaseModValue()!");
return 0.0f;
}
@@ -6180,7 +6079,7 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
if (itr->second.uState != SKILL_NEW)
itr->second.uState = SKILL_CHANGED;
UpdateSkillEnchantments(skill_id, value, new_value);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skill_id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skill_id);
return true;
}
@@ -6323,7 +6222,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
}
}
UpdateSkillEnchantments(SkillId, SkillValue, new_value);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId);
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f);
return true;
}
@@ -6513,8 +6412,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
// if skill value is going up, update enchantments after setting the new value
if (newVal > currVal)
UpdateSkillEnchantments(id, currVal, newVal);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id);
}
else //remove
{
@@ -6547,15 +6446,15 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id);
if (!pSkill)
{
- sLog->outError("Skill not found in SkillLineStore: skill #%u", id);
+ sLog->outError(LOG_FILTER_PLAYER_SKILLS, "Skill not found in SkillLineStore: skill #%u", id);
return;
}
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id, step));
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i), MAKE_SKILL_VALUE(newVal, maxVal));
UpdateSkillEnchantments(id, currVal, newVal);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id);
// insert new entry or update if not deleted old entry yet
if (itr != mSkillStatus.end())
@@ -6707,8 +6606,6 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const
void Player::SendActionButtons(uint32 state) const
{
- sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec);
-
WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4));
data << uint8(state);
/*
@@ -6730,20 +6627,20 @@ void Player::SendActionButtons(uint32 state) const
}
GetSession()->SendPacket(&data);
- sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "SMSG_ACTION_BUTTONS sent '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec);
}
bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
{
if (button >= MAX_ACTION_BUTTONS)
{
- sLog->outError("Action %u not added into button %u for player %s: button must be < %u", action, button, GetName(), MAX_ACTION_BUTTONS);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Action %u not added into button %u for player %s: button must be < %u", action, button, GetName(), MAX_ACTION_BUTTONS);
return false;
}
if (action >= MAX_ACTION_BUTTON_ACTION_VALUE)
{
- sLog->outError("Action %u not added into button %u for player %s: action must be < %u", action, button, GetName(), MAX_ACTION_BUTTON_ACTION_VALUE);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Action %u not added into button %u for player %s: action must be < %u", action, button, GetName(), MAX_ACTION_BUTTON_ACTION_VALUE);
return false;
}
@@ -6752,7 +6649,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
case ACTION_BUTTON_SPELL:
if (!sSpellMgr->GetSpellInfo(action))
{
- sLog->outError("Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName());
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName());
return false;
}
@@ -6765,7 +6662,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
case ACTION_BUTTON_ITEM:
if (!sObjectMgr->GetItemTemplate(action))
{
- sLog->outError("Item action %u not added into button %u for player %s: item not exist", action, button, GetName());
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Item action %u not added into button %u for player %s: item not exist", action, button, GetName());
return false;
}
break;
@@ -6787,7 +6684,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
// set data and update to CHANGED if not NEW
ab.SetActionAndType(action, ActionButtonType(type));
- sLog->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button);
+ sLog->outInfo(LOG_FILTER_PLAYER_LOADING, "Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button);
return &ab;
}
@@ -6802,7 +6699,7 @@ void Player::removeActionButton(uint8 button)
else
buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save
- sLog->outDetail("Action Button '%u' Removed from Player '%u'", button, GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_PLAYER_LOADING, "Action Button '%u' Removed from Player '%u'", button, GetGUIDLow());
}
ActionButton const* Player::GetActionButton(uint8 button)
@@ -6914,7 +6811,7 @@ void Player::CheckAreaExploreAndOutdoor()
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
- sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE);
+ sLog->outError(LOG_FILTER_PLAYER, "Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE);
return;
}
@@ -6925,12 +6822,12 @@ void Player::CheckAreaExploreAndOutdoor()
{
SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields | val));
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA);
AreaTableEntry const* areaEntry = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId());
if (!areaEntry)
{
- sLog->outError("Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId());
return;
}
@@ -6967,7 +6864,7 @@ void Player::CheckAreaExploreAndOutdoor()
GiveXP(XP, NULL);
SendExplorationExperience(area, XP);
}
- sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area);
+ sLog->outInfo(LOG_FILTER_PLAYER, "Player %u discovered a new area: %u", GetGUIDLow(), area);
}
}
}
@@ -6981,10 +6878,10 @@ uint32 Player::TeamForRace(uint8 race)
case 1: return HORDE;
case 7: return ALLIANCE;
}
- sLog->outError("Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
+ sLog->outError(LOG_FILTER_PLAYER, "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
}
else
- sLog->outError("Race (%u) not found in DBC: wrong DBC files?", uint32(race));
+ sLog->outError(LOG_FILTER_PLAYER, "Race (%u) not found in DBC: wrong DBC files?", uint32(race));
return ALLIANCE;
}
@@ -7367,8 +7264,6 @@ void Player::SetArenaPoints(uint32 value)
void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
{
- PreparedStatement* stmt = NULL;
-
int32 newValue = int32(GetHonorPoints()) + value;
if (newValue < 0)
newValue = 0;
@@ -7376,7 +7271,7 @@ void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
if (trans && !trans->null())
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_HONOR_POINTS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_HONOR_POINTS);
stmt->setUInt32(0, newValue);
stmt->setUInt32(1, GetGUIDLow());
(*trans)->Append(stmt);
@@ -7385,8 +7280,6 @@ void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/)
{
- PreparedStatement* stmt = NULL;
-
int32 newValue = int32(GetArenaPoints()) + value;
if (newValue < 0)
newValue = 0;
@@ -7394,7 +7287,7 @@ void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/)
if (trans && !trans->null())
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_ARENA_POINTS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_ARENA_POINTS);
stmt->setUInt32(0, newValue);
stmt->setUInt32(1, GetGUIDLow());
(*trans)->Append(stmt);
@@ -7531,6 +7424,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
{
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sOutdoorPvPMgr->HandlePlayerEnterZone(this, newZone);
+ sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
+ sBattlefieldMgr->HandlePlayerEnterZone(this, newZone);
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
}
@@ -7610,8 +7505,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
if (GetRestType() == REST_TYPE_IN_TAVERN) // Still inside a tavern or has recently left
{
// Remove rest state if we have recently left a tavern.
- // Why is 40 yd hardcoded?
- if (GetMapId() != GetInnPosMapId() || GetExactDist(GetInnPosX(), GetInnPosY(), GetInnPosZ()) > 40.0f)
+ if (GetMapId() != GetInnPosMapId() || GetExactDist(GetInnPosX(), GetInnPosY(), GetInnPosZ()) > 1.0f)
{
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
SetRestType(REST_TYPE_NO);
@@ -7678,7 +7572,7 @@ void Player::CheckDuelDistance(time_t currTime)
bool Player::IsOutdoorPvPActive()
{
- return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (IsPvP() || sWorld->IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight();
+ return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight();
}
void Player::DuelComplete(DuelCompleteType type)
@@ -7726,10 +7620,10 @@ void Player::DuelComplete(DuelCompleteType type)
}
break;
case DUEL_WON:
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
if (duel->opponent)
{
- duel->opponent->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1);
+ duel->opponent->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1);
//Credit for quest Death's Challenge
if (getClass() == CLASS_DEATH_KNIGHT && duel->opponent->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE)
@@ -7813,7 +7707,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
if (item->IsBroken())
return;
- sLog->outDetail("applying mods for item %u ", item->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_PLAYER_ITEMS, "applying mods for item %u ", item->GetGUIDLow());
uint8 attacktype = Player::GetAttackBySlot(slot);
@@ -8019,6 +7913,9 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -val, apply);
m_spellPenetrationItemMod += apply ? val : -val;
break;
+ case ITEM_MOD_BLOCK_VALUE:
+ HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(val), apply);
+ break;
// deprecated item mods
case ITEM_MOD_SPELL_HEALING_DONE:
case ITEM_MOD_SPELL_DAMAGE_DONE:
@@ -8299,7 +8196,7 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply,
return;
}
- sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
+ sLog->outDebug(LOG_FILTER_PLAYER, "WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
CastSpell(this, spellInfo, true, item);
}
@@ -8405,7 +8302,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown Item spellid %i", spellData.SpellId);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "WORLD: unknown Item spellid %i", spellData.SpellId);
continue;
}
@@ -8474,7 +8371,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- sLog->outError("Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
GetGUIDLow(), GetName(), pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -8519,7 +8416,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(learn_spell_id);
if (!spellInfo)
{
- sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
SendEquipError(EQUIP_ERR_NONE, item, NULL);
return;
}
@@ -8551,7 +8448,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (!spellInfo)
{
- sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
continue;
}
@@ -8579,7 +8476,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- sLog->outError("Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -9259,6 +9156,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
case 1519: // Stormwind City
case 1537: // Ironforge
case 2257: // Deeprun Tram
+ case 3703: // Shattrath City
break;
case 139: // Eastern Plaguelands
if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_EP)
@@ -9665,7 +9563,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(3610) << uint32(0x0); // 9 show
}
break;
- case 3703: // Shattrath City
case 4384: // Strand of the Ancients
if (bg && bg->GetTypeID(true) == BATTLEGROUND_SA)
bg->FillInitialWorldStates(data);
@@ -9808,7 +9705,7 @@ uint32 Player::GetXPRestBonus(uint32 xp)
SetRestBonus(GetRestBonus() - rested_bonus);
- sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus());
+ sLog->outInfo(LOG_FILTER_PLAYER, "Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus());
return rested_bonus;
}
@@ -9840,7 +9737,7 @@ void Player::ResetPetTalents()
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("Object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
+ sLog->outError(LOG_FILTER_PLAYER, "Object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return;
}
pet->resetTalents();
@@ -10678,7 +10575,7 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// currencytoken case
- if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS))
+ if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->IsCurrencyToken()))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// prevent cheating
@@ -11031,7 +10928,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
- else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ else if (pProto->IsCurrencyToken())
{
res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot);
if (res != EQUIP_ERR_OK)
@@ -11198,7 +11095,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
- else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ else if (pProto->IsCurrencyToken())
{
res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot);
if (res != EQUIP_ERR_OK)
@@ -11447,7 +11344,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
if (b_found)
continue;
- if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ if (pProto->IsCurrencyToken())
{
for (uint32 t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t)
{
@@ -11634,7 +11531,11 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
if (eslot == EQUIPMENT_SLOT_OFFHAND)
{
- if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
+ // Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750)
+ if (type == INVTYPE_WEAPON && pProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM)
+ return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT;
+
+ else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
{
if (!CanDualWield())
return EQUIP_ERR_CANT_DUAL_WIELD;
@@ -11743,7 +11644,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
uint8 pItemslot = pItem->GetSlot();
if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END)
{
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
+ sLog->outError(LOG_FILTER_PLAYER, "Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId);
return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED;
}
@@ -12174,8 +12075,8 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
if (pItem)
{
ItemAddedQuestCheck(item, count);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1);
if (randomPropertyId)
pItem->SetItemRandomProperties(randomPropertyId);
pItem = StoreItem(dest, pItem, update);
@@ -12345,7 +12246,7 @@ Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update)
if (Item* pItem = Item::CreateItem(item, 1, this))
{
ItemAddedQuestCheck(item, 1);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1);
return EquipItem(pos, pItem, update);
}
@@ -12382,7 +12283,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cooldownSpell);
if (!spellProto)
- sLog->outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
+ sLog->outError(LOG_FILTER_PLAYER, "Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
else
{
m_weaponChangeTimer = spellProto->StartRecoveryTime;
@@ -12455,8 +12356,8 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
}
// only for full equip instead adding to stack
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
return pItem;
}
@@ -12477,8 +12378,8 @@ void Player::QuickEquipItem(uint16 pos, Item* pItem)
pItem->SendUpdateToPlayer(this);
}
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
}
}
@@ -12624,7 +12525,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool
{
// update quest counters
ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount());
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount());
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount());
// store item
Item* pLastItem = StoreItem(dest, pItem, update);
@@ -12764,7 +12665,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ
{
ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount);
pItem->SetCount(pItem->GetCount() - count + remcount);
- if (IsInWorld() & update)
+ if (IsInWorld() && update)
pItem->SendUpdateToPlayer(this);
pItem->SetState(ITEM_CHANGED, this);
return;
@@ -12792,7 +12693,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ
{
ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount);
pItem->SetCount(pItem->GetCount() - count + remcount);
- if (IsInWorld() & update)
+ if (IsInWorld() && update)
pItem->SendUpdateToPlayer(this);
pItem->SetState(ITEM_CHANGED, this);
return;
@@ -12858,7 +12759,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ
{
ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount);
pItem->SetCount(pItem->GetCount() - count + remcount);
- if (IsInWorld() & update)
+ if (IsInWorld() && update)
pItem->SendUpdateToPlayer(this);
pItem->SetState(ITEM_CHANGED, this);
return;
@@ -12933,6 +12834,11 @@ Item* Player::GetItemByEntry(uint32 entry) const
if (pItem->GetEntry() == entry)
return pItem;
+ for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
+ if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
+ if (pItem->GetEntry() == entry)
+ return pItem;
+
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
if (Bag* pBag = GetBagByPos(i))
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
@@ -12966,7 +12872,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update)
ItemRemovedQuestCheck(pItem->GetEntry(), count);
pItem->SetCount(pItem->GetCount() - count);
count = 0;
- if (IsInWorld() & update)
+ if (IsInWorld() && update)
pItem->SendUpdateToPlayer(this);
pItem->SetState(ITEM_CHANGED, this);
}
@@ -14140,7 +14046,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
// nothing do..
break;
default:
- sLog->outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
+ sLog->outError(LOG_FILTER_PLAYER, "Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
break;
} /*switch (enchant_display_type)*/
} /*for*/
@@ -14312,7 +14218,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
VendorItemData const* vendorItems = creature->GetVendorItems();
if (!vendorItems || vendorItems->Empty())
{
- sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", creature->GetGUIDLow(), creature->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", creature->GetGUIDLow(), creature->GetEntry());
canTalk = false;
}
break;
@@ -14361,7 +14267,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
canTalk = false;
break;
default:
- sLog->outErrorDb("Creature entry %u have unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
+ sLog->outError(LOG_FILTER_SQL, "Creature entry %u have unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
canTalk = false;
break;
}
@@ -14456,7 +14362,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
{
if (gossipOptionId > GOSSIP_OPTION_QUESTGIVER)
{
- sLog->outError("Player guid %u request invalid gossip option for GameObject entry %u", GetGUIDLow(), source->GetEntry());
+ sLog->outError(LOG_FILTER_PLAYER, "Player guid %u request invalid gossip option for GameObject entry %u", GetGUIDLow(), source->GetEntry());
return;
}
}
@@ -14560,7 +14466,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
{
- sLog->outError("a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUIDLow());
return;
}
@@ -14824,13 +14730,14 @@ bool Player::CanSeeStartQuest(Quest const* quest)
bool Player::CanTakeQuest(Quest const* quest, bool msg)
{
- return SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg)
+ return !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
+ && SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg)
&& SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg)
&& SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg)
&& SatisfyQuestPreviousQuest(quest, msg) && SatisfyQuestTimed(quest, msg)
&& SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg)
&& SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg)
- && SatisfyQuestSeasonal(quest,msg) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
+ && SatisfyQuestSeasonal(quest,msg)
&& SatisfyQuestConditions(quest, msg);
}
@@ -15085,7 +14992,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
m_QuestStatusSave[quest_id] = true;
- GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest_id);
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest_id);
//starting initial quest script
if (questGiver && quest->GetQuestStartScript() != 0)
@@ -15222,7 +15129,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
ModifyMoney(moneyRew);
if (moneyRew > 0)
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, uint32(moneyRew));
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, uint32(moneyRew));
}
// honor reward
@@ -15259,8 +15166,8 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
SetDailyQuestStatus(quest_id);
if (quest->IsDaily())
{
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, quest_id);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, quest_id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, quest_id);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, quest_id);
}
}
else if (quest->IsWeekly())
@@ -15288,9 +15195,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
CastSpell(this, quest->GetRewSpell(), true);
if (quest->GetZoneOrSort() > 0)
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, quest->GetZoneOrSort());
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId());
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, quest->GetZoneOrSort());
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId());
uint32 zone = 0;
uint32 area = 0;
@@ -15780,7 +15687,6 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
{
uint32 srcItemId = quest->GetSrcItemId();
ItemTemplate const* item = sObjectMgr->GetItemTemplate(srcItemId);
- bool destroyItem = true;
if (srcItemId > 0)
{
@@ -15800,6 +15706,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
return false;
}
+ bool destroyItem = true;
for (uint8 n = 0; n < QUEST_ITEM_OBJECTIVES_COUNT; ++n)
if (item->StartQuest == questId && srcItemId == quest->RequiredItemId[n])
destroyItem = false;
@@ -16069,8 +15976,8 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid)
real_entry = killed->GetEntry();
}
- GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_CREATURE, real_entry); // MUST BE CALLED FIRST
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, guid ? GetMap()->GetCreature(guid) : NULL);
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_CREATURE, real_entry); // MUST BE CALLED FIRST
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, guid ? GetMap()->GetCreature(guid) : NULL);
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
{
@@ -16473,7 +16380,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver)
data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY)));
}
- data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier());
+ data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
data << uint32(quest->GetBonusTalents()); // bonus talents
data << uint32(quest->GetRewArenaPoints());
GetSession()->SendPacket(&data);
@@ -16632,7 +16539,7 @@ void Player::_LoadArenaTeamInfo(PreparedQueryResult result)
ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(arenaTeamId);
if (!arenaTeam)
{
- sLog->outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenaTeamId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenaTeamId);
continue;
}
@@ -16672,10 +16579,11 @@ void Player::_LoadEquipmentSets(PreparedQueryResult result)
uint8 index = fields[1].GetUInt8();
eqSet.Name = fields[2].GetString();
eqSet.IconName = fields[3].GetString();
+ eqSet.IgnoreMask = fields[4].GetUInt32();
eqSet.state = EQUIPMENT_SET_UNCHANGED;
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
- eqSet.Items[i] = fields[4+i].GetUInt32();
+ eqSet.Items[i] = fields[5+i].GetUInt32();
m_EquipmentSets[index] = eqSet;
@@ -16782,7 +16690,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (!result)
{
- sLog->outError("Player (GUID: %u) not found in table `characters`, can't load. ", guid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) not found in table `characters`, can't load. ", guid);
return false;
}
@@ -16794,13 +16702,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// player should be able to load/delete character only with correct account!
if (dbAccountId != GetSession()->GetAccountId())
{
- sLog->outError("Player (GUID: %u) loading from wrong account (is: %u, should be: %u)", guid, GetSession()->GetAccountId(), dbAccountId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) loading from wrong account (is: %u, should be: %u)", guid, GetSession()->GetAccountId(), dbAccountId);
return false;
}
if (holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBANNED))
{
- sLog->outError("Player (GUID: %u) is banned, can't load.", guid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) is banned, can't load.", guid);
return false;
}
@@ -16828,7 +16736,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
uint8 Gender = fields[5].GetUInt8();
if (!IsValidGender(Gender))
{
- sLog->outError("Player (GUID: %u) has wrong gender (%hu), can't be loaded.", guid, Gender);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) has wrong gender (%hu), can't be loaded.", guid, Gender);
return false;
}
@@ -16859,7 +16767,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32());
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
- SetUInt32Value(PLAYER_BYTES_3, (fields[49].GetUInt16() & 0xFFFE) | fields[5].GetUInt8());
+ SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
+ SetByteValue(PLAYER_BYTES_3, 1, fields[49].GetUInt8());
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[48].GetUInt32());
@@ -16951,7 +16860,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !IsPositionValid())
{
- sLog->outError("Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
RelocateToHomebind();
}
// Player was saved in Arena or Bg
@@ -16989,7 +16898,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (mapId == MAPID_INVALID) // Battleground Entry Point not found (???)
{
- sLog->outError("Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.", guid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.", guid);
RelocateToHomebind();
}
else
@@ -17011,7 +16920,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// transport size limited
m_movementInfo.t_pos.m_positionX > 250 || m_movementInfo.t_pos.m_positionY > 250 || m_movementInfo.t_pos.m_positionZ > 250)
{
- sLog->outError("Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
guid, GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY,
GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.m_orientation);
@@ -17031,7 +16940,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
}
if (!m_transport)
{
- sLog->outError("Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.",
guid, transGUID);
RelocateToHomebind();
@@ -17058,12 +16967,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (!nodeEntry) // don't know taxi start node, to homebind
{
- sLog->outError("Character %u have wrong data in taxi destination list, teleport to homebind.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u have wrong data in taxi destination list, teleport to homebind.", GetGUIDLow());
RelocateToHomebind();
}
else // have start node, to it
{
- sLog->outError("Character %u have too short taxi destination list, teleport to original node.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u have too short taxi destination list, teleport to original node.", GetGUIDLow());
mapId = nodeEntry->map_id;
Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f);
}
@@ -17113,13 +17022,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(mapId);
if (at)
{
- sLog->outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation());
mapId = at->target_mapId;
}
else
{
- sLog->outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
RelocateToHomebind();
}
@@ -17129,11 +17038,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
mapId = info->mapId;
Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
- sLog->outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
map = sMapMgr->CreateMap(mapId, this);
if (!map)
{
- sLog->outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
}
@@ -17147,7 +17056,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
else
{
- sLog->outError("Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), mapId);
RelocateToHomebind();
}
}
@@ -17169,13 +17078,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// set value, including drunk invisibility detection
// calculate sobering. after 15 minutes logged out, the player will be sober again
- float soberFactor;
- if (time_diff > 15*MINUTE)
- soberFactor = 0;
- else
- soberFactor = 1-time_diff/(15.0f*MINUTE);
- uint16 newDrunkenValue = uint16(soberFactor*(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE));
- SetDrunkValue(newDrunkenValue);
+ uint8 newDrunkValue = 0;
+ if (time_diff < uint32(GetDrunkValue()) * 9)
+ newDrunkValue = GetDrunkValue() - time_diff / 9;
+
+ SetDrunkValue(newDrunkValue);
m_cinematic = fields[18].GetUInt8();
m_Played_time[PLAYED_TIME_TOTAL]= fields[19].GetUInt32();
@@ -17191,7 +17098,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
m_stableSlots = fields[32].GetUInt8();
if (m_stableSlots > MAX_PET_STABLES)
{
- sLog->outError("Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots));
+ sLog->outError(LOG_FILTER_PLAYER, "Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots));
m_stableSlots = MAX_PET_STABLES;
}
@@ -17211,14 +17118,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
SetUInt32Value(UNIT_CHANNEL_SPELL, 0);
// clear charm/summon related fields
- SetUInt64Value(UNIT_FIELD_SUMMONEDBY, 0);
+ SetOwnerGUID(0);
SetUInt64Value(UNIT_FIELD_CHARMEDBY, 0);
SetUInt64Value(UNIT_FIELD_CHARM, 0);
SetUInt64Value(UNIT_FIELD_SUMMON, 0);
SetUInt64Value(PLAYER_FARSIGHT, 0);
SetCreatorGUID(0);
- RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
+ RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT);
// reset some aura modifiers before aura apply
SetUInt32Value(PLAYER_TRACK_CREATURES, 0);
@@ -17269,7 +17176,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS)
{
m_activeSpec = 0;
- sLog->outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), m_specsCount, m_activeSpec);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), m_specsCount, m_activeSpec);
}
_LoadTalents(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADTALENTS));
@@ -17474,7 +17381,7 @@ void Player::_LoadActions(PreparedQueryResult result)
ab->uState = ACTIONBUTTON_UNCHANGED;
else
{
- sLog->outError(" ...at loading, and will deleted in DB also");
+ sLog->outError(LOG_FILTER_PLAYER, " ...at loading, and will deleted in DB also");
// Will deleted in DB at next save (it can create data until save but marked as deleted)
m_actionButtons[button].uState = ACTIONBUTTON_DELETED;
@@ -17518,7 +17425,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- sLog->outError("Unknown aura (spellid %u), ignore.", spellid);
+ sLog->outError(LOG_FILTER_PLAYER, "Unknown aura (spellid %u), ignore.", spellid);
continue;
}
@@ -17552,7 +17459,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
aura->ApplyForTargets();
- sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
+ sLog->outInfo(LOG_FILTER_PLAYER, "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
}
}
while (result->NextRow());
@@ -17575,13 +17482,13 @@ void Player::_LoadGlyphAuras()
continue;
}
else
- sLog->outError("Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
}
else
- sLog->outError("Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
}
else
- sLog->outError("Player %s has not existing glyph entry %u on index %u", m_name.c_str(), glyph, i);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has not existing glyph entry %u on index %u", m_name.c_str(), glyph, i);
// On any error remove glyph
SetGlyph(i, 0);
@@ -17615,8 +17522,8 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
{
uint32 zoneId = GetZoneId();
- std::map<uint64, Bag*> bagMap; // fast guid lookup for bags
- std::map<uint64, Item*> invalidBagMap; // fast guid lookup for bags
+ std::map<uint32, Bag*> bagMap; // fast guid lookup for bags
+ std::map<uint32, Item*> invalidBagMap; // fast guid lookup for bags
std::list<Item*> problematicItems;
SQLTransaction trans = CharacterDatabase.BeginTransaction();
@@ -17675,7 +17582,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
{
item->SetSlot(NULL_SLOT);
// Item is in the bag, find the bag
- std::map<uint64, Bag*>::iterator itr = bagMap.find(bagGuid);
+ std::map<uint32, Bag*>::iterator itr = bagMap.find(bagGuid);
if (itr != bagMap.end())
{
ItemPosCountVec dest;
@@ -17685,13 +17592,13 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
}
else if (invalidBagMap.find(bagGuid) != invalidBagMap.end())
{
- std::map<uint64, Item*>::iterator itr = invalidBagMap.find(bagGuid);
- if (std::find(problematicItems.begin(),problematicItems.end(),itr->second) != problematicItems.end())
+ std::map<uint32, Item*>::iterator itr = invalidBagMap.find(bagGuid);
+ if (std::find(problematicItems.begin(), problematicItems.end(), itr->second) != problematicItems.end())
err = EQUIP_ERR_INT_BAG_ERROR;
}
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?",
GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot);
item->DeleteFromInventoryDB(trans);
delete item;
@@ -17705,7 +17612,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
item->SetState(ITEM_UNCHANGED, this);
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.",
GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot, err);
item->DeleteFromInventoryDB(trans);
problematicItems.push_back(item);
@@ -17736,7 +17643,6 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields)
{
- PreparedStatement* stmt = NULL;
Item* item = NULL;
uint32 itemGuid = fields[13].GetUInt32();
uint32 itemEntry = fields[14].GetUInt32();
@@ -17746,6 +17652,8 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
item = NewItemOrBag(proto);
if (item->LoadFromDB(itemGuid, GetGUID(), fields, itemEntry))
{
+ PreparedStatement* stmt = NULL;
+
// Do not allow to have item limited to another map/zone in alive state
if (isAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
{
@@ -17831,7 +17739,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has broken item (GUID: %u, entry: %u) in inventory. Deleting item.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has broken item (GUID: %u, entry: %u) in inventory. Deleting item.",
GetGUIDLow(), GetName(), itemGuid, itemEntry);
remove = true;
}
@@ -17846,7 +17754,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has unknown item (entry: %u) in inventory. Deleting item.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has unknown item (entry: %u) in inventory. Deleting item.",
GetGUIDLow(), GetName(), itemEntry);
Item::DeleteFromInventoryDB(trans, itemGuid);
Item::DeleteFromDB(trans, itemGuid);
@@ -17877,7 +17785,7 @@ void Player::_LoadMailedItems(Mail* mail)
if (!proto)
{
- sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), itemGuid, itemTemplate, mail->messageID);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), itemGuid, itemTemplate, mail->messageID);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM);
stmt->setUInt32(0, itemGuid);
@@ -17893,7 +17801,7 @@ void Player::_LoadMailedItems(Mail* mail)
if (!item->LoadFromDB(itemGuid, MAKE_NEW_GUID(fields[13].GetUInt32(), 0, HIGHGUID_PLAYER), fields, itemTemplate))
{
- sLog->outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM);
stmt->setUInt32(0, itemGuid);
@@ -17956,7 +17864,7 @@ void Player::_LoadMail()
if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
{
- sLog->outError("Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
m->mailTemplateId = 0;
}
@@ -18013,7 +17921,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
else
{
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
- sLog->outError("Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
GetName(), GetGUIDLow(), quest_id, qstatus);
}
@@ -18137,7 +18045,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result)
if (quest_daily_idx >= PLAYER_MAX_DAILY_QUESTS) // max amount with exist data in query
{
- sLog->outError("Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`", GetGUIDLow());
break;
}
@@ -18268,12 +18176,12 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !mapEntry->IsDungeon())
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
deleteInstance = true;
}
else if (difficulty >= MAX_DIFFICULTY)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
deleteInstance = true;
}
else
@@ -18281,12 +18189,12 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
if (!mapDiff)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
deleteInstance = true;
}
else if (!perm && group)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty);
deleteInstance = true;
}
}
@@ -18578,7 +18486,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
leader = ObjectAccessor::FindPlayer(leaderGuid);
if (ar->achievement)
- if (!leader || !leader->GetAchievementMgr().HasAchieved(ar->achievement))
+ if (!leader || !leader->HasAchieved(ar->achievement))
missingAchievement = ar->achievement;
Difficulty target_difficulty = GetDifficulty(mapEntry->IsRaid());
@@ -18632,7 +18540,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- sLog->outError("Player (Name %s) has incorrect race/class pair. Can't be loaded.", GetName());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (Name %s) has incorrect race/class pair. Can't be loaded.", GetName());
return false;
}
@@ -18680,7 +18588,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
CharacterDatabase.Execute(stmt);
}
- sLog->outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
+ sLog->outDebug(LOG_FILTER_PLAYER, "Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
return true;
@@ -18769,7 +18677,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt32(index++, GetUInt32Value(PLAYER_CHOSEN_TITLE));
stmt->setUInt64(index++, GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX));
- stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE));
+ stmt->setUInt8(index++, GetDrunkValue());
stmt->setUInt32(index++, GetHealth());
for (uint32 i = 0; i < MAX_POWERS; ++i)
@@ -18880,7 +18788,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt32(index++, GetUInt32Value(PLAYER_CHOSEN_TITLE));
stmt->setUInt64(index++, GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX));
- stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE));
+ stmt->setUInt8(index++, GetDrunkValue());
stmt->setUInt32(index++, GetHealth());
for (uint32 i = 0; i < MAX_POWERS; ++i)
@@ -19124,7 +19032,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
}
else
{
- sLog->outError("Can't find item guid %u but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Can't find item guid %u but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow());
m_refundableItems.erase(itr);
}
}
@@ -19155,7 +19063,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
uint32 bagTestGUID = 0;
if (Item* test2 = GetItemByPos(INVENTORY_SLOT_BAG_0, item->GetBagSlot()))
bagTestGUID = test2->GetGUIDLow();
- sLog->outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), (int32)item->GetState());
+ sLog->outError(LOG_FILTER_PLAYER, "Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), (int32)item->GetState());
// according to the test that was just performed nothing should be in this slot, delete
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT);
stmt->setUInt32(0, bagTestGUID);
@@ -19171,7 +19079,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
}
else if (test != item)
{
- sLog->outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u are incorrect, the item with guid %u is there instead!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u are incorrect, the item with guid %u is there instead!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow());
// save all changes to the item...
if (item->GetState() != ITEM_NEW) // only for existing items, no dupes
item->SaveToDB(trans);
@@ -19581,7 +19489,7 @@ void Player::_SaveStats(SQLTransaction& trans)
void Player::outDebugValues() const
{
- if (!sLog->IsOutDebug()) // optimize disabled debug output
+ if (!sLog->ShouldLog(LOG_FILTER_UNITS, LOG_LEVEL_DEBUG))
return;
sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u", GetMaxHealth(), GetMaxPower(POWER_MANA));
@@ -19901,7 +19809,7 @@ Pet* Player::GetPet() const
return pet;
//there may be a guardian in slot
- //sLog->outError("Player::GetPet: Pet %u not exist.", GUID_LOPART(pet_guid));
+ //sLog->outError(LOG_FILTER_PLAYER, "Player::GetPet: Pet %u not exist.", GUID_LOPART(pet_guid));
//const_cast<Player*>(this)->SetPetGUID(0);
}
@@ -20003,10 +19911,10 @@ void Player::StopCastingCharm()
if (GetCharmGUID())
{
- sLog->outCrash("Player %s (GUID: " UI64FMTD " is not able to uncharm unit (GUID: " UI64FMTD " Entry: %u, Type: %u)", GetName(), GetGUID(), GetCharmGUID(), charm->GetEntry(), charm->GetTypeId());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Player %s (GUID: " UI64FMTD " is not able to uncharm unit (GUID: " UI64FMTD " Entry: %u, Type: %u)", GetName(), GetGUID(), GetCharmGUID(), charm->GetEntry(), charm->GetTypeId());
if (charm->GetCharmerGUID())
{
- sLog->outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
ASSERT(false);
}
else
@@ -20019,7 +19927,7 @@ inline void Player::BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std:
*data << uint8(msgtype);
*data << uint32(language);
*data << uint64(GetGUID());
- *data << uint32(language); //language 2.1.0 ?
+ *data << uint32(0); // constant unknown time
*data << uint64(GetGUID());
*data << uint32(text.length() + 1);
*data << text;
@@ -20198,7 +20106,7 @@ void Player::PossessSpellInitialize()
if (!charmInfo)
{
- sLog->outError("Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
+ sLog->outError(LOG_FILTER_PLAYER, "Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
return;
}
@@ -20310,7 +20218,7 @@ void Player::CharmSpellInitialize()
CharmInfo* charmInfo = charm->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("Player::CharmSpellInitialize(): the player's charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CharmSpellInitialize(): the player's charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
return;
}
@@ -20555,7 +20463,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
else
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID_TYPE);
- stmt->setUInt8(0, uint8(type));
+ stmt->setUInt8(1, uint8(type));
}
stmt->setUInt32(0, GUID_LOPART(guid));
@@ -20836,8 +20744,8 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
//Checks and preparations done, DO FLIGHT
ModifyMoney(-(int32)totalcost);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1);
// prevent stealth flight
//RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
@@ -21021,7 +20929,7 @@ void Player::InitDisplayIds()
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- sLog->outError("Player %u has incorrect race/class pair. Can't init display ids.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %u has incorrect race/class pair. Can't init display ids.", GetGUIDLow());
return;
}
@@ -21037,7 +20945,7 @@ void Player::InitDisplayIds()
SetNativeDisplayId(info->displayId_m);
break;
default:
- sLog->outError("Invalid gender %u for player", gender);
+ sLog->outError(LOG_FILTER_PLAYER, "Invalid gender %u for player", gender);
return;
}
}
@@ -21174,7 +21082,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
if (!iece)
{
- sLog->outError("Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
+ sLog->outError(LOG_FILTER_PLAYER, "Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
return false;
}
@@ -21217,7 +21125,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
uint32 maxCount = MAX_MONEY_AMOUNT / pProto->BuyPrice;
if ((uint32)count > maxCount)
{
- sLog->outError("Player %s tried to buy %u item id %u, causing overflow", GetName(), (uint32)count, pProto->ItemId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s tried to buy %u item id %u, causing overflow", GetName(), (uint32)count, pProto->ItemId);
count = (uint8)maxCount;
}
price = pProto->BuyPrice * count; //it should not exceed MAX_MONEY_AMOUNT
@@ -21697,7 +21605,7 @@ void Player::SetBattlegroundEntryPoint()
if (const WorldSafeLocsEntry* entry = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()))
m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f);
else
- sLog->outError("SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId());
+ sLog->outError(LOG_FILTER_PLAYER, "SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId());
}
// If new entry point is not BG or arena set it
else if (!GetMap()->IsBattlegroundOrArena())
@@ -22190,7 +22098,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
SendEquipmentSetList();
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4);
- data << uint32(secsToTimeBitFields(sWorld->GetGameTime()));
+ data.AppendPackedTime(sWorld->GetGameTime());
data << float(0.01666667f); // game speed
data << uint32(0); // added in 3.1.2
GetSession()->SendPacket(&data);
@@ -22827,7 +22735,7 @@ void Player::SummonIfPossible(bool agree)
m_summon_expire = 0;
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1);
TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z, GetOrientation());
}
@@ -22931,7 +22839,7 @@ bool Player::HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item cons
break;
}
default:
- sLog->outError("HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass);
+ sLog->outError(LOG_FILTER_PLAYER, "HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass);
break;
}
@@ -23009,7 +22917,7 @@ uint32 Player::GetResurrectionSpellId()
case 27239: spell_id = 27240; break; // rank 6
case 47883: spell_id = 47882; break; // rank 7
default:
- sLog->outError("Unhandled spell %u: S.Resurrection", (*itr)->GetId());
+ sLog->outError(LOG_FILTER_PLAYER, "Unhandled spell %u: S.Resurrection", (*itr)->GetId());
continue;
}
@@ -23413,7 +23321,7 @@ bool Player::isUsingLfg()
return sLFGMgr->GetState(guid) != LFG_STATE_NONE;
}
-void Player::SetBattlegroundRaid(Group* group, int8 subgroup)
+void Player::SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup)
{
//we must move references from m_group to m_originalGroup
SetOriginalGroup(GetGroup(), GetSubGroup());
@@ -23423,7 +23331,7 @@ void Player::SetBattlegroundRaid(Group* group, int8 subgroup)
m_group.setSubGroup((uint8)subgroup);
}
-void Player::RemoveFromBattlegroundRaid()
+void Player::RemoveFromBattlegroundOrBattlefieldRaid()
{
//remove existing reference
m_group.unlink();
@@ -23565,7 +23473,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
if (!AddUInt64Value(PLAYER_FARSIGHT, target->GetGUID()))
{
- sLog->outCrash("Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName());
return;
}
@@ -23581,7 +23489,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
if (!RemoveUInt64Value(PLAYER_FARSIGHT, target->GetGUID()))
{
- sLog->outCrash("Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName());
return;
}
@@ -24001,9 +23909,9 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
--loot->unlootedCount;
SendNewItem(newitem, uint32(item->count), false, false, true);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count);
}
else
SendEquipError(msg, NULL, NULL, item->itemid);
@@ -24058,7 +23966,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
if (!pSkill)
{
- sLog->outError("Character %u has skill %u that does not exist.", GetGUIDLow(), skill);
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u has skill %u that does not exist.", GetGUIDLow(), skill);
continue;
}
@@ -24076,7 +23984,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
}
if (value == 0)
{
- sLog->outError("Character %u has skill %u with value 0. Will be deleted.", GetGUIDLow(), skill);
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u has skill %u with value 0. Will be deleted.", GetGUIDLow(), skill);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL);
@@ -24105,7 +24013,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
if (count >= PLAYER_MAX_SKILLS) // client limit
{
- sLog->outError("Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS);
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS);
break;
}
}
@@ -24269,24 +24177,54 @@ void Player::HandleFall(MovementInfo const& movementInfo)
// recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case
if (isAlive() && final_damage < original_health)
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
}
//Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
- sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
+ sLog->outDebug(LOG_FILTER_PLAYER, "FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
}
}
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LANDING); // No fly zone - Parachute
}
+void Player::ResetAchievements()
+{
+ m_achievementMgr.Reset();
+}
+
+void Player::SendRespondInspectAchievements(Player* player) const
+{
+ m_achievementMgr.SendRespondInspectAchievements(player);
+}
+
+bool Player::HasAchieved(uint32 achievementId) const
+{
+ return m_achievementMgr.HasAchieved(achievementId);
+}
+
+void Player::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost/* = 0*/)
+{
+ m_achievementMgr.StartTimedAchievement(type, entry, timeLost);
+}
+
+void Player::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
+{
+ m_achievementMgr.RemoveTimedAchievement(type, entry);
+}
+
+void Player::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, bool evenIfCriteriaComplete /* = false*/)
+{
+ m_achievementMgr.ResetAchievementCriteria(type, miscValue1, miscValue2, evenIfCriteriaComplete);
+}
+
void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/)
{
- GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
+ m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
}
void Player::CompletedAchievement(AchievementEntry const* entry)
{
- GetAchievementMgr().CompletedAchievement(entry);
+ m_achievementMgr.CompletedAchievement(entry);
}
void Player::LearnTalent(uint32 talentId, uint32 talentRank)
@@ -24387,7 +24325,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
uint32 spellid = talentInfo->RankID[talentRank];
if (spellid == 0)
{
- sLog->outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ sLog->outError(LOG_FILTER_PLAYER, "Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
return;
}
@@ -24399,7 +24337,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
learnSpell(spellid, false);
AddTalent(spellid, m_activeSpec, true);
- sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, m_activeSpec);
+ sLog->outInfo(LOG_FILTER_PLAYER, "TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, m_activeSpec);
// update free talent points
SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
@@ -24524,7 +24462,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
uint32 spellid = talentInfo->RankID[talentRank];
if (spellid == 0)
{
- sLog->outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ sLog->outError(LOG_FILTER_PLAYER, "Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
return;
}
@@ -24534,7 +24472,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
// learn! (other talent ranks will unlearned at learning)
pet->learnSpell(spellid);
- sLog->outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
+ sLog->outInfo(LOG_FILTER_PLAYER, "PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
// update free talent points
pet->SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
@@ -24602,11 +24540,11 @@ bool Player::canSeeSpellClickOn(Creature const* c) const
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(c->GetEntry(), itr->second.spellId);
ConditionSourceInfo info = ConditionSourceInfo(const_cast<Player*>(this), const_cast<Creature*>(c));
- if (!sConditionMgr->IsObjectMeetToConditions(info, conds))
- return false;
+ if (sConditionMgr->IsObjectMeetToConditions(info, conds))
+ return true;
}
- return true;
+ return false;
}
void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
@@ -24817,7 +24755,13 @@ void Player::SendEquipmentSetList()
data << itr->second.Name;
data << itr->second.IconName;
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
- data.appendPackGUID(MAKE_NEW_GUID(itr->second.Items[i], 0, HIGHGUID_ITEM));
+ {
+ // ignored slots stored in IgnoreMask, client wants "1" as raw GUID, so no HIGHGUID_ITEM
+ if (itr->second.IgnoreMask & (1 << i))
+ data.appendPackGUID(uint64(1));
+ else
+ data.appendPackGUID(MAKE_NEW_GUID(itr->second.Items[i], 0, HIGHGUID_ITEM));
+ }
++count; // client have limit but it checked at loading and set
}
@@ -24842,7 +24786,7 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
if (!found) // something wrong...
{
- sLog->outError("Player %s tried to save equipment set "UI64FMTD" (index %u), but that equipment set not found!", GetName(), eqset.Guid, index);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s tried to save equipment set "UI64FMTD" (index %u), but that equipment set not found!", GetName(), eqset.Guid, index);
return;
}
}
@@ -24883,6 +24827,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_EQUIP_SET);
stmt->setString(j++, eqset.Name.c_str());
stmt->setString(j++, eqset.IconName.c_str());
+ stmt->setUInt32(j++, eqset.IgnoreMask);
for (uint8 i=0; i<EQUIPMENT_SLOT_END; ++i)
stmt->setUInt32(j++, eqset.Items[i]);
stmt->setUInt32(j++, GetGUIDLow());
@@ -24899,6 +24844,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
stmt->setUInt32(j++, index);
stmt->setString(j++, eqset.Name.c_str());
stmt->setString(j++, eqset.IconName.c_str());
+ stmt->setUInt32(j++, eqset.IgnoreMask);
for (uint8 i=0; i<EQUIPMENT_SLOT_END; ++i)
stmt->setUInt32(j++, eqset.Items[i]);
trans->Append(stmt);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index b0cbb5c7927..0decacd6258 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -114,7 +114,7 @@ struct PlayerTalent
// Spell modifier (used for modify other spells)
struct SpellModifier
{
- SpellModifier(Aura* _ownerAura = NULL) : charges(0), ownerAura(_ownerAura) {}
+ SpellModifier(Aura* _ownerAura = NULL) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
SpellModOp op : 8;
SpellModType type : 8;
int16 charges : 16;
@@ -299,7 +299,7 @@ struct Areas
enum RuneCooldowns
{
RUNE_BASE_COOLDOWN = 10000,
- RUNE_MISS_COOLDOWN = 1500, // cooldown applied on runes when the spell misses
+ RUNE_MISS_COOLDOWN = 1500 // cooldown applied on runes when the spell misses
};
enum RuneType
@@ -399,7 +399,7 @@ enum PlayerFlags
PLAYER_FLAGS_UNK28 = 0x10000000,
PLAYER_FLAGS_UNK29 = 0x20000000,
PLAYER_FLAGS_UNK30 = 0x40000000,
- PLAYER_FLAGS_UNK31 = 0x80000000,
+ PLAYER_FLAGS_UNK31 = 0x80000000
};
// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1)
@@ -640,7 +640,7 @@ enum EquipmentSetUpdateState
struct EquipmentSet
{
- EquipmentSet() : Guid(0), state(EQUIPMENT_SET_NEW)
+ EquipmentSet() : Guid(0), IgnoreMask(0), state(EQUIPMENT_SET_NEW)
{
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
Items[i] = 0;
@@ -649,6 +649,7 @@ struct EquipmentSet
uint64 Guid;
std::string Name;
std::string IconName;
+ uint32 IgnoreMask;
uint32 Items[EQUIPMENT_SLOT_END];
EquipmentSetUpdateState state;
};
@@ -671,7 +672,7 @@ enum TradeSlots
TRADE_SLOT_COUNT = 7,
TRADE_SLOT_TRADED_COUNT = 6,
TRADE_SLOT_NONTRADED = 6,
- TRADE_SLOT_INVALID = -1,
+ TRADE_SLOT_INVALID = -1
};
enum TransferAbortReason
@@ -691,7 +692,7 @@ enum TransferAbortReason
TRANSFER_ABORT_NOT_FOUND2 = 0x0D, // 3.1
TRANSFER_ABORT_NOT_FOUND3 = 0x0E, // 3.2
TRANSFER_ABORT_REALM_ONLY = 0x0F, // All players on party must be from the same realm.
- TRANSFER_ABORT_MAP_NOT_ALLOWED = 0x10, // Map can't be entered at this time.
+ TRANSFER_ABORT_MAP_NOT_ALLOWED = 0x10 // Map can't be entered at this time.
};
enum InstanceResetWarningType
@@ -738,7 +739,7 @@ enum TeleportToOptions
TELE_TO_NOT_LEAVE_TRANSPORT = 0x02,
TELE_TO_NOT_LEAVE_COMBAT = 0x04,
TELE_TO_NOT_UNSUMMON_PET = 0x08,
- TELE_TO_SPELL = 0x10,
+ TELE_TO_SPELL = 0x10
};
/// Type of environmental damages
@@ -760,7 +761,7 @@ enum PlayerChatTag
CHAT_TAG_DND = 0x02,
CHAT_TAG_GM = 0x04,
CHAT_TAG_COM = 0x08, // Commentator
- CHAT_TAG_DEV = 0x10,
+ CHAT_TAG_DEV = 0x10
};
enum PlayedTimeIndex
@@ -806,7 +807,7 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 29,
PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 30,
PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS = 31,
- MAX_PLAYER_LOGIN_QUERY,
+ MAX_PLAYER_LOGIN_QUERY
};
enum PlayerDelayedOperations
@@ -895,6 +896,16 @@ enum PlayerRestState
REST_STATE_RAF_LINKED = 0x06
};
+enum PlayerCommandStates
+{
+ CHEAT_NONE = 0x00,
+ CHEAT_GOD = 0x01,
+ CHEAT_CASTTIME = 0x02,
+ CHEAT_COOLDOWN = 0x04,
+ CHEAT_POWER = 0x08,
+ CHEAT_WATERWALK = 0x10
+};
+
class PlayerTaxi
{
public:
@@ -980,7 +991,7 @@ class TradeData
public: // constructors
TradeData(Player* player, Player* trader) :
m_player(player), m_trader(trader), m_accepted(false), m_acceptProccess(false),
- m_money(0), m_spell(0) {}
+ m_money(0), m_spell(0), m_spellCastItem(0) { memset(m_items, 0, TRADE_SLOT_COUNT * sizeof(uint64)); }
Player* GetTrader() const { return m_trader; }
TradeData* GetTraderData() const;
@@ -1068,9 +1079,6 @@ class Player : public Unit, public GridObject<Player>
void CleanupsBeforeDelete(bool finalCleanup = true);
- static UpdateMask updateVisualBits;
- static void InitVisibleBits();
-
void AddToWorld();
void RemoveFromWorld();
@@ -1150,6 +1158,11 @@ class Player : public Unit, public GridObject<Player>
void InitStatsForLevel(bool reapplyMods = false);
+ // .cheat command related
+ bool GetCommandStatus(uint32 command) const { return _activeCheats & command; }
+ void SetCommandStatusOn(uint32 command) { _activeCheats |= command; }
+ void SetCommandStatusOff(uint32 command) { _activeCheats &= ~command; }
+
// Played Time Stuff
time_t m_logintime;
time_t m_Last_tick;
@@ -2052,9 +2065,9 @@ class Player : public Unit, public GridObject<Player>
inline SpellCooldowns GetSpellCooldowns() const { return m_spellCooldowns; }
- void SetDrunkValue(uint16 newDrunkValue, uint32 itemid=0);
- uint16 GetDrunkValue() const { return m_drunk; }
- static DrunkenState GetDrunkenstateByValue(uint16 value);
+ void SetDrunkValue(uint8 newDrunkValue, uint32 itemId = 0);
+ uint8 GetDrunkValue() const { return GetByteValue(PLAYER_BYTES_3, 1); }
+ static DrunkenState GetDrunkenstateByValue(uint8 value);
uint32 GetDeathTimer() const { return m_deathTimer; }
uint32 GetCorpseReclaimDelay(bool pvp) const;
@@ -2419,9 +2432,9 @@ class Player : public Unit, public GridObject<Player>
Player* GetNextRandomRaidMember(float radius);
PartyResult CanUninviteFromGroup() const;
- // Battleground Group System
- void SetBattlegroundRaid(Group* group, int8 subgroup = -1);
- void RemoveFromBattlegroundRaid();
+ // Battleground / Battlefield Group System
+ void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1);
+ void RemoveFromBattlegroundOrBattlefieldRaid();
Group* GetOriginalGroup() { return m_originalGroup.getTarget(); }
GroupReference& GetOriginalGroupRef() { return m_originalGroup; }
uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); }
@@ -2459,9 +2472,14 @@ class Player : public Unit, public GridObject<Player>
void AddRunePower(uint8 index);
void InitRunes();
- AchievementMgr& GetAchievementMgr() { return m_achievementMgr; }
- AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; }
+ void SendRespondInspectAchievements(Player* player) const;
+ bool HasAchieved(uint32 achievementId) const;
+ void ResetAchievements();
+ void CheckAllAchievementCriteria();
+ void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, bool evenIfCriteriaComplete = false);
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
+ void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0);
+ void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry);
void CompletedAchievement(AchievementEntry const* entry);
bool HasTitle(uint32 bitIndex);
@@ -2619,9 +2637,6 @@ class Player : public Unit, public GridObject<Player>
void _SaveStats(SQLTransaction& trans);
void _SaveInstanceTimeRestrictions(SQLTransaction& trans);
- void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
- void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
-
/*********************************************************/
/*** ENVIRONMENTAL SYSTEM ***/
/*********************************************************/
@@ -2725,7 +2740,6 @@ class Player : public Unit, public GridObject<Player>
time_t m_lastDailyQuestTime;
uint32 m_drunkTimer;
- uint16 m_drunk;
uint32 m_weaponChangeTimer;
uint32 m_zoneUpdateId;
@@ -2860,6 +2874,8 @@ class Player : public Unit, public GridObject<Player>
InstanceTimeMap _instanceResetTimes;
uint32 _pendingBindId;
uint32 _pendingBindTimer;
+
+ uint32 _activeCheats;
};
void AddItemsSetItem(Player*player, Item* item);
diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h
index 3c7d13070fa..99a40d6110f 100755
--- a/src/server/game/Entities/Player/SocialMgr.h
+++ b/src/server/game/Entities/Player/SocialMgr.h
@@ -54,24 +54,12 @@ struct FriendInfo
uint8 Class;
std::string Note;
- FriendInfo()
+ FriendInfo() : Status(FRIEND_STATUS_OFFLINE), Flags(0), Area(0), Level(0), Class(0), Note()
{
- Status = FRIEND_STATUS_OFFLINE;
- Flags = 0;
- Area = 0;
- Level = 0;
- Class = 0;
- Note = "";
}
- FriendInfo(uint8 flags, const std::string& note)
+ FriendInfo(uint8 flags, const std::string& note) : Status(FRIEND_STATUS_OFFLINE), Flags(flags), Area(0), Level(0), Class(0), Note(note)
{
- Status = FRIEND_STATUS_OFFLINE;
- Flags = flags;
- Area = 0;
- Level = 0;
- Class = 0;
- Note = note;
}
};
diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp
index 80c5de35e59..d5d1bd99277 100755
--- a/src/server/game/Entities/Totem/Totem.cpp
+++ b/src/server/game/Entities/Totem/Totem.cpp
@@ -86,7 +86,7 @@ void Totem::InitStats(uint32 duration)
void Totem::InitSummon()
{
- if (m_type == TOTEM_PASSIVE)
+ if (m_type == TOTEM_PASSIVE && GetSpell())
{
CastSpell(this, GetSpell(), true);
}
@@ -96,10 +96,16 @@ void Totem::InitSummon()
CastSpell(this, GetSpell(1), true);
}
-void Totem::UnSummon()
+void Totem::UnSummon(uint32 msTime)
{
+ if (msTime)
+ {
+ m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime));
+ return;
+ }
+
CombatStop();
- RemoveAurasDueToSpell(GetSpell());
+ RemoveAurasDueToSpell(GetSpell(), GetGUID());
// clear owner's totem slot
for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
@@ -111,7 +117,11 @@ void Totem::UnSummon()
}
}
- m_owner->RemoveAurasDueToSpell(GetSpell());
+ m_owner->RemoveAurasDueToSpell(GetSpell(), GetGUID());
+
+ // Remove Sentry Totem Aura
+ if (GetEntry() == SENTRY_TOTEM_ENTRY)
+ m_owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID);
//remove aura all party members too
if (Player* owner = m_owner->ToPlayer())
@@ -127,7 +137,7 @@ void Totem::UnSummon()
{
Player* target = itr->getSource();
if (target && group->SameSubGroup(owner, target))
- target->RemoveAurasDueToSpell(GetSpell());
+ target->RemoveAurasDueToSpell(GetSpell(), GetGUID());
}
}
}
diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h
index c33b8776660..6271253498d 100755
--- a/src/server/game/Entities/Totem/Totem.h
+++ b/src/server/game/Entities/Totem/Totem.h
@@ -27,8 +27,10 @@ enum TotemType
TOTEM_ACTIVE = 1,
TOTEM_STATUE = 2 // copied straight from MaNGOS, may need more implementation to work
};
+// Some Totems cast spells that are not in creature DB
+#define SENTRY_TOTEM_SPELLID 6495
-#define SENTRY_TOTEM_ENTRY 3968
+#define SENTRY_TOTEM_ENTRY 3968
class Totem : public Minion
{
@@ -38,7 +40,7 @@ class Totem : public Minion
void Update(uint32 time);
void InitStats(uint32 duration);
void InitSummon();
- void UnSummon();
+ void UnSummon(uint32 msTime = 0);
uint32 GetSpell(uint8 slot = 0) const { return m_spells[slot]; }
uint32 GetTotemDuration() const { return m_duration; }
void SetTotemDuration(uint32 duration) { m_duration = duration; }
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index 95c6d308626..558fdd72a95 100755
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -35,8 +35,7 @@ void MapManager::LoadTransports()
if (!result)
{
- sLog->outString(">> Loaded 0 transports. DB table `transports` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 transports. DB table `transports` is empty!");
return;
}
@@ -56,17 +55,17 @@ void MapManager::LoadTransports()
if (!goinfo)
{
- sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
continue;
}
if (goinfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
{
- sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
continue;
}
- // sLog->outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
+ // sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
std::set<uint32> mapsUsed;
@@ -74,7 +73,7 @@ void MapManager::LoadTransports()
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
- sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
+ sLog->outError(LOG_FILTER_SQL, "Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
delete t;
continue;
}
@@ -116,13 +115,12 @@ void MapManager::LoadTransports()
uint32 guid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
std::string name = fields[2].GetString();
- sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports must not have any records in `gameobject` or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid);
+ sLog->outError(LOG_FILTER_SQL, "Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports must not have any records in `gameobject` or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid);
}
while (result->NextRow());
}
- sLog->outString(">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void MapManager::LoadTransportNPCs()
@@ -134,8 +132,7 @@ void MapManager::LoadTransportNPCs()
if (!result)
{
- sLog->outString(">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!");
return;
}
@@ -166,8 +163,7 @@ void MapManager::LoadTransportNPCs()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0),
@@ -197,7 +193,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!IsPositionValid())
{
- sLog->outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_TRANSPORTS, "Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow, x, y);
return false;
}
@@ -208,7 +204,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!goinfo)
{
- sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
+ sLog->outError(LOG_FILTER_SQL, "Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
return false;
}
@@ -354,7 +350,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
}
// for (int i = 0; i < keyFrames.size(); ++i) {
- // sLog->outString("%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
// }
// Now we're completely set up; we can move along the length of each waypoint at 100 ms intervals
@@ -397,7 +393,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
cM = keyFrames[i].node->mapid;
}
- // sLog->outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
if (teleport)
m_WayPoints[t] = WayPoint(keyFrames[i].node->mapid, newX, newY, newZ, teleport, 0);
}
@@ -445,14 +441,14 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
m_WayPoints[t] = WayPoint(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport,
0, keyFrames[i + 1].node->arrivalEventID, keyFrames[i + 1].node->departureEventID);
- // sLog->outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
t += keyFrames[i + 1].node->delay * 1000;
}
uint32 timer = t;
- // sLog->outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, " Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
m_curr = m_WayPoints.begin();
m_next = GetNextWayPoint();
@@ -511,7 +507,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
bool Transport::AddPassenger(Player* passenger)
{
if (m_passengers.insert(passenger).second)
- sLog->outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, "Player %s boarded transport %s.", passenger->GetName(), GetName());
sScriptMgr->OnAddPassenger(this, passenger);
return true;
@@ -520,7 +516,7 @@ bool Transport::AddPassenger(Player* passenger)
bool Transport::RemovePassenger(Player* passenger)
{
if (m_passengers.erase(passenger))
- sLog->outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName());
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, "Player %s removed from transport %s.", passenger->GetName(), GetName());
sScriptMgr->OnRemovePassenger(this, passenger);
return true;
@@ -531,7 +527,7 @@ void Transport::Update(uint32 p_diff)
if (!AI())
{
if (!AIM_Initialize())
- sLog->outError("Could not initialize GameObjectAI for Transport");
+ sLog->outError(LOG_FILTER_TRANSPORTS, "Could not initialize GameObjectAI for Transport");
} else
AI()->UpdateAI(p_diff);
@@ -660,7 +656,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
if (!creature->IsPositionValid())
{
- sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY());
+ sLog->outError(LOG_FILTER_TRANSPORTS, "Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY());
delete creature;
return 0;
}
@@ -708,17 +704,15 @@ void Transport::UpdateNPCPositions()
}
}
-//! This method transforms supplied transport offsets into global coordinates
void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o)
{
float inx = x, iny = y, inz = z, ino = o;
o = GetOrientation() + ino;
- x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI));
- y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation()));
+ x = GetPositionX() + inx * cos(GetOrientation()) - iny * sin(GetOrientation());
+ y = GetPositionY() + iny * cos(GetOrientation()) + inx * sin(GetOrientation());
z = GetPositionZ() + inz;
}
-//! This method transforms supplied global coordinates into local offsets
void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o)
{
o -= GetOrientation();
@@ -726,6 +720,6 @@ void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o)
y -= GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o)
x -= GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi)
float inx = x, iny = y;
- y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) - sin(GetOrientation() + M_PI) * tan(GetOrientation()));
- x = (inx - iny * sin(GetOrientation() + M_PI) / cos(GetOrientation())) / (cos(GetOrientation()) - tan(GetOrientation()) * sin(GetOrientation() + M_PI));
+ y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) + sin(GetOrientation()) * tan(GetOrientation()));
+ x = (inx + iny * tan(GetOrientation())) / (cos(GetOrientation()) + sin(GetOrientation()) * tan(GetOrientation()));
}
diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h
index 4b0c42c9071..8fd12b50695 100755
--- a/src/server/game/Entities/Transport/Transport.h
+++ b/src/server/game/Entities/Transport/Transport.h
@@ -20,12 +20,13 @@
#define TRANSPORTS_H
#include "GameObject.h"
+#include "VehicleDefines.h"
#include <map>
#include <set>
#include <string>
-class Transport : public GameObject
+class Transport : public GameObject, public TransportBase
{
public:
Transport(uint32 period, uint32 script);
@@ -47,8 +48,13 @@ class Transport : public GameObject
uint32 AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim=0);
void UpdatePosition(MovementInfo* mi);
void UpdateNPCPositions();
+
+ /// This method transforms supplied transport offsets into global coordinates
void CalculatePassengerPosition(float& x, float& y, float& z, float& o);
+
+ /// This method transforms supplied global coordinates into local offsets
void CalculatePassengerOffset(float& x, float& y, float& z, float& o);
+
void BuildStartMovePacket(Map const* targetMap);
void BuildStopMovePacket(Map const* targetMap);
uint32 GetScriptId() const { return ScriptId; }
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index d8165f3e6c9..555ecef35c3 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -56,6 +56,9 @@
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "ConditionMgr.h"
+#include "UpdateFieldFlags.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
#include <math.h>
@@ -151,12 +154,26 @@ _hitMask(hitMask), _spell(spell), _damageInfo(damageInfo), _healInfo(healInfo)
#ifdef _MSC_VER
#pragma warning(disable:4355)
#endif
-Unit::Unit(bool isWorldObject): WorldObject(isWorldObject),
-m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false),
-m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL),
-i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this),
-m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
-m_HostileRefManager(this)
+Unit::Unit(bool isWorldObject): WorldObject(isWorldObject)
+ , m_movedPlayer(NULL)
+ , m_lastSanctuaryTime(0)
+ , m_TempSpeed(0.0f)
+ , IsAIEnabled(false)
+ , NeedChangeAI(false)
+ , m_ControlledByPlayer(false)
+ , movespline(new Movement::MoveSpline())
+ , i_AI(NULL)
+ , i_disabledAI(NULL)
+ , m_AutoRepeatFirstCast(false)
+ , m_procDeep(0)
+ , m_removedAurasCount(0)
+ , i_motionMaster(this)
+ , m_ThreatManager(this)
+ , m_vehicle(NULL)
+ , m_vehicleKit(NULL)
+ , m_unitTypeMask(UNIT_MASK_NONE)
+ , m_HostileRefManager(this)
+ , _lastDamagedTime(0)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -251,8 +268,8 @@ m_HostileRefManager(this)
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
_focusSpell = NULL;
- _targetLocked = false;
_lastLiquid = NULL;
+ _isWalkingBeforeCharm = false;
}
////////////////////////////////////////////////////////////
@@ -377,9 +394,7 @@ void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed)
void Unit::UpdateSplineMovement(uint32 t_diff)
{
- enum{
- POSITION_UPDATE_DELAY = 400,
- };
+ uint32 const positionUpdateDelay = 400;
if (movespline->Finalized())
return;
@@ -393,7 +408,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff)
m_movesplineTimer.Update(t_diff);
if (m_movesplineTimer.Passed() || arrived)
{
- m_movesplineTimer.Reset(POSITION_UPDATE_DELAY);
+ m_movesplineTimer.Reset(positionUpdateDelay);
Movement::Location loc = movespline->ComputePosition();
if (HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
@@ -403,17 +418,14 @@ void Unit::UpdateSplineMovement(uint32 t_diff)
pos.m_positionY = loc.y;
pos.m_positionZ = loc.z;
pos.m_orientation = loc.orientation;
- if (Unit* vehicle = GetVehicleBase())
- {
- loc.x += vehicle->GetPositionX();
- loc.y += vehicle->GetPositionY();
- loc.z += vehicle->GetPositionZMinusOffset();
- loc.orientation = vehicle->GetOrientation();
- }
- else if (Transport* trans = GetTransport())
- trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
+
+ if (TransportBase* transport = GetDirectTransport())
+ transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
}
+ if (HasUnitState(UNIT_STATE_CANNOT_TURN))
+ loc.orientation = GetOrientation();
+
UpdatePosition(loc.x, loc.y, loc.z, loc.orientation);
}
}
@@ -527,13 +539,7 @@ void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb)
if (absorb)
*absorb += damage;
damage = 0;
- return;
}
-
- uint32 originalDamage = damage;
-
- if (absorb && originalDamage > damage)
- *absorb += (originalDamage - damage);
}
uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellInfo const* spellProto, bool durabilityLoss)
@@ -544,9 +550,12 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
if (IsAIEnabled)
GetAI()->DamageDealt(victim, damage, damagetype);
- // Signal to pets that their owner was attacked
if (victim->GetTypeId() == TYPEID_PLAYER)
{
+ if (victim->ToPlayer()->GetCommandStatus(CHEAT_GOD))
+ return 0;
+
+ // Signal to pets that their owner was attacked
Pet* pet = victim->ToPlayer()->GetPet();
if (pet && pet->isAlive())
@@ -634,10 +643,10 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
return 0;
}
- sLog->outStaticDebug("DealDamageStart");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageStart");
uint32 health = victim->GetHealth();
- sLog->outDetail("deal dmg:%d to health:%d ", damage, health);
+ sLog->outInfo(LOG_FILTER_UNITS, "deal dmg:%d to health:%d ", damage, health);
// duel ends when player has 1 or less hp
bool duel_hasEnded = false;
@@ -691,7 +700,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
if (health <= damage)
{
- sLog->outStaticDebug("DealDamage: victim just died");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamage: victim just died");
if (victim->GetTypeId() == TYPEID_PLAYER && victim != this)
{
@@ -699,14 +708,14 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
// call before auras are removed
if (Player* killer = GetCharmerOrOwnerPlayerOrPlayerItself())
- killer->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim);
+ killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim);
}
Kill(victim, durabilityLoss);
}
else
{
- sLog->outStaticDebug("DealDamageAlive");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageAlive");
if (victim->GetTypeId() == TYPEID_PLAYER)
victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage);
@@ -790,7 +799,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
}
}
- sLog->outStaticDebug("DealDamageEnd returned %d damage", damage);
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageEnd returned %d damage", damage);
return damage;
}
@@ -806,15 +815,10 @@ void Unit::CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo
{
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
- // TODO: this is a workaround and needs removal
- if (!originalCaster && GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem() && IsControlledByPlayer())
- if (Unit* owner = GetOwner())
- originalCaster=owner->GetGUID();
-
// TODO: this is a workaround - not needed anymore, but required for some scripts :(
if (!originalCaster && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
@@ -839,7 +843,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
@@ -867,28 +871,35 @@ void Unit::CastCustomSpell(Unit* target, uint32 spellId, int32 const* bp0, int32
values.AddSpellMod(SPELLVALUE_BASE_POINT1, *bp1);
if (bp2)
values.AddSpellMod(SPELLVALUE_BASE_POINT2, *bp2);
- CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
+ CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
{
CustomSpellValues values;
values.AddSpellMod(mod, value);
- CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
+ CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
-void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
+void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
+{
+ CustomSpellValues values;
+ values.AddSpellMod(mod, value);
+ CastCustomSpell(spellId, values, target, triggerFlags, castItem, triggeredByAura, originalCaster);
+}
+
+void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
SpellCastTargets targets;
targets.SetUnitTarget(victim);
- CastSpell(targets, spellInfo, &value, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
+ CastSpell(targets, spellInfo, &value, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
@@ -896,7 +907,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
SpellCastTargets targets;
@@ -910,7 +921,7 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
SpellCastTargets targets;
@@ -1759,8 +1770,10 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(), next; (itr != vSplitDamagePctCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
{
// Check if aura was removed during iteration - we don't need to work on such auras
- if (!((*itr)->GetBase()->IsAppliedOnTarget(victim->GetGUID())))
+ AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(victim->GetGUID());
+ if (!aurApp)
continue;
+
// check damage school mask
if (!((*itr)->GetMiscValue() & schoolMask))
continue;
@@ -1770,13 +1783,14 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->isAlive())
continue;
- int32 splitDamage = CalculatePctN(dmgInfo.GetDamage(), (*itr)->GetAmount());
+ uint32 splitDamage = CalculatePctN(dmgInfo.GetDamage(), (*itr)->GetAmount());
+
+ (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, dmgInfo, splitDamage);
// absorb must be smaller than the damage itself
- splitDamage = RoundToInterval(splitDamage, 0, int32(dmgInfo.GetDamage()));
+ splitDamage = RoundToInterval(splitDamage, uint32(0), uint32(dmgInfo.GetDamage()));
dmgInfo.AbsorbDamage(splitDamage);
-
uint32 splitted = splitDamage;
uint32 split_absorb = 0;
DealDamageMods(caster, splitted, &split_absorb);
@@ -1891,10 +1905,10 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext
DealMeleeDamage(&damageInfo, true);
if (GetTypeId() == TYPEID_PLAYER)
- sLog->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
+ sLog->outDebug(LOG_FILTER_UNITS, "AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
else
- sLog->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
+ sLog->outDebug(LOG_FILTER_UNITS, "AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
}
}
@@ -1925,7 +1939,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
float parry_chance = victim->GetUnitParryChance();
// Useful if want to specify crit & miss chances for melee, else it could be removed
- sLog->outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
+ sLog->outDebug(LOG_FILTER_UNITS, "MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
return RollMeleeOutcomeAgainst(victim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100), int32(parry_chance*100), int32(block_chance*100));
}
@@ -1946,22 +1960,22 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
int32 sum = 0, tmp = 0;
int32 roll = urand (0, 10000);
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance);
tmp = miss_chance;
if (tmp > 0 && roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: MISS");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: MISS");
return MELEE_HIT_MISS;
}
// always crit against a sitting target (except 0 crit chance)
if (victim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !victim->IsStandState())
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRIT (sitting victim)");
return MELEE_HIT_CRIT;
}
@@ -1970,7 +1984,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
// only players can't dodge if attacker is behind
if (victim->GetTypeId() == TYPEID_PLAYER && !victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
}
else
{
@@ -1989,7 +2003,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
&& ((tmp -= skillBonus) > 0)
&& roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum);
return MELEE_HIT_DODGE;
}
}
@@ -1998,7 +2012,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
// check if attack comes from behind, nobody can parry or block if attacker is behind
if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind.");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: attack came from behind.");
else
{
// Reduce parry chance by attacker expertise rating
@@ -2014,7 +2028,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
&& (tmp2 -= skillBonus) > 0
&& roll < (sum += tmp2))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
return MELEE_HIT_PARRY;
}
}
@@ -2026,7 +2040,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
&& (tmp -= skillBonus) > 0
&& roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
return MELEE_HIT_BLOCK;
}
}
@@ -2037,9 +2051,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
if (tmp > 0 && roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRIT DISABLED)");
else
return MELEE_HIT_CRIT;
}
@@ -2059,7 +2073,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
tmp = tmp > 4000 ? 4000 : tmp;
if (roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum);
return MELEE_HIT_GLANCING;
}
}
@@ -2083,13 +2097,13 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
tmp = tmp * 200 - 1500;
if (roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum);
return MELEE_HIT_CRUSHING;
}
}
}
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: NORMAL");
return MELEE_HIT_NORMAL;
}
@@ -2154,7 +2168,7 @@ void Unit::SendMeleeAttackStart(Unit* victim)
data << uint64(GetGUID());
data << uint64(victim->GetGUID());
SendMessageToSet(&data, true);
- sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
+ sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sent SMSG_ATTACKSTART");
}
void Unit::SendMeleeAttackStop(Unit* victim)
@@ -2164,12 +2178,12 @@ void Unit::SendMeleeAttackStop(Unit* victim)
data.append(victim ? victim->GetPackGUID() : 0);
data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation
SendMessageToSet(&data, true);
- sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP");
+ sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sent SMSG_ATTACKSTOP");
if (victim)
- sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_UNITS, "%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
else
- sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_UNITS, "%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());
}
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
@@ -2339,7 +2353,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
case MELEE_HIT_BLOCK: canBlock = false; break;
case MELEE_HIT_PARRY: canParry = false; break;
default:
- sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
+ sLog->outDebug(LOG_FILTER_UNITS, "Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
break;
}
}
@@ -2465,12 +2479,12 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell)
// Chance resist debuff
if (!spell->IsPositive())
{
- bool bNegativeAura = false;
+ bool bNegativeAura = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
- if (spell->Effects[i].ApplyAuraName != 0)
+ if (spell->Effects[i].ApplyAuraName == 0)
{
- bNegativeAura = true;
+ bNegativeAura = false;
break;
}
}
@@ -3602,87 +3616,6 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
// Call AfterDispel hook on AuraScript
aura->CallScriptAfterDispel(&dispelInfo);
- switch (aura->GetSpellInfo()->SpellFamilyName)
- {
- case SPELLFAMILY_WARLOCK:
- {
- // Unstable Affliction (crash if before removeaura?)
- if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x0100)
- {
- Unit* caster = aura->GetCaster();
- if (!caster)
- break;
- if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_0))
- {
- int32 damage = aurEff->GetAmount() * 9;
- // backfire damage and silence
- caster->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, aurEff);
- }
- }
- break;
- }
- case SPELLFAMILY_DRUID:
- {
- // Lifebloom
- if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x10)
- {
- if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_1))
- {
- // final heal
- int32 healAmount = aurEff->GetAmount();
- if (Unit* caster = aura->GetCaster())
- {
- healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges());
- healAmount = this->SpellHealingBonusTaken(caster, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges());
- }
- CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
-
- // mana
- if (Unit* caster = aura->GetCaster())
- {
- int32 mana = CalculatePctU(caster->GetCreateMana(), aura->GetSpellInfo()->ManaCostPercentage) * chargesRemoved / 2;
- caster->CastCustomSpell(caster, 64372, &mana, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
- }
- }
- }
- break;
- }
- case SPELLFAMILY_SHAMAN:
- {
- // Flame Shock
- if (aura->GetSpellInfo()->SpellFamilyFlags[0] & 0x10000000)
- {
- if (Unit* caster = aura->GetCaster())
- {
- uint32 triggeredSpellId = 0;
- // Lava Flows
- if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 3087, 0))
- {
- switch (aurEff->GetId())
- {
- case 51482: // Rank 3
- triggeredSpellId = 65264;
- break;
- case 51481: // Rank 2
- triggeredSpellId = 65263;
- break;
- case 51480: // Rank 1
- triggeredSpellId = 64694;
- break;
- default:
- sLog->outError("Unit::RemoveAurasDueToSpellByDispel: Unknown rank of Lava Flows (%d) found", aurEff->GetId());
- }
- }
-
- if (triggeredSpellId)
- caster->CastSpell(caster, triggeredSpellId, true);
- }
- }
- break;
- }
- default:
- break;
- }
return;
}
else
@@ -4384,11 +4317,16 @@ uint32 Unit::GetDoTsByCaster(uint64 casterGUID) const
int32 Unit::GetTotalAuraModifier(AuraType auratype) const
{
+ std::map<SpellGroup, int32> SameEffectSpellGroup;
int32 modifier = 0;
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
- modifier += (*i)->GetAmount();
+ if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup))
+ modifier += (*i)->GetAmount();
+
+ for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr)
+ modifier += itr->second;
return modifier;
}
@@ -4432,14 +4370,19 @@ int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const
int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
{
+ std::map<SpellGroup, int32> SameEffectSpellGroup;
int32 modifier = 0;
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
+
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
- {
- if ((*i)->GetMiscValue()& misc_mask)
- modifier += (*i)->GetAmount();
- }
+ if ((*i)->GetMiscValue() & misc_mask)
+ if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup))
+ modifier += (*i)->GetAmount();
+
+ for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr)
+ modifier += itr->second;
+
return modifier;
}
@@ -4860,7 +4803,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
data << float(pInfo->multiplier); // gain multiplier
break;
default:
- sLog->outError("Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
+ sLog->outError(LOG_FILTER_UNITS, "Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
return;
}
@@ -5021,7 +4964,7 @@ bool Unit::HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!triggerEntry)
{
- sLog->outError("Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", hasteSpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", hasteSpell->Id, triggered_spell_id);
return false;
}
@@ -5079,7 +5022,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf
if (!triggerEntry)
{
- sLog->outError("Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id);
return false;
}
@@ -5721,7 +5664,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 31571: triggered_spell_id = 57529; break;
case 31572: triggered_spell_id = 57531; break;
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u", dummySpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u", dummySpell->Id);
return false;
}
break;
@@ -5807,7 +5750,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 12847: basepoints0 = int32(0.16f * damage); break;
case 12848: basepoints0 = int32(0.20f * damage); break;
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id);
return false;
}
@@ -5925,7 +5868,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 29834: triggered_spell_id=29841; break;
case 42770: triggered_spell_id=42771; break;
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
return false;
}
@@ -6509,30 +6452,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
basepoints0 = CalculatePctN(int32(damage), triggerAmount);
break;
}
- // King of the Jungle
- else if (dummySpell->SpellIconID == 2850)
- {
- // Effect 0 - mod damage while having Enrage
- if (effIndex == 0)
- {
- if (!(procSpell->SpellFamilyFlags[0] & 0x00080000))
- return false;
- triggered_spell_id = 51185;
- basepoints0 = triggerAmount;
- target = this;
- break;
- }
- // Effect 1 - Tiger's Fury restore energy
- else if (effIndex == 1)
- {
- if (!(procSpell->SpellFamilyFlags[2] & 0x00000800))
- return false;
- triggered_spell_id = 51178;
- basepoints0 = triggerAmount;
- target = this;
- break;
- }
- }
break;
}
case SPELLFAMILY_ROGUE:
@@ -6714,24 +6633,49 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Light's Beacon - Beacon of Light
if (dummySpell->Id == 53651)
{
- // Get target of beacon of light
- if (Unit* beaconTarget = triggeredByAura->GetBase()->GetCaster())
+ if (!victim)
+ return false;
+ triggered_spell_id = 0;
+ Unit* beaconTarget = NULL;
+ if (this->GetTypeId() != TYPEID_PLAYER)
{
- // do not proc when target of beacon of light is healed
- if (beaconTarget == this)
+ beaconTarget = triggeredByAura->GetBase()->GetCaster();
+ if (beaconTarget == this || !(beaconTarget->GetAura(53563, victim->GetGUID())))
return false;
- // check if it was heal by paladin which casted this beacon of light
- if (beaconTarget->GetAura(53563, victim->GetGUID()))
+ basepoints0 = int32(damage);
+ triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(365)) ? 53652 : 53654;
+ }
+ else
+ { // Check Party/Raid Group
+ if (Group *group = this->ToPlayer()->GetGroup())
{
- if (beaconTarget->IsWithinLOSInMap(victim))
+ for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
- basepoints0 = damage;
- victim->CastCustomSpell(beaconTarget, 53654, &basepoints0, NULL, NULL, true);
- return true;
+ Player* Member = itr->getSource();
+
+ // check if it was heal by paladin which casted this beacon of light
+ if (Aura const * aura = Member->GetAura(53563, victim->GetGUID()))
+ {
+ // do not proc when target of beacon of light is healed
+ if (Member == this)
+ return false;
+
+ beaconTarget = Member;
+ basepoints0 = int32(damage);
+ triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(365)) ? 53652 : 53654;
+ break;
+ }
}
}
}
- return false;
+
+ if (triggered_spell_id && beaconTarget)
+ {
+ victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura);
+ return true;
+ }
+ else
+ return false;
}
// Judgements of the Wise
if (dummySpell->SpellIconID == 3017)
@@ -6751,34 +6695,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura);
return true;
}
- // Sacred Shield
- if (dummySpell->SpellFamilyFlags[1] & 0x80000)
- {
- if (procFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS)
- {
- if (procSpell->SpellFamilyName == SPELLFAMILY_PALADIN && (procSpell->SpellFamilyFlags[0] & 0x40000000))
- {
- basepoints0 = damage / 12;
-
- if (basepoints0)
- CastCustomSpell(this, 66922, &basepoints0, NULL, NULL, true, 0, triggeredByAura, victim->GetGUID());
-
- return true;
- }
- else
- return false;
- }
- else if (damage > 0)
- triggered_spell_id = 58597;
-
- // Item - Paladin T8 Holy 4P Bonus
- if (Unit* caster = triggeredByAura->GetCaster())
- if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
- cooldown = aurEff->GetAmount();
-
- target = this;
- break;
- }
// Righteous Vengeance
if (dummySpell->SpellIconID == 3025)
{
@@ -6799,6 +6715,23 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
switch (dummySpell->Id)
{
+ // Sacred Shield
+ case 53601:
+ {
+ if (procFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS)
+ return false;
+
+ if (damage > 0)
+ triggered_spell_id = 58597;
+
+ // Item - Paladin T8 Holy 4P Bonus
+ if (Unit* caster = triggeredByAura->GetCaster())
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
+ cooldown = aurEff->GetAmount();
+
+ target = this;
+ break;
+ }
// Heart of the Crusader
case 20335: // rank 1
triggered_spell_id = 21183;
@@ -6812,10 +6745,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Judgement of Light
case 20185:
{
- // 2% of base mana
- basepoints0 = int32(victim->CountPctFromMaxHealth(2));
- victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
- return true;
+ if (!victim)
+ return false;
+
+ // 2% of maximum health
+ basepoints0 = int32(victim->CountPctFromMaxHealth(2));
+ victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
+ return true;
}
// Judgement of Wisdom
case 20186:
@@ -7161,7 +7097,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 3787:spellId = 58804; break; // 8 Rank
default:
{
- sLog->outError("Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)), dummySpell->Id);
return false;
}
@@ -7170,7 +7106,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!windfurySpellInfo)
{
- sLog->outError("Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
return false;
}
@@ -7500,7 +7436,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 49270: spellId = 49268; break; // Rank 7
case 49271: spellId = 49269; break; // Rank 8
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
return false;
}
@@ -7814,7 +7750,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!triggerEntry)
{
- sLog->outError("Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -7872,7 +7808,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffec
// Try handle unknown trigger spells
if (!triggerEntry)
{
- sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleObsModEnergyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -7925,7 +7861,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura
if (!triggerEntry)
{
- sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleModDamagePctTakenAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -8292,6 +8228,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
CastSpell(victim, 27526, true, castItem, triggeredByAura);
return true;
}
+ // Evasive Maneuvers
+ case 50240:
+ {
+ // Remove a Evasive Charge
+ Aura* charge = GetAura(50241);
+ if (charge->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL))
+ RemoveAurasDueToSpell(50240);
+ }
}
break;
case SPELLFAMILY_MAGE:
@@ -8304,7 +8248,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
trigger_spell_id = 31643;
break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
return false;
}
}
@@ -8380,7 +8324,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 27815: trigger_spell_id = 27817; break;
case 27816: trigger_spell_id = 27818; break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
return false;
}
basepoints0 = CalculatePctN(int32(damage), triggerAmount) / 3;
@@ -8440,7 +8384,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
trigger_spell_id = 63468;
break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
return false;
}
SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id);
@@ -8553,14 +8497,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 48820: originalSpellId = 48824; break;
case 48821: originalSpellId = 48825; break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
return false;
}
}
SpellInfo const* originalSpell = sSpellMgr->GetSpellInfo(originalSpellId);
if (!originalSpell)
{
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
return false;
}
// percent stored in effect 1 (class scripts) base points
@@ -8714,7 +8658,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (triggerEntry == NULL)
{
// Don't cast unknown spell
- // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
+ // sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
return false;
}
@@ -8946,12 +8890,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
CastSpell(this, 70721, true);
break;
}
- // Bloodthirst (($m/100)% of max health)
- case 23880:
- {
- basepoints0 = int32(CountPctFromMaxHealth(triggerAmount));
- break;
- }
// Shamanistic Rage triggered spell
case 30824:
{
@@ -9229,7 +9167,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
if (!triggerEntry)
{
- sLog->outError("Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
return false;
}
@@ -9296,11 +9234,11 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
if (GetGUID() != guid)
{
if (Player const* player = ToPlayer())
- sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction());
+ sLog->outError(LOG_FILTER_UNITS, "Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction());
else if (Creature const* creature = ToCreature())
- sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
else
- sLog->outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction());
+ sLog->outError(LOG_FILTER_UNITS, "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction());
guid = GetGUID();
}
@@ -9648,7 +9586,7 @@ void Unit::RemoveAllAttackers()
AttackerSet::iterator iter = m_attackers.begin();
if (!(*iter)->AttackStop())
{
- sLog->outError("WORLD: Unit has an attacker that isn't attacking it!");
+ sLog->outError(LOG_FILTER_UNITS, "WORLD: Unit has an attacker that isn't attacking it!");
m_attackers.erase(iter);
}
}
@@ -9748,6 +9686,31 @@ bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit co
return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
}
+void Unit::SetOwnerGUID(uint64 owner)
+{
+ if (GetOwnerGUID() == owner)
+ return;
+
+ SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner);
+ if (!owner)
+ return;
+
+ // Update owner dependent fields
+ Player* player = ObjectAccessor::GetPlayer(*this, owner);
+ if (!player || !player->HaveAtClient(this)) // if player cannot see this unit yet, he will receive needed data with create object
+ return;
+
+ SetFieldNotifyFlag(UF_FLAG_OWNER);
+
+ UpdateData udata;
+ WorldPacket packet;
+ BuildValuesUpdateBlockForPlayer(&udata, player);
+ udata.BuildPacket(&packet);
+ player->SendDirectMessage(&packet);
+
+ RemoveFieldNotifyFlag(UF_FLAG_OWNER);
+}
+
Unit* Unit::GetOwner() const
{
if (uint64 ownerid = GetOwnerGUID())
@@ -9791,7 +9754,7 @@ Minion *Unit::GetFirstMinion() const
if (pet->HasUnitTypeMask(UNIT_MASK_MINION))
return (Minion*)pet;
- sLog->outError("Unit::GetFirstMinion: Minion %u not exist.", GUID_LOPART(pet_guid));
+ sLog->outError(LOG_FILTER_UNITS, "Unit::GetFirstMinion: Minion %u not exist.", GUID_LOPART(pet_guid));
const_cast<Unit*>(this)->SetMinionGUID(0);
}
@@ -9806,7 +9769,7 @@ Guardian* Unit::GetGuardianPet() const
if (pet->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
return (Guardian*)pet;
- sLog->outCrash("Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
const_cast<Unit*>(this)->SetPetGUID(0);
}
@@ -9820,7 +9783,7 @@ Unit* Unit::GetCharm() const
if (Unit* pet = ObjectAccessor::GetUnit(*this, charm_guid))
return pet;
- sLog->outError("Unit::GetCharm: Charmed creature %u not exist.", GUID_LOPART(charm_guid));
+ sLog->outError(LOG_FILTER_UNITS, "Unit::GetCharm: Charmed creature %u not exist.", GUID_LOPART(charm_guid));
const_cast<Unit*>(this)->SetUInt64Value(UNIT_FIELD_CHARM, 0);
}
@@ -9833,12 +9796,14 @@ void Unit::SetMinion(Minion *minion, bool apply)
if (apply)
{
- if (!minion->AddUInt64Value(UNIT_FIELD_SUMMONEDBY, GetGUID()))
+ if (minion->GetOwnerGUID())
{
- sLog->outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
return;
}
+ minion->SetOwnerGUID(GetGUID());
+
m_Controlled.insert(minion);
if (GetTypeId() == TYPEID_PLAYER)
@@ -9907,7 +9872,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
{
if (minion->GetOwnerGUID() != GetGUID())
{
- sLog->outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
return;
}
@@ -10019,7 +9984,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (GetTypeId() == TYPEID_PLAYER)
{
if (!AddUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
- sLog->outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Player %s is trying to charm unit %u, but it already has a charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
charm->m_ControlledByPlayer = true;
// TODO: maybe we can use this flag to check if controlled by player
@@ -10032,9 +9997,10 @@ void Unit::SetCharm(Unit* charm, bool apply)
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
if (!charm->AddUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
- sLog->outCrash("Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
- if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
+ _isWalkingBeforeCharm = charm->IsWalking();
+ if (_isWalkingBeforeCharm)
{
charm->SetWalk(false);
charm->SendMovementFlagUpdate();
@@ -10047,11 +10013,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (GetTypeId() == TYPEID_PLAYER)
{
if (!RemoveUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
- sLog->outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Player %s is trying to uncharm unit %u, but it has another charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
}
if (!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
- sLog->outCrash("Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
if (charm->GetTypeId() == TYPEID_PLAYER)
{
@@ -10072,6 +10038,12 @@ void Unit::SetCharm(Unit* charm, bool apply)
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, 0);
}
+ if (charm->IsWalking() != _isWalkingBeforeCharm)
+ {
+ charm->SetWalk(_isWalkingBeforeCharm);
+ charm->SendMovementFlagUpdate(true); // send packet to self, to update movement state on player.
+ }
+
if (charm->GetTypeId() == TYPEID_PLAYER
|| !charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_MINION)
|| charm->GetOwnerGUID() != GetGUID())
@@ -10104,15 +10076,15 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth)
// use the actual gain, as the overheal shall not be counted, skip gain 0 (it ignored anyway in to criteria)
if (gain)
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim);
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth);
}
if (Player* player = victim->ToPlayer())
{
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain);
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
}
return gain;
@@ -10127,7 +10099,7 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo)
Unit::AuraEffectList const& magnetAuras = victim->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET);
for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
{
- if (Unit* magnet = (*itr)->GetBase()->GetUnitOwner())
+ if (Unit* magnet = (*itr)->GetBase()->GetCaster())
if (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK
&& spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK
&& _IsValidAttackTarget(magnet, spellInfo)
@@ -10185,14 +10157,14 @@ void Unit::RemoveAllControlled()
else if (target->GetOwnerGUID() == GetGUID() && target->isSummon())
target->ToTempSummon()->UnSummon();
else
- sLog->outError("Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
}
if (GetPetGUID())
- sLog->outCrash("Unit %u is not able to release its pet " UI64FMTD, GetEntry(), GetPetGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its pet " UI64FMTD, GetEntry(), GetPetGUID());
if (GetMinionGUID())
- sLog->outCrash("Unit %u is not able to release its minion " UI64FMTD, GetEntry(), GetMinionGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its minion " UI64FMTD, GetEntry(), GetMinionGUID());
if (GetCharmGUID())
- sLog->outCrash("Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID());
}
Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
@@ -10346,6 +10318,10 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
if (!spellProto || !victim || damagetype == DIRECT_DAMAGE)
return pdamage;
+ // Some spells don't benefit from done mods
+ if (spellProto->AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS)
+ return pdamage;
+
// small exception for Deep Wounds, can't find any general rule
// should ignore ALL damage mods, they already calculated in trigger spell
if (spellProto->Id == 12721) // Deep Wounds
@@ -10747,13 +10723,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
- // Some spells don't benefit from done mods
- if (spellProto->AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS)
- {
- DoneTotal = 0;
- DoneTotalMod = 1.0f;
- }
-
float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod;
// apply spellmod to Done damage (flat and pct)
if (Player* modOwner = GetSpellModOwner())
@@ -10769,6 +10738,15 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
int32 TakenTotal = 0;
float TakenTotalMod = 1.0f;
+ float TakenTotalCasterMod = 0.0f;
+
+ // get all auras from caster that allow the spell to ignore resistance (sanctified wrath)
+ AuraEffectList const& IgnoreResistAuras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
+ for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i)
+ {
+ if ((*i)->GetMiscValue() & spellProto->GetSchoolMask())
+ TakenTotalCasterMod += (float((*i)->GetAmount()));
+ }
// from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
// multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085)
@@ -10833,7 +10811,22 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
TakenTotal+= int32(TakenAdvertisedBenefit * coeff * factorMod);
}
- float tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod;
+ float tmpDamage = 0.0f;
+
+ if (TakenTotalCasterMod)
+ {
+ if (TakenTotal < 0)
+ {
+ if (TakenTotalMod < 1)
+ tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenTotal) * TakenTotalMod) + CalculatePctF(pdamage, TakenTotalCasterMod));
+ else
+ tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenTotal) + CalculatePctF(pdamage, TakenTotalCasterMod)) * TakenTotalMod);
+ }
+ else if (TakenTotalMod < 1)
+ tmpDamage = ((CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod));
+ }
+ if (!tmpDamage)
+ tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod;
return uint32(std::max(tmpDamage, 0.0f));
}
@@ -10910,6 +10903,8 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
case 379: // Earth Shield
case 33778: // Lifebloom Final Bloom
case 64844: // Divine Hymn
+ case 71607: // Item - Bauble of True Blood 10m
+ case 71646: // Item - Bauble of True Blood 25m
break;
default:
return false;
@@ -11111,9 +11106,12 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
crit_bonus -= damage;
- // adds additional damage to crit_bonus (from talents)
- if (Player* modOwner = GetSpellModOwner())
- modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus);
+ if (damage > uint32(crit_bonus))
+ {
+ // adds additional damage to critBonus (from talents)
+ if (Player* modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus);
+ }
crit_bonus += damage;
@@ -11278,16 +11276,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
- // Gift of the Naaru
- if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329)
- {
- int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK)));
- if (apBonus > DoneAdvertisedBenefit)
- DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick
- else
- DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick
- }
-
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
switch (spellProto->Effects[i].ApplyAuraName)
@@ -11538,6 +11526,8 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
+ if (!spellInfo->Effects[i].IsEffect())
+ continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immuneToAllEffects = false;
@@ -11783,6 +11773,16 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
return 0;
int32 TakenFlatBenefit = 0;
+ float TakenTotalCasterMod = 0.0f;
+
+ // get all auras from caster that allow the spell to ignore resistance (sanctified wrath)
+ SpellSchoolMask attackSchoolMask = spellProto ? spellProto->GetSchoolMask() : SPELL_SCHOOL_MASK_NORMAL;
+ AuraEffectList const& IgnoreResistAuras = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
+ for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i)
+ {
+ if ((*i)->GetMiscValue() & attackSchoolMask)
+ TakenTotalCasterMod += (float((*i)->GetAmount()));
+ }
// ..taken
AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
@@ -11867,7 +11867,22 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
AddPctN(TakenTotalMod, (*i)->GetAmount());
}
- float tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod;
+ float tmpDamage = 0.0f;
+
+ if (TakenTotalCasterMod)
+ {
+ if (TakenFlatBenefit < 0)
+ {
+ if (TakenTotalMod < 1)
+ tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenFlatBenefit) * TakenTotalMod) + CalculatePctF(pdamage, TakenTotalCasterMod));
+ else
+ tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenFlatBenefit) + CalculatePctF(pdamage, TakenTotalCasterMod)) * TakenTotalMod);
+ }
+ else if (TakenTotalMod < 1)
+ tmpDamage = ((CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod));
+ }
+ if (!tmpDamage)
+ tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod;
// bonus result can be negative
return uint32(std::max(tmpDamage, 0.0f));
@@ -12269,19 +12284,21 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
if (GetReactionTo(target) == REP_NEUTRAL &&
target->GetReactionTo(this) == REP_NEUTRAL)
{
- if (
- !(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
- !(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT)
- )
+ if (!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
+ !(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT))
{
Player const* player = target->GetTypeId() == TYPEID_PLAYER ? target->ToPlayer() : ToPlayer();
Unit const* creature = target->GetTypeId() == TYPEID_UNIT ? target : this;
if (FactionTemplateEntry const* factionTemplate = creature->getFactionTemplateEntry())
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
- if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
- if (!(repState->Flags & FACTION_FLAG_AT_WAR))
- return false;
+ {
+ if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
+ if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
+ if (!(repState->Flags & FACTION_FLAG_AT_WAR))
+ return false;
+
+ }
}
}
@@ -12419,6 +12436,10 @@ int32 Unit::ModifyHealth(int32 dVal)
if (dVal == 0)
return 0;
+ // Part of Evade mechanics. Only track health lost, not gained.
+ if (dVal < 0 && GetTypeId() != TYPEID_PLAYER && !isPet())
+ SetLastDamagedTime(time(NULL));
+
int32 curHealth = (int32)GetHealth();
int32 val = dVal + curHealth;
@@ -12618,7 +12639,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
break;
}
default:
- sLog->outError("Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
return;
}
@@ -12725,7 +12746,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4);
break;
default:
- sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
return;
}
@@ -12776,7 +12797,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16);
break;
default:
- sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
return;
}
data.append(GetPackGUID());
@@ -13039,12 +13060,20 @@ Unit* Creature::SelectVictim()
else
return NULL;
- if (target && _IsTargetAcceptable(target))
+ if (target && _IsTargetAcceptable(target) && canCreatureAttack(target))
{
SetInFront(target);
return target;
}
+ // Case where mob is being kited.
+ // Mob may not be in range to attack or may have dropped target. In any case,
+ // don't evade if damage received within the last 10 seconds
+ // Does not apply to world bosses to prevent kiting to cities
+ if (!isWorldBoss() && !GetInstanceId())
+ if (time(NULL) - GetLastDamagedTime() <= MAX_AGGRO_RESET_TIME)
+ return target;
+
// last case when creature must not go to evade mode:
// it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list
// for example at owner command to pet attack some far away creature
@@ -13065,7 +13094,7 @@ Unit* Creature::SelectVictim()
{
target = SelectNearestTargetInAttackDistance(m_CombatDistance ? m_CombatDistance : ATTACK_DISTANCE);
- if (target && _IsTargetAcceptable(target))
+ if (target && _IsTargetAcceptable(target) && canCreatureAttack(target))
return target;
}
@@ -13221,13 +13250,13 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
}
break;
case SPELLFAMILY_PALADIN:
- if (spellProto->SpellFamilyFlags[0] & 0x00000002)
+ if ((spellProto->SpellFamilyFlags[0] & 0x00000002) && spellProto->SpellIconID == 298)
{
// Glyph of Blessing of Might
if (AuraEffect* aurEff = GetAuraEffect(57958, 0))
duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS;
}
- else if (spellProto->SpellFamilyFlags[0] & 0x00010000)
+ else if ((spellProto->SpellFamilyFlags[0] & 0x00010000) && spellProto->SpellIconID == 306)
{
// Glyph of Blessing of Wisdom
if (AuraEffect* aurEff = GetAuraEffect(57979, 0))
@@ -13247,7 +13276,7 @@ void Unit::ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell);
- if (!(spellProto->Attributes & (SPELL_ATTR0_ABILITY|SPELL_ATTR0_TRADESPELL)) && spellProto->SpellFamilyName)
+ if (!(spellProto->Attributes & (SPELL_ATTR0_ABILITY|SPELL_ATTR0_TRADESPELL)) && ((GetTypeId() == TYPEID_PLAYER && spellProto->SpellFamilyName) || GetTypeId() == TYPEID_UNIT))
castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
else if (spellProto->Attributes & SPELL_ATTR0_REQ_AMMO && !(spellProto->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG))
castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]);
@@ -13434,7 +13463,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
{
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog->outError("ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
+ sLog->outError(LOG_FILTER_UNITS, "ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
return false;
}
@@ -13499,7 +13528,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
{
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog->outError("attempt to access non-existing modifier value from UnitMods!");
+ sLog->outError(LOG_FILTER_UNITS, "attempt to access non-existing modifier value from UnitMods!");
return 0.0f;
}
@@ -13529,7 +13558,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
{
if (unitMod >= UNIT_MOD_END)
{
- sLog->outError("attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
+ sLog->outError(LOG_FILTER_UNITS, "attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
return 0.0f;
}
@@ -13810,7 +13839,7 @@ void Unit::RemoveFromWorld()
if (GetCharmerGUID())
{
- sLog->outCrash("Unit %u has charmer guid when removed from world", GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u has charmer guid when removed from world", GetEntry());
ASSERT(false);
}
@@ -13818,7 +13847,7 @@ void Unit::RemoveFromWorld()
{
if (owner->m_Controlled.find(this) != owner->m_Controlled.end())
{
- sLog->outCrash("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
ASSERT(false);
}
}
@@ -13910,7 +13939,8 @@ void Unit::DeleteCharmInfo()
CharmInfo::CharmInfo(Unit* unit)
: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_petnumber(0), m_barInit(false),
- m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false)
+ m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false),
+ m_stayX(0.0f), m_stayY(0.0f), m_stayZ(0.0f)
{
for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i)
m_charmspells[i].SetActionAndType(0, ACT_DISABLED);
@@ -14348,10 +14378,17 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
continue;
ProcTriggeredData triggerData(itr->second->GetBase());
// Defensive procs are active on absorbs (so absorption effects are not a hindrance)
- bool active = (damage > 0) || (procExtra & (PROC_EX_ABSORB|PROC_EX_BLOCK) && isVictim);
+ bool active = damage || (procExtra & PROC_EX_BLOCK && isVictim);
if (isVictim)
procExtra &= ~PROC_EX_INTERNAL_REQ_FAMILY;
+
SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
+
+ // only auras that has triggered spell should proc from fully absorbed damage
+ if (procExtra & PROC_EX_ABSORB && isVictim)
+ if (damage || spellProto->Effects[EFFECT_0].TriggerSpell || spellProto->Effects[EFFECT_1].TriggerSpell || spellProto->Effects[EFFECT_2].TriggerSpell)
+ active = true;
+
if (!IsTriggeredAtSpellProcEvent(target, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, triggerData.spellProcEvent))
continue;
@@ -14525,6 +14562,11 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
if (procSpell && (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check
takeCharges = true;
break;
+ case SPELL_AURA_SPELL_MAGNET:
+ // Skip Melee hits and targets with magnet aura
+ if (procSpell && (triggeredByAura->GetBase()->GetUnitOwner()->ToUnit() == ToUnit())) // Magnet
+ takeCharges = true;
+ break;
case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT:
case SPELL_AURA_MOD_POWER_COST_SCHOOL:
// Skip melee hits and spells ws wrong school or zero cost
@@ -14758,11 +14800,11 @@ void Unit::StopMoving()
init.Launch();
}
-void Unit::SendMovementFlagUpdate()
+void Unit::SendMovementFlagUpdate(bool self /* = false */)
{
WorldPacket data;
BuildHeartBeatMsg(&data);
- SendMessageToSet(&data, false);
+ SendMessageToSet(&data, self);
}
bool Unit::IsSitState() const
@@ -15242,7 +15284,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
if (!pet->InitStatsForLevel(level))
{
- sLog->outError("Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
return false;
}
@@ -15420,7 +15462,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
damageSpellId = 43594;
break;
default:
- sLog->outError("Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
return false;
}
@@ -15551,7 +15593,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// update get killing blow achievements, must be done before setDeathState to be able to require auras on target
// and before Spirit of Redemption as it also removes auras
if (player)
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim);
// if talent known but not triggered (check priest class for speedup check)
bool spiritOfRedemption = false;
@@ -15582,7 +15624,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
if (!spiritOfRedemption)
{
- sLog->outStaticDebug("SET JUST_DIED");
+ sLog->outDebug(LOG_FILTER_UNITS, "SET JUST_DIED");
victim->setDeathState(JUST_DIED);
}
@@ -15607,7 +15649,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// only if not player and not controlled by player pet. And not at BG
if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
{
- sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
+ sLog->outDebug(LOG_FILTER_UNITS, "We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
// durability lost message
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
@@ -15627,7 +15669,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
}
else // creature died
{
- sLog->outStaticDebug("DealDamageNotPlayer");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageNotPlayer");
if (!creature->isPet())
{
@@ -15679,9 +15721,14 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// outdoor pvp things, do these after setting the death state, else the player activity notify won't work... doh...
// handle player kill only if not suicide (spirit of redemption for example)
if (player && this != victim)
+ {
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
pvp->HandleKill(player, victim);
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
+ bf->HandleKill(player, victim);
+ }
+
//if (victim->GetTypeId() == TYPEID_PLAYER)
// if (OutdoorPvP* pvp = victim->ToPlayer()->GetOutdoorPvP())
// pvp->HandlePlayerActivityChangedpVictim->ToPlayer();
@@ -15702,9 +15749,9 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
if (victim->GetTypeId() == TYPEID_PLAYER)
{
if (GetTypeId() == TYPEID_UNIT)
- victim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, GetEntry());
+ victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, GetEntry());
else if (GetTypeId() == TYPEID_PLAYER && victim != this)
- victim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, ToPlayer()->GetTeam());
+ victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, ToPlayer()->GetTeam());
}
// Hook for OnPVPKill Event
@@ -15962,7 +16009,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (this == charmer)
{
- sLog->outCrash("Unit::SetCharmedBy: Unit %u (GUID %u) is trying to charm itself!", GetEntry(), GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: Unit %u (GUID %u) is trying to charm itself!", GetEntry(), GetGUIDLow());
return false;
}
@@ -15971,14 +16018,14 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport())
{
- sLog->outCrash("Unit::SetCharmedBy: Player on transport is trying to charm %u (GUID %u)", GetEntry(), GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: Player on transport is trying to charm %u (GUID %u)", GetEntry(), GetGUIDLow());
return false;
}
// Already charmed
if (GetCharmerGUID())
{
- sLog->outCrash("Unit::SetCharmedBy: %u (GUID %u) has already been charmed but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: %u (GUID %u) has already been charmed but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
return false;
}
@@ -16003,7 +16050,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
// StopCastingCharm may remove a possessed pet?
if (!IsInWorld())
{
- sLog->outCrash("Unit::SetCharmedBy: %u (GUID %u) is not in world but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: %u (GUID %u) is not in world but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
return false;
}
@@ -16103,7 +16150,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
charmer = GetCharmer();
if (charmer != GetCharmer()) // one aura overrides another?
{
-// sLog->outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
+// sLog->outFatal(LOG_FILTER_UNITS, "Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
// GetGUID(), GetCharmerGUID(), charmer->GetGUID());
// ASSERT(false);
return;
@@ -16134,7 +16181,8 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (Creature* creature = ToCreature())
{
- creature->AI()->OnCharmed(false);
+ if (creature->AI())
+ creature->AI()->OnCharmed(false);
if (type != CHARM_TYPE_VEHICLE) // Vehicles' AI is never modified
{
@@ -16185,7 +16233,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (GetCharmInfo())
GetCharmInfo()->SetPetNumber(0, true);
else
- sLog->outError("Aura::HandleModCharm: target="UI64FMTD" with typeid=%d has a charm aura but no charm info!", GetGUID(), GetTypeId());
+ sLog->outError(LOG_FILTER_UNITS, "Aura::HandleModCharm: target="UI64FMTD" with typeid=%d has a charm aura but no charm info!", GetGUID(), GetTypeId());
}
}
break;
@@ -16277,6 +16325,13 @@ uint64 Unit::GetTransGUID() const
return 0;
}
+TransportBase* Unit::GetDirectTransport() const
+{
+ if (Vehicle* veh = GetVehicle())
+ return veh;
+ return GetTransport();
+}
+
bool Unit::IsInPartyWith(Unit const* unit) const
{
if (this == unit)
@@ -16953,19 +17008,20 @@ void Unit::JumpTo(WorldObject* obj, float speedZ)
bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
{
+ bool result = false;
uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->GetCreatureEntry() : GetEntry();
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
{
//! First check simple relations from clicker to clickee
if (!itr->second.IsFitToRequirements(clicker, this))
- return false;
+ continue;
//! Check database conditions
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(spellClickEntry, itr->second.spellId);
ConditionSourceInfo info = ConditionSourceInfo(clicker, this);
if (!sConditionMgr->IsObjectMeetToConditions(info, conds))
- return false;
+ continue;
Unit* caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this;
Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this;
@@ -16990,12 +17046,12 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
if (!valid)
{
- sLog->outErrorDb("Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
- return false;
+ sLog->outError(LOG_FILTER_SQL, "Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
+ continue;
}
if (IsInMap(caster))
- caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, false, NULL, NULL, origCasterGUID);
+ caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
else // This can happen during Player::_LoadAuras
{
int32 bp0 = seatId;
@@ -17005,22 +17061,27 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
else
{
if (IsInMap(caster))
- caster->CastSpell(target, spellEntry, false, NULL, NULL, origCasterGUID);
+ caster->CastSpell(target, spellEntry, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
else
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID);
}
+
+ result = true;
}
- Creature* creature = ToCreature();
- if (creature && creature->IsAIEnabled)
- creature->AI()->DoAction(EVENT_SPELLCLICK);
+ if (result)
+ {
+ Creature* creature = ToCreature();
+ if (creature && creature->IsAIEnabled)
+ creature->AI()->OnSpellClick(clicker);
+ }
- return true;
+ return result;
}
void Unit::EnterVehicle(Unit* base, int8 seatId)
{
- CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, false);
+ CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
}
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
@@ -17038,6 +17099,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId);
ChangeSeat(seatId);
}
+
return;
}
else
@@ -17073,6 +17135,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
ASSERT(!m_vehicle);
m_vehicle = vehicle;
+
if (!m_vehicle->AddPassenger(this, seatId))
{
m_vehicle = NULL;
@@ -17125,9 +17188,11 @@ void Unit::_ExitVehicle(Position const* exitPosition)
m_vehicle->RemovePassenger(this);
+ Player* player = ToPlayer();
+
// If player is on mouted duel and exits the mount should immediatly lose the duel
- if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->duel && ToPlayer()->duel->isMounted)
- ToPlayer()->DuelComplete(DUEL_FLED);
+ if (player && player->duel && player->duel->isMounted)
+ player->DuelComplete(DUEL_FLED);
// This should be done before dismiss, because there may be some aura removal
Vehicle* vehicle = m_vehicle;
@@ -17144,8 +17209,8 @@ void Unit::_ExitVehicle(Position const* exitPosition)
AddUnitState(UNIT_STATE_MOVE);
- if (GetTypeId() == TYPEID_PLAYER)
- ToPlayer()->SetFallInformation(0, GetPositionZ());
+ if (player)
+ player->SetFallInformation(0, GetPositionZ());
else if (HasUnitMovementFlag(MOVEMENTFLAG_ROOT))
{
WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8);
@@ -17161,7 +17226,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
//GetMotionMaster()->MoveFall(); // Enable this once passenger positions are calculater properly (see above)
- if (Player* player = ToPlayer())
+ if (player)
player->ResummonPetTemporaryUnSummonedIfAny();
if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION))
@@ -17290,7 +17355,7 @@ void Unit::UpdateOrientation(float orientation)
{
SetOrientation(orientation);
if (IsVehicle())
- GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), GetPositionZ(), orientation);
+ GetVehicleKit()->RelocatePassengers();
}
//! Only server-side height update, does not broadcast to client
@@ -17298,7 +17363,7 @@ void Unit::UpdateHeight(float newZ)
{
Relocate(GetPositionX(), GetPositionY(), newZ);
if (IsVehicle())
- GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), newZ, GetOrientation());
+ GetVehicleKit()->RelocatePassengers();
}
void Unit::SendThreatListUpdate()
@@ -17426,39 +17491,44 @@ void Unit::StopAttackFaction(uint32 faction_id)
void Unit::OutDebugInfo() const
{
- sLog->outError("Unit::OutDebugInfo");
- sLog->outString("GUID "UI64FMTD", entry %u, type %u, name %s", GetGUID(), GetEntry(), (uint32)GetTypeId(), GetName());
- sLog->outString("OwnerGUID "UI64FMTD", MinionGUID "UI64FMTD", CharmerGUID "UI64FMTD", CharmedGUID "UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID());
- sLog->outString("In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::OutDebugInfo");
+ sLog->outInfo(LOG_FILTER_UNITS, "GUID "UI64FMTD", entry %u, type %u, name %s", GetGUID(), GetEntry(), (uint32)GetTypeId(), GetName());
+ sLog->outInfo(LOG_FILTER_UNITS, "OwnerGUID "UI64FMTD", MinionGUID "UI64FMTD", CharmerGUID "UI64FMTD", CharmedGUID "UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID());
+ sLog->outInfo(LOG_FILTER_UNITS, "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
if (IsInWorld())
- sLog->outString("Mapid %u", GetMapId());
+ sLog->outInfo(LOG_FILTER_UNITS, "Mapid %u", GetMapId());
- sLog->outStringInLine("Summon Slot: ");
+ std::ostringstream o;
+ o << "Summon Slot: ";
for (uint32 i = 0; i < MAX_SUMMON_SLOT; ++i)
- sLog->outStringInLine(UI64FMTD", ", m_SummonSlot[i]);
- sLog->outString();
+ o << m_SummonSlot[i] << ", ";
- sLog->outStringInLine("Controlled List: ");
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
+ o.str("");
+
+ o << "Controlled List: ";
for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
- sLog->outStringInLine(UI64FMTD", ", (*itr)->GetGUID());
- sLog->outString();
+ o << (*itr)->GetGUID() << ", ";
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
+ o.str("");
- sLog->outStringInLine("Aura List: ");
+ o << "Aura List: ";
for (AuraApplicationMap::const_iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr)
- sLog->outStringInLine("%u, ", itr->first);
- sLog->outString();
+ o << itr->first << ", ";
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
+ o.str("");
if (IsVehicle())
{
- sLog->outStringInLine("Passenger List: ");
+ o << "Passenger List: ";
for (SeatMap::iterator itr = GetVehicleKit()->Seats.begin(); itr != GetVehicleKit()->Seats.end(); ++itr)
if (Unit* passenger = ObjectAccessor::GetUnit(*GetVehicleBase(), itr->second.Passenger))
- sLog->outStringInLine(UI64FMTD", ", passenger->GetGUID());
- sLog->outString();
+ o << passenger->GetGUID() << ", ";
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
}
if (GetVehicle())
- sLog->outString("On vehicle %u.", GetVehicleBase()->GetEntry());
+ sLog->outInfo(LOG_FILTER_UNITS, "On vehicle %u.", GetVehicleBase()->GetEntry());
}
uint32 Unit::GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex) const
@@ -17691,3 +17761,31 @@ void Unit::SendMovementCanFlyChange()
BuildMovementPacket(&data);
SendMessageToSet(&data, false);
}
+
+void Unit::FocusTarget(Spell const* focusSpell, uint64 target)
+{
+ // already focused
+ if (_focusSpell)
+ return;
+
+ _focusSpell = focusSpell;
+ SetUInt64Value(UNIT_FIELD_TARGET, target);
+ if (focusSpell->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_DONT_TURN_DURING_CAST)
+ AddUnitState(UNIT_STATE_ROTATING);
+}
+
+void Unit::ReleaseFocus(Spell const* focusSpell)
+{
+ // focused to something else
+ if (focusSpell != _focusSpell)
+ return;
+
+ _focusSpell = NULL;
+ if (Unit* victim = getVictim())
+ SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
+ else
+ SetUInt64Value(UNIT_FIELD_TARGET, 0);
+
+ if (focusSpell->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_DONT_TURN_DURING_CAST)
+ ClearUnitState(UNIT_STATE_ROTATING);
+}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 9b63de0cdb8..5a639de574c 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -46,7 +46,7 @@ enum SpellInterruptFlags
SPELL_INTERRUPT_FLAG_PUSH_BACK = 0x02, // push back
SPELL_INTERRUPT_FLAG_UNK3 = 0x04, // any info?
SPELL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt
- SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10, // _complete_ interrupt on direct damage
+ SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10 // _complete_ interrupt on direct damage
//SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph"
};
@@ -86,7 +86,7 @@ enum SpellAuraInterruptFlags
AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage
AURA_INTERRUPT_FLAG_LANDING = 0x02000000, // 25 removed by hitting the ground
- AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE),
+ AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE)
};
enum SpellModOp
@@ -133,7 +133,7 @@ enum SpellValueMod
SPELLVALUE_BASE_POINT2,
SPELLVALUE_RADIUS_MOD,
SPELLVALUE_MAX_TARGETS,
- SPELLVALUE_AURA_STACK,
+ SPELLVALUE_AURA_STACK
};
typedef std::pair<SpellValueMod, int32> CustomSpellValueMod;
@@ -253,7 +253,7 @@ enum UnitPVPStateFlags
enum UnitRename
{
UNIT_CAN_BE_RENAMED = 0x01,
- UNIT_CAN_BE_ABANDONED = 0x02,
+ UNIT_CAN_BE_ABANDONED = 0x02
};
#define CREATURE_MAX_SPELLS 8
@@ -262,6 +262,8 @@ enum UnitRename
#define MAX_SPELL_POSSESS 8
#define MAX_SPELL_CONTROL_BAR 10
+#define MAX_AGGRO_RESET_TIME 10 // in seconds
+
enum Swing
{
NOSWING = 0,
@@ -339,6 +341,7 @@ class UnitAI;
class Totem;
class Transport;
class Vehicle;
+class TransportBase;
typedef std::list<Unit*> UnitList;
typedef std::list< std::pair<Aura*, uint8> > DispelChargesList;
@@ -402,7 +405,7 @@ enum TriggerCastFlags
TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements
TRIGGERED_DISALLOW_PROC_EVENTS = 0x00020000, //! Disallows proc events from triggered spell (default)
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
- TRIGGERED_FULL_MASK = 0xFFFFFFFF,
+ TRIGGERED_FULL_MASK = 0xFFFFFFFF
};
enum UnitMods
@@ -461,11 +464,11 @@ enum BaseModType
enum DeathState
{
- ALIVE = 0,
- JUST_DIED = 1,
- CORPSE = 2,
- DEAD = 3,
- JUST_RESPAWNED = 4,
+ ALIVE = 0,
+ JUST_DIED = 1,
+ CORPSE = 2,
+ DEAD = 3,
+ JUST_RESPAWNED = 4
};
enum UnitState
@@ -618,17 +621,24 @@ enum UnitFlags
// Value masks for UNIT_FIELD_FLAGS_2
enum UnitFlags2
{
- UNIT_FLAG2_FEIGN_DEATH = 0x00000001,
- UNIT_FLAG2_UNK1 = 0x00000002, // Hide unit model (show only player equip)
- UNIT_FLAG2_IGNORE_REPUTATION = 0x00000004,
- UNIT_FLAG2_COMPREHEND_LANG = 0x00000008,
- UNIT_FLAG2_MIRROR_IMAGE = 0x00000010,
- UNIT_FLAG2_FORCE_MOVE = 0x00000040,
- UNIT_FLAG2_DISARM_OFFHAND = 0x00000080,
- UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?)
- UNIT_FLAG2_REGENERATE_POWER = 0x00000800,
- UNIT_FLAG2_ALLOW_ENEMY_INTERACT = 0x00004000,
- UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000, // allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL
+ UNIT_FLAG2_FEIGN_DEATH = 0x00000001,
+ UNIT_FLAG2_UNK1 = 0x00000002, // Hide unit model (show only player equip)
+ UNIT_FLAG2_IGNORE_REPUTATION = 0x00000004,
+ UNIT_FLAG2_COMPREHEND_LANG = 0x00000008,
+ UNIT_FLAG2_MIRROR_IMAGE = 0x00000010,
+ UNIT_FLAG2_INSTANTLY_APPEAR_MODEL = 0x00000020, // Unit model instantly appears when summoned (does not fade in)
+ UNIT_FLAG2_FORCE_MOVEMENT = 0x00000040,
+ UNIT_FLAG2_DISARM_OFFHAND = 0x00000080,
+ UNIT_FLAG2_DISABLE_PRED_STATS = 0x00000100, // Player has disabled predicted stats (Used by raid frames)
+ UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?)
+ UNIT_FLAG2_REGENERATE_POWER = 0x00000800,
+ UNIT_FLAG2_RESTRICT_PARTY_INTERACTION = 0x00001000, // Restrict interaction to party or raid
+ UNIT_FLAG2_PREVENT_SPELL_CLICK = 0x00002000, // Prevent spellclick
+ UNIT_FLAG2_ALLOW_ENEMY_INTERACT = 0x00004000,
+ UNIT_FLAG2_DISABLE_TURN = 0x00008000,
+ UNIT_FLAG2_UNK2 = 0x00010000,
+ UNIT_FLAG2_PLAY_DEATH_ANIM = 0x00020000, // Plays special death animation upon death
+ UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000 // Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL
};
/// Non Player Character flags
@@ -660,7 +670,7 @@ enum NPCFlags
UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100%
UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode
UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click)
- UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set
+ UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000 // players with mounts that have vehicle data should have it set
};
enum MovementFlags
@@ -712,7 +722,7 @@ enum MovementFlags
//! TODO if needed: add more flags to this masks that are exclusive to players
MOVEMENTFLAG_MASK_PLAYER_ONLY =
- MOVEMENTFLAG_FLYING,
+ MOVEMENTFLAG_FLYING
};
enum MovementFlags2
{
@@ -732,7 +742,7 @@ enum MovementFlags2
MOVEMENTFLAG2_INTERPOLATED_PITCHING = 0x00001000,
MOVEMENTFLAG2_UNK14 = 0x00002000,
MOVEMENTFLAG2_UNK15 = 0x00004000,
- MOVEMENTFLAG2_UNK16 = 0x00008000,
+ MOVEMENTFLAG2_UNK16 = 0x00008000
};
enum UnitTypeMask
@@ -747,7 +757,7 @@ enum UnitTypeMask
UNIT_MASK_PUPPET = 0x00000040,
UNIT_MASK_HUNTER_PET = 0x00000080,
UNIT_MASK_CONTROLABLE_GUARDIAN = 0x00000100,
- UNIT_MASK_ACCESSORY = 0x00000200,
+ UNIT_MASK_ACCESSORY = 0x00000200
};
namespace Movement{
@@ -761,7 +771,7 @@ enum DiminishingLevels
DIMINISHING_LEVEL_3 = 2,
DIMINISHING_LEVEL_IMMUNE = 3,
DIMINISHING_LEVEL_4 = 3,
- DIMINISHING_LEVEL_TAUNT_IMMUNE = 4,
+ DIMINISHING_LEVEL_TAUNT_IMMUNE = 4
};
struct DiminishingReturn
@@ -793,8 +803,8 @@ public:
m_dispeller(_dispeller), m_dispellerSpellId(_dispellerSpellId), m_chargesRemoved(_chargesRemoved) {}
Unit* GetDispeller() { return m_dispeller; }
- uint32 GetDispellerSpellId() { return m_dispellerSpellId; }
- uint8 GetRemovedCharges() { return m_chargesRemoved; }
+ uint32 GetDispellerSpellId() const { return m_dispellerSpellId; }
+ uint8 GetRemovedCharges() const { return m_chargesRemoved; }
void SetRemovedCharges(uint8 amount)
{
m_chargesRemoved = amount;
@@ -963,24 +973,6 @@ struct SpellPeriodicAuraLogInfo
uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition);
-enum UnitAnimationState
-{
- ANIMATION_ON_GROUND = 0,
- ANIMATION_SWIMMING = 1,
- ANIMATION_HOVER = 2,
- ANIMATION_FLYING = 3,
-};
-
-struct MonsterMoveData
-{
- MonsterMoveData() : SplineFlag(0), AnimationState(ANIMATION_ON_GROUND), Time(0), SpeedZ(0.0f) {}
- Position DestLocation;
- uint32 SplineFlag;
- UnitAnimationState AnimationState; // Only used with SPLINEFLAG_ANIMATIONTIER
- uint32 Time;
- float SpeedZ; // Only used with SPLINEFLAG_TRAJECTORY
-};
-
#define MAX_DECLINED_NAME_CASES 5
struct DeclinedName
@@ -1090,7 +1082,7 @@ enum CharmType
CHARM_TYPE_CHARM,
CHARM_TYPE_POSSESS,
CHARM_TYPE_VEHICLE,
- CHARM_TYPE_CONVERT,
+ CHARM_TYPE_CONVERT
};
typedef UnitActionBarEntry CharmSpellInfo;
@@ -1100,7 +1092,7 @@ enum ActionBarIndex
ACTION_BAR_INDEX_START = 0,
ACTION_BAR_INDEX_PET_SPELL_START = 3,
ACTION_BAR_INDEX_PET_SPELL_END = 7,
- ACTION_BAR_INDEX_END = 10,
+ ACTION_BAR_INDEX_END = 10
};
#define MAX_UNIT_ACTION_BAR_INDEX (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START)
@@ -1200,7 +1192,7 @@ enum PlayerTotemType
SUMMON_TYPE_TOTEM_FIRE = 63,
SUMMON_TYPE_TOTEM_EARTH = 81,
SUMMON_TYPE_TOTEM_WATER = 82,
- SUMMON_TYPE_TOTEM_AIR = 83,
+ SUMMON_TYPE_TOTEM_AIR = 83
};
// delay time next attack to prevent client attack animation problems
@@ -1337,10 +1329,10 @@ class Unit : public WorldObject
uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); }
bool IsFullHealth() const { return GetHealth() == GetMaxHealth(); }
- bool HealthBelowPct(int32 pct) const { return GetHealth() * uint64(100) < GetMaxHealth() * uint64(pct); }
- bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return (int32(GetHealth()) - damage) * int64(100) < GetMaxHealth() * int64(pct); }
- bool HealthAbovePct(int32 pct) const { return GetHealth() * uint64(100) > GetMaxHealth() * uint64(pct); }
- bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return (GetHealth() + heal) * uint64(100) > GetMaxHealth() * uint64(pct); }
+ bool HealthBelowPct(int32 pct) const { return GetHealth() < CountPctFromMaxHealth(pct); }
+ bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return int64(GetHealth()) - int64(damage) < int64(CountPctFromMaxHealth(pct)); }
+ bool HealthAbovePct(int32 pct) const { return GetHealth() > CountPctFromMaxHealth(pct); }
+ bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return uint64(GetHealth()) + uint64(heal) > CountPctFromMaxHealth(pct); }
float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; }
uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePctN(GetMaxHealth(), pct); }
uint32 CountPctFromCurHealth(int32 pct) const { return CalculatePctN(GetHealth(), pct); }
@@ -1579,13 +1571,14 @@ class Unit : public WorldObject
void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* Victim = NULL, bool triggered = true, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* Victim = NULL, bool triggered = true, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
Aura* AddAura(uint32 spellId, Unit* target);
Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target);
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
@@ -1617,7 +1610,7 @@ class Unit : public WorldObject
void MonsterMoveWithSpeed(float x, float y, float z, float speed);
//void SetFacing(float ori, WorldObject* obj = NULL);
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
- void SendMovementFlagUpdate();
+ void SendMovementFlagUpdate(bool self = false);
/*! These methods send the same packet to the client in apply and unapply case.
The client-side interpretation of this packet depends on the presence of relevant movementflags
@@ -1656,6 +1649,7 @@ class Unit : public WorldObject
virtual void setDeathState(DeathState s); // overwrited in Creature/Player/Pet
uint64 GetOwnerGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMONEDBY); }
+ void SetOwnerGUID(uint64 owner);
uint64 GetCreatorGUID() const { return GetUInt64Value(UNIT_FIELD_CREATEDBY); }
void SetCreatorGUID(uint64 creator) { SetUInt64Value(UNIT_FIELD_CREATEDBY, creator); }
uint64 GetMinionGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMON); }
@@ -2178,6 +2172,8 @@ class Unit : public WorldObject
uint32 GetTransTime() const { return m_movementInfo.t_time; }
int8 GetTransSeat() const { return m_movementInfo.t_seat; }
uint64 GetTransGUID() const;
+ /// Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
+ TransportBase* GetDirectTransport() const;
bool m_ControlledByPlayer;
@@ -2213,38 +2209,21 @@ class Unit : public WorldObject
void SetTarget(uint64 guid)
{
- if (!_targetLocked)
+ if (!_focusSpell)
SetUInt64Value(UNIT_FIELD_TARGET, guid);
}
- void FocusTarget(Spell const* focusSpell, uint64 target)
- {
- // already focused
- if (_focusSpell)
- return;
-
- _focusSpell = focusSpell;
- _targetLocked = true;
- SetUInt64Value(UNIT_FIELD_TARGET, target);
- }
-
- void ReleaseFocus(Spell const* focusSpell)
- {
- // focused to something else
- if (focusSpell != _focusSpell)
- return;
-
- _focusSpell = NULL;
- _targetLocked = false;
- if (Unit* victim = getVictim())
- SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
- else
- SetUInt64Value(UNIT_FIELD_TARGET, 0);
- }
+ // Handling caster facing during spellcast
+ void FocusTarget(Spell const* focusSpell, uint64 target);
+ void ReleaseFocus(Spell const* focusSpell);
// Movement info
Movement::MoveSpline * movespline;
+ // Part of Evade mechanics
+ time_t GetLastDamagedTime() const { return _lastDamagedTime; }
+ void SetLastDamagedTime(time_t val) { _lastDamagedTime = val; }
+
protected:
explicit Unit (bool isWorldObject);
@@ -2364,8 +2343,10 @@ class Unit : public WorldObject
bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
- Spell const* _focusSpell;
- bool _targetLocked; // locks the target during spell cast for proper facing
+ Spell const* _focusSpell; ///> Locks the target during spell cast for proper facing
+ bool _isWalkingBeforeCharm; // Are we walking before we were charmed?
+
+ time_t _lastDamagedTime; // Part of Evade mechanics
};
namespace Trinity
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 710821f2f24..ef4ed1a7f81 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -437,23 +437,23 @@ void Vehicle::RemovePassenger(Unit* unit)
}
//! Must be called after m_base::Relocate
-void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
+void Vehicle::RelocatePassengers()
{
ASSERT(_me->GetMap());
- // not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle
+ // not sure that absolute position calculation is correct, it must depend on vehicle pitch angle
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
+ {
if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.Passenger))
{
ASSERT(passenger->IsInWorld());
- float px = x + passenger->m_movementInfo.t_pos.m_positionX;
- float py = y + passenger->m_movementInfo.t_pos.m_positionY;
- float pz = z + passenger->m_movementInfo.t_pos.m_positionZ;
- float po = ang + passenger->m_movementInfo.t_pos.m_orientation;
-
+ float px, py, pz, po;
+ passenger->m_movementInfo.t_pos.GetPosition(px, py, pz, po);
+ CalculatePassengerPosition(px, py, pz, po);
passenger->UpdatePosition(px, py, pz, po);
}
+ }
}
void Vehicle::Dismiss()
@@ -512,3 +512,23 @@ uint8 Vehicle::GetAvailableSeatCount() const
return ret;
}
+
+void Vehicle::CalculatePassengerPosition(float& x, float& y, float& z, float& o)
+{
+ float inx = x, iny = y, inz = z, ino = o;
+ o = GetBase()->GetOrientation() + ino;
+ x = GetBase()->GetPositionX() + inx * cos(GetBase()->GetOrientation()) - iny * sin(GetBase()->GetOrientation());
+ y = GetBase()->GetPositionY() + iny * cos(GetBase()->GetOrientation()) + inx * sin(GetBase()->GetOrientation());
+ z = GetBase()->GetPositionZ() + inz;
+}
+
+void Vehicle::CalculatePassengerOffset(float& x, float& y, float& z, float& o)
+{
+ o -= GetBase()->GetOrientation();
+ z -= GetBase()->GetPositionZ();
+ y -= GetBase()->GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o)
+ x -= GetBase()->GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi)
+ float inx = x, iny = y;
+ y = (iny - inx * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation()));
+ x = (inx + iny * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation()));
+}
diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h
index 213be5a21fe..4ad8663a17a 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.h
+++ b/src/server/game/Entities/Vehicle/Vehicle.h
@@ -25,7 +25,9 @@
struct VehicleEntry;
class Unit;
-class Vehicle
+typedef std::set<uint64> GuidSet;
+
+class Vehicle : public TransportBase
{
public:
explicit Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry);
@@ -50,9 +52,10 @@ class Vehicle
bool AddPassenger(Unit* passenger, int8 seatId = -1);
void EjectPassenger(Unit* passenger, Unit* controller);
void RemovePassenger(Unit* passenger);
- void RelocatePassengers(float x, float y, float z, float ang);
+ void RelocatePassengers();
void RemoveAllPassengers();
void Dismiss();
+ void TeleportVehicle(float x, float y, float z, float ang);
bool IsVehicleInUse() { return Seats.begin() != Seats.end(); }
SeatMap Seats;
@@ -63,8 +66,15 @@ class Vehicle
SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger);
void InitMovementInfoForBase();
+ /// This method transforms supplied transport offsets into global coordinates
+ void CalculatePassengerPosition(float& x, float& y, float& z, float& o);
+
+ /// This method transforms supplied global coordinates into local offsets
+ void CalculatePassengerOffset(float& x, float& y, float& z, float& o);
+
Unit* _me;
VehicleEntry const* _vehicleInfo;
+ GuidSet vehiclePlayers;
uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags
uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players
};
diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h
index df34a61d444..cb8a6628b80 100644
--- a/src/server/game/Entities/Vehicle/VehicleDefines.h
+++ b/src/server/game/Entities/Vehicle/VehicleDefines.h
@@ -44,7 +44,7 @@ enum VehicleFlags
VEHICLE_FLAG_FULLSPEEDPITCHING = 0x00000020, // Sets MOVEFLAG2_FULLSPEEDPITCHING
VEHICLE_FLAG_CUSTOM_PITCH = 0x00000040, // If set use pitchMin and pitchMax from DBC, otherwise pitchMin = -pi/2, pitchMax = pi/2
VEHICLE_FLAG_ADJUST_AIM_ANGLE = 0x00000400, // Lua_IsVehicleAimAngleAdjustable
- VEHICLE_FLAG_ADJUST_AIM_POWER = 0x00000800, // Lua_IsVehicleAimPowerAdjustable
+ VEHICLE_FLAG_ADJUST_AIM_POWER = 0x00000800 // Lua_IsVehicleAimPowerAdjustable
};
enum VehicleSpells
@@ -75,4 +75,14 @@ typedef std::vector<VehicleAccessory> VehicleAccessoryList;
typedef std::map<uint32, VehicleAccessoryList> VehicleAccessoryContainer;
typedef std::map<int8, VehicleSeat> SeatMap;
+class TransportBase
+{
+ public:
+ /// This method transforms supplied transport offsets into global coordinates
+ virtual void CalculatePassengerPosition(float& x, float& y, float& z, float& o) = 0;
+
+ /// This method transforms supplied global coordinates into local offsets
+ virtual void CalculatePassengerOffset(float& x, float& y, float& z, float& o) = 0;
+};
+
#endif
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index d5e85d2cf2f..2116738fac3 100755
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -205,13 +205,13 @@ void GameEventMgr::LoadFromDB()
{
{
uint32 oldMSTime = getMSTime();
- // 1 2 3 4 5 6 7 8
+ // 0 1 2 3 4 5 6 7
QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event");
if (!result)
{
mGameEvent.clear();
- sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 game events. DB table `game_event` is empty.");
+
return;
}
@@ -223,7 +223,7 @@ void GameEventMgr::LoadFromDB()
uint8 event_id = fields[0].GetUInt8();
if (event_id == 0)
{
- sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used.");
+ sLog->outError(LOG_FILTER_SQL, "`game_event` game event entry 0 is reserved and can't be used.");
continue;
}
@@ -241,7 +241,7 @@ void GameEventMgr::LoadFromDB()
if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
{
- sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
continue;
}
@@ -249,7 +249,7 @@ void GameEventMgr::LoadFromDB()
{
if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))
{
- sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id);
pGameEvent.holiday_id = HOLIDAY_NONE;
}
}
@@ -260,11 +260,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
- sLog->outString("Loading Game Event Saves Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Saves Data...");
{
uint32 oldMSTime = getMSTime();
@@ -273,8 +273,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
+
}
else
{
@@ -287,7 +287,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id);
continue;
}
@@ -298,7 +298,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
- sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u", event_id);
+ sLog->outError(LOG_FILTER_SQL, "game_event_save includes event save for non-worldevent id %u", event_id);
continue;
}
@@ -306,12 +306,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Prerequisite Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Prerequisite Data...");
{
uint32 oldMSTime = getMSTime();
@@ -319,8 +319,8 @@ void GameEventMgr::LoadFromDB()
QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite");
if (!result)
{
- sLog->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
+
}
else
{
@@ -333,7 +333,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -342,14 +342,14 @@ void GameEventMgr::LoadFromDB()
uint16 prerequisite_event = fields[1].GetUInt32();
if (prerequisite_event >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event);
continue;
}
mGameEvent[event_id].prerequisite_events.insert(prerequisite_event);
}
else
{
- sLog->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u", event_id);
+ sLog->outError(LOG_FILTER_SQL, "game_event_prerequisiste includes event entry for non-worldevent id %u", event_id);
continue;
}
@@ -357,23 +357,23 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Creature Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Creature Data...");
{
uint32 oldMSTime = getMSTime();
- // 1 2
+ // 0 1
QueryResult result = WorldDatabase.Query("SELECT creature.guid, game_event_creature.eventEntry FROM creature"
" JOIN game_event_creature ON creature.guid = game_event_creature.guid");
if (!result)
{
- sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
+
}
else
{
@@ -389,7 +389,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -400,12 +400,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event GO Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Data...");
{
uint32 oldMSTime = getMSTime();
@@ -415,8 +415,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
+
}
else
{
@@ -432,7 +432,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -443,12 +443,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Model/Equipment Change Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Model/Equipment Change Data...");
{
uint32 oldMSTime = getMSTime();
@@ -458,8 +457,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
}
else
{
@@ -473,7 +471,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventModelEquip.size())
{
- sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -488,7 +486,7 @@ void GameEventMgr::LoadFromDB()
{
if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id))
{
- sLog->outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.",
+ sLog->outError(LOG_FILTER_SQL, "Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.",
guid, newModelEquipSet.equipment_id);
continue;
}
@@ -500,12 +498,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Quest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Quest Data...");
{
uint32 oldMSTime = getMSTime();
@@ -514,8 +511,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
}
else
{
@@ -530,7 +526,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventCreatureQuests.size())
{
- sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -541,12 +537,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event GO Quest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Quest Data...");
{
uint32 oldMSTime = getMSTime();
@@ -555,8 +550,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
}
else
{
@@ -571,7 +565,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventGameObjectQuests.size())
{
- sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -582,12 +576,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Quest Condition Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Quest Condition Data...");
{
uint32 oldMSTime = getMSTime();
@@ -596,8 +589,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
}
else
{
@@ -613,7 +605,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -625,12 +617,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Condition Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Condition Data...");
{
uint32 oldMSTime = getMSTime();
@@ -639,8 +630,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
}
else
{
@@ -654,7 +644,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -667,12 +657,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Condition Save Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Condition Save Data...");
{
uint32 oldMSTime = getMSTime();
@@ -681,8 +670,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
}
else
{
@@ -696,7 +684,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -707,7 +695,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
- sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
+ sLog->outError(LOG_FILTER_SQL, "game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
continue;
}
@@ -715,12 +703,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event NPCflag Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event NPCflag Data...");
{
uint32 oldMSTime = getMSTime();
@@ -729,8 +716,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
}
else
{
@@ -745,7 +731,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -755,12 +741,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Seasonal Quest Relations...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Seasonal Quest Relations...");
{
uint32 oldMSTime = getMSTime();
@@ -769,8 +754,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
}
else
{
@@ -784,13 +768,13 @@ void GameEventMgr::LoadFromDB()
if (!sObjectMgr->GetQuestTemplate(questId))
{
- sLog->outErrorDb("`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
continue;
}
if (eventEntry >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
continue;
}
@@ -799,12 +783,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Vendor Additions Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Vendor Additions Data...");
{
uint32 oldMSTime = getMSTime();
@@ -813,8 +796,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
}
else
{
@@ -827,7 +809,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventVendors.size())
{
- sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -865,12 +847,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Battleground Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Battleground Data...");
{
uint32 oldMSTime = getMSTime();
@@ -879,8 +860,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty.");
}
else
{
@@ -893,7 +873,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -903,12 +883,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Game Event Pool Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Pool Data...");
{
uint32 oldMSTime = getMSTime();
@@ -918,8 +897,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
}
else
{
@@ -935,13 +913,13 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
if (!sPoolMgr->CheckPool(entry))
{
- sLog->outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
continue;
}
@@ -952,8 +930,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
}
@@ -1015,7 +992,7 @@ void GameEventMgr::StartArenaSeason()
if (!result)
{
- sLog->outError("ArenaSeason (%u) must be an existant Arena Season", season);
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "ArenaSeason (%u) must be an existant Arena Season", season);
return;
}
@@ -1024,13 +1001,13 @@ void GameEventMgr::StartArenaSeason()
if (eventId >= mGameEvent.size())
{
- sLog->outError("EventEntry %u for ArenaSeason (%u) does not exists", eventId, season);
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "EventEntry %u for ArenaSeason (%u) does not exists", eventId, season);
return;
}
StartEvent(eventId, true);
- sLog->outString("Arena Season %u started...", season);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Arena Season %u started...", season);
+
}
uint32 GameEventMgr::Update() // return the next event delay in ms
@@ -1043,7 +1020,7 @@ uint32 GameEventMgr::Update() // return the next e
{
// must do the activating first, and after that the deactivating
// so first queue it
- //sLog->outErrorDb("Checking event %u", itr);
+ //sLog->outError(LOG_FILTER_SQL, "Checking event %u", itr);
if (CheckOneGameEvent(itr))
{
// if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so
@@ -1099,13 +1076,13 @@ uint32 GameEventMgr::Update() // return the next e
nextEventDelay = 0;
for (std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
StopEvent(*itr);
- sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1);
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Next game event check in %u seconds.", nextEventDelay + 1);
return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call
}
void GameEventMgr::UnApplyEvent(uint16 event_id)
{
- sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str());
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str());
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_END
RunSmartAIScripts(event_id, false);
// un-spawn positive event tagged objects
@@ -1137,7 +1114,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id)
break;
}
- sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str());
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str());
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_END
RunSmartAIScripts(event_id, true);
@@ -1211,7 +1188,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventCreatureGuids.size());
return;
}
@@ -1238,7 +1215,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventGameobjectGuids.size());
return;
}
@@ -1271,7 +1248,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",
internal_event_id, mGameEventPoolIds.size());
return;
}
@@ -1286,7 +1263,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventCreatureGuids.size());
return;
}
@@ -1308,7 +1285,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventGameobjectGuids.size());
return;
}
@@ -1329,7 +1306,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
}
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size());
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size());
return;
}
diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h
index d9b5890bfe5..dbc2c7ead10 100755
--- a/src/server/game/Events/GameEventMgr.h
+++ b/src/server/game/Events/GameEventMgr.h
@@ -28,12 +28,12 @@
enum GameEventState
{
- GAMEEVENT_NORMAL = 0, // standard game events
- GAMEEVENT_WORLD_INACTIVE = 1, // not yet started
- GAMEEVENT_WORLD_CONDITIONS = 2, // condition matching phase
- GAMEEVENT_WORLD_NEXTPHASE = 3, // conditions are met, now 'length' timer to start next event
- GAMEEVENT_WORLD_FINISHED = 4, // next events are started, unapply this one
- GAMEEVENT_INTERNAL = 5, // never handled in update
+ GAMEEVENT_NORMAL = 0, // standard game events
+ GAMEEVENT_WORLD_INACTIVE = 1, // not yet started
+ GAMEEVENT_WORLD_CONDITIONS = 2, // condition matching phase
+ GAMEEVENT_WORLD_NEXTPHASE = 3, // conditions are met, now 'length' timer to start next event
+ GAMEEVENT_WORLD_FINISHED = 4, // next events are started, unapply this one
+ GAMEEVENT_INTERNAL = 5 // never handled in update
};
struct GameEventFinishCondition
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index 9a99a28c7aa..81a132a40d8 100755
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -290,7 +290,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
return NULL;
}
- sLog->outStaticDebug("Deleting Corpse and spawned bones.");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Deleting Corpse and spawned bones.");
// Map can be NULL
Map* map = corpse->FindMap();
diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h
index 92a7a24571e..0a1b41eb292 100755
--- a/src/server/game/Globals/ObjectAccessor.h
+++ b/src/server/game/Globals/ObjectAccessor.h
@@ -155,14 +155,14 @@ class ObjectAccessor
CellCoord p = Trinity::ComputeCellCoord(x, y);
if (!p.IsCoordValid())
{
- sLog->outError("ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
+ sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
return NULL;
}
CellCoord q = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!q.IsCoordValid())
{
- sLog->outError("ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
+ sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
return NULL;
}
@@ -191,6 +191,7 @@ class ObjectAccessor
// ACCESS LIKE THAT IS NOT THREAD SAFE
static Pet* FindPet(uint64);
static Player* FindPlayer(uint64);
+ static Creature* FindCreature(uint64);
static Unit* FindUnit(uint64);
static Player* FindPlayerByName(const char* name);
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 65f2ccff476..7d94e0ad209 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -296,8 +296,7 @@ void ObjectMgr::LoadCreatureLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadGossipMenuItemsLocales()
@@ -333,8 +332,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadPointOfInterestLocales()
@@ -360,8 +358,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.IconName);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadCreatureTemplates()
@@ -372,24 +369,23 @@ void ObjectMgr::LoadCreatureTemplates()
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
// 9 10 11 12 13 14 15 16 17 18 19 20 21
"modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, "
- // 22 23 24 25 26 27 28 29 30 31 32
- "scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, "
- // 33 34 35 36 37 38 39 40 41 42
+ // 22 23 24 25 26 27 28 29 30 31 32 33
+ "scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, "
+ // 34 35 36 37 38 39 40 41 42 43
"dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, "
- // 43 44 45 46 47 48 49 50 51 52 53
+ // 44 45 46 47 48 49 50 51 52 53 54
"type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, "
- // 54 55 56 57 58 59 60 61 62 63 64 65 66
+ // 55 56 57 58 59 60 61 62 63 64 65 66 67
"spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, "
- // 67 68 69 70 71 72 73 74 75 76 77
+ // 68 69 70 71 72 73 74 75 76 77 78
"InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, "
- // 78 79 80 81 82 83
+ // 79 80 81 82 83 84
" questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName "
"FROM creature_template;");
if (!result)
{
- sLog->outString(">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
return;
}
@@ -439,49 +435,50 @@ void ObjectMgr::LoadCreatureTemplates()
creatureTemplate.rangeattacktime = fields[30].GetUInt32();
creatureTemplate.unit_class = uint32(fields[31].GetUInt8());
creatureTemplate.unit_flags = fields[32].GetUInt32();
- creatureTemplate.dynamicflags = fields[33].GetUInt32();
- creatureTemplate.family = uint32(fields[34].GetUInt8());
- creatureTemplate.trainer_type = uint32(fields[35].GetUInt8());
- creatureTemplate.trainer_spell = fields[36].GetUInt32();
- creatureTemplate.trainer_class = uint32(fields[37].GetUInt8());
- creatureTemplate.trainer_race = uint32(fields[38].GetUInt8());
- creatureTemplate.minrangedmg = fields[39].GetFloat();
- creatureTemplate.maxrangedmg = fields[40].GetFloat();
- creatureTemplate.rangedattackpower = uint32(fields[41].GetUInt16());
- creatureTemplate.type = uint32(fields[42].GetUInt8());
- creatureTemplate.type_flags = fields[43].GetUInt32();
- creatureTemplate.lootid = fields[44].GetUInt32();
- creatureTemplate.pickpocketLootId = fields[45].GetUInt32();
- creatureTemplate.SkinLootId = fields[46].GetUInt32();
+ creatureTemplate.unit_flags2 = fields[33].GetUInt32();
+ creatureTemplate.dynamicflags = fields[34].GetUInt32();
+ creatureTemplate.family = uint32(fields[35].GetUInt8());
+ creatureTemplate.trainer_type = uint32(fields[36].GetUInt8());
+ creatureTemplate.trainer_spell = fields[37].GetUInt32();
+ creatureTemplate.trainer_class = uint32(fields[38].GetUInt8());
+ creatureTemplate.trainer_race = uint32(fields[39].GetUInt8());
+ creatureTemplate.minrangedmg = fields[40].GetFloat();
+ creatureTemplate.maxrangedmg = fields[41].GetFloat();
+ creatureTemplate.rangedattackpower = uint32(fields[42].GetUInt16());
+ creatureTemplate.type = uint32(fields[43].GetUInt8());
+ creatureTemplate.type_flags = fields[44].GetUInt32();
+ creatureTemplate.lootid = fields[45].GetUInt32();
+ creatureTemplate.pickpocketLootId = fields[46].GetUInt32();
+ creatureTemplate.SkinLootId = fields[47].GetUInt32();
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- creatureTemplate.resistance[i] = fields[47 + i -1].GetInt16();
+ creatureTemplate.resistance[i] = fields[48 + i -1].GetInt16();
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
- creatureTemplate.spells[i] = fields[53 + i].GetUInt32();
-
- creatureTemplate.PetSpellDataId = fields[61].GetUInt32();
- creatureTemplate.VehicleId = fields[62].GetUInt32();
- creatureTemplate.mingold = fields[63].GetUInt32();
- creatureTemplate.maxgold = fields[64].GetUInt32();
- creatureTemplate.AIName = fields[65].GetString();
- creatureTemplate.MovementType = uint32(fields[66].GetUInt8());
- creatureTemplate.InhabitType = uint32(fields[67].GetUInt8());
- creatureTemplate.HoverHeight = fields[68].GetFloat();
- creatureTemplate.ModHealth = fields[69].GetFloat();
- creatureTemplate.ModMana = fields[70].GetFloat();
- creatureTemplate.ModArmor = fields[71].GetFloat();
- creatureTemplate.RacialLeader = fields[72].GetBool();
+ creatureTemplate.spells[i] = fields[54 + i].GetUInt32();
+
+ creatureTemplate.PetSpellDataId = fields[62].GetUInt32();
+ creatureTemplate.VehicleId = fields[63].GetUInt32();
+ creatureTemplate.mingold = fields[64].GetUInt32();
+ creatureTemplate.maxgold = fields[65].GetUInt32();
+ creatureTemplate.AIName = fields[66].GetString();
+ creatureTemplate.MovementType = uint32(fields[67].GetUInt8());
+ creatureTemplate.InhabitType = uint32(fields[68].GetUInt8());
+ creatureTemplate.HoverHeight = fields[69].GetFloat();
+ creatureTemplate.ModHealth = fields[70].GetFloat();
+ creatureTemplate.ModMana = fields[71].GetFloat();
+ creatureTemplate.ModArmor = fields[72].GetFloat();
+ creatureTemplate.RacialLeader = fields[73].GetBool();
for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
- creatureTemplate.questItems[i] = fields[73 + i].GetUInt32();
+ creatureTemplate.questItems[i] = fields[74 + i].GetUInt32();
- creatureTemplate.movementId = fields[79].GetUInt32();
- creatureTemplate.RegenHealth = fields[80].GetBool();
- creatureTemplate.equipmentId = fields[81].GetUInt32();
- creatureTemplate.MechanicImmuneMask = fields[82].GetUInt32();
- creatureTemplate.flags_extra = fields[83].GetUInt32();
- creatureTemplate.ScriptID = GetScriptId(fields[84].GetCString());
+ creatureTemplate.movementId = fields[80].GetUInt32();
+ creatureTemplate.RegenHealth = fields[81].GetBool();
+ creatureTemplate.equipmentId = fields[82].GetUInt32();
+ creatureTemplate.MechanicImmuneMask = fields[83].GetUInt32();
+ creatureTemplate.flags_extra = fields[84].GetUInt32();
+ creatureTemplate.ScriptID = GetScriptId(fields[85].GetCString());
++count;
}
@@ -491,8 +488,7 @@ void ObjectMgr::LoadCreatureTemplates()
for (CreatureTemplateContainer::const_iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr)
CheckCreatureTemplate(&itr->second);
- sLog->outString(">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadCreatureTemplateAddons()
@@ -504,8 +500,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
if (!result)
{
- sLog->outString(">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
return;
}
@@ -518,7 +513,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
if (!sObjectMgr->GetCreatureTemplate(entry))
{
- sLog->outErrorDb("Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry);
continue;
}
@@ -538,7 +533,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr)));
if (!AdditionalSpellInfo)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr)));
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr)));
continue;
}
creatureAddon.auras[i++] = uint32(atol(*itr));
@@ -548,14 +543,14 @@ void ObjectMgr::LoadCreatureTemplateAddons()
{
if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount))
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount);
creatureAddon.mount = 0;
}
}
if (!sEmotesStore.LookupEntry(creatureAddon.emote))
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote);
creatureAddon.emote = 0;
}
@@ -563,8 +558,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
@@ -582,7 +576,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureTemplate const* difficultyInfo = GetCreatureTemplate(cInfo->DifficultyEntry[diff]);
if (!difficultyInfo)
{
- sLog->outErrorDb("Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff]);
continue;
}
@@ -593,20 +587,20 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
ok2 = false;
if (_difficultyEntries[diff2].find(cInfo->Entry) != _difficultyEntries[diff2].end())
{
- sLog->outErrorDb("Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
cInfo->Entry, diff2 + 1, cInfo->DifficultyEntry[diff], diff + 1);
continue;
}
if (_difficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != _difficultyEntries[diff2].end())
{
- sLog->outErrorDb("Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1);
continue;
}
if (_hasDifficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != _hasDifficultyEntries[diff2].end())
{
- sLog->outErrorDb("Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff], diff2 + 1);
continue;
}
@@ -617,51 +611,51 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->unit_class != difficultyInfo->unit_class)
{
- sLog->outErrorDb("Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
cInfo->Entry, cInfo->unit_class, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->unit_class);
continue;
}
if (cInfo->npcflag != difficultyInfo->npcflag)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_class != difficultyInfo->trainer_class)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_race != difficultyInfo->trainer_race)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_type != difficultyInfo->trainer_type)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_spell != difficultyInfo->trainer_spell)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (!difficultyInfo->AIName.empty())
{
- sLog->outErrorDb("Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (difficultyInfo->ScriptID)
{
- sLog->outErrorDb("Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
@@ -673,11 +667,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A);
if (!factionTemplate)
- sLog->outErrorDb("Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A);
factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_H);
if (!factionTemplate)
- sLog->outErrorDb("Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H);
// used later for scale
CreatureDisplayInfoEntry const* displayScaleEntry = NULL;
@@ -687,7 +681,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid1);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1);
const_cast<CreatureTemplate*>(cInfo)->Modelid1 = 0;
}
else if (!displayScaleEntry)
@@ -695,7 +689,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid1);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry);
}
if (cInfo->Modelid2)
@@ -703,7 +697,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid2);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2);
const_cast<CreatureTemplate*>(cInfo)->Modelid2 = 0;
}
else if (!displayScaleEntry)
@@ -711,7 +705,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
}
if (cInfo->Modelid3)
@@ -719,7 +713,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid3);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3);
const_cast<CreatureTemplate*>(cInfo)->Modelid3 = 0;
}
else if (!displayScaleEntry)
@@ -727,7 +721,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid3);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry);
}
if (cInfo->Modelid4)
@@ -735,7 +729,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid4);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4);
const_cast<CreatureTemplate*>(cInfo)->Modelid4 = 0;
}
else if (!displayScaleEntry)
@@ -743,11 +737,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
}
if (!displayScaleEntry)
- sLog->outErrorDb("Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
for (int k = 0; k < MAX_KILL_CREDIT; ++k)
{
@@ -755,7 +749,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
if (!GetCreatureTemplate(cInfo->KillCredit[k]))
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1);
const_cast<CreatureTemplate*>(cInfo)->KillCredit[k] = 0;
}
}
@@ -763,13 +757,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (!cInfo->unit_class || ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
const_cast<CreatureTemplate*>(cInfo)->unit_class = UNIT_CLASS_WARRIOR;
}
if (cInfo->dmgschool >= MAX_SPELL_SCHOOL)
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool);
const_cast<CreatureTemplate*>(cInfo)->dmgschool = SPELL_SCHOOL_NORMAL;
}
@@ -780,30 +774,30 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = BASE_ATTACK_TIME;
if ((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE)
- sLog->outErrorDb("Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type);
if (cInfo->type && !sCreatureTypeStore.LookupEntry(cInfo->type))
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type);
const_cast<CreatureTemplate*>(cInfo)->type = CREATURE_TYPE_HUMANOID;
}
// must exist or used hidden but used in data horse case
if (cInfo->family && !sCreatureFamilyStore.LookupEntry(cInfo->family) && cInfo->family != CREATURE_FAMILY_HORSE_CUSTOM)
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family);
const_cast<CreatureTemplate*>(cInfo)->family = 0;
}
if (cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType);
const_cast<CreatureTemplate*>(cInfo)->InhabitType = INHABIT_ANYWHERE;
}
if (cInfo->HoverHeight < 0.0f)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight);
const_cast<CreatureTemplate*>(cInfo)->HoverHeight = 1.0f;
}
@@ -812,7 +806,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->VehicleId);
if (!vehId)
{
- sLog->outErrorDb("Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId);
const_cast<CreatureTemplate*>(cInfo)->VehicleId = 0;
}
}
@@ -821,21 +815,21 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId);
if (!spellDataId)
- sLog->outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId);
}
for (uint8 j = 0; j < CREATURE_MAX_SPELLS; ++j)
{
if (cInfo->spells[j] && !sSpellMgr->GetSpellInfo(cInfo->spells[j]))
{
- sLog->outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]);
const_cast<CreatureTemplate*>(cInfo)->spells[j] = 0;
}
}
if (cInfo->MovementType >= MAX_DB_MOTION_TYPE)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType);
const_cast<CreatureTemplate*>(cInfo)->MovementType = IDLE_MOTION_TYPE;
}
@@ -843,7 +837,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
if (!GetEquipmentInfo(cInfo->equipmentId))
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `equipment_id` %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with `equipment_id` %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId);
const_cast<CreatureTemplate*>(cInfo)->equipmentId = 0;
}
}
@@ -859,13 +853,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->expansion > (MAX_CREATURE_BASE_HP - 1))
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
const_cast<CreatureTemplate*>(cInfo)->expansion = 0;
}
if (uint32 badFlags = (cInfo->flags_extra & ~CREATURE_FLAG_EXTRA_DB_ALLOWED))
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags);
const_cast<CreatureTemplate*>(cInfo)->flags_extra &= CREATURE_FLAG_EXTRA_DB_ALLOWED;
}
@@ -881,8 +875,7 @@ void ObjectMgr::LoadCreatureAddons()
if (!result)
{
- sLog->outString(">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
return;
}
@@ -896,7 +889,7 @@ void ObjectMgr::LoadCreatureAddons()
CreatureData const* creData = GetCreatureData(guid);
if (!creData)
{
- sLog->outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid);
continue;
}
@@ -906,7 +899,7 @@ void ObjectMgr::LoadCreatureAddons()
if (creData->movementType == WAYPOINT_MOTION_TYPE && !creatureAddon.path_id)
{
const_cast<CreatureData*>(creData)->movementType = IDLE_MOTION_TYPE;
- sLog->outErrorDb("Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid);
}
creatureAddon.mount = fields[2].GetUInt32();
@@ -922,7 +915,7 @@ void ObjectMgr::LoadCreatureAddons()
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr)));
if (!AdditionalSpellInfo)
{
- sLog->outErrorDb("Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr)));
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr)));
continue;
}
creatureAddon.auras[i++] = uint32(atol(*itr));
@@ -932,14 +925,14 @@ void ObjectMgr::LoadCreatureAddons()
{
if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount))
{
- sLog->outErrorDb("Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.mount);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.mount);
creatureAddon.mount = 0;
}
}
if (!sEmotesStore.LookupEntry(creatureAddon.emote))
{
- sLog->outErrorDb("Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote);
creatureAddon.emote = 0;
}
@@ -947,8 +940,7 @@ void ObjectMgr::LoadCreatureAddons()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid)
@@ -986,8 +978,7 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!result)
{
- sLog->outString(">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
return;
}
@@ -1013,7 +1004,7 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!dbcItem)
{
- sLog->outErrorDb("Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.",
+ sLog->outError(LOG_FILTER_SQL, "Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.",
equipmentInfo.ItemEntry[i], i+1, entry);
equipmentInfo.ItemEntry[i] = 0;
continue;
@@ -1029,7 +1020,7 @@ void ObjectMgr::LoadEquipmentTemplates()
dbcItem->InventoryType != INVTYPE_THROWN &&
dbcItem->InventoryType != INVTYPE_RANGEDRIGHT)
{
- sLog->outErrorDb("Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.",
+ sLog->outError(LOG_FILTER_SQL, "Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.",
equipmentInfo.ItemEntry[i], i+1, entry);
equipmentInfo.ItemEntry[i] = 0;
}
@@ -1039,8 +1030,7 @@ void ObjectMgr::LoadEquipmentTemplates()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId)
@@ -1097,7 +1087,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
{
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender);
if (!minfo_tmp)
- sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender);
+ sLog->outError(LOG_FILTER_SQL, "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender);
else
{
// Model ID changed
@@ -1117,8 +1107,7 @@ void ObjectMgr::LoadCreatureModelInfo()
if (!result)
{
- sLog->outString(">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
return;
}
@@ -1141,17 +1130,17 @@ void ObjectMgr::LoadCreatureModelInfo()
// Checks
if (!sCreatureDisplayInfoStore.LookupEntry(modelId))
- sLog->outErrorDb("Table `creature_model_info` has model for not existed display id (%u).", modelId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has model for not existed display id (%u).", modelId);
if (modelInfo.gender > GENDER_NONE)
{
- sLog->outErrorDb("Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId);
modelInfo.gender = GENDER_MALE;
}
if (modelInfo.modelid_other_gender && !sCreatureDisplayInfoStore.LookupEntry(modelInfo.modelid_other_gender))
{
- sLog->outErrorDb("Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId);
modelInfo.modelid_other_gender = 0;
}
@@ -1162,8 +1151,7 @@ void ObjectMgr::LoadCreatureModelInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadLinkedRespawn()
@@ -1176,8 +1164,8 @@ void ObjectMgr::LoadLinkedRespawn()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
+
return;
}
@@ -1198,7 +1186,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1206,7 +1194,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1214,14 +1202,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1235,7 +1223,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1243,7 +1231,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1251,14 +1239,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1272,7 +1260,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1280,7 +1268,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1288,14 +1276,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1309,7 +1297,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1317,7 +1305,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1325,14 +1313,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1348,8 +1336,7 @@ void ObjectMgr::LoadLinkedRespawn()
}
while (result->NextRow());
- sLog->outString(">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime));
}
bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
@@ -1374,13 +1361,13 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
return false;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
return false;
}
@@ -1408,8 +1395,8 @@ void ObjectMgr::LoadCreatures()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 creatures. DB table `creature` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures. DB table `creature` is empty.");
+
return;
}
@@ -1433,7 +1420,7 @@ void ObjectMgr::LoadCreatures()
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
if (!cInfo)
{
- sLog->outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry);
continue;
}
@@ -1463,19 +1450,19 @@ void ObjectMgr::LoadCreatures()
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if (!mapEntry)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid);
continue;
}
if (data.spawnMask & ~spawnMasks[data.mapid])
- sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid);
bool ok = true;
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff)
{
if (_difficultyEntries[diff].find(data.id) != _difficultyEntries[diff].end())
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.",
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.",
guid, diff + 1, data.id);
ok = false;
}
@@ -1488,7 +1475,7 @@ void ObjectMgr::LoadCreatures()
{
if (!GetEquipmentInfo(data.equipmentId))
{
- sLog->outErrorDb("Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId);
data.equipmentId = -1;
}
}
@@ -1496,19 +1483,19 @@ void ObjectMgr::LoadCreatures()
if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
{
if (!mapEntry || !mapEntry->IsDungeon())
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.id);
}
if (data.spawndist < 0.0f)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id);
data.spawndist = 0.0f;
}
else if (data.movementType == RANDOM_MOTION_TYPE)
{
if (data.spawndist == 0.0f)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id);
data.movementType = IDLE_MOTION_TYPE;
}
}
@@ -1516,14 +1503,14 @@ void ObjectMgr::LoadCreatures()
{
if (data.spawndist != 0.0f)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id);
data.spawndist = 0.0f;
}
}
if (data.phaseMask == 0)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
data.phaseMask = 1;
}
@@ -1535,8 +1522,7 @@ void ObjectMgr::LoadCreatures()
} while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
@@ -1606,7 +1592,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
GameObject* go = new GameObject;
if (!go->LoadGameObjectFromDB(guid, map))
{
- sLog->outError("AddGOData: cannot add gameobject entry %u to map", entry);
+ sLog->outError(LOG_FILTER_GENERAL, "AddGOData: cannot add gameobject entry %u to map", entry);
delete go;
return 0;
}
@@ -1641,7 +1627,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos)
Creature* creature = new Creature;
if (!creature->LoadCreatureFromDB(guid, map))
{
- sLog->outError("AddCreature: cannot add creature entry %u to map", guid);
+ sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", guid);
delete creature;
return false;
}
@@ -1693,7 +1679,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
Creature* creature = new Creature;
if (!creature->LoadCreatureFromDB(guid, map))
{
- sLog->outError("AddCreature: cannot add creature entry %u to map", entry);
+ sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", entry);
delete creature;
return 0;
}
@@ -1718,8 +1704,8 @@ void ObjectMgr::LoadGameobjects()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
+
return;
}
@@ -1742,7 +1728,7 @@ void ObjectMgr::LoadGameobjects()
GameObjectTemplate const* gInfo = GetGameObjectTemplate(entry);
if (!gInfo)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry);
continue;
}
@@ -1754,14 +1740,14 @@ void ObjectMgr::LoadGameobjects()
case GAMEOBJECT_TYPE_SPELL_FOCUS:
break;
default:
- sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
break;
}
}
if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId))
{
- sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
continue;
}
@@ -1782,13 +1768,13 @@ void ObjectMgr::LoadGameobjects()
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if (!mapEntry)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.id, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.id, data.mapid);
continue;
}
if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction())
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id);
}
data.animprogress = fields[12].GetUInt8();
@@ -1797,7 +1783,7 @@ void ObjectMgr::LoadGameobjects()
uint32 go_state = fields[13].GetUInt8();
if (go_state >= MAX_GO_STATE)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state);
continue;
}
data.go_state = GOState(go_state);
@@ -1805,7 +1791,7 @@ void ObjectMgr::LoadGameobjects()
data.spawnMask = fields[14].GetUInt8();
if (data.spawnMask & ~spawnMasks[data.mapid])
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
data.phaseMask = fields[15].GetUInt16();
int16 gameEvent = fields[16].GetInt8();
@@ -1813,25 +1799,25 @@ void ObjectMgr::LoadGameobjects()
if (data.rotation2 < -1.0f || data.rotation2 > 1.0f)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2);
continue;
}
if (data.rotation3 < -1.0f || data.rotation3 > 1.0f)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3);
continue;
}
if (!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation))
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
continue;
}
if (data.phaseMask == 0)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
data.phaseMask = 1;
}
@@ -1840,8 +1826,7 @@ void ObjectMgr::LoadGameobjects()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
@@ -2009,16 +1994,15 @@ void ObjectMgr::LoadItemLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadItemTemplates()
{
uint32 oldMSTime = getMSTime();
- // 0 1 2 3 4 5 6 7 8 9 10 11 12
- QueryResult result = WorldDatabase.Query("SELECT entry, class, subclass, unk0, name, displayid, Quality, Flags, FlagsExtra, BuyCount, BuyPrice, SellPrice, InventoryType, "
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12
+ QueryResult result = WorldDatabase.Query("SELECT entry, class, subclass, SoundOverrideSubclass, name, displayid, Quality, Flags, FlagsExtra, BuyCount, BuyPrice, SellPrice, InventoryType, "
// 13 14 15 16 17 18 19 20
"AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, "
// 21 22 23 24 25 26 27 28
@@ -2052,8 +2036,7 @@ void ObjectMgr::LoadItemTemplates()
if (!result)
{
- sLog->outString(">> Loaded 0 item templates. DB table `item_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 item templates. DB table `item_template` is empty.");
return;
}
@@ -2072,7 +2055,7 @@ void ObjectMgr::LoadItemTemplates()
itemTemplate.ItemId = entry;
itemTemplate.Class = uint32(fields[1].GetUInt8());
itemTemplate.SubClass = uint32(fields[2].GetUInt8());
- itemTemplate.Unk0 = fields[3].GetInt32();
+ itemTemplate.SoundOverrideSubclass = int32(fields[3].GetInt8());
itemTemplate.Name1 = fields[4].GetString();
itemTemplate.DisplayInfoID = fields[5].GetUInt32();
itemTemplate.Quality = uint32(fields[6].GetUInt8());
@@ -2183,61 +2166,61 @@ void ObjectMgr::LoadItemTemplates()
{
if (itemTemplate.Class != dbcitem->Class)
{
- sLog->outErrorDb("Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class);
if (enforceDBCAttributes)
itemTemplate.Class = dbcitem->Class;
}
- if (itemTemplate.Unk0 != dbcitem->Unk0)
+ if (itemTemplate.SoundOverrideSubclass != dbcitem->SoundOverrideSubclass)
{
- sLog->outErrorDb("Item (Entry: %u) does not have a correct Unk0 (%i), must be %i .", entry, itemTemplate.Unk0, dbcitem->Unk0);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct SoundOverrideSubclass (%i), must be %i .", entry, itemTemplate.SoundOverrideSubclass, dbcitem->SoundOverrideSubclass);
if (enforceDBCAttributes)
- itemTemplate.Unk0 = dbcitem->Unk0;
+ itemTemplate.SoundOverrideSubclass = dbcitem->SoundOverrideSubclass;
}
if (itemTemplate.Material != dbcitem->Material)
{
- sLog->outErrorDb("Item (Entry: %u) does not have a correct material (%i), must be %i .", entry, itemTemplate.Material, dbcitem->Material);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct material (%i), must be %i .", entry, itemTemplate.Material, dbcitem->Material);
if (enforceDBCAttributes)
itemTemplate.Material = dbcitem->Material;
}
if (itemTemplate.InventoryType != dbcitem->InventoryType)
{
- sLog->outErrorDb("Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", entry, itemTemplate.InventoryType, dbcitem->InventoryType);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", entry, itemTemplate.InventoryType, dbcitem->InventoryType);
if (enforceDBCAttributes)
itemTemplate.InventoryType = dbcitem->InventoryType;
}
if (itemTemplate.DisplayInfoID != dbcitem->DisplayId)
{
- sLog->outErrorDb("Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId);
if (enforceDBCAttributes)
itemTemplate.DisplayInfoID = dbcitem->DisplayId;
}
if (itemTemplate.Sheath != dbcitem->Sheath)
{
- sLog->outErrorDb("Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath);
if (enforceDBCAttributes)
itemTemplate.Sheath = dbcitem->Sheath;
}
}
else
- sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry);
if (itemTemplate.Class >= MAX_ITEM_CLASS)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong Class value (%u)", entry, itemTemplate.Class);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Class value (%u)", entry, itemTemplate.Class);
itemTemplate.Class = ITEM_CLASS_MISC;
}
if (itemTemplate.SubClass >= MaxItemSubclassValues[itemTemplate.Class])
{
- sLog->outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u", entry, itemTemplate.SubClass, itemTemplate.Class);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Subclass value (%u) for class %u", entry, itemTemplate.SubClass, itemTemplate.Class);
itemTemplate.SubClass = 0;// exist for all item classes
}
if (itemTemplate.Quality >= MAX_ITEM_QUALITY)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong Quality value (%u)", entry, itemTemplate.Quality);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Quality value (%u)", entry, itemTemplate.Quality);
itemTemplate.Quality = ITEM_QUALITY_NORMAL;
}
@@ -2245,36 +2228,36 @@ void ObjectMgr::LoadItemTemplates()
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE))
if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0)
- sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.",
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.",
entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_HORDE_ONLY);
if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY)
- sLog->outErrorDb("Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.",
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.",
entry, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY, ITEM_FLAGS_EXTRA_HORDE_ONLY);
}
else if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY)
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE))
if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0)
- sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.",
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.",
entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY);
}
if (itemTemplate.BuyCount <= 0)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).", entry, itemTemplate.BuyCount);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).", entry, itemTemplate.BuyCount);
itemTemplate.BuyCount = 1;
}
if (itemTemplate.InventoryType >= MAX_INVTYPE)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)", entry, itemTemplate.InventoryType);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong InventoryType value (%u)", entry, itemTemplate.InventoryType);
itemTemplate.InventoryType = INVTYPE_NON_EQUIP;
}
if (itemTemplate.RequiredSkill >= MAX_SKILL_TYPE)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)", entry, itemTemplate.RequiredSkill);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong RequiredSkill value (%u)", entry, itemTemplate.RequiredSkill);
itemTemplate.RequiredSkill = 0;
}
@@ -2294,60 +2277,60 @@ void ObjectMgr::LoadItemTemplates()
if (req)
{
if (!(itemTemplate.AllowableClass & CLASSMASK_ALL_PLAYABLE))
- sLog->outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.AllowableClass);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.AllowableClass);
if (!(itemTemplate.AllowableRace & RACEMASK_ALL_PLAYABLE))
- sLog->outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.AllowableRace);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.AllowableRace);
}
}
if (itemTemplate.RequiredSpell && !sSpellMgr->GetSpellInfo(itemTemplate.RequiredSpell))
{
- sLog->outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)", entry, itemTemplate.RequiredSpell);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)", entry, itemTemplate.RequiredSpell);
itemTemplate.RequiredSpell = 0;
}
if (itemTemplate.RequiredReputationRank >= MAX_REPUTATION_RANK)
- sLog->outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.", entry, itemTemplate.RequiredReputationRank);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.", entry, itemTemplate.RequiredReputationRank);
if (itemTemplate.RequiredReputationFaction)
{
if (!sFactionStore.LookupEntry(itemTemplate.RequiredReputationFaction))
{
- sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)", entry, itemTemplate.RequiredReputationFaction);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)", entry, itemTemplate.RequiredReputationFaction);
itemTemplate.RequiredReputationFaction = 0;
}
if (itemTemplate.RequiredReputationRank == MIN_REPUTATION_RANK)
- sLog->outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry);
}
if (itemTemplate.MaxCount < -1)
{
- sLog->outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.", entry, itemTemplate.MaxCount);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.", entry, itemTemplate.MaxCount);
itemTemplate.MaxCount = -1;
}
if (itemTemplate.Stackable == 0)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.", entry, itemTemplate.Stackable);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.", entry, itemTemplate.Stackable);
itemTemplate.Stackable = 1;
}
else if (itemTemplate.Stackable < -1)
{
- sLog->outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.", entry, itemTemplate.Stackable);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.", entry, itemTemplate.Stackable);
itemTemplate.Stackable = -1;
}
if (itemTemplate.ContainerSlots > MAX_BAG_SIZE)
{
- sLog->outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).", entry, itemTemplate.ContainerSlots, MAX_BAG_SIZE);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).", entry, itemTemplate.ContainerSlots, MAX_BAG_SIZE);
itemTemplate.ContainerSlots = MAX_BAG_SIZE;
}
if (itemTemplate.StatsCount > MAX_ITEM_PROTO_STATS)
{
- sLog->outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS);
itemTemplate.StatsCount = MAX_ITEM_PROTO_STATS;
}
@@ -2356,7 +2339,7 @@ void ObjectMgr::LoadItemTemplates()
// for ItemStatValue != 0
if (itemTemplate.ItemStat[j].ItemStatValue && itemTemplate.ItemStat[j].ItemStatType >= MAX_ITEM_MOD)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType);
itemTemplate.ItemStat[j].ItemStatType = 0;
}
@@ -2364,7 +2347,7 @@ void ObjectMgr::LoadItemTemplates()
{
case ITEM_MOD_SPELL_HEALING_DONE:
case ITEM_MOD_SPELL_DAMAGE_DONE:
- sLog->outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has deprecated stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType);
break;
default:
break;
@@ -2375,7 +2358,7 @@ void ObjectMgr::LoadItemTemplates()
{
if (itemTemplate.Damage[j].DamageType >= MAX_SPELL_SCHOOL)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)", entry, j+1, itemTemplate.Damage[j].DamageType);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong dmg_type%d (%u)", entry, j+1, itemTemplate.Damage[j].DamageType);
itemTemplate.Damage[j].DamageType = 0;
}
}
@@ -2386,7 +2369,7 @@ void ObjectMgr::LoadItemTemplates()
// spell_1
if (itemTemplate.Spells[0].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format", entry, 0+1, itemTemplate.Spells[0].SpellTrigger);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format", entry, 0+1, itemTemplate.Spells[0].SpellTrigger);
itemTemplate.Spells[0].SpellId = 0;
itemTemplate.Spells[0].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
itemTemplate.Spells[1].SpellId = 0;
@@ -2396,14 +2379,14 @@ void ObjectMgr::LoadItemTemplates()
// spell_2 have learning spell
if (itemTemplate.Spells[1].SpellTrigger != ITEM_SPELLTRIGGER_LEARN_SPELL_ID)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.", entry, 1+1, itemTemplate.Spells[1].SpellTrigger);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.", entry, 1+1, itemTemplate.Spells[1].SpellTrigger);
itemTemplate.Spells[0].SpellId = 0;
itemTemplate.Spells[1].SpellId = 0;
itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
}
else if (!itemTemplate.Spells[1].SpellId)
{
- sLog->outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.", entry, 1+1);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.", entry, 1+1);
itemTemplate.Spells[0].SpellId = 0;
itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
}
@@ -2412,7 +2395,7 @@ void ObjectMgr::LoadItemTemplates()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[1].SpellId);
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, NULL))
{
- sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId);
itemTemplate.Spells[0].SpellId = 0;
itemTemplate.Spells[1].SpellId = 0;
itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
@@ -2420,7 +2403,7 @@ void ObjectMgr::LoadItemTemplates()
// allowed only in special format
else if ((itemTemplate.Spells[1].SpellId == 483) || (itemTemplate.Spells[1].SpellId == 55884))
{
- sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId);
itemTemplate.Spells[0].SpellId = 0;
itemTemplate.Spells[1].SpellId = 0;
itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
@@ -2432,13 +2415,13 @@ void ObjectMgr::LoadItemTemplates()
{
if (itemTemplate.Spells[j].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger);
itemTemplate.Spells[j].SpellId = 0;
itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
}
else if (itemTemplate.Spells[j].SpellId != 0)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format", entry, j+1, itemTemplate.Spells[j].SpellId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format", entry, j+1, itemTemplate.Spells[j].SpellId);
itemTemplate.Spells[j].SpellId = 0;
}
}
@@ -2450,7 +2433,7 @@ void ObjectMgr::LoadItemTemplates()
{
if (itemTemplate.Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || itemTemplate.Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger);
itemTemplate.Spells[j].SpellId = 0;
itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
}
@@ -2460,13 +2443,13 @@ void ObjectMgr::LoadItemTemplates()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[j].SpellId);
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, NULL))
{
- sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId);
itemTemplate.Spells[j].SpellId = 0;
}
// allowed only in special format
else if ((itemTemplate.Spells[j].SpellId == 483) || (itemTemplate.Spells[j].SpellId == 55884))
{
- sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId);
itemTemplate.Spells[j].SpellId = 0;
}
}
@@ -2474,17 +2457,17 @@ void ObjectMgr::LoadItemTemplates()
}
if (itemTemplate.Bonding >= MAX_BIND_TYPE)
- sLog->outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)", entry, itemTemplate.Bonding);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Bonding value (%u)", entry, itemTemplate.Bonding);
if (itemTemplate.PageText && !GetPageText(itemTemplate.PageText))
- sLog->outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", entry, itemTemplate.PageText);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has non existing first page (Id:%u)", entry, itemTemplate.PageText);
if (itemTemplate.LockID && !sLockStore.LookupEntry(itemTemplate.LockID))
- sLog->outErrorDb("Item (Entry: %u) has wrong LockID (%u)", entry, itemTemplate.LockID);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong LockID (%u)", entry, itemTemplate.LockID);
if (itemTemplate.Sheath >= MAX_SHEATHETYPE)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong Sheath (%u)", entry, itemTemplate.Sheath);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Sheath (%u)", entry, itemTemplate.Sheath);
itemTemplate.Sheath = SHEATHETYPE_NONE;
}
@@ -2496,28 +2479,28 @@ void ObjectMgr::LoadItemTemplates()
else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomProperty)))
{
- sLog->outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)", entry, itemTemplate.RandomProperty);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)", entry, itemTemplate.RandomProperty);
itemTemplate.RandomProperty = 0;
}
}
if (itemTemplate.RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomSuffix)))
{
- sLog->outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)", entry, itemTemplate.RandomSuffix);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong RandomSuffix (%u)", entry, itemTemplate.RandomSuffix);
itemTemplate.RandomSuffix = 0;
}
if (itemTemplate.ItemSet && !sItemSetStore.LookupEntry(itemTemplate.ItemSet))
{
- sLog->outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)", entry, itemTemplate.ItemSet);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) have wrong ItemSet (%u)", entry, itemTemplate.ItemSet);
itemTemplate.ItemSet = 0;
}
if (itemTemplate.Area && !GetAreaEntryByAreaID(itemTemplate.Area))
- sLog->outErrorDb("Item (Entry: %u) has wrong Area (%u)", entry, itemTemplate.Area);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Area (%u)", entry, itemTemplate.Area);
if (itemTemplate.Map && !sMapStore.LookupEntry(itemTemplate.Map))
- sLog->outErrorDb("Item (Entry: %u) has wrong Map (%u)", entry, itemTemplate.Map);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Map (%u)", entry, itemTemplate.Map);
if (itemTemplate.BagFamily)
{
@@ -2531,7 +2514,7 @@ void ObjectMgr::LoadItemTemplates()
ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1);
if (!bf)
{
- sLog->outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry);
itemTemplate.BagFamily &= ~mask;
continue;
}
@@ -2541,7 +2524,7 @@ void ObjectMgr::LoadItemTemplates()
CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemTemplate.ItemId);
if (!ctEntry)
{
- sLog->outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry);
itemTemplate.BagFamily &= ~mask;
}
}
@@ -2549,41 +2532,41 @@ void ObjectMgr::LoadItemTemplates()
}
if (itemTemplate.TotemCategory && !sTotemCategoryStore.LookupEntry(itemTemplate.TotemCategory))
- sLog->outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)", entry, itemTemplate.TotemCategory);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong TotemCategory (%u)", entry, itemTemplate.TotemCategory);
for (uint8 j = 0; j < MAX_ITEM_PROTO_SOCKETS; ++j)
{
if (itemTemplate.Socket[j].Color && (itemTemplate.Socket[j].Color & SOCKET_COLOR_ALL) != itemTemplate.Socket[j].Color)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)", entry, j+1, itemTemplate.Socket[j].Color);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong socketColor_%d (%u)", entry, j+1, itemTemplate.Socket[j].Color);
itemTemplate.Socket[j].Color = 0;
}
}
if (itemTemplate.GemProperties && !sGemPropertiesStore.LookupEntry(itemTemplate.GemProperties))
- sLog->outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)", entry, itemTemplate.GemProperties);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong GemProperties (%u)", entry, itemTemplate.GemProperties);
if (itemTemplate.FoodType >= MAX_PET_DIET)
{
- sLog->outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)", entry, itemTemplate.FoodType);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong FoodType value (%u)", entry, itemTemplate.FoodType);
itemTemplate.FoodType = 0;
}
if (itemTemplate.ItemLimitCategory && !sItemLimitCategoryStore.LookupEntry(itemTemplate.ItemLimitCategory))
{
- sLog->outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)", entry, itemTemplate.ItemLimitCategory);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong LimitCategory value (%u)", entry, itemTemplate.ItemLimitCategory);
itemTemplate.ItemLimitCategory = 0;
}
if (itemTemplate.HolidayId && !sHolidaysStore.LookupEntry(itemTemplate.HolidayId))
{
- sLog->outErrorDb("Item (Entry: %u) has wrong HolidayId value (%u)", entry, itemTemplate.HolidayId);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong HolidayId value (%u)", entry, itemTemplate.HolidayId);
itemTemplate.HolidayId = 0;
}
if (itemTemplate.FlagsCu & ITEM_FLAGS_CU_DURATION_REAL_TIME && !itemTemplate.Duration)
{
- sLog->outErrorDb("Item (Entry %u) has flag ITEM_FLAGS_CU_DURATION_REAL_TIME but it does not have duration limit", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry %u) has flag ITEM_FLAGS_CU_DURATION_REAL_TIME but it does not have duration limit", entry);
itemTemplate.FlagsCu &= ~ITEM_FLAGS_CU_DURATION_REAL_TIME;
}
@@ -2612,10 +2595,9 @@ void ObjectMgr::LoadItemTemplates()
}
for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
- sLog->outErrorDb("Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
- sLog->outString(">> Loaded %u item templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
@@ -2650,8 +2632,7 @@ void ObjectMgr::LoadItemSetNameLocales()
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Name);
} while (result->NextRow());
- sLog->outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadItemSetNames()
@@ -2679,8 +2660,7 @@ void ObjectMgr::LoadItemSetNames()
if (!result)
{
- sLog->outString(">> Loaded 0 item set names. DB table `item_set_names` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 item set names. DB table `item_set_names` is empty.");
return;
}
@@ -2694,7 +2674,7 @@ void ObjectMgr::LoadItemSetNames()
uint32 entry = fields[0].GetUInt32();
if (itemSetItems.find(entry) == itemSetItems.end())
{
- sLog->outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry);
continue;
}
@@ -2704,7 +2684,7 @@ void ObjectMgr::LoadItemSetNames()
uint32 invType = fields[2].GetUInt8();
if (invType >= MAX_INVTYPE)
{
- sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType);
+ sLog->outError(LOG_FILTER_SQL, "Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType);
invType = INVTYPE_NON_EQUIP;
}
@@ -2723,19 +2703,18 @@ void ObjectMgr::LoadItemSetNames()
pProto = sObjectMgr->GetItemTemplate(entry);
if (pProto)
{
- sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
ItemSetNameEntry &data = _itemSetNameStore[entry];
data.name = pProto->Name1;
data.InventoryType = pProto->InventoryType;
++count;
}
else
- sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry);
}
}
- sLog->outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadVehicleTemplateAccessories()
@@ -2751,8 +2730,8 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
+
return;
}
@@ -2769,19 +2748,19 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
if (!sObjectMgr->GetCreatureTemplate(uiEntry))
{
- sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry);
continue;
}
if (!sObjectMgr->GetCreatureTemplate(uiAccessory))
{
- sLog->outErrorDb("Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory);
continue;
}
if (_spellClickInfoStore.find(uiEntry) == _spellClickInfoStore.end())
{
- sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry);
continue;
}
@@ -2791,8 +2770,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadVehicleAccessories()
@@ -2808,8 +2786,7 @@ void ObjectMgr::LoadVehicleAccessories()
if (!result)
{
- sLog->outString(">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime));
return;
}
@@ -2826,7 +2803,7 @@ void ObjectMgr::LoadVehicleAccessories()
if (!sObjectMgr->GetCreatureTemplate(uiAccessory))
{
- sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
continue;
}
@@ -2836,8 +2813,7 @@ void ObjectMgr::LoadVehicleAccessories()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadPetLevelInfo()
@@ -2849,8 +2825,8 @@ void ObjectMgr::LoadPetLevelInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
+
return;
}
@@ -2863,7 +2839,7 @@ void ObjectMgr::LoadPetLevelInfo()
uint32 creature_id = fields[0].GetUInt32();
if (!sObjectMgr->GetCreatureTemplate(creature_id))
{
- sLog->outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id);
+ sLog->outError(LOG_FILTER_SQL, "Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id);
continue;
}
@@ -2871,17 +2847,17 @@ void ObjectMgr::LoadPetLevelInfo()
if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
else
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
}
continue;
}
else if (current_level < 1)
{
- sLog->outErrorDb("Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level);
continue;
}
@@ -2914,7 +2890,7 @@ void ObjectMgr::LoadPetLevelInfo()
// fatal error if no level 1 data
if (!pInfo || pInfo[0].health == 0)
{
- sLog->outErrorDb("Creature %u does not have pet stats data for Level 1!", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Creature %u does not have pet stats data for Level 1!", itr->first);
exit(1);
}
@@ -2923,14 +2899,13 @@ void ObjectMgr::LoadPetLevelInfo()
{
if (pInfo[level].health == 0)
{
- sLog->outErrorDb("Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level);
pInfo[level] = pInfo[level-1];
}
}
}
- sLog->outString(">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const
@@ -2952,7 +2927,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
else
{
if (count < -1)
- sLog->outErrorDb("Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
+ sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
uint32 RaceClass = (race_) | (class_ << 8);
bool doneOne = false;
@@ -2974,7 +2949,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
}
if (!found)
- sLog->outErrorDb("Item %u specified to be removed from original create info not found in dbc!", itemId);
+ sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId);
if (!doneOne)
doneOne = true;
@@ -2996,8 +2971,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outString();
- sLog->outErrorDb(">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
+
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
exit(1);
}
else
@@ -3019,39 +2994,39 @@ void ObjectMgr::LoadPlayerInfo()
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
continue;
}
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race);
if (!rEntry)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
continue;
}
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
continue;
}
if (!sChrClassesStore.LookupEntry(current_class))
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
continue;
}
// accept DB data only for valid position (and non instanceable)
if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation))
{
- sLog->outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
continue;
}
if (sMapStore.LookupEntry(mapId)->Instanceable())
{
- sLog->outErrorDb("Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
+ sLog->outError(LOG_FILTER_SQL, "Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
continue;
}
@@ -3071,13 +3046,12 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Load playercreate items
- sLog->outString("Loading Player Create Items Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Items Data...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3
@@ -3085,8 +3059,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outString(">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
}
else
{
@@ -3099,14 +3072,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class);
continue;
}
@@ -3114,7 +3087,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!GetItemTemplate(item_id))
{
- sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
+ sLog->outError(LOG_FILTER_SQL, "Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
continue;
}
@@ -3122,7 +3095,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!amount)
{
- sLog->outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
+ sLog->outError(LOG_FILTER_SQL, "Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
continue;
}
@@ -3143,13 +3116,12 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Load playercreate spells
- sLog->outString("Loading Player Create Spell Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Spell Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3158,8 +3130,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell");
+
}
else
{
@@ -3172,14 +3144,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class);
continue;
}
@@ -3200,13 +3172,12 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Load playercreate actions
- sLog->outString("Loading Player Create Action Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Action Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3215,8 +3186,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
+
}
else
{
@@ -3229,14 +3200,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class);
continue;
}
@@ -3247,13 +3218,12 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Loading levels data (class only dependent)
- sLog->outString("Loading Player Create Level HP/Mana Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Level HP/Mana Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3262,8 +3232,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty.");
+
exit(1);
}
@@ -3276,14 +3246,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_class = fields[0].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `player_classlevelstats` table, ignoring.", current_class);
continue;
}
uint8 current_level = fields[1].GetUInt8(); // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type
if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
continue;
}
@@ -3314,7 +3284,7 @@ void ObjectMgr::LoadPlayerInfo()
// fatal error if no level 1 data
if (!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0)
{
- sLog->outErrorDb("Class %i Level 1 does not have health/mana data!", class_);
+ sLog->outError(LOG_FILTER_SQL, "Class %i Level 1 does not have health/mana data!", class_);
exit(1);
}
@@ -3323,18 +3293,17 @@ void ObjectMgr::LoadPlayerInfo()
{
if (pClassInfo->levelInfo[level].basehealth == 0)
{
- sLog->outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level);
pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level-1];
}
}
}
- sLog->outString(">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
// Loading levels data (class/race dependent)
- sLog->outString("Loading Player Create Level Stats Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Level Stats Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3343,8 +3312,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
+
exit(1);
}
@@ -3357,14 +3326,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `player_levelstats` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `player_levelstats` table, ignoring.", current_class);
continue;
}
@@ -3372,10 +3341,10 @@ void ObjectMgr::LoadPlayerInfo()
if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
else
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
}
continue;
@@ -3427,7 +3396,7 @@ void ObjectMgr::LoadPlayerInfo()
// fatal error if no level 1 data
if (!pInfo->levelInfo || pInfo->levelInfo[0].stats[0] == 0)
{
- sLog->outErrorDb("Race %i Class %i Level 1 does not have stats data!", race, class_);
+ sLog->outError(LOG_FILTER_SQL, "Race %i Class %i Level 1 does not have stats data!", race, class_);
exit(1);
}
@@ -3436,19 +3405,18 @@ void ObjectMgr::LoadPlayerInfo()
{
if (pInfo->levelInfo[level].stats[0] == 0)
{
- sLog->outErrorDb("Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level);
pInfo->levelInfo[level] = pInfo->levelInfo[level-1];
}
}
}
}
- sLog->outString(">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
// Loading xp per level data
- sLog->outString("Loading Player Create XP Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create XP Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3461,8 +3429,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
+
exit(1);
}
@@ -3478,10 +3446,10 @@ void ObjectMgr::LoadPlayerInfo()
if (current_level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level);
else
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
}
continue;
@@ -3497,13 +3465,12 @@ void ObjectMgr::LoadPlayerInfo()
{
if (_playerXPperLevel[level] == 0)
{
- sLog->outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level);
_playerXPperLevel[level] = _playerXPperLevel[level-1]+100;
}
}
- sLog->outString(">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -3660,8 +3627,8 @@ void ObjectMgr::LoadQuests()
" FROM quest_template");
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
+
return;
}
@@ -3690,18 +3657,18 @@ void ObjectMgr::LoadQuests()
// additional quest integrity checks (GO, creature_template and item_template must be loaded already)
if (qinfo->GetQuestMethod() >= 3)
- sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
{
- sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
}
if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY)
{
- sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
qinfo->Flags &= ~QUEST_FLAGS_DAILY;
}
@@ -3709,7 +3676,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
{
- sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
}
}
@@ -3718,7 +3685,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
{
- sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
}
}
@@ -3730,7 +3697,7 @@ void ObjectMgr::LoadQuests()
{
if (uint32 id = qinfo->RewardChoiceItemId[j])
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest ignore this data
}
@@ -3742,7 +3709,7 @@ void ObjectMgr::LoadQuests()
{
if (!GetAreaEntryByAreaID(qinfo->ZoneOrSort))
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.",
qinfo->GetQuestId(), qinfo->ZoneOrSort);
// no changes, quest not dependent from this value but can have problems at client
}
@@ -3753,7 +3720,7 @@ void ObjectMgr::LoadQuests()
QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->ZoneOrSort));
if (!qSort)
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.",
qinfo->GetQuestId(), qinfo->ZoneOrSort);
// no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check)
}
@@ -3762,7 +3729,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredSkillId != skill_id)
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id);
//override, and force proper value here?
}
@@ -3774,7 +3741,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->RequiredClasses & CLASSMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses);
qinfo->RequiredClasses = 0;
}
}
@@ -3783,7 +3750,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->RequiredRaces & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces);
qinfo->RequiredRaces = 0;
}
}
@@ -3792,7 +3759,7 @@ void ObjectMgr::LoadQuests()
{
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId))
{
- sLog->outErrorDb("Quest %u has `RequiredSkillId` = %u but this skill does not exist",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSkillId` = %u but this skill does not exist",
qinfo->GetQuestId(), qinfo->RequiredSkillId);
}
}
@@ -3801,7 +3768,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue())
{
- sLog->outErrorDb("Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue());
// no changes, quest can't be done for this requirement
}
@@ -3810,77 +3777,77 @@ void ObjectMgr::LoadQuests()
if (qinfo->RequiredFactionId2 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId2))
{
- sLog->outErrorDb("Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredFactionId2, qinfo->RequiredFactionId2);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredFactionId1 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId1))
{
- sLog->outErrorDb("Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredFactionId1, qinfo->RequiredFactionId1);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction))
{
- sLog->outErrorDb("Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMinRepFaction, qinfo->RequiredMinRepFaction);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction))
{
- sLog->outErrorDb("Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMaxRepFaction, qinfo->RequiredMaxRepFaction);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap)
{
- sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMinRepValue, ReputationMgr::Reputation_Cap);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMinRepValue && qinfo->RequiredMaxRepValue && qinfo->RequiredMaxRepValue <= qinfo->RequiredMinRepValue)
{
- sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue, qinfo->RequiredMinRepValue);
// no changes, quest can't be done for this requirement
}
if (!qinfo->RequiredFactionId1 && qinfo->RequiredFactionValue1 != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredFactionValue1);
// warning
}
if (!qinfo->RequiredFactionId2 && qinfo->RequiredFactionValue2 != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredFactionValue2);
// warning
}
if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredMinRepValue);
// warning
}
if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue);
// warning
}
if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId))
{
- sLog->outErrorDb("Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId());
qinfo->RewardTitleId = 0;
// quest can't reward this title
@@ -3890,20 +3857,20 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId))
{
- sLog->outErrorDb("Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId);
qinfo->SourceItemId = 0; // quest can't be done for this requirement
}
else if (qinfo->SourceItemIdCount == 0)
{
- sLog->outErrorDb("Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.",
qinfo->GetQuestId(), qinfo->SourceItemId);
qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB
}
}
else if (qinfo->SourceItemIdCount>0)
{
- sLog->outErrorDb("Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
qinfo->GetQuestId(), qinfo->SourceItemIdCount);
qinfo->SourceItemIdCount=0; // no quest work changes in fact
}
@@ -3913,13 +3880,13 @@ void ObjectMgr::LoadQuests()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellid);
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
}
@@ -3932,7 +3899,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredItemCount[j] == 0)
{
- sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest can't be done for this requirement
}
@@ -3941,14 +3908,14 @@ void ObjectMgr::LoadQuests()
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, id);
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
}
}
else if (qinfo->RequiredItemCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]);
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
}
@@ -3961,7 +3928,7 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, id);
// no changes, quest can't be done for this requirement
}
@@ -3970,7 +3937,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredSourceItemCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemCount[j]);
// no changes, quest ignore this data
}
@@ -3985,7 +3952,7 @@ void ObjectMgr::LoadQuests()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, id);
continue;
}
@@ -4007,7 +3974,7 @@ void ObjectMgr::LoadQuests()
{
if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
+ sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
// this will prevent quest completing without objective
const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
@@ -4015,7 +3982,7 @@ void ObjectMgr::LoadQuests()
}
else
{
- sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1, id);
// no changes, quest can't be done for this requirement
}
@@ -4028,14 +3995,14 @@ void ObjectMgr::LoadQuests()
int32 id = qinfo->RequiredNpcOrGo[j];
if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id))
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, uint32(-id));
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
}
if (id > 0 && !sObjectMgr->GetCreatureTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, uint32(id));
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
}
@@ -4048,14 +4015,14 @@ void ObjectMgr::LoadQuests()
if (!qinfo->RequiredNpcOrGoCount[j])
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest can be incorrectly done, but we already report this
}
}
else if (qinfo->RequiredNpcOrGoCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredNpcOrGoCount[j]);
// no changes, quest ignore this data
}
@@ -4068,21 +4035,21 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
qinfo->GetQuestId(), j+1, id, id);
qinfo->RewardChoiceItemId[j] = 0; // no changes, quest will not reward this
}
if (!qinfo->RewardChoiceItemCount[j])
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest can't be done
}
}
else if (qinfo->RewardChoiceItemCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardChoiceItemCount[j]);
// no changes, quest ignore this data
}
@@ -4095,21 +4062,21 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
qinfo->GetQuestId(), j+1, id, id);
qinfo->RewardItemId[j] = 0; // no changes, quest will not reward this item
}
if (!qinfo->RewardItemIdCount[j])
{
- sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes
}
}
else if (qinfo->RewardItemIdCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardItemIdCount[j]);
// no changes, quest ignore this data
}
@@ -4121,18 +4088,18 @@ void ObjectMgr::LoadQuests()
{
if (abs(qinfo->RewardFactionValueId[j]) > 9)
{
- sLog->outErrorDb("Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]);
}
if (!sFactionStore.LookupEntry(qinfo->RewardFactionId[j]))
{
- sLog->outErrorDb("Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]);
qinfo->RewardFactionId[j] = 0; // quest will not reward this
}
}
else if (qinfo->RewardFactionValueIdOverride[j] != 0)
{
- sLog->outErrorDb("Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardFactionValueIdOverride[j]);
// no changes, quest ignore this data
}
@@ -4144,21 +4111,21 @@ void ObjectMgr::LoadQuests()
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
qinfo->RewardSpell = 0; // no spell reward will display for this quest
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
qinfo->RewardSpell = 0; // no spell reward will display for this quest
}
else if (GetTalentSpellCost(qinfo->RewardSpell))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
qinfo->RewardSpell = 0; // no spell reward will display for this quest
}
@@ -4170,21 +4137,21 @@ void ObjectMgr::LoadQuests()
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
else if (GetTalentSpellCost(qinfo->RewardSpellCast))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
@@ -4194,7 +4161,7 @@ void ObjectMgr::LoadQuests()
{
if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId))
{
- sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId);
qinfo->RewardMailTemplateId = 0; // no mail will send to player
qinfo->RewardMailDelay = 0; // no mail will send to player
@@ -4202,7 +4169,7 @@ void ObjectMgr::LoadQuests()
else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end())
{
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId);
- sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second);
qinfo->RewardMailTemplateId = 0; // no mail will send to player
qinfo->RewardMailDelay = 0; // no mail will send to player
@@ -4216,7 +4183,7 @@ void ObjectMgr::LoadQuests()
QuestMap::iterator qNextItr = _questTemplates.find(qinfo->NextQuestIdChain);
if (qNextItr == _questTemplates.end())
{
- sLog->outErrorDb("Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
qinfo->GetQuestId(), qinfo->NextQuestIdChain, qinfo->NextQuestIdChain);
qinfo->NextQuestIdChain = 0;
}
@@ -4229,7 +4196,7 @@ void ObjectMgr::LoadQuests()
{
if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end())
{
- sLog->outErrorDb("Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId());
}
else
{
@@ -4242,7 +4209,7 @@ void ObjectMgr::LoadQuests()
QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId()));
if (qNextItr == _questTemplates.end())
{
- sLog->outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
}
else
{
@@ -4281,7 +4248,7 @@ void ObjectMgr::LoadQuests()
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id);
// this will prevent quest completing without objective
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
@@ -4289,8 +4256,7 @@ void ObjectMgr::LoadQuests()
}
}
- sLog->outString(">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadQuestLocales()
@@ -4338,8 +4304,7 @@ void ObjectMgr::LoadQuestLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadScripts(ScriptsType type)
@@ -4357,7 +4322,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (sScriptMgr->IsScriptScheduled()) // function cannot be called when scripts are in use.
return;
- sLog->outString("Loading %s...", tableName.c_str());
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading %s...", tableName.c_str());
scripts->clear(); // need for reload support
@@ -4367,8 +4332,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (!result)
{
- sLog->outString(">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str());
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str());
return;
}
@@ -4399,19 +4363,19 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (tmp.Talk.ChatType > CHAT_TYPE_WHISPER && tmp.Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER)
{
- sLog->outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.ChatType, tmp.id);
continue;
}
if (!tmp.Talk.TextID)
{
- sLog->outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.TextID, tmp.id);
continue;
}
if (tmp.Talk.TextID < MIN_DB_SCRIPT_STRING_ID || tmp.Talk.TextID >= MAX_DB_SCRIPT_STRING_ID)
{
- sLog->outErrorDb("Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.TextID, MIN_DB_SCRIPT_STRING_ID, MAX_DB_SCRIPT_STRING_ID, tmp.id);
continue;
}
@@ -4423,7 +4387,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sEmotesStore.LookupEntry(tmp.Emote.EmoteID))
{
- sLog->outErrorDb("Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u",
tableName.c_str(), tmp.Emote.EmoteID, tmp.id);
continue;
}
@@ -4434,14 +4398,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sMapStore.LookupEntry(tmp.TeleportTo.MapID))
{
- sLog->outErrorDb("Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
tableName.c_str(), tmp.TeleportTo.MapID, tmp.id);
continue;
}
if (!Trinity::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
{
- sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
tableName.c_str(), tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation, tmp.id);
continue;
}
@@ -4453,14 +4417,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
Quest const* quest = GetQuestTemplate(tmp.QuestExplored.QuestID);
if (!quest)
{
- sLog->outErrorDb("Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id);
continue;
}
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id);
// this will prevent quest completing without objective
@@ -4471,21 +4435,21 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (float(tmp.QuestExplored.Distance) > DEFAULT_VISIBILITY_DISTANCE)
{
- sLog->outErrorDb("Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
tableName.c_str(), tmp.QuestExplored.Distance, tmp.id);
continue;
}
if (tmp.QuestExplored.Distance && float(tmp.QuestExplored.Distance) > DEFAULT_VISIBILITY_DISTANCE)
{
- sLog->outErrorDb("Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check",
tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, DEFAULT_VISIBILITY_DISTANCE);
continue;
}
if (tmp.QuestExplored.Distance && float(tmp.QuestExplored.Distance) < INTERACTION_DISTANCE)
{
- sLog->outErrorDb("Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check",
tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, INTERACTION_DISTANCE);
continue;
}
@@ -4497,7 +4461,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!GetCreatureTemplate(tmp.KillCredit.CreatureEntry))
{
- sLog->outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u",
tableName.c_str(), tmp.KillCredit.CreatureEntry, tmp.id);
continue;
}
@@ -4509,7 +4473,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectData const* data = GetGOData(tmp.RespawnGameobject.GOGuid);
if (!data)
{
- sLog->outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
tableName.c_str(), tmp.RespawnGameobject.GOGuid, tmp.id);
continue;
}
@@ -4517,7 +4481,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectTemplate const* info = GetGameObjectTemplate(data->id);
if (!info)
{
- sLog->outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
tableName.c_str(), tmp.RespawnGameobject.GOGuid, data->id, tmp.id);
continue;
}
@@ -4528,7 +4492,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
info->type == GAMEOBJECT_TYPE_BUTTON ||
info->type == GAMEOBJECT_TYPE_TRAP)
{
- sLog->outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
tableName.c_str(), info->entry, tmp.id);
continue;
}
@@ -4539,14 +4503,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!Trinity::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
{
- sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
tableName.c_str(), tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation, tmp.id);
continue;
}
if (!GetCreatureTemplate(tmp.TempSummonCreature.CreatureEntry))
{
- sLog->outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
tableName.c_str(), tmp.TempSummonCreature.CreatureEntry, tmp.id);
continue;
}
@@ -4559,7 +4523,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectData const* data = GetGOData(tmp.ToggleDoor.GOGuid);
if (!data)
{
- sLog->outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",
tableName.c_str(), tmp.ToggleDoor.GOGuid, GetScriptCommandName(tmp.command).c_str(), tmp.id);
continue;
}
@@ -4567,14 +4531,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectTemplate const* info = GetGameObjectTemplate(data->id);
if (!info)
{
- sLog->outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",
tableName.c_str(), tmp.ToggleDoor.GOGuid, data->id, GetScriptCommandName(tmp.command).c_str(), tmp.id);
continue;
}
if (info->type != GAMEOBJECT_TYPE_DOOR)
{
- sLog->outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject type (%u) non supported by command %s for script id %u",
tableName.c_str(), info->entry, GetScriptCommandName(tmp.command).c_str(), tmp.id);
continue;
}
@@ -4586,13 +4550,13 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sSpellMgr->GetSpellInfo(tmp.RemoveAura.SpellID))
{
- sLog->outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
tableName.c_str(), tmp.RemoveAura.SpellID, tmp.id);
continue;
}
if (tmp.RemoveAura.Flags & ~0x1) // 1 bits (0, 1)
{
- sLog->outErrorDb("Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
tableName.c_str(), tmp.RemoveAura.Flags, tmp.id);
continue;
}
@@ -4603,25 +4567,25 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sSpellMgr->GetSpellInfo(tmp.CastSpell.SpellID))
{
- sLog->outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.SpellID, tmp.id);
continue;
}
if (tmp.CastSpell.Flags > 4) // targeting type
{
- sLog->outErrorDb("Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.Flags, tmp.id);
continue;
}
if (tmp.CastSpell.Flags != 4 && tmp.CastSpell.CreatureEntry & ~0x1) // 1 bit (0, 1)
{
- sLog->outErrorDb("Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id);
continue;
}
else if (tmp.CastSpell.Flags == 4 && !GetCreatureTemplate(tmp.CastSpell.CreatureEntry))
{
- sLog->outErrorDb("Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id);
continue;
}
@@ -4632,13 +4596,13 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!GetItemTemplate(tmp.CreateItem.ItemEntry))
{
- sLog->outErrorDb("Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u",
tableName.c_str(), tmp.CreateItem.ItemEntry, tmp.id);
continue;
}
if (!tmp.CreateItem.Amount)
{
- sLog->outErrorDb("Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u",
tableName.c_str(), tmp.CreateItem.Amount, tmp.id);
continue;
}
@@ -4659,8 +4623,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
}
while (result->NextRow());
- sLog->outString(">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadGameObjectScripts()
@@ -4671,7 +4634,7 @@ void ObjectMgr::LoadGameObjectScripts()
for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr)
{
if (!GetGOData(itr->first))
- sLog->outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first);
}
}
@@ -4683,7 +4646,7 @@ void ObjectMgr::LoadQuestEndScripts()
for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr)
{
if (!GetQuestTemplate(itr->first))
- sLog->outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first);
}
}
@@ -4695,7 +4658,7 @@ void ObjectMgr::LoadQuestStartScripts()
for (ScriptMapMap::const_iterator itr = sQuestStartScripts.begin(); itr != sQuestStartScripts.end(); ++itr)
{
if (!GetQuestTemplate(itr->first))
- sLog->outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first);
}
}
@@ -4711,14 +4674,14 @@ void ObjectMgr::LoadSpellScripts()
if (!spellInfo)
{
- sLog->outErrorDb("Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId);
continue;
}
uint8 i = (uint8)((uint32(itr->first) >> 24) & 0x000000FF);
//check for correct spellEffect
if (!spellInfo->Effects[i].Effect || (spellInfo->Effects[i].Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->Effects[i].Effect != SPELL_EFFECT_DUMMY))
- sLog->outErrorDb("Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i);
}
}
@@ -4760,7 +4723,7 @@ void ObjectMgr::LoadEventScripts()
{
std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
if (itr2 == evt_scripts.end())
- sLog->outErrorDb("Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u",
itr->first, SPELL_EFFECT_SEND_EVENT);
}
}
@@ -4791,7 +4754,7 @@ void ObjectMgr::LoadWaypointScripts()
}
for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr)
- sLog->outErrorDb("There is no waypoint which links to the waypoint script %u", *itr);
+ sLog->outError(LOG_FILTER_SQL, "There is no waypoint which links to the waypoint script %u", *itr);
}
void ObjectMgr::LoadSpellScriptNames()
@@ -4804,8 +4767,7 @@ void ObjectMgr::LoadSpellScriptNames()
if (!result)
{
- sLog->outString(">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
return;
}
@@ -4816,11 +4778,11 @@ void ObjectMgr::LoadSpellScriptNames()
Field* fields = result->Fetch();
- int32 spellId = fields[0].GetInt32();
+ int32 spellId = fields[0].GetInt32();
const char *scriptName = fields[1].GetCString();
bool allRanks = false;
- if (spellId <=0)
+ if (spellId <= 0)
{
allRanks = true;
spellId = -spellId;
@@ -4829,7 +4791,7 @@ void ObjectMgr::LoadSpellScriptNames()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32());
continue;
}
@@ -4837,7 +4799,7 @@ void ObjectMgr::LoadSpellScriptNames()
{
if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId))
{
- sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32());
continue;
}
while (spellInfo)
@@ -4852,8 +4814,7 @@ void ObjectMgr::LoadSpellScriptNames()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::ValidateSpellScripts()
@@ -4862,8 +4823,7 @@ void ObjectMgr::ValidateSpellScripts()
if (_spellScriptsStore.empty())
{
- sLog->outString(">> Validated 0 scripts.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated 0 scripts.");
return;
}
@@ -4883,7 +4843,7 @@ void ObjectMgr::ValidateSpellScripts()
bool valid = true;
if (!spellScript && !auraScript)
{
- sLog->outError("TSCR: Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second));
+ sLog->outError(LOG_FILTER_TSCR, "Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second));
valid = false;
}
if (spellScript)
@@ -4910,8 +4870,7 @@ void ObjectMgr::ValidateSpellScripts()
++count;
}
- sLog->outString(">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadPageTexts()
@@ -4923,8 +4882,7 @@ void ObjectMgr::LoadPageTexts()
if (!result)
{
- sLog->outString(">> Loaded 0 page texts. DB table `page_text` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 page texts. DB table `page_text` is empty!");
return;
}
@@ -4948,13 +4906,12 @@ void ObjectMgr::LoadPageTexts()
{
PageTextContainer::const_iterator itr2 = _pageTextStore.find(itr->second.NextPage);
if (itr2 == _pageTextStore.end())
- sLog->outErrorDb("Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage);
+ sLog->outError(LOG_FILTER_SQL, "Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage);
}
}
- sLog->outString(">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
PageText const* ObjectMgr::GetPageText(uint32 pageEntry)
@@ -4989,8 +4946,7 @@ void ObjectMgr::LoadPageTextLocales()
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Text);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadInstanceTemplate()
@@ -5002,8 +4958,7 @@ void ObjectMgr::LoadInstanceTemplate()
if (!result)
{
- sLog->outString(">> Loaded 0 instance templates. DB table `page_text` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 instance templates. DB table `page_text` is empty!");
return;
}
@@ -5016,7 +4971,7 @@ void ObjectMgr::LoadInstanceTemplate()
if (!MapManager::IsValidMAP(mapID, true))
{
- sLog->outErrorDb("ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID);
+ sLog->outError(LOG_FILTER_SQL, "ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID);
continue;
}
@@ -5032,8 +4987,7 @@ void ObjectMgr::LoadInstanceTemplate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID)
@@ -5053,8 +5007,8 @@ void ObjectMgr::LoadInstanceEncounters()
QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 instance encounters, table is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 instance encounters, table is empty!");
+
return;
}
@@ -5070,13 +5024,13 @@ void ObjectMgr::LoadInstanceEncounters()
DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry);
if (!dungeonEncounter)
{
- sLog->outErrorDb("Table `instance_encounters` has an invalid encounter id %u, skipped!", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid encounter id %u, skipped!", entry);
continue;
}
if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon))
{
- sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon);
continue;
}
@@ -5085,7 +5039,7 @@ void ObjectMgr::LoadInstanceEncounters()
{
if (itr != dungeonLastBosses.end())
{
- sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]);
continue;
}
@@ -5099,7 +5053,7 @@ void ObjectMgr::LoadInstanceEncounters()
CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry);
if (!creatureInfo)
{
- sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
continue;
}
const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
@@ -5108,12 +5062,12 @@ void ObjectMgr::LoadInstanceEncounters()
case ENCOUNTER_CREDIT_CAST_SPELL:
if (!sSpellMgr->GetSpellInfo(creditEntry))
{
- sLog->outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
continue;
}
break;
default:
- sLog->outErrorDb("Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName[0]);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName[0]);
continue;
}
@@ -5122,8 +5076,7 @@ void ObjectMgr::LoadInstanceEncounters()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const
@@ -5143,8 +5096,7 @@ void ObjectMgr::LoadGossipText()
int count = 0;
if (!result)
{
- sLog->outString(">> Loaded %u npc texts", count);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts", count);
return;
}
_gossipTextStore.rehash(result->GetRowCount());
@@ -5161,7 +5113,7 @@ void ObjectMgr::LoadGossipText()
uint32 Text_ID = fields[cic++].GetUInt32();
if (!Text_ID)
{
- sLog->outErrorDb("Table `npc_text` has record wit reserved id 0, ignore.");
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_text` has record wit reserved id 0, ignore.");
continue;
}
@@ -5183,8 +5135,7 @@ void ObjectMgr::LoadGossipText()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadNpcTextLocales()
@@ -5226,8 +5177,7 @@ void ObjectMgr::LoadNpcTextLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
//not very fast function but it is called only once a day, or on starting-up
@@ -5238,7 +5188,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
time_t curTime = time(NULL);
tm* lt = localtime(&curTime);
uint64 basetime(curTime);
- sLog->outDetail("Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec);
// Delete all old mails without item and without body immediately, if starting server
if (!serverUp)
@@ -5252,8 +5202,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
- sLog->outString(">> No expired mails found.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> No expired mails found.");
return; // any mails need to be returned or deleted
}
@@ -5356,8 +5305,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
}
while (result->NextRow());
- sLog->outString(">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadQuestAreaTriggers()
@@ -5370,8 +5318,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
if (!result)
{
- sLog->outString(">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
return;
}
@@ -5389,7 +5336,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID);
continue;
}
@@ -5397,13 +5344,13 @@ void ObjectMgr::LoadQuestAreaTriggers()
if (!quest)
{
- sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID);
+ sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID);
continue;
}
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID);
+ sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID);
// this will prevent quest completing without objective
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
@@ -5415,8 +5362,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
} while (result->NextRow());
- sLog->outString(">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadTavernAreaTriggers()
@@ -5429,8 +5375,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
if (!result)
{
- sLog->outString(">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
return;
}
@@ -5447,15 +5392,14 @@ void ObjectMgr::LoadTavernAreaTriggers()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
_tavernAreaTriggerStore.insert(Trigger_ID);
} while (result->NextRow());
- sLog->outString(">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadAreaTriggerScripts()
@@ -5467,8 +5411,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
if (!result)
{
- sLog->outString(">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
return;
}
@@ -5486,14 +5429,13 @@ void ObjectMgr::LoadAreaTriggerScripts()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
_areaTriggerScriptStore[Trigger_ID] = GetScriptId(scriptName);
} while (result->NextRow());
- sLog->outString(">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team)
@@ -5588,7 +5530,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
mount_id = mount_info->GetRandomValidModelId();
if (!mount_id)
{
- sLog->outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
+ sLog->outError(LOG_FILTER_SQL, "No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
return false;
}
}
@@ -5611,8 +5553,7 @@ void ObjectMgr::LoadGraveyardZones()
if (!result)
{
- sLog->outString(">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
return;
}
@@ -5631,43 +5572,42 @@ void ObjectMgr::LoadGraveyardZones()
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId);
if (!entry)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId);
continue;
}
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
if (!areaEntry)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
continue;
}
if (areaEntry->zone != 0)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId);
continue;
}
if (team != 0 && team != HORDE && team != ALLIANCE)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
continue;
}
if (!AddGraveYardLink(safeLocId, zoneId, team, false))
- sLog->outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
} while (result->NextRow());
- sLog->outString(">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team)
{
enum DefaultGraveyard
{
- HORDE_GRAVEYARD = 10, // Crossroads
- ALLIANCE_GRAVEYARD = 4, // Westfall
+ HORDE_GRAVEYARD = 10, // Crossroads
+ ALLIANCE_GRAVEYARD = 4 // Westfall
};
if (team == HORDE)
@@ -5686,7 +5626,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
{
if (z > -500)
{
- sLog->outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
+ sLog->outError(LOG_FILTER_GENERAL, "ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
return GetDefaultGraveYard(team);
}
}
@@ -5705,7 +5645,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
if (graveLow == graveUp && !map->IsBattleArena())
{
- sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
return GetDefaultGraveYard(team);
}
@@ -5731,7 +5671,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId);
if (!entry)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId);
continue;
}
@@ -5849,7 +5789,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
GraveYardContainer::iterator graveUp = GraveYardStore.upper_bound(zoneId);
if (graveLow == graveUp)
{
- //sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
+ //sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
return;
}
@@ -5904,8 +5844,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
if (!result)
{
- sLog->outString(">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
return;
}
@@ -5930,20 +5869,20 @@ void ObjectMgr::LoadAreaTriggerTeleports()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
MapEntry const* mapEntry = sMapStore.LookupEntry(at.target_mapId);
if (!mapEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId);
continue;
}
if (at.target_X == 0 && at.target_Y == 0 && at.target_Z == 0)
{
- sLog->outErrorDb("Area trigger (ID:%u) target coordinates not provided.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) target coordinates not provided.", Trigger_ID);
continue;
}
@@ -5951,8 +5890,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
} while (result->NextRow());
- sLog->outString(">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadAccessRequirements()
@@ -5965,8 +5903,7 @@ void ObjectMgr::LoadAccessRequirements()
QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
if (!result)
{
- sLog->outString(">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
return;
}
@@ -5998,7 +5935,7 @@ void ObjectMgr::LoadAccessRequirements()
ItemTemplate const* pProto = GetItemTemplate(ar.item);
if (!pProto)
{
- sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty);
ar.item = 0;
}
}
@@ -6008,7 +5945,7 @@ void ObjectMgr::LoadAccessRequirements()
ItemTemplate const* pProto = GetItemTemplate(ar.item2);
if (!pProto)
{
- sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty);
ar.item2 = 0;
}
}
@@ -6017,7 +5954,7 @@ void ObjectMgr::LoadAccessRequirements()
{
if (!GetQuestTemplate(ar.quest_A))
{
- sLog->outErrorDb("Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty);
+ sLog->outError(LOG_FILTER_SQL, "Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty);
ar.quest_A = 0;
}
}
@@ -6026,7 +5963,7 @@ void ObjectMgr::LoadAccessRequirements()
{
if (!GetQuestTemplate(ar.quest_H))
{
- sLog->outErrorDb("Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty);
+ sLog->outError(LOG_FILTER_SQL, "Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty);
ar.quest_H = 0;
}
}
@@ -6035,7 +5972,7 @@ void ObjectMgr::LoadAccessRequirements()
{
if (!sAchievementStore.LookupEntry(ar.achievement))
{
- sLog->outErrorDb("Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty);
+ sLog->outError(LOG_FILTER_SQL, "Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty);
ar.achievement = 0;
}
}
@@ -6043,8 +5980,7 @@ void ObjectMgr::LoadAccessRequirements()
_accessRequirementStore[requirement_ID] = ar;
} while (result->NextRow());
- sLog->outString(">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
/*
@@ -6158,7 +6094,7 @@ uint32 ObjectMgr::GenerateAuctionID()
{
if (_auctionId >= 0xFFFFFFFE)
{
- sLog->outError("Auctions ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Auctions ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _auctionId++;
@@ -6168,7 +6104,7 @@ uint64 ObjectMgr::GenerateEquipmentSetGuid()
{
if (_equipmentSetGuid >= uint64(0xFFFFFFFFFFFFFFFELL))
{
- sLog->outError("EquipmentSet guid overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "EquipmentSet guid overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _equipmentSetGuid++;
@@ -6178,7 +6114,7 @@ uint32 ObjectMgr::GenerateMailID()
{
if (_mailId >= 0xFFFFFFFE)
{
- sLog->outError("Mail ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Mail ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _mailId++;
@@ -6268,8 +6204,7 @@ void ObjectMgr::LoadGameObjectLocales()
AddLocaleString(fields[i + (TOTAL_LOCALES - 1)].GetString(), LocaleConstant(i), data.CastBarCaption);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N)
@@ -6277,7 +6212,7 @@ inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32
if (sLockStore.LookupEntry(dataN))
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
goInfo->entry, goInfo->type, N, goInfo->door.lockId, goInfo->door.lockId);
}
@@ -6286,7 +6221,7 @@ inline void CheckGOLinkedTrapId(GameObjectTemplate const* goInfo, uint32 dataN,
if (GameObjectTemplate const* trapInfo = sObjectMgr->GetGameObjectTemplate(dataN))
{
if (trapInfo->type != GAMEOBJECT_TYPE_TRAP)
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
goInfo->entry, goInfo->type, N, dataN, dataN, GAMEOBJECT_TYPE_TRAP);
}
}
@@ -6296,7 +6231,7 @@ inline void CheckGOSpellId(GameObjectTemplate const* goInfo, uint32 dataN, uint3
if (sSpellMgr->GetSpellInfo(dataN))
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
goInfo->entry, goInfo->type, N, dataN, dataN);
}
@@ -6305,7 +6240,7 @@ inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32
if (dataN <= (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR))
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR);
// prevent client and server unexpected work
@@ -6318,7 +6253,7 @@ inline void CheckGONoDamageImmuneId(GameObjectTemplate* goTemplate, uint32 dataN
if (dataN <= 1)
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN);
}
inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N)
@@ -6327,7 +6262,7 @@ inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, ui
if (dataN <= 1)
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.",
goInfo->entry, goInfo->type, N, dataN);
}
@@ -6345,8 +6280,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (!result)
{
- sLog->outString(">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
return;
}
@@ -6430,7 +6364,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (got.spellFocus.focusId)
{
if (!sSpellFocusObjectStore.LookupEntry(got.spellFocus.focusId))
- sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
entry, got.type, got.spellFocus.focusId, got.spellFocus.focusId);
}
@@ -6448,7 +6382,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (got.goober.pageId) // pageId
{
if (!GetPageText(got.goober.pageId))
- sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
entry, got.type, got.goober.pageId, got.goober.pageId);
}
CheckGONoDamageImmuneId(&got, got.goober.noDamageImmune, 11);
@@ -6473,7 +6407,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (got.moTransport.taxiPathId)
{
if (got.moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[got.moTransport.taxiPathId].empty())
- sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
entry, got.type, got.moTransport.taxiPathId, got.moTransport.taxiPathId);
}
break;
@@ -6515,8 +6449,7 @@ void ObjectMgr::LoadGameObjectTemplate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadExplorationBaseXP()
@@ -6527,8 +6460,8 @@ void ObjectMgr::LoadExplorationBaseXP()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
+
return;
}
@@ -6544,8 +6477,7 @@ void ObjectMgr::LoadExplorationBaseXP()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
uint32 ObjectMgr::GetBaseXP(uint8 level)
@@ -6553,7 +6485,7 @@ uint32 ObjectMgr::GetBaseXP(uint8 level)
return _baseXPTable[level] ? _baseXPTable[level] : 0;
}
-uint32 ObjectMgr::GetXPForLevel(uint8 level)
+uint32 ObjectMgr::GetXPForLevel(uint8 level) const
{
if (level < _playerXPperLevel.size())
return _playerXPperLevel[level];
@@ -6568,8 +6500,7 @@ void ObjectMgr::LoadPetNames()
if (!result)
{
- sLog->outString(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
return;
}
@@ -6589,8 +6520,7 @@ void ObjectMgr::LoadPetNames()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadPetNumber()
@@ -6604,8 +6534,7 @@ void ObjectMgr::LoadPetNumber()
_hiPetNumber = fields[0].GetUInt32()+1;
}
- sLog->outString(">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime));
}
std::string ObjectMgr::GeneratePetName(uint32 entry)
@@ -6638,8 +6567,7 @@ void ObjectMgr::LoadCorpses()
PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES));
if (!result)
{
- sLog->outString(">> Loaded 0 corpses. DB table `corpse` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 corpses. DB table `corpse` is empty.");
return;
}
@@ -6651,7 +6579,7 @@ void ObjectMgr::LoadCorpses()
CorpseType type = CorpseType(fields[13].GetUInt8());
if (type >= MAX_CORPSE_TYPE)
{
- sLog->outError("Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type);
+ sLog->outError(LOG_FILTER_GENERAL, "Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type);
continue;
}
@@ -6667,8 +6595,7 @@ void ObjectMgr::LoadCorpses()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadReputationRewardRate()
@@ -6682,8 +6609,8 @@ void ObjectMgr::LoadReputationRewardRate()
if (!result)
{
- sLog->outErrorDb(">> Loaded `reputation_reward_rate`, table is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded `reputation_reward_rate`, table is empty!");
+
return;
}
@@ -6702,25 +6629,25 @@ void ObjectMgr::LoadReputationRewardRate()
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
if (!factionEntry)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId);
continue;
}
if (repRate.quest_rate < 0.0f)
{
- sLog->outErrorDb("Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.quest_rate, factionId);
+ sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.quest_rate, factionId);
continue;
}
if (repRate.creature_rate < 0.0f)
{
- sLog->outErrorDb("Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creature_rate, factionId);
+ sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creature_rate, factionId);
continue;
}
if (repRate.spell_rate < 0.0f)
{
- sLog->outErrorDb("Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId);
+ sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId);
continue;
}
@@ -6730,8 +6657,7 @@ void ObjectMgr::LoadReputationRewardRate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadReputationOnKill()
@@ -6751,8 +6677,8 @@ void ObjectMgr::LoadReputationOnKill()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
+
return;
}
@@ -6775,7 +6701,7 @@ void ObjectMgr::LoadReputationOnKill()
if (!GetCreatureTemplate(creature_id))
{
- sLog->outErrorDb("Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id);
continue;
}
@@ -6784,7 +6710,7 @@ void ObjectMgr::LoadReputationOnKill()
FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repOnKill.RepFaction1);
if (!factionEntry1)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction1);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction1);
continue;
}
}
@@ -6794,7 +6720,7 @@ void ObjectMgr::LoadReputationOnKill()
FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repOnKill.RepFaction2);
if (!factionEntry2)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction2);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction2);
continue;
}
}
@@ -6804,8 +6730,7 @@ void ObjectMgr::LoadReputationOnKill()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadReputationSpilloverTemplate()
@@ -6819,8 +6744,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!result)
{
- sLog->outString(">> Loaded `reputation_spillover_template`, table is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded `reputation_spillover_template`, table is empty.");
return;
}
@@ -6849,13 +6773,13 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!factionEntry)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId);
continue;
}
if (factionEntry->team == 0)
{
- sLog->outErrorDb("Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
continue;
}
@@ -6867,19 +6791,19 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!factionSpillover)
{
- sLog->outErrorDb("Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId);
+ sLog->outError(LOG_FILTER_SQL, "Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId);
continue;
}
if (factionSpillover->reputationListID < 0)
{
- sLog->outErrorDb("Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
+ sLog->outError(LOG_FILTER_SQL, "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
continue;
}
if (repTemplate.faction_rank[i] >= MAX_REPUTATION_RANK)
{
- sLog->outErrorDb("Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]);
+ sLog->outError(LOG_FILTER_SQL, "Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]);
continue;
}
}
@@ -6888,25 +6812,25 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
FactionEntry const* factionEntry0 = sFactionStore.LookupEntry(repTemplate.faction[0]);
if (repTemplate.faction[0] && !factionEntry0)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]);
continue;
}
FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repTemplate.faction[1]);
if (repTemplate.faction[1] && !factionEntry1)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]);
continue;
}
FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repTemplate.faction[2]);
if (repTemplate.faction[2] && !factionEntry2)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]);
continue;
}
FactionEntry const* factionEntry3 = sFactionStore.LookupEntry(repTemplate.faction[3]);
if (repTemplate.faction[3] && !factionEntry3)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]);
continue;
}
@@ -6916,8 +6840,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadPointsOfInterest()
@@ -6933,8 +6856,8 @@ void ObjectMgr::LoadPointsOfInterest()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
+
return;
}
@@ -6954,7 +6877,7 @@ void ObjectMgr::LoadPointsOfInterest()
if (!Trinity::IsValidMapCoord(POI.x, POI.y))
{
- sLog->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y);
+ sLog->outError(LOG_FILTER_SQL, "Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y);
continue;
}
@@ -6963,8 +6886,7 @@ void ObjectMgr::LoadPointsOfInterest()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadQuestPOI()
@@ -6980,8 +6902,8 @@ void ObjectMgr::LoadQuestPOI()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
+
return;
}
@@ -7035,8 +6957,7 @@ void ObjectMgr::LoadQuestPOI()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadNPCSpellClickSpells()
@@ -7049,8 +6970,8 @@ void ObjectMgr::LoadNPCSpellClickSpells()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
+
return;
}
@@ -7064,7 +6985,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
CreatureTemplate const* cInfo = GetCreatureTemplate(npc_entry);
if (!cInfo)
{
- sLog->outErrorDb("Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry);
continue;
}
@@ -7072,13 +6993,13 @@ void ObjectMgr::LoadNPCSpellClickSpells()
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellinfo)
{
- sLog->outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
+ sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
continue;
}
uint8 userType = fields[3].GetUInt16();
if (userType >= SPELL_CLICK_USER_MAX)
- sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType));
+ sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType));
uint8 castFlags = fields[2].GetUInt8();
SpellClickInfo info;
@@ -7098,13 +7019,12 @@ void ObjectMgr::LoadNPCSpellClickSpells()
{
if ((itr->second.npcflag & UNIT_NPC_FLAG_SPELLCLICK) && _spellClickInfoStore.find(itr->second.Entry) == _spellClickInfoStore.end())
{
- sLog->outErrorDb("npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry);
+ sLog->outError(LOG_FILTER_SQL, "npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry);
const_cast<CreatureTemplate*>(&itr->second)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK;
}
}
- sLog->outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::DeleteCreatureData(uint32 guid)
@@ -7153,8 +7073,8 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str());
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str());
+
return;
}
@@ -7170,7 +7090,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
if (_questTemplates.find(quest) == _questTemplates.end())
{
- sLog->outErrorDb("Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id);
continue;
}
@@ -7182,8 +7102,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadGameobjectQuestRelations()
@@ -7194,9 +7113,9 @@ void ObjectMgr::LoadGameobjectQuestRelations()
{
GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first);
if (!goInfo)
- sLog->outErrorDb("Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER)
- sLog->outErrorDb("Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7208,9 +7127,9 @@ void ObjectMgr::LoadGameobjectInvolvedRelations()
{
GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first);
if (!goInfo)
- sLog->outErrorDb("Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER)
- sLog->outErrorDb("Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7222,9 +7141,9 @@ void ObjectMgr::LoadCreatureQuestRelations()
{
CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first);
if (!cInfo)
- sLog->outErrorDb("Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER))
- sLog->outErrorDb("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7236,9 +7155,9 @@ void ObjectMgr::LoadCreatureInvolvedRelations()
{
CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first);
if (!cInfo)
- sLog->outErrorDb("Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER))
- sLog->outErrorDb("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7252,8 +7171,7 @@ void ObjectMgr::LoadReservedPlayersNames()
if (!result)
{
- sLog->outString(">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
return;
}
@@ -7268,7 +7186,7 @@ void ObjectMgr::LoadReservedPlayersNames()
std::wstring wstr;
if (!Utf8toWStr (name, wstr))
{
- sLog->outError("Table `reserved_name` have invalid name: %s", name.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Table `reserved_name` have invalid name: %s", name.c_str());
continue;
}
@@ -7279,8 +7197,7 @@ void ObjectMgr::LoadReservedPlayersNames()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
bool ObjectMgr::IsReservedName(const std::string& name) const
@@ -7384,6 +7301,11 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create)
if (!isValidString(wname, strictMask, false, create))
return CHAR_NAME_MIXED_LANGUAGES;
+ wstrToLower(wname);
+ for (size_t i = 2; i < wname.size(); ++i)
+ if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
+ return CHAR_NAME_THREE_CONSECUTIVE;
+
return CHAR_NAME_SUCCESS;
}
@@ -7433,8 +7355,7 @@ void ObjectMgr::LoadGameObjectForQuests()
if (sObjectMgr->GetGameObjectTemplates()->empty())
{
- sLog->outString(">> Loaded 0 GameObjects for quests");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 GameObjects for quests");
return;
}
@@ -7482,8 +7403,7 @@ void ObjectMgr::LoadGameObjectForQuests()
}
}
- sLog->outString(">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value)
@@ -7497,7 +7417,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
{
if (end_value >= start_value)
{
- sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
return false;
}
@@ -7510,7 +7430,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
{
if (start_value >= end_value)
{
- sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
return false;
}
}
@@ -7529,10 +7449,10 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
if (!result)
{
if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings
- sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table);
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table);
else
- sLog->outString(">> Loaded 0 string templates. DB table `%s` is empty.", table);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 string templates. DB table `%s` is empty.", table);
+
return false;
}
@@ -7546,12 +7466,12 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
if (entry == 0)
{
- sLog->outErrorDb("Table `%s` contain reserved entry 0, ignored.", table);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` contain reserved entry 0, ignored.", table);
continue;
}
else if (entry < start_value || entry >= end_value)
{
- sLog->outErrorDb("Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value);
continue;
}
@@ -7559,7 +7479,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
if (!data.Content.empty())
{
- sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry);
continue;
}
@@ -7571,11 +7491,10 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
} while (result->NextRow());
if (min_value == MIN_TRINITY_STRING_ID)
- sLog->outString(">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outString(">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
return true;
}
@@ -7590,9 +7509,9 @@ const char *ObjectMgr::GetTrinityString(int32 entry, LocaleConstant locale_idx)
}
if (entry > 0)
- sLog->outErrorDb("Entry %i not found in `trinity_string` table.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Entry %i not found in `trinity_string` table.", entry);
else
- sLog->outErrorDb("Trinity string entry %i not found in DB.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Trinity string entry %i not found in DB.", entry);
return "<error>";
}
@@ -7606,8 +7525,8 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
+
return;
}
@@ -7622,7 +7541,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry);
if (!fArea)
{
- sLog->outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "AreaId %u defined in `skill_fishing_base_level` does not exist", entry);
continue;
}
@@ -7631,8 +7550,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names)
@@ -7715,8 +7633,8 @@ void ObjectMgr::LoadGameTele()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
+
return;
}
@@ -7739,13 +7657,13 @@ void ObjectMgr::LoadGameTele()
if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation))
{
- sLog->outErrorDb("Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str());
continue;
}
if (!Utf8toWStr(gt.name, gt.wnameLow))
{
- sLog->outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id);
+ sLog->outError(LOG_FILTER_SQL, "Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id);
continue;
}
@@ -7757,8 +7675,7 @@ void ObjectMgr::LoadGameTele()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
@@ -7856,8 +7773,8 @@ void ObjectMgr::LoadMailLevelRewards()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
+
return;
}
@@ -7874,25 +7791,25 @@ void ObjectMgr::LoadMailLevelRewards()
if (level > MAX_LEVEL)
{
- sLog->outErrorDb("Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL);
continue;
}
if (!(raceMask & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
continue;
}
if (!sMailTemplateStore.LookupEntry(mailTemplateId))
{
- sLog->outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level);
continue;
}
if (!GetCreatureTemplate(senderEntry))
{
- sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level);
continue;
}
@@ -7902,8 +7819,7 @@ void ObjectMgr::LoadMailLevelRewards()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel)
@@ -7914,32 +7830,32 @@ void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost,
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
if (!cInfo)
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry for a non-existing creature template (Entry: %u), ignoring", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry for a non-existing creature template (Entry: %u), ignoring", entry);
return;
}
if (!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER))
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry);
return;
}
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spell);
if (!spellinfo)
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell);
return;
}
if (!SpellMgr::IsSpellValid(spellinfo))
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell);
return;
}
if (GetTalentSpellCost(spell))
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell);
return;
}
@@ -7967,7 +7883,7 @@ void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost,
if (spellinfo->Effects[i].TargetA.GetTarget() != 0 && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ALLY
&& spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ANY && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER)
{
- sLog->outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
continue;
}
@@ -7991,16 +7907,14 @@ void ObjectMgr::LoadTrainerSpell()
// For reload case
_cacheTrainerSpellStore.clear();
- std::set<uint32> skip_trainers;
-
QueryResult result = WorldDatabase.Query("SELECT b.entry, a.spell, a.spellcost, a.reqskill, a.reqskillvalue, a.reqlevel FROM npc_trainer AS a "
"INNER JOIN npc_trainer AS b ON a.entry = -(b.spell) "
"UNION SELECT * FROM npc_trainer WHERE spell > 0");
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
+
return;
}
@@ -8023,8 +7937,7 @@ void ObjectMgr::LoadTrainerSpell()
}
while (result->NextRow());
- sLog->outString(">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
@@ -8080,8 +7993,8 @@ void ObjectMgr::LoadVendors()
QueryResult result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
if (!result)
{
- sLog->outString();
- sLog->outErrorDb(">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
+
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
return;
}
@@ -8114,8 +8027,7 @@ void ObjectMgr::LoadVendors()
}
while (result->NextRow());
- sLog->outString(">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadGossipMenu()
@@ -8128,8 +8040,8 @@ void ObjectMgr::LoadGossipMenu()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
+
return;
}
@@ -8146,7 +8058,7 @@ void ObjectMgr::LoadGossipMenu()
if (!GetGossipText(gMenu.text_id))
{
- sLog->outErrorDb("Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id);
continue;
}
@@ -8156,8 +8068,7 @@ void ObjectMgr::LoadGossipMenu()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadGossipMenuItems()
@@ -8175,8 +8086,8 @@ void ObjectMgr::LoadGossipMenuItems()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!");
+
return;
}
@@ -8202,16 +8113,16 @@ void ObjectMgr::LoadGossipMenuItems()
if (gMenuItem.OptionIcon >= GOSSIP_ICON_MAX)
{
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionIcon);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionIcon);
gMenuItem.OptionIcon = GOSSIP_ICON_CHAT;
}
if (gMenuItem.OptionType >= GOSSIP_OPTION_MAX)
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionType);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionType);
if (gMenuItem.ActionPoiId && !GetPointOfInterest(gMenuItem.ActionPoiId))
{
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionPoiId);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionPoiId);
gMenuItem.ActionPoiId = 0;
}
@@ -8220,8 +8131,7 @@ void ObjectMgr::LoadGossipMenuItems()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/)
@@ -8273,7 +8183,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
return false;
}
@@ -8284,7 +8194,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
if (skip_vendors)
skip_vendors->insert(vendor_entry);
@@ -8297,7 +8207,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id);
return false;
}
@@ -8306,7 +8216,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry);
return false;
}
@@ -8315,7 +8225,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
return false;
}
else if (maxcount == 0 && incrtime > 0)
@@ -8323,7 +8233,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0");
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
return false;
}
@@ -8336,7 +8246,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost);
else
- sLog->outErrorDb("Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry);
return false;
}
@@ -8345,7 +8255,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
else
- sLog->outErrorDb("Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
return false;
}
@@ -8384,8 +8294,8 @@ void ObjectMgr::LoadScriptNames()
if (!result)
{
- sLog->outString();
- sLog->outErrorDb(">> Loaded empty set of Script Names!");
+
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded empty set of Script Names!");
return;
}
@@ -8399,8 +8309,7 @@ void ObjectMgr::LoadScriptNames()
while (result->NextRow());
std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end());
- sLog->outString(">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
uint32 ObjectMgr::GetScriptId(const char *name)
@@ -8432,7 +8341,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids)
case SCRIPT_COMMAND_TALK:
{
if (!GetTrinityStringLocale (itrM->second.Talk.TextID))
- sLog->outErrorDb("Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
if (ids.find(itrM->second.Talk.TextID) != ids.end())
ids.erase(itrM->second.Talk.TextID);
@@ -8458,7 +8367,7 @@ void ObjectMgr::LoadDbScriptStrings()
CheckScripts(ScriptsType(type), ids);
for (std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
- sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr);
+ sLog->outError(LOG_FILTER_SQL, "Table `db_script_string` has unused string id %u", *itr);
}
bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value)
@@ -8467,7 +8376,7 @@ bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value)
// start/end reversed for negative values
if (start_value > MAX_DB_SCRIPT_STRING_ID || end_value >= start_value)
{
- sLog->outErrorDb("Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1);
return false;
}
@@ -8503,8 +8412,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
if (!result)
{
- sLog->outString(">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
return;
}
@@ -8525,13 +8433,13 @@ void ObjectMgr::LoadCreatureClassLevelStats()
stats.BaseArmor = fields[6].GetInt16();
if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
- sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class);
+ sLog->outError(LOG_FILTER_SQL, "Creature base stats for level %u has invalid class %u", Level, Class);
for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i)
{
if (stats.BaseHealth[i] < 1)
{
- sLog->outErrorDb("Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i);
+ sLog->outError(LOG_FILTER_SQL, "Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i);
stats.BaseHealth[i] = 1;
}
}
@@ -8548,12 +8456,11 @@ void ObjectMgr::LoadCreatureClassLevelStats()
for (uint16 lvl = itr->second.minlevel; lvl <= itr->second.maxlevel; ++lvl)
{
if (_creatureBaseStatsStore.find(MAKE_PAIR16(lvl, itr->second.unit_class)) == _creatureBaseStatsStore.end())
- sLog->outErrorDb("Missing base stats for creature class %u level %u", itr->second.unit_class, lvl);
+ sLog->outError(LOG_FILTER_SQL, "Missing base stats for creature class %u level %u", itr->second.unit_class, lvl);
}
}
- sLog->outString(">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadFactionChangeAchievements()
@@ -8564,8 +8471,8 @@ void ObjectMgr::LoadFactionChangeAchievements()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
+
return;
}
@@ -8579,9 +8486,9 @@ void ObjectMgr::LoadFactionChangeAchievements()
uint32 horde = fields[1].GetUInt32();
if (!sAchievementStore.LookupEntry(alliance))
- sLog->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
else if (!sAchievementStore.LookupEntry(horde))
- sLog->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
else
FactionChange_Achievements[alliance] = horde;
@@ -8589,8 +8496,7 @@ void ObjectMgr::LoadFactionChangeAchievements()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadFactionChangeItems()
@@ -8601,8 +8507,7 @@ void ObjectMgr::LoadFactionChangeItems()
if (!result)
{
- sLog->outString(">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
return;
}
@@ -8616,9 +8521,9 @@ void ObjectMgr::LoadFactionChangeItems()
uint32 horde = fields[1].GetUInt32();
if (!GetItemTemplate(alliance))
- sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
else if (!GetItemTemplate(horde))
- sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
else
FactionChange_Items[alliance] = horde;
@@ -8626,8 +8531,7 @@ void ObjectMgr::LoadFactionChangeItems()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadFactionChangeSpells()
@@ -8638,8 +8542,8 @@ void ObjectMgr::LoadFactionChangeSpells()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
+
return;
}
@@ -8653,9 +8557,9 @@ void ObjectMgr::LoadFactionChangeSpells()
uint32 horde = fields[1].GetUInt32();
if (!sSpellMgr->GetSpellInfo(alliance))
- sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
else if (!sSpellMgr->GetSpellInfo(horde))
- sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
else
FactionChange_Spells[alliance] = horde;
@@ -8663,8 +8567,7 @@ void ObjectMgr::LoadFactionChangeSpells()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadFactionChangeReputations()
@@ -8675,8 +8578,7 @@ void ObjectMgr::LoadFactionChangeReputations()
if (!result)
{
- sLog->outString(">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
return;
}
@@ -8690,9 +8592,9 @@ void ObjectMgr::LoadFactionChangeReputations()
uint32 horde = fields[1].GetUInt32();
if (!sFactionStore.LookupEntry(alliance))
- sLog->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
else if (!sFactionStore.LookupEntry(horde))
- sLog->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
else
FactionChange_Reputation[alliance] = horde;
@@ -8700,8 +8602,7 @@ void ObjectMgr::LoadFactionChangeReputations()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry)
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 97c2f0234ba..a6d1dc6c386 100755
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -128,7 +128,7 @@ enum eScriptFlags
SF_PLAYSOUND_DISTANCE_SOUND = 0x2,
// Orientation flags
- SF_ORIENTATION_FACE_TARGET = 0x1,
+ SF_ORIENTATION_FACE_TARGET = 0x1
};
struct ScriptInfo
@@ -536,7 +536,7 @@ enum SkillRangeType
SKILL_RANGE_LEVEL, // 1..max skill for level
SKILL_RANGE_MONO, // 1..1, grey monolite bar
SKILL_RANGE_RANK, // 1..skill for known rank
- SKILL_RANGE_NONE, // 0..0 always
+ SKILL_RANGE_NONE // 0..0 always
};
SkillRangeType GetSkillRangeType(SkillLineEntry const* pSkill, bool racial);
@@ -561,7 +561,7 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang);
enum EncounterCreditType
{
ENCOUNTER_CREDIT_KILL_CREATURE = 0,
- ENCOUNTER_CREDIT_CAST_SPELL = 1,
+ ENCOUNTER_CREDIT_CAST_SPELL = 1
};
struct DungeonEncounter
@@ -613,14 +613,14 @@ class ObjectMgr
Player* GetPlayerByLowGUID(uint32 lowguid) const;
GameObjectTemplate const* GetGameObjectTemplate(uint32 entry);
- GameObjectTemplateContainer const* GetGameObjectTemplates() { return &_gameObjectTemplateStore; }
+ GameObjectTemplateContainer const* GetGameObjectTemplates() const { return &_gameObjectTemplateStore; }
int LoadReferenceVendor(int32 vendor, int32 item_id, std::set<uint32> *skip_vendors);
void LoadGameObjectTemplate();
void AddGameobjectInfo(GameObjectTemplate* goinfo);
CreatureTemplate const* GetCreatureTemplate(uint32 entry);
- CreatureTemplateContainer const* GetCreatureTemplates() { return &_creatureTemplateStore; }
+ CreatureTemplateContainer const* GetCreatureTemplates() const { return &_creatureTemplateStore; }
CreatureModelInfo const* GetCreatureModelInfo(uint32 modelId);
CreatureModelInfo const* GetCreatureModelRandomGender(uint32* displayID);
static uint32 ChooseDisplayId(uint32 team, const CreatureTemplate* cinfo, const CreatureData* data = NULL);
@@ -629,7 +629,7 @@ class ObjectMgr
CreatureAddon const* GetCreatureAddon(uint32 lowguid);
CreatureAddon const* GetCreatureTemplateAddon(uint32 entry);
ItemTemplate const* GetItemTemplate(uint32 entry);
- ItemTemplateContainer const* GetItemTemplateStore() { return &_itemTemplateStore; }
+ ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; }
ItemSetNameEntry const* GetItemSetNameEntry(uint32 itemId)
{
@@ -787,13 +787,13 @@ class ObjectMgr
void LoadQuests();
void LoadQuestRelations()
{
- sLog->outString("Loading GO Start Quest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GO Start Quest Data...");
LoadGameobjectQuestRelations();
- sLog->outString("Loading GO End Quest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GO End Quest Data...");
LoadGameobjectInvolvedRelations();
- sLog->outString("Loading Creature Start Quest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Start Quest Data...");
LoadCreatureQuestRelations();
- sLog->outString("Loading Creature End Quest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature End Quest Data...");
LoadCreatureInvolvedRelations();
}
void LoadGameobjectQuestRelations();
@@ -912,7 +912,7 @@ class ObjectMgr
std::string GeneratePetName(uint32 entry);
uint32 GetBaseXP(uint8 level);
- uint32 GetXPForLevel(uint8 level);
+ uint32 GetXPForLevel(uint8 level) const;
int32 GetFishingBaseSkillLevel(uint32 entry) const
{
@@ -1098,7 +1098,7 @@ class ObjectMgr
void LoadScriptNames();
ScriptNameContainer &GetScriptNames() { return _scriptNamesStore; }
- const char * GetScriptName(uint32 id) { return id < _scriptNamesStore.size() ? _scriptNamesStore[id].c_str() : ""; }
+ const char * GetScriptName(uint32 id) const { return id < _scriptNamesStore.size() ? _scriptNamesStore[id].c_str() : ""; }
uint32 GetScriptId(const char *name);
SpellClickInfoMapBounds GetSpellClickInfoMapBounds(uint32 creature_id) const
@@ -1285,7 +1285,7 @@ class ObjectMgr
CREATURE_TO_CREATURE,
CREATURE_TO_GO, // Creature is dependant on GO
GO_TO_GO,
- GO_TO_CREATURE, // GO is dependant on creature
+ GO_TO_CREATURE // GO is dependant on creature
};
};
diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h
index cf649f8d896..ad888b26dd3 100755
--- a/src/server/game/Grids/GridStates.h
+++ b/src/server/game/Grids/GridStates.h
@@ -32,7 +32,7 @@ class GridState
{
if (i_Magic != MAGIC_TESTVAL)
{
- sLog->outError("!!! GridState: Magic value gone !!!");
+ sLog->outError(LOG_FILTER_GENERAL, "!!! GridState: Magic value gone !!!");
return false;
}
return true;
diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h
index b5701a7a590..0ef885703be 100755
--- a/src/server/game/Grids/NGrid.h
+++ b/src/server/game/Grids/NGrid.h
@@ -79,9 +79,13 @@ class NGrid
public:
typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> GridType;
NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true)
- : i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false)
+ : i_gridId(id)
+ , i_GridInfo(GridInfo(expiry, unload))
+ , i_x(x)
+ , i_y(y)
+ , i_cellstate(GRID_STATE_INVALID)
+ , i_GridObjectDataLoaded(false)
{
- i_GridInfo = GridInfo(expiry, unload);
}
GridType& GetGridType(const uint32 x, const uint32 y)
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 7bb4492f99c..db4dc819557 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -694,6 +694,30 @@ namespace Trinity
NearestGameObjectEntryInObjectRangeCheck(NearestGameObjectEntryInObjectRangeCheck const&);
};
+ // Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO with a certain type)
+ class NearestGameObjectTypeInObjectRangeCheck
+ {
+ public:
+ NearestGameObjectTypeInObjectRangeCheck(WorldObject const& obj, GameobjectTypes type, float range) : i_obj(obj), i_type(type), i_range(range) {}
+ bool operator()(GameObject* go)
+ {
+ if (go->GetGoType() == i_type && i_obj.IsWithinDistInMap(go, i_range))
+ {
+ i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
+ return true;
+ }
+ return false;
+ }
+ float GetLastRange() const { return i_range; }
+ private:
+ WorldObject const& i_obj;
+ GameobjectTypes i_type;
+ float i_range;
+
+ // prevent clone this object
+ NearestGameObjectTypeInObjectRangeCheck(NearestGameObjectTypeInObjectRangeCheck const&);
+ };
+
class GameObjectWithDbGUIDCheck
{
public:
@@ -1325,11 +1349,16 @@ namespace Trinity
{
public:
UnitAuraCheck(bool present, uint32 spellId, uint64 casterGUID = 0) : _present(present), _spellId(spellId), _casterGUID(casterGUID) {}
- bool operator()(Unit* unit)
+ bool operator()(Unit* unit) const
{
return unit->HasAura(_spellId, _casterGUID) == _present;
}
+ bool operator()(WorldObject* object) const
+ {
+ return object->ToUnit() && object->ToUnit()->HasAura(_spellId, _casterGUID) == _present;
+ }
+
private:
bool _present;
uint32 _spellId;
diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp
index 519a53ad184..3b2d59dd998 100755
--- a/src/server/game/Grids/ObjectGridLoader.cpp
+++ b/src/server/game/Grids/ObjectGridLoader.cpp
@@ -94,7 +94,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T>
{
T* obj = new T;
uint32 guid = *i_guid;
- //sLog->outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
+ //sLog->outInfo(LOG_FILTER_GENERAL, "DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
if (!obj->LoadFromDB(guid, map))
{
delete obj;
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 3a6390cd83a..19ea3ff8174 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -34,6 +34,7 @@
#include "MapInstanced.h"
#include "Util.h"
#include "LFGMgr.h"
+#include "UpdateFieldFlags.h"
Roll::Roll(uint64 _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid),
itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
@@ -58,7 +59,7 @@ Loot* Roll::getLoot()
Group::Group() : m_leaderGuid(0), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL),
m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL),
-m_bgGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0),
+m_bgGroup(NULL), m_bfGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0),
m_subGroupsCounts(NULL), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), m_dbStoreId(0)
{
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
@@ -72,7 +73,7 @@ Group::~Group()
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted.");
if (m_bgGroup->GetBgRaid(ALLIANCE) == this) m_bgGroup->SetBgRaid(ALLIANCE, NULL);
else if (m_bgGroup->GetBgRaid(HORDE) == this) m_bgGroup->SetBgRaid(HORDE, NULL);
- else sLog->outError("Group::~Group: battleground group is not linked to the correct battleground.");
+ else sLog->outError(LOG_FILTER_GENERAL, "Group::~Group: battleground group is not linked to the correct battleground.");
}
Rolls::iterator itr;
while (!RollId.empty())
@@ -103,7 +104,7 @@ bool Group::Create(Player* leader)
m_leaderGuid = leaderGuid;
m_leaderName = leader->GetName();
- m_groupType = isBGGroup() ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL;
+ m_groupType = (isBGGroup() || isBFGroup()) ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL;
if (m_groupType & GROUPTYPE_RAID)
_initRaidSubGroupsCounter();
@@ -115,7 +116,7 @@ bool Group::Create(Player* leader)
m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
m_dungeonDifficulty = leader->GetDungeonDifficulty();
m_raidDifficulty = leader->GetRaidDifficulty();
@@ -231,7 +232,7 @@ void Group::ConvertToLFG()
{
m_groupType = GroupType(m_groupType | GROUPTYPE_LFG | GROUPTYPE_UNK1);
m_lootMethod = NEED_BEFORE_GREED;
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
@@ -250,7 +251,7 @@ void Group::ConvertToRaid()
_initRaidSubGroupsCounter();
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
@@ -273,7 +274,7 @@ bool Group::AddInvite(Player* player)
if (!player || player->GetGroupInvite())
return false;
Group* group = player->GetGroup();
- if (group && group->isBGGroup())
+ if (group && (group->isBGGroup() || group->isBFGroup()))
group = player->GetOriginalGroup();
if (group)
return false;
@@ -370,8 +371,8 @@ bool Group::AddMember(Player* player)
if (player)
{
player->SetGroupInvite(NULL);
- if (player->GetGroup() && isBGGroup()) //if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
- player->SetBattlegroundRaid(this, subGroup);
+ if (player->GetGroup() && (isBGGroup() || isBFGroup())) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
+ player->SetBattlegroundOrBattlefieldRaid(this, subGroup);
else if (player->GetGroup()) //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup()
player->SetOriginalGroup(this, subGroup);
else //if player is not in group, then call set group
@@ -390,7 +391,7 @@ bool Group::AddMember(Player* player)
}
// insert into the table if we're not a battleground group
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER);
@@ -409,7 +410,7 @@ bool Group::AddMember(Player* player)
if (player)
{
- if (!IsLeader(player->GetGUID()) && !isBGGroup())
+ if (!IsLeader(player->GetGUID()) && !isBGGroup() && !isBFGroup())
{
// reset the new member's instances, unless he is currently in one of them
// including raid/heroic instances that they are not permanently bound to!
@@ -437,6 +438,51 @@ bool Group::AddMember(Player* player)
if (isRaidGroup())
player->UpdateForQuestWorldObjects();
+ {
+ // Broadcast new player group member fields to rest of the group
+ player->SetFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
+
+ UpdateData groupData;
+ WorldPacket groupDataPacket;
+
+ // Broadcast group members' fields to player
+ for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ if (itr->getSource() == player)
+ continue;
+
+ if (Player* member = itr->getSource())
+ {
+ if (player->HaveAtClient(member))
+ {
+ member->SetFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
+ member->BuildValuesUpdateBlockForPlayer(&groupData, player);
+ member->RemoveFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
+ }
+
+ if (member->HaveAtClient(player))
+ {
+ UpdateData newData;
+ WorldPacket newDataPacket;
+ player->BuildValuesUpdateBlockForPlayer(&newData, member);
+ if (newData.HasData())
+ {
+ newData.BuildPacket(&newDataPacket);
+ member->SendDirectMessage(&newDataPacket);
+ }
+ }
+ }
+ }
+
+ if (groupData.HasData())
+ {
+ groupData.BuildPacket(&groupDataPacket);
+ player->SendDirectMessage(&groupDataPacket);
+ }
+
+ player->RemoveFieldNotifyFlag(UF_FLAG_PARTY_MEMBER);
+ }
+
if (m_maxEnchantingLevel < player->GetSkillValue(SKILL_ENCHANTING))
m_maxEnchantingLevel = player->GetSkillValue(SKILL_ENCHANTING);
}
@@ -454,15 +500,15 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK)
return m_memberSlots.size();
- // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group)
- if (GetMembersCount() > ((isBGGroup() || isLFGGroup()) ? 1u : 2u))
+ // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group)
+ if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u))
{
Player* player = ObjectAccessor::FindPlayer(guid);
if (player)
{
// Battleground group handling
- if (isBGGroup())
- player->RemoveFromBattlegroundRaid();
+ if (isBGGroup() || isBFGroup())
+ player->RemoveFromBattlegroundOrBattlefieldRaid();
else
// Regular group
{
@@ -493,13 +539,13 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
}
// Remove player from group in DB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
-
- stmt->setUInt32(0, GUID_LOPART(guid));
-
- CharacterDatabase.Execute(stmt);
-
- DelinkMember(guid);
+ if (!isBGGroup() && !isBFGroup())
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
+ stmt->setUInt32(0, GUID_LOPART(guid));
+ CharacterDatabase.Execute(stmt);
+ DelinkMember(guid);
+ }
// Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline
if ((player && player->GetSkillValue(SKILL_ENCHANTING)) || !player)
@@ -590,7 +636,7 @@ void Group::ChangeLeader(uint64 guid)
sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid);
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
// Remove the groups permanent instance bindings
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
@@ -650,8 +696,8 @@ void Group::Disband(bool hideDestroy /* = false */)
//we cannot call _removeMember because it would invalidate member iterator
//if we are removing player from battleground raid
- if (isBGGroup())
- player->RemoveFromBattlegroundRaid();
+ if (isBGGroup() || isBFGroup())
+ player->RemoveFromBattlegroundOrBattlefieldRaid();
else
{
//we can remove player who is in battleground from his original group
@@ -695,7 +741,7 @@ void Group::Disband(bool hideDestroy /* = false */)
RemoveAllInvites();
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
@@ -949,6 +995,64 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
else
i->is_underthreshold = true;
}
+
+ for (i = loot->quest_items.begin(); i != loot->quest_items.end(); ++i, ++itemSlot)
+ {
+ if (!i->follow_loot_rules)
+ continue;
+
+ item = sObjectMgr->GetItemTemplate(i->itemid);
+ if (!item)
+ {
+ //sLog->outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
+ continue;
+ }
+
+ uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
+ Roll* r = new Roll(newitemGUID, *i);
+
+ //a vector is filled with only near party members
+ for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* member = itr->getSource();
+ if (!member || !member->GetSession())
+ continue;
+
+ if (i->AllowedForPlayer(member))
+ {
+ if (member->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
+ {
+ r->totalPlayersRolling++;
+ r->playerVote[member->GetGUID()] = NOT_EMITED_YET;
+ }
+ }
+ }
+
+ if (r->totalPlayersRolling > 0)
+ {
+ r->setLoot(loot);
+ r->itemSlot = itemSlot;
+
+ loot->quest_items[itemSlot - loot->items.size()].is_blocked = true;
+
+ SendLootStartRoll(60000, pLootedObject->GetMapId(), *r);
+
+ RollId.push_back(r);
+
+ if (Creature* creature = pLootedObject->ToCreature())
+ {
+ creature->m_groupLootTimer = 60000;
+ creature->lootingGroupLowGUID = GetLowGUID();
+ }
+ else if (GameObject* go = pLootedObject->ToGameObject())
+ {
+ go->m_groupLootTimer = 60000;
+ go->lootingGroupLowGUID = GetLowGUID();
+ }
+ }
+ else
+ delete r;
+ }
}
void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
@@ -1033,6 +1137,66 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
else
i->is_underthreshold = true;
}
+
+ for (std::vector<LootItem>::iterator i = loot->quest_items.begin(); i != loot->quest_items.end(); ++i, ++itemSlot)
+ {
+ if (!i->follow_loot_rules)
+ continue;
+
+ item = sObjectMgr->GetItemTemplate(i->itemid);
+ uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
+ Roll* r = new Roll(newitemGUID, *i);
+
+ for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* playerToRoll = itr->getSource();
+ if (!playerToRoll || !playerToRoll->GetSession())
+ continue;
+
+ bool allowedForPlayer = i->AllowedForPlayer(playerToRoll);
+ if (allowedForPlayer && playerToRoll->IsWithinDistInMap(lootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
+ {
+ r->totalPlayersRolling++;
+ r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET;
+ }
+ }
+
+ if (r->totalPlayersRolling > 0)
+ {
+ r->setLoot(loot);
+ r->itemSlot = itemSlot;
+
+ loot->quest_items[itemSlot - loot->items.size()].is_blocked = true;
+
+ //Broadcast Pass and Send Rollstart
+ for (Roll::PlayerVote::const_iterator itr = r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
+ {
+ Player* p = ObjectAccessor::FindPlayer(itr->first);
+ if (!p || !p->GetSession())
+ continue;
+
+ if (itr->second == PASS)
+ SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r);
+ else
+ SendLootStartRollToPlayer(60000, lootedObject->GetMapId(), p, p->CanRollForItemInLFG(item, lootedObject) == EQUIP_ERR_OK, *r);
+ }
+
+ RollId.push_back(r);
+
+ if (Creature* creature = lootedObject->ToCreature())
+ {
+ creature->m_groupLootTimer = 60000;
+ creature->lootingGroupLowGUID = GetLowGUID();
+ }
+ else if (GameObject* go = lootedObject->ToGameObject())
+ {
+ go->m_groupLootTimer = 60000;
+ go->lootingGroupLowGUID = GetLowGUID();
+ }
+ }
+ else
+ delete r;
+ }
}
void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
@@ -1162,10 +1326,10 @@ void Group::CountTheRoll(Rolls::iterator rollI)
if (player && player->GetSession())
{
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
ItemPosCountVec dest;
- LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
+ LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
if (msg == EQUIP_ERR_OK)
{
@@ -1212,9 +1376,9 @@ void Group::CountTheRoll(Rolls::iterator rollI)
if (player && player->GetSession())
{
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
- LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
+ LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
if (rollvote == GREED)
{
@@ -1251,7 +1415,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
SendLootAllPassed(*roll);
// remove is_blocked so that the item is lootable by all players
- LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
+ LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
if (item)
item->is_blocked = false;
}
@@ -1347,7 +1511,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
Player* member = ObjectAccessor::FindPlayer(citr->guid);
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
- onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
+ onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0);
data << citr->name;
data << uint64(citr->guid); // guid
@@ -1438,7 +1602,7 @@ bool Group::_setMembersGroup(uint64 guid, uint8 group)
SubGroupCounterIncrease(group);
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
@@ -1489,7 +1653,7 @@ void Group::ChangeMembersGroup(uint64 guid, uint8 group)
SubGroupCounterDecrease(prevSubGroup);
// Preserve new sub group in database for non-raid groups
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
@@ -1684,7 +1848,7 @@ void Roll::targetObjectBuildLink()
void Group::SetDungeonDifficulty(Difficulty difficulty)
{
m_dungeonDifficulty = difficulty;
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY);
@@ -1708,7 +1872,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty)
void Group::SetRaidDifficulty(Difficulty difficulty)
{
m_raidDifficulty = difficulty;
- if (!isBGGroup())
+ if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY);
@@ -1744,7 +1908,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
{
- if (isBGGroup())
+ if (isBGGroup() || isBFGroup())
return;
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND
@@ -1859,7 +2023,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, bool load)
{
- if (!save || isBGGroup())
+ if (!save || isBGGroup() || isBFGroup())
return NULL;
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
@@ -1927,7 +2091,7 @@ void Group::BroadcastGroupUpdate(void)
{
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);
- sLog->outStaticDebug("-- Forced group value update for '%s'", pp->GetName());
+ sLog->outDebug(LOG_FILTER_GENERAL, "-- Forced group value update for '%s'", pp->GetName());
}
}
}
@@ -1989,6 +2153,11 @@ bool Group::isBGGroup() const
return m_bgGroup != NULL;
}
+bool Group::isBFGroup() const
+{
+ return m_bfGroup != NULL;
+}
+
bool Group::IsCreated() const
{
return GetMembersCount() > 0;
@@ -2090,6 +2259,11 @@ void Group::SetBattlegroundGroup(Battleground* bg)
m_bgGroup = bg;
}
+void Group::SetBattlefieldGroup(Battlefield *bg)
+{
+ m_bfGroup = bg;
+}
+
void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag)
{
// Assistants, main assistants and main tanks are only available in raid groups
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index e5f174c4230..a00b7e1ef3a 100755
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -26,6 +26,8 @@
#include "QueryResult.h"
#include "SharedDefines.h"
#include "Player.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
class Creature;
class GroupReference;
@@ -64,20 +66,20 @@ enum GroupMemberOnlineStatus
MEMBER_STATUS_PVP_FFA = 0x0010, // Lua_UnitIsPVPFreeForAll
MEMBER_STATUS_UNK3 = 0x0020, // used in calls from Lua_GetPlayerMapPosition/Lua_GetBattlefieldFlagPosition
MEMBER_STATUS_AFK = 0x0040, // Lua_UnitIsAFK
- MEMBER_STATUS_DND = 0x0080, // Lua_UnitIsDND
+ MEMBER_STATUS_DND = 0x0080 // Lua_UnitIsDND
};
enum GroupMemberFlags
{
MEMBER_FLAG_ASSISTANT = 0x01,
MEMBER_FLAG_MAINTANK = 0x02,
- MEMBER_FLAG_MAINASSIST = 0x04,
+ MEMBER_FLAG_MAINASSIST = 0x04
};
enum GroupMemberAssignment
{
GROUP_ASSIGN_MAINTANK = 0,
- GROUP_ASSIGN_MAINASSIST = 1,
+ GROUP_ASSIGN_MAINASSIST = 1
};
enum GroupType
@@ -87,7 +89,7 @@ enum GroupType
GROUPTYPE_RAID = 0x02,
GROUPTYPE_BGRAID = GROUPTYPE_BG | GROUPTYPE_RAID, // mask
GROUPTYPE_UNK1 = 0x04,
- GROUPTYPE_LFG = 0x08,
+ GROUPTYPE_LFG = 0x08
// 0x10, leave/change group?, I saw this flag when leaving group and after leaving BG while in group
};
@@ -115,7 +117,7 @@ enum GroupUpdateFlags
GROUP_UPDATE_FLAG_PET_AURAS = 0x00040000, // uint64 mask, for each bit set uint32 spellid + uint8 unk, pet auras...
GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00080000, // uint32 vehicle_seat_id (index from VehicleSeat.dbc)
GROUP_UPDATE_PET = 0x0007FC00, // all pet flags
- GROUP_UPDATE_FULL = 0x0007FFFF, // all known flags
+ GROUP_UPDATE_FULL = 0x0007FFFF // all known flags
};
#define GROUP_UPDATE_FLAGS_COUNT 20
@@ -205,6 +207,7 @@ class Group
bool isLFGGroup() const;
bool isRaidGroup() const;
bool isBGGroup() const;
+ bool isBFGroup() const;
bool IsCreated() const;
uint64 GetLeaderGUID() const;
uint64 GetGUID() const;
@@ -241,6 +244,7 @@ class Group
void ConvertToRaid();
void SetBattlegroundGroup(Battleground* bg);
+ void SetBattlefieldGroup(Battlefield* bf);
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
void ChangeMembersGroup(uint64 guid, uint8 group);
@@ -324,6 +328,7 @@ class Group
Difficulty m_dungeonDifficulty;
Difficulty m_raidDifficulty;
Battleground* m_bgGroup;
+ Battlefield* m_bfGroup;
uint64 m_targetIcons[TARGETICONCOUNT];
LootMethod m_lootMethod;
ItemQualities m_lootThreshold;
diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp
index f372f08c941..77b3a304f6b 100644
--- a/src/server/game/Groups/GroupMgr.cpp
+++ b/src/server/game/Groups/GroupMgr.cpp
@@ -46,7 +46,7 @@ uint32 GroupMgr::GenerateNewGroupDbStoreId()
if (newStorageId == NextGroupDbStoreId)
{
- sLog->outError("Group storage ID overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Group storage ID overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
@@ -84,7 +84,7 @@ uint32 GroupMgr::GenerateGroupId()
{
if (NextGroupId >= 0xFFFFFFFE)
{
- sLog->outError("Group guid overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Group guid overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return NextGroupId++;
@@ -125,8 +125,7 @@ void GroupMgr::LoadGroups()
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
if (!result)
{
- sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group definitions. DB table `groups` is empty!");
return;
}
@@ -151,11 +150,10 @@ void GroupMgr::LoadGroups()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
- sLog->outString("Loading Group members...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Group members...");
{
uint32 oldMSTime = getMSTime();
@@ -169,8 +167,7 @@ void GroupMgr::LoadGroups()
QueryResult result = CharacterDatabase.Query("SELECT guid, memberGuid, memberFlags, subgroup, roles FROM group_member ORDER BY guid");
if (!result)
{
- sLog->outString(">> Loaded 0 group members. DB table `group_member` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group members. DB table `group_member` is empty!");
return;
}
@@ -184,17 +181,16 @@ void GroupMgr::LoadGroups()
if (group)
group->LoadMemberFromDB(fields[1].GetUInt32(), fields[2].GetUInt8(), fields[3].GetUInt8(), fields[4].GetUInt8());
else
- sLog->outError("GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
+ sLog->outError(LOG_FILTER_GENERAL, "GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
++count;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
- sLog->outString("Loading Group instance saves...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Group instance saves...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6
@@ -203,8 +199,7 @@ void GroupMgr::LoadGroups()
"LEFT JOIN character_instance ci LEFT JOIN groups g ON g.leaderGuid = ci.guid ON ci.instance = gi.instance AND ci.permanent = 1 GROUP BY gi.instance ORDER BY gi.guid");
if (!result)
{
- sLog->outString(">> Loaded 0 group-instance saves. DB table `group_instance` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group-instance saves. DB table `group_instance` is empty!");
return;
}
@@ -218,14 +213,14 @@ void GroupMgr::LoadGroups()
MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt16());
if (!mapEntry || !mapEntry->IsDungeon())
{
- sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt16());
+ sLog->outError(LOG_FILTER_SQL, "Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt16());
continue;
}
uint32 diff = fields[4].GetUInt8();
if (diff >= uint32(mapEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
{
- sLog->outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
+ sLog->outError(LOG_FILTER_SQL, "Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
diff = 0; // default for both difficaly types
}
@@ -235,7 +230,6 @@ void GroupMgr::LoadGroups()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 889174420c6..332c0924b61 100755
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -51,7 +51,7 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil
data << uint32(errCode);
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)");
}
void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode)
@@ -60,10 +60,9 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode
data << uint32(errCode);
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)");
}
-///////////////////////////////////////////////////////////////////////////////
// LogHolder
Guild::LogHolder::~LogHolder()
{
@@ -337,21 +336,21 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields)
uint32 itemEntry = fields[15].GetUInt32();
if (slotId >= GUILD_BANK_MAX_SLOTS)
{
- sLog->outError("Invalid slot for item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
+ sLog->outError(LOG_FILTER_GUILD, "Invalid slot for item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
return false;
}
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemEntry);
if (!proto)
{
- sLog->outError("Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
+ sLog->outError(LOG_FILTER_GUILD, "Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
return false;
}
Item* pItem = NewItemOrBag(proto);
if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry))
{
- sLog->outError("Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
+ sLog->outError(LOG_FILTER_GUILD, "Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM);
stmt->setUInt32(0, m_guildId);
@@ -599,7 +598,7 @@ bool Guild::Member::LoadFromDB(Field* fields)
if (!m_zoneId)
{
- sLog->outError("Player (GUID: %u) has broken zone-data", GUID_LOPART(m_guid));
+ sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has broken zone-data", GUID_LOPART(m_guid));
m_zoneId = Player::GetZoneIdFromDB(m_guid);
}
return true;
@@ -610,12 +609,12 @@ bool Guild::Member::CheckStats() const
{
if (m_level < 1)
{
- sLog->outError("Player (GUID: %u) has a broken data in field `characters`.`level`, deleting him from guild!", GUID_LOPART(m_guid));
+ sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has a broken data in field `characters`.`level`, deleting him from guild!", GUID_LOPART(m_guid));
return false;
}
if (m_class < CLASS_WARRIOR || m_class >= MAX_CLASSES)
{
- sLog->outError("Player (GUID: %u) has a broken data in field `characters`.`class`, deleting him from guild!", GUID_LOPART(m_guid));
+ sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has a broken data in field `characters`.`class`, deleting him from guild!", GUID_LOPART(m_guid));
return false;
}
return true;
@@ -1220,17 +1219,16 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/)
session->SendPacket(&data);
else
BroadcastPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_ROSTER)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_ROSTER)");
}
void Guild::HandleQuery(WorldSession* session)
{
WorldPacket data(SMSG_GUILD_QUERY_RESPONSE, 8 * 32 + 200); // Guess size
-
data << uint32(m_id);
data << m_name;
- for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) // Alwayse show 10 ranks
+ for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) // Always show 10 ranks
{
if (i < _GetRanksSize())
data << m_ranks[i].GetName();
@@ -1239,10 +1237,10 @@ void Guild::HandleQuery(WorldSession* session)
}
m_emblemInfo.WritePacket(data);
- data << uint32(0); // Something new in WotLK
-
+ data << uint32(_GetRanksSize()); // Amount of ranks
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)");
+
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)");
}
void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd)
@@ -1451,7 +1449,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name)
data << m_name;
pInvitee->GetSession()->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INVITE)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_INVITE)");
}
void Guild::HandleAcceptMember(WorldSession* session)
@@ -1719,12 +1717,12 @@ void Guild::SendInfo(WorldSession* session) const
{
WorldPacket data(SMSG_GUILD_INFO, m_name.size() + 4 + 4 + 4);
data << m_name;
- data << secsToTimeBitFields(m_createdDate); // 3.x (prev. year + month + day)
+ data.AppendPackedTime(m_createdDate); // 3.x (prev. year + month + day)
data << uint32(m_members.size()); // Number of members
data << m_accountsNumber; // Number of accounts
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INFO)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_INFO)");
}
void Guild::SendEventLog(WorldSession* session) const
@@ -1774,7 +1772,7 @@ void Guild::SendBankTabsInfo(WorldSession* session) const
data << uint8(0); // Do not send tab content
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
void Guild::SendBankTabText(WorldSession* session, uint8 tabId) const
@@ -1914,13 +1912,13 @@ bool Guild::LoadBankEventLogFromDB(Field* fields)
{
if (!isMoneyTab)
{
- sLog->outError("GuildBankEventLog ERROR: MoneyEvent(LogGuid: %u, Guild: %u) does not belong to money tab (%u), ignoring...", guid, m_id, dbTabId);
+ sLog->outError(LOG_FILTER_GUILD, "GuildBankEventLog ERROR: MoneyEvent(LogGuid: %u, Guild: %u) does not belong to money tab (%u), ignoring...", guid, m_id, dbTabId);
return false;
}
}
else if (isMoneyTab)
{
- sLog->outError("GuildBankEventLog ERROR: non-money event (LogGuid: %u, Guild: %u) belongs to money tab, ignoring...", guid, m_id);
+ sLog->outError(LOG_FILTER_GUILD, "GuildBankEventLog ERROR: non-money event (LogGuid: %u, Guild: %u) belongs to money tab, ignoring...", guid, m_id);
return false;
}
pLog->LoadEvent(new BankEventLogEntry(
@@ -1943,7 +1941,7 @@ bool Guild::LoadBankTabFromDB(Field* fields)
uint8 tabId = fields[1].GetUInt8();
if (tabId >= _GetPurchasedTabsSize())
{
- sLog->outError("Invalid tab (tabId: %u) in guild bank, skipped.", tabId);
+ sLog->outError(LOG_FILTER_GUILD, "Invalid tab (tabId: %u) in guild bank, skipped.", tabId);
return false;
}
return m_bankTabs[tabId]->LoadFromDB(fields);
@@ -1954,7 +1952,7 @@ bool Guild::LoadBankItemFromDB(Field* fields)
uint8 tabId = fields[12].GetUInt8();
if (tabId >= _GetPurchasedTabsSize())
{
- sLog->outError("Invalid tab for item (GUID: %u, id: #%u) in guild bank, skipped.",
+ sLog->outError(LOG_FILTER_GUILD, "Invalid tab for item (GUID: %u, id: #%u) in guild bank, skipped.",
fields[14].GetUInt32(), fields[15].GetUInt32());
return false;
}
@@ -1972,7 +1970,7 @@ bool Guild::Validate()
bool broken_ranks = false;
if (_GetRanksSize() < GUILD_RANKS_MIN_COUNT || _GetRanksSize() > GUILD_RANKS_MAX_COUNT)
{
- sLog->outError("Guild %u has invalid number of ranks, creating new...", m_id);
+ sLog->outError(LOG_FILTER_GUILD, "Guild %u has invalid number of ranks, creating new...", m_id);
broken_ranks = true;
}
else
@@ -1982,7 +1980,7 @@ bool Guild::Validate()
RankInfo* rankInfo = GetRankInfo(rankId);
if (rankInfo->GetId() != rankId)
{
- sLog->outError("Guild %u has broken rank id %u, creating default set of ranks...", m_id, rankId);
+ sLog->outError(LOG_FILTER_GUILD, "Guild %u has broken rank id %u, creating default set of ranks...", m_id, rankId);
broken_ranks = true;
}
}
@@ -2533,7 +2531,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
/*
if (pItemSrc->GetCount() == 0)
{
- sLog->outCrash("Guild::SwapItems: Player %s(GUIDLow: %u) tried to move item %u from tab %u slot %u to tab %u slot %u, but item %u has a stack of zero!",
+ sLog->outFatal(LOG_FILTER_GENERAL, "Guild::SwapItems: Player %s(GUIDLow: %u) tried to move item %u from tab %u slot %u to tab %u slot %u, but item %u has a stack of zero!",
player->GetName(), player->GetGUIDLow(), pItemSrc->GetEntry(), tabId, slotId, destTabId, destSlotId, pItemSrc->GetEntry());
//return; // Commented out for now, uncomment when it's verified that this causes a crash!!
}
@@ -2643,7 +2641,7 @@ void Guild::_SendBankContent(WorldSession* session, uint8 tabId) const
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
}
@@ -2658,7 +2656,7 @@ void Guild::_SendBankMoneyUpdate(WorldSession* session) const
data << uint8(0); // No items
BroadcastPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const
@@ -2718,7 +2716,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
player->GetSession()->SendPacket(&data);
}
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
}
@@ -2742,5 +2740,5 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par
BroadcastPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_EVENT");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent SMSG_GUILD_EVENT");
}
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index e18e62e51b7..dd1fb7cc6b6 100755
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -37,7 +37,7 @@ enum GuildMisc
GUILD_RANK_NONE = 0xFF,
GUILD_WITHDRAW_MONEY_UNLIMITED = 0xFFFFFFFF,
GUILD_WITHDRAW_SLOT_UNLIMITED = 0xFFFFFFFF,
- GUILD_EVENT_LOG_GUID_UNDEFINED = 0xFFFFFFFF,
+ GUILD_EVENT_LOG_GUID_UNDEFINED = 0xFFFFFFFF
};
enum GuildDefaultRanks
@@ -47,7 +47,7 @@ enum GuildDefaultRanks
GR_OFFICER = 1,
GR_VETERAN = 2,
GR_MEMBER = 3,
- GR_INITIATE = 4,
+ GR_INITIATE = 4
// When promoting member server does: rank--
// When demoting member server does: rank++
};
@@ -141,7 +141,7 @@ enum PetitionTurns
{
PETITION_TURN_OK = 0,
PETITION_TURN_ALREADY_IN_GUILD = 2,
- PETITION_TURN_NEED_MORE_SIGNATURES = 4,
+ PETITION_TURN_NEED_MORE_SIGNATURES = 4
};
enum PetitionSigns
@@ -150,7 +150,7 @@ enum PetitionSigns
PETITION_SIGN_ALREADY_SIGNED = 1,
PETITION_SIGN_ALREADY_IN_GUILD = 2,
PETITION_SIGN_CANT_SIGN_OWN = 3,
- PETITION_SIGN_NOT_SERVER = 4,
+ PETITION_SIGN_NOT_SERVER = 4
};
enum GuildBankRights
@@ -160,7 +160,7 @@ enum GuildBankRights
GUILD_BANK_RIGHT_UPDATE_TEXT = 0x04,
GUILD_BANK_RIGHT_DEPOSIT_ITEM = GUILD_BANK_RIGHT_VIEW_TAB | GUILD_BANK_RIGHT_PUT_ITEM,
- GUILD_BANK_RIGHT_FULL = 0xFF,
+ GUILD_BANK_RIGHT_FULL = 0xFF
};
enum GuildBankEventLogTypes
@@ -173,7 +173,7 @@ enum GuildBankEventLogTypes
GUILD_BANK_LOG_REPAIR_MONEY = 6,
GUILD_BANK_LOG_MOVE_ITEM2 = 7,
GUILD_BANK_LOG_UNK1 = 8,
- GUILD_BANK_LOG_UNK2 = 9,
+ GUILD_BANK_LOG_UNK2 = 9
};
enum GuildEventLogTypes
@@ -183,7 +183,7 @@ enum GuildEventLogTypes
GUILD_EVENT_LOG_PROMOTE_PLAYER = 3,
GUILD_EVENT_LOG_DEMOTE_PLAYER = 4,
GUILD_EVENT_LOG_UNINVITE_PLAYER = 5,
- GUILD_EVENT_LOG_LEAVE_GUILD = 6,
+ GUILD_EVENT_LOG_LEAVE_GUILD = 6
};
enum GuildEmblemError
diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp
index 106be2a605d..cebcf6040f9 100644
--- a/src/server/game/Guilds/GuildMgr.cpp
+++ b/src/server/game/Guilds/GuildMgr.cpp
@@ -43,7 +43,7 @@ uint32 GuildMgr::GenerateGuildId()
{
if (NextGuildId >= 0xFFFFFFFE)
{
- sLog->outError("Guild ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GUILD, "Guild ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return NextGuildId++;
@@ -93,7 +93,7 @@ Guild* GuildMgr::GetGuildByLeader(uint64 guid) const
void GuildMgr::LoadGuilds()
{
// 1. Load all guilds
- sLog->outString("Loading guilds definitions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guilds definitions...");
{
uint32 oldMSTime = getMSTime();
@@ -105,8 +105,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild definitions. DB table `guild` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild definitions. DB table `guild` is empty.");
return;
}
else
@@ -128,13 +127,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 2. Load all guild ranks
- sLog->outString("Loading guild ranks...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild ranks...");
{
uint32 oldMSTime = getMSTime();
@@ -146,8 +144,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
}
else
{
@@ -164,13 +161,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 3. Load all guild members
- sLog->outString("Loading guild members...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild members...");
{
uint32 oldMSTime = getMSTime();
@@ -189,8 +185,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild members. DB table `guild_member` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty.");
}
else
{
@@ -208,13 +203,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 4. Load all guild bank tab rights
- sLog->outString("Loading bank tab rights...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading bank tab rights...");
{
uint32 oldMSTime = getMSTime();
@@ -226,8 +220,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
}
else
{
@@ -244,13 +237,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 5. Load all event logs
- sLog->outString("Loading guild event logs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild event logs...");
{
uint32 oldMSTime = getMSTime();
@@ -261,8 +253,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
}
else
{
@@ -279,13 +270,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 6. Load all bank event logs
- sLog->outString("Loading guild bank event logs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank event logs...");
{
uint32 oldMSTime = getMSTime();
@@ -297,8 +287,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
}
else
{
@@ -315,13 +304,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 7. Load all guild bank tabs
- sLog->outString("Loading guild bank tabs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank tabs...");
{
uint32 oldMSTime = getMSTime();
@@ -333,8 +321,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
}
else
{
@@ -351,13 +338,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 8. Fill all guild bank tabs
- sLog->outString("Filling bank tabs with items...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Filling bank tabs with items...");
{
uint32 oldMSTime = getMSTime();
@@ -371,8 +357,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
}
else
{
@@ -389,13 +374,12 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// 9. Validate loaded guild data
- sLog->outString("Validating data of loaded guilds...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Validating data of loaded guilds...");
{
uint32 oldMSTime = getMSTime();
@@ -412,7 +396,6 @@ void GuildMgr::LoadGuilds()
}
}
- sLog->outString(">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
}
diff --git a/src/server/game/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp
index ef537cb6198..c3ffeace3fb 100755
--- a/src/server/game/Handlers/AddonHandler.cpp
+++ b/src/server/game/Handlers/AddonHandler.cpp
@@ -37,26 +37,6 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
uint32 CurrentPosition;
uint32 TempValue;
- unsigned char tdata[256] =
- {
- 0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
- 0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
- 0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
- 0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
- 0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
- 0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
- 0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
- 0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
- 0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
- 0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
- 0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
- 0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
- 0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
- 0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
- 0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
- 0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
- };
-
// broken addon packet, can't be received from real client
if (Source->rpos() + 4 > Source->size())
return false;
@@ -110,7 +90,28 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
uint8 unk = (crc != 0x4c1c776d); // If addon is Standard addon CRC
*Target << uint8(unk);
if (unk)
+ {
+ unsigned char tdata[256] =
+ {
+ 0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
+ 0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
+ 0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
+ 0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
+ 0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
+ 0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
+ 0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
+ 0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
+ 0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
+ 0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
+ 0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
+ 0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
+ 0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
+ 0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
+ 0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
+ 0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
+ };
Target->append(tdata, sizeof(tdata));
+ }
*Target << uint32(0);
}
@@ -135,7 +136,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
}
else
{
- sLog->outError("Addon packet uncompress error :(");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Addon packet uncompress error :(");
return false;
}
return true;
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index d26f275b864..74d4f4102cf 100755
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
etime *= MINUTE;
- switch(etime)
+ switch (etime)
{
case 1*MIN_AUCTION_TIME:
case 2*MIN_AUCTION_TIME:
@@ -247,11 +247,12 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
- GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
+ GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
}
AH->item_guidlow = item->GetGUIDLow();
AH->item_template = item->GetEntry();
+ AH->itemCount = item->GetCount();
AH->owner = _player->GetGUIDLow();
AH->startbid = bid;
AH->bidder = 0;
@@ -261,7 +262,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
- sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
sAuctionMgr->AddAItem(item);
auctionHouse->AddAuction(AH);
@@ -276,7 +277,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK);
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
return;
}
else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size
@@ -284,7 +285,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
Item* newItem = item->CloneItem(finalCount, _player);
if (!newItem)
{
- sLog->outError("CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
+ sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
return;
}
@@ -292,11 +293,12 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
- GetPlayerName(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount());
+ GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount());
}
AH->item_guidlow = newItem->GetGUIDLow();
AH->item_template = newItem->GetEntry();
+ AH->itemCount = newItem->GetCount();
AH->owner = _player->GetGUIDLow();
AH->startbid = bid;
AH->bidder = 0;
@@ -306,7 +308,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
- sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
sAuctionMgr->AddAItem(newItem);
auctionHouse->AddAuction(AH);
@@ -345,7 +347,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK);
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
return;
}
}
@@ -436,7 +438,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
auction->bidder = player->GetGUIDLow();
auction->bid = price;
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID);
stmt->setUInt32(0, auction->bidder);
@@ -459,7 +461,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
}
auction->bidder = player->GetGUIDLow();
auction->bid = auction->buyout;
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout);
//- Mails must be under transaction control too to prevent data loss
sAuctionMgr->SendAuctionSalePendingMail(auction, trans);
@@ -520,18 +522,15 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans);
player->ModifyMoney(-int32(auctionCut));
}
- // Return the item by mail
- std::ostringstream msgAuctionCanceledOwner;
- msgAuctionCanceledOwner << auction->item_template << ":0:" << AUCTION_CANCELED << ":0:0";
// item will deleted or added to received mail list
- MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body
+ MailDraft(auction->BuildAuctionMailSubject(AUCTION_CANCELED), AuctionEntry::BuildAuctionMailBody(0, 0, auction->buyout, auction->deposit, 0))
.AddItem(pItem)
.SendMailTo(trans, player, auction, MAIL_CHECK_MASK_COPIED);
}
else
{
- sLog->outError("Auction id: %u has non-existed item (item guid : %u)!!!", auction->Id, auction->item_guidlow);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Auction id: %u has non-existed item (item guid : %u)!!!", auction->Id, auction->item_guidlow);
SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR);
return;
}
@@ -540,7 +539,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
{
SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR);
//this code isn't possible ... maybe there should be assert
- sLog->outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", player->GetGUIDLow(), auctionId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", player->GetGUIDLow(), auctionId);
return;
}
@@ -572,7 +571,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
recv_data >> outbiddedCount;
if (recv_data.size() != (16 + outbiddedCount * 4))
{
- sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(), (16 + outbiddedCount * 4));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(), (16 + outbiddedCount * 4));
outbiddedCount = 0;
}
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index a0c5268136b..3bae430ad2c 100755
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -86,7 +86,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{
- sLog->outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow());
return;
}
@@ -244,7 +244,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
}
-void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_data*/)
+void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recv_data*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message");
@@ -252,39 +252,44 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_
if (!bg) // can't be received if player not in battleground
return;
- uint32 count = 0;
- Player* aplr = NULL;
- Player* hplr = NULL;
+ uint32 flagCarrierCount = 0;
+ Player* allianceFlagCarrier = NULL;
+ Player* hordeFlagCarrier = NULL;
if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_ALLIANCE))
{
- aplr = ObjectAccessor::FindPlayer(guid);
- if (aplr)
- ++count;
+ allianceFlagCarrier = ObjectAccessor::FindPlayer(guid);
+ if (allianceFlagCarrier)
+ ++flagCarrierCount;
}
if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_HORDE))
{
- hplr = ObjectAccessor::FindPlayer(guid);
- if (hplr)
- ++count;
+ hordeFlagCarrier = ObjectAccessor::FindPlayer(guid);
+ if (hordeFlagCarrier)
+ ++flagCarrierCount;
}
- WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, 4 + 4 + 16 * count);
- data << 0;
- data << count;
- if (aplr)
+ WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, 4 + 4 + 16 * flagCarrierCount);
+ // Used to send several player positions (found used in AV)
+ data << 0; // CGBattlefieldInfo__m_numPlayerPositions
+ /*
+ for (CGBattlefieldInfo__m_numPlayerPositions)
+ data << guid << posx << posy;
+ */
+ data << flagCarrierCount;
+ if (allianceFlagCarrier)
{
- data << uint64(aplr->GetGUID());
- data << float(aplr->GetPositionX());
- data << float(aplr->GetPositionY());
+ data << uint64(allianceFlagCarrier->GetGUID());
+ data << float(allianceFlagCarrier->GetPositionX());
+ data << float(allianceFlagCarrier->GetPositionY());
}
- if (hplr)
+ if (hordeFlagCarrier)
{
- data << uint64(hplr->GetGUID());
- data << float(hplr->GetPositionX());
- data << float(hplr->GetPositionY());
+ data << uint64(hordeFlagCarrier->GetGUID());
+ data << float(hordeFlagCarrier->GetPositionX());
+ data << float(hordeFlagCarrier->GetPositionY());
}
SendPacket(&data);
@@ -366,13 +371,13 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
GroupQueueInfo ginfo;
if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo))
{
- sLog->outError("BattlegroundHandler: itrplayerstatus not found.");
+ sLog->outError(LOG_FILTER_NETWORKIO, "BattlegroundHandler: itrplayerstatus not found.");
return;
}
// if action == 1, then instanceId is required
if (!ginfo.IsInvitedToBGInstanceGUID && action == 1)
{
- sLog->outError("BattlegroundHandler: instance not found.");
+ sLog->outError(LOG_FILTER_NETWORKIO, "BattlegroundHandler: instance not found.");
return;
}
@@ -383,7 +388,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
if (!bg)
{
- sLog->outError("BattlegroundHandler: bg_template not found for type id %u.", bgTypeId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "BattlegroundHandler: bg_template not found for type id %u.", bgTypeId);
return;
}
@@ -408,7 +413,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
//if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
if (_player->getLevel() > bg->GetMaxLevel())
{
- sLog->outError("Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
_player->GetName(), _player->GetGUIDLow(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID());
action = 0;
}
@@ -457,6 +462,9 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId);
break;
case 0: // leave queue
+ if (bg->isArena() && bg->GetStatus() > STATUS_WAIT_QUEUE)
+ return;
+
// if player leaves rated arena match before match start, it is counted as he played but he lost
if (ginfo.IsRated && ginfo.IsInvitedToBGInstanceGUID)
{
@@ -478,7 +486,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId);
break;
default:
- sLog->outError("Battleground port: unknown action %u", action);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground port: unknown action %u", action);
break;
}
}
@@ -565,46 +573,6 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/)
}
}
-void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
-{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
-
- Battleground* bg = _player->GetBattleground();
-
- uint64 guid;
- recv_data >> guid;
-
- Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
- if (!unit)
- return;
-
- if (!unit->isSpiritService()) // it's not spirit service
- return;
-
- if (bg)
- sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid);
-}
-
-void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
-{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
-
- Battleground* bg = _player->GetBattleground();
-
- uint64 guid;
- recv_data >> guid;
-
- Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
- if (!unit)
- return;
-
- if (!unit->isSpiritService()) // it's not spirit service
- return;
-
- if (bg)
- bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
-}
-
void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
@@ -644,7 +612,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
arenatype = ARENA_TYPE_5v5;
break;
default:
- sLog->outError("Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot);
return;
}
@@ -652,7 +620,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BATTLEGROUND_AA);
if (!bg)
{
- sLog->outError("Battleground: template bg (all arenas) not found");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground: template bg (all arenas) not found");
return;
}
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 298c742fc3a..d1209eead22 100755
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -73,7 +73,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
}
else
{
- sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it);
+ sLog->outError(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it);
data << uint64(0);
data << uint64(0);
data << uint8(0);
@@ -90,16 +90,16 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(*it))
{
data << uint64(*it);
- data << calendarEvent->GetTitle().c_str();
+ data << calendarEvent->GetTitle();
data << uint32(calendarEvent->GetType());
- data << uint32(calendarEvent->GetTime());
+ data.AppendPackedTime(calendarEvent->GetTime());
data << uint32(calendarEvent->GetFlags());
data << uint32(calendarEvent->GetDungeonId());
data.appendPackGUID(calendarEvent->GetCreatorGUID());
}
else
{
- sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it);
+ sLog->outError(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it);
data << uint64(0);
data << uint8(0);
data << uint32(0);
@@ -111,7 +111,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
}
data << uint32(cur_time); // server time
- data << uint32(secsToTimeBitFields(cur_time)); // server time
+ data.AppendPackedTime(cur_time); // server time
uint32 counter = 0;
size_t p_counter = data.wpos();
@@ -240,7 +240,10 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
uint8 rank;
recvData >> title >> description >> type >> repeatable >> maxInvites;
- recvData >> dungeonId >> eventPackedTime >> unkPackedTime >> flags;
+ recvData >> dungeonId;
+ recvData.ReadPackedTime(eventPackedTime);
+ recvData.ReadPackedTime(unkPackedTime);
+ recvData >> flags;
if (!(flags & CALENDAR_FLAG_WITHOUT_INVITES))
{
@@ -251,7 +254,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
if (inviteCount != 1 || invitee != guid)
{
- sLog->outError("HandleCalendarAddEvent: [" UI64FMTD
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleCalendarAddEvent: [" UI64FMTD
"]: More than one invite (%d) or Invitee [" UI64FMTD
"] differs", guid, inviteCount, invitee);
return;
@@ -317,7 +320,9 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData)
recvData >> eventId >> inviteId >> title >> description >> type;
recvData >> repeatable >> maxInvites >> dungeonId;
- recvData >> eventPackedTime >> timeZoneTime >> flags;
+ recvData.ReadPackedTime(eventPackedTime);
+ recvData.ReadPackedTime(timeZoneTime);
+ recvData >> flags;
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_UPDATE_EVENT [" UI64FMTD "] EventId [" UI64FMTD
"], InviteId [" UI64FMTD "] Title %s, Description %s, type %u "
@@ -372,7 +377,8 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
uint64 inviteId;
uint32 time;
- recvData >> eventId >> inviteId >> time;
+ recvData >> eventId >> inviteId;
+ recvData.ReadPackedTime(time);
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COPY_EVENT [" UI64FMTD "], EventId [" UI64FMTD
"] inviteId [" UI64FMTD "] Time: %u", guid, eventId, inviteId, time);
@@ -425,7 +431,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData)
return;
}
- if (_player->GetTeam() != team)
+ if (_player->GetTeam() != team && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR))
{
SendCalendarCommandResult(CALENDAR_ERROR_NOT_ALLIED);
return;
@@ -607,15 +613,15 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, Calenda
data << uint8(sendEventType);
data.appendPackGUID(calendarEvent.GetCreatorGUID());
data << uint64(eventId);
- data << calendarEvent.GetTitle().c_str();
- data << calendarEvent.GetDescription().c_str();
+ data << calendarEvent.GetTitle();
+ data << calendarEvent.GetDescription();
data << uint8(calendarEvent.GetType());
data << uint8(calendarEvent.GetRepeatable());
data << uint32(calendarEvent.GetMaxInvites());
data << int32(calendarEvent.GetDungeonId());
data << uint32(calendarEvent.GetFlags());
- data << uint32(calendarEvent.GetTime());
- data << uint32(calendarEvent.GetTimeZoneTime());
+ data.AppendPackedTime(calendarEvent.GetTime());
+ data.AppendPackedTime(calendarEvent.GetTimeZoneTime());
data << uint32(calendarEvent.GetGuildId());
CalendarInviteIdList const& invites = calendarEvent.GetInviteIdList();
@@ -635,7 +641,7 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, Calenda
data << uint8(calendarEvent.GetGuildId() != 0);
data << uint64(invite->GetInviteId());
data << uint32(invite->GetStatusTime());
- data << invite->GetText().c_str();
+ data << invite->GetText();
}
else
{
@@ -643,7 +649,7 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, Calenda
data << uint8(0) << uint8(0) << uint8(0) << uint8(0)
<< uint64(0) << uint32(0) << uint8(0);
- sLog->outError("SendCalendarEvent: No Invite found with id [" UI64FMTD "]", *it);
+ sLog->outError(LOG_FILTER_NETWORKIO, "SendCalendarEvent: No Invite found with id [" UI64FMTD "]", *it);
}
}
SendPacket(&data);
@@ -692,7 +698,7 @@ void WorldSession::SendCalendarEventInviteAlert(CalendarEvent const& calendarEve
WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_ALERT);
data << uint64(eventId);
data << calendarEvent.GetTitle().c_str();
- data << uint32(calendarEvent.GetTime());
+ data.AppendPackedTime(calendarEvent.GetTime());
data << uint32(calendarEvent.GetFlags());
data << uint32(calendarEvent.GetType());
data << uint32(calendarEvent.GetDungeonId());
@@ -717,9 +723,9 @@ void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEve
calendarEvent.GetTitle().size() + calendarEvent.GetDescription().size() + 1 + 4 + 4);
data << uint8(sendEventType);
data << uint64(eventId);
- data << uint32(calendarEvent.GetTime());
+ data.AppendPackedTime(calendarEvent.GetTime());
data << uint32(calendarEvent.GetFlags());
- data << uint32(calendarEvent.GetTime());
+ data.AppendPackedTime(calendarEvent.GetTime());
data << uint8(calendarEvent.GetType());
data << uint32(calendarEvent.GetDungeonId());
data << calendarEvent.GetTitle().c_str();
@@ -734,7 +740,7 @@ void WorldSession::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEv
{
uint64 guid = _player->GetGUID();
uint64 eventId = calendarEvent.GetEventId();
- uint32 eventTime = (calendarEvent.GetTime());
+ uint32 eventTime = calendarEvent.GetTime();
sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_REMOVED_ALERT [" UI64FMTD "] EventId ["
UI64FMTD "] Time %u", guid, eventId, eventTime);
@@ -742,7 +748,7 @@ void WorldSession::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEv
WorldPacket data(SMSG_CALENDAR_EVENT_REMOVED_ALERT, 1 + 8 + 1);
data << uint8(1); // FIXME: If true does not SignalEvent(EVENT_CALENDAR_ACTION_PENDING)
data << uint64(eventId);
- data << uint32(eventTime);
+ data.AppendPackedTime(eventTime);
SendPacket(&data);
}
@@ -752,11 +758,11 @@ void WorldSession::SendCalendarEventStatus(CalendarEvent const& calendarEvent, C
uint64 eventId = calendarEvent.GetEventId();
uint64 inviteId = invite.GetInviteId();
uint64 invitee = invite.GetInvitee();
- uint32 eventTime = (calendarEvent.GetTime());
+ uint32 eventTime = calendarEvent.GetTime();
uint32 flags = calendarEvent.GetFlags();
uint8 status = invite.GetStatus();
uint8 rank = invite.GetRank();
- uint32 statusTime = secsToTimeBitFields(invite.GetStatusTime());
+ uint32 statusTime = invite.GetStatusTime();
sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_STATUS [" UI64FMTD "] EventId ["
@@ -768,11 +774,11 @@ void WorldSession::SendCalendarEventStatus(CalendarEvent const& calendarEvent, C
WorldPacket data(SMSG_CALENDAR_EVENT_STATUS, 8 + 8 + 4 + 4 + 1 + 1 + 4);
data.appendPackGUID(invitee);
data << uint64(eventId);
- data << uint32(eventTime);
+ data.AppendPackedTime(eventTime);
data << uint32(flags);
data << uint8(status);
data << uint8(rank);
- data << uint32(statusTime);
+ data.AppendPackedTime(statusTime);
SendPacket(&data);
}
@@ -801,7 +807,7 @@ void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calen
{
uint64 guid = _player->GetGUID();
uint64 eventId = calendarEvent.GetEventId();
- uint32 eventTime = (calendarEvent.GetTime());
+ uint32 eventTime = calendarEvent.GetTime();
uint32 flags = calendarEvent.GetFlags();
sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT ["
@@ -810,7 +816,7 @@ void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calen
WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, 8 + 4 + 4 + 1);
data << uint64(eventId);
- data << uint32(eventTime);
+ data.AppendPackedTime(eventTime);
data << uint32(flags);
data << uint8(status);
SendPacket(&data);
@@ -877,7 +883,7 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
if (add)
{
data.SetOpcode(SMSG_CALENDAR_RAID_LOCKOUT_ADDED);
- data << uint32(secsToTimeBitFields(currTime));
+ data.AppendPackedTime(currTime);
}
data << uint32(save->GetMapId());
@@ -899,7 +905,7 @@ void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save)
time_t cur_time = time_t(time(NULL));
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8);
- data << secsToTimeBitFields(cur_time);
+ data.AppendPackedTime(cur_time);
data << uint32(save->GetMapId());
data << uint32(save->GetDifficulty());
data << uint32(0); // Amount of seconds that has changed to the reset time
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 2d70efd3305..39cf0d6b3cf 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -215,7 +215,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
do
{
uint32 guidlow = (*result)[0].GetUInt32();
- sLog->outDetail("Loading char guid %u from account %u.", guidlow, GetAccountId());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Loading char guid %u from account %u.", guidlow, GetAccountId());
if (Player::BuildEnumData(result, &data))
{
_allowedCharsToLogin.insert(guidlow);
@@ -293,7 +293,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
{
data << (uint8)CHAR_CREATE_FAILED;
SendPacket(&data);
- sLog->outError("Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId());
return;
}
@@ -302,7 +302,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
{
data << (uint8)CHAR_CREATE_FAILED;
SendPacket(&data);
- sLog->outError("Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId());
return;
}
@@ -310,7 +310,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
if (raceEntry->expansion > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION;
- sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_);
SendPacket(&data);
return;
}
@@ -319,7 +319,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
if (classEntry->expansion > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION_CLASS;
- sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_);
SendPacket(&data);
return;
}
@@ -348,7 +348,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
{
data << (uint8)CHAR_NAME_NO_NAME;
SendPacket(&data);
- sLog->outError("Account:[%d] but tried to Create character with empty [name] ", GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Account:[%d] but tried to Create character with empty [name] ", GetAccountId());
return;
}
@@ -658,8 +658,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
SendPacket(&data);
std::string IP_str = GetRemoteAddress();
- sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow());
- sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow());
sScriptMgr->OnPlayerCreate(&newChar);
sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass());
@@ -687,7 +686,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
if (sGuildMgr->GetGuildByLeader(guid))
{
WorldPacket data(SMSG_CHAR_DELETE, 1);
- data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER;
+ data << uint8(CHAR_DELETE_FAILED_GUILD_LEADER);
SendPacket(&data);
return;
}
@@ -696,18 +695,15 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
if (sArenaTeamMgr->GetArenaTeamByCaptain(guid))
{
WorldPacket data(SMSG_CHAR_DELETE, 1);
- data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN;
+ data << uint8(CHAR_DELETE_FAILED_ARENA_CAPTAIN);
SendPacket(&data);
return;
}
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_NAME_BY_GUID);
-
stmt->setUInt32(0, GUID_LOPART(guid));
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (result)
+ if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
{
Field* fields = result->Fetch();
accountId = fields[0].GetUInt32();
@@ -719,12 +715,11 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
return;
std::string IP_str = GetRemoteAddress();
- sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
- sLog->outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
sScriptMgr->OnPlayerDelete(guid);
sWorld->DeleteCharaceterNameData(GUID_LOPART(guid));
- if (sLog->IsOutCharDump()) // optimize GetPlayerDump call
+ if (sLog->ShouldLog(LOG_FILTER_PLAYER_DUMP, LOG_LEVEL_INFO)) // optimize GetPlayerDump call
{
std::string dump;
if (PlayerDumpWriter().GetDump(GUID_LOPART(guid), dump))
@@ -734,7 +729,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
Player::DeleteFromDB(guid, GetAccountId());
WorldPacket data(SMSG_CHAR_DELETE, 1);
- data << (uint8)CHAR_DELETE_SUCCESS;
+ data << uint8(CHAR_DELETE_SUCCESS);
SendPacket(&data);
}
@@ -742,20 +737,20 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data)
{
if (PlayerLoading() || GetPlayer() != NULL)
{
- sLog->outError("Player tryes to login again, AccountId = %d", GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player tryes to login again, AccountId = %d", GetAccountId());
return;
}
m_playerLoading = true;
uint64 playerGuid = 0;
- sLog->outStaticDebug("WORLD: Recvd Player Logon Message");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd Player Logon Message");
recv_data >> playerGuid;
if (!CharCanLogin(GUID_LOPART(playerGuid)))
{
- sLog->outError("Account (%u) can't login with that character (%u).", GetAccountId(), GUID_LOPART(playerGuid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Account (%u) can't login with that character (%u).", GetAccountId(), GUID_LOPART(playerGuid));
KickPlayer();
return;
}
@@ -839,13 +834,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
data.put(0, linecount);
SendPacket(&data);
- sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_MOTD)");
// send server info
if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
chH.PSendSysMessage(_FULLVERSION);
- sLog->outStaticDebug("WORLD: Sent server info");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent server info");
}
//QueryResult* result = CharacterDatabase.PQuery("SELECT guildid, rank FROM guild_member WHERE guid = '%u'", pCurrChar->GetGUIDLow());
@@ -868,7 +863,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
else
{
// remove wrong guild data
- sLog->outError("Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId());
pCurrChar->SetInGuild(0);
}
}
@@ -1006,7 +1001,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
SendNotification(LANG_GM_ON);
std::string IP_str = GetRemoteAddress();
- sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d",
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d",
GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->getLevel());
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
@@ -1020,7 +1015,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data)
{
- sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_ATWAR");
uint32 repListID;
uint8 flag;
@@ -1034,7 +1029,7 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data)
//I think this function is never used :/ I dunno, but i guess this opcode not exists
void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/)
{
- sLog->outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
GetPlayer()->GetReputationMgr().SendStates();
}
@@ -1068,7 +1063,7 @@ void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/)
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
{
- sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_WATCHED_FACTION");
uint32 fact;
recv_data >> fact;
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact);
@@ -1076,7 +1071,7 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
{
- sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_INACTIVE");
uint32 replistid;
uint8 inactive;
recv_data >> replistid >> inactive;
@@ -1086,14 +1081,14 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
void WorldSession::HandleShowingHelmOpcode(WorldPacket& recv_data)
{
- sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_HELM for %s", _player->GetName());
recv_data.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
}
void WorldSession::HandleShowingCloakOpcode(WorldPacket& recv_data)
{
- sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_CLOAK for %s", _player->GetName());
recv_data.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
}
@@ -1183,7 +1178,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu
CharacterDatabase.Execute(stmt);
- sLog->outChar("Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), guidLow, newName.c_str());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), guidLow, newName.c_str());
WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newName.size()+1));
data << uint8(RESPONSE_SUCCESS);
@@ -1313,12 +1308,29 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data)
if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender()))
return;
- uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor);
+ GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
+ if (!go)
+ {
+ WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
+ data << uint32(2);
+ SendPacket(&data);
+ return;
+ }
+
+ if (_player->getStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)
+ {
+ WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
+ data << uint32(2);
+ SendPacket(&data);
+ return;
+ }
+
+ uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor);
// 0 - ok
// 1, 3 - not enough money
// 2 - you have to seat on barber chair
- if (!_player->HasEnoughMoney(Cost))
+ if (!_player->HasEnoughMoney(cost))
{
WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
data << uint32(1); // no money
@@ -1332,8 +1344,8 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data)
SendPacket(&data);
}
- _player->ModifyMoney(-int32(Cost)); // it isn't free
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, Cost);
+ _player->ModifyMoney(-int32(cost)); // it isn't free
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost);
_player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id));
_player->SetByteValue(PLAYER_BYTES, 3, uint8(Color));
@@ -1341,7 +1353,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data)
if (bs_skinColor)
_player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->hair_id));
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
_player->SetStandState(0); // stand up
}
@@ -1450,7 +1462,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
if (result)
{
std::string oldname = result->Fetch()[0].GetString();
- sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
}
Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair);
@@ -1514,6 +1526,14 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
uint64 itemGuid;
recv_data.readPackGUID(itemGuid);
+ // equipment manager sends "1" (as raw GUID) for slots set to "ignore" (don't touch slot at equip set)
+ if (itemGuid == 1)
+ {
+ // ignored slots saved as bit mask because we have no free special values for Items[i]
+ eqSet.IgnoreMask |= 1 << i;
+ continue;
+ }
+
Item* item = _player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!item && itemGuid) // cheating check 1
@@ -1555,6 +1575,10 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot);
+ // check if item slot is set to "ignored" (raw value == 1), must not be unequipped then
+ if (itemGuid == 1)
+ continue;
+
Item* item = _player->GetItemByGuid(itemGuid);
uint16 dstpos = i | (INVENTORY_SLOT_BAG_0 << 8);
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index 966eae598a6..711d7af4dc3 100755
--- a/src/server/game/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -52,7 +52,7 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && AccountMgr::IsPlayerAccount(GetSecurity())
&& !ChatHandler(this).isValidChatMessage(msg.c_str()))
{
- sLog->outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
GetPlayer()->GetGUIDLow(), msg.c_str());
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer();
@@ -73,7 +73,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
if (type >= MAX_CHAT_MSG_TYPE)
{
- sLog->outError("CHAT: Wrong message type received: %u", type);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CHAT: Wrong message type received: %u", type);
recv_data.rfinish();
return;
}
@@ -474,7 +474,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
}
} break;
default:
- sLog->outError("CHAT: unknown message type %u, lang: %u", type, lang);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CHAT: unknown message type %u, lang: %u", type, lang);
break;
}
}
@@ -577,7 +577,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data)
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker);
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
//Send scripted event call
if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI())
diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp
index 6693cdfca27..78547d2d0f3 100755
--- a/src/server/game/Handlers/CombatHandler.cpp
+++ b/src/server/game/Handlers/CombatHandler.cpp
@@ -80,7 +80,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data)
if (sheathed >= MAX_SHEATH_STATE)
{
- sLog->outError("Unknown sheath state %u ??", sheathed);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Unknown sheath state %u ??", sheathed);
return;
}
diff --git a/src/server/game/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp
index 8afd9f3b978..1b3f71c8cf1 100755
--- a/src/server/game/Handlers/DuelHandler.cpp
+++ b/src/server/game/Handlers/DuelHandler.cpp
@@ -42,8 +42,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
return;
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_ACCEPTED");
- sLog->outStaticDebug("Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName());
- sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
time_t now = time(NULL);
player->duel->startTimer = now;
diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index 18435263b2e..43655750aff 100755
--- a/src/server/game/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -84,7 +84,10 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
// restrict invite to GMs
if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
+ {
+ SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S);
return;
+ }
// can't group with
if (!GetPlayer()->isGameMaster() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
@@ -207,7 +210,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data)
if (group->GetLeaderGUID() == GetPlayer()->GetGUID())
{
- sLog->outError("HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
@@ -280,7 +283,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
//can't uninvite yourself
if (guid == GetPlayer()->GetGUID())
{
- sLog->outError("WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
@@ -330,7 +333,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
// can't uninvite yourself
if (GetPlayer()->GetName() == membername)
{
- sLog->outError("WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
@@ -447,10 +450,10 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData)
switch (rollType)
{
case ROLL_NEED:
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case ROLL_GREED:
- GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
}
@@ -856,7 +859,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
{
if (auramask & (uint64(1) << i))
{
- AuraApplication const* aurApp = player->GetVisibleAura(i);
+ AuraApplication const* aurApp = pet->GetVisibleAura(i);
*data << uint32(aurApp ? aurApp->GetBase()->GetId() : 0);
*data << uint8(1);
}
@@ -980,7 +983,7 @@ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data)
if (!GetPlayer()) // needed because STATUS_AUTHED
{
if (passOnLoot != 0)
- sLog->outError("CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!");
+ sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!");
return;
}
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index a569c914be0..614e0064132 100755
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -284,7 +284,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
uint32 item;
recv_data >> item;
- sLog->outDetail("STORAGE: Item Query = %u", item);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Item Query = %u", item);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (pProto)
@@ -306,7 +306,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
data << pProto->ItemId;
data << pProto->Class;
data << pProto->SubClass;
- data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache?
+ data << pProto->SoundOverrideSubclass;
data << Name;
data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00);
@@ -444,7 +444,7 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data)
uint8 bag, slot;
recv_data >> bag >> slot;
- //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot);
+ //sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Read bag = %u, slot = %u", bag, slot);
Item* pItem = _player->GetItemByPos(bag, slot);
if (pItem && pItem->GetTemplate()->PageText)
@@ -455,12 +455,12 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data)
if (msg == EQUIP_ERR_OK)
{
data.Initialize (SMSG_READ_ITEM_OK, 8);
- sLog->outDetail("STORAGE: Item page sent");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Item page sent");
}
else
{
data.Initialize(SMSG_READ_ITEM_FAILED, 8);
- sLog->outDetail("STORAGE: Unable to read item");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Unable to read item");
_player->SendEquipError(msg, pItem, NULL);
}
data << pItem->GetGUID();
@@ -479,7 +479,7 @@ void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recv_data)
recv_data >> itemid >> guid;
- sLog->outDetail("Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid));
}
@@ -561,7 +561,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
Item* pNewItem = pItem->CloneItem(count, _player);
if (!pNewItem)
{
- sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
@@ -586,7 +586,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
uint32 money = pProto->SellPrice * count;
_player->ModifyMoney(money);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
}
else
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
@@ -634,7 +634,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
_player->ModifyMoney(-(int32)price);
_player->RemoveItemFromBuyBackSlot(slot, false);
_player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount());
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount());
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount());
_player->StoreItem(dest, pItem, true);
}
else
@@ -880,7 +880,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
// next slot
++slot;
- sLog->outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "PLAYER: Buy bank bag slot, slot number = %u", slot);
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
@@ -908,7 +908,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
data << uint32(ERR_BANKSLOT_OK);
SendPacket(&data);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
}
void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
@@ -1349,6 +1349,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
_player->ToggleMetaGemsActive(slot, true); //turn on all metagems (except for target item)
+ _player->RemoveTradeableItem(itemTarget);
itemTarget->ClearSoulboundTradeable(_player); // clear tradeable flag
}
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 339c7a44d9f..73c8457eb66 100755
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -179,7 +179,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
for (std::vector<Player*>::const_iterator i = playersNear.begin(); i != playersNear.end(); ++i)
{
(*i)->ModifyMoney(goldPerPlayer);
- (*i)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer);
+ (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer);
WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1);
data << uint32(goldPerPlayer);
@@ -190,7 +190,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
else
{
player->ModifyMoney(loot->gold);
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold);
WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1);
data << uint32(loot->gold);
@@ -472,16 +472,18 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (!loot)
return;
- if (slotid > loot->items.size())
+ if (slotid >= loot->items.size() + loot->quest_items.size())
{
sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size());
return;
}
- LootItem& item = loot->items[slotid];
+ LootItem& item = slotid >= loot->items.size() ? loot->quest_items[slotid - loot->items.size()] : loot->items[slotid];
ItemPosCountVec dest;
InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
+ if (item.follow_loot_rules && !item.AllowedForPlayer(target))
+ msg = EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
if (msg != EQUIP_ERR_OK)
{
target->SendEquipError(msg, NULL, NULL, item.itemid);
@@ -496,9 +498,9 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
// not move item from loot to target inventory
Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters);
target->SendNewItem(newitem, uint32(item.count), false, false, true);
- target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count);
- target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count);
- target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count);
+ target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count);
+ target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count);
+ target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count);
// mark as looted
item.count=0;
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index c30cbaa622e..c6b5377fe36 100755
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -89,13 +89,13 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
if (!rc)
{
- sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND);
return;
}
- sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
if (player->GetGUID() == rc)
{
@@ -107,7 +107,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
uint32 reqmoney = cost + money;
- if (!player->HasEnoughMoney(reqmoney))
+ if (!player->HasEnoughMoney(reqmoney) && !player->isGameMaster())
{
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_ENOUGH_MONEY);
return;
@@ -246,7 +246,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
player->SendMailResult(0, MAIL_SEND, MAIL_OK);
player->ModifyMoney(-int32(reqmoney));
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
bool needItemDelay = false;
@@ -264,7 +264,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
if (!AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)",
- GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
+ GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
}
item->SetNotRefundable(GetPlayer()); // makes the item no longer refundable
@@ -284,7 +284,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
- GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
+ GetPlayerName().c_str(), GetAccountId(), money, receiver.c_str(), rc_account);
}
}
@@ -479,7 +479,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
}
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
- GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
+ GetPlayerName().c_str(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
}
else if (!receive)
sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid);
@@ -500,6 +500,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
player->RemoveMItem(it->GetGUIDLow());
uint32 count = it->GetCount(); // save counts before store and possible merge with deleting
+ it->SetState(ITEM_UNCHANGED); // need to set this state, otherwise item cannot be removed later, if neccessary
player->MoveItemToInventory(dest, it, true);
player->SaveInventoryAndGoldToDB(trans);
@@ -573,8 +574,8 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
for (PlayerMails::iterator itr = player->GetMailBegin(); itr != player->GetMailEnd(); ++itr)
{
- // packet send mail count as uint8, prevent overflow
- if (mailsCount >= 254)
+ // Only first 50 mails are displayed
+ if (mailsCount >= 50)
{
realCount += 1;
continue;
@@ -586,7 +587,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
uint8 item_count = (*itr)->items.size(); // max count is MAX_MAIL_ITEMS (12)
- size_t next_mail_size = 2+4+1+((*itr)->messageType == MAIL_NORMAL ? 8 : 4)+4*8+((*itr)->subject.size()+1)+((*itr)->body.size()+1)+1+item_count*(1+4+4+7*3*4+4+4+4+4+4+4+1);
+ size_t next_mail_size = 2+4+1+((*itr)->messageType == MAIL_NORMAL ? 8 : 4)+4*8+((*itr)->subject.size()+1)+((*itr)->body.size()+1)+1+item_count*(1+4+4+MAX_INSPECTED_ENCHANTMENT_SLOT*3*4+4+4+4+4+4+4+1);
if (data.wpos()+next_mail_size > maxPacketSize)
{
@@ -614,7 +615,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
}
data << uint32((*itr)->COD); // COD
- data << uint32(0); // probably changed in 3.3.3
+ data << uint32(0); // package (Package.dbc)
data << uint32((*itr)->stationery); // stationery (Stationery.dbc)
data << uint32((*itr)->money); // Gold
data << uint32((*itr)->checked); // flags
@@ -655,8 +656,8 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
data << uint8(0);
}
- realCount += 1;
- mailsCount += 1;
+ ++realCount;
+ ++mailsCount;
}
data.put<uint32>(0, realCount); // this will display warning about undelivered mail to player if realCount > mailsCount
@@ -713,7 +714,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data)
bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender);
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK);
- sLog->outDetail("HandleMailCreateTextItem mailid=%u", mailId);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleMailCreateTextItem mailid=%u", mailId);
ItemPosCountVec dest;
uint8 msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, bodyItem, false);
@@ -743,11 +744,12 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/)
if (_player->unReadMails > 0)
{
- data << uint32(0); // float
+ data << float(0); // float
data << uint32(0); // count
uint32 count = 0;
time_t now = time(NULL);
+ std::set<uint32> sentSenders;
for (PlayerMails::iterator itr = _player->GetMailBegin(); itr != _player->GetMailEnd(); ++itr)
{
Mail* m = (*itr);
@@ -759,36 +761,29 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/)
if (now < m->deliver_time)
continue;
- if (m->messageType)
- data << uint64(m->sender); // player guid
- else
- data << uint32(m->sender); // creature entry
+ // only send each mail sender once
+ if (sentSenders.count(m->sender))
+ continue;
- switch (m->messageType)
- {
- case MAIL_AUCTION:
- data << uint32(2);
- data << uint32(2);
- data << uint32(m->stationery);
- break;
- default:
- data << uint32(0);
- data << uint32(0);
- data << uint32(m->stationery);
- break;
- }
- data << uint32(0xC6000000); // float unk, time or something
+ data << uint64(m->messageType == MAIL_NORMAL ? m->sender : 0); // player guid
+ data << uint32(m->messageType != MAIL_NORMAL ? m->sender : 0); // non-player entries
+ data << uint32(m->messageType);
+ data << uint32(m->stationery);
+ data << float(m->deliver_time - now);
+ sentSenders.insert(m->sender);
++count;
if (count == 2) // do not display more than 2 mails
break;
}
+
data.put<uint32>(4, count);
}
else
{
- data << uint32(0xC7A8C000);
- data << uint32(0x00000000);
+ data << float(-DAY);
+ data << uint32(0);
}
+
SendPacket(&data);
}
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 11f0857ca2b..1da44882ea9 100755
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -52,6 +52,9 @@
#include "Group.h"
#include "AccountMgr.h"
#include "Spell.h"
+#include "BattlegroundMgr.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
{
@@ -963,7 +966,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data)
if (decompressedSize > 0xFFFF)
{
recv_data.rfinish(); // unnneded warning spam in this case
- sLog->outError("UAD: Account data packet too big, size %u", decompressedSize);
+ sLog->outError(LOG_FILTER_NETWORKIO, "UAD: Account data packet too big, size %u", decompressedSize);
return;
}
@@ -974,7 +977,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data)
if (uncompress(const_cast<uint8*>(dest.contents()), &realSize, const_cast<uint8*>(recv_data.contents() + recv_data.rpos()), recv_data.size() - recv_data.rpos()) != Z_OK)
{
recv_data.rfinish(); // unnneded warning spam in this case
- sLog->outError("UAD: Failed to decompress account data");
+ sLog->outError(LOG_FILTER_NETWORKIO, "UAD: Failed to decompress account data");
return;
}
@@ -1039,10 +1042,10 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
uint32 action = ACTION_BUTTON_ACTION(packetData);
uint8 type = ACTION_BUTTON_TYPE(packetData);
- sLog->outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
if (!packetData)
{
- sLog->outDetail("MISC: Remove action from button %u", button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Remove action from button %u", button);
GetPlayer()->removeActionButton(button);
}
else
@@ -1051,19 +1054,19 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
{
case ACTION_BUTTON_MACRO:
case ACTION_BUTTON_CMACRO:
- sLog->outDetail("MISC: Added Macro %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added Macro %u into button %u", action, button);
break;
case ACTION_BUTTON_EQSET:
- sLog->outDetail("MISC: Added EquipmentSet %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added EquipmentSet %u into button %u", action, button);
break;
case ACTION_BUTTON_SPELL:
- sLog->outDetail("MISC: Added Spell %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added Spell %u into button %u", action, button);
break;
case ACTION_BUTTON_ITEM:
- sLog->outDetail("MISC: Added Item %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added Item %u into button %u", action, button);
break;
default:
- sLog->outError("MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName(), _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName(), _player->GetGUIDLow());
return;
}
GetPlayer()->addActionButton(button, action, type);
@@ -1170,7 +1173,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED)
{
if (ActionBar != 0)
- sLog->outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar));
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar));
return;
}
@@ -1418,7 +1421,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data)
if (WorldObject* target = _player->GetViewpoint())
_player->SetSeer(target);
else
- sLog->outError("Player %s requests non-existing seer " UI64FMTD, _player->GetName(), _player->GetUInt64Value(PLAYER_FARSIGHT));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s requests non-existing seer " UI64FMTD, _player->GetName(), _player->GetUInt64Value(PLAYER_FARSIGHT));
break;
default:
sLog->outDebug(LOG_FILTER_NETWORKIO, "Unhandled mode in CMSG_FAR_SIGHT: %u", apply);
@@ -1489,7 +1492,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
if (mode >= MAX_DUNGEON_DIFFICULTY)
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
return;
}
@@ -1500,7 +1503,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
Map* map = _player->FindMap();
if (map && map->IsDungeon())
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", _player->GetName(), _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", _player->GetName(), _player->GetGUIDLow());
return;
}
@@ -1520,7 +1523,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
if (groupGuy->GetMap()->IsNonRaidDungeon())
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow());
return;
}
}
@@ -1546,7 +1549,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
if (mode >= MAX_RAID_DIFFICULTY)
{
- sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
return;
}
@@ -1554,7 +1557,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
Map* map = _player->FindMap();
if (map && map->IsDungeon())
{
- sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
return;
}
@@ -1577,7 +1580,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
if (groupGuy->GetMap()->IsRaid())
{
- sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
return;
}
}
@@ -1659,7 +1662,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data)
if (!player)
return;
- player->GetAchievementMgr().SendRespondInspectAchievements(_player);
+ player->SendRespondInspectAchievements(_player);
}
void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/)
@@ -1686,12 +1689,64 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
data << uint32(PhaseShift);
SendPacket(&data);
}
+// Battlefield and Battleground
+void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
+{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
+
+ Battleground* bg = _player->GetBattleground();
+
+ uint64 guid;
+ recv_data >> guid;
+
+ Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
+ if (!unit)
+ return;
+
+ if (!unit->isSpiritService()) // it's not spirit service
+ return;
+
+ if (bg)
+ sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid);
+
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
+ bf->SendAreaSpiritHealerQueryOpcode(_player,guid);
+}
+
+void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
+{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
+
+ Battleground* bg = _player->GetBattleground();
+
+ uint64 guid;
+ recv_data >> guid;
+
+ Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
+ if (!unit)
+ return;
+
+ if (!unit->isSpiritService()) // it's not spirit service
+ return;
+
+ if (bg)
+ bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
+
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
+ bf->AddPlayerToResurrectQueue(guid, _player->GetGUID());
+}
void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
{
if (_player->isInFlight())
return;
+ if (/*Battlefield* bf = */sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
+ {
+ // bf->PlayerAskToLeave(_player); FIXME
+ return;
+ }
+
AreaTableEntry const* atEntry = GetAreaEntryByAreaID(_player->GetAreaId());
if (!atEntry || !(atEntry->flags & AREA_FLAG_WINTERGRASP_2))
return;
@@ -1708,7 +1763,7 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
if (!_player->HasPendingBind())
{
- sLog->outDetail("InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName(), _player->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName(), _player->GetGUIDLow());
return;
}
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index ff9030f04d5..27b1f2eca3f 100755
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -66,7 +66,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
Map* oldMap = GetPlayer()->GetMap();
if (GetPlayer()->IsInWorld())
{
- sLog->outError("Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId());
oldMap->RemovePlayerFromMap(GetPlayer(), false);
}
@@ -76,7 +76,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// while the player is in transit, for example the map may get full
if (!newMap || !newMap->CanEnter(GetPlayer()))
{
- sLog->outError("Map %d could not be created for player %d, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Map %d could not be created for player %d, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUIDLow());
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
@@ -89,7 +89,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->SendInitialPacketsBeforeAddToMap();
if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()))
{
- sLog->outError("WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(oldMap);
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
@@ -196,8 +196,8 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
uint32 flags, time;
recv_data >> flags >> time;
- sLog->outStaticDebug("Guid " UI64FMTD, guid);
- sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS);
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Guid " UI64FMTD, guid);
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Flags %u, time %u", flags, time/IN_MILLISECONDS);
Player* plMover = _player->m_mover->ToPlayer();
@@ -455,7 +455,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break;
case CMSG_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break;
default:
- sLog->outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
return;
}
@@ -472,13 +472,13 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
{
if (_player->GetSpeed(move_type) > newspeed) // must be greater - just correct
{
- sLog->outError("%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
+ sLog->outError(LOG_FILTER_NETWORKIO, "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
move_type_name[move_type], _player->GetName(), _player->GetSpeed(move_type), newspeed);
_player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true);
}
else // must be lesser - cheating
{
- sLog->outBasic("Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
_player->GetName(), _player->GetSession()->GetAccountId(), _player->GetSpeed(move_type), newspeed);
_player->GetSession()->KickPlayer();
}
@@ -495,7 +495,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
if (GetPlayer()->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
- sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
}
}
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index f0c3093aa25..085e3c49157 100755
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -44,7 +44,7 @@ enum StableResultCode
STABLE_SUCCESS_STABLE = 0x08, // stable success
STABLE_SUCCESS_UNSTABLE = 0x09, // unstable/swap success
STABLE_SUCCESS_BUY_SLOT = 0x0A, // buy slot success
- STABLE_ERR_EXOTIC = 0x0C, // "you are unable to control exotic creatures"
+ STABLE_ERR_EXOTIC = 0x0C // "you are unable to control exotic creatures"
};
void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data)
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 321c0ada247..3501b3bc068 100755
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -69,17 +69,17 @@ void WorldSession::HandlePetAction(WorldPacket & recv_data)
// used also for charmed creature
Unit* pet= ObjectAccessor::GetUnit(*_player, guid1);
- sLog->outDetail("HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2)));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2)));
if (!pet)
{
- sLog->outError("HandlePetAction: Pet (GUID: %u) doesn't exist for player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetAction: Pet (GUID: %u) doesn't exist for player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
return;
}
if (pet != GetPlayer()->GetFirstControlled())
{
- sLog->outError("HandlePetAction: Pet (GUID: %u) does not belong to player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetAction: Pet (GUID: %u) does not belong to player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
return;
}
@@ -121,13 +121,13 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recv_data)
if (!pet)
{
- sLog->outError("HandlePetStopAttack: Pet %u does not exist", uint32(GUID_LOPART(guid)));
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetStopAttack: Pet %u does not exist", uint32(GUID_LOPART(guid)));
return;
}
if (pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm())
{
- sLog->outError("HandlePetStopAttack: Pet GUID %u isn't a pet or charmed creature of player %s", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetStopAttack: Pet GUID %u isn't a pet or charmed creature of player %s", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
@@ -142,7 +142,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!",
guid1, guid2, spellid, flag, pet->GetGUIDLow(), pet->GetTypeId());
return;
}
@@ -263,7 +263,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
}
break;
default:
- sLog->outError("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
break;
case ACT_REACTION: // 0x6
@@ -292,7 +292,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown PET spell id %i", spellid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET spell id %i", spellid);
return;
}
@@ -397,13 +397,13 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
break;
}
default:
- sLog->outError("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
}
void WorldSession::HandlePetNameQuery(WorldPacket & recv_data)
{
- sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetNameQuery. CMSG_PET_NAME_QUERY");
uint32 petnumber;
uint64 petguid;
@@ -454,7 +454,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
{
if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
{
- sLog->outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
return false;
}
}
@@ -463,7 +463,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
{
if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER))
{
- sLog->outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid));
return false;
}
}
@@ -472,7 +472,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
{
- sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetSetAction. CMSG_PET_SET_ACTION");
uint64 petguid;
uint8 count;
@@ -483,14 +483,14 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
if (!pet || pet != _player->GetFirstControlled())
{
- sLog->outError("HandlePetSetAction: Unknown pet (GUID: %u) or pet owner (GUID: %u)", GUID_LOPART(petguid), _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetSetAction: Unknown pet (GUID: %u) or pet owner (GUID: %u)", GUID_LOPART(petguid), _player->GetGUIDLow());
return;
}
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return;
}
@@ -552,7 +552,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
uint32 spell_id = UNIT_ACTION_BUTTON_ACTION(data[i]);
uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]);
- sLog->outDetail("Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName(), position[i], spell_id, uint32(act_state));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName(), position[i], spell_id, uint32(act_state));
//if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add
if (!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_PASSIVE) && spell_id && !pet->HasSpell(spell_id)))
@@ -588,7 +588,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
void WorldSession::HandlePetRename(WorldPacket & recv_data)
{
- sLog->outDetail("HandlePetRename. CMSG_PET_RENAME");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetRename. CMSG_PET_RENAME");
uint64 petguid;
uint8 isdeclined;
@@ -675,7 +675,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data)
{
uint64 guid;
recv_data >> guid; //pet guid
- sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid));
if (!_player->IsInWorld())
return;
@@ -701,7 +701,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data)
void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
{
- sLog->outDetail("CMSG_PET_SPELL_AUTOCAST");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_PET_SPELL_AUTOCAST");
uint64 guid;
uint32 spellid;
uint8 state; //1 for on, 0 for off
@@ -717,7 +717,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
if (!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm()))
{
- sLog->outError("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
@@ -729,7 +729,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return;
}
@@ -762,14 +762,14 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm()))
{
- sLog->outError("HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown PET spell id %i", spellId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET spell id %i", spellId);
return;
}
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index cb3bac0e443..90af03113bf 100755
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -479,7 +479,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
if (!result)
{
- sLog->outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionGuid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Petition %u is not found for player %u %s", GUID_LOPART(petitionGuid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
return;
}
@@ -771,7 +771,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
}
else
{
- sLog->outError("Player %s (guid: %u) tried to turn in petition (guid: %u) that is not present in the database", _player->GetName(), _player->GetGUIDLow(), GUID_LOPART(petitionGuid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (guid: %u) tried to turn in petition (guid: %u) that is not present in the database", _player->GetName(), _player->GetGUIDLow(), GUID_LOPART(petitionGuid));
return;
}
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 4fb90bed10b..d3f51867831 100755
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -70,7 +70,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data)
recv_data >> guid;
// This is disable by default to prevent lots of console spam
- // sLog->outString("HandleNameQueryOpcode %u", guid);
+ // sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleNameQueryOpcode %u", guid);
SendNameQueryOpcode(guid);
}
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index d13c2fb0956..b16459a48b0 100755
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -43,7 +43,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data)
Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
if (!questgiver)
{
- sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid));
return;
}
@@ -71,7 +71,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data)
break;
}
default:
- sLog->outError("QuestGiver called for unexpected type %u", questgiver->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "QuestGiver called for unexpected type %u", questgiver->GetTypeId());
break;
}
@@ -122,7 +122,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
// no or incorrect quest giver
if (!object || (object->GetTypeId() != TYPEID_PLAYER && !object->hasQuest(questId)) ||
- (object->GetTypeId() == TYPEID_PLAYER && !object->ToPlayer()->CanShareQuest(questId)))
+ (object->GetTypeId() == TYPEID_PLAYER && object != _player && !object->ToPlayer()->CanShareQuest(questId)))
{
_player->PlayerTalkClass->SendCloseGossip();
_player->SetDivider(0);
@@ -289,7 +289,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
if (reward >= QUEST_REWARD_CHOICES_COUNT)
{
- sLog->outError("Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (probably packet hacking)", _player->GetName(), _player->GetGUIDLow(), reward);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (probably packet hacking)", _player->GetName(), _player->GetGUIDLow(), reward);
return;
}
@@ -308,7 +308,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) ||
(_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete()))
{
- sLog->outError("HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!",
_player->GetName(), _player->GetGUIDLow(), questId);
return;
}
@@ -433,14 +433,14 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
_player->TakeQuestSourceItem(questId, true); // remove quest src item from player
_player->RemoveActiveQuest(questId);
- _player->GetAchievementMgr().RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
+ _player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
- sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %u abandoned quest %u", _player->GetGUIDLow(), questId);
}
_player->SetQuestSlot(slot, 0);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED, 1);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED, 1);
}
}
@@ -500,7 +500,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data)
{
if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE)
{
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!",
_player->GetName(), _player->GetGUIDLow(), questId);
return;
}
@@ -582,7 +582,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
continue;
}
- player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true);
+ player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GetGUID(), true);
player->SetDivider(_player->GetGUID());
}
}
@@ -634,7 +634,7 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32
}
default:
//its imposible, but check ^)
- sLog->outError("Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId());
return DIALOG_STATUS_NONE;
}
diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index f9731ba85db..8872816f87d 100755
--- a/src/server/game/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -84,9 +84,13 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data)
unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect"
}
-void WorldSession::HandleUnlearnSkillOpcode(WorldPacket & recv_data)
+void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData)
{
- uint32 skill_id;
- recv_data >> skill_id;
- GetPlayer()->SetSkill(skill_id, 0, 0, 0);
+ uint32 skillId;
+ recvData >> skillId;
+
+ if (!IsPrimaryProfessionSkill(skillId))
+ return;
+
+ GetPlayer()->SetSkill(skillId, 0, 0, 0);
}
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index c02bb43a353..afaa38527bb 100755
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -187,7 +187,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
recvPacket >> bagIndex >> slot;
- sLog->outDetail("bagIndex: %u, slot: %u", bagIndex, slot);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "bagIndex: %u, slot: %u", bagIndex, slot);
Item* item = pUser->GetItemByPos(bagIndex, slot);
if (!item)
@@ -207,7 +207,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
if (!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
{
pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
pUser->GetName(), pUser->GetGUIDLow(), item->GetGUIDLow(), proto->ItemId);
return;
}
@@ -221,7 +221,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
if (!lockInfo)
{
pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, item, NULL);
- sLog->outError("WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", item->GetGUIDLow(), lockId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", item->GetGUIDLow(), lockId);
return;
}
@@ -254,7 +254,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
}
else
{
- sLog->outError("Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUIDLow());
pUser->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
return;
}
@@ -305,7 +305,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
go->AI()->GossipHello(_player);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, go->GetEntry());
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, go->GetEntry());
}
void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
@@ -328,7 +328,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %u", spellId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown spell id %u", spellId);
recvPacket.rfinish(); // prevent spam at ignore packet
return;
}
@@ -444,7 +444,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown PET spell id %u", spellId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET spell id %u", spellId);
return;
}
@@ -452,13 +452,13 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
if (!pet)
{
- sLog->outError("HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %u by player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %u by player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm())
{
- sLog->outError("HandlePetCancelAura: Pet %u is not a pet of player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetCancelAura: Pet %u is not a pet of player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
@@ -514,8 +514,8 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
return;
Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]);
- // Don't unsummon sentry totem
- if (totem && totem->isTotem() && totem->GetEntry() != SENTRY_TOTEM_ENTRY)
+
+ if (totem && totem->isTotem())
totem->ToTotem()->UnSummon();
}
diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp
index 9d7fa7da396..f50b9ebd311 100755
--- a/src/server/game/Handlers/TradeHandler.cpp
+++ b/src/server/game/Handlers/TradeHandler.cpp
@@ -192,21 +192,21 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
if (myItems[i])
{
if (!traderCanTrade)
- sLog->outError("trader can't store item: %u", myItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "trader can't store item: %u", myItems[i]->GetGUIDLow());
if (_player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, myItems[i], false) == EQUIP_ERR_OK)
_player->MoveItemToInventory(playerDst, myItems[i], true, true);
else
- sLog->outError("player can't take item back: %u", myItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "player can't take item back: %u", myItems[i]->GetGUIDLow());
}
// return the already removed items to the original owner
if (hisItems[i])
{
if (!playerCanTrade)
- sLog->outError("player can't store item: %u", hisItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "player can't store item: %u", hisItems[i]->GetGUIDLow());
if (trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK)
trader->MoveItemToInventory(traderDst, hisItems[i], true, true);
else
- sLog->outError("trader can't take item back: %u", hisItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "trader can't take item back: %u", hisItems[i]->GetGUIDLow());
}
}
}
@@ -224,7 +224,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m
{
if (Item* item = myTrade->GetItem(TradeSlots(i)))
{
- sLog->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
//Can return NULL
myItems[i] = item;
myItems[i]->SetInTrade();
@@ -232,7 +232,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m
if (Item* item = hisTrade->GetItem(TradeSlots(i)))
{
- sLog->outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
hisItems[i] = item;
hisItems[i]->SetInTrade();
}
diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp
index cfd73c2c987..f0ccfc44e60 100644
--- a/src/server/game/Handlers/VehicleHandler.cpp
+++ b/src/server/game/Handlers/VehicleHandler.cpp
@@ -63,7 +63,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
if (!seat->CanSwitchFromSeat())
{
recv_data.rfinish(); // prevent warnings spam
- sLog->outError("HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.",
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.",
recv_data.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags);
return;
}
@@ -150,7 +150,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
if (!vehicle)
{
data.rfinish(); // prevent warnings spam
- sLog->outError("HandleEjectPassenger: Player %u is not in a vehicle!", GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleEjectPassenger: Player %u is not in a vehicle!", GetPlayer()->GetGUIDLow());
return;
}
@@ -162,13 +162,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
Player* player = ObjectAccessor::FindPlayer(guid);
if (!player)
{
- sLog->outError("Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
if (!player->IsOnVehicle(vehicle->GetBase()))
{
- sLog->outError("Player %u tried to eject player %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject player %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
@@ -177,7 +177,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
if (seat->IsEjectable())
player->ExitVehicle();
else
- sLog->outError("Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
}
else if (IS_CREATURE_GUID(guid))
@@ -185,13 +185,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
if (!unit) // creatures can be ejected too from player mounts
{
- sLog->outError("Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
if (!unit->IsOnVehicle(vehicle->GetBase()))
{
- sLog->outError("Player %u tried to eject unit %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject unit %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
@@ -203,10 +203,10 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
unit->ExitVehicle();
}
else
- sLog->outError("Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
}
else
- sLog->outError("HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid);
}
void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recv_data*/)
@@ -220,7 +220,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recv_data*/)
if (seat->CanEnterOrExit())
GetPlayer()->ExitVehicle();
else
- sLog->outError("Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
GetPlayer()->GetGUIDLow(), seat->m_ID, seat->m_flags);
}
}
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index 59bb86cb68e..48ed7bdba1f 100755
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -75,19 +75,19 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
const MapEntry* entry = sMapStore.LookupEntry(mapId);
if (!entry)
{
- sLog->outError("InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
return NULL;
}
if (instanceId == 0)
{
- sLog->outError("InstanceSaveManager::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
return NULL;
}
if (difficulty >= (entry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
{
- sLog->outError("InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
return NULL;
}
@@ -275,8 +275,8 @@ void InstanceSaveManager::LoadInstances()
// Load reset times and clean expired instances
sInstanceSaveMgr->LoadResetTimes();
- sLog->outString(">> Loaded instances in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded instances in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void InstanceSaveManager::LoadResetTimes()
@@ -364,7 +364,7 @@ void InstanceSaveManager::LoadResetTimes()
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
if (!mapDiff)
{
- sLog->outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid, difficulty);
continue;
}
@@ -458,7 +458,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev
}
if (itr == m_resetTimeQueue.end())
- sLog->outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d, %d, %d) was not found!", event.type, event.mapid, event.instanceId);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d, %d, %d) was not found!", event.type, event.mapid, event.instanceId);
}
}
else
@@ -566,7 +566,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
if (!mapDiff || !mapDiff->resetTime)
{
- sLog->outError("InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
return;
}
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index d2c256e08f7..f8df5862df0 100755
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -46,7 +46,7 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject* go)
if (go)
go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed");
+ sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript: HandleGameObject failed");
}
bool InstanceScript::IsEncounterInProgress() const
@@ -197,7 +197,7 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
if (bossInfo->state == TO_BE_DECIDED) // loading
{
bossInfo->state = state;
- //sLog->outError("Inialize boss %u state as %u.", id, (uint32)state);
+ //sLog->outError(LOG_FILTER_GENERAL, "Inialize boss %u state as %u.", id, (uint32)state);
return false;
}
else
@@ -267,7 +267,7 @@ void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime,
go->ResetDoorOrButton();
}
else
- sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", go->GetEntry(), go->GetGoType());
+ sLog->outError(LOG_FILTER_GENERAL, "SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", go->GetEntry(), go->GetGoType());
}
}
@@ -298,7 +298,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
player->SendUpdateWorldState(uiStateId, uiStateData);
}
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map.");
+ sLog->outDebug(LOG_FILTER_TSCR, "DoUpdateWorldState attempt send data but no players in map.");
}
// Send Notify to all players in instance
@@ -339,7 +339,7 @@ void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type,
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->getSource())
- player->GetAchievementMgr().StartTimedAchievement(type, entry);
+ player->StartTimedAchievement(type, entry);
}
// Stop timed achievement for all players in instance
@@ -350,7 +350,7 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->getSource())
- player->GetAchievementMgr().RemoveTimedAchievement(type, entry);
+ player->RemoveTimedAchievement(type, entry);
}
// Remove Auras due to Spell on all players in instance
@@ -384,7 +384,7 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
{
- sLog->outError("Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
+ sLog->outError(LOG_FILTER_GENERAL, "Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
instance->GetId(), criteria_id);
return false;
}
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index 71f1572624b..f1766833aee 100755
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -25,11 +25,11 @@
//#include "GameObject.h"
//#include "Map.h"
-#define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
-#define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
-#define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
-#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
-#define OUT_LOAD_INST_DATA_FAIL sLog->outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
+#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_LOAD_INST_DATA_FAIL sLog->outError(LOG_FILTER_TSCR, "Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
class Map;
class Unit;
@@ -49,7 +49,7 @@ enum EncounterFrameType
ENCOUNTER_FRAME_ENABLE_OBJECTIVE = 4,
ENCOUNTER_FRAME_UPDATE_OBJECTIVE = 5,
ENCOUNTER_FRAME_DISABLE_OBJECTIVE = 6,
- ENCOUNTER_FRAME_UNK7 = 7, // Seems to have something to do with sorting the encounter units
+ ENCOUNTER_FRAME_UNK7 = 7 // Seems to have something to do with sorting the encounter units
};
enum EncounterState
@@ -59,7 +59,7 @@ enum EncounterState
FAIL = 2,
DONE = 3,
SPECIAL = 4,
- TO_BE_DECIDED = 5,
+ TO_BE_DECIDED = 5
};
enum DoorType
@@ -67,7 +67,7 @@ enum DoorType
DOOR_TYPE_ROOM = 0, // Door can open if encounter is not in progress
DOOR_TYPE_PASSAGE = 1, // Door can open if encounter is done
DOOR_TYPE_SPAWN_HOLE = 2, // Door can open if encounter is in progress, typically used for spawning places
- MAX_DOOR_TYPES,
+ MAX_DOOR_TYPES
};
enum BoundaryType
@@ -84,7 +84,7 @@ enum BoundaryType
BOUNDARY_MAX_X = BOUNDARY_N,
BOUNDARY_MIN_X = BOUNDARY_S,
BOUNDARY_MAX_Y = BOUNDARY_W,
- BOUNDARY_MIN_Y = BOUNDARY_E,
+ BOUNDARY_MIN_Y = BOUNDARY_E
};
typedef std::map<BoundaryType, float> BossBoundaryMap;
@@ -131,7 +131,6 @@ typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
class InstanceScript : public ZoneScript
{
public:
-
explicit InstanceScript(Map* map) : instance(map), completedEncounters(0) {}
virtual ~InstanceScript() {}
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 53b560e0b77..fca8d78a3de 100755
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -121,7 +121,7 @@ uint32 LootStore::LoadLootTable()
if (maxcount > std::numeric_limits<uint8>::max())
{
- sLog->outErrorDb("Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
continue; // error already printed to log/console.
}
@@ -225,12 +225,12 @@ void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const
{
// all still listed ids isn't referenced
for (LootIdSet::const_iterator itr = lootIdSet.begin(); itr != lootIdSet.end(); ++itr)
- sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
}
void LootStore::ReportNotExistedId(uint32 id) const
{
- sLog->outErrorDb("Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
}
//
@@ -259,13 +259,13 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
{
if (group >= 1 << 7) // it stored in 7 bit field
{
- sLog->outErrorDb("Table '%s' entry %d item %d: group (%u) must be less %u - skipped", store.GetName(), entry, itemid, group, 1 << 7);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: group (%u) must be less %u - skipped", store.GetName(), entry, itemid, group, 1 << 7);
return false;
}
if (mincountOrRef == 0)
{
- sLog->outErrorDb("Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
return false;
}
@@ -274,36 +274,36 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid);
if (!proto)
{
- sLog->outErrorDb("Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
return false;
}
if (chance == 0 && group == 0) // Zero chance is allowed for grouped entries only
{
- sLog->outErrorDb("Table '%s' entry %d item %d: equal-chanced grouped entry, but group not defined - skipped", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: equal-chanced grouped entry, but group not defined - skipped", store.GetName(), entry, itemid);
return false;
}
if (chance != 0 && chance < 0.000001f) // loot with low chance
{
- sLog->outErrorDb("Table '%s' entry %d item %d: low chance (%f) - skipped",
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: low chance (%f) - skipped",
store.GetName(), entry, itemid, chance);
return false;
}
if (maxcount < mincountOrRef) // wrong max count
{
- sLog->outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
return false;
}
}
else // mincountOrRef < 0
{
if (needs_quest)
- sLog->outErrorDb("Table '%s' entry %d item %d: quest chance will be treated as non-quest chance", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: quest chance will be treated as non-quest chance", store.GetName(), entry, itemid);
else if (chance == 0) // no chance for the reference
{
- sLog->outErrorDb("Table '%s' entry %d item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid);
return false;
}
}
@@ -322,6 +322,7 @@ LootItem::LootItem(LootStoreItem const& li)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid);
freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT);
+ follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES);
needs_quest = li.needs_quest;
@@ -358,12 +359,7 @@ bool LootItem::AllowedForPlayer(Player const* player) const
// check quest requirements
if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid)))
- if (Group const* group = player->GetGroup())
- {
- if (pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT || ((pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0 && (group->GetLootMethod() != MASTER_LOOT || group->GetLooterGuid() != player->GetGUID())))
- return false;
- }
- else return false;
+ return false;
return true;
}
@@ -413,7 +409,7 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo
if (!tab)
{
if (!noEmptyError)
- sLog->outErrorDb("Table '%s' loot id #%u used but it doesn't have records.", store.GetName(), lootId);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' loot id #%u used but it doesn't have records.", store.GetName(), lootId);
return false;
}
@@ -479,7 +475,7 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting)
if (!item->is_looted && item->freeforall && item->AllowedForPlayer(player))
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid))
- if (proto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ if (proto->IsCurrencyToken())
player->StoreLootItem(i, this);
}
}
@@ -517,18 +513,19 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
for (uint8 i = 0; i < quest_items.size(); ++i)
{
LootItem &item = quest_items[i];
- if (!item.is_looted && item.AllowedForPlayer(player))
+
+ if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT ))))
{
ql->push_back(QuestItem(i));
- // questitems get blocked when they first appear in a
+ // quest items get blocked when they first appear in a
// player's quest vector
//
// increase once if one looter only, looter-times if free for all
if (item.freeforall || !item.is_blocked)
++unlootedCount;
-
- item.is_blocked = true;
+ if (!player->GetGroup() || (player->GetGroup()->GetLootMethod() != GROUP_LOOT && player->GetGroup()->GetLootMethod() != ROUND_ROBIN))
+ item.is_blocked = true;
if (items.size() + ql->size() == MAX_NR_LOOT_ITEMS)
break;
@@ -551,7 +548,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool pres
for (uint8 i = 0; i < items.size(); ++i)
{
LootItem &item = items[i];
- if (!item.is_looted && !item.freeforall && item.AllowedForPlayer(player))
+ if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT ))))
{
if (presentAtLooting)
item.AddAllowedLooter(player);
@@ -894,7 +891,6 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
- LootSlotType partySlotType = lv.permission == MASTER_PERMISSION ? LOOT_SLOT_TYPE_MASTER : (lv.permission == GROUP_PERMISSION ? LOOT_SLOT_TYPE_ROLL_ONGOING : slotType);
QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems();
QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUIDLow());
if (q_itr != lootPlayerQuestItems.end())
@@ -907,8 +903,25 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
{
b << uint8(l.items.size() + (qi - q_list->begin()));
b << item;
- if (!item.freeforall)
- b << uint8(partySlotType);
+ if (item.follow_loot_rules)
+ {
+ switch (lv.permission)
+ {
+ case MASTER_PERMISSION:
+ b << uint8(LOOT_SLOT_TYPE_MASTER);
+ break;
+ case GROUP_PERMISSION:
+ case ROUND_ROBIN_PERMISSION:
+ if (!item.is_blocked)
+ b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
+ else
+ b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
+ break;
+ default:
+ b << uint8(slotType);
+ break;
+ }
+ }
else
b << uint8(slotType);
++itemsShown;
@@ -928,10 +941,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
{
b << uint8(fi->index);
b << item;
- if (!item.freeforall)
- b << uint8(partySlotType);
- else
- b << uint8(slotType);
+ b << uint8(slotType);
++itemsShown;
}
}
@@ -949,8 +959,25 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
{
b << uint8(ci->index);
b << item;
- if (!item.freeforall)
- b << uint8(partySlotType);
+ if (item.follow_loot_rules)
+ {
+ switch (lv.permission)
+ {
+ case MASTER_PERMISSION:
+ b << uint8(LOOT_SLOT_TYPE_MASTER);
+ break;
+ case GROUP_PERMISSION:
+ case ROUND_ROBIN_PERMISSION:
+ if (!item.is_blocked)
+ b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
+ else
+ b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
+ break;
+ default:
+ b << uint8(slotType);
+ break;
+ }
+ }
else
b << uint8(slotType);
++itemsShown;
@@ -1151,12 +1178,12 @@ void LootTemplate::LootGroup::Verify(LootStore const& lootstore, uint32 id, uint
float chance = RawTotalChance();
if (chance > 101.0f) // TODO: replace with 100% when DBs will be ready
{
- sLog->outErrorDb("Table '%s' entry %u group %d has total chance > 100%% (%f)", lootstore.GetName(), id, group_id, chance);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %u group %d has total chance > 100%% (%f)", lootstore.GetName(), id, group_id, chance);
}
if (chance >= 100.0f && !EqualChanced.empty())
{
- sLog->outErrorDb("Table '%s' entry %u group %d has items with chance=0%% but group total chance >= 100%% (%f)", lootstore.GetName(), id, group_id, chance);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %u group %d has items with chance=0%% but group total chance >= 100%% (%f)", lootstore.GetName(), id, group_id, chance);
}
}
@@ -1364,7 +1391,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
if (!cond || !cond->isLoaded())//should never happen, checked at loading
{
- sLog->outError("LootTemplate::addConditionItem: condition is null");
+ sLog->outError(LOG_FILTER_LOOT, "LootTemplate::addConditionItem: condition is null");
return false;
}
if (!Entries.empty())
@@ -1423,7 +1450,7 @@ bool LootTemplate::isReference(uint32 id)
void LoadLootTemplates_Creature()
{
- sLog->outString("Loading creature loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading creature loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1450,16 +1477,14 @@ void LoadLootTemplates_Creature()
LootTemplates_Creature.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty");
}
void LoadLootTemplates_Disenchant()
{
- sLog->outString("Loading disenchanting loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading disenchanting loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1485,15 +1510,14 @@ void LoadLootTemplates_Disenchant()
LootTemplates_Disenchant.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty");
}
void LoadLootTemplates_Fishing()
{
- sLog->outString("Loading fishing loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading fishing loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1510,16 +1534,14 @@ void LoadLootTemplates_Fishing()
LootTemplates_Fishing.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty");
}
void LoadLootTemplates_Gameobject()
{
- sLog->outString("Loading gameobject loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading gameobject loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1546,16 +1568,14 @@ void LoadLootTemplates_Gameobject()
LootTemplates_Gameobject.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty");
}
void LoadLootTemplates_Item()
{
- sLog->outString("Loading item loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading item loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1572,16 +1592,14 @@ void LoadLootTemplates_Item()
LootTemplates_Item.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 prospecting loot templates. DB table `item_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty");
}
void LoadLootTemplates_Milling()
{
- sLog->outString("Loading milling loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading milling loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1603,16 +1621,14 @@ void LoadLootTemplates_Milling()
LootTemplates_Milling.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty");
}
void LoadLootTemplates_Pickpocketing()
{
- sLog->outString("Loading pickpocketing loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading pickpocketing loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1639,16 +1655,14 @@ void LoadLootTemplates_Pickpocketing()
LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty");
}
void LoadLootTemplates_Prospecting()
{
- sLog->outString("Loading prospecting loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading prospecting loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1670,16 +1684,14 @@ void LoadLootTemplates_Prospecting()
LootTemplates_Prospecting.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
}
void LoadLootTemplates_Mail()
{
- sLog->outString("Loading mail loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading mail loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1696,16 +1708,14 @@ void LoadLootTemplates_Mail()
LootTemplates_Mail.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty");
}
void LoadLootTemplates_Skinning()
{
- sLog->outString("Loading skinning loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading skinning loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1732,16 +1742,14 @@ void LoadLootTemplates_Skinning()
LootTemplates_Skinning.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
-
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
}
void LoadLootTemplates_Spell()
{
- sLog->outString("Loading spell loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1776,15 +1784,14 @@ void LoadLootTemplates_Spell()
LootTemplates_Spell.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty");
}
void LoadLootTemplates_Reference()
{
- sLog->outString("Loading reference loot templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading reference loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1807,6 +1814,5 @@ void LoadLootTemplates_Reference()
// output error for any still listed ids (not referenced from any loot table)
LootTemplates_Reference.ReportUnusedIds(lootIdSet);
- sLog->outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index 4a6becc7eff..45fc5c7983c 100755
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -69,7 +69,7 @@ enum PermissionTypes
MASTER_PERMISSION = 2,
ROUND_ROBIN_PERMISSION = 3,
OWNER_PERMISSION = 4,
- NONE_PERMISSION = 5,
+ NONE_PERMISSION = 5
};
enum LootType
@@ -94,7 +94,7 @@ enum LootSlotType
LOOT_SLOT_TYPE_ROLL_ONGOING = 1, // roll is ongoing. player cannot loot.
LOOT_SLOT_TYPE_MASTER = 2, // item can only be distributed by group loot master.
LOOT_SLOT_TYPE_LOCKED = 3, // item is shown in red. player cannot loot.
- LOOT_SLOT_TYPE_OWNER = 4, // ignore binding confirmation and etc, for single player looting
+ LOOT_SLOT_TYPE_OWNER = 4 // ignore binding confirmation and etc, for single player looting
};
class Player;
@@ -140,6 +140,7 @@ struct LootItem
bool is_underthreshold : 1;
bool is_counted : 1;
bool needs_quest : 1; // quest drop
+ bool follow_loot_rules : 1;
// Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties
// Should be called for non-reference LootStoreItem entries only (mincountOrRef > 0)
@@ -280,6 +281,7 @@ struct Loot
QuestItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
std::vector<LootItem> items;
+ std::vector<LootItem> quest_items;
uint32 gold;
uint8 unlootedCount;
uint64 roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released.
@@ -344,7 +346,6 @@ struct Loot
QuestItemList* FillQuestLoot(Player* player);
QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting);
- std::vector<LootItem> quest_items;
std::set<uint64> PlayersLooting;
QuestItemMap PlayerQuestItems;
QuestItemMap PlayerFFAItems;
diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp
index 3c3888eb9f8..929a1d81d57 100755
--- a/src/server/game/Mails/Mail.cpp
+++ b/src/server/game/Mails/Mail.cpp
@@ -50,7 +50,7 @@ MailSender::MailSender(Object* sender, MailStationery stationery) : m_stationery
default:
m_messageType = MAIL_NORMAL;
m_senderId = 0; // will show mail from not existed player
- sLog->outError("MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId());
+ sLog->outError(LOG_FILTER_GENERAL, "MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId());
break;
}
}
diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h
index dbd03bd96ee..10095268ead 100755
--- a/src/server/game/Mails/Mail.h
+++ b/src/server/game/Mails/Mail.h
@@ -36,7 +36,7 @@ enum MailMessageType
MAIL_AUCTION = 2,
MAIL_CREATURE = 3, // client send CMSG_CREATURE_QUERY on this mailmessagetype
MAIL_GAMEOBJECT = 4, // client send CMSG_GAMEOBJECT_QUERY on this mailmessagetype
- MAIL_ITEM = 5, // client send CMSG_ITEM_QUERY on this mailmessagetype
+ MAIL_ITEM = 5 // client send CMSG_ITEM_QUERY on this mailmessagetype
};
enum MailCheckMask
@@ -46,7 +46,7 @@ enum MailCheckMask
MAIL_CHECK_MASK_RETURNED = 0x02, /// This mail was returned. Do not allow returning mail back again.
MAIL_CHECK_MASK_COPIED = 0x04, /// This mail was copied. Do not allow making a copy of items in mail.
MAIL_CHECK_MASK_COD_PAYMENT = 0x08,
- MAIL_CHECK_MASK_HAS_BODY = 0x10, /// This mail has body text.
+ MAIL_CHECK_MASK_HAS_BODY = 0x10 /// This mail has body text.
};
// gathered from Stationery.dbc
@@ -56,8 +56,9 @@ enum MailStationery
MAIL_STATIONERY_DEFAULT = 41,
MAIL_STATIONERY_GM = 61,
MAIL_STATIONERY_AUCTION = 62,
- MAIL_STATIONERY_VAL = 64,
- MAIL_STATIONERY_CHR = 65,
+ MAIL_STATIONERY_VAL = 64, // Valentine
+ MAIL_STATIONERY_CHR = 65, // Christmas
+ MAIL_STATIONERY_ORP = 67 // Orphan
};
enum MailState
@@ -67,24 +68,13 @@ enum MailState
MAIL_STATE_DELETED = 3
};
-enum MailAuctionAnswers
-{
- AUCTION_OUTBIDDED = 0,
- AUCTION_WON = 1,
- AUCTION_SUCCESSFUL = 2,
- AUCTION_EXPIRED = 3,
- AUCTION_CANCELLED_TO_BIDDER = 4,
- AUCTION_CANCELED = 5,
- AUCTION_SALE_PENDING = 6
-};
-
enum MailShowFlags
{
MAIL_SHOW_UNK0 = 0x0001,
MAIL_SHOW_DELETE = 0x0002, // forced show delete button instead return button
MAIL_SHOW_AUCTION = 0x0004, // from old comment
MAIL_SHOW_UNK2 = 0x0008, // unknown, COD will be shown even without that flag
- MAIL_SHOW_RETURN = 0x0010,
+ MAIL_SHOW_RETURN = 0x0010
};
class MailSender
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 82659e32016..aee516f6f1d 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -81,14 +81,14 @@ bool Map::ExistMap(uint32 mapid, int gx, int gy)
FILE* pf=fopen(tmp, "rb");
if (!pf)
- sLog->outError("Map file '%s': does not exist!", tmp);
+ sLog->outError(LOG_FILTER_MAPS, "Map file '%s': does not exist!", tmp);
else
{
map_fileheader header;
if (fread(&header, sizeof(header), 1, pf) == 1)
{
if (header.mapMagic != MapMagic.asUInt || header.versionMagic != MapVersionMagic.asUInt)
- sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", tmp);
+ sLog->outError(LOG_FILTER_MAPS, "Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", tmp);
else
ret = true;
}
@@ -108,7 +108,7 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy)
if (!exists)
{
std::string name = vmgr->getDirFileName(mapid, gx, gy);
- sLog->outError("VMap file '%s' is missing or points to wrong version of vmap file. Redo vmaps with latest version of vmap_assembler.exe.", (sWorld->GetDataPath()+"vmaps/"+name).c_str());
+ sLog->outError(LOG_FILTER_MAPS, "VMap file '%s' is missing or points to wrong version of vmap file. Redo vmaps with latest version of vmap_assembler.exe.", (sWorld->GetDataPath()+"vmaps/"+name).c_str());
return false;
}
}
@@ -124,13 +124,13 @@ void Map::LoadVMap(int gx, int gy)
switch (vmapLoadResult)
{
case VMAP::VMAP_LOAD_RESULT_OK:
- sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ sLog->outInfo(LOG_FILTER_MAPS, "VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
break;
case VMAP::VMAP_LOAD_RESULT_ERROR:
- sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ sLog->outInfo(LOG_FILTER_MAPS, "Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
break;
case VMAP::VMAP_LOAD_RESULT_IGNORED:
- sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ sLog->outDebug(LOG_FILTER_MAPS, "Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
break;
}
}
@@ -157,7 +157,7 @@ void Map::LoadMap(int gx, int gy, bool reload)
//map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?)
if (GridMaps[gx][gy])
{
- sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId());
+ sLog->outInfo(LOG_FILTER_MAPS, "Unloading previously loaded map %u before reloading.", GetId());
sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy);
delete (GridMaps[gx][gy]);
@@ -169,12 +169,12 @@ void Map::LoadMap(int gx, int gy, bool reload)
int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
tmp = new char[len];
snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy);
- sLog->outDetail("Loading map %s", tmp);
+ sLog->outInfo(LOG_FILTER_MAPS, "Loading map %s", tmp);
// loading data
GridMaps[gx][gy] = new GridMap();
if (!GridMaps[gx][gy]->loadData(tmp))
{
- sLog->outError("Error loading map file: \n %s\n", tmp);
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map file: \n %s\n", tmp);
}
delete [] tmp;
@@ -264,7 +264,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
CellCoord p = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!p.IsCoordValid())
{
- sLog->outError("Map::SwitchGridContainers: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
+ sLog->outError(LOG_FILTER_MAPS, "Map::SwitchGridContainers: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
return;
}
@@ -272,7 +272,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
if (!IsGridLoaded(GridCoord(cell.data.Part.grid_x, cell.data.Part.grid_y)))
return;
- sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
+ sLog->outDebug(LOG_FILTER_MAPS, "Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(ngrid != NULL);
@@ -346,7 +346,7 @@ void Map::EnsureGridLoadedForActiveObject(const Cell &cell, WorldObject* object)
// refresh grid state & timer
if (grid->GetGridState() != GRID_STATE_ACTIVE)
{
- sLog->outStaticDebug("Active object "UI64FMTD" triggers loading of grid [%u, %u] on map %u", object->GetGUID(), cell.GridX(), cell.GridY(), GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Active object "UI64FMTD" triggers loading of grid [%u, %u] on map %u", object->GetGUID(), cell.GridX(), cell.GridY(), GetId());
ResetGridExpiry(*grid, 0.1f);
grid->SetGridState(GRID_STATE_ACTIVE);
}
@@ -387,7 +387,7 @@ bool Map::AddPlayerToMap(Player* player)
CellCoord cellCoord = Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY());
if (!cellCoord.IsCoordValid())
{
- sLog->outError("Map::Add: Player (GUID: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
+ sLog->outError(LOG_FILTER_MAPS, "Map::Add: Player (GUID: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
return false;
}
@@ -439,7 +439,7 @@ bool Map::AddToMap(T *obj)
ASSERT(cellCoord.IsCoordValid());
if (!cellCoord.IsCoordValid())
{
- sLog->outError("Map::Add: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
+ sLog->outError(LOG_FILTER_MAPS, "Map::Add: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
return false; //Should delete object
}
@@ -449,7 +449,7 @@ bool Map::AddToMap(T *obj)
else
EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY()));
AddToGrid(obj, cell);
- sLog->outStaticDebug("Object %u enters grid[%u, %u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
+ sLog->outDebug(LOG_FILTER_MAPS, "Object %u enters grid[%u, %u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
//Must already be set before AddToMap. Usually during obj->Create.
//obj->SetMap(this);
@@ -711,11 +711,11 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie
player->Relocate(x, y, z, orientation);
if (player->IsVehicle())
- player->GetVehicleKit()->RelocatePassengers(x, y, z, orientation);
+ player->GetVehicleKit()->RelocatePassengers();
if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell))
{
- sLog->outStaticDebug("Player %s relocation grid[%u, %u]cell[%u, %u]->grid[%u, %u]cell[%u, %u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
+ sLog->outDebug(LOG_FILTER_MAPS, "Player %s relocation grid[%u, %u]cell[%u, %u]->grid[%u, %u]cell[%u, %u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
player->RemoveFromGrid();
@@ -757,7 +757,7 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa
{
creature->Relocate(x, y, z, ang);
if (creature->IsVehicle())
- creature->GetVehicleKit()->RelocatePassengers(x, y, z, ang);
+ creature->GetVehicleKit()->RelocatePassengers();
creature->UpdateObjectVisibility(false);
RemoveCreatureFromMoveList(creature);
}
@@ -1002,7 +1002,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll)
GridMaps[gx][gy] = NULL;
}
- sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Unloading grid[%u, %u] for map %u finished", x, y, GetId());
return true;
}
@@ -1016,7 +1016,7 @@ void Map::RemoveAllPlayers()
if (!player->IsBeingTeleportedFar())
{
// this is happening for bg
- sLog->outError("Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", player->GetName(), GetId());
+ sLog->outError(LOG_FILTER_MAPS, "Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", player->GetName(), GetId());
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
}
}
@@ -1089,28 +1089,28 @@ bool GridMap::loadData(char *filename)
// loadup area data
if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
{
- sLog->outError("Error loading map area data\n");
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map area data\n");
fclose(in);
return false;
}
// loadup height data
if (header.heightMapOffset && !loadHeihgtData(in, header.heightMapOffset, header.heightMapSize))
{
- sLog->outError("Error loading map height data\n");
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map height data\n");
fclose(in);
return false;
}
// loadup liquid data
if (header.liquidMapOffset && !loadLiquidData(in, header.liquidMapOffset, header.liquidMapSize))
{
- sLog->outError("Error loading map liquids data\n");
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map liquids data\n");
fclose(in);
return false;
}
fclose(in);
return true;
}
- sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename);
+ sLog->outError(LOG_FILTER_MAPS, "Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename);
fclose(in);
return false;
}
@@ -1223,14 +1223,14 @@ bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/)
}
if (!(header.flags & MAP_LIQUID_NO_HEIGHT))
{
- _liquidMap = new float[_liquidWidth*_liquidHeight];
- if (fread(_liquidMap, sizeof(float), _liquidWidth*_liquidHeight, in) != _liquidWidth*_liquidHeight)
+ _liquidMap = new float[uint32(_liquidWidth) * uint32(_liquidHeight)];
+ if (fread(_liquidMap, sizeof(float), _liquidWidth*_liquidHeight, in) != (uint32(_liquidWidth) * uint32(_liquidHeight)))
return false;
}
return true;
}
-uint16 GridMap::getArea(float x, float y)
+uint16 GridMap::getArea(float x, float y) const
{
if (!_areaMap)
return _gridArea;
@@ -1463,7 +1463,7 @@ float GridMap::getHeightFromUint16(float x, float y) const
return (float)((a * x) + (b * y) + c)*_gridIntHeightMultiplier + _gridHeight;
}
-float GridMap::getLiquidLevel(float x, float y)
+float GridMap::getLiquidLevel(float x, float y) const
{
if (!_liquidMap)
return _liquidLevel;
@@ -1483,7 +1483,7 @@ float GridMap::getLiquidLevel(float x, float y)
}
// Why does this return LIQUID data?
-uint8 GridMap::getTerrainType(float x, float y)
+uint8 GridMap::getTerrainType(float x, float y) const
{
if (!_liquidFlags)
return 0;
@@ -1700,7 +1700,7 @@ bool Map::IsOutdoors(float x, float y, float z) const
WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
if (wmoEntry)
{
- sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
+ sLog->outDebug(LOG_FILTER_MAPS, "Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
}
return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry);
@@ -1987,7 +1987,7 @@ void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellCoord cellpa
void Map::SendInitSelf(Player* player)
{
- sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_MAPS, "Creating player data for himself %u", player->GetGUIDLow());
UpdateData data;
@@ -2071,7 +2071,7 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y)
{
if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS)
{
- sLog->outError("map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y);
+ sLog->outError(LOG_FILTER_MAPS, "map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y);
ASSERT(false);
}
i_grids[x][y] = grid;
@@ -2144,7 +2144,7 @@ void Map::RemoveAllObjectsInRemoveList()
{
Corpse* corpse = ObjectAccessor::GetCorpse(*obj, obj->GetGUID());
if (!corpse)
- sLog->outError("Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow());
+ sLog->outError(LOG_FILTER_MAPS, "Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow());
else
RemoveFromMap(corpse, true);
break;
@@ -2162,7 +2162,7 @@ void Map::RemoveAllObjectsInRemoveList()
RemoveFromMap(obj->ToCreature(), true);
break;
default:
- sLog->outError("Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId());
+ sLog->outError(LOG_FILTER_MAPS, "Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId());
break;
}
@@ -2239,7 +2239,7 @@ void Map::AddToActive(Creature* c)
else
{
GridCoord p2 = Trinity::ComputeGridCoord(c->GetPositionX(), c->GetPositionY());
- sLog->outError("Active creature (GUID: %u Entry: %u) added to grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
+ sLog->outError(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) added to grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord);
}
}
@@ -2260,7 +2260,7 @@ void Map::RemoveFromActive(Creature* c)
else
{
GridCoord p2 = Trinity::ComputeGridCoord(c->GetPositionX(), c->GetPositionY());
- sLog->outError("Active creature (GUID: %u Entry: %u) removed from grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
+ sLog->outError(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) removed from grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord);
}
}
@@ -2311,7 +2311,7 @@ bool InstanceMap::CanEnter(Player* player)
{
if (player->GetMapRef().getTarget() == this)
{
- sLog->outError("InstanceMap::CanEnter - player %s(%u) already in map %d, %d, %d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::CanEnter - player %s(%u) already in map %d, %d, %d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
ASSERT(false);
return false;
}
@@ -2324,7 +2324,7 @@ bool InstanceMap::CanEnter(Player* player)
uint32 maxPlayers = GetMaxPlayers();
if (GetPlayersCountExceptGMs() >= maxPlayers)
{
- sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
return false;
}
@@ -2394,7 +2394,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
if (!mapSave)
{
- sLog->outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
+ sLog->outInfo(LOG_FILTER_MAPS, "InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
}
@@ -2405,7 +2405,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// cannot enter other instances if bound permanently
if (playerBind->save != mapSave)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d, %d, %d, %d, %d, %d but he is being put into instance %d, %d, %d, %d, %d, %d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is permanently bound to instance %d, %d, %d, %d, %d, %d but he is being put into instance %d, %d, %d, %d, %d, %d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
return false;
}
}
@@ -2417,9 +2417,9 @@ bool InstanceMap::AddPlayerToMap(Player* player)
InstanceGroupBind* groupBind = group->GetBoundInstance(this);
if (playerBind)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
if (groupBind)
- sLog->outError("InstanceMap::Add: the group is bound to the instance %d, %d, %d, %d, %d, %d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: the group is bound to the instance %d, %d, %d, %d, %d, %d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
//ASSERT(false);
return false;
}
@@ -2431,15 +2431,15 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// cannot jump to a different instance without resetting it
if (groupBind->save != mapSave)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
if (mapSave)
- sLog->outError("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
+ sLog->outError(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
else
- sLog->outError("MapSave NULL");
+ sLog->outError(LOG_FILTER_MAPS, "MapSave NULL");
if (groupBind->save)
- sLog->outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
+ sLog->outError(LOG_FILTER_MAPS, "GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
else
- sLog->outError("GroupBind save NULL");
+ sLog->outError(LOG_FILTER_MAPS, "GroupBind save NULL");
return false;
}
// if the group/leader is permanently bound to the instance
@@ -2478,7 +2478,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// first player enters (no players yet)
SetResetSchedule(false);
- sLog->outDetail("MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
// initialize unload state
m_unloadTimer = 0;
m_resetAfterUnload = false;
@@ -2504,7 +2504,7 @@ void InstanceMap::Update(const uint32 t_diff)
void InstanceMap::RemovePlayerFromMap(Player* player, bool remove)
{
- sLog->outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
//if last player set unload timer
if (!m_unloadTimer && m_mapRefManager.getSize() == 1)
m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
@@ -2599,7 +2599,7 @@ void InstanceMap::PermBindAllPlayers(Player* source)
InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
if (!save)
{
- sLog->outError("Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", source->GetGUIDLow(), source->GetName(), source->GetMap()->GetMapName(), source->GetMapId(), GetInstanceId());
+ sLog->outError(LOG_FILTER_MAPS, "Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", source->GetGUIDLow(), source->GetName(), source->GetMap()->GetMapName(), source->GetMapId(), GetInstanceId());
return;
}
@@ -2653,7 +2653,7 @@ void InstanceMap::SetResetSchedule(bool on)
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()))
sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
else
- sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u, difficulty: %u)",
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u, difficulty: %u)",
on ? "on" : "off", GetId(), GetMapName(), GetInstanceId(), Difficulty(GetSpawnMode()));
}
}
@@ -2688,7 +2688,7 @@ uint32 InstanceMap::GetMaxResetDelay() const
/* ******* Battleground Instance Maps ******* */
BattlegroundMap::BattlegroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, uint8 spawnMode)
- : Map(id, expiry, InstanceId, spawnMode, _parent)
+ : Map(id, expiry, InstanceId, spawnMode, _parent), m_bg(NULL)
{
//lets initialize visibility distance for BG/Arenas
BattlegroundMap::InitVisibilityDistance();
@@ -2715,7 +2715,7 @@ bool BattlegroundMap::CanEnter(Player* player)
{
if (player->GetMapRef().getTarget() == this)
{
- sLog->outError("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_MAPS, "BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow());
ASSERT(false);
return false;
}
@@ -2743,7 +2743,7 @@ bool BattlegroundMap::AddPlayerToMap(Player* player)
void BattlegroundMap::RemovePlayerFromMap(Player* player, bool remove)
{
- sLog->outDetail("MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
Map::RemovePlayerFromMap(player, remove);
}
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 214f50e6d3c..0743c4e545f 100755
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -193,10 +193,10 @@ public:
bool loadData(char* filaname);
void unloadData();
- uint16 getArea(float x, float y);
- inline float getHeight(float x, float y) {return (this->*_gridGetHeight)(x, y);}
- float getLiquidLevel(float x, float y);
- uint8 getTerrainType(float x, float y);
+ uint16 getArea(float x, float y) const;
+ inline float getHeight(float x, float y) const {return (this->*_gridGetHeight)(x, y);}
+ float getLiquidLevel(float x, float y) const;
+ uint8 getTerrainType(float x, float y) const;
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = 0);
};
@@ -439,9 +439,9 @@ class Map : public GridRefManager<NGridType>
float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const;
void Balance() { _dynamicTree.balance(); }
- void Remove(const GameObjectModel& mdl) { _dynamicTree.remove(mdl); }
- void Insert(const GameObjectModel& mdl) { _dynamicTree.insert(mdl); }
- bool Contains(const GameObjectModel& mdl) const { return _dynamicTree.contains(mdl);}
+ void RemoveGameObjectModel(const GameObjectModel& model) { _dynamicTree.remove(model); }
+ void InsertGameObjectModel(const GameObjectModel& model) { _dynamicTree.insert(model); }
+ bool ContainsGameObjectModel(const GameObjectModel& model) const { return _dynamicTree.contains(model);}
bool getObjectHitPos(uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist);
/*
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index 2c1bdb00834..5fcca05361b 100755
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -193,13 +193,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
const MapEntry* entry = sMapStore.LookupEntry(GetId());
if (!entry)
{
- sLog->outError("CreateInstance: no entry for map %d", GetId());
+ sLog->outError(LOG_FILTER_MAPS, "CreateInstance: no entry for map %d", GetId());
ASSERT(false);
}
const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
if (!iTemplate)
{
- sLog->outError("CreateInstance: no instance template for map %d", GetId());
+ sLog->outError(LOG_FILTER_MAPS, "CreateInstance: no instance template for map %d", GetId());
ASSERT(false);
}
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index e9de3ae001f..b49d7db0a27 100755
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -77,7 +77,7 @@ void MapManager::checkAndCorrectGridStatesArray()
{
if (i_GridStates[i] != si_GridStates[i])
{
- sLog->outError("MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!");
+ sLog->outError(LOG_FILTER_MAPS, "MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!");
ok = false;
si_GridStates[i] = i_GridStates[i];
}
@@ -411,7 +411,7 @@ uint32 MapManager::GenerateInstanceId()
if (newInstanceId == _nextInstanceId)
{
- sLog->outError("Instance ID overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_MAPS, "Instance ID overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h
index 106c2189c65..aa07eef2204 100755
--- a/src/server/game/Maps/MapManager.h
+++ b/src/server/game/Maps/MapManager.h
@@ -143,7 +143,7 @@ class MapManager
void RegisterInstanceId(uint32 instanceId);
void FreeInstanceId(uint32 instanceId);
- uint32 GetNextInstanceId() { return _nextInstanceId; };
+ uint32 GetNextInstanceId() const { return _nextInstanceId; };
void SetNextInstanceId(uint32 nextInstanceId) { _nextInstanceId = nextInstanceId; };
MapUpdater * GetMapUpdater() { return &m_updater; }
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index bf00514000e..dac5b1ef9a2 100755
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -127,7 +127,7 @@ namespace Trinity
nBaseExp = 580;
break;
default:
- sLog->outError("BaseGain: Unsupported content level %u", content);
+ sLog->outError(LOG_FILTER_GENERAL, "BaseGain: Unsupported content level %u", content);
nBaseExp = 45;
break;
}
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index aec72835d86..5893bbd6564 100755
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -86,7 +86,8 @@ enum TrinityStrings
LANG_CONNECTED_PLAYERS = 60,
LANG_ACCOUNT_ADDON = 61,
LANG_IMPROPER_VALUE = 62,
- // Room for more level 0 63-99 not used
+ LANG_CANT_DO_NOW = 63,
+ // Room for more level 0 64-99 not used
// level 1 chat
LANG_GLOBAL_NOTIFY = 100,
@@ -337,7 +338,13 @@ enum TrinityStrings
LANG_TITLE_REMOVE_RES = 354,
LANG_TITLE_CURRENT_RES = 355,
LANG_CURRENT_TITLE_RESET = 356,
- // Room for more level 2 357-399 not used
+ LANG_COMMAND_CHEAT_STATUS = 357,
+ LANG_COMMAND_CHEAT_GOD = 358,
+ LANG_COMMAND_CHEAT_CT = 359,
+ LANG_COMMAND_CHEAT_CD = 360,
+ LANG_COMMAND_CHEAT_POWER = 361,
+ LANG_COMMAND_CHEAT_WW = 362,
+ // Room for more level 2 363-399 not used
// level 3 chat
LANG_SCRIPTS_RELOADED = 400,
@@ -957,7 +964,10 @@ enum TrinityStrings
LANG_COMMAND_LOOKUP_MAX_RESULTS = 5029,
LANG_FLEE = 5030,
LANG_NPCINFO_AIINFO = 5031,
- // Room for more Trinity strings 5032-9999
+ LANG_COMMAND_NO_BATTLEGROUND_FOUND = 5032,
+ LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND = 5033,
+ LANG_COMMAND_NO_OUTDOOR_PVP_FORUND = 5034,
+ // Room for more Trinity strings 5035-9999
// Level requirement notifications
LANG_SAY_REQ = 6604,
@@ -1066,7 +1076,7 @@ enum TrinityStrings
// Use for custom patches 11000-11999
LANG_AUTO_BROADCAST = 11000,
- LANG_INVALID_REALMID = 11001,
+ LANG_INVALID_REALMID = 11001
// NOT RESERVED IDS 12000-1999999999
// `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 06aca10879d..4f6ad917423 100755
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -26,7 +26,7 @@ enum SpellEffIndex
{
EFFECT_0 = 0,
EFFECT_1 = 1,
- EFFECT_2 = 2,
+ EFFECT_2 = 2
};
// used in script definitions
@@ -124,7 +124,7 @@ enum UnitClass
UNIT_CLASS_WARRIOR = 1,
UNIT_CLASS_PALADIN = 2,
UNIT_CLASS_ROGUE = 4,
- UNIT_CLASS_MAGE = 8,
+ UNIT_CLASS_MAGE = 8
};
#define CLASSMASK_ALL_CREATURES ((1<<(UNIT_CLASS_WARRIOR-1)) | (1<<(UNIT_CLASS_PALADIN-1)) | (1<<(UNIT_CLASS_ROGUE-1)) | (1<<(UNIT_CLASS_MAGE-1)))
@@ -245,7 +245,7 @@ enum ItemQualities
enum SpellCategory
{
SPELL_CATEGORY_FOOD = 11,
- SPELL_CATEGORY_DRINK = 59,
+ SPELL_CATEGORY_DRINK = 59
};
const uint32 ItemQualityColors[MAX_ITEM_QUALITY] =
@@ -465,7 +465,7 @@ enum SpellAttr5
SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK = 0x00010000, // 16 this allows spells with EquippedItemClass to affect spells from other items if the required item is equipped
SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared
SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused
- SPELL_ATTR5_UNK19 = 0x00080000, // 19
+ SPELL_ATTR5_DONT_TURN_DURING_CAST = 0x00080000, // 19 Blocks caster's turning when casting (client does not automatically turn caster's model to face UNIT_FIELD_TARGET)
SPELL_ATTR5_UNK20 = 0x00100000, // 20
SPELL_ATTR5_UNK21 = 0x00200000, // 21
SPELL_ATTR5_UNK22 = 0x00400000, // 22
@@ -572,7 +572,7 @@ enum SpellClickCastFlags
{
NPC_CLICK_CAST_CASTER_CLICKER = 0x01,
NPC_CLICK_CAST_TARGET_CLICKER = 0x02,
- NPC_CLICK_CAST_ORIG_CASTER_OWNER = 0x04,
+ NPC_CLICK_CAST_ORIG_CASTER_OWNER = 0x04
};
enum SheathTypes
@@ -642,7 +642,7 @@ enum TeamId
{
TEAM_ALLIANCE = 0,
TEAM_HORDE,
- TEAM_NEUTRAL,
+ TEAM_NEUTRAL
};
enum Team
@@ -654,7 +654,7 @@ enum Team
//TEAM_HORDE_FORCES = 892,
//TEAM_SANCTUARY = 936,
//TEAM_OUTLAND = 980,
- TEAM_OTHER = 0, // if ReputationListId > 0 && Flags != FACTION_FLAG_TEAM_HEADER
+ TEAM_OTHER = 0 // if ReputationListId > 0 && Flags != FACTION_FLAG_TEAM_HEADER
};
enum SpellEffects
@@ -1121,7 +1121,7 @@ enum SpellCustomErrors
SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_RECRUITS = 96, // You already have the max number of recruits.
SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_VOLUNTEERS = 97, // You already have the max number of volunteers.
SPELL_CUSTOM_ERROR_FROSTMOURNE_RENDERED_RESSURECT = 98, // Frostmourne has rendered you unable to ressurect.
- SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99, // You can't mount while affected by that shapeshift.
+ SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99 // You can't mount while affected by that shapeshift.
};
enum StealthType
@@ -1192,7 +1192,7 @@ enum AuraStateType
//AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide)
//AURA_STATE_UNKNOWN21 = 21, // | not used
AURA_STATE_UNKNOWN22 = 22, // C t| varius spells (63884, 50240)
- AURA_STATE_HEALTH_ABOVE_75_PERCENT = 23, // C |
+ AURA_STATE_HEALTH_ABOVE_75_PERCENT = 23 // C |
};
#define PER_CASTER_AURA_STATE_MASK (\
@@ -1485,7 +1485,7 @@ enum GameObjectFlags
GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state
GO_FLAG_TRIGGERED = 0x00000040, // typically, summoned objects. Triggered by spell or other events
GO_FLAG_DAMAGED = 0x00000200,
- GO_FLAG_DESTROYED = 0x00000400,
+ GO_FLAG_DESTROYED = 0x00000400
};
enum GameObjectDynamicLowFlags
@@ -1493,7 +1493,7 @@ enum GameObjectDynamicLowFlags
GO_DYNFLAG_LO_ACTIVATE = 0x01, // enables interaction with GO
GO_DYNFLAG_LO_ANIMATE = 0x02, // possibly more distinct animation of GO
GO_DYNFLAG_LO_NO_INTERACT = 0x04, // appears to disable interaction (not fully verified)
- GO_DYNFLAG_LO_SPARKLE = 0x08, // makes GO sparkle
+ GO_DYNFLAG_LO_SPARKLE = 0x08 // makes GO sparkle
};
enum GameObjectDestructibleState
@@ -1501,7 +1501,7 @@ enum GameObjectDestructibleState
GO_DESTRUCTIBLE_INTACT = 0,
GO_DESTRUCTIBLE_DAMAGED = 1,
GO_DESTRUCTIBLE_DESTROYED = 2,
- GO_DESTRUCTIBLE_REBUILDING = 3,
+ GO_DESTRUCTIBLE_REBUILDING = 3
};
// EmotesText.dbc
@@ -1758,7 +1758,7 @@ enum TextEmotes
TEXT_EMOTE_LOOK = 449,
TEXT_EMOTE_OBJECT = 450,
TEXT_EMOTE_SWEAT = 451,
- TEXT_EMOTE_YW = 453,
+ TEXT_EMOTE_YW = 453
};
// Emotes.dbc
@@ -2595,7 +2595,7 @@ enum CreatureTypeFlags
CREATURE_TYPEFLAGS_UNK28 = 0x10000000,
CREATURE_TYPEFLAGS_UNK29 = 0x20000000,
CREATURE_TYPEFLAGS_UNK30 = 0x40000000,
- CREATURE_TYPEFLAGS_UNK31 = 0x80000000,
+ CREATURE_TYPEFLAGS_UNK31 = 0x80000000
};
enum CreatureEliteType
@@ -2700,7 +2700,7 @@ enum QuestSort
QUEST_SORT_JEWELCRAFTING = 373,
QUEST_SORT_NOBLEGARDEN = 374,
QUEST_SORT_PILGRIMS_BOUNTY = 375,
- QUEST_SORT_LOVE_IS_IN_THE_AIR = 376,
+ QUEST_SORT_LOVE_IS_IN_THE_AIR = 376
};
inline uint8 ClassByQuestSort(int32 QuestSort)
@@ -3085,7 +3085,7 @@ enum AiReaction
AI_REACTION_FRIENDLY = 1, // (NOT used in client packet handler)
AI_REACTION_HOSTILE = 2, // sent on every attack, triggers aggro sound (used in client packet handler)
AI_REACTION_AFRAID = 3, // seen for polymorph (when AI not in control of self?) (NOT used in client packet handler)
- AI_REACTION_DESTROY = 4, // used on object destroy (NOT used in client packet handler)
+ AI_REACTION_DESTROY = 4 // used on object destroy (NOT used in client packet handler)
};
// Diminishing Returns Types
@@ -3119,7 +3119,7 @@ enum DiminishingGroup
DIMINISHING_SLEEP = 17,
DIMINISHING_TAUNT = 18,
DIMINISHING_LIMITONLY = 19,
- DIMINISHING_DRAGONS_BREATH = 20,
+ DIMINISHING_DRAGONS_BREATH = 20
};
enum SummonCategory
@@ -3129,7 +3129,7 @@ enum SummonCategory
SUMMON_CATEGORY_PET = 2,
SUMMON_CATEGORY_PUPPET = 3,
SUMMON_CATEGORY_VEHICLE = 4,
- SUMMON_CATEGORY_UNK = 5, // as of patch 3.3.5a only Bone Spike in Icecrown Citadel
+ SUMMON_CATEGORY_UNK = 5 // as of patch 3.3.5a only Bone Spike in Icecrown Citadel
// uses this category
};
@@ -3146,14 +3146,12 @@ enum SummonType
SUMMON_TYPE_WILD3 = 8,
SUMMON_TYPE_VEHICLE = 9,
SUMMON_TYPE_VEHICLE2 = 10,
- SUMMON_TYPE_OBJECT = 11,
+ SUMMON_TYPE_OBJECT = 11
};
enum EventId
{
- EVENT_SPELLCLICK = 1001,
- EVENT_FALL_GROUND = 1002,
- EVENT_CHARGE = 1003,
+ EVENT_CHARGE = 1003
};
enum ResponseCodes
@@ -3337,7 +3335,7 @@ enum MailResponseResult
MAIL_ERR_MAIL_AND_CHAT_SUSPENDED = 17,
MAIL_ERR_TOO_MANY_ATTACHMENTS = 18,
MAIL_ERR_MAIL_ATTACHMENT_INVALID = 19,
- MAIL_ERR_ITEM_HAS_EXPIRED = 21,
+ MAIL_ERR_ITEM_HAS_EXPIRED = 21
};
enum SpellFamilyNames
@@ -3403,7 +3401,7 @@ enum RemoveMethod
{
GROUP_REMOVEMETHOD_DEFAULT = 0,
GROUP_REMOVEMETHOD_KICK = 1,
- GROUP_REMOVEMETHOD_LEAVE = 2,
+ GROUP_REMOVEMETHOD_LEAVE = 2
};
enum ActivateTaxiReply
@@ -3430,7 +3428,7 @@ enum CalendarFlags
CALENDAR_FLAG_ALL_ALLOWED = 0x001,
CALENDAR_FLAG_INVITES_LOCKED = 0x010,
CALENDAR_FLAG_WITHOUT_INVITES = 0x040,
- CALENDAR_FLAG_GUILD_ONLY = 0x400,
+ CALENDAR_FLAG_GUILD_ONLY = 0x400
};
enum CalendarActionData
@@ -3444,21 +3442,21 @@ enum CalendarActionData
CALENDAR_ACTION_MODIFY_EVENT_INVITE,
CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE,
CALENDAR_ACTION_REMOVE_EVENT_INVITE,
- CALENDAR_ACTION_SIGNUP_TO_EVENT,
+ CALENDAR_ACTION_SIGNUP_TO_EVENT
};
enum CalendarModerationRank
{
CALENDAR_RANK_PLAYER,
CALENDAR_RANK_MODERATOR,
- CALENDAR_RANK_OWNER,
+ CALENDAR_RANK_OWNER
};
enum CalendarSendEventType
{
CALENDAR_SENDTYPE_GET,
CALENDAR_SENDTYPE_ADD,
- CALENDAR_SENDTYPE_COPY,
+ CALENDAR_SENDTYPE_COPY
};
enum CalendarEventType
@@ -3467,7 +3465,7 @@ enum CalendarEventType
CALENDAR_TYPE_DUNGEON,
CALENDAR_TYPE_PVP,
CALENDAR_TYPE_MEETING,
- CALENDAR_TYPE_OTHER,
+ CALENDAR_TYPE_OTHER
};
enum CalendarInviteStatus
@@ -3481,7 +3479,7 @@ enum CalendarInviteStatus
CALENDAR_STATUS_CONFIRMED,
CALENDAR_STATUS_NO_OWNER,
CALENDAR_STATUS_8,
- CALENDAR_STATUS_9,
+ CALENDAR_STATUS_9
};
enum CalendarError
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index bc0570bb73b..26e83773228 100755
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -189,7 +189,7 @@ void MotionMaster::MoveRandom(float spawndist)
{
if (_owner->GetTypeId() == TYPEID_UNIT)
{
- sLog->outStaticDebug("Creature (GUID: %u) start moving random", _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (GUID: %u) start moving random", _owner->GetGUIDLow());
Mutate(new RandomMovementGenerator<Creature>(spawndist), MOTION_SLOT_IDLE);
}
}
@@ -200,22 +200,22 @@ void MotionMaster::MoveTargetedHome()
if (_owner->GetTypeId()==TYPEID_UNIT && !((Creature*)_owner)->GetCharmerOrOwnerGUID())
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow());
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
}
else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID())
{
- sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
Unit *target = ((Creature*)_owner)->GetCharmerOrOwner();
if (target)
{
- sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow());
Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE);
}
}
else
{
- sLog->outError("Player (GUID: %u) attempt targeted home", _owner->GetGUIDLow());
+ sLog->outError(LOG_FILTER_GENERAL, "Player (GUID: %u) attempt targeted home", _owner->GetGUIDLow());
}
}
@@ -223,12 +223,12 @@ void MotionMaster::MoveConfused()
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) move confused", _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) move confused", _owner->GetGUIDLow());
Mutate(new ConfusedMovementGenerator<Player>(), MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) move confused",
_owner->GetEntry(), _owner->GetGUIDLow());
Mutate(new ConfusedMovementGenerator<Creature>(), MOTION_SLOT_CONTROLLED);
}
@@ -243,7 +243,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
//_owner->ClearUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) chase to %s (GUID: %u)",
_owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
@@ -251,7 +251,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
@@ -268,14 +268,14 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
//_owner->AddUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(),
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
Mutate(new FollowMovementGenerator<Player>(*target,dist,angle), slot);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
@@ -287,12 +287,12 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z), MOTION_SLOT_ACTIVE);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_ACTIVE);
}
@@ -303,7 +303,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos)
float x, y, z;
pos.GetPosition(x, y, z);
- sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
Movement::MoveSplineInit init(*_owner);
init.MoveTo(x,y,z);
@@ -317,7 +317,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos)
float x, y, z;
pos.GetPosition(x, y, z);
- sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
Movement::MoveSplineInit init(*_owner);
init.MoveTo(x,y,z);
@@ -335,9 +335,17 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa
float x, y, z;
float moveTimeHalf = speedZ / Movement::gravity;
float dist = 2 * moveTimeHalf * speedXY;
+ float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ);
_owner->GetNearPoint(_owner, x, y, z, _owner->GetObjectSize(), dist, _owner->GetAngle(srcX, srcY) + M_PI);
- MoveJump(x, y, z, speedXY, speedZ);
+
+ Movement::MoveSplineInit init(*_owner);
+ init.MoveTo(x,y,z);
+ init.SetParabolic(max_height,0);
+ init.SetOrientationFixed(true);
+ init.SetVelocity(speedXY);
+ init.Launch();
+ Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED);
}
void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
@@ -356,7 +364,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id)
{
- sLog->outStaticDebug("Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
float moveTimeHalf = speedZ / Movement::gravity;
float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ);
@@ -375,7 +383,7 @@ void MotionMaster::MoveFall(uint32 id/*=0*/)
float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE);
if (tz <= INVALID_HEIGHT)
{
- sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).",
+ sLog->outDebug(LOG_FILTER_GENERAL, "MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).",
_owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ());
return;
}
@@ -404,12 +412,12 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
}
@@ -419,11 +427,11 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outError("Player (GUID: %u) attempt to seek assistance", _owner->GetGUIDLow());
+ sLog->outError(LOG_FILTER_GENERAL, "Player (GUID: %u) attempt to seek assistance", _owner->GetGUIDLow());
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
_owner->AttackStop();
_owner->ToCreature()->SetReactState(REACT_PASSIVE);
@@ -435,11 +443,11 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outError("Player (GUID: %u) attempt to call distract after assistance", _owner->GetGUIDLow());
+ sLog->outError(LOG_FILTER_GENERAL, "Player (GUID: %u) attempt to call distract after assistance", _owner->GetGUIDLow());
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(), time);
Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE);
}
@@ -455,14 +463,14 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(),
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(),
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow());
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
_owner->GetEntry(), _owner->GetGUIDLow(),
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(),
@@ -480,19 +488,19 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
{
if (path < sTaxiPathNodesByPath.size())
{
- sLog->outStaticDebug("%s taxi to (Path %u node %u)", _owner->GetName(), path, pathnode);
+ sLog->outDebug(LOG_FILTER_GENERAL, "%s taxi to (Path %u node %u)", _owner->GetName(), path, pathnode);
FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(sTaxiPathNodesByPath[path], pathnode);
Mutate(mgen, MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outError("%s attempt taxi to (not existed Path %u node %u)",
+ sLog->outError(LOG_FILTER_GENERAL, "%s attempt taxi to (not existed Path %u node %u)",
_owner->GetName(), path, pathnode);
}
}
else
{
- sLog->outError("Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)",
+ sLog->outError(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)",
_owner->GetEntry(), _owner->GetGUIDLow(), path, pathnode);
}
}
@@ -504,11 +512,11 @@ void MotionMaster::MoveDistract(uint32 timer)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) (timer: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(), timer);
}
@@ -560,7 +568,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
//Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
- sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO");
}
@@ -619,7 +627,7 @@ void MotionMaster::DirectDelete(_Ty curr)
void MotionMaster::DelayedDelete(_Ty curr)
{
- sLog->outCrash("Unit (Entry %u) is trying to delete its updating MG (Type %u)!", _owner->GetEntry(), curr->GetMovementGeneratorType());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Unit (Entry %u) is trying to delete its updating MG (Type %u)!", _owner->GetEntry(), curr->GetMovementGeneratorType());
if (isStatic(curr))
return;
if (!_expList)
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index 727f626cdea..8d7fdee7ad2 100755
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -51,7 +51,7 @@ enum MovementGeneratorType
FOLLOW_MOTION_TYPE = 14,
ROTATE_MOTION_TYPE = 15,
EFFECT_MOTION_TYPE = 16,
- NULL_MOTION_TYPE = 17,
+ NULL_MOTION_TYPE = 17
};
enum MovementSlot
@@ -59,7 +59,7 @@ enum MovementSlot
MOTION_SLOT_IDLE,
MOTION_SLOT_ACTIVE,
MOTION_SLOT_CONTROLLED,
- MAX_MOTION_SLOT,
+ MAX_MOTION_SLOT
};
enum MMCleanFlag
@@ -72,7 +72,7 @@ enum MMCleanFlag
enum RotateDirection
{
ROTATE_DIRECTION_LEFT,
- ROTATE_DIRECTION_RIGHT,
+ ROTATE_DIRECTION_RIGHT
};
// assume it is 25 yard per 0.6 second
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
index 08e27abf050..56818e95a2b 100755
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -140,7 +140,12 @@ bool FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float
angle = i_cur_angle + static_cast<float>(M_PI);
distance /= 2;
break;
+ default:
+ angle = 0.0f;
+ distance = 0.0f;
+ break;
}
+
temp_x = x + distance * cos(angle);
temp_y = y + distance * sin(angle);
Trinity::NormalizeMapCoord(temp_x);
@@ -407,10 +412,6 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32& time_diff
if (i_totalFleeTime.Passed())
return false;
- i_totalFleeTime.Update(time_diff);
- if (i_totalFleeTime.Passed())
- return false;
-
// This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, const uint32 &) version
// This is done instead of casting Unit& to Creature& and call parent method, then we can use Unit directly
return MovementGeneratorMedium< Creature, FleeingMovementGenerator<Creature> >::Update(owner, time_diff);
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
index a922c937b5f..07a5761517e 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -33,6 +33,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
unit.StopMoving();
unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ i_recalculateSpeed = false;
Movement::MoveSplineInit init(unit);
init.MoveTo(i_x, i_y, i_z);
if (speed > 0.0f)
@@ -53,6 +54,17 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/)
}
unit.AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ if (i_recalculateSpeed && !unit.movespline->Finalized())
+ {
+ i_recalculateSpeed = false;
+ Movement::MoveSplineInit init(unit);
+ init.MoveTo(i_x, i_y, i_z);
+ if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
+ init.SetVelocity(speed);
+ init.Launch();
+ }
+
return !unit.movespline->Finalized();
}
@@ -81,11 +93,6 @@ void PointMovementGenerator<T>::MovementInform(T & /*unit*/)
template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
{
- //if (id == EVENT_FALL_GROUND)
- //{
- // unit.setDeathState(JUST_DIED);
- // unit.SetFlying(true);
- //}
if (unit.AI())
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
}
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
index 13be9fee77b..d2833a5ee10 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -36,6 +36,8 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG
void MovementInform(T &);
+ void unitSpeedChanged() { i_recalculateSpeed = true; }
+
MovementGeneratorType GetMovementGeneratorType() { return POINT_MOTION_TYPE; }
bool GetDestination(float& x, float& y, float& z) const { x=i_x; y=i_y; z=i_z; return true; }
@@ -43,6 +45,7 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG
uint32 id;
float i_x, i_y, i_z;
float speed;
+ bool i_recalculateSpeed;
};
class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index fdff5a92564..2cd3d745750 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -89,6 +89,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
Movement::MoveSplineInit init(owner);
init.MoveTo(x,y,z);
+ init.SetFacing(i_target.getTarget());
init.SetWalk(((D*)this)->EnableWalking());
init.Launch();
}
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 25730f92161..12b85b10922 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -41,7 +41,7 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature)
if (!i_path)
{
// No movement found for entry
- sLog->outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path id: %u", creature.GetName(), creature.GetEntry(), creature.GetGUIDLow(), path_id);
+ sLog->outError(LOG_FILTER_SQL, "WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path id: %u", creature.GetName(), creature.GetEntry(), creature.GetGUIDLow(), path_id);
return;
}
@@ -314,11 +314,11 @@ void FlightPathMovementGenerator::PreloadEndGrid()
// Load the grid
if (endMap)
{
- sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1));
+ sLog->outInfo(LOG_FILTER_GENERAL, "Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1));
endMap->LoadGrid(_endGridX, _endGridY);
}
else
- sLog->outDetail("Unable to determine map to preload flightmaster grid");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unable to determine map to preload flightmaster grid");
}
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
index b1c25aedfd7..699d054be4b 100644
--- a/src/server/game/Movement/Spline/MoveSpline.cpp
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -107,7 +107,7 @@ struct FallInitializer
};
enum{
- minimal_duration = 1,
+ minimal_duration = 1
};
struct CommonInitializer
@@ -153,7 +153,7 @@ void MoveSpline::init_spline(const MoveSplineInitArgs& args)
// TODO: what to do in such cases? problem is in input data (all points are at same coords)
if (spline.length() < minimal_duration)
{
- sLog->outError("MoveSpline::init_spline: zero length spline, wrong input data?");
+ sLog->outError(LOG_FILTER_GENERAL, "MoveSpline::init_spline: zero length spline, wrong input data?");
spline.set_length(spline.last(), spline.isCyclic() ? 1000 : 1);
}
point_Idx = spline.first();
@@ -167,6 +167,7 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args)
point_Idx_offset = args.path_Idx_offset;
initialOrientation = args.initialOrientation;
+ onTransport = false;
time_passed = 0;
vertical_acceleration = 0.f;
effect_start_time = 0;
@@ -199,7 +200,7 @@ bool MoveSplineInitArgs::Validate() const
#define CHECK(exp) \
if (!(exp))\
{\
- sLog->outError("MoveSplineInitArgs::Validate: expression '%s' failed", #exp);\
+ sLog->outError(LOG_FILTER_GENERAL, "MoveSplineInitArgs::Validate: expression '%s' failed", #exp);\
return false;\
}
CHECK(path.size() > 1);
@@ -217,7 +218,7 @@ bool MoveSplineInitArgs::_checkPathBounds() const
if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2)
{
enum{
- MAX_OFFSET = (1 << 11) / 2,
+ MAX_OFFSET = (1 << 11) / 2
};
Vector3 middle = (path.front()+path.back()) / 2;
Vector3 offset;
@@ -226,7 +227,7 @@ bool MoveSplineInitArgs::_checkPathBounds() const
offset = path[i] - middle;
if (fabs(offset.x) >= MAX_OFFSET || fabs(offset.y) >= MAX_OFFSET || fabs(offset.z) >= MAX_OFFSET)
{
- sLog->outError("MoveSplineInitArgs::_checkPathBounds check failed");
+ sLog->outError(LOG_FILTER_GENERAL, "MoveSplineInitArgs::_checkPathBounds check failed");
return false;
}
}
diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h
index d4b19b21634..945adf6d9f8 100644
--- a/src/server/game/Movement/Spline/MoveSpline.h
+++ b/src/server/game/Movement/Spline/MoveSpline.h
@@ -45,7 +45,7 @@ namespace Movement
Result_None = 0x01,
Result_Arrived = 0x02,
Result_NextCycle = 0x04,
- Result_NextSegment = 0x08,
+ Result_NextSegment = 0x08
};
friend class PacketBuilder;
protected:
@@ -119,6 +119,7 @@ namespace Movement
const Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx+1) : Vector3();}
int32 currentPathIdx() const;
+ bool onTransport;
std::string ToString() const;
};
}
diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h
index cfc2fdee450..a7262182391 100644
--- a/src/server/game/Movement/Spline/MoveSplineFlag.h
+++ b/src/server/game/Movement/Spline/MoveSplineFlag.h
@@ -70,7 +70,7 @@ namespace Movement
// CatmullRom interpolation mode used
Mask_CatmullRom = Flying | Catmullrom,
// Unused, not suported flags
- Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown7|Unknown8|Unknown10|Unknown11|Unknown12|Unknown13,
+ Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown7|Unknown8|Unknown10|Unknown11|Unknown12|Unknown13
};
inline uint32& raw() { return (uint32&)*this;}
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp
index c539dd3cc39..fec629c3329 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.cpp
+++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp
@@ -74,7 +74,8 @@ namespace Movement
// there is a big chance that current position is unknown if current state is not finalized, need compute it
// this also allows calculate spline position and update map position in much greater intervals
- if (!move_spline.Finalized())
+ // Don't compute for transport movement if the unit is in a motion between two transports
+ if (!move_spline.Finalized() && move_spline.onTransport == transport)
real_position = move_spline.ComputePosition();
// should i do the things that user should do? - no.
@@ -84,6 +85,7 @@ namespace Movement
// corrent first vertex
args.path[0] = real_position;
args.initialOrientation = real_position.orientation;
+ move_spline.onTransport = transport;
uint32 moveFlags = unit.m_movementInfo.GetMovementFlags();
if (args.flags.walkmode)
@@ -158,17 +160,9 @@ namespace Movement
{
if (_transformForTransport)
{
- if (Unit* vehicle = _owner.GetVehicleBase())
- {
- input.x -= vehicle->GetPositionX();
- input.y -= vehicle->GetPositionY();
- input.z -= vehicle->GetPositionZMinusOffset();
- }
- else if (Transport* transport = _owner.GetTransport())
- {
- float unused = 0.0f;
+ float unused = 0.0f;
+ if (TransportBase* transport = _owner.GetDirectTransport())
transport->CalculatePassengerOffset(input.x, input.y, input.z, unused);
- }
}
return input;
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h
index ef847809ac8..cae9f1321d2 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.h
+++ b/src/server/game/Movement/Spline/MoveSplineInit.h
@@ -30,7 +30,7 @@ namespace Movement
ToGround = 0, // 460 = ToGround, index of AnimationData.dbc
FlyToFly = 1, // 461 = FlyToFly?
ToFly = 2, // 458 = ToFly
- FlyToGround = 3, // 463 = FlyToGround
+ FlyToGround = 3 // 463 = FlyToGround
};
// Transforms coordinates from global to transport offsets
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
index 16f06a25058..8aef671d2d1 100644
--- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
@@ -49,7 +49,7 @@ namespace Movement
data << move_spline.spline.getPoint(move_spline.spline.first());
data << move_spline.GetId();
- switch(splineflags & MoveSplineFlag::Mask_Final_Facing)
+ switch (splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
data << uint8(MonsterMoveFacingTarget);
diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h
index 627cdcf3e3b..63e61b84579 100644
--- a/src/server/game/Movement/Spline/Spline.h
+++ b/src/server/game/Movement/Spline/Spline.h
@@ -53,7 +53,7 @@ protected:
// lesser value saves more performance in cost of lover precision
// minimal value is 1
// client's value is 20, blizzs use 2-3 steps to compute length
- STEPS_PER_SEGMENT = 3,
+ STEPS_PER_SEGMENT = 3
};
static_assert(STEPS_PER_SEGMENT > 0, "shouldn't be lesser than 1");
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index 296c9eee50f..a01e18347f6 100755
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -48,8 +48,8 @@ void WaypointMgr::Load()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
+
return;
}
@@ -86,8 +86,8 @@ void WaypointMgr::Load()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void WaypointMgr::ReloadPath(uint32 id)
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
index dfdd4fc4ffc..9919a47642e 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -29,8 +29,8 @@
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
-OPvPCapturePoint::OPvPCapturePoint(OutdoorPvP* pvp):
-m_capturePointGUID(0), m_capturePoint(NULL), m_maxValue(0), m_maxSpeed(0),
+OPvPCapturePoint::OPvPCapturePoint(OutdoorPvP* pvp) :
+m_capturePointGUID(0), m_capturePoint(NULL), m_maxValue(0.0f), m_minValue(0.0f), m_maxSpeed(0),
m_value(0), m_team(TEAM_NEUTRAL), m_OldState(OBJECTIVESTATE_NEUTRAL),
m_State(OBJECTIVESTATE_NEUTRAL), m_neutralValuePct(0), m_PvP(pvp)
{
@@ -123,7 +123,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
{
- sLog->outError("OutdoorPvP: GO %u is not capture point!", entry);
+ sLog->outError(LOG_FILTER_OUTDOORPVP, "OutdoorPvP: GO %u is not capture point!", entry);
return false;
}
@@ -382,7 +382,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
if (m_OldState != m_State)
{
- //sLog->outError("%u->%u", m_OldState, m_State);
+ //sLog->outError(LOG_FILTER_OUTDOORPVP, "%u->%u", m_OldState, m_State);
if (oldTeam != m_team)
ChangeTeam(oldTeam);
ChangeState();
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h
index 6ea13d353c5..e896fa2acf6 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.h
@@ -31,7 +31,7 @@ enum OutdoorPvPTypes
OUTDOOR_PVP_TF = 3,
OUTDOOR_PVP_ZM = 4,
OUTDOOR_PVP_SI = 5,
- OUTDOOR_PVP_EP = 6,
+ OUTDOOR_PVP_EP = 6
};
#define MAX_OUTDOORPVP_TYPES 7
@@ -44,7 +44,7 @@ enum ObjectiveStates
OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE,
OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE,
OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE,
- OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE,
+ OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE
};
#define OTHER_TEAM(a) (a == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE)
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
index a079d2f643b..ce987e25eed 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
@@ -46,8 +46,7 @@ void OutdoorPvPMgr::InitOutdoorPvP()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
return;
}
@@ -65,7 +64,7 @@ void OutdoorPvPMgr::InitOutdoorPvP()
if (typeId >= MAX_OUTDOORPVP_TYPES)
{
- sLog->outErrorDb("Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
+ sLog->outError(LOG_FILTER_SQL, "Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
continue;
}
@@ -85,20 +84,20 @@ void OutdoorPvPMgr::InitOutdoorPvP()
OutdoorPvPDataMap::iterator iter = m_OutdoorPvPDatas.find(OutdoorPvPTypes(i));
if (iter == m_OutdoorPvPDatas.end())
{
- sLog->outErrorDb("Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
+ sLog->outError(LOG_FILTER_SQL, "Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
continue;
}
pvp = sScriptMgr->CreateOutdoorPvP(iter->second);
if (!pvp)
{
- sLog->outError("Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i));
+ sLog->outError(LOG_FILTER_OUTDOORPVP, "Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i));
continue;
}
if (!pvp->SetupOutdoorPvP())
{
- sLog->outError("Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
+ sLog->outError(LOG_FILTER_OUTDOORPVP, "Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
delete pvp;
continue;
}
@@ -106,8 +105,7 @@ void OutdoorPvPMgr::InitOutdoorPvP()
m_OutdoorPvPSet.push_back(pvp);
}
- sLog->outString(">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP* handle)
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index d8548b552d3..79e8d47aa94 100755
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -571,8 +571,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
mPoolTemplate.clear();
- sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 object pools. DB table `pool_template` is empty.");
return;
}
@@ -590,13 +589,12 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
// Creatures
- sLog->outString("Loading Creatures Pooling Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creatures Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -605,8 +603,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
}
else
{
@@ -622,17 +619,17 @@ void PoolMgr::LoadFromDB()
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
if (!data)
{
- sLog->outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog->outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
continue;
}
PoolTemplateData* pPoolTemplate = &mPoolTemplate[pool_id];
@@ -647,14 +644,13 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Gameobjects
- sLog->outString("Loading Gameobject Pooling Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Gameobject Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -663,8 +659,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
}
else
{
@@ -680,7 +675,7 @@ void PoolMgr::LoadFromDB()
GameObjectData const* data = sObjectMgr->GetGOData(guid);
if (!data)
{
- sLog->outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
continue;
}
@@ -689,19 +684,19 @@ void PoolMgr::LoadFromDB()
goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE)
{
- sLog->outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog->outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
continue;
}
@@ -717,14 +712,13 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Pool of pools
- sLog->outString("Loading Mother Pooling Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Mother Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -733,8 +727,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 pools in pools");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools in pools");
}
else
{
@@ -749,22 +742,22 @@ void PoolMgr::LoadFromDB()
if (mother_pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", mother_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", mother_pool_id);
continue;
}
if (child_pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.", child_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.", child_pool_id);
continue;
}
if (mother_pool_id == child_pool_id)
{
- sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.", child_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.", child_pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog->outErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id);
continue;
}
PoolTemplateData* pPoolTemplateMother = &mPoolTemplate[mother_pool_id];
@@ -794,7 +787,7 @@ void PoolMgr::LoadFromDB()
ss << *itr << ' ';
ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
<< poolItr->first << " and child pool " << poolItr->second;
- sLog->outErrorDb("%s", ss.str().c_str());
+ sLog->outError(LOG_FILTER_SQL, "%s", ss.str().c_str());
mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
mPoolSearchMap.erase(poolItr);
--count;
@@ -803,12 +796,11 @@ void PoolMgr::LoadFromDB()
}
}
- sLog->outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Quest Pooling Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quest Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -817,8 +809,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 quests in pools");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests in pools");
}
else
{
@@ -844,19 +835,19 @@ void PoolMgr::LoadFromDB()
Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
if (!quest)
{
- sLog->outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
continue;
}
if (!quest->IsDailyOrWeekly())
{
- sLog->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
continue;
}
@@ -867,7 +858,7 @@ void PoolMgr::LoadFromDB()
if (poolTypeMap[pool_id] != currType)
{
- sLog->outErrorDb("`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.",
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.",
entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY");
continue;
}
@@ -877,7 +868,7 @@ void PoolMgr::LoadFromDB()
if (creBounds.first == creBounds.second && goBounds.first == goBounds.second)
{
- sLog->outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id);
continue;
}
@@ -893,13 +884,12 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks
- sLog->outString("Starting objects pooling system...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting objects pooling system...");
{
uint32 oldMSTime = getMSTime();
@@ -909,8 +899,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Pool handling system initialized, 0 pools spawned.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Pool handling system initialized, 0 pools spawned.");
}
else
{
@@ -926,9 +915,9 @@ void PoolMgr::LoadFromDB()
if (pool_pool_id)
// The pool is a child pool in pool_pool table. Ideally we should remove it from the pool handler to ensure it never gets spawned,
// however that could recursively invalidate entire chain of mother pools. It can be done in the future but for now we'll do nothing.
- sLog->outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt32());
+ sLog->outError(LOG_FILTER_SQL, "Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt32());
else
- sLog->outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
+ sLog->outError(LOG_FILTER_SQL, "Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
continue;
}
@@ -941,8 +930,8 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outBasic("Pool handling system initialized, %u pools spawned in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outDebug(LOG_FILTER_POOLSYS, "Pool handling system initialized, %u pools spawned in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
}
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 9221da53003..b58011efe42 100755
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -238,10 +238,11 @@ uint32 Quest::CalculateHonorGain(uint8 level) const
if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f)
{
// values stored from 0.. for 1...
- TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1);
+ TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level);
if (!tc)
return 0;
- honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161);
+
+ honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f);
honor += GetRewHonorAddition();
}
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 7f22b441afe..5a8891d888c 100755
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -90,7 +90,7 @@ enum __QuestTradeSkill
QUEST_TRSKILL_MINING = 11,
QUEST_TRSKILL_FISHING = 12,
QUEST_TRSKILL_SKINNING = 13,
- QUEST_TRSKILL_JEWELCRAFTING = 14,
+ QUEST_TRSKILL_JEWELCRAFTING = 14
};
enum QuestStatus
@@ -158,7 +158,7 @@ enum __QuestFlags
QUEST_TRINITY_FLAGS_SPEAKTO = 0x08000000, // Internal flag computed only
QUEST_TRINITY_FLAGS_KILL_OR_CAST = 0x10000000, // Internal flag computed only
QUEST_TRINITY_FLAGS_TIMED = 0x20000000, // Internal flag computed only
- QUEST_TRINITY_FLAGS_PLAYER_KILL = 0x40000000, // Internal flag computed only
+ QUEST_TRINITY_FLAGS_PLAYER_KILL = 0x40000000 // Internal flag computed only
};
struct QuestLocale
@@ -194,7 +194,7 @@ class Quest
int32 GetZoneOrSort() const { return ZoneOrSort; }
uint32 GetMinLevel() const { return MinLevel; }
uint32 GetMaxLevel() const { return MaxLevel; }
- uint32 GetQuestLevel() const { return Level; }
+ int32 GetQuestLevel() const { return Level; }
uint32 GetType() const { return Type; }
uint32 GetRequiredClasses() const { return RequiredClasses; }
uint32 GetRequiredRaces() const { return RequiredRaces; }
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index 94a6590cc4a..7ef59916099 100755
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -45,7 +45,7 @@ bool ReputationMgr::IsAtWar(uint32 faction_id) const
if (!factionEntry)
{
- sLog->outError("ReputationMgr::IsAtWar: Can't get AtWar flag of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
+ sLog->outError(LOG_FILTER_GENERAL, "ReputationMgr::IsAtWar: Can't get AtWar flag of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
return 0;
}
@@ -68,7 +68,7 @@ int32 ReputationMgr::GetReputation(uint32 faction_id) const
if (!factionEntry)
{
- sLog->outError("ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
+ sLog->outError(LOG_FILTER_GENERAL, "ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
return 0;
}
@@ -388,11 +388,11 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
UpdateRankCounters(old_rank, new_rank);
_player->ReputationChanged(factionEntry);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID);
- _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID);
+ _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID);
return true;
}
diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h
index a073845ea73..f950cbb82c2 100755
--- a/src/server/game/Reputation/ReputationMgr.h
+++ b/src/server/game/Reputation/ReputationMgr.h
@@ -65,7 +65,7 @@ class ReputationMgr
{
public: // constructors and global modifiers
explicit ReputationMgr(Player* owner) : _player(owner),
- _visibleFactionCount(0), _honoredFactionCount(0), _reveredFactionCount(0), _exaltedFactionCount(0) {}
+ _visibleFactionCount(0), _honoredFactionCount(0), _reveredFactionCount(0), _exaltedFactionCount(0), _sendFactionIncreased(false) {}
~ReputationMgr() {}
void SaveToDB(SQLTransaction& trans);
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 5387a3132c6..517ea6cb6bd 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -102,7 +102,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
{
Player* player = NULL;
if (!source && !target)
- sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
else
{
// Check target first, then source.
@@ -112,7 +112,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
player = source->ToPlayer();
if (!player)
- sLog->outError("%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
@@ -124,7 +124,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
{
Creature* creature = NULL;
if (!source && !target)
- sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
else
{
if (bReverse)
@@ -145,7 +145,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
}
if (!creature)
- sLog->outError("%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
@@ -157,15 +157,15 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
{
Unit* unit = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else if (!obj->isType(TYPEMASK_UNIT))
- sLog->outError("%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
else
{
unit = obj->ToUnit();
if (!unit)
- sLog->outError("%s %s object could not be casted to unit.",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object could not be casted to unit.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
}
return unit;
@@ -175,12 +175,12 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInf
{
Player* player = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
player = obj->ToPlayer();
if (!player)
- sLog->outError("%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return player;
@@ -190,12 +190,12 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const Scrip
{
Creature* creature = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
creature = obj->ToCreature();
if (!creature)
- sLog->outError("%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return creature;
@@ -205,13 +205,13 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const
{
WorldObject* pWorldObject = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
pWorldObject = dynamic_cast<WorldObject*>(obj);
if (!pWorldObject)
- sLog->outError("%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return pWorldObject;
@@ -227,29 +227,29 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, const Script
case SCRIPT_COMMAND_OPEN_DOOR: bOpen = true; break;
case SCRIPT_COMMAND_CLOSE_DOOR: break;
default:
- sLog->outError("%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str());
return;
}
if (!guid)
- sLog->outError("%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str());
else if (!source)
- sLog->outError("%s source object is NULL.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source object is NULL.", scriptInfo->GetDebugInfo().c_str());
else if (!source->isType(TYPEMASK_UNIT))
- sLog->outError("%s source object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->GetDebugInfo().c_str(),
+ sLog->outError(LOG_FILTER_TSCR, "%s source object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->GetDebugInfo().c_str(),
source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
if (!wSource)
- sLog->outError("%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
{
GameObject* pDoor = _FindGameObject(wSource, guid);
if (!pDoor)
- sLog->outError("%s gameobject was not found (guid: %u).", scriptInfo->GetDebugInfo().c_str(), guid);
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject was not found (guid: %u).", scriptInfo->GetDebugInfo().c_str(), guid);
else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR)
- sLog->outError("%s gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetEntry(), pDoor->GetGUIDLow());
else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY))
{
@@ -331,7 +331,7 @@ void Map::ScriptsProcess()
}
break;
default:
- sLog->outError("%s source with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s source with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
step.script->GetDebugInfo().c_str(), step.sourceGUID, GUID_HIPART(step.sourceGUID));
break;
}
@@ -359,7 +359,7 @@ void Map::ScriptsProcess()
target = HashMapHolder<Corpse>::Find(step.targetGUID);
break;
default:
- sLog->outError("%s target with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s target with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
step.script->GetDebugInfo().c_str(), step.targetGUID, GUID_HIPART(step.targetGUID));
break;
}
@@ -370,7 +370,7 @@ void Map::ScriptsProcess()
case SCRIPT_COMMAND_TALK:
if (step.script->Talk.ChatType > CHAT_TYPE_WHISPER && step.script->Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER)
{
- sLog->outError("%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType);
+ sLog->outError(LOG_FILTER_TSCR, "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType);
break;
}
if (step.script->Talk.Flags & SF_TALK_USE_PLAYER)
@@ -397,7 +397,7 @@ void Map::ScriptsProcess()
{
uint64 targetGUID = target ? target->GetGUID() : 0;
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
- sLog->outError("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
player->Whisper(text, LANG_UNIVERSAL, targetGUID);
break;
@@ -429,13 +429,13 @@ void Map::ScriptsProcess()
break;
case CHAT_TYPE_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
- sLog->outError("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
cSource->Whisper(step.script->Talk.TextID, targetGUID);
break;
case CHAT_MSG_RAID_BOSS_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
- sLog->outError("%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
cSource->MonsterWhisper(step.script->Talk.TextID, targetGUID, true);
break;
@@ -463,7 +463,7 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FieldSet.FieldID <= OBJECT_FIELD_ENTRY || step.script->FieldSet.FieldID >= cSource->GetValuesCount())
- sLog->outError("%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FieldSet.FieldID,
cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetEntry(), cSource->GetGUIDLow());
else
@@ -492,7 +492,7 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
- sLog->outError("%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
@@ -506,7 +506,7 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
- sLog->outError("%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
@@ -533,12 +533,12 @@ void Map::ScriptsProcess()
{
if (!source)
{
- sLog->outError("%s source object is NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source object is NULL.", step.script->GetDebugInfo().c_str());
break;
}
if (!target)
{
- sLog->outError("%s target object is NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s target object is NULL.", step.script->GetDebugInfo().c_str());
break;
}
@@ -549,7 +549,7 @@ void Map::ScriptsProcess()
{
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
{
- sLog->outError("%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
break;
}
@@ -562,7 +562,7 @@ void Map::ScriptsProcess()
{
if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
{
- sLog->outError("%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
}
@@ -570,7 +570,7 @@ void Map::ScriptsProcess()
}
else
{
- sLog->outError("%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow(),
target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
@@ -601,7 +601,7 @@ void Map::ScriptsProcess()
case SCRIPT_COMMAND_RESPAWN_GAMEOBJECT:
if (!step.script->RespawnGameobject.GOGuid)
{
- sLog->outError("%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str());
break;
}
@@ -611,7 +611,7 @@ void Map::ScriptsProcess()
GameObject* pGO = _FindGameObject(pSummoner, step.script->RespawnGameobject.GOGuid);
if (!pGO)
{
- sLog->outError("%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid);
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid);
break;
}
@@ -620,7 +620,7 @@ void Map::ScriptsProcess()
pGO->GetGoType() == GAMEOBJECT_TYPE_BUTTON ||
pGO->GetGoType() == GAMEOBJECT_TYPE_TRAP)
{
- sLog->outError("%s can not be used with gameobject of type %u (guid: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s can not be used with gameobject of type %u (guid: %u).",
step.script->GetDebugInfo().c_str(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid);
break;
}
@@ -643,7 +643,7 @@ void Map::ScriptsProcess()
if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
{
if (!step.script->TempSummonCreature.CreatureEntry)
- sLog->outError("%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str());
else
{
float x = step.script->TempSummonCreature.PosX;
@@ -652,7 +652,7 @@ void Map::ScriptsProcess()
float o = step.script->TempSummonCreature.Orientation;
if (!pSummoner->SummonCreature(step.script->TempSummonCreature.CreatureEntry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, step.script->TempSummonCreature.DespawnDelay))
- sLog->outError("%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry);
+ sLog->outError(LOG_FILTER_TSCR, "%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry);
}
}
break;
@@ -670,13 +670,13 @@ void Map::ScriptsProcess()
// Target must be GameObject.
if (!target)
{
- sLog->outError("%s target object is NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s target object is NULL.", step.script->GetDebugInfo().c_str());
break;
}
if (target->GetTypeId() != TYPEID_GAMEOBJECT)
{
- sLog->outError("%s target object is not gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s target object is not gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
}
@@ -700,7 +700,7 @@ void Map::ScriptsProcess()
// TODO: Allow gameobjects to be targets and casters
if (!source && !target)
{
- sLog->outError("%s source and target objects are NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source and target objects are NULL.", step.script->GetDebugInfo().c_str());
break;
}
@@ -733,13 +733,13 @@ void Map::ScriptsProcess()
if (!uSource || !uSource->isType(TYPEMASK_UNIT))
{
- sLog->outError("%s no source unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
+ sLog->outError(LOG_FILTER_TSCR, "%s no source unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
break;
}
if (!uTarget || !uTarget->isType(TYPEMASK_UNIT))
{
- sLog->outError("%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
+ sLog->outError(LOG_FILTER_TSCR, "%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
break;
}
@@ -799,7 +799,7 @@ void Map::ScriptsProcess()
if (Unit* unit = _GetScriptUnit(source, true, step.script))
{
if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID))
- sLog->outError("%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID);
+ sLog->outError(LOG_FILTER_TSCR, "%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID);
else
unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable);
}
@@ -809,12 +809,12 @@ void Map::ScriptsProcess()
{
if (!step.script->CallScript.CreatureEntry)
{
- sLog->outError("%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str());
break;
}
if (!step.script->CallScript.ScriptID)
{
- sLog->outError("%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str());
break;
}
@@ -840,7 +840,7 @@ void Map::ScriptsProcess()
if (!cTarget)
{
- sLog->outError("%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry);
+ sLog->outError(LOG_FILTER_TSCR, "%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry);
break;
}
@@ -849,7 +849,7 @@ void Map::ScriptsProcess()
//if no scriptmap present...
if (!datamap)
{
- sLog->outError("%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType);
+ sLog->outError(LOG_FILTER_TSCR, "%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType);
break;
}
@@ -863,7 +863,7 @@ void Map::ScriptsProcess()
if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
{
if (cSource->isDead())
- sLog->outError("%s creature is already dead (Entry: %u, GUID: %u)",
+ sLog->outError(LOG_FILTER_TSCR, "%s creature is already dead (Entry: %u, GUID: %u)",
step.script->GetDebugInfo().c_str(), cSource->GetEntry(), cSource->GetGUIDLow());
else
{
@@ -919,7 +919,7 @@ void Map::ScriptsProcess()
break;
default:
- sLog->outError("Unknown script command %s.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Unknown script command %s.", step.script->GetDebugInfo().c_str());
break;
}
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index f64d0953e86..fc56106ab6f 100755
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -46,19 +46,33 @@ void AddSC_SmartSCripts();
//Commands
void AddSC_account_commandscript();
void AddSC_achievement_commandscript();
+void AddSC_ban_commandscript();
+void AddSC_bf_commandscript();
+void AddSC_cast_commandscript();
+void AddSC_character_commandscript();
+void AddSC_cheat_commandscript();
void AddSC_debug_commandscript();
+void AddSC_disable_commandscript();
void AddSC_event_commandscript();
void AddSC_gm_commandscript();
void AddSC_go_commandscript();
void AddSC_gobject_commandscript();
+void AddSC_guild_commandscript();
void AddSC_honor_commandscript();
+void AddSC_instance_commandscript();
void AddSC_learn_commandscript();
+void AddSC_list_commandscript();
+void AddSC_lookup_commandscript();
+void AddSC_message_commandscript();
void AddSC_misc_commandscript();
void AddSC_modify_commandscript();
void AddSC_npc_commandscript();
void AddSC_quest_commandscript();
void AddSC_reload_commandscript();
+void AddSC_reset_commandscript();
+void AddSC_server_commandscript();
void AddSC_tele_commandscript();
+void AddSC_ticket_commandscript();
void AddSC_titles_commandscript();
void AddSC_wp_commandscript();
@@ -311,6 +325,7 @@ void AddSC_bug_trio();
void AddSC_boss_sartura();
void AddSC_boss_skeram();
void AddSC_boss_twinemperors();
+void AddSC_boss_ouro();
void AddSC_mob_anubisath_sentinel();
void AddSC_instance_temple_of_ahnqiraj();
void AddSC_wailing_caverns(); //Wailing caverns
@@ -496,6 +511,7 @@ void AddSC_howling_fjord();
void AddSC_icecrown();
void AddSC_sholazar_basin();
void AddSC_storm_peaks();
+void AddSC_wintergrasp();
void AddSC_zuldrak();
void AddSC_crystalsong_forest();
void AddSC_isle_of_conquest();
@@ -648,19 +664,33 @@ void AddCommandScripts()
{
AddSC_account_commandscript();
AddSC_achievement_commandscript();
+ AddSC_ban_commandscript();
+ AddSC_bf_commandscript();
+ AddSC_cast_commandscript();
+ AddSC_character_commandscript();
+ AddSC_cheat_commandscript();
AddSC_debug_commandscript();
+ AddSC_disable_commandscript();
AddSC_event_commandscript();
AddSC_gm_commandscript();
AddSC_go_commandscript();
AddSC_gobject_commandscript();
+ AddSC_guild_commandscript();
AddSC_honor_commandscript();
+ AddSC_instance_commandscript();
AddSC_learn_commandscript();
+ AddSC_lookup_commandscript();
+ AddSC_list_commandscript();
+ AddSC_message_commandscript();
AddSC_misc_commandscript();
AddSC_modify_commandscript();
AddSC_npc_commandscript();
AddSC_quest_commandscript();
AddSC_reload_commandscript();
+ AddSC_reset_commandscript();
+ AddSC_server_commandscript();
AddSC_tele_commandscript();
+ AddSC_ticket_commandscript();
AddSC_titles_commandscript();
AddSC_wp_commandscript();
}
@@ -924,6 +954,7 @@ void AddKalimdorScripts()
AddSC_boss_sartura();
AddSC_boss_skeram();
AddSC_boss_twinemperors();
+ AddSC_boss_ouro();
AddSC_mob_anubisath_sentinel();
AddSC_instance_temple_of_ahnqiraj();
AddSC_wailing_caverns(); //Wailing caverns
@@ -1200,6 +1231,7 @@ void AddNorthrendScripts()
AddSC_icecrown();
AddSC_sholazar_basin();
AddSC_storm_peaks();
+ AddSC_wintergrasp();
AddSC_zuldrak();
AddSC_crystalsong_forest();
AddSC_isle_of_conquest();
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 23d18e12097..47ce6c17b28 100755
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -16,7 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
#include "ScriptMgr.h"
#include "Config.h"
#include "DatabaseEnv.h"
@@ -27,6 +26,10 @@
#include "ScriptSystem.h"
#include "Transport.h"
#include "Vehicle.h"
+#include "SpellInfo.h"
+#include "SpellScript.h"
+#include "GossipDef.h"
+#include "CreatureAI.h"
// This is the global static registry of scripts.
template<class TScript>
@@ -51,7 +54,7 @@ class ScriptRegistry
{
if (it->second == script)
{
- sLog->outError("Script '%s' has same memory pointer as '%s'.",
+ sLog->outError(LOG_FILTER_TSCR, "Script '%s' has same memory pointer as '%s'.",
script->GetName().c_str(), it->second->GetName().c_str());
return;
@@ -87,7 +90,7 @@ class ScriptRegistry
else
{
// If the script is already assigned -> delete it!
- sLog->outError("Script '%s' already assigned with the same script name, so the script can't work.",
+ sLog->outError(LOG_FILTER_TSCR, "Script '%s' already assigned with the same script name, so the script can't work.",
script->GetName().c_str());
ASSERT(false); // Error that should be fixed ASAP.
@@ -97,7 +100,7 @@ class ScriptRegistry
{
// The script uses a script name from database, but isn't assigned to anything.
if (script->GetName().find("example") == std::string::npos && script->GetName().find("Smart") == std::string::npos)
- sLog->outErrorDb("Script named '%s' does not have a script name assigned in database.",
+ sLog->outError(LOG_FILTER_SQL, "Script named '%s' does not have a script name assigned in database.",
script->GetName().c_str());
}
}
@@ -159,13 +162,13 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
{
if (!pSource)
{
- sLog->outError("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i, invalid Source pointer.", iTextEntry);
return;
}
if (iTextEntry >= 0)
{
- sLog->outError("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
return;
}
@@ -173,18 +176,18 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (!pData)
{
- sLog->outError("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
return;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
+ sLog->outDebug(LOG_FILTER_TSCR, "DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
if (pData->uiSoundId)
{
if (sSoundEntriesStore.LookupEntry(pData->uiSoundId))
pSource->SendPlaySound(pData->uiSoundId, false);
else
- sLog->outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
}
if (pData->uiEmote)
@@ -192,7 +195,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote);
else
- sLog->outError("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId());
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId());
}
switch (pData->uiType)
@@ -214,7 +217,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (target && target->GetTypeId() == TYPEID_PLAYER)
pSource->MonsterWhisper(iTextEntry, target->GetGUID());
else
- sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
break;
}
@@ -223,7 +226,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (target && target->GetTypeId() == TYPEID_PLAYER)
pSource->MonsterWhisper(iTextEntry, target->GetGUID(), true);
else
- sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
break;
}
@@ -248,13 +251,12 @@ void ScriptMgr::Initialize()
LoadDatabase();
- sLog->outString("Loading C++ scripts");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading C++ scripts");
FillSpellSummary();
AddScripts();
- sLog->outString(">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
}
void ScriptMgr::Unload()
@@ -851,6 +853,14 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature)
return tmpscript->GetAI(creature);
}
+GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* gameobject)
+{
+ ASSERT(gameobject);
+
+ GET_SCRIPT_RET(GameObjectScript, gameobject->GetScriptId(), tmpscript, NULL);
+ return tmpscript->GetAI(gameobject);
+}
+
void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff)
{
ASSERT(creature);
@@ -970,14 +980,6 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd
return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
}
-GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go)
-{
- ASSERT(go);
-
- GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL);
- return tmpscript->GetAI(go);
-}
-
bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
{
ASSERT(player);
@@ -1440,7 +1442,7 @@ WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<Map>(mapId)
{
if (GetEntry() && !GetEntry()->IsWorldMap())
- sLog->outError("WorldMapScript for map %u is invalid.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "WorldMapScript for map %u is invalid.", mapId);
ScriptRegistry<WorldMapScript>::AddScript(this);
}
@@ -1449,7 +1451,7 @@ InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<InstanceMap>(mapId)
{
if (GetEntry() && !GetEntry()->IsDungeon())
- sLog->outError("InstanceMapScript for map %u is invalid.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "InstanceMapScript for map %u is invalid.", mapId);
ScriptRegistry<InstanceMapScript>::AddScript(this);
}
@@ -1458,7 +1460,7 @@ BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<BattlegroundMap>(mapId)
{
if (GetEntry() && !GetEntry()->IsBattleground())
- sLog->outError("BattlegroundMapScript for map %u is invalid.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "BattlegroundMapScript for map %u is invalid.", mapId);
ScriptRegistry<BattlegroundMapScript>::AddScript(this);
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index b3d445af0c6..270182509f9 100755
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -164,7 +164,7 @@ class ScriptObject
protected:
ScriptObject(const char* name)
- : _name(std::string(name))
+ : _name(name)
{
}
@@ -314,7 +314,7 @@ template<class TMap> class MapScript : public UpdatableScript<TMap>
: _mapEntry(sMapStore.LookupEntry(mapId))
{
if (!_mapEntry)
- sLog->outError("Invalid MapScript for %u; no such map ID.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "Invalid MapScript for %u; no such map ID.", mapId);
}
public:
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index c38d559372f..41b41b91808 100755
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -16,28 +16,27 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
#include "ScriptSystem.h"
#include "ObjectMgr.h"
#include "DatabaseEnv.h"
+#include "ScriptMgr.h"
ScriptPointVector const SystemMgr::_empty;
void SystemMgr::LoadScriptTexts()
{
- sLog->outString("TSCR: Loading Script Texts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts...");
LoadTrinityStrings("script_texts", TEXT_SOURCE_RANGE, 1+(TEXT_SOURCE_RANGE*2));
- sLog->outString("TSCR: Loading Script Texts additional data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts additional data...");
uint32 oldMSTime = getMSTime();
-
+
// 0 1 2 3
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts");
if (!result)
{
- sLog->outString(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty.");
return;
}
@@ -56,50 +55,48 @@ void SystemMgr::LoadScriptTexts()
if (iId >= 0)
{
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` is not a negative value.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` is not a negative value.", iId);
continue;
}
if (iId > TEXT_SOURCE_RANGE || iId <= TEXT_SOURCE_RANGE*2)
{
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId);
continue;
}
if (temp.uiSoundId)
{
if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
if (!GetLanguageDescByID(temp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
if (temp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
m_mTextDataMap[iId] = temp;
++uiCount;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime));
}
void SystemMgr::LoadScriptTextsCustom()
{
- sLog->outString("TSCR: Loading Custom Texts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts...");
LoadTrinityStrings("custom_texts", TEXT_SOURCE_RANGE*2, 1+(TEXT_SOURCE_RANGE*3));
- sLog->outString("TSCR: Loading Custom Texts additional data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts additional data...");
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts");
if (!result)
{
- sLog->outString(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.");
return;
}
@@ -118,35 +115,34 @@ void SystemMgr::LoadScriptTextsCustom()
if (iId >= 0)
{
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` is not a negative value.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` is not a negative value.", iId);
continue;
}
if (iId > TEXT_SOURCE_RANGE*2 || iId <= TEXT_SOURCE_RANGE*3)
{
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId);
continue;
}
if (temp.uiSoundId)
{
if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
if (!GetLanguageDescByID(temp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
if (temp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
m_mTextDataMap[iId] = temp;
++uiCount;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u additional Custom Texts data.", uiCount);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Custom Texts data.", uiCount);
}
void SystemMgr::LoadScriptWaypoints()
@@ -163,15 +159,14 @@ void SystemMgr::LoadScriptWaypoints()
if (result)
uiCreatureCount = result->GetRowCount();
- sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
// 0 1 2 3 4 5
result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
if (!result)
{
- sLog->outString(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
return;
}
@@ -194,18 +189,17 @@ void SystemMgr::LoadScriptWaypoints()
if (!pCInfo)
{
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
continue;
}
if (!pCInfo->ScriptID)
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
m_mPointMoveMap[uiEntry].push_back(temp);
++count;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h
index cf6332b22f2..4211a63b043 100644
--- a/src/server/game/Scripting/ScriptSystem.h
+++ b/src/server/game/Scripting/ScriptSystem.h
@@ -5,6 +5,7 @@
#ifndef SC_SYSTEM_H
#define SC_SYSTEM_H
+#include "ScriptMgr.h"
#include <ace/Singleton.h>
#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index 8fb8ea0298b..a229d3ed536 100755
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -1273,15 +1273,15 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x4DC*/ { "SMSG_PVP_QUEUE_STATS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x4DD*/ { "CMSG_SET_PAID_SERVICE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x4DE*/ { "SMSG_BATTLEFIELD_MGR_ENTRY_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
- /*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
+ /*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfEntryInviteResponse },
/*0x4E0*/ { "SMSG_BATTLEFIELD_MGR_ENTERED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x4E1*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
- /*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
+ /*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfQueueInviteResponse },
/*0x4E3*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x4E4*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x4E5*/ { "SMSG_BATTLEFIELD_MGR_EJECT_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x4E6*/ { "SMSG_BATTLEFIELD_MGR_EJECTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
- /*0x4E7*/ { "CMSG_BATTLEFIELD_MGR_EXIT_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
+ /*0x4E7*/ { "CMSG_BATTLEFIELD_MGR_EXIT_REQUEST", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfExitRequest },
/*0x4E8*/ { "SMSG_BATTLEFIELD_MGR_STATE_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x4E9*/ { "CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x4EA*/ { "CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h
index 65e7b3597ce..625ee88a853 100755
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -1356,7 +1356,7 @@ enum SessionStatus
STATUS_TRANSFER, // Player transferring to another map (_player != NULL, m_GUID == _player->GetGUID(), !inWorld())
STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, // _player != NULL or _player == NULL && m_playerRecentlyLogout && m_playerLogout, m_GUID store last _player guid)
STATUS_NEVER, // Opcode not accepted from client (deprecated or server side only)
- STATUS_UNHANDLED, // Opcode not handled yet
+ STATUS_UNHANDLED // Opcode not handled yet
};
enum PacketProcessing
@@ -1385,5 +1385,13 @@ inline const char* LookupOpcodeName(uint16 id)
return "Received unknown opcode, it's more than max!";
return opcodeTable[id].name;
}
+
+inline std::string GetOpcodeNameForLogging(uint16 opcode)
+{
+ std::ostringstream ss;
+ ss << '[' << LookupOpcodeName(opcode) << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]";
+ return ss.str();
+}
+
#endif
/// @}
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 81ec5495421..6a2c7e64446 100755
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -137,16 +137,29 @@ WorldSession::~WorldSession()
LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query
}
-void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
-{
- sLog->outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped",
- GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size);
-}
-
/// Get the player name
-char const* WorldSession::GetPlayerName() const
-{
- return GetPlayer() ? GetPlayer()->GetName() : "<none>";
+std::string WorldSession::GetPlayerName(bool simple /* = true */) const
+ {
+ std::string name = "[Player: ";
+ uint32 guidLow = 0;
+
+ if (Player* player = GetPlayer())
+ {
+ name.append(player->GetName());
+ guidLow = player->GetGUIDLow();
+ }
+ else
+ name.append("<none>");
+
+ if (!simple)
+ {
+ std::ostringstream ss;
+ ss << " (Guid: " << guidLow << ", Account: " << GetAccountId() << ")";
+ name.append(ss.str());
+ }
+
+ name.append("]");
+ return name;
}
/// Get player guid if available. Use for logging purposes only
@@ -186,8 +199,8 @@ void WorldSession::SendPacket(WorldPacket const* packet)
{
uint64 minTime = uint64(cur_time - lastTime);
uint64 fullTime = uint64(lastTime - firstTime);
- sLog->outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime));
- sLog->outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime));
+ sLog->outInfo(LOG_FILTER_GENERAL, "Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime);
lastTime = cur_time;
sendLastPacketCount = 1;
@@ -208,16 +221,15 @@ void WorldSession::QueuePacket(WorldPacket* new_packet)
/// Logging helper for unexpected opcodes
void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s",
- GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
- LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), status, reason);
+ sLog->outError(LOG_FILTER_OPCODES, "Received unexpected opcode %s Status: %s Reason: %s from %s",
+ GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), status, reason, GetPlayerName(false).c_str());
}
/// Logging helper for unexpected opcodes
void WorldSession::LogUnprocessedTail(WorldPacket* packet)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)",
- LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), uint32(packet->rpos()), uint32(packet->wpos()));
+ sLog->outError(LOG_FILTER_OPCODES, "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s",
+ uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerName(false).c_str());
packet->print_storage();
}
@@ -250,7 +262,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
{
if (packet->GetOpcode() >= NUM_MSG_TYPES)
{
- sLog->outError("SESSION: received non-existed opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
+ sLog->outError(LOG_FILTER_OPCODES, "Received non-existed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
+ , GetPlayerName(false).c_str());
sScriptMgr->OnUnknownPacketReceive(m_Socket, WorldPacket(*packet));
}
else
@@ -275,16 +288,15 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
deletePacket = false;
QueuePacket(packet);
//! Log
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s (0x%.4X) with with status STATUS_LOGGEDIN. "
- "Player is currently not in world yet.", opHandle.name, packet->GetOpcode());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. "
+ "Player is currently not in world yet.", GetOpcodeNameForLogging(packet->GetOpcode()).c_str());
}
-
}
else if (_player->IsInWorld())
{
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle.handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
}
// lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
@@ -298,7 +310,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
// not expected _player or must checked in packet handler
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle.handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
}
break;
@@ -311,7 +323,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
{
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle.handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
}
break;
@@ -330,30 +342,24 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle.handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
break;
case STATUS_NEVER:
- sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)",
- GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
- LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
+ sLog->outError(LOG_FILTER_OPCODES, "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
+ , GetPlayerName(false).c_str());
break;
case STATUS_UNHANDLED:
- sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)",
- GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
- LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
+ sLog->outDebug(LOG_FILTER_OPCODES, "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
+ , GetPlayerName(false).c_str());
break;
}
}
catch(ByteBufferException &)
{
- sLog->outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
- if (sLog->IsOutDebug())
- {
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
- packet->hexlike();
- }
+ packet->hexlike();
}
}
@@ -537,7 +543,7 @@ void WorldSession::LogoutPlayer(bool Save)
// e.g if he got disconnected during a transfer to another map
// calls to GetMap in this case may cause crashes
_player->CleanupsBeforeDelete();
- sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel());
if (Map* _map = _player->FindMap())
_map->RemovePlayerFromMap(_player, true);
@@ -610,22 +616,26 @@ const char *WorldSession::GetTrinityString(int32 entry) const
void WorldSession::Handle_NULL(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received unhandled opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_OPCODES, "Received unhandled opcode %s from %s"
+ , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
}
void WorldSession::Handle_EarlyProccess(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_OPCODES, "Received opcode %s that must be processed in WorldSocket::OnRead from %s"
+ , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
}
void WorldSession::Handle_ServerSide(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received server-side opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_OPCODES, "Received server-side opcode %s from %s"
+ , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
}
void WorldSession::Handle_Deprecated(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received deprecated opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_OPCODES, "Received deprecated opcode %s from %s"
+ , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
}
void WorldSession::SendAuthWaitQue(uint32 position)
@@ -668,13 +678,15 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask)
uint32 type = fields[0].GetUInt8();
if (type >= NUM_ACCOUNT_DATA_TYPES)
{
- sLog->outError("Table `%s` have invalid account data type (%u), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
+ sLog->outError(LOG_FILTER_GENERAL, "Table `%s` have invalid account data type (%u), ignore.",
+ mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
continue;
}
if ((mask & (1 << type)) == 0)
{
- sLog->outError("Table `%s` have non appropriate for table account data type (%u), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
+ sLog->outError(LOG_FILTER_GENERAL, "Table `%s` have non appropriate for table account data type (%u), ignore.",
+ mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
continue;
}
@@ -928,7 +940,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
if (size > 0xFFFFF)
{
- sLog->outError("WorldSession::ReadAddonsInfo addon info too big, size %u", size);
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSession::ReadAddonsInfo addon info too big, size %u", size);
return;
}
@@ -958,7 +970,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
addonInfo >> enabled >> crc >> unk1;
- sLog->outDetail("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
AddonInfo addon(addonName, enabled, crc, 2, true);
@@ -971,15 +983,15 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
match = false;
if (!match)
- sLog->outDetail("ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC);
else
- sLog->outDetail("ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC);
}
else
{
AddonMgr::SaveAddon(addon);
- sLog->outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC);
}
// TODO: Find out when to not use CRC/pubkey, and other possible states.
@@ -994,7 +1006,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under-read!");
}
else
- sLog->outError("Addon packet uncompress error!");
+ sLog->outError(LOG_FILTER_GENERAL, "Addon packet uncompress error!");
}
void WorldSession::SendAddonsInfo()
@@ -1033,7 +1045,7 @@ void WorldSession::SendAddonsInfo()
data << uint8(usepk);
if (usepk) // if CRC is wrong, add public key (client need it)
{
- sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey",
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey",
itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC);
data.append(addonPublicKey, sizeof(addonPublicKey));
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 00d5a8b5a86..bc9e6ac4298 100755
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -68,7 +68,7 @@ enum AccountDataType
GLOBAL_MACROS_CACHE = 4, // 0x10 g
PER_CHARACTER_MACROS_CACHE = 5, // 0x20 p
PER_CHARACTER_LAYOUT_CACHE = 6, // 0x40 p
- PER_CHARACTER_CHAT_CACHE = 7, // 0x80 p
+ PER_CHARACTER_CHAT_CACHE = 7 // 0x80 p
};
#define NUM_ACCOUNT_DATA_TYPES 8
@@ -125,6 +125,16 @@ enum PartyResult
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
};
+
+enum BFLeaveReason
+{
+ BF_LEAVE_REASON_CLOSE = 0x00000001,
+ //BF_LEAVE_REASON_UNK1 = 0x00000002, (not used)
+ //BF_LEAVE_REASON_UNK2 = 0x00000004, (not used)
+ BF_LEAVE_REASON_EXITED = 0x00000008,
+ BF_LEAVE_REASON_LOW_LEVEL = 0x00000010
+};
+
enum ChatRestrictionType
{
ERR_CHAT_RESTRICTED = 0,
@@ -223,8 +233,6 @@ class WorldSession
bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }
bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; }
- void SizeError(WorldPacket const& packet, uint32 size) const;
-
void ReadAddonsInfo(WorldPacket& data);
void SendAddonsInfo();
@@ -246,7 +254,7 @@ class WorldSession
AccountTypes GetSecurity() const { return _security; }
uint32 GetAccountId() const { return _accountId; }
Player* GetPlayer() const { return _player; }
- char const* GetPlayerName() const;
+ std::string GetPlayerName(bool simple = true) const;
uint32 GetGuidLow() const;
void SetSecurity(AccountTypes security) { _security = security; }
std::string const& GetRemoteAddress() { return m_Address; }
@@ -323,7 +331,7 @@ class WorldSession
void LoadTutorialsData();
void SendTutorialsData();
void SaveTutorialsData(SQLTransaction& trans);
- uint32 GetTutorialInt(uint8 index) { return m_Tutorials[index]; }
+ uint32 GetTutorialInt(uint8 index) const { return m_Tutorials[index]; }
void SetTutorialInt(uint8 index, uint32 value)
{
if (m_Tutorials[index] != value)
@@ -390,8 +398,8 @@ class WorldSession
}
// Recruit-A-Friend Handling
- uint32 GetRecruiterId() { return recruiterId; }
- bool IsARecruiter() { return isRecruiter; }
+ uint32 GetRecruiterId() const { return recruiterId; }
+ bool IsARecruiter() const { return isRecruiter; }
public: // opcodes handlers
@@ -786,7 +794,16 @@ class WorldSession
void HandleResetInstancesOpcode(WorldPacket& recv_data);
void HandleHearthAndResurrect(WorldPacket& recv_data);
void HandleInstanceLockResponse(WorldPacket& recvPacket);
- void HandleUpdateMissileTrajectory(WorldPacket& recvPacket);
+
+ // Battlefield
+ void SendBfInvitePlayerToWar(uint32 BattleId,uint32 ZoneId,uint32 time);
+ void SendBfInvitePlayerToQueue(uint32 BattleId);
+ void SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue = true, bool Full = false);
+ void SendBfEntered(uint32 BattleId);
+ void SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED);
+ void HandleBfQueueInviteResponse(WorldPacket &recv_data);
+ void HandleBfEntryInviteResponse(WorldPacket &recv_data);
+ void HandleBfExitRequest(WorldPacket &recv_data);
// Looking for Dungeon/Raid
void HandleLfgSetCommentOpcode(WorldPacket& recv_data);
@@ -914,6 +931,7 @@ class WorldSession
void HandleEjectPassenger(WorldPacket& data);
void HandleEnterPlayerVehicle(WorldPacket& data);
void HandleUpdateProjectilePosition(WorldPacket& recvPacket);
+ void HandleUpdateMissileTrajectory(WorldPacket& recvPacket);
private:
void InitializeQueryCallbackParameters();
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 74e414a43a9..92455f8edfe 100755
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -63,22 +63,22 @@ struct ServerPktHeader
if (isLargePacket())
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "initializing large server to client packet. Size: %u, cmd: %u", size, cmd);
- header[headerIndex++] = 0x80|(0xFF &(size>>16));
+ header[headerIndex++] = 0x80 | (0xFF & (size >> 16));
}
- header[headerIndex++] = 0xFF &(size>>8);
- header[headerIndex++] = 0xFF &size;
+ header[headerIndex++] = 0xFF &(size >> 8);
+ header[headerIndex++] = 0xFF & size;
header[headerIndex++] = 0xFF & cmd;
- header[headerIndex++] = 0xFF & (cmd>>8);
+ header[headerIndex++] = 0xFF & (cmd >> 8);
}
uint8 getHeaderLength()
{
// cmd = 2 bytes, size= 2||3bytes
- return 2+(isLargePacket()?3:2);
+ return 2 + (isLargePacket() ? 3 : 2);
}
- bool isLargePacket()
+ bool isLargePacket() const
{
return size > 0x7FFF;
}
@@ -107,8 +107,8 @@ m_Seed(static_cast<uint32> (rand32()))
{
reference_counting_policy().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
- msg_queue()->high_water_mark(8*1024*1024);
- msg_queue()->low_water_mark(8*1024*1024);
+ msg_queue()->high_water_mark(8 * 1024 * 1024);
+ msg_queue()->low_water_mark(8 * 1024 * 1024);
}
WorldSocket::~WorldSocket (void)
@@ -193,7 +193,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct)
if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
{
- sLog->outError("WorldSocket::SendPacket enqueue_tail failed");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::SendPacket enqueue_tail failed");
mb->release();
return -1;
}
@@ -236,7 +236,7 @@ int WorldSocket::open (void *a)
if (peer().get_remote_addr(remote_addr) == -1)
{
- sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
return -1;
}
@@ -261,7 +261,7 @@ int WorldSocket::open (void *a)
// Register with ACE Reactor
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
{
- sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
return -1;
}
@@ -297,14 +297,14 @@ int WorldSocket::handle_input (ACE_HANDLE)
return Update(); // interesting line, isn't it ?
}
- sLog->outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
errno = ECONNRESET;
return -1;
}
case 0:
{
- sLog->outStaticDebug("WorldSocket::handle_input: Peer has closed connection");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer has closed connection");
errno = ECONNRESET;
return -1;
@@ -373,7 +373,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
if (msg_queue()->dequeue_head(mblk, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
{
- sLog->outError("WorldSocket::handle_output_queue dequeue_head");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue dequeue_head");
return -1;
}
@@ -408,7 +408,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
if (msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero) == -1)
{
- sLog->outError("WorldSocket::handle_output_queue enqueue_head");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue enqueue_head");
mblk->release();
return -1;
}
@@ -480,7 +480,7 @@ int WorldSocket::handle_input_header (void)
if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240))
{
Player* _player = m_Session ? m_Session->GetPlayer() : NULL;
- sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
m_Session ? m_Session->GetAccountId() : 0,
_player ? _player->GetGUIDLow() : 0,
_player ? _player->GetName() : "<none>",
@@ -586,7 +586,7 @@ int WorldSocket::handle_input_missing_data (void)
// hope this is not hack, as proper m_RecvWPct is asserted around
if (!m_RecvWPct)
{
- sLog->outError("Forcing close on input m_RecvWPct = NULL");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Forcing close on input m_RecvWPct = NULL");
errno = EINVAL;
return -1;
}
@@ -632,7 +632,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g)
(this, ACE_Event_Handler::WRITE_MASK) == -1)
{
// would be good to store errno from reactor with errno guard
- sLog->outError("WorldSocket::cancel_wakeup_output");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::cancel_wakeup_output");
return -1;
}
@@ -651,7 +651,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g)
if (reactor()->schedule_wakeup
(this, ACE_Event_Handler::WRITE_MASK) == -1)
{
- sLog->outError("WorldSocket::schedule_wakeup_output");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::schedule_wakeup_output");
return -1;
}
@@ -683,58 +683,51 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
case CMSG_AUTH_SESSION:
if (m_Session)
{
- sLog->outError("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", m_Session->GetPlayerName(false).c_str());
return -1;
}
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
return HandleAuthSession (*new_pct);
case CMSG_KEEP_ALIVE:
- sLog->outStaticDebug ("CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size()));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", GetOpcodeNameForLogging(opcode).c_str());
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
return 0;
default:
{
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
- if (m_Session != NULL)
+ if (!m_Session)
{
- // Our Idle timer will reset on any non PING opcodes.
- // Catches people idling on the login screen and any lingering ingame connections.
- m_Session->ResetTimeOutTime();
-
- // OK, give the packet to WorldSession
- aptr.release();
- // WARNINIG here we call it with locks held.
- // Its possible to cause deadlock if QueuePacket calls back
- m_Session->QueuePacket (new_pct);
- return 0;
- }
- else
- {
- sLog->outError("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
+ sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
return -1;
}
+
+ // Our Idle timer will reset on any non PING opcodes.
+ // Catches people idling on the login screen and any lingering ingame connections.
+ m_Session->ResetTimeOutTime();
+
+ // OK, give the packet to WorldSession
+ aptr.release();
+ // WARNINIG here we call it with locks held.
+ // Its possible to cause deadlock if QueuePacket calls back
+ m_Session->QueuePacket(new_pct);
+ return 0;
}
}
}
catch (ByteBufferException &)
{
- sLog->outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
- opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
- if (sLog->IsOutDebug())
- {
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
- new_pct->hexlike();
- }
-
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
+ opcode, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1);
+ new_pct->hexlike();
return -1;
}
ACE_NOTREACHED (return 0);
}
-int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
+int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
{
// NOTE: ATM the socket is singlethread, have this in mind ...
uint8 digest[20];
@@ -758,7 +751,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
packet << uint8(AUTH_REJECT);
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
return -1;
}
@@ -772,7 +765,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
recvPacket >> unk4;
recvPacket.read(digest, 20);
- sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
BuiltNumberClient,
unk2,
account.c_str(),
@@ -794,7 +787,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
return -1;
}
@@ -814,7 +807,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free()
const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free()
- sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s",
sStr,
vStr);
@@ -830,7 +823,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
packet << uint8 (AUTH_FAILED);
SendPacket(packet);
- sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
return -1;
}
}
@@ -894,7 +887,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
packet << uint8 (AUTH_BANNED);
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
return -1;
}
@@ -908,7 +901,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
SendPacket(packet);
- sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
return -1;
}
@@ -932,11 +925,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str());
return -1;
}
- sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
account.c_str(),
address.c_str());
@@ -1012,12 +1005,8 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
if (m_Session && AccountMgr::IsPlayerAccount(m_Session->GetSecurity()))
{
- Player* _player = m_Session->GetPlayer();
- sLog->outError("WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",
- m_Session->GetAccountId(),
- _player ? _player->GetGUIDLow() : 0,
- _player ? _player->GetName() : "<none>",
- GetRemoteAddress().c_str());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)",
+ m_Session->GetPlayerName(false).c_str(), GetRemoteAddress().c_str());
return -1;
}
@@ -1035,7 +1024,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
m_Session->SetLatency (latency);
else
{
- sLog->outError("WorldSocket::HandlePing: peer sent CMSG_PING, "
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: peer sent CMSG_PING, "
"but is not authenticated or got recently kicked, "
" address = %s",
GetRemoteAddress().c_str());
diff --git a/src/server/game/Server/WorldSocketAcceptor.h b/src/server/game/Server/WorldSocketAcceptor.h
index a16c5c2189f..d4ff7823b02 100644
--- a/src/server/game/Server/WorldSocketAcceptor.h
+++ b/src/server/game/Server/WorldSocketAcceptor.h
@@ -44,7 +44,7 @@ protected:
virtual int handle_timeout(const ACE_Time_Value& /*current_time*/, const void* /*act = 0*/)
{
- sLog->outBasic("Resuming acceptor");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Resuming acceptor");
reactor()->cancel_timer(this, 1);
return reactor()->register_handler(this, ACE_Event_Handler::ACCEPT_MASK);
}
@@ -54,7 +54,7 @@ protected:
#if defined(ENFILE) && defined(EMFILE)
if (errno == ENFILE || errno == EMFILE)
{
- sLog->outError("Out of file descriptors, suspending incoming connections for 10 seconds");
+ sLog->outError(LOG_FILTER_GENERAL, "Out of file descriptors, suspending incoming connections for 10 seconds");
reactor()->remove_handler(this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
reactor()->schedule_timer(this, NULL, ACE_Time_Value(10));
}
diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp
index d357651a5bf..ed960258c41 100755
--- a/src/server/game/Server/WorldSocketMgr.cpp
+++ b/src/server/game/Server/WorldSocketMgr.cpp
@@ -155,7 +155,7 @@ class ReactorRunnable : protected ACE_Task_Base
virtual int svc()
{
- sLog->outStaticDebug ("Network Thread Starting");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Network Thread Starting");
ACE_ASSERT (m_Reactor);
@@ -192,7 +192,7 @@ class ReactorRunnable : protected ACE_Task_Base
}
}
- sLog->outStaticDebug ("Network Thread exits");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Network Thread exits");
return 0;
}
@@ -236,7 +236,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (num_threads <= 0)
{
- sLog->outError("Network.Threads is wrong in your config file");
+ sLog->outError(LOG_FILTER_GENERAL, "Network.Threads is wrong in your config file");
return -1;
}
@@ -244,7 +244,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
m_NetThreads = new ReactorRunnable[m_NetThreadsCount];
- sLog->outBasic ("Max allowed socket connections %d", ACE::max_handles());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Max allowed socket connections %d", ACE::max_handles());
// -1 means use default
m_SockOutKBuff = ConfigMgr::GetIntDefault ("Network.OutKBuff", -1);
@@ -253,7 +253,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (m_SockOutUBuff <= 0)
{
- sLog->outError("Network.OutUBuff is wrong in your config file");
+ sLog->outError(LOG_FILTER_GENERAL, "Network.OutUBuff is wrong in your config file");
return -1;
}
@@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (m_Acceptor->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1)
{
- sLog->outError("Failed to open acceptor, check if the port is free");
+ sLog->outError(LOG_FILTER_GENERAL, "Failed to open acceptor, check if the port is free");
return -1;
}
@@ -276,7 +276,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
int
WorldSocketMgr::StartNetwork (ACE_UINT16 port, const char* address)
{
- if (!sLog->IsOutDebug())
+ if (!sLog->ShouldLog(LOG_FILTER_GENERAL, LOG_LEVEL_DEBUG))
ACE_Log_Msg::instance()->priority_mask (LM_ERROR, ACE_Log_Msg::PROCESS);
if (StartReactiveIO(port, address) == -1)
@@ -327,7 +327,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock)
(void*) & m_SockOutKBuff,
sizeof (int)) == -1 && errno != ENOTSUP)
{
- sLog->outError("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF");
return -1;
}
}
@@ -342,7 +342,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock)
(void*)&ndoption,
sizeof (int)) == -1)
{
- sLog->outError("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno));
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno));
return -1;
}
}
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index e314fab07be..3eac3d34fd2 100755
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -55,8 +55,8 @@ void LoadSkillDiscoveryTable()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
+
return;
}
@@ -89,7 +89,7 @@ void LoadSkillDiscoveryTable()
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
- sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
reportedReqSpells.insert(absReqSkillOrSpell);
}
continue;
@@ -102,7 +102,7 @@ void LoadSkillDiscoveryTable()
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
- sLog->outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
" and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
absReqSkillOrSpell, spellId);
reportedReqSpells.insert(absReqSkillOrSpell);
@@ -118,7 +118,7 @@ void LoadSkillDiscoveryTable()
if (bounds.first == bounds.second)
{
- sLog->outErrorDb("Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
continue;
}
@@ -127,7 +127,7 @@ void LoadSkillDiscoveryTable()
}
else
{
- sLog->outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
continue;
}
@@ -136,7 +136,7 @@ void LoadSkillDiscoveryTable()
while (result->NextRow());
if (!ssNonDiscoverableEntries.str().empty())
- sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
+ sLog->outError(LOG_FILTER_SQL, "Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
// report about empty data for explicit discovery spells
for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
@@ -150,11 +150,11 @@ void LoadSkillDiscoveryTable()
continue;
if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())
- sLog->outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
}
- sLog->outString(">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp
index 3bb435145f1..9e2648dc943 100755
--- a/src/server/game/Skills/SkillExtraItems.cpp
+++ b/src/server/game/Skills/SkillExtraItems.cpp
@@ -60,8 +60,8 @@ void LoadSkillExtraItemTable()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
+
return;
}
@@ -75,28 +75,28 @@ void LoadSkillExtraItemTable()
if (!sSpellMgr->GetSpellInfo(spellId))
{
- sLog->outError("Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
continue;
}
uint32 requiredSpecialization = fields[1].GetUInt32();
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
{
- sLog->outError("Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
continue;
}
float additionalCreateChance = fields[2].GetFloat();
if (additionalCreateChance <= 0.0f)
{
- sLog->outError("Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
continue;
}
uint8 additionalMaxNum = fields[3].GetUInt8();
if (!additionalMaxNum)
{
- sLog->outError("Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
continue;
}
@@ -110,8 +110,8 @@ void LoadSkillExtraItemTable()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax)
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index ddb230d6773..6902dd60c80 100755
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -47,14 +47,14 @@ enum AuraEffectHandleModes
AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK = (AURA_EFFECT_HANDLE_SEND_FOR_CLIENT | AURA_EFFECT_HANDLE_REAL), // any case handler need to send packet
AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK = (AURA_EFFECT_HANDLE_CHANGE_AMOUNT | AURA_EFFECT_HANDLE_REAL), // any case handler applies effect depending on amount
AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK = (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK),
- AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK = (AURA_EFFECT_HANDLE_REAPPLY | AURA_EFFECT_HANDLE_REAL),
+ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK = (AURA_EFFECT_HANDLE_REAPPLY | AURA_EFFECT_HANDLE_REAL)
};
//m_schoolAbsorb
enum DAMAGE_ABSORB_TYPE
{
ALL_DAMAGE_ABSORB = -2,
- ONLY_MAGIC_ABSORB = -1,
+ ONLY_MAGIC_ABSORB = -1
};
enum AuraType
@@ -382,6 +382,7 @@ enum AuraType
enum AuraObjectType
{
UNIT_AURA_TYPE,
- DYNOBJ_AURA_TYPE,
+ DYNOBJ_AURA_TYPE
};
+
#endif
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 849a7136ea8..29dcde9d616 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -36,6 +36,8 @@
#include "CellImpl.h"
#include "ScriptMgr.h"
#include "Vehicle.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
class Aura;
//
@@ -627,7 +629,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
uint8 cp = caster->ToPlayer()->GetComboPoints();
// Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs
- if (AuraEffect const* aurEff = caster->GetAuraEffect(34241, 0))
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(34241, EFFECT_0))
+ amount += cp * aurEff->GetAmount();
+ // Idol of Worship. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs
+ else if (AuraEffect const* aurEff = caster->GetAuraEffect(60774, EFFECT_0))
amount += cp * aurEff->GetAmount();
amount += uint32(CalculatePctU(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp));
@@ -781,33 +786,18 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load)
m_amplitude = 1 * IN_MILLISECONDS;
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_HEAL:
- case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_OBS_MOD_HEALTH:
+ case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
+ case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
case SPELL_AURA_PERIODIC_MANA_LEECH:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_POWER_BURN:
- m_isPeriodic = true;
- break;
- case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
- if (GetId() == 51912)
- m_amplitude = 3000;
- m_isPeriodic = true;
- break;
- case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
case SPELL_AURA_PERIODIC_DUMMY:
+ case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
m_isPeriodic = true;
break;
- case SPELL_AURA_DUMMY:
- // Haunting Spirits - perdiodic trigger demon
- if (GetId() == 7057)
- {
- m_isPeriodic = true;
- m_amplitude = irand (0, 60) + 30;
- m_amplitude *= IN_MILLISECONDS;
- }
- break;
default:
break;
}
@@ -873,21 +863,6 @@ void AuraEffect::CalculateSpellMod()
case SPELL_AURA_DUMMY:
switch (GetSpellInfo()->SpellFamilyName)
{
- case SPELLFAMILY_PRIEST:
- // Pain and Suffering
- if (m_spellInfo->SpellIconID == 2874)
- {
- if (!m_spellmod)
- {
- m_spellmod = new SpellModifier(GetBase());
- m_spellmod->op = SPELLMOD_DOT;
- m_spellmod->type = SPELLMOD_PCT;
- m_spellmod->spellId = GetId();
- m_spellmod->mask[1] = 0x00002000;
- }
- m_spellmod->value = GetAmount();
- }
- break;
case SPELLFAMILY_DRUID:
switch (GetId())
{
@@ -1103,14 +1078,6 @@ void AuraEffect::UpdatePeriodic(Unit* caster)
{
switch (GetAuraType())
{
- case SPELL_AURA_DUMMY:
- // Haunting Spirits
- if (GetId() == 7057)
- {
- m_amplitude = irand (0, 60) + 30;
- m_amplitude *= IN_MILLISECONDS;
- }
- break;
case SPELL_AURA_PERIODIC_DUMMY:
switch (GetSpellInfo()->SpellFamilyName)
{
@@ -1142,7 +1109,7 @@ void AuraEffect::UpdatePeriodic(Unit* caster)
if (aurEff->GetAuraType() != SPELL_AURA_MOD_POWER_REGEN)
{
m_isPeriodic = false;
- sLog->outError("Aura %d structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura %d structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
}
else
{
@@ -1312,11 +1279,6 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const
case SPELL_AURA_POWER_BURN:
HandlePeriodicPowerBurnAuraTick(target, caster);
break;
- case SPELL_AURA_DUMMY:
- // Haunting Spirits
- if (GetId() == 7057)
- target->CastSpell((Unit*)NULL, GetAmount(), true);
- break;
default:
break;
}
@@ -1973,7 +1935,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
case FORM_SPIRITOFREDEMPTION: // 0x20
break;
default:
- sLog->outError("Auras: Unknown Shapeshift Type: %u", GetMiscValue());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Auras: Unknown Shapeshift Type: %u", GetMiscValue());
}
modelid = target->GetModelForForm(form);
@@ -2328,7 +2290,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
if (!ci)
{
target->SetDisplayId(16358); // pig pink ^_^
- sLog->outError("Auras: unknown creature id = %d (only need its modelid) From Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Auras: unknown creature id = %d (only need its modelid) From Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
}
else
{
@@ -2847,7 +2809,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry);
if (!ci)
{
- sLog->outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue());
+ sLog->outError(LOG_FILTER_SQL, "AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue());
return;
}
@@ -2996,13 +2958,13 @@ void AuraEffect::HandleForceMoveForward(AuraApplication const* aurApp, uint8 mod
Unit* target = aurApp->GetTarget();
if (apply)
- target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
+ target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT);
else
{
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
if (target->HasAuraType(GetAuraType()))
return;
- target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
+ target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT);
}
}
@@ -3369,7 +3331,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
Unit* target = aurApp->GetTarget();
std::list <AuraType> aura_immunity_list;
- uint32 mechanic_immunity_list;
+ uint32 mechanic_immunity_list = 0;
int32 miscVal = GetMiscValue();
switch (miscVal)
@@ -3399,7 +3361,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3431,7 +3392,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3469,7 +3429,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3513,7 +3472,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3548,7 +3506,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3576,7 +3533,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
break;
}
- if (aura_immunity_list.size() == 0)
+ if (aura_immunity_list.empty())
{
if (miscVal & (1<<10))
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
@@ -3928,7 +3885,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bo
if (GetMiscValue() < -2 || GetMiscValue() > 4)
{
- sLog->outError("WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
return;
}
@@ -3954,7 +3911,7 @@ void AuraEffect::HandleModPercentStat(AuraApplication const* aurApp, uint8 mode,
if (GetMiscValue() < -1 || GetMiscValue() > 4)
{
- sLog->outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
return;
}
@@ -4052,7 +4009,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
if (GetMiscValue() < -1 || GetMiscValue() > 4)
{
- sLog->outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
return;
}
@@ -4090,7 +4047,7 @@ void AuraEffect::HandleAuraModResistenceOfStatPercent(AuraApplication const* aur
{
// support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
// and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
- sLog->outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
return;
}
@@ -5011,38 +4968,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget()))
target->CastSpell(spellTarget, 51699, true);
break;
- case 28832: // Mark of Korth'azz
- case 28833: // Mark of Blaumeux
- case 28834: // Mark of Rivendare
- case 28835: // Mark of Zeliek
- if (caster) // actually we can also use cast(this, originalcasterguid)
- {
- int32 damage;
- switch (GetBase()->GetStackAmount())
- {
- case 1: damage = 0; break;
- case 2: damage = 500; break;
- case 3: damage = 1000; break;
- case 4: damage = 1500; break;
- case 5: damage = 4000; break;
- case 6: damage = 12000; break;
- default:damage = 20000 + 1000 * (GetBase()->GetStackAmount() - 7); break;
- }
- if (damage)
- caster->CastCustomSpell(28836, SPELLVALUE_BASE_POINT0, damage, target);
- }
- break;
- case 63322: // Saronite Vapors
- {
- if (caster)
- {
- int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount
- int32 damage = mana * 2; // damage
- caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true);
- caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true);
- }
- break;
- }
case 71563:
if (Aura* newAura = target->AddAura(71564, target))
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
@@ -5093,8 +5018,12 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 2584: // Waiting to Resurrect
// Waiting to resurrect spell cancel, we must remove player from resurrect queue
if (target->GetTypeId() == TYPEID_PLAYER)
+ {
if (Battleground* bg = target->ToPlayer()->GetBattleground())
bg->RemovePlayerFromResurrectQueue(target->GetGUID());
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
+ bf->RemovePlayerFromResurrectQueue(target->GetGUID());
+ }
break;
case 36730: // Flame Strike
{
@@ -5113,7 +5042,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
}
case 43681: // Inactive
{
- if (!target || target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;
if (target->GetMap()->IsBattleground())
@@ -5131,62 +5060,12 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this);
break;
case 58600: // Restricted Flight Area
+ case 58730: // Restricted Flight Area
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 58601, true);
break;
}
break;
- case SPELLFAMILY_MAGE:
- // Living Bomb
- if (m_spellInfo->SpellFamilyFlags[1] & 0x20000)
- {
- AuraRemoveMode removeMode = aurApp->GetRemoveMode();
- if (caster && (removeMode == AURA_REMOVE_BY_ENEMY_SPELL || removeMode == AURA_REMOVE_BY_EXPIRE))
- caster->CastSpell(target, GetAmount(), true);
- }
- break;
- case SPELLFAMILY_PRIEST:
- // Vampiric Touch
- if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0)
- if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
- {
- int32 damage = aurEff->GetAmount() * 8;
- // backfire damage
- target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID());
- }
- break;
- case SPELLFAMILY_WARLOCK:
- // Haunt
- if (m_spellInfo->SpellFamilyFlags[1] & 0x40000)
- if (caster)
- target->CastCustomSpell(caster, 48210, &m_amount, 0, 0, true, NULL, this, GetCasterGUID());
- break;
- case SPELLFAMILY_DRUID:
- // Lifebloom
- if (GetSpellInfo()->SpellFamilyFlags[1] & 0x10)
- {
- // Final heal only on duration end
- if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
- return;
-
- // final heal
- int32 stack = GetBase()->GetStackAmount();
- int32 heal = m_amount;
- if (caster)
- {
- heal = caster->SpellHealingBonusDone(target, GetSpellInfo(), heal, HEAL, stack);
- heal = target->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, HEAL, stack);
- }
- target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID());
-
- // restore mana
- if (caster)
- {
- int32 returnmana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
- caster->CastCustomSpell(caster, 64372, &returnmana, NULL, NULL, true, NULL, this, GetCasterGUID());
- }
- }
- break;
case SPELLFAMILY_DEATHKNIGHT:
// Summon Gargoyle (Dismiss Gargoyle at remove)
if (GetId() == 61777)
@@ -5194,7 +5073,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
case SPELLFAMILY_ROGUE:
// Tricks of the trade
- switch(GetId())
+ switch (GetId())
{
case 59628: //Tricks of the trade buff on rogue (6sec duration)
target->SetReducedThreatPercent(0,0);
@@ -5262,48 +5141,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
target->SetEntry(apply ? 17654 : 17326);
break;
}
- //Summon Fire Elemental
- case 40133:
- {
- if (!caster)
- break;
-
- Unit* owner = caster->GetOwner();
- if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- {
- if (apply)
- owner->CastSpell(owner, 8985, true);
- else
- owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
- }
- break;
- }
- //Summon Earth Elemental
- case 40132 :
- {
- if (!caster)
- break;
-
- Unit* owner = caster->GetOwner();
- if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- {
- if (apply)
- owner->CastSpell(owner, 19704, true);
- else
- owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
- }
- break;
- }
- case 57723: // Exhaustion
- case 57724: // Sated
- {
- switch (GetId())
- {
- case 57723: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 32182, apply); break; // Heroism
- case 57724: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 2825, apply); break; // Bloodlust
- }
- break;
- }
case 57819: // Argent Champion
case 57820: // Ebon Champion
case 57821: // Champion of the Kirin Tor
@@ -5396,69 +5233,14 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
}
case SPELLFAMILY_DRUID:
{
- if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK))
- break;
- switch (GetId())
- {
- case 52610: // Savage Roar
- {
- uint32 spellId = 62071;
- if (apply)
- {
- if (target->GetShapeshiftForm() != FORM_CAT)
- break;
-
- target->CastSpell(target, spellId, true, NULL, NULL, GetCasterGUID());
- break;
- }
- target->RemoveAurasDueToSpell(spellId);
- break;
- }
- case 61336: // Survival Instincts
- {
- if (!(mode & AURA_EFFECT_HANDLE_REAL))
- break;
-
- if (apply)
- {
- if (!target->IsInFeralForm())
- break;
-
- int32 bp0 = int32(target->CountPctFromMaxHealth(GetAmount()));
- target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true);
- }
- else
- target->RemoveAurasDueToSpell(50322);
- break;
- }
- }
- // Predatory Strikes
- if (target->GetTypeId() == TYPEID_PLAYER && GetSpellInfo()->SpellIconID == 1563)
- {
- target->ToPlayer()->UpdateAttackPowerAndDamage();
- }
+ //if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ //break;
break;
}
case SPELLFAMILY_SHAMAN:
{
- if (!(mode & AURA_EFFECT_HANDLE_REAL))
- break;
- // Sentry Totem
- if (GetId() == 6495 && caster && caster->GetTypeId() == TYPEID_PLAYER)
- {
- if (apply)
- {
- if (uint64 guid = caster->m_SummonSlot[4])
- {
- if (Creature* totem = caster->GetMap()->GetCreature(guid))
- if (totem->isTotem())
- caster->ToPlayer()->CastSpell(totem, 6277, true);
- }
- }
- else
- caster->ToPlayer()->StopCastingBindSight();
- return;
- }
+ //if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ //break;
break;
}
case SPELLFAMILY_PALADIN:
@@ -6088,14 +5870,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
if (caster)
caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, int32(target->CountPctFromMaxHealth(21)), target, true, NULL, this);
return;
- // Detonate Mana
- case 27819:
- if (int32 mana = (int32)(target->GetMaxPower(POWER_MANA) / 10))
- {
- mana = target->ModifyPower(POWER_MANA, -mana);
- target->CastCustomSpell(27820, SPELLVALUE_BASE_POINT0, -mana*10, target, true, NULL, this);
- }
- return;
// Inoculate Nestlewood Owlkin
case 29528:
if (target->GetTypeId() != TYPEID_UNIT) // prevent error reports in case ignored player target
@@ -6467,7 +6241,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo());
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb);
caster->DealDamageMods(target, damage, &absorb);
@@ -6537,7 +6311,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
if (target->GetHealth() < damage)
damage = uint32(target->GetHealth());
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb);
caster->SendSpellNonMeleeDamageLog(target, GetId(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
@@ -6669,7 +6443,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
if (crit)
damage = caster->SpellCriticalHealingBonus(m_spellInfo, damage, target);
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId());
uint32 absorb = 0;
@@ -6738,7 +6512,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
drainAmount = maxmana;
}
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId());
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
@@ -6760,33 +6534,6 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
}
- // spell-specific code
- switch (GetId())
- {
- case 31447: // Mark of Kaz'rogal
- if (target->GetPower(powerType) == 0)
- {
- target->CastSpell(target, 31463, true, 0, this);
- // Remove aura
- GetBase()->SetDuration(0);
- }
- break;
- case 32960: // Mark of Kazzak
- {
- int32 modifier = int32(target->GetPower(powerType) * 0.05f);
- target->ModifyPower(powerType, -modifier);
-
- if (target->GetPower(powerType) == 0)
- {
- target->CastSpell(target, 32961, true, 0, this);
- // Remove aura
- GetBase()->SetDuration(0);
- }
- break;
- }
- default:
- break;
- }
// Drain Mana
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK
&& m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
@@ -6826,7 +6573,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
// ignore negative values (can be result apply spellmods to aura damage
uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) /100;
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId());
SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
@@ -6861,7 +6608,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
target->SendPeriodicAuraLog(&pInfo);
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId());
int32 gain = target->ModifyPower(powerType, amount);
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 4dda1c731a7..4060ee42206 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -424,8 +424,8 @@ void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraA
// TODO: Figure out why this happens
if (itr == m_applications.end())
{
- sLog->outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
- target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellInfo()->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
+ target->GetGUIDLow(), caster ? caster->GetGUIDLow() : 0, auraApp->GetBase()->GetSpellInfo()->Id);
ASSERT(false);
}
@@ -566,7 +566,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
if (!GetOwner()->IsSelfOrInSameMap(itr->first))
{
//TODO: There is a crash caused by shadowfiend load addon
- sLog->outCrash("Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
+ sLog->outFatal(LOG_FILTER_SPELLS_AURAS, "Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
GetOwner()->GetName(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1),
itr->first->GetName(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1));
ASSERT(false);
@@ -766,7 +766,7 @@ void Aura::SetCharges(uint8 charges)
uint8 Aura::CalcMaxCharges(Unit* caster) const
{
- uint8 maxProcCharges = m_spellInfo->ProcCharges;
+ uint32 maxProcCharges = m_spellInfo->ProcCharges;
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()))
maxProcCharges = procEntry->charges;
@@ -1181,7 +1181,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 31571: spellId = 57529; break;
case 31572: spellId = 57531; break;
default:
- sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId());
}
if (spellId)
caster->CastSpell(caster, spellId, true);
@@ -1221,19 +1221,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0));
}
}
- // Renew
- else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000040 && GetEffect(0))
- {
- // Empowered Renew
- if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, 1))
- {
- uint32 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL);
- damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, HEAL);
-
- int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100;
- caster->CastCustomSpell(target, 63544, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
- }
- }
// Power Word: Shield
else if (m_spellInfo->SpellFamilyFlags[0] & 0x1 && m_spellInfo->SpellFamilyFlags[2] & 0x400 && GetEffect(0))
{
@@ -1290,7 +1277,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 49631: spellId = 50509; break;
case 49032: spellId = 50508; break;
default:
- sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId());
}
caster->CastSpell(target, spellId, true, 0, GetEffect(0));
}
@@ -1386,17 +1373,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_WARLOCK:
if (!caster)
break;
- // Curse of Doom
- if (GetSpellInfo()->SpellFamilyFlags[1] & 0x02)
- {
- if (removeMode == AURA_REMOVE_BY_DEATH)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
- caster->CastSpell(target, 18662, true, NULL, GetEffect(0));
- }
- }
// Improved Fear
- else if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
+ if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
{
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_WARLOCK, 98, 0))
{
@@ -1406,7 +1384,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 53759: spellId = 60947; break;
case 53754: spellId = 60946; break;
default:
- sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Improved Fear (%d) found", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Improved Fear (%d) found", aurEff->GetId());
}
if (spellId)
caster->CastSpell(target, spellId, true);
@@ -1436,10 +1414,16 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (caster->GetTypeId() == TYPEID_PLAYER)
{
if (caster->ToPlayer()->HasSpellCooldown(aura->GetId()))
- break;
- // and add if needed
- caster->ToPlayer()->AddSpellCooldown(aura->GetId(), 0, uint32(time(NULL) + 12));
+ {
+ // This additional check is needed to add a minimal delay before cooldown in in effect
+ // to allow all bubbles broken by a single damage source proc mana return
+ if (caster->ToPlayer()->GetSpellCooldownDelay(aura->GetId()) <= 11)
+ break;
+ }
+ else // and add if needed
+ caster->ToPlayer()->AddSpellCooldown(aura->GetId(), 0, uint32(time(NULL) + 12));
}
+
// effect on caster
if (AuraEffect const* aurEff = aura->GetEffect(0))
{
@@ -1615,6 +1599,14 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
switch (GetId())
{
case 19746:
+ // Improved concentration aura - linked aura
+ if (caster->HasAura(20254) || caster->HasAura(20255) || caster->HasAura(20256))
+ {
+ if (apply)
+ target->CastSpell(target, 63510, true);
+ else
+ target->RemoveAura(63510);
+ }
case 31821:
// Aura Mastery Triggered Spell Handler
// If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity
@@ -1623,6 +1615,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
// Do effects only on aura owner
if (GetCasterGUID() != target->GetGUID())
break;
+
if (apply)
{
if ((GetSpellInfo()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellInfo()->Id == 19746 && target->HasAura(31821)))
@@ -1642,6 +1635,29 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
}
+ if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA)
+ {
+ if (!caster)
+ break;
+
+ // Improved devotion aura
+ if (caster->HasAura(20140) || caster->HasAura(20138) || caster->HasAura(20139))
+ {
+ if (apply)
+ caster->CastSpell(target, 63514, true);
+ else
+ target->RemoveAura(63514);
+ }
+ // 63531 - linked aura for both Sanctified Retribution and Swift Retribution talents
+ // Not allow for Retribution Aura (prevent stacking)
+ if ((GetSpellInfo()->SpellIconID != 555) && (caster->HasAura(53648) || caster->HasAura(53484) || caster->HasAura(53379) || caster->HasAura(31869)))
+ {
+ if (apply)
+ caster->CastSpell(target, 63531, true);
+ else
+ target->RemoveAura(63531);
+ }
+ }
break;
case SPELLFAMILY_DEATHKNIGHT:
if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_PRESENCE)
@@ -2055,6 +2071,7 @@ void Aura::LoadScripts()
{
std::list<AuraScript*>::iterator bitr = itr;
++itr;
+ delete (*bitr);
m_loadedScripts.erase(bitr);
continue;
}
@@ -2310,6 +2327,21 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraAppli
}
}
+void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount)
+{
+ for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ {
+ (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_SPLIT, aurApp);
+ std::list<AuraScript::EffectSplitHandler>::iterator effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin();
+ for (; effItr != effEndItr; ++effItr)
+ {
+ if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
+ (*effItr).Call(*scritr, aurEff, dmgInfo, splitAmount);
+ }
+ (*scritr)->_FinishScriptCall();
+ }
+}
+
UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
: Aura(spellproto, owner, caster, castItem, casterGUID)
{
@@ -2317,7 +2349,7 @@ UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
LoadScripts();
_InitEffects(effMask, caster, baseAmount);
GetUnitOwner()->_AddAura(this, caster);
-};
+}
void UnitAura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp)
{
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 2f50d47a79b..85c8992c597 100755
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -217,6 +217,8 @@ class Aura
void CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
void CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
void CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
+ void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount);
+
std::list<AuraScript*> m_loadedScripts;
private:
void _DeleteRemovedApplications();
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 58a89f75fd3..6b51f240b28 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -53,6 +53,8 @@
#include "SpellScript.h"
#include "InstanceScript.h"
#include "SpellInfo.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS];
@@ -85,7 +87,7 @@ SpellDestination::SpellDestination(WorldObject const& wObj)
}
-SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0)
+SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0), m_strTarget()
{
m_objectTarget = NULL;
m_itemTarget = NULL;
@@ -94,7 +96,6 @@ SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0)
m_itemTargetGUID = 0;
m_itemTargetEntry = 0;
- m_strTarget = "";
m_targetMask = 0;
}
@@ -458,23 +459,23 @@ void SpellCastTargets::Update(Unit* caster)
void SpellCastTargets::OutDebug() const
{
if (!m_targetMask)
- sLog->outString("No targets");
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "No targets");
- sLog->outString("target mask: %u", m_targetMask);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "target mask: %u", m_targetMask);
if (m_targetMask & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK | TARGET_FLAG_GAMEOBJECT_MASK))
- sLog->outString("Object target: " UI64FMTD, m_objectTargetGUID);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Object target: " UI64FMTD, m_objectTargetGUID);
if (m_targetMask & TARGET_FLAG_ITEM)
- sLog->outString("Item target: " UI64FMTD, m_itemTargetGUID);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Item target: " UI64FMTD, m_itemTargetGUID);
if (m_targetMask & TARGET_FLAG_TRADE_ITEM)
- sLog->outString("Trade item target: " UI64FMTD, m_itemTargetGUID);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Trade item target: " UI64FMTD, m_itemTargetGUID);
if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION)
- sLog->outString("Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_src._transportGUID, m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_src._transportGUID, m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str());
if (m_targetMask & TARGET_FLAG_DEST_LOCATION)
- sLog->outString("Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dst._transportGUID, m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dst._transportGUID, m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str());
if (m_targetMask & TARGET_FLAG_STRING)
- sLog->outString("String: %s", m_strTarget.c_str());
- sLog->outString("speed: %f", m_speed);
- sLog->outString("elevation: %f", m_elevation);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "String: %s", m_strTarget.c_str());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "speed: %f", m_speed);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "elevation: %f", m_elevation);
}
SpellValue::SpellValue(SpellInfo const* proto)
@@ -582,7 +583,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
&& !m_spellInfo->IsPassive() && !m_spellInfo->IsPositive();
CleanupTargetList();
- CleanupEffectExecuteData();
+ memset(m_effectExecuteData, 0, MAX_SPELL_EFFECTS * sizeof(ByteBuffer*));
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
m_destTargets[i] = SpellDestination(*m_caster);
@@ -603,7 +604,7 @@ Spell::~Spell()
{
// Clean the reference to avoid later crash.
// If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
- sLog->outError("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
*m_selfContainer = NULL;
}
@@ -827,7 +828,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
break;
}
- switch(targetType.GetSelectionCategory())
+ switch (targetType.GetSelectionCategory())
{
case TARGET_SELECT_CATEGORY_CHANNEL:
SelectImplicitChannelTargets(effIndex, targetType);
@@ -845,7 +846,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
switch (targetType.GetObjectType())
{
case TARGET_OBJECT_TYPE_SRC:
- switch(targetType.GetReferenceType())
+ switch (targetType.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER:
m_targets.SetSrc(*m_caster);
@@ -856,7 +857,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
}
break;
case TARGET_OBJECT_TYPE_DEST:
- switch(targetType.GetReferenceType())
+ switch (targetType.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER:
SelectImplicitCasterDestTargets(effIndex, targetType);
@@ -873,7 +874,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
}
break;
default:
- switch(targetType.GetReferenceType())
+ switch (targetType.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER:
SelectImplicitCasterObjectTargets(effIndex, targetType);
@@ -914,17 +915,25 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
switch (targetType.GetTarget())
{
case TARGET_UNIT_CHANNEL_TARGET:
+ {
+ WorldObject* target = ObjectAccessor::GetUnit(*m_caster, m_originalCaster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT));
+ CallScriptObjectTargetSelectHandlers(target, effIndex);
// unit target may be no longer avalible - teleported out of map for example
- if (Unit* target = Unit::GetUnit(*m_caster, channeledSpell->m_targets.GetUnitTargetGUID()))
- AddUnitTarget(target, 1 << effIndex);
+ if (target && target->ToUnit())
+ AddUnitTarget(target->ToUnit(), 1 << effIndex);
else
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex);
break;
+ }
case TARGET_DEST_CHANNEL_TARGET:
if (channeledSpell->m_targets.HasDst())
m_targets.SetDst(channeledSpell->m_targets);
- else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, channeledSpell->m_targets.GetObjectTargetGUID()))
- m_targets.SetDst(*target);
+ else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, m_originalCaster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)))
+ {
+ CallScriptObjectTargetSelectHandlers(target, effIndex);
+ if (target)
+ m_targets.SetDst(*target);
+ }
else
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex);
break;
@@ -1002,6 +1011,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
return;
}
+ CallScriptObjectTargetSelectHandlers(target, effIndex);
+
switch (targetType.GetObjectType())
{
case TARGET_OBJECT_TYPE_UNIT:
@@ -1041,7 +1052,9 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
{
Trinity::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList);
Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> searcher(m_caster, targets, check, containerTypeMask);
- SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, radius);
+ SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask, m_caster, m_caster, radius);
+
+ CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
if (!targets.empty())
{
@@ -1069,8 +1082,6 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
gObjTargets.push_back(gObjTarget);
}
- CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex);
-
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr)
AddUnitTarget(*itr, effMask, false);
@@ -1205,6 +1216,9 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
default:
break;
}
+
+ CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
+
std::list<Unit*> unitTargets;
std::list<GameObject*> gObjTargets;
// for compability with older code - add only unit and go targets
@@ -1286,18 +1300,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth
power = POWER_HEALTH;
}
- else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall
- {
- // Remove targets not in LoS or in stealth
- for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
- {
- if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster))
- itr = unitTargets.erase(itr);
- else
- ++itr;
- }
- break;
- }
else
break;
@@ -1338,6 +1340,11 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
}
}
+ // todo: move to scripts, but we must call it before resize list by MaxAffectedTargets
+ // Intimidating Shout
+ if (m_spellInfo->Id == 5246 && effIndex != EFFECT_0)
+ unitTargets.remove(m_targets.GetUnitTarget());
+
// Other special target selection goes here
if (uint32 maxTargets = m_spellValue->MaxAffectedTargets)
{
@@ -1346,13 +1353,9 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
if ((*j)->IsAffectedOnSpell(m_spellInfo))
maxTargets += (*j)->GetAmount();
- if (m_spellInfo->Id == 5246) //Intimidating Shout
- unitTargets.remove(m_targets.GetUnitTarget());
Trinity::Containers::RandomResizeList(unitTargets, maxTargets);
}
- CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex);
-
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr)
AddUnitTarget(*itr, effMask, false);
}
@@ -1368,6 +1371,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
Trinity::Containers::RandomResizeList(gObjTargets, maxTargets);
}
+
for (std::list<GameObject*>::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr)
AddGOTarget(*itr, effMask);
}
@@ -1375,7 +1379,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
- switch(targetType.GetTarget())
+ switch (targetType.GetTarget())
{
case TARGET_DEST_CASTER:
m_targets.SetDst(*m_caster);
@@ -1440,7 +1444,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
void Spell::SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
WorldObject* target = m_targets.GetObjectTarget();
- switch(targetType.GetTarget())
+ switch (targetType.GetTarget())
{
case TARGET_DEST_TARGET_ENEMY:
case TARGET_DEST_TARGET_ANY:
@@ -1473,7 +1477,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
if (!m_targets.HasDst())
m_targets.SetDst(*m_caster);
- switch(targetType.GetTarget())
+ switch (targetType.GetTarget())
{
case TARGET_DEST_DYNOBJ_ENEMY:
case TARGET_DEST_DYNOBJ_ALLY:
@@ -1499,27 +1503,27 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
- switch(targetType.GetTarget())
+ WorldObject* target = NULL;
+ bool checkIfValid = true;
+
+ switch (targetType.GetTarget())
{
case TARGET_UNIT_CASTER:
- AddUnitTarget(m_caster, 1 << effIndex, false);
+ target = m_caster;
+ checkIfValid = false;
break;
case TARGET_UNIT_MASTER:
- if (Unit* owner = m_caster->GetCharmerOrOwner())
- AddUnitTarget(owner, 1 << effIndex);
+ target = m_caster->GetCharmerOrOwner();
break;
case TARGET_UNIT_PET:
- if (Guardian* pet = m_caster->GetGuardianPet())
- AddUnitTarget(pet, 1 << effIndex);
+ target = m_caster->GetGuardianPet();
break;
case TARGET_UNIT_SUMMONER:
if (m_caster->isSummon())
- if (Unit* unit = m_caster->ToTempSummon()->GetSummoner())
- AddUnitTarget(unit, 1 << effIndex);
+ target = m_caster->ToTempSummon()->GetSummoner();
break;
case TARGET_UNIT_VEHICLE:
- if (Unit *vehicle = m_caster->GetVehicleBase())
- AddUnitTarget(vehicle, 1 << effIndex);
+ target = m_caster->GetVehicleBase();
break;
case TARGET_UNIT_PASSENGER_0:
case TARGET_UNIT_PASSENGER_1:
@@ -1530,26 +1534,38 @@ void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImpli
case TARGET_UNIT_PASSENGER_6:
case TARGET_UNIT_PASSENGER_7:
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsVehicle())
- if (Unit *unit = m_caster->GetVehicleKit()->GetPassenger(targetType.GetTarget() - TARGET_UNIT_PASSENGER_0))
- AddUnitTarget(unit, 1 << effIndex);
+ target = m_caster->GetVehicleKit()->GetPassenger(targetType.GetTarget() - TARGET_UNIT_PASSENGER_0);
break;
default:
break;
}
+
+ CallScriptObjectTargetSelectHandlers(target, effIndex);
+
+ if (target && target->ToUnit())
+ AddUnitTarget(target->ToUnit(), 1 << effIndex, checkIfValid);
}
void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
ASSERT((m_targets.GetObjectTarget() || m_targets.GetItemTarget()) && "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!");
- if (Unit* unit = m_targets.GetUnitTarget())
- AddUnitTarget(unit, 1 << effIndex, true, false);
- else if (GameObject* gobj = m_targets.GetGOTarget())
- AddGOTarget(gobj, 1 << effIndex);
- else
- AddItemTarget(m_targets.GetItemTarget(), 1 << effIndex);
- if (WorldObject* target = m_targets.GetObjectTarget())
+ WorldObject* target = m_targets.GetObjectTarget();
+
+ CallScriptObjectTargetSelectHandlers(target, effIndex);
+
+ if (target)
+ {
+ if (Unit* unit = target->ToUnit())
+ AddUnitTarget(unit, 1 << effIndex, true, false);
+ else if (GameObject* gobj = target->ToGameObject())
+ AddGOTarget(gobj, 1 << effIndex);
+
SelectImplicitChainTargets(effIndex, targetType, target, 1 << effIndex);
+ }
+ // Script hook can remove object target and we would wrongly land here
+ else if (Item* item = m_targets.GetItemTarget())
+ AddItemTarget(item, 1 << effIndex);
}
void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask)
@@ -1570,14 +1586,15 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg
SearchChainTargets(targets, maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType()
, m_spellInfo->Effects[effIndex].ImplicitTargetConditions, targetType.GetTarget() == TARGET_UNIT_TARGET_CHAINHEAL_ALLY);
+ // Chain primary target is added earlier
+ CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
+
// for backward compability
std::list<Unit*> unitTargets;
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
if (Unit* unitTarget = (*itr)->ToUnit())
unitTargets.push_back(unitTarget);
- CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex);
-
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr)
AddUnitTarget(*itr, effMask, false);
}
@@ -1621,7 +1638,7 @@ void Spell::SelectImplicitTrajTargets()
float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
if (a > -0.0001f)
a = 0;
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: a %f b %f", a, b);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: a %f b %f", a, b);)
float bestDist = m_spellInfo->GetMaxRange(false);
@@ -1637,11 +1654,11 @@ void Spell::SelectImplicitTrajTargets()
const float objDist2d = m_targets.GetSrcPos()->GetExactDist2d(*itr) * cos(m_targets.GetSrcPos()->GetRelativeAngle(*itr));
const float dz = (*itr)->GetPositionZ() - m_targets.GetSrcPos()->m_positionZ;
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);)
float dist = objDist2d - size;
float height = dist * (a * dist + b);
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)
if (dist < bestDist && height < dz + size && height > dz - size)
{
bestDist = dist > 0 ? dist : 0;
@@ -1649,7 +1666,7 @@ void Spell::SelectImplicitTrajTargets()
}
#define CHECK_DIST {\
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\
if (dist > bestDist)\
continue;\
if (dist < objDist2d + size && dist > objDist2d - size)\
@@ -1711,7 +1728,7 @@ void Spell::SelectImplicitTrajTargets()
float distSq = (*itr)->GetExactDistSq(x, y, z);
float sizeSq = (*itr)->GetObjectSize();
sizeSq *= sizeSq;
- DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
if (distSq > sizeSq)
{
float factor = 1 - sqrt(sizeSq / distSq);
@@ -1720,7 +1737,7 @@ void Spell::SelectImplicitTrajTargets()
z += factor * ((*itr)->GetPositionZ() - z);
distSq = (*itr)->GetExactDistSq(x, y, z);
- DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
}
}
@@ -1740,9 +1757,12 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
case SPELL_EFFECT_SUMMON_PLAYER:
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection())
{
- Player* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection());
- if (target)
- AddUnitTarget(target, 1 << effIndex, false);
+ WorldObject* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection());
+
+ CallScriptObjectTargetSelectHandlers(target, SpellEffIndex(effIndex));
+
+ if (target && target->ToPlayer())
+ AddUnitTarget(target->ToUnit(), 1 << effIndex, false);
}
return;
default:
@@ -1758,6 +1778,8 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
if (!targetMask)
return;
+ WorldObject* target = NULL;
+
switch (m_spellInfo->Effects[effIndex].GetImplicitTargetType())
{
// add explicit object target or self to the target map
@@ -1766,40 +1788,46 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
if (targetMask & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK))
{
if (Unit* unitTarget = m_targets.GetUnitTarget())
- AddUnitTarget(unitTarget, 1 << effIndex, false);
+ target = unitTarget;
else if (targetMask & TARGET_FLAG_CORPSE_MASK)
{
if (Corpse* corpseTarget = m_targets.GetCorpseTarget())
{
// TODO: this is a workaround - corpses should be added to spell target map too, but we can't do that so we add owner instead
if (Player* owner = ObjectAccessor::FindPlayer(corpseTarget->GetOwnerGUID()))
- AddUnitTarget(owner, 1 << effIndex, false);
+ target = owner;
}
}
else //if (targetMask & TARGET_FLAG_UNIT_MASK)
- {
- AddUnitTarget(m_caster, 1 << effIndex, false);
- }
+ target = m_caster;
}
if (targetMask & TARGET_FLAG_ITEM_MASK)
{
if (Item* itemTarget = m_targets.GetItemTarget())
AddItemTarget(itemTarget, 1 << effIndex);
+ return;
}
if (targetMask & TARGET_FLAG_GAMEOBJECT_MASK)
- {
- if (GameObject* gObjTarget = m_targets.GetGOTarget())
- AddGOTarget(gObjTarget, 1 << effIndex);
- }
+ target = m_targets.GetGOTarget();
break;
// add self to the target map
case EFFECT_IMPLICIT_TARGET_CASTER:
if (targetMask & TARGET_FLAG_UNIT_MASK)
- AddUnitTarget(m_caster, 1 << effIndex, false);
+ target = m_caster;
break;
default:
break;
}
+
+ CallScriptObjectTargetSelectHandlers(target, SpellEffIndex(effIndex));
+
+ if (target)
+ {
+ if (target->ToUnit())
+ AddUnitTarget(target->ToUnit(), 1 << effIndex, false);
+ else if (target->ToGameObject())
+ AddGOTarget(target->ToGameObject(), 1 << effIndex);
+ }
}
uint32 Spell::GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionList* condList)
@@ -2473,12 +2501,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
}
- // Haunt
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1))
- {
- AuraEffect* aurEff = m_spellAura->GetEffect(1);
- aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage));
- }
m_damage = damageInfo.damage;
@@ -2503,7 +2525,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
}
}
- if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
+ if (missInfo != SPELL_MISS_EVADE && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
{
m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO));
@@ -2547,27 +2569,49 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
return SPELL_MISS_EVADE;
// For delayed spells immunity may be applied between missile launch and hit - check immunity for that case
+ if (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo)))
+ return SPELL_MISS_IMMUNE;
+
// disable effects to which unit is immune
+ SpellMissInfo returnVal = SPELL_MISS_IMMUNE;
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
- if (effectMask & (1 << effectNumber) && unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber))
- effectMask &= ~(1 << effectNumber);
- if (!effectMask || (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo))))
- return SPELL_MISS_IMMUNE;
+ {
+ if (effectMask & (1 << effectNumber))
+ {
+ if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber))
+ effectMask &= ~(1 << effectNumber);
+ else if (m_spellInfo->Effects[effectNumber].IsAura() && !m_spellInfo->IsPositiveEffect(effectNumber))
+ {
+ int32 debuff_resist_chance = unit->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel));
+ debuff_resist_chance += unit->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel));
+
+ if (debuff_resist_chance > 0)
+ if (irand(0,10000) <= (debuff_resist_chance * 100))
+ {
+ effectMask &= ~(1 << effectNumber);
+ returnVal = SPELL_MISS_RESIST;
+ }
+ }
+ }
+ }
+
+ if (!effectMask)
+ return returnVal;
PrepareScriptHitHandlers();
CallScriptBeforeHitHandlers();
- if (unit->GetTypeId() == TYPEID_PLAYER)
+ if (Player* player = unit->ToPlayer())
{
- unit->ToPlayer()->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, m_spellInfo->Id);
- unit->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id, 0, m_caster);
- unit->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, m_spellInfo->Id);
+ player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, m_spellInfo->Id);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id, 0, m_caster);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, m_spellInfo->Id);
}
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (Player* player = m_caster->ToPlayer())
{
- m_caster->ToPlayer()->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER, m_spellInfo->Id);
- m_caster->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, unit);
+ player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER, m_spellInfo->Id);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, unit);
}
if (m_caster != unit)
@@ -2979,8 +3023,14 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
// calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail)
m_casttime = m_spellInfo->CalcCastTime(m_caster, this);
if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+ // Set casttime to 0 if .cheat casttime is enabled.
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME))
+ m_casttime = 0;
+ }
+
// don't allow channeled spells / spells with cast time to be casted while moving
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)
@@ -3019,10 +3069,9 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
SendSpellStart();
// set target for proper facing
- if (m_casttime && !(_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING))
- if (uint64 target = m_targets.GetUnitTargetGUID())
- if (m_caster->GetGUID() != target && m_caster->GetTypeId() == TYPEID_UNIT)
- m_caster->FocusTarget(this, target);
+ if ((m_casttime || m_spellInfo->IsChanneled()) && !(_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING))
+ if (m_caster->GetGUID() != m_targets.GetObjectTargetGUID() && m_caster->GetTypeId() == TYPEID_UNIT)
+ m_caster->FocusTarget(this, m_targets.GetObjectTargetGUID());
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_GCD))
TriggerGlobalCooldown();
@@ -3204,15 +3253,15 @@ void Spell::cast(bool skipCheck)
// set to real guid to be sent later to the client
m_targets.UpdateTradeSlotItem();
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (Player* player = m_caster->ToPlayer())
{
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_ITEM) && m_CastItem)
{
- m_caster->ToPlayer()->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_ITEM, m_CastItem->GetEntry());
- m_caster->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, m_CastItem->GetEntry());
+ player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_ITEM, m_CastItem->GetEntry());
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, m_CastItem->GetEntry());
}
- m_caster->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
}
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST))
@@ -3271,8 +3320,14 @@ void Spell::cast(bool skipCheck)
}
if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+ //Clear spell cooldowns after every spell is cast if .cheat cooldown is enabled.
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
+ m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
+ }
+
SetExecutedCurrently(false);
}
@@ -4027,41 +4082,47 @@ void Spell::WriteAmmoToPacket(WorldPacket* data)
*data << uint32(ammoInventoryType);
}
+/// Writes miss and hit targets for a SMSG_SPELL_GO packet
void Spell::WriteSpellGoTargets(WorldPacket* data)
{
// This function also fill data for channeled spells:
// m_needAliveTargetMask req for stop channelig if one target die
- uint32 hit = m_UniqueGOTargetInfo.size(); // Always hits on GO
- uint32 miss = 0;
for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
{
if ((*ihit).effectMask == 0) // No effect apply - all immuned add state
- {
// possibly SPELL_MISS_IMMUNE2 for this??
ihit->missCondition = SPELL_MISS_IMMUNE2;
- ++miss;
- }
- else if ((*ihit).missCondition == SPELL_MISS_NONE)
- ++hit;
- else
- ++miss;
}
- *data << (uint8)hit;
- for (std::list<TargetInfo>::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
+ // Hit and miss target counts are both uint8, that limits us to 255 targets for each
+ // sending more than 255 targets crashes the client (since count sent would be wrong)
+ // Spells like 40647 (with a huge radius) can easily reach this limit (spell might need
+ // target conditions but we still need to limit the number of targets sent and keeping
+ // correct count for both hit and miss).
+
+ uint32 hit = 0;
+ size_t hitPos = data->wpos();
+ *data << (uint8)0; // placeholder
+ for (std::list<TargetInfo>::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end() && hit <= 255; ++ihit)
{
if ((*ihit).missCondition == SPELL_MISS_NONE) // Add only hits
{
*data << uint64(ihit->targetGUID);
m_channelTargetEffectMask |=ihit->effectMask;
+ ++hit;
}
}
- for (std::list<GOTargetInfo>::const_iterator ighit = m_UniqueGOTargetInfo.begin(); ighit != m_UniqueGOTargetInfo.end(); ++ighit)
+ for (std::list<GOTargetInfo>::const_iterator ighit = m_UniqueGOTargetInfo.begin(); ighit != m_UniqueGOTargetInfo.end() && hit <= 255; ++ighit)
+ {
*data << uint64(ighit->targetGUID); // Always hits
+ ++hit;
+ }
- *data << (uint8)miss;
- for (std::list<TargetInfo>::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
+ uint32 miss = 0;
+ size_t missPos = data->wpos();
+ *data << (uint8)0; // placeholder
+ for (std::list<TargetInfo>::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end() && miss <= 255; ++ihit)
{
if (ihit->missCondition != SPELL_MISS_NONE) // Add only miss
{
@@ -4069,11 +4130,15 @@ void Spell::WriteSpellGoTargets(WorldPacket* data)
*data << uint8(ihit->missCondition);
if (ihit->missCondition == SPELL_MISS_REFLECT)
*data << uint8(ihit->reflectResult);
+ ++miss;
}
}
// Reset m_needAliveTargetMask for non channeled spell
if (!m_spellInfo->IsChanneled())
m_channelTargetEffectMask = 0;
+
+ data->put<uint8>(hitPos, (uint8)hit);
+ data->put<uint8>(missPos, (uint8)miss);
}
void Spell::SendLogExecute()
@@ -4212,6 +4277,9 @@ void Spell::SendChannelUpdate(uint32 time)
void Spell::SendChannelStart(uint32 duration)
{
uint64 channelTarget = m_targets.GetObjectTargetGUID();
+ if (!channelTarget && !m_spellInfo->NeedsExplicitUnitTarget())
+ if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY
+ channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID;
WorldPacket data(MSG_CHANNEL_START, (8+4+4));
data.append(m_caster->GetPackGUID());
@@ -4262,7 +4330,7 @@ void Spell::TakeCastItem()
{
// This code is to avoid a crash
// I'm not sure, if this is really an error, but I guess every item needs a prototype
- sLog->outError("Cast item has no item prototype highId=%d, lowId=%d", m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Cast item has no item prototype highId=%d, lowId=%d", m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow());
return;
}
@@ -4314,6 +4382,13 @@ void Spell::TakePower()
if (m_CastItem || m_triggeredByAuraSpell)
return;
+ //Don't take power if the spell is cast while .cheat power is enabled.
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_POWER))
+ return;
+ }
+
Powers powerType = Powers(m_spellInfo->PowerType);
bool hit = true;
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -4352,7 +4427,7 @@ void Spell::TakePower()
if (powerType >= MAX_POWERS)
{
- sLog->outError("Spell::TakePower: Unknown power type '%d'", powerType);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::TakePower: Unknown power type '%d'", powerType);
return;
}
@@ -4839,19 +4914,9 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
return SPELL_FAILED_LINE_OF_SIGHT;
}
- else
- {
- if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster
- {
- // Lay on Hands - cannot be self-cast on paladin with Forbearance or after using Avenging Wrath
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[0] & 0x0008000)
- if (target->HasAura(61988)) // Immunity shield marker
- return SPELL_FAILED_TARGET_AURASTATE;
- }
- }
}
- //Check for line of sight for spells with dest
+ // Check for line of sight for spells with dest
if (m_targets.HasDst())
{
float x, y, z;
@@ -4950,7 +5015,8 @@ SpellCastResult Spell::CheckCast(bool strict)
bool hasDispellableAura = false;
bool hasNonDispelEffect = false;
- for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ uint32 dispelMask = 0;
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL)
{
if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->AttributesEx & SPELL_ATTR1_MELEE_COMBAT_START)
@@ -4958,17 +5024,8 @@ SpellCastResult Spell::CheckCast(bool strict)
hasDispellableAura = true;
break;
}
- if (Unit* target = m_targets.GetUnitTarget())
- {
- DispelChargesList dispelList;
- uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
- target->GetDispellableAuraList(m_caster, dispelMask, dispelList);
- if (!dispelList.empty())
- {
- hasDispellableAura = true;
- break;
- }
- }
+
+ dispelMask |= SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
}
else if (m_spellInfo->Effects[i].IsEffect())
{
@@ -4976,34 +5033,22 @@ SpellCastResult Spell::CheckCast(bool strict)
break;
}
- if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && !IsTriggered())
- return SPELL_FAILED_NOTHING_TO_DISPEL;
+ if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered())
+ {
+ if (Unit* target = m_targets.GetUnitTarget())
+ {
+ DispelChargesList dispelList;
+ target->GetDispellableAuraList(m_caster, dispelMask, dispelList);
+ if (dispelList.empty())
+ return SPELL_FAILED_NOTHING_TO_DISPEL;
+ }
+ }
- for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
// for effects of spells that have only one target
switch (m_spellInfo->Effects[i].Effect)
{
- case SPELL_EFFECT_DUMMY:
- {
- if (m_spellInfo->Id == 19938) // Awaken Peon
- {
- Unit* unit = m_targets.GetUnitTarget();
- if (!unit || !unit->HasAura(17743))
- return SPELL_FAILED_BAD_TARGETS;
- }
- else if (m_spellInfo->Id == 31789) // Righteous Defense
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return SPELL_FAILED_DONT_REPORT;
-
- Unit* target = m_targets.GetUnitTarget();
- if (!target || !target->IsFriendlyTo(m_caster) || target->getAttackers().empty())
- return SPELL_FAILED_BAD_TARGETS;
-
- }
- break;
- }
case SPELL_EFFECT_LEARN_SPELL:
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -5102,6 +5147,10 @@ SpellCastResult Spell::CheckCast(bool strict)
}
if (m_caster->HasUnitState(UNIT_STATE_ROOT))
return SPELL_FAILED_ROOTED;
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (Unit* target = m_targets.GetUnitTarget())
+ if (!target->isAlive())
+ return SPELL_FAILED_BAD_TARGETS;
break;
}
case SPELL_EFFECT_SKINNING:
@@ -5320,10 +5369,6 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_EFFECT_LEAP_BACK:
{
- // Spell 781 (Disengage) requires player to be in combat
- if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 781 && !m_caster->isInCombat())
- return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
-
if (m_caster->HasUnitState(UNIT_STATE_ROOT))
{
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -5345,66 +5390,10 @@ SpellCastResult Spell::CheckCast(bool strict)
}
}
- for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
switch (m_spellInfo->Effects[i].ApplyAuraName)
{
- case SPELL_AURA_DUMMY:
- {
- //custom check
- switch (m_spellInfo->Id)
- {
- // Tag Murloc
- case 30877:
- {
- Unit* target = m_targets.GetUnitTarget();
- if (!target || target->GetEntry() != 17326)
- return SPELL_FAILED_BAD_TARGETS;
- break;
- }
- case 61336:
- if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_caster->ToPlayer()->IsInFeralForm())
- return SPELL_FAILED_ONLY_SHAPESHIFT;
- break;
- case 1515:
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return SPELL_FAILED_BAD_TARGETS;
-
- if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget()->GetTypeId() == TYPEID_PLAYER)
- return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
-
- Creature* target = m_targets.GetUnitTarget()->ToCreature();
-
- if (target->getLevel() > m_caster->getLevel())
- return SPELL_FAILED_HIGHLEVEL;
-
- // use SMSG_PET_TAME_FAILURE?
- if (!target->GetCreatureTemplate()->isTameable (m_caster->ToPlayer()->CanTameExoticPets()))
- return SPELL_FAILED_BAD_TARGETS;
-
- if (m_caster->GetPetGUID())
- return SPELL_FAILED_ALREADY_HAVE_SUMMON;
-
- if (m_caster->GetCharmGUID())
- return SPELL_FAILED_ALREADY_HAVE_CHARM;
-
- break;
- }
- case 44795: // Parachute
- {
- float x, y, z;
- m_caster->GetPosition(x, y, z);
- float ground_Z = m_caster->GetMap()->GetHeight(m_caster->GetPhaseMask(), x, y, z);
- if (fabs(ground_Z - z) < 0.1f)
- return SPELL_FAILED_DONT_REPORT;
- break;
- }
- default:
- break;
- }
- break;
- }
case SPELL_AURA_MOD_POSSESS_PET:
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -5489,8 +5478,9 @@ SpellCastResult Spell::CheckCast(bool strict)
// allow always ghost flight spells
if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive())
{
- if (AreaTableEntry const* pArea = GetAreaEntryByAreaID(m_originalCaster->GetAreaId()))
- if (pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId());
+ if (AreaTableEntry const* area = GetAreaEntryByAreaID(m_originalCaster->GetAreaId()))
+ if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn()))
return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE;
}
break;
@@ -5591,7 +5581,7 @@ SpellCastResult Spell::CheckCasterAuras() const
// We use bitmasks so the loop is done only once and not on every aura check below.
if (m_spellInfo->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
{
- for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_SCHOOL_IMMUNITY)
school_immune |= uint32(m_spellInfo->Effects[i].MiscValue);
@@ -5659,7 +5649,7 @@ SpellCastResult Spell::CheckCasterAuras() const
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (auraInfo->GetAllEffectsMechanicMask() & mechanic_immune)
continue;
- if (auraInfo->GetSchoolMask() & school_immune)
+ if (auraInfo->GetSchoolMask() & school_immune && !(auraInfo->AttributesEx & SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE))
continue;
if (auraInfo->GetDispelMask() & dispel_immune)
continue;
@@ -5821,7 +5811,7 @@ SpellCastResult Spell::CheckPower()
// Check valid power type
if (m_spellInfo->PowerType >= MAX_POWERS)
{
- sLog->outError("Spell::CheckPower: Unknown power type '%d'", m_spellInfo->PowerType);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::CheckPower: Unknown power type '%d'", m_spellInfo->PowerType);
return SPELL_FAILED_UNKNOWN;
}
@@ -6385,7 +6375,7 @@ void Spell::Delayed() // only called in DealDamage()
else
m_timer += delaytime;
- sLog->outDetail("Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime);
WorldPacket data(SMSG_SPELL_DELAYED, 8+4);
data.append(m_caster->GetPackGUID());
@@ -6601,7 +6591,7 @@ SpellEvent::~SpellEvent()
}
else
{
- sLog->outError("~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUIDLow(), m_Spell->m_spellInfo->Id);
ASSERT(false);
}
@@ -6870,9 +6860,9 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
0 : m_caster->ToPlayer()->GetSkillValue(skillId);
// skill bonus provided by casting spell (mostly item spells)
- // add the damage modifier from the spell casted (cheat lock / skeleton key etc.)
+ // add the effect base points modifier from the spell casted (cheat lock / skeleton key etc.)
if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET)
- skillValue += uint32(CalculateDamage(effIndex, NULL));
+ skillValue += m_spellInfo->Effects[effIndex].CalcValue();
if (skillValue < reqSkillValue)
return SPELL_FAILED_LOW_CASTLEVEL;
@@ -6941,12 +6931,6 @@ void Spell::InitEffectExecuteData(uint8 effIndex)
}
}
-void Spell::CleanupEffectExecuteData()
-{
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- m_effectExecuteData[i] = NULL;
-}
-
void Spell::CheckEffectExecuteData()
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -6962,6 +6946,7 @@ void Spell::LoadScripts()
{
std::list<SpellScript*>::iterator bitr = itr;
++itr;
+ delete (*bitr);
m_loadedScripts.erase(bitr);
continue;
}
@@ -7122,15 +7107,29 @@ void Spell::CallScriptAfterHitHandlers()
}
}
-void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list<Unit*>& unitTargets, SpellEffIndex effIndex)
+void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list<WorldObject*>& targets, SpellEffIndex effIndex)
+{
+ for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ {
+ (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT);
+ std::list<SpellScript::ObjectAreaTargetSelectHandler>::iterator hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin();
+ for (; hookItr != hookItrEnd; ++hookItr)
+ if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex))
+ (*hookItr).Call(*scritr, targets);
+
+ (*scritr)->_FinishScriptCall();
+ }
+}
+
+void Spell::CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex)
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
- (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT);
- std::list<SpellScript::UnitTargetHandler>::iterator hookItrEnd = (*scritr)->OnUnitTargetSelect.end(), hookItr = (*scritr)->OnUnitTargetSelect.begin();
+ (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT);
+ std::list<SpellScript::ObjectTargetSelectHandler>::iterator hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin();
for (; hookItr != hookItrEnd; ++hookItr)
if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex))
- (*hookItr).Call(*scritr, unitTargets);
+ (*hookItr).Call(*scritr, target);
(*scritr)->_FinishScriptCall();
}
@@ -7164,12 +7163,6 @@ void Spell::PrepareTriggersExecutedOnHit()
// todo: move this to scripts
switch (m_spellInfo->SpellFamilyName)
{
- case SPELLFAMILY_GENERIC:
- {
- if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages
- m_preCastSpell = 11196; // Recently Bandaged
- break;
- }
case SPELLFAMILY_MAGE:
{
// Permafrost
@@ -7230,6 +7223,10 @@ void Spell::TriggerGlobalCooldown()
if (!gcd)
return;
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
+ return;
+
// Global cooldown can't leave range 1..1.5 secs
// There are some spells (mostly not casted directly by player) that have < 1 sec and > 1.5 sec global cooldowns
// but as tests show are not affected by any spell mods.
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 8f43b9b2290..d2bdf4b8970 100755
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -69,14 +69,14 @@ enum SpellCastFlags
CAST_FLAG_UNKNOWN_29 = 0x10000000,
CAST_FLAG_UNKNOWN_30 = 0x20000000,
CAST_FLAG_UNKNOWN_31 = 0x40000000,
- CAST_FLAG_UNKNOWN_32 = 0x80000000,
+ CAST_FLAG_UNKNOWN_32 = 0x80000000
};
enum SpellRangeFlag
{
SPELL_RANGE_DEFAULT = 0,
SPELL_RANGE_MELEE = 1, //melee
- SPELL_RANGE_RANGED = 2, //hunter range and ranged weapon
+ SPELL_RANGE_RANGED = 2 //hunter range and ranged weapon
};
struct SpellDestination
@@ -203,7 +203,7 @@ enum SpellEffectHandleMode
SPELL_EFFECT_HANDLE_LAUNCH,
SPELL_EFFECT_HANDLE_LAUNCH_TARGET,
SPELL_EFFECT_HANDLE_HIT,
- SPELL_EFFECT_HANDLE_HIT_TARGET,
+ SPELL_EFFECT_HANDLE_HIT_TARGET
};
class Spell
@@ -616,7 +616,6 @@ class Spell
// spell execution log
void InitEffectExecuteData(uint8 effIndex);
- void CleanupEffectExecuteData();
void CheckEffectExecuteData();
// Scripting system
@@ -630,7 +629,8 @@ class Spell
void CallScriptBeforeHitHandlers();
void CallScriptOnHitHandlers();
void CallScriptAfterHitHandlers();
- void CallScriptAfterUnitTargetSelectHandlers(std::list<Unit*>& unitTargets, SpellEffIndex effIndex);
+ void CallScriptObjectAreaTargetSelectHandlers(std::list<WorldObject*>& targets, SpellEffIndex effIndex);
+ void CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex);
std::list<SpellScript*> m_loadedScripts;
struct HitTriggerSpell
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 0d5dac8f8e0..dcbd1888b03 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -277,6 +277,10 @@ void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/)
if (!unitTarget || !unitTarget->isAlive())
return;
+ if (unitTarget->GetTypeId() == TYPEID_PLAYER)
+ if (unitTarget->ToPlayer()->GetCommandStatus(CHEAT_GOD))
+ return;
+
if (m_caster == unitTarget) // prevent interrupt message
finish();
@@ -312,10 +316,9 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
return;
- bool apply_direct_bonus = true;
-
if (unitTarget && unitTarget->isAlive())
{
+ bool apply_direct_bonus = true;
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
@@ -353,43 +356,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
return;
break;
}
- case 33671: // gruul's shatter
- case 50811: // krystallus shatter ( Normal )
- case 61547: // krystallus shatter ( Heroic )
- {
- // don't damage self and only players
- if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- float radius = m_spellInfo->Effects[EFFECT_0].CalcRadius(m_caster);
- if (!radius)
- return;
- float distance = m_caster->GetDistance2d(unitTarget);
- damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * ((radius - distance)/radius));
- break;
- }
- // Loken Pulsing Shockwave
- case 59837:
- case 52942:
- {
- // don't damage self and only players
- if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- float radius = m_spellInfo->Effects[EFFECT_0].CalcRadius(m_caster);
- if (!radius)
- return;
- float distance = m_caster->GetDistance2d(unitTarget);
- damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * distance);
- break;
- }
- // TODO: add spell specific target requirement hook for spells
- // Shadowbolts only affects targets with Shadow Mark (Gothik)
- case 27831:
- case 55638:
- if (!unitTarget->HasAura(27825))
- return;
- break;
// Gargoyle Strike
case 51963:
{
@@ -402,11 +368,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
}
case SPELLFAMILY_WARRIOR:
{
- // Bloodthirst
- if (m_spellInfo->SpellFamilyFlags[1] & 0x400)
- ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
// Shield Slam
- else if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
{
uint8 level = m_caster->getLevel();
uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f));
@@ -503,20 +466,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
}
case SPELLFAMILY_PRIEST:
{
- // Shadow Word: Death - deals damage equal to damage done to caster
- if (m_spellInfo->SpellFamilyFlags[1] & 0x2)
- {
- int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE);
- back_damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE);
- // Pain and Suffering reduces damage
- if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0))
- AddPctN(back_damage, -aurEff->GetAmount());
-
- if (back_damage < int32(unitTarget->GetHealth()))
- m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true);
- }
// Improved Mind Blast (Mind Blast in shadow form bonus)
- else if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
+ if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
{
Unit::AuraEffectList const& ImprMindBlast = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for (Unit::AuraEffectList::const_iterator i = ImprMindBlast.begin(); i != ImprMindBlast.end(); ++i)
@@ -816,7 +767,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
if (!spellInfo)
{
- sLog->outError("EffectDummy of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id, spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectDummy of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id, spell_id);
return;
}
@@ -1074,7 +1025,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
if (!spellInfo)
{
- sLog->outError("Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -1119,7 +1070,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
if (!spellInfo)
{
- sLog->outError("EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -1202,6 +1153,14 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
if (unitTarget->getLevel() > uiMaxSafeLevel)
{
unitTarget->AddAura(60444, unitTarget); //Apply Lost! Aura
+
+ // ALLIANCE from 60323 to 60330 - HORDE from 60328 to 60335
+ uint32 spellId = 60323;
+ if (m_caster->ToPlayer()->GetTeam() == HORDE)
+ spellId += 5;
+
+ spellId += urand(0, 7);
+ m_caster->CastSpell(m_caster, spellId, true);
return;
}
break;
@@ -1228,7 +1187,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
// If not exist data for dest location - return
if (!m_targets.HasDst())
{
- sLog->outError("Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id);
return;
}
@@ -1554,7 +1513,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
if (!targetAura)
{
- sLog->outError("Target(GUID:" UI64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Target(GUID:" UI64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID());
return;
}
@@ -1773,8 +1732,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow());
// send info to the client
- if (pItem)
- player->SendNewItem(pItem, num_to_add, true, bgType == 0);
+ player->SendNewItem(pItem, num_to_add, true, bgType == 0);
// we succeeded in creating at least one item, so a levelup is possible
if (bgType == 0)
@@ -2029,7 +1987,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
// Players shouldn't be able to loot gameobjects that are currently despawned
if (!gameObjTarget->isSpawned() && !player->isGameMaster())
{
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
player->GetName(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow());
return;
}
@@ -2128,7 +2086,8 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
bg->EventPlayerClickedOnFlag(player, gameObjTarget);
return;
}
- }else if (m_spellInfo->Id == 1842 && gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && gameObjTarget->GetOwner())
+ }
+ else if (m_spellInfo->Id == 1842 && gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && gameObjTarget->GetOwner())
{
gameObjTarget->SetLootState(GO_JUST_DEACTIVATED);
return;
@@ -2165,7 +2124,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
if (gameObjTarget)
SendLoot(guid, LOOT_SKINNING);
- else
+ else if (itemTarget)
itemTarget->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED);
// not allow use skill grow at item base open
@@ -2327,7 +2286,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->Effects[effIndex].MiscValueB);
if (!properties)
{
- sLog->outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
return;
}
@@ -2445,7 +2404,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (properties->Category == SUMMON_CATEGORY_ALLY)
{
- summon->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_originalCaster->GetGUID());
+ summon->SetOwnerGUID(m_originalCaster->GetGUID());
summon->setFaction(m_originalCaster->getFaction());
summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
}
@@ -2472,12 +2431,13 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
return;
// The spell that this effect will trigger. It has SPELL_AURA_CONTROL_VEHICLE
- uint32 spell = VEHICLE_SPELL_RIDE_HARDCODED;
- if (SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(m_spellInfo->Effects[effIndex].CalcValue()))
- spell = spellProto->Id;
+ uint32 spellId = VEHICLE_SPELL_RIDE_HARDCODED;
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spellInfo->Effects[effIndex].CalcValue());
+ if (spellInfo && spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE))
+ spellId = spellInfo->Id;
// Hard coded enter vehicle spell
- m_originalCaster->CastSpell(summon, spell, true);
+ m_originalCaster->CastSpell(summon, spellId, true);
uint32 faction = properties->Faction;
if (!faction)
@@ -2850,6 +2810,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, true);
+ item_owner->RemoveTradeableItem(itemTarget);
itemTarget->ClearSoulboundTradeable(item_owner);
}
}
@@ -2887,7 +2848,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
}
if (!add_socket)
{
- sLog->outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
m_spellInfo->Id, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC, ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
return;
}
@@ -2914,6 +2875,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true);
+ item_owner->RemoveTradeableItem(itemTarget);
itemTarget->ClearSoulboundTradeable(item_owner);
}
@@ -2952,14 +2914,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
case 10: spell_id = 36758; break; // 14%
case 11: spell_id = 36760; break; // 20%
default:
- sLog->outError("Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage);
return;
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
if (!spellInfo)
{
- sLog->outError("Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id);
return;
}
@@ -2986,14 +2948,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
if (!enchant_id)
{
- sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
return;
}
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if (!pEnchant)
{
- sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
return;
}
@@ -3425,7 +3387,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
// Blood Strike
if (m_spellInfo->SpellFamilyFlags[0] & 0x400000)
{
- AddPctF(totalDamagePercentMod, m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f);
+ float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f;
+ // Death Knight T8 Melee 4P Bonus
+ if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0))
+ AddPctF(bonusPct, aurEff->GetAmount());
+ AddPctF(totalDamagePercentMod, bonusPct);
// Glyph of Blood Strike
if (m_caster->GetAuraEffect(59332, EFFECT_0))
@@ -3452,7 +3418,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
if (roll_chance_i(aurEff->GetAmount()))
consumeDiseases = false;
- AddPctF(totalDamagePercentMod, m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f);
+ float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f;
+ // Death Knight T8 Melee 4P Bonus
+ if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0))
+ AddPctF(bonusPct, aurEff->GetAmount());
+ AddPctF(totalDamagePercentMod, bonusPct);
break;
}
// Blood-Caked Strike - Blood-Caked Blade
@@ -3464,7 +3434,12 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
// Heart Strike
if (m_spellInfo->SpellFamilyFlags[0] & 0x1000000)
{
- AddPctN(totalDamagePercentMod, m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()));
+ float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID());
+ // Death Knight T8 Melee 4P Bonus
+ if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0))
+ AddPctF(bonusPct, aurEff->GetAmount());
+
+ AddPctF(totalDamagePercentMod, bonusPct);
break;
}
break;
@@ -3574,15 +3549,6 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/)
return;
int32 addhealth = 0;
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN) // Lay on Hands
- {
- if (m_caster->GetGUID() == unitTarget->GetGUID())
- {
- m_caster->CastSpell(m_caster, 25771, true); // Forbearance
- m_caster->CastSpell(m_caster, 61988, true); // Immune shield marker (serverside)
- m_caster->CastSpell(m_caster, 61987, true); // Avenging Wrath marker
- }
- }
// damage == 0 - heal for caster max health
if (damage == 0)
@@ -3618,8 +3584,8 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
{
if (m_originalCaster)
{
- int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false, 1 << effIndex);
- unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), duration/*GetSpellDuration(m_spellInfo)*/);
+ int32 duration = m_spellInfo->GetDuration();
+ unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), unitTarget->ModSpellDuration(m_spellInfo, unitTarget, duration, false, 1 << effIndex));
}
ExecuteLogEffectInterruptCast(effIndex, unitTarget, curSpellInfo->Id);
unitTarget->InterruptSpell(CurrentSpellTypes(i), false);
@@ -3813,12 +3779,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (!itemTarget && m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- uint32 spell_id = 0;
- switch (urand(1, 5))
- {
- case 1: spell_id = 8854; break;
- default: spell_id = 8855; break;
- }
+ uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
m_caster->CastSpell(m_caster, spell_id, true, NULL);
return;
@@ -3865,10 +3826,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
return;
}
- // Escape artist
- case 20589:
- m_caster->RemoveMovementImpairingAuras();
- return;
// Decimate
case 28374:
case 54426:
@@ -3899,15 +3856,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
DoCreateItem(effIndex, item);
break;
}
- // Improved Sprint
- case 30918:
- {
- // Removes snares and roots.
- unitTarget->RemoveMovementImpairingAuras();
- break;
- }
- // Spirit Walk
- case 58876:
+ case 20589: // Escape artist
+ case 30918: // Improved Sprint
{
// Removes snares and roots.
unitTarget->RemoveMovementImpairingAuras();
@@ -3925,96 +3875,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
}
}
break;
- case 48025: // Headless Horseman's Mount
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 51617, true);
- else
- unitTarget->CastSpell(unitTarget, 48024, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 48023, true);
- else
- unitTarget->CastSpell(unitTarget, 48024, true);
- }break;
- }
- return;
- }
- case 47977: // Magic Broom
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 42680, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 42683, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 42667, true);
- else
- unitTarget->CastSpell(unitTarget, 42683, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 42668, true);
- else
- unitTarget->CastSpell(unitTarget, 42683, true);
- }break;
- }
- return;
- }
// Mug Transformation
case 41931:
{
@@ -4206,25 +4066,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (unitTarget)
unitTarget->CastSpell(m_caster, damage, true);
return;
- // Winged Steed of the Ebon Blade
- case 54729:
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill
- if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
- {
- if (skillval >= 300)
- unitTarget->CastSpell(unitTarget, 54727, true);
- else
- unitTarget->CastSpell(unitTarget, 54726, true);
- }
- return;
- }
case 57347: // Retrieving (Wintergrasp RP-GG pickup spell)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -4307,189 +4148,9 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
m_caster->CastSpell(m_caster, 63919, true);
return;
}
- case 71342: // Big Love Rocket
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 0: unitTarget->CastSpell(unitTarget, 71343, true); break;
- case 75: unitTarget->CastSpell(unitTarget, 71344, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 71345, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 71346, true);
- else
- unitTarget->CastSpell(unitTarget, 71345, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 71347, true);
- else
- unitTarget->CastSpell(unitTarget, 71345, true);
- }break;
- }
- return;
- }
- case 72286: // Invincible
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 72281, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 72282, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 72283, true);
- else
- unitTarget->CastSpell(unitTarget, 72282, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 72284, true);
- else
- unitTarget->CastSpell(unitTarget, 72282, true);
- }break;
- }
- return;
- }
- case 74856: // Blazing Hippogryph
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill
- if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
- {
- if (skillval >= 300)
- unitTarget->CastSpell(unitTarget, 74855, true);
- else
- unitTarget->CastSpell(unitTarget, 74854, true);
- }
- return;
- }
- case 75614: // Celestial Steed
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 75619, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 75620, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 75617, true);
- else
- unitTarget->CastSpell(unitTarget, 75620, true);
- }break;
- case 300:
- {
- if (canFly)
- {
- if (unitTarget->ToPlayer()->Has310Flyer(false))
- unitTarget->CastSpell(unitTarget, 76153, true);
- else
- unitTarget->CastSpell(unitTarget, 75618, true);
- }
- else
- unitTarget->CastSpell(unitTarget, 75620, true);
- }break;
- }
- return;
- }
- case 75973: // X-53 Touring Rocket
+ case 59317: // Teleporting
{
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
- // Triggered spell id dependent on riding skill
- if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
- {
- if (skillval >= 300)
- {
- if (unitTarget->ToPlayer()->Has310Flyer(false))
- unitTarget->CastSpell(unitTarget, 76154, true);
- else
- unitTarget->CastSpell(unitTarget, 75972, true);
- }
- else
- unitTarget->CastSpell(unitTarget, 75957, true);
- }
- return;
- }
- case 59317: // Teleporting
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4501,20 +4162,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->CastSpell(unitTarget, 59314, true);
return;
- // random spell learn instead placeholder
- case 60893: // Northrend Alchemy Research
- case 61177: // Northrend Inscription Research
- case 61288: // Minor Inscription Research
- case 61756: // Northrend Inscription Research (FAST QA VERSION)
- case 64323: // Book of Glyph Mastery
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // learn random explicit discovery recipe (if any)
- if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, m_caster->ToPlayer()))
- m_caster->ToPlayer()->learnSpell(discoveredSpell, false);
- return;
}
case 62482: // Grab Crate
{
@@ -4548,7 +4195,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 31893: spell_heal = 48084; break;
case 31883: spell_heal = 48085; break;
default:
- sLog->outError("Unknown Lightwell spell caster %u", m_caster->GetEntry());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unknown Lightwell spell caster %u", m_caster->GetEntry());
return;
}
@@ -4633,17 +4280,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->CastSpell(unitTarget, spellTarget[urand(0, 4)], true);
break;
}
- case 64142: // Upper Deck - Create Foam Sword
- if (unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
- Player* player = unitTarget->ToPlayer();
- static uint32 const itemId[] = {45061, 45176, 45177, 45178, 45179, 0};
- // player can only have one of these items
- for (uint32 const* itr = &itemId[0]; *itr; ++itr)
- if (player->HasItemCount(*itr, 1, true))
- return;
- DoCreateItem(effIndex, itemId[urand(0, 4)]);
- return;
}
break;
}
@@ -4665,7 +4301,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 57774: spellId1 = 20185; break; // Judgement of Light
case 53408: spellId1 = 20186; break; // Judgement of Wisdom
default:
- sLog->outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id);
return;
}
// all seals have aura dummy in 2 effect
@@ -4938,7 +4574,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
Player* target = (Player*)m_caster;
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck");
- sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
if (target->isInFlight())
return;
@@ -5104,16 +4740,14 @@ void Spell::EffectDisEnchant(SpellEffIndex /*effIndex*/)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
return;
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- Player* p_caster = (Player*)m_caster;
if (!itemTarget || !itemTarget->GetTemplate()->DisenchantID)
return;
- p_caster->UpdateCraftSkill(m_spellInfo->Id);
-
- m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING);
+ if (Player* caster = m_caster->ToPlayer())
+ {
+ caster->UpdateCraftSkill(m_spellInfo->Id);
+ caster->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING);
+ }
// item will be removed at disenchanting end
}
@@ -5126,16 +4760,18 @@ void Spell::EffectInebriate(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- Player* player = (Player*)unitTarget;
- uint16 currentDrunk = player->GetDrunkValue();
- uint16 drunkMod = damage * 256;
- if (currentDrunk + drunkMod > 0xFFFF)
+ Player* player = unitTarget->ToPlayer();
+ uint8 currentDrunk = player->GetDrunkValue();
+ uint8 drunkMod = damage;
+ if (currentDrunk + drunkMod > 100)
{
- currentDrunk = 0xFFFF;
- player->CastSpell(player, 67468, false);
+ currentDrunk = 100;
+ if (rand_chance() < 25.0f)
+ player->CastSpell(player, 67468, false); // Drunken Vomit
}
else
currentDrunk += drunkMod;
+
player->SetDrunkValue(currentDrunk, m_CastItem ? m_CastItem->GetEntry() : 0);
}
@@ -5547,6 +5183,10 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
if (creatureTarget->isWorldBoss() || creatureTarget->IsDungeonBoss())
return;
+ // Spells with SPELL_EFFECT_KNOCK_BACK(like Thunderstorm) can't knoback target if target has ROOT/STUN
+ if (unitTarget->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ return;
+
// Typhoon
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x01000000)
{
@@ -5853,7 +5493,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
if (!goinfo)
{
- sLog->outErrorDb("Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id, m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id, m_spellInfo->Id);
return;
}
@@ -5957,7 +5597,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
ExecuteLogEffectSummonObject(effIndex, pGameObj);
- sLog->outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted");
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AddObject at SpellEfects.cpp EffectTransmitted");
//m_caster->AddGameObject(pGameObj);
//m_ObjToDel.push_back(pGameObj);
@@ -6500,7 +6140,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex)
if (!sSoundEntriesStore.LookupEntry(soundid))
{
- sLog->outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
return;
}
@@ -6544,6 +6184,7 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex)
case 58730: // Restricted Flight Area
case 58600: // Restricted Flight Area
unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
+ unitTarget->PlayDirectSound(9417); // Fel Reaver sound
break;
}
@@ -6551,7 +6192,7 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex)
if (!sSoundEntriesStore.LookupEntry(soundid))
{
- sLog->outError("EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
return;
}
@@ -6661,7 +6302,7 @@ void Spell::EffectBind(SpellEffIndex effIndex)
SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id);
if (!st)
{
- sLog->outError("Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id);
return;
}
@@ -6689,11 +6330,11 @@ void Spell::EffectBind(SpellEffIndex effIndex)
data << uint32(area_id);
player->SendDirectMessage(&data);
- sLog->outStaticDebug("New homebind X : %f", loc.m_positionX);
- sLog->outStaticDebug("New homebind Y : %f", loc.m_positionY);
- sLog->outStaticDebug("New homebind Z : %f", loc.m_positionZ);
- sLog->outStaticDebug("New homebind MapId : %u", loc.m_mapId);
- sLog->outStaticDebug("New homebind AreaId : %u", area_id);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind X : %f", loc.m_positionX);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Y : %f", loc.m_positionY);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Z : %f", loc.m_positionZ);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind MapId : %u", loc.m_mapId);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind AreaId : %u", area_id);
// zone update
data.Initialize(SMSG_PLAYERBOUND, 8+4);
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 7995087f2c1..0531549cbd3 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -361,7 +361,7 @@ bool SpellEffectInfo::IsAura() const
bool SpellEffectInfo::IsAura(AuraType aura) const
{
- return IsAura() && ApplyAuraName == aura;
+ return IsAura() && ApplyAuraName == uint32(aura);
}
bool SpellEffectInfo::IsTargetingArea() const
@@ -1020,7 +1020,7 @@ bool SpellInfo::IsPassiveStackableWithRanks() const
bool SpellInfo::IsMultiSlotAura() const
{
- return IsPassive() || Id == 44413;
+ return IsPassive() || Id == 40075 || Id == 44413; // No other way to make 40075 have more than 1 copy of aura
}
bool SpellInfo::IsDeathPersistent() const
@@ -1127,10 +1127,6 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
bool SpellInfo::CanDispelAura(SpellInfo const* aura) const
{
- // These auras (like ressurection sickness) can't be dispelled
- if (aura->Attributes & SPELL_ATTR0_NEGATIVE_1)
- return false;
-
// These spells (like Mass Dispel) can dispell all auras
if (Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
return true;
@@ -1262,7 +1258,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
shapeInfo = sSpellShapeshiftStore.LookupEntry(form);
if (!shapeInfo)
{
- sLog->outError("GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
return SPELL_CAST_OK;
}
actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells
@@ -1736,6 +1732,7 @@ AuraStateType SpellInfo::GetAuraState() const
switch (Id)
{
case 71465: // Divine Surge
+ case 50241: // Evasive Charges
return AURA_STATE_UNKNOWN22;
default:
break;
@@ -2016,7 +2013,7 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask)
// Else drain all power
if (PowerType < MAX_POWERS)
return caster->GetPower(Powers(PowerType));
- sLog->outError("SpellInfo::CalcPowerCost: Unknown power type '%d' in spell %d", PowerType, Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "SpellInfo::CalcPowerCost: Unknown power type '%d' in spell %d", PowerType, Id);
return 0;
}
@@ -2045,7 +2042,7 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!");
break;
default:
- sLog->outError("CalculateManaCost: Unknown power type '%d' in spell %d", PowerType, Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Unknown power type '%d' in spell %d", PowerType, Id);
return 0;
}
}
@@ -2204,14 +2201,15 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
case SPELLFAMILY_GENERIC:
switch (Id)
{
+ case 29214: // Wrath of the Plaguebringer
case 34700: // Allergic Reaction
+ case 54836: // Wrath of the Plaguebringer
case 61987: // Avenging Wrath Marker
case 61988: // Divine Shield exclude aura
- case 62532: // Conservator's Grip
return false;
+ case 30877: // Tag Murloc
case 61716: // Rabbit Costume
case 61734: // Noblegarden Bunny
- case 30877: // Tag Murloc
case 62344: // Fists of Stone
return true;
default:
@@ -2297,6 +2295,8 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
case SPELL_EFFECT_HEAL_PCT:
case SPELL_EFFECT_ENERGIZE_PCT:
return true;
+ case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
+ return false;
// non-positive aura use
case SPELL_EFFECT_APPLY_AURA:
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 54430cd7116..2d53c7d8ace 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -67,7 +67,7 @@ enum SpellCastTargetFlags
| TARGET_FLAG_UNIT_ENEMY | TARGET_FLAG_UNIT_ALLY | TARGET_FLAG_UNIT_DEAD | TARGET_FLAG_UNIT_MINIPET | TARGET_FLAG_UNIT_PASSENGER,
TARGET_FLAG_GAMEOBJECT_MASK = TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_GAMEOBJECT_ITEM,
TARGET_FLAG_CORPSE_MASK = TARGET_FLAG_CORPSE_ALLY | TARGET_FLAG_CORPSE_ENEMY,
- TARGET_FLAG_ITEM_MASK = TARGET_FLAG_TRADE_ITEM | TARGET_FLAG_ITEM | TARGET_FLAG_GAMEOBJECT_ITEM,
+ TARGET_FLAG_ITEM_MASK = TARGET_FLAG_TRADE_ITEM | TARGET_FLAG_ITEM | TARGET_FLAG_GAMEOBJECT_ITEM
};
enum SpellTargetSelectionCategories
@@ -77,7 +77,7 @@ enum SpellTargetSelectionCategories
TARGET_SELECT_CATEGORY_CHANNEL,
TARGET_SELECT_CATEGORY_NEARBY,
TARGET_SELECT_CATEGORY_CONE,
- TARGET_SELECT_CATEGORY_AREA,
+ TARGET_SELECT_CATEGORY_AREA
};
enum SpellTargetReferenceTypes
@@ -87,7 +87,7 @@ enum SpellTargetReferenceTypes
TARGET_REFERENCE_TYPE_TARGET,
TARGET_REFERENCE_TYPE_LAST,
TARGET_REFERENCE_TYPE_SRC,
- TARGET_REFERENCE_TYPE_DEST,
+ TARGET_REFERENCE_TYPE_DEST
};
enum SpellTargetObjectTypes
@@ -103,7 +103,7 @@ enum SpellTargetObjectTypes
TARGET_OBJECT_TYPE_CORPSE,
// only for effect target type
TARGET_OBJECT_TYPE_CORPSE_ENEMY,
- TARGET_OBJECT_TYPE_CORPSE_ALLY,
+ TARGET_OBJECT_TYPE_CORPSE_ALLY
};
enum SpellTargetCheckTypes
@@ -115,7 +115,7 @@ enum SpellTargetCheckTypes
TARGET_CHECK_PARTY,
TARGET_CHECK_RAID,
TARGET_CHECK_RAID_CLASS,
- TARGET_CHECK_PASSENGER,
+ TARGET_CHECK_PASSENGER
};
enum SpellTargetDirectionTypes
@@ -130,14 +130,14 @@ enum SpellTargetDirectionTypes
TARGET_DIR_BACK_LEFT,
TARGET_DIR_FRONT_LEFT,
TARGET_DIR_RANDOM,
- TARGET_DIR_ENTRY,
+ TARGET_DIR_ENTRY
};
enum SpellEffectImplicitTargetTypes
{
EFFECT_IMPLICIT_TARGET_NONE = 0,
EFFECT_IMPLICIT_TARGET_EXPLICIT,
- EFFECT_IMPLICIT_TARGET_CASTER,
+ EFFECT_IMPLICIT_TARGET_CASTER
};
// Spell clasification
@@ -165,7 +165,7 @@ enum SpellSpecificType
SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE = 25,
SPELL_SPECIFIC_WARRIOR_ENRAGE = 26,
SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT = 27,
- SPELL_SPECIFIC_HAND = 28,
+ SPELL_SPECIFIC_HAND = 28
};
enum SpellCustomAttributes
@@ -187,7 +187,7 @@ enum SpellCustomAttributes
SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER = 0x00010000,
SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET = 0x00020000,
- SPELL_ATTR0_CU_NEGATIVE = SPELL_ATTR0_CU_NEGATIVE_EFF0 | SPELL_ATTR0_CU_NEGATIVE_EFF1 | SPELL_ATTR0_CU_NEGATIVE_EFF2,
+ SPELL_ATTR0_CU_NEGATIVE = SPELL_ATTR0_CU_NEGATIVE_EFF0 | SPELL_ATTR0_CU_NEGATIVE_EFF1 | SPELL_ATTR0_CU_NEGATIVE_EFF2
};
uint32 GetTargetFlagMask(SpellTargetObjectTypes objType);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index d9459b11ba1..70ec7bd4d68 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -30,6 +30,8 @@
#include "CreatureAI.h"
#include "MapManager.h"
#include "BattlegroundIC.h"
+#include "BattlefieldWG.h"
+#include "BattlefieldMgr.h"
bool IsPrimaryProfessionSkill(uint32 skill)
{
@@ -72,6 +74,9 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto,
// Pet charge effects (Infernal Awakening, Demon Charge)
if (spellproto->SpellVisual[0] == 2816 && spellproto->SpellIconID == 15)
return DIMINISHING_CONTROLLED_STUN;
+ // Frost Tomb
+ else if (spellproto->Id == 48400)
+ return DIMINISHING_NONE;
// Gnaw
else if (spellproto->Id == 47481)
return DIMINISHING_CONTROLLED_STUN;
@@ -370,7 +375,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Craft spell %u not have create item entry.", spellInfo->Id);
else
- sLog->outErrorDb("Craft spell %u not have create item entry.", spellInfo->Id);
+ sLog->outError(LOG_FILTER_SQL, "Craft spell %u not have create item entry.", spellInfo->Id);
}
return false;
}
@@ -384,7 +389,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
else
- sLog->outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
+ sLog->outError(LOG_FILTER_SQL, "Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
}
return false;
}
@@ -402,7 +407,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Spell %u learn to broken spell %u, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
else
- sLog->outErrorDb("Spell %u learn to invalid spell %u, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u learn to invalid spell %u, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
}
return false;
}
@@ -422,7 +427,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
else
- sLog->outErrorDb("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
+ sLog->outError(LOG_FILTER_SQL, "Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
}
return false;
}
@@ -454,7 +459,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
uint32 mode = uint32(caster->GetMap()->GetSpawnMode());
if (mode >= MAX_DIFFICULTY)
{
- sLog->outError("SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell %u.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell %u.", spellId);
return spellId; //return source spell
}
@@ -477,7 +482,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
if (difficultyEntry->SpellID[mode] <= 0)
{
- sLog->outErrorDb("SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
+ sLog->outError(LOG_FILTER_SQL, "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
return spellId;
}
@@ -1120,10 +1125,20 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
break;
}
+ case 58730: // No fly Zone - Wintergrasp
+ {
+ if (!player)
+ return false;
+
+ Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId());
+ if (!Bf || Bf->CanFlyIn() || (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY)))
+ return false;
+ break;
+ }
case 68719: // Oil Refinery - Isle of Conquest.
case 68720: // Quarry - Isle of Conquest.
{
- if (player->GetBattlegroundTypeId() != BATTLEGROUND_IC || !player->GetBattleground())
+ if (!player || player->GetBattlegroundTypeId() != BATTLEGROUND_IC || !player->GetBattleground())
return false;
uint8 nodeType = spellId == 68719 ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY;
@@ -1135,6 +1150,46 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
}
+ case 56618: // Horde Controls Factory Phase Shift
+ case 56617: // Alliance Controls Factory Phase Shift
+ {
+ if (!player)
+ return false;
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId());
+
+ if (!bf || bf->GetTypeId() != BATTLEFIELD_WG)
+ return false;
+
+ // team that controls the workshop in the specified area
+ uint32 team = bf->GetData(newArea);
+
+ if (team == TEAM_HORDE)
+ return spellId == 56618;
+ else if (team == TEAM_ALLIANCE)
+ return spellId == 56617;
+ }
+ break;
+ case 57940: // Essence of Wintergrasp - Northrend
+ case 58045: // Essence of Wintergrasp - Wintergrasp
+ {
+ if (!player)
+ return false;
+
+ if (Battlefield* battlefieldWG = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
+ return battlefieldWG->IsEnabled() && (player->GetTeamId() == battlefieldWG->GetDefenderTeam()) && !battlefieldWG->IsWarTime();
+ break;
+ }
+ case 74411: // Battleground - Dampening
+ {
+ if (!player)
+ return false;
+
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
+ return bf->IsWarTime();
+ break;
+ }
+
}
return true;
@@ -1155,8 +1210,8 @@ void SpellMgr::LoadSpellRanks()
if (!result)
{
- sLog->outString(">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
+
return;
}
@@ -1195,13 +1250,13 @@ void SpellMgr::LoadSpellRanks()
SpellInfo const* first = GetSpellInfo(lastSpell);
if (!first)
{
- sLog->outErrorDb("Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
continue;
}
// check if chain is long enough
if (rankChain.size() < 2)
{
- sLog->outErrorDb("There is only 1 spell rank for identifier(first_spell_id) %u in `spell_ranks`, entry is not needed!", lastSpell);
+ sLog->outError(LOG_FILTER_SQL, "There is only 1 spell rank for identifier(first_spell_id) %u in `spell_ranks`, entry is not needed!", lastSpell);
continue;
}
int32 curRank = 0;
@@ -1212,14 +1267,14 @@ void SpellMgr::LoadSpellRanks()
SpellInfo const* spell = GetSpellInfo(itr->first);
if (!spell)
{
- sLog->outErrorDb("Spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
valid = false;
break;
}
++curRank;
if (itr->second != curRank)
{
- sLog->outErrorDb("Spell %u (rank %u) listed in `spell_ranks` for chain %u does not have proper rank value(should be %u)!", itr->first, itr->second, lastSpell, curRank);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u (rank %u) listed in `spell_ranks` for chain %u does not have proper rank value(should be %u)!", itr->first, itr->second, lastSpell, curRank);
valid = false;
break;
}
@@ -1251,8 +1306,8 @@ void SpellMgr::LoadSpellRanks()
while (true);
} while (!finished);
- sLog->outString(">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellRequired()
@@ -1267,8 +1322,8 @@ void SpellMgr::LoadSpellRequired()
if (!result)
{
- sLog->outString(">> Loaded 0 spell required records. DB table `spell_required` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell required records. DB table `spell_required` is empty.");
+
return;
}
@@ -1284,26 +1339,26 @@ void SpellMgr::LoadSpellRequired()
SpellInfo const* spell = GetSpellInfo(spell_id);
if (!spell)
{
- sLog->outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
+ sLog->outError(LOG_FILTER_SQL, "spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
continue;
}
SpellInfo const* req_spell = GetSpellInfo(spell_req);
if (!req_spell)
{
- sLog->outErrorDb("req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
+ sLog->outError(LOG_FILTER_SQL, "req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
continue;
}
if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req))
{
- sLog->outErrorDb("req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
+ sLog->outError(LOG_FILTER_SQL, "req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
continue;
}
if (IsSpellRequiringSpell(spell_id, spell_req))
{
- sLog->outErrorDb("duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
+ sLog->outError(LOG_FILTER_SQL, "duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
continue;
}
@@ -1312,8 +1367,8 @@ void SpellMgr::LoadSpellRequired()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellLearnSkills()
@@ -1350,8 +1405,7 @@ void SpellMgr::LoadSpellLearnSkills()
}
}
- sLog->outString(">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellLearnSpells()
@@ -1364,8 +1418,7 @@ void SpellMgr::LoadSpellLearnSpells()
QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
if (!result)
{
- sLog->outString(">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
return;
}
@@ -1383,19 +1436,19 @@ void SpellMgr::LoadSpellLearnSpells()
if (!GetSpellInfo(spell_id))
{
- sLog->outErrorDb("Spell %u listed in `spell_learn_spell` does not exist", spell_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_learn_spell` does not exist", spell_id);
continue;
}
if (!GetSpellInfo(node.spell))
{
- sLog->outErrorDb("Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell);
continue;
}
if (GetTalentSpellCost(node.spell))
{
- sLog->outErrorDb("Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell);
continue;
}
@@ -1437,7 +1490,7 @@ void SpellMgr::LoadSpellLearnSpells()
{
if (itr->second.spell == dbc_node.spell)
{
- sLog->outErrorDb("Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
+ sLog->outError(LOG_FILTER_SQL, "Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
spell, dbc_node.spell);
found = true;
break;
@@ -1453,8 +1506,7 @@ void SpellMgr::LoadSpellLearnSpells()
}
}
- sLog->outString(">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellTargetPositions()
@@ -1467,8 +1519,7 @@ void SpellMgr::LoadSpellTargetPositions()
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
if (!result)
{
- sLog->outString(">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
return;
}
@@ -1490,20 +1541,20 @@ void SpellMgr::LoadSpellTargetPositions()
MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId);
if (!mapEntry)
{
- sLog->outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Spell_ID, st.target_mapId);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Spell_ID, st.target_mapId);
continue;
}
if (st.target_X==0 && st.target_Y==0 && st.target_Z==0)
{
- sLog->outErrorDb("Spell (ID:%u) target coordinates not provided.", Spell_ID);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID:%u) target coordinates not provided.", Spell_ID);
continue;
}
SpellInfo const* spellInfo = GetSpellInfo(Spell_ID);
if (!spellInfo)
{
- sLog->outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.", Spell_ID);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID:%u) listed in `spell_target_position` does not exist.", Spell_ID);
continue;
}
@@ -1518,7 +1569,7 @@ void SpellMgr::LoadSpellTargetPositions()
uint32 area_id = sMapMgr->GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z);
if (area_id != uint32(spellInfo->Effects[i].MiscValue))
{
- sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.", Spell_ID, spellInfo->Effects[i].MiscValue, area_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.", Spell_ID, spellInfo->Effects[i].MiscValue, area_id);
break;
}
}
@@ -1529,7 +1580,7 @@ void SpellMgr::LoadSpellTargetPositions()
}
if (!found)
{
- sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID);
+ sLog->outError(LOG_FILTER_SQL, "Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID);
continue;
}
@@ -1573,8 +1624,7 @@ void SpellMgr::LoadSpellTargetPositions()
}
}*/
- sLog->outString(">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellGroups()
@@ -1588,8 +1638,7 @@ void SpellMgr::LoadSpellGroups()
QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
if (!result)
{
- sLog->outString(">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
return;
}
@@ -1602,7 +1651,7 @@ void SpellMgr::LoadSpellGroups()
uint32 group_id = fields[0].GetUInt32();
if (group_id <= SPELL_GROUP_DB_RANGE_MIN && group_id >= SPELL_GROUP_CORE_RANGE_MAX)
{
- sLog->outErrorDb("SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id);
+ sLog->outError(LOG_FILTER_SQL, "SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id);
continue;
}
int32 spell_id = fields[1].GetInt32();
@@ -1618,7 +1667,7 @@ void SpellMgr::LoadSpellGroups()
{
if (groups.find(abs(itr->second)) == groups.end())
{
- sLog->outErrorDb("SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second));
+ sLog->outError(LOG_FILTER_SQL, "SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second));
mSpellGroupSpell.erase(itr++);
}
else
@@ -1630,12 +1679,12 @@ void SpellMgr::LoadSpellGroups()
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_group` does not exist", itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_group` does not exist", itr->second);
mSpellGroupSpell.erase(itr++);
}
else if (spellInfo->GetRank() > 1)
{
- sLog->outErrorDb("Spell %u listed in `spell_group` is not first rank of spell", itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_group` is not first rank of spell", itr->second);
mSpellGroupSpell.erase(itr++);
}
else
@@ -1655,8 +1704,7 @@ void SpellMgr::LoadSpellGroups()
}
}
- sLog->outString(">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellGroupStackRules()
@@ -1669,8 +1717,7 @@ void SpellMgr::LoadSpellGroupStackRules()
QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
if (!result)
{
- sLog->outString(">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
return;
}
@@ -1683,7 +1730,7 @@ void SpellMgr::LoadSpellGroupStackRules()
uint8 stack_rule = fields[1].GetInt8();
if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX)
{
- sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
+ sLog->outError(LOG_FILTER_SQL, "SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
continue;
}
@@ -1691,7 +1738,7 @@ void SpellMgr::LoadSpellGroupStackRules()
if (spellGroup.first == spellGroup.second)
{
- sLog->outErrorDb("SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id);
+ sLog->outError(LOG_FILTER_SQL, "SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id);
continue;
}
@@ -1700,8 +1747,7 @@ void SpellMgr::LoadSpellGroupStackRules()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellProcEvents()
@@ -1714,8 +1760,7 @@ void SpellMgr::LoadSpellProcEvents()
QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if (!result)
{
- sLog->outString(">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
return;
}
@@ -1730,7 +1775,7 @@ void SpellMgr::LoadSpellProcEvents()
SpellInfo const* spell = GetSpellInfo(entry);
if (!spell)
{
- sLog->outErrorDb("Spell %u listed in `spell_proc_event` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` does not exist", entry);
continue;
}
@@ -1753,7 +1798,7 @@ void SpellMgr::LoadSpellProcEvents()
{
if (spe.procFlags == 0)
{
- sLog->outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` probally not triggered spell", entry);
continue;
}
customProc++;
@@ -1762,10 +1807,10 @@ void SpellMgr::LoadSpellProcEvents()
} while (result->NextRow());
if (customProc)
- sLog->outString(">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outString(">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellProcs()
@@ -1778,8 +1823,7 @@ void SpellMgr::LoadSpellProcs()
QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
if (!result)
{
- sLog->outString(">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
return;
}
@@ -1800,7 +1844,7 @@ void SpellMgr::LoadSpellProcs()
SpellInfo const* spellEntry = GetSpellInfo(spellId);
if (!spellEntry)
{
- sLog->outErrorDb("Spell %u listed in `spell_proc` does not exist", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` does not exist", spellId);
continue;
}
@@ -1808,7 +1852,7 @@ void SpellMgr::LoadSpellProcs()
{
if (GetFirstSpellInChain(spellId) != uint32(spellId))
{
- sLog->outErrorDb("Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32());
continue;
}
}
@@ -1835,7 +1879,7 @@ void SpellMgr::LoadSpellProcs()
{
if (mSpellProcMap.find(spellId) != mSpellProcMap.end())
{
- sLog->outErrorDb("Spell %u listed in `spell_proc` has duplicate entry in the table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellId);
break;
}
SpellProcEntry procEntry = SpellProcEntry(baseProcEntry);
@@ -1850,47 +1894,47 @@ void SpellMgr::LoadSpellProcs()
// validate data
if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask);
if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName);
if (procEntry.chance < 0)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId);
procEntry.chance = 0;
}
if (procEntry.ratePerMinute < 0)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId);
procEntry.ratePerMinute = 0;
}
if (cooldown < 0)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId);
procEntry.cooldown = 0;
}
if (procEntry.chance == 0 && procEntry.ratePerMinute == 0)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId);
if (procEntry.charges > 99)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId);
procEntry.charges = 99;
}
if (!procEntry.typeMask)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId);
if (procEntry.spellTypeMask & ~PROC_SPELL_PHASE_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask);
if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId);
if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId);
if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask);
if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId);
if (procEntry.hitMask & ~PROC_HIT_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask);
if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId);
mSpellProcMap[spellId] = procEntry;
@@ -1905,8 +1949,7 @@ void SpellMgr::LoadSpellProcs()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellBonusess()
@@ -1919,8 +1962,7 @@ void SpellMgr::LoadSpellBonusess()
QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
if (!result)
{
- sLog->outString(">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
return;
}
@@ -1933,7 +1975,7 @@ void SpellMgr::LoadSpellBonusess()
SpellInfo const* spell = GetSpellInfo(entry);
if (!spell)
{
- sLog->outErrorDb("Spell %u listed in `spell_bonus_data` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_bonus_data` does not exist", entry);
continue;
}
@@ -1946,8 +1988,7 @@ void SpellMgr::LoadSpellBonusess()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellThreats()
@@ -1960,8 +2001,7 @@ void SpellMgr::LoadSpellThreats()
QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat");
if (!result)
{
- sLog->outString(">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
return;
}
@@ -1974,7 +2014,7 @@ void SpellMgr::LoadSpellThreats()
if (!GetSpellInfo(entry))
{
- sLog->outErrorDb("Spell %u listed in `spell_threat` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_threat` does not exist", entry);
continue;
}
@@ -1987,8 +2027,7 @@ void SpellMgr::LoadSpellThreats()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSkillLineAbilityMap()
@@ -2009,8 +2048,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
++count;
}
- sLog->outString(">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellPetAuras()
@@ -2023,8 +2061,7 @@ void SpellMgr::LoadSpellPetAuras()
QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
if (!result)
{
- sLog->outString(">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
return;
}
@@ -2046,21 +2083,21 @@ void SpellMgr::LoadSpellPetAuras()
SpellInfo const* spellInfo = GetSpellInfo(spell);
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_pet_auras` does not exist", spell);
continue;
}
if (spellInfo->Effects[eff].Effect != SPELL_EFFECT_DUMMY &&
(spellInfo->Effects[eff].Effect != SPELL_EFFECT_APPLY_AURA ||
spellInfo->Effects[eff].ApplyAuraName != SPELL_AURA_DUMMY))
{
- sLog->outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
continue;
}
SpellInfo const* spellInfo2 = GetSpellInfo(aura);
if (!spellInfo2)
{
- sLog->outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura);
+ sLog->outError(LOG_FILTER_SQL, "Aura %u listed in `spell_pet_auras` does not exist", aura);
continue;
}
@@ -2071,8 +2108,7 @@ void SpellMgr::LoadSpellPetAuras()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
// Fill custom data about enchancments
@@ -2112,8 +2148,7 @@ void SpellMgr::LoadEnchantCustomAttr()
}
}
- sLog->outString(">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellEnchantProcData()
@@ -2126,8 +2161,7 @@ void SpellMgr::LoadSpellEnchantProcData()
QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
if (!result)
{
- sLog->outString(">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
return;
}
@@ -2141,7 +2175,7 @@ void SpellMgr::LoadSpellEnchantProcData()
SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchantId);
if (!ench)
{
- sLog->outErrorDb("Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId);
+ sLog->outError(LOG_FILTER_SQL, "Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId);
continue;
}
@@ -2156,8 +2190,7 @@ void SpellMgr::LoadSpellEnchantProcData()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellLinked()
@@ -2170,8 +2203,7 @@ void SpellMgr::LoadSpellLinked()
QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
if (!result)
{
- sLog->outString(">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
return;
}
@@ -2187,13 +2219,13 @@ void SpellMgr::LoadSpellLinked()
SpellInfo const* spellInfo = GetSpellInfo(abs(trigger));
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
continue;
}
spellInfo = GetSpellInfo(abs(effect));
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
continue;
}
@@ -2209,8 +2241,7 @@ void SpellMgr::LoadSpellLinked()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadPetLevelupSpellMap()
@@ -2266,8 +2297,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
}
}
- sLog->outString(">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime));
}
bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpellsEntry& petDefSpells)
@@ -2351,10 +2381,9 @@ void SpellMgr::LoadPetDefaultSpells()
}
}
- sLog->outString(">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString("Loading summonable creature templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading summonable creature templates...");
oldMSTime = getMSTime();
// different summon spells
@@ -2395,8 +2424,7 @@ void SpellMgr::LoadPetDefaultSpells()
}
}
- sLog->outString(">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellAreas()
@@ -2414,8 +2442,8 @@ void SpellMgr::LoadSpellAreas()
if (!result)
{
- sLog->outString(">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
+
return;
}
@@ -2443,7 +2471,7 @@ void SpellMgr::LoadSpellAreas()
}
else
{
- sLog->outErrorDb("Spell %u listed in `spell_area` does not exist", spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` does not exist", spell);
continue;
}
@@ -2472,20 +2500,20 @@ void SpellMgr::LoadSpellAreas()
if (!ok)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` already listed with similar requirements.", spell);
continue;
}
}
if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId);
continue;
}
if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart))
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.questStart);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.questStart);
continue;
}
@@ -2493,13 +2521,13 @@ void SpellMgr::LoadSpellAreas()
{
if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd))
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd);
continue;
}
if (spellArea.questEnd == spellArea.questStart && !spellArea.questStartCanActive)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd);
continue;
}
}
@@ -2509,13 +2537,13 @@ void SpellMgr::LoadSpellAreas()
SpellInfo const* spellInfo = GetSpellInfo(abs(spellArea.auraSpell));
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell));
continue;
}
if (uint32(abs(spellArea.auraSpell)) == spellArea.spellId)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
continue;
}
@@ -2535,7 +2563,7 @@ void SpellMgr::LoadSpellAreas()
if (chain)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
continue;
}
@@ -2551,7 +2579,7 @@ void SpellMgr::LoadSpellAreas()
if (chain)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
continue;
}
}
@@ -2559,13 +2587,13 @@ void SpellMgr::LoadSpellAreas()
if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.raceMask);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.raceMask);
continue;
}
if (spellArea.gender != GENDER_NONE && spellArea.gender != GENDER_FEMALE && spellArea.gender != GENDER_MALE)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender);
continue;
}
@@ -2595,8 +2623,7 @@ void SpellMgr::LoadSpellAreas()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellInfoStore()
@@ -2612,8 +2639,7 @@ void SpellMgr::LoadSpellInfoStore()
mSpellInfoMap[i] = new SpellInfo(spellEntry);
}
- sLog->outString(">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::UnloadSpellInfoStore()
@@ -2749,6 +2775,10 @@ void SpellMgr::LoadSpellCustomAttr()
switch (spellInfo->Id)
{
+ case 60256:
+ //Crashes client on pressing ESC (Maybe because of ReqSpellFocus and GameObject)
+ spellInfo->AttributesEx4 &= ~SPELL_ATTR4_TRIGGERED;
+ break;
case 1776: // Gouge
case 1777:
case 8629:
@@ -2925,8 +2955,7 @@ void SpellMgr::LoadSpellCustomAttr()
CreatureAI::FillAISpellInfo();
- sLog->outString(">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadDbcDataCorrections()
@@ -2960,8 +2989,20 @@ void SpellMgr::LoadDbcDataCorrections()
switch (spellInfo->Id)
{
- case 40244: case 40245: // Simon Game Visual
- case 40246: case 40247: // Simon Game Visual
+ case 42730:
+ spellInfo->EffectTriggerSpell[EFFECT_1] = 42739;
+ break;
+ case 59735:
+ spellInfo->EffectTriggerSpell[EFFECT_1] = 59736;
+ break;
+ case 52611: // Summon Skeletons
+ case 52612: // Summon Skeletons
+ spellInfo->EffectMiscValueB[0] = 64;
+ break;
+ case 40244: // Simon Game Visual
+ case 40245: // Simon Game Visual
+ case 40246: // Simon Game Visual
+ case 40247: // Simon Game Visual
case 42835: // Spout, remove damage effect, only anim is needed
spellInfo->Effect[0] = 0;
break;
@@ -2973,7 +3014,6 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetB[0] = 0;
break;
case 63665: // Charge (Argent Tournament emote on riders)
- case 31447: // Mark of Kaz'rogal (needs target selection script)
case 31298: // Sleep (needs target selection script)
case 51904: // Summon Ghouls On Scarlet Crusade (this should use conditions table, script for this spell needs to be fixed)
case 2895: // Wrath of Air Totem rank 1 (Aura)
@@ -3128,6 +3168,9 @@ void SpellMgr::LoadDbcDataCorrections()
case 51852: // The Eye of Acherus (no spawn in phase 2 in db)
spellInfo->EffectMiscValue[0] |= 1;
break;
+ case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster
+ spellInfo->EffectAmplitude[0] = 3000;
+ break;
case 29809: // Desecration Arm - 36 instead of 37 - typo? :/
spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_7_YARDS;
break;
@@ -3237,9 +3280,21 @@ void SpellMgr::LoadDbcDataCorrections()
// this needs research on modifier applying rules, does not seem to be in Attributes fields
spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000);
break;
- case 63163: // Apply Enchanted Bridle (Argent Tournament)
- spellInfo->EffectDieSides[0] = 0; // was 1, that should probably mean seat 0, but instead it's treated as spell 1
- spellInfo->EffectBasePoints[0] = 52391; // Ride Vehicle (forces seat 0)
+ case 64949: // Idol of the Flourishing Life
+ spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x00000000, 0x02000000, 0x00000000);
+ spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER;
+ break;
+ case 34231: // Libram of the Lightbringer
+ case 60792: // Libram of Tolerance
+ case 64956: // Libram of the Resolute
+ spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x80000000, 0x00000000, 0x00000000);
+ spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER;
+ break;
+ case 28851: // Libram of Light
+ case 28853: // Libram of Divinity
+ case 32403: // Blessed Book of Nagrand
+ spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x40000000, 0x00000000, 0x00000000);
+ spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER;
break;
case 45602: // Ride Carpet
spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)"
@@ -3258,9 +3313,16 @@ void SpellMgr::LoadDbcDataCorrections()
case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc
spellInfo->CastingTimeIndex = 1;
break;
+ case 59414: // Pulsing Shockwave Aura (Loken)
+ // this flag breaks movement, remove it
+ spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1;
+ break;
case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with
spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
break;
+ case 70650: // Death Knight T10 Tank 2P Bonus
+ spellInfo->EffectApplyAuraName[0] = SPELL_AURA_ADD_PCT_MODIFIER;
+ break;
// ULDUAR SPELLS
//
case 62374: // Pursued (Flame Leviathan)
@@ -3299,11 +3361,6 @@ void SpellMgr::LoadDbcDataCorrections()
// that will be clear if we get more spells with problem like this
spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY;
break;
- case 62584: // Lifebinder's Gift
- case 64185: // Lifebinder's Gift
- spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_NEARBY_ENTRY;
- spellInfo->EffectImplicitTargetB[2] = TARGET_UNIT_NEARBY_ENTRY;
- break;
case 62301: // Cosmic Smash (Algalon the Observer)
spellInfo->MaxAffectedTargets = 1;
break;
@@ -3382,6 +3439,9 @@ void SpellMgr::LoadDbcDataCorrections()
case 71159: // Awaken Plagued Zombies
spellInfo->DurationIndex = 21;
break;
+ case 70530: // Volatile Ooze Beam Protection (Professor Putricide)
+ spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID
+ break;
// THIS IS HERE BECAUSE COOLDOWN ON CREATURE PROCS IS NOT IMPLEMENTED
case 71604: // Mutated Strength (Professor Putricide)
case 72673: // Mutated Strength (Professor Putricide)
@@ -3435,7 +3495,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd
break;
case 70598: // Sindragosa's Fury
- spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_CASTER;
+ spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST;
break;
case 69846: // Frost Bomb
spellInfo->speed = 0.0f; // This spell's summon happens instantly
@@ -3545,11 +3605,6 @@ void SpellMgr::LoadDbcDataCorrections()
switch (spellInfo->SpellFamilyName)
{
- case SPELLFAMILY_DRUID:
- // Starfall Target Selection
- if (spellInfo->SpellFamilyFlags[2] & 0x100)
- spellInfo->MaxAffectedTargets = 2;
- break;
case SPELLFAMILY_PALADIN:
// Seals of the Pure should affect Seal of Righteousness
if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
@@ -3568,6 +3623,5 @@ void SpellMgr::LoadDbcDataCorrections()
properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893
properties->Type = SUMMON_TYPE_TOTEM;
- sLog->outString(">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index dcf3c38fe4f..9423ebf2893 100755
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -38,8 +38,8 @@ enum SpellCategories
SPELLCATEGORY_HEALTH_MANA_POTIONS = 4,
SPELLCATEGORY_DEVOUR_MAGIC = 12,
SPELLCATEGORY_JUDGEMENT = 1210, // Judgement (seal trigger)
- SPELLCATEGORY_FOOD = 11,
- SPELLCATEGORY_DRINK = 59,
+ SPELLCATEGORY_FOOD = 11,
+ SPELLCATEGORY_DRINK = 59
};
//SpellFamilyFlags
@@ -85,7 +85,7 @@ enum SpellFamilyFlag
SPELLFAMILYFLAG_DK_DEATH_COIL = 0x00002000,
// TODO: Figure out a more accurate name for the following familyflag(s)
- SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS = 0x04000000, // Seems to be linked to most totems and some totem effects
+ SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS = 0x04000000 // Seems to be linked to most totems and some totem effects
};
@@ -96,7 +96,7 @@ enum SpellLinkedType
SPELL_LINK_CAST = 0, // +: cast; -: remove
SPELL_LINK_HIT = 1 * 200000,
SPELL_LINK_AURA = 2 * 200000, // +: aura; -: immune
- SPELL_LINK_REMOVE = 0,
+ SPELL_LINK_REMOVE = 0
};
@@ -177,7 +177,7 @@ enum ProcFlags
| PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
| PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_TAKEN_DAMAGE,
- REQ_SPELL_PHASE_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK & DONE_HIT_PROC_FLAG_MASK,
+ REQ_SPELL_PHASE_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK & DONE_HIT_PROC_FLAG_MASK
};
#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_DONE_MELEE_AUTO_ATTACK | \
@@ -261,12 +261,12 @@ enum ProcFlagsHit
PROC_HIT_REFLECT = 0x0000800,
PROC_HIT_INTERRUPT = 0x0001000, // (not used atm)
PROC_HIT_FULL_BLOCK = 0x0002000,
- PROC_HIT_MASK_ALL = 0x2FFF,
+ PROC_HIT_MASK_ALL = 0x2FFF
};
enum ProcAttributes
{
- PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000010,
+ PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000010
};
struct SpellProcEventEntry
@@ -322,12 +322,12 @@ typedef UNORDERED_MAP<uint32, SpellBonusEntry> SpellBonusMap;
enum SpellGroup
{
- SPELL_GROUP_NONE = 0,
- SPELL_GROUP_ELIXIR_BATTLE = 1,
- SPELL_GROUP_ELIXIR_GUARDIAN = 2,
- SPELL_GROUP_ELIXIR_UNSTABLE = 3,
+ SPELL_GROUP_NONE = 0,
+ SPELL_GROUP_ELIXIR_BATTLE = 1,
+ SPELL_GROUP_ELIXIR_GUARDIAN = 2,
+ SPELL_GROUP_ELIXIR_UNSTABLE = 3,
SPELL_GROUP_ELIXIR_SHATTRATH = 4,
- SPELL_GROUP_CORE_RANGE_MAX = 5,
+ SPELL_GROUP_CORE_RANGE_MAX = 5
};
#define SPELL_GROUP_DB_RANGE_MIN 1000
@@ -342,11 +342,12 @@ typedef std::pair<SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_
enum SpellGroupStackRule
{
- SPELL_GROUP_STACK_RULE_DEFAULT = 0,
- SPELL_GROUP_STACK_RULE_EXCLUSIVE = 1,
+ SPELL_GROUP_STACK_RULE_DEFAULT = 0,
+ SPELL_GROUP_STACK_RULE_EXCLUSIVE = 1,
SPELL_GROUP_STACK_RULE_EXCLUSIVE_FROM_SAME_CASTER = 2,
- SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT = 3,
+ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT = 3
};
+
#define SPELL_GROUP_STACK_RULE_MAX 4
typedef std::map<SpellGroup, SpellGroupStackRule> SpellGroupStackMap;
@@ -441,7 +442,7 @@ class PetAura
typedef UNORDERED_MAP<uint32, uint32> PetAuraMap;
public:
- PetAura()
+ PetAura() : removeOnChangePet(false), damage(0)
{
auras.clear();
}
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index e6ce80c20f0..f7ab6e22f2e 100755
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -25,7 +25,7 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
{
if (!Validate(entry))
{
- sLog->outError("TSCR: Spell `%u` did not pass Validate() function of script `%s` - script will be not added to the spell", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` did not pass Validate() function of script `%s` - script will be not added to the spell", entry->Id, m_scriptName->c_str());
return false;
}
return true;
@@ -203,52 +203,110 @@ void SpellScript::HitHandler::Call(SpellScript* spellScript)
(spellScript->*pHitHandlerScript)();
}
-SpellScript::UnitTargetHandler::UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType)
- : _SpellScript::EffectHook(_effIndex), targetType(_targetType)
+SpellScript::TargetHook::TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area)
+ : _SpellScript::EffectHook(_effectIndex), targetType(_targetType), area(_area)
{
- pUnitTargetHandlerScript = _pUnitTargetHandlerScript;
}
-std::string SpellScript::UnitTargetHandler::ToString()
+std::string SpellScript::TargetHook::ToString()
{
std::ostringstream oss;
oss << "Index: " << EffIndexToString() << " Target: " << targetType;
return oss.str();
}
-bool SpellScript::UnitTargetHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
+bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
{
if (!targetType)
return false;
- return (effIndex == EFFECT_ALL) || (spellEntry->Effects[effIndex].TargetA.GetTarget() == targetType || spellEntry->Effects[effIndex].TargetB.GetTarget() == targetType);
+
+ if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType &&
+ spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType)
+ return false;
+
+ SpellImplicitTargetInfo targetInfo(targetType);
+ switch (targetInfo.GetSelectionCategory())
+ {
+ case TARGET_SELECT_CATEGORY_CHANNEL: // SINGLE
+ return !area;
+ case TARGET_SELECT_CATEGORY_NEARBY: // BOTH
+ return true;
+ case TARGET_SELECT_CATEGORY_CONE: // AREA
+ case TARGET_SELECT_CATEGORY_AREA: // AREA
+ return area;
+ case TARGET_SELECT_CATEGORY_DEFAULT:
+ switch (targetInfo.GetObjectType())
+ {
+ case TARGET_OBJECT_TYPE_SRC: // EMPTY
+ case TARGET_OBJECT_TYPE_DEST: // EMPTY
+ return false;
+ default:
+ switch (targetInfo.GetReferenceType())
+ {
+ case TARGET_REFERENCE_TYPE_CASTER: // SINGLE
+ return !area;
+ case TARGET_REFERENCE_TYPE_TARGET: // BOTH
+ return true;
+ default:
+ break;
+ }
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return false;
+}
+
+SpellScript::ObjectAreaTargetSelectHandler::ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType)
+ : TargetHook(_effIndex, _targetType, true)
+{
+ pObjectAreaTargetSelectHandlerScript = _pObjectAreaTargetSelectHandlerScript;
}
-void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list<Unit*>& unitTargets)
+void SpellScript::ObjectAreaTargetSelectHandler::Call(SpellScript* spellScript, std::list<WorldObject*>& targets)
{
- (spellScript->*pUnitTargetHandlerScript)(unitTargets);
+ (spellScript->*pObjectAreaTargetSelectHandlerScript)(targets);
+}
+
+SpellScript::ObjectTargetSelectHandler::ObjectTargetSelectHandler(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType)
+ : TargetHook(_effIndex, _targetType, false)
+{
+ pObjectTargetSelectHandlerScript = _pObjectTargetSelectHandlerScript;
+}
+
+void SpellScript::ObjectTargetSelectHandler::Call(SpellScript* spellScript, WorldObject*& target)
+{
+ (spellScript->*pObjectTargetSelectHandlerScript)(target);
}
bool SpellScript::_Validate(SpellInfo const* entry)
{
- for (std::list<EffectHandler>::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr)
+ for (std::list<EffectHandler>::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr)
+ for (std::list<EffectHandler>::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr)
+ for (std::list<EffectHandler>::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr)
+ for (std::list<EffectHandler>::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<UnitTargetHandler>::iterator itr = OnUnitTargetSelect.begin(); itr != OnUnitTargetSelect.end(); ++itr)
+ for (std::list<ObjectAreaTargetSelectHandler>::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnUnitTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+
+ for (std::list<ObjectTargetSelectHandler>::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr)
+ if (!(*itr).GetAffectedEffectsMask(entry))
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
return _SpellScript::_Validate(entry);
}
@@ -356,7 +414,7 @@ Unit* SpellScript::GetHitUnit()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->unitTarget;
@@ -366,7 +424,7 @@ Creature* SpellScript::GetHitCreature()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
if (m_spell->unitTarget)
@@ -379,7 +437,7 @@ Player* SpellScript::GetHitPlayer()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
if (m_spell->unitTarget)
@@ -392,7 +450,7 @@ Item* SpellScript::GetHitItem()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->itemTarget;
@@ -402,7 +460,7 @@ GameObject* SpellScript::GetHitGObj()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->gameObjTarget;
@@ -412,7 +470,7 @@ WorldLocation* SpellScript::GetHitDest()
{
if (!IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->destTarget;
@@ -422,7 +480,7 @@ int32 SpellScript::GetHitDamage()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return 0;
}
return m_spell->m_damage;
@@ -432,7 +490,7 @@ void SpellScript::SetHitDamage(int32 damage)
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_spell->m_damage = damage;
@@ -442,7 +500,7 @@ int32 SpellScript::GetHitHeal()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return 0;
}
return m_spell->m_healing;
@@ -452,7 +510,7 @@ void SpellScript::SetHitHeal(int32 heal)
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_spell->m_healing = heal;
@@ -462,7 +520,7 @@ Aura* SpellScript::GetHitAura()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
if (!m_spell->m_spellAura)
@@ -476,7 +534,7 @@ void SpellScript::PreventHitAura()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
if (m_spell->m_spellAura)
@@ -487,7 +545,7 @@ void SpellScript::PreventHitEffect(SpellEffIndex effIndex)
{
if (!IsInHitPhase() && !IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_hitPreventEffectMask |= 1 << effIndex;
@@ -498,7 +556,7 @@ void SpellScript::PreventHitDefaultEffect(SpellEffIndex effIndex)
{
if (!IsInHitPhase() && !IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_hitPreventDefaultEffectMask |= 1 << effIndex;
@@ -508,7 +566,7 @@ int32 SpellScript::GetEffectValue()
{
if (!IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return 0;
}
return m_spell->damage;
@@ -539,7 +597,7 @@ void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result)
{
if (!IsInCheckCastHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
@@ -555,67 +613,71 @@ bool AuraScript::_Validate(SpellInfo const* entry)
{
for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
if (!entry->HasAreaAuraEffect())
- sLog->outError("TSCR: Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
for (std::list<AuraDispelHandler>::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
- sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
for (std::list<AuraDispelHandler>::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
- sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectPeriodicHandler>::iterator itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectUpdatePeriodicHandler>::iterator itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectCalcAmountHandler>::iterator itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectCalcPeriodicHandler>::iterator itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectCalcSpellModHandler>::iterator itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectAbsorbHandler>::iterator itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectAbsorbHandler>::iterator itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectManaShieldHandler>::iterator itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectManaShieldHandler>::iterator itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+
+ for (std::list<EffectSplitHandler>::iterator itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr)
+ if (!(*itr).GetAffectedEffectsMask(entry))
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
return _SpellScript::_Validate(entry);
}
@@ -745,6 +807,17 @@ void AuraScript::EffectManaShieldHandler::Call(AuraScript* auraScript, AuraEffec
(auraScript->*pEffectHandlerScript)(aurEff, dmgInfo, absorbAmount);
}
+AuraScript::EffectSplitHandler::EffectSplitHandler(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex)
+ : AuraScript::EffectBase(_effIndex, SPELL_AURA_SPLIT_DAMAGE_PCT)
+{
+ pEffectHandlerScript = _pEffectHandlerScript;
+}
+
+void AuraScript::EffectSplitHandler::Call(AuraScript* auraScript, AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& splitAmount)
+{
+ (auraScript->*pEffectHandlerScript)(aurEff, dmgInfo, splitAmount);
+}
+
bool AuraScript::_Load(Aura* aura)
{
m_aura = aura;
@@ -779,6 +852,7 @@ bool AuraScript::_IsDefaultActionPrevented()
case AURA_SCRIPT_HOOK_EFFECT_REMOVE:
case AURA_SCRIPT_HOOK_EFFECT_PERIODIC:
case AURA_SCRIPT_HOOK_EFFECT_ABSORB:
+ case AURA_SCRIPT_HOOK_EFFECT_SPLIT:
return m_defaultActionPrevented;
default:
ASSERT(false && "AuraScript::_IsDefaultActionPrevented is called in a wrong place");
@@ -794,10 +868,11 @@ void AuraScript::PreventDefaultAction()
case AURA_SCRIPT_HOOK_EFFECT_REMOVE:
case AURA_SCRIPT_HOOK_EFFECT_PERIODIC:
case AURA_SCRIPT_HOOK_EFFECT_ABSORB:
+ case AURA_SCRIPT_HOOK_EFFECT_SPLIT:
m_defaultActionPrevented = true;
break;
default:
- sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
break;
}
}
@@ -975,9 +1050,10 @@ Unit* AuraScript::GetTarget() const
case AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB:
case AURA_SCRIPT_HOOK_EFFECT_MANASHIELD:
case AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD:
+ case AURA_SCRIPT_HOOK_EFFECT_SPLIT:
return m_auraApplication->GetTarget();
default:
- sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
}
return NULL;
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 7b194b7827f..a5d77806739 100755
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -47,7 +47,7 @@ enum SpellScriptState
SPELL_SCRIPT_STATE_NONE = 0,
SPELL_SCRIPT_STATE_REGISTRATION,
SPELL_SCRIPT_STATE_LOADING,
- SPELL_SCRIPT_STATE_UNLOADING,
+ SPELL_SCRIPT_STATE_UNLOADING
};
#define SPELL_SCRIPT_STATE_END SPELL_SCRIPT_STATE_UNLOADING + 1
@@ -131,11 +131,12 @@ enum SpellScriptHookType
SPELL_SCRIPT_HOOK_BEFORE_HIT,
SPELL_SCRIPT_HOOK_HIT,
SPELL_SCRIPT_HOOK_AFTER_HIT,
- SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT,
+ SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT,
+ SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT,
SPELL_SCRIPT_HOOK_CHECK_CAST,
SPELL_SCRIPT_HOOK_BEFORE_CAST,
SPELL_SCRIPT_HOOK_ON_CAST,
- SPELL_SCRIPT_HOOK_AFTER_CAST,
+ SPELL_SCRIPT_HOOK_AFTER_CAST
};
#define HOOK_SPELL_HIT_START SPELL_SCRIPT_HOOK_EFFECT_HIT
@@ -154,7 +155,8 @@ class SpellScript : public _SpellScript
typedef void(CLASSNAME::*SpellEffectFnType)(SpellEffIndex); \
typedef void(CLASSNAME::*SpellHitFnType)(); \
typedef void(CLASSNAME::*SpellCastFnType)(); \
- typedef void(CLASSNAME::*SpellUnitTargetFnType)(std::list<Unit*>&); \
+ typedef void(CLASSNAME::*SpellObjectAreaTargetSelectFnType)(std::list<WorldObject*>&); \
+ typedef void(CLASSNAME::*SpellObjectTargetSelectFnType)(WorldObject*&);
SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript)
@@ -196,16 +198,33 @@ class SpellScript : public _SpellScript
SpellHitFnType pHitHandlerScript;
};
- class UnitTargetHandler : public _SpellScript::EffectHook
+ class TargetHook : public _SpellScript::EffectHook
{
public:
- UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType);
+ TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area);
+ bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex);
std::string ToString();
- bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType);
- void Call(SpellScript* spellScript, std::list<Unit*>& unitTargets);
- private:
- SpellUnitTargetFnType pUnitTargetHandlerScript;
+ protected:
uint16 targetType;
+ bool area;
+ };
+
+ class ObjectAreaTargetSelectHandler : public TargetHook
+ {
+ public:
+ ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType);
+ void Call(SpellScript* spellScript, std::list<WorldObject*>& targets);
+ private:
+ SpellObjectAreaTargetSelectFnType pObjectAreaTargetSelectHandlerScript;
+ };
+
+ class ObjectTargetSelectHandler : public TargetHook
+ {
+ public:
+ ObjectTargetSelectHandler(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType);
+ void Call(SpellScript* spellScript, WorldObject*& targets);
+ private:
+ SpellObjectTargetSelectFnType pObjectTargetSelectHandlerScript;
};
#define SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \
@@ -213,7 +232,8 @@ class SpellScript : public _SpellScript
class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \
class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \
class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \
- class UnitTargetHandlerFunction : public SpellScript::UnitTargetHandler { public: UnitTargetHandlerFunction(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::UnitTargetHandler((SpellScript::SpellUnitTargetFnType)_pUnitTargetHandlerScript, _effIndex, _targetType) {} }; \
+ class ObjectAreaTargetSelectHandlerFunction : public SpellScript::ObjectAreaTargetSelectHandler { public: ObjectAreaTargetSelectHandlerFunction(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::ObjectAreaTargetSelectHandler((SpellScript::SpellObjectAreaTargetSelectFnType)_pObjectAreaTargetSelectHandlerScript, _effIndex, _targetType) {} }; \
+ class ObjectTargetSelectHandlerFunction : public SpellScript::ObjectTargetSelectHandler { public: ObjectTargetSelectHandlerFunction(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::ObjectTargetSelectHandler((SpellScript::SpellObjectTargetSelectFnType)_pObjectTargetSelectHandlerScript, _effIndex, _targetType) {} };
#define PrepareSpellScript(CLASSNAME) SPELLSCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME)
public:
@@ -267,15 +287,21 @@ class SpellScript : public _SpellScript
// where function is: void function()
#define SpellHitFn(F) HitHandlerFunction(&F)
- // example: OnUnitTargetSelect += SpellUnitTargetFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier);
- // where function is void function(std::list<Unit*>& targetList)
- HookList<UnitTargetHandler> OnUnitTargetSelect;
- #define SpellUnitTargetFn(F, I, N) UnitTargetHandlerFunction(&F, I, N)
+ // example: OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier);
+ // where function is void function(std::list<WorldObject*>& targets)
+ HookList<ObjectAreaTargetSelectHandler> OnObjectAreaTargetSelect;
+ #define SpellObjectAreaTargetSelectFn(F, I, N) ObjectAreaTargetSelectHandlerFunction(&F, I, N)
+
+ // example: OnObjectTargetSelect += SpellObjectTargetSelectFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier);
+ // where function is void function(WorldObject*& target)
+ HookList<ObjectTargetSelectHandler> OnObjectTargetSelect;
+ #define SpellObjectTargetSelectFn(F, I, N) ObjectTargetSelectHandlerFunction(&F, I, N)
// hooks are executed in following order, at specified event of spell:
// 1. BeforeCast - executed when spell preparation is finished (when cast bar becomes full) before cast is handled
// 2. OnCheckCast - allows to override result of CheckCast function
- // 3. OnUnitTargetSelect - executed just before adding selected targets to final target list
+ // 3a. OnObjectAreaTargetSelect - executed just before adding selected targets to final target list (for area targets)
+ // 3b. OnObjectTargetSelect - executed just before adding selected target to final target list (for single unit targets)
// 4. OnCast - executed just before spell is launched (creates missile) or executed
// 5. AfterCast - executed after spell missile is launched and immediate spell actions are done
// 6. OnEffectLaunch - executed just before specified effect handler call - when spell missile is launched
@@ -302,7 +328,7 @@ class SpellScript : public _SpellScript
// -shadowstep - explicit target is the unit you want to go behind of
// -chain heal - explicit target is the unit to be healed first
// -holy nova/arcane explosion - explicit target = NULL because target you are selecting doesn't affect how spell targets are selected
- // you can determine if spell requires explicit targets by dbc columns:
+ // you can determine if spell requires explicit targets by dbc columns:
// - Targets - mask of explicit target types
// - ImplicitTargetXX set to TARGET_XXX_TARGET_YYY, _TARGET_ here means that explicit target is used by the effect, so spell needs one too
@@ -397,9 +423,10 @@ enum AuraScriptHookType
AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB,
AURA_SCRIPT_HOOK_EFFECT_MANASHIELD,
AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD,
+ AURA_SCRIPT_HOOK_EFFECT_SPLIT,
AURA_SCRIPT_HOOK_CHECK_AREA_TARGET,
AURA_SCRIPT_HOOK_DISPEL,
- AURA_SCRIPT_HOOK_AFTER_DISPEL,
+ AURA_SCRIPT_HOOK_AFTER_DISPEL
/*AURA_SCRIPT_HOOK_APPLY,
AURA_SCRIPT_HOOK_REMOVE, */
};
@@ -423,6 +450,7 @@ class AuraScript : public _SpellScript
typedef void(CLASSNAME::*AuraEffectCalcPeriodicFnType)(AuraEffect const*, bool &, int32 &); \
typedef void(CLASSNAME::*AuraEffectCalcSpellModFnType)(AuraEffect const*, SpellModifier* &); \
typedef void(CLASSNAME::*AuraEffectAbsorbFnType)(AuraEffect*, DamageInfo &, uint32 &); \
+ typedef void(CLASSNAME::*AuraEffectSplitFnType)(AuraEffect*, DamageInfo &, uint32 &); \
AURASCRIPT_FUNCTION_TYPE_DEFINES(AuraScript)
@@ -514,6 +542,14 @@ class AuraScript : public _SpellScript
private:
AuraEffectAbsorbFnType pEffectHandlerScript;
};
+ class EffectSplitHandler : public EffectBase
+ {
+ public:
+ EffectSplitHandler(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex);
+ void Call(AuraScript* auraScript, AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & splitAmount);
+ private:
+ AuraEffectSplitFnType pEffectHandlerScript;
+ };
#define AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \
class CheckAreaTargetFunction : public AuraScript::CheckAreaTargetHandler { public: CheckAreaTargetFunction(AuraCheckAreaTargetFnType _pHandlerScript) : AuraScript::CheckAreaTargetHandler((AuraScript::AuraCheckAreaTargetFnType)_pHandlerScript) {} }; \
@@ -526,6 +562,7 @@ class AuraScript : public _SpellScript
class EffectApplyHandlerFunction : public AuraScript::EffectApplyHandler { public: EffectApplyHandlerFunction(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode) : AuraScript::EffectApplyHandler((AuraScript::AuraEffectApplicationModeFnType)_pEffectHandlerScript, _effIndex, _effName, _mode) {} }; \
class EffectAbsorbFunction : public AuraScript::EffectAbsorbHandler { public: EffectAbsorbFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectAbsorbHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \
class EffectManaShieldFunction : public AuraScript::EffectManaShieldHandler { public: EffectManaShieldFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectManaShieldHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \
+ class EffectSplitFunction : public AuraScript::EffectSplitHandler { public: EffectSplitFunction(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectSplitHandler((AuraScript::AuraEffectSplitFnType)_pEffectHandlerScript, _effIndex) {} }; \
#define PrepareAuraScript(CLASSNAME) AURASCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME)
@@ -650,6 +687,12 @@ class AuraScript : public _SpellScript
// where function is: void function (AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount);
HookList<EffectManaShieldHandler> AfterEffectManaShield;
+ // executed when the caster of some spell with split dmg aura gets damaged through it
+ // example: OnEffectSplit += AuraEffectSplitFn(class::function, EffectIndexSpecifier);
+ // where function is: void function (AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& splitAmount);
+ HookList<EffectSplitHandler> OnEffectSplit;
+ #define AuraEffectSplitFn(F, I) EffectSplitFunction(&F, I)
+
// AuraScript interface - hook/effect execution manipulators
// prevents default action of a hook from being executed (works only while called in a hook which default action can be prevented)
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 2f79eaff06a..7818527b34b 100755
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -77,8 +77,8 @@ void CreatureTextMgr::LoadCreatureTexts()
if (!result)
{
- sLog->outString(">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
+
return;
}
@@ -104,25 +104,25 @@ void CreatureTextMgr::LoadCreatureTexts()
if (temp.sound)
{
if (!sSoundEntriesStore.LookupEntry(temp.sound)){
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound);
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound);
temp.sound = 0;
}
}
if (!GetLanguageDescByID(temp.lang))
{
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang));
temp.lang = LANG_UNIVERSAL;
}
if (temp.type >= MAX_CHAT_MSG_TYPE)
{
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type));
temp.type = CHAT_MSG_SAY;
}
if (temp.emote)
{
if (!sEmotesStore.LookupEntry(temp.emote))
{
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote));
temp.emote = EMOTE_ONESHOT_NONE;
}
}
@@ -136,8 +136,8 @@ void CreatureTextMgr::LoadCreatureTexts()
++textCount;
} while (result->NextRow());
- sLog->outString(">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime));
+
}
void CreatureTextMgr::LoadCreatureTextLocales()
@@ -166,8 +166,8 @@ void CreatureTextMgr::LoadCreatureTextLocales()
++textCount;
} while (result->NextRow());
- sLog->outString(">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, TextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/)
@@ -178,7 +178,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp
CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry());
if (sList == mTextMap.end())
{
- sLog->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry());
return 0;
}
@@ -186,7 +186,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp
CreatureTextHolder::const_iterator itr = textHolder.find(textGroup);
if (itr == textHolder.end())
{
- sLog->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry());
return 0;
}
@@ -383,7 +383,7 @@ void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id)
if (std::find(repeats.begin(), repeats.end(), id) == repeats.end())
repeats.push_back(id);
else
- sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id));
}
CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup)
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index f82c01adf31..0a4682db759 100755
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -144,11 +144,24 @@ void GmTicket::SendResponse(WorldSession* session) const
data << uint32(1); // responseID
data << uint32(_id); // ticketID
data << _message.c_str();
- data << _response.c_str();
- // 3 null strings (unused)
- data << uint8(0);
- data << uint8(0);
- data << uint8(0);
+
+ size_t len = _response.size();
+ char const* s = _response.c_str();
+
+ for (int i = 0; i < 4; i++)
+ {
+ if (len)
+ {
+ size_t writeLen = std::min<size_t>(len, 3999);
+ data.append(s, writeLen);
+
+ len -= writeLen;
+ s += writeLen;
+ }
+
+ data << uint8(0);
+ }
+
session->SendPacket(&data);
}
@@ -250,8 +263,8 @@ void TicketMgr::LoadTickets()
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
- sLog->outString(">> Loaded 0 GM tickets. DB table `gm_tickets` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 GM tickets. DB table `gm_tickets` is empty!");
+
return;
}
@@ -277,8 +290,8 @@ void TicketMgr::LoadTickets()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u GM tickets in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GM tickets in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void TicketMgr::LoadSurveys()
@@ -290,8 +303,8 @@ void TicketMgr::LoadSurveys()
if (QueryResult result = CharacterDatabase.Query("SELECT MAX(surveyId) FROM gm_surveys"))
_lastSurveyId = (*result)[0].GetUInt32();
- sLog->outString(">> Loaded GM Survey count from database in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded GM Survey count from database in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void TicketMgr::AddTicket(GmTicket* ticket)
@@ -371,17 +384,7 @@ void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const
// we've got the easy stuff done by now.
// Now we need to go through the client logic for displaying various levels of ticket load
- if (ticket)
- ticket->WritePacket(data);
- else
- {
- // we can't actually get any numbers here...
- data << float(0);
- data << float(0);
- data << float(1);
- data << uint8(0);
- data << uint8(0);
- }
+ ticket->WritePacket(data);
}
session->SendPacket(&data);
}
diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h
index be8b4063d84..ecf315c059c 100755
--- a/src/server/game/Tickets/TicketMgr.h
+++ b/src/server/game/Tickets/TicketMgr.h
@@ -29,13 +29,13 @@ class ChatHandler;
enum GMTicketSystemStatus
{
GMTICKET_QUEUE_STATUS_DISABLED = 0,
- GMTICKET_QUEUE_STATUS_ENABLED = 1,
+ GMTICKET_QUEUE_STATUS_ENABLED = 1
};
enum GMTicketStatus
{
GMTICKET_STATUS_HASTEXT = 0x06,
- GMTICKET_STATUS_DEFAULT = 0x0A,
+ GMTICKET_STATUS_DEFAULT = 0x0A
};
enum GMTicketResponse
@@ -45,7 +45,7 @@ enum GMTicketResponse
GMTICKET_RESPONSE_CREATE_ERROR = 3,
GMTICKET_RESPONSE_UPDATE_SUCCESS = 4,
GMTICKET_RESPONSE_UPDATE_ERROR = 5,
- GMTICKET_RESPONSE_TICKET_DELETED = 9,
+ GMTICKET_RESPONSE_TICKET_DELETED = 9
};
// from Blizzard LUA:
@@ -58,14 +58,14 @@ enum GMTicketEscalationStatus
TICKET_UNASSIGNED = 0,
TICKET_ASSIGNED = 1,
TICKET_IN_ESCALATION_QUEUE = 2,
- TICKET_ESCALATED_ASSIGNED = 3,
+ TICKET_ESCALATED_ASSIGNED = 3
};
// from blizzard lua
enum GMTicketOpenedByGMStatus
{
GMTICKET_OPENEDBYGM_STATUS_NOT_OPENED = 0, // ticket has never been opened by a gm
- GMTICKET_OPENEDBYGM_STATUS_OPENED = 1, // ticket has been opened by a gm
+ GMTICKET_OPENEDBYGM_STATUS_OPENED = 1 // ticket has been opened by a gm
};
enum LagReportType
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
index b734d90b040..f87b81c8be8 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
@@ -29,7 +29,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
if (!sWorld->getBoolConfig(CONFIG_CLEAN_CHARACTER_DB))
return;
- sLog->outString("Cleaning character database...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Cleaning character database...");
uint32 oldMSTime = getMSTime();
@@ -63,8 +63,8 @@ void CharacterDatabaseCleaner::CleanDatabase()
sWorld->SetCleaningFlags(flags);
- sLog->outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table, bool (*check)(uint32))
@@ -72,7 +72,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
if (!result)
{
- sLog->outString("Table %s is empty.", table);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Table %s is empty.", table);
return;
}
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index 476a19b6885..f6d0de28d28 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -320,7 +320,7 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl
case DTT_CHARACTER:
{
if (result->GetFieldCount() <= 68) // avoid crashes on next check
- sLog->outCrash("PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table.");
+ sLog->outFatal(LOG_FILTER_GENERAL, "PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table.");
if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error
return false;
@@ -496,7 +496,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
std::string tn = gettablename(line);
if (tn.empty())
{
- sLog->outError("LoadPlayerDump: Can't extract table name from line: '%s'!", line.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "LoadPlayerDump: Can't extract table name from line: '%s'!", line.c_str());
ROLLBACK(DUMP_FILE_BROKEN);
}
@@ -513,7 +513,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if (i == DUMP_TABLE_COUNT)
{
- sLog->outError("LoadPlayerDump: Unknown table: '%s'!", tn.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "LoadPlayerDump: Unknown table: '%s'!", tn.c_str());
ROLLBACK(DUMP_FILE_BROKEN);
}
@@ -662,7 +662,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
break;
}
default:
- sLog->outError("Unknown dump table type: %u", type);
+ sLog->outError(LOG_FILTER_GENERAL, "Unknown dump table type: %u", type);
break;
}
diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h
index b5655328507..6662d91fb31 100755
--- a/src/server/game/Tools/PlayerDump.h
+++ b/src/server/game/Tools/PlayerDump.h
@@ -48,7 +48,7 @@ enum DumpTableType
DTT_ITEM_GIFT, // <- item guids // character_gifts
DTT_PET, // -> pet guids collection // character_pet
- DTT_PET_TABLE, // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
+ DTT_PET_TABLE // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
};
enum DumpReturn
diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp
index cc1c2ff50c6..d651fbd4ce1 100644
--- a/src/server/game/Warden/Warden.cpp
+++ b/src/server/game/Warden/Warden.cpp
@@ -105,9 +105,8 @@ void Warden::Update()
// Kick player if client response delays more than set in config
if (_clientResponseTimer > maxClientResponseDelay * IN_MILLISECONDS)
{
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client",
- _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), _session->GetLatency(), _session->GetRemoteAddress().c_str(),
- secsToTimeString(maxClientResponseDelay, true).c_str());
+ sLog->outWarn(LOG_FILTER_WARDEN, "%s (latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client",
+ _session->GetPlayerName(false).c_str(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), secsToTimeString(maxClientResponseDelay, true).c_str());
_session->KickPlayer();
}
else
@@ -196,7 +195,6 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/)
sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server");
return "Ban";
- break;
}
default:
break;
@@ -212,7 +210,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData)
sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size()));
recvData.hexlike();
- switch(opcode)
+ switch (opcode)
{
case WARDEN_CMSG_MODULE_MISSING:
_warden->SendModuleToClient();
diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h
index d16890b31b9..7a8f0f52315 100644
--- a/src/server/game/Warden/Warden.h
+++ b/src/server/game/Warden/Warden.h
@@ -54,7 +54,7 @@ enum WardenCheckType
DRIVER_CHECK = 0x71, // 113: uint Seed + byte[20] SHA1 + byte driverNameIndex (check to ensure driver isn't loaded)
TIMING_CHECK = 0x57, // 87: empty (check to ensure GetTickCount() isn't detoured)
PROC_CHECK = 0x7E, // 126: uint Seed + byte[20] SHA1 + byte moluleNameIndex + byte procNameIndex + uint Offset + byte Len (check to ensure proc isn't detoured)
- MODULE_CHECK = 0xD9, // 217: uint Seed + byte[20] SHA1 (check to ensure module isn't injected)
+ MODULE_CHECK = 0xD9 // 217: uint Seed + byte[20] SHA1 (check to ensure module isn't injected)
};
#if defined(__GNUC__)
diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp
index f4c7a5069cf..f6daba76c1a 100644
--- a/src/server/game/Warden/WardenCheckMgr.cpp
+++ b/src/server/game/Warden/WardenCheckMgr.cpp
@@ -43,8 +43,8 @@ void WardenCheckMgr::LoadWardenChecks()
// Check if Warden is enabled by config before loading anything
if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED))
{
- sLog->outString(">> Warden disabled, loading checks skipped.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Warden disabled, loading checks skipped.");
+
return;
}
@@ -52,8 +52,8 @@ void WardenCheckMgr::LoadWardenChecks()
if (!result)
{
- sLog->outString(">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
+
return;
}
@@ -121,7 +121,7 @@ void WardenCheckMgr::LoadWardenChecks()
if (checkType == MPQ_CHECK || checkType == MEM_CHECK)
{
- WardenCheckResult *wr = new WardenCheckResult();
+ WardenCheckResult* wr = new WardenCheckResult();
wr->Result.SetHexStr(checkResult.c_str());
int len = checkResult.size() / 2;
if (wr->Result.GetNumBytes() < len)
@@ -145,19 +145,27 @@ void WardenCheckMgr::LoadWardenChecks()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u warden checks.", count);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded %u warden checks.", count);
+
}
void WardenCheckMgr::LoadWardenOverrides()
{
+ // Check if Warden is enabled by config before loading anything
+ if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED))
+ {
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Warden disabled, loading check overrides skipped.");
+
+ return;
+ }
+
// 0 1
QueryResult result = CharacterDatabase.Query("SELECT wardenId, action FROM warden_action");
if (!result)
{
- sLog->outString(">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!");
+
return;
}
@@ -174,10 +182,10 @@ void WardenCheckMgr::LoadWardenOverrides()
// Check if action value is in range (0-2, see WardenActions enum)
if (action > WARDEN_ACTION_BAN)
- sLog->outError("Warden check override action out of range (ID: %u, action: %u)", checkId, action);
+ sLog->outError(LOG_FILTER_WARDEN, "Warden check override action out of range (ID: %u, action: %u)", checkId, action);
// Check if check actually exists before accessing the CheckStore vector
else if (checkId > CheckStore.size())
- sLog->outError("Warden check action override for non-existing check (ID: %u, action: %u), skipped", checkId, action);
+ sLog->outError(LOG_FILTER_WARDEN, "Warden check action override for non-existing check (ID: %u, action: %u), skipped", checkId, action);
else
{
CheckStore[checkId]->Action = WardenActions(action);
@@ -186,8 +194,8 @@ void WardenCheckMgr::LoadWardenOverrides()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u warden action overrides.", count);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded %u warden action overrides.", count);
+
}
WardenCheck* WardenCheckMgr::GetWardenDataById(uint16 Id)
diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp
index a60ae765013..9c90662105a 100644
--- a/src/server/game/Warden/WardenMac.cpp
+++ b/src/server/game/Warden/WardenMac.cpp
@@ -43,8 +43,8 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K)
_session = pClient;
// Generate Warden Key
SHA1Randx WK(K->AsByteArray(), K->GetNumBytes());
- WK.generate(_inputKey, 16);
- WK.generate(_outputKey, 16);
+ WK.Generate(_inputKey, 16);
+ WK.Generate(_outputKey, 16);
/*
Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet)
Hash: <?> (0x04 packet)
@@ -152,9 +152,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff)
// Verify key
if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0)
{
- sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
- _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
+ sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
return;
}
@@ -222,7 +220,7 @@ void WardenMac::HandleData(ByteBuffer &buff)
// return;
//}
- bool found = false;
+ //bool found = false;
std::string str = "Test string!";
@@ -238,7 +236,7 @@ void WardenMac::HandleData(ByteBuffer &buff)
if (memcmp(sha1Hash, sha1.GetDigest(), 20))
{
sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: SHA1 hash is wrong!");
- found = true;
+ //found = true;
}
MD5_CTX ctx;
@@ -253,7 +251,7 @@ void WardenMac::HandleData(ByteBuffer &buff)
if (memcmp(ourMD5Hash, theirsMD5Hash, 16))
{
sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: MD5 hash is wrong!");
- found = true;
+ //found = true;
}
_session->KickPlayer();
diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp
index a7485d7da51..20f09ec5bda 100644
--- a/src/server/game/Warden/WardenWin.cpp
+++ b/src/server/game/Warden/WardenWin.cpp
@@ -47,8 +47,8 @@ void WardenWin::Init(WorldSession* session, BigNumber *k)
_session = session;
// Generate Warden Key
SHA1Randx WK(k->AsByteArray(), k->GetNumBytes());
- WK.generate(_inputKey, 16);
- WK.generate(_outputKey, 16);
+ WK.Generate(_inputKey, 16);
+ WK.Generate(_outputKey, 16);
memcpy(_seed, Module.Seed, 16);
@@ -156,9 +156,7 @@ void WardenWin::HandleHashResult(ByteBuffer &buff)
// Verify key
if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0)
{
- sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
- _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
+ sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
return;
}
@@ -343,9 +341,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length))
{
buff.rpos(buff.wpos());
- sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s",
- _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
+ sLog->outWarn(LOG_FILTER_WARDEN, "%s failed checksum. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
return;
}
@@ -356,9 +352,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
// TODO: test it.
if (result == 0x00)
{
- sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s",
- _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
+ sLog->outWarn(LOG_FILTER_WARDEN, "%s failed timing check. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
return;
}
@@ -500,9 +494,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
if (checkFailed > 0)
{
WardenCheck* check = sWardenCheckMgr->GetWardenDataById(checkFailed);
-
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s",
- _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), checkFailed, Penalty(check).c_str());
+ sLog->outWarn(LOG_FILTER_WARDEN, "%s failed Warden check %u. Action: %s", _session->GetPlayerName(false).c_str(), checkFailed, Penalty(check).c_str());
}
// Set hold off timer, minimum timer should at least be 1 second
diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp
index 965e6bf3805..896e7161606 100755
--- a/src/server/game/Weather/Weather.cpp
+++ b/src/server/game/Weather/Weather.cpp
@@ -37,7 +37,7 @@ Weather::Weather(uint32 zone, WeatherData const* weatherChances)
m_type = WEATHER_TYPE_FINE;
m_grade = 0;
- sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
}
/// Launch a weather update
@@ -97,7 +97,7 @@ bool Weather::ReGenerate()
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
- sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
if ((u < 60) && (m_grade < 0.33333334f)) // Get fair
{
@@ -258,7 +258,7 @@ bool Weather::UpdateWeather()
wthstr = "fine";
break;
}
- sLog->outDetail("Change the weather of zone %u to %s.", m_zone, wthstr);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Change the weather of zone %u to %s.", m_zone, wthstr);
sScriptMgr->OnWeatherChange(this, state, m_grade);
return true;
diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h
index dadd1151a53..59bff95d7ea 100755
--- a/src/server/game/Weather/Weather.h
+++ b/src/server/game/Weather/Weather.h
@@ -57,7 +57,7 @@ enum WeatherState
WEATHER_STATE_HEAVY_SANDSTORM = 42,
WEATHER_STATE_THUNDERS = 86,
WEATHER_STATE_BLACKRAIN = 90,
- WEATHER_STATE_BLACKSNOW = 106,
+ WEATHER_STATE_BLACKSNOW = 106
};
/// Weather for one zone
diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp
index bb8fadf08bc..da62122d7a3 100755
--- a/src/server/game/Weather/WeatherMgr.cpp
+++ b/src/server/game/Weather/WeatherMgr.cpp
@@ -93,8 +93,8 @@ void LoadWeatherData()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
+
return;
}
@@ -115,19 +115,19 @@ void LoadWeatherData()
if (wzc.data[season].rainChance > 100)
{
wzc.data[season].rainChance = 25;
- sLog->outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season);
+ sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season);
}
if (wzc.data[season].snowChance > 100)
{
wzc.data[season].snowChance = 25;
- sLog->outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season);
+ sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season);
}
if (wzc.data[season].stormChance > 100)
{
wzc.data[season].stormChance = 25;
- sLog->outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season);
+ sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season);
}
}
@@ -137,8 +137,8 @@ void LoadWeatherData()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SendFineWeatherUpdateToPlayer(Player* player)
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 5bd5961a05b..1d1fb45b74e 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -77,6 +77,7 @@
#include "WardenCheckMgr.h"
#include "Warden.h"
#include "CalendarMgr.h"
+#include "BattlefieldMgr.h"
ACE_Atomic_Op<ACE_Thread_Mutex, bool> World::m_stopEvent = false;
uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE;
@@ -267,7 +268,7 @@ void World::AddSession_(WorldSession* s)
{
AddQueuedPlayer (s);
UpdateMaxSessionCounters();
- sLog->outDetail("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize);
+ sLog->outInfo(LOG_FILTER_GENERAL, "PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize);
return;
}
@@ -284,7 +285,7 @@ void World::AddSession_(WorldSession* s)
float popu = (float)GetActiveSessionCount(); // updated number of users on the server
popu /= pLimit;
popu *= 2;
- sLog->outDetail("Server Population (%f).", popu);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Server Population (%f).", popu);
}
}
@@ -395,11 +396,10 @@ void World::LoadConfigSettings(bool reload)
{
if (!ConfigMgr::Load())
{
- sLog->outError("World settings reload fail: can't read settings from %s.", ConfigMgr::GetFilename().c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "World settings reload fail: can't read settings from %s.", ConfigMgr::GetFilename().c_str());
return;
}
-
- sLog->ReloadConfig(); // Reload log levels and filters
+ sLog->LoadFromConfig();
}
///- Read the player limit and the Message of the day from the config file
@@ -419,27 +419,27 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_HEALTH] = ConfigMgr::GetFloatDefault("Rate.Health", 1);
if (rate_values[RATE_HEALTH] < 0)
{
- sLog->outError("Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]);
rate_values[RATE_HEALTH] = 1;
}
rate_values[RATE_POWER_MANA] = ConfigMgr::GetFloatDefault("Rate.Mana", 1);
if (rate_values[RATE_POWER_MANA] < 0)
{
- sLog->outError("Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]);
rate_values[RATE_POWER_MANA] = 1;
}
rate_values[RATE_POWER_RAGE_INCOME] = ConfigMgr::GetFloatDefault("Rate.Rage.Income", 1);
rate_values[RATE_POWER_RAGE_LOSS] = ConfigMgr::GetFloatDefault("Rate.Rage.Loss", 1);
if (rate_values[RATE_POWER_RAGE_LOSS] < 0)
{
- sLog->outError("Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]);
rate_values[RATE_POWER_RAGE_LOSS] = 1;
}
rate_values[RATE_POWER_RUNICPOWER_INCOME] = ConfigMgr::GetFloatDefault("Rate.RunicPower.Income", 1);
rate_values[RATE_POWER_RUNICPOWER_LOSS] = ConfigMgr::GetFloatDefault("Rate.RunicPower.Loss", 1);
if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0)
{
- sLog->outError("Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]);
rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1;
}
rate_values[RATE_POWER_FOCUS] = ConfigMgr::GetFloatDefault("Rate.Focus", 1.0f);
@@ -463,7 +463,7 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_REPAIRCOST] = ConfigMgr::GetFloatDefault("Rate.RepairCost", 1.0f);
if (rate_values[RATE_REPAIRCOST] < 0.0f)
{
- sLog->outError("Rate.RepairCost (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.RepairCost (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]);
rate_values[RATE_REPAIRCOST] = 0.0f;
}
rate_values[RATE_REPUTATION_GAIN] = ConfigMgr::GetFloatDefault("Rate.Reputation.Gain", 1.0f);
@@ -500,13 +500,13 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_TALENT] = ConfigMgr::GetFloatDefault("Rate.Talent", 1.0f);
if (rate_values[RATE_TALENT] < 0.0f)
{
- sLog->outError("Rate.Talent (%f) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.Talent (%f) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]);
rate_values[RATE_TALENT] = 1.0f;
}
rate_values[RATE_MOVESPEED] = ConfigMgr::GetFloatDefault("Rate.MoveSpeed", 1.0f);
if (rate_values[RATE_MOVESPEED] < 0)
{
- sLog->outError("Rate.MoveSpeed (%f) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Rate.MoveSpeed (%f) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]);
rate_values[RATE_MOVESPEED] = 1.0f;
}
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED];
@@ -515,12 +515,12 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = ConfigMgr::GetFloatDefault("TargetPosRecalculateRange", 1.5f);
if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE)
{
- sLog->outError("TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE);
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = CONTACT_DISTANCE;
}
else if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] > NOMINAL_MELEE_RANGE)
{
- sLog->outError("TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.",
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE);
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE;
}
@@ -528,12 +528,12 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = ConfigMgr::GetFloatDefault("DurabilityLoss.OnDeath", 10.0f);
if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f)
{
- sLog->outError("DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f;
}
if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] > 100.0f)
{
- sLog->outError("DurabilityLoss.OnDeath (%f) must be <= 100. Using 100.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DurabilityLoss.OnDeath (%f) must be <= 100. Using 100.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f;
@@ -541,25 +541,25 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_DURABILITY_LOSS_DAMAGE] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Damage", 0.5f);
if (rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]);
rate_values[RATE_DURABILITY_LOSS_DAMAGE] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_ABSORB] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Absorb", 0.5f);
if (rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]);
rate_values[RATE_DURABILITY_LOSS_ABSORB] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_PARRY] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Parry", 0.05f);
if (rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]);
rate_values[RATE_DURABILITY_LOSS_PARRY] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_BLOCK] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Block", 0.05f);
if (rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]);
rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f;
}
///- Read other configuration items from the config file
@@ -569,7 +569,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_COMPRESSION] = ConfigMgr::GetIntDefault("Compression", 1);
if (m_int_configs[CONFIG_COMPRESSION] < 1 || m_int_configs[CONFIG_COMPRESSION] > 9)
{
- sLog->outError("Compression level (%i) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Compression level (%i) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]);
m_int_configs[CONFIG_COMPRESSION] = 1;
}
m_bool_configs[CONFIG_ADDON_CHANNEL] = ConfigMgr::GetBoolDefault("AddonChannel", true);
@@ -593,14 +593,14 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = ConfigMgr::GetIntDefault("PlayerSave.Stats.MinLevel", 0);
if (m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] > MAX_LEVEL)
{
- sLog->outError("PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]);
m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0;
}
m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = ConfigMgr::GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS);
if (m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY)
{
- sLog->outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_GRIDCLEAN], MIN_GRID_DELAY);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "GridCleanUpDelay (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_GRIDCLEAN], MIN_GRID_DELAY);
m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY;
}
if (reload)
@@ -609,7 +609,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = ConfigMgr::GetIntDefault("MapUpdateInterval", 100);
if (m_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY)
{
- sLog->outError("MapUpdateInterval (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MapUpdateInterval (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY);
m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY;
}
if (reload)
@@ -621,7 +621,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("WorldServerPort", 8085);
if (val != m_int_configs[CONFIG_PORT_WORLD])
- sLog->outError("WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_PORT_WORLD]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_PORT_WORLD]);
}
else
m_int_configs[CONFIG_PORT_WORLD] = ConfigMgr::GetIntDefault("WorldServerPort", 8085);
@@ -640,7 +640,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("GameType", 0);
if (val != m_int_configs[CONFIG_GAME_TYPE])
- sLog->outError("GameType option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_GAME_TYPE]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "GameType option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_GAME_TYPE]);
}
else
m_int_configs[CONFIG_GAME_TYPE] = ConfigMgr::GetIntDefault("GameType", 0);
@@ -649,12 +649,13 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
if (val != m_int_configs[CONFIG_REALM_ZONE])
- sLog->outError("RealmZone option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_REALM_ZONE]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "RealmZone option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_REALM_ZONE]);
}
else
m_int_configs[CONFIG_REALM_ZONE] = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = ConfigMgr::GetBoolDefault("AllowTwoSide.Accounts", true);
+ m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR]= ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Calendar", false);
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Chat", false);
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Channel", false);
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Group", false);
@@ -671,21 +672,21 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MIN_PLAYER_NAME] = ConfigMgr::GetIntDefault ("MinPlayerName", 2);
if (m_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
{
- sLog->outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MinPlayerName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME);
m_int_configs[CONFIG_MIN_PLAYER_NAME] = 2;
}
m_int_configs[CONFIG_MIN_CHARTER_NAME] = ConfigMgr::GetIntDefault ("MinCharterName", 2);
if (m_int_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_int_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME)
{
- sLog->outError("MinCharterName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MinCharterName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME);
m_int_configs[CONFIG_MIN_CHARTER_NAME] = 2;
}
m_int_configs[CONFIG_MIN_PET_NAME] = ConfigMgr::GetIntDefault ("MinPetName", 2);
if (m_int_configs[CONFIG_MIN_PET_NAME] < 1 || m_int_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME)
{
- sLog->outError("MinPetName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MinPetName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME);
m_int_configs[CONFIG_MIN_PET_NAME] = 2;
}
@@ -696,7 +697,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_CHARACTERS_PER_REALM] = ConfigMgr::GetIntDefault("CharactersPerRealm", 10);
if (m_int_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_int_configs[CONFIG_CHARACTERS_PER_REALM] > 10)
{
- sLog->outError("CharactersPerRealm (%i) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "CharactersPerRealm (%i) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
m_int_configs[CONFIG_CHARACTERS_PER_REALM] = 10;
}
@@ -704,14 +705,14 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = ConfigMgr::GetIntDefault("CharactersPerAccount", 50);
if (m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_int_configs[CONFIG_CHARACTERS_PER_REALM])
{
- sLog->outError("CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_int_configs[CONFIG_CHARACTERS_PER_REALM];
}
m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = ConfigMgr::GetIntDefault("HeroicCharactersPerRealm", 1);
if (int32(m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10)
{
- sLog->outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1;
}
@@ -720,7 +721,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_SKIP_CINEMATICS] = ConfigMgr::GetIntDefault("SkipCinematics", 0);
if (int32(m_int_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_int_configs[CONFIG_SKIP_CINEMATICS] > 2)
{
- sLog->outError("SkipCinematics (%i) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "SkipCinematics (%i) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]);
m_int_configs[CONFIG_SKIP_CINEMATICS] = 0;
}
@@ -728,14 +729,14 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
if (val != m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
- sLog->outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxPlayerLevel option can't be changed at config reload, using current value (%u).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
}
else
m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
if (m_int_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL)
{
- sLog->outError("MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL);
m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL;
}
@@ -744,25 +745,25 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("StartPlayerLevel", 1);
if (m_int_configs[CONFIG_START_PLAYER_LEVEL] < 1)
{
- sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_PLAYER_LEVEL] = 1;
}
else if (m_int_configs[CONFIG_START_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
- sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
}
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("StartHeroicPlayerLevel", 55);
if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1)
{
- sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.",
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55;
}
else if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
- sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
}
@@ -770,12 +771,12 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_PLAYER_MONEY] = ConfigMgr::GetIntDefault("StartPlayerMoney", 0);
if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0)
{
- sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
m_int_configs[CONFIG_START_PLAYER_MONEY] = 0;
}
else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT)
{
- sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",
m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT);
m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT;
}
@@ -783,20 +784,20 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("MaxHonorPoints", 75000);
if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0)
{
- sLog->outError("MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]);
m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0;
}
m_int_configs[CONFIG_START_HONOR_POINTS] = ConfigMgr::GetIntDefault("StartHonorPoints", 0);
if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0)
{
- sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0);
m_int_configs[CONFIG_START_HONOR_POINTS] = 0;
}
else if (m_int_configs[CONFIG_START_HONOR_POINTS] > m_int_configs[CONFIG_MAX_HONOR_POINTS])
{
- sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS]);
m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS];
}
@@ -804,20 +805,20 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_ARENA_POINTS] = ConfigMgr::GetIntDefault("MaxArenaPoints", 10000);
if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0)
{
- sLog->outError("MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]);
m_int_configs[CONFIG_MAX_ARENA_POINTS] = 0;
}
m_int_configs[CONFIG_START_ARENA_POINTS] = ConfigMgr::GetIntDefault("StartArenaPoints", 0);
if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0)
{
- sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0);
m_int_configs[CONFIG_START_ARENA_POINTS] = 0;
}
else if (m_int_configs[CONFIG_START_ARENA_POINTS] > m_int_configs[CONFIG_MAX_ARENA_POINTS])
{
- sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS]);
m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS];
}
@@ -825,7 +826,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxLevel", 60);
if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
- sLog->outError("RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.",
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 60);
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60;
}
@@ -845,7 +846,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MIN_PETITION_SIGNS] = ConfigMgr::GetIntDefault("MinPetitionSigns", 9);
if (m_int_configs[CONFIG_MIN_PETITION_SIGNS] > 9)
{
- sLog->outError("MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_int_configs[CONFIG_MIN_PETITION_SIGNS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_int_configs[CONFIG_MIN_PETITION_SIGNS]);
m_int_configs[CONFIG_MIN_PETITION_SIGNS] = 9;
}
@@ -860,13 +861,13 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_GM_LEVEL] = ConfigMgr::GetIntDefault("GM.StartLevel", 1);
if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL])
{
- sLog->outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
m_int_configs[CONFIG_START_GM_LEVEL], m_int_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, m_int_configs[CONFIG_START_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_GM_LEVEL] = m_int_configs[CONFIG_START_PLAYER_LEVEL];
}
else if (m_int_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL)
{
- sLog->outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
m_int_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
}
m_bool_configs[CONFIG_ALLOW_GM_GROUP] = ConfigMgr::GetBoolDefault("GM.AllowInvite", false);
@@ -881,7 +882,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_UPTIME_UPDATE] = ConfigMgr::GetIntDefault("UpdateUptimeInterval", 10);
if (int32(m_int_configs[CONFIG_UPTIME_UPDATE]) <= 0)
{
- sLog->outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "UpdateUptimeInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]);
m_int_configs[CONFIG_UPTIME_UPDATE] = 10;
}
if (reload)
@@ -894,7 +895,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = ConfigMgr::GetIntDefault("LogDB.Opt.ClearInterval", 10);
if (int32(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0)
{
- sLog->outError("LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = 10;
}
if (reload)
@@ -903,7 +904,7 @@ void World::LoadConfigSettings(bool reload)
m_timers[WUPDATE_CLEANDB].Reset();
}
m_int_configs[CONFIG_LOGDB_CLEARTIME] = ConfigMgr::GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default
- sLog->outString("Will clear `logs` table of entries older than %i seconds every %u minutes.",
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Will clear `logs` table of entries older than %i seconds every %u minutes.",
m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = ConfigMgr::GetIntDefault("SkillChance.Orange", 100);
@@ -928,7 +929,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = ConfigMgr::GetIntDefault("MaxOverspeedPings", 2);
if (m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2)
{
- sLog->outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]);
m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2;
}
@@ -943,7 +944,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("Expansion", 1);
if (val != m_int_configs[CONFIG_EXPANSION])
- sLog->outError("Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]);
}
else
m_int_configs[CONFIG_EXPANSION] = ConfigMgr::GetIntDefault("Expansion", 1);
@@ -975,7 +976,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = ConfigMgr::GetIntDefault("Battleground.Random.ResetHour", 6);
if (m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23)
{
- sLog->outError("Battleground.Random.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR]);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Battleground.Random.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR]);
m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6;
}
@@ -1022,6 +1023,7 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_BG_XP_FOR_KILL] = ConfigMgr::GetBoolDefault("Battleground.GiveXPForKills", false);
m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = ConfigMgr::GetIntDefault ("Arena.MaxRatingDifference", 150);
m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS);
+ m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS);
m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = ConfigMgr::GetBoolDefault("Arena.AutoDistributePoints", false);
m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = ConfigMgr::GetIntDefault ("Arena.AutoDistributeInterval", 7);
m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.Enable", false);
@@ -1041,10 +1043,10 @@ void World::LoadConfigSettings(bool reload)
if (clientCacheId > 0)
{
m_int_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId;
- sLog->outString("Client cache version set to: %u", clientCacheId);
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Client cache version set to: %u", clientCacheId);
}
else
- sLog->outError("ClientCacheVersion can't be negative %d, ignored.", clientCacheId);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "ClientCacheVersion can't be negative %d, ignored.", clientCacheId);
}
m_int_configs[CONFIG_INSTANT_LOGOUT] = ConfigMgr::GetIntDefault("InstantLogout", SEC_MODERATOR);
@@ -1060,12 +1062,12 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistanceOnContinents = ConfigMgr::GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
if (m_MaxVisibleDistanceOnContinents < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
{
- sLog->outError("Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceOnContinents = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
}
else if (m_MaxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Visibility.Distance.Continents can't be greater %f", MAX_VISIBILITY_DISTANCE);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.Continents can't be greater %f", MAX_VISIBILITY_DISTANCE);
m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE;
}
@@ -1073,12 +1075,12 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistanceInInstances = ConfigMgr::GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
if (m_MaxVisibleDistanceInInstances < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
{
- sLog->outError("Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInInstances = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
}
else if (m_MaxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Visibility.Distance.Instances can't be greater %f", MAX_VISIBILITY_DISTANCE);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.Instances can't be greater %f", MAX_VISIBILITY_DISTANCE);
m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE;
}
@@ -1086,12 +1088,12 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistanceInBGArenas = ConfigMgr::GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
if (m_MaxVisibleDistanceInBGArenas < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
{
- sLog->outError("Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInBGArenas = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
}
else if (m_MaxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Visibility.Distance.BGArenas can't be greater %f", MAX_VISIBILITY_DISTANCE);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.BGArenas can't be greater %f", MAX_VISIBILITY_DISTANCE);
m_MaxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE;
}
@@ -1112,12 +1114,12 @@ void World::LoadConfigSettings(bool reload)
if (reload)
{
if (dataPath != m_dataPath)
- sLog->outError("DataDir option can't be changed at worldserver.conf reload, using current value (%s).", m_dataPath.c_str());
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "DataDir option can't be changed at worldserver.conf reload, using current value (%s).", m_dataPath.c_str());
}
else
{
m_dataPath = dataPath;
- sLog->outString("Using DataDir %s", m_dataPath.c_str());
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Using DataDir %s", m_dataPath.c_str());
}
m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0);
@@ -1128,19 +1130,19 @@ void World::LoadConfigSettings(bool reload)
std::string ignoreSpellIds = ConfigMgr::GetStringDefault("vmap.ignoreSpellIds", "");
if (!enableHeight)
- sLog->outError("VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
VMAP::VMapFactory::createOrGetVMapManager()->setEnableLineOfSightCalc(enableLOS);
VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight);
VMAP::VMapFactory::preventSpellsFromBeingTestedForLoS(ignoreSpellIds.c_str());
- sLog->outString("WORLD: VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS);
- sLog->outString("WORLD: VMap data directory is: %svmaps", m_dataPath.c_str());
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS);
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "VMap data directory is: %svmaps", m_dataPath.c_str());
m_int_configs[CONFIG_MAX_WHO] = ConfigMgr::GetIntDefault("MaxWhoListReturns", 49);
m_bool_configs[CONFIG_PET_LOS] = ConfigMgr::GetBoolDefault("vmap.petLOS", true);
m_bool_configs[CONFIG_START_ALL_SPELLS] = ConfigMgr::GetBoolDefault("PlayerStart.AllSpells", false);
if (m_bool_configs[CONFIG_START_ALL_SPELLS])
- sLog->outString("WORLD: WARNING: PlayerStart.AllSpells enabled - may not function as intended!");
+ sLog->outWarn(LOG_FILTER_SERVER_LOADING, "PlayerStart.AllSpells enabled - may not function as intended!");
m_int_configs[CONFIG_HONOR_AFTER_DUEL] = ConfigMgr::GetIntDefault("HonorPointsAfterDuel", 0);
m_bool_configs[CONFIG_START_ALL_EXPLORED] = ConfigMgr::GetBoolDefault("PlayerStart.MapsExplored", false);
m_bool_configs[CONFIG_START_ALL_REP] = ConfigMgr::GetBoolDefault("PlayerStart.AllReputation", false);
@@ -1192,6 +1194,11 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_AUTOBROADCAST] = ConfigMgr::GetBoolDefault("AutoBroadcast.On", false);
m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = ConfigMgr::GetIntDefault("AutoBroadcast.Center", 0);
m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = ConfigMgr::GetIntDefault("AutoBroadcast.Timer", 60000);
+ if (reload)
+ {
+ m_timers[WUPDATE_AUTOBROADCAST].SetInterval(m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL]);
+ m_timers[WUPDATE_AUTOBROADCAST].Reset();
+ }
// MySQL ping time interval
m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30);
@@ -1201,6 +1208,14 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true);
// call ScriptMgr if we're reloading the configuration
+ m_bool_configs[CONFIG_WINTERGRASP_ENABLE] = ConfigMgr::GetBoolDefault("Wintergrasp.Enable", false);
+ m_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMax", 100);
+ m_int_configs[CONFIG_WINTERGRASP_PLR_MIN] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMin", 0);
+ m_int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMinLvl", 77);
+ m_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.BattleTimer", 30);
+ m_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.NoBattleTimer", 150);
+ m_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = ConfigMgr::GetIntDefault("Wintergrasp.CrashRestartTimer", 10);
+
if (reload)
sScriptMgr->OnConfigLoad(reload);
}
@@ -1236,7 +1251,7 @@ void World::SetInitialWorldSettings()
!MapManager::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
!MapManager::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
{
- sLog->outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.", m_dataPath.c_str(), m_dataPath.c_str());
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.", m_dataPath.c_str(), m_dataPath.c_str());
exit(1);
}
@@ -1247,8 +1262,8 @@ void World::SetInitialWorldSettings()
sGameEventMgr->Initialize();
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
- sLog->outString();
- sLog->outString("Loading Trinity strings...");
+
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Trinity strings...");
if (!sObjectMgr->LoadTrinityStrings())
exit(1); // Error message displayed in function already
@@ -1272,36 +1287,36 @@ void World::SetInitialWorldSettings()
CharacterDatabase.Execute(stmt);
///- Load the DBC files
- sLog->outString("Initialize data stores...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Initialize data stores...");
LoadDBCStores(m_dataPath);
DetectDBCLang();
- sLog->outString("Loading spell dbc data corrections...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell dbc data corrections...");
sSpellMgr->LoadDbcDataCorrections();
- sLog->outString("Loading SpellInfo store...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo store...");
sSpellMgr->LoadSpellInfoStore();
- sLog->outString("Loading SkillLineAbilityMultiMap Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SkillLineAbilityMultiMap Data...");
sSpellMgr->LoadSkillLineAbilityMap();
- sLog->outString("Loading spell custom attributes...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell custom attributes...");
sSpellMgr->LoadSpellCustomAttr();
- sLog->outString("Loading GameObject models...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GameObject models...");
LoadGameObjectModelList();
- sLog->outString("Loading Script Names...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Names...");
sObjectMgr->LoadScriptNames();
- sLog->outString("Loading Instance Template...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Instance Template...");
sObjectMgr->LoadInstanceTemplate();
// Must be called before `creature_respawn`/`gameobject_respawn` tables
- sLog->outString("Loading instances...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading instances...");
sInstanceSaveMgr->LoadInstances();
- sLog->outString("Loading Localization strings...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Localization strings...");
uint32 oldMSTime = getMSTime();
sObjectMgr->LoadCreatureLocales();
sObjectMgr->LoadGameObjectLocales();
@@ -1314,308 +1329,308 @@ void World::SetInitialWorldSettings()
sObjectMgr->LoadPointOfInterestLocales();
sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
- sLog->outString(">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
- sLog->outString("Loading Page Texts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Page Texts...");
sObjectMgr->LoadPageTexts();
- sLog->outString("Loading Game Object Templates..."); // must be after LoadPageTexts
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Object Templates..."); // must be after LoadPageTexts
sObjectMgr->LoadGameObjectTemplate();
- sLog->outString("Loading Spell Rank Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Rank Data...");
sSpellMgr->LoadSpellRanks();
- sLog->outString("Loading Spell Required Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Required Data...");
sSpellMgr->LoadSpellRequired();
- sLog->outString("Loading Spell Group types...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Group types...");
sSpellMgr->LoadSpellGroups();
- sLog->outString("Loading Spell Learn Skills...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Learn Skills...");
sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
- sLog->outString("Loading Spell Learn Spells...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Learn Spells...");
sSpellMgr->LoadSpellLearnSpells();
- sLog->outString("Loading Spell Proc Event conditions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Proc Event conditions...");
sSpellMgr->LoadSpellProcEvents();
- sLog->outString("Loading Spell Proc conditions and data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Proc conditions and data...");
sSpellMgr->LoadSpellProcs();
- sLog->outString("Loading Spell Bonus Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Bonus Data...");
sSpellMgr->LoadSpellBonusess();
- sLog->outString("Loading Aggro Spells Definitions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Aggro Spells Definitions...");
sSpellMgr->LoadSpellThreats();
- sLog->outString("Loading Spell Group Stack Rules...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Group Stack Rules...");
sSpellMgr->LoadSpellGroupStackRules();
- sLog->outString("Loading NPC Texts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading NPC Texts...");
sObjectMgr->LoadGossipText();
- sLog->outString("Loading Enchant Spells Proc datas...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Enchant Spells Proc datas...");
sSpellMgr->LoadSpellEnchantProcData();
- sLog->outString("Loading Item Random Enchantments Table...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Item Random Enchantments Table...");
LoadRandomEnchantmentsTable();
- sLog->outString("Loading Disables");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Disables");
DisableMgr::LoadDisables(); // must be before loading quests and items
- sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
sObjectMgr->LoadItemTemplates();
- sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Item set names..."); // must be after LoadItemPrototypes
sObjectMgr->LoadItemSetNames();
- sLog->outString("Loading Creature Model Based Info Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Model Based Info Data...");
sObjectMgr->LoadCreatureModelInfo();
- sLog->outString("Loading Equipment templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Equipment templates...");
sObjectMgr->LoadEquipmentTemplates();
- sLog->outString("Loading Creature templates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature templates...");
sObjectMgr->LoadCreatureTemplates();
- sLog->outString("Loading Creature template addons...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature template addons...");
sObjectMgr->LoadCreatureTemplateAddons();
- sLog->outString("Loading Reputation Reward Rates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Reputation Reward Rates...");
sObjectMgr->LoadReputationRewardRate();
- sLog->outString("Loading Creature Reputation OnKill Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Reputation OnKill Data...");
sObjectMgr->LoadReputationOnKill();
- sLog->outString("Loading Reputation Spillover Data..." );
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Reputation Spillover Data...");
sObjectMgr->LoadReputationSpilloverTemplate();
- sLog->outString("Loading Points Of Interest Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Points Of Interest Data...");
sObjectMgr->LoadPointsOfInterest();
- sLog->outString("Loading Creature Base Stats...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Base Stats...");
sObjectMgr->LoadCreatureClassLevelStats();
- sLog->outString("Loading Creature Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Data...");
sObjectMgr->LoadCreatures();
- sLog->outString("Loading pet levelup spells...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading pet levelup spells...");
sSpellMgr->LoadPetLevelupSpellMap();
- sLog->outString("Loading pet default spells additional to levelup spells...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading pet default spells additional to levelup spells...");
sSpellMgr->LoadPetDefaultSpells();
- sLog->outString("Loading Creature Addon Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Addon Data...");
sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
- sLog->outString("Loading Gameobject Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Gameobject Data...");
sObjectMgr->LoadGameobjects();
- sLog->outString("Loading Creature Linked Respawn...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Linked Respawn...");
sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
- sLog->outString("Loading Weather Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Weather Data...");
WeatherMgr::LoadWeatherData();
- sLog->outString("Loading Quests...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quests...");
sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
- sLog->outString("Checking Quest Disables");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Checking Quest Disables");
DisableMgr::CheckQuestDisables(); // must be after loading quests
- sLog->outString("Loading Quest POI");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quest POI");
sObjectMgr->LoadQuestPOI();
- sLog->outString("Loading Quests Relations...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quests Relations...");
sObjectMgr->LoadQuestRelations(); // must be after quest load
- sLog->outString("Loading Objects Pooling Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Objects Pooling Data...");
sPoolMgr->LoadFromDB();
- sLog->outString("Loading Game Event Data..."); // must be after loading pools fully
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Data..."); // must be after loading pools fully
sGameEventMgr->LoadFromDB();
- sLog->outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
sObjectMgr->LoadNPCSpellClickSpells();
- sLog->outString("Loading Vehicle Template Accessories...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Vehicle Template Accessories...");
sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
- sLog->outString("Loading Vehicle Accessories...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Vehicle Accessories...");
sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
- sLog->outString("Loading Dungeon boss data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Dungeon boss data...");
sObjectMgr->LoadInstanceEncounters();
- sLog->outString("Loading LFG rewards...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading LFG rewards...");
sLFGMgr->LoadRewards();
- sLog->outString("Loading SpellArea Data..."); // must be after quest load
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SpellArea Data..."); // must be after quest load
sSpellMgr->LoadSpellAreas();
- sLog->outString("Loading AreaTrigger definitions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading AreaTrigger definitions...");
sObjectMgr->LoadAreaTriggerTeleports();
- sLog->outString("Loading Access Requirements...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Access Requirements...");
sObjectMgr->LoadAccessRequirements(); // must be after item template load
- sLog->outString("Loading Quest Area Triggers...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quest Area Triggers...");
sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests
- sLog->outString("Loading Tavern Area Triggers...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Tavern Area Triggers...");
sObjectMgr->LoadTavernAreaTriggers();
- sLog->outString("Loading AreaTrigger script names...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading AreaTrigger script names...");
sObjectMgr->LoadAreaTriggerScripts();
- sLog->outString("Loading Graveyard-zone links...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Graveyard-zone links...");
sObjectMgr->LoadGraveyardZones();
- sLog->outString("Loading spell pet auras...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell pet auras...");
sSpellMgr->LoadSpellPetAuras();
- sLog->outString("Loading Spell target coordinates...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell target coordinates...");
sSpellMgr->LoadSpellTargetPositions();
- sLog->outString("Loading enchant custom attributes...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading enchant custom attributes...");
sSpellMgr->LoadEnchantCustomAttr();
- sLog->outString("Loading linked spells...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading linked spells...");
sSpellMgr->LoadSpellLinked();
- sLog->outString("Loading Player Create Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Data...");
sObjectMgr->LoadPlayerInfo();
- sLog->outString("Loading Exploration BaseXP Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Exploration BaseXP Data...");
sObjectMgr->LoadExplorationBaseXP();
- sLog->outString("Loading Pet Name Parts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Pet Name Parts...");
sObjectMgr->LoadPetNames();
CharacterDatabaseCleaner::CleanDatabase();
- sLog->outString("Loading the max pet number...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading the max pet number...");
sObjectMgr->LoadPetNumber();
- sLog->outString("Loading pet level stats...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading pet level stats...");
sObjectMgr->LoadPetLevelInfo();
- sLog->outString("Loading Player Corpses...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Corpses...");
sObjectMgr->LoadCorpses();
- sLog->outString("Loading Player level dependent mail rewards...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player level dependent mail rewards...");
sObjectMgr->LoadMailLevelRewards();
// Loot tables
LoadLootTables();
- sLog->outString("Loading Skill Discovery Table...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
- sLog->outString("Loading Skill Extra Item Table...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Skill Extra Item Table...");
LoadSkillExtraItemTable();
- sLog->outString("Loading Skill Fishing base level requirements...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Skill Fishing base level requirements...");
sObjectMgr->LoadFishingBaseSkillLevel();
- sLog->outString("Loading Achievements...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Achievements...");
sAchievementMgr->LoadAchievementReferenceList();
- sLog->outString("Loading Achievement Criteria Lists...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Achievement Criteria Lists...");
sAchievementMgr->LoadAchievementCriteriaList();
- sLog->outString("Loading Achievement Criteria Data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Achievement Criteria Data...");
sAchievementMgr->LoadAchievementCriteriaData();
- sLog->outString("Loading Achievement Rewards...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Achievement Rewards...");
sAchievementMgr->LoadRewards();
- sLog->outString("Loading Achievement Reward Locales...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Achievement Reward Locales...");
sAchievementMgr->LoadRewardLocales();
- sLog->outString("Loading Completed Achievements...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Completed Achievements...");
sAchievementMgr->LoadCompletedAchievements();
// Delete expired auctions before loading
- sLog->outString("Deleting expired auctions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Deleting expired auctions...");
sAuctionMgr->DeleteExpiredAuctionsAtStartup();
///- Load dynamic data tables from the database
- sLog->outString("Loading Item Auctions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Item Auctions...");
sAuctionMgr->LoadAuctionItems();
- sLog->outString("Loading Auctions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Auctions...");
sAuctionMgr->LoadAuctions();
sGuildMgr->LoadGuilds();
- sLog->outString("Loading ArenaTeams...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading ArenaTeams...");
sArenaTeamMgr->LoadArenaTeams();
- sLog->outString("Loading Groups...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Groups...");
sGroupMgr->LoadGroups();
- sLog->outString("Loading ReservedNames...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading ReservedNames...");
sObjectMgr->LoadReservedPlayersNames();
- sLog->outString("Loading GameObjects for quests...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GameObjects for quests...");
sObjectMgr->LoadGameObjectForQuests();
- sLog->outString("Loading BattleMasters...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading BattleMasters...");
sBattlegroundMgr->LoadBattleMastersEntry();
- sLog->outString("Loading GameTeleports...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GameTeleports...");
sObjectMgr->LoadGameTele();
- sLog->outString("Loading Gossip menu...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Gossip menu...");
sObjectMgr->LoadGossipMenu();
- sLog->outString("Loading Gossip menu options...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Gossip menu options...");
sObjectMgr->LoadGossipMenuItems();
- sLog->outString("Loading Vendors...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Vendors...");
sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
- sLog->outString("Loading Trainers...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Trainers...");
sObjectMgr->LoadTrainerSpell(); // must be after load CreatureTemplate
- sLog->outString("Loading Waypoints...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Waypoints...");
sWaypointMgr->Load();
- sLog->outString("Loading SmartAI Waypoints...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SmartAI Waypoints...");
sSmartWaypointMgr->LoadFromDB();
- sLog->outString("Loading Creature Formations...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Formations...");
sFormationMgr->LoadCreatureFormations();
- sLog->outString("Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions
LoadWorldStates();
- sLog->outString("Loading Conditions...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Conditions...");
sConditionMgr->LoadConditions();
- sLog->outString("Loading faction change achievement pairs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading faction change achievement pairs...");
sObjectMgr->LoadFactionChangeAchievements();
- sLog->outString("Loading faction change spell pairs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading faction change spell pairs...");
sObjectMgr->LoadFactionChangeSpells();
- sLog->outString("Loading faction change item pairs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading faction change item pairs...");
sObjectMgr->LoadFactionChangeItems();
- sLog->outString("Loading faction change reputation pairs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading faction change reputation pairs...");
sObjectMgr->LoadFactionChangeReputations();
- sLog->outString("Loading GM tickets...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GM tickets...");
sTicketMgr->LoadTickets();
- sLog->outString("Loading GM surveys...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GM surveys...");
sTicketMgr->LoadSurveys();
- sLog->outString("Loading client addons...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading client addons...");
AddonMgr::LoadFromDB();
///- Handle outdated emails (delete/return)
- sLog->outString("Returning old mails...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Returning old mails...");
sObjectMgr->ReturnOrDeleteOldMails(false);
- sLog->outString("Loading Autobroadcasts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Autobroadcasts...");
LoadAutobroadcasts();
///- Load and initialize scripts
@@ -1626,42 +1641,42 @@ void World::SetInitialWorldSettings()
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadWaypointScripts();
- sLog->outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Scripts text locales..."); // must be after Load*Scripts calls
sObjectMgr->LoadDbScriptStrings();
- sLog->outString("Loading CreatureEventAI Texts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading CreatureEventAI Texts...");
sEventAIMgr->LoadCreatureEventAI_Texts();
- sLog->outString("Loading CreatureEventAI Summons...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading CreatureEventAI Summons...");
sEventAIMgr->LoadCreatureEventAI_Summons();
- sLog->outString("Loading CreatureEventAI Scripts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading CreatureEventAI Scripts...");
sEventAIMgr->LoadCreatureEventAI_Scripts();
- sLog->outString("Loading spell script names...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell script names...");
sObjectMgr->LoadSpellScriptNames();
- sLog->outString("Loading Creature Texts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Texts...");
sCreatureTextMgr->LoadCreatureTexts();
- sLog->outString("Loading Creature Text Locales...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Text Locales...");
sCreatureTextMgr->LoadCreatureTextLocales();
- sLog->outString("Initializing Scripts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Initializing Scripts...");
sScriptMgr->Initialize();
sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized
- sLog->outString("Validating spell scripts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Validating spell scripts...");
sObjectMgr->ValidateSpellScripts();
- sLog->outString("Loading SmartAI scripts...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SmartAI scripts...");
sSmartScriptMgr->LoadSmartAIFromDB();
- sLog->outString("Loading Calendar data...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Calendar data...");
sCalendarMgr->LoadFromDB();
///- Initialize game time and timers
- sLog->outString("Initialize game time and timers");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Initialize game time and timers");
m_gameTime = time(NULL);
m_startTime = m_gameTime;
@@ -1688,17 +1703,16 @@ void World::SetInitialWorldSettings()
mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
//1440
mail_timer_expires = ((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
- sLog->outDetail("Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires));
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires));
///- Initilize static helper structures
AIRegistry::Initialize();
- Player::InitVisibleBits();
///- Initialize MapManager
- sLog->outString("Starting Map System");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Map System");
sMapMgr->Initialize();
- sLog->outString("Starting Game Event system...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Game Event system...");
uint32 nextGameEvent = sGameEventMgr->StartSystem();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
@@ -1708,61 +1722,55 @@ void World::SetInitialWorldSettings()
// Delete all custom channels which haven't been used for PreserveCustomChannelDuration days.
Channel::CleanOldChannelsInDB();
- sLog->outString("Starting Arena Season...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Arena Season...");
sGameEventMgr->StartArenaSeason();
sTicketMgr->Initialize();
///- Initialize Battlegrounds
- sLog->outString("Starting Battleground System");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battleground System");
sBattlegroundMgr->CreateInitialBattlegrounds();
sBattlegroundMgr->InitAutomaticArenaPointDistribution();
///- Initialize outdoor pvp
- sLog->outString("Starting Outdoor PvP System");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Outdoor PvP System");
sOutdoorPvPMgr->InitOutdoorPvP();
- sLog->outString("Loading Transports...");
+ ///- Initialize Battlefield
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battlefield System");
+ sBattlefieldMgr->InitBattlefield();
+
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Transports...");
sMapMgr->LoadTransports();
- sLog->outString("Loading Transport NPCs...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Transport NPCs...");
sMapMgr->LoadTransportNPCs();
///- Initialize Warden
- sLog->outString("Loading Warden Checks..." );
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Warden Checks...");
sWardenCheckMgr->LoadWardenChecks();
- sLog->outString("Loading Warden Action Overrides..." );
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Warden Action Overrides...");
sWardenCheckMgr->LoadWardenOverrides();
- sLog->outString("Deleting expired bans...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Deleting expired bans...");
LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query
- sLog->outString("Calculate next daily quest reset time...");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate next daily quest reset time...");
InitDailyQuestResetTime();
- sLog->outString("Calculate next weekly quest reset time..." );
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate next weekly quest reset time...");
InitWeeklyQuestResetTime();
- sLog->outString("Calculate random battleground reset time..." );
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate random battleground reset time...");
InitRandomBGResetTime();
LoadCharacterNameData();
- // possibly enable db logging; avoid massive startup spam by doing it here.
- if (sLog->GetLogDBLater())
- {
- sLog->outString("Enabling database logging...");
- sLog->SetLogDBLater(false);
- sLog->SetLogDB(true);
- }
- else
- sLog->SetLogDB(false);
-
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
- sLog->outString();
- sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
- sLog->outString();
+
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
+ sLog->EnableDBAppenders();
}
void World::DetectDBCLang()
@@ -1771,7 +1779,7 @@ void World::DetectDBCLang()
if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES)
{
- sLog->outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES);
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES);
m_lang_confid = LOCALE_enUS;
}
@@ -1799,14 +1807,14 @@ void World::DetectDBCLang()
if (default_locale >= TOTAL_LOCALES)
{
- sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)");
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Unable to determine your DBC Locale! (corrupt DBC?)");
exit(1);
}
m_defaultDbcLocale = LocaleConstant(default_locale);
- sLog->outString("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[m_defaultDbcLocale], availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str());
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Using %s DBC Locale as default. All available DBC locales: %s", localeNames[m_defaultDbcLocale], availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str());
+
}
void World::RecordTimeDiff(const char *text, ...)
@@ -1829,7 +1837,7 @@ void World::RecordTimeDiff(const char *text, ...)
va_start(ap, text);
vsnprintf(str, 256, text, ap);
va_end(ap);
- sLog->outDetail("Difftime %s: %u.", str, diff);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Difftime %s: %u.", str, diff);
}
m_currentTime = thisTime;
@@ -1845,8 +1853,8 @@ void World::LoadAutobroadcasts()
if (!result)
{
- sLog->outString(">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!");
+
return;
}
@@ -1863,8 +1871,8 @@ void World::LoadAutobroadcasts()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
/// Update the World !
@@ -1876,7 +1884,7 @@ void World::Update(uint32 diff)
{
if (m_updateTimeSum > m_int_configs[CONFIG_INTERVAL_LOG_UPDATE])
{
- sLog->outBasic("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
m_updateTimeSum = m_updateTime;
m_updateTimeCount = 1;
}
@@ -1996,6 +2004,9 @@ void World::Update(uint32 diff)
sOutdoorPvPMgr->Update(diff);
RecordTimeDiff("UpdateOutdoorPvPMgr");
+ sBattlefieldMgr->Update(diff);
+ RecordTimeDiff("BattlefieldMgr");
+
///- Delete all characters which have been deleted X days before
if (m_timers[WUPDATE_DELETECHARS].Passed())
{
@@ -2030,7 +2041,7 @@ void World::Update(uint32 diff)
if (m_timers[WUPDATE_PINGDB].Passed())
{
m_timers[WUPDATE_PINGDB].Reset();
- sLog->outDetail("Ping MySQL to keep connection alive");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Ping MySQL to keep connection alive");
CharacterDatabase.KeepAlive();
LoginDatabase.KeepAlive();
WorldDatabase.KeepAlive();
@@ -2504,7 +2515,7 @@ void World::ShutdownMsg(bool show, Player* player)
ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME;
SendServerMessage(msgid, str.c_str(), player);
- sLog->outStaticDebug("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str());
}
}
@@ -2522,7 +2533,7 @@ void World::ShutdownCancel()
m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value
SendServerMessage(msgid);
- sLog->outStaticDebug("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
+ sLog->outDebug(LOG_FILTER_GENERAL, "Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
sScriptMgr->OnShutdownCancel();
}
@@ -2578,7 +2589,7 @@ void World::ProcessCliCommands()
CliCommandHolder* command = NULL;
while (cliCmdQueue.next(command))
{
- sLog->outDetail("CLI command under processing...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "CLI command under processing...");
zprint = command->m_print;
callbackArg = command->m_callbackArg;
CliHandler handler(callbackArg, zprint);
@@ -2619,7 +2630,7 @@ void World::SendAutoBroadcast()
sWorld->SendGlobalMessage(&data);
}
- sLog->outDetail("AutoBroadcast: '%s'", msg.c_str());
+ sLog->outDebug(LOG_FILTER_GENERAL, "AutoBroadcast: '%s'", msg.c_str());
}
void World::UpdateRealmCharCount(uint32 accountId)
@@ -2721,7 +2732,7 @@ void World::InitRandomBGResetTime()
void World::ResetDailyQuests()
{
- sLog->outDetail("Daily quests reset for all characters.");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Daily quests reset for all characters.");
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_DAILY);
CharacterDatabase.Execute(stmt);
@@ -2782,7 +2793,7 @@ void World::ResetEventSeasonalQuests(uint16 event_id)
void World::ResetRandomBG()
{
- sLog->outDetail("Random BG status reset for all characters.");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Random BG status reset for all characters.");
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BATTLEGROUND_RANDOM);
CharacterDatabase.Execute(stmt);
@@ -2846,8 +2857,8 @@ void World::LoadWorldStates()
if (!result)
{
- sLog->outString(">> Loaded 0 world states. DB table `worldstates` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 world states. DB table `worldstates` is empty!");
+
return;
}
@@ -2861,8 +2872,8 @@ void World::LoadWorldStates()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
// Setting a worldstate will save it to DB
@@ -2918,12 +2929,12 @@ void World::ProcessQueryCallbacks()
void World::LoadCharacterNameData()
{
- sLog->outString("Loading character name data");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading character name data");
QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters WHERE deleteDate IS NULL");
if (!result)
{
- sLog->outError("No character name data loaded, empty query");
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "No character name data loaded, empty query");
return;
}
@@ -2937,7 +2948,7 @@ void World::LoadCharacterNameData()
++count;
} while (result->NextRow());
- sLog->outString("Loaded name data for %u characters", count);
+ sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loaded name data for %u characters", count);
}
void World::AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass)
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 95e9fbda8ca..90bb82f1c2e 100755
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -55,14 +55,14 @@ enum ServerMessageType
enum ShutdownMask
{
SHUTDOWN_MASK_RESTART = 1,
- SHUTDOWN_MASK_IDLE = 2,
+ SHUTDOWN_MASK_IDLE = 2
};
enum ShutdownExitCode
{
SHUTDOWN_EXIT_CODE = 0,
ERROR_EXIT_CODE = 1,
- RESTART_EXIT_CODE = 2,
+ RESTART_EXIT_CODE = 2
};
/// Timers for different object refresh rates
@@ -91,6 +91,7 @@ enum WorldBoolConfigs
CONFIG_GRID_UNLOAD,
CONFIG_STATS_SAVE_ONLY_ON_LOGOUT,
CONFIG_ALLOW_TWO_SIDE_ACCOUNTS,
+ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR,
CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT,
CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL,
CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP,
@@ -164,6 +165,7 @@ enum WorldBoolConfigs
CONFIG_QUEST_IGNORE_AUTO_ACCEPT,
CONFIG_QUEST_IGNORE_AUTO_COMPLETE,
CONFIG_WARDEN_ENABLED,
+ CONFIG_WINTERGRASP_ENABLE,
BOOL_CONFIG_VALUE_COUNT
};
@@ -279,6 +281,7 @@ enum WorldIntConfigs
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
CONFIG_ARENA_RATING_DISCARD_TIMER,
+ CONFIG_ARENA_RATED_UPDATE_TIMER,
CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS,
CONFIG_ARENA_SEASON_ID,
CONFIG_ARENA_START_RATING,
@@ -317,6 +320,12 @@ enum WorldIntConfigs
CONFIG_WARDEN_CLIENT_BAN_DURATION,
CONFIG_WARDEN_NUM_MEM_CHECKS,
CONFIG_WARDEN_NUM_OTHER_CHECKS,
+ CONFIG_WINTERGRASP_PLR_MAX,
+ CONFIG_WINTERGRASP_PLR_MIN,
+ CONFIG_WINTERGRASP_PLR_MIN_LVL,
+ CONFIG_WINTERGRASP_BATTLETIME,
+ CONFIG_WINTERGRASP_NOBATTLETIME,
+ CONFIG_WINTERGRASP_RESTART_AFTER_CRASH,
INT_CONFIG_VALUE_COUNT
};
@@ -400,18 +409,18 @@ enum BillingPlanFlags
SESSION_USAGE = 0x10,
SESSION_TIME_MIXTURE = 0x20,
SESSION_RESTRICTED = 0x40,
- SESSION_ENABLE_CAIS = 0x80,
+ SESSION_ENABLE_CAIS = 0x80
};
/// Type of server, this is values from second column of Cfg_Configs.dbc
enum RealmType
{
- REALM_TYPE_NORMAL = 0,
- REALM_TYPE_PVP = 1,
- REALM_TYPE_NORMAL2 = 4,
- REALM_TYPE_RP = 6,
- REALM_TYPE_RPPVP = 8,
- REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries
+ REALM_TYPE_NORMAL = 0,
+ REALM_TYPE_PVP = 1,
+ REALM_TYPE_NORMAL2 = 4,
+ REALM_TYPE_RP = 6,
+ REALM_TYPE_RPPVP = 8,
+ REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries
// replaced by REALM_PVP in realm list
};
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index 792fdeb3e7b..f148ae2b3ee 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -80,6 +80,8 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI
${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts
${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse
+ ${CMAKE_SOURCE_DIR}/src/server/game/Battlefield
+ ${CMAKE_SOURCE_DIR}/src/server/game/Battlefield/Zones
${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds
${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds/Zones
${CMAKE_SOURCE_DIR}/src/server/game/Calendar
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt
index 86fe984e197..177b3a479f5 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/src/server/scripts/Commands/CMakeLists.txt
@@ -12,33 +12,38 @@ set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
Commands/cs_account.cpp
Commands/cs_achievement.cpp
+ Commands/cs_ban.cpp
+ Commands/cs_bf.cpp
+ Commands/cs_cast.cpp
+ Commands/cs_character.cpp
+ Commands/cs_cheat.cpp
Commands/cs_debug.cpp
+ Commands/cs_disable.cpp
Commands/cs_event.cpp
Commands/cs_gm.cpp
Commands/cs_go.cpp
Commands/cs_gobject.cpp
+ Commands/cs_guild.cpp
Commands/cs_honor.cpp
+ Commands/cs_instance.cpp
Commands/cs_learn.cpp
+ Commands/cs_list.cpp
+ Commands/cs_lookup.cpp
+ Commands/cs_message.cpp
Commands/cs_misc.cpp
Commands/cs_modify.cpp
Commands/cs_npc.cpp
Commands/cs_quest.cpp
Commands/cs_reload.cpp
+ Commands/cs_reset.cpp
Commands/cs_tele.cpp
+ Commands/cs_ticket.cpp
+ Commands/cs_server.cpp
Commands/cs_titles.cpp
Commands/cs_wp.cpp
-# Commands/cs_character.cpp
-# Commands/cs_list.cpp
-# Commands/cs_lookup.cpp
# Commands/cs_pdump.cpp
-# Commands/cs_guild.cpp
-# Commands/cs_cast.cpp
-# Commands/cs_reset.cpp
-# Commands/cs_instance.cpp
-# Commands/cs_server.cpp
# Commands/cs_channel.cpp
# Commands/cs_pet.cpp
-# Commands/cs_ticket.cpp
# Commands/cs_aura.cpp
# Commands/cs_unaura.cpp
# Commands/cs_nameannounce.cpp
@@ -65,10 +70,6 @@ set(scripts_STAT_SRCS
# Commands/cs_save.cpp
# Commands/cs_saveall.cpp
# Commands/cs_kick.cpp
-# Commands/cs_ban.cpp
-# Commands/cs_unban.cpp
-# Commands/cs_baninfo.cpp
-# Commands/cs_banlist.cpp
# Commands/cs_start.cpp
# Commands/cs_taxicheat.cpp
# Commands/cs_linkgrave.cpp
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index b52102479b5..1024a3acf15 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -38,7 +38,7 @@ public:
{ "addon", SEC_ADMINISTRATOR, true, &HandleAccountSetAddonCommand, "", NULL },
{ "gmlevel", SEC_CONSOLE, true, &HandleAccountSetGmLevelCommand, "", NULL },
{ "password", SEC_CONSOLE, true, &HandleAccountSetPasswordCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand accountCommandTable[] =
{
@@ -50,12 +50,12 @@ public:
{ "set", SEC_ADMINISTRATOR, true, NULL, "", accountSetCommandTable },
{ "password", SEC_PLAYER, false, &HandleAccountPasswordCommand, "", NULL },
{ "", SEC_PLAYER, false, &HandleAccountCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "account", SEC_PLAYER, true, NULL, "", accountCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
return commandTable;
}
@@ -110,7 +110,11 @@ public:
case AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
if (handler->GetSession())
- sLog->outChar("Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.", handler->GetSession()->GetAccountId(),handler->GetSession()->GetRemoteAddress().c_str(), handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUIDLow());
+ {
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password."
+ , handler->GetSession()->GetAccountId(),handler->GetSession()->GetRemoteAddress().c_str()
+ , handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUIDLow());
+ }
break;
case AOR_NAME_TOO_LONG:
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
@@ -232,8 +236,8 @@ public:
}
else
handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str());
-
- } while (result->NextRow());
+ }
+ while (result->NextRow());
handler->SendSysMessage(LANG_ACCOUNT_LIST_BAR);
return true;
@@ -377,7 +381,6 @@ public:
handler->SetSentErrorMessage(true);
return false;
}
-
}
// Let set addon state only for lesser (strong) security level
@@ -535,8 +538,8 @@ public:
///- Get the command line arguments
char* account = strtok((char*)args, " ");
- char* password = strtok(NULL, " ");
- char* passwordConfirmation = strtok(NULL, " ");
+ char* password = strtok(NULL, " ");
+ char* passwordConfirmation = strtok(NULL, " ");
if (!account || !password || !passwordConfirmation)
return false;
@@ -589,7 +592,6 @@ public:
handler->SetSentErrorMessage(true);
return false;
}
-
return true;
}
};
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
new file mode 100644
index 00000000000..bfb52d342e1
--- /dev/null
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -0,0 +1,718 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: ban_commandscript
+%Complete: 100
+Comment: All ban related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "AccountMgr.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+
+class ban_commandscript : public CommandScript
+{
+public:
+ ban_commandscript() : CommandScript("ban_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand unbanCommandTable[] =
+ {
+ { "account", SEC_ADMINISTRATOR, true, &HandleUnBanAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &HandleUnBanCharacterCommand, "", NULL },
+ { "playeraccount", SEC_ADMINISTRATOR, true, &HandleUnBanAccountByCharCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &HandleUnBanIPCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand banlistCommandTable[] =
+ {
+ { "account", SEC_ADMINISTRATOR, true, &HandleBanListAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &HandleBanListCharacterCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &HandleBanListIPCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand baninfoCommandTable[] =
+ {
+ { "account", SEC_ADMINISTRATOR, true, &HandleBanInfoAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &HandleBanInfoCharacterCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &HandleBanInfoIPCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand banCommandTable[] =
+ {
+ { "account", SEC_ADMINISTRATOR, true, &HandleBanAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &HandleBanCharacterCommand, "", NULL },
+ { "playeraccount", SEC_ADMINISTRATOR, true, &HandleBanAccountByCharCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &HandleBanIPCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "ban", SEC_ADMINISTRATOR, true, NULL, "", banCommandTable },
+ { "baninfo", SEC_ADMINISTRATOR, true, NULL, "", baninfoCommandTable },
+ { "banlist", SEC_ADMINISTRATOR, true, NULL, "", banlistCommandTable },
+ { "unban", SEC_ADMINISTRATOR, true, NULL, "", unbanCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleBanAccountCommand(ChatHandler* handler, char const* args)
+ {
+ return HandleBanHelper(BAN_ACCOUNT, args, handler);
+ }
+
+ static bool HandleBanCharacterCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* nameStr = strtok((char*)args, " ");
+ if (!nameStr)
+ return false;
+
+ std::string name = nameStr;
+
+ char* durationStr = strtok(NULL, " ");
+ if (!durationStr || !atoi(durationStr))
+ return false;
+
+ char* reasonStr = strtok(NULL, "");
+ if (!reasonStr)
+ return false;
+
+ if (!normalizePlayerName(name))
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : ""))
+ {
+ case BAN_SUCCESS:
+ {
+ if (atoi(durationStr) > 0)
+ handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ else
+ handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
+ break;
+ }
+ case BAN_NOTFOUND:
+ {
+ handler->PSendSysMessage(LANG_BAN_NOTFOUND, "character", name.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ default:
+ break;
+ }
+
+ return true;
+ }
+
+ static bool HandleBanAccountByCharCommand(ChatHandler* handler, char const* args)
+ {
+ return HandleBanHelper(BAN_CHARACTER, args, handler);
+ }
+
+ static bool HandleBanIPCommand(ChatHandler* handler, char const* args)
+ {
+ return HandleBanHelper(BAN_IP, args, handler);
+ }
+
+ static bool HandleBanHelper(BanMode mode, char const* args, ChatHandler* handler)
+ {
+ if (!*args)
+ return false;
+
+ char* cnameOrIP = strtok((char*)args, " ");
+ if (!cnameOrIP)
+ return false;
+
+ std::string nameOrIP = cnameOrIP;
+
+ char* durationStr = strtok(NULL, " ");
+ if (!durationStr || !atoi(durationStr))
+ return false;
+
+ char* reasonStr = strtok(NULL, "");
+ if (!reasonStr)
+ return false;
+
+ switch (mode)
+ {
+ case BAN_ACCOUNT:
+ if (!AccountMgr::normalizeString(nameOrIP))
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ break;
+ case BAN_CHARACTER:
+ if (!normalizePlayerName(nameOrIP))
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ break;
+ case BAN_IP:
+ if (!IsIPAddress(nameOrIP.c_str()))
+ return false;
+ break;
+ }
+
+ switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : ""))
+ {
+ case BAN_SUCCESS:
+ if (atoi(durationStr) > 0)
+ handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ else
+ handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reasonStr);
+ break;
+ case BAN_SYNTAX_ERROR:
+ return false;
+ case BAN_NOTFOUND:
+ switch (mode)
+ {
+ default:
+ handler->PSendSysMessage(LANG_BAN_NOTFOUND, "account", nameOrIP.c_str());
+ break;
+ case BAN_CHARACTER:
+ handler->PSendSysMessage(LANG_BAN_NOTFOUND, "character", nameOrIP.c_str());
+ break;
+ case BAN_IP:
+ handler->PSendSysMessage(LANG_BAN_NOTFOUND, "ip", nameOrIP.c_str());
+ break;
+ }
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return true;
+ }
+
+ static bool HandleBanInfoAccountCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* nameStr = strtok((char*)args, "");
+ if (!nameStr)
+ return false;
+
+ std::string accountName = nameStr;
+ if (!AccountMgr::normalizeString(accountName))
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 accountId = AccountMgr::GetId(accountName);
+ if (!accountId)
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
+ return true;
+ }
+
+ return HandleBanInfoHelper(accountId, accountName.c_str(), handler);
+ }
+
+ static bool HandleBanInfoHelper(uint32 accountId, char const* accountName, ChatHandler* handler)
+ {
+ QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC", accountId);
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_BANINFO_NOACCOUNTBAN, accountName);
+ return true;
+ }
+
+ handler->PSendSysMessage(LANG_BANINFO_BANHISTORY, accountName);
+ do
+ {
+ Field* fields = result->Fetch();
+
+ time_t unbanDate = time_t(fields[3].GetUInt32());
+ bool active = false;
+ if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(NULL)))
+ active = true;
+ bool permanent = (fields[1].GetUInt64() == uint64(0));
+ std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
+ handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
+ fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_BANINFO_YES) : handler->GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
+ }
+ while (result->NextRow());
+
+ return true;
+ }
+
+ static bool HandleBanInfoCharacterCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* target = sObjectAccessor->FindPlayerByName(args);
+ uint32 targetGuid = 0;
+ std::string name(args);
+
+ if (!target)
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
+ stmt->setString(0, name);
+ PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
+
+ if (!resultCharacter)
+ {
+ handler->PSendSysMessage(LANG_BANINFO_NOCHARACTER);
+ return false;
+ }
+
+ targetGuid = (*resultCharacter)[0].GetUInt32();
+ }
+ else
+ targetGuid = target->GetGUIDLow();
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
+ stmt->setUInt32(0, targetGuid);
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_CHAR_NOT_BANNED, name.c_str());
+ return true;
+ }
+
+ handler->PSendSysMessage(LANG_BANINFO_BANHISTORY, name.c_str());
+ do
+ {
+ Field* fields = result->Fetch();
+ time_t unbanDate = time_t(fields[3].GetUInt32());
+ bool active = false;
+ if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(NULL)))
+ active = true;
+ bool permanent = (fields[1].GetUInt32() == uint32(0));
+ std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true);
+ handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
+ fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_BANINFO_YES) : handler->GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
+ }
+ while (result->NextRow());
+
+ return true;
+ }
+
+ static bool HandleBanInfoIPCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* ipStr = strtok((char*)args, "");
+ if (!ipStr)
+ return false;
+
+ if (!IsIPAddress(ipStr))
+ return false;
+
+ std::string IP = ipStr;
+
+ LoginDatabase.EscapeString(IP);
+ QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason, bannedby, unbandate-bandate FROM ip_banned WHERE ip = '%s'", IP.c_str());
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_BANINFO_NOIP);
+ return true;
+ }
+
+ Field* fields = result->Fetch();
+ bool permanent = !fields[6].GetUInt64();
+ handler->PSendSysMessage(LANG_BANINFO_IPENTRY,
+ fields[0].GetCString(), fields[1].GetCString(), permanent ? handler->GetTrinityString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
+ permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetCString(), fields[5].GetCString());
+
+
+ return true;
+ }
+
+ static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args)
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
+ LoginDatabase.Execute(stmt);
+
+ char* filterStr = strtok((char*)args, " ");
+ std::string filter = filterStr ? filterStr : "";
+
+ PreparedQueryResult result;
+
+ if (filter.empty())
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL);
+ result = LoginDatabase.Query(stmt);
+ }
+ else
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME);
+ stmt->setString(0, filter);
+ result = LoginDatabase.Query(stmt);
+ }
+
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_BANLIST_NOACCOUNT);
+ return true;
+ }
+
+ return HandleBanListHelper(result, handler);
+ }
+
+ static bool HandleBanListHelper(PreparedQueryResult result, ChatHandler* handler)
+ {
+ handler->PSendSysMessage(LANG_BANLIST_MATCHINGACCOUNT);
+
+ // Chat short output
+ if (handler->GetSession())
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 accountid = fields[0].GetUInt32();
+
+ QueryResult banResult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id", accountid);
+ if (banResult)
+ {
+ Field* fields2 = banResult->Fetch();
+ handler->PSendSysMessage("%s", fields2[0].GetCString());
+ }
+ }
+ while (result->NextRow());
+ }
+ // Console wide output
+ else
+ {
+ handler->SendSysMessage(LANG_BANLIST_ACCOUNTS);
+ handler->SendSysMessage(" ===============================================================================");
+ handler->SendSysMessage(LANG_BANLIST_ACCOUNTS_HEADER);
+ do
+ {
+ handler->SendSysMessage("-------------------------------------------------------------------------------");
+ Field* fields = result->Fetch();
+ uint32 accountId = fields[0].GetUInt32();
+
+ std::string accountName;
+
+ // "account" case, name can be get in same query
+ if (result->GetFieldCount() > 1)
+ accountName = fields[1].GetString();
+ // "character" case, name need extract from another DB
+ else
+ AccountMgr::GetName(accountId, accountName);
+
+ // No SQL injection. id is uint32.
+ QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = %u ORDER BY unbandate", accountId);
+ if (banInfo)
+ {
+ Field* fields2 = banInfo->Fetch();
+ do
+ {
+ time_t timeBan = time_t(fields2[0].GetUInt32());
+ tm* tmBan = localtime(&timeBan);
+
+ if (fields2[0].GetUInt32() == fields2[1].GetUInt32())
+ {
+ handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
+ accountName.c_str(), tmBan->tm_year%100, tmBan->tm_mon+1, tmBan->tm_mday, tmBan->tm_hour, tmBan->tm_min,
+ fields2[2].GetCString(), fields2[3].GetCString());
+ }
+ else
+ {
+ time_t timeUnban = time_t(fields2[1].GetUInt32());
+ tm* tmUnban = localtime(&timeUnban);
+ handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
+ accountName.c_str(), tmBan->tm_year%100, tmBan->tm_mon+1, tmBan->tm_mday, tmBan->tm_hour, tmBan->tm_min,
+ tmUnban->tm_year%100, tmUnban->tm_mon+1, tmUnban->tm_mday, tmUnban->tm_hour, tmUnban->tm_min,
+ fields2[2].GetCString(), fields2[3].GetCString());
+ }
+ }
+ while (banInfo->NextRow());
+ }
+ }
+ while (result->NextRow());
+
+ handler->SendSysMessage(" ===============================================================================");
+ }
+
+ return true;
+ }
+
+ static bool HandleBanListCharacterCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* filterStr = strtok((char*)args, " ");
+ if (!filterStr)
+ return false;
+
+ std::string filter(filterStr);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
+ stmt->setString(0, filter);
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_BANLIST_NOCHARACTER);
+ return true;
+ }
+
+ handler->PSendSysMessage(LANG_BANLIST_MATCHINGCHARACTER);
+
+ // Chat short output
+ if (handler->GetSession())
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
+ stmt2->setUInt32(0, fields[0].GetUInt32());
+ PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
+ if (banResult)
+ handler->PSendSysMessage("%s", (*banResult)[0].GetCString());
+ }
+ while (result->NextRow());
+ }
+ // Console wide output
+ else
+ {
+ handler->SendSysMessage(LANG_BANLIST_CHARACTERS);
+ handler->SendSysMessage(" =============================================================================== ");
+ handler->SendSysMessage(LANG_BANLIST_CHARACTERS_HEADER);
+ do
+ {
+ handler->SendSysMessage("-------------------------------------------------------------------------------");
+
+ Field* fields = result->Fetch();
+
+ std::string char_name = fields[1].GetString();
+
+ PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
+ stmt2->setUInt32(0, fields[0].GetUInt32());
+ PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
+ if (banInfo)
+ {
+ Field* banFields = banInfo->Fetch();
+ do
+ {
+ time_t timeBan = time_t(banFields[0].GetUInt32());
+ tm* tmBan = localtime(&timeBan);
+
+ if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
+ {
+ handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
+ char_name.c_str(), tmBan->tm_year%100, tmBan->tm_mon+1, tmBan->tm_mday, tmBan->tm_hour, tmBan->tm_min,
+ banFields[2].GetCString(), banFields[3].GetCString());
+ }
+ else
+ {
+ time_t timeUnban = time_t(banFields[1].GetUInt32());
+ tm* tmUnban = localtime(&timeUnban);
+ handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
+ char_name.c_str(), tmBan->tm_year%100, tmBan->tm_mon+1, tmBan->tm_mday, tmBan->tm_hour, tmBan->tm_min,
+ tmUnban->tm_year%100, tmUnban->tm_mon+1, tmUnban->tm_mday, tmUnban->tm_hour, tmUnban->tm_min,
+ banFields[2].GetCString(), banFields[3].GetCString());
+ }
+ }
+ while (banInfo->NextRow());
+ }
+ }
+ while (result->NextRow());
+ handler->SendSysMessage(" =============================================================================== ");
+ }
+
+ return true;
+ }
+
+ static bool HandleBanListIPCommand(ChatHandler* handler, char const* args)
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
+ LoginDatabase.Execute(stmt);
+
+ char* filterStr = strtok((char*)args, " ");
+ std::string filter = filterStr ? filterStr : "";
+ LoginDatabase.EscapeString(filter);
+
+ PreparedQueryResult result;
+
+ if (filter.empty())
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_ALL);
+ result = LoginDatabase.Query(stmt);
+ }
+ else
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_BY_IP);
+ stmt->setString(0, filter);
+ result = LoginDatabase.Query(stmt);
+ }
+
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_BANLIST_NOIP);
+ return true;
+ }
+
+ handler->PSendSysMessage(LANG_BANLIST_MATCHINGIP);
+ // Chat short output
+ if (handler->GetSession())
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ handler->PSendSysMessage("%s", fields[0].GetCString());
+ }
+ while (result->NextRow());
+ }
+ // Console wide output
+ else
+ {
+ handler->SendSysMessage(LANG_BANLIST_IPS);
+ handler->SendSysMessage(" ===============================================================================");
+ handler->SendSysMessage(LANG_BANLIST_IPS_HEADER);
+ do
+ {
+ handler->SendSysMessage("-------------------------------------------------------------------------------");
+ Field* fields = result->Fetch();
+ time_t timeBan = time_t(fields[1].GetUInt32());
+ tm* tmBan = localtime(&timeBan);
+ if (fields[1].GetUInt32() == fields[2].GetUInt32())
+ {
+ handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
+ fields[0].GetCString(), tmBan->tm_year%100, tmBan->tm_mon+1, tmBan->tm_mday, tmBan->tm_hour, tmBan->tm_min,
+ fields[3].GetCString(), fields[4].GetCString());
+ }
+ else
+ {
+ time_t timeUnban = time_t(fields[2].GetUInt32());
+ tm* tmUnban = localtime(&timeUnban);
+ handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
+ fields[0].GetCString(), tmBan->tm_year%100, tmBan->tm_mon+1, tmBan->tm_mday, tmBan->tm_hour, tmBan->tm_min,
+ tmUnban->tm_year%100, tmUnban->tm_mon+1, tmUnban->tm_mday, tmUnban->tm_hour, tmUnban->tm_min,
+ fields[3].GetCString(), fields[4].GetCString());
+ }
+ }
+ while (result->NextRow());
+
+ handler->SendSysMessage(" ===============================================================================");
+ }
+
+ return true;
+ }
+
+ static bool HandleUnBanAccountCommand(ChatHandler* handler, char const* args)
+ {
+ return HandleUnBanHelper(BAN_ACCOUNT, args, handler);
+ }
+
+ static bool HandleUnBanCharacterCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* nameStr = strtok((char*)args, " ");
+ if (!nameStr)
+ return false;
+
+ std::string name = nameStr;
+
+ if (!normalizePlayerName(name))
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!sWorld->RemoveBanCharacter(name))
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return true;
+ }
+
+ static bool HandleUnBanAccountByCharCommand(ChatHandler* handler, char const* args)
+ {
+ return HandleUnBanHelper(BAN_CHARACTER, args, handler);
+ }
+
+ static bool HandleUnBanIPCommand(ChatHandler* handler, char const* args)
+ {
+ return HandleUnBanHelper(BAN_IP, args, handler);
+ }
+
+ static bool HandleUnBanHelper(BanMode mode, char const* args, ChatHandler* handler)
+ {
+ if (!*args)
+ return false;
+
+ char* nameOrIPStr = strtok((char*)args, " ");
+ if (!nameOrIPStr)
+ return false;
+
+ std::string nameOrIP = nameOrIPStr;
+
+ switch (mode)
+ {
+ case BAN_ACCOUNT:
+ if (!AccountMgr::normalizeString(nameOrIP))
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ break;
+ case BAN_CHARACTER:
+ if (!normalizePlayerName(nameOrIP))
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ break;
+ case BAN_IP:
+ if (!IsIPAddress(nameOrIP.c_str()))
+ return false;
+ break;
+ }
+
+ if (sWorld->RemoveBanAccount(mode, nameOrIP))
+ handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
+ else
+ handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
+
+ return true;
+ }
+};
+
+void AddSC_ban_commandscript()
+{
+ new ban_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
new file mode 100644
index 00000000000..7284e6ad6b7
--- /dev/null
+++ b/src/server/scripts/Commands/cs_bf.cpp
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: bf_commandscript
+%Complete: 100
+Comment: All bf related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "BattlefieldMgr.h"
+
+class bf_commandscript : public CommandScript
+{
+public:
+ bf_commandscript() : CommandScript("bf_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand battlefieldcommandTable[] =
+ {
+ { "start", SEC_ADMINISTRATOR, false, &HandleBattlefieldStart, "", NULL },
+ { "stop", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnd, "", NULL },
+ { "switch", SEC_ADMINISTRATOR, false, &HandleBattlefieldSwitch, "", NULL },
+ { "timer", SEC_ADMINISTRATOR, false, &HandleBattlefieldTimer, "", NULL },
+ { "enable", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnable, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "bf", SEC_ADMINISTRATOR, false, NULL, "", battlefieldcommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleBattlefieldStart(ChatHandler* handler, const char* args)
+ {
+ uint32 battleid = 0;
+ char* battleid_str = strtok((char*)args, " ");
+ if (!battleid_str)
+ return false;
+
+ battleid = atoi(battleid_str);
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);
+
+ if (!bf)
+ return false;
+
+ bf->StartBattle();
+
+ if (battleid == 1)
+ handler->SendGlobalGMSysMessage("Wintergrasp (Command start used)");
+
+ return true;
+ }
+
+ static bool HandleBattlefieldEnd(ChatHandler* handler, const char* args)
+ {
+ uint32 battleid = 0;
+ char* battleid_str = strtok((char*)args, " ");
+ if (!battleid_str)
+ return false;
+
+ battleid = atoi(battleid_str);
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);
+
+ if (!bf)
+ return false;
+
+ bf->EndBattle(true);
+
+ if (battleid == 1)
+ handler->SendGlobalGMSysMessage("Wintergrasp (Command stop used)");
+
+ return true;
+ }
+
+ static bool HandleBattlefieldEnable(ChatHandler* handler, const char* args)
+ {
+ uint32 battleid = 0;
+ char* battleid_str = strtok((char*)args, " ");
+ if (!battleid_str)
+ return false;
+
+ battleid = atoi(battleid_str);
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);
+
+ if (!bf)
+ return false;
+
+ if (bf->IsEnabled())
+ {
+ bf->ToggleBattlefield(false);
+ if (battleid == 1)
+ handler->SendGlobalGMSysMessage("Wintergrasp is disabled");
+ }
+ else
+ {
+ bf->ToggleBattlefield(true);
+ if (battleid == 1)
+ handler->SendGlobalGMSysMessage("Wintergrasp is enabled");
+ }
+
+ return true;
+ }
+
+ static bool HandleBattlefieldSwitch(ChatHandler* handler, const char* args)
+ {
+ uint32 battleid = 0;
+ char* battleid_str = strtok((char*)args, " ");
+ if (!battleid_str)
+ return false;
+
+ battleid = atoi(battleid_str);
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);
+
+ if (!bf)
+ return false;
+
+ bf->EndBattle(false);
+ if (battleid == 1)
+ handler->SendGlobalGMSysMessage("Wintergrasp (Command switch used)");
+
+ return true;
+ }
+
+ static bool HandleBattlefieldTimer(ChatHandler* handler, const char* args)
+ {
+ uint32 battleid = 0;
+ uint32 time = 0;
+ char* battleid_str = strtok((char*)args, " ");
+ if (!battleid_str)
+ return false;
+ char* time_str = strtok(NULL, " ");
+ if (!time_str)
+ return false;
+
+ battleid = atoi(battleid_str);
+
+ time = atoi(time_str);
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);
+
+ if (!bf)
+ return false;
+
+ bf->SetTimer(time * IN_MILLISECONDS);
+ bf->SendInitWorldStatesToAll();
+ if (battleid == 1)
+ handler->SendGlobalGMSysMessage("Wintergrasp (Command timer used)");
+
+ return true;
+ }
+};
+
+void AddSC_bf_commandscript()
+{
+ new bf_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp
new file mode 100644
index 00000000000..70cfb8cb830
--- /dev/null
+++ b/src/server/scripts/Commands/cs_cast.cpp
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: cast_commandscript
+%Complete: 100
+Comment: All cast related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+
+class cast_commandscript : public CommandScript
+{
+public:
+ cast_commandscript() : CommandScript("cast_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand castCommandTable[] =
+ {
+ { "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "", NULL },
+ { "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "", NULL },
+ { "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "", NULL },
+ { "target", SEC_ADMINISTRATOR, false, &HandleCastTargetCommad, "", NULL },
+ { "dest", SEC_ADMINISTRATOR, false, &HandleCastDestCommand, "", NULL },
+ { "", SEC_ADMINISTRATOR, false, &HandleCastCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleCastCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Unit* target = handler->getSelectedUnit();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastBackCommand(ChatHandler* handler, char const* args)
+ {
+ Creature* caster = handler->getSelectedCreature();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastDistCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* distStr = strtok(NULL, " ");
+
+ float dist = 0;
+
+ if (distStr)
+ sscanf(distStr, "%f", &dist);
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ float x, y, z;
+ handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist);
+
+ handler->GetSession()->GetPlayer()->CastSpell(x, y, z, spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastSelfCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Unit* target = handler->getSelectedUnit();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo)
+ return false;
+
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ target->CastSpell(target, spellId, false);
+
+ return true;
+ }
+
+ static bool HandleCastTargetCommad(ChatHandler* handler, char const* args)
+ {
+ Creature* caster = handler->getSelectedCreature();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!caster->getVictim())
+ {
+ handler->SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ caster->CastSpell(caster->getVictim(), spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastDestCommand(ChatHandler* handler, char const* args)
+ {
+ Unit* caster = handler->getSelectedUnit();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* posX = strtok(NULL, " ");
+ char* posY = strtok(NULL, " ");
+ char* posZ = strtok(NULL, " ");
+
+ if (!posX || !posY || !posZ)
+ return false;
+
+ float x = float(atof(posX));
+ float y = float(atof(posY));
+ float z = float(atof(posZ));
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ caster->CastSpell(x, y, z, spellId, triggered);
+
+ return true;
+ }
+};
+
+void AddSC_cast_commandscript()
+{
+ new cast_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
new file mode 100644
index 00000000000..f5fbfa33cae
--- /dev/null
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -0,0 +1,924 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: character_commandscript
+%Complete: 100
+Comment: All character related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "AccountMgr.h"
+#include "ObjectMgr.h"
+#include "PlayerDump.h"
+
+class character_commandscript : public CommandScript
+{
+public:
+ character_commandscript() : CommandScript("character_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand pdumpCommandTable[] =
+ {
+ { "load", SEC_ADMINISTRATOR, true, &HandlePDumpLoadCommand, "", NULL },
+ { "write", SEC_ADMINISTRATOR, true, &HandlePDumpWriteCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand characterDeletedCommandTable[] =
+ {
+ { "delete", SEC_CONSOLE, true, &HandleCharacterDeletedDeleteCommand, "", NULL },
+ { "list", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedListCommand, "", NULL },
+ { "restore", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedRestoreCommand, "", NULL },
+ { "old", SEC_CONSOLE, true, &HandleCharacterDeletedOldCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand characterCommandTable[] =
+ {
+ { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL },
+ { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL },
+ { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL },
+ { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable },
+ { "erase", SEC_CONSOLE, true, &HandleCharacterEraseCommand, "", NULL },
+ { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL },
+ { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL },
+ { "reputation", SEC_GAMEMASTER, true, &HandleCharacterReputationCommand, "", NULL },
+ { "titles", SEC_GAMEMASTER, true, &HandleCharacterTitlesCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable },
+ { "levelup", SEC_ADMINISTRATOR, false, &HandleLevelUpCommand, "", NULL },
+ { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ // Stores informations about a deleted character
+ struct DeletedInfo
+ {
+ uint32 lowGuid; ///< the low GUID from the character
+ std::string name; ///< the character name
+ uint32 accountId; ///< the account id
+ std::string accountName; ///< the account name
+ time_t deleteDate; ///< the date at which the character has been deleted
+ };
+
+ typedef std::list<DeletedInfo> DeletedInfoList;
+
+ /**
+ * Collects all GUIDs (and related info) from deleted characters which are still in the database.
+ *
+ * @param foundList a reference to an std::list which will be filled with info data
+ * @param searchString the search string which either contains a player GUID or a part fo the character-name
+ * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable)
+ */
+ static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
+ {
+ PreparedQueryResult result;
+ PreparedStatement* stmt;
+ if (!searchString.empty())
+ {
+ // search by GUID
+ if (isNumeric(searchString.c_str()))
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID);
+ stmt->setUInt32(0, uint32(atoi(searchString.c_str())));
+ result = CharacterDatabase.Query(stmt);
+ }
+ // search by name
+ else
+ {
+ if (!normalizePlayerName(searchString))
+ return false;
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME);
+ stmt->setString(0, searchString);
+ result = CharacterDatabase.Query(stmt);
+ }
+ }
+ else
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO);
+ result = CharacterDatabase.Query(stmt);
+ }
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+
+ DeletedInfo info;
+
+ info.lowGuid = fields[0].GetUInt32();
+ info.name = fields[1].GetString();
+ info.accountId = fields[2].GetUInt32();
+
+ // account name will be empty for not existed account
+ AccountMgr::GetName(info.accountId, info.accountName);
+ info.deleteDate = time_t(fields[3].GetUInt32());
+ foundList.push_back(info);
+ }
+ while (result->NextRow());
+ }
+
+ return true;
+ }
+
+ /**
+ * Shows all deleted characters which matches the given search string, expected non empty list
+ *
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedRestoreCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see DeletedInfoList
+ *
+ * @param foundList contains a list with all found deleted characters
+ */
+ static void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList, ChatHandler* handler)
+ {
+ if (!handler->GetSession())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER);
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
+ }
+
+ for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
+ {
+ std::string dateStr = TimeToTimestampStr(itr->deleteDate);
+
+ if (!handler->GetSession())
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
+ itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
+ itr->accountId, dateStr.c_str());
+ else
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
+ itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
+ itr->accountId, dateStr.c_str());
+ }
+
+ if (!handler->GetSession())
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
+ }
+
+ /**
+ * Restore a previously deleted character
+ *
+ * @see HandleCharacterDeletedListHelper
+ * @see HandleCharacterDeletedRestoreCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see DeletedInfoList
+ *
+ * @param delInfo the informations about the character which will be restored
+ */
+ static void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo, ChatHandler* handler)
+ {
+ if (delInfo.accountName.empty()) // account not exist
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId);
+ return;
+ }
+
+ // check character count
+ uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId);
+ if (charcount >= 10)
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId);
+ return;
+ }
+
+ if (sObjectMgr->GetPlayerGUIDByName(delInfo.name))
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId);
+ return;
+ }
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO);
+ stmt->setString(0, delInfo.name);
+ stmt->setUInt32(1, delInfo.accountId);
+ stmt->setUInt32(2, delInfo.lowGuid);
+ CharacterDatabase.Execute(stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
+ stmt->setUInt32(0, delInfo.lowGuid);
+ if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
+ sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8());
+ }
+
+ static void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel, ChatHandler* handler)
+ {
+ if (player)
+ {
+ player->GiveLevel(newLevel);
+ player->InitTalentForLevel();
+ player->SetUInt32Value(PLAYER_XP, 0);
+
+ if (handler->needReportToTarget(player))
+ {
+ if (oldLevel == newLevel)
+ ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, handler->GetNameLink().c_str());
+ else if (oldLevel < newLevel)
+ ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, handler->GetNameLink().c_str(), newLevel);
+ else // if (oldlevel > newlevel)
+ ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, handler->GetNameLink().c_str(), newLevel);
+ }
+ }
+ else
+ {
+ // Update level and reset XP, everything else will be updated at login
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
+ stmt->setUInt8(0, uint8(newLevel));
+ stmt->setUInt32(1, GUID_LOPART(playerGuid));
+ CharacterDatabase.Execute(stmt);
+ }
+ }
+
+ static bool HandleCharacterTitlesCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ LocaleConstant loc = handler->GetSessionDbcLocale();
+ char const* targetName = target->GetName();
+ char const* knownStr = handler->GetTrinityString(LANG_KNOWN);
+
+ // Search in CharTitles.dbc
+ for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
+ {
+ CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
+
+ if (titleInfo && target->HasTitle(titleInfo))
+ {
+ std::string name = titleInfo->name[loc];
+ if (name.empty())
+ continue;
+
+ char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
+ ? handler->GetTrinityString(LANG_ACTIVE)
+ : "";
+
+ char titleNameStr[80];
+ snprintf(titleNameStr, 80, name.c_str(), targetName);
+
+ // send title in "id (idx:idx) - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
+ else
+ handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
+ }
+ }
+
+ return true;
+ }
+
+ //rename characters
+ static bool HandleCharacterRenameCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ if (target)
+ {
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ handler->PSendSysMessage(LANG_RENAME_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_RENAME);
+ }
+ else
+ {
+ // check offline security
+ if (handler->HasLowerSecurity(NULL, targetGuid))
+ return false;
+
+ std::string oldNameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ CharacterDatabase.Execute(stmt);
+ }
+
+ return true;
+ }
+
+ static bool HandleCharacterLevelCommand(ChatHandler* handler, char const* args)
+ {
+ char* nameStr;
+ char* levelStr;
+ handler->extractOptFirstArg((char*)args, &nameStr, &levelStr);
+ if (!levelStr)
+ return false;
+
+ // exception opt second arg: .character level $name
+ if (isalpha(levelStr[0]))
+ {
+ nameStr = levelStr;
+ levelStr = NULL; // current level will used
+ }
+
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
+ return false;
+
+ int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(targetGuid);
+ int32 newlevel = levelStr ? atoi(levelStr) : oldlevel;
+
+ if (newlevel < 1)
+ return false; // invalid level
+
+ if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
+ newlevel = STRONG_MAX_LEVEL;
+
+ HandleCharacterLevel(target, targetGuid, oldlevel, newlevel, handler);
+ if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL
+ {
+ std::string nameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
+ }
+
+ return true;
+ }
+
+ // customize characters
+ static bool HandleCharacterCustomizeCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
+ if (target)
+ {
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
+ stmt->setUInt32(1, target->GetGUIDLow());
+ }
+ else
+ {
+ std::string oldNameLink = handler->playerLink(targetName);
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ }
+ CharacterDatabase.Execute(stmt);
+
+ return true;
+ }
+
+ static bool HandleCharacterChangeFactionCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
+ if (target)
+ {
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
+ stmt->setUInt32(1, target->GetGUIDLow());
+ }
+ else
+ {
+ std::string oldNameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ }
+ CharacterDatabase.Execute(stmt);
+
+ return true;
+ }
+
+ static bool HandleCharacterChangeRaceCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
+ if (target)
+ {
+ // TODO : add text into database
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
+ stmt->setUInt32(1, target->GetGUIDLow());
+ }
+ else
+ {
+ std::string oldNameLink = handler->playerLink(targetName);
+ // TODO : add text into database
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ }
+ CharacterDatabase.Execute(stmt);
+
+ return true;
+ }
+
+ static bool HandleCharacterReputationCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ LocaleConstant loc = handler->GetSessionDbcLocale();
+
+ FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
+ for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
+ {
+ FactionState const& faction = itr->second;
+ FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
+ char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
+ ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
+ std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r";
+ else
+ ss << faction.ID << " - " << factionName << ' ' << localeNames[loc];
+
+ ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
+
+ if (faction.Flags & FACTION_FLAG_VISIBLE)
+ ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
+ if (faction.Flags & FACTION_FLAG_AT_WAR)
+ ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
+ if (faction.Flags & FACTION_FLAG_PEACE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
+ if (faction.Flags & FACTION_FLAG_HIDDEN)
+ ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
+ if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
+ if (faction.Flags & FACTION_FLAG_INACTIVE)
+ ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
+
+ handler->SendSysMessage(ss.str().c_str());
+ }
+
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string
+ *
+ * @see HandleCharacterDeletedListHelper
+ * @see HandleCharacterDeletedRestoreCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see DeletedInfoList
+ *
+ * @param args the search string which either contains a player GUID or a part fo the character-name
+ */
+ static bool HandleCharacterDeletedListCommand(ChatHandler* handler, char const* args)
+ {
+ DeletedInfoList foundList;
+ if (!GetDeletedCharacterInfoList(foundList, args))
+ return false;
+
+ // if no characters have been found, output a warning
+ if (foundList.empty())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
+ return false;
+ }
+
+ HandleCharacterDeletedListHelper(foundList, handler);
+
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string
+ *
+ * The command automatically calls '.character deleted list' command with the search string to show all restored characters.
+ *
+ * @see HandleCharacterDeletedRestoreHelper
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ *
+ * @param args the search string which either contains a player GUID or a part of the character-name
+ */
+ static bool HandleCharacterDeletedRestoreCommand(ChatHandler* handler, char const* args)
+ {
+ // It is required to submit at least one argument
+ if (!*args)
+ return false;
+
+ std::string searchString;
+ std::string newCharName;
+ uint32 newAccount = 0;
+
+ // GCC by some strange reason fail build code without temporary variable
+ std::istringstream params(args);
+ params >> searchString >> newCharName >> newAccount;
+
+ DeletedInfoList foundList;
+ if (!GetDeletedCharacterInfoList(foundList, searchString))
+ return false;
+
+ if (foundList.empty())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
+ return false;
+ }
+
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_RESTORE);
+ HandleCharacterDeletedListHelper(foundList, handler);
+
+ if (newCharName.empty())
+ {
+ // Drop not existed account cases
+ for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
+ HandleCharacterDeletedRestoreHelper(*itr, handler);
+ }
+ else if (foundList.size() == 1 && normalizePlayerName(newCharName))
+ {
+ DeletedInfo delInfo = foundList.front();
+
+ // update name
+ delInfo.name = newCharName;
+
+ // if new account provided update deleted info
+ if (newAccount && newAccount != delInfo.accountId)
+ {
+ delInfo.accountId = newAccount;
+ AccountMgr::GetName(newAccount, delInfo.accountName);
+ }
+
+ HandleCharacterDeletedRestoreHelper(delInfo, handler);
+ }
+ else
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME);
+
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string
+ *
+ * @see Player::GetDeletedCharacterGUIDs
+ * @see Player::DeleteFromDB
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedRestoreCommand
+ *
+ * @param args the search string which either contains a player GUID or a part fo the character-name
+ */
+ static bool HandleCharacterDeletedDeleteCommand(ChatHandler* handler, char const* args)
+ {
+ // It is required to submit at least one argument
+ if (!*args)
+ return false;
+
+ DeletedInfoList foundList;
+ if (!GetDeletedCharacterInfoList(foundList, args))
+ return false;
+
+ if (foundList.empty())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
+ return false;
+ }
+
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_DELETE);
+ HandleCharacterDeletedListHelper(foundList, handler);
+
+ // Call the appropriate function to delete them (current account for deleted characters is 0)
+ for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
+ Player::DeleteFromDB(itr->lowGuid, 0, false, true);
+
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago
+ *
+ * @see Player::DeleteOldCharacters
+ * @see Player::DeleteFromDB
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedRestoreCommand
+ *
+ * @param args the search string which either contains a player GUID or a part fo the character-name
+ */
+ static bool HandleCharacterDeletedOldCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
+
+ char* daysStr = strtok((char*)args, " ");
+ if (daysStr)
+ {
+ if (!isNumeric(daysStr))
+ return false;
+
+ keepDays = atoi(daysStr);
+ if (keepDays < 0)
+ return false;
+ }
+ // config option value 0 -> disabled and can't be used
+ else if (keepDays <= 0)
+ return false;
+
+ Player::DeleteOldCharacters(uint32(keepDays));
+
+ return true;
+ }
+
+ static bool HandleCharacterEraseCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* characterName_str = strtok((char*)args, " ");
+ if (!characterName_str)
+ return false;
+
+ std::string characterName = characterName_str;
+ if (!normalizePlayerName(characterName))
+ return false;
+
+ uint64 characterGuid;
+ uint32 accountId;
+
+ Player* player = sObjectAccessor->FindPlayerByName(characterName.c_str());
+ if (player)
+ {
+ characterGuid = player->GetGUID();
+ accountId = player->GetSession()->GetAccountId();
+ player->GetSession()->KickPlayer();
+ }
+ else
+ {
+ characterGuid = sObjectMgr->GetPlayerGUIDByName(characterName);
+ if (!characterGuid)
+ {
+ handler->PSendSysMessage(LANG_NO_PLAYER, characterName.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ accountId = sObjectMgr->GetPlayerAccountIdByGUID(characterGuid);
+ }
+
+ std::string accountName;
+ AccountMgr::GetName(accountId, accountName);
+
+ Player::DeleteFromDB(characterGuid, accountId, true, true);
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED, characterName.c_str(), GUID_LOPART(characterGuid), accountName.c_str(), accountId);
+
+ return true;
+ }
+
+ static bool HandleLevelUpCommand(ChatHandler* handler, char const* args)
+ {
+ char* nameStr;
+ char* levelStr;
+ handler->extractOptFirstArg((char*)args, &nameStr, &levelStr);
+
+ // exception opt second arg: .character level $name
+ if (levelStr && isalpha(levelStr[0]))
+ {
+ nameStr = levelStr;
+ levelStr = NULL; // current level will used
+ }
+
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
+ return false;
+
+ int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(targetGuid);
+ int32 addlevel = levelStr ? atoi(levelStr) : 1;
+ int32 newlevel = oldlevel + addlevel;
+
+ if (newlevel < 1)
+ newlevel = 1;
+
+ if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
+ newlevel = STRONG_MAX_LEVEL;
+
+ HandleCharacterLevel(target, targetGuid, oldlevel, newlevel, handler);
+
+ if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including chr == NULL
+ {
+ std::string nameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
+ }
+
+ return true;
+ }
+
+ static bool HandlePDumpLoadCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* fileStr = strtok((char*)args, " ");
+ if (!fileStr)
+ return false;
+
+ char* accountStr = strtok(NULL, " ");
+ if (!accountStr)
+ return false;
+
+ std::string accountName = accountStr;
+ if (!AccountMgr::normalizeString(accountName))
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 accountId = AccountMgr::GetId(accountName);
+ if (!accountId)
+ {
+ accountId = atoi(accountStr); // use original string
+ if (!accountId)
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ if (!AccountMgr::GetName(accountId, accountName))
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* guidStr = NULL;
+ char* nameStr = strtok(NULL, " ");
+
+ std::string name;
+ if (nameStr)
+ {
+ name = nameStr;
+ // normalize the name if specified and check if it exists
+ if (!normalizePlayerName(name))
+ {
+ handler->PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (ObjectMgr::CheckPlayerName(name, true) != CHAR_NAME_SUCCESS)
+ {
+ handler->PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ guidStr = strtok(NULL, " ");
+ }
+
+ uint32 guid = 0;
+
+ if (guidStr)
+ {
+ guid = uint32(atoi(guidStr));
+ if (!guid)
+ {
+ handler->PSendSysMessage(LANG_INVALID_CHARACTER_GUID);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (sObjectMgr->GetPlayerAccountIdByGUID(guid))
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_GUID_IN_USE, guid);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ switch (PlayerDumpReader().LoadDump(fileStr, accountId, name, guid))
+ {
+ case DUMP_SUCCESS:
+ handler->PSendSysMessage(LANG_COMMAND_IMPORT_SUCCESS);
+ break;
+ case DUMP_FILE_OPEN_ERROR:
+ handler->PSendSysMessage(LANG_FILE_OPEN_FAIL, fileStr);
+ handler->SetSentErrorMessage(true);
+ return false;
+ case DUMP_FILE_BROKEN:
+ handler->PSendSysMessage(LANG_DUMP_BROKEN, fileStr);
+ handler->SetSentErrorMessage(true);
+ return false;
+ case DUMP_TOO_MANY_CHARS:
+ handler->PSendSysMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, accountName.c_str(), accountId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ default:
+ handler->PSendSysMessage(LANG_COMMAND_IMPORT_FAILED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return true;
+ }
+
+ static bool HandlePDumpWriteCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* fileStr = strtok((char*)args, " ");
+ char* playerStr = strtok(NULL, " ");
+
+ if (!fileStr || !playerStr)
+ return false;
+
+ uint64 guid;
+ // character name can't start from number
+ if (isNumeric(playerStr))
+ guid = MAKE_NEW_GUID(atoi(playerStr), 0, HIGHGUID_PLAYER);
+ else
+ {
+ std::string name = handler->extractPlayerNameFromLink(playerStr);
+ if (name.empty())
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ guid = sObjectMgr->GetPlayerGUIDByName(name);
+ }
+
+ if (!sObjectMgr->GetPlayerAccountIdByGUID(guid))
+ {
+ handler->PSendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ switch (PlayerDumpWriter().WriteDump(fileStr, uint32(guid)))
+ {
+ case DUMP_SUCCESS:
+ handler->PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS);
+ break;
+ case DUMP_FILE_OPEN_ERROR:
+ handler->PSendSysMessage(LANG_FILE_OPEN_FAIL, fileStr);
+ handler->SetSentErrorMessage(true);
+ return false;
+ case DUMP_CHARACTER_DELETED:
+ handler->PSendSysMessage(LANG_COMMAND_EXPORT_DELETED_CHAR);
+ handler->SetSentErrorMessage(true);
+ return false;
+ default:
+ handler->PSendSysMessage(LANG_COMMAND_EXPORT_FAILED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return true;
+ }
+};
+
+void AddSC_character_commandscript()
+{
+ new character_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
new file mode 100644
index 00000000000..4f503fdbb76
--- /dev/null
+++ b/src/server/scripts/Commands/cs_cheat.cpp
@@ -0,0 +1,298 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: cheat_commandscript
+%Complete: 100
+Comment: All cheat related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "ObjectMgr.h"
+#include "Chat.h"
+
+class cheat_commandscript : public CommandScript
+{
+public:
+ cheat_commandscript() : CommandScript("cheat_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+
+ static ChatCommand cheatCommandTable[] =
+ {
+ { "god", SEC_GAMEMASTER, false, &HandleGodModeCheatCommand, "", NULL },
+ { "casttime", SEC_GAMEMASTER, false, &HandleCasttimeCheatCommand, "", NULL },
+ { "cooldown", SEC_GAMEMASTER, false, &HandleCoolDownCheatCommand, "", NULL },
+ { "power", SEC_GAMEMASTER, false, &HandlePowerCheatCommand, "", NULL },
+ { "waterwalk", SEC_GAMEMASTER, false, &HandleWaterWalkCheatCommand, "", NULL },
+ { "status", SEC_GAMEMASTER, false, &HandleCheatStatusCommand, "", NULL },
+ { "taxi", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "", NULL },
+ { "explore", SEC_GAMEMASTER, false, &HandleExploreCheatCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "cheat", SEC_GAMEMASTER, false, NULL, "", cheatCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleGodModeCheatCommand(ChatHandler* handler, const char* args)
+ {
+ if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
+ return false;
+
+ std::string argstr = (char*)args;
+
+ if (!*args)
+ argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_GOD)) ? "off" : "on";
+
+ if (argstr == "off")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_GOD);
+ handler->SendSysMessage("Godmode is OFF. You can take damage.");
+ return true;
+ }
+ else if (argstr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_GOD);
+ handler->SendSysMessage("Godmode is ON. You won't take damage.");
+ return true;
+ }
+
+ return false;
+ }
+
+ static bool HandleCasttimeCheatCommand(ChatHandler* handler, const char* args)
+ {
+ if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
+ return false;
+
+ std::string argstr = (char*)args;
+
+ if (!*args)
+ argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_CASTTIME)) ? "off" : "on";
+
+ if (argstr == "off")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_CASTTIME);
+ handler->SendSysMessage("CastTime Cheat is OFF. Your spells will have a casttime.");
+ return true;
+ }
+ else if (argstr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_CASTTIME);
+ handler->SendSysMessage("CastTime Cheat is ON. Your spells won't have a casttime.");
+ return true;
+ }
+
+ return false;
+ }
+
+ static bool HandleCoolDownCheatCommand(ChatHandler* handler, const char* args)
+ {
+ if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
+ return false;
+
+ std::string argstr = (char*)args;
+
+ if (!*args)
+ argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_COOLDOWN)) ? "off" : "on";
+
+ if (argstr == "off")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_COOLDOWN);
+ handler->SendSysMessage("Cooldown Cheat is OFF. You are on the global cooldown.");
+ return true;
+ }
+ else if (argstr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_COOLDOWN);
+ handler->SendSysMessage("Cooldown Cheat is ON. You are not on the global cooldown.");
+ return true;
+ }
+
+ return false;
+ }
+
+ static bool HandlePowerCheatCommand(ChatHandler* handler, const char* args)
+ {
+ if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
+ return false;
+
+ std::string argstr = (char*)args;
+
+ if (!*args)
+ argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_POWER)) ? "off" : "on";
+
+ if (argstr == "off")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_POWER);
+ handler->SendSysMessage("Power Cheat is OFF. You need mana/rage/energy to use spells.");
+ return true;
+ }
+ else if (argstr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_POWER);
+ handler->SendSysMessage("Power Cheat is ON. You don't need mana/rage/energy to use spells.");
+ return true;
+ }
+
+ return false;
+ }
+
+ static bool HandleCheatStatusCommand(ChatHandler* handler, const char* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+
+ const char* enabled = "enabled";
+ const char* disabled = "disabled";
+
+ handler->SendSysMessage(LANG_COMMAND_CHEAT_STATUS);
+ handler->PSendSysMessage(LANG_COMMAND_CHEAT_GOD, player->GetCommandStatus(CHEAT_GOD) ? enabled : disabled);
+ handler->PSendSysMessage(LANG_COMMAND_CHEAT_CD, player->GetCommandStatus(CHEAT_COOLDOWN) ? enabled : disabled);
+ handler->PSendSysMessage(LANG_COMMAND_CHEAT_CT, player->GetCommandStatus(CHEAT_CASTTIME) ? enabled : disabled);
+ handler->PSendSysMessage(LANG_COMMAND_CHEAT_POWER, player->GetCommandStatus(CHEAT_POWER) ? enabled : disabled);
+ handler->PSendSysMessage(LANG_COMMAND_CHEAT_WW, player->GetCommandStatus(CHEAT_WATERWALK) ? enabled : disabled);
+ return true;
+ }
+
+ static bool HandleWaterWalkCheatCommand(ChatHandler* handler, const char* args)
+ {
+ if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
+ return false;
+
+ std::string argstr = (char*)args;
+
+ if (!*args)
+ {
+ argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK)) ? "off" : "on";
+ if (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK))
+ argstr = "off";
+ else
+ argstr = "on";
+ }
+
+ if (argstr == "off")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK);
+ handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF
+ handler->SendSysMessage("Waterwalking is OFF. You can't walk on water.");
+ return true;
+ }
+ else if (argstr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK);
+ handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON
+ handler->SendSysMessage("Waterwalking is ON. You can walk on water.");
+ return true;
+ }
+
+ return false;
+ }
+
+ static bool HandleTaxiCheatCommand(ChatHandler* handler, const char* args)
+ {
+ if (!*args)
+ {
+ handler->SendSysMessage(LANG_USE_BOL);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ std::string argstr = (char*)args;
+
+ Player* chr = handler->getSelectedPlayer();
+
+ if (!chr)
+ chr = handler->GetSession()->GetPlayer();
+ else if (handler->HasLowerSecurity(chr, 0)) // check online security
+ return false;
+
+ if (argstr == "on")
+ {
+ chr->SetTaxiCheater(true);
+ handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
+ if (handler->needReportToTarget(chr))
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
+ return true;
+ }
+
+ if (argstr == "off")
+ {
+ chr->SetTaxiCheater(false);
+ handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
+ if (handler->needReportToTarget(chr))
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
+
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_USE_BOL);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ static bool HandleExploreCheatCommand(ChatHandler* handler, const char *args)
+ {
+ if (!*args)
+ return false;
+
+ int flag = atoi((char*)args);
+
+ Player* chr = handler->getSelectedPlayer();
+ if (chr == NULL)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (flag != 0)
+ {
+ handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr).c_str());
+ if (handler->needReportToTarget(chr))
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str());
+ }
+ else
+ {
+ handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr).c_str());
+ if (handler->needReportToTarget(chr))
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str());
+ }
+
+ for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
+ {
+ if (flag != 0)
+ handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
+ else
+ handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
+ }
+
+ return true;
+ }
+};
+
+void AddSC_cheat_commandscript()
+{
+ new cheat_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index c7bcde01e9b..7f25a11bcdd 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -410,7 +410,7 @@ public:
}
else
{
- sLog->outError("Sending opcode that has unknown type '%s'", type.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Sending opcode that has unknown type '%s'", type.c_str());
break;
}
}
@@ -1325,7 +1325,7 @@ public:
{
Player* player = handler->GetSession()->GetPlayer();
- sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+ sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
return true;
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
new file mode 100644
index 00000000000..0bb376b08dd
--- /dev/null
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -0,0 +1,371 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: disable_commandscript
+%Complete: 100
+Comment: All disable related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "ObjectMgr.h"
+#include "Chat.h"
+#include "DisableMgr.h"
+#include "OutdoorPvP.h"
+
+class disable_commandscript : public CommandScript
+{
+public:
+ disable_commandscript() : CommandScript("disable_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand removeDisableCommandTable[] =
+ {
+ { "spell", SEC_ADMINISTRATOR, true, &HandleRemoveDisableSpellCommand, "", NULL },
+ { "quest", SEC_ADMINISTRATOR, true, &HandleRemoveDisableQuestCommand, "", NULL },
+ { "map", SEC_ADMINISTRATOR, true, &HandleRemoveDisableMapCommand, "", NULL },
+ { "battleground", SEC_ADMINISTRATOR, true, &HandleRemoveDisableBattlegroundCommand, "", NULL },
+ { "achievement_criteria", SEC_ADMINISTRATOR, true, &HandleRemoveDisableAchievementCriteriaCommand, "", NULL },
+ { "outdoorpvp", SEC_ADMINISTRATOR, true, &HandleRemoveDisableOutdoorPvPCommand, "", NULL },
+ { "vmap", SEC_ADMINISTRATOR, true, &HandleRemoveDisableVmapCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand addDisableCommandTable[] =
+ {
+ { "spell", SEC_ADMINISTRATOR, true, &HandleAddDisableSpellCommand, "", NULL },
+ { "quest", SEC_ADMINISTRATOR, true, &HandleAddDisableQuestCommand, "", NULL },
+ { "map", SEC_ADMINISTRATOR, true, &HandleAddDisableMapCommand, "", NULL },
+ { "battleground", SEC_ADMINISTRATOR, true, &HandleAddDisableBattlegroundCommand, "", NULL },
+ { "achievement_criteria", SEC_ADMINISTRATOR, true, &HandleAddDisableAchievementCriteriaCommand, "", NULL },
+ { "outdoorpvp", SEC_ADMINISTRATOR, true, &HandleAddDisableOutdoorPvPCommand, "", NULL },
+ { "vmap", SEC_ADMINISTRATOR, true, &HandleAddDisableVmapCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand disableCommandTable[] =
+ {
+ { "add", SEC_ADMINISTRATOR, true, NULL, "", addDisableCommandTable },
+ { "remove", SEC_ADMINISTRATOR, true, NULL, "", removeDisableCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "disable", SEC_ADMINISTRATOR, false, NULL, "", disableCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleAddDisables(ChatHandler* handler, char const* args, uint8 disableType)
+ {
+ char* entryStr = strtok((char*)args, " ");
+ if (!entryStr || !atoi(entryStr))
+ return false;
+
+ char* flagsStr = strtok(NULL, " ");
+ uint8 flags = flagsStr ? uint8(atoi(flagsStr)) : 0;
+
+ char* commentStr = strtok(NULL, "");
+ if (!commentStr)
+ return false;
+
+ std::string disableComment = commentStr;
+ uint32 entry = uint32(atoi(entryStr));
+
+ std::string disableTypeStr = "";
+
+ switch (disableType)
+ {
+ case DISABLE_TYPE_SPELL:
+ {
+ if (!sSpellMgr->GetSpellInfo(entry))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "spell";
+ break;
+ }
+ case DISABLE_TYPE_QUEST:
+ {
+ if (!sObjectMgr->GetQuestTemplate(entry))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "quest";
+ break;
+ }
+ case DISABLE_TYPE_MAP:
+ {
+ if (!sMapStore.LookupEntry(entry))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "map";
+ break;
+ }
+ case DISABLE_TYPE_BATTLEGROUND:
+ {
+ if (!sBattlemasterListStore.LookupEntry(entry))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NO_BATTLEGROUND_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "battleground";
+ break;
+ }
+ case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
+ {
+ if (!sAchievementCriteriaStore.LookupEntry(entry))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "achievement criteria";
+ break;
+ }
+ case DISABLE_TYPE_OUTDOORPVP:
+ {
+ if (entry > MAX_OUTDOORPVP_TYPES)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NO_OUTDOOR_PVP_FORUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "outdoorpvp";
+ break;
+ }
+ case DISABLE_TYPE_VMAP:
+ {
+ if (!sMapStore.LookupEntry(entry))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ disableTypeStr = "vmap";
+ break;
+ }
+ default:
+ break;
+ }
+
+ PreparedStatement* stmt = NULL;
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
+ stmt->setUInt32(0, entry);
+ stmt->setUInt8(1, disableType);
+ PreparedQueryResult result = WorldDatabase.Query(stmt);
+ if (result)
+ {
+ handler->PSendSysMessage("This %s (Id: %u) is already disabled.", disableTypeStr.c_str(), entry);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_DISABLES);
+ stmt->setUInt32(0, entry);
+ stmt->setUInt8(1, disableType);
+ stmt->setUInt16(2, flags);
+ stmt->setString(3, disableComment);
+ WorldDatabase.Execute(stmt);
+
+ handler->PSendSysMessage("Add Disabled %s (Id: %u) for reason %s", disableTypeStr.c_str(), entry, disableComment.c_str());
+ return true;
+ }
+
+ static bool HandleAddDisableSpellCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_SPELL);
+ }
+
+ static bool HandleAddDisableQuestCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_QUEST);
+ }
+
+ static bool HandleAddDisableMapCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_MAP);
+ }
+
+ static bool HandleAddDisableBattlegroundCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_BATTLEGROUND);
+ }
+
+ static bool HandleAddDisableAchievementCriteriaCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_ACHIEVEMENT_CRITERIA);
+ }
+
+ static bool HandleAddDisableOutdoorPvPCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ HandleAddDisables(handler, args, DISABLE_TYPE_OUTDOORPVP);
+ return true;
+ }
+
+ static bool HandleAddDisableVmapCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_VMAP);
+ }
+
+ static bool HandleRemoveDisables(ChatHandler* handler, char const* args, uint8 disableType)
+ {
+ char* entryStr = strtok((char*)args, " ");
+ if (!entryStr || !atoi(entryStr))
+ return false;
+
+ uint32 entry = uint32(atoi(entryStr));
+
+ std::string disableTypeStr = "";
+
+ switch (disableType)
+ {
+ case DISABLE_TYPE_SPELL:
+ disableTypeStr = "spell";
+ break;
+ case DISABLE_TYPE_QUEST:
+ disableTypeStr = "quest";
+ break;
+ case DISABLE_TYPE_MAP:
+ disableTypeStr = "map";
+ break;
+ case DISABLE_TYPE_BATTLEGROUND:
+ disableTypeStr = "battleground";
+ break;
+ case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
+ disableTypeStr = "achievement criteria";
+ break;
+ case DISABLE_TYPE_OUTDOORPVP:
+ disableTypeStr = "outdoorpvp";
+ break;
+ case DISABLE_TYPE_VMAP:
+ disableTypeStr = "vmap";
+ break;
+ }
+
+ PreparedStatement* stmt = NULL;
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
+ stmt->setUInt32(0, entry);
+ stmt->setUInt8(1, disableType);
+ PreparedQueryResult result = WorldDatabase.Query(stmt);
+ if (!result)
+ {
+ handler->PSendSysMessage("This %s (Id: %u) is not disabled.", disableTypeStr.c_str(), entry);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_DISABLES);
+ stmt->setUInt32(0, entry);
+ stmt->setUInt8(1, disableType);
+ WorldDatabase.Execute(stmt);
+
+ handler->PSendSysMessage("Remove Disabled %s (Id: %u)", disableTypeStr.c_str(), entry);
+ return true;
+ }
+
+ static bool HandleRemoveDisableSpellCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_SPELL);
+ }
+
+ static bool HandleRemoveDisableQuestCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_QUEST);
+ }
+
+ static bool HandleRemoveDisableMapCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleAddDisables(handler, args, DISABLE_TYPE_MAP);
+ }
+
+ static bool HandleRemoveDisableBattlegroundCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_BATTLEGROUND);
+ }
+
+ static bool HandleRemoveDisableAchievementCriteriaCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_ACHIEVEMENT_CRITERIA);
+ }
+
+ static bool HandleRemoveDisableOutdoorPvPCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_OUTDOORPVP);
+ }
+
+ static bool HandleRemoveDisableVmapCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_VMAP);
+ }
+};
+
+void AddSC_disable_commandscript()
+{
+ new disable_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index d449b3617f7..3dfc6f9c7e8 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -196,11 +196,16 @@ public:
return true;
}
+ const uint32 VISUAL_AURA = 37800;
std::string param = (char*)args;
+ Player* player = handler->GetSession()->GetPlayer();
if (param == "on")
{
- handler->GetSession()->GetPlayer()->SetGMVisible(true);
+ if (player->HasAura(VISUAL_AURA, 0))
+ player->RemoveAurasDueToSpell(VISUAL_AURA);
+
+ player->SetGMVisible(true);
handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
return true;
}
@@ -208,7 +213,10 @@ public:
if (param == "off")
{
handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
- handler->GetSession()->GetPlayer()->SetGMVisible(false);
+ player->SetGMVisible(false);
+
+ player->AddAura(VISUAL_AURA, player);
+
return true;
}
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 232aad9f21c..167c56c20a2 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -133,7 +133,7 @@ public:
if (objectInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(objectInfo->displayId))
{
// report to DB errors log as in loading case
- sLog->outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.", objectId, objectInfo->type, objectInfo->displayId);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.", objectId, objectInfo->type, objectInfo->displayId);
handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA, objectId);
handler->SetSentErrorMessage(true);
return false;
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
new file mode 100644
index 00000000000..a453122aef6
--- /dev/null
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: guild_commandscript
+%Complete: 100
+Comment: All guild related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "Guild.h"
+#include "GuildMgr.h"
+#include "ObjectAccessor.h"
+
+class guild_commandscript : public CommandScript
+{
+public:
+ guild_commandscript() : CommandScript("guild_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand guildCommandTable[] =
+ {
+ { "create", SEC_GAMEMASTER, true, &HandleGuildCreateCommand, "", NULL },
+ { "delete", SEC_GAMEMASTER, true, &HandleGuildDeleteCommand, "", NULL },
+ { "invite", SEC_GAMEMASTER, true, &HandleGuildInviteCommand, "", NULL },
+ { "uninvite", SEC_GAMEMASTER, true, &HandleGuildUninviteCommand, "", NULL },
+ { "rank", SEC_GAMEMASTER, true, &HandleGuildRankCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ /** \brief GM command level 3 - Create a guild.
+ *
+ * This command allows a GM (level 3) to create a guild.
+ *
+ * The "args" parameter contains the name of the guild leader
+ * and then the name of the guild.
+ *
+ */
+ static bool HandleGuildCreateCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // if not guild name only (in "") then player name
+ Player* target;
+ if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : NULL, &target))
+ return false;
+
+ char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
+ if (!tailStr)
+ return false;
+
+ char* guildStr = handler->extractQuotedArg(tailStr);
+ if (!guildStr)
+ return false;
+
+ std::string guildName = guildStr;
+
+ if (target->GetGuildId())
+ {
+ handler->SendSysMessage(LANG_PLAYER_IN_GUILD);
+ return true;
+ }
+
+ Guild* guild = new Guild;
+ if (!guild->Create(target, guildName))
+ {
+ delete guild;
+ handler->SendSysMessage(LANG_GUILD_NOT_CREATED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ sGuildMgr->AddGuild(guild);
+
+ return true;
+ }
+
+ static bool HandleGuildDeleteCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* guildStr = handler->extractQuotedArg((char*)args);
+ if (!guildStr)
+ return false;
+
+ std::string guildName = guildStr;
+
+ Guild* targetGuild = sGuildMgr->GetGuildByName(guildName);
+ if (!targetGuild)
+ return false;
+
+ targetGuild->Disband();
+
+ return true;
+ }
+
+ static bool HandleGuildInviteCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // if not guild name only (in "") then player name
+ uint64 targetGuid;
+ if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : NULL, NULL, &targetGuid))
+ return false;
+
+ char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
+ if (!tailStr)
+ return false;
+
+ char* guildStr = handler->extractQuotedArg(tailStr);
+ if (!guildStr)
+ return false;
+
+ std::string guildName = guildStr;
+ Guild* targetGuild = sGuildMgr->GetGuildByName(guildName);
+ if (!targetGuild)
+ return false;
+
+ // player's guild membership checked in AddMember before add
+ return targetGuild->AddMember(targetGuid);
+ }
+
+ static bool HandleGuildUninviteCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
+ return false;
+
+ uint32 guildId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(targetGuid);
+ if (!guildId)
+ return false;
+
+ Guild* targetGuild = sGuildMgr->GetGuildById(guildId);
+ if (!targetGuild)
+ return false;
+
+ targetGuild->DeleteMember(targetGuid, false, true);
+ return true;
+ }
+
+ static bool HandleGuildRankCommand(ChatHandler* handler, char const* args)
+ {
+ char* nameStr;
+ char* rankStr;
+ handler->extractOptFirstArg((char*)args, &nameStr, &rankStr);
+ if (!rankStr)
+ return false;
+
+ Player* target;
+ uint64 targetGuid;
+ std::string target_name;
+ if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &target_name))
+ return false;
+
+ uint32 guildId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(targetGuid);
+ if (!guildId)
+ return false;
+
+ Guild* targetGuild = sGuildMgr->GetGuildById(guildId);
+ if (!targetGuild)
+ return false;
+
+ uint8 newRank = uint8(atoi(rankStr));
+ return targetGuild->ChangeMemberRank(targetGuid, newRank);
+ }
+};
+
+void AddSC_guild_commandscript()
+{
+ new guild_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
new file mode 100644
index 00000000000..f51727af2ef
--- /dev/null
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: instance_commandscript
+%Complete: 100
+Comment: All instance related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "Group.h"
+#include "InstanceSaveMgr.h"
+#include "InstanceScript.h"
+#include "MapManager.h"
+
+class instance_commandscript : public CommandScript
+{
+public:
+ instance_commandscript() : CommandScript("instance_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand instanceCommandTable[] =
+ {
+ { "listbinds", SEC_ADMINISTRATOR, false, &HandleInstanceListBindsCommand, "", NULL },
+ { "unbind", SEC_ADMINISTRATOR, false, &HandleInstanceUnbindCommand, "", NULL },
+ { "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "", NULL },
+ { "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ return commandTable;
+ }
+
+ static std::string GetTimeString(uint64 time)
+ {
+ uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE;
+ std::ostringstream ss;
+ if (days)
+ ss << days << "d ";
+ if (hours)
+ ss << hours << "h ";
+ ss << minute << 'm';
+ return ss.str();
+ }
+
+ static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->getSelectedPlayer();
+ if (!player)
+ player = handler->GetSession()->GetPlayer();
+
+ uint32 counter = 0;
+ for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
+ {
+ Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
+ for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
+ {
+ InstanceSave* save = itr->second.save;
+ std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
+ handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
+ counter++;
+ }
+ }
+ handler->PSendSysMessage("player binds: %d", counter);
+
+ counter = 0;
+ if (Group* group = player->GetGroup())
+ {
+ for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
+ {
+ Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i));
+ for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
+ {
+ InstanceSave* save = itr->second.save;
+ std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
+ handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
+ counter++;
+ }
+ }
+ }
+ handler->PSendSysMessage("group binds: %d", counter);
+
+ return true;
+ }
+
+ static bool HandleInstanceUnbindCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* player = handler->getSelectedPlayer();
+ if (!player)
+ player = handler->GetSession()->GetPlayer();
+
+ char* map = strtok((char*)args, " ");
+ char* pDiff = strtok(NULL, " ");
+ int8 diff = -1;
+ if (pDiff)
+ diff = atoi(pDiff);
+ uint16 counter = 0;
+ uint16 MapId = 0;
+
+ if (strcmp(map, "all"))
+ {
+ MapId = uint16(atoi(map));
+ if (!MapId)
+ return false;
+ }
+
+ for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
+ {
+ Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
+ for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
+ {
+ InstanceSave* save = itr->second.save;
+ if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
+ {
+ std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
+ handler->PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
+ player->UnbindInstance(itr, Difficulty(i));
+ counter++;
+ }
+ else
+ ++itr;
+ }
+ }
+ handler->PSendSysMessage("instances unbound: %d", counter);
+
+ return true;
+ }
+
+ static bool HandleInstanceStatsCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances());
+ handler->PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances());
+ handler->PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves());
+ handler->PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal());
+ handler->PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal());
+
+ return true;
+ }
+
+ static bool HandleInstanceSaveDataCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ Map* map = player->GetMap();
+ if (!map->IsDungeon())
+ {
+ handler->PSendSysMessage("Map is not a dungeon.");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!((InstanceMap*)map)->GetInstanceScript())
+ {
+ handler->PSendSysMessage("Map has no instance data.");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ ((InstanceMap*)map)->GetInstanceScript()->SaveToDB();
+
+ return true;
+ }
+};
+
+void AddSC_instance_commandscript()
+{
+ new instance_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index ae573577d7e..cfdfc66f991 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -22,10 +22,10 @@ Comment: All learn related commands
Category: commandscripts
EndScriptData */
+#include "Chat.h"
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
-#include "Chat.h"
#include "SpellInfo.h"
class learn_commandscript : public CommandScript
@@ -37,35 +37,36 @@ public:
{
static ChatCommand learnAllMyCommandTable[] =
{
- { "class", SEC_ADMINISTRATOR, false, &HandleLearnAllMyClassCommand, "", NULL },
- { "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand, "", NULL },
- { "spells", SEC_ADMINISTRATOR, false, &HandleLearnAllMySpellsCommand, "", NULL },
- { "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "class", SEC_ADMINISTRATOR, false, &HandleLearnAllMyClassCommand, "", NULL },
+ { "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand, "", NULL },
+ { "spells", SEC_ADMINISTRATOR, false, &HandleLearnAllMySpellsCommand, "", NULL },
+ { "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
static ChatCommand learnAllCommandTable[] =
{
- { "my", SEC_ADMINISTRATOR, false, NULL, "", learnAllMyCommandTable },
- { "gm", SEC_GAMEMASTER, false, &HandleLearnAllGMCommand, "", NULL },
- { "crafts", SEC_GAMEMASTER, false, &HandleLearnAllCraftsCommand, "", NULL },
- { "default", SEC_MODERATOR, false, &HandleLearnAllDefaultCommand, "", NULL },
- { "lang", SEC_MODERATOR, false, &HandleLearnAllLangCommand, "", NULL },
- { "recipes", SEC_GAMEMASTER, false, &HandleLearnAllRecipesCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "my", SEC_ADMINISTRATOR, false, NULL, "", learnAllMyCommandTable },
+ { "gm", SEC_GAMEMASTER, false, &HandleLearnAllGMCommand, "", NULL },
+ { "crafts", SEC_GAMEMASTER, false, &HandleLearnAllCraftsCommand, "", NULL },
+ { "default", SEC_MODERATOR, false, &HandleLearnAllDefaultCommand, "", NULL },
+ { "lang", SEC_MODERATOR, false, &HandleLearnAllLangCommand, "", NULL },
+ { "recipes", SEC_GAMEMASTER, false, &HandleLearnAllRecipesCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
static ChatCommand learnCommandTable[] =
{
- { "all", SEC_ADMINISTRATOR, false, NULL, "", learnAllCommandTable },
- { "", SEC_ADMINISTRATOR, false, &HandleLearnCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "all", SEC_ADMINISTRATOR, false, NULL, "", learnAllCommandTable },
+ { "", SEC_ADMINISTRATOR, false, &HandleLearnCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
- { "learn", SEC_MODERATOR, false, NULL, "", learnCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { "learn", SEC_MODERATOR, false, NULL, "", learnCommandTable },
+ { "unlearn", SEC_ADMINISTRATOR, false, &HandleUnLearnCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
@@ -466,6 +467,41 @@ public:
player->learnSpell(skillLine->spellId, false);
}
}
+
+ static bool HandleUnLearnCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ char const* allStr = strtok(NULL, " ");
+ bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
+
+ Player* target = handler->getSelectedPlayer();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (allRanks)
+ spellId = sSpellMgr->GetFirstSpellInChain (spellId);
+
+ if (target->HasSpell(spellId))
+ target->removeSpell(spellId, false, !allRanks);
+ else
+ handler->SendSysMessage(LANG_FORGET_SPELL);
+
+ if (GetTalentSpellCost(spellId))
+ target->SendTalentsInfoData(false);
+
+ return true;
+ }
};
void AddSC_learn_commandscript()
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
new file mode 100644
index 00000000000..5c16a0963d3
--- /dev/null
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -0,0 +1,469 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: list_commandscript
+%Complete: 100
+Comment: All list related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "SpellAuraEffects.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+
+class list_commandscript : public CommandScript
+{
+public:
+ list_commandscript() : CommandScript("list_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand listCommandTable[] =
+ {
+ { "creature", SEC_ADMINISTRATOR, true, &HandleListCreatureCommand, "", NULL },
+ { "item", SEC_ADMINISTRATOR, true, &HandleListItemCommand, "", NULL },
+ { "object", SEC_ADMINISTRATOR, true, &HandleListObjectCommand, "", NULL },
+ { "auras", SEC_ADMINISTRATOR, false, &HandleListAurasCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleListCreatureCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
+ char* id = handler->extractKeyFromLink((char*)args, "Hcreature_entry");
+ if (!id)
+ return false;
+
+ uint32 creatureId = atol(id);
+ if (!creatureId)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureId);
+ if (!cInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* countStr = strtok(NULL, " ");
+ uint32 count = countStr ? atol(countStr) : 10;
+
+ if (count == 0)
+ return false;
+
+ QueryResult result;
+
+ uint32 creatureCount = 0;
+ result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", creatureId);
+ if (result)
+ creatureCount = (*result)[0].GetUInt64();
+
+ if (handler->GetSession())
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
+ player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count);
+ }
+ else
+ result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u",
+ creatureId, count);
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 guid = fields[0].GetUInt32();
+ float x = fields[1].GetFloat();
+ float y = fields[2].GetFloat();
+ float z = fields[3].GetFloat();
+ uint16 mapId = fields[4].GetUInt16();
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId);
+ else
+ handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId);
+ }
+ while (result->NextRow());
+ }
+
+ handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, creatureId, creatureCount);
+
+ return true;
+ }
+
+ static bool HandleListItemCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* id = handler->extractKeyFromLink((char*)args, "Hitem");
+ if (!id)
+ return false;
+
+ uint32 itemId = atol(id);
+ if (!itemId)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
+ if (!itemTemplate)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* countStr = strtok(NULL, " ");
+ uint32 count = countStr ? atol(countStr) : 10;
+
+ if (count == 0)
+ return false;
+
+ PreparedQueryResult result;
+
+ // inventory case
+ uint32 inventoryCount = 0;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM);
+ stmt->setUInt32(0, itemId);
+ result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ inventoryCount = (*result)[0].GetUInt64();
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY);
+ stmt->setUInt32(0, itemId);
+ stmt->setUInt32(1, count);
+ result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 itemGuid = fields[0].GetUInt32();
+ uint32 itemBag = fields[1].GetUInt32();
+ uint8 itemSlot = fields[2].GetUInt8();
+ uint32 ownerGuid = fields[3].GetUInt32();
+ uint32 ownerAccountId = fields[4].GetUInt32();
+ std::string ownerName = fields[5].GetString();
+
+ char const* itemPos = 0;
+ if (Player::IsEquipmentPos(itemBag, itemSlot))
+ itemPos = "[equipped]";
+ else if (Player::IsInventoryPos(itemBag, itemSlot))
+ itemPos = "[in inventory]";
+ else if (Player::IsBankPos(itemBag, itemSlot))
+ itemPos = "[in bank]";
+ else
+ itemPos = "";
+
+ handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos);
+ }
+ while (result->NextRow());
+
+ uint32 resultCount = uint32(result->GetRowCount());
+
+ if (count > resultCount)
+ count -= resultCount;
+ else if (count)
+ count = 0;
+ }
+
+ // mail case
+ uint32 mailCount = 0;
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM);
+ stmt->setUInt32(0, itemId);
+ result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ mailCount = (*result)[0].GetUInt64();
+
+ if (count > 0)
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY);
+ stmt->setUInt32(0, itemId);
+ stmt->setUInt32(1, count);
+ result = CharacterDatabase.Query(stmt);
+ }
+ else
+ result = PreparedQueryResult(NULL);
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 itemGuid = fields[0].GetUInt32();
+ uint32 itemSender = fields[1].GetUInt32();
+ uint32 itemReceiver = fields[2].GetUInt32();
+ uint32 itemSenderAccountId = fields[3].GetUInt32();
+ std::string itemSenderName = fields[4].GetString();
+ uint32 itemReceiverAccount = fields[5].GetUInt32();
+ std::string itemReceiverName = fields[6].GetString();
+
+ char const* itemPos = "[in mail]";
+
+ handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName.c_str(), itemSender, itemSenderAccountId, itemReceiverName.c_str(), itemReceiver, itemReceiverAccount, itemPos);
+ }
+ while (result->NextRow());
+
+ uint32 resultCount = uint32(result->GetRowCount());
+
+ if (count > resultCount)
+ count -= resultCount;
+ else if (count)
+ count = 0;
+ }
+
+ // auction case
+ uint32 auctionCount = 0;
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM);
+ stmt->setUInt32(0, itemId);
+ result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ auctionCount = (*result)[0].GetUInt64();
+
+ if (count > 0)
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY);
+ stmt->setUInt32(0, itemId);
+ stmt->setUInt32(1, count);
+ result = CharacterDatabase.Query(stmt);
+ }
+ else
+ result = PreparedQueryResult(NULL);
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 itemGuid = fields[0].GetUInt32();
+ uint32 owner = fields[1].GetUInt32();
+ uint32 ownerAccountId = fields[2].GetUInt32();
+ std::string ownerName = fields[3].GetString();
+
+ char const* itemPos = "[in auction]";
+
+ handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos);
+ }
+ while (result->NextRow());
+ }
+
+ // guild bank case
+ uint32 guildCount = 0;
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM);
+ stmt->setUInt32(0, itemId);
+ result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ guildCount = (*result)[0].GetUInt64();
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY);
+ stmt->setUInt32(0, itemId);
+ stmt->setUInt32(1, count);
+ result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 itemGuid = fields[0].GetUInt32();
+ uint32 guildGuid = fields[1].GetUInt32();
+ std::string guildName = fields[2].GetString();
+
+ char const* itemPos = "[in guild bank]";
+
+ handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName.c_str(), guildGuid, itemPos);
+ }
+ while (result->NextRow());
+
+ uint32 resultCount = uint32(result->GetRowCount());
+
+ if (count > resultCount)
+ count -= resultCount;
+ else if (count)
+ count = 0;
+ }
+
+ if (inventoryCount + mailCount + auctionCount + guildCount == 0)
+ {
+ handler->SendSysMessage(LANG_COMMAND_NOITEMFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ handler->PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE, itemId, inventoryCount + mailCount + auctionCount + guildCount, inventoryCount, mailCount, auctionCount, guildCount);
+
+ return true;
+ }
+
+ static bool HandleListObjectCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
+ char* id = handler->extractKeyFromLink((char*)args, "Hgameobject_entry");
+ if (!id)
+ return false;
+
+ uint32 gameObjectId = atol(id);
+ if (!gameObjectId)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(gameObjectId);
+ if (!gInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* countStr = strtok(NULL, " ");
+ uint32 count = countStr ? atol(countStr) : 10;
+
+ if (count == 0)
+ return false;
+
+ QueryResult result;
+
+ uint32 objectCount = 0;
+ result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", gameObjectId);
+ if (result)
+ objectCount = (*result)[0].GetUInt64();
+
+ if (handler->GetSession())
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
+ player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count);
+ }
+ else
+ result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u",
+ gameObjectId, count);
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 guid = fields[0].GetUInt32();
+ float x = fields[1].GetFloat();
+ float y = fields[2].GetFloat();
+ float z = fields[3].GetFloat();
+ uint16 mapId = fields[4].GetUInt16();
+ uint32 entry = fields[5].GetUInt32();
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId);
+ else
+ handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId);
+ }
+ while (result->NextRow());
+ }
+
+ handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, gameObjectId, objectCount);
+
+ return true;
+ }
+
+ static bool HandleListAurasCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* unit = handler->getSelectedUnit();
+ if (!unit)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char const* talentStr = handler->GetTrinityString(LANG_TALENT);
+ char const* passiveStr = handler->GetTrinityString(LANG_PASSIVE);
+
+ Unit::AuraApplicationMap const& auras = unit->GetAppliedAuras();
+ handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
+ for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0;
+
+ AuraApplication const* aurApp = itr->second;
+ Aura const* aura = aurApp->GetBase();
+ char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()];
+
+ std::ostringstream ss_name;
+ ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";
+
+ handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name),
+ aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
+ aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
+ (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
+ GUID_LOPART(aura->GetCasterGUID()));
+ }
+
+ for (uint16 i = 0; i < TOTAL_AURAS; ++i)
+ {
+ Unit::AuraEffectList const& auraList = unit->GetAuraEffectsByType(AuraType(i));
+ if (auraList.empty())
+ continue;
+
+ handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, auraList.size(), i);
+
+ for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
+ handler->PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), (*itr)->GetAmount());
+ }
+
+ return true;
+ }
+};
+
+void AddSC_list_commandscript()
+{
+ new list_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
new file mode 100644
index 00000000000..951ebc7714b
--- /dev/null
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -0,0 +1,1392 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: lookup_commandscript
+%Complete: 100
+Comment: All lookup related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "AccountMgr.h"
+#include "GameEventMgr.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+
+class lookup_commandscript : public CommandScript
+{
+public:
+ lookup_commandscript() : CommandScript("lookup_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand lookupPlayerCommandTable[] =
+ {
+ { "ip", SEC_GAMEMASTER, true, &HandleLookupPlayerIpCommand, "", NULL },
+ { "account", SEC_GAMEMASTER, true, &HandleLookupPlayerAccountCommand, "", NULL },
+ { "email", SEC_GAMEMASTER, true, &HandleLookupPlayerEmailCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand lookupCommandTable[] =
+ {
+ { "area", SEC_MODERATOR, true, &HandleLookupAreaCommand, "", NULL },
+ { "creature", SEC_ADMINISTRATOR, true, &HandleLookupCreatureCommand, "", NULL },
+ { "event", SEC_GAMEMASTER, true, &HandleLookupEventCommand, "", NULL },
+ { "faction", SEC_ADMINISTRATOR, true, &HandleLookupFactionCommand, "", NULL },
+ { "item", SEC_ADMINISTRATOR, true, &HandleLookupItemCommand, "", NULL },
+ { "itemset", SEC_ADMINISTRATOR, true, &HandleLookupItemSetCommand, "", NULL },
+ { "object", SEC_ADMINISTRATOR, true, &HandleLookupObjectCommand, "", NULL },
+ { "quest", SEC_ADMINISTRATOR, true, &HandleLookupQuestCommand, "", NULL },
+ { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
+ { "skill", SEC_ADMINISTRATOR, true, &HandleLookupSkillCommand, "", NULL },
+ { "spell", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "", NULL },
+ { "taxinode", SEC_ADMINISTRATOR, true, &HandleLookupTaxiNodeCommand, "", NULL },
+ { "tele", SEC_MODERATOR, true, &HandleLookupTeleCommand, "", NULL },
+ { "title", SEC_GAMEMASTER, true, &HandleLookupTitleCommand, "", NULL },
+ { "map", SEC_ADMINISTRATOR, true, &HandleLookupMapCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleLookupAreaCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ // Search in AreaTable.dbc
+ for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows(); ++areaflag)
+ {
+ AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag);
+ if (areaEntry)
+ {
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = areaEntry->area_name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = areaEntry->area_name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ // send area in "id - [name]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale]<< "]|h|r";
+ else
+ ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale];
+
+ handler->SendSysMessage(ss.str().c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOAREAFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupCreatureCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ // converting string that we try to find to lower case
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
+ for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
+ {
+ uint32 id = itr->second.Entry;
+ uint8 localeIndex = handler->GetSessionDbLocaleIndex();
+ if (CreatureLocale const* creatureLocale = sObjectMgr->GetCreatureLocale(id))
+ {
+ if (creatureLocale->Name.size() > localeIndex && !creatureLocale->Name[localeIndex].empty())
+ {
+ std::string name = creatureLocale->Name[localeIndex];
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
+
+ if (!found)
+ found = true;
+
+ continue;
+ }
+ }
+ }
+
+ std::string name = itr->second.Name;
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOCREATUREFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupEventCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ // converting string that we try to find to lower case
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
+ GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
+
+ for (uint32 id = 0; id < events.size(); ++id)
+ {
+ GameEventData const& eventData = events[id];
+
+ std::string descr = eventData.description;
+ if (descr.empty())
+ continue;
+
+ if (Utf8FitTo(descr, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ char const* active = activeEvents.find(id) != activeEvents.end() ? handler->GetTrinityString(LANG_ACTIVE) : "";
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active);
+ else
+ handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active);
+
+ if (!found)
+ found = true;
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_NOEVENTFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupFactionCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // Can be NULL at console call
+ Player* target = handler->getSelectedPlayer();
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower (wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
+ {
+ FactionEntry const* factionEntry = sFactionStore.LookupEntry(id);
+ if (factionEntry)
+ {
+ FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
+
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = factionEntry->name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = factionEntry->name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
+ // or "id - [faction] [no reputation]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[locale] << "]|h|r";
+ else
+ ss << id << " - " << name << ' ' << localeNames[locale];
+
+ if (factionState) // and then target != NULL also
+ {
+ uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
+ std::string rankName = handler->GetTrinityString(index);
+
+ ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
+
+ if (factionState->Flags & FACTION_FLAG_VISIBLE)
+ ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
+ if (factionState->Flags & FACTION_FLAG_AT_WAR)
+ ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
+ if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
+ if (factionState->Flags & FACTION_FLAG_HIDDEN)
+ ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
+ if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
+ if (factionState->Flags & FACTION_FLAG_INACTIVE)
+ ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
+ }
+ else
+ ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
+
+ handler->SendSysMessage(ss.str().c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_FACTION_NOTFOUND);
+ return true;
+ }
+
+ static bool HandleLookupItemCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ // converting string that we try to find to lower case
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // Search in `item_template`
+ ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
+ for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
+ {
+ int localeIndex = handler->GetSessionDbLocaleIndex();
+ if (localeIndex >= 0)
+ {
+ uint8 ulocaleIndex = uint8(localeIndex);
+ if (ItemLocale const* il = sObjectMgr->GetItemLocale(itr->second.ItemId))
+ {
+ if (il->Name.size() > ulocaleIndex && !il->Name[ulocaleIndex].empty())
+ {
+ std::string name = il->Name[ulocaleIndex];
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itr->second.ItemId, itr->second.ItemId, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itr->second.ItemId, name.c_str());
+
+ if (!found)
+ found = true;
+
+ continue;
+ }
+ }
+ }
+ }
+
+ std::string name = itr->second.Name1;
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itr->second.ItemId, itr->second.ItemId, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itr->second.ItemId, name.c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOITEMFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupItemSetCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // Search in ItemSet.dbc
+ for (uint32 id = 0; id < sItemSetStore.GetNumRows(); id++)
+ {
+ ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
+ if (set)
+ {
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = set->name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = set->name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ // send item set in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[locale]);
+ else
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[locale]);
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOITEMSETFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupObjectCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ // converting string that we try to find to lower case
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates();
+ for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
+ {
+ uint8 localeIndex = handler->GetSessionDbLocaleIndex();
+ if (GameObjectLocale const* objectLocalte = sObjectMgr->GetGameObjectLocale(itr->second.entry))
+ {
+ if (objectLocalte->Name.size() > localeIndex && !objectLocalte->Name[localeIndex].empty())
+ {
+ std::string name = objectLocalte->Name[localeIndex];
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
+
+ if (!found)
+ found = true;
+
+ continue;
+ }
+ }
+ }
+
+ std::string name = itr->second.name;
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOGAMEOBJECTFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupQuestCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // can be NULL at console call
+ Player* target = handler->getSelectedPlayer();
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ // converting string that we try to find to lower case
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates();
+ for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
+ {
+ Quest* qInfo = iter->second;
+
+ int localeIndex = handler->GetSessionDbLocaleIndex();
+ if (localeIndex >= 0)
+ {
+ uint8 ulocaleIndex = uint8(localeIndex);
+ if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(qInfo->GetQuestId()))
+ {
+ if (questLocale->Title.size() > ulocaleIndex && !questLocale->Title[ulocaleIndex].empty())
+ {
+ std::string title = questLocale->Title[ulocaleIndex];
+
+ if (Utf8FitTo(title, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ char const* statusStr = "";
+
+ if (target)
+ {
+ QuestStatus status = target->GetQuestStatus(qInfo->GetQuestId());
+
+ switch (status)
+ {
+ case QUEST_STATUS_COMPLETE:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
+ break;
+ case QUEST_STATUS_INCOMPLETE:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
+ break;
+ case QUEST_STATUS_REWARDED:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr);
+ else
+ handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr);
+
+ if (!found)
+ found = true;
+
+ continue;
+ }
+ }
+ }
+ }
+
+ std::string title = qInfo->GetTitle();
+ if (title.empty())
+ continue;
+
+ if (Utf8FitTo(title, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ char const* statusStr = "";
+
+ if (target)
+ {
+ QuestStatus status = target->GetQuestStatus(qInfo->GetQuestId());
+
+ switch (status)
+ {
+ case QUEST_STATUS_COMPLETE:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
+ break;
+ case QUEST_STATUS_INCOMPLETE:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
+ break;
+ case QUEST_STATUS_REWARDED:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr);
+ else
+ handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr);
+
+ if (!found)
+ found = true;
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOQUESTFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupSkillCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // can be NULL in console call
+ Player* target = handler->getSelectedPlayer();
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // Search in SkillLine.dbc
+ for (uint32 id = 0; id < sSkillLineStore.GetNumRows(); id++)
+ {
+ SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
+ if (skillInfo)
+ {
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = skillInfo->name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = skillInfo->name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ char valStr[50] = "";
+ char const* knownStr = "";
+ if (target && target->HasSkill(id))
+ {
+ knownStr = handler->GetTrinityString(LANG_KNOWN);
+ uint32 curValue = target->GetPureSkillValue(id);
+ uint32 maxValue = target->GetPureMaxSkillValue(id);
+ uint32 permValue = target->GetSkillPermBonusValue(id);
+ uint32 tempValue = target->GetSkillTempBonusValue(id);
+
+ char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES);
+ snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue);
+ }
+
+ // send skill in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), localeNames[locale], knownStr, valStr);
+ else
+ handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), localeNames[locale], knownStr, valStr);
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOSKILLFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupSpellCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // can be NULL at console call
+ Player* target = handler->getSelectedPlayer();
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // Search in Spell.dbc
+ for (uint32 id = 0; id < sSpellMgr->GetSpellInfoStoreSize(); id++)
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
+ if (spellInfo)
+ {
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = spellInfo->SpellName[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = spellInfo->SpellName[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ bool known = target && target->HasSpell(id);
+ bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
+
+ SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
+
+ uint32 talentCost = GetTalentSpellCost(id);
+
+ bool talent = (talentCost > 0);
+ bool passive = spellInfo->IsPassive();
+ bool active = target && target->HasAura(id);
+
+ // unit32 used to prevent interpreting uint8 as char at output
+ // find rank of learned spell for learning spell, or talent rank
+ uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
+
+ // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name;
+ else
+ ss << id << " - " << name;
+
+ // include rank in link name
+ if (rank)
+ ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank;
+
+ if (handler->GetSession())
+ ss << ' ' << localeNames[locale] << "]|h|r";
+ else
+ ss << ' ' << localeNames[locale];
+
+ if (talent)
+ ss << handler->GetTrinityString(LANG_TALENT);
+ if (passive)
+ ss << handler->GetTrinityString(LANG_PASSIVE);
+ if (learn)
+ ss << handler->GetTrinityString(LANG_LEARN);
+ if (known)
+ ss << handler->GetTrinityString(LANG_KNOWN);
+ if (active)
+ ss << handler->GetTrinityString(LANG_ACTIVE);
+
+ handler->SendSysMessage(ss.str().c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char * args)
+ {
+ if (!*args)
+ return false;
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ bool found = false;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // Search in TaxiNodes.dbc
+ for (uint32 id = 0; id < sTaxiNodesStore.GetNumRows(); id++)
+ {
+ TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id);
+ if (nodeEntry)
+ {
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = nodeEntry->name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = nodeEntry->name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale],
+ nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
+ else
+ handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale],
+ nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOTAXINODEFOUND);
+
+ return true;
+ }
+
+ // Find tele in game_tele order by name
+ static bool HandleLookupTeleCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ {
+ handler->SendSysMessage(LANG_COMMAND_TELE_PARAMETER);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char const* str = strtok((char*)args, " ");
+ if (!str)
+ return false;
+
+ std::string namePart = str;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ std::ostringstream reply;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+ bool limitReached = false;
+
+ GameTeleContainer const & teleMap = sObjectMgr->GetGameTeleMap();
+ for (GameTeleContainer::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
+ {
+ GameTele const* tele = &itr->second;
+
+ if (tele->wnameLow.find(wNamePart) == std::wstring::npos)
+ continue;
+
+ if (maxResults && count++ == maxResults)
+ {
+ limitReached = true;
+ break;
+ }
+
+ if (handler->GetSession())
+ reply << " |cffffffff|Htele:" << itr->first << "|h[" << tele->name << "]|h|r\n";
+ else
+ reply << " " << itr->first << ' ' << tele->name << "\n";
+ }
+
+ if (reply.str().empty())
+ handler->SendSysMessage(LANG_COMMAND_TELE_NOLOCATION);
+ else
+ handler->PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str().c_str());
+
+ if (limitReached)
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+
+ return true;
+ }
+
+ static bool HandleLookupTitleCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // can be NULL in console call
+ Player* target = handler->getSelectedPlayer();
+
+ // title name have single string arg for player name
+ char const* targetName = target ? target->GetName() : "NAME";
+
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wNamePart);
+
+ uint32 counter = 0; // Counter for figure out that we found smth.
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ // Search in CharTitles.dbc
+ for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
+ {
+ CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
+ if (titleInfo)
+ {
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = titleInfo->name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
+
+ name = titleInfo->name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && counter == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : "";
+
+ char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
+ ? handler->GetTrinityString(LANG_ACTIVE)
+ : "";
+
+ char titleNameStr[80];
+ snprintf(titleNameStr, 80, name.c_str(), targetName);
+
+ // send title in "id (idx:idx) - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[locale], knownStr, activeStr);
+ else
+ handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr);
+
+ ++counter;
+ }
+ }
+ }
+ if (counter == 0) // if counter == 0 then we found nth
+ handler->SendSysMessage(LANG_COMMAND_NOTITLEFOUND);
+
+ return true;
+ }
+
+ static bool HandleLookupMapCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+ /*
+ std::string namePart = args;
+ std::wstring wNamePart;
+
+ // converting string that we try to find to lower case
+ if (!Utf8toWStr(namePart, wNamePart))
+ return false;
+
+ wstrToLower(wNamePart);
+
+ bool found = false;
+
+ // search in Map.dbc
+ for (uint32 id = 0; id < sMapStore.GetNumRows(); id++)
+ {
+ MapEntry const* MapInfo = sMapStore.LookupEntry(id);
+ if (MapInfo)
+ {
+ uint8 locale = handler->GetSession() ? handler->GetSession()->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale();
+
+ std::string name = MapInfo->name[locale];
+ if (name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wNamePart))
+ {
+ locale = LOCALE_enUS;
+ for (; locale < TOTAL_LOCALES; locale++)
+ {
+ if (handler->GetSession() && locale == handler->GetSession()->GetSessionDbcLocale())
+ continue;
+
+ name = MapInfo->name[locale];
+ if (name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
+ }
+
+ if (locale < TOTAL_LOCALES)
+ {
+ // send map in "id - [name][Continent][Instance/Battleground/Arena][Raid reset time:][Heroic reset time:][Mountable]" format
+ std::ostringstream ss;
+
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << ']';
+ else // console
+ ss << id << " - [" << name << ']';
+
+ if (MapInfo->IsContinent())
+ ss << handler->GetTrinityString(LANG_CONTINENT);
+
+ switch (MapInfo->map_type)
+ {
+ case MAP_INSTANCE: ss << handler->GetTrinityString(LANG_INSTANCE); break;
+ case MAP_BATTLEGROUND: ss << handler->GetTrinityString(LANG_BATTLEGROUND); break;
+ case MAP_ARENA: ss << handler->GetTrinityString(LANG_ARENA); break;
+ }
+
+ if (MapInfo->IsRaid())
+ ss << handler->GetTrinityString(LANG_RAID);
+
+ if (MapInfo->SupportsHeroicMode())
+ ss << handler->GetTrinityString(LANG_HEROIC);
+
+ uint32 ResetTimeRaid = MapInfo->resetTimeRaid;
+
+ std::string ResetTimeRaidStr;
+ if (ResetTimeRaid)
+ ResetTimeRaidStr = secsToTimeString(ResetTimeRaid, true, false);
+
+ uint32 ResetTimeHeroic = MapInfo->resetTimeHeroic;
+ std::string ResetTimeHeroicStr;
+ if (ResetTimeHeroic)
+ ResetTimeHeroicStr = secsToTimeString(ResetTimeHeroic, true, false);
+
+ if (MapInfo->IsMountAllowed())
+ ss << handler->GetTrinityString(LANG_MOUNTABLE);
+
+ if (ResetTimeRaid && !ResetTimeHeroic)
+ handler->PSendSysMessage(ss.str().c_str(), ResetTimeRaidStr.c_str());
+ else if (!ResetTimeRaid && ResetTimeHeroic)
+ handler->PSendSysMessage(ss.str().c_str(), ResetTimeHeroicStr.c_str());
+ else if (ResetTimeRaid && ResetTimeHeroic)
+ handler->PSendSysMessage(ss.str().c_str(), ResetTimeRaidStr.c_str(), ResetTimeHeroicStr.c_str());
+ else
+ handler->SendSysMessage(ss.str().c_str());
+
+ if (!found)
+ found = true;
+ }
+ }
+ }
+
+ if (!found)
+ handler->SendSysMessage(LANG_COMMAND_NOMAPFOUND);
+ */
+ return true;
+ }
+
+ static bool HandleLookupPlayerIpCommand(ChatHandler* handler, char const* args)
+ {
+ std::string ip;
+ int32 limit;
+ char* limitStr;
+
+ Player* target = handler->getSelectedPlayer();
+ if (!*args)
+ {
+ // NULL only if used from console
+ if (!target || target == handler->GetSession()->GetPlayer())
+ return false;
+
+ ip = target->GetSession()->GetRemoteAddress();
+ limit = -1;
+ }
+ else
+ {
+ ip = strtok((char*)args, " ");
+ limitStr = strtok(NULL, " ");
+ limit = limitStr ? atoi(limitStr) : -1;
+ }
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
+ stmt->setString(0, ip);
+ PreparedQueryResult result = LoginDatabase.Query(stmt);
+
+ return LookupPlayerSearchCommand(result, limit, handler);
+ }
+
+ static bool HandleLookupPlayerAccountCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string account = strtok((char*)args, " ");
+ char* limitStr = strtok(NULL, " ");
+ int32 limit = limitStr ? atoi(limitStr) : -1;
+
+ if (!AccountMgr::normalizeString
+ (account))
+ return false;
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
+ stmt->setString(0, account);
+ PreparedQueryResult result = LoginDatabase.Query(stmt);
+
+ return LookupPlayerSearchCommand(result, limit, handler);
+ }
+
+ static bool HandleLookupPlayerEmailCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string email = strtok((char*)args, " ");
+ char* limitStr = strtok(NULL, " ");
+ int32 limit = limitStr ? atoi(limitStr) : -1;
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
+ stmt->setString(0, email);
+ PreparedQueryResult result = LoginDatabase.Query(stmt);
+
+ return LookupPlayerSearchCommand(result, limit, handler);
+ }
+
+ static bool LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit, ChatHandler* handler)
+ {
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_NO_PLAYERS_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ int32 counter = 0;
+ uint32 count = 0;
+ uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
+
+ do
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ Field* fields = result->Fetch();
+ uint32 accountId = fields[0].GetUInt32();
+ std::string accountName = fields[1].GetString();
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
+ stmt->setUInt32(0, accountId);
+ PreparedQueryResult result2 = CharacterDatabase.Query(stmt);
+
+ if (result2)
+ {
+ handler->PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, accountName.c_str(), accountId);
+
+ do
+ {
+ Field* characterFields = result2->Fetch();
+ uint32 guid = characterFields[0].GetUInt32();
+ std::string name = characterFields[1].GetString();
+
+ handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
+ ++counter;
+ }
+ while (result2->NextRow() && (limit == -1 || counter < limit));
+ }
+ }
+ while (result->NextRow());
+
+ if (counter == 0) // empty accounts only
+ {
+ handler->PSendSysMessage(LANG_NO_PLAYERS_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return true;
+ }
+};
+
+void AddSC_lookup_commandscript()
+{
+ new lookup_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
new file mode 100644
index 00000000000..d61abf34e2f
--- /dev/null
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: message_commandscript
+%Complete: 100
+Comment: All message related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "ChannelMgr.h"
+
+class message_commandscript : public CommandScript
+{
+public:
+ message_commandscript() : CommandScript("message_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand channelSetCommandTable[] =
+ {
+ { "ownership", SEC_ADMINISTRATOR, false, &HandleChannelSetOwnership, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand channelCommandTable[] =
+ {
+ { "set", SEC_ADMINISTRATOR, true, NULL, "", channelSetCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable },
+ { "nameannounce", SEC_MODERATOR, true, &HandleNameAnnounceCommand, "", NULL },
+ { "gmnameannounce", SEC_MODERATOR, true, &HandleGMNameAnnounceCommand, "", NULL },
+ { "announce", SEC_MODERATOR, true, &HandleAnnounceCommand, "", NULL },
+ { "gmannounce", SEC_MODERATOR, true, &HandleGMAnnounceCommand, "", NULL },
+ { "notify", SEC_MODERATOR, true, &HandleNotifyCommand, "", NULL },
+ { "gmnotify", SEC_MODERATOR, true, &HandleGMNotifyCommand, "", NULL },
+ { "whispers", SEC_MODERATOR, false, &HandleWhispersCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleChannelSetOwnership(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+ char const* channelStr = strtok((char*)args, " ");
+ char const* argStr = strtok(NULL, "");
+
+ if (!channelStr || !argStr)
+ return false;
+
+ Player* player = handler->GetSession()->GetPlayer();
+ Channel* channcel = NULL;
+
+ if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
+ channcel = cMgr->GetChannel(channelStr, player);
+
+ if (strcmp(argStr, "on") == 0)
+ {
+ if (channcel)
+ channcel->SetOwnership(true);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
+ stmt->setUInt8 (0, 1);
+ stmt->setString(1, channelStr);
+ CharacterDatabase.Execute(stmt);
+ handler->PSendSysMessage(LANG_CHANNEL_ENABLE_OWNERSHIP, channelStr);
+ }
+ else if (strcmp(argStr, "off") == 0)
+ {
+ if (channcel)
+ channcel->SetOwnership(false);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
+ stmt->setUInt8 (0, 0);
+ stmt->setString(1, channelStr);
+ CharacterDatabase.Execute(stmt);
+ handler->PSendSysMessage(LANG_CHANNEL_DISABLE_OWNERSHIP, channelStr);
+ }
+ else
+ return false;
+
+ return true;
+ }
+
+ static bool HandleNameAnnounceCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string name("Console");
+ if (WorldSession* session = handler->GetSession())
+ name = session->GetPlayer()->GetName();
+
+ sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, name.c_str(), args);
+ return true;
+ }
+
+ static bool HandleGMNameAnnounceCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string name("Console");
+ if (WorldSession* session = handler->GetSession())
+ name = session->GetPlayer()->GetName();
+
+ sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), args);
+ return true;
+ }
+ // global announce
+ static bool HandleAnnounceCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char buff[2048];
+ sprintf(buff, handler->GetTrinityString(LANG_SYSTEMMESSAGE), args);
+ sWorld->SendServerMessage(SERVER_MSG_STRING, buff);
+ return true;
+ }
+ // announce to logged in GMs
+ static bool HandleGMAnnounceCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ sWorld->SendGMText(LANG_GM_BROADCAST, args);
+ return true;
+ }
+ // notification player at the screen
+ static bool HandleNotifyCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string str = handler->GetTrinityString(LANG_GLOBAL_NOTIFY);
+ str += args;
+
+ WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
+ data << str;
+ sWorld->SendGlobalMessage(&data);
+
+ return true;
+ }
+ // notification GM at the screen
+ static bool HandleGMNotifyCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string str = handler->GetTrinityString(LANG_GM_NOTIFY);
+ str += args;
+
+ WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
+ data << str;
+ sWorld->SendGlobalGMMessage(&data);
+
+ return true;
+ }
+ // Enable\Dissable accept whispers (for GM)
+ static bool HandleWhispersCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_WHISPERACCEPTING, handler->GetSession()->GetPlayer()->isAcceptWhispers() ? handler->GetTrinityString(LANG_ON) : handler->GetTrinityString(LANG_OFF));
+ return true;
+ }
+
+ std::string argStr = (char*)args;
+ // whisper on
+ if (argStr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetAcceptWhispers(true);
+ handler->SendSysMessage(LANG_COMMAND_WHISPERON);
+ return true;
+ }
+
+ // whisper off
+ if (argStr == "off")
+ {
+ // Remove all players from the Gamemaster's whisper whitelist
+ handler->GetSession()->GetPlayer()->ClearWhisperWhiteList();
+ handler->GetSession()->GetPlayer()->SetAcceptWhispers(false);
+ handler->SendSysMessage(LANG_COMMAND_WHISPEROFF);
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_USE_BOL);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+};
+
+void AddSC_message_commandscript()
+{
+ new message_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 7c431566f52..2c9623b23a6 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1,160 +1,2794 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ScriptPCH.h"
-#include "Chat.h"
-#include "ObjectAccessor.h"
-#include "ScriptMgr.h"
-#include "CellImpl.h"
-
-class misc_commandscript : public CommandScript
-{
-public:
- misc_commandscript() : CommandScript("misc_commandscript") { }
-
- ChatCommand* GetCommands() const
- {
- static ChatCommand commandTable[] =
- {
- { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL },
- { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- return commandTable;
- }
-
- static bool HandleDevCommand(ChatHandler* handler, char const* args)
- {
- if (!*args)
- {
- if (handler->GetSession()->GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER))
- handler->GetSession()->SendNotification(LANG_DEV_ON);
- else
- handler->GetSession()->SendNotification(LANG_DEV_OFF);
- return true;
- }
-
- std::string argstr = (char*)args;
-
- if (argstr == "on")
- {
- handler->GetSession()->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
- handler->GetSession()->SendNotification(LANG_DEV_ON);
- return true;
- }
-
- if (argstr == "off")
- {
- handler->GetSession()->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
- handler->GetSession()->SendNotification(LANG_DEV_OFF);
- return true;
- }
-
- handler->SendSysMessage(LANG_USE_BOL);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- static bool HandleGPSCommand(ChatHandler* handler, char const* args)
- {
- WorldObject* object = NULL;
- if (*args)
- {
- uint64 guid = handler->extractGuidFromLink((char*)args);
- if (guid)
- object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
-
- if (!object)
- {
- handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
- handler->SetSentErrorMessage(true);
- return false;
- }
- }
- else
- {
- object = handler->getSelectedUnit();
-
- if (!object)
- {
- handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- handler->SetSentErrorMessage(true);
- return false;
- }
- }
-
- CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY());
- Cell cell(cellCoord);
-
- uint32 zoneId, areaId;
- object->GetZoneAndAreaId(zoneId, areaId);
-
- MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId());
- AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId);
- AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId);
-
- float zoneX = object->GetPositionX();
- float zoneY = object->GetPositionY();
-
- Map2ZoneCoordinates(zoneX, zoneY, zoneId);
-
- Map const* map = object->GetMap();
- float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
- float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
-
- GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY());
-
- // 63? WHY?
- int gridX = 63 - gridCoord.x_coord;
- int gridY = 63 - gridCoord.y_coord;
-
- uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
- uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
-
- if (haveVMap)
- {
- if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()))
- handler->PSendSysMessage("You are outdoors");
- else
- handler->PSendSysMessage("You are indoors");
- }
- else
- handler->PSendSysMessage("no VMAP available for area info");
-
- handler->PSendSysMessage(LANG_MAP_POSITION,
- object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
- zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
- areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
- object->GetPhaseMask(),
- object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
- cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
- zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
-
- LiquidData liquidStatus;
- ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
-
- if (status)
- handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status);
-
- return true;
- }
-};
-
-void AddSC_misc_commandscript()
-{
- new misc_commandscript();
-}
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Chat.h"
+#include "ScriptMgr.h"
+#include "AccountMgr.h"
+#include "ArenaTeamMgr.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "Group.h"
+#include "InstanceSaveMgr.h"
+#include "MovementGenerator.h"
+#include "ObjectAccessor.h"
+#include "SpellAuras.h"
+#include "TargetedMovementGenerator.h"
+#include "WeatherMgr.h"
+#include "ace/INET_Addr.h"
+
+class misc_commandscript : public CommandScript
+{
+public:
+ misc_commandscript() : CommandScript("misc_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand groupCommandTable[] =
+ {
+ { "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "", NULL },
+ { "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL },
+ { "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand petCommandTable[] =
+ {
+ { "create", SEC_GAMEMASTER, false, &HandleCreatePetCommand, "", NULL },
+ { "learn", SEC_GAMEMASTER, false, &HandlePetLearnCommand, "", NULL },
+ { "unlearn", SEC_GAMEMASTER, false, &HandlePetUnlearnCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand sendCommandTable[] =
+ {
+ { "items", SEC_ADMINISTRATOR, true, &HandleSendItemsCommand, "", NULL },
+ { "mail", SEC_MODERATOR, true, &HandleSendMailCommand, "", NULL },
+ { "message", SEC_ADMINISTRATOR, true, &HandleSendMessageCommand, "", NULL },
+ { "money", SEC_ADMINISTRATOR, true, &HandleSendMoneyCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL },
+ { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL },
+ { "aura", SEC_ADMINISTRATOR, false, &HandleAuraCommand, "", NULL },
+ { "unaura", SEC_ADMINISTRATOR, false, &HandleUnAuraCommand, "", NULL },
+ { "appear", SEC_MODERATOR, false, &HandleAppearCommand, "", NULL },
+ { "summon", SEC_MODERATOR, false, &HandleSummonCommand, "", NULL },
+ { "groupsummon", SEC_MODERATOR, false, &HandleGroupSummonCommand, "", NULL },
+ { "commands", SEC_PLAYER, true, &HandleCommandsCommand, "", NULL },
+ { "die", SEC_ADMINISTRATOR, false, &HandleDieCommand, "", NULL },
+ { "revive", SEC_ADMINISTRATOR, true, &HandleReviveCommand, "", NULL },
+ { "dismount", SEC_PLAYER, false, &HandleDismountCommand, "", NULL },
+ { "guid", SEC_GAMEMASTER, false, &HandleGUIDCommand, "", NULL },
+ { "help", SEC_PLAYER, true, &HandleHelpCommand, "", NULL },
+ { "itemmove", SEC_GAMEMASTER, false, &HandleItemMoveCommand, "", NULL },
+ { "cooldown", SEC_ADMINISTRATOR, false, &HandleCooldownCommand, "", NULL },
+ { "distance", SEC_ADMINISTRATOR, false, &HandleGetDistanceCommand, "", NULL },
+ { "recall", SEC_MODERATOR, false, &HandleRecallCommand, "", NULL },
+ { "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL },
+ { "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL },
+ { "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL },
+ { "unstuck", SEC_PLAYER, true, &HandleUnstuckCommand, "", NULL },
+ { "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL },
+ { "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL },
+ { "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL },
+ { "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL },
+ { "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL },
+ { "additemset", SEC_ADMINISTRATOR, false, &HandleAddItemSetCommand, "", NULL },
+ { "bank", SEC_ADMINISTRATOR, false, &HandleBankCommand, "", NULL },
+ { "wchange", SEC_ADMINISTRATOR, false, &HandleChangeWeather, "", NULL },
+ { "maxskill", SEC_ADMINISTRATOR, false, &HandleMaxSkillCommand, "", NULL },
+ { "setskill", SEC_ADMINISTRATOR, false, &HandleSetSkillCommand, "", NULL },
+ { "pinfo", SEC_GAMEMASTER, true, &HandlePInfoCommand, "", NULL },
+ { "respawn", SEC_ADMINISTRATOR, false, &HandleRespawnCommand, "", NULL },
+ { "send", SEC_MODERATOR, true, NULL, "", sendCommandTable },
+ { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
+ { "mute", SEC_MODERATOR, true, &HandleMuteCommand, "", NULL },
+ { "unmute", SEC_MODERATOR, true, &HandleUnmuteCommand, "", NULL },
+ { "movegens", SEC_ADMINISTRATOR, false, &HandleMovegensCommand, "", NULL },
+ { "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "", NULL },
+ { "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "", NULL },
+ { "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL },
+ { "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL },
+ { "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL },
+ { "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL },
+ { "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL },
+ { "listfreeze", SEC_MODERATOR, false, &HandleListFreezeCommand, "", NULL },
+ { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable },
+ { "possess", SEC_ADMINISTRATOR, false, HandlePossessCommand, "", NULL },
+ { "unpossess", SEC_ADMINISTRATOR, false, HandleUnPossessCommand, "", NULL },
+ { "bindsight", SEC_ADMINISTRATOR, false, HandleBindSightCommand, "", NULL },
+ { "unbindsight", SEC_ADMINISTRATOR, false, HandleUnbindSightCommand, "", NULL },
+ { "playall", SEC_GAMEMASTER, false, HandlePlayAllCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleDevCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ {
+ if (handler->GetSession()->GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER))
+ handler->GetSession()->SendNotification(LANG_DEV_ON);
+ else
+ handler->GetSession()->SendNotification(LANG_DEV_OFF);
+ return true;
+ }
+
+ std::string argstr = (char*)args;
+
+ if (argstr == "on")
+ {
+ handler->GetSession()->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
+ handler->GetSession()->SendNotification(LANG_DEV_ON);
+ return true;
+ }
+
+ if (argstr == "off")
+ {
+ handler->GetSession()->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
+ handler->GetSession()->SendNotification(LANG_DEV_OFF);
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_USE_BOL);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ static bool HandleGPSCommand(ChatHandler* handler, char const* args)
+ {
+ WorldObject* object = NULL;
+ if (*args)
+ {
+ uint64 guid = handler->extractGuidFromLink((char*)args);
+ if (guid)
+ object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
+
+ if (!object)
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+ else
+ {
+ object = handler->getSelectedUnit();
+
+ if (!object)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY());
+ Cell cell(cellCoord);
+
+ uint32 zoneId, areaId;
+ object->GetZoneAndAreaId(zoneId, areaId);
+
+ MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId());
+ AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId);
+ AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId);
+
+ float zoneX = object->GetPositionX();
+ float zoneY = object->GetPositionY();
+
+ Map2ZoneCoordinates(zoneX, zoneY, zoneId);
+
+ Map const* map = object->GetMap();
+ float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
+ float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
+
+ GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY());
+
+ // 63? WHY?
+ int gridX = 63 - gridCoord.x_coord;
+ int gridY = 63 - gridCoord.y_coord;
+
+ uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
+ uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
+
+ if (haveVMap)
+ {
+ if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()))
+ handler->PSendSysMessage("You are outdoors");
+ else
+ handler->PSendSysMessage("You are indoors");
+ }
+ else
+ handler->PSendSysMessage("no VMAP available for area info");
+
+ handler->PSendSysMessage(LANG_MAP_POSITION,
+ object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
+ zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
+ areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
+ object->GetPhaseMask(),
+ object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
+ cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
+ zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
+
+ LiquidData liquidStatus;
+ ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
+
+ if (status)
+ handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status);
+
+ return true;
+ }
+
+ static bool HandleAuraCommand(ChatHandler* handler, char const* args)
+ {
+ Unit* target = handler->getSelectedUnit();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
+ Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target);
+
+ return true;
+ }
+
+ static bool HandleUnAuraCommand(ChatHandler* handler, char const* args)
+ {
+ Unit* target = handler->getSelectedUnit();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ std::string argstr = args;
+ if (argstr == "all")
+ {
+ target->RemoveAllAuras();
+ return true;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ target->RemoveAurasDueToSpell(spellId);
+
+ return true;
+ }
+ // Teleport to Player
+ static bool HandleAppearCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ Player* _player = handler->GetSession()->GetPlayer();
+ if (target == _player || targetGuid == _player->GetGUID())
+ {
+ handler->SendSysMessage(LANG_CANT_TELEPORT_SELF);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (target)
+ {
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ std::string chrNameLink = handler->playerLink(targetName);
+
+ Map* map = target->GetMap();
+ if (map->IsBattlegroundOrArena())
+ {
+ // only allow if gm mode is on
+ if (!_player->isGameMaster())
+ {
+ handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ // if both players are in different bgs
+ else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId())
+ _player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff
+
+ // all's well, set bg id
+ // when porting out from the bg, it will be reset to 0
+ _player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId());
+ // remember current position as entry point for return at bg end teleportation
+ if (!_player->GetMap()->IsBattlegroundOrArena())
+ _player->SetBattlegroundEntryPoint();
+ }
+ else if (map->IsDungeon())
+ {
+ // we have to go to instance, and can go to player only if:
+ // 1) we are in his group (either as leader or as member)
+ // 2) we are not bound to any group and have GM mode on
+ if (_player->GetGroup())
+ {
+ // we are in group, we can go only if we are in the player group
+ if (_player->GetGroup() != target->GetGroup())
+ {
+ handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+ else
+ {
+ // we are not in group, let's verify our GM mode
+ if (!_player->isGameMaster())
+ {
+ handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ // if the player or the player's group is bound to another instance
+ // the player will not be bound to another one
+ InstancePlayerBind* bind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(map->IsRaid()));
+ if (!bind)
+ {
+ Group* group = _player->GetGroup();
+ // if no bind exists, create a solo bind
+ InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
+ if (!gBind)
+ if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
+ _player->BindToInstance(save, !save->CanReset());
+ }
+
+ if (map->IsRaid())
+ _player->SetRaidDifficulty(target->GetRaidDifficulty());
+ else
+ _player->SetDungeonDifficulty(target->GetDungeonDifficulty());
+ }
+
+ handler->PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
+
+ // stop flight if need
+ if (_player->isInFlight())
+ {
+ _player->GetMotionMaster()->MovementExpired();
+ _player->CleanupAfterTaxiFlight();
+ }
+ // save only in non-flight case
+ else
+ _player->SaveRecallPosition();
+
+ // to point to see at target with same orientation
+ float x, y, z;
+ target->GetContactPoint(_player, x, y, z);
+
+ _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
+ _player->SetPhaseMask(target->GetPhaseMask(), true);
+ }
+ else
+ {
+ // check offline security
+ if (handler->HasLowerSecurity(NULL, targetGuid))
+ return false;
+
+ std::string nameLink = handler->playerLink(targetName);
+
+ handler->PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
+
+ // to point where player stay (if loaded)
+ float x, y, z, o;
+ uint32 map;
+ bool in_flight;
+ if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, targetGuid))
+ return false;
+
+ // stop flight if need
+ if (_player->isInFlight())
+ {
+ _player->GetMotionMaster()->MovementExpired();
+ _player->CleanupAfterTaxiFlight();
+ }
+ // save only in non-flight case
+ else
+ _player->SaveRecallPosition();
+
+ _player->TeleportTo(map, x, y, z, _player->GetOrientation());
+ }
+
+ return true;
+ }
+ // Summon Player
+ static bool HandleSummonCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ Player* _player = handler->GetSession()->GetPlayer();
+ if (target == _player || targetGuid == _player->GetGUID())
+ {
+ handler->PSendSysMessage(LANG_CANT_TELEPORT_SELF);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (target)
+ {
+ std::string nameLink = handler->playerLink(targetName);
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ if (target->IsBeingTeleported())
+ {
+ handler->PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Map* map = handler->GetSession()->GetPlayer()->GetMap();
+
+ if (map->IsBattlegroundOrArena())
+ {
+ // only allow if gm mode is on
+ if (!_player->isGameMaster())
+ {
+ handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ // if both players are in different bgs
+ else if (target->GetBattlegroundId() && handler->GetSession()->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId())
+ target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff
+
+ // all's well, set bg id
+ // when porting out from the bg, it will be reset to 0
+ target->SetBattlegroundId(handler->GetSession()->GetPlayer()->GetBattlegroundId(), handler->GetSession()->GetPlayer()->GetBattlegroundTypeId());
+ // remember current position as entry point for return at bg end teleportation
+ if (!target->GetMap()->IsBattlegroundOrArena())
+ target->SetBattlegroundEntryPoint();
+ }
+ else if (map->IsDungeon())
+ {
+ Map* map = target->GetMap();
+
+ if (map->Instanceable() && map->GetInstanceId() != map->GetInstanceId())
+ target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true);
+
+ // we are in instance, and can summon only player in our group with us as lead
+ if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() ||
+ (target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
+ (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))
+ // the last check is a bit excessive, but let it be, just in case
+ {
+ handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
+ if (handler->needReportToTarget(target))
+ ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str());
+
+ // stop flight if need
+ if (target->isInFlight())
+ {
+ target->GetMotionMaster()->MovementExpired();
+ target->CleanupAfterTaxiFlight();
+ }
+ // save only in non-flight case
+ else
+ target->SaveRecallPosition();
+
+ // before GM
+ float x, y, z;
+ handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
+ target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
+ target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), true);
+ }
+ else
+ {
+ // check offline security
+ if (handler->HasLowerSecurity(NULL, targetGuid))
+ return false;
+
+ std::string nameLink = handler->playerLink(targetName);
+
+ handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), handler->GetTrinityString(LANG_OFFLINE));
+
+ // in point where GM stay
+ Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(),
+ handler->GetSession()->GetPlayer()->GetPositionX(),
+ handler->GetSession()->GetPlayer()->GetPositionY(),
+ handler->GetSession()->GetPlayer()->GetPositionZ(),
+ handler->GetSession()->GetPlayer()->GetOrientation(),
+ handler->GetSession()->GetPlayer()->GetZoneId(),
+ targetGuid);
+ }
+
+ return true;
+ }
+ // Summon group of player
+ static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ Group* group = target->GetGroup();
+
+ std::string nameLink = handler->GetNameLink(target);
+
+ if (!group)
+ {
+ handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Map* gmMap = handler->GetSession()->GetPlayer()->GetMap();
+ bool toInstance = gmMap->Instanceable();
+
+ // we are in instance, and can summon only player in our group with us as lead
+ if (toInstance && (
+ !handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
+ (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())))
+ // the last check is a bit excessive, but let it be, just in case
+ {
+ handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* player = itr->getSource();
+
+ if (!player || player == handler->GetSession()->GetPlayer() || !player->GetSession())
+ continue;
+
+ // check online security
+ if (handler->HasLowerSecurity(player, 0))
+ return false;
+
+ std::string plNameLink = handler->GetNameLink(player);
+
+ if (player->IsBeingTeleported() == true)
+ {
+ handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (toInstance)
+ {
+ Map* playerMap = player->GetMap();
+
+ if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId())
+ {
+ // cannot summon from instance to instance
+ handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
+ if (handler->needReportToTarget(player))
+ ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str());
+
+ // stop flight if need
+ if (player->isInFlight())
+ {
+ player->GetMotionMaster()->MovementExpired();
+ player->CleanupAfterTaxiFlight();
+ }
+ // save only in non-flight case
+ else
+ player->SaveRecallPosition();
+
+ // before GM
+ float x, y, z;
+ handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize());
+ player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation());
+ }
+
+ return true;
+ }
+
+ static bool HandleCommandsCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->ShowHelpForCommand(handler->getCommandTable(), "");
+ return true;
+ }
+
+ static bool HandleDieCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* target = handler->getSelectedUnit();
+
+ if (!target || !handler->GetSession()->GetPlayer()->GetSelection())
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (handler->HasLowerSecurity((Player*)target, 0, false))
+ return false;
+ }
+
+ if (target->isAlive())
+ {
+ if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
+ handler->GetSession()->GetPlayer()->Kill(target);
+ else
+ handler->GetSession()->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ return true;
+ }
+
+ static bool HandleReviveCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
+ return false;
+
+ if (target)
+ {
+ target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f);
+ target->SpawnCorpseBones();
+ target->SaveToDB();
+ }
+ else
+ // will resurrected at login without corpse
+ sObjectAccessor->ConvertCorpseForPlayer(targetGuid);
+
+ return true;
+ }
+
+ static bool HandleDismountCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+
+ // If player is not mounted, so go out :)
+ if (!player->IsMounted())
+ {
+ handler->SendSysMessage(LANG_CHAR_NON_MOUNTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (player->isInFlight())
+ {
+ handler->SendSysMessage(LANG_YOU_IN_FLIGHT);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ player->Dismount();
+ player->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ return true;
+ }
+
+ static bool HandleGUIDCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ uint64 guid = handler->GetSession()->GetPlayer()->GetSelection();
+
+ if (guid == 0)
+ {
+ handler->SendSysMessage(LANG_NO_SELECTION);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ handler->PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
+ return true;
+ }
+
+ static bool HandleHelpCommand(ChatHandler* handler, char const* args)
+ {
+ char const* cmd = strtok((char*)args, " ");
+ if (!cmd)
+ {
+ handler->ShowHelpForCommand(handler->getCommandTable(), "help");
+ handler->ShowHelpForCommand(handler->getCommandTable(), "");
+ }
+ else
+ {
+ if (!handler->ShowHelpForCommand(handler->getCommandTable(), cmd))
+ handler->SendSysMessage(LANG_NO_HELP_CMD);
+ }
+
+ return true;
+ }
+ // move item to other slot
+ static bool HandleItemMoveCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char const* param1 = strtok((char*)args, " ");
+ if (!param1)
+ return false;
+
+ char const* param2 = strtok(NULL, " ");
+ if (!param2)
+ return false;
+
+ uint8 srcSlot = uint8(atoi(param1));
+ uint8 dstSlot = uint8(atoi(param2));
+
+ if (srcSlot == dstSlot)
+ return true;
+
+ if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcSlot, true))
+ return false;
+
+ if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstSlot, false))
+ return false;
+
+ uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcSlot);
+ uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstSlot);
+
+ handler->GetSession()->GetPlayer()->SwapItem(src, dst);
+
+ return true;
+ }
+
+ static bool HandleCooldownCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = handler->getSelectedPlayer();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ std::string nameLink = handler->GetNameLink(target);
+
+ if (!*args)
+ {
+ target->RemoveAllSpellCooldown();
+ handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str());
+ }
+ else
+ {
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellIid = handler->extractSpellIdFromLink((char*)args);
+ if (!spellIid)
+ return false;
+
+ if (!sSpellMgr->GetSpellInfo(spellIid))
+ {
+ handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ target->RemoveSpellCooldown(spellIid, true);
+ handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
+ }
+ return true;
+ }
+
+ static bool HandleGetDistanceCommand(ChatHandler* handler, char const* args)
+ {
+ WorldObject* obj = NULL;
+
+ if (*args)
+ {
+ uint64 guid = handler->extractGuidFromLink((char*)args);
+ if (guid)
+ obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
+
+ if (!obj)
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+ else
+ {
+ obj = handler->getSelectedUnit();
+
+ if (!obj)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ handler->PSendSysMessage(LANG_DISTANCE, handler->GetSession()->GetPlayer()->GetDistance(obj), handler->GetSession()->GetPlayer()->GetDistance2d(obj), handler->GetSession()->GetPlayer()->GetExactDist(obj), handler->GetSession()->GetPlayer()->GetExactDist2d(obj));
+ return true;
+ }
+ // Teleport player to last position
+ static bool HandleRecallCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ if (target->IsBeingTeleported())
+ {
+ handler->PSendSysMessage(LANG_IS_TELEPORTED, handler->GetNameLink(target).c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // stop flight if need
+ if (target->isInFlight())
+ {
+ target->GetMotionMaster()->MovementExpired();
+ target->CleanupAfterTaxiFlight();
+ }
+
+ target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
+ return true;
+ }
+
+ static bool HandleSaveCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+
+ // save GM account without delay and output message
+ if (!AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
+ {
+ if (Player* target = handler->getSelectedPlayer())
+ target->SaveToDB();
+ else
+ player->SaveToDB();
+ handler->SendSysMessage(LANG_PLAYER_SAVED);
+ return true;
+ }
+
+ // save if the player has last been saved over 20 seconds ago
+ uint32 saveInterval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
+ if (saveInterval == 0 || (saveInterval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= saveInterval - 20 * IN_MILLISECONDS))
+ player->SaveToDB();
+
+ return true;
+ }
+
+ // Save all players in the world
+ static bool HandleSaveAllCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ sObjectAccessor->SaveAllPlayers();
+ handler->SendSysMessage(LANG_PLAYERS_SAVED);
+ return true;
+ }
+
+ // kick player
+ static bool HandleKickPlayerCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = NULL;
+ std::string playerName;
+ if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
+ return false;
+
+ if (handler->GetSession() && target == handler->GetSession()->GetPlayer())
+ {
+ handler->SendSysMessage(LANG_COMMAND_KICKSELF);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
+ sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
+ else
+ handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
+
+ target->GetSession()->KickPlayer();
+
+ return true;
+ }
+
+ static bool HandleUnstuckCommand(ChatHandler* handler, char const* args)
+ {
+ //No args required for players
+ if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ if (player->isInFlight() || player->isInCombat())
+ {
+ handler->SendSysMessage(LANG_CANT_DO_NOW);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ //7355: "Stuck"
+ player->CastSpell(player, 7355, false);
+ return true;
+ }
+
+ if (!*args)
+ return false;
+
+ char* player_str = strtok((char*)args, " ");
+ if (!player_str)
+ return false;
+
+ std::string location_str = "inn";
+ if (char const* loc = strtok(NULL, " "))
+ location_str = loc;
+
+ Player* player = NULL;
+ if (!handler->extractPlayerTarget(player_str, &player))
+ return false;
+
+ if (player->isInFlight() || player->isInCombat())
+ {
+ handler->SendSysMessage(LANG_CANT_DO_NOW);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (location_str == "inn")
+ {
+ player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
+ return true;
+ }
+
+ if (location_str == "graveyard")
+ {
+ player->RepopAtGraveyard();
+ return true;
+ }
+
+ if (location_str == "startzone")
+ {
+ player->TeleportTo(player->GetStartPosition());
+ return true;
+ }
+
+ //Not a supported argument
+ return false;
+
+ }
+
+ static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* px = strtok((char*)args, " ");
+ if (!px)
+ return false;
+
+ uint32 graveyardId = uint32(atoi(px));
+
+ uint32 team;
+
+ char* px2 = strtok(NULL, " ");
+
+ if (!px2)
+ team = 0;
+ else if (strncmp(px2, "horde", 6) == 0)
+ team = HORDE;
+ else if (strncmp(px2, "alliance", 9) == 0)
+ team = ALLIANCE;
+ else
+ return false;
+
+ WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(graveyardId);
+
+ if (!graveyard)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player* player = handler->GetSession()->GetPlayer();
+
+ uint32 zoneId = player->GetZoneId();
+
+ AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
+ if (!areaEntry || areaEntry->zone !=0)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (sObjectMgr->AddGraveYardLink(graveyardId, zoneId, team))
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId);
+ else
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId);
+
+ return true;
+ }
+
+ static bool HandleNearGraveCommand(ChatHandler* handler, char const* args)
+ {
+ uint32 team;
+
+ size_t argStr = strlen(args);
+
+ if (!*args)
+ team = 0;
+ else if (strncmp((char*)args, "horde", argStr) == 0)
+ team = HORDE;
+ else if (strncmp((char*)args, "alliance", argStr) == 0)
+ team = ALLIANCE;
+ else
+ return false;
+
+ Player* player = handler->GetSession()->GetPlayer();
+ uint32 zone_id = player->GetZoneId();
+
+ WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
+ player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team);
+
+ if (graveyard)
+ {
+ uint32 graveyardId = graveyard->ID;
+
+ GraveYardData const* data = sObjectMgr->FindGraveYardData(graveyardId, zone_id);
+ if (!data)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ team = data->team;
+
+ std::string team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM);
+
+ if (team == 0)
+ team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
+ else if (team == HORDE)
+ team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
+ else if (team == ALLIANCE)
+ team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
+
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, graveyardId, team_name.c_str(), zone_id);
+ }
+ else
+ {
+ std::string team_name;
+
+ if (team == 0)
+ team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
+ else if (team == HORDE)
+ team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
+ else if (team == ALLIANCE)
+ team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
+
+ if (team == ~uint32(0))
+ handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
+ else
+ handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str());
+ }
+
+ return true;
+ }
+
+ static bool HandleShowAreaCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* playerTarget = handler->getSelectedPlayer();
+ if (!playerTarget)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ int32 area = GetAreaFlagByAreaID(atoi((char*)args));
+ int32 offset = area / 32;
+ uint32 val = uint32((1 << (area % 32)));
+
+ if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
+ {
+ handler->SendSysMessage(LANG_BAD_VALUE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
+ playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val)));
+
+ handler->SendSysMessage(LANG_EXPLORE_AREA);
+ return true;
+ }
+
+ static bool HandleHideAreaCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* playerTarget = handler->getSelectedPlayer();
+ if (!playerTarget)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ int32 area = GetAreaFlagByAreaID(atoi((char*)args));
+ int32 offset = area / 32;
+ uint32 val = uint32((1 << (area % 32)));
+
+ if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
+ {
+ handler->SendSysMessage(LANG_BAD_VALUE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
+ playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val)));
+
+ handler->SendSysMessage(LANG_UNEXPLORE_AREA);
+ return true;
+ }
+
+ static bool HandleAddItemCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 itemId = 0;
+
+ if (args[0] == '[') // [name] manual form
+ {
+ char const* itemNameStr = strtok((char*)args, "]");
+
+ if (itemNameStr && itemNameStr[0])
+ {
+ std::string itemName = itemNameStr+1;
+ WorldDatabase.EscapeString(itemName);
+
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME);
+ stmt->setString(0, itemName);
+ PreparedQueryResult result = WorldDatabase.Query(stmt);
+
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr+1);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ itemId = result->Fetch()->GetUInt32();
+ }
+ else
+ return false;
+ }
+ else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r
+ {
+ char const* id = handler->extractKeyFromLink((char*)args, "Hitem");
+ if (!id)
+ return false;
+ itemId = uint32(atol(id));
+ }
+
+ char const* ccount = strtok(NULL, " ");
+
+ int32 count = 1;
+
+ if (ccount)
+ count = strtol(ccount, NULL, 10);
+
+ if (count == 0)
+ count = 1;
+
+ Player* player = handler->GetSession()->GetPlayer();
+ Player* playerTarget = handler->getSelectedPlayer();
+ if (!playerTarget)
+ playerTarget = player;
+
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEM), itemId, count);
+
+ ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
+ if (!itemTemplate)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // Subtract
+ if (count < 0)
+ {
+ playerTarget->DestroyItemCount(itemId, -count, true, false);
+ handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str());
+ return true;
+ }
+
+ // Adding items
+ uint32 noSpaceForCount = 0;
+
+ // check space and find places
+ ItemPosCountVec dest;
+ InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount);
+ if (msg != EQUIP_ERR_OK) // convert to possible store amount
+ count -= noSpaceForCount;
+
+ if (count == 0 || dest.empty()) // can't add any
+ {
+ handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Item* item = playerTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
+
+ // remove binding (let GM give it to another player later)
+ if (player == playerTarget)
+ for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
+ if (Item* item1 = player->GetItemByPos(itr->pos))
+ item1->SetBinding(false);
+
+ if (count > 0 && item)
+ {
+ player->SendNewItem(item, count, false, true);
+ if (player != playerTarget)
+ playerTarget->SendNewItem(item, count, true, false);
+ }
+
+ if (noSpaceForCount > 0)
+ handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
+
+ return true;
+ }
+
+ static bool HandleAddItemSetCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char const* id = handler->extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r
+ if (!id)
+ return false;
+
+ uint32 itemSetId = atol(id);
+
+ // prevent generation all items with itemset field value '0'
+ if (itemSetId == 0)
+ {
+ handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player* player = handler->GetSession()->GetPlayer();
+ Player* playerTarget = handler->getSelectedPlayer();
+ if (!playerTarget)
+ playerTarget = player;
+
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEMSET), itemSetId);
+
+ bool found = false;
+ ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
+ for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
+ {
+ if (itr->second.ItemSet == itemSetId)
+ {
+ found = true;
+ ItemPosCountVec dest;
+ InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itr->second.ItemId, 1);
+ if (msg == EQUIP_ERR_OK)
+ {
+ Item* item = playerTarget->StoreNewItem(dest, itr->second.ItemId, true);
+
+ // remove binding (let GM give it to another player later)
+ if (player == playerTarget)
+ item->SetBinding(false);
+
+ player->SendNewItem(item, 1, false, true);
+ if (player != playerTarget)
+ playerTarget->SendNewItem(item, 1, true, false);
+ }
+ else
+ {
+ player->SendEquipError(msg, NULL, NULL, itr->second.ItemId);
+ handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1);
+ }
+ }
+ }
+
+ if (!found)
+ {
+ handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return true;
+ }
+
+ static bool HandleBankCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->GetSession()->SendShowBank(handler->GetSession()->GetPlayer()->GetGUID());
+ return true;
+ }
+
+ static bool HandleChangeWeather(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // Weather is OFF
+ if (!sWorld->getBoolConfig(CONFIG_WEATHER))
+ {
+ handler->SendSysMessage(LANG_WEATHER_DISABLED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // *Change the weather of a cell
+ char const* px = strtok((char*)args, " ");
+ char const* py = strtok(NULL, " ");
+
+ if (!px || !py)
+ return false;
+
+ uint32 type = uint32(atoi(px)); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
+ float grade = float(atof(py)); //0 to 1, sending -1 is instand good weather
+
+ Player* player = handler->GetSession()->GetPlayer();
+ uint32 zoneid = player->GetZoneId();
+
+ Weather* weather = WeatherMgr::FindWeather(zoneid);
+
+ if (!weather)
+ weather = WeatherMgr::AddWeather(zoneid);
+ if (!weather)
+ {
+ handler->SendSysMessage(LANG_NO_WEATHER);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ weather->SetWeather(WeatherType(type), grade);
+
+ return true;
+ }
+
+
+ static bool HandleMaxSkillCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* SelectedPlayer = handler->getSelectedPlayer();
+ if (!SelectedPlayer)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // each skills that have max skill value dependent from level seted to current level max skill value
+ SelectedPlayer->UpdateSkillsToMaxSkillsForLevel();
+ return true;
+ }
+
+ static bool HandleSetSkillCommand(ChatHandler* handler, char const* args)
+ {
+ // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r
+ char const* skillStr = handler->extractKeyFromLink((char*)args, "Hskill");
+ if (!skillStr)
+ return false;
+
+ char const* levelStr = strtok(NULL, " ");
+ if (!levelStr)
+ return false;
+
+ char const* maxPureSkill = strtok(NULL, " ");
+
+ int32 skill = atoi(skillStr);
+ if (skill <= 0)
+ {
+ handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ int32 level = uint32(atol(levelStr));
+
+ Player* target = handler->getSelectedPlayer();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skill);
+ if (!skillLine)
+ {
+ handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ std::string tNameLink = handler->GetNameLink(target);
+
+ if (!target->GetSkillValue(skill))
+ {
+ handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint16 max = maxPureSkill ? atol (maxPureSkill) : target->GetPureMaxSkillValue(skill);
+
+ if (level <= 0 || level > max || max <= 0)
+ return false;
+
+ target->SetSkill(skill, target->GetSkillStep(skill), level, max);
+ handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max);
+
+ return true;
+ }
+ // show info of player
+ static bool HandlePInfoCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+
+ uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
+
+ if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
+ {
+ target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
+ targetGuid = parseGUID;
+ }
+ else if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ uint32 accId = 0;
+ uint32 money = 0;
+ uint32 totalPlayerTime = 0;
+ uint8 level = 0;
+ uint32 latency = 0;
+ uint8 race;
+ uint8 Class;
+ int64 muteTime = 0;
+ int64 banTime = -1;
+ uint32 mapId;
+ uint32 areaId;
+ uint32 phase = 0;
+
+ // get additional information from Player object
+ if (target)
+ {
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ accId = target->GetSession()->GetAccountId();
+ money = target->GetMoney();
+ totalPlayerTime = target->GetTotalPlayedTime();
+ level = target->getLevel();
+ latency = target->GetSession()->GetLatency();
+ race = target->getRace();
+ Class = target->getClass();
+ muteTime = target->GetSession()->m_muteTime;
+ mapId = target->GetMapId();
+ areaId = target->GetAreaId();
+ phase = target->GetPhaseMask();
+ }
+ // get additional information from DB
+ else
+ {
+ // check offline security
+ if (handler->HasLowerSecurity(NULL, targetGuid))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO);
+ stmt->setUInt32(0, GUID_LOPART(targetGuid));
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+
+ if (!result)
+ return false;
+
+ Field* fields = result->Fetch();
+ totalPlayerTime = fields[0].GetUInt32();
+ level = fields[1].GetUInt8();
+ money = fields[2].GetUInt32();
+ accId = fields[3].GetUInt32();
+ race = fields[4].GetUInt8();
+ Class = fields[5].GetUInt8();
+ mapId = fields[6].GetUInt16();
+ areaId = fields[7].GetUInt16();
+ }
+
+ std::string userName = handler->GetTrinityString(LANG_ERROR);
+ std::string eMail = handler->GetTrinityString(LANG_ERROR);
+ std::string lastIp = handler->GetTrinityString(LANG_ERROR);
+ uint32 security = 0;
+ std::string lastLogin = handler->GetTrinityString(LANG_ERROR);
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
+ stmt->setInt32(0, int32(realmID));
+ stmt->setUInt32(1, accId);
+ PreparedQueryResult result = LoginDatabase.Query(stmt);
+
+ if (result)
+ {
+ Field* fields = result->Fetch();
+ userName = fields[0].GetString();
+ security = fields[1].GetUInt8();
+ eMail = fields[2].GetString();
+ muteTime = fields[5].GetUInt64();
+
+ if (eMail.empty())
+ eMail = "-";
+
+ if (!handler->GetSession() || handler->GetSession()->GetSecurity() >= AccountTypes(security))
+ {
+ lastIp = fields[3].GetString();
+ lastLogin = fields[4].GetString();
+
+ uint32 ip = inet_addr(lastIp.c_str());
+#if TRINITY_ENDIAN == BIGENDIAN
+ EndianConvertReverse(ip);
+#endif
+
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY);
+
+ stmt->setUInt32(0, ip);
+
+ PreparedQueryResult result2 = WorldDatabase.Query(stmt);
+
+ if (result2)
+ {
+ Field* fields2 = result2->Fetch();
+ lastIp.append(" (");
+ lastIp.append(fields2[0].GetString());
+ lastIp.append(")");
+ }
+ }
+ else
+ {
+ lastIp = "-";
+ lastLogin = "-";
+ }
+ }
+
+ std::string nameLink = handler->playerLink(targetName);
+
+ handler->PSendSysMessage(LANG_PINFO_ACCOUNT, (target ? "" : handler->GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(targetGuid), userName.c_str(), accId, eMail.c_str(), security, lastIp.c_str(), lastLogin.c_str(), latency);
+
+ std::string bannedby = "unknown";
+ std::string banreason = "";
+
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
+ stmt->setUInt32(0, accId);
+ PreparedQueryResult result2 = LoginDatabase.Query(stmt);
+ if (!result2)
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
+ stmt->setUInt32(0, GUID_LOPART(targetGuid));
+ result2 = CharacterDatabase.Query(stmt);
+ }
+
+ if (result2)
+ {
+ Field* fields = result2->Fetch();
+ banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32());
+ bannedby = fields[2].GetString();
+ banreason = fields[3].GetString();
+ }
+
+ if (muteTime > 0)
+ handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str());
+
+ if (banTime >= 0)
+ handler->PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str());
+
+ std::string raceStr, ClassStr;
+ switch (race)
+ {
+ case RACE_HUMAN:
+ raceStr = "Human";
+ break;
+ case RACE_ORC:
+ raceStr = "Orc";
+ break;
+ case RACE_DWARF:
+ raceStr = "Dwarf";
+ break;
+ case RACE_NIGHTELF:
+ raceStr = "Night Elf";
+ break;
+ case RACE_UNDEAD_PLAYER:
+ raceStr = "Undead";
+ break;
+ case RACE_TAUREN:
+ raceStr = "Tauren";
+ break;
+ case RACE_GNOME:
+ raceStr = "Gnome";
+ break;
+ case RACE_TROLL:
+ raceStr = "Troll";
+ break;
+ case RACE_BLOODELF:
+ raceStr = "Blood Elf";
+ break;
+ case RACE_DRAENEI:
+ raceStr = "Draenei";
+ break;
+ }
+
+ switch (Class)
+ {
+ case CLASS_WARRIOR:
+ ClassStr = "Warrior";
+ break;
+ case CLASS_PALADIN:
+ ClassStr = "Paladin";
+ break;
+ case CLASS_HUNTER:
+ ClassStr = "Hunter";
+ break;
+ case CLASS_ROGUE:
+ ClassStr = "Rogue";
+ break;
+ case CLASS_PRIEST:
+ ClassStr = "Priest";
+ break;
+ case CLASS_DEATH_KNIGHT:
+ ClassStr = "Death Knight";
+ break;
+ case CLASS_SHAMAN:
+ ClassStr = "Shaman";
+ break;
+ case CLASS_MAGE:
+ ClassStr = "Mage";
+ break;
+ case CLASS_WARLOCK:
+ ClassStr = "Warlock";
+ break;
+ case CLASS_DRUID:
+ ClassStr = "Druid";
+ break;
+ }
+
+ std::string timeStr = secsToTimeString(totalPlayerTime, true, true);
+ uint32 gold = money /GOLD;
+ uint32 silv = (money % GOLD) / SILVER;
+ uint32 copp = (money % GOLD) % SILVER;
+ handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp);
+
+ // Add map, zone, subzone and phase to output
+ int locale = handler->GetSessionDbcLocale();
+ std::string areaName = "<unknown>";
+ std::string zoneName = "";
+
+ MapEntry const* map = sMapStore.LookupEntry(mapId);
+
+ AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
+ if (area)
+ {
+ areaName = area->area_name[locale];
+
+ AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
+ if (zone)
+ zoneName = zone->area_name[locale];
+ }
+
+ if (target)
+ {
+ if (!zoneName.empty())
+ handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
+ else
+ handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
+ }
+ else
+ handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
+
+ return true;
+ }
+
+ static bool HandleRespawnCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+
+ // accept only explicitly selected target (not implicitly self targeting case)
+ Unit* target = handler->getSelectedUnit();
+ if (player->GetSelection() && target)
+ {
+ if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
+ {
+ handler->SendSysMessage(LANG_SELECT_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (target->isDead())
+ target->ToCreature()->Respawn();
+ return true;
+ }
+
+ CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
+ Cell cell(p);
+ cell.SetNoCreate();
+
+ Trinity::RespawnDo u_do;
+ Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(player, u_do);
+
+ TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
+ cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange());
+
+ return true;
+ }
+ // mute player for some times
+ static bool HandleMuteCommand(ChatHandler* handler, char const* args)
+ {
+ char* nameStr;
+ char* delayStr;
+ handler->extractOptFirstArg((char*)args, &nameStr, &delayStr);
+ if (!delayStr)
+ return false;
+
+ char const* muteReason = strtok(NULL, "\r");
+ std::string muteReasonStr = "No reason";
+ if (muteReason != NULL)
+ muteReasonStr = muteReason;
+
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
+ return false;
+
+ uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
+
+ // find only player from same account if any
+ if (!target)
+ if (WorldSession* session = sWorld->FindSession(accountId))
+ target = session->GetPlayer();
+
+ uint32 notSpeakTime = uint32(atoi(delayStr));
+
+ // must have strong lesser security level
+ if (handler->HasLowerSecurity (target, targetGuid, true))
+ return false;
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
+
+ if (target)
+ {
+ // Target is online, mute will be in effect right away.
+ int64 muteTime = time(NULL) + notSpeakTime * MINUTE;
+ target->GetSession()->m_muteTime = muteTime;
+ stmt->setInt64(0, muteTime);
+ ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str());
+ }
+ else
+ {
+ // Target is offline, mute will be in effect starting from the next login.
+ int32 muteTime = -int32(notSpeakTime * MINUTE);
+ stmt->setInt64(0, muteTime);
+ }
+
+ stmt->setUInt32(1, accountId);
+ LoginDatabase.Execute(stmt);
+ std::string nameLink = handler->playerLink(targetName);
+
+ handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
+
+ return true;
+ }
+
+ // unmute player
+ static bool HandleUnmuteCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
+
+ // find only player from same account if any
+ if (!target)
+ if (WorldSession* session = sWorld->FindSession(accountId))
+ target = session->GetPlayer();
+
+ // must have strong lesser security level
+ if (handler->HasLowerSecurity (target, targetGuid, true))
+ return false;
+
+ if (target)
+ {
+ if (target->CanSpeak())
+ {
+ handler->SendSysMessage(LANG_CHAT_ALREADY_ENABLED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ target->GetSession()->m_muteTime = 0;
+ }
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
+ stmt->setInt64(0, 0);
+ stmt->setUInt32(1, accountId);
+ LoginDatabase.Execute(stmt);
+
+ if (target)
+ ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
+
+ std::string nameLink = handler->playerLink(targetName);
+
+ handler->PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str());
+
+ return true;
+ }
+
+
+ static bool HandleMovegensCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* unit = handler->getSelectedUnit();
+ if (!unit)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow());
+
+ MotionMaster* motionMaster = unit->GetMotionMaster();
+ float x, y, z;
+ motionMaster->GetDestination(x, y, z);
+
+ for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
+ {
+ MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(i);
+ if (!movementGenerator)
+ {
+ handler->SendSysMessage("Empty");
+ continue;
+ }
+
+ switch (movementGenerator->GetMovementGeneratorType())
+ {
+ case IDLE_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_IDLE);
+ break;
+ case RANDOM_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_RANDOM);
+ break;
+ case WAYPOINT_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_WAYPOINT);
+ break;
+ case ANIMAL_RANDOM_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM);
+ break;
+ case CONFUSED_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_CONFUSED);
+ break;
+ case CHASE_MOTION_TYPE:
+ {
+ Unit* target = NULL;
+ if (unit->GetTypeId() == TYPEID_PLAYER)
+ target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
+ else
+ target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
+
+ if (!target)
+ handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
+ else if (target->GetTypeId() == TYPEID_PLAYER)
+ handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow());
+ else
+ handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow());
+ break;
+ }
+ case FOLLOW_MOTION_TYPE:
+ {
+ Unit* target = NULL;
+ if (unit->GetTypeId() == TYPEID_PLAYER)
+ target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
+ else
+ target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
+
+ if (!target)
+ handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
+ else if (target->GetTypeId() == TYPEID_PLAYER)
+ handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow());
+ else
+ handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow());
+ break;
+ }
+ case HOME_MOTION_TYPE:
+ {
+ if (unit->GetTypeId() == TYPEID_UNIT)
+ handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
+ else
+ handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
+ break;
+ }
+ case FLIGHT_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_FLIGHT);
+ break;
+ case POINT_MOTION_TYPE:
+ {
+ handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
+ break;
+ }
+ case FLEEING_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_FEAR);
+ break;
+ case DISTRACT_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_DISTRACT);
+ break;
+ case EFFECT_MOTION_TYPE:
+ handler->SendSysMessage(LANG_MOVEGENS_EFFECT);
+ break;
+ default:
+ handler->PSendSysMessage(LANG_MOVEGENS_UNKNOWN, movementGenerator->GetMovementGeneratorType());
+ break;
+ }
+ }
+ return true;
+ }
+ /*
+ ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
+ Without this function 3rd party scripting library will get linking errors (unresolved external)
+ when attempting to use the PointMovementGenerator
+ */
+ static bool HandleComeToMeCommand(ChatHandler* handler, char const* args)
+ {
+ char const* newFlagStr = strtok((char*)args, " ");
+ if (!newFlagStr)
+ return false;
+
+ Creature* caster = handler->getSelectedCreature();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player* player = handler->GetSession()->GetPlayer();
+
+ caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+
+ return true;
+ }
+
+ static bool HandleDamageCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Unit* target = handler->getSelectedUnit();
+ if (!target || !handler->GetSession()->GetPlayer()->GetSelection())
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (handler->HasLowerSecurity((Player*)target, 0, false))
+ return false;
+ }
+
+ if (!target->isAlive())
+ return true;
+
+ char* damageStr = strtok((char*)args, " ");
+ if (!damageStr)
+ return false;
+
+ int32 damage_int = atoi((char*)damageStr);
+ if (damage_int <= 0)
+ return true;
+
+ uint32 damage = damage_int;
+
+ char* schoolStr = strtok((char*)NULL, " ");
+
+ // flat melee damage without resistence/etc reduction
+ if (!schoolStr)
+ {
+ handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ if (target != handler->GetSession()->GetPlayer())
+ handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
+ return true;
+ }
+
+ uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL;
+ if (school >= MAX_SPELL_SCHOOL)
+ return false;
+
+ SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
+
+ if (Unit::IsDamageReducedByArmor(schoolmask))
+ damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK);
+
+ char* spellStr = strtok((char*)NULL, " ");
+
+ // melee damage by specific school
+ if (!spellStr)
+ {
+ uint32 absorb = 0;
+ uint32 resist = 0;
+
+ handler->GetSession()->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
+
+ if (damage <= absorb + resist)
+ return true;
+
+ damage -= absorb + resist;
+
+ handler->GetSession()->GetPlayer()->DealDamageMods(target, damage, &absorb);
+ handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
+ handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
+ return true;
+ }
+
+ // non-melee damage
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellid = handler->extractSpellIdFromLink((char*)args);
+ if (!spellid || !sSpellMgr->GetSpellInfo(spellid))
+ return false;
+
+ handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
+ return true;
+ }
+
+ static bool HandleCombatStopCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = NULL;
+
+ if (args && strlen(args) > 0)
+ {
+ target = sObjectAccessor->FindPlayerByName(args);
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ if (!target)
+ {
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+ }
+
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ target->CombatStop();
+ target->getHostileRefManager().deleteReferences();
+ return true;
+ }
+
+ static bool HandleFlushArenaPointsCommand(ChatHandler* /*handler*/, char const* /*args*/)
+ {
+ sArenaTeamMgr->DistributeArenaPoints();
+ return true;
+ }
+
+ static bool HandleRepairitemsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ // Repair items
+ target->DurabilityRepairAll(false, 0, false);
+
+ handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, handler->GetNameLink(target).c_str());
+ if (handler->needReportToTarget(target))
+ ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, handler->GetNameLink().c_str());
+
+ return true;
+ }
+
+ // Send mail by command
+ static bool HandleSendMailCommand(ChatHandler* handler, char const* args)
+ {
+ // format: name "subject text" "mail text"
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ char* tail1 = strtok(NULL, "");
+ if (!tail1)
+ return false;
+
+ char const* msgSubject = handler->extractQuotedArg(tail1);
+ if (!msgSubject)
+ return false;
+
+ char* tail2 = strtok(NULL, "");
+ if (!tail2)
+ return false;
+
+ char const* msgText = handler->extractQuotedArg(tail2);
+ if (!msgText)
+ return false;
+
+ // msgSubject, msgText isn't NUL after prev. check
+ std::string subject = msgSubject;
+ std::string text = msgText;
+
+ // from console show not existed sender
+ MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
+
+ //- TODO: Fix poor design
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ MailDraft(subject, text)
+ .SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
+
+ CharacterDatabase.CommitTransaction(trans);
+
+ std::string nameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
+ return true;
+ }
+ // Send items by mail
+ static bool HandleSendItemsCommand(ChatHandler* handler, char const* args)
+ {
+ // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
+ Player* receiver;
+ uint64 receiverGuid;
+ std::string receiverName;
+ if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
+ return false;
+
+ char* tail1 = strtok(NULL, "");
+ if (!tail1)
+ return false;
+
+ char const* msgSubject = handler->extractQuotedArg(tail1);
+ if (!msgSubject)
+ return false;
+
+ char* tail2 = strtok(NULL, "");
+ if (!tail2)
+ return false;
+
+ char const* msgText = handler->extractQuotedArg(tail2);
+ if (!msgText)
+ return false;
+
+ // msgSubject, msgText isn't NUL after prev. check
+ std::string subject = msgSubject;
+ std::string text = msgText;
+
+ // extract items
+ typedef std::pair<uint32, uint32> ItemPair;
+ typedef std::list< ItemPair > ItemPairs;
+ ItemPairs items;
+
+ // get all tail string
+ char* tail = strtok(NULL, "");
+
+ // get from tail next item str
+ while (char* itemStr = strtok(tail, " "))
+ {
+ // and get new tail
+ tail = strtok(NULL, "");
+
+ // parse item str
+ char const* itemIdStr = strtok(itemStr, ":");
+ char const* itemCountStr = strtok(NULL, " ");
+
+ uint32 itemId = atoi(itemIdStr);
+ if (!itemId)
+ return false;
+
+ ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(itemId);
+ if (!item_proto)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1;
+ if (itemCount < 1 || (item_proto->MaxCount > 0 && itemCount > uint32(item_proto->MaxCount)))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ while (itemCount > item_proto->GetMaxStackSize())
+ {
+ items.push_back(ItemPair(itemId, item_proto->GetMaxStackSize()));
+ itemCount -= item_proto->GetMaxStackSize();
+ }
+
+ items.push_back(ItemPair(itemId, itemCount));
+
+ if (items.size() > MAX_MAIL_ITEMS)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ // from console show not existed sender
+ MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
+
+ // fill mail
+ MailDraft draft(subject, text);
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+
+ for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
+ {
+ if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0))
+ {
+ item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted
+ draft.AddItem(item);
+ }
+ }
+
+ draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
+ CharacterDatabase.CommitTransaction(trans);
+
+ std::string nameLink = handler->playerLink(receiverName);
+ handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
+ return true;
+ }
+ /// Send money by mail
+ static bool HandleSendMoneyCommand(ChatHandler* handler, char const* args)
+ {
+ /// format: name "subject text" "mail text" money
+
+ Player* receiver;
+ uint64 receiverGuid;
+ std::string receiverName;
+ if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
+ return false;
+
+ char* tail1 = strtok(NULL, "");
+ if (!tail1)
+ return false;
+
+ char* msgSubject = handler->extractQuotedArg(tail1);
+ if (!msgSubject)
+ return false;
+
+ char* tail2 = strtok(NULL, "");
+ if (!tail2)
+ return false;
+
+ char* msgText = handler->extractQuotedArg(tail2);
+ if (!msgText)
+ return false;
+
+ char* moneyStr = strtok(NULL, "");
+ int32 money = moneyStr ? atoi(moneyStr) : 0;
+ if (money <= 0)
+ return false;
+
+ // msgSubject, msgText isn't NUL after prev. check
+ std::string subject = msgSubject;
+ std::string text = msgText;
+
+ // from console show not existed sender
+ MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+
+ MailDraft(subject, text)
+ .AddMoney(money)
+ .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
+
+ CharacterDatabase.CommitTransaction(trans);
+
+ std::string nameLink = handler->playerLink(receiverName);
+ handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
+ return true;
+ }
+ /// Send a message to a player in game
+ static bool HandleSendMessageCommand(ChatHandler* handler, char const* args)
+ {
+ /// - Find the player
+ Player* player;
+ if (!handler->extractPlayerTarget((char*)args, &player))
+ return false;
+
+ char* msgStr = strtok(NULL, "");
+ if (!msgStr)
+ return false;
+
+ ///- Check that he is not logging out.
+ if (player->GetSession()->isLogingOut())
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ /// - Send the message
+ // Use SendAreaTriggerMessage for fastest delivery.
+ player->GetSession()->SendAreaTriggerMessage("%s", msgStr);
+ player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
+
+ // Confirmation message
+ std::string nameLink = handler->GetNameLink(player);
+ handler->PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msgStr);
+
+ return true;
+ }
+
+ static bool HandleCreatePetCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ Creature* creatureTarget = handler->getSelectedCreature();
+
+ if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ handler->PSendSysMessage(LANG_SELECT_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ CreatureTemplate const* creatrueTemplate = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry());
+ // Creatures with family 0 crashes the server
+ if (!creatrueTemplate->family)
+ {
+ handler->PSendSysMessage("This creature cannot be tamed. (family id: 0).");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (player->GetPetGUID())
+ {
+ handler->PSendSysMessage("You already have a pet");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // Everything looks OK, create new pet
+ Pet* pet = new Pet(player, HUNTER_PET);
+ if (!pet->CreateBaseAtCreature(creatureTarget))
+ {
+ delete pet;
+ handler->PSendSysMessage("Error 1");
+ return false;
+ }
+
+ creatureTarget->setDeathState(JUST_DIED);
+ creatureTarget->RemoveCorpse();
+ creatureTarget->SetHealth(0); // just for nice GM-mode view
+
+ pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
+ pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
+
+ if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
+ {
+ sLog->outError(LOG_FILTER_GENERAL, "InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
+ handler->PSendSysMessage("Error 2");
+ delete pet;
+ return false;
+ }
+
+ // prepare visual effect for levelup
+ pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
+
+ pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
+ // this enables pet details window (Shift+P)
+ pet->InitPetCreateSpells();
+ pet->SetFullHealth();
+
+ pet->GetMap()->AddToMap(pet->ToCreature());
+
+ // visual effect for levelup
+ pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
+
+ player->SetMinion(pet, true);
+ pet->SavePetToDB(PET_SAVE_AS_CURRENT);
+ player->PetSpellInitialize();
+
+ return true;
+ }
+
+ static bool HandlePetLearnCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* player = handler->GetSession()->GetPlayer();
+ Pet* pet = player->GetPet();
+
+ if (!pet)
+ {
+ handler->PSendSysMessage("You have no pet");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ return false;
+
+ // Check if pet already has it
+ if (pet->HasSpell(spellId))
+ {
+ handler->PSendSysMessage("Pet already has spell: %u", spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // Check if spell is valid
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ pet->learnSpell(spellId);
+
+ handler->PSendSysMessage("Pet has learned spell %u", spellId);
+ return true;
+ }
+
+ static bool HandlePetUnlearnCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* player = handler->GetSession()->GetPlayer();
+ Pet* pet = player->GetPet();
+ if (!pet)
+ {
+ handler->PSendSysMessage("You have no pet");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+
+ if (pet->HasSpell(spellId))
+ pet->removeSpell(spellId, false);
+ else
+ handler->PSendSysMessage("Pet doesn't have that spell");
+
+ return true;
+ }
+
+ static bool HandleFreezeCommand(ChatHandler* handler, char const* args)
+ {
+ std::string name;
+ Player* player;
+ char const* TargetName = strtok((char*)args, " "); // get entered name
+ if (!TargetName) // if no name entered use target
+ {
+ player = handler->getSelectedPlayer();
+ if (player) //prevent crash with creature as target
+ {
+ name = player->GetName();
+ normalizePlayerName(name);
+ }
+ }
+ else // if name entered
+ {
+ name = TargetName;
+ normalizePlayerName(name);
+ player = sObjectAccessor->FindPlayerByName(name.c_str());
+ }
+
+ if (!player)
+ {
+ handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
+ return true;
+ }
+
+ if (player == handler->GetSession()->GetPlayer())
+ {
+ handler->SendSysMessage(LANG_COMMAND_FREEZE_ERROR);
+ return true;
+ }
+
+ // effect
+ if (player && (player != handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str());
+
+ // stop combat + make player unattackable + duel stop + stop some spells
+ player->setFaction(35);
+ player->CombatStop();
+ if (player->IsNonMeleeSpellCasted(true))
+ player->InterruptNonMeleeSpells(true);
+ player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ // if player class = hunter || warlock remove pet if alive
+ if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
+ {
+ if (Pet* pet = player->GetPet())
+ {
+ pet->SavePetToDB(PET_SAVE_AS_CURRENT);
+ // not let dismiss dead pet
+ if (pet && pet->isAlive())
+ player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
+ }
+ }
+
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454))
+ Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player);
+
+ // save player
+ player->SaveToDB();
+ }
+
+ return true;
+ }
+
+ static bool HandleUnFreezeCommand(ChatHandler* handler, char const*args)
+ {
+ std::string name;
+ Player* player;
+ char* targetName = strtok((char*)args, " "); // Get entered name
+
+ if (targetName)
+ {
+ name = targetName;
+ normalizePlayerName(name);
+ player = sObjectAccessor->FindPlayerByName(name.c_str());
+ }
+ else // If no name was entered - use target
+ {
+ player = handler->getSelectedPlayer();
+ if (player)
+ name = player->GetName();
+ }
+
+ if (player)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
+
+ // Reset player faction + allow combat + allow duels
+ player->setFactionForRace(player->getRace());
+ player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ // Remove Freeze spell (allowing movement and spells)
+ player->RemoveAurasDueToSpell(9454);
+
+ // Save player
+ player->SaveToDB();
+ }
+ else
+ {
+ if (targetName)
+ {
+ // Check for offline players
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME);
+ stmt->setString(0, name);
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+
+ if (!result)
+ {
+ handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
+ return true;
+ }
+
+ // If player found: delete his freeze aura
+ Field* fields = result->Fetch();
+ uint32 lowGuid = fields[0].GetUInt32();
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
+ stmt->setUInt32(0, lowGuid);
+ CharacterDatabase.Execute(stmt);
+
+ handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
+ return true;
+ }
+ else
+ {
+ handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ static bool HandleListFreezeCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ // Get names from DB
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+ if (!result)
+ {
+ handler->SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS);
+ return true;
+ }
+
+ // Header of the names
+ handler->PSendSysMessage(LANG_COMMAND_LIST_FREEZE);
+
+ // Output of the results
+ do
+ {
+ Field* fields = result->Fetch();
+ std::string player = fields[0].GetString();
+ handler->PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, player.c_str());
+ }
+ while (result->NextRow());
+
+ return true;
+ }
+
+ static bool HandleGroupLeaderCommand(ChatHandler* handler, char const* args)
+ {
+ Player* player = NULL;
+ Group* group = NULL;
+ uint64 guid = 0;
+ char* nameStr = strtok((char*)args, " ");
+
+ if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid))
+ if (group && group->GetLeaderGUID() != guid)
+ {
+ group->ChangeLeader(guid);
+ group->SendUpdate();
+ }
+
+ return true;
+ }
+
+ static bool HandleGroupDisbandCommand(ChatHandler* handler, char const* args)
+ {
+ Player* player = NULL;
+ Group* group = NULL;
+ uint64 guid = 0;
+ char* nameStr = strtok((char*)args, " ");
+
+ if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid))
+ if (group)
+ group->Disband();
+
+ return true;
+ }
+
+ static bool HandleGroupRemoveCommand(ChatHandler* handler, char const* args)
+ {
+ Player* player = NULL;
+ Group* group = NULL;
+ uint64 guid = 0;
+ char* nameStr = strtok((char*)args, " ");
+
+ if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid, true))
+ if (group)
+ group->RemoveMember(guid);
+
+ return true;
+ }
+
+ static bool HandlePlayAllCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 soundId = atoi((char*)args);
+
+ if (!sSoundEntriesStore.LookupEntry(soundId))
+ {
+ handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ WorldPacket data(SMSG_PLAY_SOUND, 4);
+ data << uint32(soundId) << handler->GetSession()->GetPlayer()->GetGUID();
+ sWorld->SendGlobalMessage(&data);
+
+ handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId);
+ return true;
+ }
+
+ static bool HandlePossessCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* unit = handler->getSelectedUnit();
+ if (!unit)
+ return false;
+
+ handler->GetSession()->GetPlayer()->CastSpell(unit, 530, true);
+ return true;
+ }
+
+ static bool HandleUnPossessCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* unit = handler->getSelectedUnit();
+ if (!unit)
+ unit = handler->GetSession()->GetPlayer();
+
+ unit->RemoveCharmAuras();
+
+ return true;
+ }
+
+ static bool HandleBindSightCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* unit = handler->getSelectedUnit();
+ if (!unit)
+ return false;
+
+ handler->GetSession()->GetPlayer()->CastSpell(unit, 6277, true);
+ return true;
+ }
+
+ static bool HandleUnbindSightCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+
+ if (player->isPossessing())
+ return false;
+
+ player->StopCastingBindSight();
+ return true;
+ }
+};
+
+void AddSC_misc_commandscript()
+{
+ new misc_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 3e04cb48af4..a88c765c596 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -198,7 +198,7 @@ public:
target->SetMaxPower(POWER_ENERGY, energym);
target->SetPower(POWER_ENERGY, energy);
- sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
return true;
}
@@ -1010,7 +1010,7 @@ public:
{
int32 newmoney = int32(moneyuser) + addmoney;
- sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
if (newmoney <= 0)
{
handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str());
@@ -1042,7 +1042,7 @@ public:
target->ModifyMoney(addmoney);
}
- sLog->outDetail(handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney());
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney());
return true;
}
@@ -1130,20 +1130,15 @@ public:
static bool HandleModifyDrunkCommand(ChatHandler* handler, const char* args)
{
- if (!*args) return false;
+ if (!*args)
+ return false;
- uint32 drunklevel = (uint32)atoi(args);
+ uint8 drunklevel = (uint8)atoi(args);
if (drunklevel > 100)
drunklevel = 100;
- uint16 drunkMod = drunklevel * 0xFFFF / 100;
-
- Player* target = handler->getSelectedPlayer();
- if (!target)
- target = handler->GetSession()->GetPlayer();
-
- if (target)
- target->SetDrunkValue(drunkMod);
+ if (Player* target = handler->getSelectedPlayer())
+ target->SetDrunkValue(drunklevel);
return true;
}
@@ -1390,7 +1385,7 @@ public:
if (!target)
target = handler->GetSession()->GetPlayer();
- // check online security
+ // check online security
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
return false;
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 832f7958fc8..77fc2918e0b 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -804,7 +804,7 @@ public:
if (dontdel_str)
{
- //sLog->outError("DEBUG: All 3 params are set");
+ //sLog->outError(LOG_FILTER_GENERAL, "DEBUG: All 3 params are set");
// All 3 params are set
// GUID
@@ -812,7 +812,7 @@ public:
// doNotDEL
if (stricmp(dontdel_str, "NODEL") == 0)
{
- //sLog->outError("DEBUG: doNotDelete = true;");
+ //sLog->outError(LOG_FILTER_GENERAL, "DEBUG: doNotDelete = true;");
doNotDelete = true;
}
}
@@ -821,10 +821,10 @@ public:
// Only 2 params - but maybe NODEL is set
if (type_str)
{
- sLog->outError("DEBUG: Only 2 params ");
+ sLog->outError(LOG_FILTER_GENERAL, "DEBUG: Only 2 params ");
if (stricmp(type_str, "NODEL") == 0)
{
- //sLog->outError("DEBUG: type_str, NODEL ");
+ //sLog->outError(LOG_FILTER_GENERAL, "DEBUG: type_str, NODEL ");
doNotDelete = true;
type_str = NULL;
}
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 2472a29e595..7e489a5781e 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -38,6 +38,7 @@ public:
{ "add", SEC_ADMINISTRATOR, false, &HandleQuestAdd, "", NULL },
{ "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "", NULL },
{ "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "", NULL },
+ { "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
@@ -77,7 +78,7 @@ public:
// check item starting quest (it can work incorrectly if added without item in inventory)
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
- ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
+ ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
if (result != itc->end())
{
@@ -244,6 +245,38 @@ public:
player->CompleteQuest(entry);
return true;
}
+
+ static bool HandleQuestReward(ChatHandler* handler, char const* args)
+ {
+ Player* player = handler->getSelectedPlayer();
+ if (!player)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // .quest reward #entry
+ // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
+ char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
+ if (!cId)
+ return false;
+
+ uint32 entry = atol(cId);
+
+ Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
+
+ // If player doesn't have the quest
+ if (!quest || player->GetQuestStatus(entry) != QUEST_STATUS_COMPLETE)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ player->RewardQuest(quest, 0, player);
+ return true;
+ }
};
void AddSC_quest_commandscript()
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 1c119fdef4c..7d2a4304054 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -222,7 +222,7 @@ public:
static bool HandleReloadAllLootCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables...");
LoadLootTables();
handler->SendGlobalGMSysMessage("DB tables `*_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
@@ -245,7 +245,7 @@ public:
HandleReloadQuestPOICommand(handler, "a");
HandleReloadQuestTemplateCommand(handler, "a");
- sLog->outString("Re-Loading Quests Relations...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Quests Relations...");
sObjectMgr->LoadQuestRelations();
handler->SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded.");
return true;
@@ -260,7 +260,7 @@ public:
return false;
}
- sLog->outString("Re-Loading Scripts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts...");
HandleReloadGameObjectScriptsCommand(handler, "a");
HandleReloadEventScriptsCommand(handler, "a");
HandleReloadQuestEndScriptsCommand(handler, "a");
@@ -333,7 +333,7 @@ public:
static bool HandleReloadConfigCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading config settings...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading config settings...");
sWorld->LoadConfigSettings(true);
sMapMgr->InitializeVisibilityDistanceInfo();
handler->SendGlobalGMSysMessage("World config settings reloaded.");
@@ -342,7 +342,7 @@ public:
static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Access Requirement definitions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Access Requirement definitions...");
sObjectMgr->LoadAccessRequirements();
handler->SendGlobalGMSysMessage("DB table `access_requirement` reloaded.");
return true;
@@ -350,7 +350,7 @@ public:
static bool HandleReloadAchievementCriteriaDataCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Additional Achievement Criteria Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Additional Achievement Criteria Data...");
sAchievementMgr->LoadAchievementCriteriaData();
handler->SendGlobalGMSysMessage("DB table `achievement_criteria_data` reloaded.");
return true;
@@ -358,7 +358,7 @@ public:
static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Achievement Reward Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Achievement Reward Data...");
sAchievementMgr->LoadRewards();
handler->SendGlobalGMSysMessage("DB table `achievement_reward` reloaded.");
return true;
@@ -366,7 +366,7 @@ public:
static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Tavern Area Triggers...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Tavern Area Triggers...");
sObjectMgr->LoadTavernAreaTriggers();
handler->SendGlobalGMSysMessage("DB table `areatrigger_tavern` reloaded.");
return true;
@@ -374,7 +374,7 @@ public:
static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading AreaTrigger teleport definitions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading AreaTrigger teleport definitions...");
sObjectMgr->LoadAreaTriggerTeleports();
handler->SendGlobalGMSysMessage("DB table `areatrigger_teleport` reloaded.");
return true;
@@ -382,7 +382,7 @@ public:
static bool HandleReloadAutobroadcastCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Autobroadcasts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Autobroadcasts...");
sWorld->LoadAutobroadcasts();
handler->SendGlobalGMSysMessage("DB table `autobroadcast` reloaded.");
return true;
@@ -397,7 +397,7 @@ public:
static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading creature award reputation definitions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading creature award reputation definitions...");
sObjectMgr->LoadReputationOnKill();
handler->SendGlobalGMSysMessage("DB table `creature_onkill_reputation` reloaded.");
return true;
@@ -431,7 +431,7 @@ public:
continue;
}
- sLog->outString("Reloading creature template entry %u", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reloading creature template entry %u", entry);
Field* fields = result->Fetch();
@@ -467,56 +467,57 @@ public:
cInfo->rangeattacktime = fields[29].GetUInt32();
cInfo->unit_class = fields[30].GetUInt8();
cInfo->unit_flags = fields[31].GetUInt32();
- cInfo->dynamicflags = fields[32].GetUInt32();
- cInfo->family = fields[33].GetUInt8();
- cInfo->trainer_type = fields[34].GetUInt8();
- cInfo->trainer_spell = fields[35].GetUInt32();
- cInfo->trainer_class = fields[36].GetUInt8();
- cInfo->trainer_race = fields[37].GetUInt8();
- cInfo->minrangedmg = fields[38].GetFloat();
- cInfo->maxrangedmg = fields[39].GetFloat();
- cInfo->rangedattackpower = fields[40].GetUInt16();
- cInfo->type = fields[41].GetUInt8();
- cInfo->type_flags = fields[42].GetUInt32();
- cInfo->lootid = fields[43].GetUInt32();
- cInfo->pickpocketLootId = fields[44].GetUInt32();
- cInfo->SkinLootId = fields[45].GetUInt32();
+ cInfo->unit_flags2 = fields[32].GetUInt32();
+ cInfo->dynamicflags = fields[33].GetUInt32();
+ cInfo->family = fields[34].GetUInt8();
+ cInfo->trainer_type = fields[35].GetUInt8();
+ cInfo->trainer_spell = fields[36].GetUInt32();
+ cInfo->trainer_class = fields[37].GetUInt8();
+ cInfo->trainer_race = fields[38].GetUInt8();
+ cInfo->minrangedmg = fields[39].GetFloat();
+ cInfo->maxrangedmg = fields[40].GetFloat();
+ cInfo->rangedattackpower = fields[41].GetUInt16();
+ cInfo->type = fields[42].GetUInt8();
+ cInfo->type_flags = fields[43].GetUInt32();
+ cInfo->lootid = fields[44].GetUInt32();
+ cInfo->pickpocketLootId = fields[45].GetUInt32();
+ cInfo->SkinLootId = fields[46].GetUInt32();
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- cInfo->resistance[i] = fields[46 + i -1].GetUInt16();
-
- cInfo->spells[0] = fields[52].GetUInt32();
- cInfo->spells[1] = fields[53].GetUInt32();
- cInfo->spells[2] = fields[54].GetUInt32();
- cInfo->spells[3] = fields[55].GetUInt32();
- cInfo->spells[4] = fields[56].GetUInt32();
- cInfo->spells[5] = fields[57].GetUInt32();
- cInfo->spells[6] = fields[58].GetUInt32();
- cInfo->spells[7] = fields[59].GetUInt32();
- cInfo->PetSpellDataId = fields[60].GetUInt32();
- cInfo->VehicleId = fields[61].GetUInt32();
- cInfo->mingold = fields[62].GetUInt32();
- cInfo->maxgold = fields[63].GetUInt32();
- cInfo->AIName = fields[64].GetString();
- cInfo->MovementType = fields[65].GetUInt8();
- cInfo->InhabitType = fields[66].GetUInt8();
- cInfo->HoverHeight = fields[67].GetFloat();
- cInfo->ModHealth = fields[68].GetFloat();
- cInfo->ModMana = fields[69].GetFloat();
- cInfo->ModArmor = fields[70].GetFloat();
- cInfo->RacialLeader = fields[71].GetBool();
- cInfo->questItems[0] = fields[72].GetUInt32();
- cInfo->questItems[1] = fields[73].GetUInt32();
- cInfo->questItems[2] = fields[74].GetUInt32();
- cInfo->questItems[3] = fields[75].GetUInt32();
- cInfo->questItems[4] = fields[76].GetUInt32();
- cInfo->questItems[5] = fields[77].GetUInt32();
- cInfo->movementId = fields[78].GetUInt32();
- cInfo->RegenHealth = fields[79].GetBool();
- cInfo->equipmentId = fields[80].GetUInt32();
- cInfo->MechanicImmuneMask = fields[81].GetUInt32();
- cInfo->flags_extra = fields[82].GetUInt32();
- cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString());
+ cInfo->resistance[i] = fields[47 + i -1].GetUInt16();
+
+ cInfo->spells[0] = fields[53].GetUInt32();
+ cInfo->spells[1] = fields[54].GetUInt32();
+ cInfo->spells[2] = fields[55].GetUInt32();
+ cInfo->spells[3] = fields[56].GetUInt32();
+ cInfo->spells[4] = fields[57].GetUInt32();
+ cInfo->spells[5] = fields[58].GetUInt32();
+ cInfo->spells[6] = fields[59].GetUInt32();
+ cInfo->spells[7] = fields[60].GetUInt32();
+ cInfo->PetSpellDataId = fields[61].GetUInt32();
+ cInfo->VehicleId = fields[62].GetUInt32();
+ cInfo->mingold = fields[63].GetUInt32();
+ cInfo->maxgold = fields[64].GetUInt32();
+ cInfo->AIName = fields[65].GetString();
+ cInfo->MovementType = fields[66].GetUInt8();
+ cInfo->InhabitType = fields[67].GetUInt8();
+ cInfo->HoverHeight = fields[68].GetFloat();
+ cInfo->ModHealth = fields[69].GetFloat();
+ cInfo->ModMana = fields[70].GetFloat();
+ cInfo->ModArmor = fields[71].GetFloat();
+ cInfo->RacialLeader = fields[72].GetBool();
+ cInfo->questItems[0] = fields[73].GetUInt32();
+ cInfo->questItems[1] = fields[74].GetUInt32();
+ cInfo->questItems[2] = fields[75].GetUInt32();
+ cInfo->questItems[3] = fields[76].GetUInt32();
+ cInfo->questItems[4] = fields[77].GetUInt32();
+ cInfo->questItems[5] = fields[78].GetUInt32();
+ cInfo->movementId = fields[79].GetUInt32();
+ cInfo->RegenHealth = fields[80].GetBool();
+ cInfo->equipmentId = fields[81].GetUInt32();
+ cInfo->MechanicImmuneMask = fields[82].GetUInt32();
+ cInfo->flags_extra = fields[83].GetUInt32();
+ cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
}
@@ -527,7 +528,7 @@ public:
static bool HandleReloadCreatureQuestRelationsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Loading Quests Relations... (`creature_questrelation`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_questrelation`)");
sObjectMgr->LoadCreatureQuestRelations();
handler->SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded.");
return true;
@@ -535,7 +536,7 @@ public:
static bool HandleReloadLinkedRespawnCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Loading Linked Respawns... (`creature_linked_respawn`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Linked Respawns... (`creature_linked_respawn`)");
sObjectMgr->LoadLinkedRespawn();
handler->SendGlobalGMSysMessage("DB table `creature_linked_respawn` (creature linked respawns) reloaded.");
return true;
@@ -543,7 +544,7 @@ public:
static bool HandleReloadCreatureQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Loading Quests Relations... (`creature_involvedrelation`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_involvedrelation`)");
sObjectMgr->LoadCreatureInvolvedRelations();
handler->SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded.");
return true;
@@ -551,7 +552,7 @@ public:
static bool HandleReloadGossipMenuCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading `gossip_menu` Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `gossip_menu` Table!");
sObjectMgr->LoadGossipMenu();
handler->SendGlobalGMSysMessage("DB table `gossip_menu` reloaded.");
sConditionMgr->LoadConditions(true);
@@ -560,7 +561,7 @@ public:
static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading `gossip_menu_option` Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `gossip_menu_option` Table!");
sObjectMgr->LoadGossipMenuItems();
handler->SendGlobalGMSysMessage("DB table `gossip_menu_option` reloaded.");
sConditionMgr->LoadConditions(true);
@@ -569,7 +570,7 @@ public:
static bool HandleReloadGOQuestRelationsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Loading Quests Relations... (`gameobject_questrelation`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_questrelation`)");
sObjectMgr->LoadGameobjectQuestRelations();
handler->SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded.");
return true;
@@ -577,7 +578,7 @@ public:
static bool HandleReloadGOQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Loading Quests Relations... (`gameobject_involvedrelation`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_involvedrelation`)");
sObjectMgr->LoadGameobjectInvolvedRelations();
handler->SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded.");
return true;
@@ -585,7 +586,7 @@ public:
static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Quest Area Triggers...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Quest Area Triggers...");
sObjectMgr->LoadQuestAreaTriggers();
handler->SendGlobalGMSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded.");
return true;
@@ -593,12 +594,12 @@ public:
static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Quest Templates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Quest Templates...");
sObjectMgr->LoadQuests();
handler->SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded.");
/// dependent also from `gameobject` but this table not reloaded anyway
- sLog->outString("Re-Loading GameObjects for quests...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading GameObjects for quests...");
sObjectMgr->LoadGameObjectForQuests();
handler->SendGlobalGMSysMessage("Data GameObjects for quests reloaded.");
return true;
@@ -606,7 +607,7 @@ public:
static bool HandleReloadLootTemplatesCreatureCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`creature_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`creature_loot_template`)");
LoadLootTemplates_Creature();
LootTemplates_Creature.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `creature_loot_template` reloaded.");
@@ -616,7 +617,7 @@ public:
static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`disenchant_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`disenchant_loot_template`)");
LoadLootTemplates_Disenchant();
LootTemplates_Disenchant.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `disenchant_loot_template` reloaded.");
@@ -626,7 +627,7 @@ public:
static bool HandleReloadLootTemplatesFishingCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`fishing_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`fishing_loot_template`)");
LoadLootTemplates_Fishing();
LootTemplates_Fishing.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `fishing_loot_template` reloaded.");
@@ -636,7 +637,7 @@ public:
static bool HandleReloadLootTemplatesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`gameobject_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`gameobject_loot_template`)");
LoadLootTemplates_Gameobject();
LootTemplates_Gameobject.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `gameobject_loot_template` reloaded.");
@@ -646,7 +647,7 @@ public:
static bool HandleReloadLootTemplatesItemCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`item_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`item_loot_template`)");
LoadLootTemplates_Item();
LootTemplates_Item.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `item_loot_template` reloaded.");
@@ -656,7 +657,7 @@ public:
static bool HandleReloadLootTemplatesMillingCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`milling_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`milling_loot_template`)");
LoadLootTemplates_Milling();
LootTemplates_Milling.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `milling_loot_template` reloaded.");
@@ -666,7 +667,7 @@ public:
static bool HandleReloadLootTemplatesPickpocketingCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`pickpocketing_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`pickpocketing_loot_template`)");
LoadLootTemplates_Pickpocketing();
LootTemplates_Pickpocketing.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `pickpocketing_loot_template` reloaded.");
@@ -676,7 +677,7 @@ public:
static bool HandleReloadLootTemplatesProspectingCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`prospecting_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`prospecting_loot_template`)");
LoadLootTemplates_Prospecting();
LootTemplates_Prospecting.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `prospecting_loot_template` reloaded.");
@@ -686,7 +687,7 @@ public:
static bool HandleReloadLootTemplatesMailCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`mail_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`mail_loot_template`)");
LoadLootTemplates_Mail();
LootTemplates_Mail.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `mail_loot_template` reloaded.");
@@ -696,7 +697,7 @@ public:
static bool HandleReloadLootTemplatesReferenceCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`reference_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`reference_loot_template`)");
LoadLootTemplates_Reference();
handler->SendGlobalGMSysMessage("DB table `reference_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
@@ -705,7 +706,7 @@ public:
static bool HandleReloadLootTemplatesSkinningCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`skinning_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`skinning_loot_template`)");
LoadLootTemplates_Skinning();
LootTemplates_Skinning.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `skinning_loot_template` reloaded.");
@@ -715,7 +716,7 @@ public:
static bool HandleReloadLootTemplatesSpellCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Loot Tables... (`spell_loot_template`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Loot Tables... (`spell_loot_template`)");
LoadLootTemplates_Spell();
LootTemplates_Spell.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `spell_loot_template` reloaded.");
@@ -725,7 +726,7 @@ public:
static bool HandleReloadTrinityStringCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading trinity_string Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading trinity_string Table!");
sObjectMgr->LoadTrinityStrings();
handler->SendGlobalGMSysMessage("DB table `trinity_string` reloaded.");
return true;
@@ -740,7 +741,7 @@ public:
return false;
}
- sLog->outString("Re-Loading warden_action Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading warden_action Table!");
sWardenCheckMgr->LoadWardenOverrides();
handler->SendGlobalGMSysMessage("DB table `warden_action` reloaded.");
return true;
@@ -748,7 +749,7 @@ public:
static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading `npc_trainer` Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `npc_trainer` Table!");
sObjectMgr->LoadTrainerSpell();
handler->SendGlobalGMSysMessage("DB table `npc_trainer` reloaded.");
return true;
@@ -756,7 +757,7 @@ public:
static bool HandleReloadNpcVendorCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading `npc_vendor` Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `npc_vendor` Table!");
sObjectMgr->LoadVendors();
handler->SendGlobalGMSysMessage("DB table `npc_vendor` reloaded.");
return true;
@@ -764,7 +765,7 @@ public:
static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading `points_of_interest` Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `points_of_interest` Table!");
sObjectMgr->LoadPointsOfInterest();
handler->SendGlobalGMSysMessage("DB table `points_of_interest` reloaded.");
return true;
@@ -772,7 +773,7 @@ public:
static bool HandleReloadQuestPOICommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString( "Re-Loading Quest POI ..." );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Quest POI ..." );
sObjectMgr->LoadQuestPOI();
handler->SendGlobalGMSysMessage("DB Table `quest_poi` and `quest_poi_points` reloaded.");
return true;
@@ -780,7 +781,7 @@ public:
static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading `npc_spellclick_spells` Table!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `npc_spellclick_spells` Table!");
sObjectMgr->LoadNPCSpellClickSpells();
handler->SendGlobalGMSysMessage("DB table `npc_spellclick_spells` reloaded.");
return true;
@@ -788,7 +789,7 @@ public:
static bool HandleReloadReservedNameCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Loading ReservedNames... (`reserved_name`)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading ReservedNames... (`reserved_name`)");
sObjectMgr->LoadReservedPlayersNames();
handler->SendGlobalGMSysMessage("DB table `reserved_name` (player reserved names) reloaded.");
return true;
@@ -796,7 +797,7 @@ public:
static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString( "Re-Loading `reputation_reward_rate` Table!" );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `reputation_reward_rate` Table!" );
sObjectMgr->LoadReputationRewardRate();
handler->SendGlobalSysMessage("DB table `reputation_reward_rate` reloaded.");
return true;
@@ -804,7 +805,7 @@ public:
static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString( "Re-Loading `reputation_spillover_template` Table!" );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `reputation_spillover_template` Table!" );
sObjectMgr->LoadReputationSpilloverTemplate();
handler->SendGlobalSysMessage("DB table `reputation_spillover_template` reloaded.");
return true;
@@ -812,7 +813,7 @@ public:
static bool HandleReloadSkillDiscoveryTemplateCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Skill Discovery Table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
handler->SendGlobalGMSysMessage("DB table `skill_discovery_template` (recipes discovered at crafting) reloaded.");
return true;
@@ -820,7 +821,7 @@ public:
static bool HandleReloadSkillExtraItemTemplateCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Skill Extra Item Table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Skill Extra Item Table...");
LoadSkillExtraItemTable();
handler->SendGlobalGMSysMessage("DB table `skill_extra_item_template` (extra item creation when crafting) reloaded.");
return true;
@@ -828,7 +829,7 @@ public:
static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Skill Fishing base level requirements...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Skill Fishing base level requirements...");
sObjectMgr->LoadFishingBaseSkillLevel();
handler->SendGlobalGMSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded.");
return true;
@@ -836,7 +837,7 @@ public:
static bool HandleReloadSpellAreaCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading SpellArea Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading SpellArea Data...");
sSpellMgr->LoadSpellAreas();
handler->SendGlobalGMSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded.");
return true;
@@ -844,7 +845,7 @@ public:
static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Required Data... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Required Data... ");
sSpellMgr->LoadSpellRequired();
handler->SendGlobalGMSysMessage("DB table `spell_required` reloaded.");
return true;
@@ -852,7 +853,7 @@ public:
static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Groups...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Groups...");
sSpellMgr->LoadSpellGroups();
handler->SendGlobalGMSysMessage("DB table `spell_group` (spell groups) reloaded.");
return true;
@@ -860,7 +861,7 @@ public:
static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Learn Spells...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Learn Spells...");
sSpellMgr->LoadSpellLearnSpells();
handler->SendGlobalGMSysMessage("DB table `spell_learn_spell` reloaded.");
return true;
@@ -868,7 +869,7 @@ public:
static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Linked Spells...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Linked Spells...");
sSpellMgr->LoadSpellLinked();
handler->SendGlobalGMSysMessage("DB table `spell_linked_spell` reloaded.");
return true;
@@ -876,7 +877,7 @@ public:
static bool HandleReloadSpellProcEventCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Proc Event conditions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Proc Event conditions...");
sSpellMgr->LoadSpellProcEvents();
handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
return true;
@@ -884,7 +885,7 @@ public:
static bool HandleReloadSpellProcsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Proc conditions and data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Proc conditions and data...");
sSpellMgr->LoadSpellProcs();
handler->SendGlobalGMSysMessage("DB table `spell_proc` (spell proc conditions and data) reloaded.");
return true;
@@ -892,7 +893,7 @@ public:
static bool HandleReloadSpellBonusesCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Bonus Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Bonus Data...");
sSpellMgr->LoadSpellBonusess();
handler->SendGlobalGMSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
return true;
@@ -900,7 +901,7 @@ public:
static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell target coordinates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell target coordinates...");
sSpellMgr->LoadSpellTargetPositions();
handler->SendGlobalGMSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded.");
return true;
@@ -908,7 +909,7 @@ public:
static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Aggro Spells Definitions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Aggro Spells Definitions...");
sSpellMgr->LoadSpellThreats();
handler->SendGlobalGMSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded.");
return true;
@@ -916,7 +917,7 @@ public:
static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell Group Stack Rules...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell Group Stack Rules...");
sSpellMgr->LoadSpellGroupStackRules();
handler->SendGlobalGMSysMessage("DB table `spell_group_stack_rules` (spell stacking definitions) reloaded.");
return true;
@@ -924,7 +925,7 @@ public:
static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Spell pet auras...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Spell pet auras...");
sSpellMgr->LoadSpellPetAuras();
handler->SendGlobalGMSysMessage("DB table `spell_pet_auras` reloaded.");
return true;
@@ -932,7 +933,7 @@ public:
static bool HandleReloadPageTextsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Page Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Page Texts...");
sObjectMgr->LoadPageTexts();
handler->SendGlobalGMSysMessage("DB table `page_texts` reloaded.");
return true;
@@ -940,7 +941,7 @@ public:
static bool HandleReloadItemEnchantementsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Item Random Enchantments Table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Item Random Enchantments Table...");
LoadRandomEnchantmentsTable();
handler->SendGlobalGMSysMessage("DB table `item_enchantment_template` reloaded.");
return true;
@@ -948,8 +949,8 @@ public:
static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Item set names...");
- LoadRandomEnchantmentsTable();
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Item set names...");
+ sObjectMgr->LoadItemSetNames();
handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded.");
return true;
}
@@ -964,7 +965,7 @@ public:
}
if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `gameobject_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `gameobject_scripts`...");
sObjectMgr->LoadGameObjectScripts();
@@ -984,7 +985,7 @@ public:
}
if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `event_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `event_scripts`...");
sObjectMgr->LoadEventScripts();
@@ -1004,7 +1005,7 @@ public:
}
if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `waypoint_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `waypoint_scripts`...");
sObjectMgr->LoadWaypointScripts();
@@ -1017,7 +1018,7 @@ public:
static bool HandleReloadWpCommand(ChatHandler* handler, const char* args)
{
if (*args != 'a')
- sLog->outString("Re-Loading Waypoints data from 'waypoints_data'");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Waypoints data from 'waypoints_data'");
sWaypointMgr->Load();
@@ -1030,7 +1031,7 @@ public:
static bool HandleReloadEventAITextsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Texts from `creature_ai_texts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Texts from `creature_ai_texts`...");
sEventAIMgr->LoadCreatureEventAI_Texts();
handler->SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded.");
return true;
@@ -1038,7 +1039,7 @@ public:
static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Summons from `creature_ai_summons`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Summons from `creature_ai_summons`...");
sEventAIMgr->LoadCreatureEventAI_Summons();
handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded.");
return true;
@@ -1046,7 +1047,7 @@ public:
static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Scripts from `creature_ai_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `creature_ai_scripts`...");
sEventAIMgr->LoadCreatureEventAI_Scripts();
handler->SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded.");
return true;
@@ -1062,7 +1063,7 @@ public:
}
if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `quest_end_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `quest_end_scripts`...");
sObjectMgr->LoadQuestEndScripts();
@@ -1082,7 +1083,7 @@ public:
}
if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `quest_start_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `quest_start_scripts`...");
sObjectMgr->LoadQuestStartScripts();
@@ -1102,7 +1103,7 @@ public:
}
if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `spell_scripts`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `spell_scripts`...");
sObjectMgr->LoadSpellScripts();
@@ -1114,7 +1115,7 @@ public:
static bool HandleReloadDbScriptStringCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Script strings from `db_script_string`...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Script strings from `db_script_string`...");
sObjectMgr->LoadDbScriptStrings();
handler->SendGlobalGMSysMessage("DB table `db_script_string` reloaded.");
return true;
@@ -1122,7 +1123,7 @@ public:
static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Graveyard-zone links...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Graveyard-zone links...");
sObjectMgr->LoadGraveyardZones();
@@ -1133,7 +1134,7 @@ public:
static bool HandleReloadGameTeleCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Game Tele coordinates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Game Tele coordinates...");
sObjectMgr->LoadGameTele();
@@ -1144,9 +1145,9 @@ public:
static bool HandleReloadDisablesCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading disables table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading disables table...");
DisableMgr::LoadDisables();
- sLog->outString("Checking quest disables...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Checking quest disables...");
DisableMgr::CheckQuestDisables();
handler->SendGlobalGMSysMessage("DB table `disables` reloaded.");
return true;
@@ -1154,7 +1155,7 @@ public:
static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Achievement Reward Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Achievement Reward Data...");
sAchievementMgr->LoadRewardLocales();
handler->SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded.");
return true;
@@ -1162,7 +1163,7 @@ public:
static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading lfg dungeon rewards...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading lfg dungeon rewards...");
sLFGMgr->LoadRewards();
handler->SendGlobalGMSysMessage("DB table `lfg_dungeon_rewards` reloaded.");
return true;
@@ -1170,7 +1171,7 @@ public:
static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Creature ...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Creature ...");
sObjectMgr->LoadCreatureLocales();
handler->SendGlobalGMSysMessage("DB table `locales_creature` reloaded.");
return true;
@@ -1178,7 +1179,7 @@ public:
static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Creature Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Creature Texts...");
sCreatureTextMgr->LoadCreatureTextLocales();
handler->SendGlobalGMSysMessage("DB table `locales_creature_text` reloaded.");
return true;
@@ -1186,7 +1187,7 @@ public:
static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Gameobject ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Gameobject ... ");
sObjectMgr->LoadGameObjectLocales();
handler->SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded.");
return true;
@@ -1194,7 +1195,7 @@ public:
static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString( "Re-Loading Locales Gossip Menu Option ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Gossip Menu Option ... ");
sObjectMgr->LoadGossipMenuItemsLocales();
handler->SendGlobalGMSysMessage("DB table `locales_gossip_menu_option` reloaded.");
return true;
@@ -1202,7 +1203,7 @@ public:
static bool HandleReloadLocalesItemCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Item ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Item ... ");
sObjectMgr->LoadItemLocales();
handler->SendGlobalGMSysMessage("DB table `locales_item` reloaded.");
return true;
@@ -1210,7 +1211,7 @@ public:
static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Item set name... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Item set name... ");
sObjectMgr->LoadItemSetNameLocales();
handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
return true;
@@ -1218,7 +1219,7 @@ public:
static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales NPC Text ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales NPC Text ... ");
sObjectMgr->LoadNpcTextLocales();
handler->SendGlobalGMSysMessage("DB table `locales_npc_text` reloaded.");
return true;
@@ -1226,7 +1227,7 @@ public:
static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Page Text ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Page Text ... ");
sObjectMgr->LoadPageTextLocales();
handler->SendGlobalGMSysMessage("DB table `locales_page_text` reloaded.");
return true;
@@ -1234,7 +1235,7 @@ public:
static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Points Of Interest ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Points Of Interest ... ");
sObjectMgr->LoadPointOfInterestLocales();
handler->SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded.");
return true;
@@ -1242,7 +1243,7 @@ public:
static bool HandleReloadLocalesQuestCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Locales Quest ... ");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Quest ... ");
sObjectMgr->LoadQuestLocales();
handler->SendGlobalGMSysMessage("DB table `locales_quest` reloaded.");
return true;
@@ -1250,7 +1251,7 @@ public:
static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Player level dependent mail rewards...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Player level dependent mail rewards...");
sObjectMgr->LoadMailLevelRewards();
handler->SendGlobalGMSysMessage("DB table `mail_level_reward` reloaded.");
return true;
@@ -1259,7 +1260,7 @@ public:
static bool HandleReloadAuctionsCommand(ChatHandler* handler, const char* /*args*/)
{
///- Reload dynamic data tables from the database
- sLog->outString("Re-Loading Auctions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Auctions...");
sAuctionMgr->LoadAuctionItems();
sAuctionMgr->LoadAuctions();
handler->SendGlobalGMSysMessage("Auctions reloaded.");
@@ -1268,7 +1269,7 @@ public:
static bool HandleReloadConditions(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Conditions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Conditions...");
sConditionMgr->LoadConditions(true);
handler->SendGlobalGMSysMessage("Conditions reloaded.");
return true;
@@ -1276,7 +1277,7 @@ public:
static bool HandleReloadCreatureText(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Creature Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Creature Texts...");
sCreatureTextMgr->LoadCreatureTexts();
handler->SendGlobalGMSysMessage("Creature Texts reloaded.");
return true;
@@ -1284,7 +1285,7 @@ public:
static bool HandleReloadSmartScripts(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Re-Loading Smart Scripts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Smart Scripts...");
sSmartScriptMgr->LoadSmartAIFromDB();
handler->SendGlobalGMSysMessage("Smart Scripts reloaded.");
return true;
@@ -1292,7 +1293,7 @@ public:
static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Reloading vehicle_accessory table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reloading vehicle_accessory table...");
sObjectMgr->LoadVehicleAccessories();
handler->SendGlobalGMSysMessage("Vehicle accessories reloaded.");
return true;
@@ -1300,7 +1301,7 @@ public:
static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, const char* /*args*/)
{
- sLog->outString("Reloading vehicle_template_accessory table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reloading vehicle_template_accessory table...");
sObjectMgr->LoadVehicleTemplateAccessories();
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
return true;
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
new file mode 100644
index 00000000000..76a4eb5d943
--- /dev/null
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -0,0 +1,313 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: reset_commandscript
+%Complete: 100
+Comment: All reset related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "ObjectAccessor.h"
+
+class reset_commandscript : public CommandScript
+{
+public:
+ reset_commandscript() : CommandScript("reset_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand resetCommandTable[] =
+ {
+ { "achievements", SEC_ADMINISTRATOR, true, &HandleResetAchievementsCommand, "", NULL },
+ { "honor", SEC_ADMINISTRATOR, true, &HandleResetHonorCommand, "", NULL },
+ { "level", SEC_ADMINISTRATOR, true, &HandleResetLevelCommand, "", NULL },
+ { "spells", SEC_ADMINISTRATOR, true, &HandleResetSpellsCommand, "", NULL },
+ { "stats", SEC_ADMINISTRATOR, true, &HandleResetStatsCommand, "", NULL },
+ { "talents", SEC_ADMINISTRATOR, true, &HandleResetTalentsCommand, "", NULL },
+ { "all", SEC_ADMINISTRATOR, true, &HandleResetAllCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleResetAchievementsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
+ return false;
+
+ if (target)
+ target->ResetAchievements();
+ else
+ AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid));
+
+ return true;
+ }
+
+ static bool HandleResetHonorCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ target->SetHonorPoints(0);
+ target->SetUInt32Value(PLAYER_FIELD_KILLS, 0);
+ target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0);
+ target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
+ target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
+ target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
+
+ return true;
+ }
+
+ static bool HandleResetStatsOrLevelHelper(Player* player)
+ {
+ ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass());
+ if (!classEntry)
+ {
+ sLog->outError(LOG_FILTER_GENERAL, "Class %u not found in DBC (Wrong DBC files?)", player->getClass());
+ return false;
+ }
+
+ uint8 powerType = classEntry->powerType;
+
+ // reset m_form if no aura
+ if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
+ player->SetShapeshiftForm(FORM_NONE);
+
+ player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
+ player->SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH);
+
+ player->setFactionForRace(player->getRace());
+
+ player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24)));
+
+ // reset only if player not in some form;
+ if (player->GetShapeshiftForm() == FORM_NONE)
+ player->InitDisplayIds();
+
+ player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
+
+ player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+
+ //-1 is default value
+ player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1));
+
+ //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000);
+ return true;
+ }
+
+ static bool HandleResetLevelCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ if (!HandleResetStatsOrLevelHelper(target))
+ return false;
+
+ uint8 oldLevel = target->getLevel();
+
+ // set starting level
+ uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT
+ ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
+ : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
+
+ target->_ApplyAllLevelScaleItemMods(false);
+ target->SetLevel(startLevel);
+ target->InitRunes();
+ target->InitStatsForLevel(true);
+ target->InitTaxiNodesForLevel();
+ target->InitGlyphsForLevel();
+ target->InitTalentForLevel();
+ target->SetUInt32Value(PLAYER_XP, 0);
+
+ target->_ApplyAllLevelScaleItemMods(true);
+
+ // reset level for pet
+ if (Pet* pet = target->GetPet())
+ pet->SynchronizeLevelWithOwner();
+
+ sScriptMgr->OnPlayerLevelChanged(target, oldLevel);
+
+ return true;
+ }
+
+ static bool HandleResetSpellsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ if (target)
+ {
+ target->resetSpells(/* bool myClassOnly */);
+
+ ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS);
+ if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
+ handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(target).c_str());
+ }
+ else
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ CharacterDatabase.Execute(stmt);
+
+ handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str());
+ }
+
+ return true;
+ }
+
+ static bool HandleResetStatsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ if (!HandleResetStatsOrLevelHelper(target))
+ return false;
+
+ target->InitRunes();
+ target->InitStatsForLevel(true);
+ target->InitTaxiNodesForLevel();
+ target->InitGlyphsForLevel();
+ target->InitTalentForLevel();
+
+ return true;
+ }
+
+ static bool HandleResetTalentsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ {
+ // Try reset talents as Hunter Pet
+ Creature* creature = handler->getSelectedCreature();
+ if (!*args && creature && creature->isPet())
+ {
+ Unit* owner = creature->GetOwner();
+ if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer()))
+ {
+ creature->ToPet()->resetTalents();
+ owner->ToPlayer()->SendTalentsInfoData(true);
+
+ ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS);
+ if (!handler->GetSession() || handler->GetSession()->GetPlayer() != owner->ToPlayer())
+ handler->PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, handler->GetNameLink(owner->ToPlayer()).c_str());
+ }
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (target)
+ {
+ target->resetTalents(true);
+ target->SendTalentsInfoData(false);
+ ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
+ if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
+ handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(target).c_str());
+
+ Pet* pet = target->GetPet();
+ Pet::resetTalentsForAllPetsOf(target, pet);
+ if (pet)
+ target->SendTalentsInfoData(true);
+ return true;
+ }
+ else if (targetGuid)
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ CharacterDatabase.Execute(stmt);
+
+ std::string nameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str());
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ static bool HandleResetAllCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string caseName = args;
+
+ AtLoginFlags atLogin;
+
+ // Command specially created as single command to prevent using short case names
+ if (caseName == "spells")
+ {
+ atLogin = AT_LOGIN_RESET_SPELLS;
+ sWorld->SendWorldText(LANG_RESETALL_SPELLS);
+ if (!handler->GetSession())
+ handler->SendSysMessage(LANG_RESETALL_SPELLS);
+ }
+ else if (caseName == "talents")
+ {
+ atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS);
+ sWorld->SendWorldText(LANG_RESETALL_TALENTS);
+ if (!handler->GetSession())
+ handler->SendSysMessage(LANG_RESETALL_TALENTS);
+ }
+ else
+ {
+ handler->PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
+ stmt->setUInt16(0, uint16(atLogin));
+ CharacterDatabase.Execute(stmt);
+
+ TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
+ HashMapHolder<Player>::MapType const& plist = sObjectAccessor->GetPlayers();
+ for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
+ itr->second->SetAtLoginFlag(atLogin);
+
+ return true;
+ }
+};
+
+void AddSC_reset_commandscript()
+{
+ new reset_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
new file mode 100644
index 00000000000..db1995ebb6e
--- /dev/null
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -0,0 +1,420 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: server_commandscript
+%Complete: 100
+Comment: All server related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "SystemConfig.h"
+#include "Config.h"
+#include "ObjectAccessor.h"
+
+class server_commandscript : public CommandScript
+{
+public:
+ server_commandscript() : CommandScript("server_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand serverIdleRestartCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverIdleShutdownCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverRestartCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverShutdownCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverSetCommandTable[] =
+ {
+ { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL },
+ { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL },
+ { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL },
+ { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverCommandTable[] =
+ {
+ { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL },
+ { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL },
+ { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
+ { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
+ { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL },
+ { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL },
+ { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL },
+ { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
+ { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
+ { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ // Triggering corpses expire check in world
+ static bool HandleServerCorpsesCommand(ChatHandler* /*handler*/, char const* /*args*/)
+ {
+ sObjectAccessor->RemoveOldCorpses();
+ return true;
+ }
+
+ static bool HandleServerInfoCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ uint32 playersNum = sWorld->GetPlayerCount();
+ uint32 maxPlayersNum = sWorld->GetMaxPlayerCount();
+ uint32 activeClientsNum = sWorld->GetActiveSessionCount();
+ uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
+ uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
+ uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount();
+ std::string uptime = secsToTimeString(sWorld->GetUptime());
+ uint32 updateTime = sWorld->GetUpdateTime();
+
+ handler->SendSysMessage(_FULLVERSION);
+ handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
+ handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
+ handler->PSendSysMessage(LANG_UPTIME, uptime.c_str());
+ handler->PSendSysMessage(LANG_UPDATE_DIFF, updateTime);
+ // Can't use sWorld->ShutdownMsg here in case of console command
+ if (sWorld->IsShuttingDown())
+ handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str());
+
+ return true;
+ }
+ // Display the 'Message of the day' for the realm
+ static bool HandleServerMotdCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd());
+ return true;
+ }
+
+ static bool HandleServerPLimitCommand(ChatHandler* handler, char const* args)
+ {
+ if (*args)
+ {
+ char* paramStr = strtok((char*)args, " ");
+ if (!paramStr)
+ return false;
+
+ int32 limit = strlen(paramStr);
+
+ if (strncmp(paramStr, "player", limit) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_PLAYER);
+ else if (strncmp(paramStr, "moderator", limit) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_MODERATOR);
+ else if (strncmp(paramStr, "gamemaster", limit) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER);
+ else if (strncmp(paramStr, "administrator", limit) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
+ else if (strncmp(paramStr, "reset", limit) == 0)
+ {
+ sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100));
+ sWorld->LoadDBAllowedSecurityLevel();
+ }
+ else
+ {
+ int32 value = atoi(paramStr);
+ if (value < 0)
+ sWorld->SetPlayerSecurityLimit(AccountTypes(-value));
+ else
+ sWorld->SetPlayerAmountLimit(uint32(value));
+ }
+ }
+
+ uint32 playerAmountLimit = sWorld->GetPlayerAmountLimit();
+ AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
+ char const* secName = "";
+ switch (allowedAccountType)
+ {
+ case SEC_PLAYER:
+ secName = "Player";
+ break;
+ case SEC_MODERATOR:
+ secName = "Moderator";
+ break;
+ case SEC_GAMEMASTER:
+ secName = "Gamemaster";
+ break;
+ case SEC_ADMINISTRATOR:
+ secName = "Administrator";
+ break;
+ default:
+ secName = "<unknown>";
+ break;
+ }
+ handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", playerAmountLimit, secName);
+
+ return true;
+ }
+
+ static bool HandleServerShutDownCancelCommand(ChatHandler* /*handler*/, char const* /*args*/)
+ {
+ sWorld->ShutdownCancel();
+
+ return true;
+ }
+
+ static bool HandleServerShutDownCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* timeStr = strtok((char*) args, " ");
+ char* exitCodeStr = strtok(NULL, "");
+
+ int32 time = atoi(timeStr);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitCodeStr)
+ {
+ int32 exitCode = atoi(exitCodeStr);
+
+ // Handle atoi() errors
+ if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitCode < 0 || exitCode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, 0, exitCode);
+ }
+ else
+ sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE);
+
+ return true;
+ }
+
+ static bool HandleServerRestartCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* timeStr = strtok((char*) args, " ");
+ char* exitCodeStr = strtok(NULL, "");
+
+ int32 time = atoi(timeStr);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitCodeStr)
+ {
+ int32 exitCode = atoi(exitCodeStr);
+
+ // Handle atoi() errors
+ if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitCode < 0 || exitCode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitCode);
+ }
+ else
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
+
+ return true;
+ }
+
+ static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* timeStr = strtok((char*) args, " ");
+ char* exitCodeStr = strtok(NULL, "");
+
+ int32 time = atoi(timeStr);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitCodeStr)
+ {
+ int32 exitCode = atoi(exitCodeStr);
+
+ // Handle atoi() errors
+ if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitCode < 0 || exitCode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, exitCode);
+ }
+ else
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
+ return true;
+ }
+
+ static bool HandleServerIdleShutDownCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* timeStr = strtok((char*) args, " ");
+ char* exitCodeStr = strtok(NULL, "");
+
+ int32 time = atoi(timeStr);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitCodeStr)
+ {
+ int32 exitCode = atoi(exitCodeStr);
+
+ // Handle atoi() errors
+ if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitCode < 0 || exitCode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitCode);
+ }
+ else
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
+ return true;
+ }
+
+ // Exit the realm
+ static bool HandleServerExitCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->SendSysMessage(LANG_COMMAND_EXIT);
+ World::StopNow(SHUTDOWN_EXIT_CODE);
+ return true;
+ }
+
+ // Define the 'Message of the day' for the realm
+ static bool HandleServerSetMotdCommand(ChatHandler* handler, char const* args)
+ {
+ sWorld->SetMotd(args);
+ handler->PSendSysMessage(LANG_MOTD_NEW, args);
+ return true;
+ }
+
+ // Set whether we accept new clients
+ static bool HandleServerSetClosedCommand(ChatHandler* handler, char const* args)
+ {
+ if (strncmp(args, "on", 3) == 0)
+ {
+ handler->SendSysMessage(LANG_WORLD_CLOSED);
+ sWorld->SetClosed(true);
+ return true;
+ }
+ else if (strncmp(args, "off", 4) == 0)
+ {
+ handler->SendSysMessage(LANG_WORLD_OPENED);
+ sWorld->SetClosed(false);
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_USE_BOL);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // Set the level of logging
+ static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* type = strtok((char*)args, " ");
+ char* name = strtok(NULL, " ");
+ char* level = strtok(NULL, " ");
+
+ if (!type || !name || !level || *name == '\0' || *level == '\0' || (*type != 'a' && *type != 'l'))
+ return false;
+
+ sLog->SetLogLevel(name, level, *type == 'l');
+ return true;
+ }
+
+ // set diff time record interval
+ static bool HandleServerSetDiffTimeCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* newTimeStr = strtok((char*)args, " ");
+ if (!newTimeStr)
+ return false;
+
+ int32 newTime = atoi(newTimeStr);
+ if (newTime < 0)
+ return false;
+
+ sWorld->SetRecordDiffInterval(newTime);
+ printf("Record diff every %u ms\n", newTime);
+
+ return true;
+ }
+};
+
+void AddSC_server_commandscript()
+{
+ new server_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index ca7c3af7fde..8f390d17cd4 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -97,15 +97,16 @@ public:
if (!*args)
return false;
- std::string name = args;
-
- if (!sObjectMgr->DeleteGameTele(name))
+ // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
+ GameTele const* tele = handler->extractGameTeleFromLink((char*)args);
+ if (!tele)
{
handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
-
+ std::string name = tele->name;
+ sObjectMgr->DeleteGameTele(name);
handler->SendSysMessage(LANG_COMMAND_TP_DELETED);
return true;
}
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
new file mode 100644
index 00000000000..baaa5d2bd43
--- /dev/null
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -0,0 +1,509 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* ScriptData
+Name: ticket_commandscript
+%Complete: 100
+Comment: All ticket related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "AccountMgr.h"
+#include "ObjectMgr.h"
+#include "TicketMgr.h"
+
+class ticket_commandscript : public CommandScript
+{
+public:
+ ticket_commandscript() : CommandScript("ticket_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand ticketResponseCommandTable[] =
+ {
+ { "append", SEC_MODERATOR, true, &HandleGMTicketResponseAppendCommand, "", NULL },
+ { "appendln", SEC_MODERATOR, true, &HandleGMTicketResponseAppendLnCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand ticketCommandTable[] =
+ {
+ { "assign", SEC_GAMEMASTER, true, &HandleGMTicketAssignToCommand, "", NULL },
+ { "close", SEC_MODERATOR, true, &HandleGMTicketCloseByIdCommand, "", NULL },
+ { "closedlist", SEC_MODERATOR, true, &HandleGMTicketListClosedCommand, "", NULL },
+ { "comment", SEC_MODERATOR, true, &HandleGMTicketCommentCommand, "", NULL },
+ { "complete", SEC_MODERATOR, true, &HandleGMTicketCompleteCommand, "", NULL },
+ { "delete", SEC_ADMINISTRATOR, true, &HandleGMTicketDeleteByIdCommand, "", NULL },
+ { "escalate", SEC_MODERATOR, true, &HandleGMTicketEscalateCommand, "", NULL },
+ { "escalatedlist", SEC_GAMEMASTER, true, &HandleGMTicketListEscalatedCommand, "", NULL },
+ { "list", SEC_MODERATOR, true, &HandleGMTicketListCommand, "", NULL },
+ { "onlinelist", SEC_MODERATOR, true, &HandleGMTicketListOnlineCommand, "", NULL },
+ { "reset", SEC_ADMINISTRATOR, true, &HandleGMTicketResetCommand, "", NULL },
+ { "response", SEC_MODERATOR, true, NULL, "", ticketResponseCommandTable },
+ { "togglesystem", SEC_ADMINISTRATOR, true, &HandleToggleGMTicketSystem, "", NULL },
+ { "unassign", SEC_GAMEMASTER, true, &HandleGMTicketUnAssignCommand, "", NULL },
+ { "viewid", SEC_MODERATOR, true, &HandleGMTicketGetByIdCommand, "", NULL },
+ { "viewname", SEC_MODERATOR, true, &HandleGMTicketGetByNameCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "ticket", SEC_MODERATOR, false, NULL, "", ticketCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleGMTicketAssignToCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* ticketIdStr = strtok((char*)args, " ");
+ uint32 ticketId = atoi(ticketIdStr);
+
+ char* targetStr = strtok(NULL, " ");
+ if (!targetStr)
+ return false;
+
+ std::string target(targetStr);
+ if (!normalizePlayerName(target))
+ return false;
+
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ // Get target information
+ uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
+ uint64 targetAccountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
+ uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccountId, realmID);
+
+ // Target must exist and have administrative rights
+ if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel))
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
+ return true;
+ }
+
+ // If already assigned, leave
+ if (ticket->IsAssignedTo(targetGuid))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_B, ticket->GetId());
+ return true;
+ }
+
+ // If assigned to different player other than current, leave
+ //! Console can override though
+ Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId(), target.c_str());
+ return true;
+ }
+
+ // Assign ticket
+ SQLTransaction trans = SQLTransaction(NULL);
+ ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel));
+ ticket->SaveToDB(trans);
+ sTicketMgr->UpdateLastChange();
+
+ std::string msg = ticket->FormatMessageString(*handler, NULL, target.c_str(), NULL, NULL);
+ handler->SendGlobalGMSysMessage(msg.c_str());
+ return true;
+ }
+
+ static bool HandleGMTicketCloseByIdCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 ticketId = atoi(args);
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ // Ticket should be assigned to the player who tries to close it.
+ // Console can override though
+ Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETCANNOTCLOSE, ticket->GetId());
+ return true;
+ }
+
+ sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
+ sTicketMgr->UpdateLastChange();
+
+ std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName() : "Console", NULL, NULL, NULL);
+ handler->SendGlobalGMSysMessage(msg.c_str());
+
+ // Inform player, who submitted this ticket, that it is closed
+ if (Player* submitter = ticket->GetPlayer())
+ {
+ if (submitter->IsInWorld())
+ {
+ WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
+ data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
+ submitter->GetSession()->SendPacket(&data);
+ }
+ }
+ return true;
+ }
+
+ static bool HandleGMTicketCommentCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* ticketIdStr = strtok((char*)args, " ");
+ uint32 ticketId = atoi(ticketIdStr);
+
+ char* comment = strtok(NULL, "\n");
+ if (!comment)
+ return false;
+
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed())
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ // Cannot comment ticket assigned to someone else
+ //! Console excluded
+ Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
+ return true;
+ }
+
+ SQLTransaction trans = SQLTransaction(NULL);
+ ticket->SetComment(comment);
+ ticket->SaveToDB(trans);
+ sTicketMgr->UpdateLastChange();
+
+ std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL);
+ msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName() : "Console", comment);
+ handler->SendGlobalGMSysMessage(msg.c_str());
+
+ return true;
+ }
+
+ static bool HandleGMTicketListClosedCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ sTicketMgr->ShowClosedList(*handler);
+ return true;
+ }
+
+ static bool HandleGMTicketCompleteCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 ticketId = atoi(args);
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ if (Player* player = ticket->GetPlayer())
+ if (player->IsInWorld())
+ ticket->SendResponse(player->GetSession());
+
+ sTicketMgr->UpdateLastChange();
+ return true;
+ }
+
+ static bool HandleGMTicketDeleteByIdCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 ticketId = atoi(args);
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket)
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ if (!ticket->IsClosed())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETCLOSEFIRST);
+ return true;
+ }
+
+ std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName() : "Console");
+ handler->SendGlobalGMSysMessage(msg.c_str());
+
+ sTicketMgr->RemoveTicket(ticket->GetId());
+ sTicketMgr->UpdateLastChange();
+
+ if (Player* player = ticket->GetPlayer())
+ {
+ if (player->IsInWorld())
+ {
+ // Force abandon ticket
+ WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
+ data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
+ player->GetSession()->SendPacket(&data);
+ }
+ }
+
+ return true;
+ }
+
+ static bool HandleGMTicketEscalateCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 ticketId = atoi(args);
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed() || ticket->IsCompleted() || ticket->GetEscalatedStatus() != TICKET_UNASSIGNED)
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ ticket->SetEscalatedStatus(TICKET_IN_ESCALATION_QUEUE);
+
+ if (Player* player = ticket->GetPlayer())
+ if (player->IsInWorld())
+ sTicketMgr->SendTicket(player->GetSession(), ticket);
+
+ sTicketMgr->UpdateLastChange();
+ return true;
+ }
+
+ static bool HandleGMTicketListEscalatedCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ sTicketMgr->ShowEscalatedList(*handler);
+ return true;
+ }
+
+ static bool HandleGMTicketListCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ sTicketMgr->ShowList(*handler, false);
+ return true;
+ }
+
+ static bool HandleGMTicketListOnlineCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ sTicketMgr->ShowList(*handler, true);
+ return true;
+ }
+
+ static bool HandleGMTicketResetCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ if (sTicketMgr->GetOpenTicketCount())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETPENDING);
+ return true;
+ }
+ else
+ {
+ sTicketMgr->ResetTickets();
+ handler->SendSysMessage(LANG_COMMAND_TICKETRESET);
+ }
+
+ return true;
+ }
+
+ static bool HandleToggleGMTicketSystem(ChatHandler* handler, char const* /*args*/)
+ {
+ bool status = !sTicketMgr->GetStatus();
+ sTicketMgr->SetStatus(status);
+ handler->PSendSysMessage(status ? LANG_ALLOW_TICKETS : LANG_DISALLOW_TICKETS);
+ return true;
+ }
+
+ static bool HandleGMTicketUnAssignCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 ticketId = atoi(args);
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+ // Ticket must be assigned
+ if (!ticket->IsAssigned())
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETNOTASSIGNED, ticket->GetId());
+ return true;
+ }
+
+ // Get security level of player, whom this ticket is assigned to
+ uint32 security = SEC_PLAYER;
+ Player* assignedPlayer = ticket->GetAssignedPlayer();
+ if (assignedPlayer && assignedPlayer->IsInWorld())
+ security = assignedPlayer->GetSession()->GetSecurity();
+ else
+ {
+ uint64 guid = ticket->GetAssignedToGUID();
+ uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
+ security = AccountMgr::GetSecurity(accountId, realmID);
+ }
+
+ // Check security
+ //! If no m_session present it means we're issuing this command from the console
+ uint32 mySecurity = handler->GetSession() ? handler->GetSession()->GetSecurity() : SEC_CONSOLE;
+ if (security > mySecurity)
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
+ return true;
+ }
+
+ SQLTransaction trans = SQLTransaction(NULL);
+ ticket->SetUnassigned();
+ ticket->SaveToDB(trans);
+ sTicketMgr->UpdateLastChange();
+
+ std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(),
+ handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName() : "Console", NULL);
+ handler->SendGlobalGMSysMessage(msg.c_str());
+
+ return true;
+ }
+
+ static bool HandleGMTicketGetByIdCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ uint32 ticketId = atoi(args);
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ SQLTransaction trans = SQLTransaction(NULL);
+ ticket->SetViewed();
+ ticket->SaveToDB(trans);
+
+ handler->SendSysMessage(ticket->FormatMessageString(*handler, true).c_str());
+ return true;
+ }
+
+ static bool HandleGMTicketGetByNameCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ std::string name(args);
+ if (!normalizePlayerName(name))
+ return false;
+
+ // Detect target's GUID
+ uint64 guid = 0;
+ if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str()))
+ guid = player->GetGUID();
+ else
+ guid = sObjectMgr->GetPlayerGUIDByName(name);
+
+ // Target must exist
+ if (!guid)
+ {
+ handler->SendSysMessage(LANG_NO_PLAYERS_FOUND);
+ return true;
+ }
+
+ // Ticket must exist
+ GmTicket* ticket = sTicketMgr->GetTicketByPlayer(guid);
+ if (!ticket)
+ {
+ handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ SQLTransaction trans = SQLTransaction(NULL);
+ ticket->SetViewed();
+ ticket->SaveToDB(trans);
+
+ handler->SendSysMessage(ticket->FormatMessageString(*handler, true).c_str());
+ return true;
+ }
+
+ static bool _HandleGMTicketResponseAppendCommand(char const* args, bool newLine, ChatHandler* handler)
+ {
+ if (!*args)
+ return false;
+
+ char* ticketIdStr = strtok((char*)args, " ");
+ uint32 ticketId = atoi(ticketIdStr);
+
+ char* response = strtok(NULL, "\n");
+ if (!response)
+ return false;
+
+ GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
+ if (!ticket || ticket->IsClosed())
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
+ return true;
+ }
+
+ // Cannot add response to ticket, assigned to someone else
+ //! Console excluded
+ Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
+ return true;
+ }
+
+ SQLTransaction trans = SQLTransaction(NULL);
+ ticket->AppendResponse(response);
+ if (newLine)
+ ticket->AppendResponse("\n");
+ ticket->SaveToDB(trans);
+
+ return true;
+ }
+
+ static bool HandleGMTicketResponseAppendCommand(ChatHandler* handler, char const* args)
+ {
+ return _HandleGMTicketResponseAppendCommand(args, false, handler);
+ }
+
+ static bool HandleGMTicketResponseAppendLnCommand(ChatHandler* handler, char const* args)
+ {
+ return _HandleGMTicketResponseAppendCommand(args, true, handler);
+ }
+};
+
+void AddSC_ticket_commandscript()
+{
+ new ticket_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 99ec263b8f9..e3cd185e4a3 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -642,19 +642,13 @@ public:
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
- // wpCreature
- Creature* wpCreature = NULL;
-
if (wpGuid != 0)
- {
- wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- if (wpCreature)
+ if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
{
wpCreature->CombatStop();
wpCreature->DeleteFromDB();
wpCreature->AddObjectToRemoveList();
}
- }
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA);
@@ -681,15 +675,12 @@ public:
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
{
- // wpCreature
- Creature* wpCreature = NULL;
// What to do:
// Move the visual spawnpoint
// Respawn the owner of the waypoints
if (wpGuid != 0)
{
- wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- if (wpCreature)
+ if (Creature* wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
{
wpCreature->CombatStop();
wpCreature->DeleteFromDB();
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
index 75dd99eef97..b2b4083f9c6 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
index 93de16fc80b..e776194652d 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
index 8b2a95be977..47091c162d9 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
index da53cffc99d..0c1eb6e6d30 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
index 3960351d395..fdb6a5da320 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Yells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
index 9375cc33f27..7286466d335 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
@@ -15,8 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
+#include "ScriptedGossip.h"
#include "blackrock_depths.h"
//go_shadowforge_brazier
@@ -207,7 +209,7 @@ public:
{
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
instance->SetData(TYPE_RING_OF_LAW, DONE);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete.");
+ sLog->outDebug(LOG_FILTER_TSCR, "npc_grimstone: event reached end and set complete.");
}
break;
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp
index ff0f1a4cedd..b2031ef0658 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp
index 2585796e28e..a07e9059b70 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
index 073c4fde82a..204fa3177e7 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackrock_depths.h"
enum Yells
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp
index 703f684cc9f..15882b30ed2 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp
index b2c93d949c2..055f1eebbac 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp
index 63d945ade90..40f8b2507e3 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
index f4f245be4be..b6be72d71e0 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp
index 3d2cc627145..c1e00796433 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp
index e6f65ab4252..6f665e9efc7 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp
index 211930e4f1a..347aff2ce0b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp
@@ -16,7 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "blackrock_depths.h"
enum Spells
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp
index 03cb077936b..0d02e4495a5 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp
@@ -16,7 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "blackrock_depths.h"
#define TIMER_TOMBOFTHESEVEN 15000
@@ -210,7 +212,7 @@ public:
void SetData64(uint32 type, uint64 data)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data);
switch (type)
{
@@ -226,7 +228,7 @@ public:
void SetData(uint32 type, uint32 data)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
switch (type)
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp
index 0279f3e2834..015c13d1098 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp
@@ -64,7 +64,7 @@ public:
void Reset()
{
- if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
+ if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
OpenDoors(false);
instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED);
// respawn any dead Blackhand Incarcerators
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp
index af0dfd38ae8..ceca6330152 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+
enum Say
{
SAY_AGGRO = -1469000,
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp
index a3eb0cea5ad..25c3f2e41e3 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp
@@ -23,7 +23,8 @@ SDComment: Chromatic Mutation disabled due to lack of core support
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Emotes
{
@@ -242,11 +243,9 @@ public:
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
{
- Unit* unit;
if ((*i) && (*i)->getSource())
{
- unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
- if (unit)
+ if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
{
//Cast affliction
DoCast(unit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK,
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
index c91e0fb3303..962e65fb8b0 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
@@ -23,7 +23,8 @@ SDComment: Shadow of Ebonroc needs core support
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_SHADOWFLAME 22539
#define SPELL_WINGBUFFET 18500
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp
index c2a2350c0e8..4d5f9b214db 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_SHADOWFLAME 22539
#define SPELL_WINGBUFFET 23339
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp
index 41bcb6c5427..e84ccd0e160 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Emotes
{
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp
index 5d4cc442a49..787fbe5312b 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp
@@ -23,7 +23,8 @@ SDComment: Some issues with class calls effecting more than one class
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Say
{
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp
index 24fc74cc7cb..04eca3586cc 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp
@@ -23,7 +23,8 @@ SDComment: Needs additional review. Phase 1 NYI (Grethok the Controller)
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
//Razorgore Phase 2 Script
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp
index eaa8c118f19..8cc42baff8e 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp
@@ -23,7 +23,9 @@ SDComment: Burning Adrenaline not correctly implemented in core
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
enum Says
{
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp
index 668b84d38dd..30638e9edeb 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp
@@ -23,7 +23,9 @@ SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong plac
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
enum Says
{
@@ -362,7 +364,7 @@ public:
Nefarian->setFaction(103);
NefarianGUID = Nefarian->GetGUID();
}
- else sLog->outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
+ else sLog->outError(LOG_FILTER_TSCR, "Blackwing Lair: Unable to spawn nefarian properly.");
}
AddSpawnTimer = 4000;
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp
index 8a9b930aa09..ae518b7c703 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp
@@ -23,4 +23,5 @@ SDComment:
SDCategory: Blackwing Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
index 4885d8620b0..f107fd7c5ec 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
@@ -21,7 +21,8 @@ SD%Complete:
SDComment: Timers and say taken from acid script
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "deadmines.h"
enum eSpels
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
index 6c6b0647c5f..888171c5415 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
@@ -23,7 +23,8 @@ SDComment: Placeholder
SDCategory: Deadmines
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "deadmines.h"
#include "Spell.h"
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index a75eda93d1d..8e0fb9ff411 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Deadmines
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "deadmines.h"
enum Sounds
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index b5a7984d945..f1aa3d68bce 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -22,7 +22,9 @@ SD%Complete: 90%
SDComment: Some visual effects are not implemented.
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "gnomeregan.h"
#include "ScriptedEscortAI.h"
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
index 0bbe787827b..931c0bb90fc 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "gnomeregan.h"
#define MAX_ENCOUNTER 1
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
index 96bda019f6a..bf27cad44ef 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_AGGRO -1532057
#define SAY_SUMMON1 -1532058
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
index e19efc7c4e5..8921867be21 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_AGGRO -1532018
#define SAY_SLAY1 -1532019
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
index 2bba875ad1f..08aad90f588 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_MIDNIGHT_KILL -1532000
#define SAY_APPEAR1 -1532001
@@ -79,6 +80,12 @@ public:
void Reset()
{
+ ResetTimer = 0;
+ }
+
+ void EnterEvadeMode()
+ {
+ ScriptedAI::EnterEvadeMode();
ResetTimer = 2000;
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index f69cecdb4c3..533a1aac2f0 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "karazhan.h"
#define SAY_AGGRO -1532011
@@ -74,8 +75,8 @@ public:
{
boss_moroesAI(Creature* creature) : ScriptedAI(creature)
{
- for (uint8 i = 0; i < 4; ++i)
- AddId[i] = 0;
+ memset(AddId, 0, sizeof(AddId));
+ memset(AddGUID, 0, sizeof(AddGUID));
instance = creature->GetInstanceScript();
}
@@ -104,10 +105,8 @@ public:
Enrage = false;
InVanish = false;
- if (me->GetHealth() > 0)
- {
+ if (me->GetHealth())
SpawnAdds();
- }
if (instance)
instance->SetData(TYPE_MOROES, NOT_STARTED);
@@ -192,10 +191,9 @@ public:
bool isAddlistEmpty()
{
for (uint8 i = 0; i < 4; ++i)
- {
if (AddId[i] == 0)
return true;
- }
+
return false;
}
@@ -203,12 +201,11 @@ public:
{
for (uint8 i = 0; i < 4; ++i)
{
- Creature* Temp = NULL;
if (AddGUID[i])
{
- Temp = Creature::GetCreature((*me), AddGUID[i]);
- if (Temp && Temp->isAlive())
- Temp->DisappearAndDie();
+ Creature* temp = Creature::GetCreature((*me), AddGUID[i]);
+ if (temp && temp->isAlive())
+ temp->DisappearAndDie();
}
}
}
@@ -217,14 +214,13 @@ public:
{
for (uint8 i = 0; i < 4; ++i)
{
- Creature* Temp = NULL;
if (AddGUID[i])
{
- Temp = Creature::GetCreature((*me), AddGUID[i]);
- if (Temp && Temp->isAlive())
+ Creature* temp = Creature::GetCreature((*me), AddGUID[i]);
+ if (temp && temp->isAlive())
{
- Temp->AI()->AttackStart(me->getVictim());
- DoZoneInCombat(Temp);
+ temp->AI()->AttackStart(me->getVictim());
+ DoZoneInCombat(temp);
} else
EnterEvadeMode();
}
@@ -252,13 +248,12 @@ public:
{
for (uint8 i = 0; i < 4; ++i)
{
- Creature* Temp = NULL;
if (AddGUID[i])
{
- Temp = Unit::GetCreature((*me), AddGUID[i]);
- if (Temp && Temp->isAlive())
- if (!Temp->getVictim())
- Temp->AI()->AttackStart(me->getVictim());
+ Creature* temp = Unit::GetCreature((*me), AddGUID[i]);
+ if (temp && temp->isAlive())
+ if (!temp->getVictim())
+ temp->AI()->AttackStart(me->getVictim());
}
}
CheckAdds_Timer = 5000;
@@ -340,17 +335,10 @@ struct boss_moroes_guestAI : public ScriptedAI
if (!instance)
return;
- uint64 MoroesGUID = instance->GetData64(DATA_MOROES);
- Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID));
- if (Moroes)
- {
+ if (Creature* Moroes = Unit::GetCreature(*me, instance->GetData64(DATA_MOROES)))
for (uint8 i = 0; i < 4; ++i)
- {
- uint64 GUID = CAST_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i];
- if (GUID)
+ if (uint64 GUID = CAST_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i])
GuestGUID[i] = GUID;
- }
- }
}
Unit* SelectGuestTarget()
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
index f89abca76cf..60e1a5ebc4c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
@@ -23,7 +23,8 @@ SDComment: Not sure about timing and portals placing
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "karazhan.h"
#define EMOTE_PHASE_PORTAL -1532089
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index ded5e6903a5..e2420749a4c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -23,7 +23,8 @@ SDComment: SDComment: Timers may incorrect
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "karazhan.h"
//phase 1
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 4700ad71fab..f4195620dda 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "karazhan.h"
#define SAY_AGGRO -1532091
@@ -186,6 +187,7 @@ public:
boss_malchezaarAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ memset(axes, 0, sizeof(axes));
}
InstanceScript* instance;
@@ -217,7 +219,10 @@ public:
positions.clear();
for (uint8 i = 0; i < 5; ++i)
+ {
enfeeble_targets[i] = 0;
+ enfeeble_health[i] = 0;
+ }
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
positions.push_back(&InfernalPoints[i]);
@@ -228,7 +233,7 @@ public:
SWPainTimer = 20000;
AmplifyDamageTimer = 5000;
Cleave_Timer = 8000;
- InfernalTimer = 45000;
+ InfernalTimer = 40000;
InfernalCleanupTimer = 47000;
AxesTargetSwitchTimer = urand(7500, 20000);
SunderArmorTimer = urand(5000, 10000);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index d95b4aa3ae1..7dd4e731a18 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -23,7 +23,8 @@ SDComment: Flame wreath missing cast animation, mods won't triggere.
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "karazhan.h"
#include "GameObject.h"
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index 2f19d2c7fc1..44cd7e0faea 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
@@ -23,8 +23,10 @@ SDComment: Complete! Needs adjustments to use spell though.
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "karazhan.h"
+#include "PassiveAI.h"
#define SAY_SLAY1 -1532065
#define SAY_SLAY2 -1532066
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 6f8121ef5b6..30d33dc65cf 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -23,7 +23,9 @@ SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing.
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "karazhan.h"
/***********************************/
@@ -1221,7 +1223,7 @@ public:
}
}
- sLog->outError("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen.");
+ sLog->outError(LOG_FILTER_TSCR, "boss_romuloAI: DamageTaken reach end of code, that should not happen.");
}
void EnterCombat(Unit* /*who*/)
@@ -1467,7 +1469,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama
if (Phase == PHASE_ROMULO)
{
- sLog->outError("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?");
+ sLog->outError(LOG_FILTER_TSCR, "boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?");
damage = 0;
return;
}
@@ -1501,7 +1503,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama
return;
}
}
- sLog->outError("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen.");
+ sLog->outError(LOG_FILTER_TSCR, "boss_julianneAI: DamageTaken reach end of code, that should not happen.");
}
void AddSC_bosses_opera()
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
index 8e86024f4d8..05d6ecf1478 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
@@ -23,7 +23,8 @@ SDComment: Instance Script for Karazhan to help in various encounters. TODO: Gam
SDCategory: Karazhan
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "karazhan.h"
#define MAX_ENCOUNTER 12
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index b37f6913b8d..b84fc15d664 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -29,7 +29,9 @@ npc_berthold
npc_image_of_medivh
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "karazhan.h"
#include "ScriptedEscortAI.h"
@@ -227,7 +229,7 @@ public:
void PrepareEncounter()
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
+ sLog->outDebug(LOG_FILTER_TSCR, "Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
uint8 index = 0;
uint8 count = 0;
@@ -342,17 +344,17 @@ public:
case GOSSIP_ACTION_INFO_DEF+3:
player->CLOSE_GOSSIP_MENU();
pBarnesAI->m_uiEventId = EVENT_OZ;
- sLog->outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ", player->GetGUID());
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ", player->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->CLOSE_GOSSIP_MENU();
pBarnesAI->m_uiEventId = EVENT_HOOD;
- sLog->outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD", player->GetGUID());
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD", player->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->CLOSE_GOSSIP_MENU();
pBarnesAI->m_uiEventId = EVENT_RAJ;
- sLog->outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ", player->GetGUID());
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ", player->GetGUID());
break;
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
index 08b9a729596..e1817034189 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
@@ -62,6 +62,6 @@ enum OperaEvents
EVENT_RAJ = 3
};
-#define ERROR_INST_DATA(a) sLog->outError("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
+#define ERROR_INST_DATA(a) sLog->outError(LOG_FILTER_TSCR, "Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
#endif
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index 4a75370f0e8..bd79cbba628 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -23,7 +23,8 @@ SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially fo
SDCategory: Magisters' Terrace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "magisters_terrace.h"
#include "WorldPacket.h"
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
index 883932fdb9b..7ce9b08845f 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
@@ -23,7 +23,8 @@ SDComment: No Heroic support yet. Needs further testing. Several scripts for pet
SDCategory: Magister's Terrace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "magisters_terrace.h"
struct Speech
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
index af7deda4545..82ad3ee2630 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
@@ -23,7 +23,8 @@ SDComment: Heroic and Normal Support. Needs further testing.
SDCategory: Magister's Terrace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "magisters_terrace.h"
#define SAY_AGGRO -1585000
@@ -75,7 +76,7 @@ public:
for (uint8 i = 0; i < size; ++i)
{
uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
+ sLog->outDebug(LOG_FILTER_TSCR, "Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
Crystals.push_back(guid);
}
}
@@ -120,7 +121,7 @@ public:
// Small door opened after event are expected to be closed by default
// Set Inst data for encounter
instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
- } else sLog->outError(ERROR_INST_DATA);
+ } else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
DrainLifeTimer = urand(3000, 7000);
DrainManaTimer = DrainLifeTimer + 5000;
@@ -222,7 +223,7 @@ public:
else
{
// Make an error message in case something weird happened here
- sLog->outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
+ sLog->outError(LOG_FILTER_TSCR, "Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
DrainingCrystal = false;
}
}
@@ -361,7 +362,7 @@ public:
}
}
}
- } else sLog->outError(ERROR_INST_DATA);
+ } else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
}
};
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
index 327c611b2d6..b5cf443c5a5 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
@@ -23,7 +23,8 @@ SDComment: Heroic and Normal support. Needs further testing.
SDCategory: Magister's Terrace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "magisters_terrace.h"
enum eEnums
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
index aa43cb3702f..cd2874f7253 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
@@ -23,7 +23,8 @@ SDComment: Designed only for Selin Fireheart
SDCategory: Magister's Terrace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "magisters_terrace.h"
#define MAX_ENCOUNTER 4
@@ -218,32 +219,32 @@ public:
{
switch (identifier)
{
- case DATA_SELIN:
+ case DATA_SELIN:
return SelinGUID;
- case DATA_DELRISSA:
+ case DATA_DELRISSA:
return DelrissaGUID;
- case DATA_VEXALLUS_DOOR:
+ case DATA_VEXALLUS_DOOR:
return VexallusDoorGUID;
- case DATA_SELIN_DOOR:
+ case DATA_SELIN_DOOR:
return SelinDoorGUID;
- case DATA_SELIN_ENCOUNTER_DOOR:
+ case DATA_SELIN_ENCOUNTER_DOOR:
return SelinEncounterDoorGUID;
- case DATA_DELRISSA_DOOR:
+ case DATA_DELRISSA_DOOR:
return DelrissaDoorGUID;
- case DATA_KAEL_DOOR:
+ case DATA_KAEL_DOOR:
return KaelDoorGUID;
- case DATA_KAEL_STATUE_LEFT:
+ case DATA_KAEL_STATUE_LEFT:
return KaelStatue[0];
- case DATA_KAEL_STATUE_RIGHT:
+ case DATA_KAEL_STATUE_RIGHT:
return KaelStatue[1];
- case DATA_ESCAPE_ORB:
+ case DATA_ESCAPE_ORB:
return EscapeOrbGUID;
case DATA_FEL_CRYSTAL:
{
if (FelCrystals.empty())
{
- sLog->outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data");
+ sLog->outError(LOG_FILTER_TSCR, "Magisters Terrace: No Fel Crystals loaded in Inst Data");
return 0;
}
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
index ccaaa0ec68d..69e0e5bff40 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_kalecgos
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## npc_kalecgos
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp
index 84e9957a60c..fa99078cedb 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp
@@ -77,7 +77,7 @@ class boss_golemagg : public CreatureScript
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
{
- if (HealthBelowPct(10) || me->HasAura(SPELL_ENRAGE))
+ if (!HealthBelowPct(10) || me->HasAura(SPELL_ENRAGE))
return;
DoCast(me, SPELL_ENRAGE, true);
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp
index 0160f35f143..9d48d04cf07 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp
@@ -23,7 +23,8 @@ SDComment: some spells doesnt work correctly
SDCategory: Molten Core
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "molten_core.h"
enum Texts
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index bf887bec164..c17a059d007 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -15,10 +15,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "Vehicle.h"
#include "ObjectMgr.h"
#include "ScriptedEscortAI.h"
+#include "CombatAI.h"
+#include "PassiveAI.h"
/*######
##Quest 12848
@@ -185,7 +189,7 @@ public:
anchorGUID = anchor->GetGUID();
}
else
- sLog->outError("npc_unworthy_initiateAI: unable to find anchor!");
+ sLog->outError(LOG_FILTER_TSCR, "npc_unworthy_initiateAI: unable to find anchor!");
float dist = 99.0f;
GameObject* prison = NULL;
@@ -205,7 +209,7 @@ public:
if (prison)
prison->ResetDoorOrButton();
else
- sLog->outError("npc_unworthy_initiateAI: unable to find prison!");
+ sLog->outError(LOG_FILTER_TSCR, "npc_unworthy_initiateAI: unable to find prison!");
}
break;
case PHASE_TO_EQUIP:
@@ -1074,9 +1078,9 @@ public:
{
car->AI()->SetGUID(miner->GetGUID());
CAST_AI(npc_scarlet_miner::npc_scarlet_minerAI, miner->AI())->InitCartQuest(player);
- } else sLog->outError("TSCR: OnGossipHello vehicle entry is not correct.");
- } else sLog->outError("TSCR: OnGossipHello player is not on the vehicle.");
- } else sLog->outError("TSCR: OnGossipHello Scarlet Miner cant be found by script.");
+ } else sLog->outError(LOG_FILTER_TSCR, "OnGossipHello vehicle entry is not correct.");
+ } else sLog->outError(LOG_FILTER_TSCR, "OnGossipHello player is not on the vehicle.");
+ } else sLog->outError(LOG_FILTER_TSCR, "OnGossipHello Scarlet Miner cant be found by script.");
}
return true;
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 1c17e6afa9b..b4c6268a43e 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
//How to win friends and influence enemies
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 8cee23fab1c..4d1552b932e 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
index 0ef2dddda8d..81211f36df3 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
/*####
## npc_valkyr_battle_maiden
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
index e5886cc39d4..c39a647d5e1 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eEnums
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
index 30105cc7315..a2cc0172969 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
index 466f940621d..ff1a0867de0 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eEnums
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 813c43288d0..028cf640d21 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "SpellMgr.h"
#include "scarlet_monastery.h"
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
index 58c21d86a2f..59244585ecf 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
@@ -23,7 +23,8 @@ SDComment: Should in addition spawn Myrmidons in the hallway outside
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
enum Says
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
index 1989c318c84..847a14f54d8 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
@@ -23,7 +23,8 @@ SDComment: TODO: if this guy not involved in some special event, remove (and let
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSpells
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
index f311da401d4..9a66c9ba728 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eEnums
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
index fd978136339..07b5ec5d584 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scarlet_monastery.h"
enum Says
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
index 8d813bfe502..0aad2857a45 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scarlet_monastery.h"
enum Says
@@ -282,6 +283,12 @@ public:
DoScriptText(SAY_WH_KILL, me);
}
+ void DamageTaken(Unit* /*attacker*/, uint32& damage)
+ {
+ if (!_bCanResurrectCheck && damage >= me->GetHealth())
+ damage = me->GetHealth() - 1;
+ }
+
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
index 8035adfc33f..6eb27327438 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
index ba0b854754e..3d3d9ae52ae 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scarlet Monastery
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scarlet_monastery.h"
enum Entry
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
index 2bc0320b81d..c2ccde645ca 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
@@ -23,7 +23,8 @@ SDComment: Doors missing in instance script.
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
#define SPELL_ARCANEMISSILES 22272
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
index 967f771fe7a..b4c4332aa45 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
class boss_death_knight_darkreaver : public CreatureScript
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
index 82f4dc85060..197ee9a5bfe 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
enum eEnums
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
index e438ae56a2b..b6b5cc0acbd 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
#define SPELL_CURSEOFAGONY 18671
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
index 498e6596b06..406b1a6b10d 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
#define SPELL_CALLOFGRAVES 17831
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
index 064faa5643d..3eb78662578 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_CURSEOFBLOOD 24673
//#define SPELL_ILLUSION 17773
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
index 5fd5a96d605..10736464ef3 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_SHADOWBOLTVOLLEY 20741
#define SPELL_BONESHIELD 27688
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
index 327c1df921d..438c3c88bb4 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
@@ -23,7 +23,8 @@ SDComment: aura applied/defined in database
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
#define SPELL_IMMOLATE 20294 // Old ID was 15570
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
index 1919a1ba099..64bbbbe9514 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
#define SPELL_VOLATILEINFECTION 24928
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
index fd10c6374a6..808dc97dc86 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_FROSTBOLT 21369
#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
index a28cecf3772..381a039d609 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "scholomance.h"
#define SPELL_TRAMPLE 15550
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
index f5f453c30bd..3c7771612e2 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eEnums
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
index 86023d21eca..c3b3724ec3d 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Scholomance
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "scholomance.h"
#define GO_GATE_KIRTONOS 175570
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
index 57b902ac6d4..b405f9eba85 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Shadowfang Keep
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "shadowfang_keep.h"
#define MAX_ENCOUNTER 4
@@ -239,7 +240,6 @@ public:
return;
Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID);
- Creature* summon = NULL;
if (!pArchmage || !pArchmage->isAlive())
return;
@@ -251,7 +251,8 @@ public:
switch (uiPhase)
{
case 1:
- summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
+ {
+ Creature* summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
summon->SetReactState(REACT_DEFENSIVE);
summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true);
@@ -259,13 +260,16 @@ public:
uiTimer = 2000;
uiPhase = 2;
break;
+ }
case 2:
+ {
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
uiPhase = 0;
break;
+ }
}
} else uiTimer -= uiDiff;
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index 63e753a18ba..676cd7be4f0 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
@@ -27,7 +27,11 @@ EndScriptData */
npc_shadowfang_prisoner
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "ScriptedEscortAI.h"
#include "shadowfang_keep.h"
@@ -193,8 +197,48 @@ public:
};
+class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader
+{
+ public:
+ spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { }
+
+ class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript);
+
+ void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
+ {
+ isPeriodic = true;
+ amplitude = (irand(0, 60) + 30) * IN_MILLISECONDS;
+ }
+
+ void HandleDummyTick(AuraEffect const* aurEff)
+ {
+ GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true);
+ }
+
+ void HandleUpdatePeriodic(AuraEffect* aurEff)
+ {
+ aurEff->CalculatePeriodic(GetCaster());
+ }
+
+ void Register()
+ {
+ DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_shadowfang_keep_haunting_spirits_AuraScript();
+ }
+};
+
void AddSC_shadowfang_keep()
{
new npc_shadowfang_prisoner();
new npc_arugal_voidwalker();
+ new spell_shadowfang_keep_haunting_spirits();
}
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
index 85faa14900b..cd3fbd09223 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
@@ -23,7 +23,8 @@ SDComment: aura applied/defined in database
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!"
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
index 106719d654f..7dafcc2b647 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
@@ -23,7 +23,8 @@ SDComment: MC disabled
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#define SPELL_BANSHEEWAIL 16565
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
index 01299ae06b6..4c2aa395e3c 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
//front, left
#define ADD_1X 3553.851807f
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
index 21e3e19d890..04380da3051 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
@@ -23,7 +23,8 @@ SDComment: Possibly need to fix/improve summons after death
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eEnums
{
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
index 37e0bd5757f..5e67f35af8b 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#define SPELL_DRAININGBLOW 16793
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
index f8a10f06155..522e43c0824 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#define SPELL_FROSTBOLT 17503
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
index c9a43edb66d..d6742e63167 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#define SPELL_ENCASINGWEBS 4962
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
index ebeda248331..47c6b66f4bb 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
@@ -23,7 +23,8 @@ SDComment: Basic script to have support for Horde paladin epic mount (quest 9737
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
/*#####
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
index cf8b10a2ee5..f650029a439 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
//Spell ID to summon this guy is 24627 "Summon Postmaster Malown"
//He should be spawned along with three other elites once the third postbox has been opened
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
index 3bb1ce7959d..4f82367924d 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#define SPELL_TRAMPLE 5568
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
index a281c1b59c6..356023bce77 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_SPAWN "TIMMY!"
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
index 387b6d7b13c..98df9638bae 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
@@ -23,7 +23,9 @@ SDComment: In progress. Undead side 75% implemented. Save/load not implemented.
SDCategory: Stratholme
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "stratholme.h"
#define GO_SERVICE_ENTRANCE 175368
@@ -122,7 +124,7 @@ class instance_stratholme : public InstanceMapScript
return true;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Cannot open slaugther square yet.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Cannot open slaugther square yet.");
return false;
}
@@ -240,7 +242,7 @@ class instance_stratholme : public InstanceMapScript
break;
EncounterState[0] = data;
events.ScheduleEvent(EVENT_BARON_RUN, 2700000);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Baron run in progress.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Baron run in progress.");
break;
case FAIL:
DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM);
@@ -298,10 +300,10 @@ class instance_stratholme : public InstanceMapScript
//UpdateGoState(ziggurat4GUID, 0, true);
if (Creature* pBaron = instance->GetCreature(baronGUID))
pBaron->SummonCreature(C_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Ramstein spawned.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Ramstein spawned.");
}
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: %u Abomnation left to kill.", count);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: %u Abomnation left to kill.", count);
}
if (data == NOT_STARTED)
@@ -310,7 +312,7 @@ class instance_stratholme : public InstanceMapScript
if (data == DONE)
{
events.ScheduleEvent(EVENT_SLAUGHTER_SQUARE, 60000);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Slaugther event will continue in 1 minute.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Slaugther event will continue in 1 minute.");
}
EncounterState[4] = data;
break;
@@ -446,7 +448,7 @@ class instance_stratholme : public InstanceMapScript
case EVENT_BARON_RUN:
if (GetData(TYPE_BARON_RUN) != DONE)
SetData(TYPE_BARON_RUN, FAIL);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN));
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN));
break;
case EVENT_SLAUGHTER_SQUARE:
if (Creature* baron = instance->GetCreature(baronGUID))
@@ -456,7 +458,7 @@ class instance_stratholme : public InstanceMapScript
HandleGameObject(ziggurat4GUID, true);
HandleGameObject(ziggurat5GUID, true);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
}
break;
default:
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
index 7e167093e07..9b4591bc633 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -30,7 +30,8 @@ mob_restless_soul
mobs_spectral_ghostly_citizen
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "stratholme.h"
#include "Group.h"
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
index e804fff44f5..e0987961f7e 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
@@ -23,7 +23,8 @@ SDComment:Place Holder
SDCategory: Sunken Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "sunken_temple.h"
#define GO_ATALAI_STATUE1 148830
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
index 35d6766872f..83ff86f5b88 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
@@ -27,7 +27,8 @@ EndScriptData */
at_malfurion_Stormrage_trigger
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunken_temple.h"
/*#####
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 43c94f8a57d..e40a48d0251 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -22,7 +22,8 @@ SD%Complete: 80
SDComment: Find a way to start the intro, best code for the intro
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
enum Quotes
@@ -170,7 +171,7 @@ public:
else
{
//Madrigosa not found, end intro
- sLog->outError("Madrigosa was not found");
+ sLog->outError(LOG_FILTER_TSCR, "Madrigosa was not found");
EndIntro();
}
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
index 03486a644a2..e7b0e86285e 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
@@ -21,7 +21,8 @@ SD%Complete: 100
SDComment:
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
enum Quotes
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index 72ad1100752..7267c4e1bdb 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -21,7 +21,12 @@ SD%Complete: 0
SDComment:
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "sunwell_plateau.h"
enum Yells
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index f783fcc1eb5..57e69238816 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Sunwell_Plateau
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
enum Yells
@@ -269,7 +270,7 @@ public:
}
else
{
- sLog->outError("TSCR: Didn't find Shathrowar. Kalecgos event reseted.");
+ sLog->outError(LOG_FILTER_TSCR, "Didn't find Shathrowar. Kalecgos event reseted.");
EnterEvadeMode();
return;
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 8a64d45abcb..167f040bbc4 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -24,7 +24,8 @@ EndScriptData */
//TODO rewrite Armageddon
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
#include <math.h>
@@ -754,7 +755,7 @@ public:
if (pRandomPlayer)
DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false);
else
- sLog->outError("try to cast SPELL_LEGION_LIGHTNING on invalid target");
+ sLog->outError(LOG_FILTER_TSCR, "try to cast SPELL_LEGION_LIGHTNING on invalid target");
Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE
Timer[TIMER_SOUL_FLAY] = 2500;
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index 66030a1c78c..c00ab84b567 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
@@ -21,7 +21,8 @@ SD%Complete: 80
SDComment: all sounds, black hole effect triggers to often (46228)
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
// Muru & Entropius's spells
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
index 645026c343d..6324c5adf16 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
@@ -23,7 +23,8 @@ SDComment: VERIFY SCRIPT
SDCategory: Sunwell_Plateau
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "sunwell_plateau.h"
#define MAX_ENCOUNTER 6
@@ -134,7 +135,7 @@ public:
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -275,14 +276,9 @@ public:
std::ostringstream stream;
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' '
<< m_auiEncounter[4] << ' ' << m_auiEncounter[5];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
- return NULL;
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return stream.str();
}
void Load(const char* in)
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
index e6349e3497e..25bc85f47b6 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
@@ -26,7 +26,8 @@ npc_prophet_velen
npc_captain_selana
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 7a946e9d5bf..74fad4f94d8 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -26,7 +26,8 @@ At 33%, he will awaken the Vault Walkers
On his death the vault door opens.
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "uldaman.h"
#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!"
@@ -94,14 +95,17 @@ class boss_archaedas : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
- void ActivateMinion(uint64 uiGuid, bool bFlag)
+ void ActivateMinion(uint64 uiGuid, bool flag)
{
- Unit* pMinion = Unit::GetUnit(*me, uiGuid);
+ Unit* minion = Unit::GetUnit(*me, uiGuid);
- if (pMinion && pMinion->isAlive())
+ if (minion && minion->isAlive())
{
- DoCast(pMinion, SPELL_AWAKEN_VAULT_WALKER, bFlag);
- pMinion->CastSpell(pMinion, SPELL_ARCHAEDAS_AWAKEN, true);
+ DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag);
+ minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true);
+ minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ minion->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
+ minion->setFaction(14);
}
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
index 8a845dbb7f6..c05a36f93a7 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Uldaman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_AGGRO -1070000
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index fea64c55377..ee82da668f8 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -23,7 +23,8 @@ SDComment: Need some cosmetics updates when archeadas door are closing (Guardian
SDCategory: Uldaman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "uldaman.h"
enum eSpells
@@ -201,6 +202,9 @@ class instance_uldaman : public InstanceMapScript
continue;
archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true);
target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true);
+ target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
+ target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ target->setFaction(14);
return; // only want the first one we find
}
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index 1c6cad7278a..2b8d4e37b65 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -30,7 +30,8 @@ go_keystone_chamber
at_map_chamber
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "uldaman.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
index a715dbfce9d..068d00f550f 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
@@ -25,7 +25,12 @@ SQLUpdate:
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "zulaman.h"
#include "Weather.h"
@@ -75,7 +80,9 @@ class boss_akilzon : public CreatureScript
boss_akilzonAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
}
+
InstanceScript* instance;
uint64 BirdGUIDs[8];
@@ -111,8 +118,7 @@ class boss_akilzon : public CreatureScript
CloudGUID = 0;
CycloneGUID = 0;
DespawnSummons();
- for (uint8 i = 0; i < 8; ++i)
- BirdGUIDs[i] = 0;
+ memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
StormCount = 0;
StormSequenceTimer = 0;
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
index 3baa6ebdf62..a8afd19cd96 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Zul'Aman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulaman.h"
//#include "spell.h"
@@ -108,6 +109,7 @@ class boss_halazzi : public CreatureScript
if (instance)
instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
+ LynxGUID = 0;
TransformCount = 0;
BerserkTimer = 600000;
CheckTimer = 1000;
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index b5698d851f8..4fcfa8a046e 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -23,7 +23,10 @@ SDComment:
SDCategory: Zul'Aman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "zulaman.h"
#define YELL_AGGRO "Da shadow gonna fall on you... "
@@ -47,54 +50,58 @@ EndScriptData */
//Defines for various powers he uses after using soul drain
-//Druid
-#define SPELL_DR_LIFEBLOOM 43421
-#define SPELL_DR_THORNS 43420
-#define SPELL_DR_MOONFIRE 43545
-
-//Hunter
-#define SPELL_HU_EXPLOSIVE_TRAP 43444
-#define SPELL_HU_FREEZING_TRAP 43447
-#define SPELL_HU_SNAKE_TRAP 43449
-
-//Mage
-#define SPELL_MG_FIREBALL 41383
-#define SPELL_MG_FROSTBOLT 43428
-#define SPELL_MG_FROST_NOVA 43426
-#define SPELL_MG_ICE_LANCE 43427
-
-//Paladin
-#define SPELL_PA_CONSECRATION 43429
-#define SPELL_PA_HOLY_LIGHT 43451
-#define SPELL_PA_AVENGING_WRATH 43430
-
-//Priest
-#define SPELL_PR_HEAL 41372
-#define SPELL_PR_MIND_CONTROL 43550
-#define SPELL_PR_MIND_BLAST 41374
-#define SPELL_PR_SW_DEATH 41375
-#define SPELL_PR_PSYCHIC_SCREAM 43432
-#define SPELL_PR_PAIN_SUPP 44416
-
-//Rogue
-#define SPELL_RO_BLIND 43433
-#define SPELL_RO_SLICE_DICE 43457
-#define SPELL_RO_WOUND_POISON 39665
-
-//Shaman
-#define SPELL_SH_FIRE_NOVA 43436
-#define SPELL_SH_HEALING_WAVE 43548
-#define SPELL_SH_CHAIN_LIGHT 43435
-
-//Warlock
-#define SPELL_WL_CURSE_OF_DOOM 43439
-#define SPELL_WL_RAIN_OF_FIRE 43440
-#define SPELL_WL_UNSTABLE_AFFL 35183
-
-//Warrior
-#define SPELL_WR_SPELL_REFLECT 43443
-#define SPELL_WR_WHIRLWIND 43442
-#define SPELL_WR_MORTAL_STRIKE 43441
+enum Spells
+{
+ // Druid
+ SPELL_DR_THORNS = 43420,
+ SPELL_DR_LIFEBLOOM = 43421,
+ SPELL_DR_MOONFIRE = 43545,
+
+ // Hunter
+ SPELL_HU_EXPLOSIVE_TRAP = 43444,
+ SPELL_HU_FREEZING_TRAP = 43447,
+ SPELL_HU_SNAKE_TRAP = 43449,
+
+ // Mage
+ SPELL_MG_FIREBALL = 41383,
+ SPELL_MG_FROST_NOVA = 43426,
+ SPELL_MG_ICE_LANCE = 43427,
+ SPELL_MG_FROSTBOLT = 43428,
+
+ // Paladin
+ SPELL_PA_CONSECRATION = 43429,
+ SPELL_PA_AVENGING_WRATH = 43430,
+ SPELL_PA_HOLY_LIGHT = 43451,
+
+ // Priest
+ SPELL_PR_HEAL = 41372,
+ SPELL_PR_MIND_BLAST = 41374,
+ SPELL_PR_SW_DEATH = 41375,
+ SPELL_PR_PSYCHIC_SCREAM = 43432,
+ SPELL_PR_MIND_CONTROL = 43550,
+ SPELL_PR_PAIN_SUPP = 44416,
+
+ // Rogue
+ SPELL_RO_BLIND = 43433,
+ SPELL_RO_SLICE_DICE = 43457,
+ SPELL_RO_WOUND_POISON = 43461,
+
+ // Shaman
+ SPELL_SH_CHAIN_LIGHT = 43435,
+ SPELL_SH_FIRE_NOVA = 43436,
+ SPELL_SH_HEALING_WAVE = 43548,
+
+ // Warlock
+ SPELL_WL_CURSE_OF_DOOM = 43439,
+ SPELL_WL_RAIN_OF_FIRE = 43440,
+ SPELL_WL_UNSTABLE_AFFL = 43522,
+ SPELL_WL_UNSTABLE_AFFL_DISPEL = 43523,
+
+ // Warrior
+ SPELL_WR_MORTAL_STRIKE = 43441,
+ SPELL_WR_WHIRLWIND = 43442,
+ SPELL_WR_SPELL_REFLECT = 43443
+};
#define ORIENT 1.5696f
#define POS_Y 921.2795f
@@ -936,6 +943,40 @@ class boss_koragg : public CreatureScript
}
};
+class spell_hexlord_unstable_affliction : public SpellScriptLoader
+{
+ public:
+ spell_hexlord_unstable_affliction() : SpellScriptLoader("spell_hexlord_unstable_affliction") { }
+
+ class spell_hexlord_unstable_affliction_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hexlord_unstable_affliction_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WL_UNSTABLE_AFFL_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, NULL, GetEffect(EFFECT_0));
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hexlord_unstable_affliction_AuraScript();
+ }
+};
+
void AddSC_boss_hex_lord_malacrass()
{
new boss_hexlord_malacrass();
@@ -947,5 +988,6 @@ void AddSC_boss_hex_lord_malacrass()
new boss_fenstalker();
new boss_koragg();
new boss_alyson_antille();
+ new spell_hexlord_unstable_affliction();
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
index a2125c45689..8a102757036 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
@@ -23,9 +23,11 @@ SDComment:
SDCategory: Zul'Aman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulaman.h"
#include "GridNotifiers.h"
+#include "CellImpl.h"
enum eEnums
{
@@ -246,7 +248,7 @@ class boss_janalai : public CreatureScript
cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange());
}
- //sLog->outError("Eggs %d at middle", templist.size());
+ //sLog->outError(LOG_FILTER_TSCR, "Eggs %d at middle", templist.size());
if (templist.empty())
return false;
@@ -532,7 +534,7 @@ class mob_janalai_hatcher : public CreatureScript
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
}
- //sLog->outError("Eggs %d at %d", templist.size(), side);
+ //sLog->outError(LOG_FILTER_TSCR, "Eggs %d at %d", templist.size(), side);
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i)
if ((*i)->GetDisplayId() != 11686)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
index 48a406f22a4..eb3057a74d3 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
@@ -23,9 +23,12 @@ SDComment:
SDCategory: Zul'Aman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulaman.h"
#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "CellImpl.h"
//Trash Waves
float NalorakkWay[8][3] =
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
index 2df202af088..8fb3dd55077 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
@@ -22,7 +22,8 @@ SD%Complete: 85%
SDComment:
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulaman.h"
//Speech
@@ -314,14 +315,12 @@ class boss_zuljin : public CreatureScript
{
for (uint8 i = 0; i < 4; ++i)
{
- Unit* Temp = NULL;
if (SpiritGUID[i])
{
- Temp = Unit::GetUnit(*me, SpiritGUID[i]);
- if (Temp)
+ if (Unit* temp = Unit::GetUnit(*me, SpiritGUID[i]))
{
- Temp->SetVisible(false);
- Temp->setDeathState(DEAD);
+ temp->SetVisible(false);
+ temp->setDeathState(DEAD);
}
}
SpiritGUID[i] = 0;
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index 884fe109785..235bec7cc8a 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Zul'Aman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "zulaman.h"
#define MAX_ENCOUNTER 6
@@ -179,12 +180,13 @@ class instance_zulaman : public InstanceMapScript
std::string GetSaveData()
{
+ OUT_SAVE_INST_DATA;
+
std::ostringstream ss;
ss << "S " << BossKilled << ' ' << ChestLooted << ' ' << QuestMinute;
- char* data = new char[ss.str().length()+1];
- strcpy(data, ss.str().c_str());
- //sLog->outError("TSCR: Zul'aman saved, %s.", data);
- return data;
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return ss.str();
}
void Load(const char* load)
@@ -193,17 +195,17 @@ class instance_zulaman : public InstanceMapScript
return;
std::istringstream ss(load);
- //sLog->outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str());
+ //sLog->outError(LOG_FILTER_TSCR, "Zul'aman loaded, %s.", ss.str().c_str());
char dataHead; // S
uint16 data1, data2, data3;
ss >> dataHead >> data1 >> data2 >> data3;
- //sLog->outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3);
+ //sLog->outError(LOG_FILTER_TSCR, "Zul'aman loaded, %d %d %d.", data1, data2, data3);
if (dataHead == 'S')
{
BossKilled = data1;
ChestLooted = data2;
QuestMinute = data3;
- } else sLog->outError("TSCR: Zul'aman: corrupted save data.");
+ } else sLog->outError(LOG_FILTER_TSCR, "Zul'aman: corrupted save data.");
}
void SetData(uint32 type, uint32 data)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
index bfb22483b09..f0bea065eb6 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_forest_frog
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "zulaman.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
index 4ba0c187973..17c3f5e8ff4 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
@@ -23,7 +23,8 @@ SDComment: Wrong cleave and red aura is missing.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
enum eYells
@@ -170,7 +171,7 @@ class boss_arlokk : public CreatureScript
MarkedTargetGUID = pMarkedTarget->GetGUID();
}
else
- sLog->outError("TSCR: boss_arlokk could not accuire pMarkedTarget.");
+ sLog->outError(LOG_FILTER_TSCR, "boss_arlokk could not accuire pMarkedTarget.");
m_uiMark_Timer = 15000;
}
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
index ce2fd0848f9..5e553c7396f 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
@@ -23,7 +23,8 @@ SDComment: Massive Geyser with knockback not working. Spell buggy.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_FROSTBREATH 16099
#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
index cdd45a3fa0d..8c71ea6d48d 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SPELL_AVARTAR 24646 //The Enrage Spell
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
index 9edd82c39b0..6cb657f4cff 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
@@ -23,7 +23,8 @@ SDComment: Blood siphon spell buggy cause of Core Issue.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SAY_AGGRO -1309020
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
index 27c46b8e0f2..bb3e0b14e0e 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SPELL_MANABURN 26046
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
index 7d2215f8311..156ccab5eae 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
@@ -23,7 +23,8 @@ SDComment: Problem in finding the right flying batriders for spawning and making
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SAY_AGGRO -1309002
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
index f4a17da56fb..f8d23947e9c 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
@@ -23,7 +23,8 @@ SDComment: Mind Control not working because of core bug. Shades visible for all.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SAY_AGGRO -1309014
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index cbe1178e6c4..32831eb047b 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -23,7 +23,8 @@ SDComment: Ohgan function needs improvements.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SAY_AGGRO -1309015
@@ -44,6 +45,8 @@ EndScriptData */
//Ohgans Spells
#define SPELL_SUNDERARMOR 24317
+#define NPC_SPEAKER 11391
+
class boss_mandokir : public CreatureScript
{
public:
@@ -78,6 +81,7 @@ class boss_mandokir : public CreatureScript
bool someWatched;
bool RaptorDead;
bool CombatStart;
+ bool SpeakerDead;
uint64 WatchTarget;
@@ -102,6 +106,7 @@ class boss_mandokir : public CreatureScript
endWatch = false;
RaptorDead = false;
CombatStart = false;
+ SpeakerDead = false;
DoCast(me, 23243);
}
@@ -128,19 +133,31 @@ class boss_mandokir : public CreatureScript
}
}
}
- DoCast(me, SPELL_LEVEL_UP, true);
- KillCount = 0;
+ DoCast(me, SPELL_LEVEL_UP, true);
+ KillCount = 0;
}
}
}
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
+ if (!SpeakerDead)
+ {
+ if (!me->FindNearestCreature(NPC_SPEAKER, 100.0f, true))
+ {
+ me->GetMotionMaster()->MovePoint(0, -12196.3f, -1948.37f, 130.36f);
+ SpeakerDead = true;
+ }
+ }
+
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && SpeakerDead)
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+
if (!UpdateVictim())
return;
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
index 44ab5d851f5..8e0deda1d0b 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
@@ -23,7 +23,8 @@ SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SAY_AGGRO -1309005
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
index 81260c28d73..32a8f209917 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SPELL_AMBUSH 24337
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
index 3da74d16dc3..29495f77f2a 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
@@ -23,7 +23,8 @@ SDComment: Almost finished.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SAY_AGGRO -1309009
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
index b22630f51bb..6cdb00236df 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "zulgurub.h"
#define SPELL_LIGHTNINGCLOUD 25033
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
index e3dd5d5933b..104d479383b 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
@@ -23,7 +23,8 @@ SDComment: Missing reset function after killing a boss for Ohgan, Thekal.
SDCategory: Zul'Gurub
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "zulgurub.h"
class instance_zulgurub : public InstanceMapScript
diff --git a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp
index e4b24dc00ee..b56727b18e1 100644
--- a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp
@@ -26,7 +26,8 @@ EndScriptData */
/* ContentData
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*void AddSC_alterac_mountains()
{
diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
index d4d35b107b2..b0d59fe8b5a 100644
--- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
+++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
@@ -27,7 +27,8 @@ EndScriptData */
npc_professor_phizzlethorpe
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp
index 2042e5313c3..3d8e68dfbf8 100644
--- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp
+++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_deathly_usher
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## npc_deathly_usher
diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
index 8749c943a6f..6a1ba633660 100644
--- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp
+++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
@@ -23,7 +23,8 @@ SDComment: Highlord Kruul are presumably no longer in-game on regular bases, how
SDCategory: Bosses
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_SHADOWVOLLEY 21341
#define SPELL_CLEAVE 20677
diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp
index b526246f670..eec747d6d73 100644
--- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp
+++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_ragged_john
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## npc_ragged_john
diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp
index 10cb5987ce5..e5af5344dc1 100644
--- a/src/server/scripts/EasternKingdoms/duskwood.cpp
+++ b/src/server/scripts/EasternKingdoms/duskwood.cpp
@@ -23,7 +23,8 @@ SDComment: Quest Support:8735
SDCategory: Duskwood
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Yells
{
diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp
index 0519ce94b32..7ca76e38fce 100644
--- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp
@@ -30,7 +30,9 @@ npc_darrowshire_spirit
npc_tirion_fordring
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
class mobs_ghoul_flayer : public CreatureScript
{
diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp
index 8ae72e142c8..d69ae3454b4 100644
--- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp
+++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp
@@ -31,7 +31,9 @@ npc_kelerun_bloodmourn
go_harbinger_second_trial
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp
index e40a2f785e6..9793c6fd31c 100644
--- a/src/server/scripts/EasternKingdoms/ghostlands.cpp
+++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp
@@ -30,7 +30,9 @@ npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp
index 8de895cb51f..a6d01f0ca93 100644
--- a/src/server/scripts/EasternKingdoms/hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp
@@ -28,7 +28,8 @@ npc_00x09hl
npc_rinji
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp
index 93a8d7423c9..2915ee1f3cb 100644
--- a/src/server/scripts/EasternKingdoms/ironforge.cpp
+++ b/src/server/scripts/EasternKingdoms/ironforge.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_royal_historian_archesonus
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## npc_royal_historian_archesonus
diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp
index 27d8ea3e51c..e448ccda14c 100644
--- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp
+++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp
@@ -28,7 +28,8 @@ npc_converted_sentry
npc_greengill_slave
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*######
## npc_converted_sentry
diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp
index 7ea8a62a5bd..4e3aaae71a1 100644
--- a/src/server/scripts/EasternKingdoms/loch_modan.cpp
+++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_mountaineer_pebblebitty
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## npc_mountaineer_pebblebitty
diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
index 3ade1da4a19..2473fec899a 100644
--- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
@@ -21,7 +21,8 @@ SD%Complete: 100%
SDComment: Support for quest 219.
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
enum eCorporalKeeshan
diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp
index e6595a83b66..954f21f73f5 100644
--- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp
+++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp
@@ -27,7 +27,8 @@ EndScriptData */
npc_blood_knight_stillblade
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*#######
# npc_blood_knight_stillblade
diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
index bc3110878de..c52e69787d4 100644
--- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
+++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
@@ -28,7 +28,8 @@ npc_deathstalker_erland
pyrewood_ambush
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
@@ -229,13 +230,11 @@ public:
{
if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
{
- Player* player = NULL;
Unit* target = NULL;
if (PlayerGUID)
{
- player = Unit::GetPlayer(*me, PlayerGUID);
- if (player)
- target = RAND((Unit*)me, (Unit*)player);
+ if (Unit* player = Unit::GetPlayer(*me, PlayerGUID)->ToUnit())
+ target = RAND((Unit*)me, player);
} else
target = me;
@@ -258,7 +257,7 @@ public:
void UpdateAI(const uint32 diff)
{
- //sLog->outString("DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer);
+ //sLog->outInfo(LOG_FILTER_TSCR, "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer);
if (!QuestInProgress)
return;
diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
index 96ad1da725d..560214d4085 100644
--- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
@@ -33,7 +33,9 @@ npc_marzon_silent_blade
npc_lord_gregor_lescovar
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp
index 03f92ce6d61..40f046a5075 100644
--- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp
+++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp
@@ -27,7 +27,8 @@ EndScriptData */
mob_yenniku
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*######
## mob_yenniku
diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
index 6507ec911c0..4c81380fb60 100644
--- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
+++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
index 4687fa3630f..70f9f93c7a7 100644
--- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
+++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
@@ -29,7 +29,8 @@ go_mausoleum_door
go_mausoleum_trigger
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*######
## npc_calvin_montague
diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp
index a9b627ded34..0d44db01592 100644
--- a/src/server/scripts/EasternKingdoms/undercity.cpp
+++ b/src/server/scripts/EasternKingdoms/undercity.cpp
@@ -29,7 +29,9 @@ npc_highborne_lamenter
npc_parqual_fintallas
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## npc_lady_sylvanas_windrunner
@@ -173,13 +175,13 @@ public:
if (me->GetDistance(victim) > 10.0f)
DoCast(victim, SPELL_MULTI_SHOT);
} else FadeTimer -= diff;
-
+
if (SummonSkeletonTimer <= diff)
{
DoCast(me, SPELL_SUMMON_SKELETON);
SummonSkeletonTimer = 20000 + rand()%10000;
} else SummonSkeletonTimer -= diff;
-
+
if (BlackArrowTimer <= diff)
{
if (Unit* victim = me->getVictim())
@@ -188,7 +190,7 @@ public:
BlackArrowTimer = 15000 + rand()%5000;
}
} else BlackArrowTimer -= diff;
-
+
if (ShotTimer <= diff)
{
if (Unit* victim = me->getVictim())
@@ -197,7 +199,7 @@ public:
ShotTimer = 8000 + rand()%2000;
}
} else ShotTimer -= diff;
-
+
if (MultiShotTimer <= diff)
{
if (Unit* victim = me->getVictim())
@@ -205,7 +207,7 @@ public:
DoCast(victim, SPELL_MULTI_SHOT);
MultiShotTimer = 10000 + rand()%3000;
}
- } else MultiShotTimer -= diff;
+ } else MultiShotTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp
index 0057c01b882..31dea10453a 100644
--- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp
@@ -30,7 +30,9 @@ npc_the_scourge_cauldron
npc_andorhal_tower
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp
index 46f1526c5bf..478c5f6c0d6 100644
--- a/src/server/scripts/EasternKingdoms/westfall.cpp
+++ b/src/server/scripts/EasternKingdoms/westfall.cpp
@@ -28,7 +28,8 @@ npc_daphne_stilwell
npc_defias_traitor
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp
index bf28d9838a4..34e6e7c9ddf 100644
--- a/src/server/scripts/EasternKingdoms/wetlands.cpp
+++ b/src/server/scripts/EasternKingdoms/wetlands.cpp
@@ -28,7 +28,8 @@ npc_mikhail
npc_tapoke_slim_jahn
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
@@ -59,12 +60,12 @@ public:
{
npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) { }
- bool m_bFriendSummoned;
+ bool IsFriendSummoned;
void Reset()
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
- m_bFriendSummoned = false;
+ IsFriendSummoned = false;
}
void WaypointReached(uint32 waypointId)
@@ -82,14 +83,12 @@ public:
void EnterCombat(Unit* /*who*/)
{
- Player* player = GetPlayerForEscort();
-
- if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_bFriendSummoned && player)
+ if (HasEscortState(STATE_ESCORT_ESCORTING) && !IsFriendSummoned && GetPlayerForEscort())
{
for (uint8 i = 0; i < 3; ++i)
DoCast(me, SPELL_CALL_FRIENDS, true);
- m_bFriendSummoned = true;
+ IsFriendSummoned = true;
}
}
diff --git a/src/server/scripts/Examples/example_commandscript.cpp b/src/server/scripts/Examples/example_commandscript.cpp
index 6b7a3d8def7..28ef021d599 100644
--- a/src/server/scripts/Examples/example_commandscript.cpp
+++ b/src/server/scripts/Examples/example_commandscript.cpp
@@ -23,7 +23,7 @@ Comment: Short custom scripting example
Category: Script Examples
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
#include "Chat.h"
// **** This script is designed as an example for others to build on ****
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp
index 7f75a0fb481..17b9aae732b 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -23,7 +23,9 @@ SDComment: Short custom scripting example
SDCategory: Script Examples
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
// **** This script is designed as an example for others to build on ****
// **** Please modify whatever you'd like to as this script is only for developement ****
diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index 851a32538e9..20e4c5614e9 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -23,7 +23,9 @@ SDComment: Script used for testing escortAI
SDCategory: Script Examples
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
enum eEnums
diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index 6d57f1ac798..a5627c68ff6 100644
--- a/src/server/scripts/Examples/example_gossip_codebox.cpp
+++ b/src/server/scripts/Examples/example_gossip_codebox.cpp
@@ -23,7 +23,9 @@ SDComment: Show a codebox in gossip option
SDCategory: Script Examples
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include <cstring>
enum eEnums
diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp
index d83a00ed82f..3aa4bac3f1e 100644
--- a/src/server/scripts/Examples/example_misc.cpp
+++ b/src/server/scripts/Examples/example_misc.cpp
@@ -23,7 +23,6 @@ SDComment: Item, Areatrigger and other small code examples
SDCategory: Script Examples
EndScriptData */
-#include "ScriptPCH.h"
#include "ScriptMgr.h"
enum eSay
diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp
index 70d7f43135c..cc27392919f 100644
--- a/src/server/scripts/Examples/example_spell.cpp
+++ b/src/server/scripts/Examples/example_spell.cpp
@@ -22,9 +22,10 @@
* and `ScriptName` is the name of a script assigned on registration
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Spells
{
@@ -80,19 +81,19 @@ class spell_ex_5581 : public SpellScriptLoader
{
// this hook is executed before anything about casting the spell is done
// after this hook is executed all the machinery starts
- sLog->outString("Caster just finished preparing the spell (cast bar has expired)");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Caster just finished preparing the spell (cast bar has expired)");
}
void HandleOnCast()
{
// cast is validated and spell targets are selected at this moment
// this is a last place when the spell can be safely interrupted
- sLog->outString("Spell is about to do take reagents, power, launch missile, do visuals and instant spell effects");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell is about to do take reagents, power, launch missile, do visuals and instant spell effects");
}
void HandleAfterCast()
{
- sLog->outString("All immediate Actions for the spell are finished now");
+ sLog->outInfo(LOG_FILTER_GENERAL, "All immediate Actions for the spell are finished now");
// this is a safe for triggering additional effects for a spell without interfering
// with visuals or with other effects of the spell
//GetCaster()->CastSpell(target, SPELL_TRIGGERED, true);
@@ -110,7 +111,7 @@ class spell_ex_5581 : public SpellScriptLoader
void HandleDummyLaunch(SpellEffIndex /*effIndex*/)
{
- sLog->outString("Spell %u with SPELL_EFFECT_DUMMY is just launched!", GetSpellInfo()->Id);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell %u with SPELL_EFFECT_DUMMY is just launched!", GetSpellInfo()->Id);
}
void HandleDummyLaunchTarget(SpellEffIndex /*effIndex*/)
@@ -119,17 +120,17 @@ class spell_ex_5581 : public SpellScriptLoader
if (Unit* unitTarget = GetHitUnit())
targetGUID = unitTarget->GetGUID();
// we're handling SPELL_EFFECT_DUMMY in effIndex 0 here
- sLog->outString("Spell %u with SPELL_EFFECT_DUMMY is just launched at it's target: " UI64FMTD "!", GetSpellInfo()->Id, targetGUID);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell %u with SPELL_EFFECT_DUMMY is just launched at it's target: " UI64FMTD "!", GetSpellInfo()->Id, targetGUID);
}
void HandleDummyHit(SpellEffIndex /*effIndex*/)
{
- sLog->outString("Spell %u with SPELL_EFFECT_DUMMY has hit!", GetSpellInfo()->Id);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell %u with SPELL_EFFECT_DUMMY has hit!", GetSpellInfo()->Id);
}
void HandleDummyHitTarget(SpellEffIndex /*effIndex*/)
{
- sLog->outString("SPELL_EFFECT_DUMMY is hits it's target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "SPELL_EFFECT_DUMMY is hits it's target!");
// make caster cast a spell on a unit target of effect
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_TRIGGERED, true);
@@ -137,23 +138,23 @@ class spell_ex_5581 : public SpellScriptLoader
void HandleBeforeHit()
{
- sLog->outString("Spell is about to hit target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell is about to hit target!");
}
void HandleOnHit()
{
- sLog->outString("Spell just hit target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell just hit target!");
}
void HandleAfterHit()
{
- sLog->outString("Spell just finished hitting target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell just finished hitting target!");
}
void FilterTargets(std::list<Unit*>& /*targetList*/)
{
// usually you want this call for Area Target spells
- sLog->outString("Spell is about to add targets from targetList to final targets!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Spell is about to add targets from targetList to final targets!");
}
// register functions used in spell script - names of these functions do not matter
@@ -228,20 +229,20 @@ class spell_ex_66244 : public SpellScriptLoader
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- sLog->outString("Aura Effect is about to be applied on target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Aura Effect is about to be applied on target!");
// this hook allows you to prevent execution of AuraEffect handler, or to replace it with your own handler
//PreventDefaultAction();
}
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- sLog->outString("Aura Effect is about to be removed from target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Aura Effect is about to be removed from target!");
// this hook allows you to prevent execution of AuraEffect handler, or to replace it with your own handler
//PreventDefaultAction();
}
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- sLog->outString("Aura Effect has just been applied on target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Aura Effect has just been applied on target!");
Unit* target = GetTarget();
// cast spell on target on aura apply
target->CastSpell(target, SPELL_TRIGGERED, true);
@@ -249,7 +250,7 @@ class spell_ex_66244 : public SpellScriptLoader
void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- sLog->outString("Aura Effect has just been just removed from target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Aura Effect has just been just removed from target!");
Unit* target = GetTarget();
Unit* caster = GetCaster();
// caster may be not avalible (logged out for example)
@@ -261,7 +262,7 @@ class spell_ex_66244 : public SpellScriptLoader
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
- sLog->outString("Perioidic Aura Effect is does a tick on target!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Perioidic Aura Effect is does a tick on target!");
Unit* target = GetTarget();
// aura targets damage self on tick
target->DealDamage(target, 100);
@@ -269,14 +270,14 @@ class spell_ex_66244 : public SpellScriptLoader
void HandleEffectPeriodicUpdate(AuraEffect* aurEff)
{
- sLog->outString("Perioidic Aura Effect is now updated!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Perioidic Aura Effect is now updated!");
// we're doubling aura amount every tick
aurEff->ChangeAmount(aurEff->GetAmount() * 2);
}
void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
- sLog->outString("Amount of Aura Effect is being calculated now!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Amount of Aura Effect is being calculated now!");
// we're setting amount to 100
amount = 100;
// amount will be never recalculated due to applying passive aura
@@ -285,7 +286,7 @@ class spell_ex_66244 : public SpellScriptLoader
void HandleEffectCalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
{
- sLog->outString("Periodic data of Aura Effect is being calculated now!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Periodic data of Aura Effect is being calculated now!");
// we're setting aura to be periodic and tick every 10 seconds
isPeriodic = true;
amplitude = 2 * IN_MILLISECONDS;
@@ -293,7 +294,7 @@ class spell_ex_66244 : public SpellScriptLoader
void HandleEffectCalcSpellMod(AuraEffect const* /*aurEff*/, SpellModifier*& spellMod)
{
- sLog->outString("SpellMod data of Aura Effect is being calculated now!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "SpellMod data of Aura Effect is being calculated now!");
// we don't want spellmod for example
if (spellMod)
{
@@ -366,14 +367,14 @@ class spell_ex_absorb_aura : public SpellScriptLoader
void HandleOnEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
- sLog->outString("Our aura is now absorbing damage done to us!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Our aura is now absorbing damage done to us!");
// absorb whole damage done to us
absorbAmount = dmgInfo.GetDamage();
}
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
{
- sLog->outString("Our aura has absorbed %u damage!", absorbAmount);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Our aura has absorbed %u damage!", absorbAmount);
}
// function registering
@@ -402,7 +403,7 @@ class spell_ex_463 : public SpellScriptLoader
bool CheckAreaTarget(Unit* target)
{
- sLog->outString("Area aura checks if unit is a valid target for it!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Area aura checks if unit is a valid target for it!");
// in our script we allow only players to be affected
return target->GetTypeId() == TYPEID_PLAYER;
}
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
index a86b2b8b17a..a70d05fa0ef 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
@@ -15,11 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "blackfathom_deeps.h"
#include "ScriptedEscortAI.h"
-enum eSpells
+enum Spells
{
SPELL_BLESSING_OF_BLACKFATHOM = 8733,
SPELL_RAVAGE = 8391,
@@ -94,11 +96,11 @@ public:
uint32 frostNovaTimer;
uint32 frostBoltVolleyTimer;
- bool bFlee;
+ bool Flee;
void Reset()
{
- bFlee = false;
+ Flee = false;
ravageTimer = urand(5000, 8000);
frostNovaTimer = urand(9000, 12000);
@@ -140,7 +142,7 @@ public:
{
if (ravageTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_RAVAGE);
+ DoCastVictim(SPELL_RAVAGE);
ravageTimer = urand(9000, 14000);
} else ravageTimer -= diff;
break;
@@ -148,9 +150,9 @@ public:
case NPC_MURKSHALLOW_SOFTSHELL:
case NPC_BARBED_CRUSTACEAN:
{
- if (!bFlee && HealthBelowPct(15))
+ if (!Flee && HealthBelowPct(15))
{
- bFlee = true;
+ Flee = true;
me->DoFleeToGetAssistance();
}
break;
@@ -160,10 +162,7 @@ public:
if (frostBoltVolleyTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- if (target)
- DoCast(target, SPELL_FROST_BOLT_VOLLEY);
- }
+ DoCast(target, SPELL_FROST_BOLT_VOLLEY);
frostBoltVolleyTimer = urand(5000, 8000);
}
else frostBoltVolleyTimer -= diff;
@@ -190,7 +189,7 @@ public:
};
};
-enum eMorridune
+enum Morridune
{
SAY_MORRIDUNE_1 = -1048003,
SAY_MORRIDUNE_2 = -1048004
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
index 32a6bcbde77..7071395812e 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackfathom_deeps.h"
enum Spells
@@ -42,14 +43,14 @@ public:
}
uint32 poisonCloudTimer;
- bool bIsEnraged;
+ bool IsEnraged;
InstanceScript* instance;
void Reset()
{
poisonCloudTimer = urand(5000, 9000);
- bIsEnraged = false;
+ IsEnraged = false;
if (instance)
instance->SetData(TYPE_AKU_MAI, NOT_STARTED);
}
@@ -77,10 +78,10 @@ public:
poisonCloudTimer = urand(25000, 50000);
} else poisonCloudTimer -= diff;
- if (!bIsEnraged && HealthBelowPct(30))
+ if (!IsEnraged && HealthBelowPct(30))
{
DoCast(me, SPELL_FRENZIED_RAGE);
- bIsEnraged = true;
+ IsEnraged = true;
}
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
index 5a60a849b75..1488772dc8a 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackfathom_deeps.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
index 7ee17172102..1c754b78672 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackfathom_deeps.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
index ea33499a960..236c7b1ba69 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Blackfathom Deeps
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "blackfathom_deeps.h"
#define MAX_ENCOUNTER 4
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
index 85f82c62079..222626240ea 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
@@ -15,42 +15,30 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "hyjal.h"
#include "hyjal_trash.h"
-#define SPELL_CARRION_SWARM 31306
-#define SPELL_SLEEP 31298
-#define SPELL_VAMPIRIC_AURA 38196
-#define SPELL_INFERNO 31299
-
-#define SAY_ONDEATH "The clock... is still... ticking."
-#define SOUND_ONDEATH 10982
-
-#define SAY_ONSLAY1 "Your hopes are lost!"
-#define SAY_ONSLAY2 "Scream for me!"
-#define SAY_ONSLAY3 "Pity, no time for a slow death!"
-#define SOUND_ONSLAY1 10981
-#define SOUND_ONSLAY2 11038
-#define SOUND_ONSLAY3 11039
-
-#define SAY_SWARM1 "The swarm is eager to feed!"
-#define SAY_SWARM2 "Pestilence upon you!"
-#define SOUND_SWARM1 10979
-#define SOUND_SWARM2 11037
-
-#define SAY_SLEEP1 "You look tired..."
-#define SAY_SLEEP2 "Sweet dreams..."
-#define SOUND_SLEEP1 10978
-#define SOUND_SLEEP2 11545
-
-#define SAY_INFERNO1 "Let fire rain from above!"
-#define SAY_INFERNO2 "Earth and sky shall burn!"
-#define SOUND_INFERNO1 10980
-#define SOUND_INFERNO2 11036
+enum Spells
+{
+ SPELL_CARRION_SWARM = 31306,
+ SPELL_SLEEP = 31298,
+ SPELL_VAMPIRIC_AURA = 38196,
+ SPELL_INFERNO = 31299,
+ SPELL_IMMOLATION = 31303,
+ SPELL_INFERNO_EFFECT = 31302,
+};
-#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!"
-#define SOUND_ONAGGRO 10977
+enum Texts
+{
+ SAY_ONDEATH = 0,
+ SAY_ONSLAY = 1,
+ SAY_SWARM = 2,
+ SAY_SLEEP = 3,
+ SAY_INFERNO = 4,
+ SAY_ONAGGRO = 5,
+};
class boss_anetheron : public CreatureScript
{
@@ -92,27 +80,12 @@ public:
{
if (instance && IsEvent)
instance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS);
- DoPlaySoundToSet(me, SOUND_ONAGGRO);
- me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
+ Talk(SAY_ONAGGRO);
}
void KilledUnit(Unit* /*victim*/)
{
- switch (urand(0, 2))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_ONSLAY1);
- me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_ONSLAY2);
- me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
- break;
- case 2:
- DoPlaySoundToSet(me, SOUND_ONSLAY3);
- me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_ONSLAY);
}
void WaypointReached(uint32 waypointId)
@@ -130,8 +103,7 @@ public:
hyjal_trashAI::JustDied(killer);
if (instance && IsEvent)
instance->SetData(DATA_ANETHERONEVENT, DONE);
- DoPlaySoundToSet(me, SOUND_ONDEATH);
- me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
+ Talk(SAY_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -169,17 +141,7 @@ public:
DoCast(target, SPELL_CARRION_SWARM);
SwarmTimer = urand(45000, 60000);
- switch (urand(0, 1))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_SWARM1);
- me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_SWARM2);
- me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_SWARM);
} else SwarmTimer -= diff;
if (SleepTimer <= diff)
@@ -190,17 +152,7 @@ public:
target->CastSpell(target, SPELL_SLEEP, true);
}
SleepTimer = 60000;
- switch (urand(0, 1))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_SLEEP1);
- me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_SLEEP2);
- me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_SLEEP);
} else SleepTimer -= diff;
if (AuraTimer <= diff)
{
@@ -211,17 +163,7 @@ public:
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
InfernoTimer = 45000;
- switch (urand(0, 1))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_INFERNO1);
- me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_INFERNO2);
- me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_INFERNO);
} else InfernoTimer -= diff;
DoMeleeAttackIfReady();
@@ -230,9 +172,6 @@ public:
};
-#define SPELL_IMMOLATION 31303
-#define SPELL_INFERNO_EFFECT 31302
-
class mob_towering_infernal : public CreatureScript
{
public:
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
index f07aaaa1f2a..ee988accbac 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
@@ -23,56 +23,57 @@ SDComment: Doomfires not completely offlike due to core limitations for random m
SDCategory: Caverns of Time, Mount Hyjal
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "hyjal.h"
#include "SpellAuras.h"
#include "hyjal_trash.h"
-//text id -1534018 are the text used when previous events complete. Not part of this script.
-#define SAY_AGGRO -1534019
-#define SAY_DOOMFIRE1 -1534020
-#define SAY_DOOMFIRE2 -1534021
-#define SAY_AIR_BURST1 -1534022
-#define SAY_AIR_BURST2 -1534023
-#define SAY_SLAY1 -1534024
-#define SAY_SLAY2 -1534025
-#define SAY_SLAY3 -1534026
-#define SAY_ENRAGE -1534027
-#define SAY_DEATH -1534028
-#define SAY_SOUL_CHARGE1 -1534029
-#define SAY_SOUL_CHARGE2 -1534030
-
-#define SPELL_DENOUEMENT_WISP 32124
-#define SPELL_ANCIENT_SPARK 39349
-#define SPELL_PROTECTION_OF_ELUNE 38528
-
-#define SPELL_DRAIN_WORLD_TREE 39140
-#define SPELL_DRAIN_WORLD_TREE_2 39141
-
-#define SPELL_FINGER_OF_DEATH 31984
-#define SPELL_HAND_OF_DEATH 35354
-#define SPELL_AIR_BURST 32014
-#define SPELL_GRIP_OF_THE_LEGION 31972
-#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures
-#define SPELL_DOOMFIRE_SPAWN 32074
-#define SPELL_DOOMFIRE 31945
-#define SPELL_SOUL_CHARGE_YELLOW 32045
-#define SPELL_SOUL_CHARGE_GREEN 32051
-#define SPELL_SOUL_CHARGE_RED 32052
-#define SPELL_UNLEASH_SOUL_YELLOW 32054
-#define SPELL_UNLEASH_SOUL_GREEN 32057
-#define SPELL_UNLEASH_SOUL_RED 32053
-#define SPELL_FEAR 31970
-
-#define CREATURE_ARCHIMONDE 17968
-#define CREATURE_DOOMFIRE 18095
-#define CREATURE_DOOMFIRE_SPIRIT 18104
-#define CREATURE_ANCIENT_WISP 17946
-#define CREATURE_CHANNEL_TARGET 22418
-
-#define NORDRASSIL_X 5503.713f
-#define NORDRASSIL_Y -3523.436f
-#define NORDRASSIL_Z 1608.781f
+enum Texts
+{
+ SAY_AGGRO = 1,
+ SAY_DOOMFIRE = 2,
+ SAY_AIR_BURST = 3,
+ SAY_SLAY = 4,
+ SAY_ENRAGE = 5,
+ SAY_DEATH = 6,
+ SAY_SOUL_CHARGE = 7,
+};
+
+enum Spells
+{
+ SPELL_DENOUEMENT_WISP = 32124,
+ SPELL_ANCIENT_SPARK = 39349,
+ SPELL_PROTECTION_OF_ELUNE = 38528,
+
+ SPELL_DRAIN_WORLD_TREE = 39140,
+ SPELL_DRAIN_WORLD_TREE_2 = 39141,
+
+ SPELL_FINGER_OF_DEATH = 31984,
+ SPELL_HAND_OF_DEATH = 35354,
+ SPELL_AIR_BURST = 32014,
+ SPELL_GRIP_OF_THE_LEGION = 31972,
+ SPELL_DOOMFIRE_STRIKE = 31903, //summons two creatures
+ SPELL_DOOMFIRE_SPAWN = 32074,
+ SPELL_DOOMFIRE = 31945,
+ SPELL_SOUL_CHARGE_YELLOW = 32045,
+ SPELL_SOUL_CHARGE_GREEN = 32051,
+ SPELL_SOUL_CHARGE_RED = 32052,
+ SPELL_UNLEASH_SOUL_YELLOW = 32054,
+ SPELL_UNLEASH_SOUL_GREEN = 32057,
+ SPELL_UNLEASH_SOUL_RED = 32053,
+ SPELL_FEAR = 31970,
+};
+
+enum Summons
+{
+ CREATURE_DOOMFIRE = 18095,
+ CREATURE_DOOMFIRE_SPIRIT = 18104,
+ CREATURE_ANCIENT_WISP = 17946,
+ CREATURE_CHANNEL_TARGET = 22418,
+};
+
+Position const NordrassilLoc = {5503.713f, -3523.436f, 1608.781f, 0.0f};
class mob_ancient_wisp : public CreatureScript
{
@@ -258,11 +259,11 @@ public:
uint32 GripOfTheLegionTimer;
uint32 DoomfireTimer;
uint32 SoulChargeTimer;
- uint32 SoulChargeCount;
+ uint8 SoulChargeCount;
uint32 MeleeRangeCheckTimer;
uint32 HandOfDeathTimer;
uint32 SummonWispTimer;
- uint32 WispCount;
+ uint8 WispCount;
uint32 EnrageTimer;
uint32 CheckDistanceTimer;
@@ -303,7 +304,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
DoZoneInCombat();
if (instance)
@@ -312,7 +313,7 @@ public:
void KilledUnit(Unit* victim)
{
- DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me);
+ Talk(SAY_SLAY);
if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
GainSoulCharge(CAST_PLR(victim));
@@ -346,7 +347,7 @@ public:
void JustDied(Unit* killer)
{
hyjal_trashAI::JustDied(killer);
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
if (instance)
instance->SetData(DATA_ARCHIMONDEEVENT, DONE);
@@ -488,7 +489,7 @@ public:
{
if (!IsChanneling)
{
- Creature* temp = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
+ Creature* temp = me->SummonCreature(CREATURE_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 1200000);
if (temp)
WorldTreeGUID = temp->GetGUID();
@@ -525,14 +526,14 @@ public:
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
Enraged = true;
- DoScriptText(SAY_ENRAGE, me);
+ Talk(SAY_ENRAGE);
}
} else EnrageTimer -= diff;
if (CheckDistanceTimer <= diff)
{
// To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature
- Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
+ Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 2000);
if (Check)
{
Check->SetVisible(false);
@@ -542,7 +543,7 @@ public:
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
Enraged = true;
- DoScriptText(SAY_ENRAGE, me);
+ Talk(SAY_ENRAGE);
}
}
CheckDistanceTimer = 5000;
@@ -598,11 +599,7 @@ public:
if (AirBurstTimer <= diff)
{
- if (urand(0, 1))
- DoScriptText(SAY_AIR_BURST1, me);
- else
- DoScriptText(SAY_AIR_BURST2, me);
-
+ Talk(SAY_AIR_BURST);
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank
AirBurstTimer = urand(25000, 40000);
} else AirBurstTimer -= diff;
@@ -615,11 +612,7 @@ public:
if (DoomfireTimer <= diff)
{
- if (urand(0, 1))
- DoScriptText(SAY_DOOMFIRE1, me);
- else
- DoScriptText(SAY_DOOMFIRE2, me);
-
+ Talk(SAY_DOOMFIRE);
Unit* temp = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!temp)
temp = me->getVictim();
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
index a9e0c866ab9..bfdaed35dd4 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
@@ -15,33 +15,31 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "hyjal.h"
#include "hyjal_trash.h"
-#define SPELL_RAIN_OF_FIRE 31340
-#define SPELL_DOOM 31347
-#define SPELL_HOWL_OF_AZGALOR 31344
-#define SPELL_CLEAVE 31345
-#define SPELL_BERSERK 26662
-
-#define SAY_ONDEATH "Your time is almost... up"
-#define SOUND_ONDEATH 11002
-
-#define SAY_ONSLAY1 "Reesh, hokta!"
-#define SAY_ONSLAY2 "Don't fight it"
-#define SAY_ONSLAY3 "No one is going to save you"
-#define SOUND_ONSLAY1 11001
-#define SOUND_ONSLAY2 11048
-#define SOUND_ONSLAY3 11047
-
-#define SAY_DOOM1 "Just a taste... of what awaits you"
-#define SAY_DOOM2 "Suffer you despicable insect!"
-#define SOUND_DOOM1 11046
-#define SOUND_DOOM2 11000
+enum Spells
+{
+ SPELL_RAIN_OF_FIRE = 31340,
+ SPELL_DOOM = 31347,
+ SPELL_HOWL_OF_AZGALOR = 31344,
+ SPELL_CLEAVE = 31345,
+ SPELL_BERSERK = 26662,
+
+ SPELL_THRASH = 12787,
+ SPELL_CRIPPLE = 31406,
+ SPELL_WARSTOMP = 31408,
+};
-#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!"
-#define SOUND_ONAGGRO 10999
+enum Texts
+{
+ SAY_ONDEATH = 0,
+ SAY_ONSLAY = 1,
+ SAY_DOOM = 2, // Not used?
+ SAY_ONAGGRO = 3,
+};
class boss_azgalor : public CreatureScript
{
@@ -88,27 +86,12 @@ public:
{
if (instance && IsEvent)
instance->SetData(DATA_AZGALOREVENT, IN_PROGRESS);
- DoPlaySoundToSet(me, SOUND_ONAGGRO);
- me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
+ Talk(SAY_ONAGGRO);
}
void KilledUnit(Unit* /*victim*/)
{
- switch (urand(0, 2))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_ONSLAY1);
- me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_ONSLAY2);
- me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
- break;
- case 2:
- DoPlaySoundToSet(me, SOUND_ONSLAY3);
- me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_ONSLAY);
}
void WaypointReached(uint32 waypointId)
@@ -126,7 +109,7 @@ public:
hyjal_trashAI::JustDied(killer);
if (instance && IsEvent)
instance->SetData(DATA_AZGALOREVENT, DONE);
- DoPlaySoundToSet(me, SOUND_ONDEATH);
+ Talk(SAY_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -196,10 +179,6 @@ public:
};
-#define SPELL_THRASH 12787
-#define SPELL_CRIPPLE 31406
-#define SPELL_WARSTOMP 31408
-
class mob_lesser_doomguard : public CreatureScript
{
public:
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
index 407faa19eaa..29eff68dfbd 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
@@ -15,30 +15,32 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "hyjal.h"
#include "hyjal_trash.h"
-#define SPELL_CLEAVE 31436
-#define SPELL_WARSTOMP 31480
-#define SPELL_MARK 31447
-
-#define SOUND_ONDEATH 11018
-
-#define SAY_ONSLAY1 "Shaza-Kiel!"
-#define SAY_ONSLAY2 "You... are nothing!"
-#define SAY_ONSLAY3 "Miserable nuisance!"
-#define SOUND_ONSLAY1 11017
-#define SOUND_ONSLAY2 11053
-#define SOUND_ONSLAY3 11054
+enum Spells
+{
+ SPELL_CLEAVE = 31436,
+ SPELL_WARSTOMP = 31480,
+ SPELL_MARK = 31447,
+ SPELL_MARK_DAMAGE = 31463
+};
-#define SAY_MARK1 "Your death will be a painful one."
-#define SAY_MARK2 "You... are marked."
-#define SOUND_MARK1 11016
-#define SOUND_MARK2 11052
+enum Texts
+{
+ SAY_ONSLAY = 0,
+ SAY_MARK = 1,
+ SAY_ONAGGRO = 2,
+};
-#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit."
-#define SOUND_ONAGGRO 11015
+enum Sounds
+{
+ SOUND_ONDEATH = 11018,
+};
class boss_kazrogal : public CreatureScript
{
@@ -80,27 +82,12 @@ public:
{
if (instance && IsEvent)
instance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
- DoPlaySoundToSet(me, SOUND_ONAGGRO);
- me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
+ Talk(SAY_ONAGGRO);
}
void KilledUnit(Unit* /*victim*/)
{
- switch (urand(0, 2))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_ONSLAY1);
- me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_ONSLAY2);
- me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
- break;
- case 2:
- DoPlaySoundToSet(me, SOUND_ONSLAY3);
- me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_ONSLAY);
}
void WaypointReached(uint32 waypointId)
@@ -162,37 +149,15 @@ public:
WarStompTimer = 60000;
} else WarStompTimer -= diff;
- if (me->HasAura(SPELL_MARK))
- me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
{
- //cast dummy, useful for bos addons
- me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
+ DoCastAOE(SPELL_MARK);
- std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
- for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
- {
- target->CastSpell(target, SPELL_MARK, true);//only cast on mana users
- }
- }
MarkTimerBase -= 5000;
if (MarkTimerBase < 5500)
MarkTimerBase = 5500;
MarkTimer = MarkTimerBase;
- switch (urand(0, 2))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_MARK1);
- me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_MARK2);
- me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_MARK);
} else MarkTimer -= diff;
DoMeleeAttackIfReady();
@@ -201,7 +166,79 @@ public:
};
+class MarkTargetFilter
+{
+ public:
+ bool operator()(WorldObject* target) const
+ {
+ if (Unit* unit = target->ToUnit())
+ return unit->getPowerType() != POWER_MANA;
+ return false;
+ }
+};
+
+class spell_mark_of_kazrogal : public SpellScriptLoader
+{
+ public:
+ spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { }
+
+ class spell_mark_of_kazrogal_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_mark_of_kazrogal_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if(MarkTargetFilter());
+ }
+
+ void Register()
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ }
+ };
+
+ class spell_mark_of_kazrogal_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mark_of_kazrogal_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void OnPeriodic(AuraEffect const* aurEff)
+ {
+ Unit* target = GetTarget();
+
+ if (target->GetPower(POWER_MANA) == 0)
+ {
+ target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff);
+ // Remove aura
+ SetDuration(0);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_mark_of_kazrogal_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_mark_of_kazrogal_AuraScript();
+ }
+};
+
void AddSC_boss_kazrogal()
{
new boss_kazrogal();
+ new spell_mark_of_kazrogal();
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
index 5d7ee1fe194..09c8c1605b3 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
@@ -15,36 +15,27 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "hyjal.h"
#include "hyjal_trash.h"
-#define SPELL_FROST_ARMOR 31256
-#define SPELL_DEATH_AND_DECAY 31258
-
-#define SPELL_FROST_NOVA 31250
-#define SPELL_ICEBOLT 31249
-
-#define SAY_ONDEATH "You have won this battle, but not... the... war"
-#define SOUND_ONDEATH 11026
-
-#define SAY_ONSLAY1 "All life must perish!"
-#define SAY_ONSLAY2 "Victory to the Legion!"
-#define SOUND_ONSLAY1 11025
-#define SOUND_ONSLAY2 11057
-
-#define SAY_DECAY1 "Crumble and rot!"
-#define SAY_DECAY2 "Ashes to ashes, dust to dust"
-#define SOUND_DECAY1 11023
-#define SOUND_DECAY2 11055
-
-#define SAY_NOVA1 "Succumb to the icy chill... of death!"
-#define SAY_NOVA2 "It will be much colder in your grave"
-#define SOUND_NOVA1 11024
-#define SOUND_NOVA2 11058
+enum Spells
+{
+ SPELL_FROST_ARMOR = 31256,
+ SPELL_DEATH_AND_DECAY = 31258,
+ SPELL_FROST_NOVA = 31250,
+ SPELL_ICEBOLT = 31249,
+};
-#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!"
-#define SOUND_ONAGGRO 11022
+enum Texts
+{
+ SAY_ONDEATH = 0,
+ SAY_ONSLAY = 1,
+ SAY_DECAY = 2,
+ SAY_NOVA = 3,
+ SAY_ONAGGRO = 4,
+};
class boss_rage_winterchill : public CreatureScript
{
@@ -86,23 +77,12 @@ public:
{
if (instance && IsEvent)
instance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
- DoPlaySoundToSet(me, SOUND_ONAGGRO);
- me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
+ Talk(SAY_ONAGGRO);
}
void KilledUnit(Unit* /*victim*/)
{
- switch (urand(0, 1))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_ONSLAY1);
- me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_ONSLAY2);
- me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_ONSLAY);
}
void WaypointReached(uint32 waypointId)
@@ -120,8 +100,7 @@ public:
hyjal_trashAI::JustDied(killer);
if (instance && IsEvent)
instance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
- DoPlaySoundToSet(me, SOUND_ONDEATH);
- me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
+ Talk(SAY_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -162,33 +141,13 @@ public:
{
DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY);
DecayTimer = 60000+rand()%20000;
- switch (urand(0, 1))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_DECAY1);
- me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_DECAY2);
- me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_DECAY);
} else DecayTimer -= diff;
if (NovaTimer <= diff)
{
DoCast(me->getVictim(), SPELL_FROST_NOVA);
NovaTimer = 30000+rand()%15000;
- switch (urand(0, 1))
- {
- case 0:
- DoPlaySoundToSet(me, SOUND_NOVA1);
- me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, 0);
- break;
- case 1:
- DoPlaySoundToSet(me, SOUND_NOVA2);
- me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, 0);
- break;
- }
+ Talk(SAY_NOVA);
} else NovaTimer -= diff;
if (IceboltTimer <= diff)
{
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
index 22307468f14..ee7ef383603 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
@@ -29,7 +29,9 @@ npc_thrall
npc_tyrande_whisperwind
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "hyjalAI.h"
#define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore."
@@ -69,7 +71,7 @@ public:
break;
case GOSSIP_ACTION_INFO_DEF:
ai->Debug = !ai->Debug;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: HyjalAI - Debug mode has been toggled");
+ sLog->outDebug(LOG_FILTER_TSCR, "HyjalAI - Debug mode has been toggled");
break;
}
return true;
@@ -146,7 +148,7 @@ public:
break;
case GOSSIP_ACTION_INFO_DEF:
ai->Debug = !ai->Debug;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: HyjalAI - Debug mode has been toggled");
+ sLog->outDebug(LOG_FILTER_TSCR, "HyjalAI - Debug mode has been toggled");
break;
}
return true;
@@ -220,11 +222,9 @@ public:
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
if (msg == EQUIP_ERR_OK)
- {
- Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true);
- if (item && player)
+ if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
player->SendNewItem(item, 1, true, false, true);
- }
+
player->SEND_GOSSIP_MENU(907, creature->GetGUID());
}
return true;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
index e045d3cbf05..6d62072608d 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
@@ -21,7 +21,7 @@
#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy."
-enum eTypes
+enum Types
{
WORLD_STATE_WAVES = 2842,
WORLD_STATE_ENEMY = 2453,
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index 2f6bbb7edb5..aa41fa992dc 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -23,17 +23,22 @@ SDComment:
SDCategory: Caverns of Time, Mount Hyjal
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedEscortAI.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "hyjalAI.h"
#include "hyjal_trash.h"
-#include "MapManager.h"
-#include "Language.h"
-#include "Chat.h"
-#include "Object.h"
-#define SPAWN_GARG_GATE 0
-#define SPAWN_WYRM_GATE 1
-#define SPAWN_NEAR_TOWER 2
+enum Spawns
+{
+ SPAWN_GARG_GATE = 0,
+ SPAWN_WYRM_GATE = 1,
+ SPAWN_NEAR_TOWER = 2,
+};
#define YELL_HURRY "Hurry, we don't have much time"
@@ -402,7 +407,7 @@ void hyjalAI::Reset()
instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0);
instance->SetData(DATA_RESET_TRASH_COUNT, 0);
}
- } else sLog->outError(ERROR_INST_DATA);
+ } else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
//Visibility
DoHide = true;
@@ -535,7 +540,7 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]
if (!instance)
{
- sLog->outError(ERROR_INST_DATA);
+ sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
return;
}
InfernalCount = 0;//reset infernal count every new wave
@@ -565,7 +570,7 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]
else
{
NextWaveTimer = 15000;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds");
+ sLog->outDebug(LOG_FILTER_TSCR, "HyjalAI: debug mode is enabled. Next Wave in 15 seconds");
}
}
else
@@ -609,7 +614,7 @@ uint32 hyjalAI::GetInstanceData(uint32 Event)
{
if (instance)
return instance->GetData(Event);
- else sLog->outError(ERROR_INST_DATA);
+ else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
return 0;
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
index b32288ca43a..68efa94d98b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
@@ -24,43 +24,49 @@
#define HYJAL_AI_MAX_SPELLS 3
-// Trash Mobs summoned in waves
-#define NECROMANCER 17899//done
-#define ABOMINATION 17898//done
-#define GHOUL 17895//done
-#define BANSHEE 17905//done
-#define CRYPT_FIEND 17897//done
-#define GARGOYLE 17906//done
-#define FROST_WYRM 17907//done
-#define GIANT_INFERNAL 17908//done
-#define FEL_STALKER 17916//done
-
-#define JAINA 17772
-#define THRALL 17852
-#define TYRANDE 17948
-
-#define ANCIENT_VEIN 185557
-#define FLAMEOBJECT 182592
-
-// Bosses summoned after every 8 waves
-#define RAGE_WINTERCHILL 17767
-#define ANETHERON 17808
-#define KAZROGAL 17888
-#define AZGALOR 17842
-#define ARCHIMONDE 17968
-
-#define SPELL_TELEPORT_VISUAL 41232
-#define SPELL_MASS_TELEPORT 16807
-
-//Spells for Jaina
-#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..)
-#define SPELL_BLIZZARD 31266
-#define SPELL_PYROBLAST 31263
-#define SPELL_SUMMON_ELEMENTALS 31264
-
-//Thrall spells
-#define SPELL_CHAIN_LIGHTNING 31330
-#define SPELL_SUMMON_DIRE_WOLF 31331
+enum CreaturesIds
+{
+ // Trash Mobs summoned in waves
+ NECROMANCER = 17899,
+ ABOMINATION = 17898,
+ GHOUL = 17895,
+ BANSHEE = 17905,
+ CRYPT_FIEND = 17897,
+ GARGOYLE = 17906,
+ FROST_WYRM = 17907,
+ GIANT_INFERNAL = 17908,
+ FEL_STALKER = 17916,
+
+ JAINA = 17772,
+ THRALL = 17852,
+ TYRANDE = 17948,
+
+ ANCIENT_VEIN = 185557,
+ FLAMEOBJECT = 182592,
+
+ // Bosses summoned after every 8 waves
+ RAGE_WINTERCHILL = 17767,
+ ANETHERON = 17808,
+ KAZROGAL = 17888,
+ AZGALOR = 17842,
+ ARCHIMONDE = 17968,
+};
+
+enum SpellIds
+{
+ SPELL_TELEPORT_VISUAL = 41232,
+ SPELL_MASS_TELEPORT = 16807,
+
+ //Spells for Jaina
+ SPELL_BRILLIANCE_AURA = 31260, // The database must handle this spell via creature_addon(it should, but is removed in evade..)
+ SPELL_BLIZZARD = 31266,
+ SPELL_PYROBLAST = 31263,
+ SPELL_SUMMON_ELEMENTALS = 31264,
+
+ //Thrall spells
+ SPELL_CHAIN_LIGHTNING = 31330,
+ SPELL_SUMMON_DIRE_WOLF = 31331,
+};
struct Wave
{
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
index 840aa5de081..01c1617aba4 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
@@ -15,16 +15,35 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "hyjal.h"
#include "hyjal_trash.h"
#include "hyjalAI.h"
-#define SPELL_METEOR 33814 //infernal visual
-#define SPELL_IMMOLATION 37059
-#define SPELL_FLAME_BUFFET 31724
-#define NPC_TRIGGER 21987 //World Trigger (Tiny)
-#define MODEL_INVIS 11686 //invisible model
+enum Spells
+{
+ SPELL_METEOR = 33814, //infernal visual
+ SPELL_IMMOLATION = 37059,
+ SPELL_FLAME_BUFFET = 31724,
+ NPC_TRIGGER = 21987, //World Trigger (Tiny)
+ MODEL_INVIS = 11686, //invisible model
+ SPELL_DISEASE_CLOUD = 31607,
+ SPELL_KNOCKDOWN = 31610,
+ SPELL_FRENZY = 31540,
+ SPELL_RAISE_DEAD_1 = 31617,
+ SPELL_RAISE_DEAD_2 = 31624,
+ SPELL_RAISE_DEAD_3 = 31625,
+ SPELL_SHADOW_BOLT = 31627,
+ SPELL_BANSHEE_CURSE = 31651,
+ SPELL_BANSHEE_WAIL = 38183,
+ SPELL_ANTI_MAGIC_SHELL = 31662,
+ SPELL_WEB = 28991,
+ SPELL_MANA_BURN = 31729,
+ SPELL_FROST_BREATH = 31688,
+ SPELL_GARGOYLE_STRIKE = 31664,
+ SPELL_EXPLODING_SHOT = 7896,
+};
float HordeWPs[8][3]=//basic waypoints from spawn to leader
{
@@ -522,9 +541,6 @@ public:
}
};
-#define SPELL_DISEASE_CLOUD 31607
-#define SPELL_KNOCKDOWN 31610
-
class mob_abomination : public CreatureScript
{
public:
@@ -623,8 +639,6 @@ public:
};
-#define SPELL_FRENZY 31540
-
class mob_ghoul : public CreatureScript
{
public:
@@ -727,11 +741,6 @@ public:
};
-#define SPELL_RAISE_DEAD_1 31617
-#define SPELL_RAISE_DEAD_2 31624
-#define SPELL_RAISE_DEAD_3 31625
-#define SPELL_SHADOW_BOLT 31627
-
class mob_necromancer : public CreatureScript
{
public:
@@ -859,10 +868,6 @@ public:
};
-#define SPELL_BANSHEE_CURSE 31651
-#define SPELL_BANSHEE_WAIL 38183
-#define SPELL_ANTI_MAGIC_SHELL 31662
-
class mob_banshee : public CreatureScript
{
public:
@@ -966,8 +971,6 @@ public:
};
-#define SPELL_WEB 28991
-
class mob_crypt_fiend : public CreatureScript
{
public:
@@ -1058,8 +1061,6 @@ public:
};
-#define SPELL_MANA_BURN 31729
-
class mob_fel_stalker : public CreatureScript
{
public:
@@ -1150,8 +1151,6 @@ public:
};
-#define SPELL_FROST_BREATH 31688
-
class mob_frost_wyrm : public CreatureScript
{
public:
@@ -1264,8 +1263,6 @@ public:
};
-#define SPELL_GARGOYLE_STRIKE 31664
-
class mob_gargoyle : public CreatureScript
{
public:
@@ -1402,8 +1399,6 @@ public:
};
-#define SPELL_EXPLODING_SHOT 7896
-
class alliance_rifleman : public CreatureScript
{
public:
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
index ad8ebdb370a..caff71c7320 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
@@ -23,15 +23,16 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter
SDCategory: Caverns of Time, Mount Hyjal
EndScriptData */
-#include "ScriptPCH.h"
-#include "hyjal.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
+#include "ScriptedCreature.h"
#include "hyjal_trash.h"
-enum eEnums
+enum Misc
{
MAX_ENCOUNTER = 5,
- GO_ANCIENT_GEM = 185557
+ GO_ANCIENT_GEM = 185557,
};
/* Battle of Mount Hyjal encounters:
0 - Rage Winterchill event
@@ -272,7 +273,7 @@ public:
break;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)", type, data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Hyjal: Instance data updated for event %u (Data=%u)", type, data);
if (data == DONE)
{
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
index b2853f25a33..7b468cb7fe5 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
@@ -23,7 +23,8 @@ SDComment: TODO: Intro, consecutive attacks to a random target durin time wrap,
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "culling_of_stratholme.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
index ccf60f9bd0b..56d07a49dc4 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "culling_of_stratholme.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
index a038a06f815..88b2a766671 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
@@ -23,7 +23,8 @@ SDComment: TODO: Intro & outro
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "culling_of_stratholme.h"
enum Spells
@@ -35,6 +36,7 @@ enum Spells
SPELL_SLEEP = 52721, //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target.
H_SPELL_SLEEP = 58849,
SPELL_VAMPIRIC_TOUCH = 52723, //Heals the caster for half the damage dealt by a melee attack.
+ SPELL_MAL_GANIS_KILL_CREDIT = 58124, // Quest credit
SPELL_KILL_CREDIT = 58630 // Non-existing spell as encounter credit, created in spell_dbc
};
@@ -237,9 +239,9 @@ public:
if (instance)
{
instance->SetData(DATA_MAL_GANIS_EVENT, DONE);
-
+ DoCastAOE(SPELL_MAL_GANIS_KILL_CREDIT);
// give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
- DoCast(me, SPELL_KILL_CREDIT);
+ DoCastAOE(SPELL_KILL_CREDIT);
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
index d5dd597960f..8e80af66379 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
@@ -23,7 +23,8 @@ SDComment: It may need timer adjustment
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "culling_of_stratholme.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
index 7828d172e1e..d23957ddf81 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
@@ -23,7 +23,8 @@ SDComment: TODO: Intro
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "culling_of_stratholme.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
index 6454083e424..e74ba833908 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
@@ -15,9 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "culling_of_stratholme.h"
#include "ScriptedEscortAI.h"
+#include "PassiveAI.h"
enum Says
{
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
index b232cae4657..ea02e8f50b5 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "CreatureTextMgr.h"
#include "culling_of_stratholme.h"
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp
index 5b47c2ee07d..161ea4ba8b7 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp
@@ -23,7 +23,8 @@ SDComment: Some spells not implemented
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "dark_portal.h"
enum eEnums
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
index a4e805b3b75..8fc7f31e766 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
@@ -23,7 +23,8 @@ SDComment: All abilities not implemented
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "dark_portal.h"
enum eEnums
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp
index f59c9f0ef4c..0256a099580 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp
@@ -23,7 +23,8 @@ SDComment: More abilities need to be implemented
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "dark_portal.h"
enum eEnums
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
index c2a41cb29d1..ee8c4d1bae1 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
@@ -29,7 +29,9 @@ npc_time_rift
npc_saat
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "dark_portal.h"
#define SAY_ENTER -1269020 //where does this belong?
@@ -324,7 +326,7 @@ public:
uint32 entry = 0;
entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount];
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).", mRiftWaveCount, entry);
+ sLog->outDebug(LOG_FILTER_TSCR, "npc_time_rift: summoning wave Creature (Wave %u, Entry %u).", mRiftWaveCount, entry);
++mRiftWaveCount;
@@ -349,7 +351,7 @@ public:
if (me->IsNonMeleeSpellCasted(false))
return;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_time_rift: not casting anylonger, i need to die.");
+ sLog->outDebug(LOG_FILTER_TSCR, "npc_time_rift: not casting anylonger, i need to die.");
me->setDeathState(JUST_DIED);
if (instance->GetData(TYPE_RIFT) == IN_PROGRESS)
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
index 2c8cd096644..da34eff7b77 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
@@ -23,7 +23,8 @@ SDComment: Quest support: 9836, 10297. Currently in progress.
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "dark_portal.h"
#define MAX_ENCOUNTER 2
@@ -192,7 +193,7 @@ public:
{
if (data == IN_PROGRESS)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Starting event.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Dark Portal: Starting event.");
InitWorldState();
m_auiEncounter[1] = IN_PROGRESS;
NextPortal_Timer = 15000;
@@ -201,7 +202,7 @@ public:
if (data == DONE)
{
//this may be completed further out in the post-event
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Event completed.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Dark Portal: Event completed.");
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
@@ -266,7 +267,7 @@ public:
if (entry == RIFT_BOSS)
entry = RandRiftBoss();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Summoning rift boss entry %u.", entry);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Dark Portal: Summoning rift boss entry %u.", entry);
Position pos;
me->GetRandomNearPosition(pos, 10.0f);
@@ -277,7 +278,7 @@ public:
if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
return NULL;
}
@@ -290,7 +291,7 @@ public:
if (tmp >= CurrentRiftId)
++tmp;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).", tmp, CurrentRiftId);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).", tmp, CurrentRiftId);
CurrentRiftId = tmp;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
index c27507cdcec..96cfba0007b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
@@ -23,7 +23,8 @@ SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + s
SDCategory: Caverns of Time, Old Hillsbrad Foothills
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "old_hillsbrad.h"
#define SAY_ENTER -1560000
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
index 82bd0a9e9be..ab0f10bdfe0 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
@@ -23,7 +23,8 @@ SDComment: Missing spawns pre-event, missing speech to be coordinated with rest
SDCategory: Caverns of Time, Old Hillsbrad Foothills
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "old_hillsbrad.h"
#define SAY_ENTER1 -1560013
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
index 45825a81eb2..534c831814e 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
@@ -23,7 +23,8 @@ SDComment: Missing proper code for patrolling area after being spawned. Script f
SDCategory: Caverns of Time, Old Hillsbrad Foothills
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "old_hillsbrad.h"
#include "ScriptedEscortAI.h"
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
index b179a15e878..7f7cbeaf566 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
@@ -23,7 +23,9 @@ SDComment: If thrall escort fail, all parts will reset. In future, save sub-part
SDCategory: Caverns of Time, Old Hillsbrad Foothills
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "old_hillsbrad.h"
#define MAX_ENCOUNTER 6
@@ -83,7 +85,7 @@ public:
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -123,7 +125,7 @@ public:
if (!player)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
@@ -139,7 +141,7 @@ public:
++mBarrelCount;
DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u", mBarrelCount);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u", mBarrelCount);
m_auiEncounter[0] = IN_PROGRESS;
@@ -160,7 +162,7 @@ public:
{
++mThrallEventCount;
m_auiEncounter[1] = NOT_STARTED;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.", mThrallEventCount);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.", mThrallEventCount);
m_auiEncounter[2] = NOT_STARTED;
m_auiEncounter[3] = NOT_STARTED;
m_auiEncounter[4] = NOT_STARTED;
@@ -173,29 +175,29 @@ public:
m_auiEncounter[3] = data;
m_auiEncounter[4] = data;
m_auiEncounter[5] = data;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.", mThrallEventCount);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.", mThrallEventCount);
}
}
else
m_auiEncounter[1] = data;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.", data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall escort event adjusted to data %u.", data);
break;
}
case TYPE_THRALL_PART1:
m_auiEncounter[2] = data;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.", data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall event part I adjusted to data %u.", data);
break;
case TYPE_THRALL_PART2:
m_auiEncounter[3] = data;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.", data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall event part II adjusted to data %u.", data);
break;
case TYPE_THRALL_PART3:
m_auiEncounter[4] = data;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.", data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall event part III adjusted to data %u.", data);
break;
case TYPE_THRALL_PART4:
m_auiEncounter[5] = data;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.", data);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.", data);
break;
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
index 7d9da6771dc..3690e87354d 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
@@ -29,7 +29,9 @@ npc_thrall_old_hillsbrad
npc_taretha
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "old_hillsbrad.h"
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
index d7043965271..b23d15cd1b5 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
@@ -46,15 +47,15 @@ public:
{
celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 Wrath_Timer;
- uint32 EntanglingRoots_Timer;
- uint32 CorruptForces_Timer;
+ uint32 WrathTimer;
+ uint32 EntanglingRootsTimer;
+ uint32 CorruptForcesTimer;
void Reset()
{
- Wrath_Timer = 8000;
- EntanglingRoots_Timer = 2000;
- CorruptForces_Timer = 30000;
+ WrathTimer = 8000;
+ EntanglingRootsTimer = 2000;
+ CorruptForcesTimer = 30000;
}
void EnterCombat(Unit* /*who*/) { }
@@ -70,32 +71,30 @@ public:
return;
//Wrath
- if (Wrath_Timer <= diff)
+ if (WrathTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_WRATH);
- Wrath_Timer = 8000;
+ WrathTimer = 8000;
}
- else Wrath_Timer -= diff;
+ else WrathTimer -= diff;
//EntanglingRoots
- if (EntanglingRoots_Timer <= diff)
+ if (EntanglingRootsTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS);
- EntanglingRoots_Timer = 20000;
+ DoCastVictim(SPELL_ENTANGLINGROOTS);
+ EntanglingRootsTimer = 20000;
}
- else EntanglingRoots_Timer -= diff;
+ else EntanglingRootsTimer -= diff;
//CorruptForces
- if (CorruptForces_Timer <= diff)
+ if (CorruptForcesTimer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_CORRUPT_FORCES);
- CorruptForces_Timer = 20000;
+ CorruptForcesTimer = 20000;
}
- else CorruptForces_Timer -= diff;
+ else CorruptForcesTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
index ea419793ae8..b4128ea80ee 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
@@ -46,15 +47,15 @@ public:
{
boss_landslideAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 KnockAway_Timer;
- uint32 Trample_Timer;
- uint32 Landslide_Timer;
+ uint32 KnockAwayTimer;
+ uint32 TrampleTimer;
+ uint32 LandslideTimer;
void Reset()
{
- KnockAway_Timer = 8000;
- Trample_Timer = 2000;
- Landslide_Timer = 0;
+ KnockAwayTimer = 8000;
+ TrampleTimer = 2000;
+ LandslideTimer = 0;
}
void EnterCombat(Unit* /*who*/)
@@ -66,32 +67,32 @@ public:
if (!UpdateVictim())
return;
- //KnockAway_Timer
- if (KnockAway_Timer <= diff)
+ //KnockAwayTimer
+ if (KnockAwayTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_KNOCKAWAY);
- KnockAway_Timer = 15000;
+ DoCastVictim(SPELL_KNOCKAWAY);
+ KnockAwayTimer = 15000;
}
- else KnockAway_Timer -= diff;
+ else KnockAwayTimer -= diff;
- //Trample_Timer
- if (Trample_Timer <= diff)
+ //TrampleTimer
+ if (TrampleTimer <= diff)
{
DoCast(me, SPELL_TRAMPLE);
- Trample_Timer = 8000;
+ TrampleTimer = 8000;
}
- else Trample_Timer -= diff;
+ else TrampleTimer -= diff;
//Landslide
if (HealthBelowPct(50))
{
- if (Landslide_Timer <= diff)
+ if (LandslideTimer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_LANDSLIDE);
- Landslide_Timer = 60000;
+ LandslideTimer = 60000;
}
- else Landslide_Timer -= diff;
+ else LandslideTimer -= diff;
}
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
index 18ce7be0f0a..ece3ff83776 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+
enum Spells
{
SPELL_TOXICVOLLEY = 21687,
@@ -44,24 +46,22 @@ public:
{
boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 ToxicVolley_Timer;
- uint32 Uppercut_Timer;
- uint32 Adds_Timer;
- uint32 Invisible_Timer;
+ uint32 ToxicVolleyTimer;
+ uint32 UppercutTimer;
+ uint32 AddsTimer;
+ uint32 InvisibleTimer;
bool Invisible;
void Reset()
{
- ToxicVolley_Timer = 7000;
- Uppercut_Timer = 16000;
- Adds_Timer = 19000;
- Invisible_Timer = 15000; //Too much too low?
+ ToxicVolleyTimer = 7000;
+ UppercutTimer = 16000;
+ AddsTimer = 19000;
+ InvisibleTimer = 15000; //Too much too low?
Invisible = false;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void SummonAdds(Unit* victim)
{
@@ -71,7 +71,7 @@ public:
void UpdateAI(const uint32 diff)
{
- if (Invisible && Invisible_Timer <= diff)
+ if (Invisible && InvisibleTimer <= diff)
{
//Become visible again
me->setFaction(14);
@@ -83,7 +83,7 @@ public:
}
else if (Invisible)
{
- Invisible_Timer -= diff;
+ InvisibleTimer -= diff;
//Do nothing while invisible
return;
}
@@ -92,24 +92,24 @@ public:
if (!UpdateVictim())
return;
- //ToxicVolley_Timer
- if (ToxicVolley_Timer <= diff)
+ //ToxicVolleyTimer
+ if (ToxicVolleyTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_TOXICVOLLEY);
- ToxicVolley_Timer = 9000;
+ DoCastVictim(SPELL_TOXICVOLLEY);
+ ToxicVolleyTimer = 9000;
}
- else ToxicVolley_Timer -= diff;
+ else ToxicVolleyTimer -= diff;
- //Uppercut_Timer
- if (Uppercut_Timer <= diff)
+ //UppercutTimer
+ if (UppercutTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_UPPERCUT);
- Uppercut_Timer = 12000;
+ DoCastVictim(SPELL_UPPERCUT);
+ UppercutTimer = 12000;
}
- else Uppercut_Timer -= diff;
+ else UppercutTimer -= diff;
- //Adds_Timer
- if (!Invisible && Adds_Timer <= diff)
+ //AddsTimer
+ if (!Invisible && AddsTimer <= diff)
{
//Interrupt any spell casting
//me->m_canMove = true;
@@ -124,11 +124,11 @@ public:
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
Invisible = true;
- Invisible_Timer = 15000;
+ InvisibleTimer = 15000;
- Adds_Timer = 40000;
+ AddsTimer = 40000;
}
- else Adds_Timer -= diff;
+ else AddsTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
index 039d30071d2..26e1f77bf48 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedCreature.h"
enum Spells
{
@@ -47,17 +49,17 @@ public:
{
boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 Dustfield_Timer;
- uint32 Boulder_Timer;
- uint32 Thrash_Timer;
- uint32 RepulsiveGaze_Timer;
+ uint32 DustfieldTimer;
+ uint32 BoulderTimer;
+ uint32 ThrashTimer;
+ uint32 RepulsiveGazeTimer;
void Reset()
{
- Dustfield_Timer = 8000;
- Boulder_Timer = 2000;
- Thrash_Timer = 5000;
- RepulsiveGaze_Timer = 23000;
+ DustfieldTimer = 8000;
+ BoulderTimer = 2000;
+ ThrashTimer = 5000;
+ RepulsiveGazeTimer = 23000;
}
void EnterCombat(Unit* /*who*/) {}
@@ -72,40 +74,38 @@ public:
if (!UpdateVictim())
return;
- //Dustfield_Timer
- if (Dustfield_Timer <= diff)
+ //DustfieldTimer
+ if (DustfieldTimer <= diff)
{
DoCast(me, SPELL_DUSTFIELD);
- Dustfield_Timer = 14000;
+ DustfieldTimer = 14000;
}
- else Dustfield_Timer -= diff;
+ else DustfieldTimer -= diff;
- //Boulder_Timer
- if (Boulder_Timer <= diff)
+ //BoulderTimer
+ if (BoulderTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_BOULDER);
- Boulder_Timer = 10000;
+ BoulderTimer = 10000;
}
- else Boulder_Timer -= diff;
+ else BoulderTimer -= diff;
- //RepulsiveGaze_Timer
- if (RepulsiveGaze_Timer <= diff)
+ //RepulsiveGazeTimer
+ if (RepulsiveGazeTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_REPULSIVEGAZE);
- RepulsiveGaze_Timer = 20000;
+ DoCastVictim(SPELL_REPULSIVEGAZE);
+ RepulsiveGazeTimer = 20000;
}
- else RepulsiveGaze_Timer -= diff;
+ else RepulsiveGazeTimer -= diff;
- //Thrash_Timer
- if (Thrash_Timer <= diff)
+ //ThrashTimer
+ if (ThrashTimer <= diff)
{
DoCast(me, SPELL_THRASH);
- Thrash_Timer = 18000;
+ ThrashTimer = 18000;
}
- else Thrash_Timer -= diff;
+ else ThrashTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index 6e6e089ba02..c243682cc61 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -25,19 +25,27 @@ SDComment: <Known bugs>
SDCategory: Onyxia's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
#include "onyxias_lair.h"
-enum eYells
+enum Yells
{
- SAY_AGGRO = -1249000,
- SAY_KILL = -1249001,
- SAY_PHASE_2_TRANS = -1249002,
- SAY_PHASE_3_TRANS = -1249003,
- EMOTE_BREATH = -1249004,
+ // Say
+ SAY_AGGRO = 0,
+ SAY_KILL = 1,
+ SAY_PHASE_2_TRANS = 2,
+ SAY_PHASE_3_TRANS = 3,
+
+ // Emote
+ EMOTE_BREATH = 4,
};
-enum eSpells
+enum Spells
{
// Phase 1 spells
SPELL_WING_BUFFET = 18500,
@@ -67,15 +75,15 @@ enum eSpells
SPELL_BELLOWING_ROAR = 18431,
};
-struct sOnyxMove
+struct OnyxMove
{
- uint32 uiLocId;
- uint32 uiLocIdEnd;
- uint32 uiSpellId;
+ uint8 LocId;
+ uint8 LocIdEnd;
+ uint32 SpellId;
float fX, fY, fZ;
};
-static sOnyxMove aMoveData[]=
+static OnyxMove MoveData[8]=
{
{0, 1, SPELL_BREATH_WEST_TO_EAST, -33.5561f, -182.682f, -56.9457f}, //west
{1, 0, SPELL_BREATH_EAST_TO_WEST, -31.4963f, -250.123f, -55.1278f}, //east
@@ -87,11 +95,11 @@ static sOnyxMove aMoveData[]=
{7, 6, SPELL_BREATH_NORTH_TO_SOUTH, 22.8763f, -217.152f, -55.0548f}, //north
};
-const Position MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f};
+Position const MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f};
-const Position Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f};
+Position const Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f};
-static Position aSpawnLocations[3]=
+Position const SpawnLocations[3]=
{
//Whelps
{-30.127f, -254.463f, -89.440f, 0.0f},
@@ -121,65 +129,65 @@ public:
InstanceScript* instance;
SummonList Summons;
- uint32 m_uiPhase;
+ uint32 Phase;
- uint32 m_uiFlameBreathTimer;
- uint32 m_uiCleaveTimer;
- uint32 m_uiTailSweepTimer;
- uint32 m_uiWingBuffetTimer;
+ uint32 FlameBreathTimer;
+ uint32 CleaveTimer;
+ uint32 TailSweepTimer;
+ uint32 WingBuffetTimer;
- uint32 m_uiMovePoint;
- uint32 m_uiMovementTimer;
- sOnyxMove* m_pPointData;
+ uint8 MovePoint;
+ uint32 MovementTimer;
+ OnyxMove* PointData;
- uint32 m_uiFireballTimer;
- uint32 m_uiWhelpTimer;
- uint32 m_uiLairGuardTimer;
- uint32 m_uiDeepBreathTimer;
+ uint32 FireballTimer;
+ uint32 WhelpTimer;
+ uint32 LairGuardTimer;
+ uint32 DeepBreathTimer;
- uint32 m_uiBellowingRoarTimer;
+ uint32 BellowingRoarTimer;
- uint8 m_uiSummonWhelpCount;
- bool m_bIsMoving;
+ uint8 SummonWhelpCount;
+ bool IsMoving;
void Reset()
{
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
- m_uiPhase = PHASE_START;
+ Phase = PHASE_START;
- m_uiFlameBreathTimer = urand(10000, 20000);
- m_uiTailSweepTimer = urand(15000, 20000);
- m_uiCleaveTimer = urand(2000, 5000);
- m_uiWingBuffetTimer = urand(10000, 20000);
+ FlameBreathTimer = urand(10000, 20000);
+ TailSweepTimer = urand(15000, 20000);
+ CleaveTimer = urand(2000, 5000);
+ WingBuffetTimer = urand(10000, 20000);
- m_uiMovePoint = urand(0, 5);
- m_uiMovementTimer = 14000;
- m_pPointData = GetMoveData();
+ MovePoint = urand(0, 5);
+ MovementTimer = 14000;
+ PointData = GetMoveData();
- m_uiFireballTimer = 15000;
- m_uiWhelpTimer = 60000;
- m_uiLairGuardTimer = 60000;
- m_uiDeepBreathTimer = 85000;
+ FireballTimer = 15000;
+ WhelpTimer = 60000;
+ LairGuardTimer = 60000;
+ DeepBreathTimer = 85000;
- m_uiBellowingRoarTimer = 30000;
+ BellowingRoarTimer = 30000;
Summons.DespawnAll();
- m_uiSummonWhelpCount = 0;
- m_bIsMoving = false;
+ SummonWhelpCount = 0;
+ IsMoving = false;
if (instance)
{
instance->SetData(DATA_ONYXIA, NOT_STARTED);
- instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
}
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
me->SetInCombatWithZone();
if (instance)
@@ -206,7 +214,7 @@ public:
switch (summoned->GetEntry())
{
case NPC_WHELP:
- ++m_uiSummonWhelpCount;
+ ++SummonWhelpCount;
break;
case NPC_LAIRGUARD:
summoned->setActive(true);
@@ -222,20 +230,20 @@ public:
void KilledUnit(Unit* /*victim*/)
{
- DoScriptText(SAY_KILL, me);
+ Talk(SAY_KILL);
}
- void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell)
+ void SpellHit(Unit* /*pCaster*/, const SpellInfo* Spell)
{
- if (pSpell->Id == SPELL_BREATH_EAST_TO_WEST ||
- pSpell->Id == SPELL_BREATH_WEST_TO_EAST ||
- pSpell->Id == SPELL_BREATH_SE_TO_NW ||
- pSpell->Id == SPELL_BREATH_NW_TO_SE ||
- pSpell->Id == SPELL_BREATH_SW_TO_NE ||
- pSpell->Id == SPELL_BREATH_NE_TO_SW)
+ if (Spell->Id == SPELL_BREATH_EAST_TO_WEST ||
+ Spell->Id == SPELL_BREATH_WEST_TO_EAST ||
+ Spell->Id == SPELL_BREATH_SE_TO_NW ||
+ Spell->Id == SPELL_BREATH_NW_TO_SE ||
+ Spell->Id == SPELL_BREATH_SW_TO_NE ||
+ Spell->Id == SPELL_BREATH_NE_TO_SW)
{
- m_pPointData = GetMoveData();
- m_uiMovePoint = m_pPointData->uiLocIdEnd;
+ PointData = GetMoveData();
+ MovePoint = PointData->LocIdEnd;
me->SetSpeed(MOVE_FLIGHT, 1.5f);
me->GetMotionMaster()->MovePoint(8, MiddleRoomLocation);
@@ -249,56 +257,56 @@ public:
switch (id)
{
case 8:
- m_pPointData = GetMoveData();
- if (m_pPointData)
+ PointData = GetMoveData();
+ if (PointData)
{
me->SetSpeed(MOVE_FLIGHT, 1.0f);
- me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+ me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
}
break;
case 9:
me->GetMotionMaster()->MoveChase(me->getVictim());
- m_uiBellowingRoarTimer = 1000;
+ BellowingRoarTimer = 1000;
break;
case 10:
me->SetCanFly(true);
me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25);
me->SetSpeed(MOVE_FLIGHT, 1.0f);
- DoScriptText(SAY_PHASE_2_TRANS, me);
+ Talk(SAY_PHASE_2_TRANS);
if (instance)
- instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
- m_uiWhelpTimer = 5000;
- m_uiLairGuardTimer = 15000;
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
+ WhelpTimer = 5000;
+ LairGuardTimer = 15000;
break;
case 11:
- if (m_pPointData)
- me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+ if (PointData)
+ me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
break;
default:
- m_bIsMoving = false;
+ IsMoving = false;
break;
}
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* pSpell)
+ void SpellHitTarget(Unit* target, const SpellInfo* Spell)
{
//Workaround - Couldn't find a way to group this spells (All Eruption)
- if (((pSpell->Id >= 17086 && pSpell->Id <= 17095) ||
- (pSpell->Id == 17097) ||
- (pSpell->Id >= 18351 && pSpell->Id <= 18361) ||
- (pSpell->Id >= 18564 && pSpell->Id <= 18576) ||
- (pSpell->Id >= 18578 && pSpell->Id <= 18607) ||
- (pSpell->Id == 18609) ||
- (pSpell->Id >= 18611 && pSpell->Id <= 18628) ||
- (pSpell->Id >= 21132 && pSpell->Id <= 21133) ||
- (pSpell->Id >= 21135 && pSpell->Id <= 21139) ||
- (pSpell->Id >= 22191 && pSpell->Id <= 22202) ||
- (pSpell->Id >= 22267 && pSpell->Id <= 22268)) &&
+ if (((Spell->Id >= 17086 && Spell->Id <= 17095) ||
+ (Spell->Id == 17097) ||
+ (Spell->Id >= 18351 && Spell->Id <= 18361) ||
+ (Spell->Id >= 18564 && Spell->Id <= 18576) ||
+ (Spell->Id >= 18578 && Spell->Id <= 18607) ||
+ (Spell->Id == 18609) ||
+ (Spell->Id >= 18611 && Spell->Id <= 18628) ||
+ (Spell->Id >= 21132 && Spell->Id <= 21133) ||
+ (Spell->Id >= 21135 && Spell->Id <= 21139) ||
+ (Spell->Id >= 22191 && Spell->Id <= 22202) ||
+ (Spell->Id >= 22267 && Spell->Id <= 22268)) &&
(target->GetTypeId() == TYPEID_PLAYER))
{
if (instance)
@@ -308,14 +316,14 @@ public:
}
}
- sOnyxMove* GetMoveData()
+ OnyxMove* GetMoveData()
{
- uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove);
+ uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove);
- for (uint32 i = 0; i < uiMaxCount; ++i)
+ for (uint8 i = 0; i < MaxCount; ++i)
{
- if (aMoveData[i].uiLocId == m_uiMovePoint)
- return &aMoveData[i];
+ if (MoveData[i].LocId == MovePoint)
+ return &MoveData[i];
}
return NULL;
@@ -323,84 +331,84 @@ public:
void SetNextRandomPoint()
{
- uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove);
+ uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove);
- uint32 iTemp = rand()%(uiMaxCount-1);
+ uint8 iTemp = urand(0, MaxCount-1);
- if (iTemp >= m_uiMovePoint)
+ if (iTemp >= MovePoint)
++iTemp;
- m_uiMovePoint = iTemp;
+ MovePoint = iTemp;
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(const uint32 Diff)
{
if (!UpdateVictim())
return;
//Common to PHASE_START && PHASE_END
- if (m_uiPhase == PHASE_START || m_uiPhase == PHASE_END)
+ if (Phase == PHASE_START || Phase == PHASE_END)
{
//Specific to PHASE_START || PHASE_END
- if (m_uiPhase == PHASE_START)
+ if (Phase == PHASE_START)
{
if (HealthBelowPct(60))
{
SetCombatMovement(false);
- m_uiPhase = PHASE_BREATH;
+ Phase = PHASE_BREATH;
me->GetMotionMaster()->MovePoint(10, Phase2Location);
return;
}
}
else
{
- if (m_uiBellowingRoarTimer <= uiDiff)
+ if (BellowingRoarTimer <= Diff)
{
DoCastVictim(SPELL_BELLOWING_ROAR);
// Eruption
- GameObject* pFloor = NULL;
+ GameObject* Floor = NULL;
Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15);
- Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, pFloor, check);
+ Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, Floor, check);
me->VisitNearbyGridObject(30, searcher);
- if (instance && pFloor)
- instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID());
- m_uiBellowingRoarTimer = 30000;
+ if (instance && Floor)
+ instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID());
+ BellowingRoarTimer = 30000;
}
else
- m_uiBellowingRoarTimer -= uiDiff;
+ BellowingRoarTimer -= Diff;
}
- if (m_uiFlameBreathTimer <= uiDiff)
+ if (FlameBreathTimer <= Diff)
{
DoCastVictim(SPELL_FLAME_BREATH);
- m_uiFlameBreathTimer = urand(10000, 20000);
+ FlameBreathTimer = urand(10000, 20000);
}
else
- m_uiFlameBreathTimer -= uiDiff;
+ FlameBreathTimer -= Diff;
- if (m_uiTailSweepTimer <= uiDiff)
+ if (TailSweepTimer <= Diff)
{
DoCastAOE(SPELL_TAIL_SWEEP);
- m_uiTailSweepTimer = urand(15000, 20000);
+ TailSweepTimer = urand(15000, 20000);
}
else
- m_uiTailSweepTimer -= uiDiff;
+ TailSweepTimer -= Diff;
- if (m_uiCleaveTimer <= uiDiff)
+ if (CleaveTimer <= Diff)
{
DoCastVictim(SPELL_CLEAVE);
- m_uiCleaveTimer = urand(2000, 5000);
+ CleaveTimer = urand(2000, 5000);
}
else
- m_uiCleaveTimer -= uiDiff;
+ CleaveTimer -= Diff;
- if (m_uiWingBuffetTimer <= uiDiff)
+ if (WingBuffetTimer <= Diff)
{
DoCastVictim(SPELL_WING_BUFFET);
- m_uiWingBuffetTimer = urand(15000, 30000);
+ WingBuffetTimer = urand(15000, 30000);
}
else
- m_uiWingBuffetTimer -= uiDiff;
+ WingBuffetTimer -= Diff;
DoMeleeAttackIfReady();
}
@@ -408,86 +416,86 @@ public:
{
if (HealthBelowPct(40))
{
- m_uiPhase = PHASE_END;
+ Phase = PHASE_END;
if (instance)
- instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
- DoScriptText(SAY_PHASE_3_TRANS, me);
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
+ Talk(SAY_PHASE_3_TRANS);
SetCombatMovement(true);
me->SetCanFly(false);
- m_bIsMoving = false;
+ IsMoving = false;
me->GetMotionMaster()->MovePoint(9, me->GetHomePosition());
return;
}
- if (m_uiDeepBreathTimer <= uiDiff)
+ if (DeepBreathTimer <= Diff)
{
- if (!m_bIsMoving)
+ if (!IsMoving)
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
- DoScriptText(EMOTE_BREATH, me);
- DoCast(me, m_pPointData->uiSpellId);
- m_uiDeepBreathTimer = 70000;
+ Talk(EMOTE_BREATH);
+ DoCast(me, PointData->SpellId);
+ DeepBreathTimer = 70000;
}
}
else
- m_uiDeepBreathTimer -= uiDiff;
+ DeepBreathTimer -= Diff;
- if (m_uiMovementTimer <= uiDiff)
+ if (MovementTimer <= Diff)
{
- if (!m_bIsMoving)
+ if (!IsMoving)
{
SetNextRandomPoint();
- m_pPointData = GetMoveData();
+ PointData = GetMoveData();
- if (!m_pPointData)
+ if (!PointData)
return;
- me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
- m_bIsMoving = true;
- m_uiMovementTimer = 25000;
+ me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
+ IsMoving = true;
+ MovementTimer = 25000;
}
}
else
- m_uiMovementTimer -= uiDiff;
+ MovementTimer -= Diff;
- if (m_uiFireballTimer <= uiDiff)
+ if (FireballTimer <= Diff)
{
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FIREBALL);
- m_uiFireballTimer = 8000;
+ FireballTimer = 8000;
}
}
else
- m_uiFireballTimer -= uiDiff;
+ FireballTimer -= Diff;
- if (m_uiLairGuardTimer <= uiDiff)
+ if (LairGuardTimer <= Diff)
{
- me->SummonCreature(NPC_LAIRGUARD, aSpawnLocations[2].GetPositionX(), aSpawnLocations[2].GetPositionY(), aSpawnLocations[2].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
- m_uiLairGuardTimer = 30000;
+ me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN);
+ LairGuardTimer = 30000;
}
else
- m_uiLairGuardTimer -= uiDiff;
+ LairGuardTimer -= Diff;
- if (m_uiWhelpTimer <= uiDiff)
+ if (WhelpTimer <= Diff)
{
- me->SummonCreature(NPC_WHELP, aSpawnLocations[0].GetPositionX(), aSpawnLocations[0].GetPositionY(), aSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
- me->SummonCreature(NPC_WHELP, aSpawnLocations[1].GetPositionX(), aSpawnLocations[1].GetPositionY(), aSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
- if (m_uiSummonWhelpCount >= RAID_MODE(20, 40))
+ me->SummonCreature(NPC_WHELP, SpawnLocations[0], TEMPSUMMON_CORPSE_DESPAWN);
+ me->SummonCreature(NPC_WHELP, SpawnLocations[1], TEMPSUMMON_CORPSE_DESPAWN);
+ if (SummonWhelpCount >= RAID_MODE(20, 40))
{
- m_uiSummonWhelpCount = 0;
- m_uiWhelpTimer = 90000;
+ SummonWhelpCount = 0;
+ WhelpTimer = 90000;
}
else
- m_uiWhelpTimer = 500;
+ WhelpTimer = 500;
}
else
- m_uiWhelpTimer -= uiDiff;
+ WhelpTimer -= Diff;
}
}
};
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
index 1c599ce7c6f..0689a8872bb 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
@@ -22,7 +22,12 @@ SDComment:
SDCategory: Onyxia's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
#include "onyxias_lair.h"
class instance_onyxias_lair : public InstanceMapScript
@@ -44,27 +49,27 @@ public:
std::map<uint64, uint32> FloorEruptionGUID[2];
std::queue<uint64> FloorEruptionGUIDQueue;
- uint64 m_uiOnyxiasGUID;
- uint32 m_uiOnyxiaLiftoffTimer;
- uint32 m_uiManyWhelpsCounter;
- uint32 m_uiEruptTimer;
+ uint64 OnyxiasGUID;
+ uint32 OnyxiaLiftoffTimer;
+ uint32 ManyWhelpsCounter;
+ uint32 EruptTimer;
- uint8 m_auiEncounter[MAX_ENCOUNTER];
+ uint8 Encounter[MAX_ENCOUNTER];
- bool m_bAchievManyWhelpsHandleIt;
- bool m_bAchievSheDeepBreathMore;
+ bool AchievManyWhelpsHandleIt;
+ bool AchievSheDeepBreathMore;
void Initialize()
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ memset(&Encounter, 0, sizeof(Encounter));
- m_uiOnyxiasGUID = 0;
- m_uiOnyxiaLiftoffTimer = 0;
- m_uiManyWhelpsCounter = 0;
- m_bAchievManyWhelpsHandleIt = false;
- m_bAchievSheDeepBreathMore = true;
+ OnyxiasGUID = 0;
+ OnyxiaLiftoffTimer = 0;
+ ManyWhelpsCounter = 0;
+ AchievManyWhelpsHandleIt = false;
+ AchievSheDeepBreathMore = true;
- m_uiEruptTimer = 0;
+ EruptTimer = 0;
}
void OnCreatureCreate(Creature* creature)
@@ -72,7 +77,7 @@ public:
switch (creature->GetEntry())
{
case NPC_ONYXIA:
- m_uiOnyxiasGUID = creature->GetGUID();
+ OnyxiasGUID = creature->GetGUID();
break;
}
}
@@ -93,7 +98,7 @@ public:
if (Creature* temp = go->SummonCreature(NPC_WHELP, goPos, TEMPSUMMON_CORPSE_DESPAWN))
{
temp->SetInCombatWithZone();
- ++m_uiManyWhelpsCounter;
+ ++ManyWhelpsCounter;
}
break;
}
@@ -139,88 +144,88 @@ public:
FloorEruptionGUID[1].erase(floorEruptedGUID);
}
- void SetData(uint32 uiType, uint32 uiData)
+ void SetData(uint32 Type, uint32 Data)
{
- switch (uiType)
+ switch (Type)
{
case DATA_ONYXIA:
- m_auiEncounter[0] = uiData;
- if (uiData == IN_PROGRESS)
+ Encounter[0] = Data;
+ if (Data == IN_PROGRESS)
SetData(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS);
break;
case DATA_ONYXIA_PHASE:
- if (uiData == PHASE_BREATH) //Used to mark the liftoff phase
+ if (Data == PHASE_BREATH) //Used to mark the liftoff phase
{
- m_bAchievManyWhelpsHandleIt = false;
- m_uiManyWhelpsCounter = 0;
- m_uiOnyxiaLiftoffTimer = 10*IN_MILLISECONDS;
+ AchievManyWhelpsHandleIt = false;
+ ManyWhelpsCounter = 0;
+ OnyxiaLiftoffTimer = 10*IN_MILLISECONDS;
}
break;
case DATA_SHE_DEEP_BREATH_MORE:
- if (uiData == IN_PROGRESS)
+ if (Data == IN_PROGRESS)
{
- m_bAchievSheDeepBreathMore = true;
+ AchievSheDeepBreathMore = true;
}
- else if (uiData == FAIL)
+ else if (Data == FAIL)
{
- m_bAchievSheDeepBreathMore = false;
+ AchievSheDeepBreathMore = false;
}
break;
}
- if (uiType < MAX_ENCOUNTER && uiData == DONE)
+ if (Type < MAX_ENCOUNTER && Data == DONE)
SaveToDB();
}
- void SetData64(uint32 uiType, uint64 uiData)
+ void SetData64(uint32 Type, uint64 Data)
{
- switch (uiType)
+ switch (Type)
{
case DATA_FLOOR_ERUPTION_GUID:
FloorEruptionGUID[1] = FloorEruptionGUID[0];
- FloorEruptionGUIDQueue.push(uiData);
- m_uiEruptTimer = 2500;
+ FloorEruptionGUIDQueue.push(Data);
+ EruptTimer = 2500;
break;
}
}
- uint32 GetData(uint32 uiType)
+ uint32 GetData(uint32 Type)
{
- switch (uiType)
+ switch (Type)
{
case DATA_ONYXIA:
- return m_auiEncounter[0];
+ return Encounter[0];
}
return 0;
}
- uint64 GetData64(uint32 uiData)
+ uint64 GetData64(uint32 Data)
{
- switch (uiData)
+ switch (Data)
{
case DATA_ONYXIA_GUID:
- return m_uiOnyxiasGUID;
+ return OnyxiasGUID;
}
return 0;
}
- void Update(uint32 uiDiff)
+ void Update(uint32 Diff)
{
if (GetData(DATA_ONYXIA) == IN_PROGRESS)
{
- if (m_uiOnyxiaLiftoffTimer && m_uiOnyxiaLiftoffTimer <= uiDiff)
+ if (OnyxiaLiftoffTimer && OnyxiaLiftoffTimer <= Diff)
{
- m_uiOnyxiaLiftoffTimer = 0;
- if (m_uiManyWhelpsCounter >= 50)
- m_bAchievManyWhelpsHandleIt = true;
- } else m_uiOnyxiaLiftoffTimer -= uiDiff;
+ OnyxiaLiftoffTimer = 0;
+ if (ManyWhelpsCounter >= 50)
+ AchievManyWhelpsHandleIt = true;
+ } else OnyxiaLiftoffTimer -= Diff;
}
if (!FloorEruptionGUIDQueue.empty())
{
- if (m_uiEruptTimer <= uiDiff)
+ if (EruptTimer <= Diff)
{
uint32 treeHeight = 0;
do
@@ -229,10 +234,10 @@ public:
FloorEruption(FloorEruptionGUIDQueue.front());
FloorEruptionGUIDQueue.pop();
} while (!FloorEruptionGUIDQueue.empty() && (*FloorEruptionGUID[1].find(FloorEruptionGUIDQueue.front())).second == treeHeight);
- m_uiEruptTimer = 1000;
+ EruptTimer = 1000;
}
else
- m_uiEruptTimer -= uiDiff;
+ EruptTimer -= Diff;
}
}
@@ -242,10 +247,10 @@ public:
{
case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER: // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s
case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER: // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s
- return m_bAchievManyWhelpsHandleIt;
+ return AchievManyWhelpsHandleIt;
case ACHIEV_CRITERIA_DEEP_BREATH_10_PLAYER: // Criteria for achievement 4404: She Deep Breaths More (10 player) Everybody evade Deep Breath
case ACHIEV_CRITERIA_DEEP_BREATH_25_PLAYER: // Criteria for achievement 4407: She Deep Breaths More (25 player) Everybody evade Deep Breath
- return m_bAchievSheDeepBreathMore;
+ return AchievSheDeepBreathMore;
}
return false;
}
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
index eaf6cac43af..26fd9284ea2 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
@@ -18,13 +18,13 @@
#ifndef DEF_ONYXIAS_LAIR_H
#define DEF_ONYXIAS_LAIR_H
-enum eData64
+enum Data64
{
DATA_ONYXIA_GUID,
DATA_FLOOR_ERUPTION_GUID
};
-enum eInstanceData
+enum InstanceData
{
DATA_ONYXIA,
MAX_ENCOUNTER,
@@ -34,7 +34,7 @@ enum eInstanceData
DATA_MANY_WHELPS_COUNT
};
-enum eCreatures
+enum Creatures
{
NPC_WHELP = 11262,
NPC_LAIRGUARD = 36561,
@@ -42,20 +42,20 @@ enum eCreatures
NPC_ONYXIA = 10184
};
-enum eOnyxiaPhases
+enum OnyxiaPhases
{
PHASE_START = 1,
PHASE_BREATH = 2,
PHASE_END = 3
};
-enum eGameObjects
+enum GameObjects
{
GO_WHELP_SPAWNER = 176510,
GO_WHELP_EGG = 176511
};
-enum eAchievementData
+enum AchievementData
{
ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER = 12565, // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s
ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER = 12568, // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
index bda5267713d..44f9aa1184a 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Razorfen Downs
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_AGGRO -1129000
#define SAY_SUMMON60 -1129001
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
index 8b138468f4c..a0a8bb02d90 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "razorfen_downs.h"
#define MAX_ENCOUNTER 1
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index b84ecea4de3..3a147007fce 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_henry_stern
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "razorfen_downs.h"
/*###
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
index 98395305d57..cce0f8b180e 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Razorfen Kraul
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "razorfen_kraul.h"
#define WARD_KEEPERS_NR 2
@@ -63,7 +64,7 @@ public:
return player;
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
index 43e3fe6efdd..374059c46ac 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
@@ -27,7 +27,8 @@ EndScriptData */
npc_willix
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "razorfen_kraul.h"
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
index 459dc87a9b8..40d4d5d54b4 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
@@ -23,7 +23,8 @@ SDComment: Place Holder
SDCategory: Ruins of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ruins_of_ahnqiraj.h"
enum Yells
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
index 18a77519ba2..c05613d387f 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ruins_of_ahnqiraj.h"
enum Texts
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
index 91c0110abd5..e9bb8be67b7 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
@@ -23,7 +23,8 @@ SDComment: Place holder
SDCategory: Ruins of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ruins_of_ahnqiraj.h"
enum Yells
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
index d4549242a4c..2dbd52f7e42 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "ruins_of_ahnqiraj.h"
class instance_ruins_of_ahnqiraj : public InstanceMapScript
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
index 36b1871c96e..0b78b5f9ab2 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
#define SPELL_CLEAVE 26350
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index 11efccd14b7..95c6d033aab 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
@@ -23,7 +23,8 @@ SDComment: Darkglare tracking issue
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
/*
@@ -180,7 +181,7 @@ public:
{
instance = creature->GetInstanceScript();
if (!instance)
- sLog->outError("TSCR: No Instance eye_of_cthunAI");
+ sLog->outError(LOG_FILTER_TSCR, "No Instance eye_of_cthunAI");
}
InstanceScript* instance;
@@ -486,7 +487,7 @@ public:
instance = creature->GetInstanceScript();
if (!instance)
- sLog->outError("TSCR: No Instance eye_of_cthunAI");
+ sLog->outError(LOG_FILTER_TSCR, "No Instance eye_of_cthunAI");
}
InstanceScript* instance;
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
index 613bc91182b..5ebce2f04e2 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
@@ -23,7 +23,8 @@ SDComment: sound not implemented
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SOUND_SENTENCE_YOU 8588
#define SOUND_SERVE_TO 8589
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
index 53fac3ee3ec..83af40c57f2 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define EMOTE_GENERIC_FRENZY_KILL -1000001
#define EMOTE_GENERIC_BERSERK -1000004
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
index 81205780e7d..f7acf28dba3 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
@@ -23,7 +23,8 @@ SDComment: No model for submerging. Currently just invisible.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
#define SPELL_SWEEP 26103
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
index 8c6c0fa0ad0..02554bbe6b3 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_AGGRO -1531008
#define SAY_SLAY -1531009
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
index 4df4bf73330..36388cfbe9c 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
@@ -23,7 +23,8 @@ SDComment: Mind Control buggy.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
#include "Group.h"
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
index abaab9d830e..b85999042dd 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
#include "WorldPacket.h"
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
index 7b30200b0b3..d0e97bc36c8 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
@@ -23,7 +23,8 @@ SDComment: place holder
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_POISON_SHOCK 25993
#define SPELL_POISONBOLT_VOLLEY 25991
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
index f1cc0b401c3..887ca4f3ad5 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "temple_of_ahnqiraj.h"
class instance_temple_of_ahnqiraj : public InstanceMapScript
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
index 556247d85af..5bb65454e0a 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
@@ -23,7 +23,8 @@ SDComment: Shadow storm is not properly implemented in core it should only targe
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "WorldPacket.h"
#include "Item.h"
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
index e61e20c35bc..1bb5c1180bd 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
@@ -23,7 +23,8 @@ SDComment: Everything seems to work, still need some checking
SDCategory: Wailing Caverns
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "wailing_caverns.h"
#define MAX_ENCOUNTER 9
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
index 7e93cc7e4c7..0d4efac4321 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
@@ -26,7 +26,9 @@ EndScriptData */
/* ContentData
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "wailing_caverns.h"
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
index b6c69584358..3a6a3f6241c 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "zulfarrak.h"
#define NPC_GAHZRILLA 7273
@@ -118,6 +119,18 @@ public:
void Initialize()
{
GahzRillaEncounter = NOT_STARTED;
+ ZumrahGUID = 0;
+ BlyGUID = 0;
+ WeegliGUID = 0;
+ OroGUID = 0;
+ RavenGUID = 0;
+ MurtaGUID = 0;
+ EndDoorGUID = 0;
+ PyramidPhase = 0;
+ major_wave_Timer = 0;
+ minor_wave_Timer = 0;
+ addGroupSize = 0;
+ waypoint = 0;
}
void OnCreatureCreate(Creature* creature)
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
index 9e3d9240321..03e3756f964 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
@@ -28,7 +28,9 @@ npc_sergeant_bly
npc_weegli_blastfuse
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "zulfarrak.h"
/*######
diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp
index e28665c038e..6a9dd77433a 100644
--- a/src/server/scripts/Kalimdor/ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/ashenvale.cpp
@@ -169,15 +169,15 @@ class npc_torek : public CreatureScript
# npc_ruul_snowhoof
####*/
-enum RuulSnowhoof
-{
+enum RuulSnowhoof
+{
NPC_THISTLEFUR_URSA = 3921,
NPC_THISTLEFUR_TOTEMIC = 3922,
NPC_THISTLEFUR_PATHFINDER = 3926,
-
+
QUEST_FREEDOM_TO_RUUL = 6482,
- GO_CAGE = 178147
+ GO_CAGE = 178147
};
Position const RuulSnowhoofSummonsCoord[6] =
@@ -447,7 +447,7 @@ class npc_muglash : public CreatureScript
DoScriptText(SAY_MUG_START1, creature);
creature->setFaction(113);
- pEscortAI->Start(true, true, player->GetGUID());
+ pEscortAI->Start(true, false, player->GetGUID());
}
}
return true;
diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp
index eae5baa8db2..8d08c26f0a7 100644
--- a/src/server/scripts/Kalimdor/azshara.cpp
+++ b/src/server/scripts/Kalimdor/azshara.cpp
@@ -182,9 +182,9 @@ public:
enum RizzleSprysprocketData
{
QUEST_CHASING_THE_MOONSTONE = 10994,
-
+
MOB_DEPTH_CHARGE = 23025,
-
+
SPELL_RIZZLE_BLACKJACK = 39865,
SPELL_RIZZLE_ESCAPE = 39871,
SPELL_RIZZLE_FROST_GRENADE = 40525,
@@ -490,7 +490,7 @@ public:
{
if (WeMustDieTimer <= diff)
me->DespawnOrUnsummon();
- else
+ else
WeMustDieTimer -= diff;
}
return;
diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp
index 608117ca9af..96e67c8de47 100644
--- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp
@@ -549,8 +549,8 @@ public:
(*itr)->Respawn();
}
}
- else
- sLog->outError("SD2 ERROR: FlagList is empty!");
+ else
+ sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: FlagList is empty!");
}
void UpdateAI(const uint32 diff)
@@ -560,7 +560,7 @@ public:
if (EventStarted)
SayTimer = NextStep(Step++);
}
- else
+ else
SayTimer -= diff;
}
};
diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
index 45e1c1808c1..5800a6a58a0 100644
--- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
@@ -25,7 +25,6 @@ EndScriptData */
/* ContentData
mobs_risen_husk_spirit
-npc_deserter_agitator
npc_lady_jaina_proudmoore
npc_nat_pagle
npc_private_hendel
@@ -132,93 +131,7 @@ class mobs_risen_husk_spirit : public CreatureScript
};
/*######
-## npc_deserter_agitator
-######*/
-
-enum Deserter
-{
- QUEST_TRAITORS_AMONG_US = 11126,
- NPC_THERAMORE_DESERTER = 23602,
-};
-
-const Position DeserterDisappearPos = {-3609.03f, -4332.91f, 9.39354f, 3.73862f};
-
-#define GOSSIP_ITEM_DESERTER "Your propaganda wont`t work on me. Spout your treasonous filth elsewhere traitor!"
-
-class npc_deserter_agitator : public CreatureScript
-{
-public:
- npc_deserter_agitator() : CreatureScript("npc_deserter_agitator") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_TRAITORS_AMONG_US) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DESERTER, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
-
- if (action == GOSSIP_SENDER_INFO)
- {
- player->CLOSE_GOSSIP_MENU();
- switch (urand(0, 1))
- {
- case 0:
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- creature->setFaction(14);
- creature->AI()->AttackStart(player);
- break;
- case 1:
- player->KilledMonsterCredit(NPC_THERAMORE_DESERTER, 0);
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- creature->SetSpeed(MOVE_RUN, creature->GetSpeedRate(MOVE_RUN), true);
- creature->setFaction(35);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
- creature->SetReactState(REACT_PASSIVE);
- creature->GetMotionMaster()->MovePoint(1, DeserterDisappearPos);
- break;
- }
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_deserter_agitatorAI(creature);
- }
-
- struct npc_deserter_agitatorAI : public ScriptedAI
- {
- npc_deserter_agitatorAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset()
- {
- me->RestoreFaction();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
- me->SetReactState(REACT_AGGRESSIVE);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- void MovementInform(uint32 Type, uint32 Id)
- {
- if (Type != POINT_MOTION_TYPE)
- return;
-
- if (Id == 1)
- me->DisappearAndDie();
- }
- };
-};
-
-/*######
-## npc_deserter_agitator
+## npc_theramor_guard
######*/
enum TheramoreGuard
@@ -794,16 +707,16 @@ class spell_energize_aoe : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();)
+ for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
{
if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE)
++itr;
else
- unitList.erase(itr++);
+ targets.erase(itr++);
}
- unitList.push_back(GetCaster());
+ targets.push_back(GetCaster());
}
void HandleScript(SpellEffIndex effIndex)
@@ -815,8 +728,8 @@ class spell_energize_aoe : public SpellScriptLoader
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
@@ -865,7 +778,6 @@ void AddSC_dustwallow_marsh()
new npc_zelfrax();
new npc_stinky();
new npc_theramore_guard();
- new npc_deserter_agitator();
new spell_ooze_zap();
new spell_ooze_zap_channel_end();
new spell_energize_aoe();
diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp
index 9243ea0017e..1a0aa7b21c0 100644
--- a/src/server/scripts/Kalimdor/felwood.cpp
+++ b/src/server/scripts/Kalimdor/felwood.cpp
@@ -40,10 +40,10 @@ EndContentData */
enum RiverbreezeAndSilversky
{
SPELL_CENARION_BEACON = 15120,
-
+
NPC_ARATHANDRIS_SILVERSKY = 9528,
NPC_MAYBESS_RIVERBREEZE = 9529,
-
+
QUEST_CLEASING_FELWOOD_A = 4101,
QUEST_CLEASING_FELWOOD_H = 4102
};
diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp
index 9df208d2578..3c8d2267903 100644
--- a/src/server/scripts/Kalimdor/moonglade.cpp
+++ b/src/server/scripts/Kalimdor/moonglade.cpp
@@ -296,7 +296,10 @@ public:
struct npc_clintar_spiritAI : public npc_escortAI
{
public:
- npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {}
+ npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature)
+ {
+ PlayerGUID = 0;
+ }
uint8 Step;
uint32 CurrWP;
diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp
index 639de3dc3b2..bad278f51c7 100644
--- a/src/server/scripts/Kalimdor/silithus.cpp
+++ b/src/server/scripts/Kalimdor/silithus.cpp
@@ -537,7 +537,6 @@ public:
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
return;
- Unit* mob = NULL;
AnimationTimer = EventAnim[AnimationCount].Timer;
if (eventEnd == false)
{
@@ -720,6 +719,7 @@ public:
case 51:
{
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
+ Unit* mob = NULL;
for (uint8 i = 0; i < 4; ++i)
{
mob = player->FindNearestCreature(entries[i], 50, me);
@@ -844,9 +844,6 @@ public:
void UpdateAI(const uint32 diff)
{
- Unit* target = NULL;
- //Player* player = me->GetPlayer(PlayerGUID);
-
if (!Timers)
{
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers
@@ -890,6 +887,7 @@ public:
}
if (!hasTarget)
{
+ Unit* target = NULL;
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
target = me->FindNearestCreature(15423, 20, true);
if (me->GetEntry() == 15423)
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
index 8f34fa56525..89064a5d18c 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
@@ -19,7 +19,8 @@
* Comment: Find correct mushrooms spell to make them visible - buffs of the mushrooms not ever applied to the users...
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ahnkahet.h"
enum Spells
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
index ea757e86f4d..7f4da5666ff 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ahnkahet.h"
//not in db
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
index f1eaa0c87c5..e81d58b4ef3 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
@@ -19,7 +19,8 @@
* Comment: Missing AI for Twisted Visages
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ahnkahet.h"
enum Spells
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
index d6e50097765..7c167fb9c27 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
@@ -19,7 +19,8 @@
* Comment: Complete - BUT THE TRIGGER NEEDS DATA WHETHER THE PRISON OF TALDARAM IS OFFLINE !
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ahnkahet.h"
enum Yells
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
index cf3c4274e48..f8e2fc0f99f 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ahnkahet.h"
enum Spells
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
index 74643e58e30..f870c61dd5f 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "ahnkahet.h"
/* Ahn'kahet encounters:
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
index ca71d8c313e..dcf1338bc74 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "azjol_nerub.h"
enum Spells
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
index 6587631f249..2690ea13ab1 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
@@ -28,7 +28,8 @@
* Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "azjol_nerub.h"
enum Spells
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
index 4d83be53c93..1acc3b77a61 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
@@ -19,7 +19,8 @@
* Comment: Find in the future best timers and the event is not implemented.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "azjol_nerub.h"
enum Spells
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
index 12622174e29..4e06ac0ba3a 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "azjol_nerub.h"
#define MAX_ENCOUNTER 3
diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt
index 3502e7fb104..dd8dd17c947 100644
--- a/src/server/scripts/Northrend/CMakeLists.txt
+++ b/src/server/scripts/Northrend/CMakeLists.txt
@@ -10,6 +10,7 @@
set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
+ Northrend/wintergrasp.cpp
Northrend/isle_of_conquest.cpp
Northrend/storm_peaks.cpp
Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index b115a4ee827..a9d6d9d91ba 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
@@ -15,7 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "obsidian_sanctum.h"
enum eEnums
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
index 91d67697ebb..7d4438ed7c7 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "obsidian_sanctum.h"
#define MAX_ENCOUNTER 1
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
index b2cf755c7af..41eb31d815d 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "ruby_sanctum.h"
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
index 4e5e01cc745..c4008564029 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ruby_sanctum.h"
enum Texts
@@ -186,7 +187,7 @@ class ConflagrationTargetSelector
public:
ConflagrationTargetSelector() { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* unit) const
{
return unit->GetTypeId() != TYPEID_PLAYER;
}
@@ -201,12 +202,12 @@ class spell_saviana_conflagration_init : public SpellScriptLoader
{
PrepareSpellScript(spell_saviana_conflagration_init_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove_if (ConflagrationTargetSelector());
+ targets.remove_if(ConflagrationTargetSelector());
uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3);
- if (unitList.size() > maxSize)
- Trinity::Containers::RandomResizeList(unitList, maxSize);
+ if (targets.size() > maxSize)
+ Trinity::Containers::RandomResizeList(targets, maxSize);
}
void HandleDummy(SpellEffIndex effIndex)
@@ -218,7 +219,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
index f9e302d7634..5678bbbeb83 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "ruby_sanctum.h"
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
index 19ae66b6a60..273c860a2ad 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ruby_sanctum.h"
enum Texts
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
index 305266ee628..d77c84b2978 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
@@ -22,7 +22,9 @@ SDComment: AI for Argent Soldiers are not implemented. AI from bosses need more
SDCategory: Trial of the Champion
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "trial_of_the_champion.h"
#include "ScriptedEscortAI.h"
@@ -60,9 +62,9 @@ class OrientationCheck : public std::unary_function<Unit*, bool>
{
public:
explicit OrientationCheck(Unit* _caster) : caster(_caster) { }
- bool operator() (Unit* unit)
+ bool operator()(WorldObject* object)
{
- return !unit->isInFront(caster, 2.5f) || !unit->IsWithinDist(caster, 40.0f);
+ return !object->isInFront(caster, 2.5f) || !object->IsWithinDist(caster, 40.0f);
}
private:
@@ -76,15 +78,16 @@ class spell_eadric_radiance : public SpellScriptLoader
class spell_eadric_radiance_SpellScript : public SpellScript
{
PrepareSpellScript(spell_eadric_radiance_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (OrientationCheck(GetCaster()));
+ unitList.remove_if(OrientationCheck(GetCaster()));
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -216,8 +219,6 @@ public:
}
InstanceScript* instance;
-
- Creature* pMemory;
uint64 MemoryGUID;
bool bHealth;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
index 9768b50b214..c56d44ceb08 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
@@ -22,7 +22,8 @@ SDComment: missing yells. not sure about timers.
SDCategory: Trial of the Champion
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "trial_of_the_champion.h"
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
index 18c972b966c..f3b6078d536 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -23,7 +23,8 @@ SDComment: Is missing the ai to make the npcs look for a new mount and use it.
SDCategory: Trial Of the Champion
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "Vehicle.h"
#include "trial_of_the_champion.h"
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
index 9ccd136731a..310dd1003c3 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
@@ -21,7 +21,9 @@ SDComment:
SDCategory: Trial Of the Champion
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "trial_of_the_champion.h"
#define MAX_ENCOUNTER 4
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
index c8236ace88c..a2488513d63 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
@@ -26,7 +26,9 @@ EndScriptData */
npc_announcer_toc5
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "trial_of_the_champion.h"
#include "Vehicle.h"
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index e4dcf978574..564df34462b 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -31,20 +31,23 @@ EndScriptData */
// Scarab - Kill credit isn't crediting?
// FrostSph - often they are casting Permafrost a little above the ground
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "trial_of_the_crusader.h"
enum Yells
{
- SAY_INTRO = -1649055,
- SAY_AGGRO = -1649056,
- SAY_KILL1 = -1649057,
- SAY_KILL2 = -1649058,
- SAY_DEATH = -1649059,
- EMOTE_SPIKE = -1649060,
- SAY_BURROWER = -1649061,
- EMOTE_LEECHING_SWARM = -1649062,
- SAY_LEECHING_SWARM = -1649063,
+ SAY_INTRO = 0,
+ SAY_AGGRO = 1,
+ EMOTE_SUBMERGE = 2,
+ EMOTE_BURROWER = 3,
+ SAY_EMERGE = 4,
+ SAY_LEECHING_SWARM = 5,
+ EMOTE_LEECHING_SWARM = 6,
+ SAY_KILL_PLAYER = 7,
+ SAY_DEATH = 8,
+
+ EMOTE_SPIKE = 0,
};
enum Summons
@@ -82,8 +85,10 @@ enum BossSpells
SPELL_SPIDER_FRENZY = 66128,
SPELL_EXPOSE_WEAKNESS = 67720, //Passive - Triggered
SPELL_SHADOW_STRIKE = 66134,
- SPELL_SUBMERGE_EFFECT = 53421,
- SPELL_EMERGE_EFFECT = 66947,
+ SPELL_SUBMERGE_EFFECT = 68394,
+ SPELL_EMERGE_EFFECT = 65982,
+ SPELL_AWAKENED = 66311,
+ SPELL_PERSISTENT_DIRT = 68048,
SUMMON_SCARAB = NPC_SCARAB,
SUMMON_FROSTSPHERE = NPC_FROST_SPHERE,
@@ -93,6 +98,7 @@ enum BossSpells
SPELL_FROST_SPHERE = 67539,
SPELL_PERMAFROST = 66193,
SPELL_PERMAFROST_VISUAL = 65882,
+ SPELL_PERMAFROST_MODEL = 66185,
//Spike
SPELL_SUMMON_SPIKE = 66169,
@@ -114,12 +120,12 @@ enum SummonActions
const Position SphereSpawn[6] =
{
- { 786.6439f, 108.2498f, 155.6701f, 0 },
- { 806.8429f, 150.5902f, 155.6701f, 0 },
- { 759.1386f, 163.9654f, 155.6701f, 0 },
- { 744.3701f, 119.5211f, 155.6701f, 0 },
- { 710.0211f, 120.8152f, 155.6701f, 0 },
- { 706.6383f, 161.5266f, 155.6701f, 0 },
+ {779.8038f, 150.6580f, 158.1426f, 0},
+ {736.0243f, 113.4201f, 158.0226f, 0},
+ {712.5712f, 160.9948f, 158.4368f, 0},
+ {701.4271f, 126.4740f, 158.0205f, 0},
+ {747.9202f, 155.0920f, 158.0613f, 0},
+ {769.6285f, 121.1024f, 158.0504f, 0},
};
enum MovementPoints
@@ -194,7 +200,7 @@ public:
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
- DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, me);
+ Talk(SAY_KILL_PLAYER);
if (instance)
instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0);
}
@@ -204,7 +210,7 @@ public:
{
if (!m_bIntro)
{
- DoScriptText(SAY_INTRO, me);
+ Talk(SAY_INTRO);
m_bIntro = false;
}
}
@@ -216,13 +222,16 @@ public:
//Summon Scarab Swarms neutral at random places
for (int i=0; i < 10; i++)
if (Creature* temp = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ()))
+ {
temp->setFaction(31);
+ temp->GetMotionMaster()->MoveRandom(10);
+ }
}
void JustDied(Unit* /*killer*/)
{
Summons.DespawnAll();
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
if (instance)
instance->SetData(TYPE_ANUBARAK, DONE);
}
@@ -239,7 +248,7 @@ public:
break;
case NPC_SPIKE:
summoned->CombatStart(target);
- DoScriptText(EMOTE_SPIKE, me, target);
+ Talk(EMOTE_SPIKE, target->GetGUID());
break;
}
Summons.Summon(summoned);
@@ -257,7 +266,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetInCombatWithZone();
if (instance)
@@ -320,7 +329,7 @@ public:
DoCast(me, SPELL_SUBMERGE_ANUBARAK);
DoCast(me, SPELL_CLEAR_ALL_DEBUFFS);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- DoScriptText(SAY_BURROWER, me);
+ Talk(EMOTE_BURROWER);
m_uiScarabSummoned = 0;
m_uiSummonScarabTimer = 4*IN_MILLISECONDS;
m_uiStage = 2;
@@ -402,8 +411,8 @@ public:
{
m_bReachedPhase3 = true;
DoCastAOE(SPELL_LEECHING_SWARM);
- DoScriptText(EMOTE_LEECHING_SWARM, me);
- DoScriptText(SAY_LEECHING_SWARM, me);
+ Talk(EMOTE_LEECHING_SWARM);
+ Talk(SAY_LEECHING_SWARM);
}
if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK))
@@ -444,10 +453,9 @@ public:
m_uiDeterminationTimer = urand(5*IN_MILLISECONDS, 60*IN_MILLISECONDS);
DoCast(me, SPELL_ACID_MANDIBLE);
me->SetInCombatWithZone();
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- me->AddThreat(target, 20000.0f);
- if (!me->isInCombat())
- me->DisappearAndDie();
+ if (me->isInCombat())
+ if (Creature* Anubarak = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_ANUBARAK)))
+ Anubarak->AI()->JustSummoned(me);
}
void DoAction(const int32 actionId)
@@ -508,14 +516,16 @@ public:
void Reset()
{
- me->SetCorpseDelay(0);
+ me->SetCorpseDelay(10);
m_uiSpiderFrenzyTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS);
m_uiSubmergeTimer = 30*IN_MILLISECONDS;
DoCast(me, SPELL_EXPOSE_WEAKNESS);
DoCast(me, SPELL_SPIDER_FRENZY);
+ DoCast(me, SPELL_AWAKENED);
me->SetInCombatWithZone();
- if (!me->isInCombat())
- me->DisappearAndDie();
+ if (me->isInCombat())
+ if (Creature* Anubarak = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_ANUBARAK)))
+ Anubarak->AI()->JustSummoned(me);
}
void DoAction(const int32 actionId)
@@ -523,8 +533,9 @@ public:
switch (actionId)
{
case ACTION_SHADOW_STRIKE:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_SHADOW_STRIKE);
+ if (!me->HasAura(SPELL_AWAKENED))
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_SHADOW_STRIKE);
break;
}
}
@@ -534,22 +545,25 @@ public:
if (!UpdateVictim())
return;
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
if ((m_uiSubmergeTimer <= uiDiff) && HealthBelowPct(80))
{
if (me->HasAura(SPELL_SUBMERGE_EFFECT))
{
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_EFFECT);
DoCast(me, SPELL_EMERGE_EFFECT);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
- me->CombatStart(me->SelectNearestTarget());
+ DoCast(me, SPELL_AWAKENED);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
else
{
if (!me->HasAura(SPELL_PERMAFROST_HELPER))
{
DoCast(me, SPELL_SUBMERGE_EFFECT);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
- me->CombatStop();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_PERSISTENT_DIRT, true);
}
}
m_uiSubmergeTimer = 20*IN_MILLISECONDS;
@@ -574,16 +588,10 @@ class mob_frost_sphere : public CreatureScript
void Reset()
{
- _isFalling = false;
me->SetReactState(REACT_PASSIVE);
- //! Confirmed sniff 3.3.5.a
- me->SetDisableGravity(true);
- me->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
- //! end
+ DoCast(SPELL_FROST_SPHERE);
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
- me->SetSpeed(MOVE_RUN, 0.5f, false);
me->GetMotionMaster()->MoveRandom(20.0f);
- DoCast(SPELL_FROST_SPHERE);
}
void DamageTaken(Unit* /*who*/, uint32& damage)
@@ -591,9 +599,20 @@ class mob_frost_sphere : public CreatureScript
if (me->GetHealth() <= damage)
{
damage = 0;
- if (!_isFalling)
+ float floorZ = me->GetMap()->GetHeight(me->GetPhaseMask(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ if (fabs(me->GetPositionZ() - floorZ) < 0.1f)
{
- _isFalling = true;
+ // we are close to the ground
+ me->GetMotionMaster()->MoveIdle();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
+ DoCast(SPELL_PERMAFROST_MODEL);
+ DoCast(SPELL_PERMAFROST);
+ me->SetObjectScale(2.0f);
+ }
+ else
+ {
+ // we are in air
me->GetMotionMaster()->MoveIdle();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//At hit the ground
@@ -612,16 +631,13 @@ class mob_frost_sphere : public CreatureScript
{
case POINT_FALL_GROUND:
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
- me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
+ DoCast(SPELL_PERMAFROST_MODEL);
DoCast(SPELL_PERMAFROST_VISUAL);
DoCast(SPELL_PERMAFROST);
me->SetObjectScale(2.0f);
break;
}
}
-
- private:
- bool _isFalling;
};
CreatureAI* GetAI(Creature* creature) const
@@ -668,6 +684,7 @@ public:
{
m_uiTargetGUID = who->GetGUID();
DoCast(who, SPELL_MARK);
+ Talk(EMOTE_SPIKE, who->GetGUID());
me->SetSpeed(MOVE_RUN, 0.5f);
m_uiSpeed = 0;
m_uiIncreaseSpeedTimer = 1*IN_MILLISECONDS;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 79bbb470edf..c662daf3671 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -27,13 +27,15 @@ EndScriptData */
// All - untested
// Pets aren't being summoned by their masters
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "trial_of_the_crusader.h"
-enum eYell
+enum Yells
{
- SAY_GARROSH_KILL_ALLIANCE_PLAYER4 = -1649118,
- SAY_VARIAN_KILL_HORDE_PLAYER4 = -1649123,
+ SAY_KILL_PLAYER = 6,
};
enum eAIs
@@ -356,11 +358,12 @@ struct boss_faction_championsAI : public ScriptedAI
if (TeamInInstance == ALLIANCE)
{
if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_VARIAN)))
- DoScriptText(SAY_VARIAN_KILL_HORDE_PLAYER4+urand(0, 3), temp); // + cause we are on negative
+ temp->AI()->Talk(SAY_KILL_PLAYER);
}
else
- if (Creature* temp = me->FindNearestCreature(NPC_GARROSH, 300.f))
- DoScriptText(SAY_GARROSH_KILL_ALLIANCE_PLAYER4+urand(0, 3), temp); // + cause we are on negative
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_GARROSH)))
+ temp->AI()->Talk(SAY_KILL_PLAYER);
+
instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0);
}
@@ -945,18 +948,18 @@ public:
};
-enum eWarlockSpells
+enum WarlockSpells
{
- SPELL_HELLFIRE = 65816,
- SPELL_CORRUPTION = 65810,
- SPELL_CURSE_OF_AGONY = 65814,
- SPELL_CURSE_OF_EXHAUSTION = 65815,
- SPELL_FEAR = 65809, //8s
- SPELL_SEARING_PAIN = 65819,
- SPELL_SHADOW_BOLT = 65821,
- SPELL_UNSTABLE_AFFLICTION = 65812,
- SPELL_SUMMON_FELHUNTER = 67514,
- H_SPELL_UNSTABLE_AFFLICTION = 68155, //15s
+ SPELL_HELLFIRE = 65816,
+ SPELL_CORRUPTION = 65810,
+ SPELL_CURSE_OF_AGONY = 65814,
+ SPELL_CURSE_OF_EXHAUSTION = 65815,
+ SPELL_FEAR = 65809, // 8s
+ SPELL_SEARING_PAIN = 65819,
+ SPELL_SHADOW_BOLT = 65821,
+ SPELL_UNSTABLE_AFFLICTION = 65812, // 15s
+ SPELL_UNSTABLE_AFFLICTION_DISPEL = 65813,
+ SPELL_SUMMON_FELHUNTER = 67514,
};
class mob_toc_warlock : public CreatureScript
@@ -2030,6 +2033,40 @@ public:
};
};
+class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
+{
+ public:
+ spell_faction_champion_warl_unstable_affliction() : SpellScriptLoader("spell_faction_champion_warl_unstable_affliction") { }
+
+ class spell_faction_champion_warl_unstable_affliction_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_faction_champion_warl_unstable_affliction_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_UNSTABLE_AFFLICTION_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, NULL, GetEffect(EFFECT_0));
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_faction_champion_warl_unstable_affliction_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_faction_champion_warl_unstable_affliction_AuraScript();
+ }
+};
+
void AddSC_boss_faction_champions()
{
new boss_toc_champion_controller();
@@ -2049,4 +2086,5 @@ void AddSC_boss_faction_champions()
new mob_toc_retro_paladin();
new mob_toc_pet_warlock();
new mob_toc_pet_hunter();
+ new spell_faction_champion_warl_unstable_affliction();
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
index a7328b43826..87e7801566e 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -30,21 +30,24 @@ EndScriptData */
// Redone summon's scripts in SAI
// Add immunities to the boss and summons
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "trial_of_the_crusader.h"
enum Yells
{
- SAY_INTRO = -1649030,
- SAY_AGGRO = -1649031,
- SAY_DEATH = -1649032,
- EMOTE_INCINERATE = -1649033,
- SAY_INCINERATE = -1649034,
- EMOTE_LEGION_FLAME = -1649035,
- EMOTE_NETHER_PORTAL = -1649036,
- SAY_NETHER_PORTAL = -1649037,
- EMOTE_INFERNAL_ERUPTION = -1649038,
- SAY_INFERNAL_ERUPTION = -1649039,
+ SAY_INTRO = 0,
+ SAY_AGGRO = 1,
+ EMOTE_LEGION_FLAME = 2,
+ EMOTE_NETHER_PORTAL = 3,
+ SAY_MISTRESS_OF_PAIN = 4,
+ EMOTE_INCINERATE = 5,
+ SAY_INCINERATE = 6,
+ EMOTE_INFERNAL_ERUPTION = 7,
+ SAY_INFERNAL_ERUPTION = 8,
+ SAY_KILL_PLAYER = 9,
+ SAY_DEATH = 10,
+ SAY_BERSERK = 11,
};
enum Equipment
@@ -158,7 +161,7 @@ public:
void JustDied(Unit* /*killer*/)
{
Summons.DespawnAll();
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
if (instance)
instance->SetData(TYPE_JARAXXUS, DONE);
}
@@ -173,7 +176,7 @@ public:
me->SetInCombatWithZone();
if (instance)
instance->SetData(TYPE_JARAXXUS, IN_PROGRESS);
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
}
void UpdateAI(const uint32 uiDiff)
@@ -183,16 +186,16 @@ public:
if (m_uiSummonInfernalEruptionTimer <= uiDiff)
{
- DoScriptText(EMOTE_INFERNAL_ERUPTION, me);
- DoScriptText(SAY_INFERNAL_ERUPTION, me);
+ Talk(EMOTE_INFERNAL_ERUPTION);
+ Talk(SAY_INFERNAL_ERUPTION);
DoCast(SPELL_INFERNAL_ERUPTION);
m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS;
} else m_uiSummonInfernalEruptionTimer -= uiDiff;
if (m_uiSummonNetherPortalTimer <= uiDiff)
{
- DoScriptText(EMOTE_NETHER_PORTAL, me);
- DoScriptText(SAY_NETHER_PORTAL, me);
+ Talk(EMOTE_NETHER_PORTAL);
+ Talk(SAY_MISTRESS_OF_PAIN);
DoCast(SPELL_NETHER_PORTAL);
m_uiSummonNetherPortalTimer = 2*MINUTE*IN_MILLISECONDS;
} else m_uiSummonNetherPortalTimer -= uiDiff;
@@ -214,8 +217,8 @@ public:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
{
- DoScriptText(EMOTE_INCINERATE, me, target);
- DoScriptText(SAY_INCINERATE, me);
+ Talk(EMOTE_INCINERATE, target->GetGUID());
+ Talk(SAY_INCINERATE);
DoCast(target, SPELL_INCINERATE_FLESH);
}
m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS);
@@ -231,7 +234,7 @@ public:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
{
- DoScriptText(EMOTE_LEGION_FLAME, me, target);
+ Talk(EMOTE_LEGION_FLAME, target->GetGUID());
DoCast(target, SPELL_LEGION_FLAME);
}
m_uiLegionFlameTimer = 30*IN_MILLISECONDS;
@@ -326,6 +329,8 @@ public:
// used to despawn corpse immediately
me->DespawnOrUnsummon();
}
+
+ void UpdateAI(uint32 const /*diff*/) {}
};
};
@@ -435,6 +440,8 @@ public:
// used to despawn corpse immediately
me->DespawnOrUnsummon();
}
+
+ void UpdateAI(uint32 const /*diff*/) {}
};
};
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index 5bda32941c2..506467be8a5 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -29,21 +29,22 @@ EndScriptData */
// Snakes - miss the 1-hitkill from emerging
// - visual changes between mobile and stationary models seems not to work sometimes
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "trial_of_the_crusader.h"
enum Yells
{
- //Gormok
- SAY_SNOBOLLED = -1649000,
- //Acidmaw & Dreadscale
- SAY_SUBMERGE = -1649010,
- SAY_EMERGE = -1649011,
- SAY_BERSERK = -1649012,
- //Icehowl
- SAY_TRAMPLE_STARE = -1649020,
- SAY_TRAMPLE_FAIL = -1649021,
- SAY_TRAMPLE_START = -1649022,
+ // Gormok
+ EMOTE_SNOBOLLED = 0,
+
+ // Acidmaw & Dreadscale
+ EMOTE_ENRAGE = 0,
+
+ // Icehowl
+ EMOTE_TRAMPLE_START = 0,
+ EMOTE_TRAMPLE_CRASH = 1,
+ EMOTE_TRAMPLE_FAIL = 2,
};
enum Equipment
@@ -238,7 +239,7 @@ public:
if (m_uiSummonCount > 0)
{
me->SummonCreature(NPC_SNOBOLD_VASSAL, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN);
- DoScriptText(SAY_SNOBOLLED, me);
+ Talk(EMOTE_SNOBOLLED);
}
m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else m_uiSummonTimer -= diff;
@@ -459,12 +460,11 @@ struct boss_jormungarAI : public ScriptedAI
if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL && !enraged)
{
- DoScriptText(SAY_EMERGE, me);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(SPELL_ENRAGE);
enraged = true;
- DoScriptText(SAY_BERSERK, me);
+ Talk(EMOTE_ENRAGE);
switch (stage)
{
case 0:
@@ -511,7 +511,6 @@ struct boss_jormungarAI : public ScriptedAI
case 1: // Submerge
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_SUBMERGE_0);
- DoScriptText(SAY_SUBMERGE, me);
me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+ frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ());
stage = 2;
case 2: // Wait til emerge
@@ -523,7 +522,6 @@ struct boss_jormungarAI : public ScriptedAI
break;
case 3: // Emerge
me->SetDisplayId(modelStationary);
- DoScriptText(SAY_EMERGE, me);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
DoCast(me, SPELL_EMERGE_0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
@@ -557,7 +555,6 @@ struct boss_jormungarAI : public ScriptedAI
case 5: // Submerge
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_SUBMERGE_0);
- DoScriptText(SAY_SUBMERGE, me);
me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ());
stage = 6;
case 6: // Wait til emerge
@@ -569,7 +566,6 @@ struct boss_jormungarAI : public ScriptedAI
break;
case 7: // Emerge
me->SetDisplayId(modelMobile);
- DoScriptText(SAY_EMERGE, me);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
DoCast(me, SPELL_EMERGE_0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
@@ -909,6 +905,8 @@ public:
if (m_uiMassiveCrashTimer <= diff)
{
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room
+ SetCombatMovement(false);
+ me->AttackStop();
m_uiStage = 7; //Invalid (Do nothing more than move)
m_uiMassiveCrashTimer = 30*IN_MILLISECONDS;
} else m_uiMassiveCrashTimer -= diff;
@@ -917,23 +915,28 @@ public:
break;
case 1:
DoCastAOE(SPELL_MASSIVE_CRASH);
+ me->StopMoving();
+ me->AttackStop();
m_uiStage = 2;
break;
case 2:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
{
+ me->StopMoving();
+ me->AttackStop();
m_uiTrampleTargetGUID = target->GetGUID();
me->SetTarget(m_uiTrampleTargetGUID);
- DoScriptText(SAY_TRAMPLE_STARE, me, target);
m_bTrampleCasted = false;
- SetCombatMovement(false);
- me->GetMotionMaster()->MoveIdle();
+ //SetCombatMovement(false);
+ //me->GetMotionMaster()->MoveIdle();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_uiTrampleTimer = 4*IN_MILLISECONDS;
m_uiStage = 3;
} else m_uiStage = 6;
break;
case 3:
+ me->StopMoving();
+ me->AttackStop();
if (m_uiTrampleTimer <= diff)
{
if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID))
@@ -946,13 +949,15 @@ public:
me->GetMotionMaster()->MoveJump(2*me->GetPositionX()-m_fTrampleTargetX,
2*me->GetPositionY()-m_fTrampleTargetY,
me->GetPositionZ(),
- 10.0f, 20.0f); // 2: Hop Backwards
+ 20.0f, 30.0f); // 2: Hop Backwards
m_uiStage = 7; //Invalid (Do nothing more than move)
} else m_uiStage = 6;
} else m_uiTrampleTimer -= diff;
break;
case 4:
- DoScriptText(SAY_TRAMPLE_START, me);
+ me->StopMoving();
+ me->AttackStop();
+ Talk(EMOTE_TRAMPLE_START, m_uiTrampleTargetGUID);
me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1);
me->SetTarget(0);
m_uiStage = 5;
@@ -984,7 +989,12 @@ public:
if (!m_bTrampleCasted)
{
DoCast(me, SPELL_STAGGERED_DAZE);
- DoScriptText(SAY_TRAMPLE_FAIL, me);
+ Talk(EMOTE_TRAMPLE_CRASH);
+ }
+ else
+ {
+ DoCast(me, SPELL_FROTHING_RAGE, true);
+ Talk(EMOTE_TRAMPLE_FAIL);
}
m_bMovementStarted = false;
me->GetMotionMaster()->MovementExpired();
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index cf84abb482f..a65eaebbc0c 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -27,22 +27,28 @@ EndScriptData */
// - They should be floating but they aren't respecting the floor =(
// - Hardcoded bullets spawner
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "trial_of_the_crusader.h"
enum Yells
{
- SAY_AGGRO = -1649040,
- SAY_DEATH = -1649041,
- SAY_BERSERK = -1649042,
- EMOTE_SHIELD = -1649043,
- SAY_SHIELD = -1649044,
- SAY_KILL1 = -1649045,
- SAY_KILL2 = -1649046,
- EMOTE_LIGHT_VORTEX = -1649047,
- SAY_LIGHT_VORTEX = -1649048,
- EMOTE_DARK_VORTEX = -1649049,
- SAY_DARK_VORTEX = -1649050,
+ SAY_AGGRO = 0,
+ SAY_NIGHT = 1,
+ SAY_LIGHT = 2,
+ EMOTE_VORTEX = 3,
+ EMOTE_TWINK_PACT = 4,
+ SAY_TWINK_PACT = 5,
+ SAY_KILL_PLAYER = 6,
+ SAY_BERSERK = 7,
+ SAY_DEATH = 8,
};
enum Equipment
@@ -159,7 +165,6 @@ struct boss_twin_baseAI : public ScriptedAI
uint32 m_uiTouchTimer;
uint32 m_uiBerserkTimer;
- int32 m_uiVortexSay;
int32 m_uiVortexEmote;
uint32 m_uiSisterNpcId;
uint32 m_uiMyEmphatySpellId;
@@ -171,7 +176,8 @@ struct boss_twin_baseAI : public ScriptedAI
uint32 m_uiSpikeSpellId;
uint32 m_uiTouchSpellId;
- void Reset() {
+ void Reset()
+ {
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
me->ModifyAuraState(m_uiAuraState, true);
@@ -216,7 +222,7 @@ struct boss_twin_baseAI : public ScriptedAI
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
- DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, me);
+ Talk(SAY_KILL_PLAYER);
if (instance)
instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0);
}
@@ -248,7 +254,7 @@ struct boss_twin_baseAI : public ScriptedAI
void JustDied(Unit* /*killer*/)
{
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
if (instance)
{
if (Creature* pSister = GetSister())
@@ -290,7 +296,7 @@ struct boss_twin_baseAI : public ScriptedAI
instance->SetData(TYPE_VALKIRIES, IN_PROGRESS);
}
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
DoCast(me, m_uiSurgeSpellId);
}
@@ -328,8 +334,7 @@ struct boss_twin_baseAI : public ScriptedAI
{
if (Creature* pSister = GetSister())
pSister->AI()->DoAction(ACTION_VORTEX);
- DoScriptText(m_uiVortexEmote, me);
- DoScriptText(m_uiVortexSay, me);
+ Talk(m_uiVortexEmote);
DoCastAOE(m_uiVortexSpellId);
m_uiStage = 0;
m_uiSpecialAbilityTimer = MINUTE*IN_MILLISECONDS;
@@ -340,8 +345,8 @@ struct boss_twin_baseAI : public ScriptedAI
case 2: // Shield+Pact
if (m_uiSpecialAbilityTimer <= uiDiff)
{
- DoScriptText(EMOTE_SHIELD, me);
- DoScriptText(SAY_SHIELD, me);
+ Talk(EMOTE_TWINK_PACT);
+ Talk(SAY_TWINK_PACT);
if (Creature* pSister = GetSister())
{
pSister->AI()->DoAction(ACTION_PACT);
@@ -379,7 +384,7 @@ struct boss_twin_baseAI : public ScriptedAI
if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff)
{
DoCast(me, SPELL_BERSERK);
- DoScriptText(SAY_BERSERK, me);
+ Talk(SAY_BERSERK);
m_bIsBerserk = true;
}
else
@@ -418,8 +423,7 @@ public:
m_uiStage = 0;
m_uiWeapon = EQUIP_MAIN_1;
m_uiAuraState = AURA_STATE_UNKNOWN22;
- m_uiVortexEmote = EMOTE_LIGHT_VORTEX;
- m_uiVortexSay = SAY_LIGHT_VORTEX;
+ m_uiVortexEmote = EMOTE_VORTEX;
m_uiSisterNpcId = NPC_DARKBANE;
m_uiMyEmphatySpellId = SPELL_TWIN_EMPATHY_DARK;
m_uiOtherEssenceSpellId = SPELL_DARK_ESSENCE_HELPER;
@@ -488,8 +492,7 @@ public:
m_uiStage = 1;
m_uiWeapon = EQUIP_MAIN_2;
m_uiAuraState = AURA_STATE_UNKNOWN19;
- m_uiVortexEmote = EMOTE_DARK_VORTEX;
- m_uiVortexSay = SAY_DARK_VORTEX;
+ m_uiVortexEmote = EMOTE_VORTEX;
m_uiSisterNpcId = NPC_LIGHTBANE;
m_uiMyEmphatySpellId = SPELL_TWIN_EMPATHY_LIGHT;
m_uiOtherEssenceSpellId = SPELL_LIGHT_ESSENCE_HELPER;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
index 1966e26b128..af6104008ff 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
@@ -23,7 +23,8 @@ SDComment: by /dev/rsa
SDCategory: Trial of the Crusader
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "trial_of_the_crusader.h"
class instance_trial_of_the_crusader : public InstanceMapScript
@@ -46,6 +47,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
uint64 BarrentGUID;
uint64 TirionGUID;
+ uint64 TirionFordringGUID;
uint64 FizzlebangGUID;
uint64 GarroshGUID;
uint64 VarianGUID;
@@ -84,6 +86,8 @@ class instance_trial_of_the_crusader : public InstanceMapScript
TrialCounter = 50;
EventStage = 0;
+ TirionFordringGUID = 0;
+
TributeChestGUID = 0;
MainGateDoorGUID = 0;
@@ -146,6 +150,9 @@ class instance_trial_of_the_crusader : public InstanceMapScript
case NPC_TIRION:
TirionGUID = creature->GetGUID();
break;
+ case NPC_TIRION_FORDRING:
+ TirionFordringGUID = creature->GetGUID();
+ break;
case NPC_FIZZLEBANG:
FizzlebangGUID = creature->GetGUID();
break;
@@ -237,10 +244,18 @@ class instance_trial_of_the_crusader : public InstanceMapScript
switch (type)
{
case TYPE_JARAXXUS:
+ // Cleanup Icehowl
+ if (Creature* icehowl = instance->GetCreature(IcehowlGUID))
+ icehowl->DespawnOrUnsummon();
if (data == DONE)
EventStage = 2000;
break;
case TYPE_CRUSADERS:
+ // Cleanup Jaraxxus
+ if (Creature* jaraxxus = instance->GetCreature(JaraxxusGUID))
+ jaraxxus->DespawnOrUnsummon();
+ if (Creature* fizzlebang = instance->GetCreature(FizzlebangGUID))
+ fizzlebang->DespawnOrUnsummon();
switch (data)
{
case IN_PROGRESS:
@@ -260,6 +275,9 @@ class instance_trial_of_the_crusader : public InstanceMapScript
}
break;
case TYPE_VALKIRIES:
+ // Cleanup chest
+ if (GameObject* cache = instance->GetGameObject(CrusadersCacheGUID))
+ cache->Delete();
switch (data)
{
case FAIL:
@@ -314,7 +332,8 @@ class instance_trial_of_the_crusader : public InstanceMapScript
}
if (tributeChest)
if (Creature* tirion = instance->GetCreature(TirionGUID))
- if (GameObject* chest = tirion->SummonGameObject(tributeChest, 805.62f, 134.87f, 142.16f, 3.27f, 0, 0, 0, 0, 90000000))
+ // need proper location.this one is guessed based on videos
+ if (GameObject* chest = tirion->SummonGameObject(tributeChest, 643.814f, 136.027f, 141.295f, 0, 0, 0, 0, 0, 90000000))
chest->SetRespawnTime(chest->GetRespawnDelay());
break;
}
@@ -393,7 +412,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
if (type < MAX_ENCOUNTERS)
{
- sLog->outDetail("[ToCr] EncounterStatus[type %u] %u = data %u;", type, EncounterStatus[type], data);
+ sLog->outInfo(LOG_FILTER_TSCR, "[ToCr] EncounterStatus[type %u] %u = data %u;", type, EncounterStatus[type], data);
if (data == FAIL)
{
--TrialCounter;
@@ -421,6 +440,8 @@ class instance_trial_of_the_crusader : public InstanceMapScript
return BarrentGUID;
case NPC_TIRION:
return TirionGUID;
+ case NPC_TIRION_FORDRING:
+ return TirionFordringGUID;
case NPC_FIZZLEBANG:
return FizzlebangGUID;
case NPC_GARROSH:
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
index 2643b8d60c7..0476b2cbacb 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
@@ -25,52 +25,66 @@ EndScriptData */
//Known Bugs:
// - Need better implementation of Gossip and correct gossip text and option
-// - Misses Dalaran Teleport at the end.
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "trial_of_the_crusader.h"
enum eYells
{
- SAY_STAGE_0_01 = -1649070,
- SAY_STAGE_0_02 = -1649071,
- SAY_STAGE_0_03a = -1649072,
- SAY_STAGE_0_03h = -1649073,
- SAY_STAGE_0_04 = -1649074,
- SAY_STAGE_0_05 = -1649075,
- SAY_STAGE_0_06 = -1649076,
- SAY_STAGE_0_WIPE = -1649077,
- SAY_STAGE_1_01 = -1649080,
- SAY_STAGE_1_02 = -1649081,
- SAY_STAGE_1_03 = -1649082,
- SAY_STAGE_1_04 = -1649083,
- SAY_STAGE_1_05 = -1649030, //INTRO Jaraxxus
- SAY_STAGE_1_06 = -1649084,
- SAY_STAGE_1_07 = -1649086,
- SAY_STAGE_1_08 = -1649087,
- SAY_STAGE_1_09 = -1649088,
- SAY_STAGE_1_10 = -1649089,
- SAY_STAGE_1_11 = -1649090,
- SAY_STAGE_2_01 = -1649091,
- SAY_STAGE_2_02a = -1649092,
- SAY_STAGE_2_02h = -1649093,
- SAY_STAGE_2_03 = -1649094,
- SAY_STAGE_2_04a = -1649095,
- SAY_STAGE_2_04h = -1649096,
- SAY_STAGE_2_05a = -1649097,
- SAY_STAGE_2_05h = -1649098,
- SAY_STAGE_2_06 = -1649099,
- SAY_STAGE_3_01 = -1649100,
- SAY_STAGE_3_02 = -1649101,
- SAY_STAGE_3_03a = -1649102,
- SAY_STAGE_3_03h = -1649103,
- SAY_STAGE_4_01 = -1649104,
- SAY_STAGE_4_02 = -1649105,
- SAY_STAGE_4_03 = -1649106,
- SAY_STAGE_4_04 = -1649107,
- SAY_STAGE_4_05 = -1649108,
- SAY_STAGE_4_06 = -1649109,
- SAY_STAGE_4_07 = -1649110,
+ // Highlord Tirion Fordring - 34996
+ SAY_STAGE_0_01 = 0,
+ SAY_STAGE_0_02 = 1,
+ SAY_STAGE_0_04 = 2,
+ SAY_STAGE_0_05 = 3,
+ SAY_STAGE_0_06 = 4,
+ SAY_STAGE_0_WIPE = 5,
+ SAY_STAGE_1_01 = 6,
+ SAY_STAGE_1_07 = 7,
+ SAY_STAGE_1_08 = 8,
+ SAY_STAGE_1_11 = 9,
+ SAY_STAGE_2_01 = 10,
+ SAY_STAGE_2_03 = 11,
+ SAY_STAGE_2_06 = 12,
+ SAY_STAGE_3_01 = 13,
+ SAY_STAGE_3_02 = 14,
+ SAY_STAGE_4_01 = 15,
+ SAY_STAGE_4_03 = 16,
+
+ // Varian Wrynn
+ SAY_STAGE_0_03a = 0,
+ SAY_STAGE_1_10 = 1,
+ SAY_STAGE_2_02a = 2,
+ SAY_STAGE_2_04a = 3,
+ SAY_STAGE_2_05a = 4,
+ SAY_STAGE_3_03a = 5,
+
+ // Garrosh
+ SAY_STAGE_0_03h = 0,
+ SAY_STAGE_1_09 = 1,
+ SAY_STAGE_2_02h = 2,
+ SAY_STAGE_2_04h = 3,
+ SAY_STAGE_2_05h = 4,
+ SAY_STAGE_3_03h = 5,
+
+ // Wilfred Fizzlebang
+ SAY_STAGE_1_02 = 0,
+ SAY_STAGE_1_03 = 1,
+ SAY_STAGE_1_04 = 2,
+ SAY_STAGE_1_06 = 3,
+
+ // Lord Jaraxxus
+ SAY_STAGE_1_05 = 0,
+
+ // The Lich King
+ SAY_STAGE_4_02 = 0,
+ SAY_STAGE_4_05 = 1,
+ SAY_STAGE_4_04 = 2,
+
+ // Highlord Tirion Fordring - 36095
+ SAY_STAGE_4_06 = 0,
+ SAY_STAGE_4_07 = 1,
};
struct _Messages
@@ -106,11 +120,8 @@ class npc_announcer_toc10 : public CreatureScript
{
npc_announcer_toc10AI(Creature* creature) : ScriptedAI(creature)
{
- instance = creature->GetInstanceScript();
}
- InstanceScript* instance;
-
void Reset()
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -204,7 +215,7 @@ class npc_announcer_toc10 : public CreatureScript
return true;
if (GameObject* floor = GameObject::GetGameObject(*player, instanceScript->GetData64(GO_ARGENT_COLISEUM_FLOOR)))
- floor->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED);
+ floor->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED);
creature->CastSpell(creature, 69016, false);
@@ -260,7 +271,7 @@ class boss_lich_king_toc : public CreatureScript
void MovementInform(uint32 uiType, uint32 uiId)
{
- if (uiType != POINT_MOTION_TYPE)
+ if (uiType != POINT_MOTION_TYPE || !instance)
return;
switch (uiId)
{
@@ -287,13 +298,13 @@ class boss_lich_king_toc : public CreatureScript
switch (instance->GetData(TYPE_EVENT))
{
case 5010:
- DoScriptText(SAY_STAGE_4_02, me);
+ Talk(SAY_STAGE_4_02);
m_uiUpdateTimer = 3000;
me->GetMotionMaster()->MovePoint(0, LichKingLoc[0]);
instance->SetData(TYPE_EVENT, 5020);
break;
case 5030:
- DoScriptText(SAY_STAGE_4_04, me);
+ Talk(SAY_STAGE_4_04);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
m_uiUpdateTimer = 10000;
instance->SetData(TYPE_EVENT, 5040);
@@ -310,7 +321,7 @@ class boss_lich_king_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 5060);
break;
case 5060:
- DoScriptText(SAY_STAGE_4_05, me);
+ Talk(SAY_STAGE_4_05);
me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
m_uiUpdateTimer = 2500;
instance->SetData(TYPE_EVENT, 5070);
@@ -322,22 +333,20 @@ class boss_lich_king_toc : public CreatureScript
break;
case 5080:
if (GameObject* go = instance->instance->GetGameObject(instance->GetData64(GO_ARGENT_COLISEUM_FLOOR)))
- go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED);
+ go->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED);
me->CastSpell(me, 69016, false);
- if (instance)
- {
- instance->SetData(TYPE_LICH_KING, DONE);
- Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_ANUBARAK));
- if (!temp || !temp->isAlive())
- temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
+ instance->SetData(TYPE_LICH_KING, DONE);
+ Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_ANUBARAK));
+ if (!temp || !temp->isAlive())
+ temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
- instance->SetData(TYPE_EVENT, 0);
- }
+ instance->SetData(TYPE_EVENT, 0);
me->DespawnOrUnsummon();
m_uiUpdateTimer = 20000;
break;
}
} else m_uiUpdateTimer -= uiDiff;
+
instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer);
}
};
@@ -369,7 +378,7 @@ class npc_fizzlebang_toc : public CreatureScript
void JustDied(Unit* killer)
{
- DoScriptText(SAY_STAGE_1_06, me, killer);
+ Talk(SAY_STAGE_1_06, killer->GetGUID());
instance->SetData(TYPE_EVENT, 1180);
if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS)))
{
@@ -428,13 +437,13 @@ class npc_fizzlebang_toc : public CreatureScript
m_uiUpdateTimer = 4000;
break;
case 1120:
- DoScriptText(SAY_STAGE_1_02, me);
+ Talk(SAY_STAGE_1_02);
instance->SetData(TYPE_EVENT, 1130);
m_uiUpdateTimer = 12000;
break;
case 1130:
me->GetMotionMaster()->MovementExpired();
- DoScriptText(SAY_STAGE_1_03, me);
+ Talk(SAY_STAGE_1_03);
me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST_OMNI);
if (Unit* pTrigger = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.69494f, TEMPSUMMON_MANUAL_DESPAWN))
{
@@ -468,7 +477,7 @@ class npc_fizzlebang_toc : public CreatureScript
m_uiUpdateTimer = 3000;
break;
case 1140:
- DoScriptText(SAY_STAGE_1_04, me);
+ Talk(SAY_STAGE_1_04);
if (Creature* temp = me->SummonCreature(NPC_JARAXXUS, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 5.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -490,7 +499,7 @@ class npc_fizzlebang_toc : public CreatureScript
break;
case 1144:
if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS)))
- DoScriptText(SAY_STAGE_1_05, temp);
+ temp->AI()->Talk(SAY_STAGE_1_05);
instance->SetData(TYPE_EVENT, 1150);
m_uiUpdateTimer = 5000;
break;
@@ -553,13 +562,13 @@ class npc_tirion_toc : public CreatureScript
{
case 110:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK);
- DoScriptText(SAY_STAGE_0_01, me);
+ Talk(SAY_STAGE_0_01);
m_uiUpdateTimer = 22000;
instance->SetData(TYPE_EVENT, 120);
break;
case 140:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK);
- DoScriptText(SAY_STAGE_0_02, me);
+ Talk(SAY_STAGE_0_02);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 150);
break;
@@ -585,7 +594,7 @@ class npc_tirion_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 160);
break;
case 200:
- DoScriptText(SAY_STAGE_0_04, me);
+ Talk(SAY_STAGE_0_04);
m_uiUpdateTimer = 8000;
instance->SetData(TYPE_EVENT, 205);
break;
@@ -617,7 +626,7 @@ class npc_tirion_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 230);
break;
case 300:
- DoScriptText(SAY_STAGE_0_05, me);
+ Talk(SAY_STAGE_0_05);
m_uiUpdateTimer = 8000;
instance->SetData(TYPE_EVENT, 305);
break;
@@ -644,54 +653,54 @@ class npc_tirion_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 320);
break;
case 400:
- DoScriptText(SAY_STAGE_0_06, me);
+ Talk(SAY_STAGE_0_06);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 0);
break;
case 666:
- DoScriptText(SAY_STAGE_0_WIPE, me);
+ Talk(SAY_STAGE_0_WIPE);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 0);
break;
case 1010:
- DoScriptText(SAY_STAGE_1_01, me);
+ Talk(SAY_STAGE_1_01);
m_uiUpdateTimer = 7000;
instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
me->SummonCreature(NPC_FIZZLEBANG, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
instance->SetData(TYPE_EVENT, 0);
break;
case 1180:
- DoScriptText(SAY_STAGE_1_07, me);
+ Talk(SAY_STAGE_1_07);
m_uiUpdateTimer = 3000;
instance->SetData(TYPE_EVENT, 0);
break;
case 2000:
- DoScriptText(SAY_STAGE_1_08, me);
+ Talk(SAY_STAGE_1_08);
m_uiUpdateTimer = 18000;
instance->SetData(TYPE_EVENT, 2010);
break;
case 2030:
- DoScriptText(SAY_STAGE_1_11, me);
+ Talk(SAY_STAGE_1_11);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 0);
break;
case 3000:
- DoScriptText(SAY_STAGE_2_01, me);
+ Talk(SAY_STAGE_2_01);
m_uiUpdateTimer = 12000;
instance->SetData(TYPE_EVENT, 3050);
break;
case 3001:
- DoScriptText(SAY_STAGE_2_01, me);
+ Talk(SAY_STAGE_2_01);
m_uiUpdateTimer = 12000;
instance->SetData(TYPE_EVENT, 3051);
break;
case 3060:
- DoScriptText(SAY_STAGE_2_03, me);
+ Talk(SAY_STAGE_2_03);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 3070);
break;
case 3061:
- DoScriptText(SAY_STAGE_2_03, me);
+ Talk(SAY_STAGE_2_03);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 3071);
break;
@@ -716,17 +725,17 @@ class npc_tirion_toc : public CreatureScript
break;
//Crusaders battle end
case 3100:
- DoScriptText(SAY_STAGE_2_06, me);
+ Talk(SAY_STAGE_2_06);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 0);
break;
case 4000:
- DoScriptText(SAY_STAGE_3_01, me);
+ Talk(SAY_STAGE_3_01);
m_uiUpdateTimer = 13000;
instance->SetData(TYPE_EVENT, 4010);
break;
case 4010:
- DoScriptText(SAY_STAGE_3_02, me);
+ Talk(SAY_STAGE_3_02);
if (Creature* temp = me->SummonCreature(NPC_LIGHTBANE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{
temp->SetVisible(false);
@@ -767,34 +776,38 @@ class npc_tirion_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 5000);
break;
case 5000:
- DoScriptText(SAY_STAGE_4_01, me);
+ Talk(SAY_STAGE_4_01);
m_uiUpdateTimer = 10000;
instance->SetData(TYPE_EVENT, 5005);
break;
case 5005:
m_uiUpdateTimer = 8000;
instance->SetData(TYPE_EVENT, 5010);
- me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5);
+ me->SummonCreature(NPC_LICH_KING_1, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5);
break;
case 5020:
- DoScriptText(SAY_STAGE_4_03, me);
+ Talk(SAY_STAGE_4_03);
m_uiUpdateTimer = 1000;
instance->SetData(TYPE_EVENT, 0);
break;
case 6000:
- me->NearTeleportTo(AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 4.0f);
+ me->SummonCreature(NPC_TIRION_FORDRING, EndSpawnLoc[0].GetPositionX(), EndSpawnLoc[0].GetPositionY(), EndSpawnLoc[0].GetPositionZ());
+ me->SummonCreature(NPC_ARGENT_MAGE, EndSpawnLoc[1].GetPositionX(), EndSpawnLoc[1].GetPositionY(), EndSpawnLoc[1].GetPositionZ());
+ me->SummonGameObject(GO_PORTAL_TO_DALARAN, EndSpawnLoc[2].GetPositionX(), EndSpawnLoc[2].GetPositionY(), EndSpawnLoc[2].GetPositionZ(), 5, 0, 0, 0, 0, 0);
m_uiUpdateTimer = 20000;
instance->SetData(TYPE_EVENT, 6005);
break;
case 6005:
- DoScriptText(SAY_STAGE_4_06, me);
+ if (Creature* tirionFordring = Unit::GetCreature((*me), instance->GetData64(NPC_TIRION_FORDRING)))
+ tirionFordring->AI()->Talk(SAY_STAGE_4_06);
m_uiUpdateTimer = 20000;
instance->SetData(TYPE_EVENT, 6010);
break;
case 6010:
if (IsHeroic())
{
- DoScriptText(SAY_STAGE_4_07, me);
+ if (Creature* tirionFordring = Unit::GetCreature((*me), instance->GetData64(NPC_TIRION_FORDRING)))
+ tirionFordring->AI()->Talk(SAY_STAGE_4_07);
m_uiUpdateTimer = 60000;
instance->SetData(TYPE_ANUBARAK, SPECIAL);
instance->SetData(TYPE_EVENT, 6020);
@@ -852,7 +865,7 @@ class npc_garrosh_toc : public CreatureScript
{
case 130:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK);
- DoScriptText(SAY_STAGE_0_03h, me);
+ Talk(SAY_STAGE_0_03h);
m_uiUpdateTimer = 3000;
instance->SetData(TYPE_EVENT, 132);
break;
@@ -862,27 +875,27 @@ class npc_garrosh_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 140);
break;
case 2010:
- DoScriptText(SAY_STAGE_1_09, me);
+ Talk(SAY_STAGE_1_09);
m_uiUpdateTimer = 9000;
instance->SetData(TYPE_EVENT, 2020);
break;
case 3050:
- DoScriptText(SAY_STAGE_2_02h, me);
+ Talk(SAY_STAGE_2_02h);
m_uiUpdateTimer = 15000;
instance->SetData(TYPE_EVENT, 3060);
break;
case 3070:
- DoScriptText(SAY_STAGE_2_04h, me);
+ Talk(SAY_STAGE_2_04h);
m_uiUpdateTimer = 6000;
instance->SetData(TYPE_EVENT, 3080);
break;
case 3081:
- DoScriptText(SAY_STAGE_2_05h, me);
+ Talk(SAY_STAGE_2_05h);
m_uiUpdateTimer = 3000;
instance->SetData(TYPE_EVENT, 3091);
break;
case 4030:
- DoScriptText(SAY_STAGE_3_03h, me);
+ Talk(SAY_STAGE_3_03h);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 4040);
break;
@@ -933,7 +946,7 @@ class npc_varian_toc : public CreatureScript
{
case 120:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK);
- DoScriptText(SAY_STAGE_0_03a, me);
+ Talk(SAY_STAGE_0_03a);
m_uiUpdateTimer = 2000;
instance->SetData(TYPE_EVENT, 122);
break;
@@ -943,27 +956,27 @@ class npc_varian_toc : public CreatureScript
instance->SetData(TYPE_EVENT, 130);
break;
case 2020:
- DoScriptText(SAY_STAGE_1_10, me);
+ Talk(SAY_STAGE_1_10);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 2030);
break;
case 3051:
- DoScriptText(SAY_STAGE_2_02a, me);
+ Talk(SAY_STAGE_2_02a);
m_uiUpdateTimer = 10000;
instance->SetData(TYPE_EVENT, 3061);
break;
case 3071:
- DoScriptText(SAY_STAGE_2_04a, me);
+ Talk(SAY_STAGE_2_04a);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 3081);
break;
case 3080:
- DoScriptText(SAY_STAGE_2_05a, me);
+ Talk(SAY_STAGE_2_05a);
m_uiUpdateTimer = 3000;
instance->SetData(TYPE_EVENT, 3090);
break;
case 4020:
- DoScriptText(SAY_STAGE_3_03a, me);
+ Talk(SAY_STAGE_3_03a);
m_uiUpdateTimer = 5000;
instance->SetData(TYPE_EVENT, 4040);
break;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
index 99525b6fb32..58cbd727963 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
@@ -53,8 +53,8 @@ const Position ToCCommonLoc[]=
{563.833008f, 195.244995f, 394.585561f, 0}, // 5 - Center
{573.5f, 180.5f, 395.14f, 0}, // 6 Move 0 Right
{553.5f, 180.5f, 395.14f, 0}, // 7 Move 0 Left
- {585.5f, 170.0f, 395.14f, 0}, // 8 Move 1 Right
- {545.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left
+ {573.0f, 170.0f, 395.14f, 0}, // 8 Move 1 Right
+ {555.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left
{563.8f, 216.1f, 395.1f, 0}, // 10 Behind the door
{575.042358f, 195.260727f, 395.137146f, 0}, // 5
@@ -129,6 +129,13 @@ const Position AnubarakLoc[]=
{740.184509f, 193.443390f, 142.117584f, 0}, // 4 - Nerub Spawn
};
+const Position EndSpawnLoc[]=
+{
+ {648.9167f, 131.0208f, 141.6161f, 0}, // 0 - Highlord Tirion Fordring
+ {649.1614f, 142.0399f, 141.3057f ,0}, // 1 - Argent Mage
+ {644.6250f, 149.2743f, 140.6015f ,0}, // 2 - Portal to Dalaran
+};
+
enum euiWorldStates
{
UPDATE_STATE_UI_SHOW = 4390,
@@ -162,6 +169,8 @@ enum eCreature
{
NPC_BARRENT = 34816,
NPC_TIRION = 34996,
+ NPC_TIRION_FORDRING = 36095,
+ NPC_ARGENT_MAGE = 36097,
NPC_FIZZLEBANG = 35458,
NPC_GARROSH = 34995,
NPC_VARIAN = 34990,
@@ -244,6 +253,7 @@ enum eGameObject
GO_MAIN_GATE_DOOR = 195647,
GO_EAST_PORTCULLIS = 195648,
GO_WEB_DOOR = 195485,
+ GO_PORTAL_TO_DALARAN = 195682,
};
enum eAchievementData
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
index 95acc79231d..8b39fc51766 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
@@ -19,7 +19,8 @@
* Comment: MAYBE need more improve the "Raptor Call".
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "drak_tharon_keep.h"
enum Spells
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
index 9ff8ee9c9ed..5d9acf4fca7 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "drak_tharon_keep.h"
enum Spells
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
index b1d588a0d0d..969ccf4a059 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "drak_tharon_keep.h"
enum Spells
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
index 26e4e9db99e..b6a4c40abdd 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
@@ -19,7 +19,9 @@
* Comment: TODO: spawn troll waves
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuras.h"
#include "drak_tharon_keep.h"
enum Spells
diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
index aff3f1b8e36..99401c1d944 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "drak_tharon_keep.h"
#define MAX_ENCOUNTER 4
@@ -69,6 +70,7 @@ public:
void Initialize()
{
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
uiTrollgore = 0;
uiNovos = 0;
uiDred = 0;
@@ -189,16 +191,12 @@ public:
{
OUT_SAVE_INST_DATA;
- std::string str_data;
-
std::ostringstream saveStream;
saveStream << "D K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3];
- str_data = saveStream.str();
-
OUT_SAVE_INST_DATA_COMPLETE;
- return str_data;
+ return saveStream.str();
}
void Load(const char* in)
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index 4a28ebe6495..b790ed518d5 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "forge_of_souls.h"
@@ -359,7 +361,7 @@ class DistanceCheck
public:
explicit DistanceCheck(Unit* _caster) : caster(_caster) { }
- bool operator() (Unit* unit)
+ bool operator() (WorldObject* unit) const
{
if (caster->GetExactDist2d(unit) <= 10.0f)
return true;
@@ -378,25 +380,25 @@ class spell_bronjahm_soulstorm_targeting : public SpellScriptLoader
{
PrepareSpellScript(spell_bronjahm_soulstorm_targeting_SpellScript);
- void FilterTargetsInitial(std::list<Unit*>& unitList)
+ void FilterTargetsInitial(std::list<WorldObject*>& targets)
{
- unitList.remove_if (DistanceCheck(GetCaster()));
- sharedUnitList = unitList;
+ targets.remove_if(DistanceCheck(GetCaster()));
+ sharedTargets = targets;
}
// use the same target for first and second effect
- void FilterTargetsSubsequent(std::list<Unit*>& unitList)
+ void FilterTargetsSubsequent(std::list<WorldObject*>& targets)
{
- unitList = sharedUnitList;
+ targets = sharedTargets;
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY);
}
- std::list<Unit*> sharedUnitList;
+ std::list<WorldObject*> sharedTargets;
};
SpellScript* GetSpellScript() const
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
index ad49f6cbce8..4fdcf96192b 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "forge_of_souls.h"
/*
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
index 1469e26fd20..c23479eea22 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "forge_of_souls.h"
enum Events
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
index bad4b8e38b2..618b2b6a9a6 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "forge_of_souls.h"
#define MAX_ENCOUNTER 2
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
index 9cfcb78f6f1..4df13d32bf8 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_reflection.h"
enum Yells
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
index a9bfb603794..8334a199791 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_reflection.h"
enum Yells
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
index 2abb60d5de2..26ec9e53213 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "halls_of_reflection.h"
enum Yells
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
index 3c4d05854bb..e3604890e39 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "halls_of_reflection.h"
#define MAX_ENCOUNTER 3
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
index a3b8c5df4e7..a12bd96f6df 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuras.h"
#include "pit_of_saron.h"
enum Yells
@@ -157,15 +160,19 @@ class boss_garfrost : public CreatureScript
void MovementInform(uint32 type, uint32 id)
{
- if (type != POINT_MOTION_TYPE || id != POINT_FORGE)
+ if (type != EFFECT_MOTION_TYPE || id != POINT_FORGE)
return;
if (events.GetPhaseMask() & PHASE_TWO_MASK)
+ {
DoCast(me, SPELL_FORGE_BLADE);
+ SetEquipmentSlots(false, EQUIP_ID_SWORD);
+ }
if (events.GetPhaseMask() & PHASE_THREE_MASK)
{
me->RemoveAurasDueToSpell(SPELL_FORGE_BLADE_HELPER);
DoCast(me, SPELL_FORGE_MACE);
+ SetEquipmentSlots(false, EQUIP_ID_MACE);
}
events.ScheduleEvent(EVENT_RESUME_ATTACK, 5000);
}
@@ -177,10 +184,6 @@ class boss_garfrost : public CreatureScript
if (Aura* aura = target->GetAura(SPELL_PERMAFROST_HELPER))
_permafrostStack = std::max<uint32>(_permafrostStack, aura->GetStackAmount());
}
- else if (spell->Id == SPELL_FORGE_BLADE)
- SetEquipmentSlots(false, EQUIP_ID_SWORD);
- else if (spell->Id == SPELL_FORGE_MACE)
- SetEquipmentSlots(false, EQUIP_ID_MACE);
}
uint32 GetData(uint32 /*type*/)
@@ -205,7 +208,7 @@ class boss_garfrost : public CreatureScript
case EVENT_THROW_SARONITE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
- Talk(SAY_THROW_SARONITE);
+ Talk(SAY_THROW_SARONITE, target->GetGUID());
DoCast(target, SPELL_THROW_SARONITE);
}
events.ScheduleEvent(EVENT_THROW_SARONITE, urand(12500, 20000));
@@ -217,7 +220,7 @@ class boss_garfrost : public CreatureScript
case EVENT_DEEP_FREEZE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
- Talk(SAY_CAST_DEEP_FREEZE);
+ Talk(SAY_CAST_DEEP_FREEZE, target->GetGUID());
DoCast(target, SPELL_DEEP_FREEZE);
}
events.ScheduleEvent(EVENT_DEEP_FREEZE, 35000, 0, PHASE_THREE);
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
index fa260cb298d..0d6e779c006 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "pit_of_saron.h"
#include "Vehicle.h"
@@ -225,13 +228,13 @@ class boss_ick : public CreatureScript
case EVENT_TOXIC_WASTE:
if (Creature* krick = GetKrick())
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- krick->CastSpell(target, SPELL_TOXIC_WASTE, false);
+ krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
break;
case EVENT_SHADOW_BOLT:
if (Creature* krick = GetKrick())
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
- krick->CastSpell(target, SPELL_SHADOW_BOLT, false);
+ krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
return;
case EVENT_MIGHTY_KICK:
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
index 8d015adf4a4..ef4d9182f82 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "pit_of_saron.h"
#include "Vehicle.h"
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
index 1301acf4c99..a6537c45d6f 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "pit_of_saron.h"
// positions for Martin Victus (37591) and Gorkun Ironskull (37592)
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
index b6c821ef66a..eba19403517 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "pit_of_saron.h"
#include "Vehicle.h"
diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
index b66c3d795f3..fd1aba79e83 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
@@ -19,7 +19,8 @@
* Comment: The event with the Living Mojos is not implemented, just is done that when one of the mojos around the boss take damage will make the boss enter in combat!
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "gundrak.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
index 3e803c24d61..b75c5cbc2a9 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "gundrak.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
index be9b09a1263..0d89c402054 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "gundrak.h"
//Spells
diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
index 1085e993322..c1301dbd2d0 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "gundrak.h"
enum eSpells
diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
index b827f43dc99..251c9ec2b83 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuras.h"
#include "gundrak.h"
//Spells
diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
index c22a0e17cd5..15315c721d7 100644
--- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
+++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "gundrak.h"
#define MAX_ENCOUNTER 5
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
index d091a87dbfe..6e7e3c49ef8 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -1296,7 +1296,7 @@ class npc_dark_nucleus : public CreatureScript
void Reset()
{
- me->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_DEFENSIVE);
me->CastSpell(me, SPELL_SHADOW_RESONANCE_AURA, true);
}
@@ -1315,15 +1315,12 @@ class npc_dark_nucleus : public CreatureScript
void MoveInLineOfSight(Unit* who)
{
- if (me->GetDistance(who) >= 15.0f)
- return;
-
ScriptedAI::MoveInLineOfSight(who);
}
void DamageTaken(Unit* attacker, uint32& /*damage*/)
{
- if (attacker == me || attacker == me->getVictim())
+ if (attacker == me)
return;
me->DeleteThreatList();
@@ -1339,12 +1336,16 @@ class npc_dark_nucleus : public CreatureScript
{
_targetAuraCheck = 1000;
if (Unit* victim = me->getVictim())
+ {
if (me->GetDistance(victim) < 15.0f &&
!victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()))
{
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
me->ClearUnitState(UNIT_STATE_CASTING);
}
+ else
+ MoveInLineOfSight(me->getVictim());
+ }
}
else
_targetAuraCheck -= diff;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
index ee966256e2b..0d092ec86b2 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
@@ -631,9 +631,9 @@ class BloodboltHitCheck
public:
explicit BloodboltHitCheck(LanaThelAI* ai) : _ai(ai) {}
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- return _ai->WasBloodbolted(unit->GetGUID());
+ return _ai->WasBloodbolted(object->GetGUID());
}
private:
@@ -661,13 +661,13 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader
return GetCaster()->GetEntry() == NPC_BLOOD_QUEEN_LANA_THEL;
}
- void FilterTargets(std::list<Unit*>& targets)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
uint32 targetCount = (targets.size() + 2) / 3;
- targets.remove_if (BloodboltHitCheck(static_cast<LanaThelAI*>(GetCaster()->GetAI())));
+ targets.remove_if(BloodboltHitCheck(static_cast<LanaThelAI*>(GetCaster()->GetAI())));
Trinity::Containers::RandomResizeList(targets, targetCount);
// mark targets now, effect hook has missile travel time delay (might cast next in that time)
- for (std::list<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
+ for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT);
}
@@ -679,7 +679,7 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_bloodbolt_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_bloodbolt_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_blood_queen_bloodbolt_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -699,19 +699,19 @@ class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader
{
PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove_if (Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN));
+ targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN));
bool remove = true;
- std::list<Unit*>::const_iterator itrEnd = unitList.end(), itr, itr2;
+ std::list<WorldObject*>::const_iterator itrEnd = targets.end(), itr, itr2;
// we can do this, unitList is MAX 4 in size
- for (itr = unitList.begin(); itr != itrEnd && remove; ++itr)
+ for (itr = targets.begin(); itr != itrEnd && remove; ++itr)
{
if (!GetCaster()->IsWithinDist(*itr, 5.0f, false))
remove = false;
- for (itr2 = unitList.begin(); itr2 != itrEnd && remove; ++itr2)
+ for (itr2 = targets.begin(); itr2 != itrEnd && remove; ++itr2)
if (itr != itr2 && !(*itr2)->IsWithinDist(*itr, 5.0f, false))
remove = false;
}
@@ -721,14 +721,14 @@ class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
{
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN);
- unitList.clear();
+ targets.clear();
}
}
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
@@ -785,15 +785,15 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg_target : public SpellScriptLo
{
PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN));
+ unitList.remove_if(Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN));
unitList.push_back(GetCaster());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 494be259baa..5d3a6814eb2 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -1198,34 +1198,34 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
return true;
}
- void FilterTargetsInitial(std::list<Unit*>& unitList)
+ void FilterTargetsInitial(std::list<WorldObject*>& targets)
{
- if (unitList.empty())
+ if (targets.empty())
return;
// select one random target, with preference of ranged targets
uint32 targetsAtRange = 0;
uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4);
- unitList.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
+ targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
// get target count at range
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr, ++targetsAtRange)
+ for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange)
if ((*itr)->GetDistance(GetCaster()) < 12.0f)
break;
// set the upper cap
if (targetsAtRange < minTargets)
- targetsAtRange = std::min<uint32>(unitList.size() - 1, minTargets);
+ targetsAtRange = std::min<uint32>(targets.size() - 1, minTargets);
- std::list<Unit*>::const_iterator itr = unitList.begin();
+ std::list<WorldObject*>::const_iterator itr = targets.begin();
std::advance(itr, urand(0, targetsAtRange));
target = *itr;
- unitList.clear();
- unitList.push_back(target);
+ targets.clear();
+ targets.push_back(target);
}
// use the same target for first and second effect
- void FilterTargetsSubsequent(std::list<Unit*>& unitList)
+ void FilterTargetsSubsequent(std::list<WorldObject*>& unitList)
{
if (!target)
return;
@@ -1241,12 +1241,12 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
}
- Unit* target;
+ WorldObject* target;
};
SpellScript* GetSpellScript() const
@@ -1269,20 +1269,20 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove(GetCaster()->getVictim());
- if (unitList.empty())
+ targets.remove(GetCaster()->getVictim());
+ if (targets.empty())
return;
- Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList);
- unitList.clear();
- unitList.push_back(target);
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ targets.clear();
+ targets.push_back(target);
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_boiling_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_boiling_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index 1672d8b2d87..0c5cb0aba52 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
@@ -416,7 +416,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader
{
PrepareSpellScript(spell_marrowgar_coldflame_SpellScript);
- void SelectTarget(std::list<Unit*>& targets)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
targets.clear();
// select any unit but not the tank (by owners threatlist)
@@ -438,7 +438,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_marrowgar_coldflame_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_marrowgar_coldflame_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_marrowgar_coldflame_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index a0fca522f61..7f6448382ba 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -23,6 +23,7 @@
#include "Spell.h"
#include "icecrown_citadel.h"
#include "Vehicle.h"
+#include "GridNotifiers.h"
enum ScriptTexts
{
@@ -185,12 +186,15 @@ class AbominationDespawner
if (Vehicle* veh = summon->GetVehicleKit())
veh->RemoveAllPassengers(); // also despawns the vehicle
+ // Found unit is Mutated Abomination, remove it
return true;
}
+ // Found unit is not Mutated Abomintaion, leave it
return false;
}
+ // No unit found, remove from SummonList
return true;
}
@@ -198,6 +202,19 @@ class AbominationDespawner
Unit* _owner;
};
+struct RotfaceHeightCheck
+{
+ RotfaceHeightCheck(Creature* rotface) : _rotface(rotface) { }
+
+ bool operator()(Creature* stalker) const
+ {
+ return stalker->GetPositionZ() < _rotface->GetPositionZ() + 5.0f;
+ }
+
+private:
+ Creature* _rotface;
+};
+
class boss_professor_putricide : public CreatureScript
{
public:
@@ -246,7 +263,7 @@ class boss_professor_putricide : public CreatureScript
events.Reset();
events.ScheduleEvent(EVENT_BERSERK, 600000);
events.ScheduleEvent(EVENT_SLIME_PUDDLE, 10000);
- events.ScheduleEvent(EVENT_UNSTABLE_EXPERIMENT, urand(25000, 30000));
+ events.ScheduleEvent(EVENT_UNSTABLE_EXPERIMENT, urand(30000, 35000));
if (IsHeroic())
events.ScheduleEvent(EVENT_UNBOUND_PLAGUE, 20000);
@@ -295,16 +312,16 @@ class boss_professor_putricide : public CreatureScript
// no possible aura seen in sniff adding the aurastate
summon->ModifyAuraState(AURA_STATE_UNKNOWN22, true);
summon->CastSpell(summon, SPELL_GASEOUS_BLOAT_PROC, true);
- summon->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, summon, false);
+ summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
summon->SetReactState(REACT_PASSIVE);
- return;
+ break;
case NPC_VOLATILE_OOZE:
// no possible aura seen in sniff adding the aurastate
summon->ModifyAuraState(AURA_STATE_UNKNOWN19, true);
summon->CastSpell(summon, SPELL_OOZE_ERUPTION_SEARCH_PERIODIC, true);
- summon->CastSpell(summon, SPELL_VOLATILE_OOZE_ADHESIVE, false);
+ summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
summon->SetReactState(REACT_PASSIVE);
- return;
+ break;
case NPC_CHOKING_GAS_BOMB:
summon->CastSpell(summon, SPELL_CHOKING_GAS_BOMB_PERIODIC, true);
summon->CastSpell(summon, SPELL_CHOKING_GAS_EXPLOSION_TRIGGER, true);
@@ -426,7 +443,8 @@ class boss_professor_putricide : public CreatureScript
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
{
std::list<Creature*> list;
- GetCreatureListWithEntryInGrid(list, rotface, NPC_PUDDLE_STALKER, 36.0f);
+ GetCreatureListWithEntryInGrid(list, rotface, NPC_PUDDLE_STALKER, 50.0f);
+ list.remove_if(RotfaceHeightCheck(rotface));
if (list.size() > 4)
{
list.sort(Trinity::ObjectDistanceOrderPred(rotface));
@@ -508,7 +526,6 @@ class boss_professor_putricide : public CreatureScript
SetPhase(PHASE_COMBAT_3);
events.ScheduleEvent(EVENT_MUTATED_PLAGUE, 25000);
events.CancelEvent(EVENT_UNSTABLE_EXPERIMENT);
- summons.remove_if(AbominationDespawner(me));
break;
default:
break;
@@ -641,7 +658,7 @@ class boss_professor_putricide : public CreatureScript
case EVENT_UNBOUND_PLAGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me)))
{
- me->CastCustomSpell(SPELL_UNBOUND_PLAGUE, SPELLVALUE_BASE_POINT0, 775, target);
+ DoCast(target, SPELL_UNBOUND_PLAGUE);
DoCast(target, SPELL_UNBOUND_PLAGUE_SEARCHER);
}
events.ScheduleEvent(EVENT_UNBOUND_PLAGUE, 90000);
@@ -666,6 +683,7 @@ class boss_professor_putricide : public CreatureScript
me->SetFacingToObject(face);
me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
Talk(SAY_TRANSFORM_2);
+ summons.remove_if(AbominationDespawner(me));
events.ScheduleEvent(EVENT_RESUME_ATTACK, 8500, 0, PHASE_COMBAT_3);
break;
default:
@@ -700,57 +718,78 @@ class boss_professor_putricide : public CreatureScript
}
};
-class npc_volatile_ooze : public CreatureScript
+class npc_putricide_oozeAI : public ScriptedAI
{
public:
- npc_volatile_ooze() : CreatureScript("npc_volatile_ooze") { }
+ npc_putricide_oozeAI(Creature* creature, uint32 hitTargetSpellId) : ScriptedAI(creature),
+ _newTargetSelectTimer(0), _hitTargetSpellId(hitTargetSpellId)
+ {
+ }
- struct npc_putricide_oozeAI : public ScriptedAI
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell)
{
- npc_putricide_oozeAI(Creature* creature) : ScriptedAI(creature)
- {
- _newTargetSelectTimer = 0;
- }
+ if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(_hitTargetSpellId, me))
+ _newTargetSelectTimer = 1000;
+ }
- void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell)
- {
- if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_OOZE_ERUPTION, me))
- _newTargetSelectTimer = 1000;
- }
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
+ {
+ if (spell->Id == SPELL_TEAR_GAS_CREATURE)
+ _newTargetSelectTimer = 1000;
+ }
- void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
+ void UpdateAI(uint32 const diff)
+ {
+ if (!UpdateVictim() && !_newTargetSelectTimer)
+ return;
+
+ if (!_newTargetSelectTimer && !me->IsNonMeleeSpellCasted(false, false, true, false, true))
+ _newTargetSelectTimer = 1000;
+
+ DoMeleeAttackIfReady();
+
+ if (!_newTargetSelectTimer)
+ return;
+
+ if (me->HasAura(SPELL_TEAR_GAS_CREATURE))
+ return;
+
+ if (_newTargetSelectTimer <= diff)
{
- if (spell->Id == SPELL_TEAR_GAS_CREATURE)
- _newTargetSelectTimer = 1000;
+ _newTargetSelectTimer = 0;
+ CastMainSpell();
}
+ else
+ _newTargetSelectTimer -= diff;
+ }
- void UpdateAI(uint32 const diff)
- {
- if (!UpdateVictim() && !_newTargetSelectTimer)
- return;
+ virtual void CastMainSpell() = 0;
- if (!_newTargetSelectTimer)
- return;
+ private:
+ uint32 _hitTargetSpellId;
+ uint32 _newTargetSelectTimer;
+};
- if (me->HasAura(SPELL_TEAR_GAS_CREATURE))
- return;
+class npc_volatile_ooze : public CreatureScript
+{
+ public:
+ npc_volatile_ooze() : CreatureScript("npc_volatile_ooze") { }
- if (_newTargetSelectTimer <= diff)
- {
- _newTargetSelectTimer = 0;
- me->CastSpell(me, SPELL_VOLATILE_OOZE_ADHESIVE, false);
- }
- else
- _newTargetSelectTimer -= diff;
+ struct npc_volatile_oozeAI : public npc_putricide_oozeAI
+ {
+ npc_volatile_oozeAI(Creature* creature) : npc_putricide_oozeAI(creature, SPELL_OOZE_ERUPTION)
+ {
}
- private:
- uint32 _newTargetSelectTimer;
+ void CastMainSpell()
+ {
+ me->CastSpell(me, SPELL_VOLATILE_OOZE_ADHESIVE, false);
+ }
};
CreatureAI* GetAI(Creature* creature) const
{
- return GetIcecrownCitadelAI<npc_putricide_oozeAI>(creature);
+ return GetIcecrownCitadelAI<npc_volatile_oozeAI>(creature);
}
};
@@ -759,45 +798,16 @@ class npc_gas_cloud : public CreatureScript
public:
npc_gas_cloud() : CreatureScript("npc_gas_cloud") { }
- struct npc_gas_cloudAI : public ScriptedAI
+ struct npc_gas_cloudAI : public npc_putricide_oozeAI
{
- npc_gas_cloudAI(Creature* creature) : ScriptedAI(creature)
+ npc_gas_cloudAI(Creature* creature) : npc_putricide_oozeAI(creature, SPELL_EXPUNGED_GAS)
{
_newTargetSelectTimer = 0;
}
- void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell)
+ void CastMainSpell()
{
- if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_EXPUNGED_GAS, me))
- _newTargetSelectTimer = 1000;
- }
-
- void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
- {
- if (spell->Id == SPELL_TEAR_GAS_CREATURE)
- _newTargetSelectTimer = 1000;
- }
-
- void UpdateAI(uint32 const diff)
- {
- if (!UpdateVictim() && !_newTargetSelectTimer)
- return;
-
- DoMeleeAttackIfReady();
-
- if (!_newTargetSelectTimer)
- return;
-
- if (me->HasAura(SPELL_TEAR_GAS_CREATURE))
- return;
-
- if (_newTargetSelectTimer <= diff)
- {
- _newTargetSelectTimer = 0;
- me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false);
- }
- else
- _newTargetSelectTimer -= diff;
+ me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false);
}
private:
@@ -868,26 +878,26 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
- void SelectTarget(std::list<Unit*>& targetList)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
- if (targetList.empty())
+ if (targets.empty())
{
FinishCast(SPELL_FAILED_NO_VALID_TARGETS);
GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update
return;
}
- Unit* target = Trinity::Containers::SelectRandomContainerElement(targetList);
- targetList.clear();
- targetList.push_back(target);
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ targets.clear();
+ targets.push_back(target);
_target = target;
}
- void SetTarget(std::list<Unit*>& targetList)
+ void SetTarget(std::list<WorldObject*>& targets)
{
- targetList.clear();
+ targets.clear();
if (_target)
- targetList.push_back(_target);
+ targets.push_back(_target);
}
void StartAttack()
@@ -898,26 +908,15 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff
}
- // temporary, until SelectTarget are not called on empty lists
- void CheckTarget()
- {
- if (_target)
- return;
-
- FinishCast(SPELL_FAILED_NO_VALID_TARGETS);
- GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update
- }
-
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
AfterHit += SpellHitFn(spell_putricide_ooze_channel_SpellScript::StartAttack);
- OnCast += SpellCastFn(spell_putricide_ooze_channel_SpellScript::CheckTarget);
}
- Unit* _target;
+ WorldObject* _target;
};
SpellScript* GetSpellScript() const
@@ -931,7 +930,7 @@ class ExactDistanceCheck
public:
ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {}
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* unit) const
{
return _source->GetExactDist2d(unit) > _dist;
}
@@ -950,15 +949,15 @@ class spell_putricide_slime_puddle : public SpellScriptLoader
{
PrepareSpellScript(spell_putricide_slime_puddle_SpellScript);
- void ScaleRange(std::list<Unit*>& targets)
+ void ScaleRange(std::list<WorldObject*>& targets)
{
targets.remove_if(ExactDistanceCheck(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X)));
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY);
}
};
@@ -1123,6 +1122,22 @@ class spell_putricide_unbound_plague : public SpellScriptLoader
return true;
}
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (AuraEffect const* eff = GetCaster()->GetAuraEffect(SPELL_UNBOUND_PLAGUE_SEARCHER, EFFECT_0))
+ {
+ if (eff->GetTickNumber() < 2)
+ {
+ targets.clear();
+ return;
+ }
+ }
+
+
+ targets.remove_if(Trinity::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster())));
+ Trinity::Containers::RandomResizeList(targets, 1);
+ }
+
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (!GetHitUnit())
@@ -1157,6 +1172,7 @@ class spell_putricide_unbound_plague : public SpellScriptLoader
void Register()
{
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_unbound_plague_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
OnEffectHitTarget += SpellEffectFn(spell_putricide_unbound_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -1176,13 +1192,13 @@ class spell_putricide_eat_ooze : public SpellScriptLoader
{
PrepareSpellScript(spell_putricide_eat_ooze_SpellScript);
- void SelectTarget(std::list<Unit*>& targets)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
- Unit* target = targets.front();
+ WorldObject* target = targets.front();
targets.clear();
targets.push_back(target);
}
@@ -1209,7 +1225,7 @@ class spell_putricide_eat_ooze : public SpellScriptLoader
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_putricide_eat_ooze_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_eat_ooze_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_eat_ooze_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY);
}
};
@@ -1456,15 +1472,15 @@ class spell_putricide_mutated_transformation_dmg : public SpellScriptLoader
{
PrepareSpellScript(spell_putricide_mutated_transformation_dmg_SpellScript);
- void FilterTargetsInitial(std::list<Unit*>& unitList)
+ void FilterTargetsInitial(std::list<WorldObject*>& targets)
{
if (Unit* owner = ObjectAccessor::GetUnit(*GetCaster(), GetCaster()->GetCreatorGUID()))
- unitList.remove(owner);
+ targets.remove(owner);
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index a4ab13f6ada..5a0560293da 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
@@ -449,23 +449,23 @@ class spell_rotface_ooze_flood : public SpellScriptLoader
GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), false, NULL, NULL, GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : 0);
}
- void FilterTargets(std::list<Unit*>& targetList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
// get 2 targets except 2 nearest
- targetList.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
+ targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
// .resize() runs pop_back();
- if (targetList.size() > 4)
- targetList.resize(4);
+ if (targets.size() > 4)
+ targets.resize(4);
- while (targetList.size() > 2)
- targetList.pop_front();
+ while (targets.size() > 2)
+ targets.pop_front();
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_rotface_ooze_flood_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_ooze_flood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_ooze_flood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
@@ -490,21 +490,21 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& targets)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
// remove targets with this aura already
// tank is not on this list
- targets.remove_if (Trinity::UnitAuraCheck(true, GetSpellInfo()->Id));
+ targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id));
if (targets.empty())
return;
- Unit* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
targets.clear();
targets.push_back(target);
_target = target;
}
- void ReplaceTargets(std::list<Unit*>& targets)
+ void ReplaceTargets(std::list<WorldObject*>& targets)
{
targets.clear();
if (_target)
@@ -520,13 +520,13 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
AfterHit += SpellHitFn(spell_rotface_mutated_infection_SpellScript::NotifyTargets);
}
- Unit* _target;
+ WorldObject* _target;
};
SpellScript* GetSpellScript() const
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index 9baf6ba7a00..e3c0f2260df 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -19,6 +19,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
+#include "GridNotifiers.h"
#include "icecrown_citadel.h"
enum Texts
@@ -183,7 +184,7 @@ class FrostBombExplosion : public BasicEvent
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
{
- _owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, true, NULL, NULL, _sindragosaGUID);
+ _owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, false, NULL, NULL, _sindragosaGUID);
_owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL);
return true;
}
@@ -200,7 +201,7 @@ class boss_sindragosa : public CreatureScript
struct boss_sindragosaAI : public BossAI
{
- boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA)
+ boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA), _summoned(false)
{
}
@@ -220,7 +221,7 @@ class boss_sindragosa : public CreatureScript
_isInAirPhase = false;
_isThirdPhase = false;
- if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255)
+ if (!_summoned)
{
me->SetCanFly(true);
me->SetDisableGravity(true);
@@ -266,10 +267,13 @@ class boss_sindragosa : public CreatureScript
{
if (action == ACTION_START_FROSTWYRM)
{
+ if (_summoned)
+ return;
+
+ _summoned = true;
if (TempSummon* summon = me->ToTempSummon())
summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN);
- instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 255);
if (me->isDead())
return;
@@ -550,6 +554,7 @@ class boss_sindragosa : public CreatureScript
uint8 _mysticBuffetStack;
bool _isInAirPhase;
bool _isThirdPhase;
+ bool _summoned;
};
CreatureAI* GetAI(Creature* creature) const
@@ -642,7 +647,7 @@ class npc_spinestalker : public CreatureScript
struct npc_spinestalkerAI : public ScriptedAI
{
- npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
+ npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false)
{
}
@@ -651,7 +656,7 @@ class npc_spinestalker : public CreatureScript
// Increase add count
if (!me->isDead())
{
- _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade
+ _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade
Reset();
}
}
@@ -664,7 +669,7 @@ class npc_spinestalker : public CreatureScript
_events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(8000, 12000));
me->SetReactState(REACT_DEFENSIVE);
- if (_instance->GetData(DATA_SPINESTALKER) != 255)
+ if (!_summoned)
{
me->SetCanFly(true);
me->SetDisableGravity(true);
@@ -674,7 +679,7 @@ class npc_spinestalker : public CreatureScript
void JustRespawned()
{
ScriptedAI::JustRespawned();
- _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade
+ _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade
}
void JustDied(Unit* /*killer*/)
@@ -686,7 +691,10 @@ class npc_spinestalker : public CreatureScript
{
if (action == ACTION_START_FROSTWYRM)
{
- _instance->SetData(DATA_SPINESTALKER, 255);
+ if (_summoned)
+ return;
+
+ _summoned = true;
if (me->isDead())
return;
@@ -753,6 +761,7 @@ class npc_spinestalker : public CreatureScript
private:
EventMap _events;
InstanceScript* _instance;
+ bool _summoned;
};
CreatureAI* GetAI(Creature* creature) const
@@ -768,7 +777,7 @@ class npc_rimefang : public CreatureScript
struct npc_rimefangAI : public ScriptedAI
{
- npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
+ npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false)
{
}
@@ -777,7 +786,7 @@ class npc_rimefang : public CreatureScript
// Increase add count
if (!me->isDead())
{
- _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade
+ _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade
Reset();
}
}
@@ -790,7 +799,7 @@ class npc_rimefang : public CreatureScript
me->SetReactState(REACT_DEFENSIVE);
_icyBlastCounter = 0;
- if (_instance->GetData(DATA_RIMEFANG) != 255)
+ if (!_summoned)
{
me->SetCanFly(true);
me->SetDisableGravity(true);
@@ -800,7 +809,7 @@ class npc_rimefang : public CreatureScript
void JustRespawned()
{
ScriptedAI::JustRespawned();
- _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade
+ _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade
}
void JustDied(Unit* /*killer*/)
@@ -812,7 +821,10 @@ class npc_rimefang : public CreatureScript
{
if (action == ACTION_START_FROSTWYRM)
{
- _instance->SetData(DATA_RIMEFANG, 255);
+ if (_summoned)
+ return;
+
+ _summoned = true;
if (me->isDead())
return;
@@ -906,6 +918,7 @@ class npc_rimefang : public CreatureScript
EventMap _events;
InstanceScript* _instance;
uint8 _icyBlastCounter;
+ bool _summoned;
};
CreatureAI* GetAI(Creature* creature) const
@@ -933,7 +946,7 @@ class npc_sindragosa_trash : public CreatureScript
if (!me->isDead())
{
if (me->GetEntry() == NPC_FROSTWING_WHELP)
- _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade
+ _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade
Reset();
}
}
@@ -956,7 +969,7 @@ class npc_sindragosa_trash : public CreatureScript
// Increase add count
if (me->GetEntry() == NPC_FROSTWING_WHELP)
- _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade
+ _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade
}
void SetData(uint32 type, uint32 data)
@@ -1029,12 +1042,31 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
bool Load()
{
_targetCount = 0;
- return true;
+
+ // This script should execute only in Icecrown Citadel
+ if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap())
+ if (instance->GetInstanceScript())
+ if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName))
+ return true;
+
+ return false;
}
- void CountTargets(std::list<Unit*>& unitList)
+ void SelectDest()
{
- _targetCount = unitList.size();
+ if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest()))
+ {
+ float destX = float(rand_norm()) * 75.0f + 4350.0f;
+ float destY = float(rand_norm()) * 75.0f + 2450.0f;
+ float destZ = 205.0f; // random number close to ground, get exact in next call
+ GetCaster()->UpdateGroundPositionZ(destX, destY, destZ);
+ dest->Relocate(destX, destY, destZ);
+ }
+ }
+
+ void CountTargets(std::list<WorldObject*>& targets)
+ {
+ _targetCount = targets.size();
}
void HandleDummy(SpellEffIndex effIndex)
@@ -1045,10 +1077,10 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
return;
float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
- uint32 minResistFactor = uint32((resistance / (resistance + 510.0f))* 10.0f) * 2;
- uint32 randomResist = urand(0, (9 - minResistFactor) * 100)/100 + minResistFactor;
+ uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2;
+ uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor;
- uint32 damage = (uint32(GetEffectValue()/_targetCount) * randomResist) / 10;
+ uint32 damage = (uint32(GetEffectValue() / _targetCount) * randomResist) / 10;
SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
damageInfo.damage = damage;
@@ -1058,8 +1090,9 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
void Register()
{
+ BeforeCast += SpellCastFn(spell_sindragosa_s_fury_SpellScript::SelectDest);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY);
}
uint32 _targetCount;
@@ -1076,9 +1109,11 @@ class UnchainedMagicTargetSelector
public:
UnchainedMagicTargetSelector() { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- return unit->getPowerType() != POWER_MANA;
+ if (Unit* unit = object->ToUnit())
+ return unit->getPowerType() != POWER_MANA;
+ return true;
}
};
@@ -1091,7 +1126,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader
{
PrepareSpellScript(spell_sindragosa_unchained_magic_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(UnchainedMagicTargetSelector());
uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2);
@@ -1101,7 +1136,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -1284,7 +1319,7 @@ class MysticBuffetTargetFilter
public:
explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* unit) const
{
return !unit->IsWithinLOSInMap(_caster);
}
@@ -1302,14 +1337,14 @@ class spell_sindragosa_mystic_buffet : public SpellScriptLoader
{
PrepareSpellScript(spell_sindragosa_mystic_buffet_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove_if(MysticBuffetTargetFilter(GetCaster()));
+ targets.remove_if(MysticBuffetTargetFilter(GetCaster()));
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -1387,22 +1422,15 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();)
- {
- if ((*itr)->GetTypeId() != TYPEID_PLAYER)
- unitList.erase(itr++);
- else
- ++itr;
- }
-
- if (unitList.empty())
+ targets.remove_if(Trinity::ObjectTypeIdCheck(TYPEID_PLAYER, false));
+ if (targets.empty())
return;
- Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList);
- unitList.clear();
- unitList.push_back(target);
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ targets.clear();
+ targets.push_back(target);
}
void HandleForcedCast(SpellEffIndex effIndex)
@@ -1423,7 +1451,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_frostwarden_handler_order_whelp_SpellScript::HandleForcedCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -1503,7 +1531,7 @@ class at_sindragosa_lair : public AreaTriggerScript
if (Creature* rimefang = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_RIMEFANG)))
rimefang->AI()->DoAction(ACTION_START_FROSTWYRM);
- if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && instance->GetBossState(DATA_SINDRAGOSA) != DONE)
+ if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && !instance->GetData64(DATA_SINDRAGOSA) && instance->GetBossState(DATA_SINDRAGOSA) != DONE)
{
if (player->GetMap()->IsHeroic() && !instance->GetData(DATA_HEROIC_ATTEMPTS))
return true;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 4dab215d1da..ba1a0614cdf 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -138,7 +138,7 @@ enum Spells
SPELL_IN_FROSTMOURNE_ROOM = 74276,
SPELL_KILL_FROSTMOURNE_PLAYERS = 75127,
SPELL_HARVESTED_SOUL = 72679,
- SPELL_TRIGGER_VILE_SPIRIT_HEROIC = 73582,
+ SPELL_TRIGGER_VILE_SPIRIT_HEROIC = 73582, // TODO: Cast every 3 seconds during Frostmourne phase, targets a Wicked Spirit amd activates it
// Frostmourne
SPELL_LIGHTS_FAVOR = 69382,
@@ -152,6 +152,7 @@ enum Spells
SPELL_SUMMON_SPIRIT_BOMB_1 = 73581, // (Heroic)
SPELL_SUMMON_SPIRIT_BOMB_2 = 74299, // (Heroic)
SPELL_EXPLOSION = 73576, // Spirit Bomb (Heroic)
+ SPELL_HARVEST_SOUL_DAMAGE_AURA = 73655,
// Outro
SPELL_FURY_OF_FROSTMOURNE = 72350,
@@ -221,7 +222,7 @@ enum Events
EVENT_QUAKE_2 = 27,
EVENT_VILE_SPIRITS = 28,
EVENT_HARVEST_SOULS = 29, // heroic only
- EVENT_WICKED_SPIRITS = 30,
+ EVENT_BERSERK = 30,
EVENT_SOUL_RIP = 31,
EVENT_DESTROY_SOUL = 32,
EVENT_FROSTMOURNE_TALK_1 = 33,
@@ -249,19 +250,18 @@ enum Events
EVENT_OUTRO_TERENAS_TALK_2 = 55,
EVENT_OUTRO_TALK_7 = 56,
EVENT_OUTRO_TALK_8 = 57,
- EVENT_BERSERK = 58,
// Shambling Horror
- EVENT_SHOCKWAVE = 59,
- EVENT_ENRAGE = 60,
+ EVENT_SHOCKWAVE = 58,
+ EVENT_ENRAGE = 59,
// Raging Spirit
- EVENT_SOUL_SHRIEK = 61,
+ EVENT_SOUL_SHRIEK = 60,
// Strangulate Vehicle (Harvest Soul)
- EVENT_TELEPORT = 62,
- EVENT_MOVE_TO_LICH_KING = 63,
- EVENT_DESPAWN_SELF = 64,
+ EVENT_TELEPORT = 61,
+ EVENT_MOVE_TO_LICH_KING = 62,
+ EVENT_DESPAWN_SELF = 63,
};
enum EventGroups
@@ -391,7 +391,7 @@ class HeightDifferenceCheck
{
}
- bool operator()(Unit* unit) const
+ bool operator()(WorldObject* unit) const
{
return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse;
}
@@ -475,6 +475,32 @@ class VileSpiritActivateEvent : public BasicEvent
Creature* _owner;
};
+class TriggerWickedSpirit : public BasicEvent
+{
+ public:
+ explicit TriggerWickedSpirit(Creature* owner)
+ : _owner(owner), _counter(13)
+ {
+ }
+
+ bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ {
+ _owner->CastCustomSpell(SPELL_TRIGGER_VILE_SPIRIT_HEROIC, SPELLVALUE_MAX_TARGETS, 1, NULL, true);
+
+ if (--_counter)
+ {
+ _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(3000));
+ return false;
+ }
+
+ return true;
+ }
+
+ private:
+ Creature* _owner;
+ uint32 _counter;
+};
+
class boss_the_lich_king : public CreatureScript
{
public:
@@ -503,6 +529,8 @@ class boss_the_lich_king : public CreatureScript
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->GetMotionMaster()->MoveFall();
+ if (Creature* frostmourne = me->FindNearestCreature(NPC_FROSTMOURNE_TRIGGER, 50.0f))
+ frostmourne->DespawnOrUnsummon();
}
void EnterCombat(Unit* target)
@@ -601,8 +629,6 @@ class boss_the_lich_king : public CreatureScript
summons.DoAction(ACTION_TELEPORT_BACK, pred);
if (!IsHeroic())
Talk(SAY_LK_FROSTMOURNE_ESCAPE);
- else
- DoCastAOE(SPELL_TRIGGER_VILE_SPIRIT_HEROIC);
break;
}
default:
@@ -645,6 +671,8 @@ class boss_the_lich_king : public CreatureScript
if (events.GetPhaseMask() & PHASE_MASK_ONE && !HealthAbovePct(70))
{
events.SetPhase(PHASE_TRANSITION);
+ me->SetReactState(REACT_PASSIVE);
+ me->AttackStop();
me->GetMotionMaster()->MovePoint(POINT_CENTER_1, CenterPosition);
return;
}
@@ -652,6 +680,8 @@ class boss_the_lich_king : public CreatureScript
if (events.GetPhaseMask() & PHASE_MASK_TWO && !HealthAbovePct(40))
{
events.SetPhase(PHASE_TRANSITION);
+ me->SetReactState(REACT_PASSIVE);
+ me->AttackStop();
me->GetMotionMaster()->MovePoint(POINT_CENTER_2, CenterPosition);
return;
}
@@ -664,7 +694,8 @@ class boss_the_lich_king : public CreatureScript
events.SetPhase(PHASE_OUTRO);
summons.DespawnAll();
SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE);
- DoCastAOE(SPELL_FURY_OF_FROSTMOURNE);
+ me->InterruptNonMeleeSpells(true);
+ me->CastSpell((Unit*)NULL, SPELL_FURY_OF_FROSTMOURNE, TRIGGERED_NONE);
me->SetWalk(true);
events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO);
events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO);
@@ -712,7 +743,6 @@ class boss_the_lich_king : public CreatureScript
break;
case NPC_FROSTMOURNE_TRIGGER:
{
- summons.Summon(summon);
summon->CastSpell((Unit*)NULL, SPELL_BROKEN_FROSTMOURNE, true);
SendLightOverride(LIGHT_SOULSTORM, 10000);
@@ -724,16 +754,11 @@ class boss_the_lich_king : public CreatureScript
case NPC_VILE_SPIRIT:
{
summons.Summon(summon);
- if (events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE)
- {
- TeleportSpirit(summon);
- return;
- }
-
summon->SetReactState(REACT_PASSIVE);
summon->SetSpeed(MOVE_FLIGHT, 0.5f);
summon->GetMotionMaster()->MoveRandom(10.0f);
- summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000));
+ if (!(events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE))
+ summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000));
return;
}
case NPC_STRANGULATE_VEHICLE:
@@ -756,7 +781,6 @@ class boss_the_lich_king : public CreatureScript
case NPC_VALKYR_SHADOWGUARD:
case NPC_RAGING_SPIRIT:
case NPC_VILE_SPIRIT:
- case NPC_WICKED_SPIRIT:
summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_CORPSE_DESPAWN);
break;
default:
@@ -802,8 +826,6 @@ class boss_the_lich_king : public CreatureScript
me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
- me->SetReactState(REACT_PASSIVE);
- me->AttackStop();
DoCast(me, SPELL_REMORSELESS_WINTER_1);
events.DelayEvents(62500, EVENT_GROUP_BERSERK); // delay berserk timer, its not ticking during phase transitions
events.ScheduleEvent(EVENT_QUAKE, 62500, 0, PHASE_TRANSITION);
@@ -819,8 +841,6 @@ class boss_the_lich_king : public CreatureScript
me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
- me->SetReactState(REACT_PASSIVE);
- me->AttackStop();
DoCast(me, SPELL_REMORSELESS_WINTER_2);
summons.DespawnEntry(NPC_VALKYR_SHADOWGUARD);
events.DelayEvents(62500, EVENT_GROUP_BERSERK); // delay berserk timer, its not ticking during phase transitions
@@ -992,10 +1012,6 @@ class boss_the_lich_king : public CreatureScript
DoCastAOE(SPELL_VILE_SPIRITS);
events.ScheduleEvent(EVENT_VILE_SPIRITS, urand(35000, 40000), EVENT_GROUP_VILE_SPIRITS, PHASE_THREE);
break;
- case EVENT_WICKED_SPIRITS:
- DoCastAOE(SPELL_VILE_SPIRITS);
- events.ScheduleEvent(EVENT_WICKED_SPIRITS, urand(35000, 40000), 0, PHASE_FROSTMOURNE);
- break;
case EVENT_HARVEST_SOULS:
Talk(SAY_LK_HARVEST_SOUL);
DoCastAOE(SPELL_HARVEST_SOULS);
@@ -1003,7 +1019,6 @@ class boss_the_lich_king : public CreatureScript
events.SetPhase(PHASE_FROSTMOURNE); // will stop running UpdateVictim (no evading)
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
- events.ScheduleEvent(EVENT_WICKED_SPIRITS, events.GetNextEventTime(EVENT_VILE_SPIRITS) - events.GetTimer(), 0, PHASE_FROSTMOURNE);
events.DelayEvents(50000, EVENT_GROUP_VILE_SPIRITS);
events.RescheduleEvent(EVENT_DEFILE, 50000, 0, PHASE_THREE);
events.RescheduleEvent(EVENT_SOUL_REAPER, urand(57000, 62000), 0, PHASE_THREE);
@@ -1019,16 +1034,22 @@ class boss_the_lich_king : public CreatureScript
if (!triggers.empty())
{
triggers.sort(Trinity::ObjectDistanceOrderPred(terenas, true));
- Unit* spawner = triggers.front();
+ Creature* spawner = triggers.front();
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players
+ spawner->m_Events.AddEvent(new TriggerWickedSpirit(spawner), spawner->m_Events.CalculateTime(3000));
}
for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
if (summon && summon->GetEntry() == NPC_VILE_SPIRIT)
- TeleportSpirit(summon);
+ {
+ summon->m_Events.KillAllEvents(true);
+ summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(50000));
+ summon->GetMotionMaster()->MoveRandom(10.0f);
+ summon->SetReactState(REACT_PASSIVE);
+ }
}
}
break;
@@ -1099,22 +1120,6 @@ class boss_the_lich_king : public CreatureScript
}
private:
-
- void TeleportSpirit(Creature* summon)
- {
- float dist = me->GetObjectSize() + (15.0f - me->GetObjectSize()) * float(rand_norm());
- float angle = float(rand_norm()) * float(2.0f * M_PI);
- Position dest = TerenasSpawnHeroic;
- me->MovePosition(dest, dist, angle);
- dest.m_positionZ += 15.0f;
- summon->UpdateEntry(NPC_WICKED_SPIRIT);
- summon->SetReactState(REACT_PASSIVE);
- summon->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation());
- summon->SetSpeed(MOVE_FLIGHT, 0.5f);
- summon->m_Events.KillAllEvents(true);
- summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(1000));
- }
-
void SendMusicToPlayers(uint32 musicId) const
{
WorldPacket data(SMSG_PLAY_MUSIC, 4);
@@ -1635,8 +1640,13 @@ class npc_strangulate_vehicle : public CreatureScript
return;
if (TempSummon* summ = me->ToTempSummon())
+ {
if (Unit* summoner = summ->GetSummoner())
+ {
DoCast(summoner, SPELL_HARVEST_SOUL_TELEPORT_BACK);
+ summoner->RemoveAurasDueToSpell(SPELL_HARVEST_SOUL_DAMAGE_AURA);
+ }
+ }
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
lichKing->AI()->SummonedCreatureDespawn(me);
@@ -1993,6 +2003,10 @@ class npc_broken_frostmourne : public CreatureScript
_events.ScheduleEvent(EVENT_OUTRO_SUMMON_TERENAS, 6000, 0, PHASE_OUTRO);
}
+ void EnterEvadeMode()
+ {
+ }
+
void UpdateAI(uint32 const diff)
{
UpdateVictim();
@@ -2098,7 +2112,7 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader
CustomSpellValues values;
//values.AddSpellMod(SPELLVALUE_AURA_STACK, 2);
values.AddSpellMod(SPELLVALUE_MAX_TARGETS, 1);
- GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, true, NULL, NULL, GetCasterGUID());
+ GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
}
@@ -2190,7 +2204,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
- GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, true, NULL, NULL, GetCasterGUID());
+ GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
}
@@ -2209,7 +2223,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
- GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, true, NULL, NULL, GetCasterGUID());
+ GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
@@ -2274,7 +2288,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScriptLoader
{
PrepareSpellScript(spell_the_lich_king_shadow_trap_periodic_SpellScript);
- void CheckTargetCount(std::list<Unit*>& targets)
+ void CheckTargetCount(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
@@ -2284,7 +2298,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -2308,10 +2322,10 @@ class spell_the_lich_king_quake : public SpellScriptLoader
return GetCaster()->GetInstanceScript() != NULL;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
if (GameObject* platform = ObjectAccessor::GetGameObject(*GetCaster(), GetCaster()->GetInstanceScript()->GetData64(DATA_ARTHAS_PLATFORM)))
- unitList.remove_if(HeightDifferenceCheck(platform, 5.0f, false));
+ targets.remove_if(HeightDifferenceCheck(platform, 5.0f, false));
}
void HandleSendEvent(SpellEffIndex /*effIndex*/)
@@ -2322,7 +2336,7 @@ class spell_the_lich_king_quake : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_quake_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_quake_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHit += SpellEffectFn(spell_the_lich_king_quake_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
}
};
@@ -2349,7 +2363,7 @@ class spell_the_lich_king_ice_burst_target_search : public SpellScriptLoader
return true;
}
- void CheckTargetCount(std::list<Unit*>& unitList)
+ void CheckTargetCount(std::list<WorldObject*>& unitList)
{
if (unitList.empty())
return;
@@ -2357,12 +2371,16 @@ class spell_the_lich_king_ice_burst_target_search : public SpellScriptLoader
// if there is at least one affected target cast the explosion
GetCaster()->CastSpell(GetCaster(), SPELL_ICE_BURST, true);
if (GetCaster()->GetTypeId() == TYPEID_UNIT)
+ {
+ GetCaster()->ToCreature()->SetReactState(REACT_PASSIVE);
+ GetCaster()->AttackStop();
GetCaster()->ToCreature()->DespawnOrUnsummon(500);
+ }
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -2411,7 +2429,7 @@ class ExactDistanceCheck
public:
ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {}
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* unit)
{
return _source->GetExactDist2d(unit) > _dist;
}
@@ -2430,7 +2448,7 @@ class spell_the_lich_king_defile : public SpellScriptLoader
{
PrepareSpellScript(spell_the_lich_king_defile_SpellScript);
- void CorrectRange(std::list<Unit*>& targets)
+ void CorrectRange(std::list<WorldObject*>& targets)
{
targets.remove_if(ExactDistanceCheck(GetCaster(), 10.0f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X)));
}
@@ -2446,8 +2464,8 @@ class spell_the_lich_king_defile : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_the_lich_king_defile_SpellScript::ChangeDamageAndGrow);
}
};
@@ -2472,14 +2490,18 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader
static Position const offset = {0.0f, 0.0f, 15.0f, 0.0f};
WorldLocation* dest = const_cast<WorldLocation*>(GetExplTargetDest());
dest->RelocateOffset(offset);
+ GetHitDest()->RelocateOffset(offset);
// spirit bombs get higher
if (GetSpellInfo()->Effects[effIndex].MiscValue == NPC_SPIRIT_BOMB)
+ {
dest->RelocateOffset(offset);
+ GetHitDest()->RelocateOffset(offset);
+ }
}
void Register()
{
- OnEffectLaunch += SpellEffectFn(spell_the_lich_king_summon_into_air_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
+ OnEffectHit += SpellEffectFn(spell_the_lich_king_summon_into_air_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
}
};
@@ -2545,26 +2567,26 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader
return true;
}
- void SelectTarget(std::list<Unit*>& unitList)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
- if (unitList.empty())
+ if (targets.empty())
return;
- unitList.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id));
- if (unitList.empty())
+ targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id));
+ if (targets.empty())
return;
- _target = Trinity::Containers::SelectRandomContainerElement(unitList);
- unitList.clear();
- unitList.push_back(_target);
+ _target = Trinity::Containers::SelectRandomContainerElement(targets);
+ targets.clear();
+ targets.push_back(_target);
GetCaster()->GetAI()->SetGUID(_target->GetGUID());
}
- void ReplaceTarget(std::list<Unit*>& unitList)
+ void ReplaceTarget(std::list<WorldObject*>& targets)
{
- unitList.clear();
+ targets.clear();
if (_target)
- unitList.push_back(_target);
+ targets.push_back(_target);
}
void HandleScript(SpellEffIndex effIndex)
@@ -2575,12 +2597,12 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_valkyr_target_search_SpellScript::ReplaceTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_valkyr_target_search_SpellScript::ReplaceTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_valkyr_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
- Unit* _target;
+ WorldObject* _target;
};
SpellScript* GetSpellScript() const
@@ -2757,7 +2779,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
- void SelectTarget(std::list<Unit*>& targets)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
@@ -2778,11 +2800,11 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
- Unit* _target;
+ WorldObject* _target;
};
SpellScript* GetSpellScript() const
@@ -2805,7 +2827,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
- void CheckTargetCount(std::list<Unit*>& targets)
+ void CheckTargetCount(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
@@ -2822,7 +2844,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_vile_spirit_damage_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_vile_spirit_damage_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
Unit* _target;
@@ -2954,6 +2976,15 @@ class spell_the_lich_king_restore_soul : public SpellScriptLoader
lichKing->AI()->DoAction(ACTION_TELEPORT_BACK);
if (Creature* spawner = GetCaster()->FindNearestCreature(NPC_WORLD_TRIGGER_INFINITE_AOI, 50.0f))
spawner->RemoveAllAuras();
+
+ std::list<Creature*> spirits;
+ GetCaster()->GetCreatureListWithEntryInGrid(spirits, NPC_WICKED_SPIRIT, 200.0f);
+ for (std::list<Creature*>::iterator itr = spirits.begin(); itr != spirits.end(); ++itr)
+ {
+ (*itr)->m_Events.KillAllEvents(true);
+ (*itr)->SetReactState(REACT_PASSIVE);
+ (*itr)->AI()->EnterEvadeMode();
+ }
}
void RemoveAura()
@@ -3046,23 +3077,18 @@ class spell_the_lich_king_trigger_vile_spirit : public SpellScriptLoader
{
PrepareSpellScript(spell_the_lich_king_trigger_vile_spirit_SpellScript);
- void TeleportOutside()
+ void ActivateSpirit()
{
Creature* target = GetHitCreature();
if (!target)
return;
- Position dest;
- Position offset;
- TerenasSpawnHeroic.GetPositionOffsetTo(*target, offset);
- GetCaster()->GetPosition(&dest);
- dest.RelocateOffset(offset);
- target->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation());
+ VileSpiritActivateEvent(target).Execute(0, 0);
}
void Register()
{
- OnHit += SpellHitFn(spell_the_lich_king_trigger_vile_spirit_SpellScript::TeleportOutside);
+ OnHit += SpellHitFn(spell_the_lich_king_trigger_vile_spirit_SpellScript::ActivateSpirit);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index c40a521c794..826c62a4390 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
@@ -1013,11 +1013,8 @@ class npc_dream_portal : public CreatureScript
{
}
- void DoAction(int32 const action)
+ void OnSpellClick(Unit* /*clicker*/)
{
- if (action != EVENT_SPELLCLICK)
- return;
-
_used = true;
me->DespawnOrUnsummon();
}
@@ -1190,13 +1187,13 @@ class spell_dreamwalker_summoner : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& targets)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- targets.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
+ targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
if (targets.empty())
return;
- Unit* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
targets.clear();
targets.push_back(target);
}
@@ -1212,7 +1209,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_dreamwalker_summoner_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
}
};
@@ -1241,7 +1238,7 @@ class spell_dreamwalker_summon_suppresser : public SpellScriptLoader
std::list<Creature*> summoners;
GetCreatureListWithEntryInGrid(summoners, caster, NPC_WORLD_TRIGGER, 100.0f);
- summoners.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
+ summoners.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
Trinity::Containers::RandomResizeList(summoners, 2);
if (summoners.empty())
return;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 6fd3cd2a294..17e33912a86 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -19,6 +19,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
+#include "PassiveAI.h"
#include "Cell.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
@@ -158,6 +159,9 @@ enum Spells
SPELL_FEL_IRON_BOMB_UNDEAD = 71787,
SPELL_MACHINE_GUN_UNDEAD = 71788,
SPELL_ROCKET_LAUNCH_UNDEAD = 71786,
+
+ // Invisible Stalker (Float, Uninteractible, LargeAOI)
+ SPELL_SOUL_MISSILE = 72585,
};
// Helper defines
@@ -248,6 +252,9 @@ enum EventTypes
EVENT_RUPERT_FEL_IRON_BOMB = 52,
EVENT_RUPERT_MACHINE_GUN = 53,
EVENT_RUPERT_ROCKET_LAUNCH = 54,
+
+ // Invisible Stalker (Float, Uninteractible, LargeAOI)
+ EVENT_SOUL_MISSILE = 55,
};
enum DataTypesICC
@@ -1668,6 +1675,56 @@ class npc_impaling_spear : public CreatureScript
}
};
+class npc_arthas_teleport_visual : public CreatureScript
+{
+ public:
+ npc_arthas_teleport_visual() : CreatureScript("npc_arthas_teleport_visual") { }
+
+ struct npc_arthas_teleport_visualAI : public NullCreatureAI
+ {
+ npc_arthas_teleport_visualAI(Creature* creature) : NullCreatureAI(creature), _instance(creature->GetInstanceScript())
+ {
+ }
+
+ void Reset()
+ {
+ _events.Reset();
+ if (_instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE &&
+ _instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE &&
+ _instance->GetBossState(DATA_SINDRAGOSA) == DONE)
+ _events.ScheduleEvent(EVENT_SOUL_MISSILE, urand(1000, 6000));
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ if (_events.Empty())
+ return;
+
+ _events.Update(diff);
+
+ if (_events.ExecuteEvent() == EVENT_SOUL_MISSILE)
+ {
+ DoCastAOE(SPELL_SOUL_MISSILE);
+ _events.ScheduleEvent(EVENT_SOUL_MISSILE, urand(5000, 7000));
+ }
+ }
+
+ private:
+ InstanceScript* _instance;
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ // Distance from the center of the spire
+ if (creature->GetExactDist2d(4357.052f, 2769.421f) < 100.0f && creature->GetHomePosition().GetPositionZ() < 315.0f)
+ return GetIcecrownCitadelAI<npc_arthas_teleport_visualAI>(creature);
+
+ // Default to no script
+ return NULL;
+ }
+};
+
class spell_icc_stoneform : public SpellScriptLoader
{
public:
@@ -1777,15 +1834,15 @@ class DeathPlagueTargetSelector
public:
explicit DeathPlagueTargetSelector(Unit* caster) : _caster(caster) {}
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- if (unit == _caster)
+ if (object == _caster)
return true;
- if (unit->GetTypeId() != TYPEID_PLAYER)
+ if (object->GetTypeId() != TYPEID_PLAYER)
return true;
- if (unit->HasAura(SPELL_RECENTLY_INFECTED) || unit->HasAura(SPELL_DEATH_PLAGUE_AURA))
+ if (object->ToUnit()->HasAura(SPELL_RECENTLY_INFECTED) || object->ToUnit()->HasAura(SPELL_DEATH_PLAGUE_AURA))
return true;
return false;
@@ -1811,25 +1868,25 @@ class spell_frost_giant_death_plague : public SpellScriptLoader
}
// First effect
- void CountTargets(std::list<Unit*>& unitList)
+ void CountTargets(std::list<WorldObject*>& targets)
{
- unitList.remove(GetCaster());
- _failed = unitList.empty();
+ targets.remove(GetCaster());
+ _failed = targets.empty();
}
// Second effect
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
// Select valid targets for jump
- unitList.remove_if (DeathPlagueTargetSelector(GetCaster()));
- if (!unitList.empty())
+ targets.remove_if(DeathPlagueTargetSelector(GetCaster()));
+ if (!targets.empty())
{
- Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList);
- unitList.clear();
- unitList.push_back(target);
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ targets.clear();
+ targets.push_back(target);
}
- unitList.push_back(GetCaster());
+ targets.push_back(GetCaster());
}
void HandleScript(SpellEffIndex effIndex)
@@ -1843,8 +1900,8 @@ class spell_frost_giant_death_plague : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY);
OnEffectHitTarget += SpellEffectFn(spell_frost_giant_death_plague_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
@@ -1893,9 +1950,11 @@ class spell_icc_harvest_blight_specimen : public SpellScriptLoader
class AliveCheck
{
public:
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- return unit->isAlive();
+ if (Unit* unit = object->ToUnit())
+ return unit->isAlive();
+ return true;
}
};
@@ -1908,10 +1967,10 @@ class spell_svalna_revive_champion : public SpellScriptLoader
{
PrepareSpellScript(spell_svalna_revive_champion_SpellScript);
- void RemoveAliveTarget(std::list<Unit*>& unitList)
+ void RemoveAliveTarget(std::list<WorldObject*>& targets)
{
- unitList.remove_if(AliveCheck());
- Trinity::Containers::RandomResizeList(unitList, 2);
+ targets.remove_if(AliveCheck());
+ Trinity::Containers::RandomResizeList(targets, 2);
}
void Land(SpellEffIndex /*effIndex*/)
@@ -1931,7 +1990,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY);
OnEffectHit += SpellEffectFn(spell_svalna_revive_champion_SpellScript::Land, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -1974,6 +2033,33 @@ class spell_svalna_remove_spear : public SpellScriptLoader
}
};
+class spell_icc_soul_missile : public SpellScriptLoader
+{
+ public:
+ spell_icc_soul_missile() : SpellScriptLoader("spell_icc_soul_missile") { }
+
+ class spell_icc_soul_missile_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_icc_soul_missile_SpellScript);
+
+ void RelocateDest()
+ {
+ static Position const offset = {0.0f, 0.0f, 200.0f, 0.0f};
+ const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset);
+ }
+
+ void Register()
+ {
+ OnCast += SpellCastFn(spell_icc_soul_missile_SpellScript::RelocateDest);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_icc_soul_missile_SpellScript();
+ }
+};
+
class at_icc_saurfang_portal : public AreaTriggerScript
{
public:
@@ -2063,6 +2149,7 @@ void AddSC_icecrown_citadel()
new npc_captain_rupert();
new npc_frostwing_vrykul();
new npc_impaling_spear();
+ new npc_arthas_teleport_visual();
new spell_icc_stoneform();
new spell_icc_sprit_alarm();
new spell_frost_giant_death_plague();
@@ -2070,6 +2157,7 @@ void AddSC_icecrown_citadel()
new spell_trigger_spell_from_caster("spell_svalna_caress_of_death", SPELL_IMPALING_SPEAR_KILL);
new spell_svalna_revive_champion();
new spell_svalna_remove_spear();
+ new spell_icc_soul_missile();
new at_icc_saurfang_portal();
new at_icc_shutdown_traps();
new at_icc_start_blood_quickening();
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
index 224777c3db7..31639a698ef 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
@@ -51,6 +51,7 @@ enum SharedSpells
SPELL_GREEN_BLIGHT_RESIDUE = 72145,
// The Lich King
+ SPELL_ARTHAS_TELEPORTER_CEREMONY = 72915,
SPELL_FROSTMOURNE_TELEPORT_VISUAL = 73078,
};
@@ -275,6 +276,9 @@ enum CreaturesIds
NPC_WORLD_TRIGGER_INFINITE_AOI = 36171,
NPC_SPIRIT_BOMB = 39189,
NPC_FROSTMOURNE_TRIGGER = 38584,
+
+ // Generic
+ NPC_INVISIBLE_STALKER = 30298,
};
enum GameObjectsIds
@@ -345,6 +349,7 @@ enum GameObjectsIds
GO_SIGIL_OF_THE_FROSTWING = 202181,
// The Lich King
+ GO_SCOURGE_TRANSPORTER_LK = 202223,
GO_ARTHAS_PLATFORM = 202161,
GO_ARTHAS_PRECIPICE = 202078,
GO_DOODAD_ICECROWN_THRONEFROSTYWIND01 = 202188,
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
index 288fde28c38..650f426d29c 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
@@ -89,13 +89,6 @@ WeeklyQuest const WeeklyQuestData[WeeklyNPCs] =
{NPC_VALITHRIA_DREAMWALKER_QUEST, {QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10, QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25}}, // Respite for a Tormented Soul
};
-enum FrostwyrmFlags
-{
- FLAG_SPINESTALKER_SUMMONED = 0x01,
- FLAG_RIMEFANG_SUMMONED = 0x02,
- FLAG_SINDRAGOSA_SUMMONED = 0x04,
-};
-
class instance_icecrown_citadel : public InstanceMapScript
{
public:
@@ -137,6 +130,7 @@ class instance_icecrown_citadel : public InstanceMapScript
SindragosaGUID = 0;
SpinestalkerGUID = 0;
RimefangGUID = 0;
+ TheLichKingTeleportGUID = 0;
TheLichKingGUID = 0;
HighlordTirionFordringGUID = 0;
TerenasMenethilGUID = 0;
@@ -152,7 +146,6 @@ class instance_icecrown_citadel : public InstanceMapScript
ColdflameJetsState = NOT_STARTED;
BloodQuickeningState = NOT_STARTED;
BloodQuickeningMinutes = 0;
- FrostwyrmFlags = 0;
}
void FillInitialWorldStates(WorldPacket& data)
@@ -284,13 +277,14 @@ class instance_icecrown_citadel : public InstanceMapScript
break;
case NPC_SPINESTALKER:
SpinestalkerGUID = creature->GetGUID();
- if (!creature->isAlive())
- FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED;
break;
case NPC_RIMEFANG:
RimefangGUID = creature->GetGUID();
- if (!creature->isAlive())
- FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED;
+ break;
+ case NPC_INVISIBLE_STALKER:
+ // Teleporter visual at center
+ if (creature->GetExactDist2d(4357.052f, 2769.421f) < 10.0f)
+ creature->CastSpell(creature, SPELL_ARTHAS_TELEPORTER_CEREMONY, false);
break;
case NPC_THE_LICH_KING:
TheLichKingGUID = creature->GetGUID();
@@ -302,11 +296,22 @@ class instance_icecrown_citadel : public InstanceMapScript
case NPC_TERENAS_MENETHIL_FROSTMOURNE_H:
TerenasMenethilGUID = creature->GetGUID();
break;
+ case NPC_WICKED_SPIRIT:
+ // Remove corpse as soon as it dies (and respawn 10 seconds later)
+ creature->SetCorpseDelay(0);
+ creature->SetReactState(REACT_PASSIVE);
+ break;
default:
break;
}
}
+ void OnCreatureRemove(Creature* creature)
+ {
+ if (creature->GetEntry() == NPC_SINDRAGOSA)
+ SindragosaGUID = 0;
+ }
+
// Weekly quest spawn prevention
uint32 GetCreatureEntry(uint32 /*guidLow*/, CreatureData const* data)
{
@@ -357,49 +362,36 @@ class instance_icecrown_citadel : public InstanceMapScript
crok->AI()->SetGUID(creature->GetGUID(), ACTION_VRYKUL_DEATH);
break;
case NPC_FROSTWING_WHELP:
+ if (FrostwyrmGUIDs.empty())
+ return;
+
if (creature->AI()->GetData(1/*DATA_FROSTWYRM_OWNER*/) == DATA_SPINESTALKER)
{
- if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED)
- return;
-
- SpinestalkerTrash.erase(creature->GetGUID());
+ SpinestalkerTrash.erase(creature->GetDBTableGUIDLow());
if (SpinestalkerTrash.empty())
- {
- FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED;
if (Creature* spinestalk = instance->GetCreature(SpinestalkerGUID))
spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM);
- }
}
else
{
- if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED)
- return;
-
- RimefangTrash.erase(creature->GetGUID());
+ RimefangTrash.erase(creature->GetDBTableGUIDLow());
if (RimefangTrash.empty())
- {
- FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED;
if (Creature* spinestalk = instance->GetCreature(RimefangGUID))
spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM);
- }
}
break;
case NPC_RIMEFANG:
case NPC_SPINESTALKER:
{
- if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED)
- return;
-
if (instance->IsHeroic() && !HeroicAttempts)
return;
if (GetBossState(DATA_SINDRAGOSA) == DONE)
return;
- FrostwyrmGUIDs.erase(creature->GetGUID());
+ FrostwyrmGUIDs.erase(creature->GetDBTableGUIDLow());
if (FrostwyrmGUIDs.empty())
{
- FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED;
instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY());
if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos))
boss->AI()->DoAction(ACTION_START_FROSTWYRM);
@@ -519,6 +511,11 @@ class instance_icecrown_citadel : public InstanceMapScript
go->SetLootRecipient(valithria->GetLootRecipient());
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN);
break;
+ case GO_SCOURGE_TRANSPORTER_LK:
+ TheLichKingTeleportGUID = go->GetGUID();
+ if (GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE && GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && GetBossState(DATA_SINDRAGOSA) == DONE)
+ go->SetGoState(GO_STATE_ACTIVE);
+ break;
case GO_ARTHAS_PLATFORM:
// this enables movement at The Frozen Throne, when printed this value is 0.000000f
// however, when represented as integer client will accept only this value
@@ -597,16 +594,10 @@ class instance_icecrown_citadel : public InstanceMapScript
switch (type)
{
case DATA_SINDRAGOSA_FROSTWYRMS:
- if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED)
- return 255;
return FrostwyrmGUIDs.size();
case DATA_SPINESTALKER:
- if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED)
- return 255;
return SpinestalkerTrash.size();
case DATA_RIMEFANG:
- if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED)
- return 255;
return RimefangTrash.size();
case DATA_COLDFLAME_JETS:
return ColdflameJetsState;
@@ -763,6 +754,8 @@ class instance_icecrown_citadel : public InstanceMapScript
break;
case DATA_PROFESSOR_PUTRICIDE:
HandleGameObject(PlagueSigilGUID, state != DONE);
+ if (state == DONE)
+ CheckLichKingAvailability();
if (instance->IsHeroic())
{
if (state == FAIL && HeroicAttempts)
@@ -777,6 +770,8 @@ class instance_icecrown_citadel : public InstanceMapScript
break;
case DATA_BLOOD_QUEEN_LANA_THEL:
HandleGameObject(BloodwingSigilGUID, state != DONE);
+ if (state == DONE)
+ CheckLichKingAvailability();
if (instance->IsHeroic())
{
if (state == FAIL && HeroicAttempts)
@@ -795,6 +790,8 @@ class instance_icecrown_citadel : public InstanceMapScript
break;
case DATA_SINDRAGOSA:
HandleGameObject(FrostwingSigilGUID, state != DONE);
+ if (state == DONE)
+ CheckLichKingAvailability();
if (instance->IsHeroic())
{
if (state == FAIL && HeroicAttempts)
@@ -806,9 +803,6 @@ class instance_icecrown_citadel : public InstanceMapScript
sindra->DespawnOrUnsummon();
}
}
- // Reached when loading from DB
- if (state == DONE)
- FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED;
break;
case DATA_THE_LICH_KING:
{
@@ -866,16 +860,13 @@ class instance_icecrown_citadel : public InstanceMapScript
IsOrbWhispererEligible = data ? true : false;
break;
case DATA_SINDRAGOSA_FROSTWYRMS:
- if (data == 255)
- FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED;
+ FrostwyrmGUIDs.insert(data);
break;
case DATA_SPINESTALKER:
- if (data == 255)
- FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED;
+ SpinestalkerTrash.insert(data);
break;
case DATA_RIMEFANG:
- if (data == 255)
- FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED;
+ RimefangTrash.insert(data);
break;
case DATA_COLDFLAME_JETS:
ColdflameJetsState = data;
@@ -918,22 +909,6 @@ class instance_icecrown_citadel : public InstanceMapScript
}
}
- void SetData64(uint32 id, uint64 data)
- {
- switch (id)
- {
- case DATA_SINDRAGOSA_FROSTWYRMS:
- FrostwyrmGUIDs.insert(data);
- break;
- case DATA_SPINESTALKER:
- SpinestalkerTrash.insert(data);
- break;
- case DATA_RIMEFANG:
- RimefangTrash.insert(data);
- break;
- }
- }
-
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/)
{
switch (criteria_id)
@@ -1107,6 +1082,28 @@ class instance_icecrown_citadel : public InstanceMapScript
return true;
}
+ void CheckLichKingAvailability()
+ {
+ if (GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE && GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && GetBossState(DATA_SINDRAGOSA) == DONE)
+ {
+ if (GameObject* teleporter = instance->GetGameObject(TheLichKingTeleportGUID))
+ {
+ teleporter->SetGoState(GO_STATE_ACTIVE);
+
+ std::list<Creature*> stalkers;
+ GetCreatureListWithEntryInGrid(stalkers, teleporter, NPC_INVISIBLE_STALKER, 100.0f);
+ if (stalkers.empty())
+ return;
+
+ stalkers.sort(Trinity::ObjectDistanceOrderPred(teleporter));
+ stalkers.front()->CastSpell((Unit*)NULL, SPELL_ARTHAS_TELEPORTER_CEREMONY, false);
+ stalkers.pop_front();
+ for (std::list<Creature*>::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr)
+ (*itr)->AI()->Reset();
+ }
+ }
+ }
+
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
@@ -1288,6 +1285,7 @@ class instance_icecrown_citadel : public InstanceMapScript
uint64 SindragosaGUID;
uint64 SpinestalkerGUID;
uint64 RimefangGUID;
+ uint64 TheLichKingTeleportGUID;
uint64 TheLichKingGUID;
uint64 HighlordTirionFordringGUID;
uint64 TerenasMenethilGUID;
@@ -1301,13 +1299,12 @@ class instance_icecrown_citadel : public InstanceMapScript
uint64 PillarsUnchainedGUID;
uint32 TeamInInstance;
uint32 ColdflameJetsState;
- std::set<uint64> FrostwyrmGUIDs;
- std::set<uint64> SpinestalkerTrash;
- std::set<uint64> RimefangTrash;
+ std::set<uint32> FrostwyrmGUIDs;
+ std::set<uint32> SpinestalkerTrash;
+ std::set<uint32> RimefangTrash;
uint32 BloodQuickeningState;
uint32 HeroicAttempts;
uint16 BloodQuickeningMinutes;
- uint16 FrostwyrmFlags;
bool IsBonedEligible;
bool IsOozeDanceEligible;
bool IsNauseaEligible;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
index 1671eab0b32..8901a61e79d 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
#define SAY_GREET RAND(-1533000, -1533004, -1533005, -1533006, -1533007)
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
index 058c5b35e3a..636f2318712 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
enum Yells
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 17ed6a79c76..29a0a11af9b 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "naxxramas.h"
enum Horsemen
@@ -26,6 +29,11 @@ enum Horsemen
HORSEMEN_SIR,
};
+enum Spells
+{
+ SPELL_MARK_DAMAGE = 28836
+};
+
enum Events
{
EVENT_NONE,
@@ -96,6 +104,7 @@ public:
if (me->GetEntry() == MOB_HORSEMEN[i])
id = Horsemen(i);
caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR);
+ encounterActionReset = false;
}
Horsemen id;
@@ -395,7 +404,63 @@ public:
};
+class spell_four_horsemen_mark : public SpellScriptLoader
+{
+ public:
+ spell_four_horsemen_mark() : SpellScriptLoader("spell_four_horsemen_mark") { }
+
+ class spell_four_horsemen_mark_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_four_horsemen_mark_AuraScript);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ int32 damage;
+ switch (GetStackAmount())
+ {
+ case 1:
+ damage = 0;
+ break;
+ case 2:
+ damage = 500;
+ break;
+ case 3:
+ damage = 1000;
+ break;
+ case 4:
+ damage = 1500;
+ break;
+ case 5:
+ damage = 4000;
+ break;
+ case 6:
+ damage = 12000;
+ break;
+ default:
+ damage = 20000 + 1000 * (GetStackAmount() - 7);
+ break;
+ }
+ if (damage)
+ caster->CastCustomSpell(SPELL_MARK_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget());
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_four_horsemen_mark_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_four_horsemen_mark_AuraScript();
+ }
+};
+
void AddSC_boss_four_horsemen()
{
new boss_four_horsemen();
+ new spell_four_horsemen_mark();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index 47dfaa7f772..69443b2824e 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
#define SPELL_MORTAL_WOUND 25646
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index 8d23de5427c..d335d36e112 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
@@ -15,7 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "GridNotifiers.h"
+#include "CombatAI.h"
#include "naxxramas.h"
enum Yells
@@ -25,6 +29,7 @@ enum Yells
SAY_DEATH = -1533042,
SAY_TELEPORT = -1533043
};
+
//Gothik
enum Spells
{
@@ -36,8 +41,11 @@ enum Spells
SPELL_INFORM_LIVE_RIDER = 27935,
SPELL_INFORM_DEAD_TRAINEE = 27915,
SPELL_INFORM_DEAD_KNIGHT = 27931,
- SPELL_INFORM_DEAD_RIDER = 27937
+ SPELL_INFORM_DEAD_RIDER = 27937,
+
+ SPELL_SHADOW_MARK = 27825
};
+
enum Creatures
{
MOB_LIVE_TRAINEE = 16124,
@@ -192,7 +200,7 @@ class boss_gothik : public CreatureScript
if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD)
{
- sLog->outError("Script Gothik: cannot summon triggers!");
+ sLog->outError(LOG_FILTER_TSCR, "Script Gothik: cannot summon triggers!");
EnterEvadeMode();
return;
}
@@ -306,15 +314,14 @@ class boss_gothik : public CreatureScript
bool CheckGroupSplitted()
{
- bool checklife = false;
- bool checkdead = false;
-
Map* map = me->GetMap();
if (map && map->IsDungeon())
{
Map::PlayerList const &PlayerList = map->GetPlayers();
if (!PlayerList.isEmpty())
{
+ bool checklife = false;
+ bool checkdead = false;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource() && i->getSource()->isAlive() &&
@@ -585,8 +592,35 @@ class mob_gothik_minion : public CreatureScript
}
};
+class spell_gothik_shadow_bolt_volley : public SpellScriptLoader
+{
+ public:
+ spell_gothik_shadow_bolt_volley() : SpellScriptLoader("spell_gothik_shadow_bolt_volley") { }
+
+ class spell_gothik_shadow_bolt_volley_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gothik_shadow_bolt_volley_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK));
+ }
+
+ void Register()
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gothik_shadow_bolt_volley_SpellScript();
+ }
+};
+
void AddSC_boss_gothik()
{
new boss_gothik();
new mob_gothik_minion();
+ new spell_gothik_shadow_bolt_volley();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
index 039b9b1e007..5a55a4f1c4b 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
#define SPELL_BOMBARD_SLIME 28280
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
index d84cfb8949e..93eab5df237 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "naxxramas.h"
#define SAY_AGGRO RAND(-1533109, -1533110, -1533111)
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index 0a4fdec7222..10b40b490c4 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -23,7 +23,10 @@ SDComment: VERIFY SCRIPT
SDCategory: Naxxramas
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "naxxramas.h"
enum Yells
@@ -86,6 +89,7 @@ enum Spells
SPELL_SHADOW_FISURE = 27810,
SPELL_VOID_BLAST = 27812,
SPELL_MANA_DETONATION = 27819,
+ SPELL_MANA_DETONATION_DAMAGE = 27820,
SPELL_FROST_BLAST = 27808,
SPELL_CHAINS_OF_KELTHUZAD = 28410, //28408 script effect
SPELL_KELTHUZAD_CHANNEL = 29423,
@@ -773,6 +777,46 @@ class npc_kelthuzad_abomination : public CreatureScript
}
};
+class spell_kelthuzad_detonate_mana : public SpellScriptLoader
+{
+ public:
+ spell_kelthuzad_detonate_mana() : SpellScriptLoader("spell_kelthuzad_detonate_mana") { }
+
+ class spell_kelthuzad_detonate_mana_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_kelthuzad_detonate_mana_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DETONATION_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void HandleScript(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+
+ Unit* target = GetTarget();
+ if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10))
+ {
+ mana = target->ModifyPower(POWER_MANA, -mana);
+ target->CastCustomSpell(SPELL_MANA_DETONATION_DAMAGE, SPELLVALUE_BASE_POINT0, -mana * 10, target, true, NULL, aurEff);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_kelthuzad_detonate_mana_AuraScript::HandleScript, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_kelthuzad_detonate_mana_AuraScript();
+ }
+};
+
class achievement_just_cant_get_enough : public AchievementCriteriaScript
{
public:
@@ -796,5 +840,6 @@ void AddSC_boss_kelthuzad()
new boss_kelthuzad();
new at_kelthuzad_center();
new npc_kelthuzad_abomination();
+ new spell_kelthuzad_detonate_mana();
new achievement_just_cant_get_enough();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
index 58d3a4240b2..71623cb1959 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "naxxramas.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
index 3c258f08030..8ec9bac7e86 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "naxxramas.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
index 75be596fd77..d106b99ace0 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
#define SAY_AGGRO RAND(-1533075, -1533076, -1533077)
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index b826a530719..b1b57836a89 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
index e06aa6b03c5..d733cac001c 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
//Razuvious - NO TEXT sound only
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
index 37fb5f3f4a9..a2acf8a64da 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "naxxramas.h"
#define EMOTE_BREATH -1533082
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index ccc8e9a5663..e45700ebd72 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -456,10 +456,10 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
- void HandleTargets(std::list<Unit*>& targetList)
+ void HandleTargets(std::list<WorldObject*>& targets)
{
uint8 count = 0;
- for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
+ for (std::list<WorldObject*>::iterator ihit = targets.begin(); ihit != targets.end(); ++ihit)
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
if (Player* target = (*ihit)->ToPlayer())
if (target->HasAura(GetTriggeringSpell()->Id))
@@ -498,7 +498,7 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
index 50eb52cc4c2..e806b60c848 100644
--- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "naxxramas.h"
const DoorData doorData[] =
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index ac5520b025a..9f5eb8d879a 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -27,7 +27,11 @@ Script Data End */
// Remove hack that re-adds targets to the aggro list after they enter to a vehicle when it works as expected
// Improve whatever can be improved :)
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
+#include "PassiveAI.h"
#include "eye_of_eternity.h"
#include "ScriptedEscortAI.h"
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
index fcb54985357..f6a12eee519 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "eye_of_eternity.h"
class instance_eye_of_eternity : public InstanceMapScript
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
index 7552ba4f389..5e6dcbcd66e 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "nexus.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
index 5c1dee1d4e4..9e6930118f7 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
@@ -16,7 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "nexus.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
index ad188738c12..9602d1bc876 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "nexus.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
index c70db7d4ebc..9f9223f0161 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "nexus.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp
index 5ea3eb32c1d..5463f6c9045 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp
@@ -23,7 +23,8 @@ SDComment: Only Alliance Heroic
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_BATTLE_SHOUT 31403
#define SPELL_CHARGE 60067
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp
index da4b49740c1..38808bc718d 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp
@@ -23,7 +23,8 @@ SDComment: Only Horde Heroic
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_BATTLE_SHOUT 31403
#define SPELL_CHARGE 60067
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
index 5af982bb694..5d430ae048d 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "nexus.h"
#define NUMBER_OF_ENCOUNTERS 4
@@ -57,6 +58,9 @@ public:
Anomalus = 0;
Keristrasza = 0;
+ AnomalusContainmentSphere = 0;
+ OrmoroksContainmentSphere = 0;
+ TelestrasContainmentSphere = 0;
}
void OnCreatureCreate(Creature* creature)
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp
index bb75b789fff..035e1a9a6df 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "oculus.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
index ab814a2ca22..270e31f4350 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "oculus.h"
//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer)
@@ -110,6 +113,13 @@ enum EmeraldDrake
SPELL_EMERALD_DREAM_FUNNEL = 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels.
};
+enum EregosData
+{
+ DATA_RUBY_VOID = 0, // http://www.wowhead.com/achievement=2044
+ DATA_EMERALD_VOID = 1, // http://www.wowhead.com/achievement=2045
+ DATA_AMBER_VOID = 2 // http://www.wowhead.com/achievement=2046
+};
+
class boss_eregos : public CreatureScript
{
public:
@@ -127,8 +137,11 @@ public:
void Reset()
{
_Reset();
+ _phase = PHASE_NORMAL;
- phase = PHASE_NORMAL;
+ _rubyVoid = true;
+ _emeraldVoid = true;
+ _amberVoid = true;
DoAction(ACTION_SET_NORMAL_EVENTS);
}
@@ -138,6 +151,31 @@ public:
_EnterCombat();
Talk(SAY_AGGRO);
+ /* Checks for present drakes vehicles from each type and deactivate achievement that corresponds to each found
+ The checks are so big in case some party try weird things like pulling boss down or hiding out of check range, the only thing player need is to get the boss kill credit after the check /even if he or his drake die/
+ Drakes mechanic would despawn all after unmount and also drakes should be auto mounted after item use, item use after Eregos is engaged leads to his despawn - based on retail data. */
+ if (me->FindNearestCreature(NPC_RUBY_DRAKE_VEHICLE, 500.0f, true))
+ _rubyVoid = false;
+ if (me->FindNearestCreature(NPC_EMERALD_DRAKE_VEHICLE, 500.0f, true))
+ _emeraldVoid = false;
+ if (me->FindNearestCreature(NPC_AMBER_DRAKE_VEHICLE, 500.0f, true))
+ _amberVoid = false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch (type)
+ {
+ case DATA_RUBY_VOID:
+ return _rubyVoid;
+ case DATA_EMERALD_VOID:
+ return _emeraldVoid;
+ case DATA_AMBER_VOID:
+ return _amberVoid;
+ default:
+ break;
+ }
+ return 0;
}
void DoAction(const int32 action)
@@ -177,11 +215,11 @@ public:
if (!me->GetMap()->IsHeroic())
return;
- if ( (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f && phase < PHASE_FIRST_PLANAR)
- || (me->GetHealthPct() < 20.0f && phase < PHASE_SECOND_PLANAR) )
+ if ( (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f && _phase < PHASE_FIRST_PLANAR)
+ || (me->GetHealthPct() < 20.0f && _phase < PHASE_SECOND_PLANAR) )
{
events.Reset();
- phase = (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f) ? PHASE_FIRST_PLANAR : PHASE_SECOND_PLANAR;
+ _phase = (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f) ? PHASE_FIRST_PLANAR : PHASE_SECOND_PLANAR;
DoCast(SPELL_PLANAR_SHIFT);
@@ -238,8 +276,11 @@ public:
_JustDied();
}
- private:
- uint8 phase;
+ private:
+ uint8 _phase;
+ bool _rubyVoid;
+ bool _emeraldVoid;
+ bool _amberVoid;
};
};
@@ -271,8 +312,25 @@ class spell_eregos_planar_shift : public SpellScriptLoader
}
};
-void AddSC_boss_eregos()
+class achievement_gen_eregos_void : public AchievementCriteriaScript
{
+ public:
+ achievement_gen_eregos_void(char const* name, uint32 data) : AchievementCriteriaScript(name), _data(data) { }
+
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ return target && target->GetAI()->GetData(_data);
+ }
+
+ private:
+ uint32 _data;
+};
+
+ void AddSC_boss_eregos()
+ {
new boss_eregos();
new spell_eregos_planar_shift();
-}
+ new achievement_gen_eregos_void("achievement_ruby_void", DATA_RUBY_VOID);
+ new achievement_gen_eregos_void("achievement_emerald_void", DATA_EMERALD_VOID);
+ new achievement_gen_eregos_void("achievement_amber_void", DATA_AMBER_VOID);
+ }
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
index b96d7c4aa84..791bc0180e5 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
@@ -22,7 +22,8 @@ SDComment: Is not working SPELL_ARCANE_SHIELD. SPELL_FROSTBOMB has some issues,
SDCategory: Instance Script
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "oculus.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index 19a84fdae84..6d9450daf21 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "oculus.h"
#include "MapManager.h"
@@ -297,7 +300,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
{
PrepareSpellScript(spell_varos_energize_core_area_enemySpellScript)
- void FilterTargets(std::list<Unit*>& targetList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
Creature* varos = GetCaster()->ToCreature();
if (!varos)
@@ -308,7 +311,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
- for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
+ for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
{
Position pos;
(*itr)->GetPosition(&pos);
@@ -317,7 +320,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
float diff = fabs(orientation - angle);
if (diff > 1.0f)
- itr = targetList.erase(itr);
+ itr = targets.erase(itr);
else
++itr;
}
@@ -325,7 +328,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_varos_energize_core_area_enemySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_varos_energize_core_area_enemySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -344,7 +347,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
{
PrepareSpellScript(spell_varos_energize_core_area_entrySpellScript)
- void FilterTargets(std::list<Unit*>& targetList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
Creature* varos = GetCaster()->ToCreature();
if (!varos)
@@ -355,7 +358,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
- for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
+ for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
{
Position pos;
(*itr)->GetPosition(&pos);
@@ -364,7 +367,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
float diff = fabs(orientation - angle);
if (diff > 1.0f)
- itr = targetList.erase(itr);
+ itr = targets.erase(itr);
else
++itr;
}
@@ -372,7 +375,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_varos_energize_core_area_entrySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_varos_energize_core_area_entrySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
index 46498a69c6f..ca4ae883747 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "oculus.h"
#define MAX_ENCOUNTER 4
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index 23f55a3033b..1d8b5b986f6 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -15,7 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "oculus.h"
#define GOSSIP_ITEM_DRAKES "So where do we go from here?"
@@ -47,7 +51,9 @@ enum Drakes
NPC_VERDISA = 27657,
NPC_BELGARISTRASZ = 27658,
- NPC_ETERNOS = 27659
+ NPC_ETERNOS = 27659,
+
+ SPELL_SHOCK_CHARGE = 49836,
};
enum Says
@@ -210,8 +216,40 @@ public:
}
};
+class spell_gen_stop_time : public SpellScriptLoader
+{
+public:
+ spell_gen_stop_time() : SpellScriptLoader("spell_gen_stop_time") { }
+
+ class spell_gen_stop_time_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_stop_time_AuraScript);
+
+ void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+ Unit* target = GetTarget();
+ for (uint32 i = 0; i < 5; ++i)
+ caster->CastSpell(target, SPELL_SHOCK_CHARGE, false);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_gen_stop_time_AuraScript::Apply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_stop_time_AuraScript();
+ }
+};
+
void AddSC_oculus()
{
new npc_oculus_drake();
new npc_image_belgaristrasz();
+ new spell_gen_stop_time();
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
index 9f39cecbb23..72ab5259693 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
@@ -23,7 +23,8 @@ SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieuten
SDCategory: Halls of Lightning
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_lightning.h"
enum eEnums
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index abdf5ecb1e1..d964f619a6e 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
@@ -20,7 +20,8 @@
* Comment: Timer check pending
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_lightning.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index 2e2744baa3c..f42fd87c643 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
@@ -19,11 +19,13 @@
/* ScriptData
SDName: Boss Loken
SD%Complete: 60%
-SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414)
+SDComment: Missing intro.
SDCategory: Halls of Lightning
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "halls_of_lightning.h"
enum eEnums
@@ -73,23 +75,17 @@ public:
InstanceScript* instance;
- bool m_bIsAura;
-
uint32 m_uiArcLightning_Timer;
uint32 m_uiLightningNova_Timer;
- uint32 m_uiPulsingShockwave_Timer;
uint32 m_uiResumePulsingShockwave_Timer;
uint32 m_uiHealthAmountModifier;
void Reset()
{
- m_bIsAura = false;
-
m_uiArcLightning_Timer = 15000;
m_uiLightningNova_Timer = 20000;
- m_uiPulsingShockwave_Timer = 2000;
- m_uiResumePulsingShockwave_Timer = 15000;
+ m_uiResumePulsingShockwave_Timer = 1000;
m_uiHealthAmountModifier = 1;
@@ -116,7 +112,10 @@ public:
Talk(SAY_DEATH);
if (instance)
+ {
instance->SetData(TYPE_LOKEN, DONE);
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA);
+ }
}
void KilledUnit(Unit* /*victim*/)
@@ -130,44 +129,13 @@ public:
if (!UpdateVictim())
return;
- if (m_bIsAura)
- {
- // workaround for PULSING_SHOCKWAVE
- if (m_uiPulsingShockwave_Timer <= uiDiff)
- {
- Map* map = me->GetMap();
- if (map->IsDungeon())
- {
- Map::PlayerList const &PlayerList = map->GetPlayers();
-
- if (PlayerList.isEmpty())
- return;
-
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- if (i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack())
- {
- int32 dmg;
- float m_fDist = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
-
- dmg = DUNGEON_MODE(100, 150); // need to correct damage
- if (m_fDist > 1.0f) // Further from 1 yard
- dmg = int32(dmg*m_fDist);
-
- me->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
- }
- }
- m_uiPulsingShockwave_Timer = 2000;
- } else m_uiPulsingShockwave_Timer -= uiDiff;
- }
- else
+ if (m_uiResumePulsingShockwave_Timer)
{
if (m_uiResumePulsingShockwave_Timer <= uiDiff)
{
- //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement?
DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
- DoCast(me, SPELL_PULSING_SHOCKWAVE_N); // need core support
- m_bIsAura = true;
+ DoCast(me, SPELL_PULSING_SHOCKWAVE_N, true);
m_uiResumePulsingShockwave_Timer = 0;
}
else
@@ -190,7 +158,7 @@ public:
Talk(EMOTE_NOVA);
DoCast(me, SPELL_LIGHTNING_NOVA_N);
- m_bIsAura = false;
+ me->RemoveAurasDueToSpell(DUNGEON_MODE<uint32>(SPELL_PULSING_SHOCKWAVE_N, SPELL_PULSING_SHOCKWAVE_H));
m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura
m_uiLightningNova_Timer = urand(20000, 21000);
}
@@ -216,7 +184,39 @@ public:
};
+class spell_loken_pulsing_shockwave : public SpellScriptLoader
+{
+ public:
+ spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { }
+
+ class spell_loken_pulsing_shockwave_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript);
+
+ void CalculateDamage(SpellEffIndex /*effIndex*/)
+ {
+ if (!GetHitUnit())
+ return;
+
+ float distance = GetCaster()->GetDistance2d(GetHitUnit());
+ if (distance > 1.0f)
+ SetHitDamage(int32(GetHitDamage() * distance));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_loken_pulsing_shockwave_SpellScript();
+ }
+};
+
void AddSC_boss_loken()
{
new boss_loken();
+ new spell_loken_pulsing_shockwave();
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index 5c7bf0d1c1e..fe41e7a12dc 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
@@ -23,7 +23,8 @@ SDComment: Event should be pretty close minus a few visual flaws
SDCategory: Halls of Lightning
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_lightning.h"
enum eEnums
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
index f25be6dae0d..93b246e9ddc 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
@@ -23,7 +23,8 @@ SDComment: All ready.
SDCategory: Halls of Lightning
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "halls_of_lightning.h"
/* Halls of Lightning encounters:
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
index bc57ce21a4d..93bea92503c 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "halls_of_stone.h"
enum Spells
@@ -157,17 +159,12 @@ public:
DoScriptText(SAY_KILL, me);
}
- void SpellHitTarget(Unit* target, const SpellInfo* pSpell)
+ void SpellHitTarget(Unit* /*target*/, const SpellInfo* pSpell)
{
//this part should be in the core
if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER)
{
- //this spell must have custom handling in the core, dealing damage based on distance
- target->CastSpell(target, DUNGEON_MODE(SPELL_SHATTER_EFFECT, H_SPELL_SHATTER_EFFECT), true);
-
- if (target->HasAura(SPELL_STONED))
- target->RemoveAurasDueToSpell(SPELL_STONED);
-
+ // todo: we need eventmap to kill this stuff
//clear this, if we are still performing
if (bIsSlam)
{
@@ -186,7 +183,74 @@ public:
};
+class spell_krystallus_shatter : public SpellScriptLoader
+{
+ public:
+ spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { }
+
+ class spell_krystallus_shatter_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_krystallus_shatter_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ target->RemoveAurasDueToSpell(SPELL_STONED);
+ target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_krystallus_shatter_SpellScript();
+ }
+};
+
+class spell_krystallus_shatter_effect : public SpellScriptLoader
+{
+ public:
+ spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { }
+
+ class spell_krystallus_shatter_effect_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript);
+
+ void CalculateDamage()
+ {
+ if (!GetHitUnit())
+ return;
+
+ float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
+ if (!radius)
+ return;
+
+ float distance = GetCaster()->GetDistance2d(GetHitUnit());
+ if (distance > 1.0f)
+ SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_krystallus_shatter_effect_SpellScript::CalculateDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_krystallus_shatter_effect_SpellScript();
+ }
+};
+
void AddSC_boss_krystallus()
{
new boss_krystallus();
+ new spell_krystallus_shatter();
+ new spell_krystallus_shatter_effect();
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
index 65711643827..8d113bce226 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_stone.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
index c2a8e905950..28052a57576 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "halls_of_stone.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
index a608de5fcf3..a90c346e470 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "halls_of_stone.h"
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
index ee5cb87dd85..869cf46e74d 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "halls_of_stone.h"
#define MAX_ENCOUNTER 4
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index 2af73389ecb..dcd3a3a91f5 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -1080,7 +1080,7 @@ class NotVictimFilter
{
}
- bool operator()(Unit* target)
+ bool operator()(WorldObject* target)
{
return target != _victim;
}
@@ -1098,14 +1098,14 @@ class spell_algalon_arcane_barrage : public SpellScriptLoader
{
PrepareSpellScript(spell_algalon_arcane_barrage_SpellScript);
- void SelectTarget(std::list<Unit*>& targets)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
targets.remove_if(NotVictimFilter(GetCaster()));
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -1118,9 +1118,9 @@ class spell_algalon_arcane_barrage : public SpellScriptLoader
class ActiveConstellationFilter
{
public:
- bool operator()(Unit* target) const
+ bool operator()(WorldObject* target) const
{
- return target->GetAI()->GetData(0);
+ return target->ToUnit() && target->ToUnit()->GetAI() && target->ToUnit()->GetAI()->GetData(0);
}
};
@@ -1133,7 +1133,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader
{
PrepareSpellScript(spell_algalon_trigger_3_adds_SpellScript);
- void SelectTarget(std::list<Unit*>& targets)
+ void SelectTarget(std::list<WorldObject*>& targets)
{
targets.remove_if(ActiveConstellationFilter());
}
@@ -1150,7 +1150,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
@@ -1202,7 +1202,7 @@ class spell_algalon_big_bang : public SpellScriptLoader
return true;
}
- void CountTargets(std::list<Unit*>& targets)
+ void CountTargets(std::list<WorldObject*>& targets)
{
_targetCount = targets.size();
}
@@ -1215,7 +1215,7 @@ class spell_algalon_big_bang : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
AfterCast += SpellCastFn(spell_algalon_big_bang_SpellScript::CheckTargets);
}
@@ -1328,7 +1328,7 @@ class spell_algalon_supermassive_fail : public SpellScriptLoader
if (!GetHitPlayer())
return;
- GetHitPlayer()->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true);
+ GetHitPlayer()->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true);
}
void Register()
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
index 472ff153d73..ec3125f7c0a 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
@@ -472,9 +472,9 @@ class npc_feral_defender : public CreatureScript
class SanctumSentryCheck
{
public:
- bool operator() (Unit* unit)
+ bool operator()(WorldObject* object) const
{
- if (unit->GetEntry() == NPC_SANCTUM_SENTRY)
+ if (object->GetEntry() == NPC_SANCTUM_SENTRY)
return false;
return true;
@@ -490,14 +490,14 @@ class spell_auriaya_strenght_of_the_pack : public SpellScriptLoader
{
PrepareSpellScript(spell_auriaya_strenght_of_the_pack_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (SanctumSentryCheck());
+ unitList.remove_if(SanctumSentryCheck());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_strenght_of_the_pack_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_strenght_of_the_pack_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
@@ -516,15 +516,15 @@ class spell_auriaya_sentinel_blast : public SpellScriptLoader
{
PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (PlayerOrPetCheck());
+ unitList.remove_if(PlayerOrPetCheck());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index 0e453eceaa1..9d5adf39817 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -720,20 +720,18 @@ class boss_flame_leviathan_overload_device : public CreatureScript
{
}
- void DoAction(const int32 param)
+ void OnSpellClick(Unit* /*clicker*/)
{
- if (param == EVENT_SPELLCLICK)
+ if (me->GetVehicle())
{
- if (me->GetVehicle())
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
{
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
- {
- me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
- player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30);
- player->ExitVehicle();
- }
+ me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
+ player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30);
+ player->ExitVehicle();
}
}
}
@@ -1232,7 +1230,7 @@ public:
//bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
//{
// player->PlayerTalkClass->ClearMenus();
- // switch(action)
+ // switch (action)
// {
// case GOSSIP_ACTION_INFO_DEF+1:
// if (player)
@@ -1619,7 +1617,7 @@ class FlameLeviathanPursuedTargetSelector
public:
explicit FlameLeviathanPursuedTargetSelector(Unit* unit) : _me(unit) {};
- bool operator()(Unit* target) const
+ bool operator()(WorldObject* target) const
{
//! No players, only vehicles (todo: check if blizzlike)
Creature* creatureTarget = target->ToCreature();
@@ -1667,7 +1665,7 @@ class spell_pursue : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& targets)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster()));
if (targets.empty())
@@ -1683,7 +1681,7 @@ class spell_pursue : public SpellScriptLoader
}
}
- void FilterTargetsSubsequently(std::list<Unit*>& targets)
+ void FilterTargetsSubsequently(std::list<WorldObject*>& targets)
{
targets.clear();
if (_target)
@@ -1710,12 +1708,12 @@ class spell_pursue : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_pursue_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_pursue_SpellScript::FilterTargetsSubsequently, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargetsSubsequently, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_pursue_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
- Unit* _target;
+ WorldObject* _target;
};
SpellScript* GetSpellScript() const
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
index 3556bf188de..8090b9e8a3e 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
@@ -51,6 +51,8 @@ enum VezaxSpells
SPELL_SHADOW_CRASH_HIT = 62659,
SPELL_SURGE_OF_DARKNESS = 62662,
SPELL_SARONITE_VAPORS = 63323,
+ SPELL_SARONITE_VAPORS_ENERGIZE = 63337,
+ SPELL_SARONITE_VAPORS_DAMAGE = 63338,
SPELL_SUMMON_SARONITE_VAPORS = 63081,
SPELL_BERSERK = 26662,
@@ -463,6 +465,45 @@ class spell_mark_of_the_faceless : public SpellScriptLoader
}
};
+class spell_general_vezax_saronite_vapors : public SpellScriptLoader
+{
+ public:
+ spell_general_vezax_saronite_vapors() : SpellScriptLoader("spell_general_vezax_saronite_vapors") { }
+
+ class spell_general_vezax_saronite_vapors_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_general_vezax_saronite_vapors_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ int32 mana = int32(aurEff->GetAmount() * pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
+ int32 damage = mana * 2;
+ caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true);
+ caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, NULL, NULL, true);
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_general_vezax_saronite_vapors_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_general_vezax_saronite_vapors_AuraScript();
+ }
+};
+
class achievement_shadowdodger : public AchievementCriteriaScript
{
public:
@@ -509,6 +550,7 @@ void AddSC_boss_general_vezax()
new boss_saronite_animus();
new npc_saronite_vapors();
new spell_mark_of_the_faceless();
+ new spell_general_vezax_saronite_vapors();
new achievement_shadowdodger();
new achievement_smell_saronite();
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index d89d640b083..24a9171e29f 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
@@ -354,7 +354,7 @@ class StoneGripTargetSelector : public std::unary_function<Unit*, bool>
public:
StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) {}
- bool operator() (Unit* target)
+ bool operator()(WorldObject* target)
{
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
return true;
@@ -385,10 +385,10 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
return true;
}
- void FilterTargetsInitial(std::list<Unit*>& unitList)
+ void FilterTargetsInitial(std::list<WorldObject*>& unitList)
{
// Remove "main tank" and non-player targets
- unitList.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim()));
+ unitList.remove_if(StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim()));
// Maximum affected targets per difficulty mode
uint32 maxTargets = 1;
if (GetSpellInfo()->Id == 63981)
@@ -397,7 +397,7 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
// Return a random amount of targets based on maxTargets
while (maxTargets < unitList.size())
{
- std::list<Unit*>::iterator itr = unitList.begin();
+ std::list<WorldObject*>::iterator itr = unitList.begin();
advance(itr, urand(0, unitList.size()-1));
unitList.erase(itr);
}
@@ -406,20 +406,20 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
m_unitList = unitList;
}
- void FillTargetsSubsequential(std::list<Unit*>& unitList)
+ void FillTargetsSubsequential(std::list<WorldObject*>& unitList)
{
unitList = m_unitList;
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
}
// Shared between effects
- std::list<Unit*> m_unitList;
+ std::list<WorldObject*> m_unitList;
};
SpellScript* GetSpellScript() const
@@ -598,14 +598,14 @@ class spell_kologarn_stone_shout : public SpellScriptLoader
{
PrepareSpellScript(spell_kologarn_stone_shout_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (PlayerOrPetCheck());
+ unitList.remove_if(PlayerOrPetCheck());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index a2044854672..7ada42144a8 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -950,9 +950,9 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader
{
PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove_if(PlayerOrPetCheck());
+ targets.remove_if(PlayerOrPetCheck());
}
void RecalculateDamage()
@@ -962,8 +962,8 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index 654d763ddbc..2f37fb06f24 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -134,6 +134,7 @@ class instance_ulduar : public InstanceMapScript
elderCount = 0;
conSpeedAtory = false;
Unbroken = true;
+ _algalonSummoned = false;
_summonAlgalon = false;
memset(AlgalonSigilDoorGUID, 0, sizeof(AlgalonSigilDoorGUID));
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
index d35f0559080..858a82bbe57 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
@@ -268,10 +268,10 @@ GameObjectAI* GetUlduarAI(GameObject* go)
class PlayerOrPetCheck
{
public:
- bool operator() (Unit* unit)
+ bool operator()(WorldObject* object) const
{
- if (unit->GetTypeId() != TYPEID_PLAYER)
- if (!unit->ToCreature()->isPet())
+ if (object->GetTypeId() != TYPEID_PLAYER)
+ if (!object->ToCreature()->isPet())
return true;
return false;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
index a7853a07e22..aaa95631792 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
@@ -22,7 +22,8 @@ SDComment: Some Problems with Annhylde Movement, Blizzlike Timers (just shadow a
SDCategory: Udgarde Keep
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "utgarde_keep.h"
enum Yells
@@ -55,13 +56,16 @@ enum Events
EVENT_DARK_SMASH,
EVENT_DREADFUL_ROAR,
EVENT_WOE_STRIKE,
- EVENT_SHADOW_AXE
+ EVENT_SHADOW_AXE,
+ EVENT_JUST_TRANSFORMED,
+ EVENT_SUMMON_BANSHEE
};
enum Phases
{
PHASE_HUMAN = 1,
PHASE_UNDEAD,
+ PHASE_EVENT
};
enum Spells
@@ -82,7 +86,7 @@ enum Spells
SPELL_WOE_STRIKE = 42730,
ENTRY_THROW_TARGET = 23996,
- SPELL_SHADOW_AXE_SUMMON = 42749
+ SPELL_SHADOW_AXE_SUMMON = 42748
};
class boss_ingvar_the_plunderer : public CreatureScript
@@ -100,14 +104,12 @@ public:
boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ bIsUndead = false;
}
InstanceScript* instance;
bool bIsUndead;
- bool bEventInProgress;
-
- uint32 uiSpawnResTimer;
void Reset()
{
@@ -115,7 +117,6 @@ public:
me->UpdateEntry(MOB_INGVAR_HUMAN);
bIsUndead = false;
- bEventInProgress = false;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
@@ -128,13 +129,6 @@ public:
events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
- events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
- events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
- events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
- events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
-
- uiSpawnResTimer = 3000;
-
if (instance)
instance->SetData(DATA_INGVAR_EVENT, NOT_STARTED);
}
@@ -154,37 +148,34 @@ public:
me->SetStandState(UNIT_STAND_STATE_DEAD);
// visuel hack end
- bEventInProgress = true;
- bIsUndead = true;
- events.SetPhase(PHASE_UNDEAD);
+ events.SetPhase(PHASE_EVENT);
+ events.ScheduleEvent(EVENT_SUMMON_BANSHEE, 3 * IN_MILLISECONDS, 0, PHASE_EVENT);
DoScriptText(YELL_DEAD_1, me);
}
- if (bEventInProgress)
- {
+ if (events.GetPhaseMask() & (1 << PHASE_EVENT))
damage = 0;
- }
}
void StartZombiePhase()
{
bIsUndead = true;
- bEventInProgress = false;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->UpdateEntry(MOB_INGVAR_UNDEAD);
- me->SetInCombatWith(me->getVictim());
- me->GetMotionMaster()->MoveChase(me->getVictim());
+ events.ScheduleEvent(EVENT_JUST_TRANSFORMED, 2 * IN_MILLISECONDS, 0, PHASE_EVENT);
DoScriptText(YELL_AGGRO_2, me);
}
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(YELL_AGGRO_1, me);
+ if (!bIsUndead)
+ DoScriptText(YELL_AGGRO_1, me);
if (instance)
instance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS);
+
+ me->SetInCombatWithZone();
}
void JustDied(Unit* /*killer*/)
@@ -199,6 +190,15 @@ public:
}
}
+ void ScheduleSecondPhase()
+ {
+ events.SetPhase(PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,18)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ }
+
void KilledUnit(Unit* /*victim*/)
{
if (bIsUndead)
@@ -209,23 +209,8 @@ public:
void UpdateAI(const uint32 diff)
{
- if (!UpdateVictim())
- return;
-
- if (bEventInProgress)
- {
- if (uiSpawnResTimer)
- {
- if (uiSpawnResTimer <= diff)
- {
- DoCast(me, SPELL_SUMMON_BANSHEE); // Summons directly on caster position
- // DoCast(me, SPELL_SCOURG_RESURRECTION, true); // Not needed ?
- uiSpawnResTimer = 0;
- } else uiSpawnResTimer -= diff;
- }
-
+ if (!UpdateVictim() && !(events.GetPhaseMask() & (1 << PHASE_EVENT)))
return;
- }
events.Update(diff);
@@ -243,24 +228,33 @@ public:
break;
case EVENT_STAGGERING_ROAR:
DoCast(me, SPELL_STAGGERING_ROAR);
- events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_ENRAGE:
DoCast(me, SPELL_ENRAGE);
events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_SMASH:
- DoCastVictim(SPELL_SMASH);
- events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ DoCastAOE(SPELL_SMASH);
+ events.ScheduleEvent(EVENT_SMASH, urand(12,16)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
+ case EVENT_JUST_TRANSFORMED:
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetInCombatWithZone();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ ScheduleSecondPhase();
+ return;
+ case EVENT_SUMMON_BANSHEE:
+ DoCast(me, SPELL_SUMMON_BANSHEE);
+ return;
// PHASE TWO
case EVENT_DARK_SMASH:
DoCastVictim(SPELL_DARK_SMASH);
- events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_DARK_SMASH, urand(12,16)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_DREADFUL_ROAR:
DoCast(me, SPELL_DREADFUL_ROAR);
- events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_WOE_STRIKE:
DoCastVictim(SPELL_WOE_STRIKE);
@@ -269,8 +263,7 @@ public:
case EVENT_SHADOW_AXE:
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
{
- me->SummonCreature(ENTRY_THROW_TARGET, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
- DoCast(me, SPELL_SHADOW_AXE_SUMMON);
+ DoCast(target, SPELL_SHADOW_AXE_SUMMON);
}
events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
@@ -409,7 +402,8 @@ public:
enum eShadowAxe
{
SPELL_SHADOW_AXE_DAMAGE = 42750,
- H_SPELL_SHADOW_AXE_DAMAGE = 59719
+ H_SPELL_SHADOW_AXE_DAMAGE = 59719,
+ POINT_TARGET = 28
};
class mob_ingvar_throw_dummy : public CreatureScript
@@ -428,32 +422,34 @@ public:
{
}
- uint32 uiDespawnTimer;
-
void Reset()
{
- Unit* target = me->FindNearestCreature(ENTRY_THROW_TARGET, 50);
- if (target)
+ if (Creature* target = me->FindNearestCreature(ENTRY_THROW_TARGET, 50.0f))
{
- DoCast(me, SPELL_SHADOW_AXE_DAMAGE);
float x, y, z;
target->GetPosition(x, y, z);
- me->GetMotionMaster()->MovePoint(0, x, y, z);
+ me->GetMotionMaster()->MoveCharge(x, y, z, 42.0f, POINT_TARGET);
+ target->DisappearAndDie();
+ }
+ else
+ {
+ me->DisappearAndDie();
}
- uiDespawnTimer = 7000;
}
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
- void EnterCombat(Unit* /*who*/) {}
- void UpdateAI(const uint32 diff)
+ void MovementInform(uint32 type, uint32 id)
{
- if (uiDespawnTimer <= diff)
+ if (type == EFFECT_MOTION_TYPE && id == POINT_TARGET)
{
- me->DealDamage(me, me->GetHealth());
- me->RemoveCorpse();
- uiDespawnTimer = 0;
- } else uiDespawnTimer -= diff;
+ DoCast(me, SPELL_SHADOW_AXE_DAMAGE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ if (TempSummon* summon = me->ToTempSummon())
+ {
+ summon->UnSummon(10000);
+ }
+ else
+ me->DisappearAndDie();
+ }
}
};
};
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
index 93cc94923db..e718942d091 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
@@ -22,7 +22,10 @@ SDComment:
SDCategory: Utgarde Keep
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "utgarde_keep.h"
enum KelsethEncounter
@@ -40,6 +43,9 @@ enum KelsethEncounter
NPC_FROSTTOMB = 23965,
NPC_SKELETON = 23970,
+ NPC_RUNEMAGE = 23960,
+ NPC_STRATEGIST = 23956,
+
SAY_START_COMBAT = 1,
SAY_SUMMON_SKELETONS,
SAY_FROST_TOMB,
@@ -115,14 +121,12 @@ public:
struct boss_kelesethAI : public BossAI
{
- boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCEKELESETH_EVENT)
- {
- creature->SetReactState(REACT_DEFENSIVE);
- }
+ boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCEKELESETH_EVENT){}
void Reset()
{
- instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
+ if (instance)
+ instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
events.Reset();
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
@@ -134,16 +138,43 @@ public:
onTheRocks = true;
}
- void EnterCombat(Unit* /*who*/)
+ void EnterCombat(Unit* who)
{
me->SetInCombatWithZone();
- instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
+ if (instance)
+ instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
Talk(SAY_START_COMBAT);
+
+ if (!who)
+ return;
+
+ std::list<Creature*> runemages;
+ me->GetCreatureListWithEntryInGrid(runemages, NPC_RUNEMAGE, 60.0f);
+ if (!runemages.empty())
+ {
+ for (std::list<Creature*>::iterator itr = runemages.begin(); itr != runemages.end(); ++itr)
+ {
+ if ((*itr)->isAlive() && (*itr)->IsWithinLOSInMap(me))
+ (*itr)->AI()->AttackStart(who);
+ }
+ }
+
+ std::list<Creature*> strategists;
+ me->GetCreatureListWithEntryInGrid(strategists, NPC_STRATEGIST, 60.0f);
+ if (!strategists.empty())
+ {
+ for (std::list<Creature*>::iterator itr = strategists.begin(); itr != strategists.end(); ++itr)
+ {
+ if ((*itr)->isAlive() && (*itr)->IsWithinLOSInMap(me))
+ (*itr)->AI()->AttackStart(who);
+ }
+ }
}
void JustDied(Unit* /*killer*/)
{
- instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
+ if (instance)
+ instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
summons.DespawnAll();
Talk(SAY_DEATH);
}
@@ -162,10 +193,20 @@ public:
return 0;
}
- void ExecuteEvent(uint32 const eventId)
+ void UpdateAI(uint32 const diff)
{
- switch (eventId)
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
{
+ switch (eventId)
+ {
case EVENT_SUMMON_SKELETONS:
Talk(SAY_SUMMON_SKELETONS);
SummonSkeletons();
@@ -186,7 +227,10 @@ public:
}
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
break;
+ }
}
+
+ DoMeleeAttackIfReady();
}
void SummonSkeletons()
@@ -219,7 +263,6 @@ public:
events.Reset();
events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
- DoCast(SPELL_BONE_ARMOR);
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
@@ -272,6 +315,13 @@ public:
break;
case EVENT_SHADOW_FISSURE:
DoCast(me, SPELL_SHADOW_FISSURE, true);
+ if (TempSummon* temp = me->ToTempSummon())
+ {
+ if (Unit* summoner = temp->GetSummoner())
+ {
+ DoCast(summoner, SPELL_BONE_ARMOR);
+ }
+ }
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
me->GetMotionMaster()->MoveChase(me->getVictim());
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
index 915d1c71bb2..7c977250e79 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
@@ -22,7 +22,8 @@ SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB
SDCategory: Utgarde Keep
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "utgarde_keep.h"
enum eEnums
@@ -46,6 +47,7 @@ enum eEnums
SPELL_CHARGE = 43651,
SPELL_STONE_STRIKE = 48583,
SPELL_SUMMON_SKARVALD_GHOST = 48613,
+ SPELL_ENRAGE = 48193,
MOB_SKARVALD_GHOST = 27390,
//Spells of Dalronn and his Ghost
MOB_DALRONN_THE_CONTROLLER = 24201,
@@ -57,6 +59,20 @@ enum eEnums
MOB_DALRONN_GHOST = 27389
};
+class SkarvaldChargePredicate
+{
+ public:
+ SkarvaldChargePredicate(Unit* unit) : me(unit) {}
+
+ bool operator() (WorldObject* object) const
+ {
+ return object->GetDistance2d(me) >= 5.0f && object->GetDistance2d(me) <= 30.0f;
+ }
+
+ private:
+ Unit* me;
+};
+
class boss_skarvald_the_constructor : public CreatureScript
{
public:
@@ -82,6 +98,7 @@ public:
uint32 Response_Timer;
uint32 Check_Timer;
bool Dalronn_isDead;
+ bool Enraged;
void Reset()
{
@@ -89,6 +106,7 @@ public:
StoneStrike_Timer = 10000;
Dalronn_isDead = false;
Check_Timer = 5000;
+ Enraged = false;
ghost = (me->GetEntry() == MOB_SKARVALD_GHOST);
if (!ghost && instance)
@@ -115,6 +133,15 @@ public:
}
}
+ void DamageTaken(Unit* /*attacker*/, uint32& damage)
+ {
+ if (!Enraged && !ghost && me->HealthBelowPctDamaged(15, damage))
+ {
+ Enraged = true;
+ DoCast(me, SPELL_ENRAGE);
+ }
+ }
+
void JustDied(Unit* killer)
{
if (!ghost && instance)
@@ -193,7 +220,7 @@ public:
if (Charge_Timer <= diff)
{
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE);
+ DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, SkarvaldChargePredicate(me)), SPELL_CHARGE);
Charge_Timer = 5000+rand()%5000;
} else Charge_Timer -= diff;
@@ -203,7 +230,8 @@ public:
StoneStrike_Timer = 5000+rand()%5000;
} else StoneStrike_Timer -= diff;
- DoMeleeAttackIfReady();
+ if (!me->HasUnitState(UNIT_STATE_CASTING))
+ DoMeleeAttackIfReady();
}
};
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
index fda4767e16b..1e79cc1c5bf 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
@@ -22,7 +22,8 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter
SDCategory: Utgarde Keep
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "utgarde_keep.h"
#define MAX_ENCOUNTER 3
@@ -119,7 +120,7 @@ public:
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
index 95d2cb1709e..c694aa88338 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
@@ -15,8 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "utgarde_keep.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
uint32 entry_search[3] =
{
@@ -163,7 +166,82 @@ public:
};
};
+enum TickingTimeBomb
+{
+ SPELL_TICKING_TIME_BOMB_EXPLODE = 59687
+};
+class spell_ticking_time_bomb : public SpellScriptLoader
+{
+ public:
+ spell_ticking_time_bomb() : SpellScriptLoader("spell_ticking_time_bomb") { }
+
+ class spell_ticking_time_bomb_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_ticking_time_bomb_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ return (bool) sSpellMgr->GetSpellInfo(SPELL_TICKING_TIME_BOMB_EXPLODE);
+ }
+
+ void HandleOnEffectRemove(AuraEffect const* /* aurEff */, AuraEffectHandleModes /* mode */)
+ {
+ if (GetCaster() == GetTarget())
+ {
+ GetTarget()->CastSpell(GetTarget(), SPELL_TICKING_TIME_BOMB_EXPLODE, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_ticking_time_bomb_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_ticking_time_bomb_AuraScript();
+ }
+};
+
+enum Fixate
+{
+ SPELL_FIXATE_TRIGGER = 40415
+};
+class spell_fixate : public SpellScriptLoader
+{
+ public:
+ spell_fixate() : SpellScriptLoader("spell_fixate") { }
+
+ class spell_fixate_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_fixate_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ return (bool) sSpellMgr->GetSpellInfo(SPELL_FIXATE_TRIGGER);
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ // The unit has to cast the taunt on hisself, but we need the original caster for SPELL_AURA_MOD_TAUNT
+ GetCaster()->CastSpell(GetCaster(), SPELL_FIXATE_TRIGGER, true, 0, 0, GetHitUnit()->GetGUID());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_fixate_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_fixate_SpellScript();
+ }
+};
void AddSC_utgarde_keep()
{
new npc_dragonflayer_forge_master();
+ new spell_ticking_time_bomb();
+ new spell_fixate();
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
index e2943f491f6..8cbfe4bafb4 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "utgarde_pinnacle.h"
enum Spells
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index 5132dd0f046..a6ad7befc38 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
@@ -25,7 +25,8 @@ SDComment: <Known Bugs>
SDCategory: Utgarde Pinnacle
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "utgarde_pinnacle.h"
//Yell
@@ -171,6 +172,7 @@ public:
boss_skadiAI(Creature* creature) : ScriptedAI(creature), Summons(me)
{
instance = creature->GetInstanceScript();
+ m_uiGraufGUID = 0;
}
InstanceScript* instance;
@@ -206,7 +208,7 @@ public:
Summons.DespawnAll();
me->SetSpeed(MOVE_FLIGHT, 3.0f);
- if ((Unit::GetCreature((*me), m_uiGraufGUID) == NULL) && !me->IsMounted())
+ if ((Unit::GetCreature(*me, m_uiGraufGUID) == NULL) && !me->IsMounted())
me->SummonCreature(CREATURE_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f);
if (instance)
{
@@ -220,7 +222,7 @@ public:
me->SetCanFly(false);
me->Dismount();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
- if (Unit::GetCreature((*me), m_uiGraufGUID) == NULL)
+ if (!Unit::GetCreature(*me, m_uiGraufGUID))
me->SummonCreature(CREATURE_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f);
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
index 44cd1184098..f2f03ff602b 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "utgarde_pinnacle.h"
enum Spells
@@ -522,12 +525,12 @@ public:
};
};
-class checkRitualTarget
+class RitualTargetCheck
{
public:
- explicit checkRitualTarget(Unit* _caster) : caster(_caster) { }
+ explicit RitualTargetCheck(Unit* _caster) : caster(_caster) { }
- bool operator() (Unit* unit)
+ bool operator() (WorldObject* unit) const
{
if (InstanceScript* instance = caster->GetInstanceScript())
if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID())
@@ -549,14 +552,14 @@ class spell_paralyze_pinnacle : public SpellScriptLoader
{
PrepareSpellScript(spell_paralyze_pinnacle_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if(checkRitualTarget(GetCaster()));
+ unitList.remove_if(RitualTargetCheck(GetCaster()));
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
index f9251c637ba..39fd01a9269 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "utgarde_pinnacle.h"
enum Spells
@@ -120,6 +121,9 @@ public:
m_uiActiveOrder[i] = m_uiActiveOrder[r];
m_uiActiveOrder[r] = temp;
}
+
+ m_uiActivedCreatureGUID = 0;
+ m_uiOrbGUID = 0;
}
bool m_bIsWalking;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
index 26fbbf4d717..c5d50d4e7fd 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "utgarde_pinnacle.h"
#define MAX_ENCOUNTER 4
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
index bffc6af2a3a..96e0bc66bd1 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "vault_of_archavon.h"
#define EMOTE_BERSERK -1590002
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
index 4980ed36ec3..903280d317a 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuras.h"
#include "vault_of_archavon.h"
//Emalon spells
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
index dd9db1c0a99..31003addf1f 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "vault_of_archavon.h"
enum Events
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
index 100f1fccac8..9c60673522c 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "vault_of_archavon.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
index ec0de41ed6d..d1209b40a19 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "vault_of_archavon.h"
/* Vault of Archavon encounters:
diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
index 37ef8bf2788..b4ce402e7de 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
index 31902acfc46..bd59b731c3c 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
index a191d9349f2..f6d918e0493 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
index 7a8254ad2b6..510e9874dd7 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
index 1a70846e1b6..f368b07077a 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
//Spells
diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
index ac165ac39ef..a01b41bfbcf 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
index 4569741e459..d1c65259738 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index 37a13388b5f..4b6fed181e4 100644
--- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "violet_hold.h"
#define MAX_ENCOUNTER 3
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
index e9d2c85e13e..870ea893b78 100644
--- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "violet_hold.h"
@@ -780,10 +782,13 @@ struct violet_hold_trashAI : public npc_escortAI
void JustDied(Unit* /*killer*/)
{
- if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL)))
- CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me);
if (instance)
+ {
+ if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL)))
+ CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me);
+
instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_REMOVE, 1);
+ }
}
void CreatureStartAttackDoor()
diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp
index 8b51618eedd..224d06e9d3c 100644
--- a/src/server/scripts/Northrend/borean_tundra.cpp
+++ b/src/server/scripts/Northrend/borean_tundra.cpp
@@ -37,7 +37,9 @@ npc_lurgglbr
npc_nexus_drake_hatchling
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h"
@@ -1665,7 +1667,6 @@ public:
/*######
## npc_imprisoned_beryl_sorcerer
######*/
-
enum eImprisionedBerylSorcerer
{
SPELL_NEURAL_NEEDLE = 45634,
@@ -1690,103 +1691,79 @@ public:
{
npc_imprisoned_beryl_sorcererAI(Creature* creature) : ScriptedAI(creature) {}
- uint64 CasterGUID;
-
- uint32 uiStep;
- uint32 uiPhase;
+ uint32 rebuff;
void Reset()
{
- uiStep = 1;
- uiPhase = 0;
- CasterGUID = 0;
+ if (me->GetReactState() != REACT_PASSIVE)
+ me->SetReactState(REACT_PASSIVE);
+
+ rebuff = 0;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ UpdateVictim();
+
+ if (rebuff <= diff)
+ {
+ if (!me->HasAura(SPELL_COSMETIC_ENSLAVE_CHAINS_SELF))
+ {
+ DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF);
+ }
+ rebuff = 180000;
+ }
+ else
+ rebuff -= diff;
+
+ DoMeleeAttackIfReady();
}
void EnterCombat(Unit* /*who*/)
{
}
- void SpellHit(Unit* unit, const SpellInfo* pSpell)
+ void SpellHit(Unit* unit, const SpellInfo* spell)
{
- if (pSpell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER)
+ if (spell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER)
{
- ++uiPhase;
- CasterGUID = unit->GetGUID();
+ if (Player* player = unit->ToPlayer())
+ {
+ GotStinged(player->GetGUID());
+ }
}
}
- void UpdateAI(const uint32 uiDiff)
+ void GotStinged(uint64 casterGUID)
{
- ScriptedAI::UpdateAI(uiDiff);
-
- if (!me->HasAura(SPELL_COSMETIC_ENSLAVE_CHAINS_SELF))
- DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF);
-
- if (me->GetReactState() != REACT_PASSIVE)
- me->SetReactState(REACT_PASSIVE);
-
- switch (uiPhase)
+ if (Player* caster = Player::GetPlayer(*me, casterGUID))
{
- case 1:
- if (uiStep == 1)
- {
+ uint32 step = caster->GetAuraCount(SPELL_NEURAL_NEEDLE) + 1;
+ switch (step)
+ {
+ case 1:
DoScriptText(SAY_IMPRISIONED_BERYL_1, me);
- uiStep = 2;
- }
- break;
-
- case 2:
- if (uiStep == 2)
- {
- DoScriptText(SAY_IMPRISIONED_BERYL_2, me);
- uiStep = 3;
- }
- break;
-
- case 3:
- if (uiStep == 3)
- {
+ break;
+ case 2:
+ DoScriptText(SAY_IMPRISIONED_BERYL_2, me, caster);
+ break;
+ case 3:
DoScriptText(SAY_IMPRISIONED_BERYL_3, me);
- uiStep = 4;
- }
- break;
-
- case 4:
- if (uiStep == 4)
- {
+ break;
+ case 4:
DoScriptText(SAY_IMPRISIONED_BERYL_4, me);
- uiStep = 5;
- }
- break;
-
- case 5:
- if (uiStep == 5)
- {
- if (Player* pCaster = Unit::GetPlayer(*me, CasterGUID))
- {
- DoScriptText(SAY_IMPRISIONED_BERYL_5, me);
- pCaster->KilledMonsterCredit(25478, 0);
- uiStep = 6;
- }
- }
- break;
-
- case 6:
- if (uiStep == 6)
- {
- DoScriptText(SAY_IMPRISIONED_BERYL_6, me);
- uiStep = 7;
- }
- break;
-
- case 7:
- if (uiStep == 7)
- {
+ break;
+ case 5:
+ DoScriptText(SAY_IMPRISIONED_BERYL_5, me);
+ break;
+ case 6:
+ DoScriptText(SAY_IMPRISIONED_BERYL_6, me, caster);
+ break;
+ case 7:
DoScriptText(SAY_IMPRISIONED_BERYL_7, me);
- uiStep = 1;
- uiPhase = 0;
- }
- break;
+ caster->KilledMonsterCredit(NPC_IMPRISONED_BERYL_SORCERER, 0);
+ break;
+ }
}
}
};
diff --git a/src/server/scripts/Northrend/crystalsong_forest.cpp b/src/server/scripts/Northrend/crystalsong_forest.cpp
index d48903696ec..7b8eb331702 100644
--- a/src/server/scripts/Northrend/crystalsong_forest.cpp
+++ b/src/server/scripts/Northrend/crystalsong_forest.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: CrystalsongForest
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*******************************************************
* npc_warmage_violetstand
diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp
index e7b92732066..c19effbab1b 100644
--- a/src/server/scripts/Northrend/dalaran.cpp
+++ b/src/server/scripts/Northrend/dalaran.cpp
@@ -23,7 +23,9 @@ SDComment: For what is 63990+63991? Same function but don't work correct...
SDCategory: Dalaran
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*******************************************************
* npc_mageguard_dalaran
diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp
index 1b339b24549..a26ee4e9270 100644
--- a/src/server/scripts/Northrend/dragonblight.cpp
+++ b/src/server/scripts/Northrend/dragonblight.cpp
@@ -27,7 +27,11 @@ EndScriptData */
npc_alexstrasza_wr_gate
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "ScriptedEscortAI.h"
enum eEnums
@@ -75,16 +79,16 @@ public:
enum StrengthenAncientsMisc
{
- SAY_WALKER_FRIENDLY = 0,
- SAY_WALKER_ENEMY = 1,
- SAY_LOTHALOR = 0,
+ SAY_WALKER_FRIENDLY = 0,
+ SAY_WALKER_ENEMY = 1,
+ SAY_LOTHALOR = 0,
- SPELL_CREATE_ITEM_BARK = 47550,
- SPELL_CONFUSED = 47044,
+ SPELL_CREATE_ITEM_BARK = 47550,
+ SPELL_CONFUSED = 47044,
- NPC_LOTHALOR = 26321,
+ NPC_LOTHALOR = 26321,
- FACTION_WALKER_ENEMY = 14,
+ FACTION_WALKER_ENEMY = 14,
};
class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker
@@ -166,9 +170,56 @@ public:
}
};
+/*######
+## wyrmrest_defender
+######*/
+
+enum WyrmDefenderEnum
+{
+ QUEST_DEFENDING_WYRMREST_TEMPLE = 12372,
+ GOSSIP_TEXTID_DEF1 = 12899,
+ GOSSIP_TEXTID_DEF2 = 12900,
+ SPELL_CHARACTER_SCRIPT = 49213
+};
+
+#define GOSSIP_ITEM_1 "We need to get into the fight. Are you ready?"
+
+class npc_wyrmrest_defender : public CreatureScript
+{
+ public:
+ npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { }
+
+ bool OnGossipHello(Player* player, Creature* creature)
+ {
+ if (player->GetQuestStatus(QUEST_DEFENDING_WYRMREST_TEMPLE) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF1, creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ {
+ player->PlayerTalkClass->ClearMenus();
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF2, creature->GetGUID());
+ // Makes player cast trigger spell for 49207 on self
+ player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true);
+ }
+
+ return true;
+ }
+};
+
void AddSC_dragonblight()
{
new npc_alexstrasza_wr_gate;
new spell_q12096_q12092_dummy;
new spell_q12096_q12092_bark;
+ new npc_wyrmrest_defender;
}
diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp
index 2da84dd3fdb..4ca12bc82a1 100644
--- a/src/server/scripts/Northrend/grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/grizzly_hills.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
/*######
@@ -599,100 +600,99 @@ enum eSmokeEmOut
QUEST_SMOKE_EM_OUT_H = 12324,
SPELL_SMOKE_BOMB = 49075,
SPELL_CHOP = 43410,
- NPC_VENTURE_CO_STABLES_KC = 27568,
+ SPELL_VENTURE_STRAGGLER_CREDIT = 49093,
};
class npc_venture_co_straggler : public CreatureScript
{
-public:
- npc_venture_co_straggler() : CreatureScript("npc_venture_co_straggler") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_venture_co_stragglerAI(creature);
- }
+ public:
+ npc_venture_co_straggler() : CreatureScript("npc_venture_co_straggler") { }
- struct npc_venture_co_stragglerAI : public ScriptedAI
- {
- npc_venture_co_stragglerAI(Creature* creature) : ScriptedAI(creature) { }
+ struct npc_venture_co_stragglerAI : public ScriptedAI
+ {
+ npc_venture_co_stragglerAI(Creature* creature) : ScriptedAI(creature) { }
- uint64 uiPlayerGUID;
- uint32 uiRunAwayTimer;
- uint32 uiTimer;
- uint32 uiChopTimer;
+ uint64 uiPlayerGUID;
+ uint32 uiRunAwayTimer;
+ uint32 uiTimer;
+ uint32 uiChopTimer;
- void Reset()
- {
- uiPlayerGUID = 0;
- uiTimer = 0;
- uiChopTimer = urand(10000, 12500);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- me->SetReactState(REACT_AGGRESSIVE);
- }
+ void Reset()
+ {
+ uiPlayerGUID = 0;
+ uiTimer = 0;
+ uiRunAwayTimer = 0;
+ uiChopTimer = urand(10000, 12500);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetReactState(REACT_AGGRESSIVE);
+ }
- void UpdateAI(const uint32 uiDiff)
- {
- if (uiRunAwayTimer <= uiDiff)
+ void UpdateAI(const uint32 uiDiff)
{
- if (Player* player = Unit::GetPlayer(*me, uiPlayerGUID))
+ if (uiPlayerGUID && uiRunAwayTimer <= uiDiff)
{
- switch (uiTimer)
+ if (Player* player = Unit::GetPlayer(*me, uiPlayerGUID))
{
- case 0:
- if (player->GetQuestStatus(QUEST_SMOKE_EM_OUT_A) == QUEST_STATUS_INCOMPLETE ||
- player->GetQuestStatus(QUEST_SMOKE_EM_OUT_H) == QUEST_STATUS_INCOMPLETE)
- player->KilledMonsterCredit(NPC_VENTURE_CO_STABLES_KC, 0);
- me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()+7, me->GetPositionZ());
- uiRunAwayTimer = 2500;
- ++uiTimer;
- break;
- case 1:
- DoScriptText(RAND(SAY_SEO1, SAY_SEO2, SAY_SEO3, SAY_SEO4, SAY_SEO5), me);
- me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()-5, me->GetPositionZ());
- uiRunAwayTimer = 2500;
- ++uiTimer;
- break;
- case 2:
- me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-5, me->GetPositionY()-5, me->GetPositionZ());
- uiRunAwayTimer = 2500;
- ++uiTimer;
- break;
- case 3:
- me->DisappearAndDie();
- uiTimer = 0;
- break;
+ switch (uiTimer)
+ {
+ case 0:
+ DoCast(player, SPELL_VENTURE_STRAGGLER_CREDIT);
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()+7, me->GetPositionZ());
+ uiRunAwayTimer = 2500;
+ ++uiTimer;
+ break;
+ case 1:
+ DoScriptText(RAND(SAY_SEO1, SAY_SEO2, SAY_SEO3, SAY_SEO4, SAY_SEO5), me);
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()-5, me->GetPositionZ());
+ uiRunAwayTimer = 2500;
+ ++uiTimer;
+ break;
+ case 2:
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-5, me->GetPositionY()-5, me->GetPositionZ());
+ uiRunAwayTimer = 2500;
+ ++uiTimer;
+ break;
+ case 3:
+ me->DisappearAndDie();
+ uiTimer = 0;
+ break;
+ }
}
}
- }
- else
- uiRunAwayTimer -= uiDiff;
+ else if (uiRunAwayTimer)
+ uiRunAwayTimer -= uiDiff;
- if (!UpdateVictim())
- return;
+ if (!UpdateVictim())
+ return;
- if (uiChopTimer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_CHOP);
- uiChopTimer = urand(10000, 12000);
- }
- else
- uiChopTimer -= uiDiff;
+ if (uiChopTimer <= uiDiff)
+ {
+ DoCast(me->getVictim(), SPELL_CHOP);
+ uiChopTimer = urand(10000, 12000);
+ }
+ else
+ uiChopTimer -= uiDiff;
- DoMeleeAttackIfReady();
- }
+ DoMeleeAttackIfReady();
+ }
- void SpellHit(Unit* pCaster, const SpellInfo* pSpell)
- {
- if (pCaster && pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_SMOKE_BOMB)
+ void SpellHit(Unit* caster, SpellInfo const* spell)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- me->SetReactState(REACT_PASSIVE);
- me->CombatStop(false);
- uiPlayerGUID = pCaster->GetGUID();
- uiRunAwayTimer = 3500;
+ if (spell->Id == SPELL_SMOKE_BOMB && caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetReactState(REACT_PASSIVE);
+ me->CombatStop(false);
+ uiPlayerGUID = caster->GetGUID();
+ uiRunAwayTimer = 3500;
+ }
}
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_venture_co_stragglerAI(creature);
}
- };
};
void AddSC_grizzly_hills()
diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp
index 88cc297868b..ffe38d6aade 100644
--- a/src/server/scripts/Northrend/howling_fjord.cpp
+++ b/src/server/scripts/Northrend/howling_fjord.cpp
@@ -27,7 +27,9 @@ npc_plaguehound_tracker
npc_apothecary_hanes
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
index fb2e0f6c389..5989b5bad2e 100644
--- a/src/server/scripts/Northrend/icecrown.cpp
+++ b/src/server/scripts/Northrend/icecrown.cpp
@@ -27,7 +27,10 @@ EndScriptData */
npc_arete
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellAuras.h"
/*######
## npc_arete
@@ -169,8 +172,7 @@ enum eArgentValiant
{
SPELL_CHARGE = 63010,
SPELL_SHIELD_BREAKER = 65147,
-
- NPC_ARGENT_VALIANT_CREDIT = 24108
+ SPELL_KILL_CREDIT = 63049
};
class npc_argent_valiant : public CreatureScript
@@ -208,7 +210,7 @@ public:
if (uiDamage > me->GetHealth() && pDoneBy->GetTypeId() == TYPEID_PLAYER)
{
uiDamage = 0;
- CAST_PLR(pDoneBy)->KilledMonsterCredit(NPC_ARGENT_VALIANT_CREDIT, 0);
+ pDoneBy->CastSpell(pDoneBy, SPELL_KILL_CREDIT, true);
me->setFaction(35);
me->DespawnOrUnsummon(5000);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp
index 6d76e348980..1cf8f54b4fe 100644
--- a/src/server/scripts/Northrend/isle_of_conquest.cpp
+++ b/src/server/scripts/Northrend/isle_of_conquest.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "BattlegroundIC.h"
// TO-DO: This should be done with SmartAI, but yet it does not correctly support vehicles's AIs.
diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp
index afab9b90a4a..56ef25c5753 100644
--- a/src/server/scripts/Northrend/sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/sholazar_basin.cpp
@@ -28,8 +28,11 @@ npc_vekjik
avatar_of_freya
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
+#include "SpellScript.h"
/*######
## npc_injured_rainspeaker_oracle
diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp
index 15239e9f836..976a6e5dba5 100644
--- a/src/server/scripts/Northrend/storm_peaks.cpp
+++ b/src/server/scripts/Northrend/storm_peaks.cpp
@@ -15,9 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "Vehicle.h"
+#include "CombatAI.h"
/*######
## npc_agnetta_tyrsdottar
@@ -129,229 +132,6 @@ public:
}
};
-/*######
-## npc_thorim
-######*/
-
-#define GOSSIP_HN "Thorim?"
-#define GOSSIP_SN1 "Can you tell me what became of Sif?"
-#define GOSSIP_SN2 "He did more than that, Thorim. He controls Ulduar now."
-#define GOSSIP_SN3 "It needn't end this way."
-
-enum eThorim
-{
- QUEST_SIBLING_RIVALRY = 13064,
- NPC_THORIM = 29445,
- GOSSIP_TEXTID_THORIM1 = 13799,
- GOSSIP_TEXTID_THORIM2 = 13801,
- GOSSIP_TEXTID_THORIM3 = 13802,
- GOSSIP_TEXTID_THORIM4 = 13803
-};
-
-class npc_thorim : public CreatureScript
-{
-public:
- npc_thorim() : CreatureScript("npc_thorim") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_SIBLING_RIVALRY) == QUEST_STATUS_INCOMPLETE) {
- player->ADD_GOSSIP_ITEM(0, GOSSIP_HN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM1, creature->GetGUID());
- return true;
- }
- return false;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM2, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_SN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM3, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_SN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM4, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->CompleteQuest(QUEST_SIBLING_RIVALRY);
- break;
- }
- return true;
- }
-};
-
-/*######
-## npc_victorious_challenger
-######*/
-
-#define GOSSIP_CHALLENGER "Let's do this, sister."
-
-enum eVictoriousChallenger
-{
- QUEST_TAKING_ALL_CHALLENGERS = 12971,
- QUEST_DEFENDING_YOUR_TITLE = 13423,
-
- SPELL_SUNDER_ARMOR = 11971,
- SPELL_REND_VC = 11977
-};
-
-class npc_victorious_challenger : public CreatureScript
-{
-public:
- npc_victorious_challenger() : CreatureScript("npc_victorious_challenger") { }
-
- struct npc_victorious_challengerAI : public ScriptedAI
- {
- npc_victorious_challengerAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 SunderArmorTimer;
- uint32 RendTimer;
-
- void Reset()
- {
- me->RestoreFaction();
-
- SunderArmorTimer = 10000;
- RendTimer = 15000;
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- if (RendTimer < diff)
- {
- DoCast(me->getVictim(), SPELL_REND_VC, true);
- RendTimer = 15000;
- }else RendTimer -= diff;
-
- if (SunderArmorTimer < diff)
- {
- DoCast(me->getVictim(), SPELL_SUNDER_ARMOR, true);
- SunderArmorTimer = 10000;
- }else SunderArmorTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
- void KilledUnit(Unit* /*victim*/)
- {
- me->RestoreFaction();
- }
-
- };
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_TAKING_ALL_CHALLENGERS) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_DEFENDING_YOUR_TITLE) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CHALLENGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- return false;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->setFaction(14);
- creature->AI()->AttackStart(player);
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_victorious_challengerAI(creature);
- }
-};
-
-/*######
-## npc_loklira_crone
-######*/
-
-#define GOSSIP_LOKLIRACRONE "Tell me about this proposal"
-#define GOSSIP_LOKLIRACRONE1 "What happened then?"
-#define GOSSIP_LOKLIRACRONE2 "You want me to take part in the Hyldsmeet to end the war?"
-#define GOSSIP_LOKLIRACRONE3 "Very well. I'll take part in this competition."
-
-enum eLokliraCrone
-{
- QUEST_HYLDSMEET = 12970,
-
- GOSSIP_TEXTID_LOK1 = 13778,
- GOSSIP_TEXTID_LOK2 = 13779,
- GOSSIP_TEXTID_LOK3 = 13780
-};
-
-class npc_loklira_crone : public CreatureScript
-{
-public:
- npc_loklira_crone() : CreatureScript("npc_loklira_crone") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_HYLDSMEET) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOKLIRACRONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
- return false;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOKLIRACRONE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOK1, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOKLIRACRONE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOK2, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOKLIRACRONE3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOK3, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->CompleteQuest(QUEST_HYLDSMEET);
- break;
- }
- return true;
- }
-};
-
/////////////////////
///npc_injured_goblin
/////////////////////
@@ -504,14 +284,12 @@ public:
## npc_brunnhildar_prisoner
######*/
-enum brunhildar {
- NPC_QUEST_GIVER = 29592,
-
+enum BrunnhildarPrisoner {
SPELL_ICE_PRISON = 54894,
- SPELL_KILL_CREDIT_PRISONER = 55144,
- SPELL_KILL_CREDIT_DRAKE = 55143,
- SPELL_SUMMON_LIBERATED = 55073,
- SPELL_ICE_LANCE = 55046
+ SPELL_ICE_LANCE = 55046,
+ SPELL_FREE_PRISONER = 55048,
+ SPELL_RIDE_DRAKE = 55074,
+ SPELL_SHARD_IMPACT = 55047
};
class npc_brunnhildar_prisoner : public CreatureScript
@@ -523,129 +301,169 @@ public:
{
npc_brunnhildar_prisonerAI(Creature* creature) : ScriptedAI(creature) {}
- uint64 drakeGUID;
- uint16 enter_timer;
- bool hasEmptySeats;
+ bool freed;
void Reset()
{
+ freed = false;
me->CastSpell(me, SPELL_ICE_PRISON, true);
- enter_timer = 0;
- drakeGUID = 0;
- hasEmptySeats = false;
}
- void UpdateAI(const uint32 diff)
+ void JustRespawned()
+ {
+ Reset();
+ }
+
+ void UpdateAI(const uint32 /*diff*/)
{
- //TODO: not good script
- if (!drakeGUID)
+ if (!freed)
return;
- Creature* drake = Unit::GetCreature(*me, drakeGUID);
- if (!drake)
+ if (!me->HasUnitState(UNIT_STATE_ONVEHICLE))
{
- drakeGUID = 0;
- return;
+ me->DespawnOrUnsummon();
}
+ }
- // drake unsummoned, passengers dropped
- if (!me->IsOnVehicle(drake) && !hasEmptySeats)
- me->DespawnOrUnsummon(3000);
-
- if (enter_timer <= 0)
+ void SpellHit(Unit* caster, const SpellInfo* spell)
+ {
+ if (spell->Id != SPELL_ICE_LANCE)
return;
- if (enter_timer < diff)
+ if (caster->GetVehicleKit()->GetAvailableSeatCount() != 0)
{
- enter_timer = 0;
- if (hasEmptySeats)
- me->JumpTo(drake, 25.0f);
- else
- Reset();
+ me->CastSpell(me, SPELL_FREE_PRISONER, true);
+ me->CastSpell(caster, SPELL_RIDE_DRAKE, true);
+ me->CastSpell(me, SPELL_SHARD_IMPACT, true);
+ freed = true;
}
- else
- enter_timer -= diff;
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_brunnhildar_prisonerAI(creature);
+ }
+};
+
+/*######
+## npc_freed_protodrake
+######*/
+
+enum FreedProtoDrake
+{
+ AREA_VALLEY_OF_ANCIENT_WINTERS = 4437,
+ TEXT_EMOTE = 0,
+ SPELL_KILL_CREDIT_PRISONER = 55144,
+ SPELL_SUMMON_LIBERATED = 55073,
+ SPELL_KILL_CREDIT_DRAKE = 55143
+};
+
+const Position FreedDrakeWaypoints[16] =
+{
+ {7294.96f, -2418.733f, 823.869f, 0.0f},
+ {7315.984f, -2331.46f, 826.3972f, 0.0f},
+ {7271.826f, -2271.479f, 833.5917f, 0.0f},
+ {7186.253f, -2218.475f, 847.5632f, 0.0f},
+ {7113.195f, -2164.288f, 850.2301f, 0.0f},
+ {7078.018f, -2063.106f, 854.7581f, 0.0f},
+ {7073.221f, -1983.382f, 861.9246f, 0.0f},
+ {7061.455f, -1885.899f, 865.119f, 0.0f},
+ {7033.32f, -1826.775f, 876.2578f, 0.0f},
+ {6999.902f, -1784.012f, 897.4521f, 0.0f},
+ {6954.913f, -1747.043f, 897.4521f, 0.0f},
+ {6933.856f, -1720.698f, 882.2022f, 0.0f},
+ {6932.729f, -1687.306f, 866.1189f, 0.0f},
+ {6952.458f, -1663.802f, 849.8133f, 0.0f},
+ {7002.819f, -1651.681f, 831.397f, 0.0f},
+ {7026.531f, -1649.239f, 828.8406f, 0.0f}
+};
+
+
+class npc_freed_protodrake : public CreatureScript
+{
+public:
+ npc_freed_protodrake() : CreatureScript("npc_freed_protodrake") { }
+
+ struct npc_freed_protodrakeAI : public VehicleAI
+ {
+ npc_freed_protodrakeAI(Creature* creature) : VehicleAI(creature) {}
+
+ bool autoMove;
+ bool wpReached;
+ uint16 CheckTimer;
+ uint16 countWP;
+
+ void Reset()
+ {
+ autoMove = false;
+ wpReached = false;
+ CheckTimer = 5000;
+ countWP = 0;
}
- void MoveInLineOfSight(Unit* who)
+ void MovementInform(uint32 type, uint32 id)
{
- if (!who || !drakeGUID)
+ if (type != POINT_MOTION_TYPE)
return;
- Creature* drake = Unit::GetCreature(*me, drakeGUID);
- if (!drake)
+ if (id < 15)
{
- drakeGUID = 0;
- return;
+ ++countWP;
+ wpReached = true;
}
-
- if (!me->IsOnVehicle(drake) && !me->HasAura(SPELL_ICE_PRISON))
+ else
+ // drake reached village
{
- if (who->IsVehicle() && me->IsWithinDist(who, 25.0f, true) && who->ToCreature() && who->ToCreature()->GetEntry() == 29709)
+ // get player that rides drake (from seat 0)
+ Unit* player = me->GetVehicleKit()->GetPassenger(0);
+ if (player && player->GetTypeId() == TYPEID_PLAYER)
{
- uint8 seat = who->GetVehicleKit()->GetNextEmptySeat(0, true);
- if (seat <= 0)
- return;
-
- me->EnterVehicle(who, seat);
- me->SendMovementFlagUpdate();
- hasEmptySeats = false;
+ // for each prisoner on drake,give credit
+ for (uint8 i = 1; i < 4; ++i)
+ if (Unit* prisoner = me->GetVehicleKit()->GetPassenger(i))
+ {
+ if (prisoner->GetTypeId() != TYPEID_UNIT)
+ return;
+ prisoner->CastSpell(player, SPELL_KILL_CREDIT_PRISONER, true);
+ prisoner->CastSpell(prisoner, SPELL_SUMMON_LIBERATED, true);
+ prisoner->ExitVehicle();
+ }
+ me->CastSpell(me, SPELL_KILL_CREDIT_DRAKE, true);
+ player->ExitVehicle();
}
}
+ }
- if (who->ToCreature() && me->IsOnVehicle(drake))
+ void UpdateAI(const uint32 diff)
+ {
+ if (!autoMove)
{
- if (who->ToCreature()->GetEntry() == NPC_QUEST_GIVER && me->IsWithinDist(who, 15.0f, false))
+ if (CheckTimer < diff)
{
- Unit* rider = drake->GetVehicleKit()->GetPassenger(0);
- if (!rider)
- return;
-
- rider->CastSpell(rider, SPELL_KILL_CREDIT_PRISONER, true);
-
- me->ExitVehicle();
- me->CastSpell(me, SPELL_SUMMON_LIBERATED, true);
- me->DespawnOrUnsummon(500);
-
- // drake is empty now, deliver credit for drake and despawn him
- if (drake->GetVehicleKit()->HasEmptySeat(1) &&
- drake->GetVehicleKit()->HasEmptySeat(2) &&
- drake->GetVehicleKit()->HasEmptySeat(3))
+ CheckTimer = 5000;
+ if (me->GetAreaId() == AREA_VALLEY_OF_ANCIENT_WINTERS)
{
- // not working rider->CastSpell(rider, SPELL_KILL_CREDIT_DRAKE, true);
- if (rider->ToPlayer())
- rider->ToPlayer()->KilledMonsterCredit(29709, 0);
-
- drake->DespawnOrUnsummon(0);
+ Talk(TEXT_EMOTE, me->GetVehicleKit()->GetPassenger(0)->GetGUID());
+ autoMove = true;
+ wpReached = true;
}
}
+ else
+ CheckTimer -= diff;
}
- }
-
- void SpellHit(Unit* hitter, const SpellInfo* spell)
- {
- if (!hitter || !spell)
- return;
-
- if (spell->Id != SPELL_ICE_LANCE)
- return;
-
- me->RemoveAura(SPELL_ICE_PRISON);
- enter_timer = 500;
- if (hitter->IsVehicle())
- drakeGUID = hitter->GetGUID();
- else
- return;
-
- if (hitter->GetVehicleKit()->GetNextEmptySeat(0, true))
- hasEmptySeats = true;
+ if (wpReached && autoMove)
+ {
+ wpReached = false;
+ me->GetMotionMaster()->MovePoint(countWP, FreedDrakeWaypoints[countWP]);
+ }
}
};
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_brunnhildar_prisonerAI(creature);
+ return new npc_freed_protodrakeAI(creature);
}
};
@@ -750,12 +568,10 @@ void AddSC_storm_peaks()
{
new npc_agnetta_tyrsdottar();
new npc_frostborn_scout();
- new npc_thorim();
- new npc_victorious_challenger();
- new npc_loklira_crone();
new npc_injured_goblin();
new npc_roxi_ramrocket();
new npc_brunnhildar_prisoner();
+ new npc_freed_protodrake();
new npc_icefang();
new npc_hyldsmeet_protodrake();
}
diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp
new file mode 100644
index 00000000000..59e9a31c4cf
--- /dev/null
+++ b/src/server/scripts/Northrend/wintergrasp.cpp
@@ -0,0 +1,585 @@
+/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "BattlefieldMgr.h"
+#include "BattlefieldWG.h"
+#include "Battlefield.h"
+#include "ScriptSystem.h"
+#include "WorldSession.h"
+#include "ObjectMgr.h"
+#include "Vehicle.h"
+#include "GameObjectAI.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellScript.h"
+
+#define GOSSIP_HELLO_DEMO1 "Build catapult."
+#define GOSSIP_HELLO_DEMO2 "Build demolisher."
+#define GOSSIP_HELLO_DEMO3 "Build siege engine."
+#define GOSSIP_HELLO_DEMO4 "I cannot build more!"
+
+enum WGqueuenpctext
+{
+ WG_NPCQUEUE_TEXT_H_NOWAR = 14775,
+ WG_NPCQUEUE_TEXT_H_QUEUE = 14790,
+ WG_NPCQUEUE_TEXT_H_WAR = 14777,
+ WG_NPCQUEUE_TEXT_A_NOWAR = 14782,
+ WG_NPCQUEUE_TEXT_A_QUEUE = 14791,
+ WG_NPCQUEUE_TEXT_A_WAR = 14781,
+ WG_NPCQUEUE_TEXTOPTION_JOIN = -1850507,
+};
+
+enum Spells
+{
+ // Demolisher engineers spells
+ SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE = 61409,
+ SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE = 56662,
+ SPELL_BUILD_CATAPULT_FORCE = 56664,
+ SPELL_BUILD_DEMOLISHER_FORCE = 56659,
+ SPELL_ACTIVATE_CONTROL_ARMS = 49899,
+ SPELL_RIDE_WG_VEHICLE = 60968,
+
+ SPELL_VEHICLE_TELEPORT = 49759,
+
+ // Spirit guide
+ SPELL_CHANNEL_SPIRIT_HEAL = 22011,
+};
+
+enum CreatureIds
+{
+ NPC_GOBLIN_MECHANIC = 30400,
+ NPC_GNOMISH_ENGINEER = 30499,
+
+ NPC_WINTERGRASP_CONTROL_ARMS = 27852,
+
+ NPC_WORLD_TRIGGER_LARGE_AOI_NOT_IMMUNE_PC_NPC = 23472,
+};
+
+enum QuestIds
+{
+ QUEST_BONES_AND_ARROWS_HORDE_ATT = 13193,
+ QUEST_JINXING_THE_WALLS_HORDE_ATT = 13202,
+ QUEST_SLAY_THEM_ALL_HORDE_ATT = 13180,
+ QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT = 13200,
+ QUEST_HEALING_WITH_ROSES_HORDE_ATT = 13201,
+ QUEST_DEFEND_THE_SIEGE_HORDE_ATT = 13223,
+
+ QUEST_BONES_AND_ARROWS_HORDE_DEF = 13199,
+ QUEST_WARDING_THE_WALLS_HORDE_DEF = 13192,
+ QUEST_SLAY_THEM_ALL_HORDE_DEF = 13178,
+ QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF = 13191,
+ QUEST_HEALING_WITH_ROSES_HORDE_DEF = 13194,
+ QUEST_TOPPLING_THE_TOWERS_HORDE_DEF = 13539,
+ QUEST_STOP_THE_SIEGE_HORDE_DEF = 13185,
+
+ QUEST_BONES_AND_ARROWS_ALLIANCE_ATT = 13196,
+ QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT = 13198,
+ QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT = 13179,
+ QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT = 13222,
+ QUEST_A_RARE_HERB_ALLIANCE_ATT = 13195,
+
+ QUEST_BONES_AND_ARROWS_ALLIANCE_DEF = 13154,
+ QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF = 13153,
+ QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF = 13177,
+ QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF = 13538,
+ QUEST_STOP_THE_SIEGE_ALLIANCE_DEF = 13186,
+ QUEST_A_RARE_HERB_ALLIANCE_DEF = 13156,
+};
+
+uint8 const MAX_WINTERGRASP_VEHICLES = 4;
+
+uint32 const vehiclesList[MAX_WINTERGRASP_VEHICLES] =
+{
+ NPC_WINTERGRASP_CATAPULT,
+ NPC_WINTERGRASP_DEMOLISHER,
+ NPC_WINTERGRASP_SIEGE_ENGINE_ALLIANCE,
+ NPC_WINTERGRASP_SIEGE_ENGINE_HORDE
+};
+
+class npc_wg_demolisher_engineer : public CreatureScript
+{
+ public:
+ npc_wg_demolisher_engineer() : CreatureScript("npc_wg_demolisher_engineer") { }
+
+ bool OnGossipHello(Player* player, Creature* creature)
+ {
+ if (creature->isQuestGiver())
+ player->PrepareQuestMenu(creature->GetGUID());
+
+ if (canBuild(creature))
+ {
+ if (player->HasAura(SPELL_CORPORAL))
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ else if (player->HasAura(SPELL_LIEUTENANT))
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ }
+ }
+ else
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ if (canBuild(creature))
+ {
+ switch (action - GOSSIP_ACTION_INFO_DEF)
+ {
+ case 0:
+ creature->CastSpell(player, SPELL_BUILD_CATAPULT_FORCE, true);
+ break;
+ case 1:
+ creature->CastSpell(player, SPELL_BUILD_DEMOLISHER_FORCE, true);
+ break;
+ case 2:
+ creature->CastSpell(player, player->GetTeamId() == TEAM_ALLIANCE ? SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE : SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE, true);
+ break;
+ }
+ if (Creature* controlArms = creature->FindNearestCreature(NPC_WINTERGRASP_CONTROL_ARMS, 30.0f, true))
+ creature->CastSpell(controlArms, SPELL_ACTIVATE_CONTROL_ARMS, true);
+ }
+ return true;
+ }
+
+ private:
+ bool canBuild(Creature* creature)
+ {
+ Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
+ if (!wintergrasp)
+ return false;
+
+ switch (creature->GetEntry())
+ {
+ case NPC_GOBLIN_MECHANIC:
+ return (wintergrasp->GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H) > wintergrasp->GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
+ case NPC_GNOMISH_ENGINEER:
+ return (wintergrasp->GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A) > wintergrasp->GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
+ default:
+ return false;
+ }
+ }
+};
+
+class npc_wg_spirit_guide : public CreatureScript
+{
+ public:
+ npc_wg_spirit_guide() : CreatureScript("npc_wg_spirit_guide") { }
+
+ bool OnGossipHello(Player* player, Creature* creature)
+ {
+ if (creature->isQuestGiver())
+ player->PrepareQuestMenu(creature->GetGUID());
+
+ Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
+ if (!wintergrasp)
+ return true;
+
+ GraveyardVect graveyard = wintergrasp->GetGraveyardVector();
+ for (uint8 i = 0; i < graveyard.size(); i++)
+ if (graveyard[i]->GetControlTeamId() == player->GetTeamId())
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(((BfGraveyardWG*)graveyard[i])->GetTextId()), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + i);
+
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
+ if (wintergrasp)
+ {
+ GraveyardVect gy = wintergrasp->GetGraveyardVector();
+ for (uint8 i = 0; i < gy.size(); i++)
+ if (action - GOSSIP_ACTION_INFO_DEF == i && gy[i]->GetControlTeamId() == player->GetTeamId())
+ if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(gy[i]->GetGraveyardId()))
+ player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0);
+ }
+ return true;
+ }
+
+ struct npc_wg_spirit_guideAI : public ScriptedAI
+ {
+ npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void UpdateAI(uint32 const /*diff*/)
+ {
+ if (!me->HasUnitState(UNIT_STATE_CASTING))
+ DoCast(me, SPELL_CHANNEL_SPIRIT_HEAL);
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_wg_spirit_guideAI(creature);
+ }
+};
+
+class npc_wg_queue : public CreatureScript
+{
+ public:
+ npc_wg_queue() : CreatureScript("npc_wg_queue") { }
+
+ bool OnGossipHello(Player* player, Creature* creature)
+ {
+ if (creature->isQuestGiver())
+ player->PrepareQuestMenu(creature->GetGUID());
+
+ Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
+ if (!wintergrasp)
+ return true;
+
+ if (wintergrasp->IsWarTime())
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
+ }
+ else
+ {
+ uint32 timer = wintergrasp->GetTimer() / 1000;
+ player->SendUpdateWorldState(4354, time(NULL) + timer);
+ if (timer < 15 * MINUTE)
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
+ }
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
+ if (!wintergrasp)
+ return true;
+
+ if (wintergrasp->IsWarTime())
+ wintergrasp->InvitePlayerToWar(player);
+ else
+ {
+ uint32 timer = wintergrasp->GetTimer() / 1000;
+ if (timer < 15 * MINUTE)
+ wintergrasp->InvitePlayerToQueue(player);
+ }
+ return true;
+ }
+};
+
+class go_wg_vehicle_teleporter : public GameObjectScript
+{
+ public:
+ go_wg_vehicle_teleporter() : GameObjectScript("go_wg_vehicle_teleporter") { }
+
+ struct go_wg_vehicle_teleporterAI : public GameObjectAI
+ {
+ go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), _checkTimer(1000) { }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (_checkTimer <= diff)
+ {
+ if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
+ // Tabulation madness in the hole!
+ for (uint8 i = 0; i < MAX_WINTERGRASP_VEHICLES; i++)
+ if (Creature* vehicleCreature = go->FindNearestCreature(vehiclesList[i], 3.0f, true))
+ if (!vehicleCreature->HasAura(SPELL_VEHICLE_TELEPORT) && vehicleCreature->getFaction() == WintergraspFaction[wg->GetDefenderTeam()])
+ if (Creature* teleportTrigger = vehicleCreature->FindNearestCreature(NPC_WORLD_TRIGGER_LARGE_AOI_NOT_IMMUNE_PC_NPC, 100.0f, true))
+ teleportTrigger->CastSpell(vehicleCreature, SPELL_VEHICLE_TELEPORT, true);
+
+ _checkTimer = 1000;
+ }
+ else _checkTimer -= diff;
+ }
+
+ private:
+ uint32 _checkTimer;
+ };
+
+ GameObjectAI* GetAI(GameObject* go) const
+ {
+ return new go_wg_vehicle_teleporterAI(go);
+ }
+};
+
+class npc_wg_quest_giver : public CreatureScript
+{
+ public:
+ npc_wg_quest_giver() : CreatureScript("npc_wg_quest_giver") { }
+
+ bool OnGossipHello(Player* player, Creature* creature)
+ {
+ if (creature->isQuestGiver())
+ player->PrepareQuestMenu(creature->GetGUID());
+
+ Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
+ if (!wintergrasp)
+ return true;
+
+ if (creature->isQuestGiver())
+ {
+ QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
+ QuestRelationBounds objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
+
+ QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu();
+ qm.ClearMenu();
+
+ for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i)
+ {
+ uint32 questId = i->second;
+ QuestStatus status = player->GetQuestStatus(questId);
+ if (status == QUEST_STATUS_COMPLETE)
+ qm.AddMenuItem(questId, 4);
+ else if (status == QUEST_STATUS_INCOMPLETE)
+ qm.AddMenuItem(questId, 4);
+ //else if (status == QUEST_STATUS_AVAILABLE)
+ // qm.AddMenuItem(quest_id, 2);
+ }
+
+ for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i)
+ {
+ uint32 questId = i->second;
+ Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
+ if (!quest)
+ continue;
+
+ switch (questId)
+ {
+ // Horde attacker
+ case QUEST_BONES_AND_ARROWS_HORDE_ATT:
+ case QUEST_JINXING_THE_WALLS_HORDE_ATT:
+ case QUEST_SLAY_THEM_ALL_HORDE_ATT:
+ case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT:
+ case QUEST_HEALING_WITH_ROSES_HORDE_ATT:
+ case QUEST_DEFEND_THE_SIEGE_HORDE_ATT:
+ if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
+ {
+ QuestStatus status = player->GetQuestStatus(questId);
+
+ if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 4);
+ else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 2);
+ }
+ break;
+ // Horde defender
+ case QUEST_BONES_AND_ARROWS_HORDE_DEF:
+ case QUEST_WARDING_THE_WALLS_HORDE_DEF:
+ case QUEST_SLAY_THEM_ALL_HORDE_DEF:
+ case QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF:
+ case QUEST_HEALING_WITH_ROSES_HORDE_DEF:
+ case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF:
+ case QUEST_STOP_THE_SIEGE_HORDE_DEF:
+ if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
+ {
+ QuestStatus status = player->GetQuestStatus(questId);
+
+ if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 4);
+ else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 2);
+ }
+ break;
+ // Alliance attacker
+ case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT:
+ case QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT:
+ case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT:
+ case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT:
+ case QUEST_A_RARE_HERB_ALLIANCE_ATT:
+ if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
+ {
+ QuestStatus status = player->GetQuestStatus(questId);
+
+ if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 4);
+ else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 2);
+ }
+ break;
+ // Alliance defender
+ case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF:
+ case QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF:
+ case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF:
+ case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF:
+ case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF:
+ case QUEST_A_RARE_HERB_ALLIANCE_DEF:
+ if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
+ {
+ QuestStatus status = player->GetQuestStatus(questId);
+
+ if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 4);
+ else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 2);
+ }
+ break;
+ default:
+ QuestStatus status = player->GetQuestStatus(questId);
+
+ if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 4);
+ else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
+ qm.AddMenuItem(questId, 2);
+ break;
+ }
+ }
+ }
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ return true;
+ }
+};
+
+class spell_wintergrasp_force_building : public SpellScriptLoader
+{
+ public:
+ spell_wintergrasp_force_building() : SpellScriptLoader("spell_wintergrasp_force_building") { }
+
+ class spell_wintergrasp_force_building_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_wintergrasp_force_building_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_BUILD_CATAPULT_FORCE)
+ || !sSpellMgr->GetSpellInfo(SPELL_BUILD_DEMOLISHER_FORCE)
+ || !sSpellMgr->GetSpellInfo(SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE)
+ || !sSpellMgr->GetSpellInfo(SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ GetHitUnit()->CastSpell(GetHitUnit(), GetEffectValue(), false);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_force_building_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_wintergrasp_force_building_SpellScript();
+ }
+};
+
+class spell_wintergrasp_grab_passenger : public SpellScriptLoader
+{
+ public:
+ spell_wintergrasp_grab_passenger() : SpellScriptLoader("spell_wintergrasp_grab_passenger") { }
+
+ class spell_wintergrasp_grab_passenger_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_wintergrasp_grab_passenger_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* target = GetHitPlayer())
+ target->CastSpell(GetCaster(), SPELL_RIDE_WG_VEHICLE, false);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_grab_passenger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_wintergrasp_grab_passenger_SpellScript();
+ }
+};
+
+class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript
+{
+public:
+ achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { }
+
+ bool OnCheck(Player* source, Unit* target)
+ {
+ if (!target)
+ return false;
+
+ if (Player* victim = target->ToPlayer())
+ {
+ if (!victim->IsMounted())
+ return false;
+
+ if (Vehicle* vehicle = source->GetVehicle())
+ if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon
+ return true;
+ }
+
+ return false;
+ }
+};
+
+class spell_wintergrasp_defender_teleport : public SpellScriptLoader
+{
+public:
+ spell_wintergrasp_defender_teleport() : SpellScriptLoader("spell_wintergrasp_defender_teleport") { }
+
+ class spell_wintergrasp_defender_teleport_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_wintergrasp_defender_teleport_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
+ if (Player* target = GetExplTargetUnit()->ToPlayer())
+ if (target->GetTeamId() != wg->GetDefenderTeam())
+ return SPELL_FAILED_BAD_TARGETS;
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_wintergrasp_defender_teleport_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_wintergrasp_defender_teleport_SpellScript();
+ }
+};
+
+void AddSC_wintergrasp()
+{
+ new npc_wg_queue();
+ new npc_wg_spirit_guide();
+ new npc_wg_demolisher_engineer();
+ new go_wg_vehicle_teleporter();
+ new npc_wg_quest_giver();
+ new spell_wintergrasp_force_building();
+ new spell_wintergrasp_grab_passenger();
+ new achievement_wg_didnt_stand_a_chance();
+ new spell_wintergrasp_defender_teleport();
+}
diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp
index 369f47cfb1c..6af96f3fdfd 100644
--- a/src/server/scripts/Northrend/zuldrak.cpp
+++ b/src/server/scripts/Northrend/zuldrak.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*####
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
index 1db4fb4dfc9..2a94ddb3134 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "OutdoorPvPEP.h"
#include "WorldPacket.h"
#include "Player.h"
@@ -26,7 +27,6 @@
#include "Language.h"
#include "World.h"
#include "GossipDef.h"
-#include "ScriptPCH.h"
OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSide(0)
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
index 06c1813d1dc..a4b506e9271 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "OutdoorPvPHP.h"
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
@@ -23,7 +24,6 @@
#include "World.h"
#include "ObjectMgr.h"
#include "Language.h"
-#include "ScriptPCH.h"
const uint32 HP_LANG_LOSE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_LOSE_BROKENHILL_A, LANG_OPVP_HP_LOSE_OVERLOOK_A, LANG_OPVP_HP_LOSE_STADIUM_A};
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index f912f25d87f..abf807327e3 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "OutdoorPvPNA.h"
#include "Player.h"
#include "ObjectMgr.h"
@@ -22,7 +23,6 @@
#include "WorldPacket.h"
#include "Language.h"
#include "World.h"
-#include "ScriptPCH.h"
OutdoorPvPNA::OutdoorPvPNA()
{
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
index a69dd3ed874..c70e4168826 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "OutdoorPvPSI.h"
#include "WorldPacket.h"
#include "Player.h"
@@ -24,7 +25,6 @@
#include "OutdoorPvPMgr.h"
#include "Language.h"
#include "World.h"
-#include "ScriptPCH.h"
OutdoorPvPSI::OutdoorPvPSI()
{
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
index ec0c10f4afe..9572125a4bd 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "OutdoorPvPTF.h"
#include "OutdoorPvPMgr.h"
#include "OutdoorPvP.h"
@@ -23,7 +24,6 @@
#include "ObjectMgr.h"
#include "Language.h"
#include "World.h"
-#include "ScriptPCH.h"
OutdoorPvPTF::OutdoorPvPTF()
{
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
index 38fed30f542..6644dd3f47f 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "OutdoorPvPZM.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
@@ -24,7 +25,6 @@
#include "WorldPacket.h"
#include "GossipDef.h"
#include "World.h"
-#include "ScriptPCH.h"
OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type)
: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N)
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
index ae1a7296de6..a8b4b1797cb 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
@@ -29,7 +29,8 @@ boss_exarch_maladaar
mob_avatar_of_martyred
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_MOONFIRE 37328
#define SPELL_FIREBALL 37329
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
index 5fc912f2a01..f678cf9c198 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
@@ -23,7 +23,8 @@ Comment: InhibitMagic should stack slower far from the boss, proper Visual for F
Category: Auchindoun, Auchenai Crypts
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_INHIBITMAGIC 32264
#define SPELL_ATTRACTMAGIC 32265
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
index a4bba5f28fb..351f30c926f 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
@@ -28,7 +28,8 @@ boss_nexusprince_shaffar
mob_ethereal_beacon
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum ePrince
{
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
index 487a1dd41ea..459ba3a8f86 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
@@ -23,7 +23,8 @@ SDComment: Not known how void blast is done (amount of rapid cast seems to be re
SDCategory: Auchindoun, Mana Tombs
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_AGGRO_1 -1557008
#define SAY_AGGRO_2 -1557009
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
index 37544f9377b..0a85cf1dc5b 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
@@ -23,7 +23,8 @@ SDComment: Shock spells/times need more work. Heroic partly implemented.
SDCategory: Auchindoun, Sethekk Halls
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SAY_SUMMON -1556000
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
index 768c4bf12d3..ec35d6c80b3 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
@@ -23,7 +23,8 @@ SDComment: Heroic supported. Some details missing, but most are spell related.
SDCategory: Auchindoun, Sethekk Halls
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "sethekk_halls.h"
#define SAY_INTRO -1556007
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
index 02c5a035375..f57bed1207b 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
@@ -23,7 +23,8 @@ SDComment: Instance Data for Sethekk Halls instance
SDCategory: Auchindoun, Sethekk Halls
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "sethekk_halls.h"
enum eEnums
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
index d92e76685d1..a109e3738b1 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
@@ -23,7 +23,8 @@ SDComment: Enrage spell missing/not known
SDCategory: Auchindoun, Shadow Labyrinth
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "shadow_labyrinth.h"
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
index 6eac36f71c8..e7063e479ee 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
@@ -23,7 +23,8 @@ SDComment: Incite Chaos not functional since core lacks Mind Control support
SDCategory: Auchindoun, Shadow Labyrinth
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "shadow_labyrinth.h"
#define SPELL_INCITE_CHAOS 33676
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
index 8d971c37559..a1780d1d4a8 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Auchindoun, Shadow Labyrinth
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "shadow_labyrinth.h"
#define SAY_INTRO -1555028
@@ -170,6 +171,7 @@ public:
summonTraveler_Timer = 90000;
banish_Timer = 17000;
HelpYell = false;
+ sumportals = false;
destroyPortals();
if (instance)
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
index 99661d8818c..4f8fc917424 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
@@ -23,7 +23,8 @@ SDComment: Timers may be incorrect
SDCategory: Auchindoun, Shadow Labyrinth
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "shadow_labyrinth.h"
#define EMOTE_SONIC_BOOM -1555036
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
index 846669552ba..9facb42107b 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
@@ -23,7 +23,8 @@ SDComment: Some cleanup left along with save
SDCategory: Auchindoun, Shadow Labyrinth
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "shadow_labyrinth.h"
#define MAX_ENCOUNTER 5
@@ -109,7 +110,7 @@ public:
if (creature->isAlive())
{
++m_uiFelOverseerCount;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shadow Labyrinth: counting %u Fel Overseers.", m_uiFelOverseerCount);
+ sLog->outDebug(LOG_FILTER_TSCR, "Shadow Labyrinth: counting %u Fel Overseers.", m_uiFelOverseerCount);
}
break;
}
@@ -126,7 +127,7 @@ public:
case TYPE_OVERSEER:
if (uiData != DONE)
{
- sLog->outError("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
+ sLog->outError(LOG_FILTER_TSCR, "Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
return;
}
if (m_uiFelOverseerCount)
@@ -134,11 +135,11 @@ public:
--m_uiFelOverseerCount;
if (m_uiFelOverseerCount)
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.", m_uiFelOverseerCount);
+ sLog->outDebug(LOG_FILTER_TSCR, "Shadow Labyrinth: %u Fel Overseers left to kill.", m_uiFelOverseerCount);
else
{
m_auiEncounter[1] = DONE;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE");
+ sLog->outDebug(LOG_FILTER_TSCR, "Shadow Labyrinth: TYPE_OVERSEER == DONE");
}
}
break;
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
index 546f9ee1e7d..5fe5b8aab0c 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
@@ -27,7 +27,9 @@ EndScriptData */
npc_spirit_of_olum
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+ #include "ScriptedGossip.h"
#include "black_temple.h"
/*###
diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
index caac89da765..fd775df3392 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
@@ -23,7 +23,8 @@ SDComment: Bloodboil not working correctly, missing enrage
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "black_temple.h"
//Speech'n'Sound
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 1926929c97c..6fd6f61c061 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -23,7 +23,10 @@ SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "PassiveAI.h"
#include "black_temple.h"
#define GETGO(obj, guid) GameObject* obj = instance->instance->GetGameObject(guid)
@@ -795,7 +798,7 @@ public:
{
EnterEvadeMode();
me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0);
- sLog->outError("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
+ sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
}
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index 4e4607a7d44..ec25a8f9f60 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
@@ -23,7 +23,8 @@ SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to dama
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "black_temple.h"
//Speech'n'Sounds
@@ -247,11 +248,9 @@ public:
{
for (uint8 i = 0; i < 3; ++i)
{
- Unit* unit = NULL;
if (TargetGUID[i])
{
- unit = Unit::GetUnit(*me, TargetGUID[i]);
- if (unit)
+ if (Unit* unit = Unit::GetUnit(*me, TargetGUID[i]))
unit->CastSpell(unit, SPELL_ATTRACTION, true);
TargetGUID[i] = 0;
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index c5e78f2fa7b..ec9e4e116bf 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "black_temple.h"
#include "Spell.h"
@@ -180,6 +181,23 @@ public:
me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
}
+ void MoveInLineOfSight(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (me->isInCombat())
+ return;
+
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (me->GetDistance(who) > 50.0f)
+ return;
+
+ AttackStartNoMove(who);
+ }
+
void EnterCombat(Unit* who)
{
me->AddThreat(who, 10000.0f);
@@ -411,6 +429,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->Yell(SUFF_SAY_RECAP, LANG_UNIVERSAL, 0);
DoScriptText(SUFF_SAY_RECAP, me);
+ me->SetReactState(REACT_PASSIVE);
}
}
@@ -531,6 +550,7 @@ public:
damage = 0;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoScriptText(SUFF_SAY_RECAP, me);
+ me->SetReactState(REACT_PASSIVE);
}
else
{
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index 630e44429fa..2757a862c93 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -23,7 +23,9 @@ SDComment: Seems to be complete.
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "black_temple.h"
#define SAY_DEATH -1564013
@@ -320,7 +322,7 @@ public:
GridSearcherSucceeded = true;
}
}
- } else sLog->outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
+ } else sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
}
}
@@ -338,13 +340,13 @@ public:
if (reseting)
return;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Increasing Death Count for Shade of Akama encounter");
+ sLog->outDebug(LOG_FILTER_TSCR, "Increasing Death Count for Shade of Akama encounter");
++DeathCount;
me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
if (guid)
{
if (Sorcerers.empty())
- sLog->outError("SD2 ERROR: Shade of Akama - attempt to remove guid " UI64FMTD " from Sorcerers list but list is already empty", guid);
+ sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: Shade of Akama - attempt to remove guid " UI64FMTD " from Sorcerers list but list is already empty", guid);
else Sorcerers.remove(guid);
}
}
@@ -396,17 +398,17 @@ public:
{
CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID();
Channelers.push_back((*itr)->GetGUID());
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID());
+ sLog->outDebug(LOG_FILTER_TSCR, "Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID());
}
}
- else sLog->outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
+ else sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
}
void SetSelectableChannelers()
{
if (Channelers.empty())
{
- sLog->outError("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
+ sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
return;
}
@@ -532,7 +534,7 @@ void mob_ashtongue_channeler::mob_ashtongue_channelerAI::JustDied(Unit* /*killer
Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount();
- else sLog->outError("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
+ else sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
}
void mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/)
@@ -540,7 +542,7 @@ void mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/
Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID());
- else sLog->outError("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
+ else sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
}
class npc_akama_shade : public CreatureScript
diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
index ce1732433c8..e34a229eea5 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
@@ -23,7 +23,9 @@ SDComment: Need to implement molten punch
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "black_temple.h"
#define EMOTE_NEW_TARGET -1564010
diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index bc12a6c1c6c..524992b3c44 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
@@ -23,7 +23,8 @@ SDComment: Requires Mind Control support for Ghosts.
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "black_temple.h"
//Speech'n'sound
diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index 5b2bb8e7bf5..e8bee95865f 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "black_temple.h"
enum eEnums
diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
index 0742f174ccf..673d4bcc96f 100644
--- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
+++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
@@ -23,7 +23,10 @@ SDComment: Circle of Healing not working properly.
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "black_temple.h"
//Speech'n'Sounds
@@ -156,7 +159,7 @@ public:
Council[1] = instance->GetData64(DATA_VERASDARKSHADOW);
Council[2] = instance->GetData64(DATA_LADYMALANDE);
Council[3] = instance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- } else sLog->outError(ERROR_INST_DATA);
+ } else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
}
void EnterCombat(Unit* /*who*/) {}
@@ -296,12 +299,11 @@ public:
for (uint8 i = 0; i < 4; ++i)
{
- Unit* Member = NULL;
if (Council[i])
{
- Member = Unit::GetUnit(*me, Council[i]);
- if (Member && Member->isAlive())
- CAST_CRE(Member)->AI()->AttackStart(target);
+ Unit* member = Unit::GetUnit(*me, Council[i]);
+ if (member && member->isAlive())
+ CAST_CRE(member)->AI()->AttackStart(target);
}
}
@@ -403,7 +405,7 @@ struct boss_illidari_councilAI : public ScriptedAI
}
else
{
- sLog->outError(ERROR_INST_DATA);
+ sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
EnterEvadeMode();
return;
}
@@ -451,7 +453,7 @@ struct boss_illidari_councilAI : public ScriptedAI
{
if (!instance)
{
- sLog->outError(ERROR_INST_DATA);
+ sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
return;
}
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 49bce6d82c0..98d90aa1818 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -23,7 +23,8 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter
SDCategory: Black Temple
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "black_temple.h"
#define MAX_ENCOUNTER 9
@@ -137,7 +138,7 @@ public:
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Black Temple: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
index 3937b213e7e..a5737714e71 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
@@ -23,7 +23,8 @@ SDComment: Cyclone workaround
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "serpent_shrine.h"
#include "ScriptedEscortAI.h"
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
index 7abd2bbc8a8..bad10752db3 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
@@ -23,7 +23,8 @@ SDComment: Some details and adjustments left to do, probably nothing major. Spaw
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "serpent_shrine.h"
#define SAY_AGGRO -1548000
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index 18d8b2b5a1e..3b94feda02b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -23,7 +23,8 @@ SDComment: Missing blizzlike Shield Generators coords
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "serpent_shrine.h"
#include "Spell.h"
@@ -199,7 +200,7 @@ public:
JustCreated = false;
} else CanAttack = true;
-
+
for (uint8 i = 0; i < 4; ++i)
if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]))
remo->setDeathState(JUST_DIED);
@@ -353,7 +354,7 @@ public:
// Static Charge
// Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
- if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
+ if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds
StaticChargeTimer = 10000+rand()%20000;
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index 4876410890c..81e03a19c1f 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -23,7 +23,8 @@ SDComment: Possesion Support
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "serpent_shrine.h"
// --- Spells used by Leotheras The Blind
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
index 00de1802bc9..b9e530996af 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
@@ -23,7 +23,8 @@ SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool
SDCategory: The Lurker Below
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "serpent_shrine.h"
#include "Spell.h"
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
index 865fb143800..32f03d4d1f9 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
@@ -23,7 +23,8 @@ SDComment: Water globules don't explode properly, remove hacks
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "serpent_shrine.h"
enum eEnums
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
index 3ed3d1a82de..87053d1de1c 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
@@ -23,7 +23,8 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "serpent_shrine.h"
#define MAX_ENCOUNTER 6
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
index 48c5a360619..038300213a4 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
@@ -28,7 +28,8 @@ boss_hydromancer_thespia
mob_coilfang_waterelemental
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "steam_vault.h"
#define SAY_SUMMON -1545000
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
index 739168863f4..50cc913c669 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
@@ -28,7 +28,8 @@ boss_mekgineer_steamrigger
mob_steamrigger_mechanic
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "steam_vault.h"
#define SAY_MECHANICS -1545007
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
index cae1117805a..d81a021c4bc 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
@@ -23,7 +23,8 @@ SDComment: Contains workarounds regarding warlord's rage spells not acting as ex
SDCategory: Coilfang Resevoir, The Steamvault
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "steam_vault.h"
#define SAY_INTRO -1545016
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
index 51032fd70ed..dd0b5ea9160 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
@@ -23,7 +23,8 @@ SDComment: Instance script and access panel GO
SDCategory: Coilfang Resevoir, The Steamvault
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "steam_vault.h"
#define MAX_ENCOUNTER 4
@@ -138,7 +139,7 @@ public:
if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
HandleGameObject(MainChambersDoor, true);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Steamvault: Access panel used.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Steamvault: Access panel used.");
}
m_auiEncounter[0] = data;
break;
@@ -150,7 +151,7 @@ public:
if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
HandleGameObject(MainChambersDoor, true);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Steamvault: Access panel used.");
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Steamvault: Access panel used.");
}
m_auiEncounter[1] = data;
break;
@@ -199,16 +200,12 @@ public:
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
+
std::ostringstream stream;
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
- return NULL;
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return stream.str();
}
void Load(const char* in)
diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
index 42d617992ed..54823687e5e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
@@ -23,7 +23,8 @@ SDComment: Need confirmation if spell data are same in both modes. Summons shoul
SDCategory: Coilfang Resevoir, Underbog
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_FOUL_SPORES 31673
#define SPELL_ACID_GEYSER 38739
diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
index f7079e5c664..4006e756ca2 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
@@ -23,7 +23,8 @@ SDComment: Timers may be incorrect
SDCategory: Coilfang Resevoir, Underbog
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#define SPELL_LEVITATE 31704
#define SPELL_SUSPENSION 31719
diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index 0e654ade995..3443103fa70 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
@@ -19,11 +19,13 @@
/* ScriptData
SDName: Boss_Gruul
SD%Complete: 60
-SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to the core)
+SDComment: Ground Slam need further development (knock back effect must be added to the core)
SDCategory: Gruul's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "gruuls_lair.h"
enum eEnums
@@ -144,12 +146,7 @@ public:
//this part should be in the core
if (pSpell->Id == SPELL_SHATTER)
{
- //this spell must have custom handling in the core, dealing damage based on distance
- target->CastSpell(target, SPELL_SHATTER_EFFECT, true);
-
- if (target->HasAura(SPELL_STONED))
- target->RemoveAurasDueToSpell(SPELL_STONED);
-
+ // todo: use eventmap to kill this stuff
//clear this, if we are still performing
if (m_bPerformingGroundSlam)
{
@@ -258,7 +255,83 @@ public:
};
+class spell_gruul_shatter : public SpellScriptLoader
+{
+ public:
+ spell_gruul_shatter() : SpellScriptLoader("spell_gruul_shatter") { }
+
+ class spell_gruul_shatter_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gruul_shatter_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_STONED))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHATTER_EFFECT))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ target->RemoveAurasDueToSpell(SPELL_STONED);
+ target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gruul_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gruul_shatter_SpellScript();
+ }
+};
+
+class spell_gruul_shatter_effect : public SpellScriptLoader
+{
+ public:
+ spell_gruul_shatter_effect() : SpellScriptLoader("spell_gruul_shatter_effect") { }
+
+ class spell_gruul_shatter_effect_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gruul_shatter_effect_SpellScript);
+
+ void CalculateDamage()
+ {
+ if (!GetHitUnit())
+ return;
+
+ float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
+ if (!radius)
+ return;
+
+ float distance = GetCaster()->GetDistance2d(GetHitUnit());
+ if (distance > 1.0f)
+ SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_gruul_shatter_effect_SpellScript::CalculateDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gruul_shatter_effect_SpellScript();
+ }
+};
+
void AddSC_boss_gruul()
{
new boss_gruul();
+ new spell_gruul_shatter();
+ new spell_gruul_shatter_effect();
}
diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
index 0f42b1b7e53..03089d646f9 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
@@ -23,7 +23,8 @@ SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing
SDCategory: Gruul's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "gruuls_lair.h"
#define SAY_AGGRO -1565000
diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
index 3514732b53a..fa67659ca66 100644
--- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
+++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Gruul's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "gruuls_lair.h"
#define MAX_ENCOUNTER 2
@@ -170,15 +171,9 @@ public:
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
- return NULL;
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return stream.str();
}
void Load(const char* in)
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
index e34e86c16a7..ed8c5351493 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
@@ -39,5 +39,9 @@
#define DATA_PRISON_CELL6 18
#define DATA_PRISON_CELL7 19
#define DATA_PRISON_CELL8 20
+#define DATA_BROGGOK_LEVER 21
+#define ACTION_ACTIVATE_BROGGOK 22
+#define ACTION_RESET_BROGGOK 23
+#define ACTION_PREPARE_BROGGOK 24
#endif
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index f6b7518661e..b42641c5171 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
@@ -23,7 +23,8 @@ SDComment: pre-event not made
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blood_furnace.h"
enum eEnums
@@ -46,9 +47,9 @@ class boss_broggok : public CreatureScript
{
}
- struct boss_broggokAI : public ScriptedAI
+ struct boss_broggokAI : public BossAI
{
- boss_broggokAI(Creature* creature) : ScriptedAI(creature)
+ boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK)
{
instance = creature->GetInstanceScript();
}
@@ -58,27 +59,21 @@ class boss_broggok : public CreatureScript
uint32 AcidSpray_Timer;
uint32 PoisonSpawn_Timer;
uint32 PoisonBolt_Timer;
+ bool canAttack;
void Reset()
{
+ _Reset();
AcidSpray_Timer = 10000;
PoisonSpawn_Timer = 5000;
PoisonBolt_Timer = 7000;
- if (instance)
- {
- instance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR4), true);
- }
+ DoAction(ACTION_RESET_BROGGOK);
+ instance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
- if (instance)
- {
- instance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR4), false);
- }
}
void JustSummoned(Creature* summoned)
@@ -93,7 +88,8 @@ class boss_broggok : public CreatureScript
{
if (!UpdateVictim())
return;
-
+ if (!canAttack)
+ return;
if (AcidSpray_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SLIME_SPRAY);
@@ -131,6 +127,26 @@ class boss_broggok : public CreatureScript
}
}
+ void DoAction(int32 const action)
+ {
+ switch (action)
+ {
+ case ACTION_PREPARE_BROGGOK:
+ me->SetInCombatWithZone();
+ break;
+ case ACTION_ACTIVATE_BROGGOK:
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
+ canAttack = true;
+ break;
+ case ACTION_RESET_BROGGOK:
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
+ canAttack = false;
+ break;
+ }
+ }
+
};
CreatureAI* GetAI(Creature* creature) const
@@ -139,7 +155,27 @@ class boss_broggok : public CreatureScript
}
};
+class go_broggok_lever : public GameObjectScript
+{
+ public:
+ go_broggok_lever() : GameObjectScript("go_broggok_lever") {}
+
+ bool OnGossipHello(Player* /*player*/, GameObject* go)
+ {
+ if (InstanceScript* instance = go->GetInstanceScript())
+ if (instance->GetData(TYPE_BROGGOK_EVENT) != DONE && instance->GetData(TYPE_BROGGOK_EVENT) != IN_PROGRESS)
+ {
+ instance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS);
+ if (Creature* broggok = Creature::GetCreature(*go, instance->GetData64(DATA_BROGGOK)))
+ broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK);
+ }
+ go->UseDoorOrButton();
+ return false;
+ }
+};
+
void AddSC_boss_broggok()
{
new boss_broggok();
+ new go_broggok_lever();
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
index 01873afeaa9..3c07862e0f6 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
@@ -28,7 +28,9 @@ boss_kelidan_the_breaker
mob_shadowmoon_channeler
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuras.h"
#include "blood_furnace.h"
enum eKelidan
@@ -55,7 +57,9 @@ enum eKelidan
SPELL_VORTEX = 37370,
ENTRY_KELIDAN = 17377,
- ENTRY_CHANNELER = 17653
+ ENTRY_CHANNELER = 17653,
+
+ ACTION_ACTIVATE_ADDS = 92
};
const float ShadowmoonChannelers[5][4]=
@@ -105,6 +109,8 @@ class boss_kelidan_the_breaker : public CreatureScript
Firenova = false;
addYell = false;
SummonChannelers();
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
if (instance)
instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED);
}
@@ -150,7 +156,8 @@ class boss_kelidan_the_breaker : public CreatureScript
if (channeler && channeler->isAlive())
return;
}
-
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
if (killer)
me->AI()->AttackStart(killer);
}
@@ -267,7 +274,6 @@ class boss_kelidan_the_breaker : public CreatureScript
DoMeleeAttackIfReady();
}
-
};
CreatureAI* GetAI(Creature* creature) const
@@ -293,16 +299,11 @@ class mob_shadowmoon_channeler : public CreatureScript
{
public:
- mob_shadowmoon_channeler()
- : CreatureScript("mob_shadowmoon_channeler")
- {
- }
+ mob_shadowmoon_channeler() : CreatureScript("mob_shadowmoon_channeler") {}
struct mob_shadowmoon_channelerAI : public ScriptedAI
{
- mob_shadowmoon_channelerAI(Creature* creature) : ScriptedAI(creature)
- {
- }
+ mob_shadowmoon_channelerAI(Creature* creature) : ScriptedAI(creature){}
uint32 ShadowBolt_Timer;
uint32 MarkOfShadow_Timer;
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
index dc9f83b073d..df9aefabe15 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
@@ -23,7 +23,8 @@ SDComment: Mind control no support
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blood_furnace.h"
enum eEnums
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
index d9f6b7e303e..233a8d82497 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -23,8 +23,10 @@ SDComment:
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "blood_furnace.h"
+#include "CreatureAI.h"
#define ENTRY_SEWER1 181823
#define ENTRY_SEWER2 181766
@@ -34,9 +36,7 @@ class instance_blood_furnace : public InstanceMapScript
{
public:
instance_blood_furnace()
- : InstanceMapScript("instance_blood_furnace", 542)
- {
- }
+ : InstanceMapScript("instance_blood_furnace", 542) {}
struct instance_blood_furnace_InstanceMapScript : public InstanceScript
{
@@ -62,6 +62,18 @@ class instance_blood_furnace : public InstanceMapScript
uint64 PrisonCell7GUID;
uint64 PrisonCell8GUID;
+ std::set<uint64> PrisonersCell5;
+ std::set<uint64> PrisonersCell6;
+ std::set<uint64> PrisonersCell7;
+ std::set<uint64> PrisonersCell8;
+
+ uint8 PrisonerCounter5;
+ uint8 PrisonerCounter6;
+ uint8 PrisonerCounter7;
+ uint8 PrisonerCounter8;
+
+ uint64 BroggokLeverGUID;
+
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
@@ -88,24 +100,45 @@ class instance_blood_furnace : public InstanceMapScript
PrisonCell6GUID = 0;
PrisonCell7GUID = 0;
PrisonCell8GUID = 0;
+
+ PrisonersCell5.clear();
+ PrisonersCell6.clear();
+ PrisonersCell7.clear();
+ PrisonersCell8.clear();
+
+ PrisonerCounter5 = 0;
+ PrisonerCounter6 = 0;
+ PrisonerCounter7 = 0;
+ PrisonerCounter8 = 0;
+
+ BroggokLeverGUID = 0;
}
void OnCreatureCreate(Creature* creature)
{
switch (creature->GetEntry())
{
- case 17381:
- The_MakerGUID = creature->GetGUID();
- break;
- case 17380:
- BroggokGUID = creature->GetGUID();
- break;
- case 17377:
- Kelidan_The_BreakerGUID = creature->GetGUID();
- break;
+ case 17381:
+ The_MakerGUID = creature->GetGUID();
+ break;
+ case 17380:
+ BroggokGUID = creature->GetGUID();
+ break;
+ case 17377:
+ Kelidan_The_BreakerGUID = creature->GetGUID();
+ break;
+ case 17398:
+ StorePrisoner(creature);
+ break;
}
}
+ void OnUnitDeath(Unit* unit)
+ {
+ if (unit && unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == 17398)
+ PrisonerDied(unit->GetGUID());
+ }
+
void OnGameObjectCreate(GameObject* go)
{
if (go->GetEntry() == 181766) //Final exit door
@@ -137,6 +170,9 @@ class instance_blood_furnace : public InstanceMapScript
PrisonCell7GUID = go->GetGUID();
if (go->GetEntry() == 181817) //Broggok prison cell back left
PrisonCell8GUID = go->GetGUID();
+
+ if (go->GetEntry() == 181982)
+ BroggokLeverGUID = go->GetGUID(); //Broggok lever
}
uint64 GetData64(uint32 data)
@@ -160,18 +196,25 @@ class instance_blood_furnace : public InstanceMapScript
case DATA_PRISON_CELL6: return PrisonCell6GUID;
case DATA_PRISON_CELL7: return PrisonCell7GUID;
case DATA_PRISON_CELL8: return PrisonCell8GUID;
+ case DATA_BROGGOK_LEVER: return BroggokLeverGUID;
}
-
return 0;
}
- void SetData(uint32 /*type*/, uint32 data)
+ void SetData(uint32 type, uint32 data)
{
- switch (data)
+ switch (type)
{
- case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break;
- case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break;
- case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break;
+ case TYPE_THE_MAKER_EVENT:
+ m_auiEncounter[0] = data;
+ break;
+ case TYPE_BROGGOK_EVENT:
+ m_auiEncounter[1] = data;
+ UpdateBroggokEvent(data);
+ break;
+ case TYPE_KELIDAN_THE_BREAKER_EVENT:
+ m_auiEncounter[2] = data;
+ break;
}
if (data == DONE)
@@ -188,15 +231,14 @@ class instance_blood_furnace : public InstanceMapScript
}
}
- uint32 GetData(uint32 data)
+ uint32 GetData(uint32 type)
{
- switch (data)
+ switch (type)
{
case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0];
case TYPE_BROGGOK_EVENT: return m_auiEncounter[1];
case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2];
}
-
return 0;
}
@@ -224,6 +266,147 @@ class instance_blood_furnace : public InstanceMapScript
OUT_LOAD_INST_DATA_COMPLETE;
}
+
+ void UpdateBroggokEvent(uint32 data)
+ {
+ switch (data)
+ {
+ case IN_PROGRESS:
+ ActivateCell(DATA_PRISON_CELL5);
+ HandleGameObject(Door4GUID, false);
+ break;
+ case NOT_STARTED:
+ ResetPrisons();
+ HandleGameObject(Door5GUID, false);
+ HandleGameObject(Door4GUID, true);
+ if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
+ lever->Respawn();
+ break;
+ }
+ }
+
+ void ResetPrisons()
+ {
+ PrisonerCounter5 = PrisonersCell5.size();
+ ResetPrisoners(PrisonersCell5);
+ HandleGameObject(PrisonCell5GUID, false);
+
+ PrisonerCounter6 = PrisonersCell6.size();
+ ResetPrisoners(PrisonersCell6);
+ HandleGameObject(PrisonCell6GUID, false);
+
+ PrisonerCounter7 = PrisonersCell7.size();
+ ResetPrisoners(PrisonersCell7);
+ HandleGameObject(PrisonCell7GUID, false);
+
+ PrisonerCounter8 = PrisonersCell8.size();
+ ResetPrisoners(PrisonersCell8);
+ HandleGameObject(PrisonCell8GUID, false);
+ }
+
+ void ResetPrisoners(std::set<uint64> prisoners)
+ {
+ for (std::set<uint64>::iterator i = prisoners.begin(); i != prisoners.end(); ++i)
+ if (Creature* prisoner = instance->GetCreature(*i))
+ ResetPrisoner(prisoner);
+ }
+
+ void ResetPrisoner(Creature* prisoner)
+ {
+ if (!prisoner->isAlive())
+ prisoner->Respawn(true);
+ prisoner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void StorePrisoner(Creature* creature)
+ {
+ float posX = creature->GetPositionX();
+ float posY = creature->GetPositionY();
+
+ if (posX >= 405.0f && posX <= 423.0f)
+ {
+ if (posY >= 106.0f && posY <= 123.0f)
+ {
+ PrisonersCell5.insert(creature->GetGUID());
+ ++PrisonerCounter5;
+ }
+ else if (posY >= 76.0f && posY <= 91.0f)
+ {
+ PrisonersCell6.insert(creature->GetGUID());
+ ++PrisonerCounter6;
+ }
+ else return;
+ }
+ else if (posX >= 490.0f && posX <= 506.0f)
+ {
+ if (posY >= 106.0f && posY <= 123.0f)
+ {
+ PrisonersCell7.insert(creature->GetGUID());
+ ++PrisonerCounter7;
+ }
+ else if (posY >= 76.0f && posY <= 91.0f)
+ {
+ PrisonersCell8.insert(creature->GetGUID());
+ ++PrisonerCounter8;
+ }
+ else
+ return;
+ }
+ else
+ return;
+
+ ResetPrisoner(creature);
+ }
+
+ void PrisonerDied(uint64 guid)
+ {
+ if (PrisonersCell5.find(guid) != PrisonersCell5.end() && --PrisonerCounter5 <= 0)
+ ActivateCell(DATA_PRISON_CELL6);
+ else if (PrisonersCell6.find(guid) != PrisonersCell6.end() && --PrisonerCounter6 <= 0)
+ ActivateCell(DATA_PRISON_CELL7);
+ else if (PrisonersCell7.find(guid) != PrisonersCell7.end() && --PrisonerCounter7 <= 0)
+ ActivateCell(DATA_PRISON_CELL8);
+ else if (PrisonersCell8.find(guid) != PrisonersCell8.end() && --PrisonerCounter8 <= 0)
+ ActivateCell(DATA_DOOR5);
+ }
+
+ void ActivateCell(uint8 id)
+ {
+ switch (id)
+ {
+ case DATA_PRISON_CELL5:
+ HandleGameObject(PrisonCell5GUID,true);
+ ActivatePrisoners(PrisonersCell5);
+ break;
+ case DATA_PRISON_CELL6:
+ HandleGameObject(PrisonCell6GUID,true);
+ ActivatePrisoners(PrisonersCell6);
+ break;
+ case DATA_PRISON_CELL7:
+ HandleGameObject(PrisonCell7GUID,true);
+ ActivatePrisoners(PrisonersCell7);
+ break;
+ case DATA_PRISON_CELL8:
+ HandleGameObject(PrisonCell8GUID,true);
+ ActivatePrisoners(PrisonersCell8);
+ break;
+ case DATA_DOOR5:
+ HandleGameObject(Door5GUID,true);
+ if (Creature* broggok = instance->GetCreature(BroggokGUID))
+ broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK);
+ break;
+ }
+ }
+
+ void ActivatePrisoners(std::set<uint64> prisoners)
+ {
+ for (std::set<uint64>::iterator i = prisoners.begin(); i != prisoners.end(); ++i)
+ if (Creature* prisoner = instance->GetCreature(*i))
+ {
+ prisoner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
+ prisoner->SetInCombatWithZone();
+ }
+ }
};
InstanceScript* GetInstanceScript(InstanceMap* map) const
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
index 2ab2b2b5b2e..714ea275471 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
@@ -23,7 +23,8 @@ SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core s
SDCategory: Hellfire Citadel, Hellfire Ramparts
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
index a5cdebea754..3bb0858d2be 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
@@ -23,7 +23,8 @@ Comment:
Category: Hellfire Citadel, Hellfire Ramparts
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSpells
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
index 2c00a68321a..1d2ecccf3c7 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
@@ -23,7 +23,8 @@ SDComment: Missing adds to heal him. Surge should be used on target furthest awa
SDCategory: Hellfire Citadel, Hellfire Ramparts
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
index 3dab24eab1b..ba7b5afb4c8 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Hellfire Ramparts
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "hellfire_ramparts.h"
class instance_ramparts : public InstanceMapScript
@@ -66,7 +67,7 @@ class instance_ramparts : public InstanceMapScript
void SetData(uint32 uiType, uint32 uiData)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Ramparts: SetData received for type %u with data %u", uiType, uiData);
+ sLog->outDebug(LOG_FILTER_TSCR, "Instance Ramparts: SetData received for type %u with data %u", uiType, uiData);
switch (uiType)
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
index 1b29abf1afc..bbf03e39f9b 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
@@ -23,7 +23,8 @@ SDComment: In Development
SDCategory: Hellfire Citadel, Magtheridon's lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "magtheridons_lair.h"
struct Yell
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
index cb55d627f7d..640e4439593 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory: Hellfire Citadel, Magtheridon's lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "InstanceScript.h"
#include "magtheridons_lair.h"
enum eSpells
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
index 7dfdc40a787..c6434d9a989 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
@@ -29,7 +29,8 @@ mob_fel_orc_convert
mob_lesser_shadow_fissure
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "shattered_halls.h"
struct Say
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
index 5371473e21e..3d2d39e9817 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
@@ -28,7 +28,8 @@ mob_omrogg_heads
boss_warbringer_omrogg
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "shattered_halls.h"
enum eEnums
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
index c1489671292..99f7c69aff2 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
@@ -27,7 +27,8 @@ EndScriptData */
boss_warchief_kargath_bladefist
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
index cc36bf9a385..4105a7d5821 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
@@ -23,7 +23,8 @@ SDComment: currently missing info about door. instance not complete
SDCategory: Hellfire Citadel, Shattered Halls
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "shattered_halls.h"
#define MAX_ENCOUNTER 2
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index 25207073708..3770ac3ba09 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Tempest Keep, The Eye
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "the_eye.h"
enum eSpells
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index d202fdd2f44..5b5c3ff2326 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -26,6 +26,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "the_eye.h"
@@ -501,9 +502,9 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
public:
spell_astromancer_wrath_of_the_astromancer() : SpellScriptLoader("spell_astromancer_wrath_of_the_astromancer") { }
- class spell_astromancer_wrath_of_the_astromancer_SpellScript : public SpellScript
+ class spell_astromancer_wrath_of_the_astromancer_AuraScript : public AuraScript
{
- PrepareSpellScript(spell_astromancer_wrath_of_the_astromancer_SpellScript);
+ PrepareAuraScript(spell_astromancer_wrath_of_the_astromancer_AuraScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
{
@@ -512,50 +513,25 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
return true;
}
- bool Load()
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- _targetCount = 0;
- return true;
- }
-
- void CountTargets(std::list<Unit*>& targetList)
- {
- _targetCount = targetList.size();
- }
-
- void HandleDummy(SpellEffIndex /* effIndex */)
- {
- if (Unit* caster = GetOriginalCaster())
- if (Unit* target = GetHitUnit())
- {
- if (!target->isAlive() || !_targetCount)
- return;
-
- int32 damage = 10000 / _targetCount;
-
- SpellNonMeleeDamage damageInfo(caster, target, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
- damageInfo.damage = damage;
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
- caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &damageInfo.absorb, &damageInfo.resist, GetSpellInfo());
- caster->DealDamageMods(target, damageInfo.damage, &damageInfo.absorb);
- caster->SendSpellNonMeleeDamageLog(&damageInfo);
- caster->DealSpellDamage(&damageInfo, false);
- }
+ Unit* target = GetUnitOwner();
+ target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(),false);
}
- private:
- int32 _targetCount;
-
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_astromancer_wrath_of_the_astromancer_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
- SpellScript* GetSpellScript() const
+ AuraScript* GetAuraScript() const
{
- return new spell_astromancer_wrath_of_the_astromancer_SpellScript();
+ return new spell_astromancer_wrath_of_the_astromancer_AuraScript();
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index 1d8c7e71bef..f60cc1d188c 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -23,7 +23,8 @@ SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/
SDCategory: Tempest Keep, The Eye
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "the_eye.h"
#include "WorldPacket.h"
@@ -365,7 +366,7 @@ class boss_kaelthas : public CreatureScript
if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3])
{
- sLog->outError("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3");
+ sLog->outError(LOG_FILTER_TSCR, "Kael'Thas One or more advisors missing, Skipping Phases 1-3");
DoScriptText(SAY_PHASE4_INTRO2, me);
@@ -693,7 +694,7 @@ class boss_kaelthas : public CreatureScript
Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]);
if (!Advisor)
- sLog->outError("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
+ sLog->outError(LOG_FILTER_TSCR, "SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
else
CAST_AI(advisorbase_ai, Advisor->AI())->Revive(target);
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
index 275a72e75ac..2c778485131 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
@@ -23,7 +23,8 @@ SDComment: Should reset if raid are out of room.
SDCategory: Tempest Keep, The Eye
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "the_eye.h"
enum eEnums
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
index f25b6749055..1230b7e88cf 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Tempest Keep, The Eye
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "the_eye.h"
#define MAX_ENCOUNTER 5
@@ -165,16 +166,12 @@ class instance_the_eye : public InstanceMapScript
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
+
std::ostringstream stream;
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
- return NULL;
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return stream.str();
}
void Load(const char* in)
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
index 421f9f2f545..a38ad1d734e 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
@@ -27,7 +27,8 @@ EndScriptData */
mob_crystalcore_devastator
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "the_eye.h"
enum eSpells
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
index 4d579ac8c16..1d816f1eee3 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
@@ -23,7 +23,8 @@ SDComment: Place Holder
SDCategory: Tempest Keep, The Mechanar
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
//not used
#define SAY_AGGRO -1554000
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
index a1287a57402..83acc1258be 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Tempest Keep, The Mechanar
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
index 3579a7d697b..d2b0475fa77 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
@@ -18,6 +18,7 @@
//! TODO - Boss not scripted, just ported required spellscript from core
#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "SpellScript.h"
enum Spells
@@ -52,10 +53,10 @@ class spell_capacitus_polarity_charge : public SpellScriptLoader
return true;
}
- void HandleTargets(std::list<Unit*>& targetList)
+ void HandleTargets(std::list<WorldObject*>& targetList)
{
uint8 count = 0;
- for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
+ for (std::list<WorldObject*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
if (Player* target = (*ihit)->ToPlayer())
if (target->HasAura(GetTriggeringSpell()->Id))
@@ -88,7 +89,7 @@ class spell_capacitus_polarity_charge : public SpellScriptLoader
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
index 59837fdbed1..02be844711d 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
@@ -23,7 +23,8 @@ SDComment: Need adjustments to initial summons
SDCategory: Tempest Keep, The Mechanar
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "mechanar.h"
enum eSays
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
index 3a4d449707d..622e6e6d7e6 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
@@ -23,7 +23,8 @@ SDComment: Event missing. Script for himself 99% blizzlike.
SDCategory: Tempest Keep, The Mechanar
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
index ad3c899237f..a96666705d1 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Mechanar
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "mechanar.h"
#define MAX_ENCOUNTER 1
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index d675b438968..f45ece47220 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
@@ -29,7 +29,8 @@ npc_warden_mellichar
mob_zerekethvoidzone
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "arcatraz.h"
/*#####
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
index c2eeaf9fe7a..730bab7e626 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
@@ -28,7 +28,8 @@ boss_harbinger_skyriss
boss_harbinger_skyriss_illusion
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "arcatraz.h"
enum eSays
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
index ffe96fb7bd1..d5b61b87fc2 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
@@ -23,7 +23,8 @@ SDComment: Mainly Harbringer Skyriss event
SDCategory: Tempest Keep, The Arcatraz
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "arcatraz.h"
#define MAX_ENCOUNTER 9
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
index ba61a1bfb12..a53f62c96f4 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
@@ -23,7 +23,8 @@ SDComment: some strange visual related to tree form(if aura lost before normal d
SDCategory: Tempest Keep, The Botanica
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
index e8188f892b3..ed04c42edc7 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
@@ -23,7 +23,8 @@ SDComment: Immunities are wrong, must be adjusted to use resistance from creatur
SDCategory: Tempest Keep, The Botanica
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSpells
{
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
index 3acde2455db..e3b1a7e94e1 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
@@ -23,7 +23,8 @@ SDComment: Includes Sapling (need some better control with these).
SDCategory: Tempest Keep, The Botanica
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum eSays
{
diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp
index 4ec1d04b6ad..c263ac85ef5 100644
--- a/src/server/scripts/Outland/blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/blades_edge_mountains.cpp
@@ -33,7 +33,13 @@ go_legion_obelisk
go_thunderspike
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
//Support for quest: You're Fired! (10821)
bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
@@ -651,7 +657,7 @@ class npc_simon_bunny : public CreatureScript
{
_events.Update(diff);
- switch(_events.ExecuteEvent())
+ switch (_events.ExecuteEvent())
{
case EVENT_SIMON_PERIODIC_PLAYER_CHECK:
if (!CheckPlayer())
diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
index a213713ae1a..96897ae3033 100644
--- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
+++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
@@ -16,7 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Texts
{
@@ -36,6 +39,7 @@ enum Spells
SPELL_THUNDERCLAP = 36706,
SPELL_VOID_BOLT = 39329,
SPELL_MARK_OF_KAZZAK = 32960,
+ SPELL_MARK_OF_KAZZAK_DAMAGE = 32961,
SPELL_ENRAGE = 32964,
SPELL_CAPTURE_SOUL = 32966,
SPELL_TWISTED_REFLECTION = 21063,
@@ -171,7 +175,55 @@ class boss_doomlord_kazzak : public CreatureScript
}
};
+class spell_mark_of_kazzak : public SpellScriptLoader
+{
+ public:
+ spell_mark_of_kazzak() : SpellScriptLoader("spell_mark_of_kazzak") { }
+
+ class spell_mark_of_kazzak_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mark_of_kazzak_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_KAZZAK_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* owner = GetUnitOwner())
+ amount = CalculatePctU(owner->GetPower(POWER_MANA), 5);
+ }
+
+ void OnPeriodic(AuraEffect const* aurEff)
+ {
+ Unit* target = GetTarget();
+
+ if (target->GetPower(POWER_MANA) == 0)
+ {
+ target->CastSpell(target, SPELL_MARK_OF_KAZZAK_DAMAGE, true, NULL, aurEff);
+ // Remove aura
+ SetDuration(0);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mark_of_kazzak_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazzak_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_mark_of_kazzak_AuraScript();
+ }
+};
+
void AddSC_boss_doomlordkazzak()
{
new boss_doomlord_kazzak();
+ new spell_mark_of_kazzak();
}
diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp
index 67834601d6f..ae3bd283db4 100644
--- a/src/server/scripts/Outland/boss_doomwalker.cpp
+++ b/src/server/scripts/Outland/boss_doomwalker.cpp
@@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Texts
{
diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp
index b0e19f0e322..4c44d4e828e 100644
--- a/src/server/scripts/Outland/hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/hellfire_peninsula.cpp
@@ -33,7 +33,9 @@ npc_trollbane
npc_wounded_blood_elf
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
@@ -158,7 +160,7 @@ public:
if (creature->GetOwner() && creature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
Start(false, false, creature->GetOwner()->GetGUID());
else
- sLog->outError("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player.");
+ sLog->outError(LOG_FILTER_TSCR, "TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player.");
creature->SetSpeed(MOVE_WALK, 1.5f);
Reset();
diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp
index 871a2f200bb..977ec57e2df 100644
--- a/src/server/scripts/Outland/nagrand.cpp
+++ b/src/server/scripts/Outland/nagrand.cpp
@@ -28,8 +28,9 @@ npc_greatmother_geyah
npc_maghar_captive
npc_creditmarker_visit_with_ancestors
EndContentData */
-
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp
index 16dac13d1a9..480275c42bd 100644
--- a/src/server/scripts/Outland/netherstorm.cpp
+++ b/src/server/scripts/Outland/netherstorm.cpp
@@ -32,7 +32,9 @@ npc_maxx_a_million
go_captain_tyralius_prison
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
@@ -496,7 +498,7 @@ public:
return true;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait.");
+ sLog->outDebug(LOG_FILTER_TSCR, "npc_commander_dawnforge event already in progress, need to wait.");
return false;
}
diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp
index 340049ba4fa..c84df2ee3d4 100644
--- a/src/server/scripts/Outland/shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/shadowmoon_valley.cpp
@@ -40,9 +40,12 @@ go_crystal_prison
npc_enraged_spirit
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "Group.h"
+#include "SpellScript.h"
/*#####
# mob_mature_netherwing_drake
@@ -836,19 +839,10 @@ public:
return 1500;
break;
case 16:
- if (player)
- {
- Illi->CastSpell(player, SPELL_TWO, true);
- player->RemoveAurasDueToSpell(SPELL_THREE);
- player->RemoveAurasDueToSpell(SPELL_FOUR);
- return 5000;
- }
- else
- {
- player->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE);
- Step = 30;
- return 100;
- }
+ Illi->CastSpell(player, SPELL_TWO, true);
+ player->RemoveAurasDueToSpell(SPELL_THREE);
+ player->RemoveAurasDueToSpell(SPELL_FOUR);
+ return 5000;
break;
case 17:
DoScriptText(LORD_ILLIDAN_SAY_5, Illi);
@@ -1866,9 +1860,134 @@ public:
};
};
-/*#####
-#
-######*/
+enum ZuluhedChains
+{
+ QUEST_ZULUHED = 10866,
+ NPC_KARYNAKU = 22112,
+};
+
+class spell_unlocking_zuluheds_chains : public SpellScriptLoader
+{
+ public:
+ spell_unlocking_zuluheds_chains() : SpellScriptLoader("spell_unlocking_zuluheds_chains") { }
+
+ class spell_unlocking_zuluheds_chains_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_unlocking_zuluheds_chains_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleAfterHit()
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (caster->GetQuestStatus(QUEST_ZULUHED) == QUEST_STATUS_INCOMPLETE)
+ caster->KilledMonsterCredit(NPC_KARYNAKU, 0);
+ }
+
+ void Register()
+ {
+ AfterHit += SpellHitFn(spell_unlocking_zuluheds_chains_SpellScript::HandleAfterHit);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_unlocking_zuluheds_chains_SpellScript();
+ }
+};
+
+enum ShadowMoonTuberEnum
+{
+ SPELL_WHISTLE = 36652,
+ SPELL_SHADOWMOON_TUBER = 36462,
+
+ NPC_BOAR_ENTRY = 21195,
+ GO_SHADOWMOON_TUBER_MOUND = 184701,
+
+ POINT_TUBER = 1,
+ TYPE_BOAR = 1,
+ DATA_BOAR = 1
+};
+
+class npc_shadowmoon_tuber_node : public CreatureScript
+{
+public:
+ npc_shadowmoon_tuber_node() : CreatureScript("npc_shadowmoon_tuber_node") {}
+
+ struct npc_shadowmoon_tuber_nodeAI : public ScriptedAI
+ {
+ npc_shadowmoon_tuber_nodeAI(Creature* creature) : ScriptedAI(creature) {}
+
+ void Reset()
+ {
+ tapped = false;
+ tuberGUID = 0;
+ resetTimer = 60000;
+ }
+
+ void SetData(uint32 id, uint32 data)
+ {
+ if (id == TYPE_BOAR && data == DATA_BOAR)
+ {
+ // Spawn chest GO
+ DoCast(SPELL_SHADOWMOON_TUBER);
+
+ // Despawn the tuber
+ if (GameObject* tuber = me->FindNearestGameObject(GO_SHADOWMOON_TUBER_MOUND, 5.0f))
+ {
+ tuberGUID = tuber->GetGUID();
+ // @Workaround: find how to properly despawn the GO
+ tuber->SetPhaseMask(2, true);
+ }
+ }
+ }
+
+ void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
+ {
+ if (!tapped && spell->Id == SPELL_WHISTLE)
+ {
+ if (Creature* boar = me->FindNearestCreature(NPC_BOAR_ENTRY, 30.0f))
+ {
+ // Disable trigger and force nearest boar to walk to him
+ tapped = true;
+ boar->SetWalk(false);
+ boar->GetMotionMaster()->MovePoint(POINT_TUBER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (tapped)
+ {
+ if (resetTimer <= diff)
+ {
+ // Respawn the tuber
+ if (tuberGUID)
+ if (GameObject* tuber = GameObject::GetGameObject(*me, tuberGUID))
+ // @Workaround: find how to properly respawn the GO
+ tuber->SetPhaseMask(1, true);
+
+ Reset();
+ }
+ else
+ resetTimer -= diff;
+ }
+ }
+ private:
+ bool tapped;
+ uint64 tuberGUID;
+ uint32 resetTimer;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_shadowmoon_tuber_nodeAI(creature);
+ }
+};
void AddSC_shadowmoon_valley()
{
@@ -1887,4 +2006,6 @@ void AddSC_shadowmoon_valley()
new mob_illidari_spawn();
new mob_torloth_the_magnificent();
new npc_enraged_spirit();
+ new spell_unlocking_zuluheds_chains();
+ new npc_shadowmoon_tuber_node();
}
diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp
index 79cce47e16c..8ad2c311fc5 100644
--- a/src/server/scripts/Outland/shattrath_city.cpp
+++ b/src/server/scripts/Outland/shattrath_city.cpp
@@ -34,7 +34,9 @@ npc_ishanah
npc_khadgar
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp
index 6c2214cde37..707cabfcf0c 100644
--- a/src/server/scripts/Outland/terokkar_forest.cpp
+++ b/src/server/scripts/Outland/terokkar_forest.cpp
@@ -33,7 +33,9 @@ npc_isla_starmane
npc_slim
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "Group.h"
diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp
index 90ce070ecc7..aa51b532c27 100644
--- a/src/server/scripts/Outland/zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zangarmarsh.cpp
@@ -32,7 +32,9 @@ npc_kayra_longmane
npc_timothy_daniels
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
/*######
diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt
index 04dcee9287c..2bb695bd8a9 100644
--- a/src/server/scripts/Spells/CMakeLists.txt
+++ b/src/server/scripts/Spells/CMakeLists.txt
@@ -24,6 +24,7 @@ set(scripts_STAT_SRCS
Spells/spell_paladin.cpp
Spells/spell_item.cpp
Spells/spell_holiday.cpp
+ Spells/spell_pet.cpp
)
message(" -> Prepared: Spells")
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index c33ca548d73..a1c48878507 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -40,6 +40,8 @@ enum DeathKnightSpells
DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611,
DK_SPELL_UNHOLY_PRESENCE = 48265,
DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622,
+ SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736,
+ DK_SPELL_BLACK_ICE_R1 = 49140,
};
// 50462 - Anti-Magic Shell (on raid member)
@@ -111,8 +113,7 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
- // Set absorbtion amount to unlimited
- amount = -1;
+ amount = GetCaster()->CountPctFromMaxHealth(hpPct);
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
@@ -334,16 +335,30 @@ class spell_dk_death_pact : public SpellScriptLoader
{
PrepareSpellScript(spell_dk_death_pact_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ SpellCastResult CheckCast()
+ {
+ // Check if we have valid targets, otherwise skip spell casting here
+ if (Player* player = GetCaster()->ToPlayer())
+ for (Unit::ControlList::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr)
+ if (Creature* undeadPet = (*itr)->ToCreature())
+ if (undeadPet->isAlive() &&
+ undeadPet->GetOwnerGUID() == player->GetGUID() &&
+ undeadPet->GetCreatureType() == CREATURE_TYPE_UNDEAD &&
+ undeadPet->IsWithinDist(player, 100.0f, false))
+ return SPELL_CAST_OK;
+
+ return SPELL_FAILED_NO_PET;
+ }
+
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
Unit* unit_to_add = NULL;
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
+ for (std::list<WorldObject*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
{
- if ((*itr)->GetTypeId() == TYPEID_UNIT
- && (*itr)->GetOwnerGUID() == GetCaster()->GetGUID()
- && (*itr)->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD)
+ if (Unit* unit = (*itr)->ToUnit())
+ if (unit->GetOwnerGUID() == GetCaster()->GetGUID() && unit->GetCreatureType() == CREATURE_TYPE_UNDEAD)
{
- unit_to_add = (*itr);
+ unit_to_add = unit;
break;
}
}
@@ -351,18 +366,12 @@ class spell_dk_death_pact : public SpellScriptLoader
unitList.clear();
if (unit_to_add)
unitList.push_back(unit_to_add);
- else
- {
- // Pet not found - remove cooldown
- if (Player* modOwner = GetCaster()->GetSpellModOwner())
- modOwner->RemoveSpellCooldown(GetSpellInfo()->Id, true);
- FinishCast(SPELL_FAILED_NO_PET);
- }
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY);
+ OnCheckCast += SpellCheckCastFn(spell_dk_death_pact_SpellScript::CheckCast);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY);
}
};
@@ -400,7 +409,12 @@ class spell_dk_scourge_strike : public SpellScriptLoader
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
+ {
multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f);
+ // Death Knight T8 Melee 4P Bonus
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_ITEM_T8_MELEE_4P_BONUS, EFFECT_0))
+ AddPctF(multiplier, aurEff->GetAmount());
+ }
}
void HandleAfterHit()
@@ -409,6 +423,10 @@ class spell_dk_scourge_strike : public SpellScriptLoader
if (Unit* unitTarget = GetHitUnit())
{
int32 bp = GetHitDamage() * multiplier;
+
+ if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(DK_SPELL_BLACK_ICE_R1, EFFECT_0))
+ AddPctN(bp, aurEff->GetAmount());
+
caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
}
}
@@ -603,7 +621,7 @@ public:
if (!target->HasAura(DK_SPELL_BLOOD_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
{
int32 basePoints1 = aurEff->GetAmount();
- target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, aurEff);
+ target->CastCustomSpell(target, DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, 0, aurEff);
}
}
@@ -738,14 +756,14 @@ class spell_dk_death_coil : public SpellScriptLoader
{
PrepareSpellScript(spell_dk_death_coil_SpellScript);
- bool Validate(SpellInfo const* /*SpellEntry*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL))
return false;
return true;
}
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 898350dbd71..32a92da5e3a 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -28,7 +28,42 @@
enum DruidSpells
{
DRUID_INCREASED_MOONFIRE_DURATION = 38414,
- DRUID_NATURES_SPLENDOR = 57865
+ DRUID_NATURES_SPLENDOR = 57865,
+ DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
+ DRUID_LIFEBLOOM_ENERGIZE = 64372,
+ DRUID_SURVIVAL_INSTINCTS = 50322,
+ DRUID_SAVAGE_ROAR = 62071,
+ SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
+ SPELL_KING_OF_THE_JUNGLE = 48492,
+ SPELL_TIGER_S_FURY_ENERGIZE = 51178,
+ SPELL_ENRAGE_MOD_DAMAGE = 51185,
+};
+
+class spell_dru_enrage : public SpellScriptLoader
+{
+ public:
+ spell_dru_enrage() : SpellScriptLoader("spell_dru_enrage") { }
+
+ class spell_dru_enrage_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_enrage_SpellScript);
+
+ void OnHit()
+ {
+ if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_0))
+ GetHitUnit()->CastCustomSpell(SPELL_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
+ }
+
+ void Register()
+ {
+ AfterHit += SpellHitFn(spell_dru_enrage_SpellScript::OnHit);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_enrage_SpellScript();
+ }
};
// 54846 Glyph of Starfire
@@ -83,6 +118,115 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
}
};
+class spell_dru_insect_swarm : public SpellScriptLoader
+{
+ public:
+ spell_dru_insect_swarm() : SpellScriptLoader("spell_dru_insect_swarm") { }
+
+ class spell_dru_insect_swarm_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_insect_swarm_AuraScript);
+
+ void CalculateAmount(AuraEffect const* aurEff, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (AuraEffect const* relicAurEff = caster->GetAuraEffect(SPELL_DRUID_ITEM_T8_BALANCE_RELIC, EFFECT_0))
+ amount += relicAurEff->GetAmount() / aurEff->GetTotalTicks();
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_insect_swarm_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_insect_swarm_AuraScript();
+ }
+};
+
+class spell_dru_lifebloom : public SpellScriptLoader
+{
+ public:
+ spell_dru_lifebloom() : SpellScriptLoader("spell_dru_lifebloom") { }
+
+ class spell_dru_lifebloom_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_lifebloom_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE))
+ return false;
+ return true;
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ // final heal
+ int32 stack = GetStackAmount();
+ int32 healAmount = aurEff->GetAmount();
+ if (Unit* caster = GetCaster())
+ {
+ healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
+ healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
+
+ GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+
+ // restore mana
+ int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
+ caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+ return;
+ }
+
+ GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* target = GetUnitOwner())
+ {
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
+ {
+ // final heal
+ int32 healAmount = aurEff->GetAmount();
+ if (Unit* caster = GetCaster())
+ {
+ healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
+ healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
+ target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+
+ // restore mana
+ int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
+ caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+ return;
+ }
+
+ target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+ }
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_lifebloom_AuraScript();
+ }
+};
+
// 69366 - Moonkin Form passive
class spell_dru_moonkin_form_passive : public SpellScriptLoader
{
@@ -127,6 +271,34 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader
}
};
+class spell_dru_predatory_strikes : public SpellScriptLoader
+{
+ public:
+ spell_dru_predatory_strikes() : SpellScriptLoader("spell_dru_predatory_strikes") { }
+
+ class spell_dru_predatory_strikes_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_predatory_strikes_AuraScript);
+
+ void UpdateAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Player* target = GetTarget()->ToPlayer())
+ target->UpdateAttackPowerAndDamage();
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_predatory_strikes_AuraScript();
+ }
+};
+
// 33851 - Primal Tenacity
class spell_dru_primal_tenacity : public SpellScriptLoader
{
@@ -154,7 +326,7 @@ class spell_dru_primal_tenacity : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
// reduces all damage taken while Stunned in Cat Form
- if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
+ if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
}
@@ -214,57 +386,67 @@ class spell_dru_savage_defense : public SpellScriptLoader
}
};
-class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
+class spell_dru_savage_roar : public SpellScriptLoader
{
public:
- spell_dru_t10_restoration_4p_bonus() : SpellScriptLoader("spell_dru_t10_restoration_4p_bonus") { }
+ spell_dru_savage_roar() : SpellScriptLoader("spell_dru_savage_roar") { }
- class spell_dru_t10_restoration_4p_bonus_SpellScript : public SpellScript
+ class spell_dru_savage_roar_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_dru_t10_restoration_4p_bonus_SpellScript);
+ PrepareSpellScript(spell_dru_savage_roar_SpellScript);
- bool Load()
+ SpellCastResult CheckCast()
{
- return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ Unit* caster = GetCaster();
+ if (caster->GetShapeshiftForm() != FORM_CAT)
+ return SPELL_FAILED_ONLY_SHAPESHIFT;
+
+ return SPELL_CAST_OK;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void Register()
{
- if (!GetCaster()->ToPlayer()->GetGroup())
- {
- unitList.clear();
- unitList.push_back(GetCaster());
- }
- else
- {
- unitList.remove(GetExplTargetUnit());
- std::list<Unit*> tempTargets;
- for (std::list<Unit*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
- if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith(*itr))
- tempTargets.push_back(*itr);
+ OnCheckCast += SpellCheckCastFn(spell_dru_savage_roar_SpellScript::CheckCast);
+ }
+ };
- if (tempTargets.empty())
- {
- unitList.clear();
- FinishCast(SPELL_FAILED_DONT_REPORT);
- return;
- }
+ class spell_dru_savage_roar_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_savage_roar_AuraScript);
- Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets);
- unitList.clear();
- unitList.push_back(target);
- }
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR);
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
+ AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
SpellScript* GetSpellScript() const
{
- return new spell_dru_t10_restoration_4p_bonus_SpellScript();
+ return new spell_dru_savage_roar_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_savage_roar_AuraScript();
}
};
@@ -277,14 +459,14 @@ class spell_dru_starfall_aoe : public SpellScriptLoader
{
PrepareSpellScript(spell_dru_starfall_aoe_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove(GetExplTargetUnit());
+ targets.remove(GetExplTargetUnit());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -294,6 +476,116 @@ class spell_dru_starfall_aoe : public SpellScriptLoader
}
};
+class spell_dru_starfall_dummy : public SpellScriptLoader
+{
+ public:
+ spell_dru_starfall_dummy() : SpellScriptLoader("spell_dru_starfall_dummy") { }
+
+ class spell_dru_starfall_dummy_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_starfall_dummy_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ Trinity::Containers::RandomResizeList(targets, 2);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ // Shapeshifting into an animal form or mounting cancels the effect
+ if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted())
+ {
+ if (SpellInfo const* spellInfo = GetTriggeringSpell())
+ caster->RemoveAurasDueToSpell(spellInfo->Id);
+ return;
+ }
+
+ // Any effect which causes you to lose control of your character will supress the starfall effect.
+ if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
+ return;
+
+ caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
+ }
+
+ void Register()
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_starfall_dummy_SpellScript();
+ }
+};
+
+class spell_dru_survival_instincts : public SpellScriptLoader
+{
+ public:
+ spell_dru_survival_instincts() : SpellScriptLoader("spell_dru_survival_instincts") { }
+
+ class spell_dru_survival_instincts_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_survival_instincts_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (!caster->IsInFeralForm())
+ return SPELL_FAILED_ONLY_SHAPESHIFT;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_dru_survival_instincts_SpellScript::CheckCast);
+ }
+ };
+
+ class spell_dru_survival_instincts_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_survival_instincts_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
+ target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_dru_survival_instincts_AuraScript::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_survival_instincts_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_survival_instincts_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_survival_instincts_AuraScript();
+ }
+};
+
// 40121 - Swift Flight Form (Passive)
class spell_dru_swift_flight_passive : public SpellScriptLoader
{
@@ -328,53 +620,102 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
-class spell_dru_starfall_dummy : public SpellScriptLoader
+class spell_dru_tiger_s_fury : public SpellScriptLoader
{
public:
- spell_dru_starfall_dummy() : SpellScriptLoader("spell_dru_starfall_dummy") { }
+ spell_dru_tiger_s_fury() : SpellScriptLoader("spell_dru_tiger_s_fury") { }
- class spell_dru_starfall_dummy_SpellScript : public SpellScript
+ class spell_dru_tiger_s_fury_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_dru_starfall_dummy_SpellScript);
+ PrepareSpellScript(spell_dru_tiger_s_fury_SpellScript);
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void OnHit()
{
- Unit* caster = GetCaster();
- // Shapeshifting into an animal form or mounting cancels the effect
- if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted())
+ if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_1))
+ GetHitUnit()->CastCustomSpell(SPELL_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
+ }
+
+ void Register()
+ {
+ AfterHit += SpellHitFn(spell_dru_tiger_s_fury_SpellScript::OnHit);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_tiger_s_fury_SpellScript();
+ }
+};
+
+class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
+{
+ public:
+ spell_dru_t10_restoration_4p_bonus() : SpellScriptLoader("spell_dru_t10_restoration_4p_bonus") { }
+
+ class spell_dru_t10_restoration_4p_bonus_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_t10_restoration_4p_bonus_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (!GetCaster()->ToPlayer()->GetGroup())
{
- if (SpellInfo const* spellInfo = GetTriggeringSpell())
- caster->RemoveAurasDueToSpell(spellInfo->Id);
- return;
+ targets.clear();
+ targets.push_back(GetCaster());
}
+ else
+ {
+ targets.remove(GetExplTargetUnit());
+ std::list<Unit*> tempTargets;
+ for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
+ if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit()))
+ tempTargets.push_back((*itr)->ToUnit());
- //Any effect which causes you to lose control of your character will supress the starfall effect.
- if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
- return;
+ if (tempTargets.empty())
+ {
+ targets.clear();
+ FinishCast(SPELL_FAILED_DONT_REPORT);
+ return;
+ }
- caster->CastSpell(GetHitUnit(), GetEffectValue(), true);
+ Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets);
+ targets.clear();
+ targets.push_back(target);
+ }
}
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const
{
- return new spell_dru_starfall_dummy_SpellScript();
+ return new spell_dru_t10_restoration_4p_bonus_SpellScript();
}
};
void AddSC_druid_spell_scripts()
{
+ new spell_dru_enrage();
new spell_dru_glyph_of_starfire();
+ new spell_dru_insect_swarm();
+ new spell_dru_lifebloom();
new spell_dru_moonkin_form_passive();
+ new spell_dru_predatory_strikes();
new spell_dru_primal_tenacity();
new spell_dru_savage_defense();
- new spell_dru_t10_restoration_4p_bonus();
+ new spell_dru_savage_roar();
new spell_dru_starfall_aoe();
- new spell_dru_swift_flight_passive();
new spell_dru_starfall_dummy();
+ new spell_dru_survival_instincts();
+ new spell_dru_swift_flight_passive();
+ new spell_dru_tiger_s_fury();
+ new spell_dru_t10_restoration_4p_bonus();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 07e9546173d..3085472749c 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -239,7 +239,7 @@ class spell_gen_parachute : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_parachute_AuraScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
return false;
@@ -907,9 +907,22 @@ class spell_gen_profession_research : public SpellScriptLoader
return SPELL_CAST_OK;
}
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ uint32 spellId = GetSpellInfo()->Id;
+
+ // learn random explicit discovery recipe (if any)
+ if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
+ caster->learnSpell(discoveredSpellId, false);
+
+ caster->UpdateCraftSkill(spellId);
+ }
+
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement);
+ OnEffectHitTarget += SpellEffectFn(spell_gen_profession_research_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -950,14 +963,14 @@ class spell_generic_clone : public SpellScriptLoader
enum CloneWeaponSpells
{
- SPELL_COPY_WEAPON = 41055,
- SPELL_COPY_WEAPON_2 = 63416,
- SPELL_COPY_WEAPON_3 = 69891,
+ SPELL_COPY_WEAPON_AURA = 41054,
+ SPELL_COPY_WEAPON_2_AURA = 63418,
+ SPELL_COPY_WEAPON_3_AURA = 69893,
- SPELL_COPY_OFFHAND = 45206,
- SPELL_COPY_OFFHAND_2 = 69892,
+ SPELL_COPY_OFFHAND_AURA = 45205,
+ SPELL_COPY_OFFHAND_2_AURA = 69896,
- SPELL_COPY_RANGED = 57593
+ SPELL_COPY_RANGED_AURA = 57594
};
class spell_generic_clone_weapon : public SpellScriptLoader
@@ -969,80 +982,147 @@ class spell_generic_clone_weapon : public SpellScriptLoader
{
PrepareSpellScript(spell_generic_clone_weapon_SpellScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND)
- || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED))
- return false;
- return true;
- }
-
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Unit* caster = GetCaster();
+
if (Unit* target = GetHitUnit())
{
uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue());
- target->CastSpell(caster, spellId, true);
+ caster->CastSpell(target, spellId, true);
+ }
+ }
- if (target->GetTypeId() == TYPEID_PLAYER)
- return;
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_generic_clone_weapon_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_generic_clone_weapon_SpellScript();
+ }
+};
+
+class spell_gen_clone_weapon_aura : public SpellScriptLoader
+{
+ public:
+ spell_gen_clone_weapon_aura() : SpellScriptLoader("spell_gen_clone_weapon_aura") { }
+
+ class spell_gen_clone_weapon_auraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_clone_weapon_auraScript);
+
+ uint32 prevItem;
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3_AURA)
+ || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED_AURA))
+ return false;
+ return true;
+ }
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* caster = GetCaster();
+ Unit* target = GetTarget();
- switch (GetSpellInfo()->Id)
+ if (!caster)
+ return;
+
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_COPY_WEAPON_AURA:
+ case SPELL_COPY_WEAPON_2_AURA:
+ case SPELL_COPY_WEAPON_3_AURA:
{
- case SPELL_COPY_WEAPON:
- case SPELL_COPY_WEAPON_2:
- case SPELL_COPY_WEAPON_3:
+ prevItem = target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID);
+
+ if (Player* player = caster->ToPlayer())
{
- if (Player* player = caster->ToPlayer())
- {
- if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
- }
- else
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
- break;
+ if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
}
- case SPELL_COPY_OFFHAND:
- case SPELL_COPY_OFFHAND_2:
+ else
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
+ break;
+ }
+ case SPELL_COPY_OFFHAND_AURA:
+ case SPELL_COPY_OFFHAND_2_AURA:
+ {
+ prevItem = target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) + 1;
+
+ if (Player* player = caster->ToPlayer())
{
- if (Player* player = caster->ToPlayer())
- {
- if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
- }
- else
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
- break;
+ if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
}
- case SPELL_COPY_RANGED:
+ else
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
+ break;
+ }
+ case SPELL_COPY_RANGED_AURA:
+ {
+ prevItem = target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) + 2;
+
+ if (Player* player = caster->ToPlayer())
{
- if (Player* player = caster->ToPlayer())
- {
- if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
- }
- else
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
- break;
+ if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
}
- default:
- break;
+ else
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
+ break;
}
+ default:
+ break;
+ }
+ }
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_COPY_WEAPON_AURA:
+ case SPELL_COPY_WEAPON_2_AURA:
+ case SPELL_COPY_WEAPON_3_AURA:
+ {
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, prevItem);
+ break;
+ }
+ case SPELL_COPY_OFFHAND_AURA:
+ case SPELL_COPY_OFFHAND_2_AURA:
+ {
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, prevItem);
+ break;
+ }
+ case SPELL_COPY_RANGED_AURA:
+ {
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, prevItem);
+ break;
+ }
+ default:
+ break;
}
}
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_generic_clone_weapon_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ OnEffectApply += AuraEffectApplyFn(spell_gen_clone_weapon_auraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_clone_weapon_auraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
+
};
- SpellScript* GetSpellScript() const
+ AuraScript* GetAuraScript() const
{
- return new spell_generic_clone_weapon_SpellScript();
+ return new spell_gen_clone_weapon_auraScript();
}
};
@@ -1844,16 +1924,18 @@ class spell_gen_break_shield: public SpellScriptLoader
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
- Aura* aura = itr->second->GetBase();
- SpellInfo const* auraInfo = aura->GetSpellInfo();
- if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
+ if (Aura* aura = itr->second->GetBase())
{
- aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
- // Remove dummys from rider (Necessary for updating visual shields)
- if (Unit* rider = target->GetCharmer())
- if (Aura* defend = rider->GetAura(aura->GetId()))
- defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
- break;
+ SpellInfo const* auraInfo = aura->GetSpellInfo();
+ if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
+ {
+ aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ // Remove dummys from rider (Necessary for updating visual shields)
+ if (Unit* rider = target->GetCharmer())
+ if (Aura* defend = rider->GetAura(aura->GetId()))
+ defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ break;
+ }
}
}
break;
@@ -1972,16 +2054,18 @@ class spell_gen_mounted_charge: public SpellScriptLoader
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
- Aura* aura = itr->second->GetBase();
- SpellInfo const* auraInfo = aura->GetSpellInfo();
- if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
+ if (Aura* aura = itr->second->GetBase())
{
- aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
- // Remove dummys from rider (Necessary for updating visual shields)
- if (Unit* rider = target->GetCharmer())
- if (Aura* defend = rider->GetAura(aura->GetId()))
- defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
- break;
+ SpellInfo const* auraInfo = aura->GetSpellInfo();
+ if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
+ {
+ aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ // Remove dummys from rider (Necessary for updating visual shields)
+ if (Unit* rider = target->GetCharmer())
+ if (Aura* defend = rider->GetAura(aura->GetId()))
+ defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ break;
+ }
}
}
break;
@@ -2357,7 +2441,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
case NPC_ARGENT_STEED_ASPIRANT:
case NPC_STORMWIND_STEED:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_STORMWIND))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_STORMWIND))
return SPELL_PENNANT_STORMWIND_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_STORMWIND) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_STORMWIND))
return SPELL_PENNANT_STORMWIND_VALIANT;
@@ -2366,7 +2450,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_GNOMEREGAN_MECHANOSTRIDER:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_GNOMEREGAN))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_GNOMEREGAN))
return SPELL_PENNANT_GNOMEREGAN_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_GNOMEREGAN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_GNOMEREGAN))
return SPELL_PENNANT_GNOMEREGAN_VALIANT;
@@ -2375,7 +2459,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_DARK_SPEAR_RAPTOR:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SEN_JIN))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_SEN_JIN))
return SPELL_PENNANT_SEN_JIN_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SEN_JIN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SEN_JIN))
return SPELL_PENNANT_SEN_JIN_VALIANT;
@@ -2385,7 +2469,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
case NPC_ARGENT_HAWKSTRIDER_ASPIRANT:
case NPC_SILVERMOON_HAWKSTRIDER:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SILVERMOON))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_SILVERMOON))
return SPELL_PENNANT_SILVERMOON_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SILVERMOON) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SILVERMOON))
return SPELL_PENNANT_SILVERMOON_VALIANT;
@@ -2394,7 +2478,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_DARNASSIAN_NIGHTSABER:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_DARNASSUS))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_DARNASSUS))
return SPELL_PENNANT_DARNASSUS_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_DARNASSUS) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_DARNASSUS))
return SPELL_PENNANT_DARNASSUS_VALIANT;
@@ -2403,7 +2487,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_EXODAR_ELEKK:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THE_EXODAR))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_THE_EXODAR))
return SPELL_PENNANT_EXODAR_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THE_EXODAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THE_EXODAR))
return SPELL_PENNANT_EXODAR_VALIANT;
@@ -2412,7 +2496,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_IRONFORGE_RAM:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_IRONFORGE))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_IRONFORGE))
return SPELL_PENNANT_IRONFORGE_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_IRONFORGE) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_IRONFORGE))
return SPELL_PENNANT_IRONFORGE_VALIANT;
@@ -2421,7 +2505,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_FORSAKEN_WARHORSE:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_UNDERCITY))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_UNDERCITY))
return SPELL_PENNANT_UNDERCITY_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_UNDERCITY) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_UNDERCITY))
return SPELL_PENNANT_UNDERCITY_VALIANT;
@@ -2430,7 +2514,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_ORGRIMMAR_WOLF:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ORGRIMMAR))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_ORGRIMMAR))
return SPELL_PENNANT_ORGRIMMAR_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_ORGRIMMAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_ORGRIMMAR))
return SPELL_PENNANT_ORGRIMMAR_VALIANT;
@@ -2439,7 +2523,7 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_THUNDER_BLUFF_KODO:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THUNDER_BLUFF))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_THUNDER_BLUFF))
return SPELL_PENNANT_THUNDER_BLUFF_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THUNDER_BLUFF) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THUNDER_BLUFF))
return SPELL_PENNANT_THUNDER_BLUFF_VALIANT;
@@ -2448,9 +2532,9 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
}
case NPC_ARGENT_WARHORSE:
{
- if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_HORDE))
+ if (player->HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->HasAchieved(ACHIEVEMENT_CHAMPION_HORDE))
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION;
- else if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_ARGENT_VALOR))
+ else if (player->HasAchieved(ACHIEVEMENT_ARGENT_VALOR))
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT;
else
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT;
@@ -2691,7 +2775,7 @@ public:
{
PrepareSpellScript(spell_gen_touch_the_nightmare_SpellScript);
- void HandleDamageCalc(SpellEffIndex effIndex)
+ void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
uint32 bp = GetCaster()->GetMaxHealth() * 0.3f;
SetHitDamage(bp);
@@ -2739,6 +2823,485 @@ public:
}
};
+enum GenericBandage
+{
+ SPELL_RECENTLY_BANDAGED = 11196,
+};
+
+class spell_gen_bandage : public SpellScriptLoader
+{
+ public:
+ spell_gen_bandage() : SpellScriptLoader("spell_gen_bandage") { }
+
+ class spell_gen_bandage_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_bandage_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED))
+ return false;
+ return true;
+ }
+
+ SpellCastResult CheckCast()
+ {
+ if (Unit* target = GetExplTargetUnit())
+ {
+ if (target->HasAura(SPELL_RECENTLY_BANDAGED))
+ return SPELL_FAILED_TARGET_AURASTATE;
+ }
+ return SPELL_CAST_OK;
+ }
+
+ void HandleScript()
+ {
+ if (Unit* target = GetHitUnit())
+ GetCaster()->CastSpell(target, SPELL_RECENTLY_BANDAGED, true);
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_gen_bandage_SpellScript::CheckCast);
+ AfterHit += SpellHitFn(spell_gen_bandage_SpellScript::HandleScript);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_bandage_SpellScript();
+ }
+};
+
+enum GenericLifebloom
+{
+ SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422,
+ SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL = 52552,
+ SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL = 53692,
+ SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL = 57763,
+ SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL = 66094,
+};
+
+class spell_gen_lifebloom : public SpellScriptLoader
+{
+ public:
+ spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+
+ class spell_gen_lifebloom_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_lifebloom_AuraScript);
+
+ public:
+ spell_gen_lifebloom_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(_spellId))
+ return false;
+ return true;
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
+ return;
+
+ // final heal
+ GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID());
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
+ }
+
+ private:
+ uint32 _spellId;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_lifebloom_AuraScript(_spellId);
+ }
+
+ private:
+ uint32 _spellId;
+};
+
+enum SummonElemental
+{
+ SPELL_SUMMON_FIRE_ELEMENTAL = 8985,
+ SPELL_SUMMON_EARTH_ELEMENTAL = 19704
+};
+
+class spell_gen_summon_elemental : public SpellScriptLoader
+{
+ public:
+ spell_gen_summon_elemental(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+
+ class spell_gen_summon_elemental_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_summon_elemental_AuraScript);
+
+ public:
+ spell_gen_summon_elemental_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(_spellId))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetCaster())
+ if (Unit* owner = GetCaster()->GetOwner())
+ owner->CastSpell(owner, _spellId, true);
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetCaster())
+ if (Unit* owner = GetCaster()->GetOwner())
+ if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong
+ owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_gen_summon_elemental_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_gen_summon_elemental_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+
+ private:
+ uint32 _spellId;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_summon_elemental_AuraScript(_spellId);
+ }
+
+ private:
+ uint32 _spellId;
+};
+
+enum Mounts
+{
+ SPELL_COLD_WEATHER_FLYING = 54197,
+
+ // Magic Broom
+ SPELL_MAGIC_BROOM_60 = 42680,
+ SPELL_MAGIC_BROOM_100 = 42683,
+ SPELL_MAGIC_BROOM_150 = 42667,
+ SPELL_MAGIC_BROOM_280 = 42668,
+
+ // Headless Horseman's Mount
+ SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621,
+ SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024,
+ SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617,
+ SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023,
+
+ // Winged Steed of the Ebon Blade
+ SPELL_WINGED_STEED_150 = 54726,
+ SPELL_WINGED_STEED_280 = 54727,
+
+ // Big Love Rocket
+ SPELL_BIG_LOVE_ROCKET_0 = 71343,
+ SPELL_BIG_LOVE_ROCKET_60 = 71344,
+ SPELL_BIG_LOVE_ROCKET_100 = 71345,
+ SPELL_BIG_LOVE_ROCKET_150 = 71346,
+ SPELL_BIG_LOVE_ROCKET_310 = 71347,
+
+ // Invincible
+ SPELL_INVINCIBLE_60 = 72281,
+ SPELL_INVINCIBLE_100 = 72282,
+ SPELL_INVINCIBLE_150 = 72283,
+ SPELL_INVINCIBLE_310 = 72284,
+
+ // Blazing Hippogryph
+ SPELL_BLAZING_HIPPOGRYPH_150 = 74854,
+ SPELL_BLAZING_HIPPOGRYPH_280 = 74855,
+
+ // Celestial Steed
+ SPELL_CELESTIAL_STEED_60 = 75619,
+ SPELL_CELESTIAL_STEED_100 = 75620,
+ SPELL_CELESTIAL_STEED_150 = 75617,
+ SPELL_CELESTIAL_STEED_280 = 75618,
+ SPELL_CELESTIAL_STEED_310 = 76153,
+
+ // X-53 Touring Rocket
+ SPELL_X53_TOURING_ROCKET_150 = 75957,
+ SPELL_X53_TOURING_ROCKET_280 = 75972,
+ SPELL_X53_TOURING_ROCKET_310 = 76154,
+};
+
+class spell_gen_mount : public SpellScriptLoader
+{
+ public:
+ spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name),
+ _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
+
+ class spell_gen_mount_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_mount_SpellScript);
+
+ public:
+ spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(),
+ _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0))
+ return false;
+ if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60))
+ return false;
+ if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100))
+ return false;
+ if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150))
+ return false;
+ if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280))
+ return false;
+ if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310))
+ return false;
+ return true;
+ }
+
+ void HandleMount(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+
+ if (Player* target = GetHitPlayer())
+ {
+ // Prevent stacking of mounts and client crashes upon dismounting
+ target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura());
+
+ // Triggered spell id dependent on riding skill and zone
+ bool canFly = false;
+ uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
+ if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
+ canFly = true;
+
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z);
+ AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag);
+ if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE)))
+ canFly = false;
+
+ uint32 mount = 0;
+ switch (target->GetBaseSkillValue(SKILL_RIDING))
+ {
+ case 0:
+ mount = _mount0;
+ break;
+ case 75:
+ mount = _mount60;
+ break;
+ case 150:
+ mount = _mount100;
+ break;
+ case 225:
+ if (canFly)
+ mount = _mount150;
+ else
+ mount = _mount100;
+ break;
+ case 300:
+ if (canFly)
+ {
+ if (_mount310 && target->Has310Flyer(false))
+ mount = _mount310;
+ else
+ mount = _mount280;
+ }
+ else
+ mount = _mount100;
+ break;
+ default:
+ break;
+ }
+
+ if (mount)
+ {
+ PreventHitAura();
+ target->CastSpell(target, mount, true);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+
+ private:
+ uint32 _mount0;
+ uint32 _mount60;
+ uint32 _mount100;
+ uint32 _mount150;
+ uint32 _mount280;
+ uint32 _mount310;
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310);
+ }
+
+ private:
+ uint32 _mount0;
+ uint32 _mount60;
+ uint32 _mount100;
+ uint32 _mount150;
+ uint32 _mount280;
+ uint32 _mount310;
+};
+
+enum FoamSword
+{
+ ITEM_FOAM_SWORD_GREEN = 45061,
+ ITEM_FOAM_SWORD_PINK = 45176,
+ ITEM_FOAM_SWORD_BLUE = 45177,
+ ITEM_FOAM_SWORD_RED = 45178,
+ ITEM_FOAM_SWORD_YELLOW = 45179,
+
+ SPELL_BONKED = 62991,
+ SPELL_FOAM_SWORD_DEFEAT = 62994,
+ SPELL_ON_GUARD = 62972,
+};
+
+class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader
+{
+ public:
+ spell_gen_upper_deck_create_foam_sword() : SpellScriptLoader("spell_gen_upper_deck_create_foam_sword") { }
+
+ class spell_gen_upper_deck_create_foam_sword_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_upper_deck_create_foam_sword_SpellScript);
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ if (Player* player = GetHitPlayer())
+ {
+ static uint32 const itemId[5] = { ITEM_FOAM_SWORD_GREEN, ITEM_FOAM_SWORD_PINK, ITEM_FOAM_SWORD_BLUE, ITEM_FOAM_SWORD_RED, ITEM_FOAM_SWORD_YELLOW };
+ // player can only have one of these items
+ for (uint8 i = 0; i < 5; ++i)
+ {
+ if (player->HasItemCount(itemId[i], 1, true))
+ return;
+ }
+
+ CreateItem(effIndex, itemId[urand(0, 4)]);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_upper_deck_create_foam_sword_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_upper_deck_create_foam_sword_SpellScript();
+ }
+};
+
+class spell_gen_bonked : public SpellScriptLoader
+{
+ public:
+ spell_gen_bonked() : SpellScriptLoader("spell_gen_bonked") { }
+
+ class spell_gen_bonked_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_bonked_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* target = GetHitPlayer())
+ {
+ Aura const* aura = GetHitAura();
+ if (!(aura && aura->GetStackAmount() == 3))
+ return;
+
+ target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
+ target->RemoveAurasDueToSpell(SPELL_BONKED);
+
+ if (Aura const* aura = target->GetAura(SPELL_ON_GUARD))
+ {
+ if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID()))
+ target->DestroyItemCount(item->GetEntry(), 1, true);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_bonked_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_bonked_SpellScript();
+ }
+};
+
+class spell_gen_gift_of_naaru : public SpellScriptLoader
+{
+ public:
+ spell_gen_gift_of_naaru() : SpellScriptLoader("spell_gen_gift_of_naaru") { }
+
+ class spell_gen_gift_of_naaru_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_gift_of_naaru_AuraScript);
+
+ void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster())
+ return;
+
+ float heal = 0.0f;
+ switch (GetSpellInfo()->SpellFamilyName)
+ {
+ case SPELLFAMILY_MAGE:
+ case SPELLFAMILY_WARLOCK:
+ case SPELLFAMILY_PRIEST:
+ heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()));
+ break;
+ case SPELLFAMILY_PALADIN:
+ case SPELLFAMILY_SHAMAN:
+ heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
+ break;
+ case SPELLFAMILY_WARRIOR:
+ case SPELLFAMILY_HUNTER:
+ case SPELLFAMILY_DEATHKNIGHT:
+ heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK)));
+ break;
+ case SPELLFAMILY_GENERIC:
+ default:
+ break;
+ }
+
+ int32 healTick = floor(heal / aurEff->GetTotalTicks());
+ amount += int32(std::max(healTick, 0));
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_gift_of_naaru_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_gift_of_naaru_AuraScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -2762,6 +3325,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_profession_research();
new spell_generic_clone();
new spell_generic_clone_weapon();
+ new spell_gen_clone_weapon_aura();
new spell_gen_seaforium_blast();
new spell_gen_turkey_marker();
new spell_gen_lifeblood();
@@ -2795,4 +3359,23 @@ void AddSC_generic_spell_scripts()
new spell_gen_despawn_self();
new spell_gen_touch_the_nightmare();
new spell_gen_dream_funnel();
+ new spell_gen_bandage();
+ new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_twisted_visage_lifebloom", SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL);
+ new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL);
+ new spell_gen_mount("spell_magic_broom", 0, SPELL_MAGIC_BROOM_60, SPELL_MAGIC_BROOM_100, SPELL_MAGIC_BROOM_150, SPELL_MAGIC_BROOM_280);
+ new spell_gen_mount("spell_headless_horseman_mount", 0, SPELL_HEADLESS_HORSEMAN_MOUNT_60, SPELL_HEADLESS_HORSEMAN_MOUNT_100, SPELL_HEADLESS_HORSEMAN_MOUNT_150, SPELL_HEADLESS_HORSEMAN_MOUNT_280);
+ new spell_gen_mount("spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280);
+ new spell_gen_mount("spell_big_love_rocket", SPELL_BIG_LOVE_ROCKET_0, SPELL_BIG_LOVE_ROCKET_60, SPELL_BIG_LOVE_ROCKET_100, SPELL_BIG_LOVE_ROCKET_150, SPELL_BIG_LOVE_ROCKET_310);
+ new spell_gen_mount("spell_invincible", 0, SPELL_INVINCIBLE_60, SPELL_INVINCIBLE_100, SPELL_INVINCIBLE_150, SPELL_INVINCIBLE_310);
+ new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280);
+ new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310);
+ new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
+ new spell_gen_upper_deck_create_foam_sword();
+ new spell_gen_bonked();
+ new spell_gen_gift_of_naaru();
}
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index dabe978b58c..a1ecac6256a 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -20,7 +20,12 @@
* Scriptnames in this file should be prefixed with "spell_#holidayname_".
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
+#include "GridNotifiers.h"
+#include "CellImpl.h"
// 45102 Romantic Picnic
enum SpellsPicnic
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 896ed331bde..a2ee6c1c3a3 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -618,6 +618,86 @@ class spell_hun_misdirection_proc : public SpellScriptLoader
}
};
+class spell_hun_disengage : public SpellScriptLoader
+{
+ public:
+ spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { }
+
+ class spell_hun_disengage_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_disengage_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat())
+ return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_hun_disengage_SpellScript();
+ }
+};
+
+class spell_hun_tame_beast : public SpellScriptLoader
+{
+ public:
+ spell_hun_tame_beast() : SpellScriptLoader("spell_hun_tame_beast") { }
+
+ class spell_hun_tame_beast_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_tame_beast_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_DONT_REPORT;
+
+ if (!GetExplTargetUnit())
+ return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
+
+ if (Creature* target = GetExplTargetUnit()->ToCreature())
+ {
+ if (target->getLevel() > caster->getLevel())
+ return SPELL_FAILED_HIGHLEVEL;
+
+ // use SMSG_PET_TAME_FAILURE?
+ if (!target->GetCreatureTemplate()->isTameable(caster->ToPlayer()->CanTameExoticPets()))
+ return SPELL_FAILED_BAD_TARGETS;
+
+ if (caster->GetPetGUID())
+ return SPELL_FAILED_ALREADY_HAVE_SUMMON;
+
+ if (caster->GetCharmGUID())
+ return SPELL_FAILED_ALREADY_HAVE_CHARM;
+ }
+ else
+ return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_hun_tame_beast_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_hun_tame_beast_SpellScript();
+ }
+};
void AddSC_hunter_spell_scripts()
{
@@ -633,4 +713,6 @@ void AddSC_hunter_spell_scripts()
new spell_hun_pet_carrion_feeder();
new spell_hun_misdirection();
new spell_hun_misdirection_proc();
+ new spell_hun_disengage();
+ new spell_hun_tame_beast();
}
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 4e2eb633662..0508d95a60b 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -836,9 +836,20 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader
return SPELL_CAST_OK;
}
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ uint32 spellId = GetSpellInfo()->Id;
+
+ // learn random explicit discovery recipe (if any)
+ if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
+ caster->learnSpell(discoveredSpellId, false);
+ }
+
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_item_book_of_glyph_mastery_SpellScript::CheckRequirement);
+ OnEffectHitTarget += SpellEffectFn(spell_item_book_of_glyph_mastery_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -1848,60 +1859,6 @@ class spell_item_unusual_compass : public SpellScriptLoader
}
};
-enum UDED
-{
- NPC_IRONWOOL_MAMMOTH = 53806,
- SPELL_MAMMOTH_CARCASS = 57444,
- SPELL_MAMMOTH_MEAT = 54625,
-};
-
-class spell_item_uded : public SpellScriptLoader
-{
- public:
- spell_item_uded() : SpellScriptLoader("spell_item_uded") { }
-
- class spell_item_uded_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_item_uded_SpellScript);
-
- bool Load()
- {
- if (GetHitCreature() && GetHitCreature()->GetEntry() == NPC_IRONWOOL_MAMMOTH)
- return true;
- return false;
- }
-
- bool Validate(SpellInfo const* /*spell*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_CARCASS) || !sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_MEAT))
- return false;
- return true;
- }
-
- void HandleDummy(SpellEffIndex /* effIndex */)
- {
- Unit* caster = GetCaster();
- Creature* creature = GetHitCreature();
- caster->CastSpell(caster,SPELL_MAMMOTH_CARCASS,true);
-
- for (uint8 i = 0; i < 4; ++i)
- caster->CastSpell(caster,SPELL_MAMMOTH_MEAT,true);
-
- creature->Kill(creature);
- }
-
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_item_uded_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_uded_SpellScript();
- }
-};
-
enum ChickenCover
{
SPELL_CHICKEN_NET = 51959,
@@ -2109,7 +2066,6 @@ void AddSC_item_spell_scripts()
new spell_item_rocket_boots();
new spell_item_pygmy_oil();
new spell_item_unusual_compass();
- new spell_item_uded();
new spell_item_chicken_cover();
new spell_item_muisek_vessel();
new spell_item_greatmothers_soulcatcher();
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index 050741ffaba..0edfbaee437 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -342,13 +342,52 @@ public:
}
};
+class spell_mage_living_bomb : public SpellScriptLoader
+{
+ public:
+ spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { }
+
+ class spell_mage_living_bomb_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mage_living_bomb_AuraScript);
+
+ bool Validate(SpellInfo const* spell)
+ {
+ if (!sSpellMgr->GetSpellInfo(uint32(spell->Effects[EFFECT_1].CalcValue())))
+ return false;
+ return true;
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
+ if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff);
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_mage_living_bomb_AuraScript();
+ }
+};
+
void AddSC_mage_spell_scripts()
{
- new spell_mage_blast_wave;
- new spell_mage_cold_snap;
+ new spell_mage_blast_wave();
+ new spell_mage_cold_snap();
new spell_mage_frost_warding_trigger();
new spell_mage_incanters_absorbtion_absorb();
new spell_mage_incanters_absorbtion_manashield();
- new spell_mage_polymorph_cast_visual;
- new spell_mage_summon_water_elemental;
+ new spell_mage_polymorph_cast_visual();
+ new spell_mage_summon_water_elemental();
+ new spell_mage_living_bomb();
}
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 4baa1eb3735..43c4dc139a3 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -43,6 +43,12 @@ enum PaladinSpells
SPELL_DIVINE_STORM = 53385,
SPELL_DIVINE_STORM_DUMMY = 54171,
SPELL_DIVINE_STORM_HEAL = 54172,
+
+ SPELL_FORBEARANCE = 25771,
+ SPELL_AVENGING_WRATH_MARKER = 61987,
+ SPELL_IMMUNE_SHIELD_MARKER = 61988,
+
+ SPELL_HAND_OF_SACRIFICE = 6940,
};
// 31850 - Ardent Defender
@@ -255,17 +261,18 @@ class spell_pal_holy_shock : public SpellScriptLoader
class spell_pal_holy_shock_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_pal_holy_shock_SpellScript)
- bool Validate(SpellInfo const* spellEntry)
+ PrepareSpellScript(spell_pal_holy_shock_SpellScript);
+
+ bool Validate(SpellInfo const* spell)
{
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
return false;
// can't use other spell than holy shock due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
+ if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
return false;
- uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
+ uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
return false;
@@ -287,7 +294,7 @@ class spell_pal_holy_shock : public SpellScriptLoader
SpellCastResult CheckCast()
{
- Player* caster = GetCaster()->ToPlayer();
+ Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
{
if (!caster->IsFriendlyTo(target))
@@ -404,7 +411,7 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
return true;
}
- void CountTargets(std::list<Unit*>& targetList)
+ void CountTargets(std::list<WorldObject*>& targetList)
{
_targetCount = targetList.size();
}
@@ -423,7 +430,7 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
}
};
@@ -433,6 +440,180 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
}
};
+class spell_pal_lay_on_hands : public SpellScriptLoader
+{
+ public:
+ spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
+
+ class spell_pal_lay_on_hands_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER))
+ return false;
+ return true;
+ }
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetExplTargetUnit())
+ if (caster == target)
+ if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER))
+ return SPELL_FAILED_TARGET_AURASTATE;
+
+ return SPELL_CAST_OK;
+ }
+
+ void HandleScript()
+ {
+ Unit* caster = GetCaster();
+ if (caster == GetHitUnit())
+ {
+ caster->CastSpell(caster, SPELL_FORBEARANCE, true);
+ caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true);
+ caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true);
+ }
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
+ AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pal_lay_on_hands_SpellScript();
+ }
+};
+
+class spell_pal_righteous_defense : public SpellScriptLoader
+{
+ public:
+ spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
+
+ class spell_pal_righteous_defense_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_DONT_REPORT;
+
+ if (Unit* target = GetExplTargetUnit())
+ {
+ if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
+ return SPELL_FAILED_BAD_TARGETS;
+ }
+ else
+ return SPELL_FAILED_BAD_TARGETS;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pal_righteous_defense_SpellScript();
+ }
+};
+
+class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
+{
+ public:
+ spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { }
+
+ class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript);
+
+ void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
+ {
+ if (!spellMod)
+ {
+ spellMod = new SpellModifier(aurEff->GetBase());
+ spellMod->op = SPELLMOD_DAMAGE;
+ spellMod->type = SPELLMOD_FLAT;
+ spellMod->spellId = GetId();
+ spellMod->mask[1] = 0x200002;
+ }
+
+ spellMod->value = aurEff->GetAmount();
+ }
+
+ void Register()
+ {
+ DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript();
+ }
+};
+
+class spell_pal_hand_of_sacrifice : public SpellScriptLoader
+{
+ public:
+ spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { }
+
+ class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript);
+
+ uint32 splitPct;
+ int32 remainingAmount;
+ Unit* caster;
+
+ bool Load()
+ {
+ caster = GetCaster();
+ if (!caster)
+ return false;
+ remainingAmount = caster->GetMaxHealth();
+ splitPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
+ return true;
+ }
+
+ void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount)
+ {
+ remainingAmount -= splitAmount;
+
+ if (remainingAmount <= 0)
+ {
+ Unit* target = GetTarget();
+ target->RemoveAura(SPELL_HAND_OF_SACRIFICE);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_pal_hand_of_sacrifice_AuraScript();
+ }
+};
+
void AddSC_paladin_spell_scripts()
{
new spell_pal_ardent_defender();
@@ -443,4 +624,8 @@ void AddSC_paladin_spell_scripts()
new spell_pal_judgement_of_command();
new spell_pal_divine_storm();
new spell_pal_divine_storm_dummy();
+ new spell_pal_lay_on_hands();
+ new spell_pal_righteous_defense();
+ new spell_pal_exorcism_and_holy_wrath_damage();
+ new spell_pal_hand_of_sacrifice();
}
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 0f16a340863..7830d46260c 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -56,6 +56,7 @@ enum WarlockPetCalculate
ENTRY_FELHUNTER = 417,
ENTRY_SUCCUBUS = 1863,
ENTRY_IMP = 416,
+ SPELL_WARLOCK_GLYPH_OF_VOIDWALKER = 56247,
};
enum DKPetCalculate
@@ -101,7 +102,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
return true;
}
- void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
@@ -120,7 +121,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
}
}
- void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
@@ -139,7 +140,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
}
}
- void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
@@ -154,7 +155,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
}
}
- void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
@@ -169,7 +170,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
}
}
- void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
@@ -236,7 +237,7 @@ public:
return true;
}
- void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
if (pet->isPet())
@@ -248,7 +249,7 @@ public:
}
}
- void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
if (_tempBonus)
@@ -261,6 +262,7 @@ public:
case ENTRY_IMP:
healthMod = uint32(_tempBonus * 8.4f);
break;
+ case ENTRY_FELGUARD:
case ENTRY_VOIDWALKER:
healthMod = _tempBonus * 11;
break;
@@ -270,9 +272,6 @@ public:
case ENTRY_FELHUNTER:
healthMod = uint32(_tempBonus * 9.5f);
break;
- case ENTRY_FELGUARD:
- healthMod = _tempBonus * 11;
- break;
default:
healthMod = 0;
break;
@@ -282,7 +281,7 @@ public:
}
}
- void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
if (pet->isPet())
@@ -292,7 +291,7 @@ public:
}
}
- void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
if (pet->isPet())
@@ -311,16 +310,16 @@ public:
// Glyph of felguard
if (pet->GetEntry() == ENTRY_FELGUARD)
{
- if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0))
+ if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(56246, EFFECT_0))
{
float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT);
- amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount());
+ amount += CalculatePctN(amount+base_attPower, /* aurEff */ect->GetAmount());
}
}
}
}
- void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
if (pet->isPet())
@@ -371,11 +370,11 @@ public:
{
if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
return false;
- _tempMana = 0;
+ _tempBonus = 0;
return true;
}
- void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateIntellectAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
if (pet->isPet())
@@ -386,58 +385,70 @@ public:
ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30);
amount += ownerBonus;
+ _tempBonus = ownerBonus;
}
}
- void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
- if (_tempMana)
- pet->SetPower(POWER_MANA, _tempMana);
+ if (_tempBonus)
+ {
+ PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
+ uint32 manaMod = 0;
+ uint32 baseMana = pInfo->mana;
+ switch (pet->GetEntry())
+ {
+ case ENTRY_IMP:
+ manaMod = uint32(_tempBonus * 4.9f);
+ break;
+ case ENTRY_VOIDWALKER:
+ case ENTRY_SUCCUBUS:
+ case ENTRY_FELHUNTER:
+ case ENTRY_FELGUARD:
+ manaMod = uint32(_tempBonus * 11.5f);
+ break;
+ default:
+ manaMod = 0;
+ break;
+ }
+ if (manaMod)
+ pet->ToPet()->SetCreateMana(baseMana + manaMod);
+ }
}
- void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
- _tempMana = pet->GetPower(POWER_MANA);
+ if (pet->isPet())
+ {
+ PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
+ pet->ToPet()->SetCreateMana(pInfo->mana);
+ }
}
- void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- float ownerBonus = 0.0f;
-
- ownerBonus = CalculatePctN(owner->GetArmor(), 35);
-
- amount += ownerBonus;
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetArmor(), 35);
+ amount += ownerBonus;
+ }
}
- void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- float ownerBonus = 0.0f;
-
- ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
-
- amount += ownerBonus;
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
+ amount += ownerBonus;
+ }
}
void Register()
@@ -450,7 +461,7 @@ public:
}
private:
- uint32 _tempMana;
+ uint32 _tempBonus;
};
AuraScript* GetAuraScript() const
@@ -475,61 +486,40 @@ public:
return true;
}
- void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- float ownerBonus = 0.0f;
-
- ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
-
- amount += ownerBonus;
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
+ amount += ownerBonus;
+ }
}
- void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- float ownerBonus = 0.0f;
-
- ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
-
- amount += ownerBonus;
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
+ amount += ownerBonus;
+ }
}
- void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- float ownerBonus = 0.0f;
-
- ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
-
- amount += ownerBonus;
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
+ amount += ownerBonus;
+ }
}
void Register()
@@ -563,23 +553,16 @@ public:
return true;
}
- void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- float ownerBonus = 0.0f;
-
- ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
-
- amount += ownerBonus;
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
+ amount += ownerBonus;
+ }
}
void Register()
@@ -610,10 +593,8 @@ public:
return true;
}
- void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -627,10 +608,8 @@ public:
}
}
- void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -644,10 +623,8 @@ public:
}
}
- void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -691,10 +668,8 @@ public:
return true;
}
- void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -715,10 +690,8 @@ public:
}
}
- void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -751,7 +724,7 @@ public:
return new spell_warl_pet_passive_AuraScript();
}
};
-
+// this doesnt actually fit in here
class spell_warl_pet_passive_damage_done : public SpellScriptLoader
{
public:
@@ -768,11 +741,11 @@ public:
return true;
}
- void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
- if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ if (GetCaster()->GetOwner()->ToPlayer())
{
switch (GetCaster()->GetEntry())
{
@@ -819,20 +792,13 @@ public:
return true;
}
- void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
-
- if (AuraEffect* aurEffect = owner->GetAuraEffect(56247, EFFECT_0))
- amount += aurEffect->GetAmount();
- }
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0))
+ amount += /* aurEff */ect->GetAmount();
}
void Register()
@@ -864,10 +830,8 @@ public:
return true;
}
- void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -881,10 +845,8 @@ public:
}
}
- void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
- if (!GetCaster() || !GetCaster()->GetOwner())
- return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
@@ -920,50 +882,45 @@ public:
{
PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript);
- void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
- {
- if (!pet->isPet())
- return;
-
- Unit* owner = pet->ToPet()->GetOwner();
- if (!owner)
- return;
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float mod = 0.45f;
+ float ownerBonus = 0.0f;
- float mod = 0.45f;
- float ownerBonus = 0.0f;
+ PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
+ if (itr == pet->ToPet()->m_spells.end())
+ itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
- PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
- if (itr == pet->ToPet()->m_spells.end())
- itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
-
- if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
- AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue());
- }
+ if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
+ AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue());
+ }
- ownerBonus = owner->GetStat(STAT_STAMINA)*mod;
+ ownerBonus = owner->GetStat(STAT_STAMINA)*mod;
- amount += ownerBonus;
- }
+ amount += ownerBonus;
+ }
}
- void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
if (_tempHealth)
pet->SetHealth(_tempHealth);
}
- void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
_tempHealth = pet->GetHealth();
}
- void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -993,7 +950,7 @@ public:
}
}
- void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1058,7 +1015,7 @@ public:
return true;
}
- void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1077,7 +1034,7 @@ public:
}
}
- void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1096,7 +1053,7 @@ public:
}
}
- void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1145,7 +1102,7 @@ public:
return true;
}
- void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1164,7 +1121,7 @@ public:
}
}
- void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1183,7 +1140,7 @@ public:
}
}
- void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1232,7 +1189,7 @@ public:
return true;
}
- void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
@@ -1249,7 +1206,7 @@ public:
}
}
- void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
@@ -1266,7 +1223,7 @@ public:
}
}
- void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
@@ -1313,11 +1270,11 @@ public:
return true;
}
- void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
- if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ if (GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
float CritSpell = 0.0f;
@@ -1334,11 +1291,11 @@ public:
}
}
- void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
- if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ if (GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
float CritMelee = 0.0f;
@@ -1384,11 +1341,11 @@ public:
return true;
}
- void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
- if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ if (GetCaster()->GetOwner()->ToPlayer())
{
// Pet's base damage changes depending on happiness
if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet())
@@ -1442,14 +1399,14 @@ public:
return true;
}
- void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
- if (AuraEffect* aurEffect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1))
- amount = aurEffect->GetAmount();
+ if (AuraEffect* /* aurEff */ect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1))
+ amount = /* aurEff */ect->GetAmount();
else
amount = 0;
}
@@ -1484,18 +1441,19 @@ public:
return true;
}
- void CalculateAvoidanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAvoidanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
if (Unit* owner = pet->GetOwner())
-
+ {
// Army of the dead ghoul
if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL)
amount = -90;
// Night of the dead
else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD))
amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
+ }
}
}
@@ -1528,7 +1486,7 @@ public:
return true;
}
- void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1554,20 +1512,20 @@ public:
}
}
- void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
if (_tempHealth)
pet->SetHealth(_tempHealth);
}
- void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
{
if (Unit* pet = GetUnitOwner())
_tempHealth = pet->GetHealth();
}
- void CalculateStrengthAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateStrengthAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1631,7 +1589,7 @@ public:
return true;
}
- void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
@@ -1674,7 +1632,7 @@ public:
return true;
}
- void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
@@ -1691,7 +1649,7 @@ public:
}
}
- void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
@@ -1737,7 +1695,7 @@ public:
return true;
}
- void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
{
@@ -1752,7 +1710,7 @@ public:
}
}
- void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (!GetCaster() || !GetCaster()->GetOwner())
return;
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 8088004c9d1..3d8ca3e729b 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -34,6 +34,11 @@ enum PriestSpells
PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619,
PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201,
+ PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL = 64085,
+ PRIEST_SPELL_EMPOWERED_RENEW = 63544,
+ PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021,
+ PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874,
+ PRIEST_SHADOW_WORD_DEATH = 32409,
};
// Guardian Spirit
@@ -129,14 +134,14 @@ class spell_pri_mind_sear : public SpellScriptLoader
{
PrepareSpellScript(spell_pri_mind_sear_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)));
+ unitList.remove_if(Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)));
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -308,7 +313,7 @@ public:
{
if (Unit* caster = GetOriginalCaster())
{
- if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE,EFFECT_0))
+ if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE, EFFECT_0))
{
int32 heal = GetHitHeal();
AddPctN(heal, aurEff->GetAmount());
@@ -330,6 +335,120 @@ public:
}
};
+class spell_pri_vampiric_touch : public SpellScriptLoader
+{
+ public:
+ spell_pri_vampiric_touch() : SpellScriptLoader("spell_pri_vampiric_touch") { }
+
+ class spell_pri_vampiric_touch_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pri_vampiric_touch_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* /*dispelInfo*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (Unit* target = GetUnitOwner())
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
+ {
+ int32 damage = aurEff->GetAmount() * 8;
+ // backfire damage
+ caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
+ }
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_pri_vampiric_touch_AuraScript();
+ }
+};
+
+class spell_priest_renew : public SpellScriptLoader
+{
+ public:
+ spell_priest_renew() : SpellScriptLoader("spell_priest_renew") { }
+
+ class spell_priest_renew_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_priest_renew_AuraScript);
+
+ bool Load()
+ {
+ return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleApplyEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ // Empowered Renew
+ if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1))
+ {
+ uint32 heal = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), GetEffect(EFFECT_0)->GetAmount(), DOT);
+ heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
+
+ int32 basepoints0 = empoweredRenewAurEff->GetAmount() * GetEffect(EFFECT_0)->GetTotalTicks() * int32(heal) / 100;
+ caster->CastCustomSpell(GetTarget(), PRIEST_SPELL_EMPOWERED_RENEW, &basepoints0, NULL, NULL, true, NULL, aurEff);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_priest_renew_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_priest_renew_AuraScript();
+ }
+};
+
+class spell_pri_shadow_word_death : public SpellScriptLoader
+{
+ public:
+ spell_pri_shadow_word_death() : SpellScriptLoader("spell_pri_shadow_word_death") { }
+
+ class spell_pri_shadow_word_death_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pri_shadow_word_death_SpellScript);
+
+ void HandleDamage()
+ {
+ int32 damage = GetHitDamage();
+
+ // Pain and Suffering reduces damage
+ if (AuraEffect* aurEff = GetCaster()->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_PAIN_AND_SUFFERING, EFFECT_1))
+ AddPctN(damage, aurEff->GetAmount());
+
+ GetCaster()->CastCustomSpell(GetCaster(), PRIEST_SHADOW_WORD_DEATH, &damage, 0, 0, true);
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_pri_shadow_word_death_SpellScript::HandleDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pri_shadow_word_death_SpellScript();
+ }
+};
+
void AddSC_priest_spell_scripts()
{
new spell_pri_guardian_spirit();
@@ -339,4 +458,7 @@ void AddSC_priest_spell_scripts()
new spell_pri_reflective_shield_trigger();
new spell_pri_mind_sear();
new spell_pri_prayer_of_mending_heal();
+ new spell_pri_vampiric_touch();
+ new spell_priest_renew();
+ new spell_pri_shadow_word_death();
}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 810cc20e04b..06d3602d8e8 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -25,6 +25,9 @@
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "Vehicle.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "CellImpl.h"
class spell_generic_quest_update_entry_SpellScript : public SpellScript
{
@@ -639,7 +642,7 @@ class spell_q12851_going_bearback : public SpellScriptLoader
// Already in fire
if (target->HasAura(SPELL_ABLAZE))
return;
-
+
if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
{
switch (target->GetEntry())
@@ -1162,6 +1165,326 @@ class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader
}
};
+enum FocusOnTheBeach
+{
+ SPELL_BUNNY_CREDIT_BEAM = 47390,
+};
+
+class spell_q12066_bunny_kill_credit : public SpellScriptLoader
+{
+public:
+ spell_q12066_bunny_kill_credit() : SpellScriptLoader("spell_q12066_bunny_kill_credit") { }
+
+ class spell_q12066_bunny_kill_credit_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12066_bunny_kill_credit_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Creature* target = GetHitCreature())
+ target->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12066_bunny_kill_credit_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q12066_bunny_kill_credit_SpellScript();
+ }
+};
+
+enum ACleansingSong
+{
+ SPELL_SUMMON_SPIRIT_ATAH = 52954,
+ SPELL_SUMMON_SPIRIT_HAKHALAN = 52958,
+ SPELL_SUMMON_SPIRIT_KOOSU = 52959,
+
+ AREA_BITTERTIDELAKE = 4385,
+ AREA_RIVERSHEART = 4290,
+ AREA_WINTERGRASPRIVER = 4388,
+};
+
+class spell_q12735_song_of_cleansing : public SpellScriptLoader
+{
+ public:
+ spell_q12735_song_of_cleansing() : SpellScriptLoader("spell_q12735_song_of_cleansing") { }
+
+ class spell_q12735_song_of_cleansing_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12735_song_of_cleansing_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ switch (caster->GetAreaId())
+ {
+ case AREA_BITTERTIDELAKE:
+ caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATAH);
+ break;
+ case AREA_RIVERSHEART:
+ caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN);
+ break;
+ case AREA_WINTERGRASPRIVER:
+ caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12735_song_of_cleansing_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q12735_song_of_cleansing_SpellScript();
+ }
+};
+
+enum DefendingWyrmrestTemple
+{
+ SPELL_SUMMON_WYRMREST_DEFENDER = 49207
+};
+
+class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader
+{
+ public:
+ spell_q12372_cast_from_gossip_trigger() : SpellScriptLoader("spell_q12372_cast_from_gossip_trigger") { }
+
+ class spell_q12372_cast_from_gossip_trigger_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12372_cast_from_gossip_trigger_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WYRMREST_DEFENDER, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12372_cast_from_gossip_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q12372_cast_from_gossip_trigger_SpellScript();
+ }
+};
+
+// http://www.wowhead.com/quest=12372 Defending Wyrmrest Temple
+// 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect
+enum Quest12372Data
+{
+ NPC_WYRMREST_TEMPLE_CREDIT = 27698,
+};
+
+class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoader
+{
+ public:
+ spell_q12372_destabilize_azure_dragonshrine_dummy() : SpellScriptLoader("spell_q12372_destabilize_azure_dragonshrine_dummy") { }
+
+ class spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (GetHitCreature())
+ if (Unit* caster = GetOriginalCaster())
+ if (Vehicle* vehicle = caster->GetVehicleKit())
+ if (Unit* passenger = vehicle->GetPassenger(0))
+ if (Player* player = passenger->ToPlayer())
+ player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT, 0);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript();
+ }
+};
+
+// "Bombing Run" and "Bomb Them Again!"
+enum Quest11010_11102_11023Data
+{
+ // Spell
+ SPELL_FLAK_CANNON_TRIGGER = 40110,
+ SPELL_CHOOSE_LOC = 40056,
+ SPELL_AGGRO_CHECK = 40112,
+ // NPCs
+ NPC_FEL_CANNON2 = 23082
+};
+
+// 40113 Knockdown Fel Cannon: The Aggro Check Aura
+class spell_q11010_q11102_q11023_aggro_check_aura : public SpellScriptLoader
+{
+ public:
+ spell_q11010_q11102_q11023_aggro_check_aura() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_check_aura") { }
+
+ class spell_q11010_q11102_q11023_aggro_check_aura_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_q11010_q11102_q11023_aggro_check_aura_AuraScript);
+
+ void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
+ {
+ if (Unit* target = GetTarget())
+ // On trigger proccing
+ target->CastSpell(target, SPELL_AGGRO_CHECK);
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_check_aura_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_q11010_q11102_q11023_aggro_check_aura_AuraScript();
+ }
+};
+
+// 40112 Knockdown Fel Cannon: The Aggro Check
+class spell_q11010_q11102_q11023_aggro_check : public SpellScriptLoader
+{
+ public:
+ spell_q11010_q11102_q11023_aggro_check() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_check") { }
+
+ class spell_q11010_q11102_q11023_aggro_check_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q11010_q11102_q11023_aggro_check_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* playerTarget = GetHitPlayer())
+ // Check if found player target is on fly mount or using flying form
+ if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
+ playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q11010_q11102_q11023_aggro_check_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q11010_q11102_q11023_aggro_check_SpellScript();
+ }
+};
+
+// 40119 Knockdown Fel Cannon: The Aggro Burst
+class spell_q11010_q11102_q11023_aggro_burst : public SpellScriptLoader
+{
+ public:
+ spell_q11010_q11102_q11023_aggro_burst() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_burst") { }
+
+ class spell_q11010_q11102_q11023_aggro_burst_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_q11010_q11102_q11023_aggro_burst_AuraScript);
+
+ void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ if (Unit* target = GetTarget())
+ // On each tick cast Choose Loc to trigger summon
+ target->CastSpell(target, SPELL_CHOOSE_LOC);
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_burst_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_q11010_q11102_q11023_aggro_burst_AuraScript();
+ }
+};
+
+// 40056 Knockdown Fel Cannon: Choose Loc
+class spell_q11010_q11102_q11023_choose_loc : public SpellScriptLoader
+{
+ public:
+ spell_q11010_q11102_q11023_choose_loc() : SpellScriptLoader("spell_q11010_q11102_q11023_choose_loc") { }
+
+ class spell_q11010_q11102_q11023_choose_loc_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q11010_q11102_q11023_choose_loc_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ // Check for player that is in 65 y range
+ std::list<Player*> playerList;
+ Trinity::AnyPlayerInObjectRangeCheck checker(caster, 765.0f);
+ Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker);
+ caster->VisitNearbyWorldObject(65.0f, searcher);
+ for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
+ // Check if found player target is on fly mount or using flying form
+ if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
+ // Summom Fel Cannon (bunny version) at found player
+ caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ());
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_q11010_q11102_q11023_choose_loc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q11010_q11102_q11023_choose_loc_SpellScript();
+ }
+};
+
+// 39844 - Skyguard Blasting Charge
+// 40160 - Throw Bomb
+class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScriptLoader
+{
+ public:
+ spell_q11010_q11102_q11023_q11008_check_fly_mount() : SpellScriptLoader("spell_q11010_q11102_q11023_q11008_check_fly_mount") { }
+
+ class spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript);
+
+ SpellCastResult CheckRequirement()
+ {
+ Unit* caster = GetCaster();
+ // This spell will be cast only if caster has one of these auras
+ if (!(caster->HasAuraType(SPELL_AURA_FLY) || caster->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)))
+ return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript::CheckRequirement);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -1189,4 +1512,13 @@ void AddSC_quest_spell_scripts()
new spell_q9452_cast_net();
new spell_q12987_read_pronouncement();
new spell_q12277_wintergarde_mine_explosion();
+ new spell_q12066_bunny_kill_credit();
+ new spell_q12735_song_of_cleansing();
+ new spell_q12372_cast_from_gossip_trigger();
+ new spell_q12372_destabilize_azure_dragonshrine_dummy();
+ new spell_q11010_q11102_q11023_aggro_check_aura();
+ new spell_q11010_q11102_q11023_aggro_check();
+ new spell_q11010_q11102_q11023_aggro_burst();
+ new spell_q11010_q11102_q11023_choose_loc();
+ new spell_q11010_q11102_q11023_q11008_check_fly_mount();
}
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 3a4132f62fe..ad437c5e431 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -350,7 +350,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
if (!spellInfo)
{
- sLog->outError("Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName(), player->GetGUIDLow(), enchant->spellid[s]);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName(), player->GetGUIDLow(), enchant->spellid[s]);
continue;
}
@@ -386,6 +386,34 @@ class spell_rog_deadly_poison : public SpellScriptLoader
}
};
+class spell_rog_shadowstep : public SpellScriptLoader
+{
+ public:
+ spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { }
+
+ class spell_rog_shadowstep_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_rog_shadowstep_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ if (GetCaster()->HasUnitState(UNIT_STATE_ROOT))
+ return SPELL_FAILED_ROOTED;
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_rog_shadowstep_SpellScript();
+ }
+};
+
void AddSC_rogue_spell_scripts()
{
new spell_rog_cheat_death();
@@ -394,4 +422,5 @@ void AddSC_rogue_spell_scripts()
new spell_rog_prey_on_the_weak();
new spell_rog_shiv();
new spell_rog_deadly_poison();
+ new spell_rog_shadowstep();
}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index c9c036d5329..c863c2363af 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -35,13 +35,19 @@ enum ShamanSpells
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
SHAMAN_SPELL_SATED = 57724,
SHAMAN_SPELL_EXHAUSTION = 57723,
-
+
SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483,
EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695,
// For Earthen Power
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474,
SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,
+
+ SHAMAN_BIND_SIGHT = 6277,
+
+ ICON_ID_SHAMAN_LAVA_FLOW = 3087,
+ SHAMAN_LAVA_FLOWS_R1 = 51480,
+ SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694,
};
// 51474 - Astral shift
@@ -255,10 +261,13 @@ class EarthenPowerTargetSelector
{
public:
EarthenPowerTargetSelector() { }
-
- bool operator() (Unit* target)
+
+ bool operator() (WorldObject* target)
{
- if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE))
+ if (!target->ToUnit())
+ return true;
+
+ if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE))
return true;
return false;
@@ -274,14 +283,14 @@ class spell_sha_earthen_power : public SpellScriptLoader
{
PrepareSpellScript(spell_sha_earthen_power_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(EarthenPowerTargetSelector());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
@@ -307,7 +316,7 @@ class spell_sha_bloodlust : public SpellScriptLoader
return true;
}
- void RemoveInvalidTargets(std::list<Unit*>& targets)
+ void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED));
}
@@ -320,9 +329,9 @@ class spell_sha_bloodlust : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff);
}
};
@@ -349,9 +358,9 @@ class spell_sha_heroism : public SpellScriptLoader
return true;
}
- void RemoveInvalidTargets(std::list<Unit*>& targets)
+ void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
- targets.remove_if (Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION));
+ targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION));
}
void ApplyDebuff()
@@ -362,9 +371,9 @@ class spell_sha_heroism : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
}
};
@@ -652,6 +661,94 @@ class spell_sha_chain_heal : public SpellScriptLoader
}
};
+class spell_sha_flame_shock : public SpellScriptLoader
+{
+ public:
+ spell_sha_flame_shock() : SpellScriptLoader("spell_sha_flame_shock") { }
+
+ class spell_sha_flame_shock_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_flame_shock_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* /*dispelInfo*/)
+ {
+ if (Unit* caster = GetCaster())
+ // Lava Flows
+ if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
+ {
+ if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
+ return;
+
+ uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId());
+ caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true);
+ }
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_sha_flame_shock_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_sha_flame_shock_AuraScript();
+ }
+};
+
+class spell_sha_sentry_totem : public SpellScriptLoader
+{
+ public:
+ spell_sha_sentry_totem() : SpellScriptLoader("spell_sha_sentry_totem") { }
+
+ class spell_sha_sentry_totem_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_sentry_totem_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4]))
+ if (totem->isTotem())
+ caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true);
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (caster->GetTypeId() == TYPEID_PLAYER)
+ caster->ToPlayer()->StopCastingBindSight();
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_sha_sentry_totem_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_sha_sentry_totem_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_sha_sentry_totem_AuraScript();
+ }
+};
+
void AddSC_shaman_spell_scripts()
{
new spell_sha_astral_shift();
@@ -667,4 +764,6 @@ void AddSC_shaman_spell_scripts()
new spell_sha_mana_spring_totem();
new spell_sha_lava_lash();
new spell_sha_chain_heal();
+ new spell_sha_flame_shock();
+ new spell_sha_sentry_totem();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 838b9e4f932..0def62b7d3a 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -37,6 +37,14 @@ enum WarlockSpells
WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
+ WARLOCK_HAUNT = 48181,
+ WARLOCK_HAUNT_HEAL = 48210,
+ WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
+ WARLOCK_CURSE_OF_DOOM_EFFECT = 18662,
+ WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
+ WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
+ WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
+ WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
};
class spell_warl_banish : public SpellScriptLoader
@@ -198,7 +206,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader
case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break;
case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break;
default:
- sLog->outError("Unknown rank of Improved Healthstone id: %d", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unknown rank of Improved Healthstone id: %d", aurEff->GetId());
break;
}
}
@@ -299,15 +307,15 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader
{
PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
if (GetExplTargetUnit())
- unitList.remove(GetExplTargetUnit());
+ targets.remove(GetExplTargetUnit());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -523,6 +531,192 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader
}
};
+class spell_warl_haunt : public SpellScriptLoader
+{
+ public:
+ spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
+
+ class spell_warl_haunt_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warl_haunt_SpellScript);
+
+ void HandleOnHit()
+ {
+ if (Aura* aura = GetHitAura())
+ if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
+ aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage()));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
+ }
+ };
+
+ class spell_warl_haunt_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_haunt_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL))
+ return false;
+ return true;
+ }
+
+ void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ int32 amount = aurEff->GetAmount();
+ GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warl_haunt_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_haunt_AuraScript();
+ }
+};
+
+class spell_warl_unstable_affliction : public SpellScriptLoader
+{
+ public:
+ spell_warl_unstable_affliction() : SpellScriptLoader("spell_warl_unstable_affliction") { }
+
+ class spell_warl_unstable_affliction_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_unstable_affliction_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* caster = GetCaster())
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_0))
+ {
+ int32 damage = aurEff->GetAmount() * 9;
+ // backfire damage and silence
+ caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
+ }
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_warl_unstable_affliction_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_unstable_affliction_AuraScript();
+ }
+};
+
+class spell_warl_curse_of_doom : public SpellScriptLoader
+{
+ public:
+ spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { }
+
+ class spell_warl_curse_of_doom_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_curse_of_doom_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (!GetCaster())
+ return;
+
+ AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
+ if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
+ return;
+
+ if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
+ GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff);
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_curse_of_doom_AuraScript();
+ }
+};
+
+class spell_warl_health_funnel : public SpellScriptLoader
+{
+public:
+ spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
+
+ class spell_warl_health_funnel_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_health_funnel_AuraScript);
+
+ void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+
+ Unit* target = GetTarget();
+ if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
+ target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
+ else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
+ target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
+ }
+
+ void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
+ target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
+ OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_health_funnel_AuraScript();
+ }
+};
+
void AddSC_warlock_spell_scripts()
{
new spell_warl_banish();
@@ -535,4 +729,8 @@ void AddSC_warlock_spell_scripts()
new spell_warl_life_tap();
new spell_warl_demonic_circle_summon();
new spell_warl_demonic_circle_teleport();
+ new spell_warl_haunt();
+ new spell_warl_unstable_affliction();
+ new spell_warl_curse_of_doom();
+ new spell_warl_health_funnel();
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 0ba5c866d63..c64101e11ea 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -77,7 +77,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
if (GetCaster())
unitList.remove(GetCaster());
@@ -85,7 +85,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
}
};
@@ -184,9 +184,9 @@ class spell_warr_deep_wounds : public SpellScriptLoader
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
-
+
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
-
+
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
@@ -397,7 +397,20 @@ class spell_warr_bloodthirst : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDamage(SpellEffIndex /*effIndex*/)
+ {
+ int32 damage = GetEffectValue();
+ ApplyPctF(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
+
+ if (Unit* target = GetHitUnit())
+ {
+ damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
+ damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
+ }
+ SetHitDamage(damage);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
@@ -405,7 +418,8 @@ class spell_warr_bloodthirst : public SpellScriptLoader
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
+ OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
@@ -415,6 +429,38 @@ class spell_warr_bloodthirst : public SpellScriptLoader
}
};
+enum BloodthirstHeal
+{
+ SPELL_BLOODTHIRST_DAMAGE = 23881,
+};
+
+class spell_warr_bloodthirst_heal : public SpellScriptLoader
+{
+ public:
+ spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
+
+ class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
+
+ void HandleHeal(SpellEffIndex /*effIndex*/)
+ {
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
+ SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_bloodthirst_heal_SpellScript();
+ }
+};
+
enum Overpower
{
SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859,
@@ -471,5 +517,6 @@ void AddSC_warrior_spell_scripts()
new spell_warr_execute();
new spell_warr_concussion_blow();
new spell_warr_bloodthirst();
+ new spell_warr_bloodthirst_heal();
new spell_warr_overpower();
}
diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp
index 9bcf450b3aa..a6f4f7f64f9 100755
--- a/src/server/scripts/World/achievement_scripts.cpp
+++ b/src/server/scripts/World/achievement_scripts.cpp
@@ -235,30 +235,6 @@ class achievement_bg_av_perfection : public AchievementCriteriaScript
}
};
-class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript
-{
-public:
- achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { }
-
- bool OnCheck(Player* source, Unit* target)
- {
- if (!target)
- return false;
-
- if (Player* victim = target->ToPlayer())
- {
- if (!victim->IsMounted())
- return false;
-
- if (Vehicle* vehicle = source->GetVehicle())
- if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon
- return true;
- }
-
- return false;
- }
-};
-
class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript
{
public:
@@ -302,6 +278,9 @@ class achievement_tilted : public AchievementCriteriaScript
bool OnCheck(Player* player, Unit* /*target*/)
{
+ if (!player)
+ return false;
+
bool checkArea = player->GetAreaId() == AREA_ARGENT_TOURNAMENT_FIELDS ||
player->GetAreaId() == AREA_RING_OF_ASPIRANTS ||
player->GetAreaId() == AREA_RING_OF_ARGENT_VALIANTS ||
@@ -309,7 +288,28 @@ class achievement_tilted : public AchievementCriteriaScript
player->GetAreaId() == AREA_RING_OF_HORDE_VALIANTS ||
player->GetAreaId() == AREA_RING_OF_CHAMPIONS;
- return player && checkArea && player->duel && player->duel->isMounted;
+ return checkArea && player->duel && player->duel->isMounted;
+ }
+};
+
+class achievement_not_even_a_scratch : public AchievementCriteriaScript
+{
+ public:
+ achievement_not_even_a_scratch() : AchievementCriteriaScript("achievement_not_even_a_scratch") { }
+
+ bool OnCheck(Player* source, Unit* /*target*/)
+ {
+ if (!source)
+ return false;
+
+ Battleground* battleground = source->GetBattleground();
+ if (!battleground)
+ return false;
+
+ if (static_cast<BattlegroundSA*>(battleground)->notEvenAScratch(source->GetTeam()))
+ return true;
+
+ return false;
}
};
@@ -323,7 +323,6 @@ void AddSC_achievement_scripts()
new achievement_bg_ic_mowed_down();
new achievement_bg_sa_artillery();
new achievement_sickly_gazelle();
- new achievement_wg_didnt_stand_a_chance();
new achievement_everything_counts();
new achievement_bg_av_perfection();
new achievement_arena_kills("achievement_arena_2v2_kills", ARENA_TYPE_2v2);
@@ -331,4 +330,5 @@ void AddSC_achievement_scripts()
new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5);
new achievement_bg_sa_defense_of_ancients();
new achievement_tilted();
+ new achievement_not_even_a_scratch();
}
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index daf0ef213d9..f302009a4f3 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -35,7 +35,8 @@ at_brewfest
at_area_52_entrance
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*######
## at_coilfang_waterfall
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index 045dea9c9a9..abb20130ef8 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -224,9 +224,9 @@ class DreamFogTargetSelector
public:
DreamFogTargetSelector() { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- return unit->HasAura(SPELL_SLEEP);
+ return object->ToUnit() && object->ToUnit()->HasAura(SPELL_SLEEP);
}
};
@@ -239,14 +239,14 @@ class spell_dream_fog_sleep : public SpellScriptLoader
{
PrepareSpellScript(spell_dream_fog_sleep_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (DreamFogTargetSelector());
+ unitList.remove_if(DreamFogTargetSelector());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -265,10 +265,12 @@ class MarkOfNatureTargetSelector
public:
MarkOfNatureTargetSelector() { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- // return anyone that isn't tagged or already under the influence of Aura of Nature
- return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE));
+ if (Unit* unit = object->ToUnit())
+ // return anyone that isn't tagged or already under the influence of Aura of Nature
+ return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE));
+ return true;
}
};
@@ -290,9 +292,9 @@ class spell_mark_of_nature : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove_if (MarkOfNatureTargetSelector());
+ targets.remove_if(MarkOfNatureTargetSelector());
}
void HandleEffect(SpellEffIndex effIndex)
@@ -305,7 +307,7 @@ class spell_mark_of_nature : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp
index 2a5d814bfde..fb540c177bc 100755
--- a/src/server/scripts/World/chat_log.cpp
+++ b/src/server/scripts/World/chat_log.cpp
@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
#include "Channel.h"
#include "Guild.h"
#include "Group.h"
@@ -31,25 +31,25 @@ public:
{
case CHAT_MSG_ADDON:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s sends: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s sends: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_SAY:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC))
- sLog->outChat("[SAY] Player %s says (language %u): %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[SAY] Player %s says (language %u): %s",
player->GetName(), lang, msg.c_str());
break;
case CHAT_MSG_EMOTE:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC))
- sLog->outChat("[TEXTEMOTE] Player %s emotes: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[TEXTEMOTE] Player %s emotes: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_YELL:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC))
- sLog->outChat("[YELL] Player %s yells (language %u): %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[YELL] Player %s yells (language %u): %s",
player->GetName(), lang, msg.c_str());
break;
}
@@ -58,10 +58,10 @@ public:
void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver)
{
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_WHISPER))
- sLog->outChat("[WHISPER] Player %s tells %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[WHISPER] Player %s tells %s: %s",
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells %s: %s",
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg.c_str());
}
@@ -73,52 +73,52 @@ public:
{
case CHAT_MSG_PARTY:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_PARTY))
- sLog->outChat("[PARTY] Player %s tells group with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[PARTY] Player %s tells group with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells group with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells group with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_PARTY_LEADER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PARTY))
- sLog->outChat("[PARTY] Leader %s tells group: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[PARTY] Leader %s tells group: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_RAID:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_RAID))
- sLog->outChat("[RAID] Player %s tells raid with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[RAID] Player %s tells raid with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells raid with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells raid with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_RAID_LEADER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID))
- sLog->outChat("[RAID] Leader player %s tells raid: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[RAID] Leader player %s tells raid: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_RAID_WARNING:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID))
- sLog->outChat("[RAID] Leader player %s warns raid with: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[RAID] Leader player %s warns raid with: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_BATTLEGROUND:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_BGROUND))
- sLog->outChat("[BATTLEGROUND] Player %s tells battleground with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[BATTLEGROUND] Player %s tells battleground with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells battleground with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells battleground with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_BATTLEGROUND_LEADER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_BGROUND))
- sLog->outChat("[BATTLEGROUND] Leader player %s tells battleground: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[BATTLEGROUND] Leader player %s tells battleground: %s",
player->GetName(), msg.c_str());
break;
}
@@ -130,16 +130,16 @@ public:
{
case CHAT_MSG_GUILD:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_GUILD))
- sLog->outChat("[GUILD] Player %s tells guild %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[GUILD] Player %s tells guild %s: %s",
player->GetName(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s sends to guild %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s sends to guild %s: %s",
player->GetName(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_OFFICER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_GUILD))
- sLog->outChat("[OFFICER] Player %s tells guild %s officers: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[OFFICER] Player %s tells guild %s officers: %s",
player->GetName(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
break;
}
@@ -154,10 +154,10 @@ public:
channel->HasFlag(CHANNEL_FLAG_LFG));
if (sWorld->getBoolConfig(CONFIG_CHATLOG_SYSCHAN) && isSystem)
- sLog->outChat("[SYSCHAN] Player %s tells channel %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[SYSCHAN] Player %s tells channel %s: %s",
player->GetName(), channel->GetName().c_str(), msg.c_str());
else if (sWorld->getBoolConfig(CONFIG_CHATLOG_CHANNEL))
- sLog->outChat("[CHANNEL] Player %s tells channel %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[CHANNEL] Player %s tells channel %s: %s",
player->GetName(), channel ? channel->GetName().c_str() : "<unknown>", msg.c_str());
}
};
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 308c7f9afa3..3ce136b9737 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -50,7 +50,9 @@ go_large_gjalerbron_cage
go_veil_skith_cage
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## go_cat_figurine
@@ -327,7 +329,7 @@ public:
if (Spell)
creature->CastSpell(player, Spell, false);
else
- sLog->outError("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->getFaction());
+ sLog->outError(LOG_FILTER_TSCR, "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->getFaction());
}
}
}
@@ -1275,6 +1277,28 @@ public:
}
};
+/*######
+## go_midsummer_bonfire
+######*/
+
+enum eMidsummerBonfire
+{
+ STAMP_OUT_BONFIRE_QUEST_COMPLETE = 45458,
+};
+
+class go_midsummer_bonfire : public GameObjectScript
+{
+public:
+ go_midsummer_bonfire() : GameObjectScript("go_midsummer_bonfire") { }
+
+ bool OnGossipSelect(Player* player, GameObject* /*go*/, uint32 /*sender*/, uint32 /*action*/)
+ {
+ player->CastSpell(player, STAMP_OUT_BONFIRE_QUEST_COMPLETE, true);
+ player->CLOSE_GOSSIP_MENU();
+ return false;
+ }
+};
+
void AddSC_go_scripts()
{
new go_cat_figurine;
@@ -1316,4 +1340,5 @@ void AddSC_go_scripts()
new go_large_gjalerbron_cage;
new go_veil_skith_cage;
new go_frostblade_shrine;
+ new go_midsummer_bonfire;
}
diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp
index e3100522fbe..4b0433fe0c7 100644
--- a/src/server/scripts/World/guards.cpp
+++ b/src/server/scripts/World/guards.cpp
@@ -29,7 +29,8 @@ guard_shattrath_aldor
guard_shattrath_scryer
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "GuardAI.h"
enum GuardGeneric
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index ae69744ea2b..d888e6cb56b 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -30,7 +30,8 @@ item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
item_only_for_flight Items which should only useable while flying
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "Spell.h"
/*#####
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index 208effee61b..be409670f5d 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -23,7 +23,9 @@ SDComment: Should be replaced with core based AI
SDCategory: Creatures
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#define GENERIC_CREATURE_COOLDOWN 5000
diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp
index fb7c0833d22..f57af517db2 100644
--- a/src/server/scripts/World/npc_innkeeper.cpp
+++ b/src/server/scripts/World/npc_innkeeper.cpp
@@ -23,7 +23,10 @@ SDComment: Complete
SDCategory: NPCs
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "GameEventMgr.h"
#define HALLOWEEN_EVENTID 12
#define SPELL_TRICK_OR_TREATED 24755
diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp
index 2afa80dd42c..175cfb190d7 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -23,7 +23,9 @@ SDComment: Provides learn/unlearn/relearn-options for professions. Not supported
SDCategory: NPCs
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*
A few notes for future developement:
@@ -242,7 +244,7 @@ bool EquippedOk(Player* player, uint32 spellId)
if (item && item->GetTemplate()->RequiredSpell == reqSpell)
{
//player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
+ sLog->outDebug(LOG_FILTER_TSCR, "player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
return false;
}
}
diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp
index ceda8e0f6ac..6241978fbd2 100644
--- a/src/server/scripts/World/npc_taxi.cpp
+++ b/src/server/scripts/World/npc_taxi.cpp
@@ -24,7 +24,9 @@ SDCategory: NPCs
EndScriptData
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#define GOSSIP_SUSURRUS "I am ready."
#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!"
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 57a65423b6f..5640a84317c 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -42,12 +42,22 @@ npc_locksmith 75% list of keys needs to be confirmed
npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "World.h"
#include "PetAI.h"
+#include "PassiveAI.h"
+#include "CombatAI.h"
+#include "GameEventMgr.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "SpellAuras.h"
/*########
# npc_air_force_bots
@@ -131,14 +141,14 @@ public:
}
if (!SpawnAssoc)
- sLog->outErrorDb("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", creature->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", creature->GetEntry());
else
{
CreatureTemplate const* spawnedTemplate = sObjectMgr->GetCreatureTemplate(SpawnAssoc->spawnedCreatureEntry);
if (!spawnedTemplate)
{
- sLog->outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry);
SpawnAssoc = NULL;
return;
}
@@ -158,7 +168,7 @@ public:
SpawnedGUID = summoned->GetGUID();
else
{
- sLog->outErrorDb("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry);
SpawnAssoc = NULL;
}
@@ -836,7 +846,7 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 const diff)
patientEntry = HordeSoldierId[rand() % 3];
break;
default:
- sLog->outError("TSCR: Invalid entry for Triage doctor. Please check your database");
+ sLog->outError(LOG_FILTER_TSCR, "Invalid entry for Triage doctor. Please check your database");
return;
}
diff --git a/src/server/shared/AutoPtr.h b/src/server/shared/AutoPtr.h
index 988c46cc5a2..f4199880abd 100644
--- a/src/server/shared/AutoPtr.h
+++ b/src/server/shared/AutoPtr.h
@@ -27,7 +27,7 @@ namespace Trinity
{
public:
AutoPtr() : ACE_Strong_Bound_Ptr<Pointer, Lock>() {}
-
+
AutoPtr(Pointer* x)
{
ACE_Strong_Bound_Ptr<Pointer, Lock>::reset(x);
@@ -48,6 +48,6 @@ namespace Trinity
return ACE_Strong_Bound_Ptr<Pointer, Lock>::get() != x;
}
};
-};
+}
-#endif \ No newline at end of file
+#endif
diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp
index b82d86cc5d0..e0df22b88ae 100755
--- a/src/server/shared/Configuration/Config.cpp
+++ b/src/server/shared/Configuration/Config.cpp
@@ -80,7 +80,7 @@ std::string GetStringDefault(const char* name, const std::string &def)
{
ACE_TString val;
return GetValueHelper(name, val) ? val.c_str() : def;
-};
+}
bool GetBoolDefault(const char* name, bool def)
{
@@ -91,19 +91,19 @@ bool GetBoolDefault(const char* name, bool def)
return (val == "true" || val == "TRUE" || val == "yes" || val == "YES" ||
val == "1");
-};
+}
int GetIntDefault(const char* name, int def)
{
ACE_TString val;
return GetValueHelper(name, val) ? atoi(val.c_str()) : def;
-};
+}
float GetFloatDefault(const char* name, float def)
{
ACE_TString val;
return GetValueHelper(name, val) ? (float)atof(val.c_str()) : def;
-};
+}
const std::string & GetFilename()
{
diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h
index a870379881b..82e4d9bcce0 100755
--- a/src/server/shared/Configuration/Config.h
+++ b/src/server/shared/Configuration/Config.h
@@ -34,4 +34,3 @@ namespace ConfigMgr
}
#endif
-
diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h
index f0242cbff0e..0a1b6738f1a 100644
--- a/src/server/shared/Containers.h
+++ b/src/server/shared/Containers.h
@@ -63,9 +63,9 @@ namespace Trinity
std::advance(it, urand(0, container.size() - 1));
return *it;
}
- };
+ }
//! namespace Containers
-};
+}
//! namespace Trinity
-#endif //! #ifdef TRINITY_CONTAINERS_H \ No newline at end of file
+#endif //! #ifdef TRINITY_CONTAINERS_H
diff --git a/src/server/shared/Cryptography/ARC4.cpp b/src/server/shared/Cryptography/ARC4.cpp
index 52a60573eca..5b2cf7a0a93 100755
--- a/src/server/shared/Cryptography/ARC4.cpp
+++ b/src/server/shared/Cryptography/ARC4.cpp
@@ -19,14 +19,14 @@
#include "ARC4.h"
#include <openssl/sha.h>
-ARC4::ARC4(uint8 len)
+ARC4::ARC4(uint8 len) : m_ctx()
{
EVP_CIPHER_CTX_init(&m_ctx);
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
EVP_CIPHER_CTX_set_key_length(&m_ctx, len);
}
-ARC4::ARC4(uint8 *seed, uint8 len)
+ARC4::ARC4(uint8 *seed, uint8 len) : m_ctx()
{
EVP_CIPHER_CTX_init(&m_ctx);
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
index 7081b4973d4..b40ce8ac40c 100755
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
@@ -41,4 +41,3 @@ class AuthCrypt
bool _initialized;
};
#endif
-
diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp
index 364ee76ec75..8e424e9bcdb 100755
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -75,7 +75,7 @@ void BigNumber::SetRand(int numbits)
BN_rand(_bn, numbits, 0, 1);
}
-BigNumber BigNumber::operator=(const BigNumber &bn)
+BigNumber& BigNumber::operator=(const BigNumber &bn)
{
if (this == &bn)
return *this;
@@ -164,7 +164,7 @@ uint32 BigNumber::AsDword()
bool BigNumber::isZero() const
{
- return BN_is_zero(_bn)!=0;
+ return BN_is_zero(_bn);
}
uint8 *BigNumber::AsByteArray(int minSize, bool reverse)
diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h
index 6646245a6a0..a27d74fb5c7 100755
--- a/src/server/shared/Cryptography/BigNumber.h
+++ b/src/server/shared/Cryptography/BigNumber.h
@@ -39,7 +39,7 @@ class BigNumber
void SetRand(int numbits);
- BigNumber operator=(const BigNumber &bn);
+ BigNumber& operator=(const BigNumber &bn);
BigNumber operator+=(const BigNumber &bn);
BigNumber operator+(const BigNumber &bn)
diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h
index 9b44ab1832e..f0a9905b6fe 100644
--- a/src/server/shared/Cryptography/WardenKeyGeneration.h
+++ b/src/server/shared/Cryptography/WardenKeyGeneration.h
@@ -21,50 +21,56 @@
#ifndef _WARDEN_KEY_GENERATION_H
#define _WARDEN_KEY_GENERATION_H
-class SHA1Randx {
+class SHA1Randx
+{
public:
- SHA1Randx(uint8 *buff, uint32 size) {
+ SHA1Randx(uint8* buff, uint32 size)
+ {
uint32 taken = size/2;
sh.Initialize();
- sh.UpdateData(buff,taken);
+ sh.UpdateData(buff, taken);
sh.Finalize();
- memcpy(o1,sh.GetDigest(),20);
+ memcpy(o1, sh.GetDigest(), 20);
sh.Initialize();
- sh.UpdateData(buff+taken,size-taken);
+ sh.UpdateData(buff + taken, size - taken);
sh.Finalize();
- memcpy(o2,sh.GetDigest(),20);
+ memcpy(o2, sh.GetDigest(), 20);
- memset(o0,0x00,20);
+ memset(o0, 0x00, 20);
- fillUp();
+ FillUp();
}
- void generate(uint8 *buf, uint32 sz) {
- for(uint32 i=0;i<sz;i++) {
- if(taken == 20) {
- fillUp();
- }
+ void Generate(uint8* buf, uint32 sz)
+ {
+ for (uint32 i = 0; i < sz; ++i)
+ {
+ if (taken == 20)
+ FillUp();
buf[i] = o0[taken];
taken++;
}
}
+
private:
- void fillUp() {
+ void FillUp()
+ {
sh.Initialize();
- sh.UpdateData(o1,20);
- sh.UpdateData(o0,20);
- sh.UpdateData(o2,20);
+ sh.UpdateData(o1, 20);
+ sh.UpdateData(o0, 20);
+ sh.UpdateData(o2, 20);
sh.Finalize();
- memcpy(o0,sh.GetDigest(),20);
+ memcpy(o0, sh.GetDigest(), 20);
taken = 0;
}
+
SHA1Hash sh;
uint32 taken;
uint8 o0[20],o1[20],o2[20];
diff --git a/src/server/shared/DataStores/DBCFileLoader.cpp b/src/server/shared/DataStores/DBCFileLoader.cpp
index f909c8566bb..6f78ce5a02d 100755
--- a/src/server/shared/DataStores/DBCFileLoader.cpp
+++ b/src/server/shared/DataStores/DBCFileLoader.cpp
@@ -23,10 +23,8 @@
#include "DBCFileLoader.h"
#include "Errors.h"
-DBCFileLoader::DBCFileLoader()
+DBCFileLoader::DBCFileLoader() : fieldsOffset(NULL), data(NULL), stringTable(NULL)
{
- data = NULL;
- fieldsOffset = NULL;
}
bool DBCFileLoader::Load(const char* filename, const char* fmt)
diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h
index a43807a3b59..eb8317fbefd 100755
--- a/src/server/shared/DataStores/DBCFileLoader.h
+++ b/src/server/shared/DataStores/DBCFileLoader.h
@@ -32,8 +32,8 @@ enum
FT_BYTE='b', //uint8
FT_SORT='d', //sorted by this field, field is not included
FT_IND='n', //the same, but parsed to data
- FT_LOGIC='l', //Logical (boolean)
- FT_SQL_PRESENT='p', //Used in sql format to mark column present in sql dbc
+ FT_LOGIC='l', //Logical (boolean)
+ FT_SQL_PRESENT='p', //Used in sql format to mark column present in sql dbc
FT_SQL_ABSENT='a' //Used in sql format to mark column absent in sql dbc
};
diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h
index c5b8b6f5a21..9965a5c1d71 100755
--- a/src/server/shared/DataStores/DBCStore.h
+++ b/src/server/shared/DataStores/DBCStore.h
@@ -117,7 +117,7 @@ class DBCStorage
// Check if sql index pos is valid
if (int32(result->GetFieldCount()-1) < sql->sqlIndexPos)
{
- sLog->outError("Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str());
return false;
}
}
@@ -148,7 +148,7 @@ class DBCStorage
uint32 id = fields[sql->sqlIndexPos].GetUInt32();
if (indexTable.asT[id])
{
- sLog->outError("Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str());
return false;
}
indexTable.asT[id]=(T*)&sqlDataTable[offset];
@@ -203,7 +203,7 @@ class DBCStorage
offset+=1;
break;
case FT_STRING:
- sLog->outError("Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
+ sLog->outError(LOG_FILTER_GENERAL, "Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
return false;
case FT_SORT:
break;
@@ -215,13 +215,13 @@ class DBCStorage
}
else
{
- sLog->outError("Incorrect sql format string '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
+ sLog->outError(LOG_FILTER_GENERAL, "Incorrect sql format string '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
return false;
}
}
if (sqlColumnNumber != (result->GetFieldCount()-1))
{
- sLog->outError("SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str());
return false;
}
diff --git a/src/server/shared/Database/AdhocStatement.cpp b/src/server/shared/Database/AdhocStatement.cpp
index 9e795ae853a..95dce77e53c 100755
--- a/src/server/shared/Database/AdhocStatement.cpp
+++ b/src/server/shared/Database/AdhocStatement.cpp
@@ -44,6 +44,7 @@ bool BasicStatementTask::Execute()
ResultSet* result = m_conn->Query(m_sql);
if (!result || !result->GetRowCount())
{
+ delete result;
m_result.set(QueryResult(NULL));
return false;
}
diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h
index 314d196cc06..a0816686734 100755
--- a/src/server/shared/Database/DatabaseWorkerPool.h
+++ b/src/server/shared/Database/DatabaseWorkerPool.h
@@ -64,7 +64,7 @@ class DatabaseWorkerPool
bool res = true;
_connectionInfo = MySQLConnectionInfo(infoString);
- sLog->outSQLDriver("Opening DatabasePool '%s'. Asynchronous connections: %u, synchronous connections: %u.",
+ sLog->outInfo(LOG_FILTER_SQL_DRIVER, "Opening DatabasePool '%s'. Asynchronous connections: %u, synchronous connections: %u.",
GetDatabaseName(), async_threads, synch_threads);
//! Open asynchronous connections (delayed operations)
@@ -88,17 +88,17 @@ class DatabaseWorkerPool
}
if (res)
- sLog->outSQLDriver("DatabasePool '%s' opened successfully. %u total connections running.", GetDatabaseName(),
+ sLog->outInfo(LOG_FILTER_SQL_DRIVER, "DatabasePool '%s' opened successfully. %u total connections running.", GetDatabaseName(),
(_connectionCount[IDX_SYNCH] + _connectionCount[IDX_ASYNC]));
else
- sLog->outError("DatabasePool %s NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile "
+ sLog->outError(LOG_FILTER_SQL_DRIVER, "DatabasePool %s NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile "
"for specific errors.", GetDatabaseName());
return res;
}
void Close()
{
- sLog->outSQLDriver("Closing down DatabasePool '%s'.", GetDatabaseName());
+ sLog->outInfo(LOG_FILTER_SQL_DRIVER, "Closing down DatabasePool '%s'.", GetDatabaseName());
//! Shuts down delaythreads for this connection pool by underlying deactivate().
//! The next dequeue attempt in the worker thread tasks will result in an error,
@@ -114,7 +114,7 @@ class DatabaseWorkerPool
t->Close(); //! Closes the actualy MySQL connection.
}
- sLog->outSQLDriver("Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.",
+ sLog->outInfo(LOG_FILTER_SQL_DRIVER, "Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.",
GetDatabaseName());
//! Shut down the synchronous connections
@@ -127,7 +127,7 @@ class DatabaseWorkerPool
//! Deletes the ACE_Activation_Queue object and its underlying ACE_Message_Queue
delete _queue;
- sLog->outSQLDriver("All connections on DatabasePool '%s' closed.", GetDatabaseName());
+ sLog->outInfo(LOG_FILTER_SQL_DRIVER, "All connections on DatabasePool '%s' closed.", GetDatabaseName());
}
/**
@@ -224,7 +224,10 @@ class DatabaseWorkerPool
ResultSet* result = conn->Query(sql);
conn->Unlock();
if (!result || !result->GetRowCount())
+ {
+ delete result;
return QueryResult(NULL);
+ }
result->NextRow();
return QueryResult(result);
@@ -275,7 +278,10 @@ class DatabaseWorkerPool
delete stmt;
if (!ret || !ret->GetRowCount())
+ {
+ delete ret;
return PreparedQueryResult(NULL);
+ }
return PreparedQueryResult(ret);
}
@@ -351,10 +357,10 @@ class DatabaseWorkerPool
switch (transaction->GetSize())
{
case 0:
- sLog->outSQLDriver("Transaction contains 0 queries. Not executing.");
+ sLog->outDebug(LOG_FILTER_SQL_DRIVER, "Transaction contains 0 queries. Not executing.");
return;
case 1:
- sLog->outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code.");
+ sLog->outDebug(LOG_FILTER_SQL_DRIVER, "Warning: Transaction only holds 1 query, consider removing Transaction context in code.");
break;
default:
break;
@@ -501,7 +507,7 @@ class DatabaseWorkerPool
{
IDX_ASYNC,
IDX_SYNCH,
- IDX_SIZE,
+ IDX_SIZE
};
ACE_Activation_Queue* _queue; //! Queue shared by async worker threads.
diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h
index bfa42dbe574..61e8fb7ccef 100755
--- a/src/server/shared/Database/Field.h
+++ b/src/server/shared/Database/Field.h
@@ -43,7 +43,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_TINY))
{
- sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetUInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -61,7 +61,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_TINY))
{
- sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -79,7 +79,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR))
{
- sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetUInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -97,7 +97,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR))
{
- sLog->outSQLDriver("Warning: GetInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -115,7 +115,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG))
{
- sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetUInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -133,7 +133,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG))
{
- sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -151,7 +151,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT))
{
- sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetUInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -169,7 +169,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT))
{
- sLog->outSQLDriver("Warning: GetInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
return 0;
}
#endif
@@ -187,7 +187,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_FLOAT))
{
- sLog->outSQLDriver("Warning: GetFloat() on non-float field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetFloat() on non-float field. Using type: %s.", FieldTypeToString(data.type));
return 0.0f;
}
#endif
@@ -205,7 +205,7 @@ class Field
#ifdef TRINITY_DEBUG
if (!IsType(MYSQL_TYPE_DOUBLE))
{
- sLog->outSQLDriver("Warning: GetDouble() on non-double field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Warning: GetDouble() on non-double field. Using type: %s.", FieldTypeToString(data.type));
return 0.0f;
}
#endif
@@ -223,7 +223,7 @@ class Field
#ifdef TRINITY_DEBUG
if (IsNumeric())
{
- sLog->outSQLDriver("Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type));
+ sLog->outWarn(LOG_FILTER_SQL, "Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type));
return NULL;
}
#endif
@@ -322,7 +322,7 @@ class Field
MYSQL_TYPE_SET:
*/
default:
- sLog->outSQLDriver("SQL::SizeForType(): invalid field type %u", uint32(field->type));
+ sLog->outWarn(LOG_FILTER_SQL, "SQL::SizeForType(): invalid field type %u", uint32(field->type));
return 0;
}
}
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
index 89cc6ab25e5..c7a283c94d7 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
@@ -94,7 +94,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, "
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, "
"item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC)
@@ -109,7 +109,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH)
PREPARE_STATEMENT(CHAR_SEL_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, owner_guid FROM mail_items mi JOIN item_instance ii ON mi.item_guid = ii.guid WHERE mail_id = ?", CONNECTION_SYNCH)
PREPARE_STATEMENT(CHAR_SEL_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH)
PREPARE_STATEMENT(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH);
@@ -235,8 +235,8 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(CHAR_DEL_OLD_CHANNELS, "DELETE FROM channels WHERE ownership = 1 AND lastUsed + ? < UNIX_TIMESTAMP()", CONNECTION_ASYNC)
// Equipmentsets
- PREPARE_STATEMENT(CHAR_UPD_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_INS_EQUIP_SET, "INSERT INTO character_equipmentsets (guid, setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, ignore_mask=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_EQUIP_SET, "INSERT INTO character_equipmentsets (guid, setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC)
// Auras
@@ -338,7 +338,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ, latency, createTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
// For loading and deleting expired auctions at startup
- PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH)
// LFG Data
PREPARE_STATEMENT(CHAR_INS_LFG_DATA, "INSERT INTO lfg_data (guid, dungeon, state) VALUES (?, ?, ?)", CONNECTION_ASYNC)
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h
index e1530f36e44..823ad874de9 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h
@@ -513,7 +513,7 @@ enum CharacterDatabaseStatements
CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC,
CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT,
- MAX_CHARACTERDATABASE_STATEMENTS,
+ MAX_CHARACTERDATABASE_STATEMENTS
};
#endif
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp
index 028d927a720..31d9f5ec1f6 100755
--- a/src/server/shared/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp
@@ -59,7 +59,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, string) VALUES (UNIX_TIMESTAMP(), ? , ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_MUTE_TIME, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC);
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h
index 7c2a94eec94..b4f6713d118 100755
--- a/src/server/shared/Database/Implementation/LoginDatabase.h
+++ b/src/server/shared/Database/Implementation/LoginDatabase.h
@@ -108,7 +108,7 @@ enum LoginDatabaseStatements
LOGIN_SEL_REALMLIST_SECURITY_LEVEL,
LOGIN_DEL_ACCOUNT,
- MAX_LOGINDATABASE_STATEMENTS,
+ MAX_LOGINDATABASE_STATEMENTS
};
#endif
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp
index e3455891909..c491852b1bd 100755
--- a/src/server/shared/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp
@@ -78,7 +78,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH);
- PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
PREPARE_STATEMENT(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH);
PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH);
@@ -88,4 +88,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(WORLD_INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_DISABLES, "INSERT INTO disables (entry, sourceType, flags, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_SEL_DISABLES, "SELECT entry FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(WORLD_DEL_DISABLES, "DELETE FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_ASYNC);
}
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h
index 0580cecec7e..195d2ea8da5 100755
--- a/src/server/shared/Database/Implementation/WorldDatabase.h
+++ b/src/server/shared/Database/Implementation/WorldDatabase.h
@@ -109,8 +109,11 @@ enum WorldDatabaseStatements
WORLD_DEL_GAME_EVENT_CREATURE,
WORLD_DEL_GAME_EVENT_MODEL_EQUIP,
WORLD_INS_GAMEOBJECT,
+ WORLD_SEL_DISABLES,
+ WORLD_INS_DISABLES,
+ WORLD_DEL_DISABLES,
- MAX_WORLDDATABASE_STATEMENTS,
+ MAX_WORLDDATABASE_STATEMENTS
};
#endif
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index 7fb4a4f7025..c6d2a165ca2 100755
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -22,6 +22,8 @@
#include <winsock2.h>
#endif
#include <mysql.h>
+#include <mysqld_error.h>
+#include <errmsg.h>
#include "MySQLConnection.h"
#include "MySQLThreading.h"
@@ -79,7 +81,7 @@ bool MySQLConnection::Open()
mysqlInit = mysql_init(NULL);
if (!mysqlInit)
{
- sLog->outError("Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str());
return false;
}
@@ -123,13 +125,13 @@ bool MySQLConnection::Open()
{
if (!m_reconnecting)
{
- sLog->outSQLDriver("MySQL client library: %s", mysql_get_client_info());
- sLog->outSQLDriver("MySQL server ver: %s ", mysql_get_server_info(m_Mysql));
+ sLog->outInfo(LOG_FILTER_SQL, "MySQL client library: %s", mysql_get_client_info());
+ sLog->outInfo(LOG_FILTER_SQL, "MySQL server ver: %s ", mysql_get_server_info(m_Mysql));
if (mysql_get_server_version(m_Mysql) != mysql_get_client_version())
- sLog->outSQLDriver("[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements.");
+ sLog->outInfo(LOG_FILTER_SQL, "[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements.");
}
- sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str());
+ sLog->outInfo(LOG_FILTER_SQL, "Connected to MySQL database at %s", m_connectionInfo.host.c_str());
mysql_autocommit(m_Mysql, 1);
// set connection properties to UTF8 to properly handle locales for different
@@ -139,7 +141,7 @@ bool MySQLConnection::Open()
}
else
{
- sLog->outError("Could not connect to MySQL database at %s: %s\n", m_connectionInfo.host.c_str(), mysql_error(mysqlInit));
+ sLog->outError(LOG_FILTER_SQL, "Could not connect to MySQL database at %s: %s\n", m_connectionInfo.host.c_str(), mysql_error(mysqlInit));
mysql_close(mysqlInit);
return false;
}
@@ -159,26 +161,22 @@ bool MySQLConnection::Execute(const char* sql)
return false;
{
- uint32 _s = 0;
- if (sLog->GetSQLDriverQueryLogging())
- _s = getMSTime();
+ uint32 _s = getMSTime();
if (mysql_query(m_Mysql, sql))
{
uint32 lErrno = mysql_errno(m_Mysql);
- sLog->outSQLDriver("SQL: %s", sql);
- sLog->outSQLDriver("ERROR: [%u] %s", lErrno, mysql_error(m_Mysql));
+ sLog->outInfo(LOG_FILTER_SQL, "SQL: %s", sql);
+ sLog->outError(LOG_FILTER_SQL, "[%u] %s", lErrno, mysql_error(m_Mysql));
if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled successfully (i.e. reconnection)
return Execute(sql); // Try again
return false;
}
- else if (sLog->GetSQLDriverQueryLogging())
- {
- sLog->outSQLDriver("[%u ms] SQL: %s", getMSTimeDiff(_s, getMSTime()), sql);
- }
+ else
+ sLog->outDebug(LOG_FILTER_SQL, "[%u ms] SQL: %s", getMSTimeDiff(_s, getMSTime()), sql);
}
return true;
@@ -201,14 +199,12 @@ bool MySQLConnection::Execute(PreparedStatement* stmt)
MYSQL_STMT* msql_STMT = m_mStmt->GetSTMT();
MYSQL_BIND* msql_BIND = m_mStmt->GetBind();
- uint32 _s = 0;
- if (sLog->GetSQLDriverQueryLogging())
- _s = getMSTime();
+ uint32 _s = getMSTime();
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
{
uint32 lErrno = mysql_errno(m_Mysql);
- sLog->outSQLDriver("SQL(p): %s\n [ERROR]: [%u] %s", m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
+ sLog->outError(LOG_FILTER_SQL, "SQL(p): %s\n [ERROR]: [%u] %s", m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled successfully (i.e. reconnection)
return Execute(stmt); // Try again
@@ -220,7 +216,7 @@ bool MySQLConnection::Execute(PreparedStatement* stmt)
if (mysql_stmt_execute(msql_STMT))
{
uint32 lErrno = mysql_errno(m_Mysql);
- sLog->outSQLDriver("SQL(p): %s\n [ERROR]: [%u] %s", m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
+ sLog->outError(LOG_FILTER_SQL, "SQL(p): %s\n [ERROR]: [%u] %s", m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled successfully (i.e. reconnection)
return Execute(stmt); // Try again
@@ -229,8 +225,7 @@ bool MySQLConnection::Execute(PreparedStatement* stmt)
return false;
}
- if (sLog->GetSQLDriverQueryLogging())
- sLog->outSQLDriver("[%u ms] SQL(p): %s", getMSTimeDiff(_s, getMSTime()), m_mStmt->getQueryString(m_queries[index].first).c_str());
+ sLog->outDebug(LOG_FILTER_SQL, "[%u ms] SQL(p): %s", getMSTimeDiff(_s, getMSTime()), m_mStmt->getQueryString(m_queries[index].first).c_str());
m_mStmt->ClearParameters();
return true;
@@ -254,14 +249,12 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint6
MYSQL_STMT* msql_STMT = m_mStmt->GetSTMT();
MYSQL_BIND* msql_BIND = m_mStmt->GetBind();
- uint32 _s = 0;
- if (sLog->GetSQLDriverQueryLogging())
- _s = getMSTime();
+ uint32 _s = getMSTime();
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
{
uint32 lErrno = mysql_errno(m_Mysql);
- sLog->outSQLDriver("SQL(p): %s\n [ERROR]: [%u] %s", m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
+ sLog->outError(LOG_FILTER_SQL, "SQL(p): %s\n [ERROR]: [%u] %s", m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled successfully (i.e. reconnection)
return _Query(stmt, pResult, pRowCount, pFieldCount); // Try again
@@ -273,7 +266,7 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint6
if (mysql_stmt_execute(msql_STMT))
{
uint32 lErrno = mysql_errno(m_Mysql);
- sLog->outSQLDriver("SQL(p): %s\n [ERROR]: [%u] %s",
+ sLog->outError(LOG_FILTER_SQL, "SQL(p): %s\n [ERROR]: [%u] %s",
m_mStmt->getQueryString(m_queries[index].first).c_str(), lErrno, mysql_stmt_error(msql_STMT));
if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled successfully (i.e. reconnection)
@@ -283,8 +276,7 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint6
return false;
}
- if (sLog->GetSQLDriverQueryLogging())
- sLog->outSQLDriver("[%u ms] SQL(p): %s", getMSTimeDiff(_s, getMSTime()), m_mStmt->getQueryString(m_queries[index].first).c_str());
+ sLog->outDebug(LOG_FILTER_SQL, "[%u ms] SQL(p): %s", getMSTimeDiff(_s, getMSTime()), m_mStmt->getQueryString(m_queries[index].first).c_str());
m_mStmt->ClearParameters();
@@ -319,25 +311,21 @@ bool MySQLConnection::_Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD *
return false;
{
- uint32 _s = 0;
- if (sLog->GetSQLDriverQueryLogging())
- _s = getMSTime();
+ uint32 _s = getMSTime();
if (mysql_query(m_Mysql, sql))
{
uint32 lErrno = mysql_errno(m_Mysql);
- sLog->outSQLDriver("SQL: %s", sql);
- sLog->outSQLDriver("ERROR: [%u] %s", lErrno, mysql_error(m_Mysql));
+ sLog->outInfo(LOG_FILTER_SQL, "SQL: %s", sql);
+ sLog->outError(LOG_FILTER_SQL, "[%u] %s", lErrno, mysql_error(m_Mysql));
if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled successfully (i.e. reconnection)
return _Query(sql, pResult, pFields, pRowCount, pFieldCount); // We try again
return false;
}
- else if (sLog->GetSQLDriverQueryLogging())
- {
- sLog->outSQLDriver("[%u ms] SQL: %s", getMSTimeDiff(_s, getMSTime()), sql);
- }
+ else
+ sLog->outDebug(LOG_FILTER_SQL, "[%u ms] SQL: %s", getMSTimeDiff(_s, getMSTime()), sql);
*pResult = mysql_store_result(m_Mysql);
*pRowCount = mysql_affected_rows(m_Mysql);
@@ -393,7 +381,7 @@ bool MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
ASSERT(stmt);
if (!Execute(stmt))
{
- sLog->outSQLDriver("[Warning] Transaction aborted. %u queries not executed.", (uint32)queries.size());
+ sLog->outWarn(LOG_FILTER_SQL, "Transaction aborted. %u queries not executed.", (uint32)queries.size());
RollbackTransaction();
return false;
}
@@ -405,7 +393,7 @@ bool MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
ASSERT(sql);
if (!Execute(sql))
{
- sLog->outSQLDriver("[Warning] Transaction aborted. %u queries not executed.", (uint32)queries.size());
+ sLog->outWarn(LOG_FILTER_SQL, "Transaction aborted. %u queries not executed.", (uint32)queries.size());
RollbackTransaction();
return false;
}
@@ -428,7 +416,7 @@ MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index)
ASSERT(index < m_stmts.size());
MySQLPreparedStatement* ret = m_stmts[index];
if (!ret)
- sLog->outSQLDriver("ERROR: Could not fetch prepared statement %u on database `%s`, connection type: %s.",
+ sLog->outError(LOG_FILTER_SQL, "Could not fetch prepared statement %u on database `%s`, connection type: %s.",
index, m_connectionInfo.database.c_str(), (m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous");
return ret;
@@ -449,19 +437,19 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
return;
}
- MYSQL_STMT * stmt = mysql_stmt_init(m_Mysql);
+ MYSQL_STMT* stmt = mysql_stmt_init(m_Mysql);
if (!stmt)
{
- sLog->outSQLDriver("[ERROR]: In mysql_stmt_init() id: %u, sql: \"%s\"", index, sql);
- sLog->outSQLDriver("[ERROR]: %s", mysql_error(m_Mysql));
+ sLog->outError(LOG_FILTER_SQL, "In mysql_stmt_init() id: %u, sql: \"%s\"", index, sql);
+ sLog->outError(LOG_FILTER_SQL, "%s", mysql_error(m_Mysql));
m_prepareError = true;
}
else
{
if (mysql_stmt_prepare(stmt, sql, static_cast<unsigned long>(strlen(sql))))
{
- sLog->outSQLDriver("[ERROR]: In mysql_stmt_prepare() id: %u, sql: \"%s\"", index, sql);
- sLog->outSQLDriver("[ERROR]: %s", mysql_stmt_error(stmt));
+ sLog->outError(LOG_FILTER_SQL, "In mysql_stmt_prepare() id: %u, sql: \"%s\"", index, sql);
+ sLog->outError(LOG_FILTER_SQL, "%s", mysql_stmt_error(stmt));
mysql_stmt_close(stmt);
m_prepareError = true;
}
@@ -493,19 +481,19 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo)
{
switch (errNo)
{
- case 2006: // "MySQL server has gone away"
- case 2013: // "Lost connection to MySQL server during query"
- case 2048: // "Invalid connection handle"
- case 2055: // "Lost connection to MySQL server at '%s', system error: %d"
+ case CR_SERVER_GONE_ERROR:
+ case CR_SERVER_LOST:
+ case CR_INVALID_CONN_HANDLE:
+ case CR_SERVER_LOST_EXTENDED:
{
m_reconnecting = true;
uint64 oldThreadId = mysql_thread_id(GetHandle());
mysql_close(GetHandle());
if (this->Open()) // Don't remove 'this' pointer unless you want to skip loading all prepared statements....
{
- sLog->outSQLDriver("Connection to the MySQL server is active.");
+ sLog->outInfo(LOG_FILTER_SQL, "Connection to the MySQL server is active.");
if (oldThreadId != mysql_thread_id(GetHandle()))
- sLog->outSQLDriver("Successfully reconnected to %s @%s:%s (%s).",
+ sLog->outInfo(LOG_FILTER_SQL, "Successfully reconnected to %s @%s:%s (%s).",
m_connectionInfo.database.c_str(), m_connectionInfo.host.c_str(), m_connectionInfo.port_or_socket.c_str(),
(m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous");
@@ -518,21 +506,27 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo)
return _HandleMySQLErrno(lErrno); // Call self (recursive)
}
- case 1213: // "Deadlock found when trying to get lock; try restarting transaction"
+ case ER_LOCK_DEADLOCK:
return false; // Implemented in TransactionTask::Execute and DatabaseWorkerPool<T>::DirectCommitTransaction
// Query related errors - skip query
- case 1058: // "Column count doesn't match value count"
- case 1062: // "Duplicate entry '%s' for key '%d'"
+ case ER_WRONG_VALUE_COUNT:
+ case ER_DUP_ENTRY:
return false;
// Outdated table or database structure - terminate core
- case 1054: // "Unknown column '%s' in '%s'"
- case 1146: // "Table '%s' doesn't exist"
- WPFatal(!errNo, "Your database structure is not up to date. Please make sure you've executed all queries in the sql/updates folders.");
+ case ER_BAD_FIELD_ERROR:
+ case ER_NO_SUCH_TABLE:
+ sLog->outError(LOG_FILTER_SQL, "Your database structure is not up to date. Please make sure you've executed all queries in the sql/updates folders.");
+ ACE_OS::sleep(10);
+ std::abort();
+ return false;
+ case ER_PARSE_ERROR:
+ sLog->outError(LOG_FILTER_SQL, "Error while parsing SQL. Core fix required.");
+ ACE_OS::sleep(10);
+ std::abort();
return false;
-
default:
- sLog->outSQLDriver("Unhandled MySQL errno %u. Unexpected behaviour possible.", errNo);
+ sLog->outError(LOG_FILTER_SQL, "Unhandled MySQL errno %u. Unexpected behaviour possible.", errNo);
return false;
}
}
diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h
index c05c4e62c96..c597476967d 100755
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -33,7 +33,7 @@ enum ConnectionFlags
{
CONNECTION_ASYNC = 0x1,
CONNECTION_SYNCH = 0x2,
- CONNECTION_BOTH = CONNECTION_ASYNC | CONNECTION_SYNCH,
+ CONNECTION_BOTH = CONNECTION_ASYNC | CONNECTION_SYNCH
};
struct MySQLConnectionInfo
diff --git a/src/server/shared/Database/MySQLThreading.h b/src/server/shared/Database/MySQLThreading.h
index 2004ee9826c..038ec4ee794 100755
--- a/src/server/shared/Database/MySQLThreading.h
+++ b/src/server/shared/Database/MySQLThreading.h
@@ -33,7 +33,7 @@ class MySQL
static void Thread_Init()
{
mysql_thread_init();
- sLog->outSQLDriver("Core thread with ID ["UI64FMTD"] initializing MySQL thread.",
+ sLog->outWarn(LOG_FILTER_SQL, "Core thread with ID ["UI64FMTD"] initializing MySQL thread.",
(uint64)ACE_Based::Thread::currentId());
}
@@ -44,7 +44,7 @@ class MySQL
static void Thread_End()
{
mysql_thread_end();
- sLog->outSQLDriver("Core thread with ID ["UI64FMTD"] shutting down MySQL thread.",
+ sLog->outWarn(LOG_FILTER_SQL, "Core thread with ID ["UI64FMTD"] shutting down MySQL thread.",
(uint64)ACE_Based::Thread::currentId());
}
diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp
index db26dabaee7..21aef0f1834 100755
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -78,7 +78,7 @@ void PreparedStatement::BindParameters()
}
#ifdef _DEBUG
if (i < m_stmt->m_paramCount)
- sLog->outSQLDriver("[WARNING]: BindParameters() for statement %u did not bind all allocated parameters", m_index);
+ sLog->outWarn(LOG_FILTER_SQL, "[WARNING]: BindParameters() for statement %u did not bind all allocated parameters", m_index);
#endif
}
@@ -209,7 +209,7 @@ m_bind(NULL)
MySQLPreparedStatement::~MySQLPreparedStatement()
{
ClearParameters();
- if(m_Mstmt->bind_result_done)
+ if (m_Mstmt->bind_result_done)
{
delete[] m_Mstmt->bind->length;
delete[] m_Mstmt->bind->is_null;
@@ -237,7 +237,7 @@ bool MySQLPreparedStatement::CheckValidIndex(uint8 index)
return false;
if (m_paramsSet[index])
- sLog->outSQLDriver("[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index);
+ sLog->outWarn(LOG_FILTER_SQL, "[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index);
return true;
}
@@ -440,6 +440,7 @@ bool PreparedStatementTask::Execute()
PreparedResultSet* result = m_conn->Query(m_stmt);
if (!result || !result->GetRowCount())
{
+ delete result;
m_result.set(PreparedQueryResult(NULL));
return false;
}
diff --git a/src/server/shared/Database/QueryHolder.cpp b/src/server/shared/Database/QueryHolder.cpp
index a3602531205..ed228c74667 100755
--- a/src/server/shared/Database/QueryHolder.cpp
+++ b/src/server/shared/Database/QueryHolder.cpp
@@ -24,7 +24,7 @@ bool SQLQueryHolder::SetQuery(size_t index, const char *sql)
{
if (m_queries.size() <= index)
{
- sLog->outError("Query index (%zu) out of range (size: %u) for query: %s", index, (uint32)m_queries.size(), sql);
+ sLog->outError(LOG_FILTER_SQL, "Query index (%u) out of range (size: %u) for query: %s", uint32(index), (uint32)m_queries.size(), sql);
return false;
}
@@ -44,7 +44,7 @@ bool SQLQueryHolder::SetPQuery(size_t index, const char *format, ...)
{
if (!format)
{
- sLog->outError("Query (index: %zu) is empty.", index);
+ sLog->outError(LOG_FILTER_SQL, "Query (index: %u) is empty.", uint32(index));
return false;
}
@@ -56,7 +56,7 @@ bool SQLQueryHolder::SetPQuery(size_t index, const char *format, ...)
if (res == -1)
{
- sLog->outError("SQL Query truncated (and not execute) for format: %s", format);
+ sLog->outError(LOG_FILTER_SQL, "SQL Query truncated (and not execute) for format: %s", format);
return false;
}
@@ -67,7 +67,7 @@ bool SQLQueryHolder::SetPreparedQuery(size_t index, PreparedStatement* stmt)
{
if (m_queries.size() <= index)
{
- sLog->outError("Query index (%zu) out of range (size: %u) for prepared statement", index, (uint32)m_queries.size());
+ sLog->outError(LOG_FILTER_SQL, "Query index (%u) out of range (size: %u) for prepared statement", uint32(index), (uint32)m_queries.size());
return false;
}
@@ -116,6 +116,12 @@ PreparedQueryResult SQLQueryHolder::GetPreparedResult(size_t index)
void SQLQueryHolder::SetResult(size_t index, ResultSet* result)
{
+ if (result && !result->GetRowCount())
+ {
+ delete result;
+ result = NULL;
+ }
+
/// store the result in the holder
if (index < m_queries.size())
m_queries[index].second.qresult = result;
@@ -123,6 +129,12 @@ void SQLQueryHolder::SetResult(size_t index, ResultSet* result)
void SQLQueryHolder::SetPreparedResult(size_t index, PreparedResultSet* result)
{
+ if (result && !result->GetRowCount())
+ {
+ delete result;
+ result = NULL;
+ }
+
/// store the result in the holder
if (index < m_queries.size())
m_queries[index].second.presult = result;
diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp
index 95034387089..cb21c088d00 100755
--- a/src/server/shared/Database/QueryResult.cpp
+++ b/src/server/shared/Database/QueryResult.cpp
@@ -59,7 +59,7 @@ m_length(NULL)
//- This is where we store the (entire) resultset
if (mysql_stmt_store_result(m_stmt))
{
- sLog->outSQLDriver("%s:mysql_stmt_store_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt));
+ sLog->outWarn(LOG_FILTER_SQL, "%s:mysql_stmt_store_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt));
return;
}
@@ -86,7 +86,7 @@ m_length(NULL)
//- This is where we bind the bind the buffer to the statement
if (mysql_stmt_bind_result(m_stmt, m_rBind))
{
- sLog->outSQLDriver("%s:mysql_stmt_bind_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt));
+ sLog->outWarn(LOG_FILTER_SQL, "%s:mysql_stmt_bind_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt));
delete[] m_rBind;
delete[] m_isNull;
delete[] m_length;
diff --git a/src/server/shared/Database/SQLOperation.h b/src/server/shared/Database/SQLOperation.h
index b911c1c92aa..401535e39f7 100755
--- a/src/server/shared/Database/SQLOperation.h
+++ b/src/server/shared/Database/SQLOperation.h
@@ -37,7 +37,7 @@ union SQLElementUnion
enum SQLElementDataType
{
SQL_ELEMENT_RAW,
- SQL_ELEMENT_PREPARED,
+ SQL_ELEMENT_PREPARED
};
//- The element
diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h
index 48a8bda32ed..6ce3d926f4c 100755
--- a/src/server/shared/Debugging/Errors.h
+++ b/src/server/shared/Debugging/Errors.h
@@ -24,10 +24,10 @@
#include <ace/Stack_Trace.h>
#include <ace/OS_NS_unistd.h>
-#define WPAssert(assertion) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError("\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } }
-#define WPError(assertion, errmsg) { if (!(assertion)) { sLog->outError("%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); *((volatile int*)NULL) = 0; } }
-#define WPWarning(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); } }
-#define WPFatal(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; } }
+#define WPAssert(assertion) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } }
+#define WPError(assertion, errmsg) { if (!(assertion)) { sLog->outError(LOG_FILTER_GENERAL, "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); *((volatile int*)NULL) = 0; } }
+#define WPWarning(assertion, errmsg) { if (!(assertion)) { sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); } }
+#define WPFatal(assertion, errmsg) { if (!(assertion)) { sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; } }
#define ASSERT WPAssert
#endif
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp
index febc5ef3573..96a115f8057 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.cpp
+++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp
@@ -409,11 +409,12 @@ void WheatyExceptionReport::printTracesForAllThreads()
CONTEXT context;
context.ContextFlags = 0xffffffff;
HANDLE threadHandle = OpenThread(THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION, false, te32.th32ThreadID);
- if (threadHandle && GetThreadContext(threadHandle, &context))
+ if (threadHandle)
{
- WriteStackDetails(&context, false, threadHandle);
+ if (GetThreadContext(threadHandle, &context))
+ WriteStackDetails(&context, false, threadHandle);
+ CloseHandle(threadHandle);
}
- CloseHandle(threadHandle);
}
} while (Thread32Next(hThreadSnap, &te32));
@@ -521,7 +522,7 @@ PEXCEPTION_POINTERS pExceptionInfo)
_tprintf(_T("Global Variables\r\n"));
SymEnumSymbols(GetCurrentProcess(),
- (DWORD64)GetModuleHandle(szFaultingModule),
+ (UINT_PTR)GetModuleHandle(szFaultingModule),
0, EnumerateSymbolsCallback, 0);
// #endif // X86 Only!
@@ -989,7 +990,7 @@ PVOID pAddress)
if (!IsBadStringPtr(*(PSTR*)pAddress, 32))
{
pszCurrBuffer += sprintf(pszCurrBuffer, " = \"%.31s\"",
- *(PDWORD)pAddress);
+ *(PSTR*)pAddress);
}
else
pszCurrBuffer += sprintf(pszCurrBuffer, " = %X",
diff --git a/src/server/shared/Dynamic/TypeContainerFunctions.h b/src/server/shared/Dynamic/TypeContainerFunctions.h
index 19ebfb3adfc..5011ec1c1be 100755
--- a/src/server/shared/Dynamic/TypeContainerFunctions.h
+++ b/src/server/shared/Dynamic/TypeContainerFunctions.h
@@ -36,7 +36,7 @@ namespace Trinity
template<class SPECIFIC_TYPE> size_t Count(const ContainerMapList<SPECIFIC_TYPE> &elements, SPECIFIC_TYPE* /*fake*/)
{
return elements._element.getSize();
- };
+ }
template<class SPECIFIC_TYPE> size_t Count(const ContainerMapList<TypeNull> &/*elements*/, SPECIFIC_TYPE* /*fake*/)
{
@@ -64,7 +64,7 @@ namespace Trinity
//elements._element[hdl] = obj;
obj->AddToGrid(elements._element);
return obj;
- };
+ }
template<class SPECIFIC_TYPE> SPECIFIC_TYPE* Insert(ContainerMapList<TypeNull> &/*elements*/, SPECIFIC_TYPE * /*obj*/)
{
diff --git a/src/server/shared/Dynamic/TypeContainerVisitor.h b/src/server/shared/Dynamic/TypeContainerVisitor.h
index beddb31f343..155989f15f6 100755
--- a/src/server/shared/Dynamic/TypeContainerVisitor.h
+++ b/src/server/shared/Dynamic/TypeContainerVisitor.h
@@ -35,7 +35,7 @@ template<class T, class Y> class TypeContainerVisitor;
template<class VISITOR, class TYPE_CONTAINER> void VisitorHelper(VISITOR &v, TYPE_CONTAINER &c)
{
v.Visit(c);
-};
+}
// terminate condition for container list
template<class VISITOR> void VisitorHelper(VISITOR &v, ContainerList<TypeNull> &c)
diff --git a/src/server/shared/Logging/Appender.cpp b/src/server/shared/Logging/Appender.cpp
new file mode 100644
index 00000000000..348ec4b3c7c
--- /dev/null
+++ b/src/server/shared/Logging/Appender.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Appender.h"
+#include "Common.h"
+
+std::string LogMessage::getTimeStr(time_t time)
+{
+ tm* aTm = localtime(&time);
+ char buf[20];
+ snprintf(buf, 20, "%04d-%02d-%02d_%02d:%02d:%02d", aTm->tm_year+1900, aTm->tm_mon+1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
+ return std::string(buf);
+}
+
+std::string LogMessage::getTimeStr()
+{
+ return getTimeStr(mtime);
+}
+
+Appender::Appender(uint8 _id, std::string const& _name, AppenderType _type /* = APPENDER_NONE*/, LogLevel _level /* = LOG_LEVEL_DISABLED */, AppenderFlags _flags /* = APPENDER_FLAGS_NONE */):
+id(_id), name(_name), type(_type), level(_level), flags(_flags)
+{
+}
+
+Appender::~Appender()
+{
+}
+
+uint8 Appender::getId() const
+{
+ return id;
+}
+
+std::string const& Appender::getName() const
+{
+ return name;
+}
+
+AppenderType Appender::getType() const
+{
+ return type;
+}
+
+LogLevel Appender::getLogLevel() const
+{
+ return level;
+}
+
+AppenderFlags Appender::getFlags() const
+{
+ return flags;
+}
+
+void Appender::setLogLevel(LogLevel _level)
+{
+ level = _level;
+}
+
+void Appender::write(LogMessage& message)
+{
+ if (!level || level > message.level)
+ {
+ //fprintf(stderr, "Appender::write: Appender %s, Level %s. Msg %s Level %s Type %s WRONG LEVEL MASK\n", getName().c_str(), getLogLevelString(level), message.text.c_str(), getLogLevelString(message.level), getLogFilterTypeString(message.type)); // DEBUG - RemoveMe
+ return;
+ }
+
+ message.prefix.clear();
+ if (flags & APPENDER_FLAGS_PREFIX_TIMESTAMP)
+ message.prefix.append(message.getTimeStr().c_str());
+
+ if (flags & APPENDER_FLAGS_PREFIX_LOGLEVEL)
+ {
+ if (!message.prefix.empty())
+ message.prefix.push_back(' ');
+
+ char text[MAX_QUERY_LEN];
+ snprintf(text, MAX_QUERY_LEN, "%-5s", Appender::getLogLevelString(message.level));
+ message.prefix.append(text);
+ }
+
+ if (flags & APPENDER_FLAGS_PREFIX_LOGFILTERTYPE)
+ {
+ if (!message.prefix.empty())
+ message.prefix.push_back(' ');
+
+ char text[MAX_QUERY_LEN];
+ snprintf(text, MAX_QUERY_LEN, "[%s]", Appender::getLogFilterTypeString(message.type));
+ message.prefix.append(text);
+ }
+
+ if (!message.prefix.empty())
+ message.prefix.push_back(' ');
+
+ _write(message);
+}
+
+const char* Appender::getLogLevelString(LogLevel level)
+{
+ switch (level)
+ {
+ case LOG_LEVEL_FATAL:
+ return "FATAL";
+ case LOG_LEVEL_ERROR:
+ return "ERROR";
+ case LOG_LEVEL_WARN:
+ return "WARN";
+ case LOG_LEVEL_INFO:
+ return "INFO";
+ case LOG_LEVEL_DEBUG:
+ return "DEBUG";
+ case LOG_LEVEL_TRACE:
+ return "TRACE";
+ default:
+ return "DISABLED";
+ }
+}
+
+char const* Appender::getLogFilterTypeString(LogFilterType type)
+{
+ switch (type)
+ {
+ case LOG_FILTER_GENERAL:
+ return "GENERAL";
+ case LOG_FILTER_UNITS:
+ return "UNITS";
+ case LOG_FILTER_PETS:
+ return "PETS";
+ case LOG_FILTER_VEHICLES:
+ return "VEHICLES";
+ case LOG_FILTER_TSCR:
+ return "TSCR";
+ case LOG_FILTER_DATABASE_AI:
+ return "DATABASE_AI";
+ case LOG_FILTER_MAPSCRIPTS:
+ return "MAPSCRIPTS";
+ case LOG_FILTER_NETWORKIO:
+ return "NETWORKIO";
+ case LOG_FILTER_SPELLS_AURAS:
+ return "SPELLS_AURAS";
+ case LOG_FILTER_ACHIEVEMENTSYS:
+ return "ACHIEVEMENTSYS";
+ case LOG_FILTER_CONDITIONSYS:
+ return "CONDITIONSYS";
+ case LOG_FILTER_POOLSYS:
+ return "POOLSYS";
+ case LOG_FILTER_AUCTIONHOUSE:
+ return "AUCTIONHOUSE";
+ case LOG_FILTER_BATTLEGROUND:
+ return "BATTLEGROUND";
+ case LOG_FILTER_OUTDOORPVP:
+ return "OUTDOORPVP";
+ case LOG_FILTER_CHATSYS:
+ return "CHATSYS";
+ case LOG_FILTER_LFG:
+ return "LFG";
+ case LOG_FILTER_MAPS:
+ return "MAPS";
+ case LOG_FILTER_PLAYER:
+ return "PLAYER";
+ case LOG_FILTER_PLAYER_LOADING:
+ return "PLAYER LOADING";
+ case LOG_FILTER_PLAYER_ITEMS:
+ return "PLAYER ITEMS";
+ case LOG_FILTER_PLAYER_SKILLS:
+ return "PLAYER SKILLS";
+ case LOG_FILTER_PLAYER_CHATLOG:
+ return "PLAYER CHATLOG";
+ case LOG_FILTER_LOOT:
+ return "LOOT";
+ case LOG_FILTER_GUILD:
+ return "GUILD";
+ case LOG_FILTER_TRANSPORTS:
+ return "TRANSPORTS";
+ case LOG_FILTER_SQL:
+ return "SQL";
+ case LOG_FILTER_GMCOMMAND:
+ return "GMCOMMAND";
+ case LOG_FILTER_REMOTECOMMAND:
+ return "REMOTECOMMAND";
+ case LOG_FILTER_WARDEN:
+ return "WARDEN";
+ case LOG_FILTER_AUTHSERVER:
+ return "AUTHSERVER";
+ case LOG_FILTER_WORLDSERVER:
+ return "WORLDSERVER";
+ case LOG_FILTER_GAMEEVENTS:
+ return "GAMEEVENTS";
+ case LOG_FILTER_CALENDAR:
+ return "CALENDAR";
+ case LOG_FILTER_CHARACTER:
+ return "CHARACTER";
+ case LOG_FILTER_ARENAS:
+ return "ARENAS";
+ case LOG_FILTER_SQL_DRIVER:
+ return "SQL DRIVER";
+ case LOG_FILTER_SQL_DEV:
+ return "SQL DEV";
+ case LOG_FILTER_PLAYER_DUMP:
+ return "PLAYER DUMP";
+ case LOG_FILTER_BATTLEFIELD:
+ return "BATTLEFIELD";
+ case LOG_FILTER_SERVER_LOADING:
+ return "SERVER LOADING";
+ case LOG_FILTER_OPCODES:
+ return "OPCODE";
+ default:
+ break;
+ }
+ return "???";
+}
diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h
new file mode 100644
index 00000000000..5c4b009ef67
--- /dev/null
+++ b/src/server/shared/Logging/Appender.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef APPENDER_H
+#define APPENDER_H
+
+#include "Define.h"
+#include <time.h>
+#include <string>
+#include <map>
+
+enum LogFilterType
+{
+ LOG_FILTER_GENERAL, // This one should only be used inside Log.cpp
+ LOG_FILTER_UNITS, // Anything related to units that doesn't fit in other categories. ie. creature formations
+ LOG_FILTER_PETS,
+ LOG_FILTER_VEHICLES,
+ LOG_FILTER_TSCR, // C++ AI, instance scripts, etc.
+ LOG_FILTER_DATABASE_AI, // SmartAI, EventAI, Creature* * AI
+ LOG_FILTER_MAPSCRIPTS,
+ LOG_FILTER_NETWORKIO,
+ LOG_FILTER_SPELLS_AURAS,
+ LOG_FILTER_ACHIEVEMENTSYS,
+ LOG_FILTER_CONDITIONSYS,
+ LOG_FILTER_POOLSYS,
+ LOG_FILTER_AUCTIONHOUSE,
+ LOG_FILTER_BATTLEGROUND,
+ LOG_FILTER_OUTDOORPVP,
+ LOG_FILTER_CHATSYS,
+ LOG_FILTER_LFG,
+ LOG_FILTER_MAPS,
+ LOG_FILTER_PLAYER, // Any player log that does not fit in other player filters
+ LOG_FILTER_PLAYER_LOADING, // Debug output from Player::_Load functions
+ LOG_FILTER_PLAYER_ITEMS,
+ LOG_FILTER_PLAYER_SKILLS,
+ LOG_FILTER_PLAYER_CHATLOG,
+ LOG_FILTER_LOOT,
+ LOG_FILTER_GUILD,
+ LOG_FILTER_TRANSPORTS,
+ LOG_FILTER_SQL,
+ LOG_FILTER_GMCOMMAND,
+ LOG_FILTER_REMOTECOMMAND,
+ LOG_FILTER_WARDEN,
+ LOG_FILTER_AUTHSERVER,
+ LOG_FILTER_WORLDSERVER,
+ LOG_FILTER_GAMEEVENTS,
+ LOG_FILTER_CALENDAR,
+ LOG_FILTER_CHARACTER,
+ LOG_FILTER_ARENAS,
+ LOG_FILTER_SQL_DRIVER,
+ LOG_FILTER_SQL_DEV,
+ LOG_FILTER_PLAYER_DUMP,
+ LOG_FILTER_BATTLEFIELD,
+ LOG_FILTER_SERVER_LOADING,
+ LOG_FILTER_OPCODES
+};
+
+const uint8 MaxLogFilter = uint8(LOG_FILTER_OPCODES) + 1;
+
+// Values assigned have their equivalent in enum ACE_Log_Priority
+enum LogLevel
+{
+ LOG_LEVEL_DISABLED = 0,
+ LOG_LEVEL_TRACE = 1,
+ LOG_LEVEL_DEBUG = 2,
+ LOG_LEVEL_INFO = 3,
+ LOG_LEVEL_WARN = 4,
+ LOG_LEVEL_ERROR = 5,
+ LOG_LEVEL_FATAL = 6
+};
+
+const uint8 MaxLogLevels = 6;
+
+enum AppenderType
+{
+ APPENDER_NONE,
+ APPENDER_CONSOLE,
+ APPENDER_FILE,
+ APPENDER_DB
+};
+
+enum AppenderFlags
+{
+ APPENDER_FLAGS_NONE = 0x00,
+ APPENDER_FLAGS_PREFIX_TIMESTAMP = 0x01,
+ APPENDER_FLAGS_PREFIX_LOGLEVEL = 0x02,
+ APPENDER_FLAGS_PREFIX_LOGFILTERTYPE = 0x04,
+ APPENDER_FLAGS_USE_TIMESTAMP = 0x08, // only used by FileAppender
+ APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10 // only used by FileAppender
+};
+
+struct LogMessage
+{
+ LogMessage(LogLevel _level, LogFilterType _type, std::string _text)
+ : level(_level)
+ , type(_type)
+ , text(_text)
+ {
+ mtime = time(NULL);
+ }
+
+ static std::string getTimeStr(time_t time);
+ std::string getTimeStr();
+
+ LogLevel level;
+ LogFilterType type;
+ std::string text;
+ std::string prefix;
+ std::string param1;
+ time_t mtime;
+};
+
+class Appender
+{
+ public:
+ Appender(uint8 _id, std::string const& name, AppenderType type = APPENDER_NONE, LogLevel level = LOG_LEVEL_DISABLED, AppenderFlags flags = APPENDER_FLAGS_NONE);
+ virtual ~Appender();
+
+ uint8 getId() const;
+ std::string const& getName() const;
+ AppenderType getType() const;
+ LogLevel getLogLevel() const;
+ AppenderFlags getFlags() const;
+
+ void setLogLevel(LogLevel);
+ void write(LogMessage& message);
+ static const char* getLogLevelString(LogLevel level);
+ static const char* getLogFilterTypeString(LogFilterType type);
+
+ private:
+ virtual void _write(LogMessage& /*message*/) = 0;
+
+ uint8 id;
+ std::string name;
+ AppenderType type;
+ LogLevel level;
+ AppenderFlags flags;
+};
+
+typedef std::map<uint8, Appender*> AppenderMap;
+
+#endif
diff --git a/src/server/shared/Logging/AppenderConsole.cpp b/src/server/shared/Logging/AppenderConsole.cpp
new file mode 100644
index 00000000000..be6dc6c807f
--- /dev/null
+++ b/src/server/shared/Logging/AppenderConsole.cpp
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "AppenderConsole.h"
+#include "Config.h"
+#include "Util.h"
+
+#include <sstream>
+
+AppenderConsole::AppenderConsole(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags):
+Appender(id, name, APPENDER_CONSOLE, level, flags), _colored(false)
+{
+ for (uint8 i = 0; i < MaxLogLevels; ++i)
+ _colors[i] = ColorTypes(MaxColors);
+}
+
+void AppenderConsole::InitColors(std::string const& str)
+{
+ if (str.empty())
+ {
+ _colored = false;
+ return;
+ }
+
+ int color[MaxLogLevels];
+
+ std::istringstream ss(str);
+
+ for (uint8 i = 0; i < MaxLogLevels; ++i)
+ {
+ ss >> color[i];
+
+ if (!ss)
+ return;
+
+ if (color[i] < 0 || color[i] >= MaxColors)
+ return;
+ }
+
+ for (uint8 i = 0; i < MaxLogLevels; ++i)
+ _colors[i] = ColorTypes(color[i]);
+
+ _colored = true;
+}
+
+void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
+{
+ #if PLATFORM == PLATFORM_WINDOWS
+ static WORD WinColorFG[MaxColors] =
+ {
+ 0, // BLACK
+ FOREGROUND_RED, // RED
+ FOREGROUND_GREEN, // GREEN
+ FOREGROUND_RED | FOREGROUND_GREEN, // BROWN
+ FOREGROUND_BLUE, // BLUE
+ FOREGROUND_RED | FOREGROUND_BLUE, // MAGENTA
+ FOREGROUND_GREEN | FOREGROUND_BLUE, // CYAN
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, // WHITE
+ // YELLOW
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY,
+ // RED_BOLD
+ FOREGROUND_RED | FOREGROUND_INTENSITY,
+ // GREEN_BOLD
+ FOREGROUND_GREEN | FOREGROUND_INTENSITY,
+ FOREGROUND_BLUE | FOREGROUND_INTENSITY, // BLUE_BOLD
+ // MAGENTA_BOLD
+ FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
+ // CYAN_BOLD
+ FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
+ // WHITE_BOLD
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
+ };
+
+ HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
+ SetConsoleTextAttribute(hConsole, WinColorFG[color]);
+ #else
+ enum ANSITextAttr
+ {
+ TA_NORMAL = 0,
+ TA_BOLD = 1,
+ TA_BLINK = 5,
+ TA_REVERSE = 7
+ };
+
+ enum ANSIFgTextAttr
+ {
+ FG_BLACK = 30,
+ FG_RED,
+ FG_GREEN,
+ FG_BROWN,
+ FG_BLUE,
+ FG_MAGENTA,
+ FG_CYAN,
+ FG_WHITE,
+ FG_YELLOW
+ };
+
+ enum ANSIBgTextAttr
+ {
+ BG_BLACK = 40,
+ BG_RED,
+ BG_GREEN,
+ BG_BROWN,
+ BG_BLUE,
+ BG_MAGENTA,
+ BG_CYAN,
+ BG_WHITE
+ };
+
+ static uint8 UnixColorFG[MaxColors] =
+ {
+ FG_BLACK, // BLACK
+ FG_RED, // RED
+ FG_GREEN, // GREEN
+ FG_BROWN, // BROWN
+ FG_BLUE, // BLUE
+ FG_MAGENTA, // MAGENTA
+ FG_CYAN, // CYAN
+ FG_WHITE, // WHITE
+ FG_YELLOW, // YELLOW
+ FG_RED, // LRED
+ FG_GREEN, // LGREEN
+ FG_BLUE, // LBLUE
+ FG_MAGENTA, // LMAGENTA
+ FG_CYAN, // LCYAN
+ FG_WHITE // LWHITE
+ };
+
+ fprintf((stdout_stream? stdout : stderr), "\x1b[%d%sm", UnixColorFG[color], (color >= YELLOW && color < MaxColors ? ";1" : ""));
+ #endif
+}
+
+void AppenderConsole::ResetColor(bool stdout_stream)
+{
+ #if PLATFORM == PLATFORM_WINDOWS
+ HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
+ SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
+ #else
+ fprintf((stdout_stream ? stdout : stderr), "\x1b[0m");
+ #endif
+}
+
+void AppenderConsole::_write(LogMessage& message)
+{
+ bool stdout_stream = message.level == LOG_LEVEL_ERROR || message.level == LOG_LEVEL_FATAL;
+
+ if (_colored)
+ {
+ uint8 index;
+ switch (message.level)
+ {
+ case LOG_LEVEL_TRACE:
+ index = 5;
+ break;
+ case LOG_LEVEL_DEBUG:
+ index = 4;
+ break;
+ case LOG_LEVEL_INFO:
+ index = 3;
+ break;
+ case LOG_LEVEL_WARN:
+ index = 2;
+ break;
+ case LOG_LEVEL_FATAL:
+ index = 0;
+ break;
+ case LOG_LEVEL_ERROR: // No break on purpose
+ default:
+ index = 1;
+ break;
+ }
+
+ SetColor(stdout_stream, _colors[index]);
+ utf8printf(stdout_stream ? stdout : stderr, "%s%s", message.prefix.c_str(), message.text.c_str());
+ ResetColor(stdout_stream);
+ }
+ else
+ utf8printf(stdout_stream ? stdout : stderr, "%s%s", message.prefix.c_str(), message.text.c_str());
+}
diff --git a/src/server/shared/Logging/AppenderConsole.h b/src/server/shared/Logging/AppenderConsole.h
new file mode 100644
index 00000000000..ad7d9543cdb
--- /dev/null
+++ b/src/server/shared/Logging/AppenderConsole.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef APPENDERCONSOLE_H
+#define APPENDERCONSOLE_H
+
+#include "Appender.h"
+#include <string>
+
+enum ColorTypes
+{
+ BLACK,
+ RED,
+ GREEN,
+ BROWN,
+ BLUE,
+ MAGENTA,
+ CYAN,
+ GREY,
+ YELLOW,
+ LRED,
+ LGREEN,
+ LBLUE,
+ LMAGENTA,
+ LCYAN,
+ WHITE
+};
+
+const uint8 MaxColors = uint8(WHITE) + 1;
+
+class AppenderConsole: public Appender
+{
+ public:
+ AppenderConsole(uint8 _id, std::string const& name, LogLevel level, AppenderFlags flags);
+ void InitColors(const std::string& init_str);
+
+ private:
+ void SetColor(bool stdout_stream, ColorTypes color);
+ void ResetColor(bool stdout_stream);
+ void _write(LogMessage& message);
+ bool _colored;
+ ColorTypes _colors[MaxLogLevels];
+};
+
+#endif
diff --git a/src/server/shared/Logging/AppenderDB.cpp b/src/server/shared/Logging/AppenderDB.cpp
new file mode 100644
index 00000000000..d85a4db9f7a
--- /dev/null
+++ b/src/server/shared/Logging/AppenderDB.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "AppenderDB.h"
+#include "Database/DatabaseEnv.h"
+
+AppenderDB::AppenderDB(uint8 id, std::string const& name, LogLevel level, uint8 realmId):
+Appender(id, name, APPENDER_DB, level), realm(realmId), enable(false)
+{
+}
+
+AppenderDB::~AppenderDB()
+{
+}
+
+void AppenderDB::_write(LogMessage& message)
+{
+ if (!enable)
+ return;
+ switch (message.type)
+ {
+ case LOG_FILTER_SQL:
+ case LOG_FILTER_SQL_DRIVER:
+ case LOG_FILTER_SQL_DEV:
+ break; // Avoid infinite loop, PExecute triggers Logging with LOG_FILTER_SQL type
+ default:
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
+ stmt->setUInt64(0, message.mtime);
+ stmt->setUInt32(1, realm);
+ stmt->setUInt8(2, message.type);
+ stmt->setUInt8(3, message.level);
+ stmt->setString(4, message.text);
+ LoginDatabase.Execute(stmt);
+ break;
+ }
+}
+
+void AppenderDB::setEnable(bool _enable)
+{
+ enable = _enable;
+}
diff --git a/src/server/shared/Logging/AppenderDB.h b/src/server/shared/Logging/AppenderDB.h
new file mode 100644
index 00000000000..4399195b181
--- /dev/null
+++ b/src/server/shared/Logging/AppenderDB.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef APPENDERDB_H
+#define APPENDERDB_H
+
+#include "Appender.h"
+
+class AppenderDB: public Appender
+{
+ public:
+ AppenderDB(uint8 _id, std::string const& _name, LogLevel level, uint8 realmId);
+ ~AppenderDB();
+ void setEnable(bool enable);
+
+ private:
+ uint8 realm;
+ bool enable;
+ void _write(LogMessage& message);
+};
+
+#endif
diff --git a/src/server/shared/Logging/AppenderFile.cpp b/src/server/shared/Logging/AppenderFile.cpp
new file mode 100644
index 00000000000..67adff39aae
--- /dev/null
+++ b/src/server/shared/Logging/AppenderFile.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "AppenderFile.h"
+#include "Common.h"
+
+AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, const char* _filename, const char* _logDir, const char* _mode, AppenderFlags _flags)
+ : Appender(id, name, APPENDER_FILE, level, _flags)
+ , filename(_filename)
+ , logDir(_logDir)
+ , mode(_mode)
+{
+ dynamicName = std::string::npos != filename.find("%s");
+ backup = _flags & APPENDER_FLAGS_MAKE_FILE_BACKUP;
+
+ logfile = !dynamicName ? OpenFile(_filename, _mode, backup) : NULL;
+}
+
+AppenderFile::~AppenderFile()
+{
+ if (logfile)
+ {
+ fclose(logfile);
+ logfile = NULL;
+ }
+}
+
+void AppenderFile::_write(LogMessage& message)
+{
+ if (dynamicName)
+ {
+ char namebuf[TRINITY_PATH_MAX];
+ snprintf(namebuf, TRINITY_PATH_MAX, filename.c_str(), message.param1.c_str());
+ logfile = OpenFile(namebuf, mode, backup);
+ }
+
+ if (logfile)
+ {
+ fprintf(logfile, "%s%s", message.prefix.c_str(), message.text.c_str());
+ fflush(logfile);
+
+ if (dynamicName)
+ {
+ fclose(logfile);
+ logfile = NULL;
+ }
+ }
+}
+
+FILE* AppenderFile::OpenFile(std::string const &filename, std::string const &mode, bool backup)
+{
+ if (mode == "w" && backup)
+ {
+ std::string newName(filename);
+ newName.push_back('.');
+ newName.append(LogMessage::getTimeStr(time(NULL)));
+ rename(filename.c_str(), newName.c_str()); // no error handling... if we couldn't make a backup, just ignore
+ }
+ return fopen((logDir + filename).c_str(), mode.c_str());
+}
diff --git a/src/server/shared/Logging/AppenderFile.h b/src/server/shared/Logging/AppenderFile.h
new file mode 100644
index 00000000000..e9cb858f625
--- /dev/null
+++ b/src/server/shared/Logging/AppenderFile.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef APPENDERFILE_H
+#define APPENDERFILE_H
+
+#include "Appender.h"
+
+class AppenderFile: public Appender
+{
+ public:
+ AppenderFile(uint8 _id, std::string const& _name, LogLevel level, const char* filename, const char* logDir, const char* mode, AppenderFlags flags);
+ ~AppenderFile();
+ FILE* OpenFile(std::string const& _name, std::string const& _mode, bool _backup);
+
+ private:
+ void _write(LogMessage& message);
+ FILE* logfile;
+ std::string filename;
+ std::string logDir;
+ std::string mode;
+ bool dynamicName;
+ bool backup;
+};
+
+#endif
diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp
index 79eab053d08..ed65104d6ac 100755
--- a/src/server/shared/Logging/Log.cpp
+++ b/src/server/shared/Logging/Log.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,343 +16,274 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
#include "Log.h"
-#include "Configuration/Config.h"
+#include "Common.h"
+#include "Config.h"
#include "Util.h"
+#include "AppenderConsole.h"
+#include "AppenderFile.h"
+#include "AppenderDB.h"
+#include "LogOperation.h"
-#include "Implementation/LoginDatabase.h" // For logging
-extern LoginDatabaseWorkerPool LoginDatabase;
-
-#include <stdarg.h>
-#include <stdio.h>
+#include <cstdarg>
+#include <cstdio>
+#include <sstream>
-Log::Log() :
- raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL),
- dberLogfile(NULL), chatLogfile(NULL), arenaLogFile(NULL), sqlLogFile(NULL), sqlDevLogFile(NULL), wardenLogFile(NULL),
- m_gmlog_per_account(false), m_enableLogDBLater(false),
- m_enableLogDB(false), m_colored(false)
+Log::Log() : worker(NULL)
{
- Initialize();
+ SetRealmID(0);
+ m_logsTimestamp = "_" + GetTimestampStr();
+ LoadFromConfig();
}
Log::~Log()
{
- if (logfile != NULL)
- fclose(logfile);
- logfile = NULL;
-
- if (gmLogfile != NULL)
- fclose(gmLogfile);
- gmLogfile = NULL;
-
- if (charLogfile != NULL)
- fclose(charLogfile);
- charLogfile = NULL;
-
- if (dberLogfile != NULL)
- fclose(dberLogfile);
- dberLogfile = NULL;
-
- if (raLogfile != NULL)
- fclose(raLogfile);
- raLogfile = NULL;
-
- if (chatLogfile != NULL)
- fclose(chatLogfile);
- chatLogfile = NULL;
-
- if (arenaLogFile != NULL)
- fclose(arenaLogFile);
- arenaLogFile = NULL;
-
- if (sqlLogFile != NULL)
- fclose(sqlLogFile);
- sqlLogFile = NULL;
-
- if (sqlDevLogFile != NULL)
- fclose(sqlDevLogFile);
- sqlDevLogFile = NULL;
+ Close();
+}
- if (wardenLogFile != NULL)
- fclose(wardenLogFile);
- wardenLogFile = NULL;
+uint8 Log::NextAppenderId()
+{
+ return AppenderId++;
}
-void Log::SetLogLevel(char *Level)
+int32 GetConfigIntDefault(std::string base, const char* name, int32 value)
{
- int32 NewLevel = atoi((char*)Level);
- if (NewLevel < 0)
- NewLevel = 0;
- m_logLevel = NewLevel;
+ base.append(name);
+ return ConfigMgr::GetIntDefault(base.c_str(), value);
+}
- outString("LogLevel is %u", m_logLevel);
+std::string GetConfigStringDefault(std::string base, const char* name, const char* value)
+{
+ base.append(name);
+ return ConfigMgr::GetStringDefault(base.c_str(), value);
}
-void Log::SetLogFileLevel(char *Level)
+// Returns default logger if the requested logger is not found
+Logger* Log::GetLoggerByType(LogFilterType filter)
{
- int32 NewLevel = atoi((char*)Level);
- if (NewLevel < 0)
- NewLevel = 0;
- m_logFileLevel = NewLevel;
+ LoggerMap::iterator it = loggers.begin();
+ while (it != loggers.end() && it->second.getType() != filter)
+ ++it;
- outString("LogFileLevel is %u", m_logFileLevel);
+ return it == loggers.end() ? &(loggers[0]) : &(it->second);
}
-void Log::SetDBLogLevel(char *Level)
+Appender* Log::GetAppenderByName(std::string const& name)
{
- int32 NewLevel = atoi((char*)Level);
- if (NewLevel < 0)
- NewLevel = 0;
- m_dbLogLevel = NewLevel;
+ AppenderMap::iterator it = appenders.begin();
+ while (it != appenders.end() && it->second && it->second->getName() != name)
+ ++it;
- outString("DBLogLevel is %u", m_dbLogLevel);
+ return it == appenders.end() ? NULL : it->second;
}
-void Log::Initialize()
+void Log::CreateAppenderFromConfig(const char* name)
{
- /// Check whether we'll log GM commands/RA events/character outputs/chat stuffs
- m_dbChar = ConfigMgr::GetBoolDefault("LogDB.Char", false);
- m_dbRA = ConfigMgr::GetBoolDefault("LogDB.RA", false);
- m_dbGM = ConfigMgr::GetBoolDefault("LogDB.GM", false);
- m_dbChat = ConfigMgr::GetBoolDefault("LogDB.Chat", false);
+ if (!name || *name == '\0')
+ return;
- /// Realm must be 0 by default
- SetRealmID(0);
+ // Format=type,level,flags,optional1,optional2
+ // if type = File. optional1 = file and option2 = mode
+ // if type = Console. optional1 = Color
+ std::string options = "Appender.";
+ options.append(name);
+ options = ConfigMgr::GetStringDefault(options.c_str(), "");
+ Tokens tokens(options, ',');
+ Tokens::iterator iter = tokens.begin();
- /// Common log files data
- m_logsDir = ConfigMgr::GetStringDefault("LogsDir", "");
- if (!m_logsDir.empty())
- if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\'))
- m_logsDir.push_back('/');
+ if (tokens.size() < 2)
+ {
+ fprintf(stderr, "Log::CreateAppenderFromConfig: Wrong configuration for appender %s. Config line: %s\n", name, options.c_str());
+ return;
+ }
- m_logsTimestamp = "_" + GetTimestampStr();
+ AppenderFlags flags = APPENDER_FLAGS_NONE;
+ AppenderType type = AppenderType(atoi(*iter));
+ ++iter;
+ LogLevel level = LogLevel(atoi(*iter));
+ if (level > LOG_LEVEL_FATAL)
+ {
+ fprintf(stderr, "Log::CreateAppenderFromConfig: Wrong Log Level %d for appender %s\n", level, name);
+ return;
+ }
- /// Open specific log files
- logfile = openLogFile("LogFile", "LogTimestamp", "w");
- InitColors(ConfigMgr::GetStringDefault("LogColors", ""));
+ if (++iter != tokens.end())
+ flags = AppenderFlags(atoi(*iter));
- m_gmlog_per_account = ConfigMgr::GetBoolDefault("GmLogPerAccount", false);
- if (!m_gmlog_per_account)
- gmLogfile = openLogFile("GMLogFile", "GmLogTimestamp", "a");
- else
+ switch (type)
{
- // GM log settings for per account case
- m_gmlog_filename_format = ConfigMgr::GetStringDefault("GMLogFile", "");
- if (!m_gmlog_filename_format.empty())
+ case APPENDER_CONSOLE:
{
- bool m_gmlog_timestamp = ConfigMgr::GetBoolDefault("GmLogTimestamp", false);
+ AppenderConsole* appender = new AppenderConsole(NextAppenderId(), name, level, flags);
+ appenders[appender->getId()] = appender;
+ if (++iter != tokens.end())
+ appender->InitColors(*iter);
+ //fprintf(stdout, "Log::CreateAppenderFromConfig: Created Appender %s (%u), Type CONSOLE, Mask %u\n", appender->getName().c_str(), appender->getId(), appender->getLogLevel()); // DEBUG - RemoveMe
+ break;
+ }
+ case APPENDER_FILE:
+ {
+ std::string filename;
+ std::string mode = "a";
- size_t dot_pos = m_gmlog_filename_format.find_last_of('.');
- if (dot_pos!=m_gmlog_filename_format.npos)
+ if (++iter == tokens.end())
{
- if (m_gmlog_timestamp)
- m_gmlog_filename_format.insert(dot_pos, m_logsTimestamp);
-
- m_gmlog_filename_format.insert(dot_pos, "_#%u");
+ fprintf(stderr, "Log::CreateAppenderFromConfig: Missing file name for appender %s\n", name);
+ return;
}
- else
- {
- m_gmlog_filename_format += "_#%u";
- if (m_gmlog_timestamp)
- m_gmlog_filename_format += m_logsTimestamp;
+ filename = *iter;
+
+ if (++iter != tokens.end())
+ mode = *iter;
+
+ if (flags & APPENDER_FLAGS_USE_TIMESTAMP)
+ {
+ size_t dot_pos = filename.find_last_of(".");
+ if (dot_pos != filename.npos)
+ filename.insert(dot_pos, m_logsTimestamp);
+ else
+ filename += m_logsTimestamp;
}
- m_gmlog_filename_format = m_logsDir + m_gmlog_filename_format;
+ uint8 id = NextAppenderId();
+ appenders[id] = new AppenderFile(id, name, level, filename.c_str(), m_logsDir.c_str(), mode.c_str(), flags);
+ //fprintf(stdout, "Log::CreateAppenderFromConfig: Created Appender %s (%u), Type FILE, Mask %u, File %s, Mode %s\n", name, id, level, filename.c_str(), mode.c_str()); // DEBUG - RemoveMe
+ break;
}
- }
-
- charLogfile = openLogFile("CharLogFile", "CharLogTimestamp", "a");
- dberLogfile = openLogFile("DBErrorLogFile", NULL, "a");
- raLogfile = openLogFile("RaLogFile", NULL, "a");
- chatLogfile = openLogFile("ChatLogFile", "ChatLogTimestamp", "a");
- arenaLogFile = openLogFile("ArenaLogFile", NULL, "a");
- sqlLogFile = openLogFile("SQLDriverLogFile", NULL, "a");
- sqlDevLogFile = openLogFile("SQLDeveloperLogFile", NULL, "a");
- wardenLogFile = openLogFile("Warden.LogFile",NULL,"a");
-
- // Main log file settings
- m_logLevel = ConfigMgr::GetIntDefault("LogLevel", LOGL_NORMAL);
- m_logFileLevel = ConfigMgr::GetIntDefault("LogFileLevel", LOGL_NORMAL);
- m_dbLogLevel = ConfigMgr::GetIntDefault("DBLogLevel", LOGL_NORMAL);
- m_sqlDriverQueryLogging = ConfigMgr::GetBoolDefault("SQLDriverQueryLogging", false);
-
- m_DebugLogMask = DebugLogFilters(ConfigMgr::GetIntDefault("DebugLogMask", LOG_FILTER_NONE));
-
- // Char log settings
- m_charLog_Dump = ConfigMgr::GetBoolDefault("CharLogDump", false);
- m_charLog_Dump_Separate = ConfigMgr::GetBoolDefault("CharLogDump.Separate", false);
- if (m_charLog_Dump_Separate)
- {
- m_dumpsDir = ConfigMgr::GetStringDefault("CharLogDump.SeparateDir", "");
- if (!m_dumpsDir.empty())
- if ((m_dumpsDir.at(m_dumpsDir.length() - 1) != '/') && (m_dumpsDir.at(m_dumpsDir.length() - 1) != '\\'))
- m_dumpsDir.push_back('/');
+ case APPENDER_DB:
+ {
+ uint8 id = NextAppenderId();
+ appenders[id] = new AppenderDB(id, name, level, realm);
+ break;
+ }
+ default:
+ fprintf(stderr, "Log::CreateAppenderFromConfig: Unknown type %d for appender %s\n", type, name);
+ break;
}
}
-void Log::ReloadConfig()
+void Log::CreateLoggerFromConfig(const char* name)
{
- m_logLevel = ConfigMgr::GetIntDefault("LogLevel", LOGL_NORMAL);
- m_logFileLevel = ConfigMgr::GetIntDefault("LogFileLevel", LOGL_NORMAL);
- m_dbLogLevel = ConfigMgr::GetIntDefault("DBLogLevel", LOGL_NORMAL);
+ if (!name || *name == '\0')
+ return;
- m_DebugLogMask = DebugLogFilters(ConfigMgr::GetIntDefault("DebugLogMask", LOG_FILTER_NONE));
-}
+ LogLevel level = LOG_LEVEL_DISABLED;
+ int32 type = -1;
-FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFlag, char const* mode)
-{
- std::string logfn=ConfigMgr::GetStringDefault(configFileName, "");
- if (logfn.empty())
- return NULL;
+ std::string options = "Logger.";
+ options.append(name);
+ options = ConfigMgr::GetStringDefault(options.c_str(), "");
- if (configTimeStampFlag && ConfigMgr::GetBoolDefault(configTimeStampFlag, false))
+ if (options.empty())
{
- size_t dot_pos = logfn.find_last_of(".");
- if (dot_pos!=logfn.npos)
- logfn.insert(dot_pos, m_logsTimestamp);
- else
- logfn += m_logsTimestamp;
+ fprintf(stderr, "Log::CreateLoggerFromConfig: Missing config option Logger.%s\n", name);
+ return;
}
- return fopen((m_logsDir+logfn).c_str(), mode);
-}
+ Tokens tokens(options, ',');
+ Tokens::iterator iter = tokens.begin();
-FILE* Log::openGmlogPerAccount(uint32 account)
-{
- if (m_gmlog_filename_format.empty())
- return NULL;
+ if (tokens.size() != 3)
+ {
+ fprintf(stderr, "Log::CreateLoggerFromConfig: Wrong config option Logger.%s=%s\n", name, options.c_str());
+ return;
+ }
- char namebuf[TRINITY_PATH_MAX];
- snprintf(namebuf, TRINITY_PATH_MAX, m_gmlog_filename_format.c_str(), account);
- return fopen(namebuf, "a");
-}
+ type = atoi(*iter);
+ if (type > MaxLogFilter)
+ {
+ fprintf(stderr, "Log::CreateLoggerFromConfig: Wrong type %u for logger %s\n", type, name);
+ return;
+ }
-void Log::outTimestamp(FILE* file)
-{
- time_t t = time(NULL);
- tm* aTm = localtime(&t);
- // YYYY year
- // MM month (2 digits 01-12)
- // DD day (2 digits 01-31)
- // HH hour (2 digits 00-23)
- // MM minutes (2 digits 00-59)
- // SS seconds (2 digits 00-59)
- fprintf(file, "%-4d-%02d-%02d %02d:%02d:%02d ", aTm->tm_year+1900, aTm->tm_mon+1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
-}
+ Logger& logger = loggers[type];
+ if (!logger.getName().empty())
+ {
+ fprintf(stderr, "Error while configuring Logger %s. Already defined\n", name);
+ return;
+ }
-void Log::InitColors(const std::string& str)
-{
- if (str.empty())
+ ++iter;
+ level = LogLevel(atoi(*iter));
+ if (level > LOG_LEVEL_FATAL)
{
- m_colored = false;
+ fprintf(stderr, "Log::CreateLoggerFromConfig: Wrong Log Level %u for logger %s\n", type, name);
return;
}
- int color[4];
+ logger.Create(name, LogFilterType(type), level);
+ //fprintf(stdout, "Log::CreateLoggerFromConfig: Created Logger %s, Type %u, mask %u\n", name, LogFilterType(type), level); // DEBUG - RemoveMe
- std::istringstream ss(str);
+ ++iter;
+ std::istringstream ss(*iter);
+ std::string str;
- for (uint8 i = 0; i < LogLevels; ++i)
+ ss >> str;
+ while (ss)
{
- ss >> color[i];
-
- if (!ss)
- return;
-
- if (color[i] < 0 || color[i] >= Colors)
- return;
+ if (Appender* appender = GetAppenderByName(str))
+ {
+ logger.addAppender(appender->getId(), appender);
+ //fprintf(stdout, "Log::CreateLoggerFromConfig: Added Appender %s to Logger %s\n", appender->getName().c_str(), name); // DEBUG - RemoveMe
+ }
+ else
+ fprintf(stderr, "Error while configuring Appender %s in Logger %s. Appender does not exist", str.c_str(), name);
+ ss >> str;
}
+}
- for (uint8 i = 0; i < LogLevels; ++i)
- m_colors[i] = ColorTypes(color[i]);
+void Log::ReadAppendersFromConfig()
+{
+ std::istringstream ss(ConfigMgr::GetStringDefault("Appenders", ""));
+ std::string name;
- m_colored = true;
+ do
+ {
+ ss >> name;
+ CreateAppenderFromConfig(name.c_str());
+ name = "";
+ }
+ while (ss);
}
-void Log::SetColor(bool stdout_stream, ColorTypes color)
+void Log::ReadLoggersFromConfig()
{
- #if PLATFORM == PLATFORM_WINDOWS
- static WORD WinColorFG[Colors] =
- {
- 0, // BLACK
- FOREGROUND_RED, // RED
- FOREGROUND_GREEN, // GREEN
- FOREGROUND_RED | FOREGROUND_GREEN, // BROWN
- FOREGROUND_BLUE, // BLUE
- FOREGROUND_RED | FOREGROUND_BLUE, // MAGENTA
- FOREGROUND_GREEN | FOREGROUND_BLUE, // CYAN
- FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, // WHITE
- // YELLOW
- FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- // RED_BOLD
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- // GREEN_BOLD
- FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- FOREGROUND_BLUE | FOREGROUND_INTENSITY, // BLUE_BOLD
- // MAGENTA_BOLD
- FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- // CYAN_BOLD
- FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- // WHITE_BOLD
- FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
- };
-
- HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE );
- SetConsoleTextAttribute(hConsole, WinColorFG[color]);
- #else
- enum ANSITextAttr
- {
- TA_NORMAL=0,
- TA_BOLD=1,
- TA_BLINK=5,
- TA_REVERSE=7
- };
+ std::istringstream ss(ConfigMgr::GetStringDefault("Loggers", ""));
+ std::string name;
- enum ANSIFgTextAttr
+ do
{
- FG_BLACK=30, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE,
- FG_MAGENTA, FG_CYAN, FG_WHITE, FG_YELLOW
- };
+ ss >> name;
+ CreateLoggerFromConfig(name.c_str());
+ name = "";
+ }
+ while (ss);
- enum ANSIBgTextAttr
- {
- BG_BLACK=40, BG_RED, BG_GREEN, BG_BROWN, BG_BLUE,
- BG_MAGENTA, BG_CYAN, BG_WHITE
- };
+ // root logger must exist. Marking as disabled as its not configured
+ if (loggers.find(LOG_FILTER_GENERAL) == loggers.end())
+ loggers[LOG_FILTER_GENERAL].Create("root", LOG_FILTER_GENERAL, LOG_LEVEL_DISABLED);
+}
- static uint8 UnixColorFG[Colors] =
- {
- FG_BLACK, // BLACK
- FG_RED, // RED
- FG_GREEN, // GREEN
- FG_BROWN, // BROWN
- FG_BLUE, // BLUE
- FG_MAGENTA, // MAGENTA
- FG_CYAN, // CYAN
- FG_WHITE, // WHITE
- FG_YELLOW, // YELLOW
- FG_RED, // LRED
- FG_GREEN, // LGREEN
- FG_BLUE, // LBLUE
- FG_MAGENTA, // LMAGENTA
- FG_CYAN, // LCYAN
- FG_WHITE // LWHITE
- };
-
- fprintf((stdout_stream? stdout : stderr), "\x1b[%d%sm", UnixColorFG[color], (color >= YELLOW && color < Colors ? ";1" : ""));
- #endif
+void Log::EnableDBAppenders()
+{
+ for (AppenderMap::iterator it = appenders.begin(); it != appenders.end(); ++it)
+ if (it->second && it->second->getType() == APPENDER_DB)
+ ((AppenderDB *)it->second)->setEnable(true);
}
-void Log::ResetColor(bool stdout_stream)
+void Log::vlog(LogFilterType filter, LogLevel level, char const* str, va_list argptr)
{
- #if PLATFORM == PLATFORM_WINDOWS
- HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE );
- SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED );
- #else
- fprintf(( stdout_stream ? stdout : stderr ), "\x1b[0m");
- #endif
+ char text[MAX_QUERY_LEN];
+ vsnprintf(text, MAX_QUERY_LEN, str, argptr);
+ write(new LogMessage(level, filter, text));
+}
+
+void Log::write(LogMessage* msg)
+{
+ msg->text.append("\n");
+ Logger* logger = GetLoggerByType(msg->type);
+ worker->enqueue(new LogOperation(logger, msg));
}
std::string Log::GetTimestampStr()
@@ -370,710 +301,192 @@ std::string Log::GetTimestampStr()
return std::string(buf);
}
-void Log::outDB(LogTypes type, const char * str)
-{
- if (!str || type >= MAX_LOG_TYPES)
- return;
-
- std::string logStr(str);
- if (logStr.empty())
- return;
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
-
- stmt->setInt32(0, realm);
- stmt->setUInt8(1, uint8(type));
- stmt->setString(2, logStr);
-
- LoginDatabase.Execute(stmt);
-}
-
-void Log::outString(const char * str, ...)
+bool Log::SetLogLevel(std::string const& name, const char* newLevelc, bool isLogger /* = true */)
{
- if (!str)
- return;
-
- if (m_enableLogDB)
- {
- // we don't want empty strings in the DB
- std::string s(str);
- if (s.empty() || s == " ")
- return;
-
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_STRING, nnew_str);
- va_end(ap2);
- }
-
- if (m_colored)
- SetColor(true, m_colors[LOGL_NORMAL]);
-
- va_list ap;
-
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(true);
-
- printf("\n");
- if (logfile)
- {
- outTimestamp(logfile);
- va_start(ap, str);
- vfprintf(logfile, str, ap);
- fprintf(logfile, "\n");
- va_end(ap);
-
- fflush(logfile);
- }
- fflush(stdout);
-}
+ LogLevel newLevel = LogLevel(atoi(newLevelc));
+ if (newLevel < 0)
+ return false;
-void Log::outString()
-{
- printf("\n");
- if (logfile)
+ if (isLogger)
{
- outTimestamp(logfile);
- fprintf(logfile, "\n");
- fflush(logfile);
- }
- fflush(stdout);
-}
+ LoggerMap::iterator it = loggers.begin();
+ while (it != loggers.end() && it->second.getName() != name)
+ ++it;
-void Log::outCrash(const char * err, ...)
-{
- if (!err)
- return;
+ if (it == loggers.end())
+ return false;
- if (m_enableLogDB)
- {
- va_list ap2;
- va_start(ap2, err);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, err, ap2);
- outDB(LOG_TYPE_CRASH, nnew_str);
- va_end(ap2);
+ it->second.setLogLevel(newLevel);
}
-
- if (m_colored)
- SetColor(false, LRED);
-
- va_list ap;
-
- va_start(ap, err);
- vutf8printf(stderr, err, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(false);
-
- fprintf(stderr, "\n");
- if (logfile)
+ else
{
- outTimestamp(logfile);
- fprintf(logfile, "CRASH ALERT: ");
-
- va_start(ap, err);
- vfprintf(logfile, err, ap);
- va_end(ap);
+ Appender* appender = GetAppenderByName(name);
+ if (!appender)
+ return false;
- fprintf(logfile, "\n");
- fflush(logfile);
+ appender->setLogLevel(newLevel);
}
- fflush(stderr);
+ return true;
}
-void Log::outError(const char * err, ...)
+bool Log::ShouldLog(LogFilterType type, LogLevel level) const
{
- if (!err)
- return;
-
- if (m_enableLogDB)
- {
- va_list ap2;
- va_start(ap2, err);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, err, ap2);
- outDB(LOG_TYPE_ERROR, nnew_str);
- va_end(ap2);
- }
-
- if (m_colored)
- SetColor(false, LRED);
-
- va_list ap;
-
- va_start(ap, err);
- vutf8printf(stderr, err, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(false);
-
- fprintf( stderr, "\n");
- if (logfile)
+ LoggerMap::const_iterator it = loggers.find(type);
+ if (it != loggers.end())
{
- outTimestamp(logfile);
- fprintf(logfile, "ERROR: ");
-
- va_start(ap, err);
- vfprintf(logfile, err, ap);
- va_end(ap);
-
- fprintf(logfile, "\n");
- fflush(logfile);
+ LogLevel loggerLevel = it->second.getLogLevel();
+ return loggerLevel && loggerLevel <= level;
}
- fflush(stderr);
-}
-void Log::outArena(const char * str, ...)
-{
- if (!str)
- return;
+ if (type != LOG_FILTER_GENERAL)
+ return ShouldLog(LOG_FILTER_GENERAL, level);
- if (arenaLogFile)
- {
- va_list ap;
- outTimestamp(arenaLogFile);
- va_start(ap, str);
- vfprintf(arenaLogFile, str, ap);
- fprintf(arenaLogFile, "\n");
- va_end(ap);
- fflush(arenaLogFile);
- }
+ return false;
}
-void Log::outSQLDriver(const char* str, ...)
+void Log::outTrace(LogFilterType filter, const char * str, ...)
{
- if (!str)
+ if (!str || !ShouldLog(filter, LOG_LEVEL_TRACE))
return;
va_list ap;
va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
-
- printf("\n");
-
- if (sqlLogFile)
- {
- outTimestamp(sqlLogFile);
-
- va_list apSQL;
- va_start(apSQL, str);
- vfprintf(sqlLogFile, str, apSQL);
- va_end(apSQL);
- fprintf(sqlLogFile, "\n");
- fflush(sqlLogFile);
- }
-
- fflush(stdout);
-}
-
-void Log::outErrorDb(const char * err, ...)
-{
- if (!err)
- return;
-
- if (m_colored)
- SetColor(false, LRED);
+ vlog(filter, LOG_LEVEL_TRACE, str, ap);
- va_list ap;
-
- va_start(ap, err);
- vutf8printf(stderr, err, &ap);
va_end(ap);
-
- if (m_colored)
- ResetColor(false);
-
- fprintf( stderr, "\n" );
-
- if (logfile)
- {
- outTimestamp(logfile);
- fprintf(logfile, "ERROR: " );
-
- va_start(ap, err);
- vfprintf(logfile, err, ap);
- va_end(ap);
-
- fprintf(logfile, "\n" );
- fflush(logfile);
- }
-
- if (dberLogfile)
- {
- outTimestamp(dberLogfile);
- va_start(ap, err);
- vfprintf(dberLogfile, err, ap);
- va_end(ap);
-
- fprintf(dberLogfile, "\n" );
- fflush(dberLogfile);
- }
- fflush(stderr);
}
-void Log::outBasic(const char * str, ...)
+void Log::outDebug(LogFilterType filter, const char * str, ...)
{
- if (!str)
+ if (!str || !ShouldLog(filter, LOG_LEVEL_DEBUG))
return;
- if (m_enableLogDB && m_dbLogLevel > LOGL_NORMAL)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_BASIC, nnew_str);
- va_end(ap2);
- }
-
- if (m_logLevel > LOGL_NORMAL)
- {
- if (m_colored)
- SetColor(true, m_colors[LOGL_BASIC]);
-
- va_list ap;
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(true);
+ va_list ap;
+ va_start(ap, str);
- printf("\n");
+ vlog(filter, LOG_LEVEL_DEBUG, str, ap);
- if (logfile)
- {
- outTimestamp(logfile);
- va_list ap2;
- va_start(ap2, str);
- vfprintf(logfile, str, ap2);
- fprintf(logfile, "\n" );
- va_end(ap2);
- fflush(logfile);
- }
- }
- fflush(stdout);
+ va_end(ap);
}
-void Log::outDetail(const char * str, ...)
+void Log::outInfo(LogFilterType filter, const char * str, ...)
{
- if (!str)
+ if (!str || !ShouldLog(filter, LOG_LEVEL_INFO))
return;
- if (m_enableLogDB && m_dbLogLevel > LOGL_BASIC)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_DETAIL, nnew_str);
- va_end(ap2);
- }
-
- if (m_logLevel > LOGL_BASIC)
- {
- if (m_colored)
- SetColor(true, m_colors[LOGL_DETAIL]);
-
- va_list ap;
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(true);
-
- printf("\n");
+ va_list ap;
+ va_start(ap, str);
- if (logfile)
- {
- outTimestamp(logfile);
- va_list ap2;
- va_start(ap2, str);
- vfprintf(logfile, str, ap2);
- va_end(ap2);
-
- fprintf(logfile, "\n");
- fflush(logfile);
- }
- }
+ vlog(filter, LOG_LEVEL_INFO, str, ap);
- fflush(stdout);
+ va_end(ap);
}
-void Log::outDebugInLine(const char * str, ...)
+void Log::outWarn(LogFilterType filter, const char * str, ...)
{
- if (!str)
+ if (!str || !ShouldLog(filter, LOG_LEVEL_WARN))
return;
- if (m_logLevel > LOGL_DETAIL)
- {
- va_list ap;
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
+ va_list ap;
+ va_start(ap, str);
- //if (m_colored)
- // ResetColor(true);
+ vlog(filter, LOG_LEVEL_WARN, str, ap);
- if (logfile)
- {
- va_list ap2;
- va_start(ap2, str);
- vfprintf(logfile, str, ap2);
- va_end(ap2);
- }
- }
+ va_end(ap);
}
-void Log::outSQLDev(const char* str, ...)
+void Log::outError(LogFilterType filter, const char * str, ...)
{
- if (!str)
+ if (!str || !ShouldLog(filter, LOG_LEVEL_ERROR))
return;
va_list ap;
va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
- printf("\n");
-
- if (sqlDevLogFile)
- {
- va_list ap2;
- va_start(ap2, str);
- vfprintf(sqlDevLogFile, str, ap2);
- va_end(ap2);
-
- fprintf(sqlDevLogFile, "\n");
- fflush(sqlDevLogFile);
- }
+ vlog(filter, LOG_LEVEL_ERROR, str, ap);
- fflush(stdout);
+ va_end(ap);
}
-void Log::outDebug(DebugLogFilters f, const char * str, ...)
+void Log::outFatal(LogFilterType filter, const char * str, ...)
{
- if (!(m_DebugLogMask & f))
- return;
-
- if (!str)
+ if (!str || !ShouldLog(filter, LOG_LEVEL_FATAL))
return;
- if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_DEBUG, nnew_str);
- va_end(ap2);
- }
-
- if ( m_logLevel > LOGL_DETAIL )
- {
- if (m_colored)
- SetColor(true, m_colors[LOGL_DEBUG]);
-
- va_list ap;
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(true);
+ va_list ap;
+ va_start(ap, str);
- printf( "\n" );
+ vlog(filter, LOG_LEVEL_FATAL, str, ap);
- if (logfile)
- {
- outTimestamp(logfile);
- va_list ap2;
- va_start(ap2, str);
- vfprintf(logfile, str, ap2);
- va_end(ap2);
-
- fprintf(logfile, "\n" );
- fflush(logfile);
- }
- }
- fflush(stdout);
+ va_end(ap);
}
-void Log::outStaticDebug(const char * str, ...)
+void Log::outCharDump(char const* str, uint32 accountId, uint32 guid, char const* name)
{
- if (!str)
+ if (!str || !ShouldLog(LOG_FILTER_PLAYER_DUMP, LOG_LEVEL_INFO))
return;
- if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_DEBUG, nnew_str);
- va_end(ap2);
- }
-
- if ( m_logLevel > LOGL_DETAIL )
- {
- if (m_colored)
- SetColor(true, m_colors[LOGL_DEBUG]);
-
- va_list ap;
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
+ std::ostringstream ss;
+ ss << "== START DUMP == (account: " << accountId << " guid: " << guid << " name: " << name
+ << ")\n" << str << "\n== END DUMP ==\n";
- if (m_colored)
- ResetColor(true);
+ LogMessage* msg = new LogMessage(LOG_LEVEL_INFO, LOG_FILTER_PLAYER_DUMP, ss.str());
+ ss.clear();
+ ss << guid << '_' << name;
- printf( "\n" );
+ msg->param1 = ss.str();
- if (logfile)
- {
- outTimestamp(logfile);
- va_list ap2;
- va_start(ap2, str);
- vfprintf(logfile, str, ap2);
- va_end(ap2);
-
- fprintf(logfile, "\n" );
- fflush(logfile);
- }
- }
- fflush(stdout);
+ write(msg);
}
-void Log::outStringInLine(const char * str, ...)
+void Log::outCommand(uint32 account, const char * str, ...)
{
- if (!str)
+ if (!str || !ShouldLog(LOG_FILTER_GMCOMMAND, LOG_LEVEL_INFO))
return;
va_list ap;
-
va_start(ap, str);
- vutf8printf(stdout, str, &ap);
+ char text[MAX_QUERY_LEN];
+ vsnprintf(text, MAX_QUERY_LEN, str, ap);
va_end(ap);
- if (logfile)
- {
- va_start(ap, str);
- vfprintf(logfile, str, ap);
- va_end(ap);
- }
-}
-
-void Log::outCommand(uint32 account, const char * str, ...)
-{
- if (!str)
- return;
-
- // TODO: support accountid
- if (m_enableLogDB && m_dbGM)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_GM, nnew_str);
- va_end(ap2);
- }
-
- if (m_logLevel > LOGL_NORMAL)
- {
- if (m_colored)
- SetColor(true, m_colors[LOGL_BASIC]);
-
- va_list ap;
- va_start(ap, str);
- vutf8printf(stdout, str, &ap);
- va_end(ap);
-
- if (m_colored)
- ResetColor(true);
-
- printf("\n");
-
- if (logfile)
- {
- outTimestamp(logfile);
- va_list ap2;
- va_start(ap2, str);
- vfprintf(logfile, str, ap2);
- fprintf(logfile, "\n" );
- va_end(ap2);
- fflush(logfile);
- }
- }
-
- if (m_gmlog_per_account)
- {
- if (FILE* per_file = openGmlogPerAccount (account))
- {
- outTimestamp(per_file);
- va_list ap;
- va_start(ap, str);
- vfprintf(per_file, str, ap);
- fprintf(per_file, "\n" );
- va_end(ap);
- fclose(per_file);
- }
- }
- else if (gmLogfile)
- {
- outTimestamp(gmLogfile);
- va_list ap;
- va_start(ap, str);
- vfprintf(gmLogfile, str, ap);
- fprintf(gmLogfile, "\n" );
- va_end(ap);
- fflush(gmLogfile);
- }
-
- fflush(stdout);
-}
-
-void Log::outChar(const char * str, ...)
-{
- if (!str)
- return;
-
- if (m_enableLogDB && m_dbChar)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_CHAR, nnew_str);
- va_end(ap2);
- }
+ LogMessage* msg = new LogMessage(LOG_LEVEL_INFO, LOG_FILTER_GMCOMMAND, text);
- if (charLogfile)
- {
- outTimestamp(charLogfile);
- va_list ap;
- va_start(ap, str);
- vfprintf(charLogfile, str, ap);
- fprintf(charLogfile, "\n" );
- va_end(ap);
- fflush(charLogfile);
- }
-}
+ std::ostringstream ss;
+ ss << account;
+ msg->param1 = ss.str();
-void Log::outCharDump(const char * str, uint32 account_id, uint32 guid, const char * name)
-{
- FILE* file = NULL;
- if (m_charLog_Dump_Separate)
- {
- char fileName[29]; // Max length: name(12) + guid(11) + _.log (5) + \0
- snprintf(fileName, 29, "%d_%s.log", guid, name);
- std::string sFileName(m_dumpsDir);
- sFileName.append(fileName);
- file = fopen((m_logsDir + sFileName).c_str(), "w");
- }
- else
- file = charLogfile;
- if (file)
- {
- fprintf(file, "== START DUMP == (account: %u guid: %u name: %s )\n%s\n== END DUMP ==\n",
- account_id, guid, name, str);
- fflush(file);
- if (m_charLog_Dump_Separate)
- fclose(file);
- }
+ write(msg);
}
-void Log::outRemote(const char * str, ...)
+void Log::SetRealmID(uint32 id)
{
- if (!str)
- return;
-
- if (m_enableLogDB && m_dbRA)
- {
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_RA, nnew_str);
- va_end(ap2);
- }
-
- if (raLogfile)
- {
- outTimestamp(raLogfile);
- va_list ap;
- va_start(ap, str);
- vfprintf(raLogfile, str, ap);
- fprintf(raLogfile, "\n" );
- va_end(ap);
- fflush(raLogfile);
- }
+ realm = id;
}
-void Log::outChat(const char * str, ...)
+void Log::Close()
{
- if (!str)
- return;
-
- if (m_enableLogDB && m_dbChat)
+ delete worker;
+ worker = NULL;
+ loggers.clear();
+ for (AppenderMap::iterator it = appenders.begin(); it != appenders.end(); ++it)
{
- va_list ap2;
- va_start(ap2, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
- outDB(LOG_TYPE_CHAT, nnew_str);
- va_end(ap2);
- }
-
- if (chatLogfile)
- {
- outTimestamp(chatLogfile);
- va_list ap;
- va_start(ap, str);
- vfprintf(chatLogfile, str, ap);
- fprintf(chatLogfile, "\n" );
- fflush(chatLogfile);
- va_end(ap);
+ delete it->second;
+ it->second = NULL;
}
+ appenders.clear();
}
-void Log::outErrorST(const char * str, ...)
+void Log::LoadFromConfig()
{
- va_list ap;
- va_start(ap, str);
- char nnew_str[MAX_QUERY_LEN];
- vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap);
- va_end(ap);
-
- ACE_Stack_Trace st;
- outError("%s [Stacktrace: %s]", nnew_str, st.c_str());
-}
-
-void Log::outWarden(const char * str, ...)
-{
- if (!str)
- return;
-
- if (wardenLogFile)
- {
- outTimestamp(wardenLogFile);
- va_list ap;
- va_start(ap, str);
- vfprintf(wardenLogFile, str, ap);
- fprintf(wardenLogFile, "\n" );
- fflush(wardenLogFile);
- va_end(ap);
- }
+ Close();
+ AppenderId = 0;
+ m_logsDir = ConfigMgr::GetStringDefault("LogsDir", "");
+ if (!m_logsDir.empty())
+ if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\'))
+ m_logsDir.push_back('/');
+ ReadAppendersFromConfig();
+ ReadLoggersFromConfig();
+ worker = new LogWorker();
}
diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h
index 296c13d86c9..b66e774b527 100755
--- a/src/server/shared/Logging/Log.h
+++ b/src/server/shared/Logging/Log.h
@@ -19,196 +19,69 @@
#ifndef TRINITYCORE_LOG_H
#define TRINITYCORE_LOG_H
-#include "Common.h"
-#include <ace/Singleton.h>
-
-class Config;
-
-enum DebugLogFilters
-{
- LOG_FILTER_NONE = 0x00000000,
- LOG_FILTER_UNITS = 0x00000001, // Anything related to units that doesn't fit in other categories. ie. creature formations
- LOG_FILTER_PETS = 0x00000002,
- LOG_FILTER_VEHICLES = 0x00000004,
- LOG_FILTER_TSCR = 0x00000008, // C++ AI, instance scripts, etc.
- LOG_FILTER_DATABASE_AI = 0x00000010, // SmartAI, EventAI, CreatureAI
- LOG_FILTER_MAPSCRIPTS = 0x00000020,
- LOG_FILTER_NETWORKIO = 0x00000040, // Anything packet/netcode related
- LOG_FILTER_SPELLS_AURAS = 0x00000080,
- LOG_FILTER_ACHIEVEMENTSYS = 0x00000100,
- LOG_FILTER_CONDITIONSYS = 0x00000200,
- LOG_FILTER_POOLSYS = 0x00000400,
- LOG_FILTER_AUCTIONHOUSE = 0x00000800,
- LOG_FILTER_BATTLEGROUND = 0x00001000, // Anything related to arena's and battlegrounds
- LOG_FILTER_OUTDOORPVP = 0x00002000,
- LOG_FILTER_CHATSYS = 0x00004000,
- LOG_FILTER_LFG = 0x00008000,
- LOG_FILTER_MAPS = 0x00010000, // Maps, instances, grids, cells, visibility
- LOG_FILTER_PLAYER_LOADING = 0x00020000, // Debug output from Player::_Load functions
- LOG_FILTER_PLAYER_ITEMS = 0x00040000, // Anything item related
- LOG_FILTER_PLAYER_SKILLS = 0x00080000, // Skills related
- LOG_FILTER_LOOT = 0x00100000, // Loot related
- LOG_FILTER_GUILD = 0x00200000, // Guild related
- LOG_FILTER_TRANSPORTS = 0x00400000, // Transport related
- LOG_FILTER_WARDEN = 0x00800000, // Warden related
-};
-
-enum LogTypes
-{
- LOG_TYPE_STRING = 0,
- LOG_TYPE_ERROR = 1,
- LOG_TYPE_BASIC = 2,
- LOG_TYPE_DETAIL = 3,
- LOG_TYPE_DEBUG = 4,
- LOG_TYPE_CHAR = 5,
- LOG_TYPE_WORLD = 6,
- LOG_TYPE_RA = 7,
- LOG_TYPE_GM = 8,
- LOG_TYPE_CRASH = 9,
- LOG_TYPE_CHAT = 10,
- MAX_LOG_TYPES
-};
-
-enum LogLevel
-{
- LOGL_NORMAL = 0,
- LOGL_BASIC,
- LOGL_DETAIL,
- LOGL_DEBUG
-};
-
-const int LogLevels = int(LOGL_DEBUG)+1;
+#include "Define.h"
+#include "Appender.h"
+#include "LogWorker.h"
+#include "Logger.h"
-enum ColorTypes
-{
- BLACK,
- RED,
- GREEN,
- BROWN,
- BLUE,
- MAGENTA,
- CYAN,
- GREY,
- YELLOW,
- LRED,
- LGREEN,
- LBLUE,
- LMAGENTA,
- LCYAN,
- WHITE
-};
+#include <ace/Singleton.h>
-const int Colors = int(WHITE)+1;
+#include <string>
+#include <set>
class Log
{
friend class ACE_Singleton<Log, ACE_Thread_Mutex>;
+ typedef std::map<uint8, Logger> LoggerMap;
+
private:
Log();
~Log();
public:
- void Initialize();
-
- void ReloadConfig();
-
- void InitColors(const std::string& init_str);
- void SetColor(bool stdout_stream, ColorTypes color);
- void ResetColor(bool stdout_stream);
-
- void outErrorST(const char * err, ...) ATTR_PRINTF(2, 3);
- void outDB(LogTypes type, const char * str);
- void outString(const char * str, ...) ATTR_PRINTF(2, 3);
- void outString();
- void outStringInLine(const char * str, ...) ATTR_PRINTF(2, 3);
- void outError(const char * err, ...) ATTR_PRINTF(2, 3);
- void outCrash(const char * err, ...) ATTR_PRINTF(2, 3);
- void outBasic(const char * str, ...) ATTR_PRINTF(2, 3);
- void outDetail(const char * str, ...) ATTR_PRINTF(2, 3);
- void outSQLDev(const char * str, ...) ATTR_PRINTF(2, 3);
- void outDebug(DebugLogFilters f, const char* str, ...) ATTR_PRINTF(3, 4);
- void outStaticDebug(const char * str, ...) ATTR_PRINTF(2, 3);
- void outDebugInLine(const char * str, ...) ATTR_PRINTF(2, 3);
- void outErrorDb(const char * str, ...) ATTR_PRINTF(2, 3);
- void outChar(const char * str, ...) ATTR_PRINTF(2, 3);
- void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4);
- void outRemote(const char * str, ...) ATTR_PRINTF(2, 3);
- void outChat(const char * str, ...) ATTR_PRINTF(2, 3);
- void outArena(const char * str, ...) ATTR_PRINTF(2, 3);
- void outSQLDriver(const char* str, ...) ATTR_PRINTF(2, 3);
- void outWarden(const char * str, ...) ATTR_PRINTF(2, 3);
- void outCharDump(const char * str, uint32 account_id, uint32 guid, const char * name);
-
- static void outTimestamp(FILE* file);
+ void LoadFromConfig();
+ void Close();
+ bool ShouldLog(LogFilterType type, LogLevel level) const;
+ bool SetLogLevel(std::string const& name, char const* level, bool isLogger = true);
+
+ void outTrace(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4);
+ void outDebug(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4);
+ void outInfo(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4);
+ void outWarn(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4);
+ void outError(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4);
+ void outFatal(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4);
+
+ void EnableDBAppenders();
+ void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4);
+ void outCharDump(char const* str, uint32 account_id, uint32 guid, char const* name);
static std::string GetTimestampStr();
- void SetLogLevel(char * Level);
- void SetLogFileLevel(char * Level);
- void SetDBLogLevel(char * Level);
- void SetSQLDriverQueryLogging(bool newStatus) { m_sqlDriverQueryLogging = newStatus; }
- void SetRealmID(uint32 id) { realm = id; }
-
- bool IsOutDebug() const { return m_logLevel > 2 || (m_logFileLevel > 2 && logfile); }
- bool IsOutCharDump() const { return m_charLog_Dump; }
+ void SetRealmID(uint32 id);
- bool GetLogDB() const { return m_enableLogDB; }
- bool GetLogDBLater() const { return m_enableLogDBLater; }
- void SetLogDB(bool enable) { m_enableLogDB = enable; }
- void SetLogDBLater(bool value) { m_enableLogDBLater = value; }
- bool GetSQLDriverQueryLogging() const { return m_sqlDriverQueryLogging; }
private:
- FILE* openLogFile(char const* configFileName, char const* configTimeStampFlag, char const* mode);
- FILE* openGmlogPerAccount(uint32 account);
-
- FILE* raLogfile;
- FILE* logfile;
- FILE* gmLogfile;
- FILE* charLogfile;
- FILE* dberLogfile;
- FILE* chatLogfile;
- FILE* arenaLogFile;
- FILE* sqlLogFile;
- FILE* sqlDevLogFile;
- FILE* wardenLogFile;
-
- // cache values for after initilization use (like gm log per account case)
+ void vlog(LogFilterType f, LogLevel level, char const* str, va_list argptr);
+ void write(LogMessage* msg);
+
+ Logger* GetLoggerByType(LogFilterType filter);
+ Appender* GetAppenderByName(std::string const& name);
+ uint8 NextAppenderId();
+ void CreateAppenderFromConfig(const char* name);
+ void CreateLoggerFromConfig(const char* name);
+ void ReadAppendersFromConfig();
+ void ReadLoggersFromConfig();
+
+ AppenderMap appenders;
+ LoggerMap loggers;
+ uint8 AppenderId;
+
std::string m_logsDir;
std::string m_logsTimestamp;
- // gm log control
- bool m_gmlog_per_account;
- std::string m_gmlog_filename_format;
-
- bool m_enableLogDBLater;
- bool m_enableLogDB;
uint32 realm;
-
- // log coloring
- bool m_colored;
- ColorTypes m_colors[4];
-
- // log levels:
- // false: errors only, true: full query logging
- bool m_sqlDriverQueryLogging;
-
- // log levels:
- // 0 minimum/string, 1 basic/error, 2 detail, 3 full/debug
- uint8 m_dbLogLevel;
- uint8 m_logLevel;
- uint8 m_logFileLevel;
- bool m_dbChar;
- bool m_dbRA;
- bool m_dbGM;
- bool m_dbChat;
- bool m_charLog_Dump;
- bool m_charLog_Dump_Separate;
- std::string m_dumpsDir;
-
- DebugLogFilters m_DebugLogMask;
+ LogWorker* worker;
};
#define sLog ACE_Singleton<Log, ACE_Thread_Mutex>::instance()
#endif
-
diff --git a/src/server/shared/Logging/LogOperation.cpp b/src/server/shared/Logging/LogOperation.cpp
new file mode 100644
index 00000000000..b36dd3a8b1e
--- /dev/null
+++ b/src/server/shared/Logging/LogOperation.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "LogOperation.h"
+#include "Logger.h"
+
+LogOperation::~LogOperation()
+{
+ delete msg;
+}
+
+int LogOperation::call()
+{
+ if (logger && msg)
+ logger->write(*msg);
+ return 0;
+}
diff --git a/src/server/shared/Logging/LogOperation.h b/src/server/shared/Logging/LogOperation.h
new file mode 100644
index 00000000000..d872670d756
--- /dev/null
+++ b/src/server/shared/Logging/LogOperation.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOGOPERATION_H
+#define LOGOPERATION_H
+
+class Logger;
+struct LogMessage;
+
+class LogOperation
+{
+ public:
+ LogOperation(Logger* _logger, LogMessage* _msg)
+ : logger(_logger)
+ , msg(_msg)
+ { }
+
+ ~LogOperation();
+
+ int call();
+
+ protected:
+ Logger *logger;
+ LogMessage *msg;
+};
+
+#endif
diff --git a/src/server/shared/Logging/LogWorker.cpp b/src/server/shared/Logging/LogWorker.cpp
new file mode 100644
index 00000000000..a12faaf224c
--- /dev/null
+++ b/src/server/shared/Logging/LogWorker.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "LogWorker.h"
+
+LogWorker::LogWorker()
+ : m_queue(HIGH_WATERMARK, LOW_WATERMARK)
+{
+ ACE_Task_Base::activate(THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, 1);
+}
+
+LogWorker::~LogWorker()
+{
+ m_queue.deactivate();
+ wait();
+}
+
+int LogWorker::enqueue(LogOperation* op)
+{
+ return m_queue.enqueue(op);
+}
+
+int LogWorker::svc()
+{
+ while (1)
+ {
+ LogOperation* request;
+ if (m_queue.dequeue(request) == -1)
+ break;
+
+ request->call();
+ delete request;
+ }
+
+ return 0;
+}
diff --git a/src/server/shared/Logging/LogWorker.h b/src/server/shared/Logging/LogWorker.h
new file mode 100644
index 00000000000..ea1744f9790
--- /dev/null
+++ b/src/server/shared/Logging/LogWorker.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOGWORKER_H
+#define LOGWORKER_H
+
+#include "LogOperation.h"
+
+#include <ace/Task.h>
+#include <ace/Activation_Queue.h>
+
+class LogWorker: protected ACE_Task_Base
+{
+ public:
+ LogWorker();
+ ~LogWorker();
+
+ typedef ACE_Message_Queue_Ex<LogOperation, ACE_MT_SYNCH> LogMessageQueueType;
+
+ enum
+ {
+ HIGH_WATERMARK = 8 * 1024 * 1024,
+ LOW_WATERMARK = 8 * 1024 * 1024
+ };
+
+ int enqueue(LogOperation *op);
+
+ private:
+ virtual int svc();
+ LogMessageQueueType m_queue;
+};
+
+#endif
diff --git a/src/server/shared/Logging/Logger.cpp b/src/server/shared/Logging/Logger.cpp
new file mode 100644
index 00000000000..10276eb3acb
--- /dev/null
+++ b/src/server/shared/Logging/Logger.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Logger.h"
+
+Logger::Logger(): name(""), type(LOG_FILTER_GENERAL), level(LOG_LEVEL_DISABLED)
+{
+}
+
+void Logger::Create(std::string const& _name, LogFilterType _type, LogLevel _level)
+{
+ name = _name;
+ type = _type;
+ level = _level;
+}
+
+Logger::~Logger()
+{
+ for (AppenderMap::iterator it = appenders.begin(); it != appenders.end(); ++it)
+ it->second = NULL;
+ appenders.clear();
+}
+
+std::string const& Logger::getName() const
+{
+ return name;
+}
+
+LogFilterType Logger::getType() const
+{
+ return type;
+}
+
+LogLevel Logger::getLogLevel() const
+{
+ return level;
+}
+
+void Logger::addAppender(uint8 id, Appender* appender)
+{
+ appenders[id] = appender;
+}
+
+void Logger::delAppender(uint8 id)
+{
+ AppenderMap::iterator it = appenders.find(id);
+ if (it != appenders.end())
+ {
+ it->second = NULL;
+ appenders.erase(it);
+ }
+}
+
+void Logger::setLogLevel(LogLevel _level)
+{
+ level = _level;
+}
+
+void Logger::write(LogMessage& message)
+{
+ if (!level || level > message.level || message.text.empty())
+ {
+ //fprintf(stderr, "Logger::write: Logger %s, Level %u. Msg %s Level %u WRONG LEVEL MASK OR EMPTY MSG\n", getName().c_str(), messge.level, message.text.c_str(), .message.level); // DEBUG - RemoveMe
+ return;
+ }
+
+ for (AppenderMap::iterator it = appenders.begin(); it != appenders.end(); ++it)
+ if (it->second)
+ it->second->write(message);
+}
diff --git a/src/server/shared/Logging/Logger.h b/src/server/shared/Logging/Logger.h
new file mode 100644
index 00000000000..9d13f08620f
--- /dev/null
+++ b/src/server/shared/Logging/Logger.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOGGER_H
+#define LOGGER_H
+
+#include "Appender.h"
+
+class Logger
+{
+ public:
+ Logger();
+ ~Logger();
+
+ void Create(std::string const& name, LogFilterType type, LogLevel level);
+ void addAppender(uint8 type, Appender *);
+ void delAppender(uint8 type);
+
+ std::string const& getName() const;
+ LogFilterType getType() const;
+ LogLevel getLogLevel() const;
+ void setLogLevel(LogLevel level);
+ void write(LogMessage& message);
+
+ private:
+ std::string name;
+ LogFilterType type;
+ LogLevel level;
+ AppenderMap appenders;
+};
+
+#endif
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h
index fb2fdf09583..1fa3148504a 100755
--- a/src/server/shared/Packets/ByteBuffer.h
+++ b/src/server/shared/Packets/ByteBuffer.h
@@ -50,8 +50,10 @@ class ByteBufferPositionException : public ByteBufferException
protected:
void PrintError() const
{
- sLog->outError("Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " ,
- (_add ? "put" : "get"), ValueSize, Pos, Size);
+ ACE_Stack_Trace trace;
+
+ sLog->outError(LOG_FILTER_GENERAL, "Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stacktrace: %s]" ,
+ (_add ? "put" : "get"), ValueSize, Pos, Size, trace.c_str());
}
private:
@@ -70,8 +72,10 @@ class ByteBufferSourceException : public ByteBufferException
protected:
void PrintError() const
{
- sLog->outError("Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")",
- (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size);
+ ACE_Stack_Trace trace;
+
+ sLog->outError(LOG_FILTER_GENERAL, "Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")\n[Stacktrace: %s]",
+ (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size, trace.c_str());
}
};
@@ -185,8 +189,7 @@ class ByteBuffer
ByteBuffer &operator<<(const char *str)
{
- size_t len = 0;
- if (str && (len = strlen(str)))
+ if (size_t len = (str ? strlen(str) : 0))
append((uint8 const*)str, len);
append((uint8)0);
return *this;
@@ -356,6 +359,28 @@ class ByteBuffer
}
}
+ uint32 ReadPackedTime()
+ {
+ uint32 packedDate = read<uint32>();
+ tm lt;
+ memset(&lt, 0, sizeof(lt));
+
+ lt.tm_min = packedDate & 0x3F;
+ lt.tm_hour = (packedDate >> 6) & 0x1F;
+ //lt.tm_wday = (packedDate >> 11) & 7;
+ lt.tm_mday = ((packedDate >> 14) & 0x3F) + 1;
+ lt.tm_mon = (packedDate >> 20) & 0xF;
+ lt.tm_year = ((packedDate >> 24) & 0x1F) + 100;
+
+ return mktime(&lt) + timezone;
+ }
+
+ ByteBuffer& ReadPackedTime(uint32& time)
+ {
+ time = ReadPackedTime();
+ return *this;
+ }
+
const uint8 *contents() const { return &_storage[0]; }
size_t size() const { return _storage.size(); }
@@ -435,6 +460,12 @@ class ByteBuffer
append(packGUID, size);
}
+ void AppendPackedTime(time_t time)
+ {
+ tm* lt = localtime(&time);
+ append<uint32>((lt->tm_year - 100) << 24 | lt->tm_mon << 20 | (lt->tm_mday - 1) << 14 | lt->tm_wday << 11 | lt->tm_hour << 6 | lt->tm_min);
+ }
+
void put(size_t pos, const uint8 *src, size_t cnt)
{
if (pos + cnt > size())
@@ -448,79 +479,65 @@ class ByteBuffer
void print_storage() const
{
- if (!sLog->IsOutDebug()) // optimize disabled debug output
+ if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled debug output
return;
- sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() );
+ std::ostringstream o;
+ o << "STORAGE_SIZE: " << size();
for (uint32 i = 0; i < size(); ++i)
- sLog->outDebugInLine("%u - ", read<uint8>(i) );
- sLog->outDebug(LOG_FILTER_NETWORKIO, " ");
+ o << read<uint8>(i) << " - ";
+ o << " ";
+
+ sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str());
}
void textlike() const
{
- if (!sLog->IsOutDebug()) // optimize disabled debug output
+ if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled debug output
return;
- sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() );
+ std::ostringstream o;
+ o << "STORAGE_SIZE: " << size();
for (uint32 i = 0; i < size(); ++i)
- sLog->outDebugInLine("%c", read<uint8>(i) );
- sLog->outDebug(LOG_FILTER_NETWORKIO, " ");
+ {
+ char buf[1];
+ snprintf(buf, 1, "%c", read<uint8>(i));
+ o << buf;
+ }
+ o << " ";
+ sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str());
}
void hexlike() const
{
- if (!sLog->IsOutDebug()) // optimize disabled debug output
+ if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled debug output
return;
uint32 j = 1, k = 1;
- sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() );
+
+ std::ostringstream o;
+ o << "STORAGE_SIZE: " << size();
for (uint32 i = 0; i < size(); ++i)
{
+ char buf[3];
+ snprintf(buf, 1, "%2X ", read<uint8>(i));
if ((i == (j * 8)) && ((i != (k * 16))))
{
- if (read<uint8>(i) < 0x10)
- {
- sLog->outDebugInLine("| 0%X ", read<uint8>(i) );
- }
- else
- {
- sLog->outDebugInLine("| %X ", read<uint8>(i) );
- }
+ o << "| ";
++j;
}
else if (i == (k * 16))
{
- if (read<uint8>(i) < 0x10)
- {
- sLog->outDebugInLine("\n");
-
- sLog->outDebugInLine("0%X ", read<uint8>(i) );
- }
- else
- {
- sLog->outDebugInLine("\n");
-
- sLog->outDebugInLine("%X ", read<uint8>(i) );
- }
-
+ o << "\n";
++k;
++j;
}
- else
- {
- if (read<uint8>(i) < 0x10)
- {
- sLog->outDebugInLine("0%X ", read<uint8>(i) );
- }
- else
- {
- sLog->outDebugInLine("%X ", read<uint8>(i) );
- }
- }
+
+ o << buf;
}
- sLog->outDebugInLine("\n");
+ o << " ";
+ sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str());
}
protected:
diff --git a/src/server/shared/Threading/Threading.h b/src/server/shared/Threading/Threading.h
index 8b10e223828..7cc74574873 100755
--- a/src/server/shared/Threading/Threading.h
+++ b/src/server/shared/Threading/Threading.h
@@ -51,7 +51,7 @@ namespace ACE_Based
Normal,
High,
Highest,
- Realtime,
+ Realtime
};
#define MAXPRIORITYNUM (Realtime + 1)
diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp
index f2887a4d1bd..91a78af1adc 100755
--- a/src/server/shared/Utilities/ServiceWin32.cpp
+++ b/src/server/shared/Utilities/ServiceWin32.cpp
@@ -52,8 +52,6 @@ typedef WINADVAPI BOOL (WINAPI *CSD_T)(SC_HANDLE, DWORD, LPCVOID);
bool WinServiceInstall()
{
- CSD_T ChangeService_Config2;
- HMODULE advapi32;
SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
if (serviceControlManager)
@@ -79,7 +77,7 @@ bool WinServiceInstall()
0); // no password
if (service)
{
- advapi32 = GetModuleHandle("ADVAPI32.DLL");
+ HMODULE advapi32 = GetModuleHandle("ADVAPI32.DLL");
if (!advapi32)
{
CloseServiceHandle(service);
@@ -87,7 +85,7 @@ bool WinServiceInstall()
return false;
}
- ChangeService_Config2 = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A");
+ CSD_T ChangeService_Config2 = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A");
if (!ChangeService_Config2)
{
CloseServiceHandle(service);
@@ -257,7 +255,7 @@ bool WinServiceRun()
if (!StartServiceCtrlDispatcher(serviceTable))
{
- sLog->outError("StartService Failed. Error [%u]", ::GetLastError());
+ sLog->outError(LOG_FILTER_GENERAL, "StartService Failed. Error [%u]", ::GetLastError());
return false;
}
return true;
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp
index 7bedf9690ca..89942b978df 100755
--- a/src/server/shared/Utilities/Util.cpp
+++ b/src/server/shared/Utilities/Util.cpp
@@ -92,7 +92,7 @@ Tokens::Tokens(const std::string &src, const char sep, uint32 vectorReserve)
void stripLineInvisibleChars(std::string &str)
{
- static std::string invChars = " \t\7\n";
+ static std::string const invChars = " \t\7\n";
size_t wpos = 0;
@@ -217,7 +217,7 @@ uint32 CreatePIDFile(const std::string& filename)
pid_t pid = getpid();
#endif
- fprintf(pid_file, "%d", pid );
+ fprintf(pid_file, "%u", pid );
fclose(pid_file);
return (uint32)pid;
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 196882dc2a0..37782c31d8b 100755
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -48,12 +48,6 @@ std::string secsToTimeString(uint64 timeInSecs, bool shortText = false, bool hou
uint32 TimeStringToSecs(const std::string& timestring);
std::string TimeToTimestampStr(time_t t);
-inline uint32 secsToTimeBitFields(time_t secs)
-{
- tm* lt = localtime(&secs);
- return (lt->tm_year - 100) << 24 | lt->tm_mon << 20 | (lt->tm_mday - 1) << 14 | lt->tm_wday << 11 | lt->tm_hour << 6 | lt->tm_min;
-}
-
/* Return a random number in the range min..max; (max-min) must be smaller than 32768. */
int32 irand(int32 min, int32 max);
@@ -89,22 +83,6 @@ inline bool roll_chance_i(int chance)
return chance > irand(0, 99);
}
-inline void ApplyModUInt32Var(uint32& var, int32 val, bool apply)
-{
- int32 cur = var;
- cur += (apply ? val : -val);
- if (cur < 0)
- cur = 0;
- var = cur;
-}
-
-inline void ApplyModFloatVar(float& var, float val, bool apply)
-{
- var += (apply ? val : -val);
- if (var < 0)
- var = 0;
-}
-
inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
if (val == -100.0f) // prevent set var to zero
@@ -475,7 +453,7 @@ public:
return 0;
}
return 0;
- };
+ }
template<class type>
inline bool operator < (type & right) const
@@ -488,7 +466,7 @@ public:
return 0;
}
return 0;
- };
+ }
template<class type>
inline bool operator != (type & right)
@@ -508,7 +486,7 @@ public:
|| part[2]!=right.part[2])
return true;
return false;
- };
+ }
template<class type>
inline bool operator == (type & right)
@@ -518,7 +496,7 @@ public:
|| part[2]!=right.part[2])
return false;
return true;
- };
+ }
template<class type>
inline bool operator == (type & right) const
@@ -528,7 +506,7 @@ public:
|| part[2]!=right.part[2])
return false;
return true;
- };
+ }
template<class type>
inline void operator = (type & right)
@@ -536,7 +514,7 @@ public:
part[0]=right.part[0];
part[1]=right.part[1];
part[2]=right.part[2];
- };
+ }
template<class type>
inline flag96 operator & (type & right)
@@ -544,20 +522,21 @@ public:
flag96 ret(part[0] & right.part[0], part[1] & right.part[1], part[2] & right.part[2]);
return
ret;
- };
+ }
+
template<class type>
inline flag96 operator & (type & right) const
{
flag96 ret(part[0] & right.part[0], part[1] & right.part[1], part[2] & right.part[2]);
return
ret;
- };
+ }
template<class type>
inline void operator &= (type & right)
{
*this=*this & right;
- };
+ }
template<class type>
inline flag96 operator | (type & right)
@@ -565,7 +544,7 @@ public:
flag96 ret(part[0] | right.part[0], part[1] | right.part[1], part[2] | right.part[2]);
return
ret;
- };
+ }
template<class type>
inline flag96 operator | (type & right) const
@@ -573,13 +552,13 @@ public:
flag96 ret(part[0] | right.part[0], part[1] | right.part[1], part[2] | right.part[2]);
return
ret;
- };
+ }
template<class type>
inline void operator |= (type & right)
{
*this=*this | right;
- };
+ }
inline void operator ~ ()
{
@@ -594,7 +573,7 @@ public:
flag96 ret(part[0] ^ right.part[0], part[1] ^ right.part[1], part[2] ^ right.part[2]);
return
ret;
- };
+ }
template<class type>
inline flag96 operator ^ (type & right) const
@@ -602,13 +581,13 @@ public:
flag96 ret(part[0] ^ right.part[0], part[1] ^ right.part[1], part[2] ^ right.part[2]);
return
ret;
- };
+ }
template<class type>
inline void operator ^= (type & right)
{
*this=*this^right;
- };
+ }
inline operator bool() const
{
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 0d51f30449e..eb5bb04d766 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -80,7 +80,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Calendar
${CMAKE_SOURCE_DIR}/src/server/game/Chat
${CMAKE_SOURCE_DIR}/src/server/game/Chat/Channels
- ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Commands
${CMAKE_SOURCE_DIR}/src/server/game/Combat
${CMAKE_SOURCE_DIR}/src/server/game/Conditions
${CMAKE_SOURCE_DIR}/src/server/game/DataStores
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index e85a3e1870d..23eeca11f66 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -116,458 +116,6 @@ void commandFinished(void*, bool /*success*/)
fflush(stdout);
}
-/**
- * Collects all GUIDs (and related info) from deleted characters which are still in the database.
- *
- * @param foundList a reference to an std::list which will be filled with info data
- * @param searchString the search string which either contains a player GUID or a part fo the character-name
- * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable)
- */
-bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
-{
- PreparedQueryResult result;
- PreparedStatement* stmt;
- if (!searchString.empty())
- {
- // search by GUID
- if (isNumeric(searchString.c_str()))
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID);
-
- stmt->setUInt32(0, uint32(atoi(searchString.c_str())));
-
- result = CharacterDatabase.Query(stmt);
- }
- // search by name
- else
- {
- if (!normalizePlayerName(searchString))
- return false;
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME);
-
- stmt->setString(0, searchString);
-
- result = CharacterDatabase.Query(stmt);
- }
- }
- else
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO);
-
- result = CharacterDatabase.Query(stmt);
- }
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
-
- DeletedInfo info;
-
- info.lowguid = fields[0].GetUInt32();
- info.name = fields[1].GetString();
- info.accountId = fields[2].GetUInt32();
-
- // account name will be empty for not existed account
- AccountMgr::GetName(info.accountId, info.accountName);
-
- info.deleteDate = time_t(fields[3].GetUInt32());
-
- foundList.push_back(info);
- } while (result->NextRow());
- }
-
- return true;
-}
-
-/**
- * Generate WHERE guids list by deleted info in way preventing return too long where list for existed query string length limit.
- *
- * @param itr a reference to an deleted info list iterator, it updated in function for possible next function call if list to long
- * @param itr_end a reference to an deleted info list iterator end()
- * @return returns generated where list string in form: 'guid IN (gui1, guid2, ...)'
- */
-std::string ChatHandler::GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end)
-{
- std::ostringstream wherestr;
- wherestr << "guid IN ('";
- for (; itr != itr_end; ++itr)
- {
- wherestr << itr->lowguid;
-
- if (wherestr.str().size() > MAX_QUERY_LEN - 50) // near to max query
- {
- ++itr;
- break;
- }
-
- DeletedInfoList::const_iterator itr2 = itr;
- if (++itr2 != itr_end)
- wherestr << "', '";
- }
- wherestr << "')";
- return wherestr.str();
-}
-
-/**
- * Shows all deleted characters which matches the given search string, expected non empty list
- *
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::DeletedInfoList
- *
- * @param foundList contains a list with all found deleted characters
- */
-void ChatHandler::HandleCharacterDeletedListHelper(DeletedInfoList const& foundList)
-{
- if (!m_session)
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER);
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
- }
-
- for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
- {
- std::string dateStr = TimeToTimestampStr(itr->deleteDate);
-
- if (!m_session)
- PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
- itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
- itr->accountId, dateStr.c_str());
- else
- PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
- itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
- itr->accountId, dateStr.c_str());
- }
-
- if (!m_session)
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
-}
-
-/**
- * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string
- *
- * @see ChatHandler::HandleCharacterDeletedListHelper
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::DeletedInfoList
- *
- * @param args the search string which either contains a player GUID or a part fo the character-name
- */
-bool ChatHandler::HandleCharacterDeletedListCommand(const char* args)
-{
- DeletedInfoList foundList;
- if (!GetDeletedCharacterInfoList(foundList, args))
- return false;
-
- // if no characters have been found, output a warning
- if (foundList.empty())
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
- return false;
- }
-
- HandleCharacterDeletedListHelper(foundList);
- return true;
-}
-
-/**
- * Restore a previously deleted character
- *
- * @see ChatHandler::HandleCharacterDeletedListHelper
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::DeletedInfoList
- *
- * @param delInfo the informations about the character which will be restored
- */
-void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo)
-{
- if (delInfo.accountName.empty()) // account not exist
- {
- PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
- return;
- }
-
- // check character count
- uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId);
- if (charcount >= 10)
- {
- PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
- return;
- }
-
- if (sObjectMgr->GetPlayerGUIDByName(delInfo.name))
- {
- PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
- return;
- }
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO);
-
- stmt->setString(0, delInfo.name);
- stmt->setUInt32(1, delInfo.accountId);
- stmt->setUInt32(2, delInfo.lowguid);
-
- CharacterDatabase.Execute(stmt);
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
- stmt->setUInt32(0, delInfo.lowguid);
- if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
- sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8());
-}
-
-/**
- * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string
- *
- * The command automatically calls '.character deleted list' command with the search string to show all restored characters.
- *
- * @see ChatHandler::HandleCharacterDeletedRestoreHelper
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- *
- * @param args the search string which either contains a player GUID or a part of the character-name
- */
-bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args)
-{
- // It is required to submit at least one argument
- if (!*args)
- return false;
-
- std::string searchString;
- std::string newCharName;
- uint32 newAccount = 0;
-
- // GCC by some strange reason fail build code without temporary variable
- std::istringstream params(args);
- params >> searchString >> newCharName >> newAccount;
-
- DeletedInfoList foundList;
- if (!GetDeletedCharacterInfoList(foundList, searchString))
- return false;
-
- if (foundList.empty())
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
- return false;
- }
-
- SendSysMessage(LANG_CHARACTER_DELETED_RESTORE);
- HandleCharacterDeletedListHelper(foundList);
-
- if (newCharName.empty())
- {
- // Drop not existed account cases
- for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
- HandleCharacterDeletedRestoreHelper(*itr);
- }
- else if (foundList.size() == 1 && normalizePlayerName(newCharName))
- {
- DeletedInfo delInfo = foundList.front();
-
- // update name
- delInfo.name = newCharName;
-
- // if new account provided update deleted info
- if (newAccount && newAccount != delInfo.accountId)
- {
- delInfo.accountId = newAccount;
- AccountMgr::GetName(newAccount, delInfo.accountName);
- }
-
- HandleCharacterDeletedRestoreHelper(delInfo);
- }
- else
- SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME);
-
- return true;
-}
-
-/**
- * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string
- *
- * @see Player::GetDeletedCharacterGUIDs
- * @see Player::DeleteFromDB
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- *
- * @param args the search string which either contains a player GUID or a part fo the character-name
- */
-bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args)
-{
- // It is required to submit at least one argument
- if (!*args)
- return false;
-
- DeletedInfoList foundList;
- if (!GetDeletedCharacterInfoList(foundList, args))
- return false;
-
- if (foundList.empty())
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
- return false;
- }
-
- SendSysMessage(LANG_CHARACTER_DELETED_DELETE);
- HandleCharacterDeletedListHelper(foundList);
-
- // Call the appropriate function to delete them (current account for deleted characters is 0)
- for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
- Player::DeleteFromDB(itr->lowguid, 0, false, true);
-
- return true;
-}
-
-/**
- * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago
- *
- * @see Player::DeleteOldCharacters
- * @see Player::DeleteFromDB
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- *
- * @param args the search string which either contains a player GUID or a part fo the character-name
- */
-bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args)
-{
- int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
-
- char* px = strtok((char*)args, " ");
- if (px)
- {
- if (!isNumeric(px))
- return false;
-
- keepDays = atoi(px);
- if (keepDays < 0)
- return false;
- }
- // config option value 0 -> disabled and can't be used
- else if (keepDays <= 0)
- return false;
-
- Player::DeleteOldCharacters((uint32)keepDays);
- return true;
-}
-
-bool ChatHandler::HandleCharacterEraseCommand(const char* args){
- if (!*args)
- return false;
-
- char *character_name_str = strtok((char*)args, " ");
- if (!character_name_str)
- return false;
-
- std::string character_name = character_name_str;
- if (!normalizePlayerName(character_name))
- return false;
-
- uint64 character_guid;
- uint32 account_id;
-
- Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str());
- if (player)
- {
- character_guid = player->GetGUID();
- account_id = player->GetSession()->GetAccountId();
- player->GetSession()->KickPlayer();
- }
- else
- {
- character_guid = sObjectMgr->GetPlayerGUIDByName(character_name);
- if (!character_guid)
- {
- PSendSysMessage(LANG_NO_PLAYER, character_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid);
- }
-
- std::string account_name;
- AccountMgr::GetName (account_id, account_name);
-
- Player::DeleteFromDB(character_guid, account_id, true, true);
- PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id);
- return true;
-}
-
-/// Exit the realm
-bool ChatHandler::HandleServerExitCommand(const char* /*args*/)
-{
- SendSysMessage(LANG_COMMAND_EXIT);
- World::StopNow(SHUTDOWN_EXIT_CODE);
- return true;
-}
-
-/// Set the level of logging
-bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char *NewLevel = strtok((char*)args, " ");
- if (!NewLevel)
- return false;
-
- sLog->SetLogFileLevel(NewLevel);
- return true;
-}
-
-/// Set the level of logging
-bool ChatHandler::HandleServerSetLogLevelCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char *NewLevel = strtok((char*)args, " ");
- if (!NewLevel)
- return false;
-
- sLog->SetLogLevel(NewLevel);
- return true;
-}
-
-/// set diff time record interval
-bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char *NewTimeStr = strtok((char*)args, " ");
- if (!NewTimeStr)
- return false;
-
- int32 NewTime =atoi(NewTimeStr);
- if (NewTime < 0)
- return false;
-
- sWorld->SetRecordDiffInterval(NewTime);
- printf( "Record diff every %u ms\n", NewTime);
- return true;
-}
-
-/// toggle sql driver query logging
-bool ChatHandler::HandleServerToggleQueryLogging(const char* /* args */)
-{
- sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging());
- if (sLog->GetSQLDriverQueryLogging())
- PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED);
- else
- PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED);
-
- return true;
-}
-
-/// @}
-
#ifdef linux
// Non-blocking keypress detector, when return pressed, return 1, else always return 0
int kb_hit_return()
@@ -587,7 +135,7 @@ int kb_hit_return()
void CliRunnable::run()
{
///- Display the list of available CLI functions then beep
- //sLog->outString("");
+ //sLog->outInfo(LOG_FILTER_WORLDSERVER, "");
#if PLATFORM != PLATFORM_WINDOWS
rl_attempted_completion_function = cli_completion;
rl_event_hook = cli_hook_func;
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 04820f59355..7e43cf87dfc 100755
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -58,7 +58,7 @@ uint32 realmID; ///< Id of the realm
/// Print out the usage string for this program on the console.
void usage(const char *prog)
{
- sLog->outString("Usage: \n %s [<options>]\n"
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Usage: \n %s [<options>]\n"
" -c config_file use config_file as configuration file\n\r"
#ifdef _WIN32
" Running as service functions:\n\r"
@@ -81,7 +81,7 @@ extern int main(int argc, char **argv)
{
if (++c >= argc)
{
- sLog->outError("Runtime-Error: -c option requires an input argument");
+ printf("Runtime-Error: -c option requires an input argument");
usage(argv[0]);
return 1;
}
@@ -97,25 +97,25 @@ extern int main(int argc, char **argv)
{
if (++c >= argc)
{
- sLog->outError("Runtime-Error: -s option requires an input argument");
+ printf("Runtime-Error: -s option requires an input argument");
usage(argv[0]);
return 1;
}
if (strcmp(argv[c], "install") == 0)
{
if (WinServiceInstall())
- sLog->outString("Installing service");
+ printf("Installing service");
return 1;
}
else if (strcmp(argv[c], "uninstall") == 0)
{
if (WinServiceUninstall())
- sLog->outString("Uninstalling service");
+ printf("Uninstalling service");
return 1;
}
else
{
- sLog->outError("Runtime-Error: unsupported option %s", argv[c]);
+ printf("Runtime-Error: unsupported option %s", argv[c]);
usage(argv[0]);
return 1;
}
@@ -131,14 +131,14 @@ extern int main(int argc, char **argv)
if (!ConfigMgr::Load(cfg_file))
{
- sLog->outError("Invalid or missing configuration file : %s", cfg_file);
- sLog->outError("Verify that the file exists and has \'[worldserver]' written in the top of the file!");
+ printf("Invalid or missing configuration file : %s", cfg_file);
+ printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!");
return 1;
}
- sLog->outString("Using configuration file %s.", cfg_file);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using configuration file %s.", cfg_file);
- sLog->outString("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
- sLog->outString("Using ACE version: %s", ACE_VERSION);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using ACE version: %s", ACE_VERSION);
///- and run the 'Master'
/// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd?
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 03b2859c514..7587a9d1904 100755
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -84,7 +84,7 @@ public:
{
if (!_delaytime)
return;
- sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
m_loops = 0;
w_loops = 0;
m_lastchange = 0;
@@ -102,11 +102,11 @@ public:
// possible freeze
else if (getMSTimeDiff(w_lastchange, curtime) > _delaytime)
{
- sLog->outError("World Thread hangs, kicking out server!");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "World Thread hangs, kicking out server!");
ASSERT(false);
}
}
- sLog->outString("Anti-freeze thread exiting without problems.");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Anti-freeze thread exiting without problems.");
}
};
@@ -124,18 +124,18 @@ int Master::Run()
BigNumber seed1;
seed1.SetRand(16 * 8);
- sLog->outString("%s (worldserver-daemon)", _FULLVERSION);
- sLog->outString("<Ctrl-C> to stop.\n");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "%s (worldserver-daemon)", _FULLVERSION);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "<Ctrl-C> to stop.\n");
- sLog->outString(" ______ __");
- sLog->outString("/\\__ _\\ __ __/\\ \\__");
- sLog->outString("\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
- sLog->outString(" \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
- sLog->outString(" \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
- sLog->outString(" \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
- sLog->outString(" \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
- sLog->outString(" C O R E /\\___/");
- sLog->outString("http://TrinityCore.org \\/__/\n");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " ______ __");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "/\\__ _\\ __ __/\\ \\__");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " C O R E /\\___/");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "http://TrinityCore.org \\/__/\n");
/// worldserver PID file creation
std::string pidfile = ConfigMgr::GetStringDefault("PidFile", "");
@@ -144,11 +144,11 @@ int Master::Run()
uint32 pid = CreatePIDFile(pidfile);
if (!pid)
{
- sLog->outError("Cannot create PID file %s.\n", pidfile.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot create PID file %s.\n", pidfile.c_str());
return 1;
}
- sLog->outString("Daemon PID: %u\n", pid);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Daemon PID: %u\n", pid);
}
///- Start the databases
@@ -161,13 +161,13 @@ int Master::Run()
///- Initialize the World
sWorld->SetInitialWorldSettings();
- // Initialise the signal handlers
+ ///- Initialize the signal handlers
WorldServerSignalHandler SignalINT, SignalTERM;
#ifdef _WIN32
WorldServerSignalHandler SignalBREAK;
#endif /* _WIN32 */
- // Register worldserver's signal handlers
+ ///- Register worldserver's signal handlers
ACE_Sig_Handler Handler;
Handler.register_handler(SIGINT, &SignalINT);
Handler.register_handler(SIGTERM, &SignalTERM);
@@ -210,17 +210,16 @@ int Master::Run()
if (!curAff)
{
- sLog->outError("Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", Aff, appAff);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", Aff, appAff);
}
else
{
if (SetProcessAffinityMask(hProcess, curAff))
- sLog->outString("Using processors (bitmask, hex): %x", curAff);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", curAff);
else
- sLog->outError("Can't set used processors (hex): %x", curAff);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x", curAff);
}
}
- sLog->outString("");
}
bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false);
@@ -229,10 +228,9 @@ int Master::Run()
if (Prio)
{
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
- sLog->outString("worldserver process priority class set to HIGH");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to HIGH");
else
- sLog->outError("Can't set worldserver process priority class.");
- sLog->outString("");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class.");
}
}
#endif
@@ -242,7 +240,7 @@ int Master::Run()
if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false))
{
TCSoapRunnable* runnable = new TCSoapRunnable();
- runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), ConfigMgr::GetIntDefault("SOAP.Port", 7878));
+ runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(ConfigMgr::GetIntDefault("SOAP.Port", 7878)));
soap_thread = new ACE_Based::Thread(runnable);
}
@@ -250,7 +248,7 @@ int Master::Run()
if (uint32 freeze_delay = ConfigMgr::GetIntDefault("MaxCoreStuckTime", 0))
{
FreezeDetectorRunnable* fdr = new FreezeDetectorRunnable();
- fdr->SetDelayTime(freeze_delay*1000);
+ fdr->SetDelayTime(freeze_delay * 1000);
ACE_Based::Thread freeze_thread(fdr);
freeze_thread.setPriority(ACE_Based::Highest);
}
@@ -259,9 +257,9 @@ int Master::Run()
uint16 wsport = sWorld->getIntConfig(CONFIG_PORT_WORLD);
std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
- if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str ()) == -1)
+ if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str()) == -1)
{
- sLog->outError("Failed to start network");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Failed to start network");
World::StopNow(ERROR_EXIT_CODE);
// go down and shutdown the server
}
@@ -269,7 +267,7 @@ int Master::Run()
// set server online (allow connecting now)
LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID);
- sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "%s (worldserver-daemon) ready...", _FULLVERSION);
// when the main thread closes the singletons get unloaded
// since worldrunnable uses them, it will crash if unloaded after master
@@ -291,7 +289,7 @@ int Master::Run()
_StopDB();
- sLog->outString("Halting process...");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Halting process...");
if (cliThread)
{
@@ -356,21 +354,20 @@ bool Master::_StartDB()
{
MySQL::Library_Init();
- sLog->SetLogDB(false);
std::string dbstring;
uint8 async_threads, synch_threads;
dbstring = ConfigMgr::GetStringDefault("WorldDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("World database not specified in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "World database not specified in configuration file");
return false;
}
async_threads = ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog->outError("World database: invalid number of worker threads specified. "
+ sLog->outError(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -379,7 +376,7 @@ bool Master::_StartDB()
///- Initialise the world database
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog->outError("Cannot connect to world database %s", dbstring.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot connect to world database %s", dbstring.c_str());
return false;
}
@@ -387,14 +384,14 @@ bool Master::_StartDB()
dbstring = ConfigMgr::GetStringDefault("CharacterDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("Character database not specified in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Character database not specified in configuration file");
return false;
}
async_threads = ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog->outError("Character database: invalid number of worker threads specified. "
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -404,7 +401,7 @@ bool Master::_StartDB()
///- Initialise the Character database
if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog->outError("Cannot connect to Character database %s", dbstring.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot connect to Character database %s", dbstring.c_str());
return false;
}
@@ -412,14 +409,14 @@ bool Master::_StartDB()
dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("Login database not specified in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Login database not specified in configuration file");
return false;
}
async_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog->outError("Login database: invalid number of worker threads specified. "
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -428,7 +425,7 @@ bool Master::_StartDB()
///- Initialise the login database
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog->outError("Cannot connect to login database %s", dbstring.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot connect to login database %s", dbstring.c_str());
return false;
}
@@ -436,14 +433,11 @@ bool Master::_StartDB()
realmID = ConfigMgr::GetIntDefault("RealmID", 0);
if (!realmID)
{
- sLog->outError("Realm ID not defined in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Realm ID not defined in configuration file");
return false;
}
- sLog->outString("Realm running as realm ID %d", realmID);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Realm running as realm ID %d", realmID);
- ///- Initialize the DB logging system
- sLog->SetLogDBLater(ConfigMgr::GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished.
- sLog->SetLogDB(false);
sLog->SetRealmID(realmID);
///- Clean the database before starting
@@ -454,7 +448,7 @@ bool Master::_StartDB()
sWorld->LoadDBVersion();
- sLog->outString("Using World DB: %s", sWorld->GetDBVersion());
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using World DB: %s", sWorld->GetDBVersion());
return true;
}
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp
index 3f5d7bde736..7a1fff51afd 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -67,11 +67,11 @@ void RARunnable::run()
if (acceptor.open(listen_addr, m_Reactor) == -1)
{
- sLog->outError("Trinity RA can not bind to port %d on %s", raport, stringip.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Trinity RA can not bind to port %d on %s", raport, stringip.c_str());
return;
}
- sLog->outString("Starting Trinity RA on port %d on %s", raport, stringip.c_str());
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Starting Trinity RA on port %d on %s", raport, stringip.c_str());
while (!World::IsStopped())
{
@@ -82,5 +82,5 @@ void RARunnable::run()
break;
}
- sLog->outStaticDebug("Trinity RA thread exiting");
+ sLog->outDebug(LOG_FILTER_WORLDSERVER, "Trinity RA thread exiting");
}
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index ebc7c7624d9..18c90aa5ba5 100755
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -45,18 +45,18 @@ int RASocket::open(void *)
if (peer().get_remote_addr(remote_addr) == -1)
{
- sLog->outError("RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
+ sLog->outError(LOG_FILTER_WORLDSERVER, "RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
return -1;
}
- sLog->outRemote("Incoming connection from %s", remote_addr.get_host_addr());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Incoming connection from %s", remote_addr.get_host_addr());
return activate();
}
int RASocket::handle_close(ACE_HANDLE, ACE_Reactor_Mask)
{
- sLog->outRemote("Closing connection");
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Closing connection");
peer().close_reader();
wait();
destroy();
@@ -122,7 +122,7 @@ int RASocket::recv_line(std::string& out_line)
if (recv_line(message_block) == -1)
{
- sLog->outRemote("Recv error %s", ACE_OS::strerror(errno));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Recv error %s", ACE_OS::strerror(errno));
return -1;
}
@@ -136,7 +136,7 @@ int RASocket::process_command(const std::string& command)
if (command.length() == 0)
return 0;
- sLog->outRemote("Got command: %s", command.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Got command: %s", command.c_str());
// handle quit, exit and logout commands to terminate connection
if (command == "quit" || command == "exit" || command == "logout") {
@@ -186,7 +186,7 @@ int RASocket::check_access_level(const std::string& user)
if (!result)
{
- sLog->outRemote("User %s does not exist in database", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User %s does not exist in database", user.c_str());
return -1;
}
@@ -194,12 +194,12 @@ int RASocket::check_access_level(const std::string& user)
if (fields[1].GetUInt8() < _minLevel)
{
- sLog->outRemote("User %s has no privilege to login", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User %s has no privilege to login", user.c_str());
return -1;
}
else if (fields[2].GetInt32() != -1)
{
- sLog->outRemote("User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
return -1;
}
@@ -225,7 +225,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass)
if (!result)
{
- sLog->outRemote("Wrong password for user: %s", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Wrong password for user: %s", user.c_str());
return -1;
}
@@ -248,7 +248,7 @@ int RASocket::authenticate()
if (recv_line(pass) == -1)
return -1;
- sLog->outRemote("Login attempt for user: %s", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Login attempt for user: %s", user.c_str());
if (check_access_level(user) == -1)
return -1;
@@ -256,7 +256,7 @@ int RASocket::authenticate()
if (check_password(user, pass) == -1)
return -1;
- sLog->outRemote("User login: %s", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User login: %s", user.c_str());
return 0;
}
@@ -290,7 +290,7 @@ int RASocket::subnegotiate()
if (n >= 1024)
{
- sLog->outRemote("RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
return -1;
}
@@ -324,7 +324,7 @@ int RASocket::subnegotiate()
uint8 param = buf[++i];
ss << uint32(param);
- sLog->outRemote(ss.str().c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, ss.str().c_str());
}
++i;
}
@@ -385,7 +385,7 @@ void RASocket::zprint(void* callbackArg, const char * szText)
if (socket->putq(mb, const_cast<ACE_Time_Value*>(&ACE_Time_Value::zero)) == -1)
{
- sLog->outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
mb->release();
}
}
@@ -406,7 +406,7 @@ void RASocket::commandFinished(void* callbackArg, bool /*success*/)
if (socket->putq(mb) == -1)
{
// getting here is bad, command can't be marked as complete
- sLog->outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
mb->release();
}
}
diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp
index 26b28b25fbb..3ce4d4f59cb 100755
--- a/src/server/worldserver/TCSoap/TCSoap.cpp
+++ b/src/server/worldserver/TCSoap/TCSoap.cpp
@@ -32,11 +32,11 @@ void TCSoapRunnable::run()
soap.send_timeout = 5;
if (!soap_valid_socket(soap_bind(&soap, m_host.c_str(), m_port, 100)))
{
- sLog->outError("TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port);
exit(-1);
}
- sLog->outString("TCSoap: bound to http://%s:%d", m_host.c_str(), m_port);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "TCSoap: bound to http://%s:%d", m_host.c_str(), m_port);
while (!World::IsStopped())
{
@@ -119,7 +119,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
int acc = connection.pendingCommands.acquire();
if (acc)
{
- sLog->outError("TCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "TCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
}
// alright, command finished
diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h
index 285adaaaf4b..51ffb3a91c8 100755
--- a/src/server/worldserver/TCSoap/TCSoap.h
+++ b/src/server/worldserver/TCSoap/TCSoap.h
@@ -51,7 +51,7 @@ class SOAPCommand
{
public:
SOAPCommand():
- pendingCommands(0, USYNC_THREAD, "pendingCommands")
+ pendingCommands(0, USYNC_THREAD, "pendingCommands"), m_success(false)
{
}
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index b14038c9571..55443f4253b 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -20,11 +20,13 @@
# SERVER RATES
# AUTO BROADCAST
# BATTLEGROUND CONFIG
+# BATTLEFIELD CONFIG
# ARENA CONFIG
# NETWORK CONFIG
# CONSOLE AND REMOTE ACCESS
# CHARACTER DELETE OPTIONS
# CUSTOM SERVER OPTIONS
+# LOGGING SYSTEM SETTINGS
#
###################################################################################################
@@ -48,7 +50,7 @@
#
# RealmID
# Description: ID of the Realm using this config.
-# Important: RealmID must match the realmlist inside the realmd database.
+# Important: RealmID must match the realmlist inside the auth database.
# Default: 1
RealmID = 1
@@ -173,7 +175,7 @@ Compression = 1
# PlayerLimit
# Description: Maximum number of players in the world. Excluding Mods, GMs and Admins.
# Important: If you want to block players and only allow Mods, GMs or Admins to join the
-# server, use the DB field "realmd.realmlist.allowedSecurityLevel".
+# server, use the DB field "auth.realmlist.allowedSecurityLevel".
# Default: 100 - (Enabled)
# 1+ - (Enabled)
# 0 - (Disabled, No limit)
@@ -398,91 +400,12 @@ PersistentCharacterCleanFlags = 0
#
# PidFile
# Description: World daemon PID file
-# Example: "./worldd.pid" - (Enabled)
-# Default: "" - (Disabled)
+# Example: "./world.pid" - (Enabled)
+# Default: "" - (Disabled)
PidFile = ""
#
-# LogLevel
-# Description: Server console level of logging
-# Default: 1 - (Basic)
-# 0 - (Minimum)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-LogLevel = 1
-
-#
-# LogFile
-# Description: Log file for main server log.
-# Default: "Server.log" - (Enabled)
-# "" - (Disabled)
-
-LogFile = "Server.log"
-
-#
-# LogTimestamp
-# Description: Append timestamp to the server log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogTimestamp = 0
-
-#
-# LogFileLevel
-# Description: Server file level of logging
-# Default: 0 - (Minimum)
-# 1 - (Basic)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-LogFileLevel = 0
-
-#
-# Debug Log Mask
-# Description: Bitmask that determines which debug log output (level 3)
-# will be logged.
-# Possible flags:
-# 1 - Anything related to units that doesn't fit in other
-# categories.
-# 2 - Anything related to pets.
-# 4 - Anything related to vehicles.
-# 8 - Anything related to C++ AI, instance scripts, etc.
-# 16 - Anything related to DB AI, such as SAI, EAI, CreatureAI
-# 32 - Anything related to DB map scripts
-# 64 - Anything related to network input/output,
-# such as packet handlers and netcode logs
-# 128 - Anything related to the spellsystem and aurasystem
-# 256 - Anything related to the achievement system
-# 512 - Anything related to the condition system
-# 1024 - Anything related to the pool system
-# 2048 - Anything related to the auction house
-# 4096 - Anything related to arena's and battlegrounds
-# 8192 - Anything related to outdoor PVP
-# 16384 - Anything related to the chat system
-# 32768 - Anything related to the LFG system
-# 65536 - Anything related to maps, instances (not scripts),
-# grids, cells, visibility, etc.
-# 131072 - Anything related to player loading from DB
-# (Player::_LoadXXX functions)
-# 262144 - Anything related to items
-# 524288 - Anything related to player skills
-# (do not confuse with spells)
-# 1048576 - Anything related to loot
-# 2097152 - Anything related to guilds
-# 4194304 - Anything related to transports
-# 8388608 - Anything related to Warden anti cheat
-#
-# Simply add the values together to create a bitmask.
-# For more info see enum DebugLogFilters in Log.h
-#
-# Default: 0 (nothing)
-
-DebugLogMask = 0
-
-#
# PacketLogFile
# Description: Binary packet logging file for the world server.
# Filename extension must be .bin to be parsable with WowPacketParser.
@@ -492,231 +415,6 @@ DebugLogMask = 0
PacketLogFile = ""
#
-# DBErrorLogFile
-# Description: Log file for database errors.
-# Default: "DBErrors.log" - (Enabled)
-# "" - (Disabled)
-
-DBErrorLogFile = "DBErrors.log"
-
-#
-# CharLogFile
-# Description: Log file for character operations
-# Default: "Char.log" - (Enabled)
-# "" - (Disabled)
-
-CharLogFile = "Char.log"
-
-#
-# CharLogTimestamp
-# Description: Append timestamp to the character log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-CharLogTimestamp = 0
-
-#
-# CharLogDump
-# Description: Write a character dump in the CharLogFile before deleting it.
-# For restoration, copy character data from log file starting from
-# line == START DUMP == to line == END DUMP == (exclusive)
-# and load it using the "pdump load" command.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-CharLogDump = 0
-
-#
-# CharLogDump.Separate
-# Description: Write character dump to separate files files rather than adding it to the
-# CharLogFile.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-CharLogDump.Separate = 0
-
-#
-# CharLogDump.SeparateDir
-# Description: Write dump files into the sub folder within the log folder.
-# Example: "chardumps" - (Enabled)
-# Default: "" - (Disabled)
-
-CharLogDump.SeparateDir = ""
-
-#
-# GmLogFile
-# Description: Log file for gamemaster commands.
-# Default: "GM.log" - (Enabled)
-# "" - (Disabled)
-
-GmLogFile = "GM.log"
-
-#
-# GmLogTimestamp
-# Description: Append timestamp to the gamemaster log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-GmLogTimestamp = 0
-
-#
-# GmLogPerAccount
-# Description: Create a log file per gamemaster account.
-# Important: Logs not created if GmLogFile is not set.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-GmLogPerAccount = 0
-
-#
-# RaLogFile
-# Description: Log file for Remote Access commands.
-# Default: "RA.log" - (Enabled)
-# "" - (Disabled)
-
-RaLogFile = "RA.log"
-
-#
-# ArenaLogFile
-# Description: Log file for arena fights and arena team creations.
-# Example: "Arena.log" - (Enabled)
-# Default: "" - (Disabled)
-
-ArenaLogFile = ""
-
-#
-# ArenaLog.ExtendedInfo
-# Description: Include extended info to ArenaLogFile for each player after rated arena
-# matches (guid, name, team, IP, healing/damage done, killing blows).
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-ArenaLog.ExtendedInfo = 0
-
-#
-# SQLDeveloperLogFile
-# Description: Log file for core-generated SQL queries/dumps
-# Example: "SQLDev.log" - (Enabled)
-# Default: "" - (Disabled)
-
-SQLDeveloperLogFile = ""
-
-#
-# SQLDriverLogFile
-# Description: Log file for SQL driver events.
-# Example: "SQLDriver.log" - (Enabled)
-# Default: "" - (Disabled)
-
-SQLDriverLogFile = ""
-
-#
-# SQLDriverQueryLogging
-# Description: Log SQL queries to the SQLDriverLogFile and console.
-# Default: 0 - (Disabled, Query errors only)
-# 1 - (Enabled, Full query logging - may have performance impact)
-
-SQLDriverQueryLogging = 0
-
-#
-# LogColors
-# Description: Colors for log messages (Format: "normal basic detail debug").
-# Colors: 0 - Black
-# 1 - Red
-# 2 - Green
-# 3 - Brown
-# 4 - Blue
-# 5 - Magenta
-# 6 - Cyan
-# 7 - Grey
-# 8 - Yellow
-# 9 - Lred
-# 10 - Lgreen
-# 11 - Lblue
-# 12 - Lmagenta
-# 13 - Lcyan
-# 14 - White
-# Example: "13 11 9 5" - (Enabled)
-# Default: "" - (Disabled)
-
-LogColors = ""
-
-#
-# EnableLogDB
-# Description: Write log messages to database (LogDatabaseInfo).
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-EnableLogDB = 0
-
-#
-# DBLogLevel
-# Description: Log level of databases logging.
-# Default: 2 - (Detail)
-# 0 - (Minimum)
-# 1 - (Basic)
-# 3 - (Full/Debug)
-
-DBLogLevel = 2
-
-#
-# LogDB.Char
-# Description: Log character operations to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.Char = 0
-
-#
-# LogDB.GM
-# Description: Log gamemaster commands to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.GM = 0
-
-#
-# LogDB.RA
-# Description: Log remote access events to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.RA = 0
-
-#
-# LogDB.World
-# Description: Log world server packets to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled, May have performance impact)
-
-LogDB.World = 0
-
-#
-# LogDB.Chat
-# Description: Log chat messages to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.Chat = 0
-
-
-# ChatLogFile
-# Description: Log file for chat logs.
-# Default: "Chat.log" - (Enabled)
-# "" - (Disabled)
-
-ChatLogFile = "Chat.log"
-
-# ChatLogTimestamp
-# Description: Append timestamp to the chat log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-ChatLogTimestamp = 0
-
-#
# ChatLogs.Channel
# Description: Log custom channel chat.
# Default: 0 - (Disabled)
@@ -790,6 +488,7 @@ ChatLogs.Addon = 0
ChatLogs.BattleGround = 0
+# Extended Logging system configuration moved to end of file (on purpose)
#
###################################################################################################
@@ -1461,15 +1160,6 @@ Warden.NumMemChecks = 3
Warden.NumOtherChecks = 7
#
-# Warden.LogFile
-# Description: Client check fails will be logged here.
-# Default: "" - (Disabled)
-# "Warden.log" - (Enabled)
-#
-
-Warden.LogFile = ""
-
-#
# Warden.ClientResponseDelay
# Description: Time (in seconds) before client is getting disconnecting for not responding.
# Default: 600 - (10 Minutes)
@@ -1489,7 +1179,7 @@ Warden.ClientCheckHoldOff = 30
#
# Warden.ClientCheckFailAction
# Description: Default action being taken if a client check failed. Actions can be
-# overwritten for each single check via warden_action table in characters
+# overwritten for each single check via warden_action table in characters
# database.
# Default: 0 - (Disabled, Logging only)
# 1 - (Kick)
@@ -1520,6 +1210,14 @@ Warden.BanDuration = 86400
AllowTwoSide.Accounts = 1
#
+# AllowTwoSide.Interaction.Calendar
+# Description: Allow calendar invites between factions.
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+AllowTwoSide.Interaction.Calendar = 0
+
+#
# AllowTwoSide.Interaction.Chat
# Description: Allow say chat between factions.
# Default: 0 - (Disabled)
@@ -2252,9 +1950,9 @@ Rate.MoveSpeed = 1
#
# Rate.InstanceResetTime
-# Description: Multiplier for the rate between global raid/heroic instance resets
-# (dbc value). Higher value increases the time between resets,
-# lower value lowers the time, you need clean instance_reset in
+# Description: Multiplier for the rate between global raid/heroic instance resets
+# (dbc value). Higher value increases the time between resets,
+# lower value lowers the time, you need clean instance_reset in
# characters db in order to let new values work.
# Default: 1
@@ -2496,6 +2194,62 @@ Battleground.Random.ResetHour = 6
###################################################################################################
###################################################################################################
+# BATTLEFIELD CONFIG
+#
+# Wintergrasp.Enable
+# Description: Enable the Wintergrasp battlefield.
+# Default: 0 - (Disabled)
+# 1 - (Enabled, Experimental as of still being in development)
+
+Wintergrasp.Enable = 0
+
+#
+# Wintergrasp.PlayerMax
+# Description: Maximum number of players allowed in Wintergrasp.
+# Default: 100
+
+Wintergrasp.PlayerMax = 100
+
+#
+# Wintergrasp.PlayerMin
+# Description: Minimum number of players required for Wintergrasp.
+# Default: 0
+
+Wintergrasp.PlayerMin = 0
+
+#
+# Wintergrasp.PlayerMinLvl
+# Description: Required character level for the Wintergrasp battle.
+# Default: 77
+
+Wintergrasp.PlayerMinLvl = 77
+
+#
+# Wintergrasp.BattleTimer
+# Description: Time (in minutes) for the Wintergrasp battle to last.
+# Default: 30
+
+Wintergrasp.BattleTimer = 30
+
+#
+# Wintergrasp.NoBattleTimer
+# Description: Time (in minutes) between Wintergrasp battles.
+# Default: 150
+
+Wintergrasp.NoBattleTimer = 150
+
+#
+# Wintergrasp.CrashRestartTimer
+# Description: Time (in minutes) to delay the restart of Wintergrasp if the world server
+# crashed during a running battle.
+# Default: 10
+
+Wintergrasp.CrashRestartTimer = 10
+
+#
+###################################################################################################
+
+###################################################################################################
# ARENA CONFIG
#
# Arena.MaxRatingDifference
@@ -2515,6 +2269,13 @@ Arena.MaxRatingDifference = 150
Arena.RatingDiscardTimer = 600000
#
+# Arena.RatedUpdateTimer
+# Description: Time (in milliseconds) between checks for matchups in rated arena
+# Default: 5000 - (5 seconds)
+
+Arena.RatedUpdateTimer = 5000
+
+#
# Arena.AutoDistributePoints
# Description: Automatically distribute arena points.
# Default: 0 - (Disabled)
@@ -2575,6 +2336,15 @@ Arena.ArenaStartPersonalRating = 0
Arena.ArenaStartMatchmakerRating = 1500
#
+# ArenaLog.ExtendedInfo
+# Description: Include extended info to ArenaLogFile for each player after rated arena
+# matches (guid, name, team, IP, healing/damage done, killing blows).
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+ArenaLog.ExtendedInfo = 0
+
+#
###################################################################################################
###################################################################################################
@@ -2881,3 +2651,173 @@ PlayerDump.DisallowOverwrite = 1
#
###################################################################################################
+
+###################################################################################################
+#
+# LOGGING SYSTEM SETTINGS
+#
+# Appender config values: Given a appender "name"
+# Appender.name
+# Description: Defines 'where to log'
+# Format: Type,LogLevel,Flags,optional1,optional2
+#
+# Type
+# 0 - (None)
+# 1 - (Console)
+# 2 - (File)
+# 3 - (DB)
+#
+# LogLevel
+# 0 - (Disabled)
+# 1 - (Trace)
+# 2 - (Debug)
+# 3 - (Info)
+# 4 - (Warn)
+# 5 - (Error)
+# 6 - (Fatal)
+#
+# Flags:
+# 0 - None
+# 1 - Prefix Timestamp to the text
+# 2 - Prefix Log Level to the text
+# 4 - Prefix Log Filter type to the text
+# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS (Only used with Type = 2)
+# 16 - Make a backup of existing file before overwrite (Only used with Mode = w)
+#
+# Colors (read as optional1 if Type = Console)
+# Format: "fatal error warn info debug trace"
+# 0 - BLACK
+# 1 - RED
+# 2 - GREEN
+# 3 - BROWN
+# 4 - BLUE
+# 5 - MAGENTA
+# 6 - CYAN
+# 7 - GREY
+# 8 - YELLOW
+# 9 - LRED
+# 10 - LGREEN
+# 11 - LBLUE
+# 12 - LMAGENTA
+# 13 - LCYAN
+# 14 - WHITE
+# Example: "13 11 9 5 3 1"
+#
+# File: Name of the file (read as optional1 if Type = File)
+# Allows to use one "%s" to create dynamic files
+#
+# Mode: Mode to open the file (read as optional2 if Type = File)
+# a - (Append)
+# w - (Overwrite)
+#
+
+Appender.Console=1,3,0
+Appender.Server=2,2,0,Server.log,w
+Appender.GM=2,2,0,GM.log
+Appender.DBErrors=2,2,0,DBErrors.log
+Appender.Char=2,2,0,Char.log,w
+Appender.RA=2,2,0,RA.log
+Appender.Warden=2,4,0,Warden.log
+Appender.Chat=2,2,0,Chat.log
+Appender.CharDump=2,2,0,%s.log
+Appender.Arenas=2,2,0,Arena.log
+Appender.SQLDev=2,2,0,SQLDev.log
+Appender.SQLDriver=2,2,0,SQLDriver.log
+
+# Appenders
+# Description: List of Appenders to read from config
+# (Using spaces as separator).
+# Default: "Console Server GM DBErrors Char RA Warden Chat"
+
+Appenders=Console Server GM DBErrors Char RA Warden Chat
+
+# Logger config values: Given a logger "name"
+# Logger.name
+# Description: Defines 'What to log'
+# Format: Type,LogLevel,AppenderList
+# Type
+# 0 - Default. Each type that has no config will
+# rely on this one. Core will create this logger
+# (disabled) if it's not configured
+# 1 - Units that doesn't fit in other categories
+# 2 - Pets
+# 3 - Vehicles
+# 4 - C++ AI, instance scripts, etc.
+# 5 - DB AI, such as SAI, EAI, CreatureAI
+# 6 - DB map scripts
+# 7 - Network input/output,
+# such as packet handlers and netcode logs
+# 8 - Spellsystem and aurasystem
+# 9 - Achievement system
+# 10 - Condition system
+# 11 - Pool system
+# 12 - Auction house
+# 13 - Arena's and battlegrounds
+# 14 - Outdoor PVP
+# 15 - Chat system
+# 16 - LFG system
+# 17 - Maps, instances (not scripts),
+# grids, cells, visibility, etc.
+# 18 - Player that doesn't fit in other categories.
+# 19 - Player loading from DB
+# (Player::_LoadXXX functions)
+# 20 - Items
+# 21 - Player skills (do not confuse with spells)
+# 22 - Player chat logs
+# 23 - loot
+# 24 - guilds
+# 25 - transports
+# 26 - SQL. DB errors
+# 27 - GM Commands
+# 28 - Remote Access Commands
+# 29 - Warden
+# 30 - Authserver
+# 31 - Worldserver
+# 32 - Game Events
+# 33 - Calendar
+# 34 - Character (Exclusive to log login, logout, create, rename)
+# 35 - Arenas
+# 36 - SQL Driver
+# 37 - SQL Dev
+# 38 - Player Dump
+# 39 - Battlefield
+# 40 - Server Loading
+# 41 - Opcodes (just id and name sent / received)
+# LogLevel
+# 0 - (Disabled)
+# 1 - (Trace)
+# 2 - (Debug)
+# 3 - (Info)
+# 4 - (Warn)
+# 5 - (Error)
+# 6 - (Fatal)
+#
+# AppenderList: List of appenders linked to logger
+# (Using spaces as separator).
+#
+
+Logger.Root=0,5,Console Server
+Logger.Chat=22,2,Chat
+Logger.DBErrors=26,5,Console Server DBErrors
+Logger.GM=27,3,Console Server GM
+Logger.RA=28,3,RA
+Logger.Warden=29,4,Warden
+Logger.WorldServer=31,3,Console Server
+Logger.Character=34,3,Char
+Logger.Arenas=35,3,Arenas
+Logger.SQLDriver=36,5,SQLDriver
+Logger.SQLDev=37,3,SQLDev
+Logger.CharDump=38,3,CharDump
+Logger.Load=40,3,Console Server
+Logger.Opcodes=41,6,Console Server
+
+#
+# Loggers
+# Description: List of Loggers to read from config
+# (Using spaces as separator).
+# Default: "Root Chat DBErrors GM RA Warden Character Load"
+
+Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer Opcodes
+
+#
+###################################################################################################
diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt
index bde62c24c70..55a136f6329 100644
--- a/src/tools/map_extractor/CMakeLists.txt
+++ b/src/tools/map_extractor/CMakeLists.txt
@@ -43,5 +43,5 @@ add_dependencies(mapextractor mpq)
if( UNIX )
install(TARGETS mapextractor DESTINATION bin)
elseif( WIN32 )
- install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index 1505f2c2cee..d0342717324 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -9,6 +9,7 @@
#include "direct.h"
#else
#include <sys/stat.h>
+#include <unistd.h>
#endif
#include "dbcfile.h"
@@ -48,9 +49,9 @@ char output_path[128] = ".";
char input_path[128] = ".";
uint32 maxAreaId = 0;
-//**************************************************
+// **************************************************
// Extractor options
-//**************************************************
+// **************************************************
enum Extract
{
EXTRACT_MAP = 1,
@@ -221,7 +222,7 @@ uint32 ReadMapDBC()
map_ids[x].id = dbc.getRecord(x).getUInt(0);
strcpy(map_ids[x].name, dbc.getRecord(x).getString(1));
}
- printf("Done! (%u maps loaded)\n", map_count);
+ printf("Done! (%zu maps loaded)\n", map_count);
return map_count;
}
@@ -246,7 +247,7 @@ void ReadAreaTableDBC()
maxAreaId = dbc.getMaxId();
- printf("Done! (%u areas loaded)\n", area_count);
+ printf("Done! (%zu areas loaded)\n", area_count);
}
void ReadLiquidTypeTableDBC()
@@ -267,7 +268,7 @@ void ReadLiquidTypeTableDBC()
for(uint32 x = 0; x < liqTypeCount; ++x)
LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
- printf("Done! (%u LiqTypes loaded)\n", liqTypeCount);
+ printf("Done! (%zu LiqTypes loaded)\n", liqTypeCount);
}
//
@@ -572,7 +573,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/,
// Try store as packed in uint16 or uint8 values
if (!(heightHeader.flags & MAP_HEIGHT_NO_HEIGHT))
{
- float step;
+ float step = 0;
// Try Store as uint values
if (CONF_allow_float_to_int)
{
@@ -900,7 +901,7 @@ void ExtractMapsFromMpq(uint32 build)
printf("Convert map files\n");
for(uint32 z = 0; z < map_count; ++z)
{
- printf("Extract %s (%d/%d) \n", map_ids[z].name, z+1, map_count);
+ printf("Extract %s (%d/%u) \n", map_ids[z].name, z+1, map_count);
// Loadup map grid data
sprintf(mpq_map_name, "World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name);
WDT_file wdt;
@@ -980,13 +981,13 @@ void ExtractDBCFiles(int locale, bool basicLocale)
}
// extract DBCs
- int count = 0;
+ uint32 count = 0;
for (set<string>::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter)
{
string filename = path;
filename += (iter->c_str() + strlen("DBFilesClient\\"));
- if(ExtractFile(iter->c_str(), filename))
+ if (ExtractFile(iter->c_str(), filename))
++count;
}
printf("Extracted %u DBC files\n\n", count);
diff --git a/src/tools/map_extractor/dbcfile.cpp b/src/tools/map_extractor/dbcfile.cpp
index 927d3d62b7f..c1cab7ddb2f 100644
--- a/src/tools/map_extractor/dbcfile.cpp
+++ b/src/tools/map_extractor/dbcfile.cpp
@@ -3,12 +3,12 @@
#include "dbcfile.h"
#include "mpq_libmpq04.h"
-DBCFile::DBCFile(const std::string &filename):
- filename(filename),
- data(0)
+DBCFile::DBCFile(const std::string& filename):
+ filename(filename), recordSize(0), recordCount(0), fieldCount(0), stringSize(0), data(NULL), stringTable(NULL)
{
}
+
bool DBCFile::open()
{
MPQFile f(filename.c_str());
diff --git a/src/tools/vmap4_extractor/adtfile.cpp b/src/tools/vmap4_extractor/adtfile.cpp
index a966172a3be..a605118eead 100644
--- a/src/tools/vmap4_extractor/adtfile.cpp
+++ b/src/tools/vmap4_extractor/adtfile.cpp
@@ -26,7 +26,7 @@
#define snprintf _snprintf
#endif
-const char * GetPlainName(const char * FileName)
+char const* GetPlainName(char const* FileName)
{
const char * szTemp;
@@ -35,7 +35,7 @@ const char * GetPlainName(const char * FileName)
return FileName;
}
-char * GetPlainName(char * FileName)
+char* GetPlainName(char* FileName)
{
char * szTemp;
@@ -44,24 +44,21 @@ char * GetPlainName(char * FileName)
return FileName;
}
-void fixnamen(char *name, size_t len)
+void fixnamen(char* name, size_t len)
{
- for (size_t i=0; i<len-3; i++)
+ for (size_t i = 0; i < len-3; i++)
{
- if (i>0 && name[i]>='A' && name[i]<='Z' && isalpha(name[i-1]))
- {
+ if (i > 0 && name[i] >= 'A' && name[i] <= 'Z' && isalpha(name[i-1]))
name[i] |= 0x20;
- } else if ((i==0 || !isalpha(name[i-1])) && name[i]>='a' && name[i]<='z')
- {
+ else if ((i == 0 || !isalpha(name[i-1])) && name[i]>='a' && name[i]<='z')
name[i] &= ~0x20;
- }
}
//extension in lowercase
- for(size_t i=len-3; i<len; i++)
+ for (size_t i = len - 3; i < len; i++)
name[i] |= 0x20;
}
-void fixname2(char *name, size_t len)
+void fixname2(char* name, size_t len)
{
for (size_t i=0; i<len-3; i++)
{
@@ -70,15 +67,15 @@ void fixname2(char *name, size_t len)
}
}
-char * GetExtension(char * FileName)
+char* GetExtension(char* FileName)
{
- char * szTemp;
- if((szTemp = strrchr(FileName, '.')) != NULL)
+ char* szTemp;
+ if (szTemp = strrchr(FileName, '.'))
return szTemp;
return NULL;
}
-ADTFile::ADTFile(char* filename): ADT(filename)
+ADTFile::ADTFile(char* filename): ADT(filename), nWMO(0), nMDX(0), WmoInstansName(NULL), ModelInstansName(NULL)
{
Adtfilename.append(filename);
}
@@ -99,7 +96,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
xMap = TempMapNumber.substr(TempMapNumber.find("_")+1,(TempMapNumber.find_last_of("_")-1) - (TempMapNumber.find("_")));
yMap = TempMapNumber.substr(TempMapNumber.find_last_of("_")+1,(TempMapNumber.length()) - (TempMapNumber.find_last_of("_")));
Adtfilename.erase((Adtfilename.length()-xMap.length()-yMap.length()-2), (xMap.length()+yMap.length()+2));
- string AdtMapNumber = xMap + ' ' + yMap + ' ' + GetPlainName((char*)Adtfilename.c_str());
+ //string AdtMapNumber = xMap + ' ' + yMap + ' ' + GetPlainName((char*)Adtfilename.c_str());
//printf("Processing map %s...\n", AdtMapNumber.c_str());
//printf("MapNumber = %s\n", TempMapNumber.c_str());
//printf("xMap = %s\n", xMap.c_str());
@@ -159,18 +156,17 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
{
if (size)
{
- char *buf = new char[size];
+ char* buf = new char[size];
ADT.read(buf, size);
- char *p=buf;
+ char* p=buf;
int q = 0;
WmoInstansName = new string[size];
while (p<buf+size)
{
- string path(p);
- char* s=GetPlainName(p);
- fixnamen(s,strlen(s));
- fixname2(s,strlen(s));
- p=p+strlen(p)+1;
+ char* s = GetPlainName(p);
+ fixnamen(s, strlen(s));
+ fixname2(s, strlen(s));
+ p += strlen(p) + 1;
WmoInstansName[q++] = s;
}
delete[] buf;
diff --git a/src/tools/vmap4_extractor/dbcfile.cpp b/src/tools/vmap4_extractor/dbcfile.cpp
index 2474cea5259..a651456d916 100644
--- a/src/tools/vmap4_extractor/dbcfile.cpp
+++ b/src/tools/vmap4_extractor/dbcfile.cpp
@@ -23,9 +23,10 @@
#include <cstdio>
-DBCFile::DBCFile(const std::string &filename) : filename(filename)
+DBCFile::DBCFile(const std::string& filename):
+ filename(filename), recordSize(0), recordCount(0), fieldCount(0), stringSize(0), data(NULL), stringTable(NULL)
{
- data = NULL;
+
}
bool DBCFile::open()
diff --git a/src/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp
index e81972f521f..57f9b421dbe 100644
--- a/src/tools/vmap4_extractor/model.cpp
+++ b/src/tools/vmap4_extractor/model.cpp
@@ -26,15 +26,14 @@
Model::Model(std::string &filename) : filename(filename), vertices(0), indices(0)
{
+ memset(&header, 0, sizeof(header));
}
bool Model::open()
{
MPQFile f(filename.c_str());
- ok = !f.isEof();
-
- if (!ok)
+ if (f.isEof())
{
f.close();
// Do not show this error on console to avoid confusion, the extractor can continue working even if some models fail to load
@@ -52,9 +51,7 @@ bool Model::open()
vertices = new Vec3D[header.nBoundingVertices];
f.read(vertices,header.nBoundingVertices*12);
for (uint32 i=0; i<header.nBoundingVertices; i++)
- {
vertices[i] = fixCoordSystem(vertices[i]);
- }
f.seek(0);
f.seekRelative(header.ofsBoundingTriangles);
indices = new uint16[header.nBoundingTriangles];
@@ -73,13 +70,13 @@ bool Model::open()
bool Model::ConvertToVMAPModel(const char * outfilename)
{
int N[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
- FILE * output=fopen(outfilename,"wb");
- if(!output)
+ FILE* output=fopen(outfilename, "wb");
+ if (!output)
{
printf("Can't create the output file '%s'\n",outfilename);
return false;
}
- fwrite(szRawVMAPMagic,8,1,output);
+ fwrite(szRawVMAPMagic, 8, 1, output);
uint32 nVertices = 0;
nVertices = header.nBoundingVertices;
fwrite(&nVertices, sizeof(int), 1, output);
@@ -101,20 +98,18 @@ bool Model::ConvertToVMAPModel(const char * outfilename)
wsize = sizeof(uint32) + sizeof(unsigned short) * nIndexes;
fwrite(&wsize, sizeof(int), 1, output);
fwrite(&nIndexes, sizeof(uint32), 1, output);
- if(nIndexes >0)
- {
+ if (nIndexes >0)
fwrite(indices, sizeof(unsigned short), nIndexes, output);
- }
- fwrite("VERT",4, 1, output);
+
+ fwrite("VERT", 4, 1, output);
wsize = sizeof(int) + sizeof(float) * 3 * nVertices;
fwrite(&wsize, sizeof(int), 1, output);
fwrite(&nVertices, sizeof(int), 1, output);
- if(nVertices >0)
+ if (nVertices >0)
{
for(uint32 vpos=0; vpos <nVertices; ++vpos)
- {
std::swap(vertices[vpos].y, vertices[vpos].z);
- }
+
fwrite(vertices, sizeof(float)*3, nVertices, output);
}
@@ -134,24 +129,24 @@ Vec3D fixCoordSystem2(Vec3D v)
return Vec3D(v.x, v.z, v.y);
}
-ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
+ModelInstance::ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
+ : model(NULL), d1(0), w(0.0f)
{
float ff[3];
f.read(&id, 4);
- f.read(ff,12);
- pos = fixCoords(Vec3D(ff[0],ff[1],ff[2]));
- f.read(ff,12);
- rot = Vec3D(ff[0],ff[1],ff[2]);
- f.read(&scale,4);
+ f.read(ff, 12);
+ pos = fixCoords(Vec3D(ff[0], ff[1], ff[2]));
+ f.read(ff, 12);
+ rot = Vec3D(ff[0], ff[1], ff[2]);
+ f.read(&scale, 4);
// scale factor - divide by 1024. blizzard devs must be on crack, why not just use a float?
sc = scale / 1024.0f;
char tempname[512];
sprintf(tempname, "%s/%s", szWorkDirWmo, ModelInstName);
- FILE *input;
- input = fopen(tempname, "r+b");
+ FILE* input = fopen(tempname, "r+b");
- if(!input)
+ if (!input)
{
//printf("ModelInstance::ModelInstance couldn't open %s\n", tempname);
return;
@@ -167,7 +162,9 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID,
uint16 adtId = 0;// not used for models
uint32 flags = MOD_M2;
- if(tileX == 65 && tileY == 65) flags |= MOD_WORLDSPAWN;
+ if (tileX == 65 && tileY == 65)
+ flags |= MOD_WORLDSPAWN;
+
//write mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, name
fwrite(&mapID, sizeof(uint32), 1, pDirfile);
fwrite(&tileX, sizeof(uint32), 1, pDirfile);
diff --git a/src/tools/vmap4_extractor/model.h b/src/tools/vmap4_extractor/model.h
index a6f4e27583c..7dd69212b54 100644
--- a/src/tools/vmap4_extractor/model.h
+++ b/src/tools/vmap4_extractor/model.h
@@ -21,12 +21,9 @@
#include "loadlib/loadlib.h"
#include "vec3d.h"
-//#include "mpq.h"
#include "modelheaders.h"
#include <vector>
-class Model;
-class WMOInstance;
class MPQFile;
Vec3D fixCoordSystem(Vec3D v);
@@ -35,18 +32,14 @@ class Model
{
public:
ModelHeader header;
- uint32 offsBB_vertices, offsBB_indices;
- Vec3D *BB_vertices, *vertices;
- uint16 *BB_indices, *indices;
- size_t nIndices;
+ Vec3D* vertices;
+ uint16* indices;
bool open();
- bool ConvertToVMAPModel(const char * outfilename);
+ bool ConvertToVMAPModel(char const* outfilename);
- bool ok;
-
- Model(std::string &filename);
- ~Model() {_unload();}
+ Model(std::string& filename);
+ ~Model() { _unload(); }
private:
void _unload()
@@ -56,22 +49,22 @@ private:
vertices = NULL;
indices = NULL;
}
+
std::string filename;
- char outfilename;
};
class ModelInstance
{
public:
- Model *model;
+ Model* model;
uint32 id;
Vec3D pos, rot;
unsigned int d1, scale;
- float w,sc;
+ float w, sc;
- ModelInstance() {}
- ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile);
+ ModelInstance() : model(NULL), d1(0), scale(0), w(0.0f), sc(0.0f), id(0) {}
+ ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
};
diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h
index ed51022de78..89f715e9e87 100644
--- a/src/tools/vmap4_extractor/mpq_libmpq04.h
+++ b/src/tools/vmap4_extractor/mpq_libmpq04.h
@@ -24,7 +24,7 @@ public:
void close();
void GetFileListTo(vector<string>& filelist) {
- uint32 filenum;
+ uint32_t filenum;
if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return;
libmpq__off_t size, transferred;
libmpq__file_unpacked_size(mpq_a, filenum, &size);
@@ -60,8 +60,8 @@ class MPQFile
libmpq__off_t pointer,size;
// disable copying
- MPQFile(const MPQFile &f) {}
- void operator=(const MPQFile &f) {}
+ MPQFile(const MPQFile& /*f*/) {}
+ void operator=(const MPQFile& /*f*/) {}
public:
MPQFile(const char* filename); // filenames are not case sensitive
diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp
index e60a773c6de..40a22a2a6e0 100644
--- a/src/tools/vmap4_extractor/vmapexport.cpp
+++ b/src/tools/vmap4_extractor/vmapexport.cpp
@@ -159,12 +159,12 @@ bool ExtractSingleWmo(std::string& fname)
int p = 0;
//Select root wmo files
- const char * rchr = strrchr(plain_name, '_');
+ char const* rchr = strrchr(plain_name, '_');
if(rchr != NULL)
{
char cpy[4];
- strncpy((char*)cpy,rchr,4);
- for (int i=0;i < 4; ++i)
+ strncpy((char*)cpy, rchr, 4);
+ for (int i = 0; i < 4; ++i)
{
int m = cpy[i];
if(isdigit(m))
@@ -200,7 +200,7 @@ bool ExtractSingleWmo(std::string& fname)
strcpy(temp, fname.c_str());
temp[fname.length()-4] = 0;
char groupFileName[1024];
- sprintf(groupFileName,"%s_%03d.wmo",temp, i);
+ sprintf(groupFileName, "%s_%03u.wmo", temp, i);
//printf("Trying to open groupfile %s\n",groupFileName);
string s = groupFileName;
@@ -382,9 +382,9 @@ bool processArgv(int argc, char ** argv, const char *versionString)
{
bool result = true;
hasInputPathParam = false;
- bool preciseVectorData = false;
+ preciseVectorData = false;
- for(int i=1; i< argc; ++i)
+ for(int i = 1; i < argc; ++i)
{
if(strcmp("-s",argv[i]) == 0)
{
@@ -447,7 +447,7 @@ int main(int argc, char ** argv)
const char *versionString = "V4.00 2012_02";
// Use command line arguments, when some
- if(!processArgv(argc, argv, versionString))
+ if (!processArgv(argc, argv, versionString))
return 1;
// some simple check if working dir is dirty
@@ -469,7 +469,7 @@ int main(int argc, char ** argv)
printf("Extract %s. Beginning work ....\n",versionString);
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// Create the working directory
- if(mkdir(szWorkDirWmo
+ if (mkdir(szWorkDirWmo
#ifdef __linux__
, 0711
#endif
@@ -482,11 +482,11 @@ int main(int argc, char ** argv)
for (size_t i=0; i < archiveNames.size(); ++i)
{
MPQArchive *archive = new MPQArchive(archiveNames[i].c_str());
- if(!gOpenArchives.size() || gOpenArchives.front() != archive)
+ if (gOpenArchives.empty() || gOpenArchives.front() != archive)
delete archive;
}
- if(gOpenArchives.empty())
+ if (gOpenArchives.empty())
{
printf("FATAL ERROR: None MPQ archive found by path '%s'. Use -d option with proper path.\n",input_path);
return 1;
@@ -494,15 +494,15 @@ int main(int argc, char ** argv)
ReadLiquidTypeTableDBC();
// extract data
- if(success)
+ if (success)
success = ExtractWmo();
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//map.dbc
- if(success)
+ if (success)
{
DBCFile * dbc = new DBCFile("DBFilesClient\\Map.dbc");
- if(!dbc->open())
+ if (!dbc->open())
{
delete dbc;
printf("FATAL ERROR: Map.dbc not found in data file.\n");
@@ -510,7 +510,7 @@ int main(int argc, char ** argv)
}
map_count=dbc->getRecordCount ();
map_ids=new map_id[map_count];
- for(unsigned int x=0;x<map_count;++x)
+ for (unsigned int x=0;x<map_count;++x)
{
map_ids[x].id=dbc->getRecord (x).getUInt(0);
strcpy(map_ids[x].name,dbc->getRecord(x).getString(1));
@@ -527,7 +527,7 @@ int main(int argc, char ** argv)
}
printf("\n");
- if(!success)
+ if (!success)
{
printf("ERROR: Extract %s. Work NOT complete.\n Precise vector data=%d.\nPress any key.\n",versionString, preciseVectorData);
getchar();
diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp
index e3ee545db19..a799a928710 100644
--- a/src/tools/vmap4_extractor/wdtfile.cpp
+++ b/src/tools/vmap4_extractor/wdtfile.cpp
@@ -30,7 +30,7 @@ char * wdtGetPlainName(char * FileName)
return FileName;
}
-WDTFile::WDTFile(char* file_name, char* file_name1):WDT(file_name)
+WDTFile::WDTFile(char* file_name, char* file_name1) : WDT(file_name), gWmoInstansName(NULL), gnWMO(0)
{
filename.append(file_name1,strlen(file_name1));
}
@@ -78,9 +78,8 @@ bool WDTFile::init(char *map_id, unsigned int mapID)
char *p=buf;
int q = 0;
gWmoInstansName = new string[size];
- while (p<buf+size)
+ while (p < buf + size)
{
- string path(p);
char* s=wdtGetPlainName(p);
fixnamen(s,strlen(s));
p=p+strlen(p)+1;
@@ -89,23 +88,20 @@ bool WDTFile::init(char *map_id, unsigned int mapID)
delete[] buf;
}
}
- else if (!strcmp(fourcc,"MODF"))
+ else if (!strcmp(fourcc, "MODF"))
{
// global wmo instance data
if (size)
{
gnWMO = (int)size / 64;
- string gWMO_mapname;
- string fake_mapname;
- fake_mapname = "65 65 ";
- //gWMO_mapname = fake_mapname + filename;
- gWMO_mapname = fake_mapname + std::string(map_id);
- for (int i=0; i<gnWMO; ++i)
+
+ for (int i = 0; i < gnWMO; ++i)
{
int id;
WDT.read(&id, 4);
- WMOInstance inst(WDT,gWmoInstansName[id].c_str(),mapID, 65, 65, dirfile);
+ WMOInstance inst(WDT,gWmoInstansName[id].c_str(), mapID, 65, 65, dirfile);
}
+
delete[] gWmoInstansName;
}
}
diff --git a/src/tools/vmap4_extractor/wdtfile.h b/src/tools/vmap4_extractor/wdtfile.h
index f3d71c41791..2c66dbceb92 100644
--- a/src/tools/vmap4_extractor/wdtfile.h
+++ b/src/tools/vmap4_extractor/wdtfile.h
@@ -13,16 +13,15 @@ class WDTFile
public:
WDTFile(char* file_name, char* file_name1);
~WDTFile(void);
- bool init(char *map_id, unsigned int mapID);
+ bool init(char* map_id, unsigned int mapID);
string* gWmoInstansName;
- int gnWMO, nMaps;
+ int gnWMO;
ADTFile* GetMap(int x, int z);
private:
MPQFile WDT;
- bool maps[64][64];
string filename;
};
diff --git a/src/tools/vmap4_extractor/wmo.cpp b/src/tools/vmap4_extractor/wmo.cpp
index 6703872111b..0bc749b9bd5 100644
--- a/src/tools/vmap4_extractor/wmo.cpp
+++ b/src/tools/vmap4_extractor/wmo.cpp
@@ -31,8 +31,12 @@
using namespace std;
extern uint16 *LiqType;
-WMORoot::WMORoot(std::string &filename) : filename(filename)
+WMORoot::WMORoot(std::string &filename)
+ : filename(filename), col(0), nTextures(0), nGroups(0), nP(0), nLights(0),
+ nModels(0), nDoodads(0), nDoodadSets(0), RootWMOID(0), liquidType(0)
{
+ memset(bbcorn1, 0, sizeof(bbcorn1));
+ memset(bbcorn2, 0, sizeof(bbcorn2));
}
bool WMORoot::open()
@@ -57,7 +61,7 @@ bool WMORoot::open()
size_t nextpos = f.getPos() + size;
- if (!strcmp(fourcc,"MOHD"))//header
+ if (!strcmp(fourcc,"MOHD")) // header
{
f.read(&nTextures, 4);
f.read(&nGroups, 4);
@@ -68,8 +72,8 @@ bool WMORoot::open()
f.read(&nDoodadSets, 4);
f.read(&col, 4);
f.read(&RootWMOID, 4);
- f.read(bbcorn1,12);
- f.read(bbcorn2,12);
+ f.read(bbcorn1, 12);
+ f.read(bbcorn2, 12);
f.read(&liquidType, 4);
break;
}
@@ -120,15 +124,15 @@ bool WMORoot::open()
return true;
}
-bool WMORoot::ConvertToVMAPRootWmo(FILE *pOutfile)
+bool WMORoot::ConvertToVMAPRootWmo(FILE* pOutfile)
{
//printf("Convert RootWmo...\n");
- fwrite(szRawVMAPMagic,1,8,pOutfile);
+ fwrite(szRawVMAPMagic, 1, 8, pOutfile);
unsigned int nVectors = 0;
- fwrite(&nVectors,sizeof(nVectors),1,pOutfile); // will be filled later
- fwrite(&nGroups,4,1,pOutfile);
- fwrite(&RootWMOID,4,1,pOutfile);
+ fwrite(&nVectors,sizeof(nVectors), 1, pOutfile); // will be filled later
+ fwrite(&nGroups, 4, 1, pOutfile);
+ fwrite(&RootWMOID, 4, 1, pOutfile);
return true;
}
@@ -136,9 +140,13 @@ WMORoot::~WMORoot()
{
}
-WMOGroup::WMOGroup(std::string &filename) : filename(filename),
- MOPY(0), MOVI(0), MoviEx(0), MOVT(0), MOBA(0), MobaEx(0), hlq(0), LiquEx(0), LiquBytes(0)
+WMOGroup::WMOGroup(const std::string &filename) :
+ filename(filename), MOPY(0), MOVI(0), MoviEx(0), MOVT(0), MOBA(0), MobaEx(0),
+ hlq(0), LiquEx(0), LiquBytes(0), groupName(0), descGroupName(0), mogpFlags(0),
+ mopy_size(0), moba_size(0), LiquEx_size(0), nVertices(0), nTriangles(0)
{
+ memset(bbcorn1, 0, sizeof(bbcorn1));
+ memset(bbcorn2, 0, sizeof(bbcorn2));
}
bool WMOGroup::open()
@@ -237,7 +245,7 @@ bool WMOGroup::open()
return true;
}
-int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPreciseVectorData)
+int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool preciseVectorData)
{
fwrite(&mogpFlags,sizeof(uint32),1,output);
fwrite(&groupWMOID,sizeof(uint32),1,output);
@@ -246,7 +254,7 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis
fwrite(bbcorn2, sizeof(float), 3, output);
fwrite(&liquflags,sizeof(uint32),1,output);
int nColTriangles = 0;
- if(pPreciseVectorData)
+ if (preciseVectorData)
{
char GRP[] = "GRP ";
fwrite(GRP,1,4,output);
@@ -479,10 +487,9 @@ WMOGroup::~WMOGroup()
delete [] LiquBytes;
}
-WMOInstance::WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
+WMOInstance::WMOInstance(MPQFile& f, char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile)
+ : currx(0), curry(0), wmo(NULL), doodadset(0), pos(), indx(0), d3(0)
{
- pos = Vec3D(0,0,0);
-
float ff[3];
f.read(&id, 4);
f.read(ff,12);
diff --git a/src/tools/vmap4_extractor/wmo.h b/src/tools/vmap4_extractor/wmo.h
index d1f7b82f0c6..74e666d3f82 100644
--- a/src/tools/vmap4_extractor/wmo.h
+++ b/src/tools/vmap4_extractor/wmo.h
@@ -50,14 +50,13 @@ public:
float bbcorn1[3];
float bbcorn2[3];
- WMORoot(std::string &filename);
+ WMORoot(std::string& filename);
~WMORoot();
bool open();
- bool ConvertToVMAPRootWmo(FILE *output);
+ bool ConvertToVMAPRootWmo(FILE* output);
private:
std::string filename;
- char outfilename;
};
struct WMOLiquidHeader
@@ -89,30 +88,29 @@ public:
uint16 nBatchB;
uint32 nBatchC, fogIdx, liquidType, groupWMOID;
- int mopy_size,moba_size;
+ int mopy_size, moba_size;
int LiquEx_size;
unsigned int nVertices; // number when loaded
int nTriangles; // number when loaded
- char *MOPY;
- uint16 *MOVI;
- uint16 *MoviEx;
- float *MOVT;
- uint16 *MOBA;
- int *MobaEx;
- WMOLiquidHeader *hlq;
- WMOLiquidVert *LiquEx;
- char *LiquBytes;
+ char* MOPY;
+ uint16* MOVI;
+ uint16* MoviEx;
+ float* MOVT;
+ uint16* MOBA;
+ int* MobaEx;
+ WMOLiquidHeader* hlq;
+ WMOLiquidVert* LiquEx;
+ char* LiquBytes;
uint32 liquflags;
- WMOGroup(std::string &filename);
+ WMOGroup(std::string const& filename);
~WMOGroup();
bool open();
- int ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPreciseVectorData);
+ int ConvertToVMAPGroupWmo(FILE* output, WMORoot* rootWMO, bool preciseVectorData);
private:
std::string filename;
- char outfilename;
};
class WMOInstance
@@ -122,13 +120,13 @@ public:
std::string MapName;
int currx;
int curry;
- WMOGroup *wmo;
+ WMOGroup* wmo;
Vec3D pos;
Vec3D pos2, pos3, rot;
- uint32 indx,id, d2, d3;
+ uint32 indx, id, d2, d3;
int doodadset;
- WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile);
+ WMOInstance(MPQFile&f , char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
static void reset();
};