Skip to content

Commit

Permalink
Merge dev into master branch (#553)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
11 people committed Feb 10, 2023
1 parent a6c8d30 commit 6a563cd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 39 deletions.
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/surftimer/globals.sp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// Checkpoint Definitions
// Maximum amount of checkpoints in a map
#define CPLIMIT 37
#define CPLIMIT 100

// Zone Definitions
#define ZONE_MODEL "models/props/de_train/barrel.mdl"
Expand Down Expand Up @@ -1367,7 +1367,7 @@ ConVar g_hHostName = null;
Handle g_hDestinations;

// CPR command
float g_fClientCPs[MAXPLAYERS + 1][36];
float g_fClientCPs[MAXPLAYERS + 1][CPLIMIT];

float g_fTargetTime[MAXPLAYERS + 1];
char g_szTargetCPR[MAXPLAYERS + 1][MAX_NAME_LENGTH];
Expand Down
58 changes: 26 additions & 32 deletions addons/sourcemod/scripting/surftimer/misc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public void SetBotQuota()

bool IsValidZonegroup(int zGrp)
{
if (-1 < zGrp < g_mapZoneGroupCount)
return true;
return false;
return -1 < zGrp < g_mapZoneGroupCount;
}

/**
Expand Down Expand Up @@ -4794,38 +4792,34 @@ public void LoadDefaultTitle(int client)
KvGetString(kv, "title", szBuffer, sizeof(szBuffer));
SetDefaultTitle(client, szBuffer);
g_iHasEnforcedTitle[client] = true;
break;
} else {
g_iHasEnforcedTitle[client] = false;
continue;
}

}

KvGetString(kv, "flag", szBuffer, sizeof(szBuffer), "none");
// Has to be a flag since no steamid was found, otherwise invalid entry
if (StrEqual(szBuffer, "none"))
continue;

// Check if client has access to this flag
int bit = ReadFlagString(szBuffer);
if (!CheckCommandAccess(client, "", bit))
continue;

// "type"
g_iEnforceTitleType[client] = 2;
KvGetString(kv, "type", szBuffer, sizeof(szBuffer), "both");
if (StrEqual(szBuffer, "scoreboard"))
g_iEnforceTitleType[client] = 1;
else if (StrEqual(szBuffer, "chat"))
g_iEnforceTitleType[client] = 0;
else
g_iEnforceTitleType[client] = 2;

KvGetString(kv, "title", szBuffer, sizeof(szBuffer));
SetDefaultTitle(client, szBuffer);
break;

// Check if this keyvalue has a flag
if (!StrEqual(szBuffer, "none"))
{
// Does the user has permissions over the flag?
int bit = ReadFlagString(szBuffer);
if (CheckCommandAccess(client, "", bit))
{
KvGetString(kv, "title", szBuffer, sizeof(szBuffer));
SetDefaultTitle(client, szBuffer);
g_iHasEnforcedTitle[client] = true;
}
}
// If user has enforced title, check and set the type
if (g_iHasEnforcedTitle[client] == true)
{
KvGetString(kv, "type", szBuffer, sizeof(szBuffer), "both");
if (StrEqual(szBuffer, "scoreboard"))
g_iEnforceTitleType[client] = 1;
else if (StrEqual(szBuffer, "chat"))
g_iEnforceTitleType[client] = 0;
else
g_iEnforceTitleType[client] = 2;
// If the title is enforced, break the loop
break;
}
} while (KvGotoNextKey(kv));
}
delete kv;
Expand Down
10 changes: 5 additions & 5 deletions addons/sourcemod/scripting/surftimer/sql.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ public void sql_selectRankedPlayersRankCallback(Handle owner, Handle hndl, const
{
if (style == 0)
{
if (g_PlayerRank[client][0] > GetConVarInt(g_hPrestigeRank) && !g_bPrestigeCheck[client])
if (g_PlayerRank[client][0] >= GetConVarInt(g_hPrestigeRank) && !g_bPrestigeCheck[client])
KickClient(client, "You must be at least rank %i to join this server", GetConVarInt(g_hPrestigeRank));
}

Expand All @@ -1603,7 +1603,7 @@ public void sql_selectRankedPlayersRankCallback(Handle owner, Handle hndl, const
}
else
{
if (g_PlayerRank[client][0] < GetConVarInt(g_hPrestigeRank) || g_bPrestigeCheck[client])
if (g_PlayerRank[client][0] <= GetConVarInt(g_hPrestigeRank) || g_bPrestigeCheck[client])
g_bPrestigeCheck[client] = true;
else if (!g_bPrestigeAvoid[client])
KickClient(client, "You must be at least rank %i to join this server", GetConVarInt(g_hPrestigeRank));
Expand Down Expand Up @@ -6545,7 +6545,7 @@ public int FinishedMapsMenuHandler(Handle menu, MenuAction action, int client, i
public void db_selectTotalBonusCount()
{
char szQuery[512];
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");
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");
SQL_TQuery(g_hDb, sql_selectTotalBonusCountCallback, szQuery, GetGameTime(), DBPrio_Low);
}

Expand Down Expand Up @@ -6574,7 +6574,7 @@ public void sql_selectTotalBonusCountCallback(Handle owner, Handle hndl, const c
public void db_selectTotalStageCount()
{
char szQuery[512];
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");
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;");
SQL_TQuery(g_hDb, sql_selectTotalStageCountCallback, szQuery, GetGameTime(), DBPrio_Low);
}

Expand Down Expand Up @@ -9277,7 +9277,7 @@ public void db_selectMapImprovementCallback(Handle owner, Handle hndl, const cha
if (type == 0)
{
Menu mi = CreateMenu(MapImprovementMenuHandler);
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);
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);
// AddMenuItem(mi, "", "", ITEMDRAW_SPACER);
AddMenuItem(mi, szMapName, "Top 10 Points");
SetMenuOptionFlags(mi, MENUFLAG_BUTTON_EXIT);
Expand Down
1 change: 1 addition & 0 deletions scripts/mysql-files/fresh_install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ CREATE TABLE IF NOT EXISTS ck_maptier (
`announcerecord` INT(11) NOT NULL DEFAULT '0',
`gravityfix` INT(11) NOT NULL DEFAULT '1',
`ranked` INT(11) NOT NULL DEFAULT '1',
`mapper` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY(`mapname`))
DEFAULT CHARSET=utf8mb4;

Expand Down

0 comments on commit 6a563cd

Please sign in to comment.