Sending Large Files Over RPC
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Sending Large Files Over RPC
WalkupAndAway
2015-11-19 16:48:32
Hello everyone,
I've been using PUN on my project for a couple of months now, and it's been fantastic. I'm currently running into an odd issue, and it's probably my fault, so I would appreciate some guidance.
Here's the situation: I'm trying to accomplish a one-time import of an obj file into all clients across the network. I'm able to get an obj file from the master client, and even import it and instantiate it there, but sending it to other clients is an issue. These files get pretty large, so to bypass the 32767 byte-limit on strings sent over RPC, I'm converting the text of the obj file to a binary array and sending that over an RPC call to a function that converts the binary array back into a string.
Now, this method works, in that it imports the model correctly, but it has the side effect of destroying every other game object I've instantiated over the network using PUN. Some documentation I read for PUN said that the max value of a byte array passed over the network is 2GBs, so I'm not sure why my 23MB obj file is causing this.
Does anyone have an idea of why this might happen and how I can fix it? If you could even point me in the direction of some documentation, I would really appreciate it! If more information is needed to figure this out, I'll happily provide it.
Comments
Hi @WalkupAndAway
If you make a search in the forum you'll find tons of discussions about using Photon to exchange files.
The most recent one from last month is interesting. Check it out here.
Back to top