@@ -11,7 +11,7 @@ import io.github.rothes.esu.core.util.NetworkUtils
1111import io.github.rothes.esu.velocity.module.NetworkThrottleModule
1212import io.github.rothes.esu.velocity.module.NetworkThrottleModule.config
1313import io.github.rothes.esu.velocity.module.NetworkThrottleModule.lang
14- import io.github.rothes.esu.velocity.module.networkthrottle.channel.ChannelInjectorController
14+ import io.github.rothes.esu.velocity.module.networkthrottle.channel.ChannelInjectionManager
1515import io.github.rothes.esu.velocity.module.networkthrottle.channel.DecoderChannelHandler
1616import io.github.rothes.esu.velocity.module.networkthrottle.channel.EncoderChannelHandler
1717import io.github.rothes.esu.velocity.module.networkthrottle.channel.PacketData
@@ -99,30 +99,30 @@ object TrafficMonitor {
9999 NetworkThrottleModule .unregisterListener(Listeners )
100100 if (viewers.isNotEmpty()) {
101101 viewers.clear()
102- ChannelInjectorController .unregisterHandler(EncoderHandler )
103- ChannelInjectorController .unregisterHandler(DecoderHandler )
102+ ChannelInjectionManager .unregisterHandler(EncoderHandler )
103+ ChannelInjectionManager .unregisterHandler(DecoderHandler )
104104 }
105105 }
106106
107107 fun forceRecord () {
108108 if (forceRun.getAndAdd(1 ) == 0 ) {
109- ChannelInjectorController .registerHandler(EncoderHandler )
110- ChannelInjectorController .registerHandler(DecoderHandler )
109+ ChannelInjectionManager .registerHandler(EncoderHandler )
110+ ChannelInjectionManager .registerHandler(DecoderHandler )
111111 }
112112 }
113113
114114 fun cancelForceRecord () {
115115 if (forceRun.addAndGet(- 1 ) == 0 && viewers.isEmpty()) {
116- ChannelInjectorController .unregisterHandler(EncoderHandler )
117- ChannelInjectorController .unregisterHandler(DecoderHandler )
116+ ChannelInjectionManager .unregisterHandler(EncoderHandler )
117+ ChannelInjectionManager .unregisterHandler(DecoderHandler )
118118 }
119119 }
120120
121121 fun addViewer (user : User , unit : Unit ) {
122122 synchronized(viewers) {
123123 if (viewers.isEmpty()) {
124- ChannelInjectorController .registerHandler(EncoderHandler )
125- ChannelInjectorController .registerHandler(DecoderHandler )
124+ ChannelInjectionManager .registerHandler(EncoderHandler )
125+ ChannelInjectionManager .registerHandler(DecoderHandler )
126126 }
127127 viewers[user] = unit
128128 }
@@ -132,8 +132,8 @@ object TrafficMonitor {
132132 synchronized(viewers) {
133133 viewers.remove(user)
134134 if (viewers.isEmpty() && forceRun.get() == 0 ) {
135- ChannelInjectorController .unregisterHandler(EncoderHandler )
136- ChannelInjectorController .unregisterHandler(DecoderHandler )
135+ ChannelInjectionManager .unregisterHandler(EncoderHandler )
136+ ChannelInjectionManager .unregisterHandler(DecoderHandler )
137137 }
138138 }
139139 }
0 commit comments