mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
add GetActiveRaisedPetsByTypes
This commit is contained in:
parent
22b5a76147
commit
2a20cbd758
@ -762,6 +762,25 @@ public class ContentController : Controller {
|
|||||||
return new RaisedPetData[] {dragonData};
|
return new RaisedPetData[] {dragonData};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Produces("application/xml")]
|
||||||
|
[Route("ContentWebService.asmx/GetActiveRaisedPetsByTypes")] // used by Math Blaster
|
||||||
|
[VikingSession(UseLock=false)]
|
||||||
|
public RaisedPetData[] GetActiveRaisedPet([FromForm] Guid userId, [FromForm] string petTypeIDs) {
|
||||||
|
Viking? viking = ctx.Vikings.FirstOrDefault(e => e.Uid == userId);
|
||||||
|
Dragon? dragon = viking.SelectedDragon;
|
||||||
|
if (dragon is null) {
|
||||||
|
return new RaisedPetData[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
RaisedPetData dragonData = GetRaisedPetDataFromDragon(dragon);
|
||||||
|
int[] petTypeIDsInt = Array.ConvertAll(petTypeIDs.Split(','), s => int.Parse(s));
|
||||||
|
if (!petTypeIDsInt.Contains(dragonData.PetTypeID))
|
||||||
|
return new RaisedPetData[0];
|
||||||
|
|
||||||
|
return new RaisedPetData[] {dragonData};
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Produces("application/xml")]
|
[Produces("application/xml")]
|
||||||
[Route("ContentWebService.asmx/GetSelectedRaisedPet")]
|
[Route("ContentWebService.asmx/GetSelectedRaisedPet")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user