T'étais sur le net..
2
README
|
@ -1,4 +1,4 @@
|
|||
Le serveur a besoin des droits en écriture sur la base SQLite3 et le répertoire
|
||||
la contenant.
|
||||
|
||||
Histoire : bbc -> lhark -> guimoz
|
||||
Histoire : bbc -> lhark -> guimoz -> Klafyvel + volgarr + Yoann
|
||||
|
|
4
assholes
|
@ -1,2 +1,4 @@
|
|||
Luc Absil
|
||||
Louis-Guillaume Dubois
|
||||
Matthieu Michelet
|
||||
Clara Husson
|
||||
Melchior Garapin
|
||||
|
|
|
@ -8,28 +8,37 @@ def connect_sql():
|
|||
passwd="q5kBLchS6ooAZDSxMeJG2gdf4gmJcfS5", # your password
|
||||
db="roulette") # name of the data base
|
||||
|
||||
def process():
|
||||
# Connexion à la base SQLite locale
|
||||
con = connect_sql()
|
||||
cur = con.cursor()
|
||||
print("Drop tables")
|
||||
cur.execute('''drop table if exists players''')
|
||||
cur.execute('''drop table if exists machines''')
|
||||
print("create tables")
|
||||
cur.execute('''create table players (id int,firstname text,name text, ban_end float)''')
|
||||
cur.execute('''create table machines (id int,player_id int,ip text)''')
|
||||
print("select players")
|
||||
cur.execute("""select id from players""")
|
||||
players = cur.fetchall()
|
||||
players = [player[0] for player in players]
|
||||
|
||||
# Connexion à la base SQLite locale
|
||||
con = connect_sql()
|
||||
cur = con.cursor()
|
||||
# cur.execute('''create table players (id,prenom,nom, etat)''')
|
||||
# cur.execute('''create table machines (id,uid_user,ip)''')
|
||||
cur.execute("""select id from players""")
|
||||
players = cur.fetchall()
|
||||
players = [player[0] for player in players]
|
||||
|
||||
cur.execute("""select ip from machines""")
|
||||
machines = cur.fetchall()
|
||||
machines = [machine[0] for machine in machines]
|
||||
|
||||
for user in User.objects.filter(school=1):
|
||||
print("select machines")
|
||||
cur.execute("""select ip from machines""")
|
||||
machines = cur.fetchall()
|
||||
machines = [machine[0] for machine in machines]
|
||||
u = User.objects.filter(school=1)
|
||||
print("Let's go !!!")
|
||||
for x,user in enumerate(u):
|
||||
print("Avancement : {}%".format(round(x/len(u)*100, 2)), end="\r")
|
||||
if user.has_access() and (user.is_adherent() or user.end_adhesion()):
|
||||
if user.uid_number not in players:
|
||||
cur.execute("""insert into players values (?,?,?,?)""",(user.uid_number, user.name, user.surname, 0))
|
||||
print(user.surname+' '+user.name)
|
||||
s = """insert into players values ({},"{}","{}",{});""".format(user.uid_number, user.name, user.surname, 0)
|
||||
cur.execute(s)
|
||||
for m in Machine.objects.filter(user= user):
|
||||
for i in Interface.objects.filter(machine = m):
|
||||
if i.ipv4.ipv4 not in machines:
|
||||
cur.execute("""insert into machines values (?,?,?) """,(i.id, user.uid_number, i.ipv4.ipv4))
|
||||
|
||||
con.close()
|
||||
s = """insert into machines values ({},{},"{}") ;""".format(i.id, user.uid_number, i.ipv4.ipv4)
|
||||
cur.execute(s)
|
||||
con.commit()
|
||||
con.close()
|
||||
|
|
|
@ -171,8 +171,8 @@ def get_players_not_banned():
|
|||
def cheat(player_id, target_id):
|
||||
success = random.choice([True, False])
|
||||
try:
|
||||
# ok = [line.strip().partition(' ') for line in IMMUNITY]
|
||||
# ok = [get_player_from_full_name(names[0], names[2])['id'] for names in ok]
|
||||
ok = [line.strip().partition(' ') for line in IMMUNITY]
|
||||
ok = [get_player_from_full_name(names[0], names[2])['id'] for names in ok]
|
||||
|
||||
ko = [line.strip().partition(' ') for line in ASSHOLES]
|
||||
ko = [get_player_from_full_name(names[0], names[2])['id'] for names in ko]
|
||||
|
@ -181,8 +181,8 @@ def cheat(player_id, target_id):
|
|||
success = True
|
||||
elif player_id in ko:
|
||||
success = False
|
||||
# elif target_id in ok:
|
||||
# success = False
|
||||
elif target_id in ok:
|
||||
success = False
|
||||
|
||||
except TypeError:
|
||||
pass
|
||||
|
|
Before Width: | Height: | Size: 9.6 KiB |
1
static/img/banner.svg
Normal file
After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 773 B |
Before Width: | Height: | Size: 780 B |
Before Width: | Height: | Size: 770 B |
Before Width: | Height: | Size: 754 B |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 651 B |
Before Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 8.9 KiB |
0
static/style.cs
Normal file
|
@ -1,5 +1,5 @@
|
|||
body {
|
||||
background: #3b5998;
|
||||
background: #2ecc71;
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-family: helvetica, sans;
|
||||
|
@ -19,8 +19,8 @@ a {
|
|||
}
|
||||
|
||||
#banner {
|
||||
height: 301px;
|
||||
background: center center url('img/metzquetaires_or.png') no-repeat;
|
||||
height: 100px;
|
||||
background: center center url('img/banner.svg') no-repeat;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
|
@ -34,45 +34,7 @@ a {
|
|||
padding-right: 12px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
#content_container div.corner {
|
||||
height: 70px;
|
||||
width: 70px;
|
||||
background-repeat: no-repeat;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#content_topleft {
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background-image: url('img/corner_topleft.png');
|
||||
background-color: #3b5998;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#content_topright {
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
background-image: url('img/corner_topright.png');
|
||||
background-color: #3b5998;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#content_bottomleft {
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
background-image: url('img/corner_bottomleft.png');
|
||||
background-color: #3b5998;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#content_bottomright {
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
background-image: url('img/corner_bottomright.png');
|
||||
background-color: #3b5998;
|
||||
z-index: 4;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
#content {
|
||||
|
|
|
@ -29,7 +29,7 @@ $(function () {
|
|||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: 'Etat du Rezo',
|
||||
text: 'État du Rézo',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle',
|
||||
y: 60
|
||||
|
@ -54,7 +54,7 @@ $(function () {
|
|||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: 'Pourcentage',
|
||||
name: 'État du Rézo',
|
||||
innerSize: '50%',
|
||||
data: [
|
||||
{
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
{% block content %}
|
||||
<h2>Toi aussi, joue au rézoman !</h2>
|
||||
<p>
|
||||
La rezo-roulette metzquetaire vous offre un répit temporaire. Profite bien {{ user['firstname']+' '+user['name'] }} ;-)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Rétablissement de la roulette vers midi.
|
||||
La Rézoroulette Metzthernet vous offre un répit temporaire. Profite bien {{ user['firstname']+' '+user['name'] }} ;-)
|
||||
</p>
|
||||
|
||||
<div id="container" style="min-width: 310px; max-width: 600px; margin: 0 auto"></div>
|
||||
|
@ -35,7 +31,7 @@ $(function () {
|
|||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: 'Etat du Rezo',
|
||||
text: 'État du Rézo',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle',
|
||||
y: 60
|
||||
|
@ -60,7 +56,7 @@ $(function () {
|
|||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: 'Pourcentage',
|
||||
name: 'État du Rézo',
|
||||
innerSize: '50%',
|
||||
data: [
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<br>
|
||||
<h2>Toi aussi, joue au rézoman avec la rezo-roulette Les Metzquetaires !</h2>
|
||||
<h2>plop lolilol babeuloula</h2>
|
||||
<p id="play" style="text-align: center; font-size: 1.5em">
|
||||
<a href="{{url_for('play')}}">Jouer</a>
|
||||
</p>
|
||||
|
@ -32,7 +32,7 @@
|
|||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: 'Etat du Rezo',
|
||||
text: 'État du Rézo',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle',
|
||||
y: 60
|
||||
|
@ -57,7 +57,7 @@
|
|||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: 'Etat du Rezo',
|
||||
name: 'État du Rézo',
|
||||
innerSize: '50%',
|
||||
data: [
|
||||
{
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Rezo-roulette Metzquetaires</title>
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html;charset=utf-8" />
|
||||
<title>Rézoroulette Metzthernet</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='highcharts.js') }}"></script>
|
||||
|
@ -19,10 +17,6 @@
|
|||
</div>
|
||||
|
||||
<div id="content_container">
|
||||
<div id="content_topleft" class="corner">
|
||||
</div>
|
||||
<div id="content_topright" class="corner">
|
||||
</div>
|
||||
<div id="content">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
|
@ -35,11 +29,7 @@
|
|||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div id="content_bottomleft" class="corner">
|
||||
</div>
|
||||
<div id="content_bottomright" class="corner">
|
||||
</div>
|
||||
<div id="footer">contact technique : <a href="mailto:roulette@metzquetaires.fr">roulette@metzquetaires.fr</a></div>
|
||||
<div id="footer">Contact technique : <a href="mailto:metzthernet@gmail.com">metzthernet@gmail.com</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Rezo-roulette Metzquetaires</title>
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html;charset=utf-8" />
|
||||
<title>Rézoroulette Metzthernet</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="refresh" content="60">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style_red.css') }}" />
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||
|
@ -20,10 +18,6 @@
|
|||
</div>
|
||||
|
||||
<div id="content_container">
|
||||
<div id="content_topleft" class="corner">
|
||||
</div>
|
||||
<div id="content_topright" class="corner">
|
||||
</div>
|
||||
<div id="content">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
|
@ -36,11 +30,7 @@
|
|||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div id="content_bottomleft" class="corner">
|
||||
</div>
|
||||
<div id="content_bottomright" class="corner">
|
||||
</div>
|
||||
<div id="footer">contact technique : <a href="mailto:roulette@metzquetaires.fr">roulette@metzquetaires.fr</a></div>
|
||||
<div id="footer">Contact technique : <a href="mailto:metzthernet@gmail.com">metzthernet@gmail.com</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Rezo-roulette</title>
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html;charset=utf-8" />
|
||||
<title>Rézoroulette</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='highcharts.js') }}"></script>
|
||||
|
@ -17,10 +15,6 @@
|
|||
<div id="body_bis">
|
||||
|
||||
<div id="content_container">
|
||||
<div id="content_topleft" class="corner">
|
||||
</div>
|
||||
<div id="content_topright" class="corner">
|
||||
</div>
|
||||
<div id="content">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
|
@ -33,10 +27,6 @@
|
|||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div id="content_bottomleft" class="corner">
|
||||
</div>
|
||||
<div id="content_bottomright" class="corner">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -17,7 +17,7 @@ $(function () {
|
|||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: 'Etat du Rezo',
|
||||
text: 'État du Rézo',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle',
|
||||
y: 60
|
||||
|
@ -42,7 +42,7 @@ $(function () {
|
|||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: 'Etat du Rezo',
|
||||
name: 'État du Rézo',
|
||||
innerSize: '50%',
|
||||
data: [
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ $(function () {
|
|||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: 'Etat du Rezo',
|
||||
text: 'État du Rézo',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle',
|
||||
y: 60
|
||||
|
@ -55,7 +55,7 @@ $(function () {
|
|||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: 'Etat du Rezo',
|
||||
name: 'État du Rézo',
|
||||
innerSize: '50%',
|
||||
data: [
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{% extends "layout_precampagne.html" %}
|
||||
{% block content %}
|
||||
<h2>Pas de précampagne!</h2>
|
||||
<h2>Pas de précampagne !</h2>
|
||||
<p>
|
||||
Reviens plus tard {{ user['firstname']+' '+user['name'] }} pour jouer à la rezo-roulette
|
||||
Reviens plus tard {{ user['firstname']+' '+user['name'] }} pour jouer à la Rézoroulette.
|
||||
</p>
|
||||
<div id="container" style="min-width: 310px; max-width: 600px; margin: 0 auto"></div>
|
||||
<script type="text/javascript">
|
||||
|
@ -14,7 +14,7 @@ $(function () {
|
|||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: 'Etat du Rezo',
|
||||
text: 'État du Rézo',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle',
|
||||
y: 60
|
||||
|
@ -39,7 +39,7 @@ $(function () {
|
|||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: 'Etat du Rezo',
|
||||
name: 'État du Rézo',
|
||||
innerSize: '50%',
|
||||
data: [
|
||||
{
|
||||
|
|