Skip to content

Commit

Permalink
A few bugfixes, release 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
paralin committed Jun 21, 2015
1 parent aba9914 commit c094086
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dota2/Dota2.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Dota2</id>
<version>0.2.1</version>
<version>0.2.2</version>
<title>Dota2</title>
<authors>paralin</authors>
<licenseUrl>https://github.com/paralin/Dota2/blob/master/Dota2/license.txt</licenseUrl>
Expand Down
1 change: 1 addition & 0 deletions Dota2/Engine/DotaGameClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public DotaGameClient(DotaGCHandler gc, CallbackManager cb, IPAddress publicIp =
/// </summary>
public void Dispose()
{
Disconnect();
foreach (var cb in _registeredCallbacks)
Callbacks.Unregister(cb);
_registeredCallbacks.Clear();
Expand Down
18 changes: 13 additions & 5 deletions Dota2/GC/DotaGCHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,21 @@ public void JoinLobby(ulong lobbyId, string pass_key = null)
}

/// <summary>
/// Leave a lobby
/// Attempt to leave a lobby
/// </summary>
public void LeaveLobby()
{
var leaveLobby =
new ClientGCMsgProtobuf<CMsgPracticeLobbyLeave>((uint) EDOTAGCMsg.k_EMsgGCPracticeLobbyLeave);
Lobby = null;
Send(leaveLobby);
}

/// <summary>
/// Leave a party.
/// Attempt to leave a party.
/// </summary>
public void LeaveParty()
{
var leaveParty = new ClientGCMsgProtobuf<CMsgLeaveParty>((uint) EGCBaseMsg.k_EMsgGCLeaveParty);
Party = null;
Send(leaveParty);
}

Expand Down Expand Up @@ -619,11 +617,21 @@ private void HandleSubscribedType(CMsgSOCacheSubscribed.SubscribedType cache)
public void HandleCacheDestroy(IPacketGCMsg obj)
{
var dest = new ClientGCMsgProtobuf<CMsgSOSingleObject>(obj);
if (PartyInvite != null && dest.Body.type_id == (int)CSOTypes.PARTY)
if (PartyInvite != null && dest.Body.type_id == (int)CSOTypes.PARTYINVITE)
{
PartyInvite = null;
Client.PostCallback(new PartyInviteLeave(null));
}
else if (Lobby != null && dest.Body.type_id == (int) CSOTypes.LOBBY)
{
Lobby = null;
Client.PostCallback(new PracticeLobbyLeave(null));
}
else if (Party != null && dest.Body.type_id == (int) CSOTypes.PARTY)
{
Party = null;
Client.PostCallback(new PartyLeave(null));
}
}

private void HandleCacheUnsubscribed(IPacketGCMsg obj)
Expand Down

0 comments on commit c094086

Please sign in to comment.