using System;
using CommonAI.Zone;
using CommonLang.IO;
using CommonLang.IO.Attribute;
using System.Collections.Generic;
namespace XmdsCommonServer.Message
{
public interface MessagePlayerEventB2R
{
string eventName { get; set; }
string playerId { get; set; }
}
public interface MessageZoneEventB2R
{
string eventName { get; set; }
string instanceId { get; set; }
}
public interface MessageMapEventB2R
{
string eventName { get; set; }
}
///
/// 战斗服通知游戏服扣道具.
///
[MessageType(0xF000009)]
public class ConsumeItemEventB2R : PlayerEvent, MessagePlayerEventB2R
{
public string eventName { get; set; }
public string playerId { get; set; }
public string Type = null;
public int Qty = 0;
public string Reason = null;
public ConsumeItemEventB2R() { }
public ConsumeItemEventB2R(string p, string t, int q, string r)
{
playerId = p;
Type = t;
Qty = q;
Reason = r;
}
override public void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutUTF(playerId);
output.PutUTF(Type);
output.PutS32(Qty);
output.PutUTF(Reason);
}
override public void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
playerId = input.GetUTF();
Type = input.GetUTF();
Qty = input.GetS32();
Reason = input.GetUTF();
}
}
///
/// 通知游戏服传送单位.
///
[MessageType((0xF000017))]
public class TransUnitEventB2R : PlayerEvent, MessagePlayerEventB2R
{
public string eventName { get; set; }
public string playerId { get; set; }
public int SceneID = 0;
public int TargetX = 0;
public int TargetY = 0;
public TransUnitEventB2R() { }
public override void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
playerId = input.GetUTF();
SceneID = input.GetS32();
TargetX = input.GetS32();
TargetY = input.GetS32();
}
public override void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutUTF(playerId);
output.PutS32(SceneID);
output.PutS32(TargetX);
output.PutS32(TargetY);
}
}
///
/// 坐骑变更通知.
///
[MessageType((0xF000018))]
public class SummonMountEventB2R : PlayerEvent, MessagePlayerEventB2R
{
public string eventName { get; set; }
///
/// 单位UUID.
///
public string playerId { get; set; }
///
/// 坐骑ID.
///
public bool IsSummonMount = false;
public override void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
playerId = input.GetUTF();
IsSummonMount = input.GetBool();
}
public override void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutUTF(playerId);
output.PutBool(IsSummonMount);
}
}
///
/// 通知游戏服弹框.
///
[MessageType((0xF000021))]
public class ShowRebirthDialogueB2R : PlayerEvent, MessagePlayerEventB2R
{
public string eventName { get; set; }
///
/// 单位UUID.
///
public string playerId { get; set; }
///
/// 死亡单位UUID.
///
public string DeadUnitUUID = null;
///
/// 施救者名字.
///
public string SaverName = null;
///
/// 施救者名字.
///
public string SaverUUID = null;
///
/// 复活后恢复HP
///
public int HP = 0;
///
/// 复活后恢复MP
///
public int MP = 0;
public override void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutUTF(DeadUnitUUID);
output.PutUTF(SaverName);
output.PutUTF(SaverUUID);
output.PutS32(HP);
output.PutS32(MP);
}
public override void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
DeadUnitUUID = input.GetUTF();
SaverName = input.GetUTF();
SaverUUID = input.GetUTF();
HP = input.GetS32();
MP = input.GetS32();
}
}
///
/// 通知游戏服触发事件.
///
[MessageType((0xFFF0001))]
public class TriggerSceneEventB2R : PlayerEvent, MessagePlayerEventB2R
{
public string EventID = null;
public string playerId { get; set; }
public string eventName { get; set; }
public TriggerSceneEventB2R() { }
public override void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
EventID = input.GetUTF();
playerId = input.GetUTF();
}
public override void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutUTF(EventID);
output.PutUTF(playerId);
}
}
///
/// 向游戏服发送战报信息.
///
[MessageType((0xFFF0002))]
public class BattleReportEventB2R : ZoneEvent, MessageZoneEventB2R
{
public string eventName { get; set; }
///
/// 场景号.
///
public string instanceId { get; set; }
public List data = null;
public override void ReadExternal(IInputStream input)
{
instanceId = input.GetUTF();
this.data = input.GetList(input.GetExt);
}
public override void WriteExternal(IOutputStream output)
{
output.PutUTF(instanceId);
output.PutList(this.data, output.PutExt);
}
}
///
///单位战报详细信息.
///
[MessageType((0xFFF0003))]
public class UnitBattleReportDetail : IExternalizable
{
public uint ID = 0;
///
/// 单位UUID
///
public string PlayerUUID = null;
///
/// 单位模板id
///
public int TemplateID = 0;
///
/// 单位阵营
///
public int Force = 0;
///
/// 总伤害.
///
public long TotalDamage = 0;
///
/// 总治疗量.
///
public long TotalHealing = 0;
public void ReadExternal(IInputStream input)
{
ID = input.GetU32();
PlayerUUID = input.GetUTF();
TemplateID = input.GetS32();
Force = input.GetS32();
TotalDamage = input.GetS64();
TotalHealing = input.GetS64();
}
public void WriteExternal(IOutputStream output)
{
output.PutU32(ID);
output.PutUTF(PlayerUUID);
output.PutS32(TemplateID);
output.PutS32(Force);
output.PutS64(TotalDamage);
output.PutS64(TotalHealing);
}
}
///
/// 通知游戏服谁击杀了BOSS.
///
[MessageType((0xFFF0004))]
public class KillBossEventB2R : ZoneEvent, MessageZoneEventB2R
{
public string eventName { get; set; }
///
/// 场景ID.
///
public string instanceId { get; set; }
public string PlayerUUID = null;
public override void ReadExternal(IInputStream input)
{
PlayerUUID = input.GetUTF();
instanceId = input.GetUTF();
}
public override void WriteExternal(IOutputStream output)
{
output.PutUTF(PlayerUUID);
output.PutUTF(instanceId);
}
}
///
/// 玩家异常.
///
[MessageType((0xFFF0005))]
public class PlayerExceptionEventB2R : PlayerEvent, MessagePlayerEventB2R
{
public string playerId { get; set; }
///
/// 场景ID.
///
public string instanceId { get; set; }
public string eventName { get; set; }
public string reason { get; set; }
}
///
/// 山大王小弟护卫事件触发
///
[MessageType((0xFFF0006))]
public class MountainKingHelpEventB2R : ZoneEvent, MessageMapEventB2R
{
public string eventName { get; set; }
public int mapId;
///
/// 场景ID.
///
public int monsterId;
public uint monsterObjectId;
public List players = new List();
public override void ReadExternal(IInputStream input)
{
throw new NotImplementedException();
}
public override void WriteExternal(IOutputStream output)
{
throw new NotImplementedException();
}
}
}