1212
This commit is contained in:
@@ -46,15 +46,16 @@ public class MapController : ControllerBase
|
||||
int area = StateHelper.areaId;
|
||||
game_city_map mapInfo = new game_city_map();
|
||||
|
||||
#region 前置条件处理
|
||||
#region 前置条件处理
|
||||
|
||||
var userRunInfo = await _mapService.GetUserRun(userId);
|
||||
if (userRunInfo.status != 0)
|
||||
{
|
||||
return PoAction.Message("正在航行状态", 103);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 地图导向处理
|
||||
|
||||
bool isSelfMap = false;
|
||||
@@ -104,10 +105,26 @@ 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<game_city_map_res> mapRes = new List<game_city_map_res>();
|
||||
if (mapInfo.isRes==1)
|
||||
{
|
||||
mapRes = await _mapService.GetMapRes(mapInfo.mapId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
object ret = new
|
||||
{
|
||||
mapInfo,
|
||||
@@ -116,7 +133,9 @@ public class MapController : ControllerBase
|
||||
chatData,
|
||||
cityShow,
|
||||
nearUser,
|
||||
noReadMsg = noReadMsg[3]
|
||||
noReadMsg = noReadMsg[3],
|
||||
business,
|
||||
mapRes
|
||||
};
|
||||
|
||||
return PoAction.Ok(ret);
|
||||
@@ -495,7 +514,14 @@ public class MapController : ControllerBase
|
||||
var toCity = await _mapService.GetCityInfoByMapId(runInfo.toMap);
|
||||
int isShip = 0;
|
||||
int safety = 0;
|
||||
|
||||
string busCode = $"{runInfo.onMap}_{runInfo.toMap}";
|
||||
var busData = await _mapService.GetMapBus(busCode, (int)runInfo.position, (int)runInfo.depth);
|
||||
var business = busData.Select(it => new
|
||||
{
|
||||
busId = it.busId,
|
||||
busName = it.busName
|
||||
});
|
||||
|
||||
return PoAction.Ok(new
|
||||
{
|
||||
onCity = onCity.cityName,
|
||||
@@ -503,7 +529,8 @@ public class MapController : ControllerBase
|
||||
distance = runInfo.distance,
|
||||
position = runInfo.position,
|
||||
isShip = isShip,
|
||||
safety = safety
|
||||
safety = safety,
|
||||
business
|
||||
});
|
||||
}
|
||||
|
||||
@@ -540,6 +567,7 @@ public class MapController : ControllerBase
|
||||
{
|
||||
return PoAction.Message("不在航行状态", 100);
|
||||
}
|
||||
|
||||
var userShip = await _weightService.GetUserShip(userId);
|
||||
if (userShip.Count == 0)
|
||||
{
|
||||
@@ -560,7 +588,8 @@ public class MapController : ControllerBase
|
||||
runInfo.upTime = TimeExtend.GetTimeStampSeconds;
|
||||
if (await _mapService.UpdateUserRunInfo(runInfo))
|
||||
{
|
||||
return PoAction.Ok(true);
|
||||
string msg = await _mapService.GetUserRunEvent(userId);
|
||||
return PoAction.Ok(true, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user