Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Start() {
- if (null !== global.con && global.con.connected) global.con.disconnect(), document.getElementById("connect").innerHTML = "Connect";
- else {
- var e = document.getElementById("email").value,
- l = document.getElementById("password").value,
- o = document.getElementById("worldid").value;
- Log("Authenticating with EE"), PlayerIO.authenticate("everybody-edits-su9rn58o40itdbnw69plyw", "simpleUsers", {
- email: e,
- password: l
- }, {}, function(e) {
- e.multiplayer.useSecureConnections = !0, global.client = e, Log("Authenticated"), global.client.bigDB.load("config", "config", function(e) {
- global.client.multiplayer.listRooms("Everybodyedits" + e.version, null, 0, 0, function(l) {
- for (var t = !1, n = 0; n < l.length; n++) l[n].id == o && (t = !0);
- Log("Connecting"), t ? global.client.multiplayer.joinRoom(o, null, function(e) {
- global.con = e, Log("Connected"), global.con.addMessageCallback("*", OnMessage), global.con.send("init")
- }, CallbackError) : global.client.multiplayer.createJoinRoom(o, "Everybodyedits" + e.version, !0, null, null, function(e) {
- global.con = e, Log("Connected"), global.con.addMessageCallback("*", OnMessage), global.con.send("init")
- }, CallbackError)
- }, CallbackError)
- }, CallbackError)
- }, CallbackError)
- }
- }
- function Log(e) {
- null == global.loghtml && (global.loghtml = document.getElementById("log")), global.loghtml.innerHTML += e + "\n", global.loghtml.scrollTop = global.loghtml.scrollHeight
- }
- function DbgLog(e) {
- console.log(e)
- }
- function CallbackError(e) {
- Log("Error: " + e.code + ": " + e.message)
- }
- function TellSudoMasters(e) {
- for (var l = 0; l < global.masters.length; l++) ! function(l) {
- setTimeout(function() {
- DbgLog("Telling sudomaster " + global.masters[l] + " -> " + e), global.con.send("say", "/pm " + global.masters[l] + " " + e)
- }, 500 * l)
- }(l)
- }
- function TellRelayMasters(e) {
- for (var l = 0; l < global.relaymasters.length; l++) ! function(l) {
- setTimeout(function() {
- global.con.send("say", "/pm " + global.relaymasters[l] + " " + e)
- }, 500 * l)
- }(l)
- }
- function TellAllMasters(e) {
- TellSudoMasters(e), setTimeout(function() {
- TellRelayMasters(e)
- }, 500 * (global.masters.length + 1))
- }
- function setMasters() {
- global.masters = document.getElementById("sudo-masters").value.split("\n"), global.relaymasters = document.getElementById("relay-masters").value.split("\n")
- }
- function ParseCommands(e, l, o) {
- "say" == o[0] ? global.con.send("say", e.substring(4)) : "pm" == o[0] ? global.con.send("say", "/pm " + o[1] + " " + e.substring(4 + o[1].length)) : "/say" == o[0] ? global.con.send("say", e.substring(5)) : "/pm" == o[0] ? global.con.send("say", "/pm " + o[1] + " " + e.substring(5 + o[1].length)) : global.con.send("say", "/pm " + l[1] + " Command not parsed.")
- }
- function OnMessage(e) {
- switch (e.type) {
- case "init":
- global.con.send("init2");
- break;
- case "init2":
- 0 == global.setupWithIACC && (null != document.getElementById("email").value && window.localStorage.setItem("email", btoa(document.getElementById("email").value)), null != document.getElementById("password").value && window.localStorage.setItem("password", btoa(document.getElementById("password").value))), document.getElementById("connect").innerHTML = "Disconnect", Log("EEProxy Joined");
- break;
- case "say":
- break;
- case "write":
- DbgLog("Write");
- var l = e.getString(1),
- o = e.getString(0).split(" "),
- t = l.split(" "); - 1 != global.masters.indexOf(o[1]) ? (Log("Sudo Master " + o[1] + " sent " + l), ParseCommands(l, o, t)) : -1 != global.relaymasters.indexOf(o[1]) ? (Log("Relay Master " + o[1] + " sent " + l), setTimeout(function() {
- TellSudoMasters(o[1] + " > " + l)
- }, 500), ParseCommands(l, o, t)) : o[1].toLowerCase() != "SYSTEM".toLowerCase() || o[1].toLowerCase() != "WORLD".toLowerCase() || o[1].toLowerCase() != "MAGIC".toLowerCase() ? "you" != o[1].toLowerCase() && (Log("Generic PM from " + o[1] + " sent " + l), TellAllMasters(o[1] + " > " + l)) : Log("EE's Servers '" + o[1] + "' sent " + l);
- break;
- case "add":
- global.players[e.getInt(0)] = e.getString(1);
- break;
- case "left":
- delete global.players[e.getInt(0)]
- }
- }
- PlayerIO.useSecureApiRequests = !0, window.onload = function() {
- null !== window.localStorage.getItem("email") && (document.getElementById("email").value = atob(window.localStorage.getItem("email"))), null !== window.localStorage.getItem("password") && (document.getElementById("password").value = atob(window.localStorage.getItem("password"))), (null == window.localStorage.getItem("email") || null == window.localStorage.getItem("password")) && (global.setupWithIACC = !1, document.getElementById("feed").innerHTML += '<p><b>Hey!</b> You haven\'t used IACC for your account yet! You <a href="https://www.sirjosh3917.com/iacc.html/">should!</a> Your account details will automatically be remembered untill you get that setup.</p>')
- }, global = {
- client: null,
- con: null,
- players: {},
- masters: ["ninjasupeatsninja"],
- relaymasters: [],
- loghtml: null,
- setupWithIACC: !0
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement