Skip to content

Commit 1c52556

Browse files
committed
Rename for Emy
1 parent 37a87e1 commit 1c52556

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/main/kotlin/com/lambda/event/listener/UnsafeListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class UnsafeListener<T : Event>(
192192
* @param function The function to be executed when the event is posted. This function should take a SafeContext and an event of type T as parameters.
193193
* @return The newly created and registered [UnsafeListener].
194194
*/
195-
inline fun <reified T : Event> Any.listenUnsafeConcurrently(
195+
inline fun <reified T : Event> Any.listenConcurrentlyUnsafe(
196196
priority: Int = 0,
197197
alwaysListen: Boolean = false,
198198
scheduler: CoroutineDispatcher = Dispatchers.Default,

src/main/kotlin/com/lambda/module/modules/network/PacketLogger.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717

1818
package com.lambda.module.modules.network
1919

20-
import com.google.gson.JsonPrimitive
2120
import com.lambda.Lambda
2221
import com.lambda.Lambda.mc
2322
import com.lambda.event.events.PacketEvent
2423
import com.lambda.event.events.TickEvent
2524
import com.lambda.event.listener.UnsafeListener.Companion.listenUnsafe
26-
import com.lambda.event.listener.UnsafeListener.Companion.listenUnsafeConcurrently
25+
import com.lambda.event.listener.UnsafeListener.Companion.listenConcurrentlyUnsafe
2726
import com.lambda.module.Module
2827
import com.lambda.module.tag.ModuleTag
2928
import com.lambda.threading.runIO
@@ -188,20 +187,20 @@ object PacketLogger : Module(
188187
it.packet.logSent()
189188
}
190189

191-
listenUnsafeConcurrently<PacketEvent.Receive.Pre> {
190+
listenConcurrentlyUnsafe<PacketEvent.Receive.Pre> {
192191
if (!logConcurrent
193192
|| !scope.shouldLog(it.packet)
194193
|| !networkSide.shouldLog(NetworkSide.Server)
195-
) return@listenUnsafeConcurrently
194+
) return@listenConcurrentlyUnsafe
196195

197196
it.packet.logReceived()
198197
}
199198

200-
listenUnsafeConcurrently<PacketEvent.Send.Pre> {
199+
listenConcurrentlyUnsafe<PacketEvent.Send.Pre> {
201200
if (!logConcurrent
202201
|| !scope.shouldLog(it.packet)
203202
|| !networkSide.shouldLog(NetworkSide.Client)
204-
) return@listenUnsafeConcurrently
203+
) return@listenConcurrentlyUnsafe
205204

206205
it.packet.logSent()
207206
}

src/main/kotlin/com/lambda/network/LambdaAPI.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import com.lambda.event.events.ClientEvent
2525
import com.lambda.event.events.ConnectionEvent
2626
import com.lambda.event.events.ConnectionEvent.Connect.Login.EncryptionResponse
2727
import com.lambda.event.listener.UnsafeListener.Companion.listenUnsafe
28-
import com.lambda.event.listener.UnsafeListener.Companion.listenUnsafeConcurrently
28+
import com.lambda.event.listener.UnsafeListener.Companion.listenConcurrentlyUnsafe
2929
import com.lambda.network.NetworkManager.updateToken
3030
import com.lambda.network.api.v1.endpoints.login
3131
import com.lambda.util.StringUtils.hash
@@ -58,7 +58,7 @@ object LambdaAPI : Configurable(LambdaConfig) {
5858
private var hash: String? = null
5959

6060
init {
61-
listenUnsafeConcurrently<ClientEvent.Startup> { authenticate() }
61+
listenConcurrentlyUnsafe<ClientEvent.Startup> { authenticate() }
6262

6363
listenUnsafe<EncryptionResponse> { event ->
6464
if (event.secretKey.isDestroyed) return@listenUnsafe
@@ -70,14 +70,14 @@ object LambdaAPI : Configurable(LambdaConfig) {
7070
hash = BigInteger(computed).toString(16)
7171
}
7272

73-
listenUnsafeConcurrently<ConnectionEvent.Connect.Post> {
73+
listenConcurrentlyUnsafe<ConnectionEvent.Connect.Post> {
7474
// FixMe: If the player have the properties but are invalid this doesn't work
75-
if (NetworkManager.isValid || mc.gameProfile.isOffline) return@listenUnsafeConcurrently
75+
if (NetworkManager.isValid || mc.gameProfile.isOffline) return@listenConcurrentlyUnsafe
7676

7777
// If we log in right as the client responds to the encryption request, we start
7878
// a race condition where the game server haven't acknowledged the packets
7979
// and posted to the sessionserver api
80-
login(mc.session.username, hash ?: return@listenUnsafeConcurrently)
80+
login(mc.session.username, hash ?: return@listenConcurrentlyUnsafe)
8181
.onSuccess { updateToken(it) }
8282
.onFailure { LOG.warn(it) }
8383
}

0 commit comments

Comments
 (0)