mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
Change automatic RaisedPet name to not happen for WoJS (#6)
* Change automatic RaisedPet name to not happen for WoJS This is because Voltage Dragons get a name later, so this placeholder name currently gets assigned first. I've never done this before, so let me know if I did it wrong lol * Added Max_OldJS to the previous PR * Added HaiFire's suggestion * Added [FromForm] string apiKey Ty HaiFire again!
This commit is contained in:
parent
2f5a589bd4
commit
ca951d78e8
@ -514,7 +514,7 @@ public class ContentController : Controller {
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/CreateRaisedPet")] // used by SoD 1.6
|
||||
[VikingSession]
|
||||
public RaisedPetData? CreateRaisedPet(Viking viking, int petTypeID) {
|
||||
public RaisedPetData? CreateRaisedPet([FromForm] string apiKey, Viking viking, int petTypeID) {
|
||||
// Update the RaisedPetData with the info
|
||||
String dragonId = Guid.NewGuid().ToString();
|
||||
|
||||
@ -523,7 +523,9 @@ public class ContentController : Controller {
|
||||
raisedPetData.PetTypeID = petTypeID;
|
||||
raisedPetData.RaisedPetID = 0; // Initially make zero, so the db auto-fills
|
||||
raisedPetData.EntityID = Guid.Parse(dragonId);
|
||||
raisedPetData.Name = string.Concat("Dragon-", dragonId.AsSpan(0, 8)); // Start off with a random name
|
||||
uint gameVersion = ClientVersion.GetVersion(apiKey);
|
||||
if (gameVersion > ClientVersion.Max_OldJS || (gameVersion & ClientVersion.WoJS) == 0)
|
||||
raisedPetData.Name = string.Concat("Dragon-", dragonId.AsSpan(0, 8)); // Start off with a random name (if game isn't WoJS)
|
||||
raisedPetData.IsSelected = false; // The api returns false, not sure why
|
||||
raisedPetData.CreateDate = new DateTime(DateTime.Now.Ticks);
|
||||
raisedPetData.UpdateDate = new DateTime(DateTime.Now.Ticks);
|
||||
|
Loading…
x
Reference in New Issue
Block a user