Fix player position not correctly set
This commit is contained in:
parent
8ee188cf19
commit
0b2ec1d626
@ -209,7 +209,7 @@ namespace RageCoop.Server
|
||||
/// Trigger a CustomEvent for this client
|
||||
/// </summary>
|
||||
/// <param name="hash">An unique identifier of the event, you can use <see cref="CustomEvents.Hash(string)"/> to get it from a string</param>
|
||||
/// <param name="args"></param>
|
||||
/// <param name="args">Arguments</param>
|
||||
public void SendCustomEvent(int hash,List<object> args)
|
||||
{
|
||||
if (!IsReady)
|
||||
@ -234,6 +234,11 @@ namespace RageCoop.Server
|
||||
Server.Logger?.Error(ex);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Trigger a CustomEvent for this client
|
||||
/// </summary>
|
||||
/// <param name="hash">An unique identifier of the event, you can use <see cref="CustomEvents.Hash(string)"/> to get it from a string</param>
|
||||
/// <param name="args">Arguments</param>
|
||||
public void SendCustomEvent(int hash,params object[] args)
|
||||
{
|
||||
if (!IsReady)
|
||||
|
@ -599,16 +599,18 @@ namespace RageCoop.Server
|
||||
// Add the player to Players
|
||||
lock (Clients)
|
||||
{
|
||||
var player = new ServerPed
|
||||
{
|
||||
ID= packet.PedID,
|
||||
};
|
||||
Entities.Add(player);
|
||||
Clients.Add(connection.RemoteUniqueIdentifier,
|
||||
tmpClient = new Client(this)
|
||||
{
|
||||
NetID = connection.RemoteUniqueIdentifier,
|
||||
Connection=connection,
|
||||
Username=packet.Username,
|
||||
Player = new()
|
||||
{
|
||||
ID= packet.PedID,
|
||||
}
|
||||
Player = player
|
||||
}
|
||||
);;
|
||||
}
|
||||
|
@ -224,5 +224,17 @@ namespace RageCoop.Server
|
||||
// Server.Logger?.Trace($"Removing ped:{id}");
|
||||
if (Peds.ContainsKey(id)) { Peds.Remove(id); }
|
||||
}
|
||||
|
||||
internal void Add(ServerPed ped)
|
||||
{
|
||||
if (Peds.ContainsKey(ped.ID))
|
||||
{
|
||||
Peds[ped.ID]=ped;
|
||||
}
|
||||
else
|
||||
{
|
||||
Peds.Add(ped.ID, ped);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
/// <summary>
|
||||
/// NPC data won't be sent to a player if their distance is greater than this value. -1 for unlimited.
|
||||
/// </summary>
|
||||
public float NpcStreamingDistance { get; set; } = 500;
|
||||
public float NpcStreamingDistance { get; set; } = 500 ;
|
||||
/// <summary>
|
||||
/// Player's data won't be sent to another player if their distance is greater than this value. -1 for unlimited.
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user