Browse Source

加载历史后,推送前端的点,推送历史

lixioayao 6 years ago
parent
commit
6c11c7643f
3 changed files with 13 additions and 13 deletions
  1. 11 3
      card_base.cpp
  2. 1 1
      card_base.h
  3. 1 9
      card_person.cpp

+ 11 - 3
card_base.cpp

@@ -57,11 +57,19 @@ void card_location_base::on_message(zloop<task*> * loop,const message_locinfo&lo
 }
 
 //前端推送位置函数.
-void card_location_base::upt_card_pos(YA::_CARD_POS_&cp, const point &pt)
+void card_location_base::upt_card_pos(YA::_CARD_POS_&cp, point &pt)
 {
 //	YA::_CARD_POS_ cp;
-	cp.x = tool_other::round(pt.x,3);
-	cp.y = tool_other::round(pt.y,3);
+    point _p;
+    if(pt.empty())
+    {
+        _p=*this;
+        pt=_p;
+    }
+    else
+        _p=pt;
+	cp.x = tool_other::round(_p.x,3);
+	cp.y = tool_other::round(_p.y,3);
 	//cp.z = pt.z;
 
 	cp.Type=m_type;

+ 1 - 1
card_base.h

@@ -96,7 +96,7 @@ struct card_location_base:card,std::enable_shared_from_this<card_location_base>
     void on_message(zloop<task*> * loop,const message_locinfo&loc,bool is_history);
     void on_location(const std::vector<point>&vp,const std::vector<loc_message> &lm );
     void do_status(int st);
-	void upt_card_pos(YA::_CARD_POS_&cp, const point &pt);
+	void upt_card_pos(YA::_CARD_POS_&cp, point &pt);
 	void del_card_pos();
 	int	 get_stat();
 	void put_three_rates(card_pos &);

+ 1 - 9
card_person.cpp

@@ -114,15 +114,7 @@ void person::on_timer()
 	  mine_business::inst()->fetch_add();
 	uint64_t _time=0;
 	point pt = getSmoothPoint(_time);
-//	const auto lm = m_area_tool->getLandmark();
-//	cp.enter_area_time = std::get<0>(lm)*1000;
-//	cp.rec_time = std::get<1>(lm);
-//	int32_t map_id = std::get<2>(lm);
-//	int32_t area_id = std::get<3>(lm);
-//	cp.map_id=map_id;cp.area_id=area_id;
-//	cp.landmark_id = std::get<4>(lm);
-//	cp.lm_direction = std::get<5>(lm);
-//	cp.landmark_dis=std::get<6>(lm);
+    
 	cp.area_info=m_area_tool->m_area_info;	
 	cp.map_id =m_area_tool->m_mapid;