Skip to content

Initial indieGala support #3532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
"i18next-fs-backend": "2.1.1",
"i18next-http-backend": "2.1.1",
"ini": "3.0.0",
"js-yaml": "^4.1.0",
"json5": "2.2.3",
"plist": "3.0.5",
"react": "18.2.0",
Expand Down Expand Up @@ -236,6 +237,7 @@
"@types/i18next-fs-backend": "1.1.4",
"@types/ini": "1.3.31",
"@types/jest": "29.4.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "18.15.0",
"@types/plist": "3.0.2",
"@types/react": "18.2.34",
Expand Down
Binary file added public/bin/linux/freecarnival
Binary file not shown.
4 changes: 4 additions & 0 deletions public/locales/en/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
"main-story": "Main Story"
},
"howLongToBeat": "How Long To Beat",
"import": {
"indiegala": "Import is not supported on IndieGala"
},
"info": {
"apple-gaming-wiki": "AppleGamingWiki Rating",
"canRunOffline": "Online Required",
Expand Down Expand Up @@ -190,6 +193,7 @@
"amazon": "You are not logged in with an Amazon account in Heroic. Don't use the store page to login, click the following button instead:",
"epic": "You are not logged in with an Epic account in Heroic. Don't use the store page to login, click the following button instead:",
"gog": "You are not logged in with a GOG account in Heroic. Don't use the store page to login, click the following button instead:",
"indieGala": "You are not logged in with an indieGala account in Heroic. Don't use the store page to login, click the following button instead:",
"login": "Log in",
"title": "You are NOT logged in"
},
Expand Down
2 changes: 2 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@
"part2": "For other places, use a symbolic link to one of these folders"
}
},
"indie-gala": "IndieGala",
"info": {
"heroic": {
"beta": "Beta",
Expand Down Expand Up @@ -391,6 +392,7 @@
"amazon": "Amazon Login",
"epic": "Epic Games Login",
"gog": "GOG Login",
"indiegala": "indieGala Login",
"message": "Login with your platform. You can login to more than one platform at the same time.",
"old-mac": "Your macOS version is {{version}}. macOS 12 or newer is required to log in."
},
Expand Down
3 changes: 3 additions & 0 deletions src/backend/api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export const getUserInfo = async () => ipcRenderer.invoke('getUserInfo')
export const getAmazonUserInfo = async () =>
ipcRenderer.invoke('getAmazonUserInfo')

export const getIndieGalaUserInfo = async () =>
ipcRenderer.invoke('getIndieGalaUserInfo')

export const syncSaves = async (args: {
arg: string | undefined
path: string
Expand Down
3 changes: 3 additions & 0 deletions src/backend/api/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export const getAmazonLoginData = async () =>
export const authAmazon = async (data: NileRegisterData) =>
ipcRenderer.invoke('authAmazon', data)
export const logoutAmazon = async () => ipcRenderer.invoke('logoutAmazon')
export const logoutCarnival = async () => ipcRenderer.invoke('logoutCarnival')
export const authCarnival = async () => ipcRenderer.invoke('authCarnival')
export const checkGameUpdates = async () =>
ipcRenderer.invoke('checkGameUpdates')
export const refreshLibrary = async (library?: Runner | 'all') =>
Expand All @@ -89,6 +91,7 @@ export const gamepadAction = async (args: GamepadActionArgs) =>

export const logError = (error: string) => ipcRenderer.send('logError', error)
export const logInfo = (info: string) => ipcRenderer.send('logInfo', info)
export const logDebug = (debug: string) => ipcRenderer.send('logDebug', debug)
export const showConfigFileInFolder = (appName: string) =>
ipcRenderer.send('showConfigFileInFolder', appName)
export const openFolder = (installPath: string) =>
Expand Down
14 changes: 14 additions & 0 deletions src/backend/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ const anticheatDataPath = join(appFolder, 'areweanticheatyet.json')
const imagesCachePath = join(appFolder, 'images-cache')
const fixesPath = join(appFolder, 'fixes')

const carnivalConfigPath = join(appFolder, 'carnival_config')
const carnivalInstalled = join(carnivalConfigPath, 'installed.yml')
const carnivalLibrary = join(carnivalConfigPath, 'library.yml')
const carnivalLogFile = ''
const carnivalCookieData = join(carnivalConfigPath, 'cookies.yml')
const carnivalUserData = join(carnivalConfigPath, 'user.yml')

const {
currentLogFile,
lastLogFile,
Expand All @@ -86,6 +93,7 @@ const gogdlAuthConfig = join(app.getPath('userData'), 'gog_store', 'auth.json')
const vulkanHelperBin = fixAsarPath(
join(publicDir, 'bin', process.platform, 'vulkan-helper')
)

const icon = fixAsarPath(join(publicDir, 'icon.png'))
const iconDark = fixAsarPath(join(publicDir, 'icon-dark.png'))
const iconLight = fixAsarPath(join(publicDir, 'icon-light.png'))
Expand Down Expand Up @@ -284,5 +292,11 @@ export {
nileInstalled,
nileLibrary,
nileUserData,
carnivalConfigPath,
carnivalInstalled,
carnivalLibrary,
carnivalLogFile,
carnivalUserData,
carnivalCookieData,
fixesPath
}
1 change: 1 addition & 0 deletions src/backend/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum LogPrefix {
Legendary = 'Legendary',
Gog = 'Gog',
Nile = 'Nile',
Carnival = 'Carnival',
WineDownloader = 'WineDownloader',
DXVKInstaller = 'DXVKInstaller',
GlobalConfig = 'GlobalConfig',
Expand Down
8 changes: 7 additions & 1 deletion src/backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ import {
getGameSdl
} from 'backend/storeManagers/legendary/library'
import { storeMap } from 'common/utils'
import { CarnivalUser } from './storeManagers/carnival/user'

app.commandLine?.appendSwitch('ozone-platform-hint', 'auto')

Expand Down Expand Up @@ -812,13 +813,18 @@ ipcMain.handle('getUserInfo', async () => {

ipcMain.handle('getAmazonUserInfo', async () => NileUser.getUserData())

ipcMain.handle('getIndieGalaUserInfo', async () => CarnivalUser.getUserData())

// Checks if the user have logged in with Legendary already
ipcMain.handle('isLoggedIn', LegendaryUser.isLoggedIn)

ipcMain.handle('login', async (event, sid) => LegendaryUser.login(sid))
ipcMain.handle('authGOG', async (event, code) => GOGUser.login(code))
ipcMain.handle('logoutLegendary', LegendaryUser.logout)
ipcMain.on('logoutGOG', GOGUser.logout)
ipcMain.handle('logoutCarnival', CarnivalUser.logout)
ipcMain.handle('authCarnival', async () => CarnivalUser.login())

ipcMain.handle('getLocalPeloadPath', async () => {
return fixAsarPath(join('file://', publicDir, 'webviewPreload.js'))
})
Expand Down Expand Up @@ -974,7 +980,7 @@ ipcMain.handle('refreshLibrary', async (e, library?) => {
})

ipcMain.on('logError', (e, err) => logError(err, LogPrefix.Frontend))

ipcMain.on('logDebug', (e, debug) => logDebug(debug, LogPrefix.Frontend))
ipcMain.on('logInfo', (e, info) => logInfo(info, LogPrefix.Frontend))

let powerDisplayId: number | null
Expand Down
2 changes: 2 additions & 0 deletions src/backend/save_sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ async function getDefaultSavePath(
return getDefaultGogSavePaths(appName, alreadyDefinedGogSaves)
case 'nile':
return ''
case 'carnival':
return ''
case 'sideload':
return ''
}
Expand Down
16 changes: 16 additions & 0 deletions src/backend/storeManagers/carnival/electronStores.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import CacheStore from 'backend/cache'
import { TypeCheckedStoreBackend } from 'backend/electron_store'
import { GameInfo } from 'common/types'
import { CarnivalInstallInfo } from 'common/types/carnival'

export const installStore = new CacheStore<CarnivalInstallInfo>(
'carnival_install_info'
)
export const libraryStore = new CacheStore<GameInfo[], 'library'>(
'carnival_library',
null
)

export const configStore = new TypeCheckedStoreBackend('carnivalConfigStore', {
cwd: 'carnival_store'
})
Loading
Loading