• Flow - Collection of gamemodes and accessories
    536 replies, posted
Things are still flowing well (pun not intended) over at qT's. I just had a quick question, though. I'm not terribly familiar with using the sql.Query command in GLua. I'm trying to use it like normal SQL queries, but I'm getting errors and I don't quite know why. I'm attempting to pull information for a single location in the database, such as the number of plays from the game_map table. What I'm currently doing is this: [lua]sql.Query( "SELECT nPlays FROM game_map WHERE szMap = '" .. game.GetMap() .. "'" )[/lua] Now whenever I query it, I get no errors with that, but when I go to print it, it seems to be a boolean value instead of a string. How would I go about querying info from the table and retrieving it as int/string instead of boolean? I'm asking here because I don't know if it has something to do with the command and how I'm using it or how the tables/GM is set up. If others feel like this should be asked elsewhere, just say so and I will request the question be moved; I just felt it was relevant enough to the information at hand.
Im getting this Issue showing up in console. [B]Couldn't load data. Retrying (Try 81) Couldn't load data. Retrying (Try 82) Couldn't load data. Retrying (Try 83) Couldn't load data. Retrying (Try 84) Couldn't load data. Retrying (Try 85) Couldn't load data. Retrying (Try 86) Couldn't load data. Retrying (Try 87) Couldn't load data. Retrying (Try 88) Couldn't load data. Retrying (Try 89) Couldn't load data. Retrying (Try 90) Couldn't load data. Retrying (Try 91) Couldn't load data. Retrying (Try 92) Couldn't load data. Retrying (Try 93) Couldn't load data. Retrying (Try 94) Couldn't load data. Retrying (Try 95) Couldn't load data. Retrying (Try 96) Couldn't load data. Retrying (Try 97) Couldn't load data. Retrying (Try 98) Couldn't load data. Retrying (Try 99) Couldn't load data. Retrying (Try 100) [LOCKING MECHANISM] Your server has been locked for this reason: Server failed to load zone data from the database (No zones set in time!) [LOCKING MECHANISM] Your server has been locked for this reason: Server failed to load zone data from the database (No zones set in time!) [LOCKING MECHANISM] Your server has been locked for this reason: Server failed to load zone data from the database (No zones set in time!) [LOCKING MECHANISM] Player has been locked out: Server failed to load zone data from the database (No zones set in time!)[/B] I have tried setting down zones, when I do it says they are set but your time will not start when you leave the zone. Also I dont seem to have the "gmod_zones" table in my MySQL DB, as when I imported both files it never got added, any fixes? Cheers :) [editline]8th May 2015[/editline] Infact, Would anyone happen to have a table that I can upload to my SQL DB with all the time zone premade? :)
[QUOTE=Clouds;47678287]Things are still flowing well (pun not intended) over at qT's. I just had a quick question, though. I'm not terribly familiar with using the sql.Query command in GLua. I'm trying to use it like normal SQL queries, but I'm getting errors and I don't quite know why. I'm attempting to pull information for a single location in the database, such as the number of plays from the game_map table. What I'm currently doing is this: [lua]sql.Query( "SELECT nPlays FROM game_map WHERE szMap = '" .. game.GetMap() .. "'" )[/lua] Now whenever I query it, I get no errors with that, but when I go to print it, it seems to be a boolean value instead of a string. How would I go about querying info from the table and retrieving it as int/string instead of boolean? I'm asking here because I don't know if it has something to do with the command and how I'm using it or how the tables/GM is set up. If others feel like this should be asked elsewhere, just say so and I will request the question be moved; I just felt it was relevant enough to the information at hand.[/QUOTE] I think it only returns a bool whenever the query fails. So if you get a "false" boolean, try running sql.LastError() to see what went wrong. Otherwise it should simply return a table and you should be able to get the nPlays column by: [code] local query = sql.Query( "Your query" ) if query then print( query[ 1 ]["nPlays"] ) else print( "Error on query", sql.LastError() ) end [/code] [QUOTE=Ethiixx;47680078]Im getting this Issue showing up in console. [B]Couldn't load data. Retrying (Try 81) Couldn't load data. Retrying (Try 82) Couldn't load data. Retrying (Try 83) Couldn't load data. Retrying (Try 84) Couldn't load data. Retrying (Try 85) Couldn't load data. Retrying (Try 86) Couldn't load data. Retrying (Try 87) Couldn't load data. Retrying (Try 88) Couldn't load data. Retrying (Try 89) Couldn't load data. Retrying (Try 90) Couldn't load data. Retrying (Try 91) Couldn't load data. Retrying (Try 92) Couldn't load data. Retrying (Try 93) Couldn't load data. Retrying (Try 94) Couldn't load data. Retrying (Try 95) Couldn't load data. Retrying (Try 96) Couldn't load data. Retrying (Try 97) Couldn't load data. Retrying (Try 98) Couldn't load data. Retrying (Try 99) Couldn't load data. Retrying (Try 100) [LOCKING MECHANISM] Your server has been locked for this reason: Server failed to load zone data from the database (No zones set in time!) [LOCKING MECHANISM] Your server has been locked for this reason: Server failed to load zone data from the database (No zones set in time!) [LOCKING MECHANISM] Your server has been locked for this reason: Server failed to load zone data from the database (No zones set in time!) [LOCKING MECHANISM] Player has been locked out: Server failed to load zone data from the database (No zones set in time!)[/B] I have tried setting down zones, when I do it says they are set but your time will not start when you leave the zone. Also I dont seem to have the "gmod_zones" table in my MySQL DB, as when I imported both files it never got added, any fixes? Cheers :) [editline]8th May 2015[/editline] Infact, Would anyone happen to have a table that I can upload to my SQL DB with all the time zone premade? :)[/QUOTE] They're already included in the release package (in the Database folder). Even if you use MySQL, still part of it (the times) are saved locally with SQLite. The MySQL part is just for global server integration if you want to have your admins shared. It's a bit vague but that's because I decided to make that part a bit more user friendly than what it was.
[QUOTE=Gravious;47684170]I think it only returns a bool whenever the query fails. So if you get a "false" boolean, try running sql.LastError() to see what went wrong. Otherwise it should simply return a table and you should be able to get the nPlays column by: [code] local query = sql.Query( "Your query" ) if query then print( query[ 1 ]["nPlays"] ) else print( "Error on query", sql.LastError() ) end [/code] They're already included in the release package (in the Database folder). Even if you use MySQL, still part of it (the times) are saved locally with SQLite. The MySQL part is just for global server integration if you want to have your admins shared. It's a bit vague but that's because I decided to make that part a bit more user friendly than what it was.[/QUOTE] Understood. But what can I do about the error? [editline]9th May 2015[/editline] Also getting this error Ive never seen in the Web Console [SQL Connect] Connected to 43.245.162.14 successfully (User: TRENTB) [SQL Error] MySQL server has gone away (On query: SELECT nTimeout, szText FROM gmod_notifications WHERE nType = 2 OR nType = 0 ORDER BY nID DESC) [SQL Error] MySQL server has gone away (On query: SELECT szSteam, nLevel FROM gmod_admins WHERE nType = 2 or nType = 0 ORDER BY nLevel DESC)
[QUOTE=Ethiixx;47687632]Understood. But what can I do about the error? [editline]9th May 2015[/editline] Also getting this error Ive never seen in the Web Console [SQL Connect] Connected to 43.245.162.14 successfully (User: TRENTB) [SQL Error] MySQL server has gone away (On query: SELECT nTimeout, szText FROM gmod_notifications WHERE nType = 2 OR nType = 0 ORDER BY nID DESC) [SQL Error] MySQL server has gone away (On query: SELECT szSteam, nLevel FROM gmod_admins WHERE nType = 2 or nType = 0 ORDER BY nLevel DESC)[/QUOTE] That error part was directed towards Cloud. To fit that Core Locking error you simple have to make sure the map you're currently playing has valid zones (in game_zones in SQLite sv.db). For MySQL server going away, I can't do anything, that should be a problem on your end. You could try picking up "gone away" in the error string (szError) and automatically retrying it when they fail like that.
[QUOTE=Gravious;47689439]That error part was directed towards Cloud. To fit that Core Locking error you simple have to make sure the map you're currently playing has valid zones (in game_zones in SQLite sv.db). For MySQL server going away, I can't do anything, that should be a problem on your end. You could try picking up "gone away" in the error string (szError) and automatically retrying it when they fail like that.[/QUOTE] Yeah but thats the thing dude, theres no game_zones when I added it to the SQL DB, this is all I have. [IMG]http://i.imgur.com/84KiFt5.png[/IMG]
[QUOTE=Ethiixx;47689468]Yeah but thats the thing dude, theres no game_zones when I added it to the SQL DB, this is all I have. [IMG]http://i.imgur.com/84KiFt5.png[/IMG][/QUOTE] I think you're still misunderstanding the database structure, let's see. I said this before: [quote] They're already included in the release package (in the Database folder). Even if you use MySQL, still part of it (the times) are saved locally with SQLite. The MySQL part is just for global server integration if you want to have your admins shared. It's a bit vague but that's because I decided to make that part a bit more user friendly than what it was. [/quote] With "They" I mean the databases, there's already pre-made sv.db files that contain a full list of zones for your maps, large chance the map you're trying already has them setup. This is the path to an example sv.db for that: "Release\Gamemodes\Flow Network - All gamemodes\Flow Network - Bunny Hop\Database\SQLite (sv.db in garrysmod folder)\sv (for clean no MySQL server).db" You can open them with any SQLite editor. The MySQL database you have there is to load admins across different servers, which is why it's on a remote database. SQLite is only local, and can only be accessed by the running server, which is why I put the times and zones in there, in order to keep some stress off the MySQL server. I hope it's clear now!
Ah, it works! Thank you very much :) Players have set a couple of Records, however the bots arent moving to show the Records or WRs, any reason for this? Just says "Awaiting playback" when you hold down TAB.
Nevermind got it sorted :) Ive noticed that the global WR system seems a bit dodgy, whats to stop people from Changing the gravity or moving the zones to get the best time? Some people have finished maps that usually take 30 - 40 seconds in 15 Seconds with 10 jumps or so on.
[QUOTE=Ethiixx;47695573]Nevermind got it sorted :) Ive noticed that the global WR system seems a bit dodgy, whats to stop people from Changing the gravity or moving the zones to get the best time? Some people have finished maps that usually take 30 - 40 seconds in 15 Seconds with 10 jumps or so on.[/QUOTE] Your anticheat and admin system are both in place to stop users from doing that. If you are running into these issues, you need to get an anticheat.
[QUOTE=Clouds;47696169]Your anticheat and admin system are both in place to stop users from doing that. If you are running into these issues, you need to get an anticheat.[/QUOTE] We have the Anti Cheat installed, but what Im saying is that the server Owner could easily change the Gravity, Air accel and such to get players times to the top of the Global Times, which is unfair. So what I'm wanting to know is, is there any way that the plugin stops that? because from the times ive seen be set it doesnt look like it.
[QUOTE=Ethiixx;47697499]We have the Anti Cheat installed, but what Im saying is that the server Owner could easily change the Gravity, Air accel and such to get players times to the top of the Global Times, which is unfair. So what I'm wanting to know is, is there any way that the plugin stops that? because from the times ive seen be set it doesnt look like it.[/QUOTE] If you have owners that cheat I'm not sure what kind of gaming community you're hosting. But EVEN for that, there's a logging system where you can see what specific admins did (gmod_logging in the MySQL database).
[QUOTE=Ethiixx;47697499]We have the Anti Cheat installed, but what Im saying is that the server Owner could easily change the Gravity, Air accel and such to get players times to the top of the Global Times, which is unfair. So what I'm wanting to know is, is there any way that the plugin stops that? because from the times ive seen be set it doesnt look like it.[/QUOTE] Stop having shitty admins, then. There's no reason anyone, even you, should have access to commands that alter these from a panel in-game. The surf/bhop gamemode doesn't need these abilities. Limit permissions and watch logfiles.
[QUOTE=Gravious;47697972]If you have owners that cheat I'm not sure what kind of gaming community you're hosting. But EVEN for that, there's a logging system where you can see what specific admins did (gmod_logging in the MySQL database).[/QUOTE] Thats not what im saying, no one is cheating on our server. Im saying with the GLOBAL RECORD time that is set across ALL servers, someone can easily cheat on one of those servers to get a non legit time, due to that server having low gravity etc. [QUOTE=Clouds;47702217]Stop having shitty admins, then. There's no reason anyone, even you, should have access to commands that alter these from a panel in-game. The surf/bhop gamemode doesn't need these abilities. Limit permissions and watch logfiles.[/QUOTE] Thats not what I said at ALL, Jesus Christ you're so aggressive.
[QUOTE=Ethiixx;47709873]Thats not what im saying, no one is cheating on our server. Im saying with the GLOBAL RECORD time that is set across ALL servers, someone can easily cheat on one of those servers to get a non legit time, due to that server having low gravity etc. Thats not what I said at ALL, Jesus Christ you're so aggressive.[/QUOTE] The WR that is set on your server is only for your server. There's no global table that your WR gets saved to. You can notify other servers you manage with a function, but the WR set on your server won't be the same on mine, on Grav's, etc. I'm not being aggressive, either. The only aggressive thing I said was to stop having shitty admins. Your other posts were very vague and that's all I had to go off of. It seemed like you just kept asking about stopping your owners from cheating. If it came off dickish, then that's my fault.
[QUOTE=Ethiixx;47709873]Thats not what im saying, no one is cheating on our server. Im saying with the GLOBAL RECORD time that is set across ALL servers, someone can easily cheat on one of those servers to get a non legit time, due to that server having low gravity etc. Thats not what I said at ALL, Jesus Christ you're so aggressive.[/QUOTE] Ah, I understand your confusion. That's just the way it's called in Bhop. Don't understand the etymology behind it either. I hope everything is clear now! :)
[QUOTE=Clouds;47709936]The WR that is set on your server is only for your server. There's no global table that your WR gets saved to. You can notify other servers you manage with a function, but the WR set on your server won't be the same on mine, on Grav's, etc. I'm not being aggressive, either. The only aggressive thing I said was to stop having shitty admins. Your other posts were very vague and that's all I had to go off of. It seemed like you just kept asking about stopping your owners from cheating. If it came off dickish, then that's my fault.[/QUOTE] Thats very strange, because when I finished my server, there was already a bunch of premade times and rankings, So I assumed they were part of some global time records. There are all these people in the top 100 who I've never seen on my server and had all their times and points preset once the server was running. Like this: [IMG]http://i.imgur.com/voeNjLZ.png[/IMG] Every map has these preset times. Yeah allgood dude, sorry for the confusion.
[QUOTE=Ethiixx;47716186]Thats very strange, because when I finished my server, there was already a bunch of premade times and rankings, So I assumed they were part of some global time records. There are all these people in the top 100 who I've never seen on my server and had all their times and points preset once the server was running. Like this: [IMG]http://i.imgur.com/voeNjLZ.png[/IMG] Every map has these preset times. Yeah allgood dude, sorry for the confusion.[/QUOTE] Those times are just an export from the flow network server before it went down.
[QUOTE=itzaname;47716213]Those times are just an export from the flow network server before it went down.[/QUOTE] Alright, cheers for clearing that up.
you can remove them, if you open up the sv.db with an SQLite Manager and remove the Datas of the game_times table.
[QUOTE=Ethiixx;47716224]Alright, cheers for clearing that up.[/QUOTE] Hence the name "sv (straight from Flow US).db". If you wanted a clean database, you should use "sv (for clean no MySQL server).db". You know, I thought that by naming files appropriately and providing extensive documentation, people, even with lacking knowledge of [I]everything[/I] would be able to understand this. Turns out I was wrong.
I did take a look at the stamina system you had and I'd suggest you replace it with this: [url]https://github.com/TotallyMehis/GMODLUA-CSS-Stamina[/url]
[QUOTE=Mehis;47728920]I did take a look at the stamina system you had and I'd suggest you replace it with this: [url]https://github.com/TotallyMehis/GMODLUA-CSS-Stamina[/url][/QUOTE] I'll say it's up to the people if they actually want it. I never intended to fully re-create CS:S stamina, just to have a more challenging mode. That's some nice work you did there though, never gotten my hands on the 2007 Source :(
[QUOTE=Gravious;47729148]I'll say it's up to the people if they actually want it. I never intended to fully re-create CS:S stamina, just to have a more challenging mode. That's some nice work you did there though, never gotten my hands on the 2007 Source :([/QUOTE] Speaking of it being up to the people... Where did you stash the code for the different styles? I tried searching for it, using my eyes and Np++'s directory search, but I came up with so many different results and none of the ones I saw were it.
[QUOTE=Clouds;47745831]Speaking of it being up to the people... Where did you stash the code for the different styles? I tried searching for it, using my eyes and Np++'s directory search, but I came up with so many different results and none of the ones I saw were it.[/QUOTE] Core.lua Line 276 "StripMovements" That's the function that makes it so the certain keys don't work. What the numbers mean: Normal = 1 SW = 2 HSW = 3 W-Only = 4 A-Only= 5 Legit = 6 Easy Scroll = 7 Bonus = 8 Practice = 9
Yeah, looks like I figured this shit out. If the sv.db gets way too big, man you're in for a fucking ride of lag. Our database had over 25k times which was causing such bad lag, and the hard drive the server is on isn't even bad. I'm going to look into re-coding local storage to use MySQL, so this type of shit doesn't happen again. Just wanted to update for other users.
For some reason my zones are not working. After i finish a zone no box shows up. Also I cant seem to add my maps to the map list, any help?
Is legit mode css-like yet?
[QUOTE=fpgranny;47801429]For some reason my zones are not working. After i finish a zone no box shows up. Also I cant seem to add my maps to the map list, any help?[/QUOTE] If none of that works, you HAVE to be getting errors. Is anything showing in either consoles? (Errors, that is) [QUOTE=thefreemann;47802111]Is legit mode css-like yet?[/QUOTE] On here I made it somewhat like CS:S, it doesn't implement it the way CS:S does it, but it replicates it to an extent. It's easier.
[QUOTE=Gravious;47815962]If none of that works, you HAVE to be getting errors. Is anything showing in either consoles? (Errors, that is) On here I made it somewhat like CS:S, it doesn't implement it the way CS:S does it, but it replicates it to an extent. It's easier.[/QUOTE] Nope, no errors anywhere. I have setup just as instructed. But zones will not show or set.
Sorry, you need to Log In to post a reply to this thread.