Lexicality / applejack

The private version of Applejack with loads of improvements and stuff (Side note - this has nothing to do with ponies)
4 stars 1 forks source link

MySQLOO Connection Issue #92

Open A-ce opened 1 year ago

A-ce commented 1 year ago

Was given these errors after entering the correct details for my database in sv_database, the database was setup properly from what I'm aware although the files came without one so I assumed it would create itself once the server's launched. The 'sv_config' file was nowhere to be seen so I took the one from the old release and replaced it which did solve the error, though both versions could be different. The overall issue is managing to connect to the database. Any support would be appreciated.

[ERROR] Couldn't include file 'sv_config.lua' - File not found (@gamemodes/applejack/gamemode/sh_init.lua (line 32))

  1. unknown - gamemodes/applejack/gamemode/sh_init.lua:32
    1. include - [C]:-1
    2. unknown - gamemodes/applejack/gamemode/init.lua:11

[ERROR] gamemodes/applejack/gamemode/libraries/sv_database.lua:87: bad argument #1 to 'connect' (string expected, got nil)

  1. connect - [C]:-1
    1. ConnectToDatabase - gamemodes/applejack/gamemode/libraries/sv_database.lua:87
    2. unknown - gamemodes/applejack/gamemode/init.lua:105
luttje commented 1 year ago

I would not expect this gamemode to run if I were you. However to help you with whatever I can:

I checked our old sv_config.lua for you and this is what it looked like in 2015:

--[[
    ~ Serverside Config ~
    ~ Applejack ~
--]]

GM.Config["MySQL Host"] = "localhost"; -- The host that your MySQL database is located.
GM.Config["MySQL Username"] = "username"; -- The username that you log into MySQL with.
GM.Config["MySQL Password"] = "xxx"; -- The password that you log into MySQL with.
GM.Config["MySQL Database"] = "ajack"; -- The name of the database that we'll be using.
GM.Config["MySQL Table"] = "players_ajack"; -- The name of the table where the player data is stored.

Looking at sv_database, configuring the db like that should still work fine.

The second error is caused by the first error, so configuring the above should at least cause other errors to occur which you can then fix.

But again: This is an old gamemode, it's unlikely to work.

A-ce commented 1 year ago

Managed to clear the errors and now upon joining I'm just stuck on the loading screen. Chances are it won't work but isn't this repository more recent than the original? It was receiving updates in 2020 which is pretty recent and the old Applejack has a separate repository. It says the connection to the database is valid but the loading screen seems to be an authentication issue, perhaps I'm using an outdated database? I could try commenting out the code and see if I can play after that. Appreciate the response by the way.

A-ce commented 1 year ago

[Thu May 4 21:33:53 2023][Errors] SQL Error loading "Ace"'s data: Unknown column 'data' in 'field list' [Thu May 4 21:34:23 2023][Errors] SQL Error loading "Ace"'s data: Unknown column 'data' in 'field list' [Thu May 4 21:34:53 2023][Errors] SQL Error loading "Ace"'s data: Unknown column 'data' in 'field list' [Thu May 4 21:35:23 2023][Errors] SQL Error loading "Ace"'s data: Unknown column 'data' in 'field list'

luttje commented 1 year ago

Managed to clear the errors and now upon joining I'm just stuck on the loading screen. Chances are it won't work but isn't this repository more recent than the original? It was receiving updates in 2020 which is pretty recent and the old Applejack has a separate repository. It says the connection to the database is valid but the loading screen seems to be an authentication issue, perhaps I'm using an outdated database? I could try commenting out the code and see if I can play after that. Appreciate the response by the way.

IIRC that was around the time Lexi was toying around with the gamemode. They could've left it in a "working on it"-state though. I don't remember.

I'll see if I have a version from before these changes. I'll get back to you here within a day if I do, otherwise no luck

A-ce commented 1 year ago

I see, I appreciate the response nonetheless and I'll be expecting a message if possible.

Lexicality commented 1 year ago

Two things. One, it looks like you've used the old database schema - don't do that. It should create its own database tables on startup. Two, I'm pretty sure this repository won't give you a stable working gamemode. It was my fuck-around repository and there's a lot of half finished rewrites in it. It might work, but I certainly wouldn't try to run it on a public server myself

A-ce commented 1 year ago

Recreating the database and allowing the server to create the tables itself solved the issue.

A-ce commented 1 year ago

Everything looks fine as of right now, thank you.

Lexicality commented 1 year ago

Incidentally if you're going to try and work on this, iirc one of the reasons I gave up was the lua reload system kept crashing the game attempting to deal with this hell gamemode. There is some seriously gnarly code in here because I literally learned to program over 15 years ago writing this gamemode and Conna for all his skill in designing gamemodes wrote some horrible code too.

Good luck, you're going to need it!

(FWIW last I checked there are multiple active pirated versions of Applejack out in the wild, you might have better luck if you can find one)