12121
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
namespace Application.Web.Controllers.Map;
|
||||
namespace Application.Web.Controllers.Map;
|
||||
|
||||
/// <summary>
|
||||
/// 地图接口
|
||||
@@ -125,34 +124,24 @@ public class MapController : ControllerBase
|
||||
string ip = ComHelper.GetClientUserIp(HttpContext);
|
||||
await _mapService.UpdateUserOnMap(userId, ip, mapInfo.mapId);
|
||||
|
||||
//地图业务
|
||||
IEnumerable<object> business = new List<object>();
|
||||
if (mapInfo.isBus == 1)
|
||||
{
|
||||
var busData = await _mapService.GetMapBus(mapInfo.mapId, 0, 0);
|
||||
business = busData.Select(it => new
|
||||
{
|
||||
busId = it.busId,
|
||||
busName = it.busName
|
||||
});
|
||||
}
|
||||
|
||||
//地图资源
|
||||
List<MapResModel> mapRes = new List<MapResModel>();
|
||||
if (mapInfo.isRes == 1)
|
||||
{
|
||||
mapRes = await _mapService.GetMapResData(mapInfo.mapId, area);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var busData = await _mapService.GetMapBus(mapInfo.mapId, 0, 0);//地图业务
|
||||
IEnumerable<object> business = busData.Select(it => new
|
||||
{
|
||||
busId = it.busId,
|
||||
busName = it.busName
|
||||
});
|
||||
|
||||
List<MapResModel> mapRes = await _mapService.GetMapResData(mapInfo.mapId, area); //地图资源
|
||||
var broadcast = await _messageService.GetBroadcastData(area);
|
||||
|
||||
var userFight = await _fightService.GetUserFight(userId);
|
||||
string fightId = userFight.Count > 0 ? userFight[0] : "";
|
||||
var mapGoods = await _fightService.GetMapFightGoods(mapInfo.mapId);
|
||||
mapGoods = mapGoods.FindAll(it => it.userId == "0" || it.userId == userId).Take(3).ToList();
|
||||
var taskData = await _taskService.GetUserTaskData(userId);
|
||||
var taskData = await _taskService.GetUserTaskData(userId);
|
||||
int isHook = 0; //挂机处理
|
||||
var onHook = await _hookService.GetUserOnHook(userId);
|
||||
isHook = (int)onHook.status;
|
||||
|
||||
@@ -100,7 +100,10 @@ public class TaskController : ControllerBase
|
||||
int toGoods = await _goodsService.GetUserGoodsCount(userId, GameConfig.GameGetTaskGoods);
|
||||
int retGoods = await _goodsService.GetUserGoodsCount(userId, GameConfig.GameRetTaskGoods);
|
||||
return PoAction.Ok(new
|
||||
{ npc = npcInfo, data = data, talkMsg, taskState, btnTips = taskInfo.btnTips, toGoods, retGoods });
|
||||
{
|
||||
npc = npcInfo, data = data, talkMsg, taskState, award = taskInfo.award, btnTips = taskInfo.btnTips, toGoods,
|
||||
retGoods
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -124,7 +127,7 @@ public class TaskController : ControllerBase
|
||||
public async Task<IPoAction> RestTask(int task)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
var onTaskInfo = await _taskService.GetUserTaskInfo(userId,task);
|
||||
var onTaskInfo = await _taskService.GetUserTaskInfo(userId, task);
|
||||
if (onTaskInfo == null)
|
||||
{
|
||||
return PoAction.Message("暂无任务!");
|
||||
@@ -188,7 +191,7 @@ public class TaskController : ControllerBase
|
||||
int toGoods = await _goodsService.GetUserGoodsCount(userId, GameConfig.GameGetTaskGoods);
|
||||
int retGoods = await _goodsService.GetUserGoodsCount(userId, GameConfig.GameRetTaskGoods);
|
||||
return PoAction.Ok(new
|
||||
{ data = data, talkMsg, taskState, toGoods, retGoods,lev = taskInfo.lev });
|
||||
{ data = data, talkMsg, taskState, toGoods, retGoods, lev = taskInfo.lev, award = taskInfo.award });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -263,7 +266,7 @@ public class TaskController : ControllerBase
|
||||
}
|
||||
|
||||
message = message.TrimEnd(',');
|
||||
await GameBus.UpdateBag(userId, 1, award, "完成任务");//发放奖励
|
||||
await GameBus.UpdateBag(userId, 1, award, "完成任务"); //发放奖励
|
||||
}
|
||||
|
||||
return PoAction.Ok(true, message);
|
||||
|
||||
Reference in New Issue
Block a user