-
Posts
6 -
Joined
Recent Profile Visitors
603 profile views
Epic's Achievements
-
Epic reacted to a post in a topic: Error: LoggedInElsewhere
-
Dr. McKay reacted to a post in a topic: Webpack can't find module './clientmetrics.json' - dynamically requiring file (w/ possible fix)
-
Epic reacted to a post in a topic: Webpack can't find module './clientmetrics.json' - dynamically requiring file (w/ possible fix)
-
Hey, I am currently working on an electron app which is relying on your 'steam-user' module, and am running into an issue with webpack when requiring the module. Error: Cannot find module './clientmetrics.json' The file in question is located under 'node_modules/steam-user/protobufs/generated' and get's required by the '_load.js' file (auto-generated by '../scripts/generate-protos.js') in the same directory. The issue with webpack is it is running in build-time and thus cannot handle dynamic variables - since the 'load' function ('_load.js') gets executed with the filename as parameter webpack cannot require the JSON files. I fixed it by editing the '_load.js' file and passing the required files as a paramter to the 'load' function: mergeObjects(Schema, load(require('./clientmetrics.json'))); //... same for all other files function load(filename){ return require('protobufjs').Root.fromJSON(filename); } I guess you would also need to edit the 'generate-protos.js' file under '../scripts': FS.readdirSync(__dirname + '/../protobufs').forEach((filename) => { if (!filename.match(/\.proto$/)) { return; } let filenameWithoutExtension = filename.replace('.proto', ''); let cmdLine = PBJS_COMMAND_LINE.replace(/%s/g, filenameWithoutExtension); console.log(cmdLine); ChildProcess.execSync(cmdLine); loader += `mergeObjects(Schema, load(require('./${filenameWithoutExtension}.json')));\n`; // FIX HERE let protoDefinition = require(Path.join(GENERATED_DIR, `${filenameWithoutExtension}.json`)); if (protoDefinition.nested) { FS.writeSync(typesFile, `///////////////////////////////////////////////\n// ${filenameWithoutExtension}.proto\n///////////////////////////////////////////////\n\n`); FS.writeSync(typesFile, writeTypedef(protoDefinition.nested)); } }); //load function: function load(filename) { return require('protobufjs').Root.fromJSON(filename); // FIX HERE } Don't know if there would be anything else to change - just skipped through the file. Do you think the fix is appropriate and could be implemented in your module? Or do you have another idea? Thanks in advance!
-
Epic changed their profile photo
-
Yeah, that's what I figured. I guess waiting for a request to complete would only be necessary for different items? I'll implement it and see if it takes considerably more time. Thanks, I really appreciate it!
-
Epic started following Storage units (limits) and def-/paintindices
-
Hey there, I've been working with storage units for the past 2 days via the 'globaloffensive' module and it is working like a charm! However there's a small problem: I would like to have a list (or something similar) with every item available for storage that matches the defindices and paintindices with actual item names. Unfortunately my Google search didn't yield any results. I was so desperate that I also jumped into the items_game.txt file under csgo/scripts/items with hopes of parsing this mess, but was grounded very fast. Can anyone help me out or point me in the right direction? On another note: Are there any rate limits if I just add/remove items to/from storage units? Only tested it with 15 items at a time (fetched the inventory once) on a bot and they were instantly added/removed. Thanks in advance! All the best and stay safe