Test Branch for this ACTWebSocket overlay updated for EW release. See below for the temporary link until the main project is updated:
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
SkillDisplay/static/js/main.e258d74f.chunk.js

2 lines
3.1 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{12:function(t,e,n){t.exports=n(22)},18:function(t,e,n){},19:function(t,e,n){},21:function(t,e,n){},22:function(t,e,n){"use strict";n.r(e);var a=n(0),i=n.n(a),o=n(4),c=n.n(o),r=(n(18),n(5)),s=n(6),u=n(11),d=n(7),l=n(1),f=n(10);n(19);var m=n(2),h=n.n(m),v=n(8),p=n(9),g=(n(21),new Set([15997,15998,15999,16e3,16001,16002,16003,16004,16191,16192,16193,16194,16195,16196,7418,16483])),w=new Set([3559,116,114]);function b(t){var e=t.action_id,n=i.a.useState(),a=Object(p.a)(n,2),o=a[0],c=a[1];return i.a.useEffect(function(){var t=!0;return Object(v.a)(h.a.mark(function n(){var a;return h.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch("https://xivapi.com/Action/".concat(e),{mode:"cors"});case 2:return n.next=4,n.sent.json();case 4:a=n.sent,t&&c(a);case 6:case"end":return n.stop()}},n)}))(),function(){t=!1}},[e]),void 0!==o&&o.Icon?i.a.createElement("img",{className:g.has(e)||!w.has(e)&&4!==o.ActionCategory.ID?"action-icon gcd":"action-icon ogcd",src:"https://xivapi.com/".concat(o.Icon),alt:o.Name||""}):null}var x=function(t){function e(t){var n;return Object(r.a)(this,e),(n=Object(u.a)(this,Object(d.a)(e).call(this,t))).state={me:0,actionlist:[],actionindex:1,lastAddedTimestamp:"",lastAddedAction:-1},function t(e){var n=new URLSearchParams(window.location.search),a="".concat(n.get("HOST_PORT"),"BeforeLogLineRead")||!1,i=new WebSocket(a);i.onerror=function(){return t()},i.onmessage=function(t,n){if("."===t.data)return i.send(".");var a=JSON.parse(t.data);if("SendCharName"===a.msgtype)return e(a.msg);if("Chat"===a.msgtype){var o=a.msg.substring(0,2);if("21"===o||"22"===o)return e(a.msg)}}}(n.handleLogEvent.bind(Object(l.a)(n))),n}return Object(f.a)(e,t),Object(s.a)(e,[{key:"handleLogEvent",value:function(t){if(t.charID)this.setState({me:t.charID});else{var e=this.state.me;if(0!==e){var n=t.split("|");if(parseInt(n[2],16)===e){var a=parseInt(n[4],16);if(!(a<=8)&&(this.state.lastAddedTimestamp!==n[1]||this.state.lastAddedAction!==a)){var i=this.state.actionindex;this.setState(function(t){return{actionindex:t.actionindex>=32?1:t.actionindex+1,lastAddedTimestamp:n[1],lastAddedAction:a,actionlist:t.actionlist.concat({index:i,action:a})}}),setTimeout(this.purgeAction.bind(this),1e4)}}}}}},{key:"purgeAction",value:function(){this.setState(function(t){return{actionlist:t.actionlist.slice(1)}})}},{key:"render",value:function(){var t=[],e=!0,n=!1,a=void 0;try{for(var o,c=this.state.actionlist[Symbol.iterator]();!(e=(o=c.next()).done);e=!0){var r=o.value;t.push(i.a.createElement(b,{key:r.index,action_id:r.action}))}}catch(s){n=!0,a=s}finally{try{e||null==c.return||c.return()}finally{if(n)throw a}}return i.a.createElement("div",{className:"actions"},t)}}]),e}(i.a.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));c.a.render(i.a.createElement(x,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(t){t.unregister()})}},[[12,1,2]]]);
//# sourceMappingURL=main.e258d74f.chunk.js.map