mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-22 03:49:35 +08:00
更新行动顺序表的异步支持
This commit is contained in:
parent
8461cba50e
commit
ccd88c5473
@ -199,9 +199,9 @@ namespace Oshima.FunGame.OshimaServers
|
||||
foreach (Character c in inGameCharacters.Where(c => c != winner && c.HP > 0))
|
||||
{
|
||||
SendAllGamingMessage(obj, data, "[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。");
|
||||
actionQueue.DeathCalculation(winner, c);
|
||||
await actionQueue.DeathCalculationAsync(winner, c);
|
||||
}
|
||||
actionQueue.EndGameInfo(winner);
|
||||
await actionQueue.EndGameInfo(winner);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ namespace Oshima.FunGame.OshimaServers
|
||||
break;
|
||||
}
|
||||
|
||||
bool isGameEnd = actionQueue.ProcessTurn(characterToAct);
|
||||
bool isGameEnd = await actionQueue.ProcessTurnAsync(characterToAct);
|
||||
if (isGameEnd)
|
||||
{
|
||||
break;
|
||||
@ -229,7 +229,7 @@ namespace Oshima.FunGame.OshimaServers
|
||||
}
|
||||
|
||||
// 模拟时间流逝
|
||||
totalTime += actionQueue.TimeLapse();
|
||||
totalTime += await actionQueue.TimeLapse();
|
||||
|
||||
if (actionQueue.Eliminated.Count > deaths)
|
||||
{
|
||||
|
@ -18,11 +18,11 @@ namespace Oshima.FunGame.OshimaServers
|
||||
|
||||
public override string Author => OshimaGameModuleConstant.Author;
|
||||
|
||||
public override void ProcessInput(string input)
|
||||
public override async void ProcessInput(string input)
|
||||
{
|
||||
if (input == "fungametest")
|
||||
{
|
||||
FunGameSimulation.StartSimulationGame(true, true);
|
||||
await FunGameSimulation.StartSimulationGame(true, true);
|
||||
}
|
||||
// OSM指令
|
||||
if (input.StartsWith(".osm", StringComparison.CurrentCultureIgnoreCase))
|
||||
|
@ -16,7 +16,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
|
||||
private string _msg = "";
|
||||
|
||||
public List<string> StartGame(List<Character> characters, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
public async Task<List<string>> StartGame(List<Character> characters, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
{
|
||||
Result.Clear();
|
||||
PrintOut = printout;
|
||||
@ -69,9 +69,9 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
foreach (Character c in characters.Where(c => c != winner && c.HP > 0))
|
||||
{
|
||||
WriteLine("[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。");
|
||||
actionQueue.DeathCalculation(winner, c);
|
||||
await actionQueue.DeathCalculationAsync(winner, c);
|
||||
}
|
||||
actionQueue.EndGameInfo(winner);
|
||||
await actionQueue.EndGameInfo(winner);
|
||||
Result.Add(_msg);
|
||||
break;
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
List<Skill> skillRewards = [];
|
||||
if (roundRewards.TryGetValue(i, out List<Skill>? effectList) && effectList != null)
|
||||
{
|
||||
skillRewards = new(effectList);
|
||||
skillRewards = [.. effectList];
|
||||
}
|
||||
|
||||
WriteLine($"=== Round {i++} ===");
|
||||
@ -127,7 +127,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
bool isGameEnd = actionQueue.ProcessTurn(characterToAct);
|
||||
bool isGameEnd = await actionQueue.ProcessTurnAsync(characterToAct);
|
||||
|
||||
if (realSkillRewards.Count > 0)
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
|
||||
// 模拟时间流逝
|
||||
double timeLapse = actionQueue.TimeLapse();
|
||||
double timeLapse = await actionQueue.TimeLapse();
|
||||
totalTime += timeLapse;
|
||||
|
||||
if (roundMsg != "")
|
||||
@ -260,7 +260,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> StartTeamGame(List<Team> teams, int maxRespawnTimes = 0, int maxScoreToWin = 0, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
public async Task<List<string>> StartTeamGame(List<Team> teams, int maxRespawnTimes = 0, int maxScoreToWin = 0, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
{
|
||||
Result.Clear();
|
||||
PrintOut = printout;
|
||||
@ -330,7 +330,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
List<Skill> skillRewards = [];
|
||||
if (roundRewards.TryGetValue(i, out List<Skill>? effectList) && effectList != null)
|
||||
{
|
||||
skillRewards = new(effectList);
|
||||
skillRewards = [.. effectList];
|
||||
}
|
||||
|
||||
WriteLine($"=== Round {i++} ===");
|
||||
@ -371,7 +371,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
bool isGameEnd = actionQueue.ProcessTurn(characterToAct);
|
||||
bool isGameEnd = await actionQueue.ProcessTurnAsync(characterToAct);
|
||||
|
||||
if (realSkillRewards.Count > 0)
|
||||
{
|
||||
@ -419,7 +419,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
|
||||
// 模拟时间流逝
|
||||
double timeLapse = actionQueue.TimeLapse();
|
||||
double timeLapse = await actionQueue.TimeLapse();
|
||||
totalTime += timeLapse;
|
||||
|
||||
if (roundMsg != "")
|
||||
@ -494,14 +494,14 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
if (PrintOut) Console.WriteLine(str);
|
||||
}
|
||||
|
||||
public static List<string> NewAndStartGame(List<Character> characters, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
public static async Task<List<string>> NewAndStartGame(List<Character> characters, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
{
|
||||
return new FunGameActionQueue().StartGame(characters, printout, isWeb, deathMatchRoundDetail, showRoundEndDetail, showAllRound);
|
||||
return await new FunGameActionQueue().StartGame(characters, printout, isWeb, deathMatchRoundDetail, showRoundEndDetail, showAllRound);
|
||||
}
|
||||
|
||||
public static List<string> NewAndStartTeamGame(List<Team> teams, int maxRespawnTimes = 0, int maxScoreToWin = 0, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
public static async Task<List<string>> NewAndStartTeamGame(List<Team> teams, int maxRespawnTimes = 0, int maxScoreToWin = 0, bool printout = false, bool isWeb = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false)
|
||||
{
|
||||
return new FunGameActionQueue().StartTeamGame(teams, maxRespawnTimes, maxScoreToWin, printout, isWeb, deathMatchRoundDetail, showRoundEndDetail, showAllRound);
|
||||
return await new FunGameActionQueue().StartTeamGame(teams, maxRespawnTimes, maxScoreToWin, printout, isWeb, deathMatchRoundDetail, showRoundEndDetail, showAllRound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> StartSimulationGame(bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false)
|
||||
public static async Task<List<string>> StartSimulationGame(bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false)
|
||||
{
|
||||
PrintOut = printout;
|
||||
IsWeb = isWeb;
|
||||
@ -76,7 +76,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
// M = 5, W = 0, P1 = 0, P3 = 2
|
||||
// M = 5, W = 1, P1 = 0, P3 = 0
|
||||
|
||||
List<Character> list = new(FunGameConstant.Characters);
|
||||
List<Character> list = [.. FunGameConstant.Characters];
|
||||
|
||||
if (list.Count > 11)
|
||||
{
|
||||
@ -167,6 +167,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
// 因赋予了装备,所以清除排序重新排
|
||||
actionQueue.ClearQueue();
|
||||
actionQueue.InitCharacterQueue(characters);
|
||||
actionQueue.SetCharactersToAIControl(false, characters);
|
||||
if (PrintOut) Console.WriteLine();
|
||||
|
||||
// 团队模式
|
||||
@ -239,9 +240,9 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
foreach (Character c in characters.Where(c => c != winner && c.HP > 0))
|
||||
{
|
||||
WriteLine("[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。");
|
||||
actionQueue.DeathCalculation(winner, c);
|
||||
await actionQueue.DeathCalculationAsync(winner, c);
|
||||
}
|
||||
actionQueue.EndGameInfo(winner);
|
||||
await actionQueue.EndGameInfo(winner);
|
||||
result.Add(Msg);
|
||||
break;
|
||||
}
|
||||
@ -257,7 +258,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
List<Skill> skillRewards = [];
|
||||
if (roundRewards.TryGetValue(i, out List<Skill>? effectList) && effectList != null)
|
||||
{
|
||||
skillRewards = new(effectList);
|
||||
skillRewards = [.. effectList];
|
||||
}
|
||||
|
||||
WriteLine($"=== Round {i++} ===");
|
||||
@ -298,7 +299,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
bool isGameEnd = actionQueue.ProcessTurn(characterToAct);
|
||||
bool isGameEnd = await actionQueue.ProcessTurnAsync(characterToAct);
|
||||
|
||||
if (realSkillRewards.Count > 0)
|
||||
{
|
||||
@ -336,7 +337,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
|
||||
// 模拟时间流逝
|
||||
double timeLapse = actionQueue.TimeLapse();
|
||||
double timeLapse = await actionQueue.TimeLapse();
|
||||
totalTime += timeLapse;
|
||||
下一次空投 -= timeLapse;
|
||||
|
||||
@ -589,10 +590,10 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
{
|
||||
foreach (Character character in queue.Queue)
|
||||
{
|
||||
Item[] 武器 = FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && (int)i.QualityType == wQuality).ToArray();
|
||||
Item[] 防具 = FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && (int)i.QualityType == aQuality).ToArray();
|
||||
Item[] 鞋子 = FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && (int)i.QualityType == sQuality).ToArray();
|
||||
Item[] 饰品 = FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == acQuality).ToArray();
|
||||
Item[] 武器 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && (int)i.QualityType == wQuality)];
|
||||
Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && (int)i.QualityType == aQuality)];
|
||||
Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && (int)i.QualityType == sQuality)];
|
||||
Item[] 饰品 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == acQuality)];
|
||||
Item? a = null, b = null, c = null, d = null;
|
||||
if (武器.Length > 0)
|
||||
{
|
||||
|
@ -31,12 +31,12 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("test")]
|
||||
public List<string> GetTest([FromQuery] bool? isweb = null, [FromQuery] bool? isteam = null, [FromQuery] bool? showall = null)
|
||||
public async Task<List<string>> GetTest([FromQuery] bool? isweb = null, [FromQuery] bool? isteam = null, [FromQuery] bool? showall = null)
|
||||
{
|
||||
bool web = isweb ?? true;
|
||||
bool team = isteam ?? false;
|
||||
bool all = showall ?? false;
|
||||
return FunGameSimulation.StartSimulationGame(false, web, team, all);
|
||||
return await FunGameSimulation.StartSimulationGame(false, web, team, all);
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
@ -50,7 +50,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
|
||||
builder.AppendLine(character.ToString());
|
||||
builder.AppendLine(character.ToStringWithLevelWithOutUser());
|
||||
builder.AppendLine($"总计造成伤害:{stats.TotalDamage:0.##} / 场均:{stats.AvgDamage:0.##}");
|
||||
builder.AppendLine($"总计造成物理伤害:{stats.TotalPhysicalDamage:0.##} / 场均:{stats.AvgPhysicalDamage:0.##}");
|
||||
builder.AppendLine($"总计造成魔法伤害:{stats.TotalMagicDamage:0.##} / 场均:{stats.AvgMagicDamage:0.##}");
|
||||
@ -105,7 +105,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
|
||||
builder.AppendLine(character.ToString());
|
||||
builder.AppendLine(character.ToStringWithLevelWithOutUser());
|
||||
builder.AppendLine($"总计造成伤害:{stats.TotalDamage:0.##} / 场均:{stats.AvgDamage:0.##}");
|
||||
builder.AppendLine($"总计造成物理伤害:{stats.TotalPhysicalDamage:0.##} / 场均:{stats.AvgPhysicalDamage:0.##}");
|
||||
builder.AppendLine($"总计造成魔法伤害:{stats.TotalMagicDamage:0.##} / 场均:{stats.AvgMagicDamage:0.##}");
|
||||
@ -157,7 +157,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
CharacterStatistics stats = FunGameSimulation.TeamCharacterStatistics[character];
|
||||
builder.AppendLine(character.ToString());
|
||||
builder.AppendLine(character.ToStringWithLevelWithOutUser());
|
||||
builder.AppendLine($"总计参赛数:{stats.Plays}");
|
||||
builder.AppendLine($"总计冠军数:{stats.Wins}");
|
||||
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
|
||||
@ -175,7 +175,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
CharacterStatistics stats = FunGameSimulation.CharacterStatistics[character];
|
||||
builder.AppendLine(character.ToString());
|
||||
builder.AppendLine(character.ToStringWithLevelWithOutUser());
|
||||
builder.AppendLine($"总计参赛数:{stats.Plays}");
|
||||
builder.AppendLine($"总计冠军数:{stats.Wins}");
|
||||
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
|
||||
@ -202,7 +202,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
CharacterStatistics stats = FunGameSimulation.TeamCharacterStatistics[character];
|
||||
builder.AppendLine(character.ToString());
|
||||
builder.AppendLine(character.ToStringWithLevelWithOutUser());
|
||||
builder.AppendLine($"总计参赛数:{stats.Plays}");
|
||||
builder.AppendLine($"总计冠军数:{stats.Wins}");
|
||||
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
|
||||
@ -220,7 +220,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
CharacterStatistics stats = FunGameSimulation.CharacterStatistics[character];
|
||||
builder.AppendLine(character.ToString());
|
||||
builder.AppendLine(character.ToStringWithLevelWithOutUser());
|
||||
builder.AppendLine($"总计参赛数:{stats.Plays}");
|
||||
builder.AppendLine($"总计冠军数:{stats.Wins}");
|
||||
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
|
||||
@ -528,7 +528,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
//{
|
||||
// return NetworkUtility.JsonSerialize(noSaved);
|
||||
//}
|
||||
return NetworkUtility.JsonSerialize($"此功能维护中。");
|
||||
return NetworkUtility.JsonSerialize($"无法还原用户 {uid} 的存档,此功能维护中。");
|
||||
}
|
||||
|
||||
[HttpPost("showsaved")]
|
||||
@ -1826,7 +1826,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("fightcustom")]
|
||||
public List<string> FightCustom([FromQuery] long? uid = null, [FromQuery] long? eqq = null, [FromQuery] bool? all = null)
|
||||
public async Task<List<string>> FightCustom([FromQuery] long? uid = null, [FromQuery] long? eqq = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1870,7 +1870,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
user1.Inventory.MainCharacter.Recovery(EP: 200);
|
||||
user2.Inventory.MainCharacter.Recovery(EP: 200);
|
||||
return FunGameActionQueue.NewAndStartGame([user1.Inventory.MainCharacter, user2.Inventory.MainCharacter], false, false, false, false, showAllRound);
|
||||
return await FunGameActionQueue.NewAndStartGame([user1.Inventory.MainCharacter, user2.Inventory.MainCharacter], false, false, false, false, showAllRound);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1884,7 +1884,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("fightcustom2")]
|
||||
public List<string> FightCustom2([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] bool? all = null)
|
||||
public async Task<List<string>> FightCustom2([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1895,7 +1895,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
return [$"找不到此昵称对应的玩家!"];
|
||||
}
|
||||
return FightCustom(uid, enemyid, all);
|
||||
return await FightCustom(uid, enemyid, all);
|
||||
}
|
||||
return [$"决斗发起失败!"];
|
||||
}
|
||||
@ -1906,7 +1906,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("fightcustomteam")]
|
||||
public List<string> FightCustomTeam([FromQuery] long? uid = null, [FromQuery] long? eqq = null, [FromQuery] bool? all = null)
|
||||
public async Task<List<string>> FightCustomTeam([FromQuery] long? uid = null, [FromQuery] long? eqq = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1968,7 +1968,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
Team team1 = new($"{user1.Username}的小队", squad1);
|
||||
Team team2 = new($"{user2.Username}的小队" + (userid == enemyid ? "2" : ""), squad2);
|
||||
return FunGameActionQueue.NewAndStartTeamGame([team1, team2], 0, 0, false, false, false, false, showAllRound);
|
||||
return await FunGameActionQueue.NewAndStartTeamGame([team1, team2], 0, 0, false, false, false, false, showAllRound);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1982,7 +1982,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("fightcustomteam2")]
|
||||
public List<string> FightCustomTeam2([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] bool? all = null)
|
||||
public async Task<List<string>> FightCustomTeam2([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1993,7 +1993,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
return [$"找不到此昵称对应的玩家!"];
|
||||
}
|
||||
return FightCustomTeam(uid, enemyid, all);
|
||||
return await FightCustomTeam(uid, enemyid, all);
|
||||
}
|
||||
return [$"决斗发起失败!"];
|
||||
}
|
||||
@ -3437,7 +3437,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("fightboss")]
|
||||
public List<string> FightBoss([FromQuery] long? uid = null, [FromQuery] int? index = null, [FromQuery] bool? all = null)
|
||||
public async Task<List<string>> FightBoss([FromQuery] long? uid = null, [FromQuery] int? index = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
||||
int bossIndex = index ?? 0;
|
||||
@ -3458,7 +3458,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
Character boss2 = CharacterBuilder.Build(boss, false, true, null, FunGameConstant.AllItems, FunGameConstant.AllSkills, false);
|
||||
List<string> msgs = FunGameActionQueue.NewAndStartGame([user.Inventory.MainCharacter, boss2], false, false, false, false, showAllRound);
|
||||
List<string> msgs = await FunGameActionQueue.NewAndStartGame([user.Inventory.MainCharacter, boss2], false, false, false, false, showAllRound);
|
||||
|
||||
if (boss2.HP <= 0)
|
||||
{
|
||||
@ -3700,7 +3700,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("fightbossteam")]
|
||||
public List<string> FightBossTeam([FromQuery] long? uid = null, [FromQuery] int? index = null, [FromQuery] bool? all = null)
|
||||
public async Task<List<string>> FightBossTeam([FromQuery] long? uid = null, [FromQuery] int? index = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
||||
int bossIndex = index ?? 0;
|
||||
@ -3727,7 +3727,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
Character boss2 = CharacterBuilder.Build(boss, false, true, null, FunGameConstant.AllItems, FunGameConstant.AllSkills, false);
|
||||
Team team1 = new($"{user.Username}的小队", squad);
|
||||
Team team2 = new($"Boss", [boss2]);
|
||||
List<string> msgs = FunGameActionQueue.NewAndStartTeamGame([team1, team2], showAllRound: showAllRound);
|
||||
List<string> msgs = await FunGameActionQueue.NewAndStartTeamGame([team1, team2], showAllRound: showAllRound);
|
||||
|
||||
if (boss2.HP <= 0)
|
||||
{
|
||||
@ -4694,7 +4694,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
if (pc.Count > 0)
|
||||
{
|
||||
User user = FunGameService.GetUser(pc);
|
||||
string msg = "";
|
||||
string msg;
|
||||
|
||||
if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long userClub) && userClub != 0)
|
||||
{
|
||||
@ -5039,7 +5039,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
List<long> list = [];
|
||||
if (pc2.TryGetValue(itemName, out object? value) && value is List<long> tempList)
|
||||
{
|
||||
list = new(tempList);
|
||||
list = [.. tempList];
|
||||
}
|
||||
|
||||
if (list.Contains(user.Id))
|
||||
|
@ -220,7 +220,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
if (!FunGameSimulation)
|
||||
{
|
||||
FunGameSimulation = true;
|
||||
List<string> msgs = Controller.GetTest(false);
|
||||
List<string> msgs = await Controller.GetTest(false);
|
||||
List<string> real = [];
|
||||
int remain = 7;
|
||||
string merge = "";
|
||||
@ -268,7 +268,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
if (!FunGameSimulation)
|
||||
{
|
||||
FunGameSimulation = true;
|
||||
List<string> msgs = Controller.GetTest(false, true);
|
||||
List<string> msgs = await Controller.GetTest(false, true);
|
||||
List<string> real = [];
|
||||
if (msgs.Count > 0)
|
||||
{
|
||||
@ -1346,11 +1346,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
List<string> msgs = [];
|
||||
if (long.TryParse(detail.Trim(), out long eqq))
|
||||
{
|
||||
msgs = Controller.FightCustom(uid, eqq, true);
|
||||
msgs = await Controller.FightCustom(uid, eqq, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
msgs = Controller.FightCustom2(uid, detail.Trim(), true);
|
||||
msgs = await Controller.FightCustom2(uid, detail.Trim(), true);
|
||||
}
|
||||
List<string> real = [];
|
||||
if (msgs.Count >= 2)
|
||||
@ -1404,11 +1404,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
List<string> msgs = [];
|
||||
if (long.TryParse(detail.Trim(), out long eqq))
|
||||
{
|
||||
msgs = Controller.FightCustom(uid, eqq, false);
|
||||
msgs = await Controller.FightCustom(uid, eqq, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
msgs = Controller.FightCustom2(uid, detail.Trim(), false);
|
||||
msgs = await Controller.FightCustom2(uid, detail.Trim(), false);
|
||||
}
|
||||
List<string> real = [];
|
||||
if (msgs.Count > 2)
|
||||
@ -1455,11 +1455,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
List<string> msgs = [];
|
||||
if (long.TryParse(detail.Trim(), out long eqq))
|
||||
{
|
||||
msgs = Controller.FightCustomTeam(uid, eqq, true);
|
||||
msgs = await Controller.FightCustomTeam(uid, eqq, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
msgs = Controller.FightCustomTeam2(uid, detail.Trim(), true);
|
||||
msgs = await Controller.FightCustomTeam2(uid, detail.Trim(), true);
|
||||
}
|
||||
List<string> real = [];
|
||||
if (msgs.Count >= 3)
|
||||
@ -1533,7 +1533,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
List<string> msgs = [];
|
||||
if (int.TryParse(detail.Trim(), out int index))
|
||||
{
|
||||
msgs = Controller.FightBossTeam(uid, index, true);
|
||||
msgs = await Controller.FightBossTeam(uid, index, true);
|
||||
List<string> real = [];
|
||||
if (msgs.Count >= 3)
|
||||
{
|
||||
@ -1592,7 +1592,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
List<string> msgs = [];
|
||||
if (int.TryParse(detail.Trim(), out int index))
|
||||
{
|
||||
msgs = Controller.FightBoss(uid, index, true);
|
||||
msgs = await Controller.FightBoss(uid, index, true);
|
||||
List<string> real = [];
|
||||
if (msgs.Count >= 3)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user