Missing "error" when botconfig is wrong

Started by Djdiper, November 18, 2016, 10:35:42 PM

Previous topic - Next topic

Djdiper

Hi Stefan!

First of all, let me congratulate you on a wonderful bot! It has surtaintly made our admins/moderators life easier :)

I just came over something now when I updated into 6.3.0. Not sure if this has been present into the earlier developments as well, but if there are 2 instances sharing the same instance ID (1,2,3,4) then the bot will just ignore it without it throwing any errors in logs. It will just process the next instanceID instead.

Nothing is written into any logfiles at all.

Eks; Inside instance.cfg:
# Enable bot instance, 1 = yes, 0 = no
# If 0, you can start the virtual bot instance later by chat command from another running virtual bot instance.
1.instance_enable = 1
# The name is needed to start or stop this virtual bot instance by chat commands. This name has to be unique!
# Don't use spaces in the bot name, only use letters, numbers, minus and underscore!
1.instance_name = Bot1
# Path to config file for this virtual bot instance.
1.instance_config_path = instances/bot1/JTS3ServerMod_server.cfg
# Path to log file for this virtual bot instance. Leave empty to disable file logging.
1.instance_logfile_path = log/bot1.log
# Path to connection log file for this virtual bot instance. Will be saved in csv format. Leave empty to disable file logging.
# This function creates a CSV file, which logs when which client (including IP address) connects to the TS3 server.
1.instance_csvloginlog_path = csv/bot1.csv


# Enable bot instance, 1 = yes, 0 = no
# If 0, you can start the virtual bot instance later by chat command from another running virtual bot instance.
2.instance_enable = 1
# The name is needed to start or stop this virtual bot instance by chat commands. This name has to be unique!
# Don't use spaces in the bot name, only use letters, numbers, minus and underscore!
2.instance_name = Bot2
# Path to config file for this virtual bot instance.
2.instance_config_path = instances/bot2/JTS3ServerMod_server.cfg
# Path to log file for this virtual bot instance. Leave empty to disable file logging.
2.instance_logfile_path = log/bot2.log
# Path to connection log file for this virtual bot instance. Will be saved in csv format. Leave empty to disable file logging.
# This function creates a CSV file, which logs when which client (including IP address) connects to the TS3 server.
2.instance_csvloginlog_path = csv/Bot2.csv

# Enable bot instance, 1 = yes, 0 = no
# If 0, you can start the virtual bot instance later by chat command from another running virtual bot instance.
#3.instance_enable = 1
# The name is needed to start or stop this virtual bot instance by chat commands. This name has to be unique!
1.instance_name = Bot3
# Path to config file for this virtual bot instance.
1.instance_config_path = instances/bot3/JTS3ServerMod_server.cfg
# Path to log file for this virtual bot instance. Leave empty to disable file logging.
1.instance_logfile_path = log/bot3.log
# Path to connection log file for this virtual bot instance. Will be saved in csv format. Leave empty to disable file logging.
# This function creates a CSV file, which logs when which client (including IP address) connects to the TS3 server.
1.instance_csvloginlog_path = csv/bot3.csv


Now the bot will just ignore Bot 1 and Bot3 and only process Bot 2 config.. I just figured this out beq of copy/paste error that I did.
Perhaps it should have commed a "Multiple Instances with same ID defined in instance.cfg - please fix this!"

Not sure if this is something that you would like to take a closer look into, but atleast now you know!

Br
Michael

Stefan1200

You forgot to replace the number 1 at the bot3 block to 3.

Example:
3.instance_enable = 1
3.instance_name = Bot3
3.instance_config_path = instances/bot3/JTS3ServerMod_server.cfg
3.instance_logfile_path = log/bot3.log
3.instance_csvloginlog_path = csv/bot3.csv

Djdiper

Yeah, I know :) I figured it out later on when the bot ONLY started up on the one that wasnt duplicated (BOT2).
Bot1 and Bot3 never started naturally.

But, It would have been nice to have a entry into logfiles that there are some misspelled configuration into the instances file.
That was my point. :)

./ Michael

Quote from: Stefan1200 on November 18, 2016, 11:09:10 PM
You forgot to replace the number 1 at the bot3 block to 3.

Example:
3.instance_enable = 1
3.instance_name = Bot3
3.instance_config_path = instances/bot3/JTS3ServerMod_server.cfg
3.instance_logfile_path = log/bot3.log
3.instance_csvloginlog_path = csv/bot3.csv


Stefan1200

Quote from: Djdiper on November 24, 2016, 08:25:43 AM
But, It would have been nice to have a entry into logfiles that there are some misspelled configuration into the instances file.
That was my point. :)

That is not possible, because that is a property file. It is impossible to detect doubled variable names without to reinvent the wheel. The last variable with the same name will overwrite the ones before.