Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloryr committed May 16, 2024
1 parent c9dd095 commit 0609475
Show file tree
Hide file tree
Showing 28 changed files with 603 additions and 577 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "OneBotSharp"]
path = OneBotSharp
url = https://github.com/Coloryr/OneBotSharp.git
6 changes: 6 additions & 0 deletions Minecraft_QQ.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneBotSharp", "OneBotSharp\OneBotSharp\OneBotSharp.csproj", "{AD4C32D7-F614-4D1B-8DEE-C927AC81CED2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -32,6 +34,10 @@ Global
{15A32294-02DD-40A9-B7B6-D8A6BEB74C72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15A32294-02DD-40A9-B7B6-D8A6BEB74C72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15A32294-02DD-40A9-B7B6-D8A6BEB74C72}.Release|Any CPU.Build.0 = Release|Any CPU
{AD4C32D7-F614-4D1B-8DEE-C927AC81CED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD4C32D7-F614-4D1B-8DEE-C927AC81CED2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD4C32D7-F614-4D1B-8DEE-C927AC81CED2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD4C32D7-F614-4D1B-8DEE-C927AC81CED2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 3 additions & 3 deletions Minecraft_QQ_Cmd/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static async Task Main()
IMinecraft_QQ.ConfigInitCall = ConfigInit;
await Minecraft_QQ.Start();

if (!Minecraft_QQ.MainConfig.Admin.NoInput)
if (!Minecraft_QQ.Main.Admin.NoInput)
{
while (true)
{
Expand Down Expand Up @@ -56,7 +56,7 @@ private static void Message(string message)

private static void ConfigInit()
{
if (Minecraft_QQ.MainConfig.Admin.NoInput)
if (Minecraft_QQ.Main.Admin.NoInput)
{
Console.WriteLine("你需要在配置文件中设置主群才能继续使用");
Environment.Exit(1);
Expand All @@ -70,7 +70,7 @@ private static void ConfigInit()
if (long.TryParse(a, out var group))
{
group = Math.Abs(group);
Minecraft_QQ.GroupConfig.Groups.Add(group, new()
Minecraft_QQ.Groups.Groups.Add(group, new()
{
Group = group,
EnableCommand = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2024-05-07T11:01:31.1314796Z||;True|2024-02-19T14:58:53.6167020+08:00||;</History>
<History>True|2024-05-16T08:07:40.1144349Z||;True|2024-05-13T20:30:51.7503157+08:00||;True|2024-05-13T20:29:37.0822568+08:00||;True|2024-05-13T10:51:01.0984596+08:00||;True|2024-05-07T19:01:31.1314796+08:00||;True|2024-02-19T14:58:53.6167020+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
8 changes: 7 additions & 1 deletion Minecraft_QQ_Core/Config/ConfigObj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ public record SettingConfig
/// 发送绑定信息QQ号
/// </summary>
public long SendQQ { get; set; }
/// <summary>
/// 机器人地址
/// </summary>
public string BotUrl { get; set; }
/// <summary>
/// 机器人鉴权
/// </summary>
public string? BotAuthorization { get; set; }

public SettingConfig()
Expand All @@ -194,7 +200,7 @@ public SettingConfig()
SendLog = true;
SendCommand = false;
SendDelay = 100;
BotUrl = "ws://127.0.0.1:8081/";
BotUrl = "ws://localhost:8081/";
}

public override string ToString()
Expand Down
32 changes: 16 additions & 16 deletions Minecraft_QQ_Core/Config/ConfigRead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ public static PlayerConfig ReadPlayer()
}
if (config.PlayerList == null)
{
config.PlayerList = new();
config.PlayerList = [];
save = true;
}
if (config.NotBindList == null)
{
config.NotBindList = new();
config.NotBindList = [];
save = true;
}
if (config.MuteList == null)
{
config.MuteList = new();
config.MuteList = [];
save = true;
}
if (save)
Expand Down Expand Up @@ -170,10 +170,10 @@ public static AskConfig ReadAsk()
{
"服务器菜单",
$"服务器查询菜单:{Environment.NewLine}" +
$"【{Minecraft_QQ.MainConfig.Check.Head}{Minecraft_QQ.MainConfig.Check.Bind} ID】可以绑定你的游戏ID。{Environment.NewLine}" +
$"【{Minecraft_QQ.MainConfig.Check.Head}{Minecraft_QQ.MainConfig.Check.PlayList}】可以查询服务器在线人数。{Environment.NewLine}" +
$"【{Minecraft_QQ.MainConfig.Check.Head}{Minecraft_QQ.MainConfig.Check.ServerCheck}】可以查询服务器是否在运行。{Environment.NewLine}" +
$"【{Minecraft_QQ.MainConfig.Check.Head}{Minecraft_QQ.MainConfig.Check.Send} 内容】可以向服务器里发送消息。(使用前请确保已经绑定了ID,)"}
$"【{Minecraft_QQ.Main.Check.Head}{Minecraft_QQ.Main.Check.Bind} ID】可以绑定你的游戏ID。{Environment.NewLine}" +
$"【{Minecraft_QQ.Main.Check.Head}{Minecraft_QQ.Main.Check.PlayList}】可以查询服务器在线人数。{Environment.NewLine}" +
$"【{Minecraft_QQ.Main.Check.Head}{Minecraft_QQ.Main.Check.ServerCheck}】可以查询服务器是否在运行。{Environment.NewLine}" +
$"【{Minecraft_QQ.Main.Check.Head}{Minecraft_QQ.Main.Check.Send} 内容】可以向服务器里发送消息。(使用前请确保已经绑定了ID,)"}
};
save = true;
}
Expand Down Expand Up @@ -209,7 +209,7 @@ public static CommandConfig ReadCommand()
config.CommandList = new()
{
{
"插件帮助",
"help",
new()
{
Command = "qq help",
Expand All @@ -218,7 +218,7 @@ public static CommandConfig ReadCommand()
}
},
{
"查钱",
"money",
new()
{
Command = "money {arg:name}",
Expand All @@ -227,16 +227,16 @@ public static CommandConfig ReadCommand()
}
},
{
"禁言",
"mute",
new()
{
Command = "mute {arg1}",
Command = "mute {arg:next}",
PlayerUse = false,
PlayerSend = false
}
},
{
"传送",
"tpa",
new()
{
Command = "tpa {arg:at}",
Expand All @@ -245,19 +245,19 @@ public static CommandConfig ReadCommand()
}
},
{
"给权限",
"lp",
new()
{
Command = "lp user {arg:at} permission set {arg1} true",
Command = "lp user {arg:at} permission set {arg:next} true",
PlayerUse = false,
PlayerSend = false
}
},
{
"说话",
"say",
new()
{
Command = "say {argx}",
Command = "say {arg:x}",
PlayerUse = false,
PlayerSend = false
}
Expand Down
10 changes: 5 additions & 5 deletions Minecraft_QQ_Core/Config/ConfigWrite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static void Ask()
{
Name = "ask",
Local = ConfigFile.AskConfig.FullName,
Obj = Minecraft_QQ.AskConfig
Obj = Minecraft_QQ.Asks
});
}
public static void Command()
Expand All @@ -17,7 +17,7 @@ public static void Command()
{
Name = "command",
Local = ConfigFile.CommandConfig.FullName,
Obj = Minecraft_QQ.CommandConfig
Obj = Minecraft_QQ.Commands
});
}
public static void Config()
Expand All @@ -26,7 +26,7 @@ public static void Config()
{
Name = "config",
Local = ConfigFile.MainConfig.FullName,
Obj = Minecraft_QQ.MainConfig
Obj = Minecraft_QQ.Main
});
}
public static void Group()
Expand All @@ -35,7 +35,7 @@ public static void Group()
{
Name = "group",
Local = ConfigFile.GroupConfig.FullName,
Obj = Minecraft_QQ.GroupConfig
Obj = Minecraft_QQ.Groups
});
}
public static void Player()
Expand All @@ -44,7 +44,7 @@ public static void Player()
{
Name = "player",
Local = ConfigFile.PlayerConfig.FullName,
Obj = Minecraft_QQ.PlayerConfig
Obj = Minecraft_QQ.Players
});
}
public static void All()
Expand Down
19 changes: 11 additions & 8 deletions Minecraft_QQ_Core/Minecraft_QQ.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="DotNetty.Buffers" Version="0.7.5" />
<PackageReference Include="DotNetty.Codecs" Version="0.7.5" />
<PackageReference Include="DotNetty.Common" Version="0.7.5" />
<PackageReference Include="DotNetty.Handlers" Version="0.7.5" />
<PackageReference Include="DotNetty.Transport" Version="0.7.5" />
<PackageReference Include="MySqlConnector" Version="2.3.5" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="DotNetty.Buffers" Version="0.7.6" />
<PackageReference Include="DotNetty.Codecs" Version="0.7.6" />
<PackageReference Include="DotNetty.Common" Version="0.7.6" />
<PackageReference Include="DotNetty.Handlers" Version="0.7.6" />
<PackageReference Include="DotNetty.Transport" Version="0.7.6" />
<PackageReference Include="MySqlConnector" Version="2.3.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Websocket.Client" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\OneBotSharp\OneBotSharp\OneBotSharp.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 0609475

Please sign in to comment.