ServerMessages: auto global RCon messages

Discussion in 'Server / Admin Tools and Discussions.' started by gdscei, Apr 1, 2013.

  1. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    This is a client I made using the BattleNET library by ziellos2k.
    Basicly, you enter the messages you want to send in a cfg file, and it will globally send these messages on your server. Client updates it's cache of messages.cfg every 10 minutes. This is mainly supposed to be a lightweight version of clients like BEC.

    Now also includes support for looping messages and saving side-chat!

    Please read readme.txt for instructions.

    Download v2.0: http://www.mediafire.com/download/aly28unu1wcxkg3/ServerMessages_v20.zip
    Source: https://github.com/gdscei/ServerMessages

    Please report bugs or suggestions at the Github repo. (click the Source link above, and go to the 'Issues' tab)

    Code:
    Changelog
     
    v2.0: Added support for loops and saving sidechat, cleaned up the code
    v1.0.1: Fixed bug with messages file
    v1.0: Initial release
     
    Jarrrk, Bassline and Kalti like this.
  2. machine

    machine Well-Known Member

    Joined:
    Jan 20, 2013
    Messages:
    297
    Likes Received:
    21
    thank you! have been looking for something simple like this for awhile!
     
    Kalti likes this.
  3. machine

    machine Well-Known Member

    Joined:
    Jan 20, 2013
    Messages:
    297
    Likes Received:
    21
    Would it be possible to just make a loop msg? instead of a time for each one?
     
  4. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    Yes, I will see if I can implement that :)
     
    Kalti likes this.
  5. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    This sure looks promising, however I haven't gotten it to work yet...

    It comes up with:

    12:47:09 Reading messages...
    12:47:09 Starting Rcon, checking connection...
    12:47:09 Succesful connection to BE server.
    12:47:09 Connection lost: Disconnected
    12:57:09 Reading messages...

    Then it crashes. Anything I can do to help you shed light on this issue?
     
  6. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    Nothing from that log seems abnormal. (the connection lost: disconnected is a good manual disconnect, and the reading messages again is normal; it checks every 10 minutes)

    The only thing I could think of is that you didn't set up the messages.cfg correctly. Can you post it here? (or a shortened version of it if it's long)
     
    Kalti likes this.
  7. machine

    machine Well-Known Member

    Joined:
    Jan 20, 2013
    Messages:
    297
    Likes Received:
    21
  8. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    Can you do the same as I asked Kalti?
     
  9. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    I went with the original messages, using the file "messages.cfg" out of your archive:
    Code:
    05:46:45~Example 1 msg
    14:05:00~Example 2 msg
    Also, I'm coming across the following 2 entries in the Event Viewer:

    Code:
    Event Type:    Error
    Event Source:    .NET Runtime 4.0 Error Reporting
    Event Category:    None
    Event ID:    5000
    Date:        8-4-2013
    Time:        12:57:10
    User:        N/A
    Computer:    DZSERVER
    Description:
    EventType clr20r3, P1 servermessages.exe, P2 1.0.0.0, P3 5159de7f, P4 mscorlib, P5 4.0.0.0, P6 50484bd7, P7 3fda, P8 ce, P9 system.io.filenotfoundexception, P10 NIL.
     
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
     
    Data:
    0000: 63 00 6c 00 72 00 32 00  c.l.r.2.
    0008: 30 00 72 00 33 00 2c 00  0.r.3.,.
    0010: 20 00 73 00 65 00 72 00    .s.e.r.
    0018: 76 00 65 00 72 00 6d 00  v.e.r.m.
    0020: 65 00 73 00 73 00 61 00  e.s.s.a.
    0028: 67 00 65 00 73 00 2e 00  g.e.s...
    0030: 65 00 78 00 65 00 2c 00  e.x.e.,.
    0038: 20 00 31 00 2e 00 30 00    .1...0.
    0040: 2e 00 30 00 2e 00 30 00  ..0...0.
    0048: 2c 00 20 00 35 00 31 00  ,. .5.1.
    0050: 35 00 39 00 64 00 65 00  5.9.d.e.
    0058: 37 00 66 00 2c 00 20 00  7.f.,. .
    0060: 6d 00 73 00 63 00 6f 00  m.s.c.o.
    0068: 72 00 6c 00 69 00 62 00  r.l.i.b.
    0070: 2c 00 20 00 34 00 2e 00  ,. .4...
    0078: 30 00 2e 00 30 00 2e 00  0...0...
    0080: 30 00 2c 00 20 00 35 00  0.,. .5.
    0088: 30 00 34 00 38 00 34 00  0.4.8.4.
    0090: 62 00 64 00 37 00 2c 00  b.d.7.,.
    0098: 20 00 33 00 66 00 64 00    .3.f.d.
    00a0: 61 00 2c 00 20 00 63 00  a.,. .c.
    00a8: 65 00 2c 00 20 00 73 00  e.,. .s.
    00b0: 79 00 73 00 74 00 65 00  y.s.t.e.
    00b8: 6d 00 2e 00 69 00 6f 00  m...i.o.
    00c0: 2e 00 66 00 69 00 6c 00  ..f.i.l.
    00c8: 65 00 6e 00 6f 00 74 00  e.n.o.t.
    00d0: 66 00 6f 00 75 00 6e 00  f.o.u.n.
    00d8: 64 00 65 00 78 00 63 00  d.e.x.c.
    00e0: 65 00 70 00 74 00 69 00  e.p.t.i.
    00e8: 6f 00 6e 00 20 00 4e 00  o.n. .N.
    00f0: 49 00 4c 00 0d 00 0a 00  I.L.....
    
    Code:
    Event Type:    Error
    Event Source:    .NET Runtime
    Event Category:    None
    Event ID:    1026
    Date:        8-4-2013
    Time:        12:58:50
    User:        N/A
    Computer:    DZSERVER
    Description:
    Application: ServerMessages.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.IO.FileNotFoundException
    Stack:
      at System.IO.__Error.WinIOError(Int32, System.String)
      at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean)
      at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions)
      at System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean, Int32)
      at System.IO.StreamReader..ctor(System.String, System.Text.Encoding)
      at System.IO.File.InternalReadAllText(System.String, System.Text.Encoding)
      at System.IO.File.ReadAllText(System.String)
      at ServerMessages.Program.Main(System.String[])
     
     
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    
     
  10. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    That little part already tells what the issue is quite clearly. An error on my part, that is. One line of code asks for the correct file, but one other line asks for it with a .txt extension. It's something easy to fix though, I'll get a new build up when I'm home.

    Edit: updated, see first post.
     
    Kalti likes this.
  11. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    Alright, tried it... Now getting a "System.FormatException" at Exception Info.

    Right after:
    Code:
    20:05:33 Reading messages...
    20:05:33 Starting RCon, checking connection...
     
  12. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    A formatting issue in your settings.cfg.

    Check to make sure it's in the following format:

    Code:
    host=127.0.0.1
    port=2302
    pass=rconpassword
     
    Kalti likes this.
  13. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    Indeed, that was the issue... typo in server IP :oops:

    Thanks, running now!
     
  14. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    No problem, glad it's solved!
     
    Kalti likes this.
  15. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    WellI'm sorry to say that I ran into another "Exception Info: System.IO.FileNotFoundException" after:

    Code:
    20:24:01 Reading messages...
    20:24:01 Starting RCon, checking connection...
    20:24:01 Succesful connection to BE server.
    20:24:01 Connection lost: Disconnected
    20:30:00 Succesful connection to BE server.
    20:30:00 Said global: Message 42
    20:30:00 Connection lost: Disconnected
    20:34:01 Reading messages...
     
  16. gdscei

    gdscei Valued Member!

    Joined:
    Nov 30, 2012
    Messages:
    269
    Likes Received:
    39
    Are you sure you have v1.0.1? Please check if there was a changelog in the readme of the download.

    When I released it, the link was wrong and I edited it later, so you might've just gotten v1 again.
     
    Kalti likes this.
  17. - Zsquad - IT07

    - Zsquad - IT07 New Member

    Joined:
    Apr 12, 2013
    Messages:
    26
    Likes Received:
    0
    Thank you sooooo much dude! I'm gonna try this out :)
    I've been looking for this a long time and now I found it!
     
  18. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    That was it. I did indeed download the old version. Sorry for the mix-up & thanks for all the time and effort.
     
  19. - Zsquad - IT07

    - Zsquad - IT07 New Member

    Joined:
    Apr 12, 2013
    Messages:
    26
    Likes Received:
    0
    I have a problem: when I start the .exe it crashes immediately and gives the next error:
    11:42:58 Reading messages...
    11:42:58 Starting RCon, checking connection...


    Code:
    11:42:58 Reading messages...
    11:42:58 Starting RCon, checking connection...
     
    Unhandled Exception: System.TypeInitializationException: The type initializer fo
    r 'ServerMessages.Settings' threw an exception. ---> System.NullReferenceExcepti
    on: Object reference not set to an instance of an object.
      at ServerMessages.Settings.getSetting(Int32 x)
      at ServerMessages.Settings..cctor()
      --- End of inner exception stack trace ---
      at ServerMessages.Program.checkConnection()
      at ServerMessages.Program.Main(String[] args)
    
     
  20. Kalti

    Kalti New Member

    Joined:
    Feb 17, 2013
    Messages:
    8
    Likes Received:
    0
    Still running without further issues.

    What would be the best way of setting it up for multiple servers?
     

Share This Page