forked from 2009Scape/Server
Simultaneous logins now possible on servers using in-memory account storage
This commit is contained in:
parent
52b8100c09
commit
17db0f27ef
1 changed files with 2 additions and 1 deletions
|
|
@ -10,10 +10,11 @@ class InMemoryStorageProvider : AccountStorageProvider {
|
|||
}
|
||||
|
||||
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) {
|
||||
info.uid = info.username.hashCode()
|
||||
storage[info.username] = info
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue