Photon Pun Sharing Arrays of Bytes! I'm stuck

Options

I have a problem with sharing data with photon. In my code, Master client is adding png files and converting them to sprites. other users should get sprites through to photon but since Photon doesnt send sprites in RPC I'm trying to sending Texture2D data then I will turn them into texture. But I'm stuck since RPC doesnt send my files and this is my guess. I sent raw byte data 2 but it didnt work either.

This is png file uploader

this is UIController object's script


Sorry for my bad english I hope I was able to explain myself. You can see scripts in the attachments. Scripts a liitle bit messy mostly I'm fixing when code works so sorry for that.


Comments

  • Tobias
    Options

    The Photon servers are not exactly built to send images around. You usually want to do this via a CDN. Someone loads the image up, gets and ID and that ID can be shared within Photon Rooms.

    If you absolutely must send images, make sure you compress them and turn them to byte[], which can be sent "as is". You can send a byte[] as parameter of an RPC and or via RaiseEvent.

  • reddote
    Options

    Ty for your advices the problem was byte limit for rpc, my images larger than 512kb so I tried smaller images and it did worked. My most images are coming from local PC I will search CDN probably the best solution for that, on the other hand some of my images are generated so I wil try to compress or chunk for these images because they need to be under 512kb for RPC.