Author Topic: MySQL Plugin for LU?  (Read 8961 times)

John_Michael

  • Guest
MySQL Plugin for LU?
« on: September 16, 2011, 04:27:53 am »
Hey all,

Does anyone have any plans to release a MySQL plugin for LU? I would really like this as I have a gamemode planned that requires MySQL. I suppose I could work around it, but having MySQL functions ready would be a lot easier (and more efficient).

Thanks in advance.

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: MySQL Plugin for LU?
« Reply #1 on: September 16, 2011, 07:10:07 am »
I know there's a SQLite plugin available IIRC, but it would be nice to see this too. Some people with complicated gamemodes that wish to link them to websites would probably enjoy this as well. :)

John_Michael

  • Guest
Re: MySQL Plugin for LU?
« Reply #2 on: September 16, 2011, 07:17:10 am »
Well, my plan is to have a shared accounts and ban database across the III, VC, SA, and IV servers running my gamemode, which is why this is important. It can wait tho, still need to work on the basics.

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: MySQL Plugin for LU?
« Reply #3 on: September 16, 2011, 07:20:39 am »
Very nice!

For my server, we had a similar plan for some of our servers in our community, but I was told it was possible through sockets to link the databases, so worst case you could probably use a similar idea, but I agree that MySQL would probably be much easier for your scenario.

Hopefully someone will pop in here later and help you out. Best of luck to you! Don't give up when things get tough! :)

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Re: MySQL Plugin for LU?
« Reply #4 on: September 16, 2011, 11:50:06 am »
Juppi has a MySQL module he never formally released.

Linux
Windows
Source

I've never tested it myself. Try it at your own risk, IMO, unless Juppi drops in here.
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

John_Michael

  • Guest
Re: MySQL Plugin for LU?
« Reply #5 on: September 16, 2011, 08:42:39 pm »
I'll play with it a bit later on, nothing too serious until Juppi shows up with a list of functions / directions or something. Thanks!

@SugarD - Another thing I've planned is to synchronize chat from all servers into one IRC channel. I noticed that there are sockets available - should I use these, or is there a hidden IRC module for LU laying around as well?
« Last Edit: September 16, 2011, 08:44:10 pm by John_Michael »

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: MySQL Plugin for LU?
« Reply #6 on: September 17, 2011, 03:37:16 pm »
I use Juppi's module (As he sort-of wrote it for me) on 2 of my servers and only noticed one annoying bug:
If you query your table and it you need multiple rows it only returns one row, and then it returns empty tables.
Juppi has looked into this for a small time and don't know how to fix it.
If anyone has some knowledge about the mysql api feel free to fix it!

And yes, There is a hidden IRC module as well, Prod vrocker for it. He was talking about releasing it anyways :)

Vortrex

  • Guest
Re: MySQL Plugin for LU?
« Reply #7 on: September 21, 2011, 03:16:36 pm »
I tried to use this plugin, but it doesn't let me connect to the MySQL server.

It has an error when trying to connect that says something about not being able to load userdata or something

Also, yes, the module was added to the script with LoadModule("lu_mysql");


SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: MySQL Plugin for LU?
« Reply #8 on: September 21, 2011, 03:22:31 pm »
I tried to use this plugin, but it doesn't let me connect to the MySQL server.

It has an error when trying to connect that says something about not being able to load userdata or something

Also, yes, the module was added to the script with LoadModule("lu_mysql");
I remember on the server I'm helping to develop, Stormeus ran across that issue with SQLite too. I think it's a script or database error, if I remember correctly, although I'm not sure how he fixed it.

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: MySQL Plugin for LU?
« Reply #9 on: September 21, 2011, 07:55:41 pm »
I tried to use this plugin, but it doesn't let me connect to the MySQL server.

It has an error when trying to connect that says something about not being able to load userdata or something

Also, yes, the module was added to the script with LoadModule("lu_mysql");


Try compiling the module on the server machine. That worked for me.
Your errors basically means it failed to load the module.
You could also try print( LoadModule("lu_mysql") ); to see if that returns false.

Vortrex

  • Guest
Re: MySQL Plugin for LU?
« Reply #10 on: September 21, 2011, 09:07:59 pm »
How would I compile this in Ubuntu Linux (Server Edition)

Vortrex

  • Guest
Re: MySQL Plugin for LU?
« Reply #11 on: September 22, 2011, 12:53:02 am »
Sorry for the double post, but I couldn't find an "Edit" button anywhere ... I tried the print() to see if it loaded, and it returns 'true', so I know its loading ... Connecting to the database is the problem ... what are the parameters for mysql_connect?

John_Michael

  • Guest
Re: MySQL Plugin for LU?
« Reply #12 on: September 22, 2011, 12:55:46 am »
Browsing the source code, I see:

Code: [Select]
_SQUIRRELDEF( SQ_mysql_connect )
{
        const SQChar* szServer = NULL;
        const SQChar* szUser = NULL;
        const SQChar* szPass = NULL;
        const SQChar* szDatabase = NULL;

I'm gussing its database <- mysql_connect(server, user, pass, database[, port]);

Vortrex

  • Guest
Re: MySQL Plugin for LU?
« Reply #13 on: September 22, 2011, 12:58:37 am »
Yeah, I tried that, with and without the port, but I keep getting the

AN ERROR HAS OCCURED [getVarInfo: Could not retrieve UserData]

The line number in the console points to the line where it tries to connect with mysql_connect

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: MySQL Plugin for LU?
« Reply #14 on: September 24, 2011, 11:28:43 am »
Are you using any variables in your connect statement? That could be the problem.
And you can compile it by downloading the source code to your machine and use the command "make" in the lu_mysql folder.

 

© Liberty Unleashed Team.