1212
This commit is contained in:
@@ -55,13 +55,13 @@ public static class GameBus
|
||||
else if (goodsType.Equals(nameof(GameEnum.PropCode.renown)))
|
||||
{
|
||||
var accService = App.GetService<IUnitUserAccService>();
|
||||
isok = await accService.UpdateUserAcc(userId, operate, nameof(AccEnum.AccType.renown), count,
|
||||
isok = await accService.UpdateUserAccBath(userId, operate, nameof(AccEnum.AccType.renown), count,
|
||||
nameof(AccEnum.Name.其他), remark);
|
||||
}
|
||||
else if (goodsType.Equals(nameof(GameEnum.PropCode.teach)))
|
||||
{
|
||||
var accService = App.GetService<IUnitUserAccService>();
|
||||
isok = await accService.UpdateUserAcc(userId, operate, nameof(AccEnum.AccType.teach), count,
|
||||
isok = await accService.UpdateUserAccBath(userId, operate, nameof(AccEnum.AccType.teach), count,
|
||||
nameof(AccEnum.Name.其他), remark);
|
||||
}
|
||||
else if (goodsType.Equals(nameof(GameEnum.PropCode.map)))
|
||||
|
||||
@@ -4,6 +4,31 @@ namespace Application.Domain;
|
||||
|
||||
public class GameTool
|
||||
{
|
||||
/// <summary>
|
||||
/// 单位转换
|
||||
/// </summary>
|
||||
/// <param name="glod"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertCopperName(long glod)
|
||||
{
|
||||
string result = string.Empty;
|
||||
string glodStr = glod.ToString();
|
||||
int yin = 0;
|
||||
int t = 0;
|
||||
if (glodStr.Length > 3)
|
||||
{
|
||||
yin = Convert.ToInt32(glodStr.Substring(0, glodStr.Length - 3));
|
||||
t = Convert.ToInt32(glodStr.Substring(glodStr.Length - 3, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
t = Convert.ToInt32(glod);
|
||||
}
|
||||
result += yin > 0 ? string.Format("{0}银", yin) : "";
|
||||
result += t > 0 ? string.Format("{0}铜", t) : "";
|
||||
result = string.IsNullOrEmpty(result) ? "0铜" : result;
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取等级基础属性
|
||||
/// </summary>
|
||||
|
||||
@@ -14,4 +14,46 @@ public static class UserStateTool
|
||||
var mapService = App.GetService<IGameMapService>();
|
||||
await mapService.SetUserMapDefault(userId);
|
||||
}
|
||||
|
||||
public static async Task<bool> CheckPkState(string userId, string otId, bool isEnemy, bool isAtArea)
|
||||
{
|
||||
bool result = true;
|
||||
var _mapService = App.GetService<IGameMapService>();
|
||||
var onMapInfo = await _mapService.GetUserOnToMapInfo(userId);
|
||||
if (onMapInfo.isPk == 0)
|
||||
{
|
||||
if (onMapInfo.retMap != onMapInfo.mapId)
|
||||
{
|
||||
if (isEnemy == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var otUserOnMap = await _mapService.GetUserOnMapInfo(otId);
|
||||
if (onMapInfo.mapId != otUserOnMap.mapId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (otUserOnMap.isOnline == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (onMapInfo.lookArea == 1)
|
||||
{
|
||||
if (isAtArea == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user