{"id":206,"date":"2025-02-22T01:59:46","date_gmt":"2025-02-22T01:59:46","guid":{"rendered":"https:\/\/endofenthalpyonline.com\/?page_id=206"},"modified":"2026-11-17T01:52:46","modified_gmt":"2026-11-17T01:52:46","slug":"create-account","status":"publish","type":"page","link":"https:\/\/endofenthalpyonline.com\/?page_id=206","title":{"rendered":"Create account"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"206\" class=\"elementor elementor-206\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7a060e0 e-con-full e-flex e-con e-parent\" data-id=\"7a060e0\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8187331 elementor-widget__width-initial elementor-widget elementor-widget-html\" data-id=\"8187331\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<html>\r\n<head>\r\n    <link rel=\"stylesheet\" href=\"https:\/\/fonts.googleapis.com\/css2?family=Lumanosimo&display=swap\">\r\n    <script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6317785694615260\"\r\n            crossorigin=\"anonymous\"><\/script>\r\n\r\n    <style>\r\n        body {\r\n            background-attachment: scroll;\r\n            background-image: url(https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/oldpaper.png);\r\n        }\r\n\r\n        video {\r\n            position: fixed;\r\n            top: 0;\r\n            left: 0;\r\n            width: 100%;\r\n            height: 100%;\r\n            object-fit: cover;\r\n            z-index: -1; \/* behind other content *\/\r\n        }\r\n\r\n        .createacountbutton {\r\n            color: green;\r\n            background-color: #000000AA;\r\n            border-color: black;\r\n        }\r\n\r\n        .createacountbutton:hover:not(:disabled) {\r\n            background-color: green;\r\n        }\r\n\r\n        .createacountbutton:disabled {\r\n            opacity: 0.5;\r\n            cursor: wait;\r\n        }\r\n\r\n        .login-form {\r\n            width: 50%;\r\n            text-align: center;\r\n            padding-right: 1%;\r\n        }\r\n\r\n        .errormessage {\r\n            color: red;\r\n        }\r\n\r\n        #User, #pass, #email {\r\n            width: 100%;\r\n        }\r\n    <\/style>\r\n\r\n    <script>\r\n        \/\/ Backend route registered by the PHP snippet: register_rest_route('custom\/v1', '\/create-account', ...)\r\n        const API_URL = 'https:\/\/endofenthalpyonline.com\/wp-json\/custom\/v1\/create-account';\r\n        const SUCCESS_URL = 'https:\/\/endofenthalpyonline.com\/?page_id=365';\r\n\r\n        \/\/ Limits. The PHP enforces only the maximums (64 \/ 200), so the minimums are checked here.\r\n        const USER_MIN = 5, USER_MAX = 64;\r\n        const PASS_MIN = 5, PASS_MAX = 200;\r\n\r\n        \/\/ NOTE: this value is visible to anyone who opens the page source.\r\n        \/\/ It must match whatever secure_send_email_permission() checks on the server.\r\n        const AUTH_HEADER = '%%%DGVgvdsfgfsd555edvv#d2';\r\n\r\n        \/\/ Messages for the error codes the PHP snippet returns.\r\n        \/\/ A code mapped to null shows the server's own message (it is already written for the player).\r\n        const ERROR_TEXT = {\r\n            email_in_use:        'Email already in use',\r\n            user_in_use:         'User already in use',\r\n            rate_limited:        'Too many attempts, please try again in a minute.',\r\n            email_not_valid:     null,   \/\/ \"This email address does not appear to exist.\" \/ \"We could not confirm...\"\r\n            missing_fields:      null,\r\n            bad_fields:          null,\r\n            send_failed:         null,   \/\/ account server unreachable\r\n            http_error:          null,   \/\/ account server returned an HTTP error\r\n            unexpected_response: null    \/\/ the account server's own reply text\r\n        };\r\n\r\n        function showError(msg) {\r\n            const el = document.getElementById('errormessage');\r\n            el.style.color = 'red';\r\n            el.textContent = msg; \/\/ textContent: server text can never inject HTML\r\n        }\r\n\r\n        function setBusy(busy) {\r\n            const btn = document.getElementById('createbutton');\r\n            btn.disabled = busy;\r\n            btn.textContent = busy ? ' checking email, please wait... ' : ' create account';\r\n        }\r\n\r\n        \/** Sends the request. The server checks the email and creates the account on the game server in one go. *\/\r\n        async function createAccount(user, email, pass) {\r\n            setBusy(true);\r\n            try {\r\n                const response = await fetch(API_URL, {\r\n                    method: 'POST',\r\n                    headers: {\r\n                        'Authorization': AUTH_HEADER,\r\n                        'Content-Type': 'application\/json'\r\n                    },\r\n                    \/\/ JSON.stringify keeps quotes \/ backslashes in passwords from breaking the request\r\n                    body: JSON.stringify({ user: user, pass: pass, to: email })\r\n                });\r\n\r\n                let data = {};\r\n                try { data = await response.json(); } catch (e) { \/* non-JSON reply *\/ }\r\n\r\n                if (response.ok && data.success) {\r\n                    window.location.replace(SUCCESS_URL);\r\n                    return;\r\n                }\r\n\r\n                \/\/ Permission check on the server rejected the request (AUTH_HEADER mismatch or header stripped by host)\r\n                if (response.status === 401 || response.status === 403) {\r\n                    console.error('Create account rejected by permission check:', response.status, data);\r\n                    showError('The server refused the request (' + response.status + '). Please contact support.');\r\n                    return;\r\n                }\r\n\r\n                \/\/ WP_Error replies look like: { code: \"...\", message: \"...\", data: { status: 409 } }\r\n                const fixed = ERROR_TEXT[data.code];\r\n                if (fixed) {\r\n                    showError(fixed);\r\n                } else {\r\n                    showError(data.message || 'Something went wrong (' + response.status + '). Please try again.');\r\n                }\r\n            } catch (err) {\r\n                console.error(err);\r\n                showError('Could not reach the server. Please try again.');\r\n            } finally {\r\n                setBusy(false);\r\n            }\r\n        }\r\n\r\n        function submitform() {\r\n            \/\/ Ignore clicks \/ Enter presses while a request is already running\r\n            if (document.getElementById('createbutton').disabled) { return; }\r\n\r\n            document.getElementById('errormessage').textContent = '';\r\n\r\n            if (validateForm() === false) { \/\/ validateForm() comes from Bottest.js\r\n                showError('CAPTCHA incorrect');\r\n                return;\r\n            }\r\n\r\n            const user = document.getElementById('User').value.trim();\r\n            const pass = document.getElementById('pass').value;\r\n            const email = document.getElementById('email').value.trim().toLowerCase();\r\n\r\n            if (user === '') { showError('please enter username'); return; }\r\n            if (user.length < USER_MIN) { showError('username must be at least ' + USER_MIN + ' characters'); return; }\r\n            if (user.length > USER_MAX) { showError('username must be ' + USER_MAX + ' characters or less'); return; }\r\n\r\n            if (pass === '') { showError('please enter password'); return; }\r\n            if (pass.length < PASS_MIN) { showError('password must be at least ' + PASS_MIN + ' characters'); return; }\r\n            if (pass.length > PASS_MAX) { showError('password must be ' + PASS_MAX + ' characters or less'); return; }\r\n\r\n            if (email === '') { showError('please enter email'); return; }\r\n            \/\/ basic shape check only; the server does the real MX \/ SMTP check\r\n            if (!\/^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$\/.test(email)) { showError('please enter a valid email'); return; }\r\n\r\n            createAccount(user, email, pass);\r\n        }\r\n\r\n        \/\/ Pressing Enter in any field submits the form\r\n        document.addEventListener('DOMContentLoaded', function () {\r\n            ['User', 'pass', 'email', 'captchaInput'].forEach(function (id) {\r\n                const el = document.getElementById(id);\r\n                if (el) {\r\n                    el.addEventListener('keydown', function (e) {\r\n                        if (e.key === 'Enter') { e.preventDefault(); submitform(); }\r\n                    });\r\n                }\r\n            });\r\n        });\r\n\r\n        var navibarjsonoveride = JSON.stringify({\r\n            NaviId: 'navibar',\r\n            backgroundimage: \"https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/LogginScreenVidio.mp4\",\r\n            overidescrooling: true,\r\n            Vidio: true\r\n        });\r\n    <\/script>\r\n    <script type=\"text\/javascript\" src=\"https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/javascripts\/Bottest.js\"><\/script>\r\n<\/head>\r\n<body onload=\"displaynaivbar(navibarjsonoveride);\">\r\n    <video autoplay muted loop>\r\n        <source src=\"https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/LogginScreenVidio.mp4\" type=\"video\/mp4\">\r\n        Your browser does not support the video tag.\r\n    <\/video>\r\n    <center>\r\n        <div id=\"navibar\"><\/div>\r\n    <\/center>\r\n\r\n    <center>\r\n        <div class=\"login-form\">\r\n            <h2>create account<\/h2>\r\n\r\n            <div>\r\n                <b id=\"errormessage\" class=\"errormessage\"><\/b><br \/>\r\n                <h4>\r\n                    Username:<input required type=\"text\" id=\"User\" value=\"\" autocomplete=\"username\" maxlength=\"64\" \/><br \/>\r\n                    Password:<input required type=\"password\" id=\"pass\" value=\"\" autocomplete=\"new-password\" maxlength=\"200\" \/><br \/>\r\n                    Email:<input required type=\"email\" id=\"email\" value=\"\" autocomplete=\"email\" maxlength=\"254\" \/><br \/>\r\n                <\/h4>\r\n\r\n                <div id=\"captcha\">\r\n                    <!-- CAPTCHA will be inserted here -->\r\n                <\/div>\r\n                <br>\r\n                <label for=\"captchaInput\">Enter CAPTCHA:<\/label>\r\n                <input type=\"text\" id=\"captchaInput\" name=\"captchaInput\" required><br><br>\r\n\r\n                <button class=\"createacountbutton\" id=\"createbutton\" name=\"create account\" onclick=\"submitform()\"> create account<\/button>\r\n            <\/div>\r\n        <\/div>\r\n    <\/center>\r\n<\/body>\r\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Your browser does not support the video tag. create account Username: Password: Email: Enter CAPTCHA: create account<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"class_list":["post-206","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages\/206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=206"}],"version-history":[{"count":97,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages\/206\/revisions"}],"predecessor-version":[{"id":1854,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages\/206\/revisions\/1854"}],"wp:attachment":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}