1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

spooky stuffs

This commit is contained in:
Steffo 2018-10-07 20:16:10 +02:00
parent 6be872ed85
commit f3f71b6373
5 changed files with 113 additions and 28 deletions

View file

@ -522,6 +522,12 @@ class RoyalDiscordBot(discord.Client):
filename=now_playing.plain_text(), filename=now_playing.plain_text(),
timestamp=datetime.datetime.now()) timestamp=datetime.datetime.now())
session.add(played_music) session.add(played_music)
# EASTER EGG, REMOVE LATER
if "ghostbusters" in now_playing.plain_text().lower():
halloween = await loop.run_in_executor(executor, session.query(db.Halloween)
.filter_by(royal=enqueuer).one_or_none)
halloween[4] = True
# END
await loop.run_in_executor(executor, session.commit) await loop.run_in_executor(executor, session.commit)
await loop.run_in_executor(executor, session.close) await loop.run_in_executor(executor, session.close)
except sqlalchemy.exc.OperationalError: except sqlalchemy.exc.OperationalError:

View file

@ -79,4 +79,4 @@ def page_whatpumpkin():
if __name__ == "__main__": if __name__ == "__main__":
app.run(debug=True, port=1235) app.run(debug=True, port=1234)

View file

@ -0,0 +1,59 @@
body {
background-color: black;
color: white;
box-sizing: border-box;
}
.container {
max-width: 900px;
margin-left: auto;
margin-right: auto;
}
.quest {
display: grid;
grid-template-columns: 64px auto;
grid-column-gap: 12px;
margin-top: 36px;
margin-bottom: 36px;
.progress {
grid-row-start: 1;
grid-row-end: 4;
grid-column: 1;
i {
display: block;
padding-top: 8px;
font-size: 64px;
color: yellow;
&.todo {
color: rgba(255, 255, 0, 0.2);
}
&.done {
color: rgba(255, 255, 0, 1);
}
}
}
h2 {
grid-row: 1;
grid-column: 2;
margin-top: 0;
margin-bottom: 4px;
}
.description {
grid-row: 2;
grid-column: 2;
}
form {
grid-row: 3;
grid-column: 2;
}
}

View file

@ -5,9 +5,13 @@
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<meta name="keywords" content="Royal Games, halloween, arg"> <meta name="keywords" content="Royal Games, halloween, arg">
<title>a curse.</title> <title>a curse.</title>
<link href="{{ url_for('static', filename='owl.less') }}" rel="stylesheet/less" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/3.0.2/less.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/3.0.2/less.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<script> <script>
var username;
var user_id;
function timer() { function timer() {
let now = new Date().getTime(); let now = new Date().getTime();
let to = new Date("Oct 31, 2018 15:30:00").getTime(); let to = new Date("Oct 31, 2018 15:30:00").getTime();
@ -17,11 +21,30 @@
+ Math.floor(String((result / 1000) % 60)) + "s"; + Math.floor(String((result / 1000) % 60)) + "s";
} }
function ident() {
let r = fetch("https://ryg.steffo.eu/ses/identify", {
method: "GET",
mode: "cors",
credentials: "include"
}).done((result) => {
data = result.json();
if(data["user_id"] === null) {
document.getElementById("main").innerHTML = "i don't know you. " +
"<a href='https://ryg.steffo.eu/login'>try logging in</a> first.";
return;
user_id = data["user_id"];
username = data["username"];
}
})
}
setInterval(timer, 100); setInterval(timer, 100);
window.onload = ident;
</script> </script>
</head> </head>
<body> <body>
<div class="container"> <div id="main" class="container">
<h1> <h1>
a curse. a curse.
</h1> </h1>
@ -55,7 +78,7 @@
<h2> <h2>
unleash the horsemen unleash the horsemen
</h2> </h2>
<div> <div class="description">
you'll need the help of the horsemen of the apocalypse to dispel the curse.<br> you'll need the help of the horsemen of the apocalypse to dispel the curse.<br>
lead Chaos to victory in the battle of the ancients, or the War from the shadow isles to victory on the rift, and you'll gain their support. lead Chaos to victory in the battle of the ancients, or the War from the shadow isles to victory on the rift, and you'll gain their support.
</div> </div>
@ -64,7 +87,7 @@
<h2> <h2>
carve the ritual pumpkin carve the ritual pumpkin
</h2> </h2>
<div> <div class="description">
prepare a pumpkin, and empty its inside.<br> prepare a pumpkin, and empty its inside.<br>
carve something on its exterior then put a light inside of it.<br> carve something on its exterior then put a light inside of it.<br>
when dusk has come, take a picture, and <a href="/whatpumpkin">post it to the owl captain</a>. when dusk has come, take a picture, and <a href="/whatpumpkin">post it to the owl captain</a>.
@ -74,7 +97,7 @@
<h2> <h2>
circle the sound circle the sound
</h2> </h2>
<div> <div class="description">
find the 2038th sound of halloween.<br> find the 2038th sound of halloween.<br>
then, follow the circle pattern.<br> then, follow the circle pattern.<br>
<br> <br>
@ -84,7 +107,7 @@
<h2> <h2>
uproot the evil uproot the evil
</h2> </h2>
<div> <div class="description">
listen to the sounds in here.<br> listen to the sounds in here.<br>
do you hear the evil that stole your voice?<br> do you hear the evil that stole your voice?<br>
answer it. answer it.
@ -97,7 +120,7 @@
<h2> <h2>
remove the ghosts remove the ghosts
</h2> </h2>
<div> <div class="description">
during the ritual something strange might happen.<br> during the ritual something strange might happen.<br>
in that case, the ghosts probably will be to blame.<br> in that case, the ghosts probably will be to blame.<br>
to be safe, i would remove them...<br> to be safe, i would remove them...<br>
@ -108,8 +131,8 @@
<h2> <h2>
conquer the mansion conquer the mansion
</h2> </h2>
<div> <div class="description">
a mansion has appeared.<br> <a href="{{ url_for('static', filename='snesfile.zip') }}">a mansion</a> has appeared.<br>
prove yourself worthy, and find the words hidden deep inside.<br> prove yourself worthy, and find the words hidden deep inside.<br>
only then i can trust you to completely perform the ritual. only then i can trust you to completely perform the ritual.
</div> </div>
@ -121,28 +144,28 @@
<h2> <h2>
</h2> </h2>
<div> <div class="description">
</div> </div>
{% elif loop.index == 8 %} {% elif loop.index == 8 %}
<h2> <h2>
</h2> </h2>
<div> <div class="description">
</div> </div>
{% elif loop.index == 9 %} {% elif loop.index == 9 %}
<h2> <h2>
</h2> </h2>
<div> <div class="description">
</div> </div>
{% elif loop.index == 10 %} {% elif loop.index == 10 %}
<h2> <h2>
</h2> </h2>
<div> <div class="description">
</div> </div>
{% endif %} {% endif %}

