public void GameLeft(ChannelAPI.ChannelReferenceObject channelRefObject, RemoveNotification notification) { object[] objArray1 = new object[] { "GameLeft ChannelID: ", channelRefObject.m_channelData.m_channelId, " notification: ", notification }; base.ApiLog.LogDebug(string.Concat(objArray1)); if (this.s_gameRequest != 0) { this.s_gameRequest = 0L; } }
public void HandlePresenceUpdates(ChannelState channelState, ChannelAPI.ChannelReferenceObject channelRef) { BattleNet.DllEntityId id; id.hi = channelRef.m_channelData.m_channelId.High; id.lo = channelRef.m_channelData.m_channelId.Low; FieldKey key = new FieldKey(); key.SetProgram(BnetProgramId.BNET.GetValue()); key.SetGroup(1); key.SetField(3); FieldKey key2 = key; List <BattleNet.PresenceUpdate> collection = new List <BattleNet.PresenceUpdate>(); foreach (FieldOperation operation in channelState.FieldOperationList) { BattleNet.PresenceUpdate item = new BattleNet.PresenceUpdate { entityId = id, programId = operation.Field.Key.Program, groupId = operation.Field.Key.Group, fieldId = operation.Field.Key.Field, index = operation.Field.Key.Index, boolVal = false, intVal = 0L, stringVal = string.Empty, valCleared = false, blobVal = new byte[0] }; if (operation.Operation == FieldOperation.Types.OperationType.CLEAR) { item.valCleared = true; bool flag = key2.Program == operation.Field.Key.Program; bool flag2 = key2.Group == operation.Field.Key.Group; bool flag3 = key2.Field == operation.Field.Key.Field; if ((flag && flag2) && flag3) { BnetEntityId entityId = BnetEntityId.CreateFromDll(item.entityId); base.m_battleNet.Friends.RemoveFriendsActiveGameAccount(entityId, operation.Field.Key.Index); } } else if (operation.Field.Value.HasBoolValue) { item.boolVal = operation.Field.Value.BoolValue; } else if (operation.Field.Value.HasIntValue) { item.intVal = operation.Field.Value.IntValue; } else if (operation.Field.Value.HasStringValue) { item.stringVal = operation.Field.Value.StringValue; } else if (operation.Field.Value.HasFourccValue) { item.stringVal = new BnetProgramId(operation.Field.Value.FourccValue).ToString(); } else if (operation.Field.Value.HasEntityidValue) { item.entityIdVal.hi = operation.Field.Value.EntityidValue.High; item.entityIdVal.lo = operation.Field.Value.EntityidValue.Low; bool flag4 = key2.Program == operation.Field.Key.Program; bool flag5 = key2.Group == operation.Field.Key.Group; bool flag6 = key2.Field == operation.Field.Key.Field; if ((flag4 && flag5) && flag6) { BnetEntityId id3 = BnetEntityId.CreateFromDll(item.entityId); base.m_battleNet.Friends.AddFriendsActiveGameAccount(id3, operation.Field.Value.EntityidValue, operation.Field.Key.Index); } } else { if (!operation.Field.Value.HasBlobValue) { continue; } item.blobVal = operation.Field.Value.BlobValue; } collection.Add(item); } collection.Reverse(); this.m_presenceUpdates.AddRange(collection); }