proletariatgames / CUDLR

⛔️ [DEPRECATED] Console for Unity Debugging and Logging Remotely
MIT License
166 stars 34 forks source link

handling very long parameters #18

Closed tenpn closed 9 years ago

tenpn commented 9 years ago

I'm still using this in all our spryfox projects. QA love it!

I tried making a command that took a dump of our save file and sent it to the game. However this save file is longish (about 1.7k), and between the html console and reaching my CUDLR.Command(), the string gets truncated. I've tried digging around both in the javascript and the C# server, looking for some constant that truncated input, but to no avail.

Any ideas what could be causing this, and if so, any ideas on a workaround?

tenpn commented 9 years ago

No, wait, ignore me.

I was sending json, and it wasn't escaped. If I encode my parameter with Uri.EncodeDataString then the command gets it fine.

Would be great to do this automatically.

tenpn commented 9 years ago

...fwiw for others, here's the full command I used to dump json in a cudlr-friendly format:

Uri.EscapeDataString(Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(json)));

Just escaping the data string seemed to lose spaces from DateTime strings, making them unparsable.

That gives you an alphanumeric mess that will go through cudlr. In your command you decode with:

System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(string.Join("", cmdParams)));

...where cmdParams is the string[] passed into the command. You don't need Uri.UnescapeDataString because that's done for you.

lpetre commented 9 years ago

I'd really like to add a generic 'upload' facility to CUDLR. We want to do something similar in our game to upload large binary player state to the server.

narabalki commented 8 years ago

Currently the server does not accept POST requests - It will be useful to have it and have a way to upload files.