486 Commits

Author SHA1 Message Date
Attila Molnar
1442193c79 Change the type of the user parameter in the OnUserPreNick() hook from User to LocalUser
No remote users were passed to this hook before.

Remove needless IS_LOCAL() checks.
2014-06-20 16:20:19 +02:00
Peter Powell
e3bcf95ee9 Prefix all definitions in config.h to avoid potential collisions. 2014-05-23 14:13:51 +02:00
Attila Molnar
5b3bc00fb4 Document parameters and return value for the OnNamesListItem() hook 2014-04-20 14:12:59 +02:00
Attila Molnar
5ebb49de65 Change the OnNamesListItem() hook to return ModResult
Return MOD_RES_DENY to exclude the user from the NAMES list
2014-04-20 14:05:21 +02:00
Attila Molnar
9e123ad121 Replace mode letter parameter of OnRawMode() with a ModeHandler*, remove pcnt 2014-02-21 14:18:49 +01:00
Attila Molnar
51b5f06c48 Return a Membership* from get_first_visible_channel() in cmd_who and pass that to modules 2014-02-14 12:00:06 +01:00
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