1. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    Some of the Web Admin features have been rolled out in the latest patch. I didn't include the info on the patch release notes because it's still a work in progress. You can turn on the web admin feature in the HostileAccess.ini file. It requires that you set a user name and password and set the enable flag. Here's an example:
    Code:
    [HostileGame.MNCWebAdmin]
    WebAdminUsername=bozoTheClown
    WebAdminPassword=asdf1234
    WebAdminPort=8080
    bWebAdminEnabled=true
    bDebugLog=false
    
    When the game boots it will listen on port 8080 (or whatever you set it to) for simple REST like web requests. You can find the API doc, which will continue to be updated as I add new features, in the Monday Night Combat folder under Binaries\WebAdminSample.

    Right now just some basic commands are supported: PlayerList, PlayerDetails, ChatHistory, SendChat, Console, Kick, KickBan, ListBans, Unban

    All responses are in JSON. Note some commands don't return anything at the moment. That'll change in the future so responses can be handled more uniformly.

    I'm not a web developer so my sample web admin "app" is really just an API tester. It's located in the same WebAdminSample directory and is named "WebAdminAPITest.html". You can use this to do basic communication with your server, but is mostly there to serve as a guide for people to write cool web apps. Hopefully someone out there will pick up the ball and run with it. I'll continue working to improve the back-end as well as other admin features like reserved slots, etc.
  2. Col_Jessep

    Col_Jessep Moderator Alumni

    Messages:
    4,227
    Likes Received:
    257
    Nice!
    To save you guys the search:
    Steam\steamapps\common\monday night combat\Binaries\WebAdminAPITest.html
  3. Bakey

    Bakey New Member

    Messages:
    115
    Likes Received:
    0
    I'll be testing this thoroughly as soon as I can get Gameservers.com to either open up port 8080 or give me a list of open ports I can have this listen on.


    If you set the debug log to true, where does it dump log files?
  4. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    Setting bDebugLog to true just causes it to print out more spam in the regular log file. It prints the details of the URL request you made as well as the JSON text it's sending back.
  5. shadoom

    shadoom New Member

    Messages:
    3
    Likes Received:
    0
    after logging in with the specified user/pw
    i get a


    Error 400: Bad Request
    Unknown Command []


    Tried several different
    ports, usernames and passwords

    no changes
  6. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    Are you trying to connect directly to the server with your browser or are you using my WebAdminAPITest.html file? It's a web service so you can't just go there with your browser and expect to get anything meaningful out of it. This service is meant for applications to interact with to perform admin commands on the server.
  7. shadoom

    shadoom New Member

    Messages:
    3
    Likes Received:
    0
    Ah okay, my apologies.


    Sorry
  8. Llamatron

    Llamatron New Member

    Messages:
    133
    Likes Received:
    0
    either I didn't understand how to use the time parameter ( ip:port/chathistory?time=integer is what I've been doing), or the chat always come in empty, tried with 0 to get all chat history, or with a value in seconds but without luck, always getting an object with an empty array: {ChatHistory:[]}
  9. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    Time=0 should work fine. This definitely would return empty if nobody had chatted on the server .... are you sure you've chatted before? :)

    I'll look into it on my side to see if there's anything wonky going on, but last I tested it worked fine.
  10. Llamatron

    Llamatron New Member

    Messages:
    133
    Likes Received:
    0
    Yup 100% sure some people chatted on the server, I tried doing the request with java and with firefox by typing the request in the adress bar, getting the same result with both.
  11. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    I tested it yesterday and confirmed it's broken. It's fixed in the next patch (coming very soon).
  12. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    BTW, if you're working on a web app don't hesitate posting feature requests here. My goal was to get the very basics in there working as quickly as possible. The advanced stuff will be done more on an as requested basis since we want to make sure we're doing want the community wants, and not what we think they want :)
  13. Llamatron

    Llamatron New Member

    Messages:
    133
    Likes Received:
    0
    Honestly I just took the occasion of this api to start learning Java, so it's gonna probably end being a small program to monitor a server and perform a few actions. So far most of the api commands are covered with a basic UI, but I'm quite a noob at coding so it progresses slowly.

    I tried to fiddle a bit with ajax but it didn't work at all, even the api example you provided, it displays the command with the right server adress:port/request, I get an authentification request, and then nothing, but if I copy the request in the adress bar I get the JSON file.

    Some suggestions I could think of would be a way for the server to send data by himself, like for example sending the match's stats on a website when a match ends. Also the possibility to allow some stats to be fetched without identification, or with another identification than the one able to kick/ban so you don't have to give full access to someone to allow him to get trivial data like number of players on the server for example.

    Another slightly related thing I have been wondering is if there would be a way to access the master server list for other apps? Because I'd definitely be interested in making a server browser to see if there's people playing on the servers with rule sets I like without having to launch the game.

    EDIT: ha, and a list of what the stuff like "playerstat2" is, so people don't spend too much time trying to figure what is what.
  14. Col_Jessep

    Col_Jessep Moderator Alumni

    Messages:
    4,227
    Likes Received:
    257
    That's a great idea!

    Great server you are running Llama, thank you! Highlander and no team stacking FTW!
  15. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    just a a headups, there seems to be an issue with IE9 and this webadmin. Logging into the webadmin does not work o IE9. so if your wondering why can't login, switch browser ;)
  16. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    That's a great idea!

    Good idea, maybe the devs need to put in a guest account in the webadmin for external applications to login to. with read only rights only.
  17. Llamatron

    Llamatron New Member

    Messages:
    133
    Likes Received:
    0
    I wonder if there's not a problem with the authentication, I couldn't get python to authenticate at all.

    Another suggestion: it would be probably nice if it was possible to specify extra infos to be added to a playerlist request, for now we have only the name and steam ID, but it would be awesome to be able to have for example kills, assists and deaths with that request instead of having to do a request for full details on each player, something in the lines of /playerlist/kills/assists/deaths for example.

    btw racq, after struggling for an afternoon with UDP, eventually I came across https://github.com/koraktor/steam-condenser and felt very dumb!

    edit: also I couldn't test the console command, got an example of some command that should produce a non blank answer?
  18. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    :mrgreen: offtopic: Llamatron, ill be sending you a revision of the code i made yesterday, turns out it wasn't listing all the MNC server. it now lists all servers returned by the master server, all 463 of them. serverlist webpage is under development now :)
  19. Bakey

    Bakey New Member

    Messages:
    115
    Likes Received:
    0
    Llamatron and racquemis, can you guys post the code/apps you've got on Sourceforge or somewhere so the rest of us don't have to reinvent the wheel?

    That'd be awesome. :mrgreen:
  20. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    I'm using digest access authentication right now. Make sure your python library supports that. My plan is to have both an authenticated path and unauthenticated so read only commands don't need to be logged in.

    It's been a while since I've tested in IE9 but last I checked it worked. I do most of my testing in Chrome followed by Firefox.

    I went with digest access authentication because I assumed security is a concern for admins. If this is not the case, please let me know. For example if the most common usage pattern is for the admin port to only be opened to the local machine (for remoting in) and not accessible from the outside, that would probably make this security method overkill. Unreal had no secure authentication methods so I had to put this in myself (using mongoose embedded server for the time being, subject to change.)

    As for Console commands, they process but in many cases don't return any useful info. And for some reason not all commands are working as I would have thought. I'm looking into it. You can verify that they do indeed work by just using "exit" to shut down the server.

Share This Page