Simultaneous logins now possible on servers using in-memory account storage
This commit is contained in:
@@ -10,10 +10,11 @@ class InMemoryStorageProvider : AccountStorageProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getAccountInfo(username: String): UserAccountInfo {
|
override fun getAccountInfo(username: String): UserAccountInfo {
|
||||||
return storage[username] ?: UserAccountInfo.createDefault()
|
return storage[username] ?: UserAccountInfo.createDefault().also { it.uid = username.hashCode(); storage[username] = it }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun store(info: UserAccountInfo) {
|
override fun store(info: UserAccountInfo) {
|
||||||
|
info.uid = info.username.hashCode()
|
||||||
storage[info.username] = info
|
storage[info.username] = info
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user