dev

textPage 14 of 208
50 messages on this page
Tuesday, January 25, 2022
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
You are retrieving player:counter var, but adding to player:counter var
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
I see the problem
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
The count was over 200 when I was testing it ๐Ÿ˜‰
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Keep going, you need to do it more than 100 times... or reduce that 100 number ๐Ÿคฃ
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
This is literally the example from the docs
{{ setVar (add "player:counter:" player.steamId) (add 1 (getVar (add "player:counter:" player.steamId))) }};
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
So this build works fine, but... it doesn't help with what I want to do. I think the reason for this is that CSMM doesn't even detect a disconnection if the server is only offline briefly, which is what happens for our servers, since we have a system that automatically restarts it if it goes down. Either that or the hooks aren't working. ๐Ÿ™‚
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
getVar
gets the value of the variable. You have
{{getVar "player:counter:" player.steamId}}
which is invalid syntax. Also
player:counter:
will be treated as a plain string in the variable name.
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
no dice so far ๐Ÿค”
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
How do we go about using the player:counter in a conditional statement?
I was thinking something like ```{{ setVar (add "player:counter:" player.steamId) (add 1 (getVar (add "player:counter:" player.steamId))) }};
{{#if (gt player:counter 100)}}
say "TEST"
{{/if}}```
Monday, January 24, 2022
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
Cool, I have some idea's ๐Ÿ‘Š
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yep should be ^^
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
Oh it's live on my instance also?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
everywhere :)
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
So I have finally got some time to look into these persistent variables ๐Ÿ˜‰
Is this live on staging @User 22055452 ?
Sunday, January 23, 2022
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Yeah I know ;) just very convinced now it's a great idea haha
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Hehe :p Wont be anytime soon I'm afraid
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Man trying to use Handlebars for error handling makes me reallllyyy want that script idea you have in your head lol
Saturday, January 22, 2022
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Set it up yesterday, will be running it on our test server over the weekend
Friday, January 21, 2022
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Nice! Looking forward to trying that out!
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
There's premade Discord notifications available, or you can add a hook to the events
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
You can use docker tag
pr-1075
to try it out ^^
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
@User 28294624 ๐Ÿ‘€
unknown.png

unknown.png

PNG โ€ข 8.5 KB

unknown.png

unknown.png

PNG โ€ข 14.9 KB

Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
So dynamically loaded :p
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
setVar test 1
Then a different hook:
setVar test 2
t = getVar test

print(t)
That should print 2
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Persistent variable wouldnt get passed during startup though, you'll be able to load them in dynamically
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Totally
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Sure is! Actually I'm sure if there's a way to populate an object with data on the processing host, you can just as easily send it arguments and persistent variables the same way you send it the data.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
But it's a fun excuse for me to play around with Firecracker haha
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
๐Ÿ™‚
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yep, lots of stuff to figure out :p
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Yeah that would be awesome. All I meant was that if that
data
object contained the same memory map as what the Handlebars built-in variables do, that would make it easy. Also though the custom variables thing may be hard to pull off, particularly the persistent variables.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Persistent vars would be
getVar("test")
and
setVar("test", 1)
etc
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
execCmd
would be a function provided by CSMM
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
In my head, what you would write instead of current handlebars would be
function main(data) {
  for (const onlinePlayer of data.onlinePlayers) {
    if (onlinePlayer.level > 100) {
      execCmd(`say "Wow ${onlinePlayer.name} is level ${onlinePlayer.level}, what a beast"`);
    }
  }
}
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
That's probably ok depending on what the API looks like. If there are objects served up for the same things Handlebars can get to, those code snips should be very easy to write.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yeah it could totally be a toggle and support both systems. Would have to be a server-wide thing though cause of how the settings in CSMM work right now
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Well butter my biscuits, if you could offer both (Handlebars for people who don't know how to write code, Firecracker for people who do) or combine them so you could use both a single script somehow, that would be awesome saucem possum
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
(Made by Amazon, they use it a lot in AWS to let people run arbitrary code on their servers)
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Remote code execution as a feature... ๐Ÿค”
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
What if you could write any code you wanted in there? Javascript or python for example
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
I'm kind of considering a bit of an overhaul to the handlebars system
Sunday, January 16, 2022
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
I thought the EOS system would've been better integrated by now
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
Dunno how long alloc Will stay quiet
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yeh true and I might have to go for it
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
Could be a temp workaround
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
Lcp is cpm
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
To me allocs = vanilla lol
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Woops :p
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
Lkp is allocs
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
vanilla commands like lkp dont even return that eos id <.<