This repository was archived by the owner on Aug 2, 2020. It is now read-only.
File tree 4 files changed +41
-0
lines changed
4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ [submodule "extern/librcnb "]
2
+ path = extern/librcnb
3
+ url = [email protected] :rcnbapp/librcnb.git
4
+ branch = 45dd2e77d3f06165c7f0511d9556b88b4497c0dc
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ include(FixDebugLibraryLookup)
14
14
include_directories (${VCPKG_INCLUDE_DIR} )
15
15
include_directories (src)
16
16
17
+ add_subdirectory (extern/librcnb)
18
+ include_directories (extern/librcnb/include )
19
+
17
20
add_definitions (-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
18
21
-D_WIN32_WINNT=0x0501
19
22
-DWIN32_LEAN_AND_MEAN
@@ -44,6 +47,7 @@ target_link_libraries(${LIB_NAME} PRIVATE ${CURL_AND_DEPS_LIBRARIES})
44
47
target_link_libraries (${LIB_NAME} PRIVATE ${SPDLOG_AND_DEPS_LIBRARIES} )
45
48
target_link_libraries (${LIB_NAME} PRIVATE sqlite3)
46
49
target_link_libraries (${LIB_NAME} PRIVATE crypt32 bcrypt)
50
+ target_link_libraries (${LIB_NAME} PRIVATE rcnb-static )
47
51
48
52
cotire(${LIB_NAME} )
49
53
Original file line number Diff line number Diff line change 10
10
#include " cqhttp/utils/jsonex.h"
11
11
#include " cqhttp/utils/string.h"
12
12
13
+ #include " rcnb/decode.h"
14
+ #include " rcnb/encode.h"
15
+
13
16
using namespace std ;
14
17
namespace api = cq::api;
15
18
namespace fs = std::filesystem;
@@ -549,5 +552,34 @@ namespace cqhttp {
549
552
}
550
553
}
551
554
555
+ #pragma endregion
556
+
557
+ #pragma region Easter Egg
558
+
559
+ HANDLER (rcnb) {
560
+ const auto text = params.get_string (" text" );
561
+ const auto action = params.get_string (" action" );
562
+ if (action == " encode" ) {
563
+ rcnb::encoder enc;
564
+ stringstream ss;
565
+ wstringstream wss;
566
+ ss << text;
567
+ enc.encode (ss, wss);
568
+ result.data = ws2s (wss.str ());
569
+ } else if (action == " decode" ) {
570
+ rcnb::decoder dec;
571
+ stringstream ss;
572
+ wstringstream wss;
573
+ wss << s2ws (text);
574
+ dec.decode (wss, ss);
575
+ result.data = ss.str ();
576
+ } else {
577
+ logging::warning (" NB" , " 你的 action 不够 NB!" );
578
+ return ;
579
+ }
580
+ logging::info_success (" NB" , " XXNB!" );
581
+ result.code = Codes::OK;
582
+ }
583
+
552
584
#pragma endregion
553
585
} // namespace cqhttp
You can’t perform that action at this time.
0 commit comments