Added function to check sessions dict for an already connected user.account . If a match is found, then the connection is closed through transport.loseConnection() (note that GameProtocol.connectionLost() will remove the entry from sessions on this call)
Ran black to match formatting standards
Testing
No 2 concurrent sessions are allowed. The old connection will be kicked and the new connection can successfully log in
Notes
Short PR addressing this task.
sessions
dict for an already connecteduser.account
. If a match is found, then the connection is closed throughtransport.loseConnection()
(note thatGameProtocol.connectionLost()
will remove the entry fromsessions
on this call)Testing