NIM SDK API  9.0.0
nim_client_helper.h
Go to the documentation of this file.
1 
6 #ifndef _NIM_SDK_CPP_CLIENT_HELPER_H_
7 #define _NIM_SDK_CPP_CLIENT_HELPER_H_
8 
9 #include <functional>
10 #include <list>
11 #include <map>
12 #include <string>
14 #include "nim_define_include.h"
15 #include "nim_wrapper_util/nim_json_util.h"
16 #include "public_defines.h"
17 
22 namespace nim {
23 
24 class Client;
26 struct NIM_SDK_CPPWRAPPER_DLL_API SDKConfig {
27  // global_config
28  std::string push_cer_name_;
29  std::string push_token_;
30  std::string database_encrypt_key_;
35  std::string preload_image_resize_;
37  NIMSDKLogLevel sdk_log_level_;
41  bool use_https_;
52  /***********消息“已接收回执”发送配置 begin************/
56  /***********消息“已接收回执”发送配置 end************/
57 
58  /***********用户数据本地备份与恢复 begin************/
63  /***********用户数据本地备份与恢复 end************/
64 
65  /***********IP地址族相关设置 begin************/
67  /***********地址族相关设置 end************/
68 
72  int comm_neca_;
73  std::string server_conf_file_path_;
74  // private_server_setting 私有服务器配置(设置方法有两种,一个是配置以下信息,一个是通过配置server_conf_file_path_地址,信息从文件中读取)
76  std::string lbs_address_;
77  std::list<std::string> lbs_backup_address_;
78  std::string nos_lbs_address_;
79  std::string default_link_address_;
84  std::string rsa_public_key_module_;
91  std::string nos_download_address_;
92  std::string nos_accelerate_host_;
93  std::vector<std::string> nos_accelerate_host_list_;
96  /***********IP地址族相关设置 begin************/
97  std::string probe_ipv4_url_;
98  std::string probe_ipv6_url_;
99  /***********地址族相关设置 end************/
100 
101  std::map<int /*key */, int /*value */> sync_data_type_list_;
102  std::list<std::string> http_dns_server_interface_;
106  NIMSDKType sdk_type;
107  std::string sdk_human_version;
109  /***********融合存储相关************/
110  std::string mock_refer_;
111  std::string mock_ua_;
116  SDKConfig();
117 
118 public:
119  void SetCustomClientType(int type);
120  int GetCustomClientType() const;
121 
122 private:
123  friend class Client;
124  std::pair<bool, int> custom_client_type_;
125 };
126 
128 struct NIM_SDK_CPPWRAPPER_DLL_API OtherClientPres {
129  std::string app_account_;
130  NIMClientType client_type_;
131  std::string client_os_;
132  std::string mac_address_;
133  std::string device_id_;
134  int64_t login_time_;
135  std::string custom_data_;
139  : login_time_(0)
140  , custom_client_type_(0) {}
141 };
142 
144 struct NIM_SDK_CPPWRAPPER_DLL_API LoginRes {
145  NIMResCode res_code_;
146  bool relogin_;
147  NIMLoginStep login_step_;
148  std::list<OtherClientPres> other_clients_;
149  bool retrying_;
152  : relogin_(false)
153  , retrying_(true) {}
154 };
155 
157 struct NIM_SDK_CPPWRAPPER_DLL_API KickoutRes {
158  NIMClientType client_type_;
159  NIMKickReason kick_reason_;
160  std::string kickout_description_;
162 };
163 
165 struct NIM_SDK_CPPWRAPPER_DLL_API MultiSpotLoginRes {
166  NIMMultiSpotNotifyType notify_type_;
167  std::list<OtherClientPres> other_clients_;
168 };
169 
171 struct NIM_SDK_CPPWRAPPER_DLL_API KickOtherRes {
172  NIMResCode res_code_;
173  std::list<std::string> device_ids_;
174 };
175 
182 bool NIM_SDK_CPPWRAPPER_DLL_API ParseOtherClientsPres(const nim_cpp_wrapper_util::Json::Value array_objs, std::list<OtherClientPres>& outs);
183 
184 struct NIM_SDK_CPPWRAPPER_DLL_API LoginParams {
185  std::string custom_data_;
186  NIMAuthType auth_type_;
187  std::string login_ex_;
188  LoginParams()
189  : auth_type_(kNIMAuthTypeDefault) {}
190 };
191 
192 } // namespace nim
193 
194 #endif //_NIM_SDK_CPP_CLIENT_HELPER_H_
nim::SDKConfig::lbs_address_
std::string lbs_address_
Definition: nim_client_helper.h:76
nim::LoginRes::login_step_
NIMLoginStep login_step_
Definition: nim_client_helper.h:147
nim::SDKConfig::caching_markread_count_
uint32_t caching_markread_count_
Definition: nim_client_helper.h:55
nim::Client
全局管理功能;主要包括SDK初始化/清理、客户端登录/退出等功能
Definition: nim_cpp_client.h:28
nim::KickOtherRes
踢人结果回调信息
Definition: nim_client_helper.h:171
nim::SDKConfig::sync_data_type_list_
std::map< int, int > sync_data_type_list_
Definition: nim_client_helper.h:101
nim::OtherClientPres
多端登陆客户端信息
Definition: nim_client_helper.h:128
nim::SDKConfig::use_https_
bool use_https_
Definition: nim_client_helper.h:41
nim::SDKConfig::caching_markread_time_
uint32_t caching_markread_time_
Definition: nim_client_helper.h:54
nim::SDKConfig::probe_ipv4_url_
std::string probe_ipv4_url_
Definition: nim_client_helper.h:97
nim::SDKConfig::caching_markread_
bool caching_markread_
Definition: nim_client_helper.h:53
nim::SDKConfig::nego_key_neca_key_version_
int nego_key_neca_key_version_
Definition: nim_client_helper.h:89
nim::LoginParams::custom_data_
std::string custom_data_
Definition: nim_client_helper.h:185
nim::OtherClientPres::client_os_
std::string client_os_
Definition: nim_client_helper.h:131
nim::SDKConfig::nego_key_neca_key_parta_
std::string nego_key_neca_key_parta_
Definition: nim_client_helper.h:87
nim::KickoutRes
被踢结果回调信息
Definition: nim_client_helper.h:157
nim::OtherClientPres::device_id_
std::string device_id_
Definition: nim_client_helper.h:133
nim::OtherClientPres::login_time_
int64_t login_time_
Definition: nim_client_helper.h:134
nim::SDKConfig
SDK设置项
Definition: nim_client_helper.h:26
nim::SDKConfig::team_msg_ack_
bool team_msg_ack_
Definition: nim_client_helper.h:49
nim::SDKConfig::disable_app_nap_
bool disable_app_nap_
Definition: nim_client_helper.h:104
nim::SDKConfig::fcs_auth_type_
int fcs_auth_type_
Definition: nim_client_helper.h:112
nim::LoginRes::retrying_
bool retrying_
Definition: nim_client_helper.h:149
nim::SDKConfig::comm_neca_
int comm_neca_
Definition: nim_client_helper.h:72
nim::LoginParams
Definition: nim_client_helper.h:184
nim::LoginRes
登录结果回调信息
Definition: nim_client_helper.h:144
nim::SDKConfig::priority_use_cdn_host_
bool priority_use_cdn_host_
Definition: nim_client_helper.h:103
nim::SDKConfig::enable_user_datafile_restore_
bool enable_user_datafile_restore_
Definition: nim_client_helper.h:60
nim::SDKConfig::rsa_version_
int rsa_version_
Definition: nim_client_helper.h:85
nim::LoginRes::other_clients_
std::list< OtherClientPres > other_clients_
Definition: nim_client_helper.h:148
nim::KickoutRes::custom_client_type_
int32_t custom_client_type_
Definition: nim_client_helper.h:161
nim::SDKConfig::enable_user_datafile_defrestoreproc_
bool enable_user_datafile_defrestoreproc_
Definition: nim_client_helper.h:61
nim::SDKConfig::dedicated_cluste_flag_
bool dedicated_cluste_flag_
Definition: nim_client_helper.h:69
nim::SDKConfig::sync_session_ack_
bool sync_session_ack_
Definition: nim_client_helper.h:38
nim::LoginParams::login_ex_
std::string login_ex_
Definition: nim_client_helper.h:187
nim::SDKConfig::http_dns_server_interface_
std::list< std::string > http_dns_server_interface_
Definition: nim_client_helper.h:102
nim::SDKConfig::login_max_retry_times_
int login_max_retry_times_
Definition: nim_client_helper.h:39
nim::SDKConfig::reset_unread_count_when_recall_
bool reset_unread_count_when_recall_
Definition: nim_client_helper.h:44
nim::SDKConfig::sdk_log_level_
NIMSDKLogLevel sdk_log_level_
Definition: nim_client_helper.h:37
nim::SDKConfig::default_link_address_
std::string default_link_address_
Definition: nim_client_helper.h:79
nim::KickOtherRes::res_code_
NIMResCode res_code_
Definition: nim_client_helper.h:172
nim::SDKConfig::lbs_backup_address_
std::list< std::string > lbs_backup_address_
Definition: nim_client_helper.h:77
nim::LoginRes::LoginRes
LoginRes()
Definition: nim_client_helper.h:151
nim::SDKConfig::enable_user_datafile_backup_
bool enable_user_datafile_backup_
Definition: nim_client_helper.h:59
nim::OtherClientPres::mac_address_
std::string mac_address_
Definition: nim_client_helper.h:132
nim::OtherClientPres::app_account_
std::string app_account_
Definition: nim_client_helper.h:129
nim::OtherClientPres::OtherClientPres
OtherClientPres()
Definition: nim_client_helper.h:138
nim::OtherClientPres::custom_data_
std::string custom_data_
Definition: nim_client_helper.h:135
nim::SDKConfig::use_private_server_
bool use_private_server_
Definition: nim_client_helper.h:75
nim::KickoutRes::kickout_description_
std::string kickout_description_
Definition: nim_client_helper.h:160
nim::SDKConfig::default_link_address_ipv6_
std::string default_link_address_ipv6_
Definition: nim_client_helper.h:80
nim::SDKConfig::need_update_lbs_befor_relogin_
bool need_update_lbs_befor_relogin_
Definition: nim_client_helper.h:50
nim::SDKConfig::default_nos_upload_host_
std::string default_nos_upload_host_
Definition: nim_client_helper.h:82
nim
namespace nim
nim::SDKConfig::nos_accelerate_address_
std::string nos_accelerate_address_
Definition: nim_client_helper.h:94
nim::SDKConfig::client_antispam_
bool client_antispam_
Definition: nim_client_helper.h:48
nim::SDKConfig::preload_image_quality_
int preload_image_quality_
Definition: nim_client_helper.h:34
nim::SDKConfig::nos_lbs_address_
std::string nos_lbs_address_
Definition: nim_client_helper.h:78
nim::SDKConfig::custom_timeout_
int custom_timeout_
Definition: nim_client_helper.h:40
nim::SDKConfig::sdk_type
NIMSDKType sdk_type
Definition: nim_client_helper.h:106
nim::SDKConfig::animated_image_thumbnail_enabled_
bool animated_image_thumbnail_enabled_
Definition: nim_client_helper.h:46
nim::SDKConfig::rsa_public_key_module_
std::string rsa_public_key_module_
Definition: nim_client_helper.h:84
nim::SDKConfig::push_cer_name_
std::string push_cer_name_
Definition: nim_client_helper.h:28
nim::SDKConfig::nos_download_address_
std::string nos_download_address_
Definition: nim_client_helper.h:91
nim::KickoutRes::kick_reason_
NIMKickReason kick_reason_
Definition: nim_client_helper.h:159
nim::OtherClientPres::custom_client_type_
int custom_client_type_
Definition: nim_client_helper.h:136
nim::ParseOtherClientsPres
bool NIM_SDK_CPPWRAPPER_DLL_API ParseOtherClientsPres(const nim_cpp_wrapper_util::Json::Value array_objs, std::list< OtherClientPres > &outs)
nim::SDKConfig::cache_session_data_when_delete_
bool cache_session_data_when_delete_
Definition: nim_client_helper.h:105
nim::MultiSpotLoginRes::other_clients_
std::list< OtherClientPres > other_clients_
Definition: nim_client_helper.h:167
nim::SDKConfig::sdk_human_version
std::string sdk_human_version
Definition: nim_client_helper.h:107
nim::SDKConfig::upload_sdk_events_after_login_
bool upload_sdk_events_after_login_
Definition: nim_client_helper.h:45
nim::SDKConfig::server_conf_file_path_
std::string server_conf_file_path_
Definition: nim_client_helper.h:73
nim::SDKConfig::user_datafile_localbackup_folder_
std::string user_datafile_localbackup_folder_
Definition: nim_client_helper.h:62
nim::SDKConfig::team_notification_unread_count_
bool team_notification_unread_count_
Definition: nim_client_helper.h:42
nim::LoginRes::relogin_
bool relogin_
Definition: nim_client_helper.h:146
nim::KickOtherRes::device_ids_
std::list< std::string > device_ids_
Definition: nim_client_helper.h:173
nim::SDKConfig::probe_ipv6_url_
std::string probe_ipv6_url_
Definition: nim_client_helper.h:98
nim::SDKConfig::preload_image_resize_
std::string preload_image_resize_
Definition: nim_client_helper.h:35
nim::KickoutRes::client_type_
NIMClientType client_type_
Definition: nim_client_helper.h:158
nim::SDKConfig::hand_shake_type_
int hand_shake_type_
Definition: nim_client_helper.h:70
nim::MultiSpotLoginRes
多端登录回调信息
Definition: nim_client_helper.h:165
nim::SDKConfig::preload_attach_
bool preload_attach_
Definition: nim_client_helper.h:31
nim::SDKConfig::push_token_
std::string push_token_
Definition: nim_client_helper.h:29
nim::MultiSpotLoginRes::notify_type_
NIMMultiSpotNotifyType notify_type_
Definition: nim_client_helper.h:166
nim::SDKConfig::vchat_miss_unread_count_
bool vchat_miss_unread_count_
Definition: nim_client_helper.h:43
nim::LoginRes::res_code_
NIMResCode res_code_
Definition: nim_client_helper.h:145
nim::SDKConfig::nos_accelerate_host_list_
std::vector< std::string > nos_accelerate_host_list_
Definition: nim_client_helper.h:93
nim::SDKConfig::nego_key_neca_key_partb_
std::string nego_key_neca_key_partb_
Definition: nim_client_helper.h:88
nim::SDKConfig::ip_protocol_version_
int ip_protocol_version_
Definition: nim_client_helper.h:66
nim::SDKConfig::database_encrypt_key_
std::string database_encrypt_key_
Definition: nim_client_helper.h:30
nim::SDKConfig::nego_key_neca_
int nego_key_neca_
Definition: nim_client_helper.h:71
nim_sdk_cpp_wrapper.h
定义导出宏
nim::SDKConfig::preload_image_name_template_
std::string preload_image_name_template_
Definition: nim_client_helper.h:36
nim::LoginParams::auth_type_
NIMAuthType auth_type_
Definition: nim_client_helper.h:186
nim::SDKConfig::nos_accelerate_host_
std::string nos_accelerate_host_
Definition: nim_client_helper.h:92
nim::SDKConfig::custom_enable_fcs_
bool custom_enable_fcs_
Definition: nim_client_helper.h:113
nim::OtherClientPres::client_type_
NIMClientType client_type_
Definition: nim_client_helper.h:130
nim::SDKConfig::default_nos_upload_address_
std::string default_nos_upload_address_
Definition: nim_client_helper.h:81