HIVE SDK for C++

HIVE_Chat.h
Go to the documentation of this file.
1
17#ifndef __HIVE_CHAT_H__
18#define __HIVE_CHAT_H__
19
20#include "HIVE_ResultAPI.h"
21#include <cstdint> // int64_t
22#include <functional> // std::function
23#include <map> // std::map
24#include <string> // std::string
25#include <vector> // std::vector
26#include <mutex>
27
28
29NS_HIVE_BEGIN
30
31class ResultAPI;
32enum class ChannelType;
33enum class SortType;
34enum class ReactionType;
35class Channel;
36class ChannelPage;
37class Member;
38class BlockMember;
44class TranslateParams;
45class ReportMessageParams;
46class ChannelListener;
48class UserListener;
50class ChannelMessage;
52class NoticeMssage;
53class DirectMessage;
54class EnteredMember;
55class ExitedMember;
56class DeletedChannel;
60class TranslationData;
61class Reaction;
62
76class HIVESDK_DLLEXPORT Chat {
77public:
78 // Callback types
79 typedef std::function<void(ResultAPI const & result)> onResult;
80 typedef std::function<void(ResultAPI const & result)> onCreateChannel;
81 typedef std::function<void(ResultAPI const & result)> onDeleteChannel;
82 typedef std::function<void(ResultAPI const & result)> onEnterChannel;
83 typedef std::function<void(ResultAPI const & result)> onExitChannel;
84 typedef std::function<void(ResultAPI const & result)> onBlockMember;
85 typedef std::function<void(ResultAPI const & result)> onUnblockMember;
86 typedef std::function<void(ResultAPI const & result)> onChannelTranslationSetting;
87 typedef std::function<void(ResultAPI const & result)> onConnect;
88 typedef std::function<void(ResultAPI const & result)> onDisconnect;
89 typedef std::function<void(ResultAPI const & result, std::vector<std::string> const & channelIds, std::vector<std::string> const & failChannelIds)> onReconnect;
90 typedef std::function<void(ResultAPI const & result, std::vector<Channel> const & channels, ChannelPage const & channelPage)> onGetChannels;
91 typedef std::function<void(ResultAPI const & result, Channel const & channel, std::vector<Member> const & members)> onGetChannelInfo;
92 typedef std::function<void(ResultAPI const & result, std::vector<Member> const & members)> onGetChannelMembers;
93 typedef std::function<void(ResultAPI const & result, std::vector<Channel> const & channels)> onGetChannelsByUser;
94 typedef std::function<void(ResultAPI const & result, std::vector<BlockMember> const & blockMembers)> onGetBlockMembers;
95 typedef std::function<void(ResultAPI const & result, ChannelSendMessageParams const & params)> onChannelSendMessage;
96 typedef std::function<void(ResultAPI const & result, DirectSendMessageParams const & params)> onDirectSendMessage;
97 typedef std::function<void(ResultAPI const & result, ChannelMessageListQueryResponse const & response)> onGetChannelMessageHistory;
98 typedef std::function<void(ResultAPI const & result, TranslationData const & translationData)> onTranslate;
99 typedef std::function<void(ResultAPI const & result, ReactionType const & reactionType)> onAddReaction;
100 typedef std::function<void(ResultAPI const & result, ReactionType const & reactionType)> onRemoveReaction;
101 typedef std::function<void(ResultAPI const & result)> onReportMessage;
102
103 // MARK: Channel APIs
124 static void createChannel(CreateChannelParams const & params, onCreateChannel listener);
125
145 static void getChannels(GetChannelsParams const * params, onGetChannels listener);
146
162 static void getChannelInfo(std::string const & channelId, onGetChannelInfo listener);
163
179 static void getChannelMembers(std::string const & channelId, onGetChannelMembers listener);
180
196 static void deleteChannel(std::string const & channelId, onDeleteChannel listener);
197
215 static void enterChannel(EnterChannelParams const & params, onEnterChannel listener);
216
232 static void exitChannel(std::string const & channelId, onExitChannel listener);
233
234 // MARK: User APIs
252 static void getChannelsByUser(onGetChannelsByUser listener);
253
271 static void getBlockMembers(onGetBlockMembers listener);
272
288 static void blockMember(int64_t blockPlayerId, onBlockMember listener);
289
305 static void unblockMember(int64_t blockPlayerId, onUnblockMember listener);
306
322 static void translate(TranslateParams const & params, onTranslate listener);
323
343 static void reportMessage(ReportMessageParams const & params, onResult listener);
344
345 // MARK: Connection APIs
363 static void connect(std::string const & extraData, onResult listener);
364
380 static void connect(onConnect listener);
381
399 static void reconnect(onReconnect listener);
400
416 static void disconnect(onDisconnect listener);
417
418 // MARK: Message APIs
435
436 // MARK: Message APIs
452 static void sendMessageWithChannelSendMessageParams(ChannelSendMessageParams const & params, onChannelSendMessage listener);
453
470
486 static void sendMessageWithDirectSendMessageParams(DirectSendMessageParams const & params, onDirectSendMessage listener);
487
488 // MARK: Listener APIs
504 static void addChannelListener(std::string const & uniqueKey, ChannelListener* listener);
505
521 static void addDirectMessageListener(std::string const & uniqueKey, DirectMessageListener* listener);
522
538 static void addUserListener(std::string const & uniqueKey, UserListener* listener);
539
555 static void addConnectionListener(std::string const & uniqueKey, ConnectionListener* listener);
556
568 static void addCustomDataListener(std::string const & uniqueKey, CustomDataListener* listener);
569
583 static void removeChannelListener(std::string const & uniqueKey);
584
598 static void removeDirectMessageListener(std::string const & uniqueKey);
599
613 static void removeUserListener(std::string const & uniqueKey);
614
628 static void removeConnectionListener(std::string const & uniqueKey);
629
641 static void removeCustomDataListener(std::string const & uniqueKey);
642
643 // MARK: Socket Connected APIs
657 static bool isConnected();
658
659 static void executeEngine(picojson::value jsonParam);
660};
661
662// MARK: Common
668enum class ChannelType {
669 UNKNOWN,
670 PRIVATE,
671 PUBLIC,
672 GROUP,
673 ONEONONE
674};
675
681enum class SortType {
682 Unknown,
683 ChannelId,
684 ChannelName,
685 RegTime
686};
687
688enum class ReactionType {
689 Unknown,
690 Like
691};
692
698enum class ReasonType {
699 Insult,
700 Fraud,
701 Spam,
702 Etc
703};
704
710class HIVESDK_DLLEXPORT Channel {
711public:
712 // 채널 ID / Channel ID
713 std::string channelId;
714 // 채널 타입 / Channel Type
715 ChannelType type;
716 // 채널 소유자 / Channel Owner
717 std::string owner;
718 // 채널명 / Channel Name
719 std::string channelName;
720 // 현재 채널 인원수 / Current Number of People in the Channel
721 int memberCount;
722 // 채널 최대 인원수 / Maximum Number of People in the Channel
723 int maxMemberCount;
724 // 채널 생성 시간 / Channel Creation Time
725 std::string regTime;
726 // 채널 생성 시간 UnixTime / Channel Creation UnixTime
727 int64_t regTimeMillis;
728 // 채널 메시지 조회 가능 여부 / Channel Message Query Availability
729 bool chatHistoryAllowed;
730
731 Channel();
732 bool parse(picojson::value const & json);
733 picojson::object toJson() const;
734 std::string toString() const;
735
736 void query(ChannelMessageListQueryParams const & params, Chat::onGetChannelMessageHistory listener) const;
737 void setTranslationEnabled(bool enabled, Chat::onChannelTranslationSetting listener) const;
738 void addReaction(std::string const & messageId, ReactionType reactionType, Chat::onAddReaction listener) const;
739 void removeReaction(std::string const & messageId, ReactionType reactionType, Chat::onRemoveReaction listener) const;
740};
741
747class HIVESDK_DLLEXPORT ChannelPage {
748public:
749 // 페이지 크기 / Page Size
750 int size;
751 // 현재 페이지 / Current Page
752 int currentPage;
753 // 전체 채널 수 / Total Number of Channels
754 int totalElements;
755 // 전체 페이지 수 / Total Number of Pages
756 int totalPages;
757
758 ChannelPage();
759 bool parse(picojson::value const & json);
760 picojson::object toJson() const;
761};
762
768class HIVESDK_DLLEXPORT Member {
769public:
770 // 플레이어 ID / Player ID
771 int64_t playerId;
772 // 접속 시간 / Connection Time
773 std::string connectedTime;
774 // 접속 시간 UnixTime / Connection UnixTime
775 int64_t connectedTimeMillis;
776
777 Member();
778 bool parse(picojson::value const & json);
779 picojson::object toJson() const;
780};
781
787class HIVESDK_DLLEXPORT BlockMember {
788public:
789 // 차단된 사용자 ID / Blocked User ID
790 int64_t playerId;
791 // 차단 시간 / Blocked Time
792 std::string blockedTime;
793 // 차단 시간 UnixTime / Blocked UnixTime
794 int64_t blockedTimeMillis;
795
796 BlockMember();
797 bool parse(picojson::value const & json);
798 picojson::object toJson() const;
799};
800
801// MARK: Params
807class HIVESDK_DLLEXPORT CreateChannelParams {
808public:
809 // 채널 ID / Channel ID
810 std::string channelId;
811 // 비밀번호 / Password
812 std::string password;
813 // 채널명 / Channel Name
814 std::string channelName;
815 // 최대 인원수 / Maximum Number of People
816 int maxMemberCount;
817 // 채널 타입 / Channel Type
818 ChannelType type;
819 // 채널 메시지 조회 가능 여부 / Channel Message Query Availability
820 bool chatHistoryAllowed;
821 // 상대 플레이어 아이디 / Member ID to Talk with
822 std::string otherPlayerId;
823
825 picojson::object toJson() const;
826 std::string toString() const;
827};
828
834class HIVESDK_DLLEXPORT GetChannelsParams {
835public:
836 // 채널 타입 / Channel Type
837 ChannelType type;
838 // 채널 ID / Channel ID
839 std::string channelId;
840 // 채널명 / Channel Name
841 std::string channelName;
842 // 정렬 타입 / Sort Type
843 SortType sort;
844 // 페이지 순서 (ASC, DESC) / Page Order (ASC, DESC)
845 std::string pageOrder;
846 // 페이지 크기 / Page Size
847 int pageSize;
848 // 페이지 번호 / Page Number
849 int pageNumber;
850
852 picojson::object toJson() const;
853 std::string toString() const;
854};
855
861class HIVESDK_DLLEXPORT EnterChannelParams {
862public:
863 // 채널 ID / Channel ID
864 std::string channelId;
865 // 비밀번호 / Password
866 std::string password;
867
869 picojson::object toJson() const;
870 std::string toString() const;
871};
872
878class HIVESDK_DLLEXPORT ChannelSendMessageParams {
879public:
880 // 채널 ID / Channel ID
881 std::string channelId;
882 // 메시지 / Message
883 std::string message;
884 // extraData
885 std::string extraData;
886 // 멘션 / Mentions
887 std::vector<int64_t> mentionedPlayerIds;
888 // 답글 Message ID / reply Message Id
889 std::string replyMessageId;
890
892 picojson::object toJson() const;
893 std::string toString() const;
894 bool parse(picojson::value const & json);
895};
896
902class HIVESDK_DLLEXPORT DirectSendMessageParams {
903public:
904 // 수신자 플레이어 ID / Receiver Player ID
905 int64_t toPlayerId;
906 // 메시지 / Message
907 std::string message;
908 // extraData
909 std::string extraData;
910
912 picojson::object toJson() const;
913 std::string toString() const;
914 bool parse(picojson::value const & json);
915};
916
922class HIVESDK_DLLEXPORT ChannelMessageListQueryParams {
923public:
924 // 입력받은 메시지 기준에서 이전 메시지 요청 개수 / Number of message requests before the received message
925 int prevSize;
926 // 입력받은 메시지 기준 이후 메시지 요청 개수 / Number of message requests after the received message
927 int nextSize;
928 // 메시지 index (없을 경우 가장 최신 메시지 조회) / Message Index (If not available, retrieve the most recent message)
929 std::string messageId;
930 // 메시지 순서 (ASC, DESC) / Message Sort (ASC, DESC)
931 std::string order;
932
934 picojson::object toJson() const;
935 std::string toString() const;
936};
937
938class HIVESDK_DLLEXPORT TranslateParams {
939public:
940 std::string message;
941 std::string sourceLanguage;
942 std::vector<std::string> targetLanguage;
943
944 TranslateParams();
945 picojson::object toJson() const;
946 std::string toString() const;
947};
948
949class HIVESDK_DLLEXPORT ReportMessageParams {
950public:
951 // 채널 ID / Channel id
952 std::string channelId;
953 // 신고할 메시지 ID / Message id to report
954 std::string messageId;
955 // 신고할 플레이어 ID / Player id to report
956 int64_t reporteePlayerId;
957 // 신고 이유 타입 / Type of reason
958 ReasonType reasonType;
959 // 신고 이유 상세 / Detailed reason (used only when the reporteePlayerId is Etc)
960 std::string reasonDetail;
961
962 ReportMessageParams();
963 picojson::object toJson() const;
964 std::string toString() const;
965};
966
967// MARK: Listener Message Classes
973class HIVESDK_DLLEXPORT EnteredMember {
974public:
975 // 채널 ID / Channel ID
976 std::string channelId;
977 // 플레이어 ID / Player ID
978 int64_t playerId;
979 // 입장 시간 / Join Time
980 std::string timestamp;
981 // 입장 시간 UnixTime / Join UnixTime
982 int64_t timestampMillis;
983
985 bool parse(picojson::value const & json);
986};
987
993class HIVESDK_DLLEXPORT ExitedMember {
994public:
995 // 채널 ID / Channel ID
996 std::string channelId;
997 // 플레이어 ID / Player ID
998 int64_t playerId;
999 // 퇴장 시간 / Exit Time
1000 std::string timestamp;
1001 // 입장 시간 UnixTime / Join UnixTime
1002 int64_t timestampMillis;
1003
1004 ExitedMember();
1005 bool parse(picojson::value const & json);
1006};
1007
1013class HIVESDK_DLLEXPORT DeletedChannel {
1014public:
1015 // 채널 ID / Channel ID
1016 std::string channelId;
1017 // 삭제 시간 / Deletion Time
1018 std::string timestamp;
1019 // 입장 시간 UnixTime / Join UnixTime
1020 int64_t timestampMillis;
1021
1023 bool parse(picojson::value const & json);
1024};
1025
1026
1032class HIVESDK_DLLEXPORT ChannelNoticeMessage {
1033public:
1034 // Message ID
1035 std::string messageId;
1036 // 채널 ID / Channel ID
1037 std::string channelId;
1038 // 발신자 / Sender
1039 std::string from;
1040 // 메시지 / Message
1041 std::string message;
1042 // 메시지 전송 시간 / Message Send Time
1043 std::string timestamp;
1044 // 입장 시간 UnixTime / Join UnixTime
1045 int64_t timestampMillis;
1046
1048 bool parse(picojson::value const & json);
1049};
1050
1056class HIVESDK_DLLEXPORT ChannelMessage {
1057public:
1058 // Message ID
1059 std::string messageId;
1060 // 발신자 / Sender
1061 int64_t from;
1062 // 발신자 추가 데이터 (닉네임 등) / Sender Additional Data (Nickname, etc)
1063 std::string extraData;
1064 // 수신받은 채널 / Received Channel
1065 std::string to;
1066 // 메시지 / Message
1067 std::string message;
1068 // 메시지 전송 시간 / Message Send Time
1069 std::string timestamp;
1070 // 입장 시간 UnixTime / Join UnixTime
1071 int64_t timestampMillis;
1072 // 번역여부 / is Translated
1073 bool translated;
1074 // 번역 메시지 / Translated Message
1075 std::string translatedMessage;
1076 // 리액션 / reactions
1077 std::map<ReactionType, std::vector<int64_t>> reactions;
1078 // 멘션 / mentionedPlayerIds
1079 std::vector<int64_t> mentionedPlayerIds;
1080 // 답글 Meesage ID / Reply Message ID
1081 std::string replyMessageId;
1082 // 답글 메시지 / Reply Message
1083 std::string replyMessage;
1084 // 답글 Extra Data / Reply Extra Data
1085 std::string replyExtraData;
1086
1088 bool parse(picojson::value const & json);
1089};
1090
1096class HIVESDK_DLLEXPORT DirectMessage {
1097public:
1098 // Message ID
1099 std::string messageId;
1100 // 발신자 / Sender
1101 int64_t from;
1102 // 발신자 추가 데이터 (닉네임 등) / Sender Additional Data (Nickname, etc.)
1103 std::string extraData;
1104 // 수신자 / Receiver
1105 int64_t to;
1106 // 메시지
1107 std::string message;
1108 // 메시지 전송 시간 / Message Send Time
1109 std::string timestamp;
1110 // 입장 시간 UnixTime / Join UnixTime
1111 int64_t timestampMillis;
1112
1113 DirectMessage();
1114 bool parse(picojson::value const & json);
1115};
1116
1122class HIVESDK_DLLEXPORT NoticeMessage {
1123public:
1124 // Message ID
1125 std::string messageId;
1126 // 발신자 / Sender
1127 std::string from;
1128 // 메시지
1129 std::string message;
1130 // 메시지 전송 시간 / Message Send Time
1131 std::string timestamp;
1132 // 메시지 전송 시간 / Message Send Time (unix time)
1133 int64_t timestampMillis;
1134
1135 NoticeMessage();
1136 bool parse(picojson::value const & json);
1137};
1138
1144class HIVESDK_DLLEXPORT ChannelMessageListQueryResponse {
1145public:
1146 bool hasNext;
1147 std::string nextMessageId;
1148 bool hasPrev;
1149 std::string prevMessageId;
1150 std::vector<ChannelMessage> content;
1151
1153 bool parse(picojson::value const & json);
1154};
1155
1161class HIVESDK_DLLEXPORT TranslationData {
1162public:
1163 std::map<std::string, std::string> translations;
1164
1166 bool parse(picojson::value const & json);
1167};
1168
1174class HIVESDK_DLLEXPORT Reaction {
1175public:
1176 std::string channelId;
1177 std::string messageId;
1178 int64_t playerId;
1179 ReactionType type;
1180
1181 Reaction();
1182 bool parse(picojson::value const & json);
1183};
1184
1185// MARK: Listener Classes
1191class HIVESDK_DLLEXPORT ChannelListener {
1192public:
1193 // 채널 입장시 호출 / Called when a member enters the channel
1194 virtual void onEnteredMember(EnteredMember const & member) = 0;
1195 // 채널 퇴장시 호출 / Called when a member exits the channel
1196 virtual void onExitedMember(ExitedMember const & member) = 0;
1197 // 채널 삭제시 호출 / Called when a channel is deleted
1198 virtual void onDeletedChannel(DeletedChannel const & channel) = 0;
1199 // 채널 공지 메시지 수신시 호출 / Called when a channel notice message is received
1200 virtual void onNoticeMessage(ChannelNoticeMessage const & message) = 0;
1201 // 채널 메시지 수신시 호출 / Called when a channel message is received
1202 virtual void onChannelMessage(ChannelMessage const & message) = 0;
1203 // 리액션 추가 수신시 호출 / Called when a channel message reaction is received
1204 virtual void onAddReaction(Reaction const & reaction) = 0;
1205 // 리액션 제거 수신시 호출 / Called when a channel message reaction is deleted
1206 virtual void onRemoveReaction(Reaction const & reaction) = 0;
1207
1208 virtual ~ChannelListener() = default;
1209};
1210
1217class HIVESDK_DLLEXPORT DirectMessageListener {
1218public:
1219 // 1:1 메시지 수신시 호출 / Called when a 1:1 message is received
1220 virtual void onDirectMessage(DirectMessage const & message) = 0;
1221};
1222
1228class HIVESDK_DLLEXPORT UserListener {
1229public:
1230 // 1:1 메시지 수신시 호출 / Called when a 1:1 message is received
1231 virtual void onDirectMessage(DirectMessage const & message) = 0;
1232 // 개인 공지 메시지 수신 시 호출 / Called when a personal notice message is received
1233 virtual void onNoticeMessage(NoticeMessage const & message) = 0;
1234
1235 virtual ~UserListener() = default;
1236};
1237
1243class HIVESDK_DLLEXPORT ConnectionListener {
1244public:
1245 // 채팅서버 연결 시도 시작 시 호출 / Called when connection to the Chat Server starts
1246 virtual void onConnectStarted() = 0;
1247 // 채팅서버 연결 완료 시 호출 / Called when connected to the Chat Server
1248 virtual void onConnectCompleted(ResultAPI const & result) = 0;
1252 // 채팅서버 연결시 호출 / Called when connected to the Chat Server
1253 virtual void onConnected() = 0;
1254
1258 // 채팅서버 재연결 시작 시 호출 / Called when reconnection to the Chat Server starts
1259 virtual void onReconnectStarted() = 0;
1263 // 채팅서버 재연결시 호출 / Called when reconnected to the Chat Server
1264 virtual void onReconnected(ResultAPI const & result, std::vector<std::string> const & channelIds, std::vector<std::string> const & failChannelIds) = 0;
1265
1266 // 채팅서버 연결 해제시 호출 / Called when disconnected from the Chat Server
1267 virtual void onDisconnected() = 0;
1268
1269 virtual ~ConnectionListener() = default;
1270};
1271
1277class HIVESDK_DLLEXPORT CustomDataListener {
1278public:
1279 // 커스텀 데이터 수신시 호출 / Called when a custom data is received
1280 virtual void onCustomData(std::string const & data) = 0;
1281
1282 virtual ~CustomDataListener() = default;
1283};
1284
1285class HIVESDK_DLLEXPORT Unique64 {
1286public:
1287
1288 static Unique64& getInstance();
1289 std::string generateKey();
1290private:
1291 std::mutex mutex_;
1292 uint64_t last_timestamp_ms_;
1293 uint16_t sequence_;
1294
1295 static const uint16_t MAX_SEQUENCE = 0xFFFF;
1296
1297 Unique64();
1298 uint64_t getCurrentTimestampMs();
1299 uint64_t waitUntilNextMillisecond(uint64_t current_ts_ms_ref);
1300};
1301
1302template<typename Key, typename Value>
1303class ThreadSafeMap {
1304private:
1305 std::map<Key, Value> map_;
1306 mutable std::mutex mutex_;
1307
1308public:
1309 ThreadSafeMap() = default;
1310 ThreadSafeMap(const ThreadSafeMap&) = delete;
1311 ThreadSafeMap& operator=(const ThreadSafeMap&) = delete;
1312 void insert(const Key& key, const Value& value);
1313 Value get(const Key& key) const;
1314 bool contains(const Key& key) const;
1315 size_t erase(const Key& key);
1316};
1317
1318NS_HIVE_END
1319
1320#endif // __HIVE_CHAT_H__
차단된 사용자 정보
Definition: HIVE_Chat.h:787
채팅 채널 정보
Definition: HIVE_Chat.h:710
채널 이벤트 리스너
Definition: HIVE_Chat.h:1191
채널 메시지 정보
Definition: HIVE_Chat.h:1056
채널 대화 이력 조회 파라미터
Definition: HIVE_Chat.h:922
채널 대화 이력 정보
Definition: HIVE_Chat.h:1144
채널 공지 메시지 정보
Definition: HIVE_Chat.h:1032
채널 조회 페이지 정보
Definition: HIVE_Chat.h:747
채널 메시지 전송 파라미터
Definition: HIVE_Chat.h:878
HiveChat provides essential features for smooth chatting in games, such as real-time,...
Definition: HIVE_Chat.h:76
연결 리스너
Definition: HIVE_Chat.h:1243
채널 생성 파라미터
Definition: HIVE_Chat.h:807
커스텀 데이터 리스너
Definition: HIVE_Chat.h:1277
삭제된 채널 정보
Definition: HIVE_Chat.h:1013
1:1 메시지 정보
Definition: HIVE_Chat.h:1096
1:1 메시지 리스너
Definition: HIVE_Chat.h:1217
1:1 메시지 전송 파라미터
Definition: HIVE_Chat.h:902
채널 입장 파라미터
Definition: HIVE_Chat.h:861
입장 멤버 정보
Definition: HIVE_Chat.h:973
퇴장 멤버 정보
Definition: HIVE_Chat.h:993
채널 목록 조회 파라미터
Definition: HIVE_Chat.h:834
채널 멤버 정보
Definition: HIVE_Chat.h:768
유저 대상 공지 메시지 정보
Definition: HIVE_Chat.h:1122
리액션
Definition: HIVE_Chat.h:1174
Definition: HIVE_ResultAPI.h:64
메시지 번역 결과
Definition: HIVE_Chat.h:1161
유저 이벤트 리스너
Definition: HIVE_Chat.h:1228
static void sendMessageWithDirectSendMessageParams(DirectSendMessageParams const &params)
Send a 1:1 message Receives the recipient ID and message and sends the message to the corresponding ...
ChannelType
채팅 채널 타입 정보
Definition: HIVE_Chat.h:668
static void getChannelMembers(std::string const &channelId, onGetChannelMembers listener)
Get channel members Receives the channel ID and retrieves the list of members in the corresponding c...
static void removeConnectionListener(std::string const &uniqueKey)
Remove Connection Listener Remove the registered connection listener.
virtual void onReconnected(ResultAPI const &result, std::vector< std::string > const &channelIds, std::vector< std::string > const &failChannelIds)=0
static void addChannelListener(std::string const &uniqueKey, ChannelListener *listener)
Register Channel Listener Register a listener to receive channel events.
ReasonType
메시지 신고 사유
Definition: HIVE_Chat.h:698
static void exitChannel(std::string const &channelId, onExitChannel listener)
Exit channel Receives the channel ID and exits the corresponding channel.
static void disconnect(onDisconnect listener)
Disconnects the Chat Server Disconnects from the Chat Server.
virtual void onConnected()=0
static void getChannelsByUser(onGetChannelsByUser listener)
Get a list of channels the user is participating in.
static void reportMessage(ReportMessageParams const &params, onResult listener)
Report a message Channel id, message id, message author, and report reason for the message can be sp...
static void unblockMember(int64_t blockPlayerId, onUnblockMember listener)
Unblock user Receives the user ID and unblocks the corresponding user.
static void removeChannelListener(std::string const &uniqueKey)
Remove Channel Listener Remove the registered channel listener.
static void removeUserListener(std::string const &uniqueKey)
Remove User Listener Remove the registered user event listener.
virtual void onReconnectStarted()=0
static void translate(TranslateParams const &params, onTranslate listener)
Message translation request.
static void connect(onConnect listener)
Connects the Chat Server Attempts to connect to the Chat Server.
static bool isConnected()
Check the socket connection status Check if the socket is currently connected.
static void getBlockMembers(onGetBlockMembers listener)
Get a list of blocked users.
static void addCustomDataListener(std::string const &uniqueKey, CustomDataListener *listener)
Register Custom Data Listener
static void getChannels(GetChannelsParams const *params, onGetChannels listener)
Get channel list Retrieves a list of accessible channels.
static void enterChannel(EnterChannelParams const &params, onEnterChannel listener)
Enter channel Receives the channel ID and connects to the channel.
static void deleteChannel(std::string const &channelId, onDeleteChannel listener)
Delete channel Receives the channel ID and deletes the corresponding channel.
static void connect(std::string const &extraData, onResult listener)
Connects the Chat Server (Deprecated) This method is no longer recommended and will be removed in fu...
static void blockMember(int64_t blockPlayerId, onBlockMember listener)
Block user Receives the user ID and blocks the corresponding user.
static void sendMessageWithDirectSendMessageParams(DirectSendMessageParams const &params, onDirectSendMessage listener)
Send a 1:1 message Receives the recipient ID and message and sends the message to the corresponding ...
static void reconnect(onReconnect listener)
Reconnects to the Chat Server (Deprecated) This method is no longer recommended and will be removed ...
static void sendMessageWithChannelSendMessageParams(ChannelSendMessageParams const &params, onChannelSendMessage listener)
Send a channel message Receives the channel ID and message and sends the message to the correspondin...
static void getChannelInfo(std::string const &channelId, onGetChannelInfo listener)
Get channel information Receives the channel ID and retrieves the information of the corresponding c...
SortType
채널 정렬 타입 정보
Definition: HIVE_Chat.h:681
static void removeDirectMessageListener(std::string const &uniqueKey)
Remove Direct Message Listener Remove the registered 1:1 message listener.
static void sendMessageWithChannelSendMessageParams(ChannelSendMessageParams const &params)
Send a channel message Receives the channel ID and message and sends the message to the correspondin...
static void addUserListener(std::string const &uniqueKey, UserListener *listener)
Register User Listener Register a listener to receive user events.
static void addDirectMessageListener(std::string const &uniqueKey, DirectMessageListener *listener)
Register Direct Message Listener Register a listener to receive 1:1 messages.
static void createChannel(CreateChannelParams const &params, onCreateChannel listener)
Create a channel Channel Name, Maximum Number of People, and Type can be specified.
static void addConnectionListener(std::string const &uniqueKey, ConnectionListener *listener)
Register Connection Listener Register a listener to receive the connection status of the Chat Server...
static void removeCustomDataListener(std::string const &uniqueKey)
Remove Custom Data Listener
Copyright © Com2uS Platform Corporation. All Right Reserved. Terms of Use Privacy Policy