Guild icon
DDraceNetwork
DDraceNetwork / questions
For newcomers to ask questions and get help. Also check https://wiki.ddnet.org/wiki/FAQ
Between 2020-10-01 00:00:00Z and 2020-10-02 00:00:00Z
Avatar
yo, is there still a command like "grenade_me 10" ?
Avatar
what is 10? if u have a ddnet server launched with sv_test_cmds 1 then u can f2 grenade
Avatar
that was a command for the strength of a grenade
Avatar
https://ddnet.tw/settingscommands/ scroll to the bottom tune explosion_strength 10
Avatar
or a command that u can shot grenades multiple times, like jetpackgun
Avatar
tune grenade_fire_delay 0 (?)
Avatar
yeah exactly, thank you bro
Avatar
what is the normal delay ?
Avatar
u can see the normal values at the bottom of that page
15:39
500 delay 6 strength
Avatar
alright, thanks bud
15:40
and for rainbow ?
Avatar
afaik it is only a thing in other mods like xxlddrace not ddnet
Avatar
ahh okay
15:42
https://ddnet.tw/settingscommands/ is this the list of all possible commands =?
15:42
ahh, nvm, i see tune_grenade isnt there ?
Avatar
at least most of them, idk if its kept upated
Avatar
do you have a list of all possible commands ?
Avatar
tune is there
Avatar
found it, thx
Avatar
thank you a lot (edited)
Avatar
Thanks @noby monkalaugh
Avatar
whats the difference between register and chain
Avatar
@plsplsplslol chain registers an additional function to run when the command is executed
Avatar
so it runs 2 functions in 1 command
Avatar
yes
15:56
I think the chain function is responsible for calling the actual function though, not sure
15:56
check an example to see what they do
Avatar
ok
Avatar
like Console()->Chain("sv_rcon_password", ConchainRconPasswordChange, this); because sv_rcon_password is a varaible but a function must be called when it is changed (to log ppl out if they are authed with that password for example)
Avatar
oh so sv_rcon_password changes the variable and runs the function
Avatar
and if it was register it would only change the variable
Avatar
register is for functions that arent associated with a variable atall
15:59
if its just a variable and no function then it goes in one of the variables .h files (edited)
15:59
ie Console()->Register("kick", "i[id] ?r[reason]", CFGFLAG_SERVER, ConKick, this, "Kick player with specified id for any reason");
Avatar
so register only runs the function
Avatar
adds it as a thing in f2 that, when u type it, yes only calls a function
Avatar
ok
Avatar
From https://github.com/ddnet/ddnet/blob/22294ec9b0484b53c8b68c064836f25d4fdb8644/src/engine/server/server.cpp#L3323-L3327: c++ void CServer::ConchainRconPasswordChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) { ((CServer *)pUserData)->ConchainRconPasswordChangeGeneric(AUTHED_ADMIN, g_Config.m_SvRconPassword, pResult); pfnCallback(pResult, pCallbackUserData); } (edited)
Avatar
the real question is why we have two .h files for variables
Avatar
@plsplsplslol you can see that it still needs to call the original function manually
Avatar
I don't remember, can we chain multiple times?
Avatar
pfnCallback(pResult, pCallbackUserData)
16:03
@Learath2 yes AFAIK, it simply replaces the function, you're responsible for calling the original caller
Avatar
// TODO: remove this #include "././game/variables.h" lol
Avatar
yup @ multiple times
16:04
it's a single linked list
16:05
singly*?
Avatar
There is much work to be done in the console btw, if anyone is interested, it's actually decently fun to work with that part of the code
Avatar
it's a bit weird how it conflates parsing commands and the execution engine IMO
16:06
leads to our weird TempCommands thing
Avatar
Hm I dont remember what TempCommands was
Avatar
what kind of work
Avatar
@Learath2 it's for registering the commands the srever sends in the console
16:07
instead of keeping it in a different data structure that both the execution engine and autocompleter use
Avatar
Ah, I see what you mean
Avatar
(not high-priority to fix though, the code works)
Avatar
@noby well one thing that has been on my todo list for a decade is the validation
Avatar
ah
Avatar
validating what
Avatar
the console pretending it validates arguments
16:09
and it does not
16:09
😄
16:09
you specify yo uwant an integer argument
Avatar
and u type in a letter and it just reads it as zero?
Avatar
the console doesn't yell at you for providing a string
16:09
yes
Avatar
yeah true
Avatar
Also erroring out should be offloaded to the console code too
16:10
All our commands are littered with error checking and error printing
Avatar
for things like bounds checking, u mean doing it like variables.h where a max and min are given in the definition?
Avatar
Bounds checking would be tough, but if I were to do it I'd integrate it into the usage bracket
Avatar
"i[value(0, 100)]" ?
16:14
idk how to make it look not ugly
Avatar
Another thing rotting in my todo list that is semi related to validation is handling for victim to allow things like the teename to be used as victim
Avatar
instead of the id?
Avatar
what if someone uses the playerid of another player as a name
Avatar
If a string completely parses into a number, treat it as an id first
Avatar
@noby raises an interesting point
Avatar
No that sounds wrong, sorry walking and thinking
Avatar
seems abusable
Avatar
That sounds very wrong
Avatar
If the string matches a name always use the name?
Avatar
would probably be better to require making it clear
16:17
i.e.
Avatar
when you name yourself "noby" you suck so people cant whisper you justatest
Avatar
allow something like kick name=12 and kick id=12
Avatar
ye
Avatar
Or that yeah
Avatar
and require it if it's ambiguous
Avatar
or using quotes in ur name yes
Avatar
Kick name=name=name
Avatar
or using the name name=name=id
Avatar
Quotes in the name we can just escape
Avatar
or if its ambiguous then require confirmation "you are about to kick "23" (id 12), confirm? y/n"
Avatar
kick name=noby=nobo
16:20
requiring confirmation for bans/especially range bans might not be a bad idea in the first place
Avatar
Or we can just keep ids, it was just an idea
Avatar
ban_country murica
f4 3
f3 2
f3 1
Avatar
Console is not interactive enough for confirmations, maybe that could be looked at
Avatar
currently it doesn't have state
Avatar
You can hack around it by keeping state yourself and parsing all the arguments yourself
Avatar
register y and n as commands xd
16:22
and then keeping the state in cserver or something yeah
Avatar
or is that not the proper way to do it / would it be cleaner to add statefulness to the console itself
16:22
antijao
Avatar
You probably want state in CPlayer tho
Avatar
oh yeah right
Avatar
Oh making the console aware of multiple users would be great too
Avatar
currently it's just a "global" variable that gets set ^^
Avatar
Currently we hack around the issue with a global yeah
Avatar
which is a global variable
Avatar
Or maybe a CConsole instance per user?
Avatar
Thst would be cool
Avatar
Idk, anyway, many things about the console are crude hacks
Avatar
Its fun to spam status
troll 3
monkalaugh 2
16:24
And fill others rcon
Avatar
Like the chat commands being executed on rcon
Avatar
good old times when chiller was mod and had super bound on hammer
16:25
spamming console with that shit
Avatar
How that didnt lead to a security issue yet is beyond me
Avatar
i thought it was intended behavior that mods can see the commands of other mods
16:25
and hahaha
Avatar
I actually kinda liked that one @Learath2 ^^
Avatar
/ban Learath2 reason=dislikes rust
16:26
monkalaugh
Avatar
but I think I also introduced it, so I'm biased 😄 (edited)
Avatar
yeah why are chat commands registered to f2
16:27
if a command expects to be a chat command thats typed by a player and its called thru econ what happens
Avatar
Finally, after 6 months I am home :P
🏠 3
Avatar
nice 🙂
16:27
couldn't get home for 6 months due to bad weather
16:27
how sad is that
Avatar
bad weather?
Avatar
@Learath2 so u were outside? greenthing
Avatar
yea, all the flights were cancelled
Avatar
@jao he was outside greenthing
Avatar
he had to walk home
Avatar
he went out for the first time in 6 months trollet
Avatar
Wow, I'm shocked. Nothing smells rotten, the house hasn't exploded
16:29
The lights still turn on
Avatar
@Learath2 congrats
Avatar
I think I've asked before but don't remember the answer: Is there a way to shorten the time for the reset/kill key to disable?
Avatar
sv_kill_delay 0 ?
Avatar
What's the default?
18:16
Avatar
1 is the default
18:29
enter it in f2, you have to be server owner
Avatar
Ok, no way as a player then. Thanks anyway!
Avatar
I think as a player left mouse click or pressing jump might speed it up
18:39
but I might also misremember
Avatar
Nah, I need it down to like 30 seconds and most servers seem to have it 5-10 minutes.
Avatar
huh, that's weird
Avatar
you are talking about different thinks, Sikarii talks about kill protection which kicks in after 20 mins, deen is talking about the time between killing and respawning
19:54
*things
Avatar
ok, sv_kill_protection then, but still a serverside setting (edited)
Exported 168 message(s)