修复同步自己问题
This commit is contained in:
parent
fd9f9e2b96
commit
f1943cc35b
@ -137,6 +137,12 @@ MetaData::Map* MetaMgr::GetMap(int map_id)
|
||||
return itr != loader_->gamemap_hash.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
MetaData::MapThing* MetaMgr::GetMapThing(int mapthing_id)
|
||||
{
|
||||
auto itr = loader_->mapthing_hash.find(mapthing_id);
|
||||
return itr != loader_->mapthing_hash.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
MetaData::Player* MetaMgr::GetPlayer(int id)
|
||||
{
|
||||
auto itr = loader_->player_hash.find(id);
|
||||
|
@ -18,6 +18,7 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
||||
|
||||
std::string GetSysParam(const std::string& param_name);
|
||||
MetaData::Map* GetMap(int map_id);
|
||||
MetaData::MapThing* GetMapThing(int mapthing_id);
|
||||
MetaData::Player* GetPlayer(int id);
|
||||
MetaData::Equip* GetEquip(int id);
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "movement.h"
|
||||
#include "bullet.h"
|
||||
#include "collider.h"
|
||||
#include "obstacle.h"
|
||||
|
||||
const int ROOM_MAX_PLAYER_NUM = 50;
|
||||
const int ANDROID_NUM = 0;
|
||||
@ -79,6 +80,8 @@ void Room::AddPlayer(Player* hum)
|
||||
accountid_hash_[hum->account_id] = hum;
|
||||
human_hash_[hum->entity_uniid] = hum;
|
||||
++alive_count_;
|
||||
hum->new_players.insert(hum);
|
||||
hum->part_players.insert(hum);
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second != hum) {
|
||||
pair.second->new_players.insert(hum);
|
||||
@ -133,6 +136,14 @@ void Room::ShuaAndroid()
|
||||
}
|
||||
}
|
||||
|
||||
void Room::ShuaObstacle(Human* hum)
|
||||
{
|
||||
MetaData::MapThing* thing = MetaMgr::Instance()->GetMapThing(61001);
|
||||
if (!thing) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool Room::RandomPos(Human* hum, float distance, Vector2D& out_pos)
|
||||
{
|
||||
float angle = ((float)rand() / RAND_MAX) * 2.0f;
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
void AddBullet(Bullet* bullet);
|
||||
unsigned short AllocUniid();
|
||||
void ShuaAndroid();
|
||||
void ShuaObstacle(Human* hum);
|
||||
bool RandomPos(Human* hum, float distance, Vector2D& out_pos);
|
||||
Human* FindEnemy(Human* hum);
|
||||
void CollisionDetection(Entity* sender, int detection_flags, std::vector<Entity*> objects);
|
||||
|
@ -55,6 +55,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
|
||||
{
|
||||
cs::SMJoinedNotify notifymsg;
|
||||
notifymsg.set_error_code(0);
|
||||
room->FillSMJoinedNotify(hum, notifymsg);
|
||||
GGListener::Instance()->SendToClient(hdr.socket_handle, hdr.seqid, notifymsg);
|
||||
}
|
||||
|
@ -545,6 +545,8 @@ message SMJoinedNotify
|
||||
|
||||
optional int32 map_type = 5; //目前没用到
|
||||
optional bool elo_start = 6; //目前没用到
|
||||
|
||||
optional int32 error_code = 7; //错误
|
||||
}
|
||||
|
||||
//地图信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user