-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06e2c16
commit cf540db
Showing
4 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { ServerGame } from "../../types/types"; | ||
import { postJson } from "../../utils/utils"; | ||
|
||
const fetchWithCookies = require("fetch-cookie")(fetch); | ||
|
||
const game: ServerGame = { | ||
id: "allbadcards", | ||
name: "All Bad Cards", | ||
author: "Jake Lauer", | ||
basedOn: { | ||
game: "Cards Against Humanity", | ||
link: "https://cardsagainsthumanity.com/", | ||
}, | ||
description: | ||
"Be rude. Be irreverent. Be hilarious! Select the card from your hand that you think is best described by a card played by the judge!", | ||
displayUrlText: "allbad.cards", | ||
displayUrlHref: "https://allbad.cards/", | ||
donationUrlText: "Support Jake on Patreon!", | ||
donationUrlHref: "https://www.patreon.com/Allbadcards", | ||
category: ["easy"], | ||
players: "4-20+", | ||
familyFriendly: false, | ||
getJoinGameUrl: async () => { | ||
const { guid } = await fetchWithCookies( | ||
"https://allbad.cards/api/user/register" | ||
).then((res) => res.json()); | ||
|
||
const { id } = await postJson( | ||
"https://allbad.cards/api/game/create", | ||
{ | ||
guid, | ||
nickname: "rocketcrab, leaving in 20 seconds!", | ||
isFamily: false, | ||
isPublic: false, | ||
}, | ||
fetchWithCookies | ||
); | ||
|
||
setTimeout(() => { | ||
postJson( | ||
"https://allbad.cards/api/game/kick", | ||
{ | ||
gameId: id, | ||
targetGuid: guid, | ||
guid: guid, | ||
}, | ||
fetchWithCookies | ||
) | ||
.then((a) => console.log(a)) | ||
.catch((e) => console.error(e)); | ||
}, 20 * 1000); | ||
|
||
return { playerURL: "https://allbad.cards/game/" + id }; | ||
}, | ||
}; | ||
|
||
export default game; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters