Skip to content

Commit 7276fc6

Browse files
committed
-- Added a sql file with a clean install for all the tables
-- Fixed wrong query for creating a table -- Wrong phrase for `/style_acronyms` -- added the scripts folder to release zip
1 parent ded13dd commit 7276fc6

File tree

6 files changed

+59
-5
lines changed

6 files changed

+59
-5
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
uses: montudor/action-zip@v1
5454

5555
- name: Zip
56-
run: zip -qq -r MapChallenge-v${{ steps.changelog_reader.outputs.version }}.zip plugins translations scripting/include
56+
run: zip -qq -r MapChallenge-v${{ steps.changelog_reader.outputs.version }}.zip plugins my-sql-scripts translations scripting/include
5757
working-directory: ${{ env.HOME_PATH }}
5858

5959
- name: Create Release

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.3.0]
8+
9+
### Added
10+
11+
- Added a `sql` file with a clean install for all the tables
12+
13+
### Fixed
14+
15+
- Fixed wrong query for creating a table
16+
- Wrong phrase for `/style_acronyms`
17+
18+
**Full Changelog**: https://github.com/shipyy/Map-Challenge/compare/v2.3.0...v2.2.0
19+
720
## [2.2.0]
821

922
### Changed

my-sql-scripts/clean_install.sql

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
CREATE TABLE `ck_challenges` (
2+
`id` int(12) NOT NULL AUTO_INCREMENT,
3+
`mapname` varchar(32) DEFAULT NULL,
4+
`StartDate` timestamp(6) NULL DEFAULT NULL,
5+
`EndDate` timestamp(6) NULL DEFAULT NULL,
6+
`style` int(12) NOT NULL DEFAULT '0',
7+
`points` int(12) NOT NULL DEFAULT '0',
8+
`active` int(12) NOT NULL DEFAULT '0',
9+
PRIMARY KEY (`id`)
10+
) DEFAULT CHARSET=utf8mb4
11+
12+
CREATE TABLE `ck_challenge_times` (
13+
`id` int(12) NOT NULL,
14+
`steamid` varchar(32) NOT NULL,
15+
`name` varchar(32) DEFAULT NULL,
16+
`mapname` varchar(32) NOT NULL,
17+
`runtime` decimal(12,6) NOT NULL DEFAULT '0.000000',
18+
`style` int(12) NOT NULL DEFAULT '0',
19+
`Run_Date` TIMESTAMP(6) NOT NULL DEFAULT (UTC_TIMESTAMP(6)),
20+
PRIMARY KEY (`id`,`steamid`,`mapname`,`runtime`)
21+
) DEFAULT CHARSET=utf8mb4
22+
23+
CREATE TABLE `ck_challenge_players` (
24+
`steamid` varchar(32) NOT NULL,
25+
`name` varchar(32) DEFAULT NULL,
26+
`style` int(12) NOT NULL DEFAULT '0',
27+
`points` int(12) NOT NULL DEFAULT '0',
28+
PRIMARY KEY (`steamid`,`style`)
29+
) DEFAULT CHARSET=utf8mb4
30+
31+
CREATE TABLE `ck_challenges_finished` (
32+
`id` int(12) NOT NULL,
33+
`winner` varchar(32) DEFAULT NULL,
34+
`nr_participants` int(12) NOT NULL DEFAULT '0',
35+
`mapname` varchar(32) DEFAULT NULL,
36+
`style` int(12) NOT NULL DEFAULT '0',
37+
`points` int(12) NOT NULL DEFAULT '0',
38+
`StartDate` timestamp(6) NULL DEFAULT NULL,
39+
`EndDate` timestamp(6) NULL DEFAULT NULL,
40+
PRIMARY KEY (`id`)
41+
) DEFAULT CHARSET=utf8mb4

scripting/Map_Challenge.sp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public Plugin myinfo =
66
name = "Map Challenges",
77
author = "https://github.com/shipyy",
88
description = "Allows Creation of challenges for surf maps",
9-
version = "2.2.0",
9+
version = "2.3.0",
1010
url = "https://github.com/shipyy/Map-Challenge"
1111
};
1212

scripting/mc-queries.sp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ char sql_ChallengeInfo[] = "SELECT id, mapname, StartDate, EndDate, points, styl
1111
/////
1212
//CK_CHALLENGE_TIMES
1313
/////
14-
char sql_CreateChallenges_Times[] = "CREATE TABLE IF NOT EXISTS ck_challenge_times (id INT(12) NOT NULL, steamid VARCHAR(32), name VARCHAR(32), mapname VARCHAR(32), runtime decimal(12, 6) NOT NULL DEFAULT '0.000000', style INT(12) NOT NULL DEFAULT '0', Run_Date TIMESTAMP(6) ON UPDATE UTC_TIMESTAMP(6) NOT NULL DEFAULT UTC_TIMESTAMP(6), PRIMARY KEY(id, steamid, mapname, runtime)) DEFAULT CHARSET=utf8mb4;";
14+
char sql_CreateChallenges_Times[] = "CREATE TABLE IF NOT EXISTS ck_challenge_times (id INT(12) NOT NULL, steamid VARCHAR(32), name VARCHAR(32), mapname VARCHAR(32), runtime decimal(12, 6) NOT NULL DEFAULT '0.000000', style INT(12) NOT NULL DEFAULT '0', Run_Date TIMESTAMP(6) NOT NULL DEFAULT (UTC_TIMESTAMP(6)), PRIMARY KEY(id, steamid, mapname, runtime)) DEFAULT CHARSET=utf8mb4;";
1515
char sql_SelectParticipants[] = "SELECT steamid, style, name, mapname, runtime FROM ck_challenge_times WHERE id = '%i' ORDER BY runtime ASC;"
1616
char sql_InsertRuntime[] = "INSERT INTO ck_challenge_times (id, steamid, name, mapname, runtime, style, Run_Date) VALUES ('%i', '%s', '%s', '%s', '%f', '%i', %s);"
17-
char sql_UpdateRuntime[] = "UPDATE ck_challenge_times SET runtime = '%f' WHERE steamid = '%s' AND mapname = '%s' AND runtime > -1.0 AND style = %i AND Run_Date BETWEEN '%s' AND '%s';"
17+
char sql_UpdateRuntime[] = "UPDATE ck_challenge_times SET runtime = '%f', Run_Date = UTC_TIMESTAMP(6) WHERE steamid = '%s' AND mapname = '%s' AND runtime > -1.0 AND style = %i AND Run_Date BETWEEN '%s' AND '%s';"
1818
char sql_CheckRuntimeExists[] = "SELECT runtime FROM ck_challenge_times WHERE steamid = '%s' AND mapname = '%s' AND runtime > -1.0 AND style = %i AND Run_Date BETWEEN '%s' AND '%s';"
1919
char sql_SelectCurrentChallengeLeaderboard[] = "SELECT name, runtime, style FROM ck_challenge_times WHERE id = '%i' ORDER BY runtime ASC LIMIT 50;"
2020

translations/mapchallenge.phrases.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"style_not_found"
6969
{
7070
"#format" "{1:s}"
71-
"en" "{1}{default} {red}Wrong style{default}, type {yellow}!acronyms{default} to see all the available {red}styles"
71+
"en" "{1}{default} {red}Wrong style{default}, type {yellow}!style_acronyms{default} to see all the available {red}styles"
7272
}
7373
"player_data_not_found"
7474
{

0 commit comments

Comments
 (0)