Server hangs

Discussion in 'Monday Night Combat PC Dedicated Server Discussion' started by Vaynen, July 31, 2011.

  1. Vaynen

    Vaynen New Member

    Messages:
    9
    Likes Received:
    0
    Hi All,

    first off, thanks for all the info available in the threads here, it helped me setup a dedicated server with a lot of ease. Just read through the info here and it all works out! Awesome stuff!

    Ok, that said, I did encounter an issue I can't quite put my finger on. I am trying to make a webadmin tool for my dedicated server, building on the basic API example that is available for download here.

    I notice that when I ask for the ChatHistory (with ?time=0) during a match everything works ok, but when the map is completed and the server is transitioning the HostileLobby, and I ask for the ChatHistory at that very exact moment, I can see the server suddenly use 100% CPU and become non-responsive. All players are eventually kicked back to the menu and I manually close the server and have to restart it.

    Now, I must say that I used Steam to d/l the dedicated server tool, and not the method mentioned here, with the HldsUpdateTool.exe tool. I don't know if this is relevant, but I thought I'd just mention that.

    Thanks for reading, and hopefully for your reply as well ;)
  2. Vaynen

    Vaynen New Member

    Messages:
    9
    Likes Received:
    0
    Ok, I'm not quite sure about the timing, if I actually found the phase where a sendchat command would cause anything.

    What I have tried is use a Javascript based timer (a setInterval() function) to do a sendmsg to the server every 5 minutes. Everything works great and the message appears in-game at the exact intervals. But sooner or later, usually a couple of hours, when people have been playing for some time, the server hangs. Now if I don't send messages the server keeps going, as far as I can tell.
  3. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    my stat tracker script doesn't have any issues at all. i worked around the issue by letting the script sleep from rounds end to start of next round.
    i can monitor statistics chat messages and send periodic messages without ever crashing the server.


    I talked with Bob Berry about it so the issue is known to uberent. the webadmin api probably needs a complete rewrite. don't expect a solution soon.
  4. Vaynen

    Vaynen New Member

    Messages:
    9
    Likes Received:
    0
    Thanks for answering!

    How do you know when the round has ended?

    I would rather have my scripts sleep as well, but I don't know how to detect when a match round has ended, or when one has started.
  5. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    Use ServerStatus/

    There is a variable in the json response called bMatchIsOver. you can use that
    dont however use bMatchHasBegun since it also reports True when in lobby.
  6. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    another good way to sleep on migrations is to query the server using the steam protocol
    whenever the server is migrating it will report the playercount as zero. querying using the steam protocol doesn't crash the server. Also you don't need to have the script run when there are no people in the server.

    you can use my proxy for that:
    query the following url using $.ajax (requires jquery) , datatype:jsonp

    http://178.18.89.72/webadminproxy.php?i ... &callback=?
    change port and serverip to your own address
    don't forget to include the &callback=? it's needed by javascript to allow the cross domain query in jsonp

    Currentmap is reported as a single number compatible with crossfire:
    0 = Hostilelobby
    1= Tully's
    2 = Ammo Mule
    3 = Steel
    4 = Grenade3
    5 = Spunky

    monitoring the current map for Hostilelobby does the same trick
  7. Vaynen

    Vaynen New Member

    Messages:
    9
    Likes Received:
    0
    Ah! So you can always call the serverstatus command without any problems?

    Excellent! Thank you very much racquemis!

    edit: Hadn't seen your second reply yet.

    Thanks again! Will try and see if I can go through Steam, first off I want to finish the stuff I'm working on now. Hopefully the serverstatus will solve my problem on the short-term.

    If the API will be rewritten, I will have a lot of work on my hands anyway..
  8. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    It's currently unknown how the webadmin api will change. it could just be fixed and the same commands will be available or it could drastically change that even the query method changes.

    Got alot fo work myself to :p if something drastic changes i need to change my entire stattracker en webadmin interface xD

Share This Page