View file

@ -68,7 +68,7 @@ def page_main():
random_diario = db_session.query(db.Diario).order_by(db.func.random()).first() random_diario = db_session.query(db.Diario).order_by(db.func.random()).first()
next_events = db_session.query(db.Event).filter(db.Event.time > datetime.datetime.now()).order_by( next_events = db_session.query(db.Event).filter(db.Event.time > datetime.datetime.now()).order_by(
db.Event.time).all() db.Event.time).all()
halloween = db.Halloween.puzzle_status() halloween = db.Halloween.puzzle_status()[1]
db_session.close() db_session.close()
return render_template("main.html", royals=royals, wiki_pages=wiki_pages, entry=random_diario, return render_template("main.html", royals=royals, wiki_pages=wiki_pages, entry=random_diario,
next_events=next_events, g=fl_g, escape=escape, halloween=enumerate(halloween)) next_events=next_events, g=fl_g, escape=escape, halloween=enumerate(halloween))
@ -115,6 +115,7 @@ def page_loggedin():
db_session = db.Session() db_session = db.Session()
user = db_session.query(db.Royal).filter_by(username=username).one_or_none() user = db_session.query(db.Royal).filter_by(username=username).one_or_none()
db_session.close() db_session.close()
fl_session.permanent = True
if user is None: if user is None:
abort(403) abort(403)
return return
@ -334,7 +335,7 @@ def page_diario():
@app.route("/api/token") @app.route("/api/token")
def page_token(): def api_token():
username = request.form.get("username", "") username = request.form.get("username", "")
password = request.form.get("password", "") password = request.form.get("password", "")
db_session = db.Session() db_session = db.Session()
@ -361,19 +362,15 @@ def page_token():
return return
@app.route("/spooky", methods=["POST"]) @app.route("/ses/identify")
def page_spooky(): def ses_identify():
if request.form.get("solution", "") != "1": response = jsonify({
return redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ") "username": fl_session.get("username"),
user_id = fl_session.get("user_id") "id": fl_session.get("user_id")
if not user_id: })
return redirect("https://www.youtube.com/watch?v=djV11Xbc914") response.headers["Access-Control-Allow-Origin"] = "https://owlcaptain.tk"
db_session = db.Session() return response
user = db_session.query(db.Royal).filter_by(id=user_id).one()
halloween = db.Halloween(royal=user, first_trigger=datetime.datetime.now())
db_session.add(halloween)
db_session.commit()
return redirect(url_for("page_main"))
@app.before_request @app.before_request