Commit graph

135 commits

Author SHA1 Message Date
Sakura Akeno Isayeki
2d839e3609
fix(db/postgres): Resolve SQL identifier casing issues
Improves SQL query execution by ensuring proper casing for identifiers across various database types, particularly for Postgres.

Enhances security and compatibility by using an identifier escaping method, preventing potential errors due to case sensitivity in SQL queries.

Addresses potential issues with existing queries for better reliability and consistency.
2025-04-29 00:47:19 +02:00
Sakura Akeno Isayeki
084411f847
refactor(db): Update SqlQueryBuilder references + Various refactors
Consolidates the creation of SQL query builders across multiple classes to ensure a unified approach for database operations.

Replaces manual type checks and specific query creators with a generic method for better maintainability and to prevent errors.

Improves code readability and reduces duplication, facilitating easier updates in the future.
2025-04-28 15:51:26 +02:00
Sakura Akeno Isayeki
8a75b1fdc5
refactor(db): Move DbQueryBuilders to separate namespace
Removes obsolete query builder interface and implementations.

Introduces a new namespace for query-related classes to enhance organization.

Updates various database managers to use the new query utilities, promoting code reuse and maintainability.

Enhances query functionality, ensuring better consistency across the codebase.
2025-04-28 14:06:02 +02:00
Janet Blackquill
f63b26ac76 Some i18nifiying 2022-10-21 16:12:04 -04:00
Killia0
154bee58f1 Typo fixes on comments/strings
My first PR contribution to TShock is spellcheck huh, frankly I don't know why but hey I could spare the time for this and caught some stuff.
2021-07-16 14:53:37 -04:00
Lucas Nicodemus
35198647a1
Presumptively fix MySQL 8 compat
`Groups` is a reserved name in MySQL 8 and this should fix compat issues
with it.
2020-05-18 18:40:51 -07:00
Lucas Nicodemus
70dd72443d Update copyright to 2019 again
Fixes #1658, most likely.
2019-03-29 17:16:37 -07:00
Ivan
ec78a070a7 Move Region related code into a separate subsystem 2018-04-29 18:33:07 +02:00
Lucas Nicodemus
569b350cea Update to Pryaxis, 2018 part 2
If there's one thing I learned in this exercise, it's that letting
people add random python scripts to the repo like gpltext.py that
promise to be easier than find and replace is a bad idea.
2018-01-01 02:20:56 -07:00
Edgar Luque
6589531868 Renamed TShockAPI.DB 'User' to 'UserAccount' 2017-12-08 01:38:15 +01:00
koneko-nyan
9d12461f8d Fix some spaces 2017-10-13 09:12:56 +02:00
koneko-nyan
30475be268 Add RegionRename 2017-10-02 17:42:22 +02:00
White
c4a3a9fb67 Updated Copyright for 2017 2017-03-13 12:17:16 +10:30
Lucas Nicodemus
678f6c7cf8
Update to Mintaka (thanks @enerdy) 2016-12-06 17:36:44 -07:00
Lucas Nicodemus
a0c4864567
Removed all obsolete methods from TShock 2016-10-23 06:09:17 -06:00
Adilson Carvalho
49b4effe74 Changed year to 2016 on all GPL headers 2016-10-16 17:06:02 -02:00
ProfessorXZ
37d9e93e6c Remove redundant region checks 2016-08-02 19:22:47 +02:00
White
b9046da5f4 Fixes #1239 2016-07-12 13:06:35 +09:30
White
8bf58dedf4 Fixes #1169 on MySQL 2016-04-02 11:05:23 +10:30
White
7e59d4c07d Fixes #1161 2016-02-19 18:10:34 +10:30
White
409327b54e Fixes #1161 2016-02-19 18:10:32 +10:30
Tyler Watson
3d37f51290 Fixed bug in AddRegion failing to completely add regions
An invalid SQL query selecting the region ID from the newly inserted
region prevented the AddRegion method from completely adding a region,
even though it was inserted into the database correctly, leading to a
`false` result even though the region add was successful.

