Add: HintBubble

Fix: chocoball color
Fix: history, ranking DB
This commit is contained in:
2019-05-11 16:14:17 +09:00
parent a02e75e06a
commit edb8b43020
10 changed files with 145 additions and 86 deletions
+1
View File
@@ -69,6 +69,7 @@
<script src="../../game/mouse/one_to_fifty/stop_watch.js"></script>
<script src="../../game/mouse/one_to_fifty/chocoball.js"></script>
<script src="../../game/mouse/one_to_fifty/god.js"></script>
<script src="../../game/mouse/one_to_fifty/hint_bubble.js"></script>
<script src="../../game/mouse/one_to_fifty/game.js"></script>
<script src="../../game/mouse/one_to_fifty/main.js"></script>
+21 -18
View File
@@ -24,16 +24,17 @@ function get_ranking_hour($maestroID, $appID) {
global $db_conn;
$query = "
SELECT BR.PlayerID As PlayerID, P.Name AS Name, MAX(BR.BestRecord) AS BestRecord
FROM best_record BR, player P
WHERE BR.PlayerID = P.PlayerID AND DATE(BR.RecordDateTime) = DATE(NOW()) AND HOUR(BR.RecordDateTime) = HOUR(NOW()) AND BR.MaestroID = ? AND BR.AppID = ?
GROUP BY BR.PlayerID
ORDER BY max(BR.BestRecord)
";
if(is_highest_record_prefer_app($appID))
$query = $query." DESC;";
else
$query = $query." ASC;";
if(is_highest_record_prefer_app($appID)) {
$query = "SELECT BR.PlayerID As PlayerID, P.Name AS Name, MAX(BR.BestRecord) AS BestRecord".$query;
$query = $query."ORDER BY max(BR.BestRecord) DESC;";
} else {
$query = "SELECT BR.PlayerID As PlayerID, P.Name AS Name, MIN(BR.BestRecord) AS BestRecord".$query;
$query = $query."ORDER BY min(BR.BestRecord) ASC;";
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('ii', $maestroID, $appID);
$stmt->execute();
@@ -53,16 +54,17 @@ function get_ranking_day($maestroID, $appID) {
global $db_conn;
$query = "
SELECT BR.PlayerID As PlayerID, P.Name AS Name, MAX(BR.BestRecord) AS BestRecord
FROM best_record BR, player P
WHERE BR.PlayerID = P.PlayerID AND DATE(BR.RecordDateTime) = DATE(NOW()) AND BR.MaestroID = ? AND BR.AppID = ?
GROUP BY BR.PlayerID
ORDER BY max(BR.BestRecord)
";
if(is_highest_record_prefer_app($appID))
$query = $query." DESC;";
else
$query = $query." ASC;";
if(is_highest_record_prefer_app($appID)) {
$query = "SELECT BR.PlayerID As PlayerID, P.Name AS Name, MAX(BR.BestRecord) AS BestRecord".$query;
$query = $query."ORDER BY max(BR.BestRecord) DESC;";
} else {
$query = "SELECT BR.PlayerID As PlayerID, P.Name AS Name, MIN(BR.BestRecord) AS BestRecord".$query;
$query = $query."ORDER BY min(BR.BestRecord) ASC;";
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('ii', $maestroID, $appID);
$stmt->execute();
@@ -82,16 +84,17 @@ function get_ranking_month($maestroID, $appID) {
global $db_conn;
$query = "
SELECT BR.PlayerID As PlayerID, P.Name AS Name, MAX(BR.BestRecord) AS BestRecord
FROM best_record BR, player P
WHERE BR.PlayerID = P.PlayerID AND MONTH(BR.RecordDateTime) = MONTH(NOW()) AND BR.MaestroID = ? AND BR.AppID = ?
GROUP BY BR.PlayerID
ORDER BY max(BR.BestRecord)
";
if(is_highest_record_prefer_app($appID))
$query = $query." DESC;";
else
$query = $query." ASC;";
if(is_highest_record_prefer_app($appID)) {
$query = "SELECT BR.PlayerID As PlayerID, P.Name AS Name, MAX(BR.BestRecord) AS BestRecord".$query;
$query = $query."ORDER BY max(BR.BestRecord) DESC;";
} else {
$query = "SELECT BR.PlayerID As PlayerID, P.Name AS Name, MIN(BR.BestRecord) AS BestRecord".$query;
$query = $query."ORDER BY min(BR.BestRecord) ASC;";
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('ii', $maestroID, $appID);
$stmt->execute();
+7 -1
View File
@@ -7,6 +7,7 @@ $player_id = $_POST["PlayerID"];
$date = $_POST["Date"];
include "./../setup/connect_db.php";
include "./../lib/util_app.php";
$replyJSON = get_history_record($maestro_id, $app_id, $player_id, $date);
@@ -24,7 +25,6 @@ function get_history_record($maestro_id, $app_id, $player_id, $date) {
global $db_conn;
$query = "
SELECT DATE(BR.RecordDateTime) AS Date, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName
FROM best_record BR
INNER JOIN app AS AA
ON BR.MaestroID = ? AND BR.PlayerID = ? AND DATE(BR.RecordDateTime) <= ? AND BR.AppID = ? AND BR.AppID = AA.AppID
@@ -32,6 +32,12 @@ function get_history_record($maestro_id, $app_id, $player_id, $date) {
ORDER BY BR.RecordDateTime DESC
LIMIT 7
";
if(is_highest_record_prefer_app($app_id)) {
$query = "SELECT DATE(BR.RecordDateTime) AS Date, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName".$query;
}
else {
$query = "SELECT DATE(BR.RecordDateTime) AS Date, MIN(BR.BestRecord) AS HighScore, AA.AppName AS AppName".$query;
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('iisi', $maestro_id, $player_id, $date, $app_id);
$stmt->execute();
+7 -6
View File
@@ -25,16 +25,17 @@ function get_ranking_record_day($maestro_id, $date, $app_id) {
global $db_conn;
$query = "
SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore
FROM best_record BR, player U
WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND DATE(BR.RecordDateTime) = ? AND AppID = ?
GROUP BY BR.playerID
ORDER BY max(BR.BestRecord)
";
if(is_highest_record_prefer_app($app_id))
$query = $query." DESC;";
else
$query = $query." ASC;";
if(is_highest_record_prefer_app($app_id)) {
$query = "SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore".$query;
$query = $query."ORDER BY MAX(BR.BestRecord) DESC;";
} else {
$query = "SELECT BR.playerID As PlayerID, U.Name AS Name, MIN(BR.BestRecord) AS HighScore".$query;
$query = $query."ORDER BY MIN(BR.BestRecord) ASC;";
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('isi', $maestro_id, $date, $app_id);
$stmt->execute();
@@ -20,20 +20,22 @@ if($replyJSON.length === 0) {
echo json_encode($replyJSON, JSON_UNESCAPED_UNICODE);
$db_conn->close();
function get_ranking_record_hour($maestro_id, $date, $time, $app_id) {
global $db_conn;
$query = "
SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore
FROM best_record BR, player U
WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND DATE(BR.RecordDateTime) = ? AND HOUR(BR.RecordDateTime) = HOUR(?) AND AppID = ?
GROUP BY BR.playerID
ORDER BY max(BR.BestRecord)
";
if(is_highest_record_prefer_app($app_id))
$query = $query." DESC;";
else
$query = $query." ASC;";
if(is_highest_record_prefer_app($app_id)) {
$query = "SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore".$query;
$query = $query."ORDER BY MAX(BR.BestRecord) DESC;";
} else {
$query = "SELECT BR.playerID As PlayerID, U.Name AS Name, MIN(BR.BestRecord) AS HighScore".$query;
$query = $query."ORDER BY MIN(BR.BestRecord) ASC;";
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('issi', $maestro_id, $date, $time, $app_id);
$stmt->execute();
@@ -25,16 +25,17 @@ function get_ranking_record_month($maestro_id, $date, $time, $app_id) {
global $db_conn;
$query = "
SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore
FROM best_record BR, player U
WHERE BR.MaestroID = ? AND BR.playerID = U.playerID AND MONTH(BR.RecordDateTime) = MONTH(?) AND AppID = ?
GROUP BY BR.playerID
ORDER BY max(BR.BestRecord)
";
if(is_highest_record_prefer_app($app_id))
$query = $query." DESC;";
else
$query = $query." ASC;";
if(is_highest_record_prefer_app($app_id)) {
$query = "SELECT BR.playerID As PlayerID, U.Name AS Name, MAX(BR.BestRecord) AS HighScore".$query;
$query = $query."ORDER BY MAX(BR.BestRecord) DESC;";
} else {
$query = "SELECT BR.playerID As PlayerID, U.Name AS Name, MIN(BR.BestRecord) AS HighScore".$query;
$query = $query."ORDER BY MIN(BR.BestRecord) ASC;";
}
$stmt = $db_conn->prepare($query);
$stmt->bind_param('isi', $maestro_id, $date, $app_id);
$stmt->execute();