• Gm_MySql v1.0 - OO edition.
    824 replies, posted
  • Avatar of ali3n92
  • [QUOTE=blackops7799;28839905]Yep, that's because servers go into a sleep like mode when no players are connected, as soon as a player makes connection it will start doing shit again.[/QUOTE] Actually, the server doesn't go back to sleep when all players are gone. It's only sleeping when it starts up.
  • Avatar of EraYaN
  • I have a problem, It doesn't call my callbacks. It executes the query but doesn't call my callbacks. They always worked and now I moved then to seperate files and they stopped working. It shoudn't be a problem that the callbacks and main function are in a huge table right? (like the Ulib way) -EraYaN-
  • Avatar of mr.wolf
  • [QUOTE=EraYaN;28911631]I have a problem, It doesn't call my callbacks. It executes the query but doesn't call my callbacks. They always worked and now I moved then to seperate files and they stopped working. It shoudn't be a problem that the callbacks and main function are in a huge table right? (like the Ulib way) -EraYaN-[/QUOTE] As long as your functions are viewable by all of your code. Make sure they aren't local functions. Also, double check that the onError isn't being called instead.
  • Avatar of Buggzie
  • [QUOTE=^seth;28837259]Does this module keep database connections over map restarts? I mean, if I restart the map frequently will I end up with 500 open MySQL connections?[/QUOTE] It will open 500 MySQL connections but kill off the previous one, all lua scripts are reloaded on map changes and server restarts.
  • [QUOTE=^seth;28837259]Does this module keep database connections over map restarts? I mean, if I restart the map frequently will I end up with 500 open MySQL connections?[/QUOTE] All MySQL servers have a timeout which will kill the connection after inactivity. This feature can not be disabled and usually defaults to 8 hours. If you want to change the inactivity timeout see [url]http://www.facepunch.com/threads/933647-Gm_MySql-v1.0-OO-edition.?p=26221004&viewfull=1#post26221004[/url]
  • Avatar of Teddi
  • Which is why when the Gamemode is shutting down, you want to set the connections to nil to terminate them. Some hosters have a limit as to how many connections can be used at any one time.
  • Avatar of mr.wolf
  • [QUOTE=Teddi Orange;28930574]Which is why when the Gamemode is shutting down, you want to set the connections to nil to terminate them. Some hosters have a limit as to how many connections can be used at any one time.[/QUOTE] Shouldn't the connections automatically terminate on shutdown, as the entire lua_state is unloaded?
  • Avatar of Kamshak
  • I'm getting an error when trying to load the module [code] error loading module 'mysqloo' from file 'f:\games\steam2\steamapps\steamname\garrysmod\garrysmod\lua\includes\modules\gmsv_mysqloo.dll': The specified module could not be found. [/code]What can i do? I copied the dir to addons and when that didn't work i copied the contents of the dir to gmod/gmod require("mysqloo") gives the error above :( The file garrysmod\garrysmod\lua\includes\modules\gmsv_mysqloo.dll does exist
  • Avatar of Teddi
  • [QUOTE=mr.wolf;28931716]Shouldn't the connections automatically terminate on shutdown, as the entire lua_state is unloaded?[/QUOTE] Should be the case, but I've found that unless I set them to nil the connections would actually persist. You can't use the connections as the object is gone though. Keep in mind this was back in v6 though, I haven't tested if the same still occurs in v7. [QUOTE=Kamshak;28945607]I'm getting an error when trying to load the module [code] error loading module 'mysqloo' from file 'f:\games\steam2\steamapps\steamname\garrysmod\garrysmod\lua\includes\modules\gmsv_mysqloo.dll': The specified module could not be found. [/code]What can i do? I copied the dir to addons and when that didn't work i copied the contents of the dir to gmod/gmod require("mysqloo") gives the error above :( The file garrysmod\garrysmod\lua\includes\modules\gmsv_mysqloo.dll does exist[/QUOTE] Screenshot of where they're installed to with the directory please.
  • Avatar of alexanderk
  • [QUOTE=Kamshak;28945607]I'm getting an error when trying to load the module [code] error loading module 'mysqloo' from file 'f:\games\steam2\steamapps\steamname\garrysmod\garrysmod\lua\includes\modules\gmsv_mysqloo.dll': The specified module could not be found. [/code]What can i do? I copied the dir to addons and when that didn't work i copied the contents of the dir to gmod/gmod require("mysqloo") gives the error above :( The file garrysmod\garrysmod\lua\includes\modules\gmsv_mysqloo.dll does exist[/QUOTE] generally means you installed the libmysql module incorrectly
  • Avatar of mr.wolf
  • [QUOTE=Knallex;28958121]generally means you installed the libmysql module incorrectly[/QUOTE] This. If it's a dedi, install the libmysql.dll to your orangebox bin folder. If it's linux, you'll need to acquire the mysql libraries.
  • Avatar of Kamshak
  • [code] 1>------ Build started: Project: LuaOO, Configuration: Release Win32 ------ 1>Build started 03.04.2011 10:20:25. 1>InitializeBuildStatus: 1> Creating "output\Release\Win32\obj\LuaOO.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> All outputs are up-to-date. 1>Lib: 1> All outputs are up-to-date. 1> LuaOO.vcxproj -> F:\Dev\VC++\GMod\LuaOO\output\Release\Win32\LuaOO.lib 1>FinalizeBuildStatus: 1> Deleting file "output\Release\Win32\obj\LuaOO.unsuccessfulbuild". 1> Touching "output\Release\Win32\obj\LuaOO.lastbuildstate". 1> 1>Build succeeded. 1> 1>Time Elapsed 00:00:00.03 2>------ Build started: Project: MySqlOO, Configuration: Release Win32 ------ 2>Build started 03.04.2011 10:20:25. 2>InitializeBuildStatus: 2> Touching "output\Release\Win32\obj\MySqlOO.unsuccessfulbuild". 2>ClCompile: 2> All outputs are up-to-date. 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(F:\Dev\VC++\GMod\MySqlOO\output\Release\Win32\MySqlOO.dll) does not match the Linker's OutputFile property value (F:\Dev\VC++\GMod\MySqlOO\output\Release\Win32\gm_mysqloo.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(MySqlOO) does not match the Linker's OutputFile property value (gm_mysqloo). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 2>Link: 2> LuaOO.lib(CLASS_LuaObjectBase.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance 2> Creating library output\Release\Win32\gm_oomysql.lib and object output\Release\Win32\gm_oomysql.exp 2> Generating code 2> Finished generating code 2> MySqlOO.vcxproj -> F:\Dev\VC++\GMod\MySqlOO\output\Release\Win32\MySqlOO.dll 2>FinalizeBuildStatus: 2> Deleting file "output\Release\Win32\obj\MySqlOO.unsuccessfulbuild". 2> Touching "output\Release\Win32\obj\MySqlOO.lastbuildstate". 2> 2>Build succeeded. 2> 2>Time Elapsed 00:00:01.22 ========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== [/code]at F:\Games\Steam2\SteamApps\steamname\garrysmod\garrysmod\addons\MySqlOO\lua\includes\modules there is gm_mysqloo.dll and at F:\Games\Steam2\SteamApps\steamname\garrysmod\garrysmod\addons\MySqlOO there is the libmysql.dll that came with the connector i linked against the same file is also at garrysmod/garrysmod/bin but still: [code] ] lua_run require("mysqloo") > require("mysqloo")... error loading module 'mysqloo' from file 'f:\games\steam2\steamapps\steamname\garrysmod\garrysmod\addons\mysqloo\lua\includes\modules\gm_mysqloo.dll': The specified module could not be found. [/code]
  • Avatar of Teddi
  • [QUOTE=Kamshak;28964574]-giant quote-[/QUOTE] The libmysql.dll goes into garrysmod/, not garrysmod/garrysmod/bin. You also have to extract the sv_ and cl_ mysqloo modules and put them directly into the lua/includes/modules folders.
  • Avatar of Kamshak
  • [QUOTE=Teddi Orange;28965946]The libmysql.dll goes into garrysmod/, not garrysmod/garrysmod/bin. You also have to extract the sv_ and cl_ mysqloo modules and put them directly into the lua/includes/modules folders.[/QUOTE] It works now, putting the libmysql into garrysmod/bin fixed it :) The module itself can stay in the addon format, it was just the libmysql that didn't work in the addon Thanks for the help :) I'm now having a very different problem, when i insert data, the data is saved but it takes ages until the onSuccess callback of the query is called Edit: ages = sometimes more than a minute, when using query:wait( ) the callbacks get called almost instantly. Is anyone else experiencing this?
  • Avatar of zzaacckk
  • Hmm this is odd.. Image: [url]http://img233.imageshack.us/img233/4796/sadfac.png[/url] Also see .. : [url]http://www.facepunch.com/threads/1077170-Mysqloo-Error[/url] [editline]9th April 2011[/editline] Resolved - a person or a bot must be in the server for queries to run.
  • Avatar of Buggzie
  • [QUOTE=zzaacckk;29068864]Hmm this is odd.. Image: [url]http://img233.imageshack.us/img233/4796/sadfac.png[/url] Also see .. : [url]http://www.facepunch.com/threads/1077170-Mysqloo-Error[/url] [editline]9th April 2011[/editline] Resolved - a person or a bot must be in the server for queries to run.[/QUOTE] Use tmysql instead.
  • Avatar of mr.wolf
  • [QUOTE=Buggzie;29072357]Use tmysql instead.[/QUOTE] I'm really getting tired of you. All of your posts in this thread have summed up to "This module sucks, go use tmysql instead" or "This addon sucks because it uses mysqloo instead of tmysql". If you don't have anything useful to contribute, don't post. There are several advantages of using either module, and I haven't seen you give one reason why someone should use tmysql instead of mysqloo. You only ever say this one sucks and not to use it. If you have any factual reason why they should, then I'm sure we would all love to hear it. Otherwise, no one cares about your opinon, so kindly stop trolling/baiting/being-a-retard or whatever you care to call it.
  • Avatar of Buggzie
  • [QUOTE=mr.wolf;29101246]I'm really getting tired of you. All of your posts in this thread have summed up to "This module sucks, go use tmysql instead" or "This addon sucks because it uses mysqloo instead of tmysql". If you don't have anything useful to contribute, don't post. There are several advantages of using either module, and I haven't seen you give one reason why someone should use tmysql instead of mysqloo. You only ever say this one sucks and not to use it. If you have any factual reason why they should, then I'm sure we would all love to hear it. Otherwise, no one cares about your opinon, so kindly stop trolling/baiting/being-a-retard or whatever you care to call it.[/QUOTE] Telling me what advantages mysqloo has over tmysql, all I can see is that mysqloo isn't updated, it crashes constantly, it's not a reliable addon. Tmysql has a better query system, doesn't fail constantly and I've been using if for nearly 8 months without havening one difficulty with that addon. I added mysqloo about a month ago, I couldn't even get my script to work, if you look at my posts a few previous pages no one EVEN helped me. So before defending this piece of shit addon that doesn't even function properly and isn't being updated by anyone, try getting a bit more back-info. I understand with mysqloo you can connect to multiple databases, but seriously one per addon is fine, you don't need more than one database per addon, thats just a plain waste of space. Reasons why I prefer tmysql over mysqloo: has not crashed ONCE, multithreading (never EVER causes lag on my server(s)), much faster, more reliable, easier to script, easier to understand.
  • Avatar of mr.wolf
  • There, you see, those are reasons. You had a bad experience, and you prefer tmysql because it solved your problems where mysqloo didn't. That's wonderful. However, when someone has a problem with this module, the first reaction shouldn't be "its borked, dump it". I have been using mysqloo on all my servers, without the slightest bit of issues. I am running linux and windows. Clearly, unless you are doing something drastically different, and much more demanding than me, the errors are user errors, not a fault of the module. Again, if you prefer tmysql, that's perfectly fine; but, don't push your opinion on others. You can offer them the option, and give your reasons why you use it, but the attitude of "this sucks don't use it" gets rather irksome after a time. As for not having any update in a while, what does that have to do with anything? The module isn't broken, and unless you have some fantastic feature you want added, it doesn't need to be updated. One could argue that frequent are a sign of an incomplete or buggy system, over a stable, functional one that doesn't need constant maintenance. Again, I'm thrilled you've had success using tmysql, and am sorry you had a bad experience with mysqloo, but please don't shove your opinions on other without reasons, as you have been known to do quite frequently. Out of curiosity, what exactly were you trying to do when you ran into trouble with this module? Again, I've been using it on both platforms for a while, without any sort of lag or errors, and I abuse this module to death.
  • Avatar of Buggzie
  • [QUOTE=mr.wolf;29104530]There, you see, those are reasons. You had a bad experience, and you prefer tmysql because it solved your problems where mysqloo didn't. That's wonderful. However, when someone has a problem with this module, the first reaction shouldn't be "its borked, dump it". I have been using mysqloo on all my servers, without the slightest bit of issues. I am running linux and windows. Clearly, unless you are doing something drastically different, and much more demanding than me, the errors are user errors, not a fault of the module. Again, if you prefer tmysql, that's perfectly fine; but, don't push your opinion on others. You can offer them the option, and give your reasons why you use it, but the attitude of "this sucks don't use it" gets rather irksome after a time. As for not having any update in a while, what does that have to do with anything? The module isn't broken, and unless you have some fantastic feature you want added, it doesn't need to be updated. One could argue that frequent are a sign of an incomplete or buggy system, over a stable, functional one that doesn't need constant maintenance. Again, I'm thrilled you've had success using tmysql, and am sorry you had a bad experience with mysqloo, but please don't shove your opinions on other without reasons, as you have been known to do quite frequently. Out of curiosity, what exactly were you trying to do when you ran into trouble with this module? Again, I've been using it on both platforms for a while, without any sort of lag or errors, and I abuse this module to death.[/QUOTE] I was trying to get the module to actually require, every time I tried loading the module it didn't seem to work, I understand others can prefer mysqloo over tmysql due to there scripting habits or different types of projects, but I'm just saying if mysqloo doesn't work for you, try tmysql.
  • Avatar of mr.wolf
  • [QUOTE=Buggzie;29104559]I was trying to get the module to actually require, every time I tried loading the module it didn't seem to work, I understand others can prefer mysqloo over tmysql due to there scripting habits or different types of projects, but I'm just saying if mysqloo doesn't work for you, try tmysql.[/QUOTE] If you couldn't get it to require, then you didn't install it properly... That has nothing to do with how the module works. I'm sorry but that's just you being dumb... You just lost all rights to complain about how it works code-wise. Also, [quote]I added mysqloo about a month ago, I couldn't even get my script to work, if you look at my posts a few previous pages no one EVEN helped me.[/quote] Take a look here: [url]http://www.facepunch.com/threads/933647-Gm_MySql-v1.0-OO-edition.?p=28312756&viewfull=1#post28312756[/url] It was even me that tried to help you, and you shrugged it off as "a problem with my dedi." I don't have any issues with you suggesting tmysql to people. I have an issue with people having a tiny, easily correctable error, and you instantly telling them to drop what they are doing and switch modules instead of trying to help. It's not helpful.
  • Avatar of Buggzie
  • [QUOTE=mr.wolf;29104760]If you couldn't get it to require, then you didn't install it properly... That has nothing to do with how the module works. I'm sorry but that's just you being dumb... You just lost all rights to complain about how it works code-wise. Also, Take a look here: [url]http://www.facepunch.com/threads/933647-Gm_MySql-v1.0-OO-edition.?p=28312756&viewfull=1#post28312756[/url] It was even me that tried to help you, and you shrugged it off as "a problem with my dedi." I don't have any issues with you suggesting tmysql to people. I have an issue with people having a tiny, easily correctable error, and you instantly telling them to drop what they are doing and switch modules instead of trying to help. It's not helpful.[/QUOTE] If I can use tmysql why can't I use mysqloo, I don't understand the problem. I also said it "seemed" to be my dedi, which was false. I never got to figure out the problem.
  • Avatar of mr.wolf
  • [QUOTE=Buggzie;29106012]If I can use tmysql why can't I use mysqloo, I don't understand the problem. I also said it "seemed" to be my dedi, which was false. I never got to figure out the problem.[/QUOTE] You can't use mysqloo because you installed it wrong. I'm done with this conversation.
  • Avatar of Buggzie
  • [QUOTE=mr.wolf;29106182]You can't use mysqloo because you installed it wrong. I'm done with this conversation.[/QUOTE] I didn't install it wrong, thanks for popping that out of your ass, I placed the module in lua/includes/module/ and I played the libmysql.dll inside with the srcds.exe and in the garrysmod folder because at times it doesn't work if its only in one with tmysql. Seth could possibly be onto something, thanks seth.
  • Avatar of mr.wolf
  • Popping it out of my ass? You never gave a specific error, only that it failed to require. The most likely case is that you installed it incorrectly. If you were to give an actual error, other than "hurrr it doesn't work", then we might be able to help you out. Can you show us a directory map of where you put everything? [quote]because at times it doesn't work if its only in one with tmysql[/quote] ... wut
  • Avatar of Teddi
  • [QUOTE=Buggzie;29103993]Giant quote asking for advantages and a bunch of other opinions.[/QUOTE] I've not used tmysql3, but from what I'm aware of (please correct me if I'm wrong here) it's not OO and it only supports a single database. For both of those reasons I cannot use tmysql seeing as I need a module that connects to more than one database, and I prefer OO programming :v:. Both modules are threaded I might add and speedwise mysqloo has never let me down (or in terms of crashes). Otherwise it's down to personal choice.
  • Avatar of ^seth
  • Mhm, I moved from tmysql to mysqloo for that exact reason (multiple databases).
  • Avatar of Buggzie
  • [QUOTE=Teddi Orange;29109052]I've not used tmysql3, but from what I'm aware of (please correct me if I'm wrong here) it's not OO and it only supports a single database. For both of those reasons I cannot use tmysql seeing as I need a module that connects to more than one database, and I prefer OO programming :v:. Both modules are threaded I might add and speedwise mysqloo has never let me down (or in terms of crashes). Otherwise it's down to personal choice.[/QUOTE] I understand this so far, as I've also pointed it in one of my posts. Anyways yeah It's your personal option but I still prefer tmysql as I don't require connecting to multiple databases :)
  • Avatar of zzaacckk
  • [QUOTE=Buggzie;29072357]Use tmysql instead.[/QUOTE] I am using both mysqloo and tmysql for my addon due to recent requests.