ServerMessages: auto global RCon messages

gdscei

Valued Member!
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
 

Kalti

New Member
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?
 

gdscei

Valued Member!
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?
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

New Member
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.
 

gdscei

Valued Member!
Code:
Exception Info: System.IO.FileNotFoundException
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

New Member
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...
 

gdscei

Valued Member!
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...
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

New Member
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...
 

gdscei

Valued Member!
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...
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

New Member
Are you sure you have v1.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.
That was it. I did indeed download the old version. Sorry for the mix-up & thanks for all the time and effort.
 
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)
 
Top