Stop using deprecated FindData method

This commit is contained in:
UnknownShadow200 2023-12-10 22:25:08 +11:00
parent 7f7cf7cb52
commit bd55a9e608
4 changed files with 15 additions and 12 deletions

View File

@ -35,10 +35,11 @@ namespace MCGalaxy.Commands.Info
if (target == null) return;
string nick = p.FormatNick(target);
string tempData = Server.tempBans.FindData(target);
string tempData = Server.tempBans.Get(target);
string tempBanner = null, tempReason = null;
DateTime tempExpiry = DateTime.MinValue;
if (tempData != null) {
if (!string.IsNullOrEmpty(tempData)) {
Ban.UnpackTempBanData(tempData, out tempReason, out tempBanner, out tempExpiry);
}

View File

@ -45,8 +45,8 @@ namespace MCGalaxy.Core {
static bool CheckTempban(Player p) {
try {
string data = Server.tempBans.FindData(p.name);
if (data == null) return true;
string data = Server.tempBans.Get(p.name);
if (string.IsNullOrEmpty(data)) return true;
string banner, reason;
DateTime expiry;

View File

@ -540,6 +540,7 @@
<Compile Include="Modules\Compiling\Compiler.cs" />
<Compile Include="Modules\Compiling\CompilerOperations.cs" />
<Compile Include="Modules\Compiling\CompilerBackends.cs" />
<Compile Include="Modules\Compiling\CompilerPlugin.cs" />
<Compile Include="Modules\Games\Countdown\CountdownConfig.cs" />
<Compile Include="Modules\Games\Countdown\CountdownPlugin.cs" />
<Compile Include="Modules\Games\Countdown\CmdCountdown.cs" />

View File

@ -185,21 +185,22 @@ namespace MCGalaxy
}
void LoadCpeData() {
string skin = Server.skins.FindData(name);
if (skin != null) SkinName = skin;
string model = Server.models.FindData(name);
if (model != null) Model = model;
string skin = Server.skins.Get(name);
if (!string.IsNullOrEmpty(skin)) SkinName = skin;
string model = Server.models.Get(name);
if (!string.IsNullOrEmpty(model)) Model = model;
string modelScales = Server.modelScales.FindData(name);
if (modelScales != null) {
string modelScales = Server.modelScales.Get(name);
if (!string.IsNullOrEmpty(modelScales)) {
string[] bits = modelScales.SplitSpaces(3);
Utils.TryParseSingle(bits[0], out ScaleX);
Utils.TryParseSingle(bits[1], out ScaleY);
Utils.TryParseSingle(bits[2], out ScaleZ);
}
string rotations = Server.rotations.FindData(name);
if (rotations != null) {
string rotations = Server.rotations.Get(name);
if (!string.IsNullOrEmpty(rotations)) {
string[] bits = rotations.SplitSpaces(2);
Orientation rot = Rot;
byte.TryParse(bits[0], out rot.RotX);