Example #1
0
 public override bool GetUrlElement()
 {
     m_UserId        = actionGetter.GetSession().UserId;
     m_RoomId        = (actionGetter.GetSession().User as RoomSessionUser).RoomId;
     m_RequestPacket = ProtoBufUtils.Deserialize <CREntityAddBuff>((byte[])actionGetter.GetMessage());
     return(true);
 }
        private RCPushEntityAddBuff ToRCPushEntityAddBuff(CREntityAddBuff request)
        {
            int originPlayer = m_UserId;
            int targetPlayer = 0;

            foreach (var player in m_Room.Players)
            {
                if (player.Value.InBattleEntity == m_Request.TargetEntityId)
                {
                    targetPlayer = player.Key;
                }
            }
            RCPushEntityAddBuff response = new RCPushEntityAddBuff()
            {
                OriginEntityId  = request.OriginEntityId,
                TargetEntityId  = request.TargetEntityId,
                OriginTransform = request.OriginTransform,
                TargetTransform = request.TargetTransform,
                OriginPlayerId  = originPlayer,
                TargetPlayerId  = targetPlayer,
            };

            response.BuffTypeIds.AddRange(request.BuffTypeIds);
            return(response);
        }
Example #3
0
 public Action5108(ActionGetter actionGetter)
     : base((short)5108, actionGetter)
 {
     m_RequestPacket  = null;
     m_ResponsePacket = null;
     m_UserId         = 0;
     m_RoomId         = 1;
 }
 public override bool Verify(Message message)
 {
     m_Request = message.Packet as CREntityAddBuff;
     return(true);
 }