Changeset 285c3cc for pages/api/postgre
- Timestamp:
- 06/16/22 17:01:08 (3 years ago)
- Branches:
- main
- Children:
- 9bd09b0
- Parents:
- ebf5e04
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pages/api/postgre/index.js
rebf5e04 r285c3cc 170 170 /** 171 171 * /---------------------- GET ----------------------/ 172 * Returns the player's room, if the player was in one. 173 * Same as the one below, but this one is used in a game-specific context. 174 * @action get_player_info_on_enter 175 * @param session_id 176 */ 177 if (req.query?.action === 'get_player_info_on_enter' && req.query?.session_id) { 178 const session_id = req.query.session_id 179 const session = sessions.find(session => session.id === session_id) 180 181 if (session) { 182 res.json({ 183 success: true, 184 displayName: session.displayName, 185 session_id: session.id, 186 credits: session.credits, 187 }) 188 return ; 189 } 190 191 res.json({ 192 success: false, 193 }) 194 } 195 196 /** 197 * /---------------------- GET ----------------------/ 198 * Returns the player's room, if the player was in one. 199 * Same as the one above, but this one is used in a general context. 172 * Checks if the player is logged in, and returns his session if so. 200 173 * @action check_if_logged_in 201 174 * @param session_id
Note:
See TracChangeset
for help on using the changeset viewer.