mirror of
https://github.com/foin137/werwolfonline.eu.git
synced 2025-12-12 03:11:35 +00:00
Merge pull request #28 from foin137/bug_27_deletegame
[#27] Fix bug when deleting games
This commit is contained in:
14
Werwolf.php
14
Werwolf.php
@@ -3940,10 +3940,13 @@ function setBereit($mysqli,$spielerID,$bereit)
|
||||
function gameAssoc($mysqli)
|
||||
{
|
||||
$spielID = $_COOKIE['SpielID'];
|
||||
$gameRes = $mysqli->Query("SELECT * FROM $spielID"."_game");
|
||||
if ($gameRes = $mysqli->Query("SELECT * FROM $spielID"."_game"))
|
||||
{
|
||||
$gameA = $gameRes->fetch_assoc();
|
||||
return $gameA;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function eigeneAssoc($mysqli)
|
||||
{
|
||||
@@ -3959,10 +3962,13 @@ function getName($mysqli, $spielerID)
|
||||
//Gibt den Namen des Spielers mit der $spielerID zurück
|
||||
$spielID = $_COOKIE['SpielID'];
|
||||
$spielerID = (int)$spielerID;
|
||||
$res = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE id = $spielerID");
|
||||
if ($res = $mysqli->Query("SELECT * FROM $spielID"."_spieler WHERE id = $spielerID"))
|
||||
{
|
||||
$temp = $res->fetch_assoc();
|
||||
return $temp['name'];
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
function getGesinnung($identitaet)
|
||||
{
|
||||
@@ -4092,7 +4098,8 @@ function toGameLog($mysqli,$logeintrag)
|
||||
{
|
||||
//Fügt dem gamelog den $logeintrag hinzu
|
||||
$spielID = $_COOKIE['SpielID'];
|
||||
$gameAssoc = gameAssoc($mysqli);
|
||||
if ($gameAssoc = gameAssoc($mysqli))
|
||||
{
|
||||
$aktLog = $gameAssoc['log'];
|
||||
$neuLog = $aktLog.date("H:i:s").": ".$logeintrag."<br>";
|
||||
$neuLog = str_replace("'",'"',$neuLog); //ersetze alle ' mit "
|
||||
@@ -4101,6 +4108,7 @@ function toGameLog($mysqli,$logeintrag)
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
}
|
||||
|
||||
function toPlayerLog($mysqli, $logeintrag, $spieler)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user