adamdburton / pointshop

PointShop is a shop system for Garry's Mod 13
http://pointshop.burt0n.net/
MIT License
69 stars 101 forks source link

Provider MySQL : Fallback doesn't working #171

Closed VickyFrenzy closed 9 years ago

VickyFrenzy commented 10 years ago

When my MySQL server is offline the fallback don't seem to work... Here is an error of the console :

[ERROR] addons/pointshop/lua/pointshop/providers/mysql.lua:61: attempt to call method 'GetFallback' (a nil value)
  1. GetData - addons/pointshop/lua/pointshop/providers/mysql.lua:61
   2. GetPlayerData - addons/pointshop/lua/pointshop/sv_init.lua:274
    3. PS_LoadData - addons/pointshop/lua/pointshop/sv_player_extension.lua:102
     4. unknown - addons/pointshop/lua/pointshop/sv_player_extension.lua:38

And in the game the PointShop doesn't work... (Buy and others) Screenshot in game

Here an extract of my mysql.lua (line 41-61) :

require('mysqloo')

local shouldmysql = false

local db = mysqloo.connect(mysql_hostname, mysql_username, mysql_password, mysql_database, mysql_port)

function db:onConnected()
    MsgN('PointShop MySQL: Connected!')
    shouldmysql = true
end

function db:onConnectionFailed(err)
    MsgN('PointShop MySQL: Connection Failed, please check your settings: ' .. err)
end

db:connect()

PROVIDER.Fallback = 'pdata'

function PROVIDER:GetData(ply, callback)
    if not shouldmysql then self:GetFallback():GetData(ply, callback) end

I normally have the latest version of PointShop. I added "PROVIDER.Fallback = 'pdata" to see if it would change anything but no. Something is missing? My fault? (I'm not very good at lua coding ...) How/where to configure it?

On Windows 8.1 and 7 - Customized PointShop (small changes)... Tell me if you want more information.

ghost commented 10 years ago

Nah, pointshop error. I have the same problem when testing and I forget to add access to my database. They'll get around to fixing it eventually. Or I will.

ghost commented 9 years ago

Yeah, I'm also recieving this problem

VickyFrenzy commented 9 years ago

981c83b removed the fallback thing.