mirror of
https://github.com/SoDOff-Project/sodoff-mmo.git
synced 2025-10-11 08:18:49 -07:00
change baby dragon exploit approach
- fix invalid FP insted of disconnect
This commit is contained in:
parent
89191a53ff
commit
3f49b895b9
@ -18,8 +18,7 @@ class SetPositionVariablesHandler : ICommandHandler {
|
||||
this.client = client;
|
||||
spvData = receivedObject;
|
||||
UpdatePositionVariables();
|
||||
if (Utils.VariablesValid(client))
|
||||
SendSPVCommand();
|
||||
SendSPVCommand();
|
||||
}
|
||||
|
||||
private void UpdatePositionVariables() {
|
||||
|
@ -46,9 +46,6 @@ class SetUserVariablesHandler : ICommandHandler {
|
||||
client.PlayerData.Bu = suvData.Get<string>("BU");
|
||||
client.PlayerData.Fp = suvData.Get<string>("FP");
|
||||
|
||||
if (!Utils.VariablesValid(client))
|
||||
return;
|
||||
|
||||
Console.WriteLine($"SUV {client.Room.Name} IID: {client.ClientID}");
|
||||
client.Room.AddClient(client);
|
||||
UpdatePlayersInRoom();
|
||||
@ -83,9 +80,6 @@ class SetUserVariablesHandler : ICommandHandler {
|
||||
vl.Add(NetworkArray.StringParam("L", client.PlayerData.L));
|
||||
}
|
||||
|
||||
if (!Utils.VariablesValid(client))
|
||||
return;
|
||||
|
||||
data.Add("vl", vl);
|
||||
|
||||
NetworkPacket packet = NetworkObject.WrapObject(0, 12, data).Serialize();
|
||||
|
@ -9,19 +9,6 @@ using sodoffmmo.Data;
|
||||
|
||||
namespace sodoffmmo.Core;
|
||||
internal static class Utils {
|
||||
public static bool VariablesValid(Client client) {
|
||||
if (client.PlayerData.Fp != "" && (client.PlayerData.PetMounted || (client.PlayerData.Mbf & 8) == 8)
|
||||
&& (client.PlayerData.GeometryType == PetGeometryType.Default && client.PlayerData.PetAge < PetAge.Teen
|
||||
|| client.PlayerData.GeometryType == PetGeometryType.Terror && client.PlayerData.PetAge < PetAge.Titan)) {
|
||||
NetworkObject obj = new NetworkObject();
|
||||
obj.Add("dr", (byte)1);
|
||||
client.Send(NetworkObject.WrapObject(0, 1005, obj).Serialize());
|
||||
client.SheduleDisconnect();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static NetworkPacket VlNetworkPacket(NetworkArray vl, int roomID) {
|
||||
NetworkObject obj = new();
|
||||
obj.Add("r", roomID);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using sodoffmmo.Core;
|
||||
using System.Text.RegularExpressions;
|
||||
using sodoffmmo.Core;
|
||||
|
||||
namespace sodoffmmo.Data;
|
||||
public class PlayerData {
|
||||
@ -61,8 +62,7 @@ public class PlayerData {
|
||||
return fp;
|
||||
}
|
||||
set {
|
||||
fp = value;
|
||||
string[] array = fp.Split('*');
|
||||
string[] array = value.Split('*');
|
||||
Dictionary<string, string> keyValPairs = new();
|
||||
foreach (string str in array) {
|
||||
string[] keyValPair = str.Split('$');
|
||||
@ -87,6 +87,14 @@ public class PlayerData {
|
||||
if (keyValPairs.TryGetValue("U", out string userdata)) {
|
||||
PetMounted = (userdata == "0");
|
||||
}
|
||||
if (PetMounted &&
|
||||
(GeometryType == PetGeometryType.Default && PetAge < PetAge.Teen
|
||||
|| GeometryType == PetGeometryType.Terror && PetAge < PetAge.Titan)
|
||||
) {
|
||||
fp = Regex.Replace(value, "^U\\$0\\*", "U$-1*");
|
||||
} else {
|
||||
fp = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
private string fp = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user