Update unity.js

This commit is contained in:
iddoeldor 2018-07-24 20:16:59 +03:00 committed by GitHub
parent 152caabb2e
commit 45baaafc59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,10 @@
// bytes 2 hex 2 string function b2h2s(array, n) { // bytes 2 hex 2 string
function b2h2s(array, n) {
var result = ''; var result = '';
for (var i = 0, l = n ? n: 100; i < l; ++i) { for (var i = 0, l = n ? n: 100; i < l; ++i) {
result += ('0' + (array[i] & 0xFF).toString(16)).slice(-2); result += ('0' + (array[i] & 0xFF).toString(16)).slice(-2);
} }
// hex 2 string // hex 2 string
// TODO improve, no need to iterate twice, read fromCharCode in first iteration
// TODO extract facebookID from previous_winners packet // TODO extract facebookID from previous_winners packet
var string = ''; var string = '';
for (var i = 0; i < result.length; i += 2) { for (var i = 0; i < result.length; i += 2) {
@ -33,6 +33,7 @@ Java.perform(function() {
}); });
/* /*
{"status":"Success","gameState":"Waiting To Show Question","questionIndex":0,"gameID":"5b575b2bd3bff {"status":"Success","gameState":"Waiting To Show Question","questionIndex":0,"gameID":"5b575b2bd3bff
****************************** ******************************