00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef USE_PCH
00017 #include "sys.h"
00018 #include "debug.h"
00019 #include <libcwd/buf2str.h>
00020 #endif
00021
00022 #include "Application.h"
00023 #include "ClientSession.h"
00024
00025
00026 ClientSessionInput::ClientSessionInput(input_buffer_ct* ibuf) : read_input_tct<text>(ibuf), M_current_msg(static_cast<ClientSession*>(this))
00027 {
00028 }
00029
00030
00031
00032
00033
00034
00035
00036 void ClientSessionInput::decode(msg_block_ct msg_block)
00037 {
00038 #ifdef CWDEBUG
00039
00040 bool is_xchat_ping = (strncmp(msg_block.get_start(), "PING LAG", 5) == 0 && Application::instance().suppress_ping());
00041
00042 bool is_oper = (msg_block.get_size() >= 5 && strncasecmp(msg_block.get_start(), "OPER ", 5) == 0);
00043
00044 if (is_oper)
00045 Dout(dc::clientinput|continued_cf|flush_cf, "ClientSessionInput::decode: Passing OPER message from client to server. Debug output will be turned off... ");
00046
00047 if (is_xchat_ping || is_oper) Debug(libcw_do.off());
00048 #endif
00049
00050 Dout(dc::clientinput, "ClientSessionInput::decode(\"" << buf2str(msg_block.get_start(), msg_block.get_size()) << "\")");
00051
00052
00053 M_current_msg.init(msg_block);
00054
00055
00056 new_message_received(M_current_msg);
00057
00058
00059 Debug(if (is_xchat_ping || is_oper) libcw_do.on());
00060
00061 #ifdef CWDEBUG
00062 if (is_oper)
00063 Dout(dc::finish, "done");
00064 #endif
00065 }