Forum Multiplayer Why isn't Buffer.BlockCopy() allowed?

Discussion and help relating to the PlayerIO Multiplayer API.

Why isn't Buffer.BlockCopy() allowed?

Postby Benedani » December 16th, 2017, 9:26 pm

I have some code that copies floats into a byte array for less data usage (PlayerIO message contents seem to be separated by a few bytes, so since this puts 13 floats into 1 byte array, that's how much less data it uses). However, when I upload the game code this message shows:

Invalid Game Dll: Ingame.Brick.get_floatarray(...) uses the non-allowed method: System.Void System.Buffer::BlockCopy(System.Array,System.Int32,System.Array,System.Int32,System.Int32)

Why is it not allowed? I'm confused. Though, I could use BitConverter, albeit with a little more ugly code as the result.
Edit: I'm using BitConverter now. Still, I'm confused as to why Buffer.BlockCopy is bad.
Benedani
 
Posts: 12
Joined: March 28th, 2017, 5:10 pm

Return to Multiplayer



cron