mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-12-05 16:16:35 +00:00
新礼包、活动功能、帮助系统优化等
This commit is contained in:
parent
cb9c2b1a78
commit
d1cac7737c
@ -157,6 +157,29 @@ namespace Oshima.FunGame.OshimaModules.Items
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class 魔法卡礼包 : Item, 礼包.GiftBox
|
||||||
|
{
|
||||||
|
public override long Id => (long)GiftBoxID.魔法卡礼包;
|
||||||
|
public override string Name => "魔法卡礼包";
|
||||||
|
public override string Description => Skills.Active?.Description ?? "";
|
||||||
|
public override QualityType QualityType => _type;
|
||||||
|
public int Count => _count;
|
||||||
|
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||||
|
private readonly QualityType _type = QualityType.White;
|
||||||
|
private readonly int _count = 1;
|
||||||
|
|
||||||
|
public 魔法卡礼包(QualityType type = QualityType.White, int count = 1, User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||||
|
{
|
||||||
|
_type = type;
|
||||||
|
_count = count;
|
||||||
|
User = user;
|
||||||
|
礼包.Init(this, new()
|
||||||
|
{
|
||||||
|
{ "与礼包同品质、随机属性、随机魔法技能的魔法卡", count }
|
||||||
|
}, remainUseTimes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class 礼包技能 : Skill
|
public class 礼包技能 : Skill
|
||||||
{
|
{
|
||||||
public override long Id => (long)ItemActiveID.礼包;
|
public override long Id => (long)ItemActiveID.礼包;
|
||||||
|
|||||||
@ -47,6 +47,7 @@
|
|||||||
年夜饭 = 20001,
|
年夜饭 = 20001,
|
||||||
蛇年大吉 = 20002,
|
蛇年大吉 = 20002,
|
||||||
新春快乐 = 20003,
|
新春快乐 = 20003,
|
||||||
毕业礼包 = 20004
|
毕业礼包 = 20004,
|
||||||
|
魔法卡礼包 = 20005
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,6 +66,7 @@ namespace Oshima.FunGame.OshimaModules
|
|||||||
(long)GiftBoxID.蛇年大吉 => new 蛇年大吉(),
|
(long)GiftBoxID.蛇年大吉 => new 蛇年大吉(),
|
||||||
(long)GiftBoxID.新春快乐 => new 新春快乐(),
|
(long)GiftBoxID.新春快乐 => new 新春快乐(),
|
||||||
(long)GiftBoxID.毕业礼包 => new 毕业礼包(),
|
(long)GiftBoxID.毕业礼包 => new 毕业礼包(),
|
||||||
|
(long)GiftBoxID.魔法卡礼包 => new 魔法卡礼包(),
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -110,6 +110,8 @@ namespace Oshima.FunGame.OshimaServers
|
|||||||
{
|
{
|
||||||
Controller.WriteLine("已重置所有人的今日运势");
|
Controller.WriteLine("已重置所有人的今日运势");
|
||||||
Daily.ClearDaily();
|
Daily.ClearDaily();
|
||||||
|
// 刷新活动缓存
|
||||||
|
FunGameService.GetEventCenter();
|
||||||
});
|
});
|
||||||
TaskScheduler.Shared.AddTask("上九", new TimeSpan(9, 0, 0), () =>
|
TaskScheduler.Shared.AddTask("上九", new TimeSpan(9, 0, 0), () =>
|
||||||
{
|
{
|
||||||
@ -213,7 +215,7 @@ namespace Oshima.FunGame.OshimaServers
|
|||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
// 刷新每天登录
|
// 刷新每天登录
|
||||||
FunGameService.FirstLoginDailyNotice.Clear();
|
FunGameService.UserNotice.Clear();
|
||||||
string directoryPath = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/saved";
|
string directoryPath = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/saved";
|
||||||
if (Directory.Exists(directoryPath))
|
if (Directory.Exists(directoryPath))
|
||||||
{
|
{
|
||||||
@ -229,12 +231,19 @@ namespace Oshima.FunGame.OshimaServers
|
|||||||
Controller.WriteLine("刷新每天登录");
|
Controller.WriteLine("刷新每天登录");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// 刷新活动缓存
|
||||||
|
FunGameService.GetEventCenter();
|
||||||
});
|
});
|
||||||
TaskScheduler.Shared.AddRecurringTask("刷新boss", TimeSpan.FromHours(1), () =>
|
TaskScheduler.Shared.AddRecurringTask("刷新boss", TimeSpan.FromHours(1), () =>
|
||||||
{
|
{
|
||||||
FunGameService.GenerateBoss();
|
FunGameService.GenerateBoss();
|
||||||
Controller.WriteLine("刷新boss");
|
Controller.WriteLine("刷新boss");
|
||||||
}, true);
|
}, true);
|
||||||
|
TaskScheduler.Shared.AddRecurringTask("刷新活动缓存", TimeSpan.FromHours(4), () =>
|
||||||
|
{
|
||||||
|
FunGameService.GetEventCenter();
|
||||||
|
Controller.WriteLine("刷新活动缓存");
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
110
OshimaServers/Service/FunGameOrderList.cs
Normal file
110
OshimaServers/Service/FunGameOrderList.cs
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
namespace Oshima.FunGame.OshimaServers.Service
|
||||||
|
{
|
||||||
|
public class FunGameOrderList
|
||||||
|
{
|
||||||
|
public static Dictionary<string, string> ArchiveHelp { get; } = new() {
|
||||||
|
{"创建存档", "创建存档,生成随机一个自建角色"},
|
||||||
|
{"还原存档", "没有后悔药"},
|
||||||
|
{"我的存档", "查看账号/存档信息"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> CharacterHelp { get; } = new() {
|
||||||
|
{"我角色 [序号]", "查看角色简略信息(默认1)"},
|
||||||
|
{"我的角色 [序号]", "查看角色详细信息(默认1)"},
|
||||||
|
{"设置主战 <序号>", "将指定角色设置为主战"},
|
||||||
|
{"我的主战", "查看当前主战角色"},
|
||||||
|
{"装备 <角色序号> <物品序号>", "装备指定物品给角色"},
|
||||||
|
{"取消装备 <角色序号> <装备槽序号>", "卸下角色装备(槽位1-6)"},
|
||||||
|
{"清空小队", "清空所有小队成员"},
|
||||||
|
{"角色升级 [序号]", "提升角色等级"},
|
||||||
|
{"角色突破 [序号]", "突破等级限制"},
|
||||||
|
{"突破信息 [序号]", "查看突破需求"},
|
||||||
|
{"角色重随", "重新随机角色属性"},
|
||||||
|
{"角色改名", "修改角色名字"},
|
||||||
|
{"开启练级 [角色序号]", "启动练级模式"},
|
||||||
|
{"练级结算", "收取练级奖励"},
|
||||||
|
{"练级信息", "查看练级进度"},
|
||||||
|
{"我的状态", "查看主战角色状态"},
|
||||||
|
{"我的小队", "查看小队角色名单"},
|
||||||
|
{"设置小队 <{序号...}>", "设置小队角色(1-4个参数)"},
|
||||||
|
{"小队添加 <序号>", "将角色加入小队"},
|
||||||
|
{"小队移除 <序号>", "将角色移出小队"},
|
||||||
|
{"小队状态", "查看小队所有角色状态"},
|
||||||
|
{"生命之泉", "使用金币回复角色状态"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> ItemHelp { get; } = new() {
|
||||||
|
{"我的库存 [页码]", "显示所有库存(角色+物品)"},
|
||||||
|
{"我的库存 <类型> [页码]", "按类型查看库存(卡包/武器/防具等)"},
|
||||||
|
{"分类库存 <索引> [页码]", "按索引分类查看物品"},
|
||||||
|
{"物品库存 [页码]", "显示库存中所有物品"},
|
||||||
|
{"角色库存 [页码]", "显示库存中所有角色"},
|
||||||
|
{"我的物品 <序号>", "查看指定物品详细信息"},
|
||||||
|
{"抽卡/十连抽卡", "金币抽卡(1000/次)"},
|
||||||
|
{"材料抽卡/材料十连抽卡", "材料抽卡(5/次)"},
|
||||||
|
{"兑换金币 <材料数>", "1材料=200金币"},
|
||||||
|
{"使用 <名称> <数量> [角色] [角色序号]", "使用物品(可指定角色)"},
|
||||||
|
{"使用 <序号> [角色] [角色序号]", "使用物品(可指定角色)"},
|
||||||
|
{"使用魔法卡 <物品序号> <卡包序号>", "使用指定魔法卡"},
|
||||||
|
{"合成魔法卡 <{序号...}>", "3张魔法卡合成(空格隔开)"},
|
||||||
|
{"分解物品 <{序号...}>", "分解指定物品"},
|
||||||
|
{"分解 <名称> <数量>", "分解指定数量物品"},
|
||||||
|
{"品质分解 <品质索引>", "按品质分解(0-6)"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> BattleHelp { get; } = new() {
|
||||||
|
{"决斗 <对方UID/昵称>", "和对方切磋(简化版)"},
|
||||||
|
{"完整决斗 <对方UID/昵称>", "和对方切磋(完整版)"},
|
||||||
|
{"小队决斗 <对方UID/昵称>", "小队切磋"},
|
||||||
|
{"查询boss [序号]", "查看boss信息(默认列表)"},
|
||||||
|
{"讨伐boss <序号>", "主战角色讨伐指定boss"},
|
||||||
|
{"小队讨伐boss <序号>", "小队讨伐指定boss"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> QuestHelp { get; } = new() {
|
||||||
|
{"任务列表", "查看今日任务列表"},
|
||||||
|
{"做任务 <序号>", "开始指定任务"},
|
||||||
|
{"任务信息", "查看进行中任务详情"},
|
||||||
|
{"任务结算", "结算进行中的任务"},
|
||||||
|
{"世界地图", "查看当前地图"},
|
||||||
|
{"主城", "查看主城信息"},
|
||||||
|
{"查地区 <序号>", "查看指定地区信息"},
|
||||||
|
{"探索 <序号>", "主战角色探索指定地区"},
|
||||||
|
{"小队探索 <序号>", "小队探索指定地区(4*单人消耗和奖励)"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> ClubHelp { get; } = new() {
|
||||||
|
{"我的社团", "查看社团信息"},
|
||||||
|
{"加入社团 <编号>", "申请加入社团"},
|
||||||
|
{"退出社团", "退出当前社团"},
|
||||||
|
{"创建社团 <前缀>", "创建一个公开社团,若指令中包含私密一词,将创建私密社团\r\n社团前缀:3-4个字符,允许:英文字母和数字、部分特殊字符"},
|
||||||
|
{"查看社团成员", "查看社团成员列表"},
|
||||||
|
{"查看社团管理", "查看管理员列表"},
|
||||||
|
{"查看申请人列表", "查看申请加入的玩家列表"},
|
||||||
|
{"解散社团", "解散当前社团"},
|
||||||
|
{"社团批准 <@对方>", "批准加入申请"},
|
||||||
|
{"社团拒绝 <@对方>", "拒绝加入申请"},
|
||||||
|
{"社团踢出 <@对方>", "踢出社团成员"},
|
||||||
|
{"社团转让 <@对方>", "转让社团所有权"},
|
||||||
|
{"社团设置 <设置项> <{参数...}>", "修改社团设置"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> ActivityHelp { get; } = new() {
|
||||||
|
{"签到", "每日签到奖励"},
|
||||||
|
{"活动中心", "查看当前活动"},
|
||||||
|
{"查活动 <编号>", "查看指定活动详情"},
|
||||||
|
{"做活动任务 <活动序号> <任务序号>", "开始指定活动任务"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, string> StoreHelp { get; } = new() {
|
||||||
|
{"每日商店", "查看每日商店商品"},
|
||||||
|
{"商店查看 <序号>", "查看指定商品详情"},
|
||||||
|
{"商店购买 <序号>", "购买指定商品"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static IEnumerable<KeyValuePair<string, string>> GetPage(Dictionary<string, string> dict, int page, int pageSize = 10)
|
||||||
|
{
|
||||||
|
return dict.Skip((page - 1) * pageSize).Take(pageSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,7 +14,8 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
{
|
{
|
||||||
public class FunGameService
|
public class FunGameService
|
||||||
{
|
{
|
||||||
public static Dictionary<long, List<string>> FirstLoginDailyNotice { get; } = [];
|
public static HashSet<Activity> Activities { get; } = [];
|
||||||
|
public static Dictionary<long, List<string>> UserNotice { get; } = [];
|
||||||
public static Dictionary<int, Character> Bosses { get; } = [];
|
public static Dictionary<int, Character> Bosses { get; } = [];
|
||||||
public static ServerPluginLoader? ServerPluginLoader { get; set; } = null;
|
public static ServerPluginLoader? ServerPluginLoader { get; set; } = null;
|
||||||
public static WebAPIPluginLoader? WebAPIPluginLoader { get; set; } = null;
|
public static WebAPIPluginLoader? WebAPIPluginLoader { get; set; } = null;
|
||||||
@ -51,7 +52,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
FunGameConstant.Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4));
|
FunGameConstant.Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4));
|
||||||
FunGameConstant.Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印(), new 流光之印(), new 永恒之印(), new 技能卷轴(), new 智慧之果(), new 奥术符文(), new 混沌之核(),
|
FunGameConstant.Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印(), new 流光之印(), new 永恒之印(), new 技能卷轴(), new 智慧之果(), new 奥术符文(), new 混沌之核(),
|
||||||
new 小回复药(), new 中回复药(), new 大回复药(), new 魔力填充剂1(), new 魔力填充剂2(), new 魔力填充剂3(), new 能量饮料1(), new 能量饮料2(), new 能量饮料3(), new 年夜饭(), new 蛇年大吉(), new 新春快乐(), new 毕业礼包(),
|
new 小回复药(), new 中回复药(), new 大回复药(), new 魔力填充剂1(), new 魔力填充剂2(), new 魔力填充剂3(), new 能量饮料1(), new 能量饮料2(), new 能量饮料3(), new 年夜饭(), new 蛇年大吉(), new 新春快乐(), new 毕业礼包(),
|
||||||
new 复苏药1(), new 复苏药2(), new 复苏药3(), new 全回复药()
|
new 复苏药1(), new 复苏药2(), new 复苏药3(), new 全回复药(), new 魔法卡礼包()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
FunGameConstant.AllItems.AddRange(FunGameConstant.Equipment);
|
FunGameConstant.AllItems.AddRange(FunGameConstant.Equipment);
|
||||||
@ -592,12 +593,22 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
if (!pc.TryGetValue("logon", out object? value) || (value is bool logon && !logon))
|
if (!pc.TryGetValue("logon", out object? value) || (value is bool logon && !logon))
|
||||||
{
|
{
|
||||||
pc.Add("logon", true);
|
pc.Add("logon", true);
|
||||||
FirstLoginDailyNotice[user.Id] = ["欢迎回到筽祀牻大陆!请发送【帮助】获取更多玩法指令哦~"];
|
AddNotice(user.Id, "欢迎回到筽祀牻大陆!请发送【帮助】获取更多玩法指令哦~");
|
||||||
|
AddNotice(user.Id, GetEvents());
|
||||||
}
|
}
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AddNotice(long userId, params string[] notices)
|
||||||
|
{
|
||||||
|
if (UserNotice.TryGetValue(userId, out List<string>? list) && list != null)
|
||||||
|
{
|
||||||
|
list.AddRange(notices);
|
||||||
|
}
|
||||||
|
else UserNotice[userId] = [.. notices];
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<T> GetPage<T>(IEnumerable<T> list, int showPage, int pageSize)
|
public static IEnumerable<T> GetPage<T>(IEnumerable<T> list, int showPage, int pageSize)
|
||||||
{
|
{
|
||||||
return [.. list.Skip((showPage - 1) * pageSize).Take(pageSize)];
|
return [.. list.Skip((showPage - 1) * pageSize).Take(pageSize)];
|
||||||
@ -1134,7 +1145,20 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
msg = "";
|
msg = "";
|
||||||
if (item.ItemType == ItemType.GiftBox)
|
if (item.ItemType == ItemType.GiftBox)
|
||||||
{
|
{
|
||||||
if (item is 礼包.GiftBox box && box.Gifts.Count > 0)
|
if (item is 魔法卡礼包 cardBox)
|
||||||
|
{
|
||||||
|
List<string> cards = [];
|
||||||
|
for (int i = 0; i< cardBox.Count; i++)
|
||||||
|
{
|
||||||
|
Item newItem = GenerateMagicCard(item.QualityType);
|
||||||
|
SetSellAndTradeTime(newItem);
|
||||||
|
newItem.User = user;
|
||||||
|
user.Inventory.Items.Add(newItem);
|
||||||
|
cards.Add(newItem.ToStringInventory(false));
|
||||||
|
}
|
||||||
|
msg = "打开礼包成功!获得了以下物品:\r\n" + string.Join("\r\n", cards);
|
||||||
|
}
|
||||||
|
else if (item is 礼包.GiftBox box && box.Gifts.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (string name in box.Gifts.Keys)
|
foreach (string name in box.Gifts.Keys)
|
||||||
{
|
{
|
||||||
@ -1861,5 +1885,90 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
}
|
}
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetEventCenter()
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
if (activities.Count == 0)
|
||||||
|
{
|
||||||
|
return "当前没有任何活动,敬请期待。";
|
||||||
|
}
|
||||||
|
Activities.Clear();
|
||||||
|
foreach (Activity activity in activities.Values)
|
||||||
|
{
|
||||||
|
Activities.Add(activity);
|
||||||
|
}
|
||||||
|
StringBuilder builder = new();
|
||||||
|
builder.AppendLine("★☆★ 活动中心 ★☆★");
|
||||||
|
|
||||||
|
ActivityState[] status = [ActivityState.InProgress, ActivityState.Upcoming, ActivityState.Future, ActivityState.Ended];
|
||||||
|
foreach (ActivityState state in status)
|
||||||
|
{
|
||||||
|
IEnumerable<Activity> filteredActivities = activities.Values.Where(a => a.Status == state);
|
||||||
|
if (filteredActivities.Any())
|
||||||
|
{
|
||||||
|
builder.AppendLine($"【{CommonSet.GetActivityStatus(state)}】");
|
||||||
|
builder.AppendLine($"{string.Join("\r\n", filteredActivities.Select(a => a.GetIdName() + $"({a.GetTimeString(false)})"))}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.AppendLine("请使用【查活动+活动序号】指令查询活动详细信息。");
|
||||||
|
|
||||||
|
return builder.ToString().Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetEvents(ActivityState status = ActivityState.InProgress)
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
IEnumerable<Activity> filteredActivities = activities.Values.Where(a => a.Status == status);
|
||||||
|
if (!filteredActivities.Any())
|
||||||
|
{
|
||||||
|
return $"当前没有任何{CommonSet.GetActivityStatus(status)}的活动,敬请期待。";
|
||||||
|
}
|
||||||
|
return $"★☆★ {CommonSet.GetActivityStatus(status)}活动列表 ★☆★\r\n" +
|
||||||
|
$"{string.Join("\r\n", filteredActivities.Select(a => a.GetIdName() + $"({a.GetTimeString(false)})"))}\r\n" +
|
||||||
|
$"请使用【查活动+活动序号】指令查询活动详细信息。";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetEvent(long id)
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
if (activities.Values.FirstOrDefault(a => a.Id == id) is Activity activity)
|
||||||
|
{
|
||||||
|
return $"{activity}";
|
||||||
|
}
|
||||||
|
return "该活动不存在。";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string AddEvent(Activity activity)
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
activity.UpdateState();
|
||||||
|
activities.Add(activity.Id.ToString(), activity);
|
||||||
|
activities.SaveConfig();
|
||||||
|
return "该活动已添加!";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string RemoveEvent(Activity activity)
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
activities.Remove(activity.Id.ToString());
|
||||||
|
activities.SaveConfig();
|
||||||
|
return "该活动已删除!";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetSquadInfo(IEnumerable<Character> inventory, HashSet<long> squadIds)
|
||||||
|
{
|
||||||
|
Character[] squad = [.. inventory.Where(c => squadIds.Contains(c.Id))];
|
||||||
|
Dictionary<Character, int> characters = inventory
|
||||||
|
.Select((character, index) => new { character, index })
|
||||||
|
.ToDictionary(x => x.character, x => x.index + 1);
|
||||||
|
return $"{(squad.Length > 0 ? string.Join("\r\n", squad.Select(c => $"#{characters[c]}. {c}")) : "空")}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
194
OshimaWebAPI/Controllers/ActivityController.cs
Normal file
194
OshimaWebAPI/Controllers/ActivityController.cs
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
|
||||||
|
namespace Oshima.FunGame.WebAPI.Controllers
|
||||||
|
{
|
||||||
|
[ApiController]
|
||||||
|
[Route("[controller]")]
|
||||||
|
public class ActivityController(ILogger<ActivityController> logger) : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ILogger<ActivityController> _logger = logger;
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult GetActivity()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
if (activities.Count == 0)
|
||||||
|
{
|
||||||
|
return Ok("当前没有任何活动,敬请期待。");
|
||||||
|
}
|
||||||
|
return Ok($"★☆★ 当前活动列表 ★☆★\r\n{string.Join("\r\n", activities.Values.Select(a => a.GetIdName()))}");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "获取活动信息时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("{id}")]
|
||||||
|
public IActionResult GetActivity(long id)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
if (activities.Get(id.ToString()) is Activity activity)
|
||||||
|
{
|
||||||
|
return Ok($"{activity}");
|
||||||
|
}
|
||||||
|
return NotFound($"活动编号 {id} 不存在。");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "获取活动信息时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("{id}")]
|
||||||
|
public IActionResult UpdateActivity(long id, [FromBody] Activity? activity = null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (activity is null || activity.Id != id)
|
||||||
|
{
|
||||||
|
return BadRequest("活动更新失败,活动 ID 与请求体 ID 不匹配或请求体格式错误。");
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
activities.Add(activity.Id.ToString(), activity);
|
||||||
|
activities.SaveConfig();
|
||||||
|
|
||||||
|
return Ok($"活动 {activity.GetIdName()} 更新成功。");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "更新活动时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("{id}")]
|
||||||
|
public IActionResult RemoveActivity(long id)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
if (activities.Count > 0)
|
||||||
|
{
|
||||||
|
activities.Remove(id.ToString());
|
||||||
|
activities.SaveConfig();
|
||||||
|
return Ok($"活动编号 {id} 已删除。");
|
||||||
|
}
|
||||||
|
return NotFound($"活动编号 {id} 不存在。");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "删除活动时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("{id}/{questId}")]
|
||||||
|
public IActionResult GetQuest(long id, long questId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
Activity? activity = activities.Values.FirstOrDefault(a => a.Id == id);
|
||||||
|
if (activity != null)
|
||||||
|
{
|
||||||
|
if (activity.Quests.FirstOrDefault(q => q.Id == questId) is Quest quest)
|
||||||
|
{
|
||||||
|
return Ok($"该任务属于活动【{activity.Name}】,详情:\r\n{quest}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NotFound($"任务编号 {questId} 不存在。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NotFound($"活动编号 {id} 不存在。");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "获取任务信息时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("{id}/{questId}")]
|
||||||
|
public IActionResult UpdateQuest(long id, long questId, [FromBody] Quest? quest = null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (quest is null || quest.Id != questId)
|
||||||
|
{
|
||||||
|
return BadRequest("任务更新失败,任务 ID 与请求体 ID 不匹配或请求体格式错误。");
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
Activity? activity = activities.Values.FirstOrDefault(a => a.Id == id);
|
||||||
|
if (activity != null)
|
||||||
|
{
|
||||||
|
if (activity.Quests.FirstOrDefault(q => q.Id == quest.Id) is Quest current)
|
||||||
|
{
|
||||||
|
activity.Quests.Remove(quest);
|
||||||
|
}
|
||||||
|
activity.Quests.Add(quest);
|
||||||
|
activities.Add(activity.Id.ToString(), activity);
|
||||||
|
activities.SaveConfig();
|
||||||
|
return Ok($"任务 {quest.GetIdName()}(属于活动【{activity.Name}】)更新成功。");
|
||||||
|
}
|
||||||
|
|
||||||
|
return NotFound($"活动编号 {id} 不存在。");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "更新任务时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete("{id}/{questId}")]
|
||||||
|
public IActionResult RemoveQuest(long id, long questId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
EntityModuleConfig<Activity> activities = new("activities", "activities");
|
||||||
|
activities.LoadConfig();
|
||||||
|
Activity? activity = activities.Values.FirstOrDefault(a => a.Id == id);
|
||||||
|
if (activity != null)
|
||||||
|
{
|
||||||
|
if (activity.Quests.FirstOrDefault(q => q.Id == questId) is Quest quest)
|
||||||
|
{
|
||||||
|
activity.Quests.Remove(quest);
|
||||||
|
activities.Add(activity.Id.ToString(), activity);
|
||||||
|
activities.SaveConfig();
|
||||||
|
|
||||||
|
return Ok($"任务 {quest} 删除成功。");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NotFound($"任务编号 {questId} 不存在。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NotFound($"活动编号 {id} 不存在。");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error: ");
|
||||||
|
return StatusCode(500, "删除任务时发生错误,请检查日志。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,11 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Milimoe.FunGame.Core.Api.Transmittal;
|
using Milimoe.FunGame.Core.Api.Transmittal;
|
||||||
using Milimoe.FunGame.Core.Api.Utility;
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
using Oshima.Core.Configs;
|
using Oshima.Core.Configs;
|
||||||
using Oshima.FunGame.OshimaServers.Service;
|
using Oshima.FunGame.OshimaServers.Service;
|
||||||
using Oshima.FunGame.WebAPI.Constant;
|
using Oshima.FunGame.WebAPI.Constant;
|
||||||
@ -42,13 +44,35 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
content = content.Trim();
|
content = content.Trim();
|
||||||
await Service.SendC2CMessageAsync(msg.OpenId, content, msgType, media, msg.Id, msgSeq);
|
await Service.SendC2CMessageAsync(msg.OpenId, content, msgType, media, msg.Id, msgSeq);
|
||||||
}
|
}
|
||||||
if (msg.FunGameUID > 0 && FunGameService.FirstLoginDailyNotice.TryGetValue(msg.FunGameUID, out List<string>? msgs) && msgs != null)
|
if (msg.FunGameUID > 0 && FunGameService.UserNotice.TryGetValue(msg.FunGameUID, out List<string>? msgs) && msgs != null)
|
||||||
{
|
{
|
||||||
FunGameService.FirstLoginDailyNotice.Remove(msg.FunGameUID);
|
FunGameService.UserNotice.Remove(msg.FunGameUID);
|
||||||
await SendAsync(msg, "每日登录提醒", string.Join("\r\n", msgs), msgType, media, 5);
|
await SendAsync(msg, "每日登录提醒", string.Join("\r\n", msgs), msgType, media, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task SendHelp(IBotMessage e, Dictionary<string, string> helpDict, string helpName, int currentPage)
|
||||||
|
{
|
||||||
|
int pageSize = 15;
|
||||||
|
int totalPages = (helpDict.Count + pageSize - 1) / pageSize;
|
||||||
|
|
||||||
|
StringBuilder result = new($"《筽祀牻》{helpName}指令(第 {currentPage}/{totalPages} 页)\n");
|
||||||
|
|
||||||
|
int index = (currentPage - 1) * pageSize + 1;
|
||||||
|
foreach ((string cmd, string desc) in FunGameOrderList.GetPage(helpDict, currentPage, pageSize))
|
||||||
|
{
|
||||||
|
result.AppendLine($"{index}. {cmd}{(desc != "" ? ":" + desc : "")}");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentPage < totalPages)
|
||||||
|
{
|
||||||
|
result.AppendLine($"发送【{helpName}{currentPage + 1}】查看下一页");
|
||||||
|
}
|
||||||
|
|
||||||
|
await SendAsync(e, "筽祀牻", result.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<bool> Handler(IBotMessage e)
|
public async Task<bool> Handler(IBotMessage e)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
@ -98,7 +122,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
// string msg = "";
|
// string msg = "";
|
||||||
// if (long.TryParse(detail, out temp_qq))
|
// if (long.TryParse(detail, out temp_qq))
|
||||||
// {
|
// {
|
||||||
// msg = NetworkUtility.JsonDeserialize<string>(QQController.Bind(new(openid, temp_qq))) ?? "";
|
// msg = QQController.Bind(new(openid, temp_qq));
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
@ -115,127 +139,76 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "查询服务器启动时间")
|
if (e.Detail == "查询服务器启动时间")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(TestController.GetLastLoginTime()) ?? "";
|
string msg = TestController.GetLastLoginTime();
|
||||||
await SendAsync(e, "查询服务器启动时间", msg);
|
await SendAsync(e, "查询服务器启动时间", msg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Detail.StartsWith("查询任务计划"))
|
if (e.Detail.StartsWith("查询任务计划"))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(TestController.GetTaskScheduler(e.Detail.Replace("查询任务计划", ""))) ?? "";
|
string msg = TestController.GetTaskScheduler(e.Detail.Replace("查询任务计划", ""));
|
||||||
await SendAsync(e, "查询任务计划", msg);
|
await SendAsync(e, "查询任务计划", msg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Detail == "帮助" || e.Detail == "帮助1")
|
// 指令处理
|
||||||
|
if (e.Detail == "帮助")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 1 / 7 页)
|
await SendAsync(e, "筽祀牻", @$"欢迎使用《筽祀牻》游戏指令帮助系统!
|
||||||
1、创建存档:创建存档,生成随机一个自建角色(序号固定为1)
|
核心库版本号:{FunGameInfo.FunGame_Version}
|
||||||
2、我的库存/我的背包/查看库存 [页码]:显示所有角色、物品库存,每个角色和物品都有一个专属序号
|
《筽祀牻》是一款奇幻冒险回合制角色扮演游戏。
|
||||||
3、我的库存 <物品类型> [页码]:卡包/武器/防具/鞋子/饰品/消耗品/魔法卡等...
|
在游戏中,你可以和其他角色组成小队,收集物品,在数十个独具风格的地区中冒险并战斗。
|
||||||
4、分类库存 <物品索引> [页码]:物品索引从0开始,同上...
|
因游戏内容、指令较多,我们将按游戏模块对指令分类,请输入以下指令查看具体分类的帮助内容:
|
||||||
5、物品库存 [页码]:显示所有角色
|
1、存档帮助
|
||||||
* 上述三指令会将物品按品质倒序和数量倒序排序,整合物品序号和数量显示物品库存
|
2、角色帮助
|
||||||
6、角色库存 [页码]:显示所有角色
|
3、物品帮助
|
||||||
7、我角色 [角色序号]:查看指定序号角色的简略信息,缺省为1
|
4、战斗帮助
|
||||||
8、我的角色 [角色序号]:查看指定序号角色的详细信息,缺省为1
|
5、任务帮助
|
||||||
9、角色重随:重新随机自建角色的属性,需要花材料
|
6、社团帮助
|
||||||
10、我的物品 <物品序号>:查看指定序号物品的详细信息
|
7、活动帮助
|
||||||
11、设置主战 <角色序号>:将指定序号角色设置为主战
|
8、商店帮助
|
||||||
发送【帮助2】查看第 2 页");
|
在指令后面加数字即可跳转指定的页码,感谢游玩《筽祀牻》。");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Detail == "帮助2")
|
if (e.Detail.StartsWith("存档帮助"))
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 2 / 7 页)
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
12、装备 <角色序号> <物品序号>:装备指定物品给指定角色
|
await SendHelp(e, FunGameOrderList.ArchiveHelp, "存档帮助", page);
|
||||||
13、取消装备 <角色序号> <装备槽序号>:卸下角色指定装备槽上的物品
|
|
||||||
* 装备槽序号从1开始,卡包/武器/防具/鞋子/饰品1/饰品2
|
|
||||||
14、角色改名:修改名字,需要金币
|
|
||||||
15、抽卡/十连抽卡:2000金币一次,还有材料抽卡/材料十连抽卡,10材料1次
|
|
||||||
16、开启练级 [角色序号]:让指定角色启动练级模式,缺省为1
|
|
||||||
17、练级结算:收取奖励,最多累计24小时的收益
|
|
||||||
18、练级信息:查看当前进度
|
|
||||||
19、角色升级 [角色序号]:升到不能升为止
|
|
||||||
20、角色突破 [角色序号]:每10/20/30/40/50/60级都要突破才可以继续升级
|
|
||||||
21、突破信息 [角色序号]:查看下一次突破信息
|
|
||||||
发送【帮助3】查看第 3 页");
|
|
||||||
}
|
}
|
||||||
|
else if (e.Detail.StartsWith("角色帮助"))
|
||||||
if (e.Detail == "帮助3")
|
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 3 / 7 页)
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
22、普攻升级 [角色序号]:升级普攻等级
|
await SendHelp(e, FunGameOrderList.CharacterHelp, "角色帮助", page);
|
||||||
23、查看普攻升级 [角色序号]:查看下一次普攻升级信息
|
|
||||||
23、技能升级 <角色序号> <技能名称>:升级技能等级
|
|
||||||
24、查看技能升级 <角色序号> <技能名称>:查看下一次技能升级信息
|
|
||||||
25、使用 <物品名称> <数量> [角色] [角色序号]
|
|
||||||
26、使用 <物品序号> [角色] [角色序号]
|
|
||||||
27、使用魔法卡 <魔法卡序号> <魔法卡包序号>
|
|
||||||
28、合成魔法卡 <{物品序号...}>:要3张魔法卡,空格隔开
|
|
||||||
29、分解物品 <{物品序号...}>
|
|
||||||
30、分解 <物品名称> <数量>
|
|
||||||
31、品质分解 <品质索引>:从0开始,普通/优秀/稀有/史诗/传说/神话/不朽
|
|
||||||
32、决斗/完整决斗 <@对方>/<QQ号>/<昵称>:和对方切磋
|
|
||||||
发送【帮助4】查看第 4 页");
|
|
||||||
}
|
}
|
||||||
|
else if (e.Detail.StartsWith("物品帮助"))
|
||||||
if (e.Detail == "帮助4")
|
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 4 / 7 页)
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
33、兑换金币 <材料数>:1材料=200金币
|
await SendHelp(e, FunGameOrderList.ItemHelp, "物品帮助", page);
|
||||||
34、还原存档:没有后悔药
|
|
||||||
35、我的主战:查看当前主战角色
|
|
||||||
36、我的小队:查看小队角色名单
|
|
||||||
37、我的存档:查看账号/存档信息
|
|
||||||
38、设置小队 <{角色序号...}>:设置小队角色(1-4个参数)
|
|
||||||
39、小队决斗/小队完整决斗 <@对方>/<QQ号>/<昵称>:用小队和对方切磋
|
|
||||||
40、查询boss [boss序号]:查看指定序号boss的详细信息,缺省为boss名称列表
|
|
||||||
41、讨伐/小队讨伐boss <boss序号>
|
|
||||||
42、签到:每日签到
|
|
||||||
发送【帮助5】查看第 5 页");
|
|
||||||
}
|
}
|
||||||
|
else if (e.Detail.StartsWith("战斗帮助"))
|
||||||
if (e.Detail == "帮助5")
|
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 5 / 7 页)
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
43:任务列表:查看今日任务列表
|
await SendHelp(e, FunGameOrderList.BattleHelp, "战斗帮助", page);
|
||||||
44:开始任务/做任务 <任务序号>
|
|
||||||
45、任务信息:查看进行中任务的详细信息
|
|
||||||
46、任务结算:对进行中的任务进行结算
|
|
||||||
47、我的状态:查看主战角色状态
|
|
||||||
48、小队状态/我的小队状态:查看小队所有角色的状态
|
|
||||||
49、小队添加 <角色序号>:将角色加入小队
|
|
||||||
50、小队移除 <角色序号>:将角色移出小队
|
|
||||||
51、清空小队
|
|
||||||
发送【帮助6】查看第 6 页");
|
|
||||||
}
|
}
|
||||||
|
else if (e.Detail.StartsWith("任务帮助"))
|
||||||
if (e.Detail == "帮助6")
|
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 6 / 7 页)
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
52、我的社团:查看社团信息
|
await SendHelp(e, FunGameOrderList.QuestHelp, "任务帮助", page);
|
||||||
53、加入社团 <社团编号>:申请加入社团
|
|
||||||
54、退出社团
|
|
||||||
55、创建社团 <社团前缀>:创建一个公开社团,若指令中包含私密一词,将创建私密社团
|
|
||||||
社团前缀:3-4个字符,允许:英文字母和数字、部分特殊字符
|
|
||||||
56、查看社团成员/查看社团管理/查看申请人列表:查看对应列表
|
|
||||||
57、解散社团
|
|
||||||
58、社团批准 <@对方>/<QQ号
|
|
||||||
59、社团拒绝 <@对方>/<QQ号
|
|
||||||
60、社团踢出 <@对方>/<QQ号
|
|
||||||
61、社团转让 <@对方>/<QQ号
|
|
||||||
62、社团设置 <设置项> <{参数...}>
|
|
||||||
发送【帮助7】查看第 7 页");
|
|
||||||
}
|
}
|
||||||
|
else if (e.Detail.StartsWith("社团帮助"))
|
||||||
if (e.Detail == "帮助7")
|
|
||||||
{
|
{
|
||||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 7 / 7 页)
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
63、每日商店
|
await SendHelp(e, FunGameOrderList.ClubHelp, "社团帮助", page);
|
||||||
64、商店查看 <商品序号>
|
}
|
||||||
65、商店购买 <商品序号>
|
else if (e.Detail.StartsWith("活动帮助"))
|
||||||
66、");
|
{
|
||||||
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
|
await SendHelp(e, FunGameOrderList.ActivityHelp, "活动帮助", page);
|
||||||
|
}
|
||||||
|
else if (e.Detail.StartsWith("商店帮助"))
|
||||||
|
{
|
||||||
|
int page = e.Detail.Length > 4 && int.TryParse(e.Detail[4..], out int p) ? p : 1;
|
||||||
|
await SendHelp(e, FunGameOrderList.StoreHelp, "商店帮助", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Detail.StartsWith("FunGame模拟", StringComparison.CurrentCultureIgnoreCase))
|
if (e.Detail.StartsWith("FunGame模拟", StringComparison.CurrentCultureIgnoreCase))
|
||||||
@ -403,7 +376,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查数据", "").Trim();
|
string detail = e.Detail.Replace("查数据", "").Trim();
|
||||||
if (int.TryParse(detail, out int id))
|
if (int.TryParse(detail, out int id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetStats(id)) ?? "";
|
string msg = Controller.GetStats(id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查数据", msg);
|
await SendAsync(e, "查数据", msg);
|
||||||
@ -417,7 +390,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查团队数据", "").Trim();
|
string detail = e.Detail.Replace("查团队数据", "").Trim();
|
||||||
if (int.TryParse(detail, out int id))
|
if (int.TryParse(detail, out int id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetTeamStats(id)) ?? "";
|
string msg = Controller.GetTeamStats(id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查团队数据", msg);
|
await SendAsync(e, "查团队数据", msg);
|
||||||
@ -451,7 +424,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查角色", "").Trim();
|
string detail = e.Detail.Replace("查角色", "").Trim();
|
||||||
if (int.TryParse(detail, out int id))
|
if (int.TryParse(detail, out int id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterInfo(id)) ?? "";
|
string msg = Controller.GetCharacterInfo(id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查角色", msg);
|
await SendAsync(e, "查角色", msg);
|
||||||
@ -465,7 +438,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查技能", "").Trim();
|
string detail = e.Detail.Replace("查技能", "").Trim();
|
||||||
if (int.TryParse(detail, out int id))
|
if (int.TryParse(detail, out int id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetSkillInfo(uid, id)) ?? "";
|
string msg = Controller.GetSkillInfo(uid, id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查技能", msg);
|
await SendAsync(e, "查技能", msg);
|
||||||
@ -473,7 +446,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetSkillInfo_Name(uid, detail)) ?? "";
|
string msg = Controller.GetSkillInfo_Name(uid, detail);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查技能", msg);
|
await SendAsync(e, "查技能", msg);
|
||||||
@ -487,7 +460,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查物品", "").Trim();
|
string detail = e.Detail.Replace("查物品", "").Trim();
|
||||||
if (int.TryParse(detail, out int id))
|
if (int.TryParse(detail, out int id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfo(uid, id)) ?? "";
|
string msg = Controller.GetItemInfo(uid, id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查物品", msg);
|
await SendAsync(e, "查物品", msg);
|
||||||
@ -495,7 +468,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfo_Name(uid, detail)) ?? "";
|
string msg = Controller.GetItemInfo_Name(uid, detail);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查物品", msg);
|
await SendAsync(e, "查物品", msg);
|
||||||
@ -524,7 +497,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CreateItem(uid, name, count, userid)) ?? "";
|
string msg = Controller.CreateItem(uid, name, count, userid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "熟圣之力", msg);
|
await SendAsync(e, "熟圣之力", msg);
|
||||||
@ -540,7 +513,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "生成魔法卡包")
|
if (e.Detail == "生成魔法卡包")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GenerateMagicCardPack()) ?? "";
|
string msg = Controller.GenerateMagicCardPack();
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "生成魔法卡包", msg);
|
await SendAsync(e, "生成魔法卡包", msg);
|
||||||
@ -549,7 +522,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
}
|
}
|
||||||
else if (e.Detail == "生成魔法卡")
|
else if (e.Detail == "生成魔法卡")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GenerateMagicCard()) ?? "";
|
string msg = Controller.GenerateMagicCard();
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "生成魔法卡", msg);
|
await SendAsync(e, "生成魔法卡", msg);
|
||||||
@ -559,7 +532,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "创建存档")
|
if (e.Detail == "创建存档")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CreateSaved(name: openid)) ?? "";
|
string msg = Controller.CreateSaved(name: openid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "创建存档", "\r\n" + msg);
|
await SendAsync(e, "创建存档", "\r\n" + msg);
|
||||||
@ -569,7 +542,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "我的存档")
|
if (e.Detail == "我的存档")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowSaved(uid)) ?? "";
|
string msg = Controller.ShowSaved(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "我的存档", "\r\n" + msg);
|
await SendAsync(e, "我的存档", "\r\n" + msg);
|
||||||
@ -579,7 +552,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "我的主战")
|
if (e.Detail == "我的主战")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterInfoFromInventory(uid, 0)) ?? "";
|
string msg = Controller.GetCharacterInfoFromInventory(uid, 0);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "我的主战", "\r\n" + msg);
|
await SendAsync(e, "我的主战", "\r\n" + msg);
|
||||||
@ -589,7 +562,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "我的状态")
|
if (e.Detail == "我的状态")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowMainCharacterOrSquadStatus(uid)) ?? "";
|
string msg = Controller.ShowMainCharacterOrSquadStatus(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "我的状态", "\r\n" + msg);
|
await SendAsync(e, "我的状态", "\r\n" + msg);
|
||||||
@ -599,7 +572,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "小队状态" || e.Detail == "我的小队状态")
|
if (e.Detail == "小队状态" || e.Detail == "我的小队状态")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowMainCharacterOrSquadStatus(uid, true)) ?? "";
|
string msg = Controller.ShowMainCharacterOrSquadStatus(uid, true);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "我的小队状态", "\r\n" + msg);
|
await SendAsync(e, "我的小队状态", "\r\n" + msg);
|
||||||
@ -609,7 +582,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "我的小队")
|
if (e.Detail == "我的小队")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowSquad(uid)) ?? "";
|
string msg = Controller.ShowSquad(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "我的小队", "\r\n" + msg);
|
await SendAsync(e, "我的小队", "\r\n" + msg);
|
||||||
@ -619,7 +592,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "清空小队")
|
if (e.Detail == "清空小队")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ClearSquad(uid)) ?? "";
|
string msg = Controller.ClearSquad(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "清空小队", "\r\n" + msg);
|
await SendAsync(e, "清空小队", "\r\n" + msg);
|
||||||
@ -629,7 +602,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "还原存档")
|
if (e.Detail == "还原存档")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.RestoreSaved(uid)) ?? "";
|
string msg = Controller.RestoreSaved(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "还原存档", "\r\n" + msg);
|
await SendAsync(e, "还原存档", "\r\n" + msg);
|
||||||
@ -639,7 +612,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "生成自建角色")
|
if (e.Detail == "生成自建角色")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.NewCustomCharacter(uid)) ?? "";
|
string msg = Controller.NewCustomCharacter(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "抽卡", "\r\n" + msg);
|
await SendAsync(e, "抽卡", "\r\n" + msg);
|
||||||
@ -649,7 +622,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "角色改名")
|
if (e.Detail == "角色改名")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ReName(uid)) ?? "";
|
string msg = Controller.ReName(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "改名", "\r\n" + msg);
|
await SendAsync(e, "改名", "\r\n" + msg);
|
||||||
@ -659,7 +632,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "角色重随")
|
if (e.Detail == "角色重随")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.RandomCustomCharacter(uid, false)) ?? "";
|
string msg = Controller.RandomCustomCharacter(uid, false);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "角色重随", "\r\n" + msg);
|
await SendAsync(e, "角色重随", "\r\n" + msg);
|
||||||
@ -669,7 +642,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "确认角色重随")
|
if (e.Detail == "确认角色重随")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.RandomCustomCharacter(uid, true)) ?? "";
|
string msg = Controller.RandomCustomCharacter(uid, true);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "角色重随", "\r\n" + msg);
|
await SendAsync(e, "角色重随", "\r\n" + msg);
|
||||||
@ -679,7 +652,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "取消角色重随")
|
if (e.Detail == "取消角色重随")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CancelRandomCustomCharacter(uid)) ?? "";
|
string msg = Controller.CancelRandomCustomCharacter(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "角色重随", "\r\n" + msg);
|
await SendAsync(e, "角色重随", "\r\n" + msg);
|
||||||
@ -689,7 +662,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "抽卡")
|
if (e.Detail == "抽卡")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DrawCard(uid)) ?? "";
|
string msg = Controller.DrawCard(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "抽卡", "\r\n" + msg);
|
await SendAsync(e, "抽卡", "\r\n" + msg);
|
||||||
@ -709,7 +682,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "材料抽卡")
|
if (e.Detail == "材料抽卡")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DrawCard_Material(uid)) ?? "";
|
string msg = Controller.DrawCard_Material(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "材料抽卡", "\r\n" + msg);
|
await SendAsync(e, "材料抽卡", "\r\n" + msg);
|
||||||
@ -827,11 +800,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int seq))
|
if (int.TryParse(detail, out int seq))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterInfoFromInventory(uid, seq, true)) ?? "";
|
msg = Controller.GetCharacterInfoFromInventory(uid, seq, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterInfoFromInventory(uid, 1, true)) ?? "";
|
msg = Controller.GetCharacterInfoFromInventory(uid, 1, true);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -846,11 +819,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int seq))
|
if (int.TryParse(detail, out int seq))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterInfoFromInventory(uid, seq, false)) ?? "";
|
msg = Controller.GetCharacterInfoFromInventory(uid, seq, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterInfoFromInventory(uid, 1, false)) ?? "";
|
msg = Controller.GetCharacterInfoFromInventory(uid, 1, false);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -865,11 +838,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int seq))
|
if (int.TryParse(detail, out int seq))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterSkills(uid, seq)) ?? "";
|
msg = Controller.GetCharacterSkills(uid, seq);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterSkills(uid, 1)) ?? "";
|
msg = Controller.GetCharacterSkills(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -884,11 +857,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int seq))
|
if (int.TryParse(detail, out int seq))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterItems(uid, seq)) ?? "";
|
msg = Controller.GetCharacterItems(uid, seq);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetCharacterItems(uid, 1)) ?? "";
|
msg = Controller.GetCharacterItems(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -903,11 +876,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.SetMain(uid, cid)) ?? "";
|
msg = Controller.SetMain(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.SetMain(uid, 1)) ?? "";
|
msg = Controller.SetMain(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -922,11 +895,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.StartTraining(uid, cid)) ?? "";
|
msg = Controller.StartTraining(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.StartTraining(uid, 1)) ?? "";
|
msg = Controller.StartTraining(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -937,7 +910,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "练级信息")
|
if (e.Detail == "练级信息")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetTrainingInfo(uid)) ?? "";
|
string msg = Controller.GetTrainingInfo(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "练级信息", "\r\n" + msg);
|
await SendAsync(e, "练级信息", "\r\n" + msg);
|
||||||
@ -947,7 +920,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "练级结算")
|
if (e.Detail == "练级结算")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.StopTraining(uid)) ?? "";
|
string msg = Controller.StopTraining(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "练级结算", "\r\n" + msg);
|
await SendAsync(e, "练级结算", "\r\n" + msg);
|
||||||
@ -957,7 +930,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "任务列表")
|
if (e.Detail == "任务列表")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CheckQuestList(uid)) ?? "";
|
string msg = Controller.CheckQuestList(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "任务列表", "\r\n" + msg);
|
await SendAsync(e, "任务列表", "\r\n" + msg);
|
||||||
@ -967,7 +940,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "任务信息")
|
if (e.Detail == "任务信息")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CheckWorkingQuest(uid)) ?? "";
|
string msg = Controller.CheckWorkingQuest(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "任务信息", "\r\n" + msg);
|
await SendAsync(e, "任务信息", "\r\n" + msg);
|
||||||
@ -977,7 +950,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "任务结算")
|
if (e.Detail == "任务结算")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.SettleQuest(uid)) ?? "";
|
string msg = Controller.SettleQuest(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "任务结算", "\r\n" + msg);
|
await SendAsync(e, "任务结算", "\r\n" + msg);
|
||||||
@ -987,7 +960,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "签到")
|
if (e.Detail == "签到")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.SignIn(uid)) ?? "";
|
string msg = Controller.SignIn(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "签到", "\r\n" + msg);
|
await SendAsync(e, "签到", "\r\n" + msg);
|
||||||
@ -1017,14 +990,14 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg;
|
string msg;
|
||||||
if (int.TryParse(detail, out int index))
|
if (int.TryParse(detail, out int index))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfoFromInventory(uid, index)) ?? "";
|
msg = Controller.GetItemInfoFromInventory(uid, index);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查库存物品", msg);
|
await SendAsync(e, "查库存物品", msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfoFromInventory_Name(uid, detail)) ?? "";
|
msg = Controller.GetItemInfoFromInventory_Name(uid, detail);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查库存物品", msg);
|
await SendAsync(e, "查库存物品", msg);
|
||||||
@ -1037,7 +1010,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("兑换金币", "").Trim();
|
string detail = e.Detail.Replace("兑换金币", "").Trim();
|
||||||
if (int.TryParse(detail, out int materials))
|
if (int.TryParse(detail, out int materials))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ExchangeCredits(uid, materials)) ?? "";
|
string msg = Controller.ExchangeCredits(uid, materials);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "兑换金币", msg);
|
await SendAsync(e, "兑换金币", msg);
|
||||||
@ -1055,7 +1028,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
if (c != -1 && i != -1)
|
if (c != -1 && i != -1)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.UnEquipItem(uid, c, i)) ?? "";
|
string msg = Controller.UnEquipItem(uid, c, i);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "取消装备", msg);
|
await SendAsync(e, "取消装备", msg);
|
||||||
@ -1074,7 +1047,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
if (c != -1 && i != -1)
|
if (c != -1 && i != -1)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.EquipItem(uid, c, i)) ?? "";
|
string msg = Controller.EquipItem(uid, c, i);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "装备", msg);
|
await SendAsync(e, "装备", msg);
|
||||||
@ -1094,7 +1067,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string s = strings[1].Trim();
|
string s = strings[1].Trim();
|
||||||
if (c != -1 && s != "")
|
if (c != -1 && s != "")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetSkillLevelUpNeedy(uid, c, s)) ?? "";
|
string msg = Controller.GetSkillLevelUpNeedy(uid, c, s);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "查看技能升级", msg);
|
await SendAsync(e, "查看技能升级", msg);
|
||||||
@ -1114,7 +1087,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string s = strings[1].Trim();
|
string s = strings[1].Trim();
|
||||||
if (c != -1 && s != "")
|
if (c != -1 && s != "")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.SkillLevelUp(uid, c, s)) ?? "";
|
string msg = Controller.SkillLevelUp(uid, c, s);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "技能升级", msg);
|
await SendAsync(e, "技能升级", msg);
|
||||||
@ -1133,7 +1106,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
if (id1 != -1 && id2 != -1 && id3 != -1)
|
if (id1 != -1 && id2 != -1 && id3 != -1)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ConflateMagicCardPack(uid, [id1, id2, id3])) ?? "";
|
string msg = Controller.ConflateMagicCardPack(uid, [id1, id2, id3]);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "合成魔法卡", msg);
|
await SendAsync(e, "合成魔法卡", msg);
|
||||||
@ -1149,11 +1122,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.CharacterLevelUp(uid, cid)) ?? "";
|
msg = Controller.CharacterLevelUp(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.CharacterLevelUp(uid, 1)) ?? "";
|
msg = Controller.CharacterLevelUp(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -1168,11 +1141,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetNormalAttackLevelUpNeedy(uid, cid)) ?? "";
|
msg = Controller.GetNormalAttackLevelUpNeedy(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetNormalAttackLevelUpNeedy(uid, 1)) ?? "";
|
msg = Controller.GetNormalAttackLevelUpNeedy(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -1187,11 +1160,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.NormalAttackLevelUp(uid, cid)) ?? "";
|
msg = Controller.NormalAttackLevelUp(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.NormalAttackLevelUp(uid, 1)) ?? "";
|
msg = Controller.NormalAttackLevelUp(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -1206,11 +1179,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.CharacterLevelBreak(uid, cid)) ?? "";
|
msg = Controller.CharacterLevelBreak(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.CharacterLevelBreak(uid, 1)) ?? "";
|
msg = Controller.CharacterLevelBreak(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -1225,11 +1198,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string msg = "";
|
string msg = "";
|
||||||
if (int.TryParse(detail, out int cid))
|
if (int.TryParse(detail, out int cid))
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetLevelBreakNeedy(uid, cid)) ?? "";
|
msg = Controller.GetLevelBreakNeedy(uid, cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetLevelBreakNeedy(uid, 1)) ?? "";
|
msg = Controller.GetLevelBreakNeedy(uid, 1);
|
||||||
}
|
}
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
@ -1254,7 +1227,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
if (id > 0 && id2 > 0)
|
if (id > 0 && id2 > 0)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.UseItem3(uid, id, id2, isCharacter)) ?? "";
|
string msg = Controller.UseItem3(uid, id, id2, isCharacter);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "使用魔法卡", msg);
|
await SendAsync(e, "使用魔法卡", msg);
|
||||||
@ -1275,7 +1248,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
string characterIdsString = match.Groups["characterIds"].Value;
|
string characterIdsString = match.Groups["characterIds"].Value;
|
||||||
int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1];
|
int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1];
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.UseItem2(uid, itemName, count, characterIds)) ?? "";
|
string msg = Controller.UseItem2(uid, itemName, count, characterIds);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "使用", msg);
|
await SendAsync(e, "使用", msg);
|
||||||
@ -1292,7 +1265,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
string characterIdsString = match.Groups["characterIds"].Value;
|
string characterIdsString = match.Groups["characterIds"].Value;
|
||||||
int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1];
|
int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1];
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.UseItem(uid, itemId, characterIds)) ?? "";
|
string msg = Controller.UseItem(uid, itemId, characterIds);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "使用", msg);
|
await SendAsync(e, "使用", msg);
|
||||||
@ -1308,7 +1281,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string itemName = match.Groups["itemName"].Value.Trim();
|
string itemName = match.Groups["itemName"].Value.Trim();
|
||||||
if (int.TryParse(match.Groups["count"].Value, out int count))
|
if (int.TryParse(match.Groups["count"].Value, out int count))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.UseItem2(uid, itemName, count)) ?? "";
|
string msg = Controller.UseItem2(uid, itemName, count);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "使用", msg);
|
await SendAsync(e, "使用", msg);
|
||||||
@ -1323,7 +1296,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
if (int.TryParse(match.Groups["itemId"].Value, out int itemId))
|
if (int.TryParse(match.Groups["itemId"].Value, out int itemId))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.UseItem(uid, itemId)) ?? "";
|
string msg = Controller.UseItem(uid, itemId);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "使用", msg);
|
await SendAsync(e, "使用", msg);
|
||||||
@ -1349,7 +1322,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
ids.Add(id);
|
ids.Add(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DecomposeItem(uid, [.. ids])) ?? "";
|
string msg = Controller.DecomposeItem(uid, [.. ids]);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "分解物品", msg);
|
await SendAsync(e, "分解物品", msg);
|
||||||
@ -1368,7 +1341,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string itemName = match.Groups["itemName"].Value.Trim();
|
string itemName = match.Groups["itemName"].Value.Trim();
|
||||||
if (int.TryParse(match.Groups["count"].Value, out int count))
|
if (int.TryParse(match.Groups["count"].Value, out int count))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DecomposeItem2(uid, itemName, count)) ?? "";
|
string msg = Controller.DecomposeItem2(uid, itemName, count);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "分解", msg);
|
await SendAsync(e, "分解", msg);
|
||||||
@ -1384,7 +1357,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("品质分解", "").Trim();
|
string detail = e.Detail.Replace("品质分解", "").Trim();
|
||||||
if (int.TryParse(detail, out int q))
|
if (int.TryParse(detail, out int q))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DecomposeItem3(uid, q)) ?? "";
|
string msg = Controller.DecomposeItem3(uid, q);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "品质分解", msg);
|
await SendAsync(e, "品质分解", msg);
|
||||||
@ -1409,7 +1382,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
userid = temp;
|
userid = temp;
|
||||||
}
|
}
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CreateItem(uid, name, count, userid)) ?? "";
|
string msg = Controller.CreateItem(uid, name, count, userid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "熟圣之力", msg);
|
await SendAsync(e, "熟圣之力", msg);
|
||||||
@ -1733,7 +1706,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("小队添加", "").Trim();
|
string detail = e.Detail.Replace("小队添加", "").Trim();
|
||||||
if (int.TryParse(detail, out int c))
|
if (int.TryParse(detail, out int c))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.AddSquad(uid, c)) ?? "";
|
string msg = Controller.AddSquad(uid, c);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "小队", msg);
|
await SendAsync(e, "小队", msg);
|
||||||
@ -1747,7 +1720,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("小队移除", "").Trim();
|
string detail = e.Detail.Replace("小队移除", "").Trim();
|
||||||
if (int.TryParse(detail, out int c))
|
if (int.TryParse(detail, out int c))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.RemoveSquad(uid, c)) ?? "";
|
string msg = Controller.RemoveSquad(uid, c);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "小队", msg);
|
await SendAsync(e, "小队", msg);
|
||||||
@ -1768,7 +1741,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
cindexs.Add(c);
|
cindexs.Add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.SetSquad(uid, [.. cindexs])) ?? "";
|
string msg = Controller.SetSquad(uid, [.. cindexs]);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "小队", msg);
|
await SendAsync(e, "小队", msg);
|
||||||
@ -1781,7 +1754,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("加入社团", "").Trim();
|
string detail = e.Detail.Replace("加入社团", "").Trim();
|
||||||
if (int.TryParse(detail, out int c))
|
if (int.TryParse(detail, out int c))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.JoinClub(uid, c)) ?? "";
|
string msg = Controller.JoinClub(uid, c);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1799,7 +1772,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
isPublic = false;
|
isPublic = false;
|
||||||
}
|
}
|
||||||
detail = detail.Replace("私密", "").Trim();
|
detail = detail.Replace("私密", "").Trim();
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.CreateClub(uid, isPublic, detail)) ?? "";
|
string msg = Controller.CreateClub(uid, isPublic, detail);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1809,7 +1782,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "退出社团")
|
if (e.Detail == "退出社团")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.QuitClub(uid)) ?? "";
|
string msg = Controller.QuitClub(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1819,7 +1792,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "我的社团")
|
if (e.Detail == "我的社团")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubInfo(uid)) ?? "";
|
string msg = Controller.ShowClubInfo(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1829,7 +1802,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "解散社团")
|
if (e.Detail == "解散社团")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DisbandClub(uid)) ?? "";
|
string msg = Controller.DisbandClub(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1842,7 +1815,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查看社团成员", "").Trim();
|
string detail = e.Detail.Replace("查看社团成员", "").Trim();
|
||||||
if (int.TryParse(detail, out int page) && page > 0)
|
if (int.TryParse(detail, out int page) && page > 0)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 0, page)) ?? "";
|
string msg = Controller.ShowClubMemberList(uid, 0, page);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1850,7 +1823,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 0, 1)) ?? "";
|
string msg = Controller.ShowClubMemberList(uid, 0, 1);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1864,7 +1837,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查看社团管理", "").Trim();
|
string detail = e.Detail.Replace("查看社团管理", "").Trim();
|
||||||
if (int.TryParse(detail, out int page) && page > 0)
|
if (int.TryParse(detail, out int page) && page > 0)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 1, page)) ?? "";
|
string msg = Controller.ShowClubMemberList(uid, 1, page);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1872,7 +1845,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 1, 1)) ?? "";
|
string msg = Controller.ShowClubMemberList(uid, 1, 1);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1886,7 +1859,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("查看申请人列表", "").Trim();
|
string detail = e.Detail.Replace("查看申请人列表", "").Trim();
|
||||||
if (int.TryParse(detail, out int page) && page > 0)
|
if (int.TryParse(detail, out int page) && page > 0)
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 2, page)) ?? "";
|
string msg = Controller.ShowClubMemberList(uid, 2, page);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1894,7 +1867,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 2, 1)) ?? "";
|
string msg = Controller.ShowClubMemberList(uid, 2, 1);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", "\r\n" + msg);
|
await SendAsync(e, "社团", "\r\n" + msg);
|
||||||
@ -1908,7 +1881,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("社团批准", "").Replace("@", "").Trim();
|
string detail = e.Detail.Replace("社团批准", "").Replace("@", "").Trim();
|
||||||
if (long.TryParse(detail, out long id))
|
if (long.TryParse(detail, out long id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ApproveClub(uid, id, true)) ?? "";
|
string msg = Controller.ApproveClub(uid, id, true);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1922,7 +1895,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("社团拒绝", "").Replace("@", "").Trim();
|
string detail = e.Detail.Replace("社团拒绝", "").Replace("@", "").Trim();
|
||||||
if (long.TryParse(detail, out long id))
|
if (long.TryParse(detail, out long id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ApproveClub(uid, id, false)) ?? "";
|
string msg = Controller.ApproveClub(uid, id, false);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1936,7 +1909,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("社团踢出", "").Replace("@", "").Trim();
|
string detail = e.Detail.Replace("社团踢出", "").Replace("@", "").Trim();
|
||||||
if (long.TryParse(detail, out long id))
|
if (long.TryParse(detail, out long id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.KickClub(uid, id)) ?? "";
|
string msg = Controller.KickClub(uid, id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1968,7 +1941,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
args = [.. strings[1..]];
|
args = [.. strings[1..]];
|
||||||
}
|
}
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ChangeClub(uid, part, [.. args])) ?? "";
|
string msg = Controller.ChangeClub(uid, part, [.. args]);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1981,7 +1954,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
string detail = e.Detail.Replace("社团转让", "").Replace("@", "").Trim();
|
string detail = e.Detail.Replace("社团转让", "").Replace("@", "").Trim();
|
||||||
List<string> args = [detail];
|
List<string> args = [detail];
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ChangeClub(uid, "setmaster", [.. args])) ?? "";
|
string msg = Controller.ChangeClub(uid, "setmaster", [.. args]);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "社团", msg);
|
await SendAsync(e, "社团", msg);
|
||||||
@ -1991,7 +1964,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "每日商店")
|
if (e.Detail == "每日商店")
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowDailyStore(uid)) ?? "";
|
string msg = Controller.ShowDailyStore(uid);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "商店", "\r\n" + msg);
|
await SendAsync(e, "商店", "\r\n" + msg);
|
||||||
@ -2010,7 +1983,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
{
|
{
|
||||||
count = temp;
|
count = temp;
|
||||||
}
|
}
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DailyStoreBuy(uid, id, count)) ?? "";
|
string msg = Controller.DailyStoreBuy(uid, id, count);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "商店购买", msg);
|
await SendAsync(e, "商店购买", msg);
|
||||||
@ -2024,7 +1997,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
string detail = e.Detail.Replace("商店查看", "").Trim();
|
string detail = e.Detail.Replace("商店查看", "").Trim();
|
||||||
if (int.TryParse(detail, out int id))
|
if (int.TryParse(detail, out int id))
|
||||||
{
|
{
|
||||||
string msg = NetworkUtility.JsonDeserialize<string>(Controller.DailyStoreShowInfo(uid, id)) ?? "";
|
string msg = Controller.DailyStoreShowInfo(uid, id);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "商店", msg);
|
await SendAsync(e, "商店", msg);
|
||||||
@ -2079,7 +2052,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Detail.StartsWith("探索", StringComparison.CurrentCultureIgnoreCase) || e.Detail.StartsWith("前往", StringComparison.CurrentCultureIgnoreCase))
|
if (e.Detail.StartsWith("探索") || e.Detail.StartsWith("前往"))
|
||||||
{
|
{
|
||||||
string detail = e.Detail.Replace("探索", "").Replace("前往", "").Trim();
|
string detail = e.Detail.Replace("探索", "").Replace("前往", "").Trim();
|
||||||
string msg = "";
|
string msg = "";
|
||||||
@ -2106,7 +2079,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
|
|
||||||
if (e.Detail == "毕业礼包")
|
if (e.Detail == "毕业礼包")
|
||||||
{
|
{
|
||||||
string msg = Controller.CreateGiftBox(uid, "毕业礼包");
|
string msg = Controller.CreateGiftBox(uid, "毕业礼包", true, 2);
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "毕业礼包", string.Join("\r\n", msg));
|
await SendAsync(e, "毕业礼包", string.Join("\r\n", msg));
|
||||||
@ -2114,6 +2087,31 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Detail == "活动" || e.Detail == "活动中心")
|
||||||
|
{
|
||||||
|
string msg = Controller.GetEvents();
|
||||||
|
if (msg != "")
|
||||||
|
{
|
||||||
|
await SendAsync(e, "活动中心", string.Join("\r\n", msg));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Detail.StartsWith("查活动"))
|
||||||
|
{
|
||||||
|
string detail = e.Detail.Replace("查活动", "").Trim();
|
||||||
|
string msg = "";
|
||||||
|
if (int.TryParse(detail, out int eid))
|
||||||
|
{
|
||||||
|
msg = Controller.GetEvents(eid);
|
||||||
|
if (msg.Trim() != "")
|
||||||
|
{
|
||||||
|
await SendAsync(e, "查活动", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if (uid == GeneralSettings.Master && e.Detail.StartsWith("重载FunGame", StringComparison.CurrentCultureIgnoreCase))
|
if (uid == GeneralSettings.Master && e.Detail.StartsWith("重载FunGame", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
string msg = Controller.Relaod(uid);
|
string msg = Controller.Relaod(uid);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user