• DarkRP 2.4.X
    1,868 replies, posted
[QUOTE=erie1555;22579861]How do you move to MySQL?[/QUOTE] Get the MySQL module and re-code every SQLite bit of DarkRP to work with MySQL instead, lol.
I'll put MySQL compatability in DarkRP don't you worry my childs. Dark-R-Daddy will take care of it.
[QUOTE=FPtje;22586173]I'll put MySQL compatability in DarkRP don't you worry my childs. Dark-R-Daddy will take care of it.[/QUOTE] Thanks :), also how do I restrict class default weapons from being dropped? rp_restrictdrop doesn't work
[QUOTE=FPtje;22586173]I'll put MySQL compatability in DarkRP don't you worry my childs. Dark-R-Daddy will take care of it.[/QUOTE] Is this what I think it is? Shared databases?
What is wrong here, I can't seem to use any chat commands or anything, the chat is all buggered up.
[QUOTE=tgp1994;22592342]Is this what I think it is? Shared databases?[/QUOTE] I doubt that there will be a central DarkRP database, due to the large chances of abuse. But, you could possibly link servers together by the same community.
[QUOTE=deadeye536;22593618]But, you could possibly link servers together by the same community.[/QUOTE] That's actually what I was going at there. I like :)
[QUOTE=mogey5101;22592681]What is wrong here, I can't seem to use any chat commands or anything, the chat is all buggered up.[/QUOTE] Errors?
I'll add MySQL support for DarkRP. It'll be easy to set it up I guess, rp_mySQL1 and rp_mySQLServer "skljadfasdlkjf.com/serv0r"
I really love this idea of using a MySQL DB and would definitely use it.
[QUOTE=FPtje;22598927]I'll add MySQL support for DarkRP. It'll be easy to set it up I guess, rp_mySQL1 and rp_mySQLServer "skljadfasdlkjf.com/serv0r"[/QUOTE] It's about time you added it to the official release. I've only been using it since my old ParadoxRP script, back in what was it 2007?. Damn. It's easy to add in and with all the problems you had with the SQLite database screwing up I honestly would have figured you would have added it in back then.
I didn't know so many people wanted it. No one made a real request before.
[QUOTE=FPtje;22601389]I didn't know so many people wanted it. No one made a real request before.[/QUOTE] I actually asked awhile back for something like that, shared databases.
[ADD] MySQL support! NOTE: THIS IS A POSSIBLY UNSTABLE RELEASE. PLEASE TEST WITH AND WITHOUT MYSQL ON. PLEASE REPORT PROBLEMS TO ME! How to set up MySQL: 1. Set up MySQL server if you haven't done that already 2. Read gamemode/_MySQL.lua
[QUOTE=FPtje;22613296][ADD] MySQL support! NOTE: THIS IS A POSSIBLY UNSTABLE RELEASE. PLEASE TEST WITH AND WITHOUT MYSQL ON. PLEASE REPORT PROBLEMS TO ME! How to set up MySQL: 1. Set up MySQL server if you haven't done that already 2. Read gamemode/_MySQL.lua[/QUOTE] Is it possible to transfer over our current database to the mysql?
[QUOTE=FPtje;22613296][ADD] MySQL support! NOTE: THIS IS A POSSIBLY UNSTABLE RELEASE. PLEASE TEST WITH AND WITHOUT MYSQL ON. PLEASE REPORT PROBLEMS TO ME! How to set up MySQL: 1. Set up MySQL server if you haven't done that already 2. Read gamemode/_MySQL.lua[/QUOTE] I think I'm starting to realise the implications of this, epic, one question; Will FAdmin have MySQL support too?
[QUOTE=erie1555;22618894]Is it possible to transfer over our current database to the mysql?[/QUOTE] [url]http://sqlite.phxsoftware.com/forums/p/941/4725.aspx[/url] Google is awesome. It saves everyone time and makes you not look stupid.
Hmm, Falco, you may want to consider rewriting part of data.lua to be more efficient concerning how MySQL is in most cases, on a remote server. Frequent connections to a remote server can be very straining on both the Gmod server and the MySQL server. You may wish to rewrite some of the queries to be more efficient, and change how data is saved overall. For example, you can have a better structure for users and doors. Consider this [code]darkrp_players id steam rpname wallet salary privs darkrp_doors id map x y z title group -- Can be null (If null, it has no group) disabled -- 0/1[/code] While this may be a better structure, it is a big change, and most likely incompatible with earlier versions. You may also wish to try to recreate some of the queries. For example, I wrote this one up which allows you to retrieve all the data needed for a player in one query. [code]-- Player Data Retrieval SELECT rpn.steam AS SteamID, rpn.name AS rpname, sal.salary AS salary, wal.amount AS cash, priv.admin AS admin, priv.mayor AS mayor, priv.cp AS CP, priv.tool AS tool, priv.phys AS phys, priv.prop AS prop FROM darkrp_rpnames AS rpn LEFT JOIN darkrp_wallets AS wal ON (wal.steam = rpn.steam) LEFT JOIN darkrp_salaries AS sal ON (sal.steam = rpn.steam) LEFT JOIN darkrp_privs AS priv ON (priv.steam = rpn.steam) WHERE rpn.steam = ----Put variable here!----[/code] Another thing you can try is interval saving (like as you see in many other scripts that use MySQL). Create a timer that will save all the player data every 5 minuets. Create a hook that saves player data on disconnect and server shutdown. Create a command for admins that allows them to save the the data manually. Basically, to conclude my mindless thought dump. MySQL and SQLite may be similar, but should be thought of two different things entirely. MySQL will (most of the time) be on a remote server. You should rely less on saving data instantly to the database, and start working on more efficient methods to save/retrieve data. MySQL is a great leap forward, keep up with it. It unlocks many possibilities for the DarkRP community. Just be aware what you're getting in to. P.S. Above query is untested, but the theory should work.
[QUOTE=FPtje;22613296][ADD] MySQL support! NOTE: THIS IS A POSSIBLY UNSTABLE RELEASE. PLEASE TEST WITH AND WITHOUT MYSQL ON. PLEASE REPORT PROBLEMS TO ME! How to set up MySQL: 1. Set up MySQL server if you haven't done that already 2. Read gamemode/_MySQL.lua[/QUOTE] So, did you fix the laptop problem?
[QUOTE=tgp1994;22626425]So, did you fix the laptop problem?[/QUOTE] No I didn't. deadeye536: I'll look into making it more efficient.
Falco, you might want to seriously consider thinking about linux hosts when coding. [LUA]if file.Exists("../lua/includes/modules/gmsv_mysqloo.dll") then require("mysqloo") end[/LUA] Will make it so mysql will not work on any linux server for this gamemode, since the binaries are different for linux and windows (Different names).
Whoops, thanks for that.
[QUOTE=FPtje;22628902]Whoops, thanks for that.[/QUOTE] NP, I'm not trying to be rude again like I was in the past. :(
Noticed first problem insantly: [lua]function DB.Begin() if CONNECTED_TO_MYSQL then sql.Begin() end end function DB.Commit() if CONNECTED_TO_MYSQL then sql.Commit() end end[/lua] It does the SQLite begin and commit when connected to MySQL? :what:
Falco another option you could code in is a /save feature for anyone using mysql, so people can verify it saved their data :P.
Well if it saves the data everything is fine, when it didn't save the data you see errors in the server console and in the DarkRP logs. What exactly would /save do? Save all the settings again?
[QUOTE=FPtje;22630443]Well if it saves the data everything is fine, when it didn't save the data you see errors in the server console and in the DarkRP logs. What exactly would /save do? Save all the settings again?[/QUOTE] Save player data for money and such. If you have it saving and reading data the instant they do anything that changes it, you're doing the mysql system wrong. There needs to be a "buffer" so to speak for any [i]remote[/i] mysql server or else there will be a large load on the MySQL server plus lag.
[QUOTE=darksoul69;22628919]NP, I'm not trying to be rude again like I was in the past. :([/QUOTE] "Drakehawke likes this" xD Oh, and yay for having a host that doesn't let you past the second garrysmod directory V_V
[QUOTE=Drakehawke;22630535]"Drakehawke likes this" xD Oh, and yay for having a host that doesn't let you past the second garrysmod directory V_V[/QUOTE] I'm assuming you're talking about your host?. Who is your host?.
[lua]Made MySQL Linux compatible (I think, tell me if I'm wrong, please test this) Optimized SQL performance Fixed minor mistake that no one really noticed :P [/lua] Darksoul, do you reckon this would work on a Linux server? (I don't have a Linux server myself so I can't test it) [lua]if file.Exists("../lua/includes/modules/gmsv_mysqloo.dll") or file.Exists("../lua/includes/modules/gmsv_mysqloo_i486.dll") then...[/lua] [editline]02:22PM[/editline] [QUOTE=darksoul69;22630533]Save player data for money and such. If you have it saving and reading data the instant they do anything that changes it, you're doing the mysql system wrong. There needs to be a "buffer" so to speak for any [i]remote[/i] mysql server or else there will be a large load on the MySQL server plus lag.[/QUOTE] DarkRP already uses cache, In the latest SVN update it first checks the cache for data, if the data is there the Query will never be executed. If it isn't, the query is executed and the data is put in the cache.
Sorry, you need to Log In to post a reply to this thread.