Commit Graph
54 Commits
Author SHA1 Message Date
Hornwitser f1ac41bc4c Port fix researchSync updating researched technologies
Add check in filter_updated_techs that ignores already researched
technologies.

This is a port of b0eb188.
2019-12-11 02:14:00 +01:00
Hornwitser 2d3307c045 Remove unused binary option from plugin configs
Remove the unimplemented "binary" option from all plugin config files.
Setting this option to something other than "nodePackage" would
supposedly run a binary and feed it with the stdout of the factorio
proccess, but that was never implemented.
2019-11-30 00:08:10 +01:00
Hornwitser ff3fc3b94b Remove .js suffix in require paths
Remove the .js suffix in require paths to make requires consistent
across the project.
2019-10-28 19:45:34 +01:00
Hornwitser 5d24329456 Port fix crash in recount_cluster_research_progress
Check that the relevant research is present in the research mapping
before accessing it in recount_cluster_research_progress.

This is a port of 0cdb5d0.
2019-10-12 22:46:08 +02:00
Hornwitser 4eda983cf4 Port filter out lower levels when syncing research
Fix the next level of an infinite research getting updated with the
progress of the previous level from other nodes in the cluster by
filtering out infinite researches with a lower level than the local
level.

This is a port of 075d54f.
2019-10-12 22:45:43 +02:00
Hornwitser 7f82680511 Port set progress when completing infinite researches
Set the progress for the next level of an infinite research when
unlocking it via a script.  This is necessary when the research is
actively being researched  as Factorio will carry over the progress for
the current level into the next one when set via a script.

It's possible for the new progress to be non-zero if the next level was
on the research queue.

This is a port of 62f3a99.
2019-10-12 22:45:07 +02:00
Hornwitser 9098b3cf19 Port rename research to tech
Use tech as the loop variable for researches as this is consistent with
the rest of the researchSync module.

This is a port of 3b1ed1a
2019-10-12 22:44:13 +02:00
Hornwitser 183902ced3 Port fix incorrect property checks in researchSync
Fix naive checks for properties being set of the form obj[key] into the
proper form Object.hasOwnProperty.call(obj, key).  The reason for this
is that if the key has a value of a built-in property like 'constructor'
then a check of the form obj[key] will always return true even if that
property hasn't been set on the object.

This is a port of 6a6274e.
2019-10-12 22:43:27 +02:00
Hornwitser a63c341209 Move unit tests to test/ folder
Move unit tests for client, master, and the lib to test/ and move plugin
unit tests to <plugin dir>/test.
2019-09-14 14:49:52 +02:00
Hornwitser 98900e72dc Merge masterIP and masterPort into masterURL
Merge the masterIP and masterPort configuration entries into a single
masterURL entry.  Fixes the problem with connecting to an HTTPS version
of the master server and also makes it easier to host the master server
behind a reverse proxy.

