Implement final changes for custom launcher

This commit is contained in:
rockisch
2023-11-15 18:33:12 -03:00
parent 405e65346b
commit a0b50bdf8d
5 changed files with 166 additions and 29 deletions

View File

@@ -122,3 +122,13 @@ func (s *Server) getReturnExpiry(uid uint32) time.Time {
s.db.Exec("UPDATE users SET last_login=$1 WHERE id=$2", time.Now(), uid)
return returnExpiry
}
func (s *Server) exportSave(ctx context.Context, uid uint32, cid uint32) (map[string]interface{}, error) {
row := s.db.QueryRowxContext(ctx, "SELECT * FROM characters WHERE id=$1 AND user_id=$2", cid, uid)
result := make(map[string]interface{})
err := row.MapScan(result)
if err != nil {
return nil, err
}
return result, nil
}