/// <summary> /// Sends a series of player updates to the specified player /// </summary> static public void Object_Players(Player p, IEnumerable <Player> updates) { //Prepare the packet SC_PlayerEnter players = new SC_PlayerEnter(); players.exclude = p; players.players = updates; //Done! if (updates.Any(plyr => plyr != null)) { p._client.sendReliable(players); } }
/// <summary> /// Sends a player update to the specified player /// </summary> static public void Object_Players(Player p, Player update) { //Sanity checks if (update._baseVehicle == null) { Log.write(TLog.Warning, "Unable to update a player '{0}' without a baseVehicle set!", update._alias); return; } //Prepare the packet SC_PlayerEnter players = new SC_PlayerEnter(); players.singlePlayer = update; p._client.sendReliable(players); }
/// <summary> /// Sends a series of player updates to the specified player /// </summary> static public void Object_Players(IEnumerable <Player> p, Player update) { //Sanity checks if (update._baseVehicle == null) { Log.write(TLog.Warning, "Unable to update a player '{0}' without a baseVehicle set!", update._alias); return; } //Prepare the packet SC_PlayerEnter players = new SC_PlayerEnter(); players.singlePlayer = update; //Send to each recipient foreach (Player player in p) { if (player != update) { player._client.sendReliable(players); } } }