Josko / aura-bot

Warcraft III high-performance hosting bot written in C++14.
76 stars 42 forks source link

Unable to connect to bnet servers #81

Closed ngx3 closed 6 years ago

ngx3 commented 6 years ago

Hosting on my Ubuntu 16.04 vps. The location "C:\Program Files\Warcraft III" in the cfg file is there as a placeholder, for clarification? I changed it to reflect my bot installation that also didn't work.

./aura++ [CONFIG] loading file [aura.cfg] [AURA] starting up [AURA] using monotonic timer with resolution 1.000000 nanoseconds [SQLITE3] version 3.18.0 [SQLITE3] opening database [aura.dbs] [SQLITE3] found schema number [1] [AURA] Aura++ version 1.32 - with GProxy++ support [UDPSOCKET] using default broadcast target [AURA] listening for GProxy++ reconnects on port 6113 [AURA] warning - irc connection not found in config file [AURA] found battle.net connection #1 for server [useast.battle.net] [AURA] using system locale of 1031 [AURA] found battle.net connection #2 for server [europe.battle.net] [AURA] using system locale of 1031 [AURA] found battle.net connection #3 for server [uswest.battle.net] [AURA] using system locale of 1031 [AURA] warning - unable to load MPQ file [C:\Program Files\Warcraft III/War3.mpq] - error code 2 [CONFIG] loading file [mapcfgs/wormwar.cfg] [UTIL] warning - unable to read file [C:\Program Files\Warcraft III\Maps\Download\/(12)WormWar.w3x] [MAP] warning - unable to load MPQ file [C:\Program Files\Warcraft III\Maps\Download\/(12)WormWar.w3x] [MAP] no map data available, using config file for map_size, map_info, map_crc, map_sha1 [MAP] no map data available, using config file for map_options, map_width, map_height, map_slot, map_numplayers, map_numteams [MAP] overriding calculated map_filter_type with config value map_filter_type = 2 [AURA] started loading [ip-to-country.csv] [AURA] iptocountry data: 10% loaded [AURA] iptocountry data: 20% loaded [AURA] iptocountry data: 30% loaded [AURA] iptocountry data: 40% loaded [AURA] iptocountry data: 50% loaded [AURA] iptocountry data: 60% loaded [AURA] iptocountry data: 70% loaded [AURA] iptocountry data: 80% loaded [AURA] iptocountry data: 90% loaded [AURA] iptocountry data: 100% loaded [AURA] finished loading [ip-to-country.csv] [BNET: USEast] connecting to server [useast.battle.net] on port 6112 [BNET: USEast] resolved and cached server IP address IP [BNET: Europe] connecting to server [europe.battle.net] on port 6112 [BNET: Europe] resolved and cached server IP address IP [BNET: USWEST] connecting to server [uswest.battle.net] on port 6112 [BNET: USWEST] resolved and cached server IP address IP [BNET: USEast] connected [BNET: USWEST] connected [BNET: Europe] connected [BNCSUI] unable to open War3EXE [] [BNET: USEast] logon failed - bncsutil key hash failed (check your Warcraft 3 path and cd keys), disconnecting [BNET: USEast] disconnected from battle.net [BNCSUI] unable to open War3EXE [] [BNCSUI] unable to open StormDLL [] [BNCSUI] unable to open GameDLL [] [BNET: USWEST] logon failed - bncsutil key hash failed (check your Warcraft 3 path and cd keys), disconnecting [BNET: USWEST] disconnected from battle.net [BNCSUI] unable to open War3EXE [] [BNCSUI] unable to open StormDLL [] [BNCSUI] unable to open GameDLL [] [BNET: Europe] logon failed - bncsutil key hash failed (check your Warcraft 3 path and cd keys), disconnecting [BNET: Europe] disconnected from battle.net

juvian commented 6 years ago

show config without user/pass/keys

ngx3 commented 6 years ago

#####################

BOT CONFIGURATION

#####################

the path to your local Warcraft III directory

this path must contain war3.exe, storm.dll, and game.dll

if this path contains War3Patch.mpq the bot will attempt to extract "Scripts\common.j" and "Scripts\blizzard.j" on startup and write them to bot_mapcfgpath (which is defined later in this file)

common.j and blizzard.j are only required for automatically calculating map_crc, you do not need them if your map config files already contain map_crc

