/// <summary>
        /// 单位离开
        /// </summary>
        private void OnUnitLeave(PacketBase packet)
        {
            ss2c.UnitLeaveAOI msg = packet as ss2c.UnitLeaveAOI;
            Log.Debug("OnUnitLeave:" + msg.unit_idx.obj_idx);

            UnitManager.Instance.RemoveUnit(msg.unit_idx.obj_idx);
        }
Example #2
0
        private void SendAOILeave(long char_idx, long leave_unit_idx)
        {
            Player player = UnitManager.Instance.GetUnitByIdx(char_idx) as Player;

            if (player == null)
            {
                return;
            }
            Unit leave_unit = UnitManager.Instance.GetUnitByIdx(leave_unit_idx);

            if (leave_unit == null)
            {
                return;
            }

            ss2c.UnitLeaveAOI rep_msg = PacketPools.Get(ss2c.msg.LEAVE_AOI) as ss2c.UnitLeaveAOI;
            rep_msg.unit_idx.Set(leave_unit.unit_type, 0, leave_unit.obj_idx);
            rep_msg.flags = 0;
            ServerNetManager.Instance.SendProxy(player.client_uid, rep_msg, false);
        }