Jump to content

TheSim:QueryServer and non GET request support?


Recommended Posts

Does anyone know if TheSim:QueryServer() supports anything but GET requests? Every example of it I can find in data/scripts has "GET" being passed to it as the final arg. I've tried, calling it with PUT, PATCH, DELETE, and POST, but it seems to ignore this param and just do a GET request anyway, including defaulting to GET if the argument is missing.

I was hoping to use a rest-ish API for doing things, but if I can't do deletes, I guess I'll have to do everything via GETs and stick things like /resources/delete/:id in the url, which isn't what I want, but I suppose if there's no other option I'll deal with it.

Link to comment
Share on other sites

I don't see an edit option.. so second question also about SimLuaProxy::QueryServer()  is there anyway to get it to not spam the log every time it's called? I'm currently polling an API to fetch command data every 5 seconds, but I end up with a lot spam I'd rather not have going to the logs. :(

For example, the following, times hundreds: 

  • forest [00:05:27]: SimLuaProxy::QueryServer()
    forest [00:05:32]: SimLuaProxy::QueryServer()
    forest [00:05:37]: SimLuaProxy::QueryServer()

     

Link to comment
Share on other sites

23 hours ago, AL said:

I don't see an edit option.. so second question also about SimLuaProxy::QueryServer()  is there anyway to get it to not spam the log every time it's called? I'm currently polling an API to fetch command data every 5 seconds, but I end up with a lot spam I'd rather not have going to the logs. :(

SimLuaProxy::QueryServer calls cLoggerImplementation::Log right at the start of the function in C++ land.

So unless you patch that out in your server's binary it's going to stick to logging.

Link to comment
Share on other sites

21 hours ago, CarlZalph said:

SimLuaProxy::QueryServer calls cLoggerImplementation::Log right at the start of the function in C++ land.

So unless you patch that out in your server's binary it's going to stick to logging.

I figured it was in the c binary. :( patching it out would be fine for me, but I'd like to distribute what I'm doing and I don't think it's a good idea to ask people to go fiddling with binaries, and I doubt Klei would applicate it either.  Ah well, I guess spammy log it is, thanks for the response!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...