Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: djray2k on July 24, 2014, 10:19:41 AM
-
Is there a way to do this? Basically somebody has their own custom texture and I want everybody else to see it. If so, what would be the best way to approach it.
Not related to TNet, but does anyone know a good way to save textures loaded in at run time? In my game you can customize a jersey, and you can load a custom logo to put on it.
-
If it's small enough, you can just send it as a byte[] array via an RFC -- or better yet, make it be a part of the Player Data. If it's a big texture, then you might want to split it up into pieces first.
-
Thank you for your response. :)
What max chunk size should I limit myself to when I send a large file? I can turn it into a byte[] just fine, but I would like to know how many bytes I should send at a time.
-
If it's via TCP, it doesn't matter that much, but I'd keep it under 256 kb just in case someone is on a really slow connection. Just be aware that while you are receiving a very large packet, other packets are effectively held back, waiting until the large one completes. This also includes pings, and if it takes you over 10 seconds to transfer the packet, you will be disconnected.