Feat: nullable roomid

This commit is contained in:
Grail Finder
2025-07-03 12:29:39 +03:00
parent 2a593739ae
commit d8338fe382
6 changed files with 25 additions and 14 deletions

View File

@ -110,8 +110,11 @@ func HandleFrontLogin(w http.ResponseWriter, r *http.Request) {
// room.PlayerList = append(room.PlayerList, fi.State.Username)
fi.Room = room
fi.List = nil
fi.State.RoomID = room.ID
repo.PlayerSetRoomID(r.Context(), fi.State.Username, room.ID)
fi.State.RoomID = &room.ID
if err := repo.PlayerSetRoomID(r.Context(), fi.State.Username, room.ID); err != nil {
abortWithError(w, err.Error())
return
}
// repo.RoomUpdate()
// save full info instead
// if err := saveFullInfo(r.Context(), fi); err != nil {
@ -191,6 +194,7 @@ func makeCookie(username string, remote string) (*http.Cookie, error) {
return cookie, nil
}
//nolint: unused
func cacheGetSession(key string) (*models.Session, error) {
userSessionB, err := cache.MemCache.Get(key)
if err != nil {