Author Topic: Missing "error" when botconfig is wrong  (Read 7186 times)

Djdiper

  • Newbie
  • *
  • Posts: 3
    • View Profile
Missing "error" when botconfig is wrong
« on: November 18, 2016, 10:35:42 PM »
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:
Code: [Select]
# 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

  • Administrator
  • *****
  • Posts: 2244
    • View Profile
Re: Missing "error" when botconfig is wrong
« Reply #1 on: November 18, 2016, 11:09:10 PM »
You forgot to replace the number 1 at the bot3 block to 3.

Example:
Code: [Select]
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

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Missing "error" when botconfig is wrong
« Reply #2 on: November 24, 2016, 08:25:43 AM »
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

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

Example:
Code: [Select]
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

  • Administrator
  • *****
  • Posts: 2244
    • View Profile
Re: Missing "error" when botconfig is wrong
« Reply #3 on: November 24, 2016, 08:37:07 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.