Code: Select all
Profiler.BeginSample("Send UserVars");
sfs.Send( new SetUserVariablesRequest(userVars) );
Profiler.EndSample();
As an experiment, I tried caching a single reference to a SetUserVariablesRequest and simply sending that over and over. This then reduced the allocation to practically zero. The problem here is of course that this isn't actually a solution to the problem, as we need to tell the server of the changed user variables and for some reason these classes seem to be read only.
Surely there must be some way to send a simple data packet without allocating so much memory? And if there isn't, would it be possible to get the Unity api source code so that I can at least attempt to optimize it myself? For the record I've spent close to 20k EUR on licenses so far.