This breaks all known code interfacing Clusterio.
2019-09-09 12:44:09 +02:00
Hornwitser 31298c7c1c Duct tape together researchSync tests
Add nock that responds to the requests the researchSync module makes
during the tests, and disable broken tests.
2019-09-04 14:59:25 +02:00
Hornwitser b191f7d831 Use instanceName in researchSync
Remove silly roundabout way to the get the current instance name.
2019-09-04 14:59:21 +02:00
Hornwitser f76c84c3f1 Move node_modules/_app/ into lib/ as a package (#190)
Move the contents of node_modules/_app into lib/ as there shouldn't be
any content in node_modules.  This directory is automatically managed
and pruned by npm.

Add lib/ as a local package in package.json, this allows scripts
everywhere to require it's content as "lib/path" instead of relying on
local paths.  This shadows the StdLib Node.js Bindings package, but I
could care less.

Change all requires with lib as a local path and _app to use just lib.
2019-08-04 15:52:36 +02:00
Sander Homan 042230dc2c Fix notifying about the same research being finished
This is just a bandaid to fix a symptom. The underlying cause is still there, but at least it shouldn't spam the players anymore.
2019-07-29 20:31:42 +02:00
Hornwitser 2714b09e5d Fix wrong argument order
Fix compression not applying because the order of the callback and
options arguments were swapped in the call to Needle.get for the
request_cluster_data function.
2019-07-26 18:51:16 +02:00
Godmave 008ea139c6 #add compression 2019-07-25 23:22:46 +02:00
TechnoStrife 2831c07000 Add logging to researchSync plugin 2019-07-17 23:21:57 +03:00
TechnoStrife d48a824a69 Fix researchSync that it counts progress only from techs on same level 2019-07-17 00:31:15 +03:00
TechnoStrife fec3cf5ddf Fix for migation to new researchSync version 2019-07-15 22:49:39 +03:00
TechnoStrife 93c210f0c7 Merge branch 'master' into spread_researching
# Conflicts:
#	sharedPlugins/researchSync/dumpResearch.lua
#	sharedPlugins/researchSync/index.js
2019-07-15 22:14:09 +03:00
TechnoStrife 251ec696a3 Fixes && debugging 2019-07-15 18:29:53 +03:00
TechnoStrife 98c6795f8f Make researchSync work for any research on any node 2019-07-15 00:46:21 +03:00
Arvids Godjuks 0b34f07954 Dump only enabled research (#164) 2019-07-14 17:48:20 +02:00
psihius 71870daaba Made so mass tech sync does not make sounds or messages, only notifies at the end 2019-07-14 15:00:55 +02:00
psihius b666a909ab Formatting and logging adjustments 2019-07-14 01:32:34 +02:00
psihius 0afe35b67c Updated research sync to handle infinite science and hopefully stop it from apply same research in a loop annoying everyone 2019-07-14 01:25:48 +02:00
TechnoStrife fa4c10dce2 Code refactor 2019-07-12 18:52:47 +03:00
Danielv123 20e66cbd40 Token auth in researchSync and UPSdisplay 2018-04-25 12:55:03 +02:00
Danielv123 8f2d22cbd8 Only wrote files on the server, might resolve some crashes 2018-04-21 08:05:40 +02:00
psihius bf9886d7ee Merge branch 'dev' of https://github.com/Danielv123/factorioClusterio into fork-dev 2018-04-19 23:33:27 +03:00
psihius 03511fc240 Hardened NaN checks, added file read delay for research-sync so factorio has time to finish writing to the file 2018-04-19 23:33:09 +03:00
Danielv123 0672004cbd researchSync: Partially fixed failing test (it still fails) 2018-04-19 17:51:46 +02:00
psihius ed9b4bbafa Changed research sync to work with /api/slaves so the instance can ignore it's own research tree and enhanced research enabling with proper messages and sound alert, added checks so we don't flip values that haven't changed 2018-04-19 18:29:05 +03:00
psihius 9a66542270 Fixed so local research is never disabled 2018-04-18 23:27:53 +03:00
psihius 1c8deea2dc Fixed research sync for levels and repeated execution 2018-04-18 10:38:44 +03:00
psihius 19913af056 Changed research transfer data from array to objects 2018-04-17 23:37:34 +03:00
psihius 718315849c Made sure data is converted to integers 2018-04-17 22:44:56 +03:00
psihius 1731426f49 Removed unnesecesary json parsing and adjusted the expression for better style 2018-04-17 22:07:18 +03:00
psihius bb06723918 Changed some research fields and added a check remoteResearch key existence 2018-04-17 21:48:34 +03:00
psihius 0edb4caff9 Typo fix 2018-04-17 14:26:09 +03:00
psihius c7cd922541 Updated research dump and enabling with a fix for infinite-research 2018-04-17 13:57:36 +03:00
Danielv123 cf7af19370 Don't send corrupt factorio file outputs to plugins 2018-04-16 06:43:22 +02:00
Danielv123 aeeb09a975 Fixed weird thing about rebinding 'this' 2018-04-15 21:15:58 +02:00
Danielv123 7915b71e10 typo 2018-04-15 21:07:49 +02:00
Danielv123 6bbd6b8717 researchSync: Fixed crash when master contact is lost 2018-04-14 11:17:38 +02:00
Danielv123 1d0d9765bd researchSync: Fixed importing research 2018-04-13 20:18:47 +02:00
Danielv123 c9bd26a01e researchSync: Fixed sending commands with newlines 2018-04-13 18:31:01 +02:00
Danielv123 f131a83103 moved isFactorioCommand, more tests, researchSync stability 2018-04-13 12:32:09 +02:00
Danielv123 181cb1179c Fixed stack size exceeded bug 2018-04-13 10:35:55 +02:00
Danielv123 c8f2a67845 researchSync: Tried to avoid errors when research doesn't exist 2018-04-12 07:49:40 +02:00