Pointshop2 icon indicating copy to clipboard operation
Pointshop2 copied to clipboard

Error

Open Zulbem opened this issue 4 years ago • 1 comments

Hello Kamshak! Hope everything is well. I've been receiving this error that I've been ignoring for a few months until now really, tried to look into it but I don't really understand where the issue is occurring, would you be able to look into this, please? It happens sometimes when players disconnect (not enough time to set data?)

WARNIG: uncaught error in Promise: Disconnected
1: (_ = GLib.PlayerMonitor, ply = Entity (6) --[[ STEAM_0:0:167648998, Russell ]], userId = "STEAM_0:0:167648998") [addons/pointshop2/lua/ps2/server/sv_pointshopcontroller_shop.lua: 18]
2: xpcall (GLib.Error) [[C]: -1]
3: DispatchEvent (self = { GLib.EventProvider: 0xf16b6630 }, eventName = "PlayerDisconnected", GLib.PlayerMonitor, Entity (6) --[[ STEAM_0:0:167648998, Russell ]], "STEAM_0:0:167648998") [addons/libk/lua/libk/3rdparty/glib/events/eventprovider.lua: 86]
4: fn (data = { table: 0xf0ce07a8 }) [addons/libk/lua/libk/3rdparty/glib/garrysmod/servers/playermonitor.lua: 60]
5: (name = "player_disconnect", gm = _R._LOADED.team:GAMEMODE, { table: 0xf0ce07a8 }) [addons/ulib/lua/ulib/shared/hook.lua: 109]
Server Broadcast: Bye, Russell!
Dropped Russell from server (Disconnect by user.)
[21:57:17] Atzul unboxed 10,000 Points
[ERROR] addons/pointshop2/lua/ps2/server/sv_pointshopcontroller.lua:64: Invalid argument #2 to KInventory.Inventory:findAllDbByField( field, value ), value expected, got nil
1. error - [C]:-1
2. findByOwnerId - addons/libk/lua/libk/server/sv_libk_model.lua:549
3. initializeInventory - addons/pointshop2/lua/ps2/server/sv_pointshopcontroller.lua:64
4. unknown - addons/pointshop2/lua/ps2/server/sv_pointshopcontroller.lua:313
Timer Failed! [Simple][@addons/pointshop2/lua/ps2/server/sv_pointshopcontroller.lua (line 312)]

Zulbem avatar Apr 09 '20 22:04 Zulbem

Hey, you can safey ignore this I think, there's a "PlayerMonitor" that should watch for disconnects and clean up the loading but seems something is wrong there I think it's here: https://github.com/Kamshak/Pointshop2/blob/ef748dda9a2265a2080c617b850ef251025b56fd/lua/ps2/server/sv_pointshopcontroller_shop.lua#L15

One thing i could think of is there is a two second timere here: https://github.com/Kamshak/Pointshop2/blob/ef748dda9a2265a2080c617b850ef251025b56fd/lua/ps2/server/sv_pointshopcontroller.lua#L317 maybe check inside of that function if the player is still valid. I forgot how to do that in Lua but it should probably fix the error

ValentinFunk avatar Jun 23 '20 19:06 ValentinFunk