mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Merge pull request #28357 from peppy/dont-fail-acks
Avoid `ChatAckRequest` failures flooding console in `OsuGameTestScene`s
This commit is contained in:
commit
981b69de2f
@ -59,7 +59,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case ChatAckRequest ack:
|
case ChatAckRequest ack:
|
||||||
ack.TriggerSuccess(new ChatAckResponse { Silences = silencedUserIds.Select(u => new ChatSilence { UserId = u }).ToList() });
|
ack.TriggerSuccess(new ChatAckResponse { Silences = silencedUserIds.Select(u => new ChatSilence { UserId = u }).ToArray() });
|
||||||
silencedUserIds.Clear();
|
silencedUserIds.Clear();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -84,6 +84,13 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
if (HandleRequest?.Invoke(request) != true)
|
if (HandleRequest?.Invoke(request) != true)
|
||||||
{
|
{
|
||||||
|
// Noisy so let's silently allow these to succeed.
|
||||||
|
if (request is ChatAckRequest ack)
|
||||||
|
{
|
||||||
|
ack.TriggerSuccess(new ChatAckResponse());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
request.Fail(new InvalidOperationException($@"{nameof(DummyAPIAccess)} cannot process this request."));
|
request.Fail(new InvalidOperationException($@"{nameof(DummyAPIAccess)} cannot process this request."));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Online.API
|
|||||||
string APIEndpointUrl { get; }
|
string APIEndpointUrl { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The root URL of of the website, excluding the trailing slash.
|
/// The root URL of the website, excluding the trailing slash.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string WebsiteRootUrl { get; }
|
string WebsiteRootUrl { get; }
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests.Responses
|
namespace osu.Game.Online.API.Requests.Responses
|
||||||
@ -10,6 +10,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
public class ChatAckResponse
|
public class ChatAckResponse
|
||||||
{
|
{
|
||||||
[JsonProperty("silences")]
|
[JsonProperty("silences")]
|
||||||
public List<ChatSilence> Silences { get; set; } = null!;
|
public ChatSilence[] Silences { get; set; } = Array.Empty<ChatSilence>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user