\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{info.modName}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{info.region}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{info.numClients} / {info.numMaxClients}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\n\t\t\n\t
\n\n")], e)
}(s.Element);
e.ServerListRootTag = l
}, function(t, e, n) {
"use strict";
var i, o = this && this.__extends || (i = Object.setPrototypeOf || {
__proto__: []
}
instanceof Array && function(t, e) {
t.__proto__ = e
} || function(t, e) {
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n])
},
function(t, e) {
function n() {
this.constructor = t
}
i(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
}),
r = this && this.__decorate || function(t, e, n, i) {
var o, r = arguments.length,
s = r < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, n) : i;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, n, i);
else
for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, n, s) : o(e, n)) || s);
return r > 3 && s && Object.defineProperty(e, n, s), s
};
Object.defineProperty(e, "__esModule", {
value: !0
});
var s = n(5),
a = n(0),
l = n(4),
c = n(2),
h = function(t) {
function e() {
var e = null !== t && t.apply(this, arguments) || this;
return e.uconfig = a.gs.uconfig, e.userEntry = l.gameCore.userEntryMan, e.cssColors = a.gs.ucolors.cssColors, e.appConfig = c.AppConfigurator.instance, e
}
return o(e, t), Object.defineProperty(e.prototype, "isDualUi", {
get: function() {
return a.gs.gconfig.ShowDualSkinInputUi
},
enumerable: !0,
configurable: !0
}), e.prototype.mounted = function() {
this.userEntry.indexChangedProc = this.update.bind(this)
}, e.prototype.inputText = function(t) {
this.userEntry.SetProp(t.target.name, t.target.value)
}, e.prototype.startPlay = function() {
l.gameCore.StartPlay()
}, e.prototype.startSpectate = function() {
l.gameCore.StartSpectate()
}, r([s.template('\n
\n\t\n\t\n\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\tPLAY
\n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\tSPEC
\n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t\n\t\t
\n\t
\n \n')], e)
}(s.Element);
e.UserEntryPanelTag = h
}, function(t, e, n) {
"use strict";
var i, o = this && this.__extends || (i = Object.setPrototypeOf || {
__proto__: []
}
instanceof Array && function(t, e) {
t.__proto__ = e
} || function(t, e) {
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n])
},
function(t, e) {
function n() {
this.constructor = t
}
i(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
}),
r = this && this.__decorate || function(t, e, n, i) {
var o, r = arguments.length,
s = r < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, n) : i;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, n, i);
else
for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, n, s) : o(e, n)) || s);
return r > 3 && s && Object.defineProperty(e, n, s), s
};
Object.defineProperty(e, "__esModule", {
value: !0
});
var s = n(5),
a = n(0),
l = n(4),
c = n(2),
h = function(t) {
function e() {
var e = null !== t && t.apply(this, arguments) || this;
const n = JSON.parse(localStorage.getItem("hideInfo"));
return n instanceof Array ? (tcfg.HidePartyCode = n[0], tcfg.HideUserSig = n[1]) : localStorage.setItem("hideInfo", JSON.stringify([0, 0])), e.gconfig = a.gs.gconfig, e.userEntry = l.gameCore.userEntryMan, e.uconfig = a.gs.uconfig, e.cssColors = a.gs.ucolors.cssColors, e.appConfig = c.AppConfigurator.instance, e
}
return o(e, t), Object.defineProperty(e.prototype, "isDualUi", {
get: function() {
return a.gs.gconfig.ShowDualSkinInputUi
},
enumerable: !0,
configurable: !0
}), e.prototype.tcfg = tcfg, e.prototype.mounted = function() {
this.userEntry.skinChangedProc = this.update.bind(this)
}, e.prototype.inputText = function(t) {
this.userEntry.SetProp(t.target.name, t.target.value)
}, e.prototype.hideCode = function() {
var t = document.getElementsByClassName("code_cover")[0];
const e = "" == t.style.display;
t.style.display = e ? "none" : "", tcfg.HidePartyCode = !e, localStorage.setItem("hideInfo", JSON.stringify([tcfg.HidePartyCode, tcfg.HideUserSig]))
}, e.prototype.hideUsig = function() {
var t = document.getElementsByClassName("usig_cover")[0];
const e = "" == t.style.display;
t.style.display = e ? "none" : "", tcfg.HideUserSig = !e, localStorage.setItem("hideInfo", JSON.stringify([tcfg.HidePartyCode, tcfg.HideUserSig]))
}, e.prototype.onArrowButton = function(t) {
var e = "arrow_left" == t.target.id ? -1 : 1;
l.gameCore.userEntryMan.ShiftIndex(e)
}, e.prototype.onBenchButton = function() {
l.gameCore.ToggleBenchMarkMode()
}, r([s.template('\n
\n\t\n\t\n\n\t\t
\n\n\t\t
\n\n\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\tnote: スキンがエラーで表示されない場合、imgurを使ってください。また、スキンの縦横のピクセル数を1000x1000以下にしてください。gyazoの画像は非対応になりました。\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\tnote: please use imgur if your skin is not shown by error. Also it noted that the pixel size of skins should be less than 1000x1000.\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\t\t\t\tLWGA-1.1\n\t\t\t
\n\t\t
\n\n\t
\n \n')], e)
}(s.Element);
e.LeftConfigPanelTag = h
}, function(t, e, n) {
"use strict";
var i, o = this && this.__extends || (i = Object.setPrototypeOf || {
__proto__: []
}
instanceof Array && function(t, e) {
t.__proto__ = e
} || function(t, e) {
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n])
},
function(t, e) {
function n() {
this.constructor = t
}
i(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
}),
r = this && this.__decorate || function(t, e, n, i) {
var o, r = arguments.length,
s = r < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, n) : i;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, n, i);
else
for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, n, s) : o(e, n)) || s);
return r > 3 && s && Object.defineProperty(e, n, s), s
};
Object.defineProperty(e, "__esModule", {
value: !0
});
var s = n(5),
a = n(0),
l = n(4),
c = (function(t) {
function e() {
return null !== t && t.apply(this, arguments) || this
}
o(e, t), e.prototype.mounted = function() {
this.root.innerHTML = this.opts.content
}, e = r([s.template("
")], e)
}(s.Element), function(t) {
function e() {
var e = null !== t && t.apply(this, arguments) || this;
return e.model = l.gameCore.gameHudModel, e.perfModel = l.gameCore.perfModel, e.gconfig = a.gs.gconfig, e.uconfig = a.gs.uconfig, e.gstates = a.gs.gstates, e.cssColors = a.gs.ucolors.cssColors, e.chatInputBoxVisible = !1, e.hasNewPrivateMessage = !1, e.prevChatMessagesCount = -1, e
}
return o(e, t), e.prototype.mounted = function() {
var t = this,
e = this.refs.lb_chart_outer,
n = this.refs.lb_chart_canvas;
n.width = 160, n.height = 160, e.style.width = "160px", e.style.height = "160px";
var i = this.refs.map_outer,
o = this.refs.map_canvas,
r = 300;
o.width = r, o.height = r, i.style.width = r + "px", i.style.height = r + "px", window.addEventListener("keydown", function(e) {
if (!e.repeat && 13 == e.keyCode) {
var n = t.refs.chat_input_text_box;
if (t.chatInputBoxVisible) {
var i = n.value;
n.value = "", t.chatInputBoxVisible = !1, i ? l.gameCore.SendChatMessage(i) : t.update()
} else {
var o = document.activeElement;
if (o && "INPUT" == o.tagName) return void o.blur();
t.chatInputBoxVisible = !0, t.update(), n.focus()
}
}
}), setInterval(this.UpdationProc.bind(this), 17);
var s = this.refs.overlay_base,
r = this.refs.chat_view,
a = this.refs.chat_input_box,
c = !1;
function h(t) {
r.style.userSelect = t ? "text" : "none"
}
r.onmouseenter = function() {
c = !0
}, r.onmouseleave = function() {
c = !1
};
var d = !1;
a.onmouseenter = function() {
d = !0
}, a.onmouseleave = function() {
d = !1
}, s.onmousedown = function() {
c && h(!0)
}, s.onmouseup = function() {
c || d || (window.getSelection().removeAllRanges(), h(!1))
}
}, e.prototype.UpdationProc = function() {
this.model.isHudUpdated && (this.model.isHudUpdated = !1, this.update(), this.model.chatMessages.length != this.prevChatMessagesCount && (this.prevChatMessagesCount = this.model.chatMessages.length, this.scrollChatViewToEnd()))
}, e.prototype.scrollChatViewToEnd = function() {
var t = this.refs.chat_view;
t.scrollTop = t.scrollHeight
}, r([s.template(`
{model.serverUserNumText}
Score: {(model.selfScore * 0.001).toFixed(1)}k
Max: {(model.maxScore * 0.001).toFixed(1)}k
{model.splitNum}/16
{model.serverDisplayMessageText}
{model.specTargetScore ? model.specTargetName + " -- " + (model.specTargetScore/1000).toFixed(1) + "k" : model.specTargetName}
benchmark mode (score: {perfModel.numCellsRendered})
ғᴘꜱ : {perfModel.avgFps.toFixed(1)}
ɴᴏᴅᴇꜱ : {perfModel.numCellsRendered}
ʀᴇɴᴅᴇʀ : {perfModel.avgDuration.toFixed(2)}ᴍs
ʟᴏᴀᴅ : {(perfModel.avgRate * 100).toFixed(2)}%
ʙᴜғғᴇʀ : {(perfModel.replayBufferBytes / 1000000).toFixed(2)}ᴍʙ
ʟᴀᴛᴇɴᴄʏ: {model.latencyMs}ᴍs
{index + 1}.{text} -- {score}
{index + 1}.{text} -- {score}
{timeStamp}
{tripKey}
{senderName}:
{message}
`)], e)
}(s.Element));
e.GameOverlayTag = c
}, function(t, e, n) {
"use strict";
var i, o = this && this.__extends || (i = Object.setPrototypeOf || {
__proto__: []
}
instanceof Array && function(t, e) {
t.__proto__ = e
} || function(t, e) {
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n])
},
function(t, e) {
function n() {
this.constructor = t
}
i(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
}),
r = this && this.__decorate || function(t, e, n, i) {
var o, r = arguments.length,
s = r < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, n) : i;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, n, i);
else
for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, n, s) : o(e, n)) || s);
return r > 3 && s && Object.defineProperty(e, n, s), s
};
Object.defineProperty(e, "__esModule", {
value: !0
});
var s = n(5),
a = n(0),
l = n(4),
c = n(1),
h = function(t) {
function e() {
var e = null !== t && t.apply(this, arguments) || this;
return e.model = l.gameCore.ReplayControllerModel, e.cssColors = a.gs.ucolors.cssColors, e.replayUiMessage = "", e.elementIdToReplayOperationDict = {
bt_flash: 2,
bt_record: 1,
bt_stop: 3,
bt_play: 4,
bt_reel_prev: 5,
bt_reel_next: 6,
bt_cont: 7,
bt_tick_prev: 8,
bt_tick_next: 9,
bt_reel_delete: 10,
bt_speed_down: 12,
bt_speed_up: 13
}, e
}
return o(e, t), e.prototype.mounted = function() {
var t = this;
this.model.SetStateChangedProc(function(e) {
t.update()
}), this.update(), this.model.captureNotificationProc = function() {
t.replayUiMessage = "captured!", setTimeout(function() {
t.replayUiMessage = "", t.update()
}, 500)
}
}, e.prototype.onTrackKnobMouseDown = function(t) {
var e = this;
if (!a.gs.gstates.isBenchmarkMode) {
var n = this.refs.gauge_rail.getBoundingClientRect().left,
i = function(t) {
var i = t.pageX - n,
o = c.Nums.VMap(i, 5, 295, 0, 1, !0);
return e.model.SeekReplayPosTo(o, !0), e.update(), !1
},
o = function(t) {
window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", o)
};
window.addEventListener("mousemove", i), window.addEventListener("mouseup", o), i(t), t.stopPropagation()
}
}, e.prototype.onButtonClick = function(t) {
if (!a.gs.gstates.isBenchmarkMode) {
var e = t.currentTarget.id,
n = this.elementIdToReplayOperationDict[e];
n && this.model.HandleReplayOperation(n), t.stopPropagation()
}
}, r([s.template('\n
\n\t\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t
\n\n\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tx{model.replaySpeedRate.toFixed(2)}\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t{model.trackPosText}\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t
{model.numReels > 0 ? model.curReelIndex + 1 : 0}/{model.numReels}
\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t
\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t\t\t{replayUiMessage}\n\t\t\t
\n\t\t
\n\t
\n \n')], e)
}(s.Element);
e.ReplayControlBarTag = h
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t() {
this.listeners = new Map
}
return t.prototype.emit = function(t, e) {
var n = this.listeners.get(t);
if (n)
for (var i = 0, o = n; i < o.length; i++)(0, o[i])(e)
}, t.prototype.on = function(t, e) {
this.listeners.get(t) || this.listeners.set(t, []), this.listeners.get(t).push(e)
}, t
}();
e.EventBus = i
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t(t) {
this.values = [0], this.maxCount = t
}
return t.prototype.Push = function(t) {
this.values.length > this.maxCount && this.values.shift(), this.values.push(t)
}, t.prototype.GetAverageValue = function() {
var t = 0;
return (t = this.values.reduce(function(t, e) {
return t + e
}, 0)) / this.values.length
}, t
}();
e.PerformanceCheckQueue = i
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1),
o = n(3),
r = n(0),
s = n(4),
a = s.gameCore.nodeMan,
l = n(11),
c = n(12),
h = n(1),
d = n(25),
u = n(10),
p = n(6);
! function(t) {
var e = function() {
function t(t) {
this.holdTick = 0, this.gameView = t, this.box = new p.Container, this.gr = new p.Graphics, this.box.addChild(this.gr), this.box.zIndex = 1e3, this.elCursorOuter = document.querySelector("#psudo_cursor"), this.elCursorImageOn = document.querySelector("#psudo_cursor_img_on"), this.elCursorOuter.style.webkitUserSelect = "none"
}
return t.prototype.SetPsudoCursor = function(t, e, n, i) {
var o = this.elCursorOuter;
o.style.display = t ? "block" : "none", o.style.left = n + "px", o.style.top = i + "px", e && (this.holdTick = 7), this.holdTick > 0 && this.holdTick--, this.elCursorImageOn.style.display = this.holdTick > 0 ? "block" : "none"
}, t.prototype.Update = function() {
this.gr.clear(), r.gs.gstates.isBenchmarkMode || (this.UpdateCursor(), this.UpdateEatingLimitMarker(), this.UpdateCellDirectionMarker(), this.UpdateTeamCircle())
}, t.prototype.DrawCrossPoint = function(t, e, n) {
var i = this.gr;
i.moveTo(t - n, e), i.lineTo(t + n, e), i.moveTo(t, e - n), i.lineTo(t, e + n)
}, t.prototype.UpdateTeamCircle = function() {
var t = Date.now(),
e = s.gameCore.sight,
n = this.gr;
if (t - e.teamCircleTimeStamp < 500) {
var i = e.teamCircleX,
o = e.teamCircleY,
r = e.teamCircleRadius;
n.lineStyle(10, 16777215, 1), n.drawCircle(i, o, r)
}
}, t.prototype.UpdateCellDirectionMarker = function() {
var t = this.gr;
r.gs.uconfig.ShowCellDirectionMarker && this.gameView.cells.forEach(function(e) {
if (e.isPlayerCell) {
var n = e.node;
if (0 != n.velocity.x || 0 != n.velocity.y) {
var o = Math.atan2(n.velocity.y, n.velocity.x),
r = n.nx,
s = n.ny,
a = e.baseSize / 2 * e.scale * .8,
l = e.baseSize / 2 * e.scale * 1.05,
c = r + Math.cos(o) * a,
h = s + Math.sin(o) * a,
d = r + Math.cos(o) * l,
u = s + Math.sin(o) * l,
p = e.labelColor;
t.lineStyle(10, p, 1);
var g = .05 * n.nr;
g = i.Nums.LoLimit(g, 15), t.lineWidth = g, t.moveTo(c, h), t.lineTo(d, u)
}
}
})
}, t.prototype.UpdateEatingLimitMarker = function() {
var t = this;
r.gs.uconfig.ShowEatLimitMarker && s.gameCore.nodeMan.nodeAnalyzer.eatingLimitList.forEach(function(e) {
var n = t.gameView.cells.get(e.eaterId),
i = t.gameView.cells.get(e.eatenId),
o = e.canEat ? 65535 : 11184810;
t.gr.lineStyle(10, o, 1), t.DrawCrossPoint(n.x, n.y, 100), t.DrawCrossPoint(i.x, i.y, 100), t.gr.drawCircle(n.x, n.y, e.limitRadius)
})
}, t.prototype.UpdateCursor = function() {
var t = this,
e = s.gameCore.sight;
if ((r.gs.gstates.isPlaying ? r.gs.uconfig.ShowCursorLine : r.gs.uconfig.ShowSpecAimCursor) && e.aimPlayerId > 0) {
var n = e.aimCursorX,
i = e.aimCursorY,
a = this.gr,
l = r.gs.ucolors.GetColor("clCursorLine");
a.alpha = o.ColorHelper.GetAlpha(l);
var c = r.gs.uconfig.CursorLineThickness;
c *= .2 / e.eyeScale, a.lineStyle(c, l);
var h = e.aimPlayerId,
d = 0;
s.gameCore.nodeMan.nodes.forEach(function(e) {
if (e.ownerPlayerId == h && 0 == e.cellType) {
var o = t.gameView.cells.get(e.nodeId);
a.moveTo(o.x, o.y), a.lineTo(n, i), d++
}
});
var u = e.WorldToScreen(n, i),
p = u[0],
g = u[1];
this.SetPsudoCursor(!r.gs.gstates.isRealtimeModePlaying && d > 0, e.splitting, p, g), e.splitting = !1
} else this.SetPsudoCursor(!1, !1, 0, 0)
}, t
}(),
n = function() {
function t() {
this.cardSize = 250, this.sharpness = 10, this.glowDist = 500
}
return t.prototype.Initialize = function() {
this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = this.cardSize + 2 * this.glowDist, this.texture = p.Texture.from(this.canvas), this.UpdateDrawing_Canvas(), r.gs.uconfig.RegisterChangedProc("SimpleVirus", this.UpdateDrawing_Canvas.bind(this)), r.gs.uconfig.RegisterChangedProc("GlowingNonPlayerCells", this.UpdateDrawing_Canvas.bind(this)), r.gs.ucolors.RegisterChangedProc("clVirusInnerFill", this.UpdateDrawing_Canvas.bind(this)), r.gs.ucolors.RegisterChangedProc("clVirusOuterStroke", this.UpdateDrawing_Canvas.bind(this))
}, t.prototype.UpdateDrawing_Canvas = function() {
const t = r.gs.uconfig.GlowingNonPlayerCells;
var e, n = (e = this.cardSize) / 2,
i = n + this.glowDist,
s = this.canvas.getContext("2d"),
a = r.gs.ucolors.GetColor("clVirusInnerFill"),
l = r.gs.ucolors.GetAlpha("clVirusInnerFill"),
c = r.gs.ucolors.GetColor("clVirusOuterStroke"),
h = r.gs.ucolors.GetAlpha("clVirusOuterStroke");
if (s.clearRect(0, 0, 2 * i, 2 * i), s.shadowColor = o.ColorHelper.ColorToHtmlString(c), r.gs.uconfig.SimpleVirus) {
s.beginPath();
var d = .01 * this.cardSize * 4;
s.arc(i, i, n, 0, 2 * Math.PI, !1), s.arc(i, i, this.cardSize / 2 - d / 2, 0, 2 * Math.PI, !1), s.lineWidth = d, s.strokeStyle = o.ColorHelper.ColorToHtmlString(c), s.globalAlpha = h, s.shadowBlur = t ? this.glowDist : 0, s.stroke(), s.stroke(), s.shadowBlur /= 2, s.stroke(), s.stroke(), s.globalAlpha /= 2, s.stroke(), s.stroke(), s.shadowBlur /= 1.5, s.stroke(), s.stroke(), s.fillStyle = o.ColorHelper.ColorToHtmlString(a), s.globalAlpha = l, s.fill(), s.shadowBlur = t ? .1 * n : 0, s.globalAlpha = h, s.stroke(), s.globalAlpha /= 2, s.stroke(), s.globalAlpha = 1
} else {
s.beginPath();
const r = 24,
d = 360 / r / 180 * Math.PI,
u = d / 2,
p = n + this.sharpness,
g = n - this.sharpness;
for (var e = 0; e <= r; e++) s.lineTo(Math.cos(e * d) * p + i, -Math.sin(e * d) * p + i), s.lineTo(Math.cos(e * d + u) * g + i, -Math.sin(e * d + u) * g + i);
s.lineWidth = .01 * this.cardSize * 3.25, s.strokeStyle = o.ColorHelper.ColorToHtmlString(c), s.lineJoin = "round", s.globalAlpha = h, s.shadowBlur = t ? this.glowDist : 0, s.stroke(), s.stroke(), s.shadowBlur /= 2, s.stroke(), s.stroke(), s.globalAlpha /= 2, s.stroke(), s.stroke(), s.shadowBlur /= 1.5, s.stroke(), s.stroke(), s.fillStyle = o.ColorHelper.ColorToHtmlString(a), s.globalAlpha = l, s.fill(), s.shadowBlur = t ? .1 * n : 0, s.globalAlpha = h, s.stroke(), s.globalAlpha /= 2, s.stroke(), s.globalAlpha = 1
}
this.texture.update()
}, t.instance = new t, t
}(),
g = function() {
function t() {}
return t.prototype.GetSequenceString = function() {
var t = this;
return "" + t.skinUrl + t.nameText + t.skinAlpha + t.renderQuality + t.baseColor + t.teamColor + t.showEnemyOverlay + t.insertRenderName
}, t
}(),
f = function() {
function t() {}
return t.GetConfigCardSizeFromRenderQuality = function(e) {
return t.CardSizeSource[e]
}, Object.defineProperty(t, "CurrentConfigCardSize", {
get: function() {
return t.GetConfigCardSizeFromRenderQuality(r.gs.uconfig.RenderQuality)
},
enumerable: !0,
configurable: !0
}), t.CardSizeSource = [200, 400, 800], t
}(),
m = function() {
function t(t) {
this.drawingProps = new g, this.playerId = t, this.drawingProps.renderQuality = r.gs.uconfig.RenderQuality
}
return t.ResizeInterCanvasIfNeed = function(e) {
var n = t.interCanvas;
n.height < e && (n.width = e, n.height = e)
}, t.prototype.ResizeCanvasIfNeed = function(t) {
if (this.canvas || (this.canvas = document.createElement("canvas"), this.canvasCapacitySize = 10, this.canvas.width = 10, this.canvas.height = 10), this.canvasCapacitySize != t) {
this.canvasCapacitySize = t, this.canvas.height < t && (this.canvas = document.createElement("canvas"), this.canvas.width = t, this.canvas.height = t, this.baseTexture = p.BaseTexture.from(this.canvas));
var e = new p.Rectangle(0, 0, t, t);
this.texture = new p.Texture(this.baseTexture, e)
}
}, t.prototype.StringToCharArrayU = function(t) {
return t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []
}, t.prototype.DrawTextCircular = function(t, e, n, i, o, r, s, a) {
t.save(), t.translate(n, i);
for (var l = s, c = this.StringToCharArrayU(e), h = 0; h < c.length; h++) {
var d = c[h];
t.save(), t.rotate(l);
var u = t.measureText(d).width,
p = -u / 2,
g = o * a;
t.strokeText(d, p, g), t.fillText(d, p, g), t.restore();
var f = .4 * u + .2 * r,
m;
l -= 2 * Math.atan2(f, Math.sqrt(o * o - f * f))
}
t.restore()
}, t.prototype.RenderCellCanvas = function() {
this.playerId == a.activeSelfPlayerId && (this.self = !0);
var e = this.drawingProps,
n = f.GetConfigCardSizeFromRenderQuality(e.renderQuality);
this.cardSize = n;
const i = n / 2;
var s = n / 2,
l = r.gs.uconfig.GlowingCells ? i : 0,
c = s + l,
h = 2 * c,
d = 2 * (s + i);
this.ResizeCanvasIfNeed(h);
var u = this.canvas.getContext("2d");
if (u.save(), u.clearRect(0, 0, d, d), u.beginPath(), u.arc(c, c, s, 0, 2 * Math.PI, !1), u.closePath(), this.skinVisible = this.skinImage && e.skinAlpha > 0, this.skinVisible) {
u.shadowBlur = l, u.shadowColor = u.fillStyle = o.ColorHelper.ColorToHtmlString(e.baseColor), u.fill(), u.clip();
var p = this.skinImage,
g = p.width,
m = p.height,
y = 0,
v = 0,
S = 0,
b = n;
let i;
if (!this.self || r.gs.uconfig.ShowSelfSkin)
if (g > m ? (y = (g - (S = m)) / 2, v = 0) : (y = 0, v = (m - (S = g)) / 2), u.globalAlpha = e.skinAlpha, b / S < .5) {
t.ResizeInterCanvasIfNeed(h);
var C = t.interCanvas,
x = C.getContext("2d"),
_ = 2 * n;
x.clearRect(0, 0, d, d), x.drawImage(p, y, v, S, S, l, l, b, b), u.drawImage(C, l, l, b, b, l, l, b, b)
} else u.drawImage(p, y, v, S, S, l, l, b, b);
u.globalAlpha = 1, u.shadowBlur = 0
}
var w = o.ColorHelper.ColorToHtmlString(e.teamColor);
if (e.showEnemyOverlay) {
var k = 2 * Math.PI,
I = 6 * (T = .01 * n),
P = 7 * T,
M = n / 2;
u.strokeStyle = w, u.lineWidth = I, u.globalAlpha = .3, u.fillStyle = "#000", u.save(), u.arc(c, c, s, 0, 2 * Math.PI, !1), u.clip(), u.fillRect(l, l, n + l, n + l), u.restore(), u.globalAlpha = .8, u.beginPath(), u.arc(c, c, M - P, 0, k, !1), u.stroke();
var h = .707 * M - P;
u.beginPath(), u.moveTo(l + M + h, l + M - h), u.lineTo(l + M - h, l + M + h), u.stroke(), u.globalAlpha = 1
}
if (e.insertRenderName) {
var T, R = 10 * (T = .01 * n) >> 0;
u.font = "bold " + R + "px Meiryo, Arial", u.strokeStyle = "#000", u.fillStyle = w, u.lineWidth = 1.3 * T >> 0, this.DrawTextCircular(u, e.nameText, n, n, .8 * s, R, 1.5, 1)
}
u.restore(), this.texture.update()
}, t.prototype.Update = function() {
var t = this,
e = this.drawingProps,
n = e.GetSequenceString(),
i = e.skinUrl,
a = s.gameCore.uMan,
c = 65535 & this.playerId,
h = 1 & this.playerId,
d = a.GetUserInfoById(c),
p = a.GetTeamInfoById(d.teamId),
g = c == a.selfUserId,
f = r.gs.gstates.isPlaying || r.gs.gstates.isDeadSpectation,
m = d.skinUrls[h],
y = p == a.selfTeamInfo,
v = o.GameHelper.CheckIsInEatableSection(p.section, a.selfTeamInfo.section),
S = !d.isBot && "" == m;
S && (m = r.gs.gconfig.NoskinFallbackUrl);
var b = 1,
C = !0;
f && !y && (r.gs.uconfig.ShowEnemySkin ? b = .6 : C = !1), S && g && (C = !1), "dead" == d.name && (C = !1), r.gs.gconfig.ShowAlwaysAllPlayersSkin && (C = !0, b = 1), this.skinImage && 0 == u.SkinImageManager.instance.getSkinAvailability(this.skinImage.src) && (C = !1), r.gs.uconfig.ShowSkin || (C = !1), C || (b = 0), e.baseColor = d.colors[h], e.skinUrl = m, e.nameText = d.fullName, e.teamColor = p.color, e.renderQuality = r.gs.uconfig.RenderQuality, e.insertRenderName = r.gs.uconfig.ShowCircularName && r.gs.uconfig.ShowName && !(!r.gs.uconfig.ShowSelfName && g), e.skinAlpha = b, e.showEnemyOverlay = r.gs.uconfig.ShowEnemySkin && f && !d.isBot && !y && v && b > 0, r.gs.gconfig.ShowAlwaysAllPlayersSkin && (e.showEnemyOverlay = !1), this.glow != r.gs.uconfig.GlowingCells && (this.glow = r.gs.uconfig.GlowingCells, this.reqRenderCellCanvasOnNextFrame = !0), (this.self || g) && this.sv != r.gs.uconfig.ShowSelfSkin && (this.sv, r.gs.uconfig.ShowSelfSkin, this.reqRenderCellCanvasOnNextFrame = !0), e.GetSequenceString() != n && (e.skinUrl != i ? (this.skinImage = null, this.reqRenderCellCanvasOnNextFrame = !0, e.skinUrl && l.ImageWrapper.LoadImageThen(e.skinUrl, function(e) {
e && u.SkinImageManager.instance.addSkinUrl(e.src), t.skinImage = e, t.reqRenderCellCanvasLazy = !0
})) : this.reqRenderCellCanvasLazy = !0)
}, t.prototype.Purge = function() {
this.skinImage && this.skinImage.src && u.SkinImageManager.instance.removeSkinUrl(this.skinImage.src)
}, t.interCanvas = document.createElement("canvas"), t
}(),
y = function() {
function t() {
this.cellCards = new Map
}
return t.prototype.GetCellCard = function(t, e) {
void 0 === e && (e = !1);
var n = this.cellCards.get(t);
return !n && e && (n = new m(t), this.cellCards.set(t, n)), h.Utils.Confirm(n), n
}, t.prototype.OnUserLeaved = function(t) {
var e = this.cellCards.get(t);
e && e.Purge(), this.cellCards.delete(t), this.cellCards.delete(t + 1)
}, t.prototype.UpdateCardDrawingQueue = function() {
var t = !1;
this.cellCards.forEach(function(e) {
e.reqRenderCellCanvasOnNextFrame && (e.RenderCellCanvas(), e.reqRenderCellCanvasOnNextFrame = !1, t = !0)
}), this.cellCards.forEach(function(e) {
!t && e.reqRenderCellCanvasLazy && (e.RenderCellCanvas(), e.reqRenderCellCanvasLazy = !1, t = !0)
})
}, t.instance = new t, t
}(),
v = function() {
function t() {
this.box = new p.Container, this.baseShape = new p.Sprite, this.baseShape.anchor.set(.5), this.baseSprite = new p.Sprite, this.baseSprite.anchor.set(.5), this.overShape = new p.Graphics, this.nameLabel = new p.Text, this.massLabel = new p.BitmapText("", {
fontName: "GAMEPLAY_MASS"
}), this.box.addChild(this.baseShape), this.box.addChild(this.baseSprite), this.box.addChild(this.overShape)
}
return t.Gain = function() {
return t.pool.Gain()
}, t.prototype.Release = function() {
this.box.removeChild(this.nameLabel), this.box.removeChild(this.massLabel), t.pool.Release(this)
}, Object.defineProperty(t.prototype, "isPlayerCell", {
get: function() {
return 0 == this.node.cellType
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "isVirus", {
get: function() {
return 2 == this.node.cellType
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "isPellet", {
get: function() {
return 1 == this.node.cellType
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "isFood", {
get: function() {
return 3 == this.node.cellType
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "isFunnel", {
get: function() {
return 4 == this.node.cellType
},
enumerable: !0,
configurable: !0
}), t.prototype.SetupLabel = function(t) {
t.style && (t.style.fontFamily = "Meiryo, Arial", t.style.fontWeight = "bold", t.style.stroke = "#000000", t.style.fontSize = .13 * this.baseSize * (r.gs.uconfig.TextZoom / 100) >> 0, t.style.strokeThickness = .015 * this.baseSize *(r.gs.uconfig.TextZoom / 100) >> 0)
}, t.prototype.Initialize = function(t) {
this.node = t, t.entity = this, this.glow = this.cellCard = this.baseSize = null, this.isPlayerCell ? this.cellCard = y.instance.GetCellCard(t.ownerPlayerId) : this.isVirus && (this.cellCard = n.instance), this.UpdateBaseShape(), this.cellCard && (this.box.addChild(this.nameLabel), this.box.addChild(this.massLabel)), this.SetupLabel(this.nameLabel), this.SetupLabel(this.massLabel), this.baseColor = -1, this.labelColor = -1, this.edgeColor = -1, this.edgeColor2 = -1, this.ringColor = -1, this.frameTick = 0, this.x = 0, this.y = 0, this.scale = 1, this.x0 = 0, this.y0 = 0, this.scale0 = 1, this.x1 = 0, this.y1 = 0, this.scale1 = 0, this.angle = 0, this.speed = 0, this.speedApplyTime = 0, this.time = 0, this.mass = 0, this.isInEatableSection = !1
}, t.prototype.UpdateProps = function(t) {
this.node = t, t.entity = this, 0 != this.mass && this.isPellet || this.UpdatePosRadius()
}, t.prototype.UpdateLabels = function(t, e, n) {
var i = null != t,
a = e >= 0;
if ((i || a) && this.labelColor != n) {
this.labelColor = n;
var l = o.ColorHelper.ColorToHtmlString(n);
this.nameLabel.style.fill = l, this.massLabel.tint = n
}
if (i && (h = this.nameLabel).text != t && (h.text = t, h.x = -h.width / 2, h.y = -h.height / 2), a) {
var c = e.toString();
if (this.massLabel.text != c) {
var h = this.massLabel,
d, u = 2;
let e;
this.isVirus ? (u = 1.9, r.gs.uconfig.VirusSplitHint ? (c = 5 - (c - 100) / 16, d = 4) : d = 2.5) : d = 1, h.scale.x = d, h.scale.y = d, e = c < 1e3 ? c : r.gs.uconfig.SimplifiedMass ? (c / 100 >> 0) / 10 + "K" : c, h.text = e, h.x = -h.width / 2, h.y = -h.height / u, i && t && (h.y += .2 * this.baseSize)
}
}
this.nameLabel.visible = i, this.massLabel.visible = a;
let p = !r.gs.uconfig.AutoHideText || s.gameCore.sight.eyeScale * this.node.r > 30;
this.nameLabel.visible = i && p, this.massLabel.visible = a && p
}, t.prototype.UpdateBaseShape = function() {
const t = f.CurrentConfigCardSize;
if (this.isPellet || this.isFood) {
const e = r.gs.uconfig.GlowingNonPlayerCells;
if (this.baseSize != t || this.glow != e) {
this.baseSize = t, this.glow = e, this.massLabel.fontSize = .13 * this.baseSize >> 0, this.baseShape.blendMode = e ? PIXI.BLEND_MODES.SCREEN : PIXI.BLEND_MODES.NORMAL;
const n = e ? "GP_GLOWING_PELLET" : "GP_BASE_LOW";
this.baseShape.texture = PIXI.utils.TextureCache[n]
}
return void(0 == this.node.ownerPlayerId ? r.gs.uconfig.ShowFood ? this.box.visible = !0 : this.box.visible = !1 : (r.gs.uconfig.ShowPelletSkin && (this.cellCard = y.instance.GetCellCard(this.node.ownerPlayerId)), this.box.visible = !0))
}
this.box.visible = !0;
const e = r.gs.uconfig.GlowingCells;
if (this.baseSize != t || this.glow != e)
if (this.baseSize = t, this.glow = e, this.massLabel.fontSize = .13 * this.baseSize >> 0, this.baseShape.blendMode = PIXI.BLEND_MODES.NORMAL, 200 == this.baseSize) {
const t = e ? "GP_GLOWING_LOW" : "GP_BASE_LOW";
this.baseShape.texture = PIXI.utils.TextureCache[t]
} else if (400 == this.baseSize) {
const t = e ? "GP_GLOWING_MEDIUM" : "GP_BASE_MEDIUM";
this.baseShape.texture = PIXI.utils.TextureCache[t]
} else {
const t = e ? "GP_GLOWING_HIGH" : "GP_BASE_HIGH";
this.baseShape.texture = PIXI.utils.TextureCache[t]
}
}, t.prototype.UpdateDrawing = function(t, e, n, i, a) {
var l = this.baseSize / 2,
c = this.baseSize / 200,
h = e >= 0 || i >= 0 || a >= 0;
if (this.isVirus && r.gs.uconfig.VirusRangeHint) {
h = !0, (p = this.overShape).clear(), p.alpha = 1;
let t = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clVirusRangeHint")),
e = r.gs.ucolors.GetAlpha("clVirusRangeHint");
p.beginFill(t, e), p.drawCircle(0, 0, 880 / this.scale), p.endFill()
}
if (h && (this.edgeColor != e || this.edgeColor2 != i || this.ringColor != a)) {
const t = this.node.ownerPlayerId == s.gameCore.nodeMan.selfUserId || this.node.ownerPlayerId == s.gameCore.nodeMan.selfUserId + 1;
if (this.edgeColor = e, this.edgeColor2 = i, this.ringColor = a, (p = this.overShape).clear(), p.alpha = 1, e >= 0) {
var d = !t && r.gs.uconfig.MarkerThin ? 4 * c : 12.5 * c;
if (p.lineStyle(d, e), p.drawCircle(0, 0, l - d / 2), n) {
var u = .707 * l;
p.moveTo(u, -u), p.lineTo(-u, u)
}
}
i >= 0 && (d = this.mass > 2e4 ? 8.75 * c : 6.25 * c, p.lineStyle(d, i), p.drawCircle(0, 0, l - d / 2)), a >= 0 && (d = 5 * c, p.lineStyle(d, a), p.drawCircle(0, 0, l + 10 * c))
}
this.overShape.visible = h, this.overShape.alpha = r.gs.uconfig.MarkerAlpha;
var p, g = t >= 0;
g && this.baseColor != t && (this.baseColor = t, this.baseShape.tint = t), this.baseShape.visible = g
}, t.prototype.UpdateGraphicsForFrame = function() {
var t = this.baseSize;
this.baseSize = f.CurrentConfigCardSize;
var e = this.baseSize != t,
n = this.node,
a = s.gameCore.nodeMan,
l = s.gameCore.uMan,
c = o.GameHelper.DecodePlayerId(n.ownerPlayerId),
d = c[0],
u = c[1],
p = l.GetUserInfoById(d),
g = l.GetTeamInfoById(p.teamId),
m = p.isBot,
y = g == l.selfTeamInfo,
v = l.selfTeamInfo.section,
S = (this.isPlayerCell || this.isFood) && !o.GameHelper.CheckIsInEatableSection(g.section, v),
self = [l.selfUserId,l.selfUserId+1];
this.isInEatableSection = S;
var b = r.gs.gstates.isPlaying && S;
this.box.alpha = b ? .5 : 1;
var C = this.isPlayerCell && (65534 & n.ownerPlayerId) == l.selfUserId,
x = this.isPlayerCell && n.ownerPlayerId == a.activeSelfPlayerId;
e && (this.SetupLabel(this.nameLabel), this.SetupLabel(this.massLabel));
var _ = this.isPlayerCell && !r.gs.uconfig.ShowCircularName && r.gs.uconfig.ShowName && !(!r.gs.uconfig.ShowSelfName && C) && "" != p.fullName,
w = r.gs.uconfig.ShowMass && (this.isPlayerCell || this.isVirus),
k = _ && p.fullName ? p.fullName : null,
I = w ? n.mass : -1,
P = this.isVirus ? 16777215 : g.color;
this.UpdateLabels(k, I, P);
var M = -1,
T = -1,
R = -1,
U = -1,
A = !1;
if (this.isPlayerCell ? M = p.colors[u] : this.isFood ? M = p.colors[u] : this.isFunnel ? M = p.colors[u] : this.isPellet && (M = n.color), this.isPlayerCell) {
if (r.gs.uconfig.ShowSplitPrediction && x) {
var E = n.splitOrderWeight,
F = i.Nums.MapTo(E, .9, .58);
if (r.gs.uconfig.ShowHalfSplit && x) {
var half = n.isHalfSplit;
if(half && n == halfbiggest){
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clHalfMarker"))
}
else{
T = 16777215 & o.ColorHelper.ColorFromHSVA(F, 1, 1, 1)
}
}else{
T = 16777215 & o.ColorHelper.ColorFromHSVA(F, 1, 1, 1)
}
}
else if (r.gs.uconfig.ShowCellRing) {
var temp = o.ColorHelper.invertColor(o.ColorHelper.ColorToHtmlString(l.colors[a]));
if (r.gs.uconfig.ShowHalfSplit && x) {
var half = n.isHalfSplit;
if(half && n == halfbiggest){
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clHalfMarker"))
}
else{
T = o.ColorHelper.ColorFromHtmlString(temp)
}
}else{
T = o.ColorHelper.ColorFromHtmlString(temp)
}
}
else if (r.gs.uconfig.ShowOrderRing2 && self.includes(d) && !r.gs.uconfig.ShowOrderRing) {
if (r.gs.uconfig.ShowHalfSplit && x) {
var half = n.isHalfSplit;
if(half && n == halfbiggest){
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clHalfMarker"))
}
else{
T =o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerRing"))
}
}
else{
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerRing2"))
}
}
else if (r.gs.uconfig.ShowOrderRing && x && !r.gs.uconfig.ShowOrderRing2) {
if (r.gs.uconfig.ShowHalfSplit && x) {
var half = n.isHalfSplit;
if(half && n == halfbiggest){
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clHalfMarker"))
}
else{
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerRing"))
}
}
else{
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerRing"))
}
}
else{
if (r.gs.uconfig.ShowHalfSplit && x) {
var half = n.isHalfSplit;
if(half && n == halfbiggest){
T = o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clHalfMarker"))
}
}
}
if (r.gs.uconfig.ShowMassMarker && !x) {
var N = n.sizeLevel,
O = r.gs.uconfig.MarkerExtend ? [o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerA")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerB")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerC")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerD")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerE")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerF")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerG")), o.ColorHelper.ReplaceAlpha(r.gs.ucolors.GetColor("clMarkerH")), 204] : [16711680, 16737792, 16776960, 56831, 43520, 204];
if (-1 != N) {
var D = O[N];
r.gs.uconfig.ShowSkin && (r.gs.uconfig.ShowEnemySkin || y) ? (T = D, A = !m && !y, r.gs.gconfig.ShowAlwaysAllPlayersSkin && (A = !1)) : M = D
}
}
if (r.gs.uconfig.ShowSplitIndicator && r.gs.gstates.isPlaying && !C && n.showMark && (U = n.canEat ? 65280 : 11184810), r.gs.uconfig.ShowAutoSplitAlert && !r.gs.gstates.isBenchmarkMode && n.mass >= 17325) {
var H = this.frameTick / 25 * .5 % 1;
(H *= 2) > 1 && (H = 2 - H), F = n.mass > 2e4 ? i.Nums.MapTo(H, 0, .33) : i.Nums.MapTo(H, .2875, .725), R = 16777215 & o.ColorHelper.ColorFromHSVA(F, 1, 1, 1)
}
}
let B = this.isPlayerCell || this.isFood;
if (this.cellCard, B || h.Utils.Confirm(-1 == T && -1 == R && -1 == U), B && this.cellCard && this.cellCard.skinVisible && (M = -1), this.UpdateDrawing(M, T, A, R, U), this.cellCard && this.cellCard.texture) {
this.baseSprite.texture = this.cellCard.texture;
var G = this.baseSize / this.cellCard.cardSize;
this.baseSprite.scale.x = G, this.baseSprite.scale.y = G
}
this.UpdateBaseShape(), this.baseSprite.visible = null != this.cellCard
}, t.prototype.UpdateInterpolation = function(t, e) {
this.frameTick++;
const n = r.gs.uconfig;
if (2 == n.InterpolationType) {
var s = i.Nums.MapTo(n.InterpolationSpeed, .9, .5);
this.x = i.Nums.EasyFilter(this.x, this.x1, s), this.y = i.Nums.EasyFilter(this.y, this.y1, s), this.scale = i.Nums.EasyFilter(this.scale, this.scale1, s), this.speedApplyTime -= t, this.speedApplyTime <= 0 && (this.speed = 0);
var a = 1 * o.GameHelper.MassToRadius(this.mass),
l = r.gs.gconfig.FieldSize;
i.Nums.InRange(this.x1, a, l - a) && i.Nums.InRange(this.y1, a, l - a) || (this.speed = 0), this.x1 += Math.cos(this.angle) * this.speed, this.y1 += Math.sin(this.angle) * this.speed
} else if (1 == n.InterpolationType) {
const t = this.node,
i = this.isFood && (!n.ShowPelletSkin || !this.cellCard) || this.isPellet ? 200 : this.baseSize,
o = e;
t.LinearUpdate(o), this.x = t.x, this.y = t.y, this.scale = 2 * t.r / i
} else {
var c = performance.now(),
h = i.Nums.MapTo(n.InterpolationSpeed, 120, 40),
d = i.Nums.Clamp((c - this.time) / h, 0, 1);
this.x = i.Nums.Lerp(this.x0, this.x1, d), this.y = i.Nums.Lerp(this.y0, this.y1, d), this.scale = i.Nums.Lerp(this.scale0, this.scale1, d)
}
this.box.x = this.x, this.box.y = this.y, this.box.scale.x = this.scale, this.box.scale.y = this.scale, this.box.zIndex = this.scale * (this.isPlayerCell || this.isVirus ? 1 : 200 / this.baseSize) + 1e-8 * this.node.nodeId + (this.isInEatableSection ? 100 : 0)
}, t.prototype.UpdatePosRadius = function() {
this.time = performance.now();
const t = this.isFood && (!r.gs.uconfig.Show || !this.cellCard) || this.isPellet ? 200 : this.baseSize;
var e = 0 == this.mass,
n = this.node.nx,
i = this.node.ny,
s = this.node.mass,
a = 2 * o.GameHelper.MassToRadius(s) / t,
l = this.node.motionAngle,
c = this.node.motionSpeed;
2 == r.gs.uconfig.InterpolationType ? (this.speed = 25 * c / 60 * .6, this.speedApplyTime = 50) : this.speed = 0, e ? (this.x0 = n, this.y0 = i, this.scale0 = a, this.x = n, this.y = i, this.scale = a) : (this.x0 = this.x, this.y0 = this.y, this.scale0 = this.scale), this.x1 = n, this.y1 = i, this.scale1 = a, this.angle = l, this.mass = s
}, t.pool = new o.ObjectPool(r.gs.gconfig.MaxCellsNum, function() {
return new t
}), t
}(),
S = function() {
function t() {
this.delta = 0, this.cells = new Map, this.time0 = Date.now(), this.checkQueue_interval = new d.PerformanceCheckQueue(60), this.checkQueue_duration = new d.PerformanceCheckQueue(60), this.frameIndex = 0
}
return t.prototype.Initialize = function() {
var t = this,
i = document.querySelector("#game_canvas_layer_main"),
o = {
width: i.width,
height: i.hight,
view: i,
antialias: r.gs.uconfig.Antialias,
transparent: !0,
resolution: r.gs.uconfig.HDMode / 2 + 1,
autoDensity: !0
};
(MAIN_RENDERER = p.autoDetectRenderer(o)).cells = this.cells, this.renderer = MAIN_RENDERER, this.drawingRoot = new p.Container, this.stage = new p.Container, this.drawingRoot.addChild(this.stage), this.fieldGraphics = new c.FieldGraphics(!0), this.stage.addChild(this.fieldGraphics.box);
var a = function() {
t.fieldGraphics.SetCoordVisibility(r.gs.uconfig.ShowCoord)
};
r.gs.uconfig.RegisterChangedProc("ShowCoord", a), a(), this.cellsBox = new p.Container, this.stage.addChild(this.cellsBox), n.instance.Initialize(), this.gfs = new e(this), this.stage.addChild(this.gfs.box), s.gameCore.nodeMan.gameViewSyncNodesToListProc = this.SyncNodeListToModel.bind(this), s.gameCore.uMan.userLeavedProc = function(t) {
y.instance.OnUserLeaved(t)
};
var l = function() {
var e = window.innerWidth,
n = window.innerHeight;
t.renderer.resize(e, n), s.gameCore.sight.SetScreenSize(e, n)
};
l(), window.onresize = l;
const h = (t, e, n) => {
n = n || 1;
const i = document.createElement("canvas"),
o = t + (e ? 400 : 0);
i.width = i.height = 2 * o;
const r = i.getContext("2d");
r.beginPath(), r.fillStyle = "#ffffff", r.shadowColor = "#ffffff", r.shadowBlur = e, r.arc(o, o, t, 0, 2 * Math.PI);
for (var s = 0; s < n; s++) r.fill(), r.globalAlpha /= 2;
return PIXI.Texture.from(i)
},
d = () => {
const t = document.createElement("canvas"),
e = t.getContext("2d");
var n = 150;
t.width = 300, t.height = 300;
const i = e.createRadialGradient(n, n, 112.5, n, n, n);
i.addColorStop(0, "transparent"), i.addColorStop(1, "white"), e.fillStyle = i, e.beginPath(), e.arc(n, n, n, 0, 2 * Math.PI, !1), e.fill();
let o = PIXI.Texture.from(t);
o.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, PIXI.Texture.addToCache(o, "Waves")
};
d();
const u = h(100),
g = h(200),
f = h(400),
m = h(100, 50, 1),
v = h(200, 100, 1),
S = h(400, 200, 1);
u.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, g.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, f.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, m.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, v.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, S.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, PIXI.Texture.addToCache(u, "GP_BASE_LOW"), PIXI.Texture.addToCache(g, "GP_BASE_MEDIUM"), PIXI.Texture.addToCache(f, "GP_BASE_HIGH"), PIXI.Texture.addToCache(m, "GP_GLOWING_LOW"), PIXI.Texture.addToCache(v, "GP_GLOWING_MEDIUM"), PIXI.Texture.addToCache(S, "GP_GLOWING_HIGH");
const b = () => {
const t = document.createElement("canvas"),
e = 500;
t.width = t.height = 1e3;
const n = t.getContext("2d"),
i = r.gs.uconfig.PelletCellsAlpha;
n.beginPath(), n.fillStyle = "#ffffff", n.shadowColor = "#ffffff", n.shadowBlur = 2e3, n.arc(e, e, 100, 0, 2 * Math.PI), n.fill(), n.globalAlpha = i / 2 + .125, n.fill(), n.save(), n.clip(), n.clearRect(0, 0, 1e3, 1e3), n.restore(), n.shadowBlur = 0, n.globalAlpha = i, n.fill();
let o = PIXI.Texture.from(t);
o.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, PIXI.Texture.addToCache(o, "GP_GLOWING_PELLET")
};
b(), r.gs.uconfig.RegisterChangedProc("PelletCellsAlpha", b)
}, t.prototype.StartAnimation = function() {
var t = this,
e = function() {
requestAnimationFrame(e), o.TimeChecker.Start("FrameProc"), t.FrameProc(), o.TimeChecker.Stop(), t.updateWaves()
};
e(), this.UpdatePerf(), this.wave_Sprite = new p.Sprite, this.wave_Sprite.anchor.x = .5, this.wave_Sprite.anchor.y = .5, t.stage.addChild(this.wave_Sprite), this.wave_Sprite.texture = PIXI.utils.TextureCache.Waves, this.wave_Sprite.visible = !1
}, t.prototype.FrameProc = function() {
this.frameIndex++;
var t = r.gs.usupport.TargetFrameRate;
r.gs.gstates.isBenchmarkMode && (t = 60);
var e = 60 / t;
if (this.frameIndex % e == 0 && (o.PageHelper.Instance.Update(), o.PageHelper.Instance.IsActive)) {
r.gs.gstates.isBenchmarkMode && s.gameCore.benchDataFeeder.FrameUpdateProc(), s.gameCore.sight.UpdateFrame();
var n = performance.now();
y.instance.UpdateCardDrawingQueue();
var i = performance.now(),
a = i - this.time0;
this.time0 = i;
let t = .5 * this.delta;
this.cells.forEach(function(e) {
e.UpdateInterpolation(a, i + t), e.UpdateGraphicsForFrame(), r.gs.uconfig.TogglePlayerTransparentCells && e.isPlayerCell ? (e.baseSprite.alpha = r.gs.uconfig.PlayerCellsAlpha, e.baseShape.alpha = r.gs.uconfig.PlayerCellsAlpha, e.overShape.fillAlpha = 0) : r.gs.uconfig.GlowingNonPlayerCells || !e.isFood && !e.isPellet ? (e.baseSprite.alpha = 1, e.baseShape.alpha = 1, e.overShape.fillAlpha = 1) : (e.baseSprite.alpha = r.gs.uconfig.PelletCellsAlpha, e.baseShape.alpha = r.gs.uconfig.PelletCellsAlpha, e.overShape.fillAlpha = 0)
}), this.gfs.Update(), this.checkQueue_interval.Push(a), this.cellsBox.sortChildren(), this.UpdateStagePlacement(), this.fieldGraphics.SetScale(r.gs.gconfig.FieldSize / this.fieldGraphics.baseSize), this.renderer.render(this.drawingRoot);
var l = performance.now() - n;
this.delta = (this.delta + performance.now() - i) / 2, this.checkQueue_duration.Push(l)
}
}, t.prototype.UpdatePerf = function() {
setTimeout(this.UpdatePerf.bind(this), 1e3), o.TimeChecker.Start("UpdatePerf");
var t = s.gameCore.perfModel,
e = this.checkQueue_duration.GetAverageValue();
t.avgDuration = e, t.avgRate = e / 17;
var n = this.checkQueue_interval.GetAverageValue();
t.avgFps = 1e3 / n, t.numCellsRendered = this.cells.size, o.TimeChecker.Stop()
}, t.prototype.updateWaves = function() {
let t = gVar.Waves;
for (let e = t.length - 1; e >= 0; e--) {
this.wave_Sprite.visible = !0;
let n = (Date.now() - t[e].time) / 2;
this.wave_Sprite.position.x = t[e].x, this.wave_Sprite.position.y = t[e].y, this.wave_Sprite.scale.set(1 + .01 * n), this.wave_Sprite.alpha -= 1e-4 * n / 5, n > t[e].wavelength && (gVar.Waves.splice(e, 1), this.wave_Sprite.visible = !1, this.wave_Sprite.alpha = 1)
}
}, t.prototype.UpdateStagePlacement = function() {
var t = this.stage,
e = s.gameCore.sight,
n = e.scw / 2 - e.eyeX * e.eyeScale,
i = e.sch / 2 - e.eyeY * e.eyeScale;
t.position.x = n, t.position.y = i, t.scale.x = e.eyeScale, t.scale.y = e.eyeScale
}, t.prototype.SyncNodeListToModel = function() {
var t = this,
e = s.gameCore.nodeMan,
n = new Set(this.cells.keys()),
i = new Set;
e.nodes.forEach(function(t) {
0 == t.cellType && (s.gameCore.uMan.GetUserInfoById(t.ownerPlayerId), i.add(t.ownerPlayerId))
}), i.forEach(function(t) {
y.instance.GetCellCard(t, !0).Update()
}), e.nodes.forEach(function(e) {
var i = e.nodeId,
o = t.cells.get(i);
o || ((o = v.Gain()).Initialize(e), t.cells.set(i, o), t.cellsBox.addChild(o.box)), o.UpdateProps(e), n.delete(i)
}), n.forEach(function(e) {
var n = t.cells.get(e);
t.cellsBox.removeChild(n.box), t.cells.delete(e), n.Release()
})
}, t
}();
t.GameView = S
}(e.GameViewDomain2 || (e.GameViewDomain2 = {}))
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(0),
o = n(4),
r = function() {
function t() {}
return t.prototype.Initialize = function(t) {
this.ctx = t.getContext("2d"), this.sz = t.width, o.gameCore.gameHudModel.chartDataHandlerProc = this.PostTeamRankingData.bind(this)
}, t.prototype.NormAngleToChartAngle = function(t) {
var e = Math.PI;
return .5 * -e + t * e * 2
}, t.prototype.PostTeamRankingData = function(t) {
if (i.gs.uconfig.ShowLeaderboard || !i.gs.gconfig.ShowTeamRanking) {
var e = this.ctx,
n = this.sz / 2,
o = this.sz / 2,
r = Math.PI;
e.font = "16px CustomFont1, メイリオ, Arial", e.fillStyle = "#CCC", e.clearRect(0, 0, this.sz, this.sz), e.beginPath(), e.arc(n, n, o, 0, 2 * r, !1), e.fill();
for (var s = 0, a = 0, l = t; a < l.length; a++) {
var c = (m = l[a]).name,
h = m.colorStr,
d = 1e-4 * m.score;
e.fillStyle = h, e.beginPath();
var u = this.NormAngleToChartAngle(s),
p = this.NormAngleToChartAngle(s + d);
e.moveTo(n, n), e.lineTo(n + Math.cos(u) * o, n + Math.sin(u) * o), e.arc(n, n, o, u, p, !1), e.lineTo(n, n), e.stroke(), e.fill(), s += d
}
e.beginPath(), e.arc(n, n, o, 0, 2 * r, !1), e.stroke(), s = 0;
for (var g = 0, f = t; g < f.length; g++) {
var m;
if (c = (m = f[g]).name, d = 1e-4 * m.score, u = this.NormAngleToChartAngle(s), p = this.NormAngleToChartAngle(s + d), d > .07) {
var y = (u + p) / 2,
v = e.measureText(c).width;
e.fillStyle = "black";
var S = .6 * o;
e.fillText(c, n + Math.cos(y) * S - v / 2, n + Math.sin(y) * S + 4)
}
s += d
}
}
}, t
}();
e.TeamRankingChartView = r
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
const i = 100,
o = (new PIXI.Graphics).beginFill(16777215, 1).drawCircle(0, 0, 50).endFill().generateCanvasTexture(1, 2),
r = (new PIXI.Graphics).lineStyle(24, 16777215).drawCircle(0, 0, 38).generateCanvasTexture(1, 2),
s = (new PIXI.Graphics).beginFill(16777215, 1).drawCircle(0, 0, 50).endFill().lineStyle(8, 16777215).drawCircle(0, 0, 66).generateCanvasTexture();
o.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, r.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, s.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON, PIXI.Texture.addToCache(o, "MM_BASE"), PIXI.Texture.addToCache(r, "MM_ENEMY"), PIXI.Texture.addToCache(s, "MM_SELF");
var a = n(1),
l = n(3),
c = n(0),
h = n(4),
d = n(12),
u = n(6),
p = function() {
function t() {
this.box = new u.Container, this.box2 = new u.Container, this.box.addChild(this.box2), this.baseShape = new u.Sprite, this.baseShape.anchor.set(.5), this.box2.addChild(this.baseShape), this.box2.alpha = 1, this.nameLabel = new u.Text, this.massLabel = new u.BitmapText("", {
fontName: "MINIMAP_MASS"
}), this.SetupLabel(this.nameLabel, 0), this.box.addChild(this.nameLabel), this.box.addChild(this.massLabel)
}
return t.Gain = function() {
return t.pool.Gain()
}, t.prototype.Release = function() {
t.pool.Release(this)
}, t.prototype.Initialize = function(t, e) {
this.playerId = t, this.isBot = e, this.name = null, this.shortName = null, this.color = 0, this.mass = 0, this.x = 0, this.y = 0, this.scale = 0, this.x1 = 0, this.y1 = 0, this.scale1 = 0, this.updated = !0, this.isSelfNode = !0, this.isTeammate = !1, this.nameLabel.style.fill = "#FFFFFF", this.nameLabel.text = null, this.massLabel.text = this.mass, this.nameLabel.visible = !e
}, t.prototype.SetupLabel = function(t) {
t.style.fontFamily = "Meiryo, Arial", t.style.fontSize = 13, t.style.fill = "#FFFFFF"
}, t.prototype.SetBasicProps = function(t, e, n, i) {
if (this.nameLabel && this.name != t) {
var o = this.nameLabel;
o.text = t, o.x = -o.width / 2, o.y = -o.height / 2, this.name = t
}
this.shortName = i, this.teamId = n, this.nameLabel.visible = !this.isBot && !e
}, t.prototype.UpdateBotDynamicProps = function(t, e) {
var n = this.massLabel;
if (n.x = n.width / 2, n.y = n.height / 2, this.nameLabel && this.name != e) {
var i = this.nameLabel;
i.text = e, i.x = -i.width / 2, i.y = -i.height / 2, this.name = e
}
this.isBot = t, this.nameLabel.visible = !this.isBot && !this.isSelfNode
}, t.prototype.SetVariableProps = function(t, e, n) {
this.isTeammate = e;
const i = c.gs.gstates;
if (this.color != t || this.isSelfNode != n) {
this.isSelfNode = n, this.baseShape.tint = this.color = t;
var o = l.ColorHelper.ColorToHtmlString(t);
this.nameLabel && (this.nameLabel.style.fill = o)
}
i.isSpectate && !i.isDeadSpectation ? (this.isSelfNode ? this.baseShape.texture = PIXI.utils.TextureCache.MM_SELF : this.baseShape.texture = PIXI.utils.TextureCache.MM_BASE, this.baseShape.alpha = 1, this.nameLabel.alpha = 1) : (this.isSelfNode ? this.baseShape.texture = PIXI.utils.TextureCache.MM_SELF : (this.isTeammate || this.isBot) && (this.baseShape.texture = PIXI.utils.TextureCache.MM_BASE), this.baseShape.alpha = this.isBot ? .75 : this.isTeammate ? 1 : .375, this.nameLabel.alpha = this.isTeammate ? 1 : .75), this.box.visible = !0
}, t.prototype.UpdateInterpolation = function() {
var t;
(this.x = a.Nums.EasyFilter(this.x, this.x1, .99), this.y = a.Nums.EasyFilter(this.y, this.y1, .99), this.box.x = this.x, this.box.y = this.y, this.box2.scale.x = this.scale, this.box2.scale.y = this.scale, this.scale = a.Nums.EasyFilter(this.scale, this.scale1, .99), this.nameLabel) && ((t = this.nameLabel).y = -t.height - 40 * this.scale);
if (this.massLabel) {
var t = this.massLabel;
const e = this.mass;
t.alpha = e > 5600 ? this.isTeammate ? 0 : Math.min(e / 12500 + .2, .95) : 0, t.y = -t.height / 1.5, t.x = -t.width / 2
}
}, t.prototype.SetPosRadius = function(e, n, i) {
var o = t.mapCoordScale;
e *= o, n *= o;
var r = 0 == this.mass;
this.mass = i, this.box._zIndex = i, this.massLabel.text = (i / 100 >> 0) / 10 + "K";
var s = l.GameHelper.MassToRadius(i);
s *= o, s *= .75, this.isSelfNode && s < 4 && (s = 4);
var a = 2 * s / t.CellBaseSize;
this.x1 = e, this.y1 = n, this.scale1 = a, r && (this.x = e, this.y = n, this.scale = a, this.box.x = e, this.box.y = n, this.box2.scale.x = a, this.box2.scale.y = a)
}, t.mapCoordScale = .01, t.CellBaseSize = i, t.pool = new l.ObjectPool(c.gs.gconfig.MaxPlayerUnitNum, function() {
return new t
}), t
}(),
g = function() {
function t() {
this.box = new u.Container, this.gr = new u.Graphics, this.box.addChild(this.gr), this.box.zIndex = 100
}
return t.prototype.Update = function() {
var t = h.gameCore.sight,
e = this.gr,
n = p.mapCoordScale;
if (e.clear(), c.gs.gstates.isRealtimeMode) {
var i = c.gs.ucolors.colorDefs.clGameForeground;
e.lineStyle(1, i);
var o = t.eyeX * n,
r = t.eyeY * n,
s = c.gs.gconfig.FieldSize * n;
e.alpha = .6, e.moveTo(o, 0), e.lineTo(o, s), e.moveTo(0, r), e.lineTo(s, r);
var a = t.ScreenToWorld(0, 0),
l = a[0],
d = a[1],
u = t.ScreenToWorld(window.innerWidth, window.innerHeight),
g = u[0],
f = u[1];
l *= n, d *= n, g *= n, f *= n, e.moveTo(l, d), e.lineTo(g, d), e.lineTo(g, f), e.lineTo(l, f), e.lineTo(l, d)
}
}, t
}(),
f = function() {
function t() {
this.nodes = new Map, this.mapFrontScreen = new g
}
return t.prototype.Initialize = function(t) {
var e = this;
this.uMan = h.gameCore.uMan, this.sz = t.width;
var n = {
width: t.width,
height: t.height,
view: t,
antialias: c.gs.uconfig.Antialias,
transparent: !0,
resolution: c.gs.uconfig.HDMode / 2 + 1,
autoDensity: !0
};
SUB_RENDERER = u.autoDetectRenderer(n), this.renderer = SUB_RENDERER, this.drawingRoot = new u.Container;
var i = new d.FieldGraphics(!1);
this.drawingRoot.addChild(i.box), i.SetScale(this.sz / i.baseSize), this.stage = new u.Container, this.stage.addChild(this.mapFrontScreen.box), this.drawingRoot.addChild(this.stage);
var o = function() {
requestAnimationFrame(o), c.gs.uconfig.ShowMap && e.FrameProc()
};
o(), h.gameCore.gameHudModel.mapDataHandlerProc = this.PostMapData.bind(this)
}, t.prototype.FrameProc = function() {
l.PageHelper.Instance.IsActive && (p.mapCoordScale = this.sz / c.gs.gconfig.FieldSize, this.mapFrontScreen.Update(), this.nodes.forEach(function(t) {
return t.UpdateInterpolation()
}), this.renderer.render(this.drawingRoot))
}, t.prototype.PostMapData = function(t) {
var e = this;
this.nodes.forEach(function(t) {
return t.updated = !1
});
for (var n = 0, i = t; n < i.length; n++) {
var o = i[n],
r = o.playerId,
s = this.nodes.get(r);
if (!s) {
var a = this.uMan.GetUserInfoById(r);
if (-1 == a.clientId) continue;
g = a.miniMapName, f = a.isBot, (s = p.Gain()).Initialize(r, f);
var l = (65534 & r) == this.uMan.selfUserId;
s.SetBasicProps(g, l, a.teamId, a.name), this.stage.addChild(s.box), this.nodes.set(r, s)
}
var c = this.uMan.GetTeamInfoForUser(r),
d = c == this.uMan.selfTeamInfo,
u = r == h.gameCore.nodeMan.activeSelfPlayerId;
s.SetVariableProps(c.color, d, u), s.SetPosRadius(o.nx, o.ny, o.mass), s.updated = !0;
var m = this.uMan.GetUserInfoById(r);
if (-1 != m.clientId) {
var y = m.miniMapName,
v = m.isBot;
s.name == y && s.isBot == v || s.UpdateBotDynamicProps(v, y)
}
}
var S = [];
this.nodes.forEach(function(t) {
return !t.updated && S.push(t)
}), S.forEach(function(t) {
e.stage.removeChild(t.box), e.nodes.delete(t.playerId), t.Release()
}), e.stage.sortChildren()
}, t
}();
e.MapView = f
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(0),
o = n(3),
r = n(2),
s = n(4),
a = function() {
return function(senderName, message, timeStamp, nameColor, skinUrl ,tripKey) {
this.senderName = senderName,
this.message = message,
this.timeStamp = timeStamp,
this.nameColor = nameColor,
this.skinUrl = skinUrl,
this.tripKey = tripKey
}
}();
e.ChatMessage = a;
var l = function() {
function t(t) {
this.text = "", this.color = "", this.score = "", this.active = !1, this.index = t
}
return t.prototype.setData = function(t, e, n) {
this.text = t, this.color = e, this.score = n, this.active = !0
}, t.prototype.setNoData = function() {
this.active = !1
}, t
}();
e.LeaderboardEntry = l;
var c = function() {
function t() {
this.leaderboardEntries = [], this.teamRankingEntries = [], this.chatMessages = [], this.selfScore = 0, this.maxScore = 0, this.leaderboardHeaderText = ""
}
return t.prototype.insertStubChatMessages = function() {
for (var t = 0; t < 2; t++) this.PostChatMessage("テスト" + t, "テスト", "0:00", null)
}, t.prototype.insertStubData = function() {}, t.prototype.Initialize = function() {
this.leaderboardHeaderText = r.AppConfigurator.instance.leaderboardHeaderText;
for (var t = 0; t < 10; t++)(e = new l(t)).setNoData(), this.leaderboardEntries.push(e);
for (t = 0; t < 4; t++) {
var e;
(e = new l(t)).setNoData(), this.teamRankingEntries.push(e)
}
this.insertStubData()
}, t.prototype.SetAimPlayerClient = function(t) {
if (this.specTargetUserId != t) {
if (this.specTargetUserId = t, t >= 0 && t != s.gameCore.uMan.selfUserId) {
var e = s.gameCore.uMan.GetUserInfoById(t);
this.specTargetName = e.fullName
} else this.specTargetName = null;
this.isHudUpdated = !0
}
}, t.prototype.SetSpecTargetScore = function(t) {
this.specTargetScore = t, this.isHudUpdated = !0
}, t.prototype.PostServerStatusData = function(t) {
o.PageHelper.Instance.IsActive && (this.serverStatusText = t.split(/\r?\n/), this.isHudUpdated = !0)
}, t.prototype.PostLatencyData = function(t) {
this.latencyMs = t, this.isHudUpdated = !0
}, t.prototype.PostServerUserNumData = function(t, e, n, i) {
var o = t + e + " / " + i + " (ᴘʟᴀʏ: " + t + ", ꜱᴘᴇᴄ: " + e + "), ʙᴏᴛ: " + n;
this.serverUserNumText = o, this.isHudUpdated = !0
}, t.prototype.PostLeaderboardData = function(t) {
if (o.PageHelper.Instance.IsActive && i.gs.uconfig.ShowLeaderboard) {
for (var e = 0; e < this.leaderboardEntries.length; e++) {
var n = this.leaderboardEntries[e];
if (e < t.length) {
var r = t[e];
n.setData(r.name, r.colorStr, (.001 * r.score).toFixed(1) + "k")
} else n.setNoData()
}
this.isHudUpdated = !0
}
}, t.prototype.PostTeamRankingData = function(t) {
if (o.PageHelper.Instance.IsActive) {
if (i.gs.uconfig.ShowLeaderboard) {
for (var e = 0; e < this.teamRankingEntries.length; e++) {
var n = this.teamRankingEntries[e];
if (e < t.length) {
var r = t[e];
n.setData(r.name, r.colorStr, (.01 * r.score).toFixed(1) + "%")
} else n.setNoData()
}
this.isHudUpdated = !0
}
this.chartDataHandlerProc(t)
}
}, t.prototype.PostMapData = function(t) {
i.gs.uconfig.ShowMap && this.mapDataHandlerProc(t)
}, t.prototype.ClearChatMessages = function() {
this.chatMessages = [], this.isHudUpdated = !0
}, t.prototype.PostChatMessage = function(t, e, n, i, skin, trip) {
i || (i = "#0CF");
var o = new a(e, n, t, i, skin, trip);
this.chatMessages.push(o), this.isHudUpdated = !0
}, t.prototype.PostServerDisplayMessage = function(t) {
this.serverDisplayMessageText = t, this.isHudUpdated = !0
}, t.prototype.PostServerInstructionText = function(t) {
this.serverInstructionProc(t)
}, t.prototype.ResetMaxScore = function() {
this.maxScore = 0, this.selfScore = 0
}, t.prototype.PostSelfScoreData = function(t) {
this.selfScore = t, this.maxScore = Math.max(this.maxScore, t), this.isHudUpdated = !0
}, t.prototype.SetSplitNum = function(t) {
this.splitNum = t, this.isHudUpdated = !0
}, t
}();
e.GameHudModel = c
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(2),
o = n(3),
r = n(0),
s = function() {};
e.ServerInfo = s;
var a = function() {
function t(t) {
this.gameCore = t;
var e = o.AppHelper.GetQueryObject();
this.showAll = 1 == e.showall
}
return t.prototype.Start = function() {
this.langCode = navigator.language.slice(0, 2), this.UpdateList()
}, t.prototype.ConnectToServer = function(t) {
if (Date.now() - r.gs.gstates.playerDeadTimeStamp < 2e3) console.log("server selection cancelled");
else {
var e = t.address;
this.currentServerUri = e, localStorage.setItem("connTargetUri", e);
var n = t.modName;
this.gameCore.ConnectToGameServerEx("ws://" + e, n)
}
}, t.prototype.FilterServers = function(t) {
var e = this;
if (t.forEach(function(t) {
t.modName = t.name, t.numClients = t.numPlayers + t.numSpectors, t.order += t.mirrorIndex, -1 != t.mirrorIndex && (t.modName += t.mirrorIndex), t.langCode && e.langCode != t.langCode && (t.visible = !1)
}), !this.showAll) {
for (var n = {}, i = 0, o = t; i < o.length; i++) n[(a = o[i]).name + a.mirrorIndex] = a;
for (var r = 0, s = t; r < s.length; r++) {
var a, l = a = s[r],
c = n[a.name + (a.mirrorIndex - 1)];
c && (c.numClients > c.numMaxClients - 25 || l.numClients > 10 || (l.visible = !1))
}
}
return t.filter(function(t) {
return t.visible
}).sort(function(t, e) {
return t.order - e.order
})
}, t.prototype.UpdateList = function() {
var t = this,
e = i.AppConfigurator.instance.trackerServerUri,
n = i.AppConfigurator.instance.trackerServerTargetSite;
$.ajax({
type: "GET",
url: e + "/list",
data: {
targetSite: n
},
success: function(e) {
if (t.serverInfos = t.FilterServers(e), null == t.currentServerUri && t.serverInfos.length > 0) {
var n = localStorage.getItem("connTargetUri"),
i = null;
if (n)
for (var o = 0, r = t.serverInfos; o < r.length; o++) {
var s = r[o];
if (s.address == n) {
i = s;
break
}
}
i || (i = t.serverInfos[0]), t.ConnectToServer(i)
}
t.Notify()
}
}), setTimeout(this.UpdateList.bind(this), 5e3)
}, t
}();
e.ServerListModel = a
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1),
o = n(0),
r = n(3),
s = function() {
function t() {}
return t.AllocatePool = function() {
null == this.pool && (this.pool = new r.ObjectPool(1e3, function() {
return new t
}))
}, t.prototype.Initialize = function(e) {
this.nodeId = t.seqId++, this.ownerPlayerId = e, this.counter = 0;
var n = o.gs.gconfig.FieldSize;
this.x = i.Nums.RandF() * n, this.y = i.Nums.RandF() * n;
var s = i.Nums.RandF();
this.mass = i.Nums.MapTo(s * s * s, 500, 22500) >> 0, this.color = r.GameHelper.GenarateRandomColor(), this.m_angle = i.Nums.RandF() * Math.PI * 2, this.speed = i.Nums.MapTo(i.Nums.RandF(), 20, 80), this.nr = r.GameHelper.MassToRadius(this.mass)
}, t.prototype.Update = function() {
this.x += Math.cos(this.m_angle) * this.speed, this.y += Math.sin(this.m_angle) * this.speed, this.counter++ % 4 == 0 && (this.mass += 100 * Math.random() - 50, this.mass = Math.max(Math.min(this.mass >> 0, 22500), 500));
var t = 1.1 * this.nr,
e = o.gs.gconfig.FieldSize;
i.Nums.InRange(this.x, t, e - t) || (this.m_angle = Math.PI - this.m_angle), i.Nums.InRange(this.y, t, e - t) || (this.m_angle = -this.m_angle)
}, t.seqId = 0, t
}(),
a = function() {
function t(t) {
this.nodes = [], this.tick = 0, this.gameCore = t
}
return t.prototype.Start = function() {
this.playerIds = this.gameCore.uMan.GetPlayerIdsAvailable(), s.AllocatePool(), this.averageFps = 60, this.t0 = performance.now();
for (var t = 0; t < 700; t++);
}, t.prototype.AddNode = function() {
var t = i.Nums.RandI(this.playerIds.length),
e = this.playerIds[t],
n = s.pool.Gain();
n.Initialize(e), this.nodes.push(n)
}, t.prototype.RemoveNode = function() {
var t = this.nodes.shift();
t && (s.pool.Release(t), this.gameCore.nodeMan.PostNodeRemoval(t.nodeId))
}, t.prototype.ClearNodes = function() {
for (var t = 0, e = this.nodes; t < e.length; t++) {
var n = e[t];
s.pool.Release(n), this.gameCore.nodeMan.PostNodeRemoval(n.nodeId)
}
this.nodes = []
}, t.prototype.FrameUpdateProc = function() {
var t = performance.now(),
e = 1e3 / (t - this.t0);
this.t0 = t, this.averageFps = i.Nums.EasyFilter(this.averageFps, e, .95), this.tick++, this.tick % 2 == 0 && (this.averageFps > 55 ? this.AddNode() : this.RemoveNode());
var n = this.gameCore.nodeMan;
this.nodes.forEach(function(t) {
t.Update(), n.PostNodeData(t.nodeId, 0, t.x, t.y, t.mass, t.ownerPlayerId, t.color, t.m_angle, t.speed)
}), n.SyncGameViewToModel()
}, t.prototype.Stop = function() {
this.ClearNodes()
}, t
}();
e.PerfBenchDataFeeder = a
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t(t) {
this.ar = [], t && (t instanceof Array ? this.AddRange(t) : this.Add(t))
}
return Object.defineProperty(t.prototype, "array", {
get: function() {
return this.ar
},
enumerable: !0,
configurable: !0
}), t.prototype.Count = function(t) {
if (t) {
var e = 0;
return this.ar.forEach(function(n) {
t(n) && e++
}), e
}
return this.ar.length
}, t.prototype.Add = function(t) {
this.ar.push(t)
}, t.prototype.AddUnique = function(t) {
this.Contains(t) || this.ar.push(t)
}, t.prototype.AddRange = function(t) {
var e;
(e = this.ar).push.apply(e, t)
}, t.prototype.Clear = function() {
this.ar.splice(0, this.ar.length)
}, t.prototype.RemoveAt = function(t) {
this.ar.splice(t, 1)
}, t.prototype.Remove = function(t) {
var e = this.ar.indexOf(t);
e >= 0 && this.ar.splice(e, 1)
}, t.prototype.RemoveAll = function(t) {
var e = this;
this.ar.filter(function(e) {
return t(e)
}).forEach(function(t) {
return e.Remove(t)
})
}, t.prototype.Contains = function(t) {
return this.ar.indexOf(t) >= 0
}, t.prototype.First = function(t) {
return 0 == this.ar.length ? null : t ? this.ar.filter(t)[0] : this.ar[0]
}, t.prototype.FirstOrDefault = function(t, e) {
return 0 == this.ar.length ? e : t ? this.ar.filter(t)[0] : this.ar[0]
}, t.prototype.Product = function(e) {
return new t(this.ar.filter(function(t) {
return e.Contains(t)
}))
}, t.prototype.Except = function(e) {
return new t(this.ar.filter(function(t) {
return e.ar.every(function(e) {
return t != e
})
}))
}, t.prototype.Concat = function(e) {
return new t(this.ar.concat(e.ar))
}, t.prototype.Distinct = function() {
var e = new t;
return this.ar.forEach(function(t) {
e.Contains(t) || e.Add(t)
}), e
}, t.prototype.Union = function(t) {
var e = this.ToList();
return t.ar.forEach(function(t) {
e.Contains(t) || e.Add(t)
}), e
}, t.prototype.ForEach = function(t) {
for (var e = 0; e < this.ar.length; e++) t(this.ar[e])
}, t.prototype.Where = function(e) {
return new t(this.ar.filter(e))
}, t.prototype.Select = function(e) {
return new t(this.ar.map(e))
}, t.prototype.LimitCount = function(e) {
return e < this.ar.length ? new t(this.ar.slice(0, e)) : this
}, t.prototype.Sort = function(e) {
return new t(this.ar.sort(e))
}, t.prototype.GroupBy = function(e) {
var n = {};
this.ar.forEach(function(i) {
var o = e(i);
n[o] || (n[o] = new t), n[o].Add(i)
});
var i = new t;
for (var o in n) i.ar.push(n[o]);
return i
}, t.prototype.Take = function(e) {
return new t(e > 0 ? this.ar.slice(0, e) : this.ar.slice(e))
}, t.prototype.TakeNFromTail = function(e) {
return new t(this.ar.slice(-e))
}, t.prototype.Skip = function(e) {
return e > this.ar.length ? new t : new t(this.ar.slice(e))
}, t.prototype.All = function(t) {
for (var e = 0, n = this.ar; e < n.length; e++)
if (!t(n[e])) return !1;
return !0
}, t.prototype.Any = function(t) {
for (var e = 0, n = this.ar; e < n.length; e++)
if (t(n[e])) return !0;
return !1
}, t.prototype.ToArray = function() {
return this.ar.slice(0)
}, t.prototype.ToList = function() {
return new t(this.ar.slice(0))
}, t.prototype.Min = function(t) {
var e = t ? this.ar.map(t) : this;
return Math.min.apply(Math, e)
}, t.prototype.Max = function(t) {
var e = t ? this.ar.map(t) : this;
return Math.max.apply(Math, e)
}, t.prototype.Sum = function(t) {
return 0 == this.Count() ? 0 : (t ? this.ar.map(t) : this).reduce(function(t, e) {
return t + e
})
}, t.prototype.SafeSum = function(t) {
return this.Sum(t)
}, t.prototype.Average = function(t) {
return 0 == this.Count() ? 0 : this.Sum(t) / this.ar.length
}, t.prototype.OrderBy = function(e) {
var n = this.ar.slice(0);
return n.sort(function(t, n) {
return e(t) - e(n)
}), new t(n)
}, t.prototype.OrderByDescending = function(e) {
var n = this.ar.slice(0);
return n.sort(function(t, n) {
return e(n) - e(t)
}), new t(n)
}, t.prototype.SelectMany = function(e) {
var n = new t;
return this.ar.forEach(function(t) {
var i = e(t);
n.AddRange(i.ar)
}), n
}, t.prototype.IndicesOf = function(e) {
for (var n = [], i = 0; i < this.ar.length; i++) this.ar[i] == e && n.push(i);
return new t(n)
}, t.prototype.SafeTake = function(t) {
return this.Take(Math.min(t, this.ar.length))
}, t.prototype.Reverse = function() {
return new t(this.ar.reverse())
}, t.prototype.Shift = function() {
return this.ar.shift()
}, t
}();
e.List = i
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(2),
o = n(32),
r = n(1),
s = n(3),
a = new function() {
this.ChatAppCoreVersion = "ChatAppCore B100", this.MessageMaxLength = 140, this.ProfileCommentMaxLength = 60
},
l = function() {
this.Sessions = "Session", this.TeamMembers = "Team Members", this.AllUsers = "All Users", this.Online = "Online", this.Offline = "Offline", this.Advertisement = "AD", this.Name = "Name", this.Skin = "Skin", this.Comment = "Comment", this.ShowTripKey = "Show Trip Key", this.Blocked = "Blocked", this.BlockedMessageNotification = "You are blocked by the peer. This message has not been sent.", this.DeleteMessage = "Delete Message", this.BlockUnblock = "Block/Unblock", this.AppInstruction0 = "An advanced chat system designed for agar private servers. There are server-wide chat, team-specific chat, and private chat between two users. Server administator has no concern in private chat.", this.AppInstruction1 = "Name and skin url are set on the main game window. Either server-wide chat or team-specific chat is synchronized to the chat on game screen (depends on the setting of game server)."
},
c = function() {
this.Sessions = "セッション", this.TeamMembers = "チームメンバー", this.AllUsers = "すべてのユーザー", this.Online = "オンライン", this.Offline = "オフライン", this.Advertisement = "広告", this.Name = "名前", this.Skin = "スキン", this.Comment = "コメント", this.ShowTripKey = "トリップキーを表示", this.Blocked = "ブロック中", this.BlockedMessageNotification = "ブロックされています。この発言は相手に届いていません。", this.DeleteMessage = "メッセージを削除", this.BlockUnblock = "ブロック/解除", this.AppInstruction0 = "agarのプライベートサーバ向けに設計されたチャットシステムです。サーバ全体での会話,チーム毎の会話,ユーザ間での個別の会話があります。サーバ管理者はユーザ同士の個別の会話の内容には関知しません。", this.AppInstruction1 = "名前とスキンURLはゲーム画面で設定したものが使われます。全体の会話またはチームの会話がゲーム内でのチャットと同期しています(ゲームサーバの設定により異なります)。"
},
h = navigator.language.startsWith("ja") ? new c : new l,
d = n(0).gs.uconfig,
u = function() {
function t(t) {
this.userId = t
}
return Object.defineProperty(t.prototype, "FullName", {
get: function() {
return this.name
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "GameFullName", {
get: function() {
return "" + this.team + this.name
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "showTripKey", {
get: function() {
return !!d.ShowTripKey || this._showTripKey
},
enumerable: !0,
configurable: !0
}),
Object.defineProperty(t.prototype, "ChatTrip", {
get: function() {
return "(" + this.fullTrip.split("#")[0].substr(2, 4) + ")"
},
enumerable: !0,
configurable: !0
}),t.prototype.SetProps = function(t) {
this.siteSig = t.siteSig, this.serverSig = t.serverSig, this.name = t.name, this.team = t.team, this.code = t.code, this.skinUrl = t.skinUrl, this.skinUrlSmall = t.skinUrlSmall, this.fullTrip = t.fullTrip;
const e = t.fullTrip.split("#"),
n = e[0],
i = e[1];
this.shortTrip = n + "|" + i, "" == this.skinUrl && (this.skinUrl = "gr/noimage.gif"), "" == this.skinUrlSmall && (this.skinUrlSmall = "gr/noimage.gif"), this.profileComment = t.profileComment, this._showTripKey = t.showTripKey, this.isPlaying = t.isPlaying, this.serverRoomSig = this.siteSig + "." + this.serverSig, this.teamRoomSig = this.siteSig + "." + this.serverSig + "." + this.team + "." + this.code
}, t
}();
e.ChatUser = u;
var p = function() {
function t(t, e, n) {
this.text = e, this.messageId = n, t && (this.icon = t.skinUrlSmall, this.userId = t.userId, this.userName = t.GameFullName, this.timeStamp = r.DateTimeHelper.GetHourMinutesString())
}
return t.prototype.MakeCopy = function() {
var e = new t(null, "", 0);
return e.icon = this.icon, e.text = this.text, e.messageId = this.messageId, e.userId = this.userId, e.userName = this.userName, e.timeStamp = this.timeStamp, e
}, t
}(),
g = function() {
function t(t) {
this.sessionId = t, this.messages = new o.List, this.isClosed = !1
}
return Object.defineProperty(t.prototype, "IsGroup", {
get: function() {
return 20 != this.category
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "IsPrivate", {
get: function() {
return 20 == this.category
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "HeaderName", {
get: function() {
return 12 == this.category && "" == this.title ? "no-tag" : this.IsGroup ? this.title : this.peer.GameFullName
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "HeaderIcon", {
get: function() {
return 20 == this.category ? this.peer.skinUrl : 12 == this.category ? "gr/team5a.png" : 11 == this.category ? "gr/web1b.png" : void 0
},
enumerable: !0,
configurable: !0
}), t.prototype.InitAsGroupSession = function(t, e, n) {
this.category = t, this.roomSig = e, this.title = n, this.peer = null
}, t.prototype.InitAsPrivateSession = function(t) {
this.category = 20, this.roomSig = "", this.title = "", this.peer = t
}, t.prototype.AddMessage = function(t) {
this.messages.Add(t), this.reqScroll = !0
}, t.prototype.RemoveMessage = function(t, e) {
var n = this.messages.First(function(e) {
return e.messageId == t
});
if (n && (this.messages.Remove(n), e)) {
var i = n.MakeCopy();
i.text = h.BlockedMessageNotification, this.messages.Add(i)
}
}, t
}(),
f = function() {
function t() {
this.siteSig = "", this.serverSig = "", this.name = "", this.team = "", this.code = "", this.skinUrl = "", this.envSig = "", this.profileComment = "", this.showTripKey = !1
}
return t.prototype.GetSequentialSignature = function() {
return this.siteSig + "_" + this.serverSig + "_" + this.name + "_" + this.team + "_" + this.code + "_" + this.skinUrl + "_" + this.profileComment + "_" + this.showTripKey + "_" + this.envSig
}, t
}(),
m = function() {
function t(t) {
this.receiver = t
}
return Object.defineProperty(t.prototype, "IsConnected", {
get: function() {
return null != this.ws
},
enumerable: !0,
configurable: !0
}), t.prototype.SendPacket = function(t) {
this.ws && this.ws.readyState == WebSocket.OPEN && this.ws.send(t)
}, t.prototype.ConnectToChatServer = function() {
console.log("connecting to chat server"), this.ws = new WebSocket(a.ChatServerUri), this.ws.onmessage = this.OnWsMessage.bind(this), this.ws.onopen = this.OnWsOpen.bind(this), this.ws.onerror = this.OnWsError.bind(this), this.ws.onclose = this.OnWsClose.bind(this)
}, t.prototype.Close = function() {
this.ws && (this.ws.close(), this.ws = null)
}, t.prototype.OnWsOpen = function() {
this.SendPacket(JSON.stringify({
op: "JoinToServer"
}))
}, t.prototype.OnWsClose = function(t) {
t.reason && console.log("connection to chat server closed: " + t.reason), this.receiver.SetAvailability(!1), this.receiver.FireChanged()
}, t.prototype.OnWsError = function(t) {
console.log(t)
}, t.prototype.OnWsMessage = function(t) {
s.TimeChecker.Start("OnWsMessage@ExChatAppModel");
var e = JSON.parse(t.data),
n = e.op;
"SelfUserId" == n ? (this.selfUserId = e.userId, this.selfUserId, this.pendingUserInfo && (this.SendSelfEntryInfoCore(this.pendingUserInfo), this.pendingUserInfo = null), this.receiver.SetAvailability(!0)) : "UpdateUserInfos" == n ? this.receiver.UserInfosUpdated(e.infos) : "UpdateFixedGroupSessions" == n ? this.receiver.UpdateFixedGroupSessionInfos(e.infos) : "UpdatePrivateSession" == n ? this.receiver.UpdatePrivateSessionInfo(e.info) : "ChatMessage" == n ? this.receiver.HandleReceivedMessage(e.data) : "MessageRemoval" == n && this.receiver.HandleMessageRemoval(e.data), this.receiver.FireChanged(), s.TimeChecker.Stop()
}, t.prototype.SendSelfEntryInfoCore = function(t) {
var e = JSON.stringify({
op: "UpdateUserInfo",
userId: this.selfUserId,
data: t
});
this.SendPacket(e)
}, t.prototype.SendSelfEntryInfo = function(t, e) {
this.ws ? this.SendSelfEntryInfoCore(t) : (this.pendingUserInfo = t, e && this.ConnectToChatServer())
}, t.prototype.RequestStartNewPrivateSession = function(t) {
this.SendPacket(JSON.stringify({
op: "NewPrivateSession",
userId: this.selfUserId,
peerUserId: t
}))
}, t.prototype.SendChatMessage = function(t, e) {
var n = a.MessageMaxLength;
e.length > n && (e = e.substr(0, n));
var i = {
sessionId: t,
userId: this.selfUserId,
text: e
};
this.SendPacket(JSON.stringify({
op: "ChatMessage",
userId: this.selfUserId,
data: i
})), this.selfUserId
}, t.prototype.SendMessageRemoval = function(t, e, n) {
var i = {
sessionId: t,
messageId: e,
isBlocked: n
};
this.SendPacket(JSON.stringify({
op: "MessageRemoval",
userId: this.selfUserId,
data: i
}))
}, t
}(),
y = function() {
this.profileComment = "", this.showTripKey = !1
},
v = function() {
function t() {}
return t.prototype.Init = function() {
var t = i.AppConfigurator.instance.MaxProfileNum;
this.profileExData = Array(t);
for (var e = 0; e < t; e++) this.profileExData[e] = new y;
var n = localStorage.getItem("profileExData");
if (n) {
var o = JSON.parse(n);
if (o && o.length > 0)
for (var s = Math.min(t, o.length), a = 0; a < s; a++) r.Objects.CopyObjectProps(this.profileExData[a], o[a])
} else this.SaveProfileExData();
var l = localStorage.getItem("isUserActive");
l ? (this.isUserActive = "1" == l, this.SaveIsActive()) : this.isUserActive = !0;
var c = localStorage.getItem("blockedUserTrips");
c ? this.blockedUserTrips = JSON.parse(c) : (this.blockedUserTrips = [], this.SaveBlockedUserTrips())
}, t.prototype.SaveProfileExData = function() {
var t = JSON.stringify(this.profileExData);
localStorage.setItem("profileExData", t)
}, t.prototype.SaveIsActive = function() {
localStorage.setItem("isUserActive", this.isUserActive ? "1" : "0")
}, t.prototype.SaveBlockedUserTrips = function() {
var t = JSON.stringify(this.blockedUserTrips);
localStorage.setItem("blockedUserTrips", t)
}, t.prototype.SetUserBlockState = function(t, e) {
if (e && -1 == this.blockedUserTrips.indexOf(t)) this.blockedUserTrips.push(t), this.SaveBlockedUserTrips();
else if (!e && this.blockedUserTrips.indexOf(t) >= 0) {
var n = this.blockedUserTrips.indexOf(t);
this.blockedUserTrips.splice(n, 1), this.SaveBlockedUserTrips()
}
}, t
}(),
S = function() {
function t() {
this.entryInfo = new f, this.entrySeqSig = "", this.allUsers = new o.List, this.allSessions = new o.List, this.tmpSession = new g(0), this.sessionInitialMessage = null, this.loadedProfileIndex = 0, this.storage = new v, this.ShowVersion(), this.bridge = new m(this)
}
return Object.defineProperty(t.prototype, "Texts", {
get: function() {
return h
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "IsUserActive", {
get: function() {
return this.storage.isUserActive
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "selfUserId", {
get: function() {
return this.bridge ? this.bridge.selfUserId : 0
},
enumerable: !0,
configurable: !0
}), t.prototype.SetUserEnvSig = function(t) {
this.entryInfo.envSig = t
}, t.prototype.ShowVersion = function() {
console.log(a.ChatAppCoreVersion)
}, t.prototype.FireChanged = function() {
this.procOnChanged && this.procOnChanged()
}, t.prototype.SetAvailability = function(t) {
this.isAvailable = t, console.log("unichat availability: " + t)
}, t.prototype.DiscardCurrentSessions = function() {
this.allSessions.Clear(), this.allUsers.Clear(), this.selfUser = null, this.gameChatSession = null, this.curSession = null
}, t.prototype.SetUserActive = function(t) {
this.storage.isUserActive != t && (this.bridge.IsConnected && !t ? (this.DiscardCurrentSessions(), this.bridge.Close()) : !this.bridge.IsConnected && t && this.bridge.SendSelfEntryInfo(this.selfInfoCash, !0), this.storage.isUserActive = t, this.storage.SaveIsActive())
}, t.prototype.ChatWindowOpenStateChanged = function(t) {
this.isWindowOpen = t, t && (this.chatNotificationBadgeProc && this.chatNotificationBadgeProc(!1), this.chatNotificationTitleProc && this.chatNotificationTitleProc(!1))
}, t.prototype.SetGameTeamChatSessionEnabled = function(t) {
a.GameChatSessionCategory = t ? 12 : 11
}, t.prototype.SetChatServerUri = function(t) {
a.ChatServerUri = t
}, t.prototype.SetSiteSignature = function(t) {
this.entryInfo.siteSig = t
}, t.prototype.SetServerSignature = function(t, e) {
(t != this.entryInfo.serverSig || e) && (this.ClearAllUsersAndSessions(), this.entryInfo.serverSig = t, e && this.SendUserEntryIfChanged(!0))
}, t.prototype.SetUserEntryInfo = function(t, e, n, o, r) {
var s = i.AppConfigurator.instance.MaxProfileNum;
if (0 <= r && r < s) {
null == r && (r = 0), this.entryInfo.name = t, this.entryInfo.team = e, this.entryInfo.code = n, this.entryInfo.skinUrl = o, this.storage.profileExData || this.storage.Init();
var a = this.storage.profileExData[r];
this.entryInfo.profileComment = a.profileComment, this.entryInfo.showTripKey = a.showTripKey, this.loadedProfileIndex = r, this.SendUserEntryIfChanged()
}
}, t.prototype.ClearAllUsersAndSessions = function() {
var t = this;
this.curSession = null, this.allSessions.Clear(), this.allUsers.Where(function(e) {
return e != t.selfUser
}).ForEach(function(e) {
return t.RemoveUser(e)
})
}, t.prototype.SendUserEntryIfChanged = function(t) {
void 0 === t && (t = !1);
var e = this.entryInfo.GetSequentialSignature();
(e != this.entrySeqSig || t) && (this.IsUserActive && this.bridge.SendSelfEntryInfo(this.entryInfo, !0), this.selfInfoCash = this.entryInfo, this.entrySeqSig = e)
}, t.prototype.UpdateSelfProfileDetail = function(t, e) {
var n = a.ProfileCommentMaxLength;
e.length > n && (e = e.substr(0, n));
var i = this.storage.profileExData[this.loadedProfileIndex];
i.profileComment = e, i.showTripKey = t, this.storage.SaveProfileExData(), this.entryInfo.profileComment = e, this.entryInfo.showTripKey = t, this.SendUserEntryIfChanged()
}, t.prototype.GetUserById = function(t) {
return this.allUsers.FirstOrDefault(function(e) {
return e.userId == t
}, null)
}, t.prototype.GetSessionById = function(t) {
return this.allSessions.FirstOrDefault(function(e) {
return e.sessionId == t
}, null)
}, t.prototype.RequestStartNewSession = function(t) {
this.bridge.RequestStartNewPrivateSession(t.userId)
}, t.prototype.CheckValidName = function() {
return "" != this.selfUser.name
}, t.prototype.SendMessageOnCurrentSession = function(t) {
this.CheckValidName() && (this.curSession == this.tmpSession ? (this.sessionInitialMessage = t, this.RequestStartNewSession(this.tmpSession.peer)) : this.bridge.SendChatMessage(this.curSession.sessionId, t))
}, t.prototype.SendMessageOnGameChatSession = function(t) {
this.CheckValidName() && this.gameChatSession && this.bridge.SendChatMessage(this.gameChatSession.sessionId, t)
}, t.prototype.SetUserBlockState = function(t, e) {
t.fullTrip != this.selfUser.fullTrip && (t.isBlocked = e, this.storage.SetUserBlockState(t.fullTrip, e))
}, t.prototype.AddNewUser = function(t) {
var e = new u(t.userId);
return e.SetProps(t), this.storage.blockedUserTrips.indexOf(e.fullTrip) >= 0 && (e.isBlocked = !0), t.userId == this.selfUserId && (this.selfUser = e), this.allUsers.Add(e), e
}, t.prototype.RemoveUser = function(t) {
var e = this;
this.allUsers.Remove(t), t.userId == this.selfUserId ? (this.allSessions.RemoveAll(function(t) {
return t.IsPrivate
}), this.SelectSession(this.gameChatSession)) : this.allSessions.Where(function(e) {
return e.peer == t
}).ForEach(function(t) {
t.hasNewMessage ? t.isClosed = !0 : e.allSessions.Remove(t)
})
}, t.prototype.UserInfosUpdated = function(t) {
var e = this;
t.forEach(function(t) {
if (0 == t.isAlive)(n = e.GetUserById(t.userId)) && e.RemoveUser(n);
else {
var n = e.GetUserById(t.userId);
t.userId == e.selfUserId && (t.name, t.team), n ? n.serverSig == t.serverSig && n.name == t.name && n.team == t.team ? n.SetProps(t) : (e.RemoveUser(n), e.AddNewUser(t)) : e.AddNewUser(t)
}
})
}, t.prototype.UpdateFixedGroupSessionInfos = function(t) {
var e = this;
t.forEach(function(t) {
var n = e.GetSessionById(t.sessionId);
n || ((n = new g(t.sessionId)).InitAsGroupSession(t.category, t.roomSig, t.title), e.allSessions.Add(n)), t.category == a.GameChatSessionCategory && (e.gameChatSession = n, e.gameChatSession.sessionId, e.gameChatSession.HeaderName)
}), null == this.curSession && (this.curSession = this.gameChatSession);
var n = t.map(function(t) {
return t.sessionId
});
this.allSessions.Where(function(t) {
return t.IsGroup && -1 == n.indexOf(t.sessionId)
}).ForEach(function(t) {
return e.allSessions.Remove(t)
})
}, t.prototype.UpdatePrivateSessionInfo = function(t) {
var e = this.GetSessionById(t.sessionId);
if (!e) {
e = new g(t.sessionId);
var n = t.userIds[0] == this.selfUserId ? t.userIds[1] : t.userIds[0],
i = this.GetUserById(n);
e.InitAsPrivateSession(i), this.allSessions.Add(e), this.tmpSession && this.curSession == this.tmpSession && t.userIds[0] == this.tmpSession.peer.userId && (this.curSession = e)
}
null != this.sessionInitialMessage && (this.curSession = e, this.SendMessageOnCurrentSession(this.sessionInitialMessage), this.sessionInitialMessage = null)
}, t.prototype.HandleReceivedMessage = function(t) {
var e = this.GetSessionById(t.sessionId),
n = this.GetUserById(t.userId);
if (n && e) {
if (n.isBlocked) return void(e.IsPrivate && this.bridge.SendMessageRemoval(e.sessionId, t.messageId, !0));
if (e.AddMessage(new p(n, t.text, t.messageId)), e != this.curSession && (e.hasNewMessage = !0), !e.IsGroup && !this.isWindowOpen) {
var i = t.text,
o = n.skinUrl;
this.chatNotificationBadgeProc && this.chatNotificationBadgeProc(!0, o, i), this.chatNotificationTitleProc && this.chatNotificationTitleProc(!0)
}
e == this.gameChatSession && this.gameChatMessageReceiverProc && this.gameChatMessageReceiverProc(n.ChatFullName, t.text,n.skinUrl,n.ChatTrip)
}
}, t.prototype.HandleMessageRemoval = function(t) {
var e = this.GetSessionById(t.sessionId);
e && e.RemoveMessage(t.messageId, t.isBlocked)
}, t.prototype.SelectUser = function(t) {
var e = this.allSessions.First(function(e) {
return e.peer == t
});
e ? (this.curSession = e, e.reqScroll = !0, this.FireChanged()) : (this.tmpSession.InitAsPrivateSession(t), this.curSession = this.tmpSession), this.curUser = t
}, t.prototype.SelectSelfUser = function() {
this.curUser = this.selfUser, this.curSession = null
}, t.prototype.SelectUserById = function(t) {
var e = this.GetUserById(t);
e && this.SelectUser(e)
}, t.prototype.RemoveCurrentSessionIfClosed = function() {
this.curSession && this.curSession.isClosed && this.allSessions.Remove(this.curSession)
}, t.prototype.SelectSession = function(t) {
this.curSession != t && (this.RemoveCurrentSessionIfClosed(), this.curSession = t, t.reqScroll = !0, t.hasNewMessage = !1, this.curUser = t.IsPrivate ? t.peer : null, this.FireChanged())
}, t.prototype.SelectMessage = function(t) {
this.curMessage = this.GetMessageById(t)
}, t.prototype.GetMessageById = function(t) {
return this.curSession.messages.First(function(e) {
return e.messageId == t
})
}, t.prototype.DeleteCurrentMessage = function() {
this.curMessage.userId == this.selfUserId && this.bridge.SendMessageRemoval(this.curSession.sessionId, this.curMessage.messageId, !1)
}, t
}();
e.ChatAppModel = S
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1),
o = n(0),
r = n(7),
s = function() {
function t(t) {
this.initDone = !1, this.tick = 0, this.jumpDurationMs = 2e3, this.teamCircleTimeStamp = 0, this.teamCircleX = 0, this.teamCircleY = 0, this.teamCircleRadius = 0, this.gameCore = t
}
return t.prototype.Init = function() {
if (!this.initDone) {
var t = o.gs.gconfig.FieldSize / 2;
this.eyeX = t, this.eyeY = t, this.eyeX1 = t, this.eyeY1 = t, this.eyeScale = .08, this.eyeScale1 = .08, this.gravityX = t, this.gravityY = t, this.aimCursorX = t, this.aimCursorY = t, this.localAimX = t, this.localAimY = t, this.initDone = !0, i.Utils.Confirm(this.scw), this.mouseX = this.scw / 2, this.mouseY = this.sch / 2, this.aimPlayerId = -1
}
}, t.prototype.sendWaves = function(t, e, n, i, o, r) {
var s = {
x: t,
y: e
};
s.time = Date.now(), s.color = n, s.wavelength = i, s.sender = o, s.moreAnimation = r, gVar.Waves.push(s)
}, t.prototype.SetScreenSize = function(t, e) {
this.scw = t, this.sch = e
}, t.prototype.ScreenToWorld = function(t, e) {
return [(t - this.scw / 2) / this.eyeScale + this.eyeX, (e - this.sch / 2) / this.eyeScale + this.eyeY]
}, t.prototype.WorldToScreen = function(t, e) {
return [(t - this.eyeX) * this.eyeScale + this.scw / 2, (e - this.eyeY) * this.eyeScale + this.sch / 2]
}, t.prototype.SetServerEyePos = function(t, e) {
this.serverEyePosX = t, this.serverEyePosY = e
}, t.prototype.ShiftScale = function(t) {
var e = 1 + .13 * t,
n = this.eyeScale1 * e;
this.eyeScale1 = i.Nums.Clamp(n, .005, 1.5)
}, t.prototype.SendSelfAimPosition = function() {
if (!stopMouse) {
var t = this.ScreenToWorld(this.mouseX, this.mouseY),
e = t[0],
n = t[1];
if (e != this.aimXSent || n != this.aimYSent) {
var i = this.gameCore.conn;
i && i.SendAimCursor(e, n), this.aimXSent = e, this.aimYSent = n
}
}
}, t.prototype.RecordStatePacket = function() {
var t = this,
e = r.InternalPackets.SightState(t.eyeX, t.eyeY, t.eyeScale, t.aimCursorX, t.aimCursorY, t.splitting, t.aimPlayerId);
this.gameCore.dataRecorder.PostInternalRecordingPacket(e)
}, t.prototype.UpdateFrame = function() {
this.UpdateCurrentPosScale();
var t = o.gs.gconfig.FieldSize;
if (this.eyeX = i.Nums.Clamp(this.eyeX, 0, t), this.eyeY = i.Nums.Clamp(this.eyeY, 0, t), o.gs.gstates.isPlaying) {
var e = this.ScreenToWorld(this.mouseX, this.mouseY),
n = e[0],
r = e[1];
this.aimCursorX = n, this.aimCursorY = r
}
o.gs.gstates.isRealtimeMode && this.tick % 2 == 0 && (this.SendSelfAimPosition(), this.RecordStatePacket()), this.tick++
}, t.prototype.UpdateCurrentPosScale = function() {
var t, e, n, r = o.gs.gstates,
s = this.gameCore.nodeMan;
if (r.isBenchmarkMode) {
var a = o.gs.gconfig.FieldSize / 2;
this.eyeX = a, this.eyeY = a, this.eyeScale = .05
} else if (r.isReplayMode) {
var l = .6;
this.eyeX = i.Nums.EasyFilter(this.eyeX, this.eyeX1, l), this.eyeY = i.Nums.EasyFilter(this.eyeY, this.eyeY1, l), this.eyeScale = i.Nums.EasyFilter(this.eyeScale, this.eyeScale1, l)
} else if (r.isRealtimeMode) {
var c = this.ScreenToWorld(this.mouseX, this.mouseY),
h = c[0],
d = c[1],
u = void 0,
p = void 0;
if (l = .985 - 5e-4 * o.gs.uconfig.CameraMovementSpeed, r.isPlaying && s.hasSelfNode) {
var g = s.CalcurateCenterPointOfAllSelfCells(),
f = g[0],
m = g[1],
y = s.CalcurateCenterPointOfEachSelfCells(),
v = y[0],
S = y[1],
b = y[2],
C = y[3];
if (this.spawned && (o.gs.uconfig.useSpawnSignal && (0 == s.operationUnitIndex && this.sendWaves(v, S, "FFFFFF", 500, "spawn", !0), 1 == s.operationUnitIndex && this.sendWaves(b, C, "FFFFFF", 500, "spawn", !0)), this.jumpTick = this.jumpDurationMs, this.eyeX2 = f, this.eyeY2 = m, this.spawned = !1), this.jumpTick > 0) {
this.jumpTick -= 17;
var x = i.Nums.VMap(this.jumpTick, this.jumpDurationMs, 0, 0, 1, !0);
u = i.Nums.Lerp(this.eyeX2, f, x), p = i.Nums.Lerp(this.eyeY2, m, x), l = i.Nums.Lerp(.94, .986, x)
} else u = (t = [f, m])[0], p = t[1]
} else - 1 != this.aimPlayerId && (65534 & this.aimPlayerId) != this.gameCore.uMan.selfUserId ? (u = (e = [this.serverEyePosX, this.serverEyePosY])[0], p = e[1]) : (u = (n = [h, d])[0], p = n[1]);
this.eyeX = i.Nums.EasyFilter(this.eyeX, u, l), this.eyeY = i.Nums.EasyFilter(this.eyeY, p, l), this.eyeScale = i.Nums.EasyFilter(this.eyeScale, this.eyeScale1, .86)
}
}, t.prototype.SetSpawned = function() {
this.spawned = !0
}, t.prototype.OnPlayerDead = function() {
var t = this.gravityX,
e = this.gravityY,
n = this.aimCursorX,
o = this.aimCursorY,
r = i.Nums.Lerp(t, n, .3),
s = i.Nums.Lerp(e, o, .3);
this.localAimX = r, this.localAimY = s
}, t.prototype.UpdateInterpolation = function() {}, t.prototype.FeedReplaySightState = function(t, e, n, i, r, s, a) {
this.eyeX1 = t, this.eyeY1 = e, o.gs.uconfig.AffectZoomingOnReplay && (this.eyeScale1 = n), this.aimCursorX = i, this.aimCursorY = r, this.splitting = s, this.aimPlayerId = a
}, t.prototype.setAimCursorProps = function(t, e, n, i) {
this.aimPlayerId = t, this.aimCursorX = e, this.aimCursorY = n, this.splitting = i
}, t
}();
e.SightCoord = s
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1),
o = n(2),
r = n(3),
s = function() {
function t(e) {
this.name = "Profile" + (e + 1), this.team = "", this.code = "";
var n = e;
n >= t.skinUrlSources.length && (n = 0), this.skinUrl = t.skinUrlSources[n], this.skinUrl2 = t.skinUrlSources[n], this.profileIndex = e
}
return t.prototype.MakeSequenceString = function() {
return this.name + "/" + this.team + "/" + this.code + "/" + this.skinUrl + "/" + this.skinUrl2
}, t.skinUrlSources = ["http://ixagar.net/skins/ring.png", "http://ixagar.net/skins/k461.png", "http://ixagar.net/skins/wolf.png", "http://ixagar.net/skins/rabbit.png", "http://ixagar.net/skins/dragon.png", "http://ixagar.net/skins/magic_circle.png", "http://ixagar.net/skins/ghost.png", "http://ixagar.net/skins/daemon.png", "http://ixagar.net/skins/bat.png", "http://ixagar.net/skins/skull.png"], t
}();
e.UserEntryInfo = s;
var a = function() {
function t() {
this.curIndex = 0, this.modified = !1, this.infos = [];
for (var t = 0; t < o.AppConfigurator.instance.MaxProfileNum; t++) this.infos[t] = new s(t)
}
return Object.defineProperty(t.prototype, "curInfo", {
get: function() {
return this.infos[this.curIndex]
},
enumerable: !0,
configurable: !0
}), t.prototype.Load = function() {
var t = localStorage.getItem("lwga_user_entries");
if (t) {
var e = JSON.parse(t);
if (e instanceof Array)
for (var n = Math.min(this.infos.length, e.length), o = 0; o < n; o++) {
const t = this.infos[o];
i.Objects.CopyObjectProps(t, e[o]), t.usig = r.AppHelper.GetUserEnironmentSignature()
}
}
var s = parseInt(localStorage.getItem("lwga_user_sel_index"));
isNaN(s) || (this.curIndex = i.Nums.Clamp(s, 0, this.infos.length - 1))
}, t.prototype.ShiftIndex = function(t) {
this.curIndex = (this.curIndex + t + this.infos.length) % this.infos.length, this.indexChangedProc(), this.SaveIfChanged()
}, t.prototype.ChangeIndex = function(t) {
this.curIndex = t
}, t.prototype.SaveIfChanged = function() {
this.modified && (localStorage.setItem("lwga_user_entries", JSON.stringify(this.infos)), this.modified = !1), localStorage.setItem("lwga_user_sel_index", this.curIndex.toString())
}, t.prototype.SetProp = function(t, e) {
this.curInfo[t] != e && (this.curInfo[t] = e, this.infos[this.curInfo.profileIndex][t] = e, "skinUrl" != t && "skinUrl2" != t || this.skinChangedProc(), this.skinChangedProc2(), this.modified = !0)
}, t
}();
e.UserEntryManager = a
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(7),
o = function() {
function t() {}
return t.prototype.SendPacket = function(t) {
this.ws && this.ws.readyState == WebSocket.OPEN && this.ws.send(t)
}, t.prototype.CloseConnection = function() {
this.ws && (this.ws.onopen = null, this.ws.onmessage = null, this.ws.onclose = null, this.ws.onerror = null, this.ws.close(), this.ws = null)
}, t.prototype.SendSessionInitialize = function(t) {
this.SendPacket(i.Packets.SessionInitialize(t))
}, t.prototype.SendUserEntryInfo = function(t, e, n, o, r) {
this.SendPacket(i.Packets.UserEntryInfo(t, e, n, o, r))
}, t.prototype.SendRequestStartPlay = function() {
this.SendPacket(i.Packets.RequestStartPlay())
}, t.prototype.SendRequestStartSpectate = function() {
this.SendPacket(i.Packets.RequestStartSpectate())
}, t.prototype.SendAimCursor = function(t, e) {
this.SendPacket(i.Packets.AimCursor(t, e))
}, t.prototype.SendPlayerAction = function(t, e) {
this.SendPacket(i.Packets.PlayerAction(t, e))
}, t.prototype.SendChatMessage = function(t, e) {
this.SendPacket(i.Packets.ChatMessage(t, e))
}, t.prototype.SendLatencyCheckRequest = function() {
this.SendPacket(i.Packets.LatencyCheckRequest())
}, t.prototype.SendSpecifySpecTarget = function(t) {
this.SendPacket(i.Packets.SpecifySpecTarget(t))
}, t.prototype.ConnectToGameServer = function(t) {
var e = this;
this.ws && this.CloseConnection(), console.log("connecting to gameserver"), this.ws = new WebSocket(t), this.ws.binaryType = "arraybuffer", this.ws.onopen = function() {
console.log("socket opened"), e.connectionOpenProc()
}, this.ws.onerror = function(t) {
console.log("socket error, " + t)
}, this.ws.onclose = function(t) {
var n = t.reason || "";
console.log("socket closed, " + n), e.connectionClosedProc(n)
}, this.ws.onmessage = function(t) {
e.packetHandlerProc(t.data)
}
}, t
}();
e.ConnectionBridge = o
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1),
o = n(8),
r = n(14),
s = n(0),
a = n(3),
l = function(t, e, n, i) {
this.timeStamp = t, this.opcode = e, this.keep = n, this.buffer = i
},
c = function() {
function t(t, e, n) {
this.packets = t, this.headIndex = e, this.tailIndex = n
}
return Object.defineProperty(t.prototype, "headTimeStamp", {
get: function() {
return this.packets[this.headIndex].timeStamp
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "durationMs", {
get: function() {
return i.Utils.Confirm(this.tailIndex < this.packets.length), this.packets[this.tailIndex].timeStamp - this.packets[this.headIndex].timeStamp
},
enumerable: !0,
configurable: !0
}), t
}(),
h = function() {
function t() {
this.totalBytes = 0, this.packets = [], this.isRecording = !1, this.isPlayback = !1, this.isLoading = !1, this.trackPos = 0, this.reels = [], this.curReelIndex = 0, this.trackPosText = "", this.isAutoShiftToNextReel = !1, this.cleanIdx = 0, this.reqMainPanelShownAfterPlayback = !1, this.replaySpeedRateExp = 0, this.replaySpeedRate = 1
}
return t.prototype.Reset = function() {
this.totalBytes = 0, this.packets = [], this.isRecording = !1, this.isPlayback = !1, this.isLoading = !1, this.trackPos = 0, this.recordHeadIndex = 0, this.replayIndex = 0, this.reels = [], this.curReelIndex = 0, this.trackPosText = "", this.cleanIdx = 0, this.reqMainPanelShownAfterPlayback = !1, this.Notify()
}, Object.defineProperty(t.prototype, "curReel", {
get: function() {
return this.reels[this.curReelIndex]
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "isReplayMode", {
get: function() {
return s.gs.gstates.isReplayMode
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "numReels", {
get: function() {
return this.reels.length
},
enumerable: !0,
configurable: !0
}), t.prototype.Initialize = function(t) {
this.nodeMan = t, this.UpdateTrackPosText(), this.startTimeStamp = Date.now()
}, t.prototype.SetStateChangedProc = function(t) {
this.notificationProc = t
}, t.prototype.Notify = function(t) {
void 0 === t && (t = null), this.notificationProc(t)
}, t.prototype.AddReel = function(t, e) {
for (var n = t; n <= e; n++) this.packets[n].keep = !0;
var i = new c(this.packets, t, e);
this.reels.push(i), this.curReelIndex = this.reels.length - 1
}, t.prototype.DeleteCurrentReel = function() {
this.reels.length > 0 && (this.reels.splice(this.curReelIndex, 1), this.ShiftCurrentReel(0), this.UpdateTrackPosText())
}, t.prototype.ShiftCurrentReel = function(t, e) {
if (void 0 === e && (e = !1), 0 != this.reels.length) {
var n = (this.curReelIndex + t + this.reels.length) % this.reels.length;
this.curReelIndex = i.Nums.Clamp(n, 0, this.reels.length - 1), this.StartReplayMode(e), e || (this.ShiftTrackPositionLittle(1), this.ShiftTrackPositionLittle(-1))
}
}, t.prototype.ShiftReplaySpeed = function(t) {
this.replaySpeedRateExp = i.Nums.Clamp(this.replaySpeedRateExp + t, -1, 2), this.replaySpeedRate = Math.pow(2, this.replaySpeedRateExp)
}, t.prototype.HandleReplayOperation = function(t) {
switch (t) {
case 1:
this.ToggleRecording();
break;
case 4:
this.TogglePlayback();
break;
case 3:
this.EndReplayMode();
break;
case 2:
this.DoInstantCapture();
break;
case 5:
this.ShiftCurrentReel(-1);
break;
case 6:
this.ShiftCurrentReel(1);
break;
case 8:
this.ShiftTrackPositionLittle(-1);
break;
case 9:
this.ShiftTrackPositionLittle(1);
break;
case 10:
this.DeleteCurrentReel();
break;
case 7:
this.isAutoShiftToNextReel = !this.isAutoShiftToNextReel;
break;
case 12:
this.ShiftReplaySpeed(-1);
break;
case 13:
this.ShiftReplaySpeed(1)
}
this.Notify()
}, t.prototype.DiscardUnnecessaryPackets = function() {
for (var t = Date.now() - 1e3 * s.gs.usupport.QuickCaptureTimeSec; this.cleanIdx < this.packets.length;) {
var e = this.packets[this.cleanIdx];
if (e) {
if (e.timeStamp >= t) break;
e.keep || (this.packets[this.cleanIdx] = null, this.totalBytes -= e.buffer.byteLength)
}
this.cleanIdx++
}
}, t.prototype.RecordPacket = function(t) {
var e = new o.DataFrameReader(t).ReadUint8();
if (!(r.OpcodeGroups.NotForRecord.indexOf(e) >= 0)) {
var n = Date.now(),
i = r.OpcodeGroups.PermanentKeeped.indexOf(e) >= 0;
this.isRecording && (i = !0);
var s = new l(n, e, i, t);
this.packets.push(s), this.totalBytes += t.byteLength
}
}, t.prototype.PostInternalRecordingPacket = function(t) {
this.RecordPacket(t)
}, t.prototype.PostPacketFromServer = function(t) {
a.TimeChecker.Start("PostPacketFromServer"), this.isReplayMode || this.nodeMan.DecodeFrame(t, !0, !1), this.RecordPacket(t), a.TimeChecker.Stop()
}, t.prototype.ToggleRecording = function() {
this.isPlayback || (this.isRecording ? (this.isRecording = !1, this.AddReel(this.recordHeadIndex, this.packets.length - 1)) : (this.isRecording = !0, this.recordHeadIndex = this.packets.length), this.Notify())
}, t.prototype.DoInstantCapture = function() {
if (!this.isPlayback) {
var t = Date.now() - this.startTimeStamp,
e = 1e3 * s.gs.usupport.QuickCaptureTimeSec;
e > t && (e = t);
var n = Date.now() - e,
i = 0;
for (i = this.packets.length - 1; i > 0; i--) {
var o = this.packets[i];
if (o && o.timeStamp < n) break
}
this.AddReel(i, this.packets.length - 1), this.captureNotificationProc(), this.Notify()
}
}, t.prototype.ToDigits2 = function(t) {
var e = t.toString();
return e.length <= 1 ? "0" + e : e
}, t.prototype.GetTimeDurationString = function(t, e) {
var n = t / 1e3 >> 0,
i = n / 3600 >> 0,
o = (n -= 3600 * i) / 60 >> 0,
r = (n -= 60 * o) >> 0,
s = t % 1e3 / 100 >> 0,
a = (this.ToDigits2(i), this.ToDigits2(o)),
l = this.ToDigits2(r),
c = null;
return c = i > 0 ? i + ":" + a + ":" + l : o + ":" + l, e && (c += "." + s), c
}, t.prototype.UpdateTrackPosText = function() {
var t = 0,
e = 0;
this.curReel && (t = i.Nums.MapTo(this.trackPos, 0, this.curReel.durationMs), e = this.curReel.durationMs);
var n = this.GetTimeDurationString(t, !0),
o = this.GetTimeDurationString(e, !0);
this.trackPosText = n + " / " + o
}, t.prototype.SeekReplayPosTo = function(t, e) {
if (this.curReel) {
var n = this.curReel.headTimeStamp,
o = this.curReel.headTimeStamp + this.curReel.durationMs,
r = i.Nums.MapTo(t, n, o);
if (t >= this.trackPos)
for (; this.replayIndex < this.curReel.tailIndex;) {
if (s = this.packets[this.replayIndex]) {
if (s.timeStamp >= r) break;
this.nodeMan.DecodeFrame(s.buffer, !1, e)
}
this.replayIndex++
} else
for (; this.replayIndex > this.curReel.headIndex;) {
var s;
if (s = this.packets[this.replayIndex]) {
if (s.timeStamp <= r) break;
this.nodeMan.DecodeFrame(s.buffer, !1, e)
}
this.replayIndex--
}
e && this.nodeMan.SyncGameViewToModel(), this.trackPos = t, this.UpdateTrackPosText()
}
}, t.prototype.ShiftTrackPositionLittle = function(t) {
if (this.curReel) {
var e = 100 * t / this.curReel.durationMs,
n = i.Nums.Clamp(this.trackPos + e, 0, 1);
this.SeekReplayPosTo(n, !1)
}
}, t.prototype.StartReplayMode = function(t) {
s.gs.gstates.isReplayMode = !0, this.trackPos = 0, this.replayIndex = this.curReel.headIndex, this.FeedStoredPackets(0, this.curReel.headIndex), t && (this.isPlayback = !0, this.ReplayLoopProc())
}, t.prototype.EndReplayMode = function() {
this.FeedStoredPackets(0, this.packets.length), this.isPlayback = !1, this.trackPos = 0, s.gs.gstates.isReplayMode = !1, this.UpdateTrackPosText(), this.reqMainPanelShownAfterPlayback && (s.gs.gstates.setMainPanelVisible(!0), this.reqMainPanelShownAfterPlayback = !1)
}, t.prototype.ReplayLoopProc = function() {
if (this.curReel) {
var t = 17 / this.curReel.durationMs * this.replaySpeedRate;
this.SeekReplayPosTo(this.trackPos + t, !1), this.trackPos < 1 ? this.isPlayback && setTimeout(this.ReplayLoopProc.bind(this), 17) : this.isAutoShiftToNextReel && this.curReelIndex < this.reels.length - 1 ? this.ShiftCurrentReel(1, !0) : this.EndReplayMode(), this.Notify()
}
}, t.prototype.FeedStoredPackets = function(t, e) {
this.isLoading = !0, 0 == t && this.nodeMan.ResetToInitialiState();
for (var n = r.OpcodeGroups.PermanentKeeped, i = t; i < e; i++) {
var o = this.packets[i];
o && (o.opcode, n.indexOf(o.opcode) >= 0 && this.nodeMan.DecodeFrame(o.buffer, !1, !0))
}
this.isLoading = !1
}, t.prototype.TogglePause = function() {
this.isReplayMode && (this.isPlayback = !this.isPlayback, this.isPlayback && this.ReplayLoopProc())
}, t.prototype.TogglePlayback = function() {
null != this.curReel && (this.isRecording || (this.isReplayMode ? this.TogglePause() : (this.reqMainPanelShownAfterPlayback = s.gs.gstates.isMainPanelVisible, this.StartReplayMode(!0), s.gs.gstates.setMainPanelVisible(!1))))
}, t
}();
e.DataRecorder = h
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1),
o = n(3),
r = n(0).gs.uconfig,
s = function() {
function t() {
this.colors = [0, 0], this.skinUrls = ["", ""]
}
return Object.defineProperty(t.prototype, "fullName", {
get: function() {
return r.ShowTripKey && this.tripKey && "aaaa" != this.tripKey ? this.team + this.name + "[" + this.tripKey + "]" : this.team + this.name
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "miniMapName", {
get: function() {
return r.ShowTripKey && this.tripKey && "aaaa" != this.tripKey ? this.team + this.name + "[" + this.tripKey + "]" : this.team + this.name
},
enumerable: !0,
configurable: !0
}), t.prototype.Initialize = function(t, e, n) {
this.clientId = t, this.isBot = e, this.tripKey = n, this.name = "", this.team = "", this.teamId = 0;
for (var i = 0; i < 2; i++) this.colors[i] = 0, this.skinUrls[i] = ""
}, t.prototype.SetProps = function(t, e, n, i, o) {
this.name = t, this.team = e, this.teamId = n, this.skinUrls[0] = i, this.skinUrls[1] = o
}, t.prototype.SetColor = function(t, e) {
this.colors[t] = e
}, t
}();
e.TUserInfoData = s;
var a = function() {
function t() {}
return t.prototype.Initialize = function(t, e, n) {
this.teamId = t, this.teamName = e, this.section = n, this.color = 0, this.colorStr = "#000"
}, t.prototype.SetColor = function(t) {
this.color = t, this.colorStr = o.ColorHelper.ColorToHtmlString(t)
}, t
}();
e.TTeamInfoData = a;
var l = function() {
function t() {
this.userInfos = new Map, this.teamInfos = new Map, this.fallbackTeamInfo = new a, this.fallbackTeamInfo.Initialize(-1, "", "**"), this.fallbackTeamInfo.SetColor(4456448), this.fallbackUserInfo = new s, this.fallbackUserInfo.Initialize(-1, !1, "ERR"), this.fallbackUserInfo.SetProps("ERR", "ERR", -1, "", ""), this.fallbackUserInfo.SetColor(0, 4456448), this.fallbackUserInfo.SetColor(1, 4456448), this.selfTeamInfo = this.fallbackTeamInfo
}
return t.prototype.Reset = function() {
this.selfUserId = 0, this.selfTeamInfo = this.fallbackTeamInfo, this.userInfos.clear(), this.teamInfos.clear()
}, t.prototype.PostSelfUserId = function(t) {
this.selfUserId = t
}, t.prototype.PostUserInfoData = function(t, e, n, o, r, a, l, c) {
void 0 === l && (l = null), void 0 === c && (c = null);
var h = this.userInfos.get(t);
h || (i.Utils.Confirm(null != l && null != c), (h = new s).Initialize(t, l, c), this.userInfos.set(t, h)), h.SetProps(e, n, o, r, a), h.isBot = l, h.clientId == this.selfUserId && (this.selfTeamInfo = this.GetTeamInfoById(h.teamId))
}, t.prototype.PostUserLeave = function(t) {
this.userInfos.delete(t), this.userLeavedProc && this.userLeavedProc(t)
}, t.prototype.PostPlayerColorData = function(t, e) {
var n = o.GameHelper.DecodePlayerId(t),
i = n[0],
r = n[1],
s = this.userInfos.get(i);
s && s.SetColor(r, e)
}, t.prototype.PostTeamInfoData = function(t, e, n, o) {
void 0 === n && (n = null), void 0 === o && (o = null);
var r = this.teamInfos.get(t);
r || (i.Utils.Confirm(null != n && null != o), (r = new a).Initialize(t, n, o), this.teamInfos.set(t, r)), r.SetColor(e)
}, t.prototype.PostTeamInfoRemoval = function(t) {
this.teamInfos.delete(t)
}, t.prototype.ClearUserInfos = function() {
this.userInfos.clear()
}, t.prototype.GetUserInfoById = function(t) {
return t &= 65534, this.userInfos.get(t) || this.fallbackUserInfo
}, t.prototype.GetTeamInfoById = function(t) {
return this.teamInfos.get(t) || this.fallbackTeamInfo
}, t.prototype.GetCellColorForPlayer = function(t) {
var e = 1 & t;
return this.GetUserInfoById(t).colors[e]
}, t.prototype.GetSkinUrlForPlayer = function(t) {
var e = 1 & t;
return this.GetUserInfoById(t).skinUrls[e]
}, t.prototype.GetTeamInfoForUser = function(t) {
t &= 65534;
var e = this.GetUserInfoById(t);
return this.GetTeamInfoById(e.teamId)
}, t.prototype.GetPlayerIdsAvailable = function() {
var t = [];
return this.userInfos.forEach(function(e) {
!e.isBot && "dead" != e.name && e.skinUrls[0] && e.colors[0] && t.push(e.clientId)
}), t
}, t
}();
e.UserInfoManager = l
}, function(t, e, n) {
"use strict";
var i, o = this && this.__extends || (i = Object.setPrototypeOf || {
__proto__: []
}
instanceof Array && function(t, e) {
t.__proto__ = e
} || function(t, e) {
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n])
},
function(t, e) {
function n() {
this.constructor = t
}
i(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
}),
r = this && this.__decorate || function(t, e, n, i) {
var o, r = arguments.length,
s = r < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, n) : i;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, n, i);
else
for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, n, s) : o(e, n)) || s);
return r > 3 && s && Object.defineProperty(e, n, s), s
};
Object.defineProperty(e, "__esModule", {
value: !0
});
var s = n(5),
a = n(4),
l = n(0),
c = n(2),
h = n(28),
d = n(27),
u = n(26),
p = n(23),
g = n(22),
f = n(21),
m = n(20),
y = n(19),
v = n(18),
S = n(17),
b = n(16);
p.ReplayControlBarTag, g.GameOverlayTag, f.LeftConfigPanelTag, m.UserEntryPanelTag, y.ServerListRootTag, v.MainPanelTag, S.MainConfigPanelTag, b.ColorConfigPanelTag, n(15).SkinFilterPanelTag;
var C = function(t) {
function e() {
var e = null !== t && t.apply(this, arguments) || this;
return e.gstates = l.gs.gstates, e.uconfig = l.gs.uconfig, e.cconfig = l.gs.ucolors, e.appConfig = c.AppConfigurator.instance, e.hasNewPrivateMessage = !1, e.newPrivateMessageSkinUrl = "", e.newPrivateMessageText = "", e
}
return o(e, t), e.prototype.onChatIconClicked = function(t) {
window.open("unichat/chat.html", "uni-chat", "width=800, height=600, menubar=no, toolbar=no, scrollbars=no"), t.stopPropagation()
}, e.prototype.onSkinFilterButton = function(t) {
this.gstates.isSkinFilterPanelVisible = !this.gstates.isSkinFilterPanelVisible, t.stopPropagation()
}, e.prototype.mounted = function() {
setTimeout(this.InitializeAfterAllMounted.bind(this), 1)
}, e.prototype.InitializeAfterAllMounted = function() {
var t = this;
l.gs.gstates.mainPanelVisibleChangedProc = this.update.bind(this), l.gs.uconfig.RegisterChangedProc("ShowReplayBar", this.update.bind(this));
var e = new u.GameViewDomain2.GameView;
a.gameCore.Initialize(), e.Initialize(), a.gameCore.serverListModel ? a.gameCore.serverListModel.Start() : (l.gs.gstates.chatRoomSig = c.AppConfigurator.instance.uniChatServerSignature, a.gameCore.ConnectToGameServer());
var n = new h.MapView,
i = new d.TeamRankingChartView;
n.Initialize(this.refs.game_overlay.refs.map_canvas), i.Initialize(this.refs.game_overlay.refs.lb_chart_canvas), a.gameCore.gameHudModel.Initialize(), e.StartAnimation(), a.gameCore.chatAppModel && (a.gameCore.chatAppModel.chatNotificationBadgeProc = function(e, n, i) {
t.hasNewPrivateMessage = e, i ? (t.newPrivateMessageSkinUrl = n, t.newPrivateMessageText = i) : (t.newPrivateMessageSkinUrl = "", t.newPrivateMessageText = ""), t.update()
}), l.gs.gstates.playerDeadCallbackProc = function() {
!l.gs.uconfig.HideMenuAfterDeath && l.gs.gstates.setMainPanelVisible(!0)
}
}, r([s.template('\n
\n\t\n\t\n\t\t
\n\t\t\t \n\t\t
\n\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\n\t\t
\n\n\t\t
\n\t\t\t \n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{newPrivateMessageText}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\n\t\t
\n\t\t\t\n\t\t
\n\t\t\t\n\t\t
\n\t\n\t\t
\n\n')], e)
}(s.Element);
e.AppRootTag = C, e.InitializeView = function() {
var t = C.createElement();
document.body.appendChild(t)
}
}, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(39),
o = n(2);
window.onload = function() {
console.log("LWGA-R A121a0 240322");
var t = "ja" == navigator.language.slice(0, 2);
o.AppConfigurator.instance.allowOnlyForJapaneseLangUser && !t ? document.body.innerHTML = "このページは現在国内ユーザ向けに提供しています。日本語環境以外ではページが表示されないようになっています。" : i.InitializeView()
}
}]);