1
This commit is contained in:
parent
eb80584ea0
commit
33fd2483d2
@ -2171,6 +2171,9 @@ void Human::ReJoin(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin>
|
||||
Human* target = target_list.at(rand() % target_list.size());
|
||||
FollowTarget(target);
|
||||
target->StartRefreshViewTimer();
|
||||
cs::SMWatchTarget rsp_msg;
|
||||
rsp_msg.set_target_uniid(target->GetUniId());
|
||||
SendNotifyMsg(rsp_msg);
|
||||
}
|
||||
}
|
||||
SendViewerUiNotify();
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "roomob.h"
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
|
||||
RoomOb::RoomOb(Room* room)
|
||||
{
|
||||
@ -31,10 +32,19 @@ Player* RoomOb::GetByAccountId(const std::string& account_id)
|
||||
|
||||
void RoomOb::AddOb(Player* hum)
|
||||
{
|
||||
|
||||
id_hash_[hum->account_id] = hum;
|
||||
}
|
||||
|
||||
void RoomOb::SendViewerUiMemberUpdate(std::vector<int> member_ids)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RoomOb::TraverseOb(std::function<bool (Player*)> cb)
|
||||
{
|
||||
for (auto& pair : id_hash_) {
|
||||
if (!cb(pair.second)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ class RoomOb : public std::enable_shared_from_this<RoomOb>
|
||||
Player* GetByAccountId(const std::string& account_id);
|
||||
void AddOb(Player* hum);
|
||||
void SendViewerUiMemberUpdate(std::vector<int> member_ids);
|
||||
void TraverseOb(std::function<bool (Player*)> cb);
|
||||
|
||||
private:
|
||||
Room* room_ = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user