This commit is contained in:
Putoo
2026-07-16 12:48:31 +08:00
parent c94b3ce200
commit 2cd2ed02f8
19 changed files with 138 additions and 20 deletions

View File

@@ -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
};

View File

@@ -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)
{

View File

@@ -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)
{