public void MatchMakerEndHandler(bnet.protocol.notification.Notification notification) { BattleNetErrors errors = (BattleNetErrors)((uint)ProtocolHelper.GetUintAttribute(notification.AttributeList, "error", 0L, null)); ulong num = ProtocolHelper.GetUintAttribute(notification.AttributeList, "game_request_id", 0L, null); object[] args = new object[] { num, (uint)errors }; base.ApiLog.LogDebug("MM_END requestId={0} code={1}", args); BattleNet.QueueEvent.Type queueType = BattleNet.QueueEvent.Type.QUEUE_LEAVE; switch (errors) { case BattleNetErrors.ERROR_OK: queueType = BattleNet.QueueEvent.Type.QUEUE_LEAVE; break; case BattleNetErrors.ERROR_GAME_MASTER_GAME_ENTRY_CANCELLED: queueType = BattleNet.QueueEvent.Type.QUEUE_CANCEL; break; case BattleNetErrors.ERROR_GAME_MASTER_GAME_ENTRY_ABORTED_CLIENT_DROPPED: queueType = BattleNet.QueueEvent.Type.ABORT_CLIENT_DROPPED; break; default: queueType = BattleNet.QueueEvent.Type.QUEUE_AMM_ERROR; break; } object[] objArray2 = new object[] { queueType, (uint)errors }; base.ApiLog.LogDebug("MatchMakerEndHandler event={0} code={1}", objArray2); this.AddQueueEvent(queueType, 0, 0, (int)errors, null); }
private void AddQueueEvent(BattleNet.QueueEvent.Type queueType, int minSeconds = 0, int maxSeconds = 0, int bnetError = 0, BattleNet.GameServerInfo gsInfo = null) { BattleNet.QueueEvent item = new BattleNet.QueueEvent(queueType, minSeconds, maxSeconds, bnetError, gsInfo); Queue <BattleNet.QueueEvent> queueEvents = this.m_queueEvents; lock (queueEvents) { this.m_queueEvents.Enqueue(item); } }
public void QueueExitHandler(bnet.protocol.notification.Notification notification) { BattleNetErrors errors = (BattleNetErrors)((uint)ProtocolHelper.GetUintAttribute(notification.AttributeList, "error", 0L, null)); ulong num = ProtocolHelper.GetUintAttribute(notification.AttributeList, "game_request_id", 0L, null); object[] args = new object[] { num, (uint)errors }; base.ApiLog.LogDebug("QueueExitHandler: requestId={0} code={1}", args); if (errors != BattleNetErrors.ERROR_OK) { BattleNet.QueueEvent.Type queueType = BattleNet.QueueEvent.Type.QUEUE_DELAY_ERROR; object[] objArray2 = new object[] { queueType, (uint)errors }; base.ApiLog.LogDebug("QueueExitHandler event={0} code={1}", objArray2); this.AddQueueEvent(queueType, 0, 0, (int)errors, null); } }
private void QueueUpdate(BattleNet.QueueEvent.Type queueType, bnet.protocol.notification.Notification notification) { int minSeconds = 0; int maxSeconds = 0; foreach (bnet.protocol.attribute.Attribute attribute in notification.AttributeList) { if ((attribute.Name == "min_wait") && attribute.Value.HasUintValue) { minSeconds = (int)attribute.Value.UintValue; } else if ((attribute.Name == "max_wait") && attribute.Value.HasUintValue) { maxSeconds = (int)attribute.Value.UintValue; } } this.AddQueueEvent(queueType, minSeconds, maxSeconds, 0, null); }