Peter Powell
d1df2bce56
Add CXX11_OVERRIDE to overridden members that lack it.
...
This fixes a ton of warnings when building on compilers that
default to C++11 or newer.
2017-07-12 14:41:52 +01:00
Attila Molnar
03c5ffbdc3
Make ModeHandler::GetUserParameter() const, accept const User
2016-12-30 18:53:04 +01:00
Attila Molnar
f899ea2786
Add const versions of ModeHandler::IsPrefixMode(), IsListModeBase() and IsParameterMode()
2016-08-30 16:01:47 +02:00
Attila Molnar
5a5dcfa4f9
Mark ModeHandler::GetModeChar() and ModeWatcher::GetModeType() as const
2016-08-29 14:50:59 +02:00
Attila Molnar
19f0c09aa7
Convert ModeHandler::GetNumParams() to NeedsParam() that returns a bool
2016-08-29 14:50:08 +02:00
Attila Molnar
299f262a4f
Fix some whitespace issues
2015-12-28 16:59:03 +01:00
Attila Molnar
6fc00fa629
Implement ModeHandler::RegisterService()
2015-11-23 12:51:00 +01:00
Attila Molnar
7010a92426
Change type of some associative containers to their flat versions, including Extensible storage
2014-12-15 17:48:52 +01:00
Attila Molnar
56af4909b8
Add typedef ModeParser::ModeWatcherMap, remove ModeWatchIter
2014-12-15 17:14:09 +01:00
Attila Molnar
3eda212c2a
Migrate code from ModeParser into cmd_mode (core_user)
...
- Process() that takes a std::vector<std::string>
- DisplayCurrentModes()
- DisplayListModes()
2014-09-04 13:30:01 +02:00
Attila Molnar
e3fc46af3e
Split ModeParser::DisplayListMode() into two parts
...
ShowListModeList() sends the list of one listmode to a user, DisplayListMode() calls it for each mode letter
2014-09-04 13:08:22 +02:00
Attila Molnar
117db983d2
Remove unused parameter passed to ModeParser::DisplayCurrentModes()
2014-09-04 13:05:13 +02:00
Attila Molnar
679411e500
Let callers customize the begin/end positions for ModeParser::ModeParamsToChangeList()
...
This helps spanningtree when it deals with a vector of parameters where the modes begin at different positions
2014-09-04 12:27:04 +02:00
Attila Molnar
5bea41d726
Use Modes::ChangeList in ModeHandler::RemoveMode()
2014-09-03 15:35:13 +02:00
Attila Molnar
f55703b2fb
Add a ModeParser::Process() overload that can process an entire Modes::ChangeList
...
This is a wrapper that calls ProcessSingle() repeatedly until the entire changelist is processed
2014-09-03 15:11:27 +02:00
Attila Molnar
c6c43eaf60
Make it possible to resume processing a partially processed Modes::ChangeList
...
Return number of processed mode changes from ModeParser::ProcessSingle() and add a begin index parameter
2014-09-03 15:05:56 +02:00
Attila Molnar
05022b58f2
Split out ModeParser::ModeParamsToChangeList()
2014-09-03 15:03:38 +02:00
Attila Molnar
3d958279c6
Split out ModeParser::ProcessSingle() from Process()
...
This applies up to one MODE line's worth of mode changes from a Modes::ChangeList
2014-09-03 14:47:13 +02:00
Attila Molnar
fb82075a2e
Add mode process flag MODE_CHECKACCESS
2014-09-03 14:37:42 +02:00
Attila Molnar
8003e37f81
Remove ModeHandler::m_paramtype and GetTranslateType()
2014-09-03 14:32:02 +02:00
Attila Molnar
3427e32cc1
Remove ModeParser::LastParseTranslate and GetLastParseTranslate()
2014-09-03 14:31:00 +02:00
Attila Molnar
626005fe12
Remove ModeParser::LastParseParams and GetLastParseParams()
2014-09-03 14:30:04 +02:00
Attila Molnar
e7e315fc9d
m_spanningtree Send MODE/FMODE from the OnMode hook
...
If the MODE_LOCALONLY flag is set the mode change is not propagated
2014-09-03 14:26:40 +02:00
Attila Molnar
f3e803f5b9
Populate a Modes::ChangeList object in ModeParser::Process()
2014-09-03 14:09:03 +02:00
Attila Molnar
39bd7db538
Add Modes::Change and Modes::ChangeList
2014-09-03 14:06:45 +02:00
Attila Molnar
01a6b5d21c
Change mode_sequence to be a const ref in ModeParser::Process()
...
Also change the signature of DisplayListModes() to accept a const ref
2014-09-02 16:32:00 +02:00
Attila Molnar
51da1d3b59
Pass prefix rank and prefix char to PrefixMode constructor
2014-08-06 13:35:40 +02:00
Attila Molnar
53f7229869
Change allocation of InspIRCd::Modes to be physically part of the object containing it using fakederef
2014-06-24 12:10:59 +02:00
Attila Molnar
5a64433015
Throw an exception if ModeParser::AddMode() fails
2014-02-23 12:24:14 +01:00
Attila Molnar
7affd6453d
Add ModeParser::GetModes(), returns all user/chanmodes
2014-02-22 14:00:04 +01:00
Attila Molnar
1b6dda7ad5
Assign an id to user modes, parameter chanmodes and simple chanmodes
2014-02-21 14:42:16 +01:00
Attila Molnar
5303501b93
Add a ModeParser::FindMode() overload that takes a mode name and a mode type
2014-02-20 13:34:27 +01:00
Attila Molnar
f66d05dbda
Create a name -> ModeHandler* map
2014-02-20 13:20:21 +01:00
Attila Molnar
7bcb703bca
Replace ModeMasks with a two-dimensional array
2014-02-18 13:47:10 +01:00
Attila Molnar
8f901b33a8
Change the parameter type of ModeHandler::GiveModeList() from ModeMasks to ModeType
2014-02-18 13:41:01 +01:00
Attila Molnar
0556720b55
Add ParamModeBase and ParamMode, change all parameter modes to inherit from ParamMode
...
- Type of the extension used to store data is a template parameter
- The extension is automatically unset when the mode is unset
- Handlers inheriting from ParamMode have to provide OnSet() and SerializeParam(); may optionally provide OnUnset()
- Transparently handle the case when OnSet() modifies the mode parameter
- Remove Channel::custom_mode_params map; ask the mode handlers to serialize their parameters instead
2014-02-15 14:38:24 +01:00
Attila Molnar
88baaf9e68
Add ModeHandler::IsParameterMode() and MC_PARAM
2014-02-15 13:51:35 +01:00
Attila Molnar
98ef89c392
Remove some dead code
2014-01-31 14:27:32 +01:00
Peter Powell
3b38de5b6e
Fix PrefixMode not being exported which caused runtime link errors.
2013-11-09 16:29:50 +00:00
attilamolnar
7ba2507681
Keep lists of mode handlers by type
2013-09-12 14:44:17 +02:00
attilamolnar
52e4d9c96c
Add ModeHandler::IsListModeBase() and MC_LIST
2013-09-12 14:44:17 +02:00
attilamolnar
16398df07d
Move prefix mode specific fields and getters into PrefixMode
...
Add ModeHandler::IsPrefixMode()
2013-09-11 12:10:07 +02:00
attilamolnar
34fa5627de
Create a base class for prefix modes
...
Move Channel::SetPrefix() into Membership
2013-09-11 12:10:07 +02:00
attilamolnar
537ad4740a
Add a type id field to ModeHandler
2013-09-11 12:10:07 +02:00
attilamolnar
3624c137a6
Introduce ModeProcessFlags, can be passed to ModeParser::Process() to indicate local only mode changes and mode merges
...
Change ProtocolInterface::SendMode() to take source and destination parameters, and call it from the mode parser whenever the mode change is global
This deprecates the ambiguous InspIRCd::SendMode() and InspIRCd::SendGlobalMode() interface (the latter sent mode changes originating from local users twice, etc.)
2013-06-13 18:15:34 +02:00
attilamolnar
b57c0342ca
Store prefix rank in a ModeHandler field, change ModeHandler::GetPrefixRank() to be non-virtual
2013-06-06 03:10:10 +02:00
attilamolnar
b01dc3cb86
Move a few trivial functions into headers
2013-06-02 00:28:55 +02:00
attilamolnar
d16a455400
Watch mode names with ModeWatchers instead of mode letters
2013-06-01 23:41:42 +02:00
attilamolnar
ca838821e7
Remove useless ModeType parameter from ModeWatcher::BeforeMode() and AfterMode()
2013-06-01 23:41:42 +02:00
attilamolnar
3406c7234a
Simplify user mode removal via ModeHandler::RemoveMode()
...
The function does not need to be virtual because the core can remove any user mode using the default logic
The optional modestack parameter was always NULL, so remove it
2013-05-27 01:07:30 +02:00