Skip to content

Commit 445e1d4

Browse files
committed
fix
1 parent b589ec1 commit 445e1d4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

api/AltV.Net.Async/Elements/Entities/AsyncVoiceChannel.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Diagnostics.CodeAnalysis;
34
using AltV.Net.Elements.Entities;
45

@@ -75,6 +76,30 @@ public int Priority
7576
}
7677
}
7778

79+
public IReadOnlyCollection<IPlayer> Players
80+
{
81+
get
82+
{
83+
lock (VoiceChannel)
84+
{
85+
if (!AsyncContext.CheckIfExistsNullable(VoiceChannel)) return default;
86+
return VoiceChannel.Players;
87+
}
88+
}
89+
}
90+
91+
public ulong PlayerCount
92+
{
93+
get
94+
{
95+
lock (VoiceChannel)
96+
{
97+
if (!AsyncContext.CheckIfExistsNullable(VoiceChannel)) return default;
98+
return VoiceChannel.PlayerCount;
99+
}
100+
}
101+
}
102+
78103
public AsyncVoiceChannel(IVoiceChannel voiceChannel, IAsyncContext asyncContext) : base(voiceChannel,
79104
asyncContext)
80105
{

api/AltV.Net.Mock/MockVoiceChannel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using AltV.Net.Elements.Entities;
34

45
namespace AltV.Net.Mock
@@ -50,5 +51,7 @@ public void Destroy()
5051

5152
public uint Filter { get; set; }
5253
public int Priority { get; set; }
54+
public IReadOnlyCollection<IPlayer> Players { get; }
55+
public ulong PlayerCount { get; }
5356
}
5457
}

0 commit comments

Comments
 (0)