Hello.
1. There is a proposal to add a new SendImage API method.
This method forces the player to cache the image. This is convenient when we know in advance that the player will see the target picture in time and save him from waiting for the download.
2. The API RemoveImage method does not work properly, this is due to a logical error on line 497. The check stops the code further if there is a picture in the cache, although logically it should be the other way around.
1. There is a proposal to add a new SendImage API method.
[HookMethod("SendImage")]
public void SendImage(BasePlayer player, string imageName, ulong imageId = 0)
{
if (!HasImage(imageName, imageId) || player?.net?.connection == null)
return;
uint crc = uint.Parse(GetImage(imageName, imageId));
byte[] array = FileStorage.server.Get(crc, FileStorage.Type.png, CommunityEntity.ServerInstance.net.ID);
if (array == null)
return;
CommunityEntity.ServerInstance.ClientRPCEx<uint, uint, byte[]>(new Network.SendInfo(player.net.connection)
{
channel = 2,
method = Network.SendMethod.Reliable
}, null, "CL_ReceiveFilePng", crc, (uint)array.Length, array);
}This method forces the player to cache the image. This is convenient when we know in advance that the player will see the target picture in time and save him from waiting for the download.
2. The API RemoveImage method does not work properly, this is due to a logical error on line 497. The check stops the code further if there is a picture in the cache, although logically it should be the other way around.