Skip to content

Commit

Permalink
SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyTech6 committed Nov 21, 2024
1 parent 1153f35 commit 9ddce4b
Show file tree
Hide file tree
Showing 14 changed files with 445 additions and 199 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

`0.1.6`
- initial release
4 changes: 2 additions & 2 deletions Commands/BanCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ private static (bool Success, PlayerInfo PlayerInfo) HandleBanOperation(ChatComm
return (false, null);
}

banList.Add(new Ban(playerInfo.User.CharacterName.ToString(), playerInfo.User.PlatformId, bannedTime, reason));
Database.SaveDatabases();
Ban ban = new Ban(playerInfo.User.CharacterName.ToString(), playerInfo.User.PlatformId, bannedTime, reason);
Database.AddBan(ban, banList);

ctx.Reply($"{name} has been {banType} for {timeSpan}");

Expand Down
3 changes: 1 addition & 2 deletions Commands/UnbanCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ private static void HandleUnbanOperation(ChatCommandContext ctx, string name, Li
}

var ban = banList.First(x => x.PlayerID == playerInfo.User.PlatformId);
banList.Remove(ban);
Database.SaveDatabases();
Database.DeleteBan(ban, banList);

ctx.Reply($"{name} has been {unbanType}");

Expand Down
1 change: 0 additions & 1 deletion Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public static void Initialize()
if (hasInitialized) return;

PlayerService = new PlayerService();
_ = new JSONBinService();

Database = new Database();

Expand Down
28 changes: 24 additions & 4 deletions CrimsonBanned.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,41 @@
<FileVersion>0.1.10.0</FileVersion>
<InformationalVersion>0.1.10+1.Branch.main.Sha.c33d0879382e1a0da34861ec55914ba7e637a80e</InformationalVersion>
</PropertyGroup>
<Target Name="Thunderstore Copy to Dist" AfterTargets="AfterBuild" Condition=" '$(Configuration' == 'Release'">
<Copy SourceFiles="$(OutDir)\CrimsonBanned.dll" DestinationFolder="$(SolutionDir)/dist" />
</Target>
<Target Name="Thunderstore Copy to Dist" AfterTargets="AfterBuild"
Condition=" '$(Configuration' == 'Release'">
<Copy SourceFiles="$(OutDir)\CrimsonBanned.dll" DestinationFolder="$(SolutionDir)/dist" />
</Target>
<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.721" IncludeAssets="compile" />
<PackageReference Include="BepInEx.Core" Version="6.0.0-be.721" IncludeAssets="compile" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Fody" Version="6.9.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MySql.Data" Version="9.1.0" />
<PackageReference Include="MySqlConnector" Version="2.4.0" />
<PackageReference Include="VRising.Unhollowed.Client" Version="1.0.*" />
<PackageReference Include="VRising.VampireCommandFramework" Version="0.9.0" />
</ItemGroup>
<ItemGroup>
<None Include =".github\FUNDING.yml" />
<None Include=".github\FUNDING.yml" />
<None Include=".github\workflows\build.yml" />
</ItemGroup>
<ItemGroup>
<Folder Include="images\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(NuGetPackageRoot)mysql.data\*\lib\net6.0\MySql.Data.dll" />
<EmbeddedResource
Include="$(NuGetPackageRoot)system.diagnostics.diagnosticsource\*\lib\net6.0\System.Diagnostics.DiagnosticSource.dll" />
<EmbeddedResource
Include="$(NuGetPackageRoot)system.security.permissions\*\lib\net6.0\System.Security.Permissions.dll" />
<EmbeddedResource
Include="$(NuGetPackageRoot)system.configuration.configurationmanager\*\lib\net6.0\System.Configuration.ConfigurationManager.dll" />
<EmbeddedResource
Include="$(NuGetPackageRoot)system.text.encoding.codepages\*\lib\net6.0\System.Text.Encoding.CodePages.dll"/>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>
141 changes: 141 additions & 0 deletions FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeReferences" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if runtime assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseRuntimeReferencePaths" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls whether the runtime assemblies are embedded with their full path or only with their assembly name.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCleanup" type="xs:boolean">
<xs:annotation>
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
1 change: 0 additions & 1 deletion Patches/ChatMessagePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public static bool Prefix(ChatMessageSystem __instance)
if (DateTime.Now > ban.TimeUntil)
{
Database.ChatBans.Remove(ban);
Database.SaveDatabases();

ServerChatUtils.SendSystemMessageToClient(Core.EntityManager, userData, "Your chat ban has ended.");
}
Expand Down
66 changes: 0 additions & 66 deletions Patches/OnUserConnectedPatch.cs

This file was deleted.

1 change: 0 additions & 1 deletion Patches/VivoxPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public static void Prefix(VivoxConnectionSystem __instance)
if (DateTime.Now > ban.TimeUntil)
{
Database.VoiceBans.Remove(ban);
Database.SaveDatabases();

ServerChatUtils.SendSystemMessageToClient(Core.EntityManager, user,
"Your voice ban has expired. Please verify in your social settings that Voice Proximity is re-enabled.");
Expand Down
82 changes: 0 additions & 82 deletions Services/JSONBinService.cs

This file was deleted.

Loading

0 comments on commit 9ddce4b

Please sign in to comment.