33 lines
884 B
C#
33 lines
884 B
C#
namespace ET.Server
|
|
{
|
|
public static class HeroNoticeHelper
|
|
{
|
|
public static void NotifyHeroUpdate(Session session, Hero hero)
|
|
{
|
|
if (session == null || hero == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Hero_HeroInfo notice = Hero_HeroInfo.Create();
|
|
notice.hero = HeroMapper.ToProto(hero);
|
|
session.Send(notice);
|
|
}
|
|
|
|
public static void NotifyHeroList(Session session, HeroComponent heroComponent)
|
|
{
|
|
if (session == null || heroComponent == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Hero_HeroInfoList list = Hero_HeroInfoList.Create();
|
|
foreach (Hero hero in heroComponent.GetAllHeroes())
|
|
{
|
|
list.heroes.Add(HeroMapper.ToProto(hero));
|
|
}
|
|
session.Send(list);
|
|
}
|
|
}
|
|
}
|