Bitwise in a client - server scenario miscalculating
the only way i know, is sending negative number from server for getting a same result, otherwise not possible to reversing it through server (i guess)
I have been tasked with creating a server for a client. I have all of the clients' code, so using it, I must create a server.
The client has a particular piece of code in a function called readInt(num1); return num1 << 24 | num1 << 16 | num1 << 8 | num1, which is called every time the client expects a type = int in the data received from a packet, and I just can't haggle with it.
I tried what comes to mind first - just reverse it, right? If the int needs to be 3, do 3 >> 24, but no yield.
My mind doesn't work well mathematically, and I'm not a good problem solver, so if I want, say 3 on the server to read as 3 on the client, what formula would I use server-side to achieve this?
The client is in Adobe ActionScript 3, and the server in Python 2.7.12.