-
Notifications
You must be signed in to change notification settings - Fork 63
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
Feature/environment configuration #116
base: main
Are you sure you want to change the base?
Changes from all commits
e9d0dc7
dfa0122
21c3bc1
a82e2ef
1912709
eaa7629
17c7a16
2be5f4d
6c18af3
3455645
8c20b82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/secrets.py | ||
/environment.py | ||
/node/live_variables.js | ||
/node/variables.js | ||
/stack/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
{% elif content=="contact"%} | ||
You can always email me at [email protected] | ||
|
||
Also check out our <a class="eexternal" href="https://discord.gg/44yUVeU" target="_blank" style="border-color: #3386CF">Discord!</a> - You can PM Wizard on Discord for faster and more informal replies :) | ||
Also check out our <a class="eexternal" href="{{domain.discord_url}}" target="_blank" style="border-color: #3386CF">Discord!</a> - You can PM Wizard on Discord for faster and more informal replies :) | ||
{%endif%} | ||
</div> | ||
</td></tr> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3270,27 +3270,34 @@ function appengine_call(method, args, on_success, on_error) { | |
} | ||
|
||
function discord_call(message) { | ||
// TODO: should it not post to the channel either way? I vote to remove this return | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd argue that the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think standard, hardcore and test servers are run from the same directory though. So they all share the same variables.js file. Should the test server actually post to the same channels as the live servers? The same question is true for hardcore servers. I kinda feel they perhaps need their own configuration as theese two servers are a special kind of servers. |
||
if (gameplay == "hardcore" || gameplay == "test") { | ||
return; | ||
} | ||
|
||
if (is_sdk) { | ||
return server_log("Discord: " + message); | ||
server_log("Discord: " + message); | ||
} | ||
var url = "https://discordapp.com/api/channels/404333059018719233/messages"; | ||
|
||
if (!variables.DISCORD.ENABLED) { | ||
return; | ||
} | ||
|
||
var url = variables.DISCORD.EVENT_CHANNELS.DEFAULT; // #game_events | ||
if (message.search(" joined Adventure Land") != -1) { | ||
url = "https://discordapp.com/api/channels/839163123499794481/messages"; | ||
url = variables.DISCORD.EVENT_CHANNELS.NEW_PLAYER; // #new_players | ||
} | ||
request( | ||
{ | ||
url: url, | ||
headers: { Authorization: "Bot " + variables.discord_token }, | ||
headers: { Authorization: "Bot " + variables.DISCORD.TOKEN }, | ||
method: "POST", | ||
json: { | ||
content: message, | ||
}, | ||
}, | ||
function (err, response, body) { | ||
//console.log(response); | ||
console.log(err, response); | ||
}, | ||
); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
GAME_NAME = "Adventure Land" | ||
APPENGINE_ID = "twodimensionalgame" | ||
DOMAIN_NAME = "adventure.land" | ||
#IMPORTANT: SPECIAL PAGE RULES ARE NEEDED: https://dash.cloudflare.com/b6f5a13bded5fdd273e4a1cd3777162d/adventure.land/page-rules - uss1 / eus1 was best | ||
IP_TO_SUBDOMAIN = { | ||
thmsndk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"35.187.255.184":"asia1", | ||
"35.246.244.105":"eu1", | ||
"35.228.96.241":"eu2", | ||
"35.234.72.136":"eupvp", | ||
"35.184.37.35":"us1", | ||
"34.67.188.57":"us2", | ||
"34.75.5.124":"us3", | ||
"34.67.187.11":"uspvp", | ||
"195.201.181.245":"eud1", | ||
"158.69.23.127":"usd1" | ||
} | ||
|
||
# This is responsible for mapping the correct ip/domain that the client should use to connect with in the websocket | ||
CREATE_SERVER_MAPPING = { | ||
|
||
# example of how thmsn.adventureland.community works | ||
# "EUI": "eu1.thmsn.adventureland.community" | ||
|
||
# When running a local test server on your private machine | ||
"EUI": "localhost" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
module.exports = { | ||
cfunctions_path: "./server/common_functions.js", | ||
functions_path: "./server/server_functions.js", | ||
worker_path: "./server/server_worker.js", | ||
data_path: "./server/data.js", | ||
base_url: "https://yourappspoturldontincludedashes.appspot.com", | ||
keyword: "123", | ||
access_master: "123", | ||
bot_key: "123", | ||
discord_token: "NDXXXXXXXXXXX...", | ||
apple_token: "acXXXXXXXX...", | ||
steam_key: "8aXXXXXXXXX...", | ||
steam_web_key: "B4XXXXXXX...", | ||
steam_partner_key: "F9XXXXXXX...", | ||
close_timeout: 24000, | ||
ip_limit: 3, | ||
character_limit: 3, | ||
cfunctions_path: "./server/common_functions.js", | ||
functions_path: "./server/server_functions.js", | ||
worker_path: "./server/server_worker.js", | ||
data_path: "./server/data.js", | ||
base_url: "https://yourappspoturldontincludedashes.appspot.com", | ||
keyword: "123", | ||
access_master: "123", | ||
bot_key: "123", | ||
apple_token: "acXXXXXXXX...", | ||
steam_key: "8aXXXXXXXXX...", | ||
steam_web_key: "B4XXXXXXX...", | ||
steam_partner_key: "F9XXXXXXX...", | ||
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, those tokens can probably move to |
||
close_timeout: 24000, | ||
ip_limit: 3, | ||
character_limit: 3, | ||
DISCORD: { | ||
ENABLED: false, | ||
TOKEN: "NDXXXXXXXXXXX", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicated token? Why is this here as well? (Maybe you don't even know) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The live variables is used as part of the deploy process on the official servers as far as I understand, there is a script that copies this and some other folders into the deployed directory. |
||
EVENT_CHANNELS: { | ||
DEFAULT: "https://discordapp.com/api/channels/404333059018719233/messages", | ||
NEW_PLAYER: "https://discordapp.com/api/channels/839163123499794481/messages", | ||
}, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,10 @@ | |
ssh-keygen -o #Doesn't work | ||
ssh-keygen -t rsa -b 4096 | ||
""" | ||
|
||
# Discord | ||
DISCORD = { | ||
"URL": { | ||
"WELCOME": "https://discord.gg/44yUVeU" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be named There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, was just an easy name to represent it as the welcome link i think the welcome name made sense in context of where it was used, I'd have to verify it again though |
||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
const path = require("node:path"); | ||
|
||
module.exports = { | ||
cfunctions_path: path.resolve(__dirname, "../js/common_functions.js"), | ||
functions_path: path.resolve(__dirname, "server_functions.js"), | ||
worker_path: path.resolve(__dirname, "server_worker.js"), | ||
data_path: path.resolve(__dirname, "data.js"), | ||
base_url: "http://thegame.com", | ||
keyword: "123", | ||
access_master: "123", | ||
bot_key: "123", | ||
discord_token: "NDXXXXXXXXXXX...", | ||
apple_token: "acXXXXXXXX...", | ||
steam_key: "8aXXXXXXXXX...", | ||
steam_web_key: "B4XXXXXXX...", | ||
steam_partner_key: "F9XXXXXXX...", | ||
is_sdk: 1, | ||
close_timeout: 4000, | ||
ip_limit: 3, | ||
character_limit: 3, | ||
fast_sdk: 0, | ||
cfunctions_path: path.resolve(__dirname, "../js/common_functions.js"), | ||
functions_path: path.resolve(__dirname, "server_functions.js"), | ||
worker_path: path.resolve(__dirname, "server_worker.js"), | ||
data_path: path.resolve(__dirname, "data.js"), | ||
base_url: "http://thegame.com", | ||
keyword: "123", | ||
access_master: "123", | ||
bot_key: "123", | ||
apple_token: "acXXXXXXXX...", | ||
steam_key: "8aXXXXXXXXX...", | ||
steam_web_key: "B4XXXXXXX...", | ||
steam_partner_key: "F9XXXXXXX...", | ||
is_sdk: 1, | ||
close_timeout: 4000, | ||
ip_limit: 3, | ||
character_limit: 3, | ||
fast_sdk: 0, | ||
DISCORD: { | ||
ENABLED: false, | ||
TOKEN: "NDXXXXXXXXXXX", // Your discord applications bot token | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this go into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Secrets is for python. |
||
EVENT_CHANNELS: { | ||
DEFAULT: "https://discordapp.com/api/channels/404333059018719233/messages", // #game_events | ||
NEW_PLAYER: "https://discordapp.com/api/channels/839163123499794481/messages", // #new_players | ||
}, | ||
}, | ||
|
||
// mode variable in server.js can be overridden here | ||
MODE: { | ||
drm_check: 0, // Enable steam/mac DRM check, prevents authfail debuff being added if disabled | ||
notverified_debuff: 0, // disables the debuff for not being verified | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it now explicitely need the protocol but didn't before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be able to connect via caracAL to the server on http, the protocol was required for a correct websocket / socket.io connection to be established.