Skip to content

Commit 6a563cd

Browse files
BaradPexxIAMJacobChristiansenshipyytslashd
authored
Merge dev into master branch (#553)
* Test server should based on dev branch * Allow pr tests against the dev branch * Upload build packages for dev branch too * Remove artifact after one month * remove old code, wait 2 frames before setting velocity to 0 (#518) * Update fresh_install.sql (#519) Fixed errors. * Add missing ck_replays table (#520) * Fix version in error message (#521) * --wrong value on check (#522) * fix for #524 (#525) * --fix style records/forwards * --added oldtime var for styles --added time difference between old and new server style record to printed phrase --actually fixed issues(?) * --missing set values for new var * --missing indexation * --wrong format * Rename some files for clarity for updating tables * Add semicolons (#528) * Use LogStackTrace instead of LogError (#530) Usage of sizeof instead of hardcoded size * Add radar images to DownloadTable (#529) * add radar images to download table * remove colon from readme * add surf load screens to readme * Add EU test server to workflow * Add EU test server to README.md * Fix chat processor for our commands (#533) * Log query times (#531) * Hello World * Hello World * Print each query time into server console while startup * Log query times into logs/surftimer/<map>.log logs * Update globals.sp (#536) if database name is greater than 32 then will get following error [SM] Exception reported: More/Less then 1 rows? RowCount: 0, Table: ck_bonus, Column: runtime [SM] Blaming: SurfTimer.smx [SM] Call stack trace: [SM] [0] SetFailState [SM] [1] Line 241, surftimer/db/updater.sp::SQLCheckDataType * Increase name length (#534) * Increase name length from 32 to 128 * Increase name size per updater * Add missing tables * Update VARCHAR size in fresh_install.sql * Skip error check to prevent invalid error * 128 -> 64 * practice mode changes (#539) * practice mode changes * remove timer function * forgot this timer seperates stuff into a million different functions :) * add mapper names to ck_maptier (#538) * add mapper names to ck_maptier * use translation * readme: improve installation + requirements docs (#537) * readme: improve installation + requirements docs * readme: EndTouchFix note update * readme: EndTouchFix note update * Fix SQL Error while creating ck_maptiermappers table * or equal to prestige_rank (#541) * Fix LoadDefaultTitle (only load the first one) (#543) * Fix LoadDefaultTitle (only load the first one) * If the title is enforced, break the loop Co-authored-by: Ismael Semmar Galvez <isgalvez24@gmail.com> * Missing mapper name argument for Map Info (#547) * fix /mi * revert and use g_szMapperName * chore: small code cleanup (#545) * fixes non-ranked players being kicked from server when ck_prestige_rank = 0 (#544) * #506 (#548) * fresh_install update (#551) * increase cplimit from 37 to 100 (#552) --------- Co-authored-by: dPexxIAM <38400978+dPexxIAM@users.noreply.github.com> Co-authored-by: Jacob Christiansen <kin.jacob.chr@gmail.com> Co-authored-by: shipyy <70631212+shipyy@users.noreply.github.com> Co-authored-by: T <74899888+tslashd@users.noreply.github.com> Co-authored-by: Kyle <kyle@kxnrl.com> Co-authored-by: 8guawong <8guawong@gmail.com> Co-authored-by: Markus <mark@saiko.tech> Co-authored-by: Ismael Semmar Galvez <30930942+Ism1tha@users.noreply.github.com> Co-authored-by: Ismael Semmar Galvez <isgalvez24@gmail.com> Co-authored-by: Charles <63302440+Sarrus1@users.noreply.github.com>
1 parent a6c8d30 commit 6a563cd

File tree

4 files changed

+34
-39
lines changed

4 files changed

+34
-39
lines changed

addons/sourcemod/scripting/surftimer/globals.sp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
// Checkpoint Definitions
5252
// Maximum amount of checkpoints in a map
53-
#define CPLIMIT 37
53+
#define CPLIMIT 100
5454

5555
// Zone Definitions
5656
#define ZONE_MODEL "models/props/de_train/barrel.mdl"
@@ -1367,7 +1367,7 @@ ConVar g_hHostName = null;
13671367
Handle g_hDestinations;
13681368

13691369
// CPR command
1370-
float g_fClientCPs[MAXPLAYERS + 1][36];
1370+
float g_fClientCPs[MAXPLAYERS + 1][CPLIMIT];
13711371

13721372
float g_fTargetTime[MAXPLAYERS + 1];
13731373
char g_szTargetCPR[MAXPLAYERS + 1][MAX_NAME_LENGTH];

addons/sourcemod/scripting/surftimer/misc.sp

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public void SetBotQuota()
3636

3737
bool IsValidZonegroup(int zGrp)
3838
{
39-
if (-1 < zGrp < g_mapZoneGroupCount)
40-
return true;
41-
return false;
39+
return -1 < zGrp < g_mapZoneGroupCount;
4240
}
4341

4442
/**
@@ -4794,38 +4792,34 @@ public void LoadDefaultTitle(int client)
47944792
KvGetString(kv, "title", szBuffer, sizeof(szBuffer));
47954793
SetDefaultTitle(client, szBuffer);
47964794
g_iHasEnforcedTitle[client] = true;
4797-
break;
4798-
} else {
4799-
g_iHasEnforcedTitle[client] = false;
4800-
continue;
48014795
}
4802-
48034796
}
4804-
48054797
KvGetString(kv, "flag", szBuffer, sizeof(szBuffer), "none");
4806-
// Has to be a flag since no steamid was found, otherwise invalid entry
4807-
if (StrEqual(szBuffer, "none"))
4808-
continue;
4809-
4810-
// Check if client has access to this flag
4811-
int bit = ReadFlagString(szBuffer);
4812-
if (!CheckCommandAccess(client, "", bit))
4813-
continue;
4814-
4815-
// "type"
4816-
g_iEnforceTitleType[client] = 2;
4817-
KvGetString(kv, "type", szBuffer, sizeof(szBuffer), "both");
4818-
if (StrEqual(szBuffer, "scoreboard"))
4819-
g_iEnforceTitleType[client] = 1;
4820-
else if (StrEqual(szBuffer, "chat"))
4821-
g_iEnforceTitleType[client] = 0;
4822-
else
4823-
g_iEnforceTitleType[client] = 2;
4824-
4825-
KvGetString(kv, "title", szBuffer, sizeof(szBuffer));
4826-
SetDefaultTitle(client, szBuffer);
4827-
break;
4828-
4798+
// Check if this keyvalue has a flag
4799+
if (!StrEqual(szBuffer, "none"))
4800+
{
4801+
// Does the user has permissions over the flag?
4802+
int bit = ReadFlagString(szBuffer);
4803+
if (CheckCommandAccess(client, "", bit))
4804+
{
4805+
KvGetString(kv, "title", szBuffer, sizeof(szBuffer));
4806+
SetDefaultTitle(client, szBuffer);
4807+
g_iHasEnforcedTitle[client] = true;
4808+
}
4809+
}
4810+
// If user has enforced title, check and set the type
4811+
if (g_iHasEnforcedTitle[client] == true)
4812+
{
4813+
KvGetString(kv, "type", szBuffer, sizeof(szBuffer), "both");
4814+
if (StrEqual(szBuffer, "scoreboard"))
4815+
g_iEnforceTitleType[client] = 1;
4816+
else if (StrEqual(szBuffer, "chat"))
4817+
g_iEnforceTitleType[client] = 0;
4818+
else
4819+
g_iEnforceTitleType[client] = 2;
4820+
// If the title is enforced, break the loop
4821+
break;
4822+
}
48294823
} while (KvGotoNextKey(kv));
48304824
}
48314825
delete kv;

addons/sourcemod/scripting/surftimer/sql.sp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ public void sql_selectRankedPlayersRankCallback(Handle owner, Handle hndl, const
15941594
{
15951595
if (style == 0)
15961596
{
1597-
if (g_PlayerRank[client][0] > GetConVarInt(g_hPrestigeRank) && !g_bPrestigeCheck[client])
1597+
if (g_PlayerRank[client][0] >= GetConVarInt(g_hPrestigeRank) && !g_bPrestigeCheck[client])
15981598
KickClient(client, "You must be at least rank %i to join this server", GetConVarInt(g_hPrestigeRank));
15991599
}
16001600

@@ -1603,7 +1603,7 @@ public void sql_selectRankedPlayersRankCallback(Handle owner, Handle hndl, const
16031603
}
16041604
else
16051605
{
1606-
if (g_PlayerRank[client][0] < GetConVarInt(g_hPrestigeRank) || g_bPrestigeCheck[client])
1606+
if (g_PlayerRank[client][0] <= GetConVarInt(g_hPrestigeRank) || g_bPrestigeCheck[client])
16071607
g_bPrestigeCheck[client] = true;
16081608
else if (!g_bPrestigeAvoid[client])
16091609
KickClient(client, "You must be at least rank %i to join this server", GetConVarInt(g_hPrestigeRank));
@@ -6545,7 +6545,7 @@ public int FinishedMapsMenuHandler(Handle menu, MenuAction action, int client, i
65456545
public void db_selectTotalBonusCount()
65466546
{
65476547
char szQuery[512];
6548-
Format(szQuery, 512, "SELECT COUNT(DISTINCT a.mapname,zonegroup) as count FROM ck_zones a RIGHT JOIN ck_maptier b ON a.mapname = b.mapname WHERE a.zonegroup > 0");
6548+
Format(szQuery, sizeof(szQuery), "SELECT COUNT(DISTINCT `a`.`mapname`, `a`.`zonegroup`) AS `count` FROM `ck_zones` `a` INNER JOIN `ck_maptier` `b` ON `b`.`mapname` = `a`.`mapname` WHERE `a`.`zonetype` = 1 AND `a`.`zonegroup` > 0");
65496549
SQL_TQuery(g_hDb, sql_selectTotalBonusCountCallback, szQuery, GetGameTime(), DBPrio_Low);
65506550
}
65516551

@@ -6574,7 +6574,7 @@ public void sql_selectTotalBonusCountCallback(Handle owner, Handle hndl, const c
65746574
public void db_selectTotalStageCount()
65756575
{
65766576
char szQuery[512];
6577-
Format(szQuery, 512, "SELECT SUM(c.stages) FROM (SELECT a.mapname, MAX(zonetypeid)+2 as stages FROM `ck_zones` a RIGHT JOIN `ck_maptier` b ON a.mapname = b.mapname WHERE zonetype = 3 GROUP BY a.mapname)c");
6577+
Format(szQuery, sizeof(szQuery), "SELECT COUNT(DISTINCT `a`.`mapname`) + COUNT(1) AS `count` FROM `ck_zones` `a` INNER JOIN `ck_maptier` `b` ON `b`.`mapname` = `a`.`mapname` WHERE `a`.`zonetype` = 3 AND `a`.`zonegroup` = 0;");
65786578
SQL_TQuery(g_hDb, sql_selectTotalStageCountCallback, szQuery, GetGameTime(), DBPrio_Low);
65796579
}
65806580

@@ -9277,7 +9277,7 @@ public void db_selectMapImprovementCallback(Handle owner, Handle hndl, const cha
92779277
if (type == 0)
92789278
{
92799279
Menu mi = CreateMenu(MapImprovementMenuHandler);
9280-
SetMenuTitle(mi, "[Point Reward: %s]\n------------------------------\nTier: %i\n \nMapper: %s\n \n[Completion Points]\n \nMap Finish Points: %i\n \n[Map Improvement Groups]\n \n[Group 1] Ranks 11-%i ~ %i Pts\n[Group 2] Ranks %i-%i ~ %i Pts\n[Group 3] Ranks %i-%i ~ %i Pts\n[Group 4] Ranks %i-%i ~ %i Pts\n[Group 5] Ranks %i-%i ~ %i Pts\n \nSR Pts: %i\n \nTotal Completions: %i\n \n",szMapName, tier, mapcompletion, g1top, RoundFloat(g1points), g2bot, g2top, RoundFloat(g2points), g3bot, g3top, RoundFloat(g3points), g4bot, g4top, RoundFloat(g4points), g5bot, g5top, RoundFloat(g5points), iwrpoints, totalplayers);
9280+
SetMenuTitle(mi, "[Point Reward: %s]\n------------------------------\nTier: %i\n \nMapper: %s\n \n[Completion Points]\n \nMap Finish Points: %i\n \n[Map Improvement Groups]\n \n[Group 1] Ranks 11-%i ~ %i Pts\n[Group 2] Ranks %i-%i ~ %i Pts\n[Group 3] Ranks %i-%i ~ %i Pts\n[Group 4] Ranks %i-%i ~ %i Pts\n[Group 5] Ranks %i-%i ~ %i Pts\n \nSR Pts: %i\n \nTotal Completions: %i\n \n",szMapName, tier, g_szMapperName, mapcompletion, g1top, RoundFloat(g1points), g2bot, g2top, RoundFloat(g2points), g3bot, g3top, RoundFloat(g3points), g4bot, g4top, RoundFloat(g4points), g5bot, g5top, RoundFloat(g5points), iwrpoints, totalplayers);
92819281
// AddMenuItem(mi, "", "", ITEMDRAW_SPACER);
92829282
AddMenuItem(mi, szMapName, "Top 10 Points");
92839283
SetMenuOptionFlags(mi, MENUFLAG_BUTTON_EXIT);

scripts/mysql-files/fresh_install.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ CREATE TABLE IF NOT EXISTS ck_maptier (
5757
`announcerecord` INT(11) NOT NULL DEFAULT '0',
5858
`gravityfix` INT(11) NOT NULL DEFAULT '1',
5959
`ranked` INT(11) NOT NULL DEFAULT '1',
60+
`mapper` VARCHAR(255) DEFAULT NULL,
6061
PRIMARY KEY(`mapname`))
6162
DEFAULT CHARSET=utf8mb4;
6263

0 commit comments

Comments
 (0)