480 Commits

Author SHA1 Message Date
Attila Molnar
5b6ae9c542 Only compile the testsuite if INSPIRCD_ENABLE_TESTSUITE is defined 2014-02-07 18:21:01 +01:00
Attila Molnar
1db0e984be Add Channel* parameter to OnSendWhoLine 2014-01-25 12:40:21 +01:00
Attila Molnar
932e8d13f8 Convert UserChanList to an intrusively linked list 2014-01-24 12:58:01 +01:00
Attila Molnar
99f79a4e5c Split IOHook into IOHook and IOHookProvider
Create one IOHook instance for each hooked socket which contains all the
hook specific data and read/write/close functions, removing the need for
the "issl_session" array in SSL modules.

Register instances of the IOHookProvider class in the core and use them to
create specialized IOHook instances (OnConnect/OnAccept).

Remove the OnHookIO hook, add a dynamic reference to ListenSocket that
points to the hook provider (if any) to use for incoming connections on
that socket.

For outgoing connections modules still have to find the IOHookProvider
they want to use themselves but instead of calling AddIOHook(hookprov),
now they have to call IOHookProvider::OnConnect() after the connection
has been established.
2014-01-22 19:10:01 +01:00
Attila Molnar
9136136ac3 Move server description field from TreeServer into Server; remove OnGetServerDescription hook 2014-01-05 15:20:17 +01:00
Attila Molnar
1e8389b27f Clean up CoreException
- Remove default constructor
- Replace virtual functions returning C strings with functions returning const std::string refs
2013-12-18 16:20:40 +01:00
Peter Powell
02830985a1 Move stuff around a bit:
- Create FileSystem class:
  * Move ServerConfig::CleanFilename to FileSystem::GetFileName and rewrite.
  * Move ServerConfig::ExpandPath to FileSystem.
  * Move ServerConfig::FileExists to FileSystem.
  * Move ServerConfig::StartsWithWindowsDriveLetter to FileSystem.
- Move FileReader to fileutils.cpp and fix documentation.
- Move UserManager::DoBackgroundUserStuff to usermanager.cpp.
2013-12-15 06:46:35 +00:00
attilamolnar
cc74fb0be4 Pass an interface to the OnSync hooks
Remove Module::ProtoSendMetaData()
2013-09-13 12:15:44 +02:00
attilamolnar
58d7827bb1 Send ListModeBase modes implicitly on channel sync
Remove Module::ProtoSendMode() and ListModeBase::DoSyncChannel()
2013-09-12 14:44:17 +02:00
attilamolnar
ba7431b4fd Hide all symbols that aren't exported explicitly
In addition to reducing the sizes of all binaries this also helps the optimizer
2013-09-08 17:21:37 +02:00
attilamolnar
992674362c Automatically register ServiceProviders created by modules 2013-09-08 17:11:08 +02:00
attilamolnar
8a64bd3a0a Deduplicate code in modmanager_static and modmanager_dynamic 2013-09-08 17:10:15 +02:00
attilamolnar
e6e3ae88fb Remove ModuleManager::ModCount and GetCount() 2013-09-08 16:57:03 +02:00
attilamolnar
fabe111fb9 Fix module loading in PURE_STATIC builds 2013-09-08 16:54:33 +02:00
attilamolnar
d349f981fb Remove ModuleManager::GetAllModuleNames(), use GetModules() instead 2013-08-30 13:15:10 +02:00
attilamolnar
c202dea024 Replace OnRehash() with ReadConfig() that is called on boot, on module load and on rehash
This eliminates the need for calling OnRehash() in init()
2013-08-30 13:15:10 +02:00
attilamolnar
9962840222 Fix a couple of issues
- Wrong doc for Snomask::GetDescription()
- Incorrect idle time when WHOISing remote users
- String + int = garbage
- Remote MODE commands (user mode changes) being broadcast in addition to being forwarded
- Incorrect revision being shown
2013-08-08 15:10:48 +02:00
attilamolnar
d24619c012 Automatically attach modules to events 2013-08-04 16:08:57 +02:00
Adam
8710724b55 Change the syntax of FOREACH macros to be less dumb. 2013-08-04 16:08:57 +02:00
attilamolnar
ac55270a08 Move dynamic_reference and related classes to dynref.h 2013-07-19 19:40:02 +02:00
Peter Powell
146d72fddb Fix Doxygen comments. 2013-06-21 03:52:56 +01:00
attilamolnar
ac72c53ce2 Replace void* dest and target_type parameters of OnMode with a User* and a Channel* 2013-06-13 18:20:10 +02:00
attilamolnar
623ba6ae49 Get rid of the OnRemoteKill hook, make use of GetRouting() and TR_CUSTOM to route KILLs 2013-06-12 21:22:37 +02:00
attilamolnar
98f3924960 Change command name parameter of OnPostCommand to be a Command* 2013-06-12 20:08:22 +02:00
attilamolnar
78900eaa5e Remove deprecated Request cross-module communication mechanism 2013-06-07 01:00:10 +02:00
attilamolnar
79db1cf848 Create IOHook interface (extracted from Module) 2013-06-07 01:00:10 +02:00
attilamolnar
ca4c4a6798 Route WALLOPS like a regular command, remove OnWallops hook 2013-06-02 18:05:01 +02:00
Peter Powell
244a65e855 Clean up the FileReader class and all of the modules that use it.
- Modules which use this class will now have to catch a
  CoreException when opening files if they wish to ignore
  the failed loading of a file.
