Ulysses Stuff > Releases
ULX MySQLOO
TweaK:
I was talking about the error you got
--- Quote from: JakeGriffin on June 29, 2013, 05:13:24 PM ---When I run require('mysqloo') I get the error
--- Code: ---Couldn't include file 'includes\modules\ mysqloo .lua' (File not found) (@lua_run (line 1))
--- End code ---
--- End quote ---
since it has a space before and after 'mysqloo' (which is obviously not going to exist on disk) I figured it was because you were running that through rcon.
rainbow Dash:
I think this has been approached wrong.
In my opinion, It would be much better if this didn't read the ranks from the external database, but rather synced the local data file with the remote database whenever a player's rank changes, or a player connects. This way, any connection problems can be overlooked quite easily, and cause minimal disruptions for the server in the event of a failed connection, as the remote database would simply become a backup, only with the added feature of being able to display a players rank in a loadingurl.
How one would go about doing this, is beyond me. I have ideas, I just can't make them.
Your welcome to whomever feels inspired by that.
Organik:
I get an error in console occasionally when some people join:
--- Code: ---addons/ulx mysql/lua/ulx/modules/sh/mysql.lua:54: attempt to call field 'adduserids' (a nil value)
--- End code ---
I've tried changing it to "adduserid" instead but that just results in something along the lines of "bad argument" if I recall.
Could anyone tell me what's going on here?
EDIT: Here is the function around that line:
--- Code: ---function LoadRank(ply)
local queryQ = ULXDB:query("SELECT * FROM `ulxmysql` WHERE steam = '" .. ply:SteamID() .. "'")
queryQ.onData = function(Q,D)
queryQ.onSuccess = function(q)
if checkQuery(q) then
print("You are already created!")
ulx.adduserids(nil,ply:SteamID(),D.groups)
end
end
end
queryQ.onError = function(Q,E) print("Q1") print(E) end
queryQ:start()
end
--- End code ---
Organik:
Sorry for the bump, could anyone shed some light on this issue possibly?
Thanks
Marmaduke:
I managed to get it mostly working but I still have one problem.
I got rid of all the errors by wrapping the code in an "if SERVER then" if statement. But I still had issues with the script adding the user to the correct usergroup when they joined (saving the groups works fine, but if the player joins the server with a usergroup that doesn't match the database, their usergroup would not change). I fixed this by changing:
"ulx.adduserids(nil,ply:SteamID(),D.groups)"
to
"ulx.adduserid(nil,ply:SteamID(),D.groups)"
Now the script works as I want it to but there is one issue.
My ulx menu seems to fail to load a lot of data. There are no maps in the maps list. There are no adverts in the adverts list (although adverts still display in chat). In the sandbox subtab of the settings tab, no sliders are appearing. In the group manager menu, group members are not appearing, and permissions are not appearing.
I've done some testing over the past few hours and the problems stated above seem to be from the fact I changed "ulx.adduserids(nil,ply:SteamID(),D.groups)" to "ulx.adduserid(nil,ply:SteamID(),D.groups)". If I change it back, all the information is displayed correctly, however the script doesn't change users usergroups.
Any help is appreciated.
Thanks
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version