1212
This commit is contained in:
@@ -40,7 +40,7 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer
|
||||
.OrderByIF(type == 7, it => it.score, OrderByType.Desc)
|
||||
.Take(100)
|
||||
.ToListAsync();
|
||||
total = data.Count;
|
||||
total.Value = data.Count;
|
||||
data = PageExtend.GetPageList(data, page, limit);
|
||||
List<GameRankModel> result = new List<GameRankModel>();
|
||||
foreach (var item in data)
|
||||
@@ -97,7 +97,7 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer
|
||||
.OrderByDescending(uc => uc.copper)
|
||||
.Take(100)
|
||||
.ToListAsync();
|
||||
total = data.Count;
|
||||
total.Value = data.Count;
|
||||
data = PageExtend.GetPageList(data, page, limit);
|
||||
List<GameRankModel> result = new List<GameRankModel>();
|
||||
foreach (var item in data)
|
||||
@@ -120,10 +120,10 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer
|
||||
.Where((uc, u) => uc.lev > 29)
|
||||
.Select<unit_user_attr>()
|
||||
.OrderByDescending(uc => uc.lev)
|
||||
.OrderByDescending(uc=>uc.levUpdate)
|
||||
.OrderBy(uc=>uc.levUpdate,OrderByType.Asc)
|
||||
.Take(100)
|
||||
.ToListAsync();
|
||||
total = data.Count;
|
||||
total.Value = data.Count;
|
||||
data = PageExtend.GetPageList(data, page, limit);
|
||||
List<GameRankModel> result = new List<GameRankModel>();
|
||||
foreach (var item in data)
|
||||
@@ -152,7 +152,7 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer
|
||||
.OrderByIF(type == 11, uc => uc.charm, OrderByType.Desc)
|
||||
.Take(100)
|
||||
.ToListAsync();
|
||||
total = data.Count;
|
||||
total.Value = data.Count;
|
||||
data = PageExtend.GetPageList(data, page, limit);
|
||||
List<GameRankModel> result = new List<GameRankModel>();
|
||||
foreach (var item in data)
|
||||
|
||||
@@ -627,7 +627,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
||||
await redis.SetAsync(key, result, 300);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result == null ? new List<AttrItem>() : result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -233,6 +233,9 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
||||
{
|
||||
await UserStateTool.SetUserMapDefault(lowUser);
|
||||
}
|
||||
//战败后,结束挂机
|
||||
var hookService = App.GetService<IOnHookService>();
|
||||
await hookService.StopOnHook(lowUser);
|
||||
|
||||
fightData.state = 1;
|
||||
fightData.winCode = nameof(UserEnum.AttrCode.Person);
|
||||
@@ -424,7 +427,7 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
||||
string noticeMsg =
|
||||
$"您在{cityInfo.cityName}·{mapInfo.mapName}被[{UbbTool.HomeUbb(winUserInfo.userNo, winUserInfo.nick)}]击杀!";
|
||||
await chatService.SendChat(lowUser, (int)lowUserInfo.areaId, nameof(GameChatEnum.Code.Notice), noticeMsg);
|
||||
if (mapInfo.isPk == 1)
|
||||
if (mapInfo.isPk == 1 && fightData.userId == winUser)
|
||||
{
|
||||
var relationService = App.GetService<IUnitUserRelationService>();
|
||||
if (await relationService.CheckUserEnemy(winUser, lowUser) == false)
|
||||
|
||||
@@ -125,11 +125,9 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
var loadState = await GetUserLoadState(userId);
|
||||
result = await GameAttrTool.CheckRoleLoadBuff(result, loadState);
|
||||
result = await ReviseUserRoleAttr(result);
|
||||
return result;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -588,13 +586,15 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
var data = await redis.GetHashAsync<List<unit_user_state>>(key, userId);
|
||||
if (data == null)
|
||||
{
|
||||
long endTime = TimeExtend.GetTimeStampSeconds;
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_state>();
|
||||
data = await db.Queryable<unit_user_state>().Where(it => it.userId == userId && it.endTime > endTime)
|
||||
data = await db.Queryable<unit_user_state>().Where(it => it.userId == userId)
|
||||
.ToListAsync();
|
||||
await redis.AddHashAsync(key, userId, data);
|
||||
}
|
||||
|
||||
long endTime = TimeExtend.GetTimeStampSeconds;
|
||||
data = data.FindAll(it => it.endTime > endTime);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,11 @@ public class TradeController : ControllerBase
|
||||
count = count < 1 ? 1 : count;
|
||||
string userId = StateHelper.userId;
|
||||
int areaId = StateHelper.areaId;
|
||||
if (price > 100000000000)
|
||||
{
|
||||
return PoAction.Message("最大单价不能超过10万金!");
|
||||
}
|
||||
|
||||
int lev = await _attrService.GetUserLev(userId);
|
||||
if (lev < 60)
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
统一配置中心
|
||||
*/
|
||||
export class BaseConfig {
|
||||
public static BaseUrl: string = 'https://localhost:7198'
|
||||
public static BaseMediaUrl: string = 'https://localhost:7198/'
|
||||
// public static BaseUrl:string="http://v3.pccsh.com";
|
||||
// public static BaseMediaUrl:string="http://v3.pccsh.com";
|
||||
// public static BaseUrl: string = 'https://localhost:7198'
|
||||
// public static BaseMediaUrl: string = 'https://localhost:7198/'
|
||||
public static BaseUrl:string="http://v3.pccsh.com";
|
||||
public static BaseMediaUrl:string="http://v3.pccsh.com";
|
||||
}
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<span v-if="item.code == 'Equ'">
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ GameTool.FormatCopper(item.price) }})
|
||||
</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ GameTool.FormatCopper(item.price) }})
|
||||
</Abar>
|
||||
</span>
|
||||
[<Abutton @click="Buy(item)">购买</Abutton>]
|
||||
</div>
|
||||
@@ -36,7 +38,7 @@
|
||||
<!-- 自定义内容 -->
|
||||
<div class="common">
|
||||
物品名称:{{ showGoods.name }}<br>
|
||||
购买单价:{{ showGoods.price }} 铜贝<br>
|
||||
购买单价:{{ GameTool.FormatCopper(showGoods.price) }}<br>
|
||||
<span v-if="showGoods.code != 'Equ'">
|
||||
剩余数量:{{ showGoods.count }}
|
||||
</span>
|
||||
@@ -88,6 +90,7 @@ const BindData = async (): Promise<void> => {
|
||||
|
||||
const Change = async (_type: string) => {
|
||||
type.value = _type;
|
||||
currentPage.value = 1;
|
||||
await BindData();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ index + 1 }}.[{{ GetRankName(item.code) }}]
|
||||
<span v-if="item.code == 'Equ'">
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ GameTool.FormatCopper(item.price) }})</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ GameTool.FormatCopper(item.price) }})</Abar>
|
||||
</span>
|
||||
(<Abutton @click="Down(item.tradeId)">下架</Abutton>)<br>
|
||||
<span v-if="item.code != 'Equ'">
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.[{{ GetRankName(item.code) }}]
|
||||
<span v-if="item.code == 'Equ'">
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ GameTool.FormatCopper(item.price) }})</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ GameTool.FormatCopper(item.price) }})</Abar>
|
||||
</span>
|
||||
[<Abutton @click="Buy(item)">购买</Abutton>]
|
||||
</div>
|
||||
@@ -24,7 +24,7 @@
|
||||
<!-- 自定义内容 -->
|
||||
<div class="common">
|
||||
物品名称:{{ showGoods.name }}<br>
|
||||
购买单价:{{ showGoods.price }} 铜贝<br>
|
||||
购买单价:{{ GameTool.FormatCopper(showGoods.price) }}<br>
|
||||
<span v-if="showGoods.code != 'Equ'">
|
||||
剩余数量:{{ showGoods.count }}
|
||||
</span>
|
||||
|
||||
@@ -47,6 +47,7 @@ const BindData = async () => {
|
||||
data.value = result.data.data;
|
||||
unitExp.value = result.data.unitExp;
|
||||
dupExp.value = result.data.dupExp;
|
||||
console.log(result);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("特性", result.msg);
|
||||
|
||||
Reference in New Issue
Block a user