NIM SDK API  8.5.1
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_;
108  SDKConfig();
109 
110 public:
111  void SetCustomClientType(int type);
112  int GetCustomClientType() const;
113 
114 private:
115  friend class Client;
116  std::pair<bool, int> custom_client_type_;
117 };
118 
120 struct NIM_SDK_CPPWRAPPER_DLL_API OtherClientPres {
121  std::string app_account_;
122  NIMClientType client_type_;
123  std::string client_os_;
124  std::string mac_address_;
125  std::string device_id_;
126  int64_t login_time_;
127  std::string custom_data_;
131  : login_time_(0)
132  , custom_client_type_(0) {}
133 };
134 
136 struct NIM_SDK_CPPWRAPPER_DLL_API LoginRes {
137  NIMResCode res_code_;
138  bool relogin_;
139  NIMLoginStep login_step_;
140  std::list<OtherClientPres> other_clients_;
141  bool retrying_;
144  : relogin_(false)
145  , retrying_(true) {}
146 };
147 
149 struct NIM_SDK_CPPWRAPPER_DLL_API KickoutRes {
150  NIMClientType client_type_;
151  NIMKickReason kick_reason_;
152  std::string kickout_description_;
154 };
155 
157 struct NIM_SDK_CPPWRAPPER_DLL_API MultiSpotLoginRes {
158  NIMMultiSpotNotifyType notify_type_;
159  std::list<OtherClientPres> other_clients_;
160 };
161 
163 struct NIM_SDK_CPPWRAPPER_DLL_API KickOtherRes {
164  NIMResCode res_code_;
165  std::list<std::string> device_ids_;
166 };
167 
174 bool NIM_SDK_CPPWRAPPER_DLL_API ParseOtherClientsPres(const nim_cpp_wrapper_util::Json::Value array_objs, std::list<OtherClientPres>& outs);
175 
176 struct NIM_SDK_CPPWRAPPER_DLL_API LoginParams {
177  std::string custom_data_;
178  NIMAuthType auth_type_;
179  std::string login_ex_;
180  LoginParams()
181  : auth_type_(kNIMAuthTypeDefault) {}
182 };
183 
184 } // namespace nim
185 
186 #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:139
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:163
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:120
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:177
nim::OtherClientPres::client_os_
std::string client_os_
Definition: nim_client_helper.h:123
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:149
nim::OtherClientPres::device_id_
std::string device_id_
Definition: nim_client_helper.h:125
nim::OtherClientPres::login_time_
int64_t login_time_
Definition: nim_client_helper.h:126
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::LoginRes::retrying_
bool retrying_
Definition: nim_client_helper.h:141
nim::SDKConfig::comm_neca_
int comm_neca_
Definition: nim_client_helper.h:72
nim::LoginParams
Definition: nim_client_helper.h:176
nim::LoginRes
登录结果回调信息
Definition: nim_client_helper.h:136
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:140
nim::KickoutRes::custom_client_type_
int32_t custom_client_type_
Definition: nim_client_helper.h:153
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:179
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:164
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:143
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:124
nim::OtherClientPres::app_account_
std::string app_account_
Definition: nim_client_helper.h:121
nim::OtherClientPres::OtherClientPres
OtherClientPres()
Definition: nim_client_helper.h:130
nim::OtherClientPres::custom_data_
std::string custom_data_
Definition: nim_client_helper.h:127
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:152
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::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:151
nim::OtherClientPres::custom_client_type_
int custom_client_type_
Definition: nim_client_helper.h:128
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:159
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:138
nim::KickOtherRes::device_ids_
std::list< std::string > device_ids_
Definition: nim_client_helper.h:165
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:150
nim::SDKConfig::hand_shake_type_
int hand_shake_type_
Definition: nim_client_helper.h:70
nim::MultiSpotLoginRes
多端登录回调信息
Definition: nim_client_helper.h:157
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:158
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:137
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:178
nim::SDKConfig::nos_accelerate_host_
std::string nos_accelerate_host_
Definition: nim_client_helper.h:92
nim::OtherClientPres::client_type_
NIMClientType client_type_
Definition: nim_client_helper.h:122
nim::SDKConfig::default_nos_upload_address_
std::string default_nos_upload_address_
Definition: nim_client_helper.h:81