summaryrefslogtreecommitdiff
path: root/src/map/irc-bot.c
AgeCommit message (Collapse)AuthorFilesLines
2016-04-25Move irc-bot.c documentation to irc-bot.hhemagx1-86/+21
interface a not interfaced function irc_privmsg_ctcp
2016-04-25Added a flood protection to IRC Bothemagx1-11/+103
Now it's possible to send as many messages as possible without get kicked for flood.
2016-02-24Removed several unnecessary explicit casts of the WFIFOP resultHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary RFIFOP typecastsHaru1-1/+1
- While this is arguable, those explicit typecasts are potentially dangerous/misleading (for example, a const specifier might get accidentally dropped without even generating a compiler warning, or a variable type might change during code changes, and any related warning would get silenced by the explicit typecast). - As a reminder Hercules is written in C, and not in C++ (and there's no such thing as "compiling in C++ mode" - they're two different languages.) As such, it is legal to let the compiler automatically promote void* from/to any non-const pointer type, as well as const void* from/to any const pointer type. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to several variable/argument pointersHaru1-8/+9
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-3/+22
Signed-off-by: Haru <haru@dotalux.com>
2015-12-04Add missing checks to irc-bot.cAndrei Karas1-6/+24
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-35/+34
Signed-off-by: Haru <haru@dotalux.com>
2015-09-18Clarified the intent of several assignments inside conditional expressionsHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Moved session array into the socket interfaceHaru1-3/+3
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Cleaned up socket interfaceHaru1-5/+5
- Replaced some macro calls with the proper interface syntax - Removed useless macros and workarounds API changes summary: - WFIFOSET() can now be safely used both inside and outside socket.c - RFIFOSKIP() can now be safely used both inside and outside socket.c - do_close() is now sockt->close() - flush_fifo() is now sockt->flush() - flush_fifos() is now sockt->flush_fifos() - getips() is now sockt->getips() - host2ip() is now sockt->host2ip() - ip2str() is now sockt->ip2str() - ntows() is now sockt->ntows() - make_connection() is now sockt->make_connection() - make_listen_bind() is now sockt->make_listen_bind() - realloc_fifo() is now sockt->realloc_fifo() - realloc_writefifo() is now sockt->realloc_writefifo() - session_isActive() is now sockt->session_is_active() - session_isValid() is now sockt->session_is_valid() - set_defaultparse() is now sockt->set_defaultparse() - set_eof() is now sockt->eof() - set_noblocking() is now sockt->set_noblocking() - str2ip() is now sockt->str2ip() Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-11/+11
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-06-02Follow up to 712812bMysteries1-1/+1
- More link changes - Added proper link to Roulette topic
2015-01-24Added script command 'channelmes'Haru1-3/+9
Special thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
2015-01-24Moved the Hercules Channel System to its own file/interfaceHaru1-22/+22
Signed-off-by: Haru <haru@dotalux.com>
2015-01-18Replacing rand leftovers with the mt19937arshennetsind1-1/+1
Signed-off-by: shennetsind <ind@henn.et>
2014-12-31Improve performance a bit by removing strlen(str) > 0.Andrei Karas1-1/+2
2014-12-06add channels config into clif interface.Andrei Karas1-16/+16
2014-11-16Whitespace cleanup (no code changes)Haru1-1/+1
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-10/+12
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-12/+10
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-10/+12
- Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru <haru@dotalux.com>
2013-12-17Fixed several compiler warningsHaru1-3/+4
- Warnings detected thanks to Xcode's compiler settings (more strict by default) and clang, warnings mostly but not only related to data sizes on 64 bit systems, that were silenced until now by very lax compiler settings. - This also decreases by a great deal the amount of warnings produced by MSVC in x64 mode (for the adventurous ones who tried that) - Also fixed (or silenced in case of false positives) the potential issues pointed out by the (awesome) clang static analyzer. - Patch co-produced with Ind, I'm merging and committing in his place! Signed-off-by: Haru <haru@dotalux.com>
2013-12-09Fixed some logic errorsshennetsind1-1/+1
Special Thanks to Haru Signed-off-by: shennetsind <ind@henn.et>
2013-11-05Introducing the Hercules Standalone Script Syntax CheckerHaru1-1/+4
- Added a command line argument '--script-check' to check a script's syntax without running the server (and without requiring a SQL connection). Usage: ./map-server --script-check /path/to/the/script.txt - For convenience, a script-checker bash script is provided, to set the path correctly when called from a different directory. Usage: /path/to/Hercules/script-checker /path/to/the/script/to/check.txt - While the script checker will supposedly work under windows as well, no convenience scripts are currently provided for platforms other than UNIX (feel free to open a pull request with a .bat launcher or whatever you like) - Integration with IDEs or text editors is possible. In fact, I already have a fully functional plugin for vim (through vim-syntastic), and if there's enough interest, I'll publish it. - screenshot: http://d.pr/i/NOBD - If you want an online checker, http://haru.ws/scriptchecker/ is running this code, without modifications and will be kept up to date (without any warranty though.) - Special thanks to Ind, Yommy, Streusel, who helped making this possible, in a way or another.
2013-10-26Changed 'tick' variables to 64 bitHaru1-3/+3
- This fixes an issue with timers that stop working after about 24-49 days when the tick overflows (note that this may happen much earlier than that, and at hard to predict times, on some systems) - Updated the RDTSC help message in the configure script to also warn users about issues with SpeedStep enabled systems. - On Windows, tick() still has a resolution of 10~15ms (or even as low as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added for a follow-up patch, as I want this one to be as small as possible) - Note: on Windows versions earlier than 6.x (Vista, Server 2008), the tick overflow issue is NOT fixed, since they don't support the function used to retrieve a 64 bit tick. This isn't a big issue, since those platforms are already - or going soon to be - out of their extended support period, and it's already advisable to upgrade, for other reasons. If you're the unfortunate user of such a system, it is recommended that you reboot your machine at least once every 49 days for Hercules to work reliably. - Note: To clear some doubts, since I've already been asked, this has absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about a variable's size, not the size of registers of your CPU, and your 32bit CPU will be able to handle this just fine. Signed-off-by: Haru <haru@dotalux.com>
2013-09-25Renamed iTimer interface to timer.shennetsind1-9/+9
Also removed duplicate mentions of timer within calls to shorten.
2013-08-12Added support for Nick Server GHOST commandHaru1-0/+3
Credits to Yommy for the idea Signed-off-by: Haru <haru@dotalux.com>
2013-08-12Added support for long IRC messagesHaru1-6/+15
- IRC messages are no longer truncated to one line of client chat message, if they are longer than that. They're instead posted as multiple lines. (See comments in the source to disable this, if you wish to.) - Added a define for the max acceptable IRC message length, and increased the size of send_string to fit it Signed-off-by: Haru <haru@dotalux.com>
2013-08-12Small IRC bridge tweaksHaru1-15/+81
- Added documentation for the remaining undocumented functions - Dropped unused function ircbot->join - Moved commented out debug commands to ifdef blocks; to quickly toggle them, (un)comment #define IRBCOT_DEBUG on top of irc-bot.c Signed-off-by: Haru <haru@dotalux.com>
2013-08-12Added support for CTCP commands to the IRC bridgeHaru1-14/+55
- Implements relevant parts from the CTCP specification at http://www.irchelp.org/irchelp/rfc/ctcpspec.html - Fixed parsing of CTCP VERSION requests (follow-up to 19b8cbb) - Added support for new CTCP commands: - ACTION (also known as /me command): will be shown to players in the #irc channel as "[ #irc ] * IRC.<nick> <action message> *" - ERRMSG, FINGER: are silently ignored (irrelevant or deprecated) - PING is replied to with the correct pong reply - TIME is replied to with the current server time Signed-off-by: Haru <haru@dotalux.com>
2013-08-12Added support for JOIN, QUIT, PART, NICK in the IRC bridgeHaru1-0/+68
- It'll now show messages such as: [ #irc ] User IRC.<nick> joined the channel. [ #irc ] User IRC.<nick> left the channel. [Quit: <quit message>] [ #irc ] User IRC.<nick> left the channel. [<leave message>] [ #irc ] User IRC.<old nick> is now known as IRC.<new nick>" - To disable, comment out the respective entries in irc_bot_init. Signed-off-by: Haru <haru@dotalux.com>
2013-08-12Added support for target-less commands in the IRC bridgeHaru1-4/+9
Needed for future updates (such as receiving "QUIT" commands Signed-off-by: Haru <haru@dotalux.com>
2013-07-11Fixed an issue with long hostnames/nicknames in the IRC BridgeHaru1-6/+3
This prevents nickname truncation and other possibly ill side-effects in case the source string for a message is in the form: aNickname!~ident@an.irc.user.with.a.very.long.hostname_________ Signed-off-by: Haru <haru@dotalux.com>
2013-07-01Fixed Bug #7216shennetsind1-0/+2
Special Thanks to Shikazu, wouldn't have been able to identify this issue without his help! http://hercules.ws/board/index.php?app=tracker&showissue=7216 Signed-off-by: shennetsind <ind@henn.et>
2013-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-6/+6
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-06-01IRC Bridge Fix/Adjustmentsshennetsind1-6/+6
All Credits to Haruna~! Thank you very much! Signed-off-by: shennetsind <ind@henn.et>
2013-05-30Memory Slasher - May 30 Patchshennetsind1-1/+5
http://hercules.ws/board/topic/928-memory-slasher-may-30-patch/ Signed-off-by: shennetsind <ind@henn.et>
2013-05-14Follow up dc16b498f6dc8621037e4a596cd47c369576fa23shennetsind1-1/+1
Yahooo an 'n'~! Signed-off-by: shennetsind <ind@henn.et>
2013-05-14Hercules IRC Bridge Fixshennetsind1-7/+21
Special Thanks to Axiom, Wolfed!~ Signed-off-by: shennetsind <ind@henn.et>
2013-04-24Fixed msvc warning on irc-botshennetsind1-7/+9
Special Thanks to Zopokx! Signed-off-by: shennetsind <ind@henn.et>
2013-04-22Hercules April 22 MEGA-ULTRA-LONG Patch~!shennetsind1-0/+272
http://hercules.ws/board/topic/470-hercules-april-22-patch/ Signed-off-by: shennetsind <ind@henn.et>