From 93b38cfc4725d9279117db20e680d45bccfabc33 Mon Sep 17 00:00:00 2001 From: foin137 <62767760+foin137@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:44:24 +0100 Subject: [PATCH 1/4] Handle mysqli errors - Handle mysql errors that are no longer silenced per default for new php versions - Handled error when log file cannot be created --- Werwolf.php | 32 +++++++++++---- includes/functions.php | 92 ++++++++++++++++++++++++------------------ 2 files changed, 78 insertions(+), 46 deletions(-) diff --git a/Werwolf.php b/Werwolf.php index 8c9771c..f7541d1 100644 --- a/Werwolf.php +++ b/Werwolf.php @@ -143,8 +143,14 @@ p#liste { else { //Schauen, ob es auch einen Eintrag zu diesem Spiel in der Datenbank gibt... - $alleres = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); - if(isset($alleres->num_rows)) + $spiel_existiert = True; + try{ + $alleres = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); + } + catch (Exception $e) { + $spiel_existiert = False; + } + if($spiel_existiert && isset($alleres->num_rows)) { //Schauen, ob es auch mich als Spieler gibt und meine verifizierungsnr stimmt $spielerResult = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE id = $eigeneID AND verifizierungsnr = ".(int)$_COOKIE['verifizierungsnr']); @@ -1513,8 +1519,14 @@ p#liste { } $spielID = rand(10000,99999); //nachschauen, ob ein Spiel mit dieser Nummer bereits existiert - $res = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); - if(isset($res->num_rows)){ + $existiert = False; + try { + $res = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); + } + catch (mysqli_sql_exception $e){ + $existiert = True; + } + if(!$existiert && isset($res->num_rows)){ //Tabelle existiert }else{ @@ -1635,8 +1647,14 @@ p#liste { if ($_POST['ihrName'] != "" && strpos($_POST['ihrName'],"$")===false && strpos($_POST['ihrName'],";")===false && strpos($_POST['ihrName'],'"')===false && strpos($_POST['ihrName'],"'")===false && strpos($_POST['ihrName'],"=")===false) { //Name wurde eingegeben. Existiert auch ein Spiel dieser Nummer? - $res = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); - if(isset($res->num_rows)) + $existiert = False; + try{ + $res = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); + } + catch(mysqli_sql_exception $e){ + $existiert = True; + } + if(!$existiert && isset($res->num_rows)) { //Ein Spiel dieser Nummer existiert! $verboteneNamen = array("niemanden","niemand","keinen","keiner","dorfbewohner","werwolf","seher","seherin","hexe","hexer","jäger","amor","beschützer","paranormaler ermittler","lykantroph","lykantrophin","spion","spionin","mordlustiger","mordlustige","pazifist","pazifistin","alter mann","alter","alte","alte frau","die alten","alten"); @@ -1645,6 +1663,7 @@ p#liste { $stmt->bind_param('s',$_POST['ihrName']); $stmt->execute(); $nameRes = $stmt->get_result(); + $stmt->close(); if ($nameRes->num_rows <= 0 && !in_array(strtolower($_POST['ihrName']),$verboteneNamen)) { //Name gültig @@ -1696,7 +1715,6 @@ p#liste { { echo "

Der angegebene Name ist bereits vorhanden oder ungültig

