function Initialize() { $xml = simplexml_load_file("Tmp/GameInfo.xml"); $xml->gamemode = 1; $xml->loop = $xml->loop + 1; $xml->playeramount = 0; $xml->begintime = null; $xml->overtime = null; $xml->maxkiller = null; $xml->maxcontributer = null; $xml->winner = null; $xml->content = null; $xml->ending = null; $newXML = $xml->asXML(); //写入XML文件 $fp = fopen('Tmp/GameInfo.xml', "w"); fwrite($fp, $newXML); fclose($fp); DataBaseInitialize(); //数据库初始化 }
function Initialize() { $xml = simplexml_load_file("GameInfo.xml"); $xml->gamemode = 1; //1游戏准备,2游戏进行,3游戏人数已满,0游戏停止 $xml->loop = $xml->loop + 1; $xml->playeramount = 0; $xml->begintime = null; $xml->overtime = null; $xml->maxkiller = null; $xml->maxcontributer = null; $xml->winner = null; $xml->content = '世界线0.5000000'; $xml->ending = null; $newXML = $xml->asXML(); //写入XML文件 $fp = fopen('GameInfo.xml', "w"); fwrite($fp, $newXML); fclose($fp); CleanChatData(); DataBaseInitialize(); //数据库初始化 }
<?php include "GameControl.php"; DataBaseInitialize();