This fixes /region define, and HouseRegions.
2016-02-06 20:37:57 +10:00
White
f0bf0ad820 Added an ID property to Regions. Commented and simplified some RegionManager code 2016-02-01 12:14:36 +10:30
Enerdy
aa419283a9 Add PlayerPermission hook, replace p.Group.HasPermission by p.HasPermission everywhere possible. 2016-01-11 14:37:02 +00:00
White
2e5eaae0b3 Checking whether a point is in a region no longer requires to region to be protected.
Renamed some methods to conform to C# conventions.
2015-09-06 18:49:57 +09:30
White
44ad0c68b8 Change TSPlayer.UserID to TSPlayer.User.ID, as well as refactoring some of UserManager.cs. Solves #916 2015-05-01 11:18:37 +09:30
White
dd7ad78d3f Adds a User object to TSPlayer 2015-04-29 17:24:20 +09:30
Zack Piispanen
406abce30c Add hooks for Region creation/deletion. Add hooks for Region Enter/Leave. Add member to TSPlayer displaying current region. Set private setters in AccountHooks. 2015-03-01 22:27:49 -05:00
Lucas Nicodemus
2f0d407dec RegionManager now says "you must be logged in" 2015-02-28 21:19:27 -07:00
Lucas Nicodemus
cbce64f1eb Remove more obsolete code; fix tab/space screwup in TSPlayer 2015-02-28 19:37:06 -07:00
Lucas Nicodemus
04145a4aca Re-add EnsureExists signature to fix compat with old plugins
Fixes #862
2015-02-22 08:43:12 -07:00
Zack
f9bf470b1d Tick version and update copyright 2015-01-28 15:29:13 -05:00
Zack Piispanen
d5527ade42 Add length to database primary keys.
Tweak some of the itembans code to be less inefficient.
Removed a chunk of code from the buff code that prevented users from being buffed with a buff that comes from an item.  This code seemed to cause max cpu usage when being disabled.  I don't think this code is useful, but I leave that to people who own servers.  IMO all buff code should be removed.
2014-09-15 09:05:28 -04:00
Zack Piispanen
1421c23df7 Remove crappy spaces in this file. 2014-09-03 02:48:57 -04:00
Zack Piispanen
1c7fe908b6 Delete a bunch of cruft that has gone unmaintained for too long.
Fix warps to have an auto-increment primary key column, and unique on name/WorldID
Same for regions.
Changed SqliteTableCreator to do proper unique syntax.
2014-09-03 02:41:53 -04:00
MarioE
eb8ffe5cfb Fix resizeRegion 2014-07-25 17:41:19 -04:00
Zack
fb451c6d49 Update license header for 2014 2014-07-10 21:48:33 -04:00
MarioE
3405acd15b Fix warps 2013-11-03 17:10:20 -05:00
MarioE
41121b8412 Re-do warps 2013-11-01 23:55:31 -04:00
MarioE
3e9aee3414 Begin Raptor compatibility 2013-10-30 22:34:09 -04:00
MarioE
61b8885ba0 Fix the last sendtilesquare exploit, I hope. 2013-10-23 18:08:21 -04:00
Zack Piispanen
b22457382e remove unused using statements 2013-09-17 02:24:02 -04:00
Lucas Nicodemus
ae7ab5f234 Updated copyright information to point to 2013. 2013-08-22 21:51:17 -06:00
Lucas Nicodemus
9470e20423 Line ending normalization to CRLF (Windows) 2013-08-22 21:17:32 -06:00
CoderCow
76aab4af78 Added quick format versions of the TSPlayer.Send<X>Message methods. 2013-06-27 15:04:00 +02:00
CoderCow
102c50a638 Fixed /region allowg adding an already existing group to the database multiple times. 2013-06-27 12:18:37 +02:00
CoderCow
f7edbe55d6 Fixed /region allow adding an already existing user id to the database multiple times. 2013-06-27 10:46:59 +02:00
Zack Piispanen
410f6cf872 Fixes some potential issues with concurrency, as well as cleaning up my z index check. 2012-12-14 23:40:38 -05:00
Zack Piispanen
88394ac561 Added back in region manager.
Added back in spawnmob commands, including the obsolete boss commands.
2012-09-15 16:20:16 -04:00
Zack Piispanen
b56a77b39d Removed the Region code. Left todo's for the places where we currently reference it though. 2012-05-30 20:12:27 -04:00