bot_war3path = /home/hostbot/aura-bot/Warcraft III

the address Aura will bind to when hosting games (leave it blank to bind to all available addresses)

if you don't know what this is just leave it blank

bot_bindaddress =

the port Aura will host games on (this must be different from your bot_reconnectport)

bot_hostport = 6112

the port Aura will listen for GProxy++ reliable reconnects on

bot_reconnectport = 6113

the maximum number of minutes to wait for a GProxy++ client to reconnect to the game

if you set this to 0 or 1 Aura will wait for up to 1 minute

if you set this to 10 or more Aura will only wait for up to 10 minutes

due to the way GProxy++ works, increasing this value increases bandwidth requirements and CPU requirements on the players' computers

players can always vote to drop a player who is lagging after waiting 45 seconds regardless of this value

bot_reconnectwaittime = 3

maximum number of games to host at once

bot_maxgames = 20

command trigger for ingame only (battle.net command triggers are defined later)

bot_commandtrigger = !

the path to the directory where you keep your map config files

this directory can also contain common.j and blizzard.j (extracted from War3Patch.mpq)

common.j and blizzard.j are only required for automatically calculating map_crc, you do not need them if your map config files already contain map_crc

bot_mapcfgpath = mapcfgs

the path to the directory where you keep your map files

Aura doesn't require map files but if it has access to them it can send them to players and automatically calculate most map config values

Aura will search [bot_mappath + map_localpath] for the map file (map_localpath is set in each map's config file)

bot_mappath = C:\Program Files\Warcraft III\Maps\Download\

the bot's virtual host name as it appears in the game lobby

colour codes are defined by the sequence "|cFF" followed by a six character hexadecimal colour in RRGGBB format (e.g. 0000FF for pure blue)

the virtual host name cannot be longer than 15 characters including the colour code, if you try to go over this limit Aura will use the default virtual host name

bot_virtualhostname = |cFF4080C0Host1

whether to automatically lock games when the owner joins

bot_autolock = 0

whether to allow map downloads or not

set to 0 to disable map downloads

set to 1 to enable map downloads

set to 2 to enable conditional map downloads (an admin must start each map download with the !download or !dl command)

bot_allowdownloads = 1

the maximum number of players allowed to download the map at the same time

bot_maxdownloaders = 3

the maximum combined download speed of all players downloading the map (in KB/sec)

bot_maxdownloadspeed = 100

use LC style pings (divide actual pings by two)

bot_lcpings = 1

auto kick players with ping higher than this

bot_autokickping = 600

automatically close the game lobby if a reserved player (or admin) doesn't join it for this many minutes

bot_lobbytimelimit = 10

the game latency

this can always be changed for a particular game with the !latency command (which enforces a minimum of 20 and a maximum of 500)

bot_latency = 100

the maximum number of packets a player is allowed to get out of sync by before starting the lag screen

this can always be changed for a particular game with the !synclimit command (which enforces a minimum of 10 and a maximum of 10000)

bot_synclimit = 50

the percentage of players required to vote yes for a votekick to pass

the player starting the votekick is assumed to have voted yes and the player the votekick is started against is assumed to have voted no

the formula for calculating the number of votes needed is votes_needed = ceil( ( num_players - 1 ) * bot_votekickpercentage / 100 )

this means it will round UP the number of votes required

if you set it to 100 it will require 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, 10/11, and 11/12 votes to pass

if you set it to 90 it will require 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, 9/11, and 10/12 votes to pass

if you set it to 80 it will require 2/3, 3/4, 4/5, 4/6, 5/7, 6/8, 7/9, 8/10, 8/11, and 9/12 votes to pass

if you set it to 70 it will require 2/3, 3/4, 3/5, 4/6, 5/7, 5/8, 6/9, 7/10, 7/11, and 8/12 votes to pass

if you set it to 60 it will require 2/3, 2/4, 3/5, 3/6, 4/7, 5/8, 5/9, 6/10, 6/11, and 7/12 votes to pass

bot_votekickpercentage = 100

the default map config (the ".cfg" will be added automatically if you leave it out)

bot_defaultmap = wormwar

the game over timer will start when this number of human players in a game has been reached. default value is 1.

bot_gameoverplayernumber = 1

#####################

LAN CONFIGURATION

#####################

the Warcraft 3 version to use when broadcasting LAN games

lan_war3version = 29

the UDP broadcast target

if this value is blank the bot will try to broadcast LAN games on the default interface which is chosen by your operating system

sometimes your operating system will choose the wrong interface when more than one exists

therefore you can use this value to force the bot to use a specific interface

for example you may set it to 192.168.1.255 to broadcast LAN games to the 192.168.1.x subnet

also if you want to broadcast to a connected Hamachi network set it to 5.255.255.255

udp_broadcasttarget =

the UDP "don't route" flag

udp_dontroute = 0

##########################

DATABASE CONFIGURATION

##########################

sqlite3 database configuration

db_sqlite3_file = aura.dbs

#####################

IRC CONFIGURATION

#####################

which irc server to connect to (ie. irc.quakenet.org)

irc_server =

the port Aura will use to connect to the irc server

a good range is between 6660 - 6669 (TCP) but not every server supports the whole range

the default port of most servers is 6667

SSL is not supported

irc_port = 6667

your irc nickname

you cannot use the same username here that you yourself use on irc

irc_nickname =

your irc username (used also in authing with Q on QuakeNet)

irc_username =

your QAuth password (NickServ not supported yet)

leave blank if you aren't connecting to QuakeNet or don't know what this is

irc_password =

the command trigger for commands (one character only)

irc_commandtrigger =

the channels Aura will join

omit the # when inputing a channel

ie. #clan007 would be irc_channel = clan007

maximum limit of 10 channels

last channel has the key irc_channel9

irc_channel = irc_channel2 = irc_channel3 =

irc root admins

defined using hostnames

ie. Starrk.users.quakenet.org

or gprs-prointernet-ff000a01-337.dhcp.inet.fi

limit of 10 rootadmins

irc_rootadmin = irc_rootadmin2 = irc_rootadmin3 =

############################

BATTLE.NET CONFIGURATION

############################

which battle.net server to connect to

1.) useast.battle.net

2.) uswest.battle.net

3.) asia.battle.net

4.) europe.battle.net

5.) server.eurobattle.net (this is a PvPGN)

note that each banned player is tied to the realm it was created on and the realm is case sensitive

so if you change your realm from useast.battle.net to USEAST.BATTLE.NET it'll still connect but anyone previously banned will not be counted as banned until you change it back

bnet_server = useast.battle.net

the server alias

this name will be used to identify the battle.net server in the Aura console

bnet_serveralias = USEast

your Warcraft III: Reign of Chaos CD key

you cannot use the same CD key here that you yourself use to login to battle.net if you plan to login at the same time as your bot

for PvPGNs you can leave it as is

bnet_cdkeyroc = xxxxxxxxxxxxxxxxxxxxxxxx

your Warcraft III: The Frozen Throne CD key

you cannot use the same CD key here that you yourself use to login to battle.net if you plan to login at the same time as your bot

for PvPGNs you can leave it as is

bnet_cdkeytft = xxxxxxxxxxxxxxxxxxxxxxxxxx

the locale specifies the area of the world you are from

battle.net uses this to group players together, showing them games hosted by players and bots mostly from their own area

it's important to set this to the correct value to increase the effectiveness of the game refresher

if you are using Windows you can set this to "system" to use the locale of your system

otherwise you can use the list at the following URL to get the correct value for your area:

http://msdn.microsoft.com/en-us/library/0h88fahh%28VS.85%29.aspx

put the "decimal value" here, e.g. 1031 is the default for "German - Germany"

note: you cannot use a value of "system" on Linux, doing so will use a default value of 1031 instead

bnet_locale = system

your battle.net username

you cannot use the same username here that you yourself use to login to battle.net if you plan to login at the same time as your bot

bnet_username = username

your battle.net password

bnet_password = password

the first channel to join upon entering battle.net

bnet_firstchannel = The Void

the root admins on this battle.net server only

seperate each name with a space, e.g. bnet_rootadmins = h4x0rz88 Aurani Radiant- Sygdyr

bnet_rootadmins =

command trigger for this battle.net server only

bnet_commandtrigger = !

you will need to edit this section of the config file if you're connecting to a PVPGN server (ie. not a Blizzard server)

check http://www.codelain.com/forum/index.php?topic=441.msg2549#msg2549 to see what to put here

