添加初始化

This commit is contained in:
aozhiwei 2019-03-30 13:35:36 +08:00
parent 3d63d7e92a
commit c6156418dd

View File

@ -14,10 +14,10 @@ struct OrderInfo
std::string seqid; std::string seqid;
std::string orderid; std::string orderid;
std::string accountid; std::string accountid;
int itemid; int itemid = 0;
int price; int price = 0;
int customprice; int customprice = 0;
int serverid; int serverid = 0;
std::string roleid; std::string roleid;
std::string rolename; std::string rolename;
std::string sp_accountid; std::string sp_accountid;
@ -25,27 +25,13 @@ struct OrderInfo
std::string itemname; std::string itemname;
std::string itemmemo; std::string itemmemo;
std::string sp_orderid; std::string sp_orderid;
time_t lastchecktime; time_t lastchecktime = 0;
OrderInfo()
{
serverid = 0;
itemid = 0;
price = 0;
lastchecktime = 0;
customprice = 0;
}
}; };
struct AddOrderResult struct AddOrderResult
{ {
bool isok; bool isok = false;
OrderInfo orderinfo; OrderInfo orderinfo;
AddOrderResult()
{
isok = false;
}
}; };
struct AddOrderNode; struct AddOrderNode;
@ -140,25 +126,31 @@ class OrderMgr : public a8::Singleton<OrderMgr>
const std::string& rolename); const std::string& rolename);
private: private:
a8::mysql::Connection* mysql_conn_; a8::mysql::Connection* mysql_conn_ = nullptr;
a8::mysql::Query* query_; a8::mysql::Query* query_ = nullptr;
a8::tick_t last_ping_db_tick_ = 0; a8::tick_t last_ping_db_tick_ = 0;
std::mutex *add_order_mutex_ = nullptr; std::mutex *add_order_mutex_ = nullptr;
AddOrderNode *top_node_, *bot_node_, *work_node_; AddOrderNode *top_node_ = nullptr;
AddOrderNode *bot_node_ = nullptr;
AddOrderNode *work_node_ = nullptr;
std::mutex *pay_notify_mutex_; std::mutex *pay_notify_mutex_ = nullptr;
PayNotifyNode *pay_notify_top_node_, *pay_notify_bot_node_, *pay_notify_work_node_; PayNotifyNode *pay_notify_top_node_ = nullptr;
PayNotifyNode *pay_notify_bot_node_ = nullptr;
PayNotifyNode *pay_notify_work_node_ = nullptr;
std::mutex *reissue_mutex_; std::mutex *reissue_mutex_ = nullptr;
ReissueNode *reissue_top_node_, *reissue_bot_node_, *reissue_work_node_; ReissueNode *reissue_top_node_ = nullptr;
ReissueNode *reissue_bot_node_ = nullptr;
ReissueNode *reissue_work_node_ = nullptr;
int last_gen_order_time_; int last_gen_order_time_ = 0;
int sub_orderid_; int sub_orderid_ = 0;
std::mutex *seq_mutex_; std::mutex *seq_mutex_ = nullptr;
volatile int current_seqid_; volatile int current_seqid_ = 0;
std::mutex *add_order_result_mutex_; std::mutex *add_order_result_mutex_ = nullptr;
std::map<int, AddOrderResult> add_order_results_; std::map<int, AddOrderResult> add_order_results_;
std::mutex *pay_notify_result_mutex_; std::mutex *pay_notify_result_mutex_;