111
This commit is contained in:
@@ -21,9 +21,12 @@ public class MapController : ControllerBase
|
||||
private readonly IGameSkillService _skillService;
|
||||
private readonly IGameGoodsService _goodsService;
|
||||
private readonly IGameTeamService _teamService;
|
||||
private readonly IGameMonsterService _monsterService;
|
||||
|
||||
public MapController(IUnitUserService userService, IGameMapService mapService, IGameChatService chatService,
|
||||
IUnitUserAttrService attrService, IMessageService messageService, IUnitUserWeight weightService,
|
||||
IUnitUserAccService accService, IGameSkillService skillService,IGameGoodsService goodsService,IGameTeamService teamService)
|
||||
IUnitUserAccService accService, IGameSkillService skillService, IGameGoodsService goodsService,
|
||||
IGameTeamService teamService, IGameMonsterService monsterService)
|
||||
{
|
||||
_userService = userService;
|
||||
_mapService = mapService;
|
||||
@@ -35,6 +38,7 @@ public class MapController : ControllerBase
|
||||
_skillService = skillService;
|
||||
_goodsService = goodsService;
|
||||
_teamService = teamService;
|
||||
_monsterService = monsterService;
|
||||
}
|
||||
|
||||
#region 地图相关
|
||||
@@ -89,14 +93,17 @@ public class MapController : ControllerBase
|
||||
#endregion
|
||||
|
||||
//公聊信息
|
||||
var myTeam = await _teamService.GetUserTeamData(userId);
|
||||
string teamId =myTeam.teamId ;
|
||||
var myTeam = await _teamService.GetUserTeamData(userId);
|
||||
string teamId = myTeam.teamId;
|
||||
string groupId = "";
|
||||
var chatData = await _chatService.GetChatTop(userId, area, 2, teamId, groupId);
|
||||
|
||||
|
||||
var npcData = await _mapService.GetMapNpc(mapInfo.mapId); //NPC信息
|
||||
npcData = npcData.FindAll(it => GameTool.AreaVerify(StateHelper.areaId, it.areaId));
|
||||
|
||||
//获取怪物
|
||||
var monsterData = await _monsterService.GetMapMonster(userId, mapInfo.mapId, teamId);
|
||||
var nearUser =
|
||||
await _mapService.GetMapUser(mapInfo.mapId, area, (int)mapInfo.lookArea, [userId],
|
||||
3); //获取附近的人
|
||||
@@ -145,7 +152,8 @@ public class MapController : ControllerBase
|
||||
noReadMsg = noReadMsg[3],
|
||||
business,
|
||||
mapRes,
|
||||
broadcast
|
||||
broadcast,
|
||||
monster = monsterData
|
||||
};
|
||||
|
||||
return PoAction.Ok(ret);
|
||||
|
||||
@@ -50,6 +50,7 @@ public class StoreController : ControllerBase
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Store)))
|
||||
{
|
||||
return PoAction.Message("业务不可用!");
|
||||
@@ -88,6 +89,7 @@ public class StoreController : ControllerBase
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Store)))
|
||||
{
|
||||
return PoAction.Message("业务不可用!");
|
||||
@@ -165,10 +167,12 @@ public class StoreController : ControllerBase
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Store)))
|
||||
{
|
||||
return PoAction.Message("业务不可用!");
|
||||
}
|
||||
|
||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||
if (npcInfo.mapId != onMap)
|
||||
{
|
||||
@@ -179,25 +183,25 @@ public class StoreController : ControllerBase
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
var data = await _equService.GetUserEquData(userId, 0, query, page, 10, total, true);
|
||||
return PoAction.Ok(new { data, total.Value });
|
||||
var data = await _equService.GetUserEquData(userId, 0, query, page, 10, total, true, true);
|
||||
return PoAction.Ok(new { data, total = total.Value });
|
||||
}
|
||||
else if (type == 1)
|
||||
{
|
||||
List<string> code = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
||||
var data = await _goodsService.GetUserGoodsData(userId, code, new List<string>(), query, page, 10, total);
|
||||
return PoAction.Ok(new { data, total.Value });
|
||||
return PoAction.Ok(new { data, total = total.Value });
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
List<string> code = new List<string>();
|
||||
List<string> noCode = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
||||
var data = await _goodsService.GetUserGoodsData(userId, code, noCode, query, page, 10, total);
|
||||
return PoAction.Ok(new { data, total.Value });
|
||||
return PoAction.Ok(new { data, total = total.Value });
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Ok(new { data = new List<string>(), total.Value });
|
||||
return PoAction.Ok(new { data = new List<string>(), total = total.Value });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +233,7 @@ public class StoreController : ControllerBase
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (parms.type == 0)//装备
|
||||
if (parms.type == 0) //装备
|
||||
{
|
||||
var equInfo = await _equService.GetUserEquInfo(parms.id);
|
||||
if (equInfo == null)
|
||||
@@ -259,7 +263,7 @@ public class StoreController : ControllerBase
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("出售失败,请稍后尝试!");
|
||||
return PoAction.Message("出售失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
else //物品
|
||||
@@ -288,7 +292,7 @@ public class StoreController : ControllerBase
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("出售失败,请稍后尝试!");
|
||||
return PoAction.Message("出售失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user