function getRandomUUID() { $param = 40; $dict = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $key = ""; for ($i = 0; $i < $param; $i++) { $key .= $dict[rand(0, 32)]; //Éú³ÉphpËæ»úÊý } return md5((string) getServerTime() . $key); }
function error($retcode, $str = "") { global $errorMsg; $json = array(); $json['serverTime'] = getServerTime(); $json['retcode'] = $retcode; $path = $_SERVER['PHP_SELF']; $json['errmsg'] = $errorMsg[$retcode] . " " . $str . " " . $path; $res = json_encode($json); $res = str_replace('\\/', '/', $res); echo $res; exit; }
/* bind parameters for markers */ $stmt->bind_param('ii', $uid, $missionID); $res = $stmt->execute(); $stmt->close(); $sql_get = "SELECT uid FROM MissionInfo WHERE uid = ? AND missionID = ?"; if ($stmt = $mysqli->prepare($sql_get)) { $stmt->bind_param('ii', $uid, $missionID); $res = $stmt->execute(); /* fetch value */ $result = $stmt->get_result(); $data = $result->fetch_array(); if ($data == null) { error(1003); } $stmt->close(); } else { error(1007); } } else { error(1007); } } //Change crystal updateCrystal($mysqli, $uid, $crystal); unset($_SESSION['missionID']); //Return response $json = array(); $json['serverTime'] = getServerTime(); $json['unlock'] = $unlock; $res = json_encode($json); echo $res;
public function status() { return view('layouts.partials.market-status-display')->with(['marketStatus' => getMarketStatus(), 'serverTime' => getServerTime()]); }