dev
textPage 41 of 208
50 messages on this page
Wednesday, July 28, 2021
Tuesday, July 27, 2021
User bddf69
Welp, not the full fix ^ I'll push another update later
User bddf69
Pushing to prod in a few
User bddf69
This should fix the doubling ๐
Monday, July 26, 2021
User bc4343
I'll throw it in my ticket
User bddf69
And can you post the config of the hook you're tesitng pls?
User bddf69
Can you check your server log? Does it show the
chat handled by mod ... log line? It can be caused by a couple of ways as prisma mentionedUser bc4343
I removed myself from all chat groups and am still getting the double ups ๐ฎ
User 42795a
I have multiple w2l (half of which don't work lol)
User a506fe
sounds very plausible like that
User bddf69
So any hooks that double for you guys would have to be logLine hooks, if my hypothesis is correct
User bddf69
So chat messages are still detected once
User bddf69
It's worth noting that hooks that use 'chatMessage' as trigger (and not logLine) works as expected
User a506fe
"handled by mod" would be there on hccp prefix (commands), ocn, groupchatcolor and indiviual chat color
User 42795a
I'll have to test later. But that does match my previous experience, yes.
User 42795a
User bddf69
Do you guys see the same behavior or is my reproduction not the same thing you see?
User bddf69
I looked into this some more and I believe it has something to do with how chat messages get handled by API mods.
When I added myself to a chat group with CPM to give myself a colour, logs start looking like this:
2021-07-26T22:11:07 2007.881 INF Chat (from '-non-player-', entity id '-1', to 'Global'): '[FF00FF]Catalysm[-]': testtt 2021-07-26T22:11:07 2007.881 INF Chat handled by mod 'CSMM Patrons': Chat (from '76561198028175941', entity id '171', to 'Global'): 'Catalysm': testtt
With a hook like in the screenshot, this hooks fires double. Builtin commands (i tested $ping) seem unaffected.
So when I remove myself from the chatgroup, the chat message is no longer handler by CPM so the log looks like
2021-07-26T22:16:11 2311.874 INF Chat (from '76561198028175941', entity id '171', to 'Global'): 'Catalysm': testtt
(notice no "chat handled by mod ...") anymore

unknown.png
PNG โข 6.4 KB
Friday, July 23, 2021
User eca9c0
I'm nota programmer so there ๐คฃ
Thursday, July 22, 2021
User 374c5d
User 42795a
so it's editable meta data
User 42795a
you could always hard code that with a fixed date and unlock the feature down the road should you choose
User 42795a
true
User bddf69
Making changes to the system later is harder since it'd break peoples already made hooks
User 42795a
but adding an expiry wouldn't be terrible either
User 42795a
ok if deleted could be a simple boolean property, pretty easy to implement
User bddf69
Yeah exactly ๐
User 42795a
lol
User 42795a
I'm trying to think down the road so you're not back to the drawing board for some future feature addition
User 42795a
ok if deleted may be more practical, though less specific
User 42795a
hmm
User bddf69
Think we can reuse the distinction between persistent and expiring variables for this? Or would you make a distinction between 'variables-that-must-stay' and 'variables-ok-if-deleted' ?
User bddf69
Would be a separate table but it is a good question which should be defined
User 42795a
For variables you could specify a lifecycle, defaulting at permanent (with your own restrictions as needed/see previous comments). But then that way if someone wanted it to be more persistent, ie. between reboots, but didn't need to keep it in the long term, just the 'most recent' it could be set to a write-over mode.
User bc4343
like if we deleted player profiles could this information be deleted also, could kill two birds with one stone
User bc4343
Would this information be stored in the actual player db?
User bc4343
I guess there is only one way to find out ๐
User bddf69
re: taking up space. Indeed! I don't know how much but there has to be some limit to how much can be stored per-server
User bddf69
Oh those are nice use cases! PV will def make those possible
User bc4343
Hmm i have some idea's that this may be useful in, If we use the built in cpm "player seems to be flying" alert could we use it to write a persistent variable(s) (fired from a hook) to do a check sum? When the first hook fires set a timer of say 30 seconds and If the hook fires 3 times before the 30 seconds expires execute command/delete variables, if it only fires once or even twice but then reaches 30 seconds the variables can be deleted. This could be a neat little way to catch out cheaters that seem to be able to bypass all of the cough anti cheat the game has ๐ It would also provide a lot more functionality to the alert as currently it can only work based off a triggered hook with no real way of making it "customisable" per say.
I was also thinking you could use it for rewarding/punishing players for certain actions over a certain period of time. For example if you wanted to punish a player for drop mining twice in the space of 24 hours, add the persistent variable to the hook and set the timer at 86400, If they do it once and not again within the time period the variable will be deleted but if they do it twice you could fire a jail/kick/ban or whatever command you would like to run /delete variable. Same with the reward, you could run a variable for say the duration of blood moon and if a player kills X amount of entities during that time they get a reward, if not delete variable.
My examples above (If they will work๐ค ) would not really effect the db to much as the timers would be deleting any variables after a certain period of time.
say "You have executed this command {{getVariable('player:{{player.steamId}}:counter')}} times"``` I could see theses taking up a lot of db space on high pop servers running multiple commands if you were looking to keep a track of every player & every command. I'll have a bit more of a look at it tomorrow with fresher eyes ๐
User bddf69
DB table most likely. It might live in Redis but so far redis is only used for caching and data which can be rebuilt. Redis would probably be faster but DB will offer more flex
I don't think where or how the data is stored should affect users though. Syntax for storing and getting these is most important
User bddf69
Yeah so since you're inside the handlebars system, you can control who can access what however you want. You could add an if statement to check a players role level before doing anything for example
User bddf69
Can you elaborate here? I was planning on just allowing either numbers or strings. With some max length check to prevent any weird overflows
User bddf69
Yep, it can use the same error handling as the rest of the system ^^
User 42795a
As for what I would use it for, I have a few ideas for creating mini games or even full game modes using only the bot. I think I told you this before, but that's how our community got started 20 years ago, we had bot developers and we used it to essentially mod the game. The bot parsed logs like most bots do, but it ran as an application along side the game server, so it was capable of anything. With handlebars and now potentially adding persistent data, you've essentially opened it up to the limits of your creativity. ๐ But of course that comes with some risk if you're running it all on your server and allowing others to write their own code and write data into your memory.
User 42795a
how will this be stored? in a db table or flat file?
User 42795a
thought: for scope, would it be role >= permission (ie. multiple levels of donors could access it, rather than being restricted to a specific group or player)
User 42795a
When a player tries to update a variable, CSMM will check if the player has reached the limit. If so, CSMM will find the least recently read variable and delete it to make room.
Personally, I would prefer it simply fail or throw an error than potentially delete a persistent value I may still want/need for something