Skip to content

Commit

Permalink
Merge pull request #277 from LossyDragon/dep-updates
Browse files Browse the repository at this point in the history
Dependency updates and post 1.5.0 fixes
  • Loading branch information
LossyDragon authored Sep 3, 2024
2 parents cdf6763 + d6c2cd6 commit 4a540f4
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

end_of_line = lf

[*.{kt,kts}]
ij_kotlin_packages_to_use_import_on_demand = java.util.**, in.dragonbra.javasteam.protobufs.steamclient.**, kotlinx.coroutines.**
indent_size = 4
Expand Down
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.gradle
/build/
/buildSrc/build/
/javasteam-tf/build/

# Ignore Gradle GUI config
gradle-app.setting

Expand Down Expand Up @@ -67,10 +62,19 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties

# JavaSteam
.gradle
/build/
/netlogs/
/buildSrc/build/
/javasteam-tf/build/

# JavaSteam Samples
cellid.txt
loginkey.txt
sentry.bin
server_list.bin

# Kotlin 2.0
/.kotlin/sessions/
*.salive
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {

allprojects {
group = "in.dragonbra"
version = "1.5.0"
version = "1.5.1"
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ dependencies {
implementation(gradleApi())

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation("commons-io:commons-io:2.16.0")
implementation("commons-io:commons-io:2.16.1")
// https://mvnrepository.com/artifact/com.squareup/kotlinpoet
implementation("com.squareup:kotlinpoet:1.16.0")
implementation("com.squareup:kotlinpoet:1.18.1")
}

gradlePlugin {
Expand Down
30 changes: 15 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
[versions]
# Java / Kotlin versions
java = "11"
kotlin = "1.9.23" # https://kotlinlang.org/docs/releases.html#release-details
kotlin = "2.0.20" # https://kotlinlang.org/docs/releases.html#release-details
dokka = "1.9.20" # https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-gradle-plugin
kotlinter = "4.3.0" # https://plugins.gradle.org/plugin/org.jmailen.kotlinter
kotlinter = "4.4.1" # https://plugins.gradle.org/plugin/org.jmailen.kotlinter

# Standard Library versions
bouncyCastle = "1.78" # https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on
commons-io = "2.16.0" # https://mvnrepository.com/artifact/commons-io/commons-io
commons-lang3 = "3.14.0" # https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
commons-validator = "1.8.0" # https://mvnrepository.com/artifact/commons-validator/commons-validator
gson = "2.10.1" # https://mvnrepository.com/artifact/com.google.code.gson/gson
bouncyCastle = "1.78.1" # https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on
commons-io = "2.16.1" # https://mvnrepository.com/artifact/commons-io/commons-io
commons-lang3 = "3.17.0" # https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
commons-validator = "1.9.0" # https://mvnrepository.com/artifact/commons-validator/commons-validator
gson = "2.11.0" # https://mvnrepository.com/artifact/com.google.code.gson/gson
jacoco = "0.8.12" # https://www.eclemma.org/jacoco
javaWebSocket = "1.5.6" # https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
kotlin-coroutines = "1.8.0" # https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
okHttp = "5.0.0-alpha.12" # https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
protobuf = "4.26.1" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
javaWebSocket = "1.5.7" # https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
kotlin-coroutines = "1.8.1" # https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
okHttp = "5.0.0-alpha.14" # https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
protobuf = "4.28.0" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
protobuf-gradle = "0.9.4" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-gradle-plugin
publishPlugin = "1.3.0" # https://mvnrepository.com/artifact/io.github.gradle-nexus/publish-plugin
qrCode = "1.0.1" # https://mvnrepository.com/artifact/pro.leaco.qrcode/console-qrcode

# Testing Lib versions
commonsCodec = "1.16.1" # https://mvnrepository.com/artifact/commons-codec/commons-codec
junit5 = "5.10.2" # https://mvnrepository.com/artifact/org.junit/junit-bom
mockWebServer = "5.0.0-alpha.12" # https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver3-junit5
mockitoVersion = "5.11.0" # https://mvnrepository.com/artifact/org.mockito/mockito-core
commonsCodec = "1.17.1" # https://mvnrepository.com/artifact/commons-codec/commons-codec
junit5 = "5.11.0" # https://mvnrepository.com/artifact/org.junit/junit-bom
mockWebServer = "5.0.0-alpha.14" # https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver3-junit5
mockitoVersion = "5.13.0" # https://mvnrepository.com/artifact/org.mockito/mockito-core

[libraries]
bouncyCastle = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bouncyCastle" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ open class AuthSession(
* @return An [AuthPollResult] containing tokens which can be used to log in to Steam.
*/
@Throws(AuthenticationException::class)
fun pollingWaitForResultCompat(): CompletableFuture<AuthPollResult> {
return scope.future { pollingWaitForResult() }
}
fun pollingWaitForResultCompat(): CompletableFuture<AuthPollResult> = scope.future { pollingWaitForResult() }

/**
* Handle any 2-factor authentication, and if necessary poll for updates until authentication succeeds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ class SteamFriends : ClientMsgHandler() {
* Results are returned in [PersonaStatesCallback].
*
* @param steamIdList A list of SteamIDs to request the info of.
* @param requestedInfo The requested info flags. If none specified, this uses [SteamConfiguration.getDefaultPersonaStateFlags].
* @param requestedInfo The requested info flags. If none specified, this uses [SteamConfiguration.defaultPersonaStateFlags].
*/
@JvmOverloads
fun requestFriendInfo(steamIdList: List<SteamID>, requestedInfo: Int = 0) {
Expand All @@ -557,7 +557,7 @@ class SteamFriends : ClientMsgHandler() {
* Results are returned in [PersonaStatesCallback].
*
* @param steamID A SteamID to request the info of.
* @param requestedInfo The requested info flags. If none specified, this uses [SteamConfiguration.getDefaultPersonaStateFlags].
* @param requestedInfo The requested info flags. If none specified, this uses [SteamConfiguration.defaultPersonaStateFlags].
*/
@JvmOverloads
fun requestFriendInfo(steamID: SteamID, requestedInfo: Int = 0) {
Expand Down Expand Up @@ -786,7 +786,9 @@ class SteamFriends : ClientMsgHandler() {
private fun handleFriendsList(packetMsg: IPacketMsg) {
val list = ClientMsgProtobuf<CMsgClientFriendsList.Builder>(CMsgClientFriendsList::class.java, packetMsg)

cache.localUser.steamID = client.steamID
client.steamID?.let {
cache.localUser.steamID = it
}

if (!list.body.bincremental) {
// if we're not an incremental update, the message contains all friends, so we should clear our current list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class Callback<TCall : ICallbackMsg> @JvmOverloads constructor(
func: Consumer<TCall>?,
private var mgr: ICallbackMgrInternals? = null,
var jobID: JobID = JobID.INVALID,
) : CallbackBase(), Closeable {
) : CallbackBase(),
Closeable {

private val onRun = func

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import `in`.dragonbra.javasteam.steam.discovery.ServerRecord
import `in`.dragonbra.javasteam.steam.steamclient.callbackmgr.CallbackMsg
import `in`.dragonbra.javasteam.util.NetHelpers
import java.net.InetSocketAddress
import java.util.*

/**
* This callback is received when the client has received the CM list from Steam.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ class AsyncJobMultiple<T : CallbackMsg>(
registerJob(client)
}

fun toDeferred(): CompletableDeferred<ResultSet> {
return tcs
}
fun toDeferred(): CompletableDeferred<ResultSet> = tcs

override fun addResult(callback: CallbackMsg?): Boolean {
if (callback == null) {
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/in/dragonbra/javasteam/types/AsyncJobSingle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ class AsyncJobSingle<T : CallbackMsg>(client: SteamClient, jobId: JobID) : Async
registerJob(client)
}

fun toDeferred(): CompletableDeferred<T> {
return tcs
}
fun toDeferred(): CompletableDeferred<T> = tcs

@Throws(CancellationException::class)
fun runBlock(): T {
return runBlocking { toDeferred().await() }
}
fun runBlock(): T = runBlocking { toDeferred().await() }

override fun addResult(callback: CallbackMsg?): Boolean {
requireNotNull(callback) { "callback must not be null" }
Expand Down

0 comments on commit 4a540f4

Please sign in to comment.