aboutsummaryrefslogtreecommitdiffstats
path: root/build/server.js
diff options
context:
space:
mode:
authorAustin Riddell <53499821+aus-tin@users.noreply.github.com>2020-05-19 10:37:35 -0500
committerGitHub <noreply@github.com>2020-05-19 18:37:35 +0300
commitd88e6d0f80211b2ace5595af9931b997eb4c6bc4 (patch)
tree12d9a63b404c1af3e6cec9a6c19d91d55473c81f /build/server.js
parent9168f9d5a8a6333e45309fdeabb2f71a368a5fce (diff)
Major frontend redesign (#5)
* Major frontend redesign * Some improvements Co-authored-by: RblSb <msrblsb@gmail.com>
Diffstat (limited to 'build/server.js')
-rw-r--r--build/server.js736
1 files changed, 312 insertions, 424 deletions
diff --git a/build/server.js b/build/server.js
index b187a5e..7a67b9d 100644
--- a/build/server.js
+++ b/build/server.js
@@ -1,4 +1,4 @@
-// Generated by Haxe 4.0.5
+// Generated by Haxe 4.1.0+9cbc59342
(function ($global) { "use strict";
var $estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_;
function $extend(from, fields) {
@@ -141,7 +141,7 @@ DateTools.__format_get = function(d,e) {
case "y":
return StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
default:
- throw new js__$Boot_HaxeError("Date.format %" + e + "- not implemented yet.");
+ throw haxe_Exception.thrown("Date.format %" + e + "- not implemented yet.");
}
};
DateTools.__format = function(d,f) {
@@ -157,8 +157,8 @@ DateTools.__format = function(d,f) {
r_b += Std.string(DateTools.__format_get(d,HxOverrides.substr(f,np + 1,1)));
p = np + 2;
}
- var len1 = f.length - p;
- r_b += len1 == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len1);
+ var len = f.length - p;
+ r_b += len == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len);
return r_b;
};
DateTools.format = function(d,f) {
@@ -181,12 +181,12 @@ EReg.prototype = {
if(this.r.m != null && n >= 0 && n < this.r.m.length) {
return this.r.m[n];
} else {
- throw new js__$Boot_HaxeError("EReg::matched");
+ throw haxe_Exception.thrown("EReg::matched");
}
}
,matchedPos: function() {
if(this.r.m == null) {
- throw new js__$Boot_HaxeError("No string matched");
+ throw haxe_Exception.thrown("No string matched");
}
return { pos : this.r.m.index, len : this.r.m[0].length};
}
@@ -203,12 +203,12 @@ EReg.prototype = {
}
return b;
} else {
- var b1 = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len));
- if(b1) {
+ var b = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len));
+ if(b) {
this.r.s = s;
this.r.m.index += pos;
}
- return b1;
+ return b;
}
}
,map: function(s,f) {
@@ -271,12 +271,8 @@ HxOverrides.remove = function(a,obj) {
a.splice(i,1);
return true;
};
-HxOverrides.iter = function(a) {
- return { cur : 0, arr : a, hasNext : function() {
- return this.cur < this.arr.length;
- }, next : function() {
- return this.arr[this.cur++];
- }};
+HxOverrides.now = function() {
+ return Date.now();
};
var json2object_reader_BaseParser = function(errors,putils,errorType) {
this.errors = errors;
@@ -293,13 +289,13 @@ json2object_reader_BaseParser.prototype = {
this.errors = [];
try {
this.loadJson(new hxjsonast_Parser(jsonString,filename).parseRec());
- } catch( e ) {
- var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e;
- if(((e1) instanceof hxjsonast_Error)) {
- var e2 = e1;
- this.errors.push(json2object_Error.ParserError(e2.message,this.putils.convertPosition(e2.pos)));
+ } catch( _g ) {
+ var _g1 = haxe_Exception.caught(_g).unwrap();
+ if(((_g1) instanceof hxjsonast_Error)) {
+ var e = _g1;
+ this.errors.push(json2object_Error.ParserError(e.message,this.putils.convertPosition(e.pos)));
} else {
- throw e;
+ throw _g;
}
}
return this.value;
@@ -376,16 +372,16 @@ json2object_reader_BaseParser.prototype = {
var tmp;
try {
tmp = loadJsonFn(j,variable);
- } catch( e ) {
- var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e;
- if(js_Boot.__instanceof(e1,json2object_InternalError)) {
- var e2 = e1;
- if(e2 != json2object_InternalError.ParsingThrow) {
- throw new js__$Boot_HaxeError(e2);
+ } catch( _g2 ) {
+ var _g3 = haxe_Exception.caught(_g2).unwrap();
+ if(js_Boot.__instanceof(_g3,json2object_InternalError)) {
+ var e = _g3;
+ if(e != json2object_InternalError.ParsingThrow) {
+ throw haxe_Exception.thrown(e);
}
continue;
} else {
- throw e;
+ throw _g2;
}
}
_g.push(tmp);
@@ -400,15 +396,15 @@ json2object_reader_BaseParser.prototype = {
var ret = loadJsonFn(field.value,field.name);
this.mapSet(assigned,name,true);
return ret;
- } catch( e ) {
- var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e;
- if(js_Boot.__instanceof(e1,json2object_InternalError)) {
- var e2 = e1;
- if(e2 != json2object_InternalError.ParsingThrow) {
- throw new js__$Boot_HaxeError(e2);
+ } catch( _g ) {
+ var _g1 = haxe_Exception.caught(_g).unwrap();
+ if(js_Boot.__instanceof(_g1,json2object_InternalError)) {
+ var e = _g1;
+ if(e != json2object_InternalError.ParsingThrow) {
+ throw haxe_Exception.thrown(e);
}
} else {
- this.errors.push(json2object_Error.CustomFunctionException(e1,pos));
+ this.errors.push(json2object_Error.CustomFunctionException(_g1,pos));
}
}
return defaultValue;
@@ -423,10 +419,10 @@ json2object_reader_BaseParser.prototype = {
}
,objectErrors: function(assigned,pos) {
var lastPos = this.putils.convertPosition(new hxjsonast_Position(pos.file,pos.max - 1,pos.max - 1));
- var s = assigned.keys();
+ var s = haxe_ds_StringMap.keysIterator(assigned.h);
while(s.hasNext()) {
var s1 = s.next();
- if(!(__map_reserved[s1] != null ? assigned.getReserved(s1) : assigned.h[s1])) {
+ if(!assigned.h[s1]) {
this.errors.push(json2object_Error.UninitializedVariable(s1,lastPos));
}
}
@@ -436,23 +432,19 @@ json2object_reader_BaseParser.prototype = {
}
,parsingThrow: function() {
if(this.errorType != 0) {
- throw new js__$Boot_HaxeError(json2object_InternalError.ParsingThrow);
+ throw haxe_Exception.thrown(json2object_InternalError.ParsingThrow);
}
}
,objectThrow: function(pos,variable) {
if(this.errorType == 2) {
- throw new js__$Boot_HaxeError(json2object_InternalError.ParsingThrow);
+ throw haxe_Exception.thrown(json2object_InternalError.ParsingThrow);
}
if(this.errorType == 1) {
this.errors.push(json2object_Error.UninitializedVariable(variable,pos));
}
}
,mapSet: function(map,key,value) {
- if(__map_reserved[key] != null) {
- map.setReserved(key,value);
- } else {
- map.h[key] = value;
- }
+ map.h[key] = value;
}
,__class__: json2object_reader_BaseParser
};
@@ -1885,50 +1877,23 @@ var haxe_IMap = function() { };
haxe_IMap.__name__ = true;
haxe_IMap.__isInterface__ = true;
var haxe_ds_StringMap = function() {
- this.h = { };
+ this.h = Object.create(null);
};
haxe_ds_StringMap.__name__ = true;
haxe_ds_StringMap.__interfaces__ = [haxe_IMap];
+haxe_ds_StringMap.keysIterator = function(h) {
+ var keys = Object.keys(h);
+ var len = keys.length;
+ var idx = 0;
+ return { hasNext : function() {
+ return idx < len;
+ }, next : function() {
+ idx += 1;
+ return keys[idx - 1];
+ }};
+};
haxe_ds_StringMap.prototype = {
- setReserved: function(key,value) {
- if(this.rh == null) {
- this.rh = { };
- }
- this.rh["$" + key] = value;
- }
- ,getReserved: function(key) {
- if(this.rh == null) {
- return null;
- } else {
- return this.rh["$" + key];
- }
- }
- ,existsReserved: function(key) {
- if(this.rh == null) {
- return false;
- }
- return this.rh.hasOwnProperty("$" + key);
- }
- ,keys: function() {
- return HxOverrides.iter(this.arrayKeys());
- }
- ,arrayKeys: function() {
- var out = [];
- for( var key in this.h ) {
- if(this.h.hasOwnProperty(key)) {
- out.push(key);
- }
- }
- if(this.rh != null) {
- for( var key in this.rh ) {
- if(key.charCodeAt(0) == 36) {
- out.push(key.substr(1));
- }
- }
- }
- return out;
- }
- ,__class__: haxe_ds_StringMap
+ __class__: haxe_ds_StringMap
};
var Lang = function() { };
Lang.__name__ = true;
@@ -1936,55 +1901,39 @@ Lang.request = function(path,callback) {
callback(js_node_Fs.readFileSync(path,{ encoding : "utf8"}));
};
Lang.init = function(folderPath,callback) {
- var _this = Lang.langs;
- _this.h = { };
- _this.rh = null;
+ Lang.langs.h = Object.create(null);
var count = 0;
var _g = 0;
var _g1 = Lang.ids;
while(_g < _g1.length) {
var name = [_g1[_g]];
++_g;
- Lang.request("" + folderPath + "/" + name[0] + ".json",(function(name1) {
+ Lang.request("" + folderPath + "/" + name[0] + ".json",(function(name) {
return function(data) {
var data1 = JSON.parse(data);
var lang = new haxe_ds_StringMap();
- var _g2 = 0;
- var _g11 = Reflect.fields(data1);
- while(_g2 < _g11.length) {
- var key = _g11[_g2];
- ++_g2;
- var v = Reflect.field(data1,key);
- if(__map_reserved[key] != null) {
- lang.setReserved(key,v);
- } else {
- lang.h[key] = v;
- }
- }
- var id = haxe_io_Path.withoutExtension(name1[0]);
- var _this1 = Lang.langs;
- if(__map_reserved[id] != null) {
- _this1.setReserved(id,lang);
- } else {
- _this1.h[id] = lang;
+ var _g = 0;
+ var _g1 = Reflect.fields(data1);
+ while(_g < _g1.length) {
+ var key = _g1[_g];
+ ++_g;
+ lang.h[key] = Reflect.field(data1,key);
}
+ var id = haxe_io_Path.withoutExtension(name[0]);
+ Lang.langs.h[id] = lang;
count += 1;
if(count == Lang.ids.length && callback != null) {
callback();
}
- return;
};
})(name));
}
};
Lang.get = function(lang,key) {
- var _this = Lang.langs;
- if((__map_reserved[lang] != null ? _this.getReserved(lang) : _this.h[lang]) == null) {
+ if(Lang.langs.h[lang] == null) {
lang = "en";
}
- var _this1 = Lang.langs;
- var _this2 = __map_reserved[lang] != null ? _this1.getReserved(lang) : _this1.h[lang];
- var text = __map_reserved[key] != null ? _this2.getReserved(key) : _this2.h[key];
+ var text = Lang.langs.h[lang].h[key];
if(text == null) {
return key;
} else {
@@ -1997,7 +1946,7 @@ Reflect.__name__ = true;
Reflect.field = function(o,field) {
try {
return o[field];
- } catch( e ) {
+ } catch( _g ) {
return null;
}
};
@@ -2026,7 +1975,8 @@ Std.parseInt = function(x) {
var i = _g++;
var c = x.charCodeAt(i);
if(c <= 8 || c >= 14 && c != 32 && c != 45) {
- var v = parseInt(x, (x[(i + 1)]=="x" || x[(i + 1)]=="X") ? 16 : 10);
+ var nc = x.charCodeAt(i + 1);
+ var v = parseInt(x,nc == 120 || nc == 88 ? 16 : 10);
if(isNaN(v)) {
return null;
} else {
@@ -2087,12 +2037,11 @@ StringTools.hex = function(n,digits) {
}
return s;
};
-var _$VideoList_VideoList_$Impl_$ = {};
-_$VideoList_VideoList_$Impl_$.__name__ = true;
-_$VideoList_VideoList_$Impl_$._new = function() {
+var VideoList = {};
+VideoList._new = function() {
return [];
};
-_$VideoList_VideoList_$Impl_$.findIndex = function(this1,f) {
+VideoList.findIndex = function(this1,f) {
var i = 0;
var _g = 0;
while(_g < this1.length) {
@@ -2103,14 +2052,14 @@ _$VideoList_VideoList_$Impl_$.findIndex = function(this1,f) {
}
return -1;
};
-_$VideoList_VideoList_$Impl_$.addItem = function(this1,item,atEnd,itemPos) {
+VideoList.addItem = function(this1,item,atEnd,itemPos) {
if(atEnd) {
this1.push(item);
} else {
this1.splice(itemPos + 1,0,item);
}
};
-_$VideoList_VideoList_$Impl_$.setNextItem = function(this1,pos,itemPos) {
+VideoList.setNextItem = function(this1,pos,itemPos) {
var next = this1[pos];
HxOverrides.remove(this1,next);
if(pos < itemPos) {
@@ -2119,10 +2068,10 @@ _$VideoList_VideoList_$Impl_$.setNextItem = function(this1,pos,itemPos) {
this1.splice(itemPos + 1,0,next);
return itemPos;
};
-_$VideoList_VideoList_$Impl_$.toggleItemType = function(this1,pos) {
+VideoList.toggleItemType = function(this1,pos) {
this1[pos].isTemp = !this1[pos].isTemp;
};
-_$VideoList_VideoList_$Impl_$.removeItem = function(this1,index,itemPos) {
+VideoList.removeItem = function(this1,index,itemPos) {
if(index < itemPos) {
--itemPos;
}
@@ -2132,7 +2081,7 @@ _$VideoList_VideoList_$Impl_$.removeItem = function(this1,index,itemPos) {
}
return itemPos;
};
-_$VideoList_VideoList_$Impl_$.skipItem = function(this1,itemPos) {
+VideoList.skipItem = function(this1,itemPos) {
var item = this1[itemPos];
if(!item.isTemp) {
++itemPos;
@@ -2144,7 +2093,7 @@ _$VideoList_VideoList_$Impl_$.skipItem = function(this1,itemPos) {
}
return itemPos;
};
-_$VideoList_VideoList_$Impl_$.itemsByUser = function(this1,client) {
+VideoList.itemsByUser = function(this1,client) {
var i = 0;
var _g = 0;
while(_g < this1.length) if(this1[_g++].author == client.name) {
@@ -2152,6 +2101,42 @@ _$VideoList_VideoList_$Impl_$.itemsByUser = function(this1,client) {
}
return i;
};
+var haxe_Exception = function(message,previous,native) {
+ Error.call(this,message);
+ this.message = message;
+ this.__previousException = previous;
+ this.__nativeException = native != null ? native : this;
+};
+haxe_Exception.__name__ = true;
+haxe_Exception.caught = function(value) {
+ if(((value) instanceof haxe_Exception)) {
+ return value;
+ } else if(((value) instanceof Error)) {
+ return new haxe_Exception(value.message,null,value);
+ } else {
+ return new haxe_ValueException(value,null,value);
+ }
+};
+haxe_Exception.thrown = function(value) {
+ if(((value) instanceof haxe_Exception)) {
+ return value.get_native();
+ } else if(((value) instanceof Error)) {
+ return value;
+ } else {
+ var e = new haxe_ValueException(value);
+ return e;
+ }
+};
+haxe_Exception.__super__ = Error;
+haxe_Exception.prototype = $extend(Error.prototype,{
+ unwrap: function() {
+ return this.__nativeException;
+ }
+ ,get_native: function() {
+ return this.__nativeException;
+ }
+ ,__class__: haxe_Exception
+});
var haxe_Log = function() { };
haxe_Log.__name__ = true;
haxe_Log.formatOutput = function(v,infos) {
@@ -2200,6 +2185,18 @@ haxe_Timer.prototype = {
}
,__class__: haxe_Timer
};
+var haxe_ValueException = function(value,previous,native) {
+ haxe_Exception.call(this,String(value),previous,native);
+ this.value = value;
+};
+haxe_ValueException.__name__ = true;
+haxe_ValueException.__super__ = haxe_Exception;
+haxe_ValueException.prototype = $extend(haxe_Exception.prototype,{
+ unwrap: function() {
+ return this.value;
+ }
+ ,__class__: haxe_ValueException
+});
var haxe_crypto_Sha256 = function() {
};
haxe_crypto_Sha256.__name__ = true;
@@ -2214,14 +2211,14 @@ haxe_crypto_Sha256.str2blks = function(s) {
var _g = 0;
var _g1 = nblk * 16;
while(_g < _g1) blks[_g++] = 0;
- var _g2 = 0;
- var _g3 = s1.length;
- while(_g2 < _g3) {
- var i = _g2++;
+ var _g = 0;
+ var _g1 = s1.length;
+ while(_g < _g1) {
+ var i = _g++;
blks[i >> 2] |= s1.b[i] << 24 - ((i & 3) << 3);
}
- var i1 = s1.length;
- blks[i1 >> 2] |= 128 << 24 - ((i1 & 3) << 3);
+ var i = s1.length;
+ blks[i >> 2] |= 128 << 24 - ((i & 3) << 3);
blks[nblk * 16 - 1] = s1.length * 8;
return blks;
};
@@ -2357,26 +2354,26 @@ haxe_io_Bytes.ofString = function(s,encoding) {
return new haxe_io_Bytes(buf.buffer);
}
var a = [];
- var i1 = 0;
- while(i1 < s.length) {
- var c1 = s.charCodeAt(i1++);
- if(55296 <= c1 && c1 <= 56319) {
- c1 = c1 - 55232 << 10 | s.charCodeAt(i1++) & 1023;
+ var i = 0;
+ while(i < s.length) {
+ var c = s.charCodeAt(i++);
+ if(55296 <= c && c <= 56319) {
+ c = c - 55232 << 10 | s.charCodeAt(i++) & 1023;
}
- if(c1 <= 127) {
- a.push(c1);
- } else if(c1 <= 2047) {
- a.push(192 | c1 >> 6);
- a.push(128 | c1 & 63);
- } else if(c1 <= 65535) {
- a.push(224 | c1 >> 12);
- a.push(128 | c1 >> 6 & 63);
- a.push(128 | c1 & 63);
+ if(c <= 127) {
+ a.push(c);
+ } else if(c <= 2047) {
+ a.push(192 | c >> 6);
+ a.push(128 | c & 63);
+ } else if(c <= 65535) {
+ a.push(224 | c >> 12);
+ a.push(128 | c >> 6 & 63);
+ a.push(128 | c & 63);
} else {
- a.push(240 | c1 >> 18);
- a.push(128 | c1 >> 12 & 63);
- a.push(128 | c1 >> 6 & 63);
- a.push(128 | c1 & 63);
+ a.push(240 | c >> 18);
+ a.push(128 | c >> 12 & 63);
+ a.push(128 | c >> 6 & 63);
+ a.push(128 | c & 63);
}
}
return new haxe_io_Bytes(new Uint8Array(a).buffer);
@@ -2453,6 +2450,20 @@ haxe_io_Path.prototype = {
}
,__class__: haxe_io_Path
};
+var haxe_iterators_ArrayIterator = function(array) {
+ this.current = 0;
+ this.array = array;
+};
+haxe_iterators_ArrayIterator.__name__ = true;
+haxe_iterators_ArrayIterator.prototype = {
+ hasNext: function() {
+ return this.current < this.array.length;
+ }
+ ,next: function() {
+ return this.array[this.current++];
+ }
+ ,__class__: haxe_iterators_ArrayIterator
+};
var hxjsonast_Error = function(message,pos) {
this.message = message;
this.pos = pos;
@@ -2617,7 +2628,7 @@ hxjsonast_Parser.prototype = {
return new hxjsonast_Json(hxjsonast_JsonValue.JBool(true),new hxjsonast_Position(this.filename,save3 - 1,this.pos));
case 123:
var fields = [];
- var names = new haxe_ds_StringMap();
+ var names_h = Object.create(null);
var field = null;
var fieldPos = null;
var comma1 = null;
@@ -2632,12 +2643,10 @@ hxjsonast_Parser.prototype = {
var fieldStartPos = this.pos - 1;
field = this.parseString();
fieldPos = new hxjsonast_Position(this.filename,fieldStartPos,this.pos);
- if(__map_reserved[field] != null ? names.existsReserved(field) : names.h.hasOwnProperty(field)) {
- throw new js__$Boot_HaxeError(new hxjsonast_Error("Duplicate field name \"" + field + "\"",fieldPos));
- } else if(__map_reserved[field] != null) {
- names.setReserved(field,true);
+ if(Object.prototype.hasOwnProperty.call(names_h,field)) {
+ throw haxe_Exception.thrown(new hxjsonast_Error("Duplicate field name \"" + field + "\"",fieldPos));
} else {
- names.h[field] = true;
+ names_h[field] = true;
}
break;
case 44:
@@ -2711,29 +2720,29 @@ hxjsonast_Parser.prototype = {
buf.b += String.fromCodePoint(uc);
break;
default:
- throw new js__$Boot_HaxeError(new hxjsonast_Error("Invalid escape sequence \\" + String.fromCodePoint(c),new hxjsonast_Position(this.filename,this.pos - 2,this.pos)));
+ throw haxe_Exception.thrown(new hxjsonast_Error("Invalid escape sequence \\" + String.fromCodePoint(c),new hxjsonast_Position(this.filename,this.pos - 2,this.pos)));
}
start = this.pos;
} else if(c != c) {
this.pos--;
- throw new js__$Boot_HaxeError(new hxjsonast_Error("Unclosed string",new hxjsonast_Position(this.filename,start - 1,this.pos)));
+ throw haxe_Exception.thrown(new hxjsonast_Error("Unclosed string",new hxjsonast_Position(this.filename,start - 1,this.pos)));
}
}
if(buf == null) {
return HxOverrides.substr(this.source,start,this.pos - start - 1);
} else {
- var s1 = this.source;
- var len1 = this.pos - start - 1;
- buf.b += len1 == null ? HxOverrides.substr(s1,start,null) : HxOverrides.substr(s1,start,len1);
+ var s = this.source;
+ var len = this.pos - start - 1;
+ buf.b += len == null ? HxOverrides.substr(s,start,null) : HxOverrides.substr(s,start,len);
return buf.b;
}
}
,invalidChar: function() {
this.pos--;
- throw new js__$Boot_HaxeError(new hxjsonast_Error("Invalid character: " + this.source.charAt(this.pos),new hxjsonast_Position(this.filename,this.pos,this.pos + 1)));
+ throw haxe_Exception.thrown(new hxjsonast_Error("Invalid character: " + this.source.charAt(this.pos),new hxjsonast_Position(this.filename,this.pos,this.pos + 1)));
}
,invalidNumber: function(start) {
- throw new js__$Boot_HaxeError(new hxjsonast_Error("Invalid number: " + this.source.substring(start,this.pos),new hxjsonast_Position(this.filename,start,this.pos)));
+ throw haxe_Exception.thrown(new hxjsonast_Error("Invalid number: " + this.source.substring(start,this.pos),new hxjsonast_Position(this.filename,start,this.pos)));
}
,__class__: hxjsonast_Parser
};
@@ -2746,18 +2755,6 @@ hxjsonast_Position.__name__ = true;
hxjsonast_Position.prototype = {
__class__: hxjsonast_Position
};
-var js__$Boot_HaxeError = function(val) {
- Error.call(this);
- this.val = val;
- if(Error.captureStackTrace) {
- Error.captureStackTrace(this,js__$Boot_HaxeError);
- }
-};
-js__$Boot_HaxeError.__name__ = true;
-js__$Boot_HaxeError.__super__ = Error;
-js__$Boot_HaxeError.prototype = $extend(Error.prototype,{
- __class__: js__$Boot_HaxeError
-});
var js_Boot = function() { };
js_Boot.__name__ = true;
js_Boot.getClass = function(o) {
@@ -2823,10 +2820,10 @@ js_Boot.__string_rec = function(o,s) {
if(((o) instanceof Array)) {
var str = "[";
s += "\t";
- var _g3 = 0;
- var _g11 = o.length;
- while(_g3 < _g11) {
- var i = _g3++;
+ var _g = 0;
+ var _g1 = o.length;
+ while(_g < _g1) {
+ var i = _g++;
str += (i > 0 ? "," : "") + js_Boot.__string_rec(o[i],s);
}
str += "]";
@@ -2835,8 +2832,7 @@ js_Boot.__string_rec = function(o,s) {
var tostr;
try {
tostr = o.toString;
- } catch( e1 ) {
- var e2 = ((e1) instanceof js__$Boot_HaxeError) ? e1.val : e1;
+ } catch( _g ) {
return "???";
}
if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
@@ -2845,7 +2841,7 @@ js_Boot.__string_rec = function(o,s) {
return s2;
}
}
- var str1 = "{\n";
+ var str = "{\n";
s += "\t";
var hasp = o.hasOwnProperty != null;
var k = null;
@@ -2856,14 +2852,14 @@ js_Boot.__string_rec = function(o,s) {
if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
continue;
}
- if(str1.length != 2) {
- str1 += ", \n";
+ if(str.length != 2) {
+ str += ", \n";
}
- str1 += s + k + " : " + js_Boot.__string_rec(o[k],s);
+ str += s + k + " : " + js_Boot.__string_rec(o[k],s);
}
s = s.substring(1);
- str1 += "\n" + s + "}";
- return str1;
+ str += "\n" + s + "}";
+ return str;
case "string":
return o;
default:
@@ -2871,24 +2867,26 @@ js_Boot.__string_rec = function(o,s) {
}
};
js_Boot.__interfLoop = function(cc,cl) {
- if(cc == null) {
- return false;
- }
- if(cc == cl) {
- return true;
- }
- if(Object.prototype.hasOwnProperty.call(cc,"__interfaces__")) {
+ while(true) {
+ if(cc == null) {
+ return false;
+ }
+ if(cc == cl) {
+ return true;
+ }
var intf = cc.__interfaces__;
- var _g = 0;
- var _g1 = intf.length;
- while(_g < _g1) {
- var i = intf[_g++];
- if(i == cl || js_Boot.__interfLoop(i,cl)) {
- return true;
+ if(intf != null) {
+ var _g = 0;
+ var _g1 = intf.length;
+ while(_g < _g1) {
+ var i = intf[_g++];
+ if(i == cl || js_Boot.__interfLoop(i,cl)) {
+ return true;
+ }
}
}
+ cc = cc.__super__;
}
- return js_Boot.__interfLoop(cc.__super__,cl);
};
js_Boot.__instanceof = function(o,cl) {
if(cl == null) {
@@ -3037,7 +3035,8 @@ json2object_ErrorUtils.convertError = function(e) {
case 5:
return header + ("Parser error: " + e.message);
case 6:
- return header + ("Custom function exception: " + Std.string(e.e));
+ var _g = e.e;
+ return header + ("Custom function exception: " + (_g == null ? "null" : Std.string(_g)));
}
};
json2object_ErrorUtils.convertErrorArray = function(e) {
@@ -3107,18 +3106,18 @@ json2object_PositionUtils.prototype = {
var _g = bounds_min;
var _g1 = this.linesInfo.length;
while(_g < _g1) {
- var line1 = this.linesInfo[_g++];
- if(line1.start <= min && line1.end >= max) {
- pos.lines.push({ number : line1.number + 1, start : min - line1.start + 1, end : max - line1.start + 1});
+ var line = this.linesInfo[_g++];
+ if(line.start <= min && line.end >= max) {
+ pos.lines.push({ number : line.number + 1, start : min - line.start + 1, end : max - line.start + 1});
break;
}
- if(line1.start <= min && min <= line1.end) {
- pos.lines.push({ number : line1.number + 1, start : min - line1.start + 1, end : line1.end + 1});
+ if(line.start <= min && min <= line.end) {
+ pos.lines.push({ number : line.number + 1, start : min - line.start + 1, end : line.end + 1});
}
- if(line1.start <= max && max <= line1.end) {
- pos.lines.push({ number : line1.number + 1, start : line1.start + 1, end : max - line1.start + 1});
+ if(line.start <= max && max <= line.end) {
+ pos.lines.push({ number : line.number + 1, start : line.start + 1, end : max - line.start + 1});
}
- if(line1.start >= max || line1.end >= max) {
+ if(line.start >= max || line.end >= max) {
break;
}
}
@@ -3139,13 +3138,11 @@ server_ConsoleInput.prototype = {
js_node_Readline.cursorTo(process.stdout,0,null);
console.log(msg);
rl.prompt(true);
- return;
};
rl.prompt();
rl.on("line",function(line) {
_gthis.parseLine(line);
rl.prompt();
- return;
});
}
,parseLine: function(line) {
@@ -3188,22 +3185,15 @@ server_HttpServer.serveFiles = function(req,res) {
url = "/index.html";
}
var filePath = server_HttpServer.dir + url;
- var tmp;
- if(!(server_HttpServer.allowLocalRequests && req.connection.remoteAddress == req.connection.localAddress)) {
- var _this = server_HttpServer.allowedLocalFiles;
- tmp = __map_reserved[url] != null ? _this.getReserved(url) : _this.h[url];
- } else {
- tmp = true;
- }
- if(tmp) {
+ if(server_HttpServer.allowLocalRequests && req.connection.remoteAddress == req.connection.localAddress || server_HttpServer.allowedLocalFiles.h[url]) {
if(server_HttpServer.serveLocalFile(res,url)) {
return;
}
}
if(!server_HttpServer.isChildOf(server_HttpServer.dir,filePath)) {
res.statusCode = 500;
- var tmp1 = "Error getting the file: No access to " + js_node_Path.relative(server_HttpServer.dir,filePath) + ".";
- res.end(tmp1);
+ var rel = js_node_Path.relative(server_HttpServer.dir,filePath);
+ res.end("Error getting the file: No access to " + rel + ".");
return;
}
if(StringTools.startsWith(url,"/proxy")) {
@@ -3227,13 +3217,11 @@ server_HttpServer.serveFiles = function(req,res) {
return;
}
var ext = haxe_io_Path.extension(filePath).toLowerCase();
- var tmp2 = server_HttpServer.getMimeType(ext);
- res.setHeader("Content-Type",tmp2);
+ res.setHeader("Content-Type",server_HttpServer.getMimeType(ext));
if(ext == "html") {
data = server_HttpServer.localizeHtml(data.toString(),req.headers["accept-language"]);
}
res.end(data);
- return;
});
};
server_HttpServer.readFileError = function(err,res,filePath) {
@@ -3253,21 +3241,14 @@ server_HttpServer.serveLocalFile = function(res,filePath) {
if(!js_node_Fs.existsSync(filePath)) {
return false;
}
- var _this = server_HttpServer.allowedLocalFiles;
- if(__map_reserved[filePath] != null) {
- _this.setReserved(filePath,true);
- } else {
- _this.h[filePath] = true;
- }
+ server_HttpServer.allowedLocalFiles.h[filePath] = true;
js_node_Fs.readFile(filePath,function(err,data) {
if(err != null) {
server_HttpServer.readFileError(err,res,filePath);
return;
}
- var tmp = server_HttpServer.getMimeType(ext);
- res.setHeader("Content-Type",tmp);
+ res.setHeader("Content-Type",server_HttpServer.getMimeType(ext));
res.end(data);
- return;
});
return true;
};
@@ -3289,15 +3270,12 @@ server_HttpServer.proxyUrl = function(req,res) {
if(url1.host == req.headers["host"]) {
return false;
}
- var url2 = url1.host;
- var options = Std.parseInt(url1.port);
- var proxy = (url1.protocol == "https:" ? js_node_Https.request : js_node_Http.request)({ host : url2, port : options, path : url1.pathname + url1.search, method : req.method},function(proxyRes) {
+ var proxy = (url1.protocol == "https:" ? js_node_Https.request : js_node_Http.request)({ host : url1.host, port : Std.parseInt(url1.port), path : url1.pathname + url1.search, method : req.method},function(proxyRes) {
res.writeHead(proxyRes.statusCode,proxyRes.headers);
- return proxyRes.pipe(res,{ end : true});
+ proxyRes.pipe(res,{ end : true});
});
proxy.on("error",function(err) {
res.end("Proxy error for " + url1.href);
- return;
});
req.pipe(proxy,{ end : true});
return true;
@@ -3311,8 +3289,7 @@ server_HttpServer.isChildOf = function(parent,child) {
}
};
server_HttpServer.getMimeType = function(ext) {
- var _this = server_HttpServer.mimeTypes;
- var contentType = __map_reserved[ext] != null ? _this.getReserved(ext) : _this.h[ext];
+ var contentType = server_HttpServer.mimeTypes.h[ext];
if(contentType == null) {
return "application/octet-stream";
}
@@ -3325,7 +3302,7 @@ var server_Main = function() {
this.isPlaylistOpen = true;
this.messages = [];
this.videoTimer = new server_VideoTimer();
- this.videoList = _$VideoList_VideoList_$Impl_$._new();
+ this.videoList = VideoList._new();
this.wsEventParser = new JsonParser_$1();
this.freeIds = [];
this.clients = [];
@@ -3340,12 +3317,10 @@ var server_Main = function() {
process.on("uncaughtException",function(err) {
_gthis.logError("uncaughtException",{ message : err.message, stack : err.stack});
_gthis.exit();
- return;
});
process.on("unhandledRejection",function(reason,promise) {
_gthis.logError("unhandledRejection",reason);
_gthis.exit();
- return;
});
this.consoleInput = new server_ConsoleInput(this);
this.consoleInput.initConsoleInput();
@@ -3365,17 +3340,15 @@ var server_Main = function() {
_gthis.globalIp = ip;
haxe_Log.trace("Local: http://" + _gthis.localIp + ":" + _gthis.port,{ fileName : "src/server/Main.hx", lineNumber : 85, className : "server.Main", methodName : "new"});
haxe_Log.trace("Global: http://" + _gthis.globalIp + ":" + _gthis.port,{ fileName : "src/server/Main.hx", lineNumber : 86, className : "server.Main", methodName : "new"});
- return;
});
var dir = "" + this.rootDir + "/res";
server_HttpServer.init(dir,"" + this.rootDir + "/user/res",this.config.localAdmins);
Lang.init("" + dir + "/langs");
- var server1 = js_node_Http.createServer(function(req,res) {
+ var server = js_node_Http.createServer(function(req,res) {
server_HttpServer.serveFiles(req,res);
- return;
});
- server1.listen(this.port);
- this.wss = new js_npm_ws_Server({ server : server1});
+ server.listen(this.port);
+ this.wss = new js_npm_ws_Server({ server : server});
this.wss.on("connection",$bind(this,this.onConnect));
};
server_Main.__name__ = true;
@@ -3391,7 +3364,6 @@ server_Main.prototype = {
}
this.wss.close(function() {
process.exit();
- return;
});
}
,generateConfigSalt: function() {
@@ -3421,8 +3393,8 @@ server_Main.prototype = {
}
HxOverrides.remove(group,type);
var _g2 = 0;
- var _g11 = Reflect.field(config.permissions,type);
- while(_g2 < _g11.length) group.push(_g11[_g2++]);
+ var _g3 = Reflect.field(config.permissions,type);
+ while(_g2 < _g3.length) group.push(_g3[_g2++]);
}
}
return config;
@@ -3444,35 +3416,23 @@ server_Main.prototype = {
}
config[field] = Reflect.field(customConfig,field);
}
- var emoteCopies = new haxe_ds_StringMap();
- var _g2 = 0;
- var _g3 = config.emotes;
- while(_g2 < _g3.length) {
- var emote = _g3[_g2];
- ++_g2;
- var key = emote.name;
- if(__map_reserved[key] != null ? emoteCopies.getReserved(key) : emoteCopies.h[key]) {
+ var emoteCopies_h = Object.create(null);
+ var _g = 0;
+ var _g1 = config.emotes;
+ while(_g < _g1.length) {
+ var emote = _g1[_g];
+ ++_g;
+ if(emoteCopies_h[emote.name]) {
haxe_Log.trace("Warning: emote name \"" + emote.name + "\" has copy",{ fileName : "src/server/Main.hx", lineNumber : 145, className : "server.Main", methodName : "getUserConfig"});
}
- var k = emote.name;
- if(__map_reserved[k] != null) {
- emoteCopies.setReserved(k,true);
- } else {
- emoteCopies.h[k] = true;
- }
+ emoteCopies_h[emote.name] = true;
if(!this.verbose) {
continue;
}
- var key1 = emote.image;
- if(__map_reserved[key1] != null ? emoteCopies.getReserved(key1) : emoteCopies.h[key1]) {
+ if(emoteCopies_h[emote.image]) {
haxe_Log.trace("Warning: emote url of name \"" + emote.name + "\" has copy",{ fileName : "src/server/Main.hx", lineNumber : 148, className : "server.Main", methodName : "getUserConfig"});
}
- var k1 = emote.image;
- if(__map_reserved[k1] != null) {
- emoteCopies.setReserved(k1,true);
- } else {
- emoteCopies.h[k1] = true;
- }
+ emoteCopies_h[emote.image] = true;
}
return config;
}
@@ -3508,9 +3468,9 @@ server_Main.prototype = {
while(_g < _g1.length) this.videoList.push(_g1[_g++]);
this.isPlaylistOpen = data.isPlaylistOpen;
this.itemPos = data.itemPos;
- var _g2 = 0;
- var _g3 = data.messages;
- while(_g2 < _g3.length) this.messages.push(_g3[_g2++]);
+ var _g = 0;
+ var _g1 = data.messages;
+ while(_g < _g1.length) this.messages.push(_g1[_g++]);
this.videoTimer.start();
this.videoTimer.setTime(data.timer.time);
this.videoTimer.pause();
@@ -3536,7 +3496,6 @@ server_Main.prototype = {
}
haxe_Log.trace("Ping " + url,{ fileName : "src/server/Main.hx", lineNumber : 218, className : "server.Main", methodName : "initIntergationHandlers"});
js_node_Http.get(url,null,function(r) {
- return;
});
};
}
@@ -3565,14 +3524,15 @@ server_Main.prototype = {
this.videoTimer.play();
}
}
+ var client1 = client;
var tmp = this.config;
var tmp1 = this.messages;
- var client1 = client.name;
+ var client2 = client.name;
var _g = [];
var _g1 = 0;
var _g2 = this.clients;
while(_g1 < _g2.length) _g.push(_g2[_g1++].getData());
- this.send(client,{ type : "Connected", connected : { config : tmp, history : tmp1, isUnknownClient : true, clientName : client1, clients : _g, videoList : this.videoList, isPlaylistOpen : this.isPlaylistOpen, itemPos : this.itemPos, globalIp : this.globalIp}});
+ this.send(client1,{ type : "Connected", connected : { config : tmp, history : tmp1, isUnknownClient : true, clientName : client2, clients : _g, videoList : this.videoList, isPlaylistOpen : this.isPlaylistOpen, itemPos : this.itemPos, globalIp : this.globalIp}});
this.sendClientList();
ws.on("message",function(data) {
var obj = _gthis.wsEventParser.fromJson(data);
@@ -3583,7 +3543,6 @@ server_Main.prototype = {
return;
}
_gthis.onMessage(client,obj);
- return;
});
ws.on("close",function(err) {
haxe_Log.trace("Client " + client.name + " disconnected",{ fileName : "src/server/Main.hx", lineNumber : 279, className : "server.Main", methodName : "onConnect"});
@@ -3601,7 +3560,6 @@ server_Main.prototype = {
}
_gthis.videoTimer.pause();
}
- return;
});
}
,onMessage: function(client,data) {
@@ -3620,7 +3578,7 @@ server_Main.prototype = {
this.serverMessage(client,"totalVideoLimitError");
return;
}
- if(this.config.userVideoLimit != 0 && _$VideoList_VideoList_$Impl_$.itemsByUser(this.videoList,client) >= this.config.userVideoLimit) {
+ if(this.config.userVideoLimit != 0 && VideoList.itemsByUser(this.videoList,client) >= this.config.userVideoLimit) {
this.serverMessage(client,"videoLimitPerUserError");
return;
}
@@ -3636,7 +3594,7 @@ server_Main.prototype = {
this.serverMessage(client,"videoAlreadyExistsError");
return;
}
- _$VideoList_VideoList_$Impl_$.addItem(this.videoList,item,data.addVideo.atEnd,this.itemPos);
+ VideoList.addItem(this.videoList,item,data.addVideo.atEnd,this.itemPos);
this.broadcast(data);
if(this.videoList.length == 1) {
this.restartWaitTimer();
@@ -3674,7 +3632,6 @@ server_Main.prototype = {
return;
}
_gthis.onMessage(client,{ type : "SkipVideo", skipVideo : { url : _gthis.videoList[_gthis.itemPos].url}});
- return;
},1000);
return;
}
@@ -3706,9 +3663,9 @@ server_Main.prototype = {
this.send(client,{ type : "PasswordRequest"});
return;
}
- } else if(Lambda.exists(this.userList.admins,function(a1) {
- if(a1.name == name) {
- return a1.hash == hash;
+ } else if(Lambda.exists(this.userList.admins,function(a) {
+ if(a.name == name) {
+ return a.hash == hash;
} else {
return false;
}
@@ -3721,23 +3678,16 @@ server_Main.prototype = {
}
client.name = name;
client.setGroupFlag(ClientGroup.User,true);
- var data1 = data.type;
- var client1 = client.name;
- var tmp = this.clientList();
- this.send(client,{ type : data1, login : { isUnknownClient : true, clientName : client1, clients : tmp}});
+ this.send(client,{ type : data.type, login : { isUnknownClient : true, clientName : client.name, clients : this.clientList()}});
this.sendClientList();
break;
case "LoginError":
break;
case "Logout":
var oldName = client.name;
- var id = this.clients.indexOf(client) + 1;
- client.name = "Guest " + id;
+ client.name = "Guest " + (this.clients.indexOf(client) + 1);
client.setGroupFlag(ClientGroup.User,false);
- var data2 = data.type;
- var client2 = client.name;
- var tmp1 = this.clientList();
- this.send(client,{ type : data2, logout : { oldClientName : oldName, clientName : client2, clients : tmp1}});
+ this.send(client,{ type : data.type, logout : { oldClientName : oldName, clientName : client.name, clients : this.clientList()}});
this.sendClientList();
break;
case "Message":
@@ -3753,7 +3703,7 @@ server_Main.prototype = {
}
data.message.text = text;
data.message.clientName = client.name;
- var time = "[" + HxOverrides.dateStr(new Date()).split(" ")[1] + "] ";
+ var time = HxOverrides.dateStr(new Date()).split(" ")[1];
this.messages.push({ text : text, name : client.name, time : time});
if(this.messages.length > this.config.serverChatHistory) {
this.messages.shift();
@@ -3766,7 +3716,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if((client.group & 2) == 0) {
+ if(!((client.group & 2) != 0)) {
return;
}
this.videoTimer.setTime(data.pause.time);
@@ -3777,7 +3727,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if((client.group & 2) == 0) {
+ if(!((client.group & 2) != 0)) {
return;
}
this.videoTimer.setTime(data.play.time);
@@ -3800,14 +3750,14 @@ server_Main.prototype = {
return;
}
var url = data.removeVideo.url;
- var index = _$VideoList_VideoList_$Impl_$.findIndex(this.videoList,function(item1) {
- return item1.url == url;
+ var index = VideoList.findIndex(this.videoList,function(item) {
+ return item.url == url;
});
if(index == -1) {
return;
}
var isCurrent = this.videoList[this.itemPos].url == url;
- this.itemPos = _$VideoList_VideoList_$Impl_$.removeItem(this.videoList,index,this.itemPos);
+ this.itemPos = VideoList.removeItem(this.videoList,index,this.itemPos);
if(isCurrent && this.videoList.length > 0) {
this.broadcast(data);
this.restartWaitTimer();
@@ -3837,7 +3787,7 @@ server_Main.prototype = {
if(!this.checkPermission(client,"requestLeader")) {
return;
}
- } else if((client.group & 2) == 0 && clientName != "") {
+ } else if(!((client.group & 2) != 0) && clientName != "") {
if(!this.checkPermission(client,"setLeader")) {
return;
}
@@ -3863,14 +3813,14 @@ server_Main.prototype = {
if(pos == this.itemPos || pos == this.itemPos + 1) {
return;
}
- this.itemPos = _$VideoList_VideoList_$Impl_$.setNextItem(this.videoList,pos,this.itemPos);
+ this.itemPos = VideoList.setNextItem(this.videoList,pos,this.itemPos);
this.broadcast(data);
break;
case "SetRate":
if(this.videoList.length == 0) {
return;
}
- if((client.group & 2) == 0) {
+ if(!((client.group & 2) != 0)) {
return;
}
this.videoTimer.setRate(data.setRate.rate);
@@ -3880,7 +3830,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if((client.group & 2) == 0) {
+ if(!((client.group & 2) != 0)) {
return;
}
this.videoTimer.setTime(data.setTime.time);
@@ -3909,14 +3859,14 @@ server_Main.prototype = {
if(this.videoList[this.itemPos].url != data.skipVideo.url) {
return;
}
- this.itemPos = _$VideoList_VideoList_$Impl_$.skipItem(this.videoList,this.itemPos);
+ this.itemPos = VideoList.skipItem(this.videoList,this.itemPos);
if(this.videoList.length > 0) {
this.restartWaitTimer();
}
this.broadcast(data);
break;
case "ToggleItemType":
- _$VideoList_VideoList_$Impl_$.toggleItemType(this.videoList,data.toggleItemType.pos);
+ VideoList.toggleItemType(this.videoList,data.toggleItemType.pos);
this.broadcast(data);
break;
case "TogglePlaylistLock":
@@ -4038,16 +3988,13 @@ server_Utils.getGlobalIp = function(callback) {
var data_b = "";
r.on("data",function(chunk) {
data_b += Std.string(chunk);
- return;
});
- return r.on("end",function(_) {
+ r.on("end",function(_) {
callback(data_b);
- return;
});
}).on("error",function(e) {
haxe_Log.trace("Warning: connection error, server is local.",{ fileName : "src/server/Utils.hx", lineNumber : 16, className : "server.Utils", methodName : "getGlobalIp"});
callback("127.0.0.1");
- return;
});
};
server_Utils.getLocalIp = function() {
@@ -4057,9 +4004,9 @@ server_Utils.getLocalIp = function() {
while(_g < _g1.length) {
var type = Reflect.field(ifaces,_g1[_g++]);
var _g2 = 0;
- var _g11 = Reflect.fields(type);
- while(_g2 < _g11.length) {
- var iface = Reflect.field(type,_g11[_g2++]);
+ var _g3 = Reflect.fields(type);
+ while(_g2 < _g3.length) {
+ var iface = Reflect.field(type,_g3[_g2++]);
if("IPv4" != iface.family || iface.internal != false) {
continue;
}
@@ -4102,9 +4049,11 @@ server_VideoTimer.__name__ = true;
server_VideoTimer.prototype = {
start: function() {
this.isStarted = true;
- this.startTime = Date.now() / 1000;
+ var hrtime = process.hrtime();
+ this.startTime = hrtime[0] + hrtime[1] / 1e9;
this.pauseStartTime = 0;
- this.rateStartTime = Date.now() / 1000;
+ var hrtime = process.hrtime();
+ this.rateStartTime = hrtime[0] + hrtime[1] / 1e9;
}
,stop: function() {
this.isStarted = false;
@@ -4113,7 +4062,8 @@ server_VideoTimer.prototype = {
}
,pause: function() {
this.startTime += this.rateTime() - this.rateTime() * this.rate;
- this.pauseStartTime = Date.now() / 1000;
+ var hrtime = process.hrtime();
+ this.pauseStartTime = hrtime[0] + hrtime[1] / 1e9;
this.rateStartTime = 0;
}
,play: function() {
@@ -4121,24 +4071,28 @@ server_VideoTimer.prototype = {
this.start();
}
this.startTime += this.pauseTime();
- this.rateStartTime = Date.now() / 1000;
+ var hrtime = process.hrtime();
+ this.rateStartTime = hrtime[0] + hrtime[1] / 1e9;
this.pauseStartTime = 0;
}
,getTime: function() {
if(this.startTime == 0) {
return 0;
}
- return Date.now() / 1000 - this.startTime - this.rateTime() + this.rateTime() * this.rate - this.pauseTime();
+ var hrtime = process.hrtime();
+ return hrtime[0] + hrtime[1] / 1e9 - this.startTime - this.rateTime() + this.rateTime() * this.rate - this.pauseTime();
}
,setTime: function(secs) {
- this.startTime = Date.now() / 1000 - secs;
- this.rateStartTime = Date.now() / 1000;
+ var hrtime = process.hrtime();
+ this.startTime = hrtime[0] + hrtime[1] / 1e9 - secs;
+ var hrtime = process.hrtime();
+ this.rateStartTime = hrtime[0] + hrtime[1] / 1e9;
if(this.isPaused()) {
this.pause();
}
}
,isPaused: function() {
- if(!(!this.isStarted)) {
+ if(this.isStarted) {
return this.pauseStartTime != 0;
} else {
return true;
@@ -4150,7 +4104,8 @@ server_VideoTimer.prototype = {
,setRate: function(rate) {
if(!this.isPaused()) {
this.startTime += this.rateTime() - this.rateTime() * this.rate;
- this.rateStartTime = Date.now() / 1000;
+ var hrtime = process.hrtime();
+ this.rateStartTime = hrtime[0] + hrtime[1] / 1e9;
}
this.rate = rate;
}
@@ -4158,13 +4113,15 @@ server_VideoTimer.prototype = {
if(this.pauseStartTime == 0) {
return 0;
}
- return Date.now() / 1000 - this.pauseStartTime;
+ var hrtime = process.hrtime();
+ return hrtime[0] + hrtime[1] / 1e9 - this.pauseStartTime;
}
,rateTime: function() {
if(this.rateStartTime == 0) {
return 0;
}
- return Date.now() / 1000 - this.rateStartTime - this.pauseTime();
+ var hrtime = process.hrtime();
+ return hrtime[0] + hrtime[1] / 1e9 - this.rateStartTime - this.pauseTime();
}
,__class__: server_VideoTimer
};
@@ -4174,42 +4131,44 @@ sys_FileSystem.exists = function(path) {
try {
js_node_Fs.accessSync(path);
return true;
- } catch( _ ) {
+ } catch( _g ) {
return false;
}
};
sys_FileSystem.isDirectory = function(path) {
try {
return js_node_Fs.statSync(path).isDirectory();
- } catch( e ) {
+ } catch( _g ) {
return false;
}
};
sys_FileSystem.createDirectory = function(path) {
try {
js_node_Fs.mkdirSync(path);
- } catch( e ) {
- var e1 = ((e) instanceof js__$Boot_HaxeError) ? e.val : e;
- if(e1.code == "ENOENT") {
+ } catch( _g ) {
+ var _g1 = haxe_Exception.caught(_g).unwrap();
+ if(_g1.code == "ENOENT") {
sys_FileSystem.createDirectory(js_node_Path.dirname(path));
js_node_Fs.mkdirSync(path);
} else {
var stat;
try {
stat = js_node_Fs.statSync(path);
- } catch( _ ) {
- throw e1;
+ } catch( _g ) {
+ throw _g1;
}
if(!stat.isDirectory()) {
- throw e1;
+ throw _g1;
}
}
}
};
-function $getIterator(o) { if( o instanceof Array ) return HxOverrides.iter(o); else return o.iterator(); }
+function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); }
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; }
$global.$haxeUID |= 0;
-var __map_reserved = {};
+if(typeof(performance) != "undefined" ? typeof(performance.now) == "function" : false) {
+ HxOverrides.now = performance.now.bind(performance);
+}
if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); }
String.prototype.__class__ = String;
String.__name__ = true;
@@ -4222,9 +4181,6 @@ var Float = Number;
var Bool = Boolean;
var Class = { };
var Enum = { };
-Object.defineProperty(js__$Boot_HaxeError.prototype,"message",{ get : function() {
- return String(this.val);
-}});
js_Boot.__toStr = ({ }).toString;
DateTools.DAY_SHORT_NAMES = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
DateTools.DAY_NAMES = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
@@ -4235,91 +4191,23 @@ Lang.ids = ["en","ru"];
server_HttpServer.mimeTypes = (function($this) {
var $r;
var _g = new haxe_ds_StringMap();
- if(__map_reserved["html"] != null) {
- _g.setReserved("html","text/html");
- } else {
- _g.h["html"] = "text/html";
- }
- if(__map_reserved["js"] != null) {
- _g.setReserved("js","text/javascript");
- } else {
- _g.h["js"] = "text/javascript";
- }
- if(__map_reserved["css"] != null) {
- _g.setReserved("css","text/css");
- } else {
- _g.h["css"] = "text/css";
- }
- if(__map_reserved["json"] != null) {
- _g.setReserved("json","application/json");
- } else {
- _g.h["json"] = "application/json";
- }
- if(__map_reserved["png"] != null) {
- _g.setReserved("png","image/png");
- } else {
- _g.h["png"] = "image/png";
- }
- if(__map_reserved["jpg"] != null) {
- _g.setReserved("jpg","image/jpg");
- } else {
- _g.h["jpg"] = "image/jpg";
- }
- if(__map_reserved["gif"] != null) {
- _g.setReserved("gif","image/gif");
- } else {
- _g.h["gif"] = "image/gif";
- }
- if(__map_reserved["svg"] != null) {
- _g.setReserved("svg","image/svg+xml");
- } else {
- _g.h["svg"] = "image/svg+xml";
- }
- if(__map_reserved["ico"] != null) {
- _g.setReserved("ico","image/x-icon");
- } else {
- _g.h["ico"] = "image/x-icon";
- }
- if(__map_reserved["wav"] != null) {
- _g.setReserved("wav","audio/wav");
- } else {
- _g.h["wav"] = "audio/wav";
- }
- if(__map_reserved["mp3"] != null) {
- _g.setReserved("mp3","audio/mpeg");
- } else {
- _g.h["mp3"] = "audio/mpeg";
- }
- if(__map_reserved["mp4"] != null) {
- _g.setReserved("mp4","video/mp4");
- } else {
- _g.h["mp4"] = "video/mp4";
- }
- if(__map_reserved["woff"] != null) {
- _g.setReserved("woff","application/font-woff");
- } else {
- _g.h["woff"] = "application/font-woff";
- }
- if(__map_reserved["ttf"] != null) {
- _g.setReserved("ttf","application/font-ttf");
- } else {
- _g.h["ttf"] = "application/font-ttf";
- }
- if(__map_reserved["eot"] != null) {
- _g.setReserved("eot","application/vnd.ms-fontobject");
- } else {
- _g.h["eot"] = "application/vnd.ms-fontobject";
- }
- if(__map_reserved["otf"] != null) {
- _g.setReserved("otf","application/font-otf");
- } else {
- _g.h["otf"] = "application/font-otf";
- }
- if(__map_reserved["wasm"] != null) {
- _g.setReserved("wasm","application/wasm");
- } else {
- _g.h["wasm"] = "application/wasm";
- }
+ _g.h["html"] = "text/html";
+ _g.h["js"] = "text/javascript";
+ _g.h["css"] = "text/css";
+ _g.h["json"] = "application/json";
+ _g.h["png"] = "image/png";
+ _g.h["jpg"] = "image/jpg";
+ _g.h["gif"] = "image/gif";
+ _g.h["svg"] = "image/svg+xml";
+ _g.h["ico"] = "image/x-icon";
+ _g.h["wav"] = "audio/wav";
+ _g.h["mp3"] = "audio/mpeg";
+ _g.h["mp4"] = "video/mp4";
+ _g.h["woff"] = "application/font-woff";
+ _g.h["ttf"] = "application/font-ttf";
+ _g.h["eot"] = "application/vnd.ms-fontobject";
+ _g.h["otf"] = "application/font-otf";
+ _g.h["wasm"] = "application/wasm";
$r = _g;
return $r;
}(this));
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage