Arcana / node-dota2-bot

Wrapper around the node-dota2 library which handles all log-in shenanigans
MIT License
9 stars 7 forks source link

.CMsgClientLogon#persona_name is not a field: undefined #8

Closed FrostBy closed 7 years ago

FrostBy commented 7 years ago

Hi! If i want to post persona_name with logonDetails to the constuctor, it throws this error "persona_name" field not exist in CMsgClientLogon

Crazy-Duck commented 7 years ago

I confirm this is a bug, I'll try to fix asap.

csplkiller commented 5 years ago

I have a large number of bots running at the same time, and I often get an error:

/scripts/dota2/bot/node_modules/steam/node_modules/steam-resources/node_modules/protobufjs/dist/ProtoBuf.js:2440 throw Error(this+"#"+keyOrObj+" is not a field: undefined"); ^

Error: .CMsgClientLogon#persona_name is not a field: undefined at MessagePrototype.set (/scripts/dota2/bot/node_modules/steam/node_modules/steam-resources/node_modules/protobufjs/dist/ProtoBuf.js:2440:35) at MessagePrototype.set (/scripts/dota2/bot/node_modules/steam/node_modules/steam-resources/node_modules/protobufjs/dist/ProtoBuf.js:2434:38) at Message (/scripts/dota2/bot/node_modules/steam/node_modules/steam-resources/node_modules/protobufjs/dist/ProtoBuf.js:2363:34) at SteamUser.logOn (/scripts/dota2/bot/node_modules/steam/lib/handlers/user/index.js:33:6) at SteamClient.onSteamLogOff (/scripts/dota2/bot/node_modules/dota2-bot/index.js:77:28) at emitOne (events.js:115:13) at SteamClient.emit (events.js:210:7) at SteamClient.handlers.(anonymous function) (/scripts/dota2/bot/node_modules/steam/lib/steam_client.js:290:8) at SteamClient._netMsgReceived (/scripts/dota2/bot/node_modules/steam/lib/steam_client.js:157:26) at SteamClient.handlers.(anonymous function) (/scripts/dota2/bot/node_modules/steam/lib/steam_client.js:259:10)

Judging by the correction presented above, I think it is necessary to make another correction when reconnecting.

Line 77 self.steamUser.logOn(self._logonDetails);

Replace by:

self.steamUser.logOn({"account_name": self._logonDetails.account_name, "password": self._logonDetails.password});

Right ?