ValentinFunk / LibK

Library for fast gmod addon development
MIT License
53 stars 21 forks source link

Fix database to tmysql #6

Closed comedinha closed 8 years ago

comedinha commented 8 years ago

The DB.MySQLDB is read by DB.Query(v[1], v[2]) and is configured on final of script... This change fix the error:

[ERROR] addons/libk/lua/libk/server/sv_libk_database.lua:257: attempt to index field 'MySQLDB' (a nil value)
  1. prepareForSQL - addons/libk/lua/libk/server/sv_libk_database.lua:257
   2. findAllDbByField - addons/libk/lua/libk/server/sv_libk_model.lua:239
    3. findByUid - addons/libk/lua/libk/server/sv_libk_model.lua:550
     4. fn - addons/libk/lua/libk/server/sv_libk_player.lua:3
      5. unknown - addons/ulib/lua/ulib/shared/hook.lua:110

and fix errors on line 108

I use tmysql with wrapper of mysqloo https://github.com/blackawps/gm_tmysql4

ValentinFunk commented 8 years ago

Does this also work with the standard mysqloo? (was that tested by you?)

comedinha commented 8 years ago

I close it because i not have tested and tmysql give others errors and crash the server...

errors found:

L 12/09/2015 - 22:00:35: Lua Error: 
[ERROR] addons/ulib/lua/ulib/shared/hook.lua:110: addons/libk/lua/libk/server/sv_libk_model.lua:661: attempt to concatenate local 'value' (a nil value)
  1. fn - [C]:-1
   2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110

[ERROR] addons/libk/lua/libk/server/sv_libk_player.lua:3: attempt to index field 'Player' (a nil value)
  1. fn - addons/libk/lua/libk/server/sv_libk_player.lua:3
   2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110

[ERROR] addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_wallet.lua:61: attempt to call field 'isProperNumber' (a nil value)
  1. addToPlayerWallet - addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_wallet.lua:61
   2. PS2_AddStandardPoints - addons/pointshop2/lua/ps2/server/sv_playerextension.lua:13
    3. fn - addons/pointshop2/lua/ps2/modules/ttt_integration/sv_ttthooks.lua:117
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:110
      5. FireBullets - [C]:-1
       6. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:318
        7. PrimaryAttack - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:242
         8. oldprimary - addons/ttt_weapons/lua/weapons/weapon_ttt_awp.lua:83
          9. unknown - addons/tttdamagelogs-master/lua/damagelogs/sv_damageinfos.lua:54

[ERROR] addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_shop.lua:21: attempt to call field 'SetBlocking' (a nil value)
  1. s - addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_shop.lua:21
   2. succ - addons/libk/lua/libk/shared/1_sh_promises.lua:48
    3. Done - addons/libk/lua/libk/shared/1_sh_promises.lua:116
     4. Then - addons/libk/lua/libk/shared/1_sh_promises.lua:107
      5. unknown - addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_shop.lua:50
       6. s - addons/libk/lua/libk/server/sv_libk_basecontroller.lua:88
        7. succ - addons/libk/lua/libk/shared/1_sh_promises.lua:48
         8. Done - addons/libk/lua/libk/shared/1_sh_promises.lua:116
          9. Then - addons/libk/lua/libk/shared/1_sh_promises.lua:107
           10. func - addons/libk/lua/libk/server/sv_libk_basecontroller.lua:68
            11. unknown - lua/includes/extensions/net.lua:32

[ERROR] addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_settings.lua:83: attempt to index field 'von' (a nil value)
  1. requestHandler - addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_settings.lua:83
   2. HandleTransferRequest - addons/libk/lua/libk/3rdparty/glib/transfers/transfers.lua:128
    3. func - addons/libk/lua/libk/3rdparty/glib/transfers/transfers.lua:158
     4. unknown - lua/includes/extensions/net.lua:32

L 12/09/2015 - 22:00:35: Lua Error: No value given for Pointshop2.AchievementsModel, field count
L 12/09/2015 - 22:00:35: Lua Error: 
[ERROR] addons/ulib/lua/ulib/shared/hook.lua:110: addons/libk/lua/libk/server/sv_libk_model.lua:661: attempt to concatenate local 'value' (a nil value)
  1. fn - [C]:-1
   2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110

[ERROR] addons/ps2_extras/lua/ps2/modules/ach_integration/sv_achievements.lua:45: Invalid argument #2 to Pointshop2.AchievementsModel:findAllDbByField( field, value ), value expected, got nil
  1. error - [C]:-1
   2. findAllByOwnerId - addons/libk/lua/libk/server/sv_libk_model.lua:233
    3. LoadAchievements - addons/ps2_extras/lua/ps2/modules/ach_integration/sv_achievements.lua:45
     4. UpdateAchievement - addons/ps2_extras/lua/ps2/modules/ach_integration/sv_achievements.lua:99
      5. fn - addons/ps2_extras/lua/ps2_achievements/timer/1440minutes.lua:20
       6. unknown - addons/ulib/lua/ulib/shared/hook.lua:110