public override bool GetUrlElement() { m_UserId = actionGetter.GetSession().UserId; m_RoomId = (actionGetter.GetSession().User as RoomSessionUser).RoomId; m_RequestPacket = ProtoBufUtils.Deserialize <CREntitySwitchHero>((byte[])actionGetter.GetMessage()); return(true); }
public override bool Verify(Message message) { m_Request = message.Packet as CREntitySwitchHero; m_Response.SerialId = m_Request.SerialId; int playerId = message.Session.UserId; if (DateTime.UtcNow.Ticks - m_Room.StartTime < GameConfigs.GetInt("Room_Battle_Start_Protection_Time", 3) * TimeSpan.TicksPerSecond) { return(false); } if (m_Request.OldEntityId != m_Room.Players[playerId].InBattleEntity) { return(false); } var newhero = m_Room.Players[playerId].Heros.Find(t => t.EntityId == m_Request.NewEntityId); if (newhero == null) { return(false); } if (newhero.HP <= 0) { return(false); } return(true); }
public Action5104(ActionGetter actionGetter) : base((short)5104, actionGetter) { m_RequestPacket = null; m_ResponsePacket = null; m_UserId = 0; }