File tree Expand file tree Collapse file tree 4 files changed +29
-9
lines changed
Expand file tree Collapse file tree 4 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ private IEnumerator<float> Checks()
166166 /// </summary>
167167 private void OnDestroy ( )
168168 {
169- var audioPlayer = AudioPlayerBase . Get ( ReferenceHub ) ;
169+ var audioPlayer = Scp575AudioPlayer . Get ( ReferenceHub ) ;
170170 audioPlayer . Stoptrack ( true ) ;
171171
172172 Timing . KillCoroutines ( _checksCoroutine ) ;
Original file line number Diff line number Diff line change @@ -5,17 +5,13 @@ namespace SCP575.Resources
55{
66 public class FakeConnection : NetworkConnectionToClient
77 {
8- public FakeConnection ( int connectionId ) : base ( connectionId , false , 0f )
9- {
10- }
11-
12- public override string address => "localhost" ;
13-
148 public override void Send ( ArraySegment < byte > segment , int channelId = 0 )
159 {
1610 }
1711
18- public override void Disconnect ( )
12+ public override string address => "localhost" ;
13+
14+ public FakeConnection ( int networkConnectionId ) : base ( networkConnectionId , false , 0 )
1915 {
2016 }
2117 }
Original file line number Diff line number Diff line change 1+ using SCPSLAudioApi . AudioCore ;
2+ using VoiceChat ;
3+
4+ namespace SCP575 . Resources
5+ {
6+ public class Scp575AudioPlayer : AudioPlayerBase
7+ {
8+ public static Scp575AudioPlayer Get ( ReferenceHub hub )
9+ {
10+ if ( AudioPlayers . TryGetValue ( hub , out AudioPlayerBase player ) )
11+ {
12+ if ( player is Scp575AudioPlayer scp575Player1 )
13+ return scp575Player1 ;
14+ }
15+
16+ var scp575Player = hub . gameObject . AddComponent < Scp575AudioPlayer > ( ) ;
17+ scp575Player . Owner = hub ;
18+ scp575Player . BroadcastChannel = VoiceChatChannel . Proximity ;
19+
20+ AudioPlayers . Add ( hub , scp575Player ) ;
21+ return scp575Player ;
22+ }
23+ }
24+ }
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ private void Spawn575(float duration)
250250
251251 if ( ! Config . Scp575 . PlaySounds ) return ;
252252 if ( ! Extensions . AudioFileExist ( ) ) Log . Error ( $ "There is no .ogg file in the folder { AudioPath } ") ;
253- var audioPlayer = AudioPlayerBase . Get ( hubPlayer ) ;
253+ var audioPlayer = Scp575AudioPlayer . Get ( hubPlayer ) ;
254254 var audioFile = Extensions . GetAudioFilePath ( ) ;
255255 audioPlayer . Enqueue ( audioFile , - 1 ) ;
256256 audioPlayer . LogDebug = Config . AudioDebug ;
You can’t perform that action at this time.
0 commit comments