-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Infinite antag tags #3025
Infinite antag tags #3025
Conversation
This is just the first chunk, of fixing around the be_special flag stuff It will probably break everything as-is
😻 |
will this mean multiple game modes at one? |
@orelbon No; this is mostly for coders--players won't notice a single difference. Basically for gamemodes/antag types, there's flags to track what a player has selected. Unfortunately, there's so many game modes now, we have run out of bitflags...meaning we have to start cannibalizing old flags or implement a new system( lik this one) to get around that. This does just that, meaning we can now have 5,000,000,000 game modes, if we want, without a problem. |
This is the sort of thing where having a functional DB is important when testing, but I don't, and I haven't found a good resource on how to do so yet. Any pointers? |
Mmm, -tg-station uses BYOND save files, which have native handling for BYOND lists, while SQL does not. Does SQL support any form of list fields? And how would I check whether entries in the SQL DB are of one format or another, since I'll need to switch the existing entries' format from one to another? |
@Crazylemon64 SQL doesn't support BYOND's idea of lists natively, no. The current standard is to use All of the SQL handling is done in this file, via MySQL queries that the server runs upon saving and loading characters. I would recommend trying to follow -tg-'s wiki article on setting up a SQL database, as it is quite helpful, except, instead of using As for checking entries in the SQL Database, you would require a basic knowledge of how SQL Queries work, plus, if you are refering to the server database, only the headmins and maintainers have access to it. Your best bet would be modifying the schema file, and getting rid of the Actually, and this line should instead look like |
@tigercat2000 I'll need to insert the new field at the end of the DB, and leave the be_special field fallow, right? Otherwise I'd expect it to mess up the |
Ripped out the preferences_savefile.dm because it's obsolete and we don't use it
Although travis does this like 18x faster than my machine can, I probably shouldn't bloat my commit count with repeated error-filled commits |
@Crazylemon64 Ah, right, forgot to respond to this- There are, also, ways to insert a column in a table mid-line, but it's annoyingly complex queries. |
But I will need to update the load_character proc too, right? Or am I overlooking something... |
Huh. You actually need to remove the be_special completely from |
I think it's so people can have characters with different antag preferences - this one is a cultist, another works for the syndicate, something like that Or does this not work at all and whoever originally wrote that gibbed themself with a faulty line of code? |
@Crazylemon64 Except the preference is just overriden by whichever loads last, the character or the player prefs; And everything else in the game prefs panel is not per-character |
Alright, ripping that bit out, then. I'll see about getting something potentially workable shortly. |
Also it compiles now as for not turning the DB into mush... wait on that "feature"
@tigercat2000 I'm having trouble starting up Apache. I lack control over the ports in my network, will that interfere with setting up XAMPP for the SQL database? EDIT: I think I got something working, I had XAMPP installed in a system directory, where it should have been in a user directory |
Database set up, now to see if things load swimmingly... They do! Now to see if I can't set up some conversion procs from our old tag system and finish up this PR... |
@@ -57,7 +56,7 @@ | |||
UI_style='[UI_style]', | |||
UI_style_color='[UI_style_color]', | |||
UI_style_alpha='[UI_style_alpha]', | |||
be_special='[be_special]', | |||
be_role='[sql_sanitize_text(list2params(be_special))]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this sql_sanitize guard is what's torpedoing the entry adding, and causing everything to be concatenated to a single entry. I'll create a proc to sql_sanitize the entries of a list, and use it here, so that we don't leave any opening for a "Bobby tables" attack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AAaahh yes, sql_sanitize strips semicolons, because semicolons are bad in SQL queries
However, as you can't have a custom be_role outside of pressing buttons, you can just remove this entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buttons work as url links through byond://, right? Couldn't someone use wireshark to see what they're sending, tweak the format, and ask for the role "; DROP TABLE players"? Anyways, I've added a proc to sql sanitize each entry of a list, so we shouldn't be at risk of this happening anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why you should always be careful with how Topic() code is written, but I don't think it would be a problem in this specific case.
There's a clause I've added in preferences.dm to watch for anyone trying to pass in a nasty href, but I can't pull it up because I adjusted the indentation in that file; is that enough to shield us from a potential exploit? |
Alright, this all works now, now to finally do a conversion proc from old format to new |
There's probably a cooler and more automated, at-once solution to this though
Alright, I think I'm pretty much done, just need to wait on @ZomgPonies's #2896, though. What will the strategy be for updating the DB for this new format? |
Yours comes first, as we're pretty much deadlocked for being able to add anything remotely related to antag flags right now, and that PR hasn't been touched in a long time. |
I actually had no problem with the meme, @Crazylemon64; I just wanted it to be accurate =p |
Well, now that THAT matter's taken care of, I think I want to get one last thing scored away, so that people don't rejoin one day and have to reset their role preferences - and of course I need to fully verify that nothing runtimes from switching the antag tags from numbers to strings. However, for now I have to leave, so once I come back and polish that off, I'll post one last update. |
Well, looking at the administration-side, I probably want to update the job-ban interface so that the new tags show up, lest a jerk show up and the admins be forced to resort to rooting through proc calls to deliver justice - hold on |
Ah, you know what, updating the ui can wait - what matters is grouping the new antagonistic roles under the antag list so that a syndicate ban will conclusively put a hold to the shenanigans. Once that's through, merge away. (After proper review of course) |
Screw it, I'm not finding a list that corresponds. One last commit and I'm done. |
Also, you'll want to make sure that all the news ones show up in the player preferences. And that no scrolling/scroll bars appear from the increased size of the new prefs. |
Fortunately, the game preferences automatically handles additional game roles, so we're golden there, and no, it doesn't require scrolling. |
Also - Increases the number of memes in the codebase
Alright look through and check if I made yog-sothoth come out of the depths of our database and eat all our precious characters or not, though it seems like it holds fast. Merge Ready. |
Memes. |
Looks alright to me, but this shouldn't be merged until we can get a patch immediately afterwards, since this requires SQL changes. |
@@ -29,7 +29,7 @@ | |||
// also make sure that there's at least one borer and one host | |||
recommended_enemies = max(src.num_players() / 20 * 2, 2) | |||
|
|||
var/list/datum/mind/possible_borers = get_players_for_role(BE_ALIEN) | |||
var/list/datum/mind/possible_borers = get_players_for_role(ROLE_ALIEN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROLE_BORER
@Crazylemon64 Give me clear instructions for the prod DB. Do I simply add your new column, or do I also remove be_special? |
@ZomgPonies You can leave be_special in place for now, until most players get their format transferred over to the list system; Once you've had that in place for "long enough", you can get rid of both the format update proc in preferences_sql.dm, and the be_special column, without any problems. |
@Crazylemon64 bit late, already did a more destructive method of |
Mmm, alright. You can rip out the conversion proc, then. |
This will change how we store our antag tags from a single integer to a list, allowing us to have as many antagonist/role types as we wish.
This is a port of @RemieRichards's HoG infinite antag refactor tgstation/tgstation#11803. Due to differences in our codebases, this will be a bit more complicated than a "ctrl-c +ctrl-v", but I figure it'll be handy, let us keep space ninja viable, and give us more than 16 types of special roles.
Before merging:
BACK UP THE DATABASE IN CASE SOMETHING GOES WRONG
New role tags: