-
Notifications
You must be signed in to change notification settings - Fork 2
feat: methods of BotMessageBuffer done #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0ead444
feat: added BotMessageBuffer
032cea7
refacto: removed dummy class BotMessageBuffer in BotClient
55ac9fe
build: when your cpu owes you money or something
vantavoids 99bfffb
feat: methods of BotMessageBuffer done
e203004
fix: no more merge conflict :)
vantavoids File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,5 @@ compile_commands.json | |
|
|
||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| .bonus | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-----::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::----------------------------------------------------------------------------------------------------------------::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::--------------------------------------------------------------------------------------------------------------------------------------------::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::------------------------------------------------------------------------------------------------------=------==-===-=---=--=-----------------------------::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::------------------------------------------------------------------------------------------=====-=+===++=+=++=++==---=---------:::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--::::::::::::::::::::::::::::::::::::::::::::---==++++==+==++++++*****+**#+**++==-==----:::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--::::-*=++=+**###**+*+*+**##**++*#+++++***+----:::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-+===+=++=+=***##%####%%%#%%%##**+++=*+++====-:::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-:---=+===+=+##%%%##%%%%%%@%%%%%%%%#%##*+==-===++=---:::::::::::::::::::::::::::::::::::.:::::::: | ||
| ..........::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--==++===+#%%%%%%@%@@@@@@%@@@@@%@@@%%%%%##*+-=+++==---::::::::::::::::::::::::::::::::::::::::::: | ||
| .....:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-===+*+*%%%%%%%@@@@@@@@@@@@@@@@@@@@@@@%%%%%#*+==+**+==---:::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::----++*%%%%%%%%@@@@@@@@@@@@@@@@@@@@@@@@@%%%%%%#*=--==------::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--:-+*#%%%%%%%@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%%%%%##++*+==-:::::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--::+*%%%%%%%%%@@@@@@@@@@@@@@@@@@@@@@@@@@%%%%%%%%%##*++=--:::-:::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::---=#%%##%%%%%%%%%@@@@@@@@@@@@@@@@@@@@@@%%%%%%%%%%%##+++-:-:::-::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::----::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-----*###%#%%%%%%%%%@@@@@@@@@@@@@@@@@%%@%%%%%%%#########*=-:-----::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::-----::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-=--=#####%%%%%%%%%%%%@%%@@@@@%@%@@@@%%%%%%%%%%%########*+--:::--::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::----::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::---=*#######%#%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#####******+=::-:---:::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::---::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--:-=*###########%%%#%%%%%%%%%%%%%%%%%%%%%%%%%#####********=--:----:::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--::-=***#*####%%###%####%%######%%%%####%%%%#######********=-::-----::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-::-=****########%%#%%#%%%%%%%%%%%%%%%%%%%%%%%%#*#********+=-:::-:::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-:---:-=+****#####%%%%%%%%%%#######%%#%%%%%%%#####*##*******++--:::::-:::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::----:-=+****###%%%%%%%%%%%%%%%##%#%%##%%%%%%%#######******++=-::::::-:::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::------=+**###%%%%%#%%#%%#%%%%%%%%%%%%%%%%%%%%%%#%%###*#****+==::::::--::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::-----::::::::::::::::::::::::::::::::::::::::::::::::::::---:--=+**#%%%%%##*#####*#%%######%#########%####%%%##%#***++=-:::----::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::::::::::-----:::::::::::::::::::::::::::::::::::::::::::::::::::---::--=**####%####%#**+++++****#**************#####****+*****=-:::::--::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::------:::::::::::::::::::::::::-----------:::::::::::::::::::::::::::::::::::::::::::::::--:::--+*#****+==++==--==-===+++=+++=+=====-=-===========+**#*=-::---=-::::::::::::::::::::::::::::::::::: | ||
| ::::::::------------------------------------------===========---:::::::::::::::::::::::::::::::::::::::::---:---*##*===------:::::::--========----------:--------=+**#*+--:--==--::::::::::::::::::::::::::::------ | ||
| :::::----=======----------------===============+++++++++++++++==-------::::::::::::::::::::::::::::::::::----:-=*##*=-:-----------------==++==-----------------=-=***#*+-::=--==---:::::::::::::::::::::::::----=== | ||
| ::::---====++++=====-------================+++++**************++==------:::::::::::::::::::::::::::::::::-:----=*###+=--:::::::::::-::-=+**++=---::::::::-::---===**#**+--:---===--::::::::::::::::::::::::----==== | ||
| :::---===+++++++======================+++++++++*****######*****+===------::::::::::::::::::::::::::::::::::==--=**#*++=-:--------::::::+###%#=::::::::---:::---=*+****+=-:-======--::::::::::::::::::::::::----==== | ||
| :::---===++++++======================+++++++++*****##########**++==------::::::::::::::::::::::::::::::::::+=-==**###*++++======------=+#%%%%+------------+=+*=******++==-==+=+==--:::::::::::::::::::::::::---==== | ||
| ::::--===+++======-------=================+++++*****#######****+==-------:::::::::::::::::::::::::::::::::-+=-=+*###%#####+-:::--:--=+*###%%%#==:--=====+++==*##*##***+==--==++==--::::::::::::::::::::::::::----== | ||
| :::::----=====-------------------===========++++**************++==------::::::::::::::::::::::::::::::::::-**===+######%%%##*+=+++++*##%*##%%##+=--:----::-+***####***+==--=+++===---::::::::::::::::::::::::::---- | ||
| ::::::-------:--------------------------=====+++****++++******++==------:::::::::::::::::::::::::::::::::::+#+==+#########%%%#%#########%%%%%#*##*++++++*#%%%%%##****+=-=-=++++====--:::::::::::::::::::::::::::--- | ||
| :::::::::::::::::::--------------------====++*******++++*******++==-----::::::::::::::::::::::::::::::::::::=*#+=****+++*####%#%%%%#**####%%%#####%%%%%%%%%%%#******++==***++++=====---:::::::::::::::::::::::::--- | ||
| :::::::::---------------------------=====+++*******************++==----------::::::::::::::::::::::::::::::--***+++++=+##*******==-=+*#####%%####*-=++####**####****++-+***++++====----:---:::::::::::::::::::----- | ||
| ::::::------------------------------=====+++*******************++==--------------------------:::::::::::-----+++=+====***++==+=----**#****####***##=--==++*++***+++++===*+++======-----------::::::::::::::::------ | ||
| ::::--------------------------------=====++++******++++++++++*++==-------------------------------------------=++=+=-==========---==****###*##*++****----==++++++*+=++++=+++======-----------------------------===== | ||
| :-------------==========++++++++++++======+++++++++++====++++++===-----====================+++++++++==========++++==-========---+**====##******++====----=======++==++++++=======--------------=-===============+++ | ||
| -==========+++++***#####%%%%%%%%%%%%###*******+++++++++++++++++==========+++++++++++==++++++++****+++++++=++++++++=========----+***=-::-=====++=--=++=----==========+++++===-==--------======================++++++ | ||
| ===++++++++++***####%%%%%%@@@@@@@@@%%%%####*******++++++++++++++=======+++++++++++++++++++++*******++++++++++==--+======---::--=+**+==--:-===-::-=+*+==----=========++======================================+++++++ | ||
| =+++++++++++****###%%%%%@@@@@@@@@@@@%%%%####*********+++++++++++=======+++++++++++++++++++++********+++++====----+=======------=+**++==---:::---=+++++=---:-========+----=====================================+++++ | ||
| +++++++++++++***###%%%%%%@@@@@@@@@@@%%%%#####*******+++++++++++++======+++++++++++++++++++++++****++++======-----========-:----===+====--------==+=+===-------=====++:::---========================--============== | ||
| ====++++++++++***####%%%%%%%@@@@@@%%%%#####*******+++++++++++++++=======++++++===========+++++++++=========-----::==+=====--------------------=======---------======-::::---------===------------------------------ | ||
| ==============+++*****#######%%%%#####******+++++++++++++++========---==================================------:::::=====+==-----------:::::-----:::::-------========:::::::::::------------------------------------ | ||
| --------------====================================================-----===============-==------========-------:::::-=========++*****++============+**++===-========-::::-:::::::----------------------------------- | ||
| --------=============================+++++++++++++++++++++++***++++==+++******+==========------:--====-------::::::-========++***++=+++++=======+******+==========:::::::--:::::::-------------------------======== | ||
| ----====++=++++******************************#####################******#+==============------------------:::-:::::-*-====--=++++++=====-==========+++*++========:::::::::---::::::::::-----------------------===== | ||
| ---==+++++++++****###******************################%%%%%%%%%%###*+================---:-----:::------:::::::::::=#=--==--=+**+++====----========++++++=======:::::::::::----::::::::::::::::::::---------------= | ||
| ---==++++++++**************************##########################*================-------:-------------::::::::::::-%===-===-==++**++++=========++++++++=======#:::::::::::::-::::::::::::::::::::::::::----------- | ||
| ---===+++++++++++******************************###############+=============---------------------------:::::::::::::%*==-=====-==*++++++++====+****+++========+%::::::::::::::::::-::::::::::::::::::::::::::::::-- | ||
| ::---========================================+++++++++++++=================----------------------------:::::::::::::#%====-====-==++===++++===+++++++=========+%::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::-----====----------------------------------------=------===-==========-----------::::::::::-------::::::::::::::#%#======================================-+@::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::-----------:::::::::::::-----------------------==----==============----------::::::::::::-------::::::::::::::+%%====================================-::+%::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::---------------==-===========-------------:::::::::::::-------::::::::::::::-%%*----================+++==+========-:::*%::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::::::::---------------=--=========--------------:::::::::::---------:::::::::::::::#%#=:---===========++++++++++=======-:::-%%::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::---------:-----=-=========-------------:::::::::::----------:::::::::::::::#%%+::--=========++++++++++++=====--::::*%#::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::::::::::::::::::::::::::::----------:-------====------------------:::::::::::-:-----:::::::::::::::::*%%#-::--========++++++++++++====-:::::=%@*::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::::::::::::::::::::::::::::::::::-----------------::------====----------------:::::::::::::::--::::::::::::::::::::=%%%+::::--=======++++++++++====-:::::-%%@+::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::::::::::::::--------------------===========--------------=------------------:::::::::::::::::::::::::::::::::::::-#%%#=:::---======++++++++++==--:::::-#+*#*::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::::--------------------------=========+++++++=-:----::-------------------:----::::::::::::::::::::::::::::::::::::::#%%%#-::-----==+==++++++++==--:::::=#=**#:::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::-------------------------==========+++******+-::---::-----------------------:::::::::::::::::::::::::::::::::::::::#%%%%#=:------====+++++++==---::::+*==**::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::-------------------------===========+++**++++--::--:::::-------------------::::::::::::::::::::::::::::::::::::::::*%%%%*#=-------===+++++==-----:::+*+==*:::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| :::-------------------------------------========-:::::::::::------------------::::::::::::::::::::::::::::::::::::::::=%*+*++**-------========-----:::**++=+-:::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::-----------------------------------:::------::::::::::::::---------------::::::::::::::::::::::::::::::::::::::::::#*+++++***------=====------::-**++==--:::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::-----------------------------------::::::----::::::::::::::--------------:::::::::::::-::::::::::::::::::::::::::::**++++***###--------------::-***+====-:::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ::::------------------------======+++++****#*-----:::::::::::::::------------::::::::::::::::::::::::::::::::::::::::::+=+++++****##*-:---------:::*#*+=====::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ----===============++++++****####%%%@@@@@@@@@=----:::::::::::::::::::------::::::::::::::::::::::::::::::::::::::::::::-=++++++*****##+:::::---:::=##*+++===::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ==+++++++++++++******######%%%%%@@@@@@@@@@@@@@----::::::::::::::::::::::----:::::::::::::::::::::::::::::::::::::::::::===++++++******#*+-::::::::##*+++++==::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ****####*******#######%%%%%%%%@@@@@@@@@@@@@@@@@+--:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::==++**++++**+++**###+-:::-+#***++++=-::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
| ******##********###########%%%%%%%@@@@@@@@@@@@@:::--:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-=+++++++++++++++++++++=-+#****+++++-:::::::::::::::::::::::::::::::::::::::::::::::::::.:.. | ||
| +++++++++++++++++++++++++***********#########%-:::::--:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-===++++++===++++++++++++##********+-:::::::::::::::::::::::::::::::::::::::::::::::::::::.. | ||
| --------------------------------------------------::::-::::::::::::...::::::::::::::::::::::::::::::::::::::::::::::::::+====++++++===++++++++*###*******++::::::::::::::::::::::::::::::::::::::::::::::::::...... | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| if [[ $# -lt 3 ]]; then | ||
| echo "Usage: $0 <hostname> <port> <password>" | ||
| echo "Example: $0 127.0.0.1 6667 lol" | ||
| exit 1 | ||
| fi | ||
|
|
||
| HOST="$1" | ||
| PORT="$2" | ||
| PASS="$3" | ||
|
|
||
| CLIENTS=1000 | ||
| CHANNEL="#the-void" | ||
| MAX_DEATHS=10 | ||
| MESSAGE="this is a test message" | ||
| SLEEP_BETWEEN_MSGS=0.01 # set to 0 for max pain | ||
|
|
||
| rand_nick() { | ||
| echo "lab$(tr -dc a-z0-9 </dev/urandom | head -c6)" | ||
| } | ||
|
|
||
| rand_goodbye() { | ||
| shuf -n1 <<-EOF | ||
| brb dissolving | ||
| lost to entropy | ||
| lab rat escaped | ||
| signal collapsed | ||
| EOF | ||
| } | ||
|
|
||
| # choose victims | ||
| DEATH_COUNT=$(shuf -i0-$MAX_DEATHS -n1) | ||
| DEAD_CLIENTS=$(shuf -i1-$CLIENTS -n "$DEATH_COUNT") | ||
|
|
||
| should_die() { | ||
| grep -qx "$1" <<< "$DEAD_CLIENTS" | ||
| } | ||
|
|
||
| echo "[*] Target: $HOST:$PORT" | ||
| echo "[*] Clients: $CLIENTS" | ||
| echo "[*] Mid-stream deaths: $DEATH_COUNT" | ||
|
|
||
| for i in $(seq 1 "$CLIENTS"); do | ||
| ( | ||
| nick=$(rand_nick) | ||
| msg_count=$(shuf -i100-200 -n1) | ||
|
|
||
| { | ||
| echo "PASS $PASS" | ||
| echo "NICK $nick" | ||
| echo "USER $nick 0 * : Lab rat" | ||
| echo "JOIN $CHANNEL" | ||
|
|
||
| for m in $(seq 1 "$msg_count"); do | ||
| echo "PRIVMSG $CHANNEL :$MESSAGE [$m/$msg_count]" | ||
| sleep "$SLEEP_BETWEEN_MSGS" | ||
|
|
||
| if should_die "$i" && (( m == msg_count / 2 )); then | ||
| # abrupt disconnect (no QUIT) | ||
| exit 0 | ||
| fi | ||
| done | ||
|
|
||
| echo "QUIT :$(rand_goodbye)" | ||
| } | nc "$HOST" "$PORT" >/dev/null 2>&1 | ||
| ) & | ||
| done | ||
|
|
||
| wait | ||
| echo "[*] Tests complete, surely your server hasn't died right :)?" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #pragma once | ||
| #include <iostream> | ||
| #include <cstddef> | ||
| #include <vector> | ||
|
|
||
| #include "core/IMessageBuffer.hpp" | ||
| #include "core/IServer.hpp" | ||
| #include "bot/IBot.hpp" | ||
|
|
||
|
|
||
| class BotMessageBuffer : public IMessageBuffer | ||
| { | ||
| private: | ||
| IServer &m_server; | ||
| IBot *m_bot; | ||
| std::string m_readBuffer; | ||
| std::string m_writeBuffer; | ||
|
|
||
| void processIncomingMessage(const std::string& raw); | ||
| void parseAndDispatch(const std::string& prefix, | ||
| const std::string& command, | ||
| const std::vector<std::string>& params); | ||
|
|
||
| void setBot(IBot* bot); | ||
| void setBotClient(IClient* client); | ||
|
|
||
| public: | ||
| BotMessageBuffer(IServer& server); | ||
| virtual ~BotMessageBuffer(); | ||
|
|
||
| void appendRead(const std::string& data); | ||
| bool hasCompleteMessage() const; | ||
| std::string getNextMessage(); | ||
| size_t getReadBufferSize() const; | ||
|
|
||
| void appendWrite(const std::string& data); | ||
| void consumeWriteBuffer(size_t bytes); | ||
| const std::string& getWriteBuffer() const; | ||
| void clearWriteBuffer(); | ||
|
|
||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #pragma one | ||
|
|
||
| #include "bot/IBot.hpp" | ||
| #include "core/IServer.hpp" | ||
|
|
||
| class NielBot : public IBot | ||
| { | ||
| private: | ||
| IServer* m_server; | ||
| IClient* m_client; | ||
| bool contains42(const std::string& msg)const; | ||
| void sendReply(IChannel* channel); | ||
|
|
||
| public: | ||
| NielBot(IServer* server, IClient* botClient); | ||
| virtual ~NielBot(); | ||
|
|
||
| void onPrivateMessage(IClient* sender, const std::string& msg); | ||
| void onChannelMessage(IClient* sender, IChannel* channel, const std::string& msg); | ||
|
|
||
| IClient* getClient(); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ | |
| #include <string> | ||
|
|
||
| class IMessageBuffer; | ||
| // class MessageBuffer; | ||
|
|
||
| class IClient | ||
| { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
evil XaViEr NiEl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allez hop set as finished -> give up