Commit graph

65 commits

Author SHA1 Message Date
afb4fd2d4d Replace boost::optional with std::optional 2020-08-15 01:45:35 +01:00
29f11d3f57 Extract strings from functions because they are too verbose and drive me crazy 2020-08-14 22:27:01 +01:00
d4fd25b151 Add shop snapshots table
It contains the snapshot of each shop and a unique hash.
This is not complete yet, running this update twice will
just corrupt the table.
2020-08-14 19:48:14 +01:00
3262ce8d25 Fix wrong hash string sometimes 2020-08-14 19:46:09 +01:00
7e48ee94c2 Organise files into a private subdir.
Move files that are not supposed to be used directly to
get oro functionalities into a private subdirectory.
2020-08-14 18:58:47 +01:00
33fe2bc8cd Add tiger. It depends on duckhandy, so add that too. 2020-08-14 00:46:36 +01:00
d1af39d2a7 Make sure NDEBUG is defined in release, plus variable rename 2020-08-14 00:44:20 +01:00
80ef2afbee Same treatment as items table, don't drop/re-create
This works in a much simpler way than the items table.
Here we just upsert new values, with the unique constraint
on the internal item_id (not the upstream one, which is
never entered into this table).
This should mean that if an item from the items table with
eg: item_id=501,id=9 gets marked as deleted and re-entered as
item_id=501,id=5000, then icon with item_id=9 should remain
in the table (there is no delete ever), and a new one with
item_id=5000 gets added. Originally they both referred to
item 501 and they still do, but because of how the items
table now works, icons should also benefit and historical
data should remain in the face of upstream changes.
2020-08-12 01:33:13 +01:00
326914f92a Add example file that's been there forever 2020-08-12 01:07:45 +01:00
1b5e1f4365 Improve sql for items table
Now if item_id or unique_name change, that counts as a record
being deleted and a new one inserted.
If neither of that changed but any other field did, the old
field gets updated with the new value.
2020-08-12 01:07:34 +01:00
4dd78099f1 Add TimerCreators 2020-08-12 01:04:28 +01:00
182e2148ac Reduce initial timer delays
This is test code anyways
2020-08-12 01:04:16 +01:00
ef39dee43e Fix issue with items table; enable foreign key constraints
Program receives the full items list periodically. I don't think
they will ever remove records from there, but if they do the
program should not corruct the db. So far the simple approach
drop table items/create table items ensured the items list is
always fresh, but it prevented foreign key constraints on shop
items. Also, if an item was removed from items, any entry in
shop would become orphaned or worse point to the wrong item if
they recycled the id. Solution is to not use item_id at all for
the relationship between shop items and items table, instead
have my own internal id that is valid forever. Now records
removed upstream get just marked as deleted (by adding a removal
timestamp). The same item_id can be reused since the unique part
now must be (item_id, removal_date), in other words there is only
one non-deleted item_id, but there can be several deleted ones.

Code stores the full items set into items_staging, marks records
in items but not in items_staging as deleted, then adds any
missing records to items from items_staging, then drops items_staging.
2020-08-12 00:07:22 +01:00
cb500fd67c Add TimerCreators 2020-08-11 02:10:43 +01:00
ebc16986e8 I don't know why this thing changed, blame SoapUI 2020-08-11 01:33:36 +01:00
3866462ff5 Add worker_threads setting 2020-08-11 01:33:11 +01:00
d0a41d916a Return some default db name if not present in the config file 2020-08-11 01:04:53 +01:00
bc0de0cf8b Populate slotted_cards table
It contains the list of cards inserted into the
slots of the items in the shop_items table

I can't enable the foreign key on card_id because
the items table gets razed periodically - need
to find a solution to this
2020-08-10 23:40:05 +01:00
b76a2f22a4 Populate shop_items table 2020-08-10 23:17:17 +01:00
bf055b5b87 Rename property 2020-08-10 23:15:25 +01:00
a930622569 Add more timestamp conversion functions to dateconv.hpp 2020-08-10 22:17:42 +01:00
616ac36a34 Populate the shops table 2020-08-10 21:52:56 +01:00
417030f4fe Parse the YYYY-MM-DDTHH:MM:SSZ dates correctly
Dates in the json reply seem to come in two different formats.
One is the reply timestamp, second one is the actual
content (for example shop opening dates)
2020-08-10 21:52:56 +01:00
9bb2efb2ee Rename TimerGeneric to TimerOroApi
It's not *that* generic, it's really meant
to only work with oro::Api methods
2020-08-10 21:52:56 +01:00
5bf036f056 Replace timers with a templated one
They all do the same thing, the only difference
is the method they call on oro::Api, so
template on that
2020-08-10 21:52:56 +01:00
4b3d88b2f0 Move more crap to the base class 2020-08-10 21:52:56 +01:00
c1e21bb8d6 Add TimerShops 2020-08-10 21:52:56 +01:00
9f4a5baebb Store icons into their own separate table 2020-08-10 21:52:56 +01:00
8d6b282862 Update submodules 2020-08-10 21:52:56 +01:00
35118dbe4e Get db path from settings file instead of using a hardcoded value 2020-08-10 13:21:04 +01:00
c05213d576 Remove config_file option 2020-08-10 12:44:54 +01:00
2a4fe62427 Add ini file parser from kamokan and meson option for config path 2020-08-10 12:24:39 +01:00
2717817958 Attach GPL3+ licence 2020-08-10 11:22:25 +01:00
ab8f8b1533 I don't think I need transactions for those 2020-08-10 10:18:15 +01:00
5bc151a3ec Refactor timer code
No need to copy-paste that much stuff, especially since
there are going to be more timer types in the future.
2020-08-10 03:01:54 +01:00
53ba7febf4 This stuff doesn't need to be in oro 2020-08-10 02:47:55 +01:00
eeab1d5c5e Add base64 decoding function 2020-08-10 02:35:27 +01:00
6b9502ea3e Store items and icons into the db 2020-08-10 02:34:09 +01:00
f2b8abf82b Disable console output from restc-cpp 2020-08-09 22:55:25 +01:00
8fa434e76e Timer queries the remote api 2020-08-09 21:07:54 +01:00
c0461f6b09 More refactoring 2020-08-09 20:47:04 +01:00
73ec4446ea Add support for long timeouts in timers 2020-08-09 20:32:25 +01:00
034020e152 Remove thread pool selection code for now 2020-08-09 20:04:22 +01:00
9df60f074b Rename classes 2020-08-09 19:28:39 +01:00
7fb055cd40 Refactor event code.
This splits the thread pool code from the event code, and
class names are now wrong (I will update them in the next
commit). Also, this disregards the roar11 vs tf library
thing, taskflow was not working anyways and I will probably
remove all the conditional compilation stuff about it for
now.
2020-08-09 19:26:18 +01:00
9f0fed98e2 Get the concept working
A bit hackish because see ThreadPool.hpp.
Also code is dirty and it can't be stopped once running.
Building up from here.
2020-08-09 17:29:37 +01:00
399f60190f Make methods noexcept where necessary 2020-08-09 17:28:31 +01:00
f6cc2ff951 Import roar11's thread pool
See https://roar11.com/2016/01/a-platform-independent-thread-pool-using-c14/
2020-08-09 17:25:33 +01:00
fb69fd2289 Split html timed fetch into 2 classes
Signed-off-by: King_DuckZ <king_duckz@gmx.com>
2020-08-01 07:24:45 +02:00
3ab4f916d8 Add sample responses as received by the origins server 2020-08-01 07:05:27 +02:00