Example #1
0
 public Action5101(ActionGetter actionGetter)
     : base((short)5101, actionGetter)
 {
     m_RequestPacket  = null;
     m_ResponsePacket = null;
     m_UserId         = 0;
 }
        public override void Process()
        {
            RCPushEntityPerformSkillStart response = new RCPushEntityPerformSkillStart()
            {
                EntityId  = m_Request.EntityId,
                Transform = m_Request.Transform,
                SkillId   = m_Request.SkillId,
                PlayerId  = m_UserId,
            };

            byte[] buffer = CustomActionDispatcher.GeneratePackageStream((int)ActionType.RCPushEntityPerformSkillStart, ProtoBufUtils.Serialize(response));
            TraceLog.Write("{0}'s Skill:{1} was started at {2},{3},{4}", m_Room.Players[m_UserId].Name, m_Request.SkillId, m_Request.Transform.PositionX, m_Request.Transform.PositionY, m_Request.Transform.Rotation);
            foreach (var player in m_Room.Players)
            {
                GameSession.Get(player.Key).SendAsync(buffer, 0, buffer.Length);
            }
            m_Response.Result = true;
        }