Closed m-bo-one closed 8 years ago
Because resp is always None
The timeout expires after 10s and the method returns None
. http://steam.readthedocs.io/en/latest/api/steam.client.html#steam.client.SteamClient.wait_event
Are you sure EMsgGCInviteToParty
is a job? A debug log would be nice to see what happens around the time the invite is sent.
log - https://gist.github.com/DeV1doR/62d235c6b68fc7a60cf252e7b7b7a8c1 I think InviteToParty must have the response handle, but can't find when it must be occur. I found in node-dota2 this: https://github.com/DeV1doR/node-dota2/blob/staging/handlers/parties.js#L5, and implement same here: https://github.com/DeV1doR/dota2/blob/party/dota2/features/party.py#L10, but when it must emit, have not find yet.
The timeout expires after 10s and the method returns None. http://steam.readthedocs.io/en/latest/api/steam.client.html#steam.client.SteamClient.wait_event
Yes I understand this, and it's return None when I already clicked on accept or decline.
UPD: I think I need to try something like:
self.on(EGCBaseMsg.EMsgGCPartyInviteResponse,
self.__handle_party_response)
def __handle_party_response(self, message):
self.emit('response_party_invite', message)
because in this message must be info about that user accepted or declined party.
Tried code above, this event not triggered and did not find in logs. When I accept or decline party invite, only triggering 5453 proto - EMsg.ClientFromGC(
@DeV1doR enable verbose_debug
on the dota2client instance, rather than on the steam client.
This is probably the response, but you need verbose_debug
to log the message contents.
Incoming: <EGCBaseMsg.EMsgGCInvitationCreated: 4502>
The actual party is a SO object, which gets updated when anything changes (e.g. someone leaving, etc). The cleanest and simplest way to approach implementing any functionality is to use NetHook
and record what messages get sent when you are doing stuff in the real client.
@rossengeorgiev , dota2 verbose_debug = True logs (with accept party) https://gist.github.com/DeV1doR/e4c758941fe282d3eb64986e4a7f9438
@rossengeorgiev, thank you) I think I understand, CMsgInviteToParty triggering when Player invite bot to party and when Player accept/decline in used CMsgInvitationCreated (need to test, just thoughts)
I was wrong, this
[2016-09-07 12:36:39,843] DEBUG Dota2Client: Incoming: <EGCBaseMsg.EMsgGCInvitationCreated: 4502>
msg: 4502
headerLength: 0
---------
group_id: 24716324451114646
steam_id: 76561198022766961
user_offline: false
just show invitation response after sending invite, it don't have data about if user accept or declined party( ok will try NetHook
Hello! On your examples I made functionality for parties but have some troubles for event triggering. (Part of party code. Need for explanation)
This code works, It send job to GC dota 2 and I get notification: But I can't handle it, when player accept/decline party by this code:
Because resp is always None( And don't understant why, same by logic code but in another style also did not trigger:
Full code of Party you can find here https://github.com/DeV1doR/dota2/tree/party (detailed https://github.com/DeV1doR/dota2/blob/party/dota2/features/party.py) and added in to FeatureBase.
For quick problem reproducing I paste gist with loader script: https://gist.github.com/DeV1doR/4e9e1ee414ca247cd15e3d0dcc3787f6