mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-05-06 18:59:33 +08:00
修复一些问题
This commit is contained in:
parent
5a503f8fc6
commit
dc33c72289
@ -150,7 +150,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("winraterank")]
|
||||
public string GetWinrateRank([FromQuery] bool? isteam = null)
|
||||
public List<string> GetWinrateRank([FromQuery] bool? isteam = null)
|
||||
{
|
||||
bool team = isteam ?? false;
|
||||
if (team)
|
||||
@ -169,7 +169,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
builder.AppendLine($"MVP次数:{stats.MVPs}");
|
||||
strings.Add(builder.ToString());
|
||||
}
|
||||
return NetworkUtility.JsonSerialize(strings);
|
||||
return strings;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -189,7 +189,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
builder.AppendLine($"MVP次数:{stats.MVPs}");
|
||||
strings.Add(builder.ToString());
|
||||
}
|
||||
return NetworkUtility.JsonSerialize(strings);
|
||||
return strings;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,17 +48,17 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
bool result = true;
|
||||
try
|
||||
{
|
||||
string openid = "";
|
||||
long uid = 0;
|
||||
|
||||
if (e is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
string isGroup = e.IsGroup ? "群聊" : "私聊";
|
||||
string openid = e.AuthorOpenId;
|
||||
long uid = 0;
|
||||
|
||||
openid = e.AuthorOpenId;
|
||||
if (openid != "")
|
||||
{
|
||||
if (MemoryCache.TryGetValue(openid, out object? value) && value is long uidTemp)
|
||||
{
|
||||
uid = uidTemp;
|
||||
@ -77,6 +77,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if (QQOpenID.QQAndOpenID.TryGetValue(openid, out long temp_qq))
|
||||
//{
|
||||
@ -345,20 +346,20 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail.StartsWith("查个人胜率", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetWinrateRank(false)) ?? "";
|
||||
if (msg.Length > 0)
|
||||
List<string> msgs = Controller.GetWinrateRank();
|
||||
if (msgs.Count > 0)
|
||||
{
|
||||
await SendAsync(e, "查个人胜率", string.Join("\r\n\r\n", msg));
|
||||
await SendAsync(e, "查个人胜率", string.Join("\r\n\r\n", msgs));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (e.Detail.StartsWith("查团队胜率", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetWinrateRank(true)) ?? "";
|
||||
if (msg.Length > 0)
|
||||
List<string> msgs = Controller.GetWinrateRank(true);
|
||||
if (msgs.Count > 0)
|
||||
{
|
||||
await SendAsync(e, "查团队胜率", string.Join("\r\n\r\n", msg));
|
||||
await SendAsync(e, "查团队胜率", string.Join("\r\n\r\n", msgs));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user