bnet_custom_war3version = 29 bnet_custom_exeversion = bnet_custom_exeversionhash = bnet_custom_passwordhashtype = bnet_custom_pvpgnrealmname = PvPGN Realm

example configuration for connecting to a second official battle.net server

bnet2_server = europe.battle.net bnet2_serveralias = Europe bnet2_cdkeyroc = xxxxxxxxxxxxxxxxxxxxx bnet2_cdkeytft = xxxxxxxxxxxxxxxxxxxxx bnet2_locale = system bnet2_username = username bnet2_password = password bnet2_firstchannel = The Void bnet2_rootadmins = bnet2_commandtrigger = !

example configuration for connecting to a third PVPGN battle.net server

bnet3_server = uswest.battle.net bnet3_serveralias = USWEST bnet3_cdkeyroc = xxxxxxxxxxxxxxxxxxxxxx bnet3_cdkeytft = xxxxxxxxxxxxxxxxxxxxxx bnet3_locale = system bnet3_username = username bnet3_password = password bnet3_firstchannel = The Void bnet3_rootadmins = bnet3_commandtrigger = !

juvian commented 6 years ago

Next time just attach file. For bot_war3path you are using / as path delimiter but for bot_mappath you are using \

ngx3 commented 6 years ago

It made no difference, it didn't work either way when I tried to start the bot, same error.

juvian commented 6 years ago

You need to set custom_war3version = 29 in all 3, you only have it in east. And bot is saying [BNCSUI] unable to open War3EXE [] so it is not being able to find Warcraft III.exe in the path you specified with bot_war3path

Josko commented 6 years ago
[AURA] warning - unable to load MPQ file [C:\Program Files\Warcraft III/War3.mpq] - error code 2
[BNCSUI] unable to open War3EXE []
[BNET: USEast] logon failed - bncsutil key hash failed (check your Warcraft 3 path and cd keys), disconnecting

It's still using the default value for the w3 path - meaning it didn't find the entry in the config file. Are you sure you edited the right file? Or perhaps used wrong line endings in the cfg file?

ngx3 commented 6 years ago

@juvian Isn't that for connecting to a PvPGN server? Regardless I did what you said and put it in, still nothing.

@Josko I have attached a file structure of the "aura-bot" directory. I've tried all these paths: bot_war3path = C:\Program Files\Warcraft III (the default one) bot_war3path = Warcraft III bot_war3path = /home/hostbot/aura-bot/Warcraft III bot_war3path = \home\hostbot\aura-bot\Warcraft III bot_war3path = /home/hostbot/aura-bot/War3 bot_war3path = \home\hostbot\aura-bot\War3

None work.

aura-bot file structure

juvian commented 6 years ago

@ngx3 no, 29 is for the bot to use new bnet connection method (that doesnt use storm.dll and game.dll)

Why are you adding Warcraft III to the path? Seems to me you have that aura-bot directory at

/home/hostbot/aura-bot

Try that ^^

ngx3 commented 6 years ago

I think that could be the reason. I have set: bnet_custom_war3version = 29 <---- this is the one you said it was already set for useast? bnet_custom_exeversion = 29 bnet_custom_exeversionhash = 29

Is that correct? Otherwise still not working :(

juvian commented 6 years ago

only set bnet_custom_war3version = 29, erase bnet_custom_exeversion and bnet_custom_exeversionhash lines:

bnet2_server = useast.battle.net bnet2_serveralias = USEast bnet2_cdkeyroc = xxxxxxxxxxxxxxxxxxxxx bnet2_cdkeytft = xxxxxxxxxxxxxxxxxxxxx bnet2_locale = system bnet2_username = xxxx bnet2_password = xxxx bnet2_firstchannel = The Void bnet2_rootadmins = bnet2_commandtrigger = ! bnet2_custom_war3version = 29

ngx3 commented 6 years ago

Ok! It seemed to have done something.. It works! I'm able to login to USEast not EU or West. Same error for EU and West as above "[BNET: USWEST] logon failed - bncsutil key hash failed (check your Warcraft 3 path and cd keys), disconnecting [BNET: USWEST] disconnected from battle.net"

juvian commented 6 years ago

You were missing bnet3_custom_war3version = 29 for west and bnet2_custom_war3version = 29 for europe

ngx3 commented 6 years ago

And solved. lol.. Thank you!

juvian commented 6 years ago

@ngx3 no problem. Close issue ^^