12121
This commit is contained in:
@@ -23,12 +23,13 @@ public class MapController : ControllerBase
|
||||
private readonly IGameFightService _fightService;
|
||||
private readonly IOnHookService _hookService;
|
||||
private readonly IGameTaskService _taskService;
|
||||
private readonly INoticeService _noticeService;
|
||||
|
||||
public MapController(IUnitUserService userService, IGameMapService mapService, IGameChatService chatService,
|
||||
IUnitUserAttrService attrService, IMessageService messageService, IUnitUserWeight weightService,
|
||||
IUnitUserAccService accService, IGameSkillService skillService, IGameGoodsService goodsService,
|
||||
IGameTeamService teamService, IGameMonsterService monsterService, IGameFightService fightService,
|
||||
IOnHookService hookService, IGameTaskService taskService)
|
||||
IOnHookService hookService, IGameTaskService taskService,INoticeService noticeService)
|
||||
{
|
||||
_userService = userService;
|
||||
_mapService = mapService;
|
||||
@@ -44,6 +45,7 @@ public class MapController : ControllerBase
|
||||
_fightService = fightService;
|
||||
_hookService = hookService;
|
||||
_taskService = taskService;
|
||||
_noticeService = noticeService;
|
||||
}
|
||||
|
||||
#region 地图相关
|
||||
@@ -146,6 +148,8 @@ public class MapController : ControllerBase
|
||||
var onHook = await _hookService.GetUserOnHook(userId);
|
||||
isHook = (int)onHook.status;
|
||||
|
||||
var notice = await _noticeService.GetNoticeDataByMap();
|
||||
|
||||
object ret = new
|
||||
{
|
||||
mapInfo,
|
||||
@@ -163,6 +167,7 @@ public class MapController : ControllerBase
|
||||
fightId,
|
||||
gameTips,
|
||||
isHook,
|
||||
notice,
|
||||
taskCount = taskData.Count
|
||||
};
|
||||
|
||||
|
||||
@@ -296,6 +296,7 @@ public class RecoverController : ControllerBase
|
||||
myEqu = myEqu.FindAll(it =>
|
||||
it.isAppr == 1 && it.durability < it.maxdurability && it.useEndTime > TimeExtend.GetTimeStampSeconds);
|
||||
int need = myEqu.Sum(it => (int)it.maxdurability - (int)it.durability);
|
||||
need = need * 500;
|
||||
if (need < 1)
|
||||
{
|
||||
return PoAction.Message("耐久已满,无需恢复!");
|
||||
@@ -351,6 +352,7 @@ public class RecoverController : ControllerBase
|
||||
}
|
||||
|
||||
int need = (int)equInfo.maxdurability - (int)equInfo.durability;
|
||||
need = need * 500;
|
||||
var myAcc = await _accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
|
||||
if (need > myAcc)
|
||||
{
|
||||
|
||||
@@ -257,6 +257,15 @@ public class GiveController : ControllerBase
|
||||
{
|
||||
return PoAction.Message("玩家不存在!");
|
||||
}
|
||||
//此处判断赠送玩家的设置
|
||||
var roleConfig = await _userService.GetUserConfigInfo(fromInfo.userId);
|
||||
if (roleConfig.giveRole == 1)//判断是否为好友
|
||||
{
|
||||
if (await _relationService.CheckIsFriend(userId, fromInfo.userId)==false)
|
||||
{
|
||||
return PoAction.Message("玩家设置了拒绝陌生人赠送!");
|
||||
}
|
||||
}
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user