1
This commit is contained in:
parent
952c949d88
commit
e960171497
@ -15,6 +15,7 @@
|
||||
#include "sandtable.h"
|
||||
|
||||
#include "mt/AirLine.h"
|
||||
#include "mt/Hero.h"
|
||||
|
||||
void FrameMaker::Debug_FullObject(Human* hum)
|
||||
{
|
||||
@ -120,6 +121,7 @@ std::shared_ptr<cs::SMUpdate> FrameMaker::MakeUpdateMsg(Human* hum)
|
||||
SerializeChgedCars(msg.get(), room, hum, framedata);
|
||||
SerializeChgedProps(msg.get(), room, hum, framedata);
|
||||
SerializeDelBullets(msg.get(), room, hum, framedata);
|
||||
SerializeVoices(msg.get(), room, hum, framedata);
|
||||
PostProcess(msg.get(), room, hum, framedata);
|
||||
return msg;
|
||||
}
|
||||
@ -607,3 +609,30 @@ void FrameMaker::SerializeDelBullets(cs::SMUpdate* msg, Room* room, Human* hum,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FrameMaker::SerializeVoices(cs::SMUpdate* msg, Room* room, Human* hum, FrameData* framedata)
|
||||
{
|
||||
if (!framedata->voices_.empty()) {
|
||||
msg->mutable_ingame_voices()->Reserve(framedata->voices_.size());
|
||||
for (auto& v : framedata->voices_) {
|
||||
auto p = msg->add_ingame_voices();
|
||||
p->set_voice_id(v->voice_id);
|
||||
if (v->killer_id) {
|
||||
Human* hum = room->GetHumanByUniId(v->killer_id);
|
||||
if (hum) {
|
||||
p->mutable_kill_info()->set_killer_uniid(hum->GetUniId());
|
||||
p->mutable_kill_info()->set_killer_name(hum->GetName());
|
||||
p->mutable_kill_info()->set_killer_hero_id(hum->GetHeroMeta()->id());
|
||||
}
|
||||
}
|
||||
if (v->dead_id) {
|
||||
Human* hum = room->GetHumanByUniId(v->dead_id);
|
||||
if (hum) {
|
||||
p->mutable_kill_info()->set_dead_uniid(hum->GetUniId());
|
||||
p->mutable_kill_info()->set_dead_name(hum->GetName());
|
||||
p->mutable_kill_info()->set_dead_hero_id(hum->GetHeroMeta()->id());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,4 +44,5 @@ private:
|
||||
void SerializeChgedCars(cs::SMUpdate* msg, Room* room, Human* hum, FrameData* framedata);
|
||||
void SerializeChgedProps(cs::SMUpdate* msg, Room* room, Human* hum, FrameData* framedata);
|
||||
void SerializeDelBullets(cs::SMUpdate* msg, Room* room, Human* hum, FrameData* framedata);
|
||||
void SerializeVoices(cs::SMUpdate* msg, Room* room, Human* hum, FrameData* framedata);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user