-
Notifications
You must be signed in to change notification settings - Fork 191
Conversation
Version 3.0.0 release
Version 4.0.0
Update to 4.0.1
Fix Arcana#304 chat channels with same name
Add setPartyLeader method
Player stat fetching
Update dependencies. Tests fail unrelated
Proto update
Proto update
Bump version to 4.1.0 + slight README updates in preparation for release
Update enums in README
Fix party invite responses + minor README tweaks
Fix Arcana#352 added boolean switches to requestPlayerHistory
Protobuf update
Fix Arcana#349 Basic popup implementation
mini protobuf update
Bump to 4.1.0
I'd like some input on this pull request, as it's something I've been struggling with for a while now. If we receive a message for which we don't know the channel information, do we really want to emit an event? It's impossible to know from which channel it comes (since we only have an id) and with our current api you can't even reply to it. The only way this specific case can pop up is when you joined a channel in a previous session, but didn't leave it before terminating the bot. Wouldn't a more appropriate response not be to either send a leaveChatChannel message upon receiving a message from a channel we haven't explicitly joined, or to just plain ignore the message? |
I would suggest the former, leave the channel, as well as log a descriptive error (maybe link to the github issue), and maybe even write the error to file where they would see it. I certainly would not ignore it. Keep up the great work. You are doing an amazing job. |
Hi guys, just getting my head around this issue. Would the following be a good solution?
|
@tomasmck the gist of it is correct, however the else statement will fail, since our API takes the channel name + type as the identifiers when leaving. You'd need to duplicate this bit from the leaveChat function for it to work:
|
Alright, this seems to be coming together nicely! I'll see if I can test the pull locally in the course of the week and make the pull as soon as I've verified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work so far, I really like the way you're following our code conventions :)
if ("" + otherLeft.steam_id === "" + this._client.steamID) { | ||
if (this.debug) { | ||
if (channel) { | ||
if ("" + userWhoLeft.steam_id === "" + this._client.steamID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While working on the fantasy stuff I found out that all these id's that are returned have a Long type. This means that we can change this to the more readable:
if (userWhoLeft.steam_id.equals(this._client.steamID)) {
if (channel) { | ||
this.emit("chatLeave", channel.channel_name, userWhoLeft.steam_id, userWhoLeft); | ||
// Delete channel from cache | ||
this.chatChannels = this.chatChannels.filter(function (item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.chatChannels = this.chatChannels.filter(item => item.channel_id.notEquals(channel.channel_id));
channel.members = channel.members.filter(function(item) { | ||
return ("" + item.steam_id !== "" + otherLeft.steam_id); | ||
channel.members = channel.members.filter(function (item) { | ||
return ("" + item.steam_id !== "" + userWhoLeft.steam_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return item.steam_id.notEquals(userWhoLeft.steam_id);
this.emit("chatLeave", channel.channel_name, userWhoLeft.steam_id, userWhoLeft); | ||
// Delete member from cached chatChannel | ||
channel.members = channel.members.filter(function (item) { | ||
return ("" + item.steam_id !== "" + userWhoLeft.steam_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return item.steam_id.notEquals(userWhoLeft.steam_id);
@@ -32,6 +32,17 @@ Dota2.Dota2Client.prototype._getChannelById = function(channel_id) { | |||
} | |||
} | |||
|
|||
Dota2.Dota2Client.prototype._leaveUnknownChatChannel = function(userWhoLeft) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like that you externalize this function, but I think making it _leaveChatChannelById would be better. The reason why is that this way we could reuse it for the leaveChat function as well. This would imply having to add the debug info to the specific event handlers, which imo isn't a bad thing, since the error can probably happen in the onChatMessage and onOtherJoinedChannel handlers as well, which would require a different debug message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small things then we're good to merge I think. Thanks a lot!
this.chatChannels = this.chatChannels.filter(item => item.channel_id.notEquals(channelId)); | ||
this.sendToGC(Dota2.schema.EDOTAGCMsg.k_EMsgGCLeaveChatChannel, payload); | ||
if (this.debug) { | ||
util.log(steamIdOfLeaver + " left channel " + channelId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This debug is somewhat counter-intuitive in the context of the function. This function makes the bot itself leave a channel so having a debug message saying someone else left might even be incorrect (take the case for example where this function would be called following a chat message or a join event). I propose changing the debug message to simply read "Leaving channel" + channelId
and removing the parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll make that change. Cheers.
util.log("This probably should be physically impossible, but whatever: you managed to leave a channel you didn't know you were in, congratulations..."); | ||
} | ||
} else { | ||
this._leaveChatChannelById(userWhoLeft.channel_id, userWhoLeft.steam_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a debug log "I left unknown channel" + userWhoLeft.channel_id
if (this.debug) | ||
util.log(userWhoLeft.steam_id + " left channel " + channel.channel_name); | ||
} else { | ||
this._leaveChatChannelById(userWhoLeft.channel_id, userWhoLeft.steam_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add debug log userWhoLeft.steam_id + " left unknown channel " + channel.channel_name
Until Arcana/node-dota2#378 is merged, schedulebot will be using the fork from tomasmck
Squashed commit of the following: commit c4fcd1b Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Tue Jan 24 13:03:58 2017 +0100 Added some config options. Final v1.2 commit- commit 64e97d7 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Mon Jan 23 14:11:24 2017 +0100 Added enfore MMR ability commit 9b35426 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 20 12:23:23 2017 +0100 Removed uneccessary comment commit b69cc92 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 20 12:21:00 2017 +0100 The bot is able to retrieve the Match ID commit 47f41fe Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Tue Jan 17 21:52:10 2017 +0100 Bug fixes commit 10ebaff Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Mon Jan 16 13:12:16 2017 +0100 Updated usage guide commit dc4989e Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Mon Jan 16 13:02:08 2017 +0100 Added CM Pick option (Needs testing) commit 35c3bfd Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sun Jan 15 17:32:46 2017 +0100 Finished MMR support. commit 3749e1e Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sun Jan 15 02:08:46 2017 +0100 Fetching MMR from OpenDota commit 021bae7 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Jan 14 17:19:16 2017 +0100 Merge branch 'dota-feature-multiple-steam-bots' Squashed commit of the following: commit ff26b5d Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Jan 14 17:15:09 2017 +0100 Works apparently. commit bed8095 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 13 11:34:17 2017 +0100 small progress commit 07a80e5 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 12 20:47:31 2017 +0100 Fixed some things + status command (untested) commit 5594b93 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 12 14:06:28 2017 +0100 Seems to work now commit e864b89 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 12 13:26:51 2017 +0100 Getting an error on lobby creation commit 100c4df Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 11 20:41:56 2017 +0100 Still a wip... commit 64bb4e1 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 11 13:30:49 2017 +0100 Forgot to upload the next version sql changes commit 977b5cb Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 11 13:29:45 2017 +0100 Still a wip I'm making soooooo much changes without testing, but I can't right now. Debugging is gonna be fun. commit 403bf75 Merge: 227c59a 4b005fd Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 11 12:01:08 2017 +0100 Merge branch 'dota-dev' into dota-feature-multiple-steam-bots commit 227c59a Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Jan 7 14:22:57 2017 +0100 Still a work in progress Rewriting the dotahandler module. commit 5d1aa84 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 21:38:12 2017 +0100 Doesn't work so far commit a95b25e Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 13:28:27 2017 +0100 Changed scripts to work with multiple bots commit 4b005fd Merge: cacfeb8 86629b0 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 11 12:00:38 2017 +0100 Merge branch 'dota' into dota-dev commit 86629b0 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 11 11:48:07 2017 +0100 v1.1.1 - Closes #9 and #10 commit cacfeb8 Merge: 69caf3c d30d919 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 11:43:09 2017 +0100 Merged branch dota into dota-dev commit d30d919 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 01:16:39 2017 +0100 Update README.md Added a link to the changelog commit 0051ff2 Merge: b6084b2 69caf3c Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 01:00:43 2017 +0100 ScheduleBot for Dota v1.1.0 Merged branch dota-dev into dota commit 69caf3c Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 00:51:44 2017 +0100 Ready to launch v1.1.0 commit 12bc1e8 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Jan 6 00:26:44 2017 +0100 Added kick admin command commit 0885aa6 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 23:18:25 2017 +0100 Two additions - Added quick-inhouse command - Players now get autoinvited if they confirm after a lobby is created. commit 61358f1 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 23:02:41 2017 +0100 fix #5 commit 61b1a5b Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 22:30:55 2017 +0100 Removed uneccessary statements commit 0c5a85e Merge: a31e7b2 6b02935 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 22:21:39 2017 +0100 Merged branch feature-ticketed-lobbies into dota-dev commit 6b02935 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 21:35:27 2017 +0100 Ticketing now works! commit a31e7b2 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 17:36:27 2017 +0100 Fixed bugg with summaries commit dd24d53 Merge: 54cec51 b1730c5 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 17:18:22 2017 +0100 Merged branch dota-dev into feature-ticketed-lobbies commit b1730c5 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 17:12:16 2017 +0100 Added TODO so I don't forget to update the setup script And knowing myself I porbably will anyways :) commit 6124102 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 17:10:00 2017 +0100 Added support for instant events + more - Replaced the "lobby_ended" field in the database with "lobby_status", whose type is the enum ELobbyStatus - Some tweaks to the event summaries commit b3b7e45 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 14:53:11 2017 +0100 Changed --limit default value to 10 commit 54cec51 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Jan 5 14:03:12 2017 +0100 Began working on ticketing support Also updated node-dota2 commit 5e56849 Merge: f0ed8cd 75422c5 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 16:16:25 2017 +0100 Merged branch master into dota-dev Updated usage guide commit f0ed8cd Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 16:08:22 2017 +0100 Modified config.js for clarification commit 73f1f49 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 15:58:59 2017 +0100 Bugfix - Closes #7 commit 47b9050 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 15:51:07 2017 +0100 Enforce inhouse event limit to be >= 10 Also fixes a bug where events without inhouses couldn't be removed. commit 2e74881 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 15:37:55 2017 +0100 Bugfix - Closes #6 commit 8f0913e Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 14:08:44 2017 +0100 Un-hardcoded the time fortmat Americans need to use MM/DD/YYY commit 26870a5 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 13:59:47 2017 +0100 Add more servers Added servers: Singapore, Dubai, Austria, Brazil, South Africa, Chile, Peru, India, Japan commit 5809103 Merge: b6084b2 e3b700c Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Jan 4 13:31:17 2017 +0100 Merged branch dota-feature-more-gamemodes into dota-dev commit e3b700c Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Tue Jan 3 20:33:46 2017 +0100 Added more gamemodes Game modes added: Captains Draft, Random Draft, Single Draft, All Random, Ranked All Pick commit b6084b2 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Tue Jan 3 20:44:23 2017 +0100 Added better links on apps descriptions commit dd4100d Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Mon Jan 2 15:58:47 2017 +0100 Added link to home page commit 045873c Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Mon Jan 2 00:27:05 2017 +0100 Minor bug fix The command link-steam wouldn't show the readable prefix. commit d24271c Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sun Jan 1 02:35:02 2017 +0100 Small changes Moved "dota edition only" to clear URLs commit e488916 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Dec 16 12:34:25 2016 +0100 Update README.md commit 514dade Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 15 13:22:37 2016 +0100 Added update scripts for the dota branch. The bot will also save the sentry file to the database if found in the local machine. commit fdf1d82 Merge: 7d5a0d2 88a1420 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 15 13:11:18 2016 +0100 Merge branch 'master' Conflicts: README.md lib/commands/general/confirm.js package.json commit 7d5a0d2 Merge: 5ffe987 4ce81ce Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Dec 14 13:22:48 2016 +0100 Merged branch dota into dota commit 5ffe987 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Dec 14 13:21:27 2016 +0100 Now saving the sentry file in the database Heroku's free plan may restart the app at any time, and delete the sentry file. Thus, the bot would crash because it wouldn't be able to log in to Steam. commit 4ce81ce Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sun Dec 11 14:28:46 2016 +0100 I should proofread more often commit 53f7c35 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Dec 10 16:34:15 2016 +0100 Fix examples commit adbfab7 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Dec 10 13:47:51 2016 +0100 Update README.md - Added git checkout dota so that the master branch isn't used - Fixed heroku link pointing to heroku instead of heroku-dota commit 6fb5196 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Dec 10 13:25:33 2016 +0100 Fixed bug in db_setup.sql ID being INTEGER and not SERIAL would cause internal errors with the "create" command. commit 761e4c1 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Sat Dec 10 12:46:10 2016 +0100 Fixed bot crashing after lobby is closed Until Arcana/node-dota2#378 is merged, schedulebot will be using the fork from tomasmck commit e30da47 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Fri Dec 9 00:27:52 2016 +0100 Fix setup script commit f65b105 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 8 23:31:20 2016 +0100 Added link to dota usage guide commit f25d7a4 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 8 23:28:50 2016 +0100 Fix typo in README.md commit 477558a Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 8 23:21:21 2016 +0100 Done! commit a580772 Merge: 530ebcb 5cb8724 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 8 23:01:27 2016 +0100 Merge branch 'master' into 'dev-steam' Conflicts: lib/modules/summaryhandler/index.js package.json commit 530ebcb Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 8 22:46:13 2016 +0100 It works! Added setup script. Need more work on the usage guide commit 5ca7ac0 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Thu Dec 8 00:29:53 2016 +0100 Should be ready now commit 19d7d64 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Wed Dec 7 14:10:30 2016 +0100 Progress on Dota lobbies Now the bot is able to create lobbies and start with force-lobby-start commit cad0207 Author: Pablo Rodríguez <pabloviolin8@gmail.com> Date: Tue Dec 6 16:17:34 2016 +0100 Began working on Steam-Dota2 support
No description provided.