dev
textPage 9 of 208
50 messages on this page
Saturday, May 14, 2022
User bddf69
With webhooks, you can write a little webservice (in python or js or w/e your lang of choice) and then perform whatever actions you want... Full freedom
User bddf69
This has the benefit that we can implement it in a secure way (unlike "execute a shell script through CSMM")
User bddf69
Right, so I think to support that use case, a possible feature in CSMM would be webhooks.
Eg:
User configers a http endpoint http://webhooklistener.example.com
something happens in CSMM (Could be a bunch of triggers,
CSMM catches this, collects some data and then sends a HTTP request to http://webhooklistener.example.com with that data
chatMessage, zombieKilled, ... It could even be triggered from inside a hook)CSMM catches this, collects some data and then sends a HTTP request to http://webhooklistener.example.com with that data
User can now catch that request in a service of their choice and do whatever they want
User c0a2ee
moving the conversation over here. The posibility to create a hook to execute a bash script through csmm after server shutdown
User 374c5d
/me grabs the popcorn
Thursday, May 5, 2022
User a12f6e
ah ok! nice, thanks!
User bddf69
No I didn't update the playground data :( It's
player.crossIdUser a12f6e
mmmmm I don't see it, is it shown in the data model in the Playground? if not what is it called?
User bddf69
etc etc
User bddf69
Eg, pushing to master branch -> builds a new image for 'latest'
pushing to a pull request -> builds an image for that specific PR
pushing to a pull request -> builds an image for that specific PR
User bddf69
Fyi, pretty much every commit that gets pushed to Github will create a new container is some form
User a12f6e
Woot woot, thanks! ๐
User bddf69
It always is ๐
User a12f6e
Is the Docker image updated?
User bddf69
but if you're running the master branch, you'll get the code
User bddf69
And I haven't made a release in a while so it wont show up in the official release notes (yet)
User bddf69
I implemented it without making an issue :p
User a12f6e
Oooo fancy, nice! I couldn't find any issues that mentioned EOS so I didn't think it could possibly be in. ๐
User bddf69
Update your CSMM to latest version :)
User a12f6e
For the server manager repo, does anyone know which files contain code used to populate the built-in variables and define the data model?
Saturday, April 9, 2022
User 882420
Might even make a
Teleport To Location link instead.User 882420
I will look into adding a
copy coords link to the player tracker:
unknown.png
PNG โข 25.6 KB
Thursday, April 7, 2022
User 882420
Aight will have a look into it.
User bddf69
That would most likely need to happen here I think
https://github.com/CatalysmsServerManager/7-days-to-die-server-manager/blob/master/worker/util/CSMMCommand/index.js#L45
https://github.com/CatalysmsServerManager/7-days-to-die-server-manager/blob/master/worker/util/CSMMCommand/index.js#L45
User bddf69
You would need to populate the
time property with those valuesUser 882420
Instead of having separate functions:
fromNow, hasPassed, etc.User 882420
Is there anyway to do this in handle bars:
time.fromNow, time.hasPassed, etc?Tuesday, April 5, 2022
User bddf69
Extending that to support embeds seems like a nice feature tho ๐ Or make a similar function that lives next to it for embeds (cause the data structure for embeds is quite a bit more complicated than a message)
User bddf69
Close but not quite
This sends a message to Discord but no support for embeds
User 882420
Too easy, I'm looking into adding the functionality for custom embed notifications for discord.
sendNotification(<channelId>,<notification>) Does this exist already?User bddf69
There's not really a document that outlines everything though
User bddf69
There's the linter which takes care of code styling mostly. A bunch of styling rules get automatically checked and reported.
Then there's the tests which do functional checks
User bddf69
The flow generally is that any new features get merged into the develop branch first. This branch gets automatically deployed to the staging instance (staging.csmm.app).
Then, when everything is well tested and stable, it gets merged to the master branch which will trigger deploys to production.
Usually I do that dev -> master thing pretty quick but I haven't had time to do much lately
User 882420
Also is there a codding standards document for the repo?
User bddf69
What are the rules for pinging, is it allowed?
Yeah no worries man. General rule (for anything here) is don't be a dick about it. :)
User 882420
What are the rules for pinging, is it allowed? Don't want to get nuked lol.
Also how do I become a contributor on the main branch? Just keep adding stuff to the dev branch and I'll eventually be added to the main branch?
Also how do I become a contributor on the main branch? Just keep adding stuff to the dev branch and I'll eventually be added to the main branch?
User bddf69
Will need quite a few tests I imagine to account for a bunch of edge cases (time and date do be like that)
User bddf69
Sorry for late response, been a hectic few days for me :(
That helper looks really useful, I like it!
Monday, April 4, 2022
User 882420
@User 22055452 Sorry for the ping man, what do you think of the helper?
User 882420
Just finished making a helper to use with
timePassed date:Handlebars.registerHelper('timeLeft', function (date) { //Get milliseconds from Date.now() var ms = Date.now() - Date.parse(date); //Return 0 if there is no time left if (ms >= 0) { return 0; } //Get the absolute value of ms ms = Math.abs(ms); //Convert ms into d h m s var d = Math.floor(ms / (24 * 60 * 60 * 1000)); var h = Math.floor((ms - d * (24 * 60 * 60 * 1000)) / (60 * 60 * 1000)); var m = Math.floor((ms - d * (24 * 60 * 60 * 1000) - h * (60 * 60 * 1000)) / 60000); var s = Math.floor((ms - d * (24 * 60 * 60 * 1000) - h * (60 * 60 * 1000) - m * 60000) / 1000); //Prepare the result string var result = ''; //Convert overflowing s into m if (s === 60) { m++; s = 0; } //Convert overflowing m into h if (m === 60) { h++; m = 0; } //Convert overflowing h into d if (h === 24) { d++; h = 0; } //Concat d to result if it is greater the 0 if (d > 0) { result = result.concat((d > 1) ? d + ' days ' : d + ' day '); } //Concat h to result if it is greater the 0 if (h > 0) { result = result.concat((h > 1) ? h + ' hours ' : h + ' hour '); } //Concat m to result if it is greater the 0 if (m > 0) { result = result.concat((m > 1) ? m + ' minutes ' : m + ' minute '); } //Concat s to result if it is greater the 0 if (s > 0) { result = result.concat((s > 1) ? 'and ' + s + ' seconds ' : ' and ' + s + ' second '); } return result; });``` Usage:
{{#if (datePassed )}}
say "The date has passed!"
{{else}}
say "{{timeLeft }}"
{{/if}}
say "The date has passed!"
{{else}}
say "{{timeLeft }}"
{{/if}}
Example:
{{#if (datePassed "2022-04-06T17:04:51.074Z")}}
say "The date has passed!"
{{else}}
say "Time left: {{timeLeft "2022-04-06T17:04:51.074Z"}}."
{{/if}}
say "The date has passed!"
{{else}}
say "Time left: {{timeLeft "2022-04-06T17:04:51.074Z"}}."
{{/if}}
Output:
"Time left: 1 day 20 hours 14 minutes and 13 seconds."
Sunday, April 3, 2022
User 882420
Too easy, will have a look at it.
User bddf69
I use vscode and a bunch of extensions for the different stuff I need
User bddf69
but other extension because these are async versions of the templates
User bddf69
They are actually https://ejs.co/ files
User 882420
What IDE can I use to edit the
sejs files?User bddf69
It's not a great solution but yeh
User bddf69
You'll probably be interested to look at https://github.com/CatalysmsServerManager/7-days-to-die-server-manager/blob/master/api/helpers/meta/export-server.js and the import file next to it

