mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
forgot to add the helper functions, still doesn't work
This commit is contained in:
parent
dccff4cc92
commit
74069f3f0f
@ -45,6 +45,19 @@ function NvHTTP(address, clientUid) {
|
||||
_self = this;
|
||||
};
|
||||
|
||||
function ab2str(buf) {
|
||||
return String.fromCharCode.apply(null, new Uint16Array(buf));
|
||||
}
|
||||
|
||||
function str2ab(str) {
|
||||
var buf = new ArrayBuffer(str.length*2); // 2 bytes for each char
|
||||
var bufView = new Uint16Array(buf);
|
||||
for (var i=0, strLen=str.length; i < strLen; i++) {
|
||||
bufView[i] = str.charCodeAt(i);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
NvHTTP.prototype = {
|
||||
refreshServerInfo: function () {
|
||||
return sendMessage('openUrl', [ _self._baseUrlHttps + '/serverinfo?' + _self._buildUidStr(), false]).then(function(ret) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user