/// <summary> /// 通知攻击事件 /// </summary> /// <param name="globalRoleID">攻击者的全局ID</param> /// <param name="skillID">技能ID</param> /// <param name="targetid">目标的全局ID</param> /// <param name="position">坐标</param> /// <param name="accounts">所有账号</param> public static void NotifyAttack(uint characterid, uint skillID, uint targetid, Vector3 position, Dictionary <string, Account> accounts) { NotifyCharacterAttack notify = new NotifyCharacterAttack(); notify.characterid = characterid; notify.skillid = skillID; notify.pos = ProtoHelper.LV2PV(position); notify.targetid = targetid; MsgSender.BroadCast(accounts, MsgID.NotifyCharacterAttack, notify); }
/// <summary> /// 角色攻击应答 /// </summary> /// <param name="data"></param> private void OnCharacterAttack(SocketModel model) { NotifyCharacterAttack notify = SerializeUtil.Deserialize <NotifyCharacterAttack>(model.message); Character role = Battle.instance.GetRole(notify.characterid); role.position = ProtoHelper.PV2UV(notify.pos); if (notify.pos == null) { LogManager.Log("OnRoleAttack, position = null"); return; } //role.Attack((int)notify.skillid, notify.targetid); }