68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
using System.Text;
|
|
|
|
namespace ET.Server
|
|
{
|
|
[ConsoleHandler("Gacha")]
|
|
public class C_Gacha : IConsoleHandler
|
|
{
|
|
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
|
|
{
|
|
Log.Console($"[GM] Gacha command received: {content}");
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
[ConsoleHandler("SimulateGacha")]
|
|
public class C_SimulateGacha : IConsoleHandler
|
|
{
|
|
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
|
|
{
|
|
string[] parts = content.Split(' ');
|
|
int poolId = parts.Length > 1 ? int.Parse(parts[1]) : 1;
|
|
int times = parts.Length > 2 ? int.Parse(parts[2]) : 1000;
|
|
|
|
int r3 = 0, r4 = 0, r5 = 0;
|
|
for (int i = 0; i < times; i++)
|
|
{
|
|
int roll = CryptoRandomGenerator.Next(0, 10000);
|
|
if (roll < 7000) r3++;
|
|
else if (roll < 9500) r4++;
|
|
else r5++;
|
|
}
|
|
|
|
Log.Console($"[GM] SimulateGacha pool={poolId} times={times} rare3={r3} rare4={r4} rare5={r5}");
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
[ConsoleHandler("ShowGachaStats")]
|
|
public class C_ShowGachaStats : IConsoleHandler
|
|
{
|
|
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
|
|
{
|
|
Log.Console("[GM] ShowGachaStats TODO: attach player and dump gacha pool stats.");
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
[ConsoleHandler("ResetGachaGuarantee")]
|
|
public class C_ResetGachaGuarantee : IConsoleHandler
|
|
{
|
|
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
|
|
{
|
|
Log.Console($"[GM] ResetGachaGuarantee command: {content}");
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
[ConsoleHandler("SetGachaCount")]
|
|
public class C_SetGachaCount : IConsoleHandler
|
|
{
|
|
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
|
|
{
|
|
Log.Console($"[GM] SetGachaCount command: {content}");
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
}
|