From 40dfa7d5c0dc8e4cb2c95e403b6b4b2c4bf70644 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sat, 4 Feb 2017 16:05:45 +0100 Subject: Original UTStats beta 4.2.8 --- html/import/import_bt.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 html/import/import_bt.php (limited to 'html/import/import_bt.php') diff --git a/html/import/import_bt.php b/html/import/import_bt.php new file mode 100755 index 0000000..fe6a480 --- /dev/null +++ b/html/import/import_bt.php @@ -0,0 +1,46 @@ + $cap_speed) { + $cap_speed = $r_capbt['col3']; + $col0 = $r_capbt['col0']; // time + $col1 = $r_capbt['col1']; // cap + $col2 = $r_capbt['col2']; // playerid + $col3 = $r_capbt['col3']; // speed in 2000 - seconds (old system) or 600000 - hundreds of seconds (new system) + $col4 = $r_capbt['col4']; // date in seconds since epoch + } + $flag_capture++; + } + + if ($cap_speed != 0) { + # use col2 to store the rank, col3 to store the captime in seconds and col4 to store the date of the record + $col2 = small_count("SELECT DISTINCT col2 FROM uts_temp_$uid WHERE col1 = 'cap' AND col3 > $col3") + 1; + if ($col1 == "btcap") { + $col3 = ceil(600000 - $col3) / 100; + } + else if ($col1 == "cap") { + $col3 = ceil((2000 - $col3-1)*100/1.1) / 100; + $col1 = "btcap"; + } + $col3 = sprintf("%01.2f", $col3); + $sql_eventsbt = "INSERT INTO uts_events + (matchid, playerid, col0, col1, col2, col3, col4) VALUES + ($matchid, $playerid, '$col0', '$col1', '$col2', '$col3', '$col4')"; + mysql_query($sql_eventsbt) or die (mysql_error()); + } + + if ($flag_capture > 0) { + $sql_playerflags = " UPDATE uts_player + SET flag_capture = $flag_capture + WHERE id = $playerecordid"; + mysql_query($sql_playerflags) or die(mysql_error()); + } +?> -- cgit