Feat: nullable roomid
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user