From: Carl Worth Date: Fri, 5 Jun 2020 13:57:04 +0000 (-0700) Subject: game: Index players directly by session ID X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b5a5c28f09756d7a7e65dd2bc75de130bc71e0dd;hp=b5a5c28f09756d7a7e65dd2bc75de130bc71e0dd;p=empires-server game: Index players directly by session ID Previously we were just storing the players in an unordered array, and doing an O(n) walk through the array to find a player with a session ID that matched the ID of interest. Instead, we now index directly with the session ID which is already guaranteed yo be unique and is convenient in JavaScript where we can use the session ID as a property name, and even use a convenient subscript syntax for that. With this change we don't even need to store the session_id property on the player since it is now not used at all. ---