@ -350,8 +350,9 @@ namespace CoopClient
|
||||
if ((CurrentVehicleSpeed > 0.2f || VehIsInBurnout) && MainVehicle.IsInRange(VehiclePosition, 7.0f))
|
||||
{
|
||||
MainVehicle.Velocity = VehicleVelocity + (VehiclePosition - MainVehicle.Position);
|
||||
MainVehicle.Quaternion = Quaternion.Slerp(MainVehicle.Quaternion, VehicleRotation, 0.25f);
|
||||
|
||||
|
||||
MainVehicle.Quaternion = Quaternion.Slerp(MainVehicle.Quaternion, VehicleRotation, 0.5f);
|
||||
|
||||
VehicleStopTime = Environment.TickCount;
|
||||
}
|
||||
else if ((Environment.TickCount - VehicleStopTime) <= 1000)
|
||||
@ -373,7 +374,7 @@ namespace CoopClient
|
||||
* Thanks to @oldnapalm.
|
||||
*/
|
||||
|
||||
private string PedalingAnimDict()
|
||||
private string PedalingAnimDict()
|
||||
{
|
||||
switch ((VehicleHash)VehicleModelHash)
|
||||
{
|
||||
|
@ -161,7 +161,6 @@ namespace CoopClient
|
||||
KeyDown += OnKeyDown;
|
||||
|
||||
Util.NativeMemory();
|
||||
Util.DisableSlowMo();
|
||||
}
|
||||
|
||||
private int LastDataSend;
|
||||
|
@ -258,7 +258,7 @@ namespace CoopClient
|
||||
}
|
||||
}
|
||||
|
||||
#region GET
|
||||
#region -- GET --
|
||||
#region -- PLAYER --
|
||||
private void PlayerConnect(PlayerConnectPacket packet)
|
||||
{
|
||||
@ -371,7 +371,6 @@ namespace CoopClient
|
||||
if (Main.Players.ContainsKey(packet.Player))
|
||||
{
|
||||
EntitiesPlayer player = Main.Players[packet.Player];
|
||||
player.ModelHash = packet.ModelHash;
|
||||
player.Health = packet.Health;
|
||||
player.Position = packet.Position.ToVector();
|
||||
player.VehicleModelHash = packet.VehModelHash;
|
||||
@ -503,7 +502,7 @@ namespace CoopClient
|
||||
#endregion // -- NPC --
|
||||
#endregion
|
||||
|
||||
#region SEND
|
||||
#region -- SEND --
|
||||
private bool FullPlayerSync = true;
|
||||
public void SendPlayerData()
|
||||
{
|
||||
@ -572,7 +571,6 @@ namespace CoopClient
|
||||
new LightSyncPlayerVehPacket()
|
||||
{
|
||||
Player = Main.LocalPlayerID,
|
||||
ModelHash = player.Model.Hash,
|
||||
Health = player.Health,
|
||||
Position = player.Position.ToLVector(),
|
||||
VehModelHash = player.CurrentVehicle.Model.Hash,
|
||||
|
@ -452,36 +452,33 @@ namespace CoopClient
|
||||
public string Player { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public int ModelHash { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public int Health { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
[ProtoMember(3)]
|
||||
public LVector3 Position { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
[ProtoMember(4)]
|
||||
public int VehModelHash { get; set; }
|
||||
|
||||
[ProtoMember(6)]
|
||||
[ProtoMember(5)]
|
||||
public int VehSeatIndex { get; set; }
|
||||
|
||||
[ProtoMember(7)]
|
||||
[ProtoMember(6)]
|
||||
public LVector3 VehPosition { get; set; }
|
||||
|
||||
[ProtoMember(8)]
|
||||
[ProtoMember(7)]
|
||||
public LQuaternion VehRotation { get; set; }
|
||||
|
||||
[ProtoMember(9)]
|
||||
[ProtoMember(8)]
|
||||
public LVector3 VehVelocity { get; set; }
|
||||
|
||||
[ProtoMember(10)]
|
||||
[ProtoMember(9)]
|
||||
public float VehSpeed { get; set; }
|
||||
|
||||
[ProtoMember(11)]
|
||||
[ProtoMember(10)]
|
||||
public float VehSteeringAngle { get; set; }
|
||||
|
||||
[ProtoMember(12)]
|
||||
[ProtoMember(11)]
|
||||
public byte? Flag { get; set; } = 0;
|
||||
|
||||
public override void PacketToNetOutGoingMessage(NetOutgoingMessage message)
|
||||
@ -501,7 +498,6 @@ namespace CoopClient
|
||||
LightSyncPlayerVehPacket data = CoopSerializer.Deserialize<LightSyncPlayerVehPacket>(message.ReadBytes(len));
|
||||
|
||||
Player = data.Player;
|
||||
ModelHash = data.ModelHash;
|
||||
Health = data.Health;
|
||||
Position = data.Position;
|
||||
VehModelHash = data.VehModelHash;
|
||||
|
@ -53,7 +53,7 @@ namespace CoopClient
|
||||
GetEntityAddressFunc = GetDelegateForFunctionPointer<GetHandleAddressFuncDelegate>(new IntPtr(*(int*)(address + 1) + address + 5));
|
||||
|
||||
// use the former pattern if the version is 1.0.1604.0 or newer
|
||||
var gameVersion = (int)Game.Version;
|
||||
int gameVersion = (int)Game.Version;
|
||||
address = gameVersion >= 46 ?
|
||||
FindPattern("\xF3\x0F\x10\x9F\xD4\x08\x00\x00\x0F\x2F\xDF\x73\x0A", "xxxx????xxxxx") :
|
||||
FindPattern("\xF3\x0F\x10\x8F\x68\x08\x00\x00\x88\x4D\x8C\x0F\x2F\xCF", "xxxx????xxx???");
|
||||
@ -63,6 +63,15 @@ namespace CoopClient
|
||||
{
|
||||
SteeringAngleOffset = *(int*)(address + 6) + 8;
|
||||
}
|
||||
|
||||
address = FindPattern("\x32\xc0\xf3\x0f\x11\x09", "xxxxxx"); // Weapon / Radio slowdown
|
||||
if (address != null)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
*(byte*)((IntPtr)address + i).ToPointer() = 0x90;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delegate ulong GetHandleAddressFuncDelegate(int handle);
|
||||
@ -75,7 +84,7 @@ namespace CoopClient
|
||||
|
||||
public static unsafe void CustomSteeringAngle(int Handle, float value)
|
||||
{
|
||||
var address = GetEntityAddress(Handle);
|
||||
IntPtr address = GetEntityAddress(Handle);
|
||||
if (address == IntPtr.Zero || SteeringAngleOffset == 0)
|
||||
{
|
||||
return;
|
||||
@ -83,20 +92,6 @@ namespace CoopClient
|
||||
|
||||
*(float*)(address + SteeringAngleOffset).ToPointer() = value;
|
||||
}
|
||||
|
||||
public static unsafe void DisableSlowMo()
|
||||
{
|
||||
var address = FindPattern("\x32\xc0\xf3\x0f\x11\x09", "xxxxxx"); // Weapon / Radio slowdown
|
||||
if (address == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
*(byte*)((IntPtr)address + i).ToPointer() = 0x90;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static bool IsBetween<T>(this T item, T start, T end)
|
||||
|
@ -415,36 +415,33 @@ namespace CoopServer
|
||||
public string Player { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public int ModelHash { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public int Health { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
[ProtoMember(3)]
|
||||
public LVector3 Position { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
[ProtoMember(4)]
|
||||
public int VehModelHash { get; set; }
|
||||
|
||||
[ProtoMember(6)]
|
||||
[ProtoMember(5)]
|
||||
public int VehSeatIndex { get; set; }
|
||||
|
||||
[ProtoMember(7)]
|
||||
[ProtoMember(6)]
|
||||
public LVector3 VehPosition { get; set; }
|
||||
|
||||
[ProtoMember(8)]
|
||||
[ProtoMember(7)]
|
||||
public LQuaternion VehRotation { get; set; }
|
||||
|
||||
[ProtoMember(9)]
|
||||
[ProtoMember(8)]
|
||||
public LVector3 VehVelocity { get; set; }
|
||||
|
||||
[ProtoMember(10)]
|
||||
[ProtoMember(9)]
|
||||
public float VehSpeed { get; set; }
|
||||
|
||||
[ProtoMember(11)]
|
||||
[ProtoMember(10)]
|
||||
public float VehSteeringAngle { get; set; }
|
||||
|
||||
[ProtoMember(12)]
|
||||
[ProtoMember(11)]
|
||||
public byte? Flag { get; set; } = 0;
|
||||
|
||||
public override void PacketToNetOutGoingMessage(NetOutgoingMessage message)
|
||||
@ -464,7 +461,6 @@ namespace CoopServer
|
||||
LightSyncPlayerVehPacket data = CoopSerializer.Deserialize<LightSyncPlayerVehPacket>(message.ReadBytes(len));
|
||||
|
||||
Player = data.Player;
|
||||
ModelHash = data.ModelHash;
|
||||
Health = data.Health;
|
||||
Position = data.Position;
|
||||
VehModelHash = data.VehModelHash;
|
||||
|
Reference in New Issue
Block a user