- m_randquote has been cleaned up massively and the RANDQUOTE
  command has been removed as it was pretty much useless.
2013-05-27 00:15:30 +02:00
Attila Molnar
b36ce84c7d Merge pull request #545 from SaberUK/master+logging-cleanup
Clean up the logging system (part 1 of 2).
2013-05-21 17:11:46 -07:00
attilamolnar
7a67685bcb Remove OnUserPreNotice and OnUserNotice hooks, add MessageType argument to OnUserMessage and OnUserPreMessage
All modules (except m_nonotice) that perform filtering on messages have common logic for handling PRIVMSGs and NOTICEs and most of them run the exact same code in both cases
2013-05-20 23:30:11 +02:00
Peter Powell
3e105c6311 Fix spacing in calls to LogManager::Log. 2013-05-19 19:33:36 +01:00
attilamolnar
8790551dc1 Merge insp20 2013-04-28 00:32:14 +02:00
Adam
8428bbb387 Modularize DNS
The DNS modules are temporarily in commands/ so they're loaded automatically

Thanks to Attila for helping with much of this.
2013-04-26 16:59:29 -05:00
attilamolnar
988d821807 OnUserPreJoin is a local-only hook, change User* parameter to LocalUser* 2013-04-13 15:34:12 +02:00
Peter Powell
11cafc12d5 Tidy up source files:
- Use #pragma once instead of include guards.
- Move header files in src/modules to include/modules.
- Fixed various spacing issues.
2013-04-12 17:03:05 +01:00
Peter Powell
645f7e18c6 Add LOG_ prefix to the log level enum values. 2013-04-12 02:21:19 +01:00
Peter Powell
5c29c53f65 Convert ISUPPORT to use a map instead of a string. 2013-04-11 23:08:03 +01:00
attilamolnar
9eeae94195 Allow dynamic references to reference ServiceProviders, introduce ModeReference
Mode handlers can be referenced using mode/<modename>
2013-04-08 23:13:24 +02:00
attilamolnar
927937d610 Rework dynamic_reference management, introduce dynamic_reference_nocheck
New dynamic references are now resolved at construction and all of them are re-resolved when a relevant service is added or removed; resolution is no longer done in operator->

dynamic_reference_nocheck is a variant of dynamic_reference that does not check for value being null in operator-> / operator*
dynamic_reference still throws an exception when used in this case

Both kinds of dynamic references support .check(): an exception is thrown if this is called when value is null
2013-04-08 23:13:24 +02:00
attilamolnar
9fc218c005 Remove OnAddBan and OnDelBan hooks 2013-04-08 21:55:53 +02:00
attilamolnar
0fa365373e Don't attempt to unload or reload modules that are waiting to be unloaded 2013-04-05 18:23:44 +02:00
attilamolnar
de9cf90b6b Remove more deprecated code
- ConfigReader
- FloodQuitUserHandler
- IsValidModuleCommand
- CallCommandHandler
- DoCleanup from u_listmode.h
2013-04-01 16:10:45 +02:00
Peter Powell
d877be98d1 Purge the deprecated chanprotect module. 2013-04-01 10:43:12 +01:00
attilamolnar
1cb05553e2 Change channel name parameter of Module::OnUserPreJoin() and Channel::JoinUser() to std::string from char* 2013-04-01 02:13:43 +02:00
attilamolnar
d1b9bf8e35 New API version 2013-04-01 01:42:49 +02:00
attilamolnar
fe9e594755 Fix m_dnsbl not checking cgiirc users when the cgiirc address is elined 2013-03-11 20:48:58 +01:00
attilamolnar
d00914ed6f Add a flag to Command that controls whether an empty last parameter is allowed or not 2012-12-15 21:17:06 +01:00
ChrisTX
5b9682275e Windows: In-depth cleanup (see details)
-Fix x64 builds for Windows. Now all configurations compile.
-Remove the non-working rebase stuff.
-Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now.
-Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2
-Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need.
-Enable optimizations for release builds.
-De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure
-Add the VC++ specific bad files in .gitignore
-Disable PID writing on Windows. This is only making sense for *nix builds.
-Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working)
-Removed certain unused functions and variables
-Remove stdint defines from the windows wrapper
-Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds.
-Re-evaluated the warnings list, commented it.
-Moved inspircd_config/_version to include/ to match *nix
-Removed the creation of inspircd_se_config, as it isn't used at all.
-Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out)
-Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly.
-Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down)
-Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded.
-Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways)
-Removed the unused ClearConsole()
-Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate.
-Made inet_aton an inline function for increased performance
-C4800, performance warning about bool forcing, resolved at all occurrences.
-C4701, uninitialized variable 'cached', resolved at all occurrences.
-dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance.
-Removed the wrong CRT debug flags. This drains a lot of performance.
-Removed the clock_gettime/gettimeofday wrappers
-Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function.
-Added a block of C4355 for < VS2012
-Update project files for c870714
2012-10-12 22:31:38 +02:00
attilamolnar
91abba488a New OnUserSetIP() hook 2012-09-13 18:51:28 +02:00
Peter Powell
808a0a0957 Fix Doxygen syntax errors. 2012-07-05 21:00:35 +01:00