Arcana / node-dota2

A node-steam plugin for Dota 2.
MIT License
545 stars 191 forks source link

How to leave lobby after launching it? #179

Closed oleghalin closed 8 years ago

oleghalin commented 8 years ago

How to leave from game after launching lobby? launchPracticeLobby

imayhaveborkedit commented 8 years ago

leavePracticeLobby()?

oleghalin commented 8 years ago

nope. Its isnt work. I need to disconnect from server, not leave from lobby

imayhaveborkedit commented 8 years ago

node-dota2 does not connect to a game like you would in the normal client. I don't know exactly what issue you're having but it's not that.

oleghalin commented 8 years ago

srsly not connect? bro, just check bot. After launching bot connection to the server

jimmydorry commented 8 years ago

Run nethook on the real client to figure out what messages are being sent. I last linked a pre-compiled version and a wiki about it here: https://github.com/RJacksonm1/node-dota2/issues/141#issuecomment-153559554

I'm pretty sure though, you just need to leave the lobby.

oleghalin commented 8 years ago

image After finish of game, i disconnect from the server, check status of bot, bot is in lobby, after try invite myself to lobby, it isnt work

oleghalin commented 8 years ago

image And when i tried to update lobby via practiceLobbyUpdate again i have this one message

jimmydorry commented 8 years ago

11 is invalid state

oleghalin commented 8 years ago

image When i try to leave lobby, i have this result

jimmydorry commented 8 years ago

2 is fail

oleghalin commented 8 years ago

I understand that is it fail, but why? And what u mean of "11 is invalid stat"

jimmydorry commented 8 years ago

There is a big list of errors. https://github.com/RJacksonm1/node-dota2/issues/174#issuecomment-162831628

oleghalin commented 8 years ago

image What does it mean?

jimmydorry commented 8 years ago

https://github.com/RJacksonm1/node-dota2/blob/afdc621f2aace87269655cbaa3a29b421805db24/proto/dota_gcmessages_common.proto#L74

oleghalin commented 8 years ago

I think that after finishing game arg lobby dont seting to null, can it be?

oleghalin commented 8 years ago

image In dota with account of bot this seems like that. (text on the button 'back to lobby') after clicking image

jimmydorry commented 8 years ago

Nethook and figure out what it wants.

On Fri, 11 Dec 2015 at 9:26 pm oleghalin notifications@github.com wrote:

[image: image] https://cloud.githubusercontent.com/assets/9086983/11742717/bf55fb80-a00a-11e5-946e-30da5b058da6.png In dota with account of bot this seems like that. (text on the button 'back to lobby') after clicking [image: image] https://cloud.githubusercontent.com/assets/9086983/11742726/d804189c-a00a-11e5-9644-d3f1c602e4de.png

— Reply to this email directly or view it on GitHub https://github.com/RJacksonm1/node-dota2/issues/179#issuecomment-163915116 .

oleghalin commented 8 years ago

Via nethook?

jimmydorry commented 8 years ago

I've linked it a million times. Re-read this thread.

oleghalin commented 8 years ago

Its just question. Just sec

jimmydorry commented 8 years ago

It's up ^^^ On Fri, 11 Dec 2015 at 9:30 pm oleghalin notifications@github.com wrote:

Its just ask.

— Reply to this email directly or view it on GitHub https://github.com/RJacksonm1/node-dota2/issues/179#issuecomment-163915654 .

oleghalin commented 8 years ago

image

jimmydorry commented 8 years ago

The instructions say

NetHook2 will now begin dumping every message to file. You can locate the dumps in your Steam install, under the nethook directory. The directories are numbered with the unix time that dumping began.

jimmydorry commented 8 years ago

It goes without saying that you need to perform the actions the bot will, so you can see what messages are being sent.

idreamshen commented 8 years ago

launchPracticeLobby, then abandonGame

oleghalin commented 8 years ago

abandonGame? node-dota havent this function

oleghalin commented 8 years ago

http://pastebin.com/RuJLYw6D in this file i get this, but what i must see there?

jimmydorry commented 8 years ago

https://github.com/RJacksonm1/node-dota2/blob/master/proto/dota_gcmessages_client.proto#L203

It's there, just no handler for it, most likely.

oleghalin commented 8 years ago

Hm. Ill write this handler, and this function need to disconnect or not to connect?

oleghalin commented 8 years ago

http://pastebin.com/Bhe3ZfTj can u check my hanlder?

idreamshen commented 8 years ago

first abandonCurrentGame(),then leavePracticeLobby().

https://github.com/idreamshen/node-dota2/blob/master/handlers/lobbies.js#L183 I wrote it for the source engine 1

oleghalin commented 8 years ago

Thank you, i think this working function:

Dota2.abandonCurrentGame();

hanlder:

Dota2.Dota2Client.prototype.abandonCurrentGame = function(callback) {
    callback = callback || null;
    var _self = this;

    if (!this._gcReady) {
        if (this.debug) util.log("GC not ready, please listen for the 'ready' event.");
        return null;
    }

    if (this.debug) util.log("Sending match CMsgAbandonCurrentGame request");
    var payload = new Dota2.schema.CMsgAbandonCurrentGame({});
    this._protoBufHeader.msg = Dota2.schema.EDOTAGCMsg.k_EMsgGCAbandonCurrentGame;
    this._gc.send(
        this._protoBufHeader,
        payload.toBuffer(),
        function(header, body) {
            onPracticeLobbyResponse.call(_self, body, callback);
        }
    );
};
jimmydorry commented 8 years ago

Feel free to make a pull request.

oleghalin commented 8 years ago

Oh no, sry. It isnt work. image

Apmats commented 8 years ago

The handler works for me and judging from the conversation here and from issue #56 it could be useful for others as well. Why no PR for this?

jimmydorry commented 8 years ago

Make a PR.

csplkiller commented 7 years ago

How to leave lobby after launching it? I need to have the bot launch the lobby, then leave the game, and immediately create a new lobby. How to implement this?

If I do first abandonCurrentGame(),then leavePracticeLobby()., then I get a red screen in the match, and trying to create a new lobby - I get into the old lobby

I need - disconnect bot from current game, and create new one...

oleghalin commented 7 years ago

Im using function like this

function leaveLobby()
{
    Dota2.abandonCurrentGame();
    Dota2.leavePracticeLobby();
    Dota2.leaveChat('Lobby_'+id);
}`
csplkiller commented 7 years ago

oleghalin Can I contact you? We swill both speak Russian. Skype planshetklik21, Viber +79516888868

csplkiller commented 7 years ago

If I use your function The situation does not change, so in the queue error And after the creation of the next lobby - it turns out that the bot Gets into the old lobby (game) ...

2017-04-15_12-33-13

oleghalin commented 7 years ago

Yes. Vk.com/pawno_ua