mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
job board and quests bugfixes
* fix: jobs disappear after completing * fix: jobs (and quest) does not cost items
This commit is contained in:
parent
e50207ac2e
commit
5c802927a0
@ -759,7 +759,7 @@ public class ContentController : Controller {
|
|||||||
[Produces("application/xml")]
|
[Produces("application/xml")]
|
||||||
[Route("V2/ContentWebService.asmx/SetTaskState")]
|
[Route("V2/ContentWebService.asmx/SetTaskState")]
|
||||||
[VikingSession]
|
[VikingSession]
|
||||||
public IActionResult SetTaskState(Viking viking, [FromForm] Guid userId, [FromForm] int missionId, [FromForm] int taskId, [FromForm] bool completed, [FromForm] string xmlPayload, [FromForm] string apiKey) {
|
public IActionResult SetTaskState(Viking viking, [FromForm] Guid userId, [FromForm] int missionId, [FromForm] int taskId, [FromForm] bool completed, [FromForm] string xmlPayload, [FromForm] string commonInventoryRequestXml, [FromForm] string apiKey) {
|
||||||
if (viking.Uid != userId)
|
if (viking.Uid != userId)
|
||||||
return Unauthorized("Can't set not owned task");
|
return Unauthorized("Can't set not owned task");
|
||||||
|
|
||||||
@ -770,6 +770,12 @@ public class ContentController : Controller {
|
|||||||
Status = SetTaskStateStatus.TaskCanBeDone,
|
Status = SetTaskStateStatus.TaskCanBeDone,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (commonInventoryRequestXml.Length > 44) { // avoid process inventory on empty xml request,
|
||||||
|
// NOTE: client do not set this on empty string when no inventory change request, but send <?xml version="1.0" encoding="utf-8"?>
|
||||||
|
SetCommonInventory(viking, commonInventoryRequestXml);
|
||||||
|
taskResult.CommonInvRes = new CommonInventoryResponse { Success = true };
|
||||||
|
}
|
||||||
|
|
||||||
if (results.Count > 0)
|
if (results.Count > 0)
|
||||||
taskResult.MissionsCompleted = results.ToArray();
|
taskResult.MissionsCompleted = results.ToArray();
|
||||||
|
|
||||||
|
@ -74,7 +74,10 @@ public class MissionService {
|
|||||||
task.Payload = null;
|
task.Payload = null;
|
||||||
task.Completed = false;
|
task.Completed = false;
|
||||||
}
|
}
|
||||||
missionState.MissionStatus = MissionStatus.Upcoming;
|
if (missionStore.GetActiveMissions(apiKey).Contains(missionId))
|
||||||
|
missionState.MissionStatus = MissionStatus.Active;
|
||||||
|
else
|
||||||
|
missionState.MissionStatus = MissionStatus.Upcoming;
|
||||||
} else {
|
} else {
|
||||||
missionState.MissionStatus = MissionStatus.Completed;
|
missionState.MissionStatus = MissionStatus.Completed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user