Skip to content

Commit

Permalink
0.0.19 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
narafrost authored Jan 6, 2024
2 parents c8d58b7 + e9bc10a commit a6e421f
Show file tree
Hide file tree
Showing 42 changed files with 2,621 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
curl --location --request POST "${{ secrets.SUPABASE_URL }}/storage/v1/object/delivery/smoke-${{ steps.package_version.outputs.version }}-x64.nsis.7z" --header "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}" --header "Content-Type: application/octet-stream" --data-binary "@./.build/nsis-web/smoke-${{ steps.package_version.outputs.version }}-x64.nsis.7z"
curl --location --request POST "${{ secrets.SUPABASE_URL }}/storage/v1/object/delivery/smoke%20Web%20Setup%20${{ steps.package_version.outputs.version }}.exe" --header "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}" --header "Content-Type: application/octet-stream" --data-binary "@./.build/nsis-web/smoke Web Setup ${{ steps.package_version.outputs.version }}.exe"
curl --location --request PUT "${{ secrets.SUPABASE_URL }}/storage/v1/object/delivery/latest.yml" --header "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}" --header "Content-Type: application/octet-stream" --data-binary "@./.build/nsis-web/latest.yml"
curl --location --request PUT "${{ secrets.SUPABASE_URL }}/storage/v1/object/delivery/smoke-0.0.0-x64.nsis.7z" --header "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}" --header "Content-Type: application/octet-stream" --data-binary "@./.build/nsis-web/smoke-${{ steps.package_version.outputs.version }}-x64.nsis.7z"
curl --location --request PUT "${{ secrets.SUPABASE_URL }}/storage/v1/object/delivery/smoke-0.0.18-x64.nsis.7z" --header "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}" --header "Content-Type: application/octet-stream" --data-binary "@./.build/nsis-web/smoke-${{ steps.package_version.outputs.version }}-x64.nsis.7z"
1 change: 0 additions & 1 deletion app-back/Services/Account/smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export default class SmokeAccount extends AbstractAccount {

async getProfileData(id: string): Promise<any> {
const result = await fetch(`/profile`, {id}, this.#token);
if(result.avatar) result.avatar = `${BASE_STORE}/${result.avatar}`;
result.smoke_id = result.id;
return result;
}
Expand Down
16 changes: 16 additions & 0 deletions app-back/Services/Forum/abstract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Service } from "../service";

export default class AbstractForum extends Service {

async getPosts(_game: any): Promise<any> {
return [];
}

async getFeaturedPost(_game: any): Promise<any> {
return {};
}

async newPost(_game: any, _post: any): Promise<any> {
return {};
}
}
345 changes: 345 additions & 0 deletions app-back/Services/Forum/smoke.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,345 @@
import { BASE_STORE, BASE_URL, anonKey } from "../smoke.config";
import AbstractForum from "./abstract";
const { ipcRenderer } = require("electron");

const fetch = async (url, data, token = null): Promise<any> => {
return await ipcRenderer.invoke('fetch',{
url: `${BASE_URL}${url}`,
options: {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token || anonKey}`,
...(token ? { "apiKey": anonKey } : {})
},
body: JSON.stringify(data || {} )
},
result: 'json'
})
}

export default class SmokeForum extends AbstractForum {

async newPost(_game: any, _post: any) {
if(!_game.smoke_id) return {};
const token = await ipcRenderer.invoke('get-session-storage', 'smoke-token');
const result = await fetch(`/post`, { game: _game.smoke_id, post: _post.content}, token);
return result?.post || {};
}
async getPosts(game) {
if(!game.smoke_id) return [];
const token = await ipcRenderer.invoke('get-session-storage', 'smoke-token');
const result = await fetch(`/feed`, { id: game.smoke_id }, token);
return result?.feed?.posts || [];
// return {
// mods: [
// {
// id: '1',
// type: 'mod',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '2',
// type: 'mod',
// title: 'Another post',
// description: 'This post has no image',
// sender: {
// avatar: 'smokedata://images/sc8d2v.jpg',
// username: 'username',
// },
// },
// {
// id: '3',
// type: 'mod',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '4',
// type: 'mod',
// title: 'Another post',
// description: 'This post has no image',
// sender: {
// avatar: 'smokedata://images/sc8d2v.jpg',
// username: 'username',
// },
// },
// {
// id: '5',
// type: 'mod',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '6',
// type: 'mod',
// title: 'Another post',
// description: 'This post has no image',
// sender: {
// avatar: 'smokedata://images/sc8d2v.jpg',
// username: 'username',
// },
// },
// ],
// servers: [
// {
// id: '1',
// type: 'server',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '2',
// type: 'server',
// title: 'Another post',
// description: 'This post has no image',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '3',
// type: 'server',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '4',
// type: 'server',
// title: 'Another post',
// description: 'This post has no image',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '5',
// type: 'server',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '6',
// type: 'server',
// title: 'Another post',
// description: 'This post has no image',
// image: 'smokedata://images/sc8d2v.jpg'
// }
// ],
// competitions: [
// {
// id: '1',
// type: 'tournament',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '2',
// type: 'tournament',
// title: 'Another post',
// description: 'This post has no image',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '3',
// type: 'tournament',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '4',
// type: 'tournament',
// title: 'Another post',
// description: 'This post has no image',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '5',
// type: 'tournament',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '6',
// type: 'tournament',
// title: 'Another post',
// description: 'This post has no image',
// image: 'smokedata://images/sc8d2v.jpg'
// }
// ],
// posts: [
// {
// id: '1',
// type: 'post',
// title: 'Game Patch 1',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '2',
// type: 'post',
// title: 'Another post',
// sender: {
// avatar: 'smokedata://images/sc8d2v.jpg',
// username: 'username',
// },
// description: 'This post has no image',
// },
// {
// id: '3',
// type: 'post',
// title: 'User Post',
// description: 'This is a user post',
// date: '2021-07-01',
// sender: {
// avatar: 'smokedata://images/sc8d2v.jpg',
// username: 'username',
// },
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '4',
// type: 'post',
// title: 'Game Patch 3',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '5',
// type: 'post',
// title: 'Another post',
// description: 'This post has no image',
// sender: {
// avatar: 'smokedata://images/sc8d2v.jpg',
// username: 'username',
// },
// },
// {
// id: '6',
// type: 'post',
// title: 'Game Patch 4',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// {
// id: '7',
// type: 'post',
// title: 'Game Patch 5',
// description: 'This is the first update for the game',
// date: '2021-07-01',
// image: 'smokedata://images/sc8d2v.jpg'
// },
// ],
// wiki: {
// "Gameplay": [
// {
// title: "Introduction to gameplay",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Story": [
// {
// title: "Introduction to story",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Characters": [
// {
// title: "Introduction to characters",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Locations": [
// {
// title: "Introduction to locations",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Items": [
// {
// title: "Introduction to items",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Enemies": [
// {
// title: "Introduction to enemies",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Weapons": [
// {
// title: "Introduction to weapons",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Armor": [
// {
// title: "Introduction to armor",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// "Skills": [
// {
// title: "Introduction to skills",
// content: "This is the introduction"
// },
// {
// title: "How to play",
// content: "This is how to play"
// }
// ],
// }
// }
}
}
2 changes: 2 additions & 0 deletions app-back/Services/Metadata/igdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default class IGDBMetadata extends AbstractScanner {
name: game.name,
image: data?.result?.cover,
banner: data?.result?.banner,
smoke_id: data?.result?.id,
igdb_id: data?.result?.id,//TODO: change to igdb_id
description: "No description yet",
};
}
Expand Down
Loading

0 comments on commit a6e421f

Please sign in to comment.