"; } - $stmt->close(); } else { diff --git a/includes/functions.php b/includes/functions.php index 8206284..ea2e954 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -30,8 +30,14 @@ function loescheAlteSpiele($mysqli) for ($i = 10000; $i<= 99999; $i++) { - $alleres = $mysqli ->Query("SELECT * FROM $i"."_game"); - if(isset($alleres->num_rows)) + $existiert = True; + try{ + $alleres = $mysqli ->Query("SELECT * FROM $i"."_game"); + } + catch (mysqli_sql_exception $e){ + $existiert = False; + } + if($existiert && isset($alleres->num_rows)) { $temp = $alleres->fetch_assoc(); if ($temp['letzterAufruf'] < $zeitpunkt) @@ -1658,41 +1664,45 @@ function writeGameToLog($mysqli) $spielID = $_COOKIE['SpielID']; $fileName = "log/Werwolf_log_".date("Y_m").".log"; $myfile = fopen($fileName, "a"); - fwrite($myfile,"\n--- SPIEL BEENDET --- \n"); - fwrite($myfile,"SpielID: $spielID \n"); - fwrite($myfile,"SpielEnde: ".date("d.m.Y, H:i:s")."\n"); - //Alle Spieler hineinschreiben: - fwrite($myfile,"Spieler:\n"); - $playerQ = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); - while ($temp = $playerQ->fetch_assoc()) - { - fwrite($myfile,$temp['name']."\n"); - } - fwrite($myfile,"Spielverlauf:\n"); - $gameAssoc = gameAssoc($mysqli); - $mitUmbruch = str_replace("
","\n",$gameAssoc['log']); - fwrite($myfile,$mitUmbruch); + if ($myfile){ + fwrite($myfile,"\n--- SPIEL BEENDET --- \n"); + fwrite($myfile,"SpielID: $spielID \n"); + fwrite($myfile,"SpielEnde: ".date("d.m.Y, H:i:s")."\n"); + //Alle Spieler hineinschreiben: + fwrite($myfile,"Spieler:\n"); + $playerQ = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); + while ($temp = $playerQ->fetch_assoc()) + { + fwrite($myfile,$temp['name']."\n"); + } + fwrite($myfile,"Spielverlauf:\n"); + $gameAssoc = gameAssoc($mysqli); + $mitUmbruch = str_replace("
","\n",$gameAssoc['log']); + fwrite($myfile,$mitUmbruch); - //Schreibe noch die Überlebenden - fwrite($myfile,"Die Überlebenden:\n"); - $lebendQuery = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE lebt = 1"); - while ($temp = $lebendQuery->fetch_assoc()) - { - fwrite($myfile,$temp['name']."(".nachtidentitaetAlsString($temp['nachtIdentitaet'],$mysqli).")\n"); + //Schreibe noch die Überlebenden + fwrite($myfile,"Die Überlebenden:\n"); + $lebendQuery = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE lebt = 1"); + while ($temp = $lebendQuery->fetch_assoc()) + { + fwrite($myfile,$temp['name']."(".nachtidentitaetAlsString($temp['nachtIdentitaet'],$mysqli).")\n"); + } + fwrite($myfile,"--- ENDE DES SPIELLOGS ---\n"); + fclose($myfile); } - fwrite($myfile,"--- ENDE DES SPIELLOGS ---\n"); - fclose($myfile); } function writeGameToLogSpielErstellen($mysqli, $spielID, $name) { $fileName = "log/Werwolf_log_".date("Y_m").".log"; $myfile = fopen($fileName, "a"); - fwrite($myfile,"\n--- NEUES SPIEL ERSTELLT --- \n"); - fwrite($myfile,"SpielID: $spielID \n"); - fwrite($myfile,"Zeit: ".date("d.m.Y, H:i:s")."\n"); - fwrite($myfile,"Name des Erstellers: $name \n"); - fclose($myfile); + if ($myfile){ + fwrite($myfile,"\n--- NEUES SPIEL ERSTELLT --- \n"); + fwrite($myfile,"SpielID: $spielID \n"); + fwrite($myfile,"Zeit: ".date("d.m.Y, H:i:s")."\n"); + fwrite($myfile,"Name des Erstellers: $name \n"); + fclose($myfile); + } } function checkeSiegbedingungen($mysqli) @@ -1813,11 +1823,13 @@ function setBereit($mysqli,$spielerID,$bereit) function gameAssoc($mysqli) { $spielID = $_COOKIE['SpielID']; - if ($gameRes = $mysqli->Query("SELECT * FROM $spielID"."_game")) - { - $gameA = $gameRes->fetch_assoc(); - return $gameA; - } + try{ + if ($gameRes = $mysqli->Query("SELECT * FROM $spielID"."_game")) + { + $gameA = $gameRes->fetch_assoc(); + return $gameA; + } + }catch(mysqli_sql_exception $e) {} return false; } @@ -1835,11 +1847,13 @@ function getName($mysqli, $spielerID) //Gibt den Namen des Spielers mit der $spielerID zurück $spielID = $_COOKIE['SpielID']; $spielerID = (int)$spielerID; - if ($res = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE id = $spielerID")) - { - $temp = $res->fetch_assoc(); - return $temp['name']; - } + try{ + if ($res = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE id = $spielerID")) + { + $temp = $res->fetch_assoc(); + return $temp['name']; + } + } catch(mysqli_sql_exception $e) {} return "Unknown"; } From 2bf710e215aa7e7d673667c84397c7ac31ceb55e Mon Sep 17 00:00:00 2001 From: foin137 <62767760+foin137@users.noreply.github.com> Date: Sun, 5 Nov 2023 16:02:36 +0100 Subject: [PATCH 2/4] Possibility to disable new games Include possibility to disable new games by changing a constant in constants.php --- Werwolf.php | 261 ++++++++++++++++++++++------------------- includes/constants.php | 8 +- 2 files changed, 145 insertions(+), 124 deletions(-) diff --git a/Werwolf.php b/Werwolf.php index f7541d1..d35517a 100644 --- a/Werwolf.php +++ b/Werwolf.php @@ -1463,8 +1463,16 @@ p#liste { if (isset($_POST['neuesSpiel'])) { //Starten wir ein neues Spiel - $mysqli->Query("UPDATE $spielID"."_game SET spielphase = ".PHASESETUP); - $mysqli->Query("UPDATE $spielID"."_spieler SET reload = 1"); + if (_NOGAMECREATIONERRORMESSAGE == "") + { + $mysqli->Query("UPDATE $spielID"."_game SET spielphase = ".PHASESETUP); + $mysqli->Query("UPDATE $spielID"."_spieler SET reload = 1"); + } + else + { + //Spiel darf nicht erstellt werden, da _NOGAMECREATIONERRORMESSAGE existiert + echo "

Spiel darf nicht erstellt werden: ". _NOGAMECREATIONERRORMESSAGE ."

"; + } } echo "
@@ -1509,129 +1517,138 @@ p#liste { if (rand(1,100)==50) loescheAlteSpiele($mysqli); //Wir erstellen ein neues Spiel - //Eine Schleife, die solange rennt, bis eine neue Zahl gefunden wurde - for ($i = 1; $i <= 100000; $i++) + + if (_NOGAMECREATIONERRORMESSAGE == "") //Wir dürfen nur ein neues Spiel erstellen, falls diese message auf "" steht { - if ($i == 1000) + //Eine Schleife, die solange rennt, bis eine neue Zahl gefunden wurde + for ($i = 1; $i <= 100000; $i++) + { + if ($i == 1000) + { + //Vielleicht gibt es alte Spiele, die Platz verbrauchen + loescheAlteSpiele($mysqli); + } + $spielID = rand(10000,99999); + //nachschauen, ob ein Spiel mit dieser Nummer bereits existiert + $existiert = False; + try { + $res = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); + } + catch (mysqli_sql_exception $e){ + $existiert = True; + } + if(!$existiert && isset($res->num_rows)){ + + //Tabelle existiert + }else{ + //Tabelle existiert noch nicht + //erstellen wir eine neue Tabelle + //BEIM HINZUFÜGEN: Auch die SetSpielerDefaultFunction ändern + $sql = " + CREATE TABLE `$spielID"."_spieler" ."` ( + `id` INT( 10 ) NULL, + `name` VARCHAR( 150 ) NOT NULL , + `spielleiter` INT( 5 ) NULL , + `lebt` INT (2) NULL, + `wahlAuf` INT ( 5 ) DEFAULT -1 , + `angeklagtVon` INT ( 5 ) DEFAULT -1 , + `nachtIdentitaet` INT( 10 ) NULL, + `buergermeister` INT ( 2 ) DEFAULT 0, + `hexeHeiltraenke` INT( 10 ) NULL, + `hexeTodestraenke` INT( 5 ) NULL , + `hexenOpfer` INT ( 5 ) DEFAULT -1 , + `hexeHeilt` INT (2) DEFAULT 0, + `beschuetzerLetzteRundeBeschuetzt` INT( 5 ) DEFAULT -1 , + `parErmEingesetzt` INT (2) DEFAULT 0 , + `verliebtMit` INT ( 5 ) DEFAULT -1 , + `jaegerDarfSchiessen` INT (2) DEFAULT 0 , + `buergermeisterDarfWeitergeben` INT (2) DEFAULT 0 , + `urwolf_anzahl_faehigkeiten` INT ( 5 ) DEFAULT 0, + `dieseNachtGestorben` INT (2) DEFAULT 0 , + `countdownBis` INT (10) DEFAULT 0 , + `countdownAb` INT (10) DEFAULT 0 , + `playerlog` LONGTEXT , + `popup_text` TEXT , + `bereit` INT (2) NULL , + `reload` INT (2) NULL , + `verifizierungsnr` INT ( 5 ) DEFAULT 0 + ) ; + "; + $mysqli->Query($sql); + //Wähle ein Verifizierungs-Passwort aus: + //Dieses dient dazu, um festzustellen, ob es tatsächlich der richtige Spieler ist, der eine Seite lädt + $verifizierungsnr = rand(2,100000); + $stmt = $mysqli->prepare("INSERT INTO $spielID"."_spieler"." (id, name , spielleiter, lebt, reload, verifizierungsnr) VALUES ( 0 , ?, 1 , 0 , 1, ?)"); + $stmt->bind_param('si',$_POST['ihrName'],$verifizierungsnr); + $stmt->execute(); + $stmt->close(); + $sql2 = " + CREATE TABLE `$spielID"."_game` ( + `spielphase` INT( 5 ) DEFAULT 0, + `charaktereAufdecken` INT ( 2 ) DEFAULT 0, + `buergermeisterWeitergeben` INT ( 2 ) DEFAULT 0, + `seherSiehtIdentitaet` INT ( 2 ) DEFAULT 1, + `werwolfzahl` INT ( 5 ) DEFAULT 0 , + `hexenzahl` INT ( 5 ) DEFAULT 0 , + `seherzahl` INT ( 5 ) DEFAULT 0 , + `jaegerzahl` INT ( 5 ) DEFAULT 0 , + `amorzahl` INT ( 2 ) DEFAULT 0 , + `beschuetzerzahl` INT ( 5 ) DEFAULT 0 , + `parErmZahl` INT (5) DEFAULT 0 , + `lykantrophenzahl` INT ( 5 ) DEFAULT 0 , + `spionezahl` INT ( 5 ) DEFAULT 0 , + `idiotenzahl` INT ( 5 ) DEFAULT 0 , + `pazifistenzahl` INT ( 5 ) DEFAULT 0 , + `altenzahl` INT ( 5 ) DEFAULT 0 , + `urwolfzahl` INT ( 5 ) DEFAULT 0 , + `zufaelligeAuswahl` INT ( 2 ) DEFAULT 0 , + `zufaelligeAuswahlBonus` INT ( 5 ) DEFAULT 0 , + `werwolfeinstimmig` INT ( 2 ) DEFAULT 1 , + `werwolfopfer` INT ( 5 ) DEFAULT -1 , + `werwolftimer1` INT ( 10 ) DEFAULT 60 , + `werwolfzusatz1` INT ( 10 ) DEFAULT 4 , + `werwolftimer2` INT ( 10 ) DEFAULT 50 , + `werwolfzusatz2` INT ( 10 ) DEFAULT 3 , + `dorftimer` INT ( 10 ) DEFAULT 550 , + `dorfzusatz` INT ( 10 ) DEFAULT 10 , + `dorfstichwahltimer` INT ( 10 ) DEFAULT 200 , + `dorfstichwahlzusatz` INT ( 10 ) DEFAULT 5 , + `inaktivzeit` INT ( 10 ) DEFAULT 40 , + `inaktivzeitzusatz` INT ( 10 ) DEFAULT 0 , + `tagestext` TEXT , + `nacht` INT ( 5 ) DEFAULT 1 , + `log` LONGTEXT , + `list_lebe` LONGTEXT, + `list_lebe_aktualisiert` BIGINT DEFAULT 0, + `list_tot` LONGTEXT, + `list_tot_aktualisiert` BIGINT DEFAULT 0, + `waiting_for_others_time` BIGINT, + `letzterAufruf` BIGINT + ) ;"; + $mysqli->Query($sql2); + $mysqli->Query("INSERT INTO $spielID"."_game (spielphase, letzterAufruf) VALUES (0 , ".time().")"); + + //Die SpielID groß mitteilen + echo "

$spielID


Mit dieser Zahl können andere deinem Spiel beitreten!"; + + //Die eigene SpielID setzen + setcookie ("SpielID", $spielID, time()+172800); //Dauer 2 Tage, länger sollte ein Spiel nicht dauern ;) + setcookie ("eigeneID",0, time()+172800); + setcookie ("verifizierungsnr",$verifizierungsnr, time()+172800); + $_COOKIE["SpielID"]=$spielID; + $_COOKIE["eigeneID"] = 0; + $_COOKIE["verifizieren"] = $verifizierungsnr; + writeGameToLogSpielErstellen($mysqli,$spielID,$_POST['ihrName']); + break; //die Schleife beenden + } + } + $pageReload = true; + } + else { - //Vielleicht gibt es alte Spiele, die Platz verbrauchen - loescheAlteSpiele($mysqli); + //Spiel darf nicht erstellt werden, da _NOGAMECREATIONERRORMESSAGE existiert + echo "

Spiel darf nicht erstellt werden: ". _NOGAMECREATIONERRORMESSAGE ."

"; } - $spielID = rand(10000,99999); - //nachschauen, ob ein Spiel mit dieser Nummer bereits existiert - $existiert = False; - try { - $res = $mysqli->Query("SELECT * FROM $spielID"."_spieler"); - } - catch (mysqli_sql_exception $e){ - $existiert = True; - } - if(!$existiert && isset($res->num_rows)){ - - //Tabelle existiert - }else{ - //Tabelle existiert noch nicht - //erstellen wir eine neue Tabelle - //BEIM HINZUFÜGEN: Auch die SetSpielerDefaultFunction ändern - $sql = " - CREATE TABLE `$spielID"."_spieler" ."` ( - `id` INT( 10 ) NULL, - `name` VARCHAR( 150 ) NOT NULL , - `spielleiter` INT( 5 ) NULL , - `lebt` INT (2) NULL, - `wahlAuf` INT ( 5 ) DEFAULT -1 , - `angeklagtVon` INT ( 5 ) DEFAULT -1 , - `nachtIdentitaet` INT( 10 ) NULL, - `buergermeister` INT ( 2 ) DEFAULT 0, - `hexeHeiltraenke` INT( 10 ) NULL, - `hexeTodestraenke` INT( 5 ) NULL , - `hexenOpfer` INT ( 5 ) DEFAULT -1 , - `hexeHeilt` INT (2) DEFAULT 0, - `beschuetzerLetzteRundeBeschuetzt` INT( 5 ) DEFAULT -1 , - `parErmEingesetzt` INT (2) DEFAULT 0 , - `verliebtMit` INT ( 5 ) DEFAULT -1 , - `jaegerDarfSchiessen` INT (2) DEFAULT 0 , - `buergermeisterDarfWeitergeben` INT (2) DEFAULT 0 , - `urwolf_anzahl_faehigkeiten` INT ( 5 ) DEFAULT 0, - `dieseNachtGestorben` INT (2) DEFAULT 0 , - `countdownBis` INT (10) DEFAULT 0 , - `countdownAb` INT (10) DEFAULT 0 , - `playerlog` LONGTEXT , - `popup_text` TEXT , - `bereit` INT (2) NULL , - `reload` INT (2) NULL , - `verifizierungsnr` INT ( 5 ) DEFAULT 0 - ) ; - "; - $mysqli->Query($sql); - //Wähle ein Verifizierungs-Passwort aus: - //Dieses dient dazu, um festzustellen, ob es tatsächlich der richtige Spieler ist, der eine Seite lädt - $verifizierungsnr = rand(2,100000); - $stmt = $mysqli->prepare("INSERT INTO $spielID"."_spieler"." (id, name , spielleiter, lebt, reload, verifizierungsnr) VALUES ( 0 , ?, 1 , 0 , 1, ?)"); - $stmt->bind_param('si',$_POST['ihrName'],$verifizierungsnr); - $stmt->execute(); - $stmt->close(); - $sql2 = " - CREATE TABLE `$spielID"."_game` ( - `spielphase` INT( 5 ) DEFAULT 0, - `charaktereAufdecken` INT ( 2 ) DEFAULT 0, - `buergermeisterWeitergeben` INT ( 2 ) DEFAULT 0, - `seherSiehtIdentitaet` INT ( 2 ) DEFAULT 1, - `werwolfzahl` INT ( 5 ) DEFAULT 0 , - `hexenzahl` INT ( 5 ) DEFAULT 0 , - `seherzahl` INT ( 5 ) DEFAULT 0 , - `jaegerzahl` INT ( 5 ) DEFAULT 0 , - `amorzahl` INT ( 2 ) DEFAULT 0 , - `beschuetzerzahl` INT ( 5 ) DEFAULT 0 , - `parErmZahl` INT (5) DEFAULT 0 , - `lykantrophenzahl` INT ( 5 ) DEFAULT 0 , - `spionezahl` INT ( 5 ) DEFAULT 0 , - `idiotenzahl` INT ( 5 ) DEFAULT 0 , - `pazifistenzahl` INT ( 5 ) DEFAULT 0 , - `altenzahl` INT ( 5 ) DEFAULT 0 , - `urwolfzahl` INT ( 5 ) DEFAULT 0 , - `zufaelligeAuswahl` INT ( 2 ) DEFAULT 0 , - `zufaelligeAuswahlBonus` INT ( 5 ) DEFAULT 0 , - `werwolfeinstimmig` INT ( 2 ) DEFAULT 1 , - `werwolfopfer` INT ( 5 ) DEFAULT -1 , - `werwolftimer1` INT ( 10 ) DEFAULT 60 , - `werwolfzusatz1` INT ( 10 ) DEFAULT 4 , - `werwolftimer2` INT ( 10 ) DEFAULT 50 , - `werwolfzusatz2` INT ( 10 ) DEFAULT 3 , - `dorftimer` INT ( 10 ) DEFAULT 550 , - `dorfzusatz` INT ( 10 ) DEFAULT 10 , - `dorfstichwahltimer` INT ( 10 ) DEFAULT 200 , - `dorfstichwahlzusatz` INT ( 10 ) DEFAULT 5 , - `inaktivzeit` INT ( 10 ) DEFAULT 40 , - `inaktivzeitzusatz` INT ( 10 ) DEFAULT 0 , - `tagestext` TEXT , - `nacht` INT ( 5 ) DEFAULT 1 , - `log` LONGTEXT , - `list_lebe` LONGTEXT, - `list_lebe_aktualisiert` BIGINT DEFAULT 0, - `list_tot` LONGTEXT, - `list_tot_aktualisiert` BIGINT DEFAULT 0, - `waiting_for_others_time` BIGINT, - `letzterAufruf` BIGINT - ) ;"; - $mysqli->Query($sql2); - $mysqli->Query("INSERT INTO $spielID"."_game (spielphase, letzterAufruf) VALUES (0 , ".time().")"); - - //Die SpielID groß mitteilen - echo "

$spielID


Mit dieser Zahl können andere deinem Spiel beitreten!"; - - //Die eigene SpielID setzen - setcookie ("SpielID", $spielID, time()+172800); //Dauer 2 Tage, länger sollte ein Spiel nicht dauern ;) - setcookie ("eigeneID",0, time()+172800); - setcookie ("verifizierungsnr",$verifizierungsnr, time()+172800); - $_COOKIE["SpielID"]=$spielID; - $_COOKIE["eigeneID"] = 0; - $_COOKIE["verifizieren"] = $verifizierungsnr; - writeGameToLogSpielErstellen($mysqli,$spielID,$_POST['ihrName']); - break; //die Schleife beenden - } - } - $pageReload = true; } else { diff --git a/includes/constants.php b/includes/constants.php index 7e25f74..e55e233 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -1,9 +1,13 @@ Date: Sun, 5 Nov 2023 16:07:41 +0100 Subject: [PATCH 3/4] Include license statement --- Werwolf.php | 23 +++++++++++++++++++++++ gamelogreload.php | 20 ++++++++++++++++++++ includes/constants.php | 26 +++++++++++++++++++++++++- includes/functions.php | 21 +++++++++++++++++++++ includes/includes.example.php | 23 ++++++++++++++++++++++- listreload.php | 20 ++++++++++++++++++++ reload.php | 21 +++++++++++++++++++++ 7 files changed, 152 insertions(+), 2 deletions(-) diff --git a/Werwolf.php b/Werwolf.php index d35517a..5e63f90 100644 --- a/Werwolf.php +++ b/Werwolf.php @@ -1,3 +1,26 @@ +. + +*/ +?> + + diff --git a/gamelogreload.php b/gamelogreload.php index f9a5be9..18ed170 100644 --- a/gamelogreload.php +++ b/gamelogreload.php @@ -1,5 +1,25 @@ . + +*/ + include "includes/includes.php"; header("Content-Type: text/html; charset=utf-8"); header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); diff --git a/includes/constants.php b/includes/constants.php index e55e233..6550a5f 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -1,11 +1,35 @@ . + +*/ + //Settings: define ("_NOGAMECREATIONERRORMESSAGE", ""); //Falls nicht "": Kein Spiel kann erstellt werden, stattdessen wird der string angezeigt. //define ("_NOGAMECREATIONERRORMESSAGE", "Wartungsarbeiten bis ..."); //Falls nicht "": Kein Spiel kann erstellt werden, stattdessen wird der string angezeigt. define("_LISTMAXRELOADTIME",3000); define("_MAXPLAYERS",50); -//Constants, do not change! + +/////////////////////////////////// +// Constants, do not change! +/////////////////////////////////// define("_VERSION","v1.2.7"); //Phasen diff --git a/includes/functions.php b/includes/functions.php index ea2e954..1b2b1e5 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1,4 +1,25 @@ . + +*/ + function start() { //Diese Funktion zeigt das Startformular an, bei dem der Nutzer aufgefordert wird, ein Spiel zu erstellen, oder eine ID einzugeben diff --git a/includes/includes.example.php b/includes/includes.example.php index 2ddd6a3..b615816 100644 --- a/includes/includes.example.php +++ b/includes/includes.example.php @@ -1,5 +1,26 @@ . + +*/ + + +$id = "id"; // Ihre ID (username) zum MySQL Server $pw = "pw"; // Passwort zum MySQL Server $host = "localhost"; // Host ("localhost" oder "IP-Adresse") $db = "werwolf"; // Name Ihrer Datenbank diff --git a/listreload.php b/listreload.php index 58d9273..8c0cf3c 100644 --- a/listreload.php +++ b/listreload.php @@ -1,5 +1,25 @@ . + +*/ + include "includes/includes.php"; include "includes/constants.php"; header("Content-Type: text/html; charset=utf-8"); diff --git a/reload.php b/reload.php index 6014afa..88758fe 100644 --- a/reload.php +++ b/reload.php @@ -1,4 +1,25 @@ . + +*/ + + header("Content-Type: text/html; charset=utf-8"); header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past From a45bd3c6421f8c304b4d42d064ccc5133172f604 Mon Sep 17 00:00:00 2001 From: foin137 <62767760+foin137@users.noreply.github.com> Date: Sun, 5 Nov 2023 16:08:17 +0100 Subject: [PATCH 4/4] Update version --- includes/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/constants.php b/includes/constants.php index 6550a5f..02dcd50 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -30,7 +30,7 @@ define("_MAXPLAYERS",50); /////////////////////////////////// // Constants, do not change! /////////////////////////////////// -define("_VERSION","v1.2.7"); +define("_VERSION","v1.2.8"); //Phasen define ("PHASESETUP",0);