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;
|
this.client = client;
|
||||||
spvData = receivedObject;
|
spvData = receivedObject;
|
||||||
UpdatePositionVariables();
|
UpdatePositionVariables();
|
||||||
if (Utils.VariablesValid(client))
|
SendSPVCommand();
|
||||||
SendSPVCommand();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePositionVariables() {
|
private void UpdatePositionVariables() {
|
||||||
|
@ -46,9 +46,6 @@ class SetUserVariablesHandler : ICommandHandler {
|
|||||||
client.PlayerData.Bu = suvData.Get<string>("BU");
|
client.PlayerData.Bu = suvData.Get<string>("BU");
|
||||||
client.PlayerData.Fp = suvData.Get<string>("FP");
|
client.PlayerData.Fp = suvData.Get<string>("FP");
|
||||||
|
|
||||||
if (!Utils.VariablesValid(client))
|
|
||||||
return;
|
|
||||||
|
|
||||||
Console.WriteLine($"SUV {client.Room.Name} IID: {client.ClientID}");
|
Console.WriteLine($"SUV {client.Room.Name} IID: {client.ClientID}");
|
||||||
client.Room.AddClient(client);
|
client.Room.AddClient(client);
|
||||||
UpdatePlayersInRoom();
|
UpdatePlayersInRoom();
|
||||||
@ -83,9 +80,6 @@ class SetUserVariablesHandler : ICommandHandler {
|
|||||||
vl.Add(NetworkArray.StringParam("L", client.PlayerData.L));
|
vl.Add(NetworkArray.StringParam("L", client.PlayerData.L));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Utils.VariablesValid(client))
|
|
||||||
return;
|
|
||||||
|
|
||||||
data.Add("vl", vl);
|
data.Add("vl", vl);
|
||||||
|
|
||||||
NetworkPacket packet = NetworkObject.WrapObject(0, 12, data).Serialize();
|
NetworkPacket packet = NetworkObject.WrapObject(0, 12, data).Serialize();
|
||||||
|
@ -9,19 +9,6 @@ using sodoffmmo.Data;
|
|||||||
|
|
||||||
namespace sodoffmmo.Core;
|
namespace sodoffmmo.Core;
|
||||||
internal static class Utils {
|
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) {
|
public static NetworkPacket VlNetworkPacket(NetworkArray vl, int roomID) {
|
||||||
NetworkObject obj = new();
|
NetworkObject obj = new();
|
||||||
obj.Add("r", roomID);
|
obj.Add("r", roomID);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using sodoffmmo.Core;
|
using System.Text.RegularExpressions;
|
||||||
|
using sodoffmmo.Core;
|
||||||
|
|
||||||
namespace sodoffmmo.Data;
|
namespace sodoffmmo.Data;
|
||||||
public class PlayerData {
|
public class PlayerData {
|
||||||
@ -61,8 +62,7 @@ public class PlayerData {
|
|||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
fp = value;
|
string[] array = value.Split('*');
|
||||||
string[] array = fp.Split('*');
|
|
||||||
Dictionary<string, string> keyValPairs = new();
|
Dictionary<string, string> keyValPairs = new();
|
||||||
foreach (string str in array) {
|
foreach (string str in array) {
|
||||||
string[] keyValPair = str.Split('$');
|
string[] keyValPair = str.Split('$');
|
||||||
@ -87,6 +87,14 @@ public class PlayerData {
|
|||||||
if (keyValPairs.TryGetValue("U", out string userdata)) {
|
if (keyValPairs.TryGetValue("U", out string userdata)) {
|
||||||
PetMounted = (userdata == "0");
|
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 = "";
|
private string fp = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user