mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-09-25 16:55:31 -05:00
GPCM: Do updatepro/getprofile in the right order
This commit is contained in:
@@ -2,8 +2,9 @@ package database
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
"wwfc/common"
|
||||
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -88,8 +89,10 @@ func LoginUserToGCPM(pool *pgxpool.Pool, ctx context.Context, authToken string)
|
||||
// Create the GPCM account
|
||||
user.CreateUser(pool, ctx)
|
||||
} else {
|
||||
// TODO get the profile ID!!!!!
|
||||
user.ProfileId = 474888031
|
||||
err := pool.QueryRow(ctx, GetUserProfileID, userId).Scan(&user.ProfileId)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
return user
|
||||
|
||||
@@ -3,9 +3,10 @@ package database
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"wwfc/common"
|
||||
|
||||
"github.com/jackc/pgx/v4"
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
"wwfc/common"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -15,6 +16,7 @@ const (
|
||||
CreateUserSession = `INSERT INTO sessions (session_key, profile_id, login_ticket) VALUES ($1, $2, $3)`
|
||||
DoesUserExist = `SELECT EXISTS(SELECT 1 FROM users WHERE user_id = $1 AND gsbrcd = $2)`
|
||||
DeleteUserSession = `DELETE FROM sessions WHERE profile_id = $1`
|
||||
GetUserProfileID = `SELECT profile_id FROM users WHERE user_id = $1`
|
||||
)
|
||||
|
||||
type User struct {
|
||||
|
||||
Reference in New Issue
Block a user