Closed JustinSGD closed 3 years ago
Hey, can you clarify a little bit about what you're expecting to happen and what's not working?
At first glance, your project looks like a standard Maven project structure, so w/the config.json
in src/main/resources
you should be able to load it with Orianna.loadConfiguration("config.json");
. If that's not working, I'd open up the .jar
you're producing and make sure config.json
is getting packaged in the root of the jar.
If you'd prefer that the configuration get picked up automatically, rather than needing to add the loadConfiguration
line of code, you can set the ORIANNA_CONFIGURATION_PATH
environment variable to point at your config.json
and Orianna will pick it up automatically when initializing.
In the screenshot you sent, it looks like you're configuring your API key, region, and locale, then loading a configuration after. Keep in mind that loadConfiguration
fully overwrites any existing configuration of Orianna, so the programmatic settings you've changed before loading the config.json
won't be kept. The configuration system isn't designed to mix both programmatic and JSON based configuration, so I'd suggest sticking with just one of them.
On a side note, you should regenerate your API key on the Riot developer portal, as it's visible in the screenshot for anyone to steal.
Let me know if this info helps with your issue, or if not can you add more details about what you're doing and why the results aren't what you expect?
I have compiled the jar. The file is also included. However, the bot then no longer works as it should. That means your API is not working. https://prntscr.com/xa1sm6
Added Season 10 in your API pls :D
Can you send me the region and match ID for a match that returns Season 10? It looks to me like the API's still giving Season 9 back for everything rn. Can add it if I have an example match.
For the config problem, it does look like you've got things set up correctly based what I can tell from the screenshot, but I still need you to tell me what exactly is going wrong so I can help. Is it not loading your config at all and just using the default config?
The default config is not loading. After that, nothing works anymore.
Is there an error message getting dumped associated with it & do you have logging enabled?
There is no error message when starting the bot. https://prntscr.com/xbc0to If I then do something with the API, nothing happens and there is no error or other message.
Could you try adding an SLF4J logging implementation to your dependencies and see if there's any log output from Ori that might help track down the problem?
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
</dependency>
is quick & easy to add
How I can debug?
Try adding that dependency and running again to see if we can get any logs out of Ori - if it gives any output it'll help us get to the bottom of it. Otherwise if you can share the code for your project or create a minimal example that replicates the error I can take a look locally.
I am add you to project on GitHub.
Thank you it works!
For those keeping score at home the issue was loading the config using Orianna.loadConfiguration
after doing some programmatic configuration (setting the API key). This overwrites the programmatic configuration, so the API key was empty.
Hey, I want to change something in config.json. This is in my resources folder. However, it doesn't work as soon as I start the plugin. As soon as I hide it in my code it works. I hope you can help me. https://prnt.sc/x60fk0