FredyH / MySQLOO

MySQLOO
GNU Lesser General Public License v2.1
140 stars 55 forks source link

Hello! Having an issue with Module Library #55

Closed Atreides88 closed 4 years ago

Atreides88 commented 4 years ago

Before I did any of this I installed the following vcredistx64 2008 (and current). I installed the files provided in my gmod/lua/bin folder.

Kinda having a weird issue with... If you don't mind, I maybe blind where is this mysqloo.lua file at? I downloaded MySQLOO-master unsure what I am supposed to do with this (don't know if I need it because I read down below about some compiler)

Couldn't include file 'includes\modules\mysqloo.lua' (File not found) (@gamemodes/starwarsrp/gamemode/libraries/mysqlite/mysqlite.lua (line 132))

==========================================================

[ERROR] gamemodes/starwarsrp/gamemode/libraries/mysqlite/mysqlite.lua:132: Module not found!

  1. require - [C]:-1
    1. loadMySQLModule - gamemodes/starwarsrp/gamemode/libraries/mysqlite/mysqlite.lua:132
    2. unknown - gamemodes/starwarsrp/gamemode/libraries/mysqlite/mysqlite.lua:141
      1. include - [C]:-1
      2. unknown - gamemodes/starwarsrp/gamemode/init.lua:42
viral32111 commented 4 years ago

I'm not the maintainer, but I can try help. If you just want to use this module and not compile it yourself, then you need to download the latest .dll module from the releases page for your OS and server architecture, not the source code from the repository. For example, on Windows running a 32-bit server you would download gmsv_mysqloo_win32.dll.

Once that's downloaded, simply place the file inside the garrymod/lua/bin folder on your server. (if the bin folder is not there, don't worry, just create it.)

With that completed, fire up your server and see if it works. If you wish to test manually if the module's working or not, you can type lua_run require("mysqloo") into the server's console to initalise the module. If it works successfully, it should run without error. If the module's installed incorrectly then it'll give you the same "Module not found error".

Also, in case you're wondering. The reason why the error says Couldn't include file 'includes\modules\mysqloo.lua' (File not found) is because the engine first tries to look for binary module (the .dll file) but if it can't find it then it moves to finding the .lua equivilent. Since it also can't find that, this is what it errors on. As documented here.

If you're used to downloading normal addons from GitHub, this is probably a bit confusing. This is a module, written in C++ which is a compiled language. Meaning you can't run it (or at the very least shouldn't run it) without first running it through a compiler and creating some sort of executable (or in this case, a module, library, etc.). Where as Lua with the LuaJIT is an interpreted language, meaning it runs on the fly and all you need is the code. No fancy compilers or executable files (please don't confuse this with normal Lua operation, as Lua on it's own without the JIT can be compiled). So because of this, most Garry's Mod module repositories utilise the releases page for publishing the final product and keep the repository tree for source code and any build scripts.

Atreides88 commented 4 years ago

So just out of curiousity is there anything else that I should be doing differently from a Dedicated Machine as well? PLEASE TAKE NOTE I do have VCRedistx64 Current and VCRedistx63 2008

libmysql - C:\Servers\gmod gmsv_mysqloo_win64 - C:\Servers\gmod\garrysmod\lua\bin

Can lua_run require("mysqloo") be ran from srcds

viral32111 commented 4 years ago

So just out of curiousity is there anything else that I should be doing differently from a Dedicated Machine as well? PLEASE TAKE NOTE I do have VCRedistx64 Current and VCRedistx63 2008

libmysql - C:\Servers\gmod gmsv_mysqloo_win64 - C:\Servers\gmod\garrysmod\lua\bin

The process should be the same even on a dedicated machine. Just make sure you ensure the following points:

Can lua_run require("mysqloo") be ran from srcds

Yes. that's what I meant by the server's console.