-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ppy#31527 from bdach/spectator-list-ready
Show spectating users during gameplay
- Loading branch information
Showing
17 changed files
with
267 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using MessagePack; | ||
using osu.Game.Users; | ||
|
||
namespace osu.Game.Online.Spectator | ||
{ | ||
[Serializable] | ||
[MessagePackObject] | ||
public class SpectatorUser : IUser, IEquatable<SpectatorUser> | ||
{ | ||
[Key(0)] | ||
public int OnlineID { get; set; } | ||
|
||
[Key(1)] | ||
public string Username { get; set; } = string.Empty; | ||
|
||
[IgnoreMember] | ||
public CountryCode CountryCode => CountryCode.Unknown; | ||
|
||
[IgnoreMember] | ||
public bool IsBot => false; | ||
|
||
public bool Equals(SpectatorUser? other) | ||
{ | ||
if (other is null) return false; | ||
if (ReferenceEquals(this, other)) return true; | ||
|
||
return OnlineID == other.OnlineID; | ||
} | ||
|
||
public override bool Equals(object? obj) => Equals(obj as SpectatorUser); | ||
|
||
// ReSharper disable once NonReadonlyMemberInGetHashCode | ||
public override int GetHashCode() => OnlineID; | ||
} | ||
} |
Oops, something went wrong.