47 Commits

Author SHA1 Message Date
Jordan Irwin
d35d7086a4 Update config file after pruning at startup 2021-08-27 17:30:11 -07:00
Jordan Irwin
a60e5578ea Add debug log level 2021-08-27 12:21:36 -07:00
Jordan Irwin
25e0021cd0 Add "server_shop" chat command to reload shops configuration 2021-08-17 06:19:16 -07:00
Jordan Irwin
ba2a9b063d Add method for loading shops config & use wdata for read/write 2021-08-17 05:17:19 -07:00
Jordan Irwin
a24764369e Use single node for both seller & buyer shops...
Function is determined by shop definition.

Also:
- "get_currencies", "get_shops", & "get_shop" return table copy
- added methods "server_shop.unregister" & "server_shop.shop_type"
2021-08-15 21:13:35 -07:00
Jordan Irwin
f1dca8c9b3 Use core.register_on_mods_loaded for shops cleanup 2021-07-08 20:00:43 -07:00
Jordan Irwin
dab0e1c349 Minor change to log method 2021-06-10 19:04:07 -07:00
Jordan Irwin
4bd54ac577 Remove FIXME note 2021-06-10 17:51:35 -07:00
Jordan Irwin
059750b6d1 Rename shop.def attribute to shop.products 2021-06-10 17:48:45 -07:00
Jordan Irwin
a0baaf2f7b Allow "value" to be used instead of "currencies" in server_shops.json 2021-06-10 17:32:38 -07:00
Jordan Irwin
868626401b multiple currencies can be registered in server_shops.json with "currencies" key 2021-06-10 17:14:23 -07:00
Jordan Irwin
6795e1aaa4 output warning if no item registered with currency value 1 2021-06-10 17:01:40 -07:00
Jordan Irwin
84a7dba152 Prune aliases & replace with actual item names after server start 2021-06-10 16:55:52 -07:00
Jordan Irwin
a413d95504 Prune items without values from shops after server start 2021-06-10 16:42:32 -07:00
Jordan Irwin
df4969c6c5 Check for registered currencies before trying to give refund 2021-06-10 15:06:36 -07:00
Jordan Irwin
034c153c24 Prune unregistered items after server startup 2021-06-02 02:01:59 -07:00
Jordan Irwin
36ff25bdb3 Add buyer shops 2021-05-14 13:16:48 -07:00
Jordan Irwin
8e6a940544 Make json data is not empty 2021-05-14 08:12:24 -07:00
Jordan Irwin
ef85f4c827 Add setting to enable automatically setting default values for currency mod if available 2021-05-12 22:09:00 -07:00
Jordan Irwin
2e04535312 Don't use node meta for formspec so players cannot...
...interfere with others' transactions.

FIXME: deposits are broken
2021-05-12 17:45:04 -07:00
Jordan Irwin
de1a7e5186 Displayed currency suffix can be customized or omitted 2021-05-12 14:40:50 -07:00
Jordan Irwin
48bfea4aef Clean up loading world shops file checks 2021-05-12 14:32:43 -07:00
Jordan Irwin
108891d39c World "server_shops.json" format changed:
- "sells" keyword changed to "products"
- added required "type" keyword can be:
  - "currency" to register new currency
  - "sell" to register new seller shop
- currencies can be registered using "currency" type:
  - subkeys are "name" (string) & "value" (number)
2021-05-12 13:47:40 -07:00
Jordan Irwin
685ea74e60 Change json keyword from "products" to "sells" 2021-05-10 18:09:30 -07:00
Jordan Irwin
379eaf9751 Use json format for shops config file in world directory 2021-05-10 17:51:33 -07:00
Jordan Irwin
8b504ad5b2 Add a localized logging method 2021-05-10 16:51:03 -07:00
Jordan Irwin
9502fef42a Segregate code 2021-05-03 18:30:30 -07:00
Jordan Irwin
c666877143 Show preview image of selected item 2021-04-29 04:37:00 -07:00
Jordan Irwin
d9cf7afb7d Add close button 2021-04-29 03:00:20 -07:00
Jordan Irwin
6dac41cfed Change drawtype to "normal" until mesh can be figured out 2021-04-29 02:47:30 -07:00
Jordan Irwin
27a921a5e8 Only allow players with "server" priv to alter shop ID 2021-04-27 15:41:18 -07:00
Jordan Irwin
1a2bd59a3e Add some Lua documentation 2021-04-27 15:19:28 -07:00
Jordan Irwin
1b47581a65 Keep formspec open when "Enter" key pressed 2021-04-27 14:29:58 -07:00
Jordan Irwin
38fb13c46f Display shop name at top of formspec 2021-04-27 14:07:46 -07:00
Jordan Irwin
2cbc07da07 Show shop name when player points at node 2021-04-27 13:53:01 -07:00
Jordan Irwin
ad0f42aa2b Players with "server" priv can manage & dig shops 2021-04-27 13:40:52 -07:00
Jordan Irwin
4c0da56fcc Implement functional transactions 2021-04-27 12:18:12 -07:00
Jordan Irwin
c64abaa4a9 Very minor optimization 2021-04-27 10:43:17 -07:00
Jordan Irwin
c1fd136030 Store selected index in meta data 2021-04-27 10:42:51 -07:00
Jordan Irwin
563607730b Minor change to displayed item string 2021-04-27 10:39:46 -07:00
Jordan Irwin
a104b71dee Set formspec on construction 2021-04-27 10:33:44 -07:00
Jordan Irwin
de10b4239b Load file in world directory for configuring shops 2021-04-27 07:31:27 -07:00
Jordan Irwin
648704c277 Make register_shop global function 2021-04-27 07:12:18 -07:00
Jordan Irwin
704bbb8a20 Don't show owner when targeting node 2021-04-27 07:03:30 -07:00
Jordan Irwin
fe470304c1 Make depositing & refunding money functional 2021-04-27 06:59:41 -07:00
Jordan Irwin
b4fc0ef65d Make shop 2 nodes high 2021-04-26 05:33:38 -07:00
Jordan Irwin
576bde30b7 Initial commit 2021-04-26 03:49:51 -07:00