Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
prosif committed Dec 30, 2024
1 parent 1c299bb commit 4061928
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 3 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"squish-1009": "npm:[email protected]",
"squish-1010": "npm:[email protected]",
"squish-120": "npm:[email protected]",
"squish-130": "npm:[email protected]",
"ws": "7.5.10"
}
}
3 changes: 2 additions & 1 deletion src/common/squish-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ module.exports = {
'1008': require.resolve('squish-1008'),
'1009': require.resolve('squish-1009'),
'1010': require.resolve('squish-1010'),
'120': require.resolve('squish-120')
'120': require.resolve('squish-120'),
'130': require.resolve('squish-130')
};
4 changes: 2 additions & 2 deletions src/dashboard/game-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const versionSelector = ({ gameKey, currentVersion, onVersionChange, otherVersio
textInfo: {
text: '\u2190',
x: 70,
y: 10,
y: 17.5,
color: COLORS.HG_BLACK,
align: 'center',
size: 4
Expand All @@ -249,7 +249,7 @@ const versionSelector = ({ gameKey, currentVersion, onVersionChange, otherVersio
textInfo: {
text: '\u2192',
x: 90,
y: 10,
y: 17.5,
color: COLORS.HG_BLACK,
align: 'center',
size: 4
Expand Down
38 changes: 38 additions & 0 deletions src/games/hello-world/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { Colors, Game, GameNode, Shapes, ShapeUtils } = require('squish-120');
const COLORS = Colors.COLORS;

class HelloWorld extends Game {
static metadata() {
return {
squishVersion: '120',
};
}

constructor() {
super();
this.base = new GameNode.Shape({
shapeType: Shapes.POLYGON,
coordinates2d: ShapeUtils.rectangle(0, 0, 100, 100),
fill: COLORS.WHITE
});

const textNode = new GameNode.Text({
textInfo: {
x: 50,
y: 50,
align: 'center',
size: 2,
text: 'Hello, world!',
color: COLORS.BLACK
}
});

this.base.addChild(textNode);
}

getLayers() {
return [{root: this.base}];
}
}

module.exports = HelloWorld;
8 changes: 8 additions & 0 deletions src/util/homenames-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ const getLocalIP = () => {
const getPublicIP = () => new Promise((resolve, reject) => {
console.log("HDSFUHDSFDFS");
const req = (isSecure ? https : http).get(`${API_URL}/ip`, (res) => {
console.log("HJDSJKF");
let buf = '';
res.on('data', (chunk) => {
buf += chunk.toString();
});

res.on('end', () => {
console.log('coolclc');
resolve(buf.toString());
});
});
Expand All @@ -61,8 +63,12 @@ const makeGet = (path = '', headers = {}, username) => new Promise((resolve, rej
const protocol = HTTPS_ENABLED ? 'https' : 'http';
// todo: fix
getPublicIP().then(publicIp => {
console.log('dsfjkhdskjfhdskff 11i1i1');
const host = HTTPS_ENABLED ? (DOMAIN_NAME || (`${getUserHash(publicIp)}.${CERT_DOMAIN}`)) : 'localhost';
const base = `${protocol}://${host}:${getConfigValue('HOMENAMES_PORT')}`;
console.log("host and base");
console.log(host);
console.log(base);

(HTTPS_ENABLED ? https : http).get(`${base}${path}`, (res) => {
let buf = '';
Expand All @@ -86,6 +92,8 @@ const makePost = (path, _payload, username) => new Promise((resolve, reject) =>
port = getConfigValue('HOMENAMES_PORT');

getPublicIP().then(publicIp => {
console.log('sdhjkfhskg j11');
console.log('butt ' + publicIp + ':' + HTTPS_ENABLED)
hostname = HTTPS_ENABLED ? (DOMAIN_NAME || (`${getUserHash(publicIp)}.${CERT_DOMAIN}`)) : 'localhost';

const headers = {};
Expand Down

0 comments on commit 4061928

Please sign in to comment.