Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Unfortunately, we need to manually add the command to discords'
registries for now :(
Am working on an abstraction layer that will allow you to add commands
easier (much like how me adding this command is simply adding this file
to the project, except there is a macro and it will register the command
automatically for you and the interaction event will have a default
handler)
|
|
|
|
Move HELLO IDENT functionality into util/net
Add ready event in example/hello, grab app id and print info
Change http_request family of functions
- Remove bufsiz for response code
- Remove post input pipe in exchange for simple writebuf
Add heartbeat latency ack tracking
Add websocket handle close function (dummy function, to be extended
upon)
Add message for invalid token
|
|
|
|
|
|
|
|
i PROMISE that there will be a stupid easy way to identify to the
websocket, consisting probably of the user just declaring the intents
somewhere (since we already have the token)
welcome to the true beginnings of DBS (new acronym for this project
instead of the lame TDBS since im not that cool)
|
|
mainly for early building process
net: make curl ws_handle non-static
|
|
|
|
remove ev abstraction
add initcall names
|
|
|
|
in subsys.h: include init.h to ensure l5_initcall availability
also: add example/ directory to provide some user-code in the skeleton
(will likely be made defunct as i make the remainder of the skeleton,
such as a /ping command and user action and maybe some buttons, which
will require more organisation)
|
|
since this project is a skeleton and not meant to clutter up the code
that will actually consume the bot, i've opted to consolidate the
majority of files under a single directory and minimise extra files
*: move code to util/
*: move include files to include/dbs/
net: consolidate net functions into single file
config: remove config
|
|
also: in makefile add support for deeper c files
|
|
|
|
|
|
we apply .env files from both the current working directory and the
directory of the executable we're running from
very simple .env format, KEY=VALUE, comments prepended with # on first
character of line only.
|
|
|
|
also: empty signal set before using due to malloc
|
|
|
|
enforce 78 character limit
add comments for reasoning and description purposes
|
|
includes heartbeat mechanism
|
|
use switch{case} instead of if statements for determining action upon
signal
|
|
design choice since 1 << n == pow(2,n)
|
|
since we moved our signal handlers to be created before subsystems are
created, our new signal handlers (which namely blocks SIGTERM, used for
panicing) are passed on. in order to restore full panic functionality,
we clear all signal blocks before passing execution to the subsystem
|
|
in panic, when killing process group, set pid to 0, where it gets our
pgid for us, using kernel optimisations, saving a trip to kernel land to
get the pgid ourselves
|
|
prevents potential race condition where a subsystem can terminate before
we fully block SIGCHLD, causing SIGCHLD to be sent to init and having
our entire process terminated ungracefully.
prevents bash and family from sending "Terminated" due to our process
receiving SIGTERM during a panic, since we already exit in there and
it'd be queued up if we do receive one
|
|
in log: we ensure we panic by killing our process group with SIGTERM,
raising it for ourselves, and exiting (if all else fails simply).
in init: we catch SIGTERM and exit with 0 if we get it, as bash (and
likely others) prints a nasty "Terminated" to stderr
|
|
libcurl requires first 3 characters of a wss url
(i.e. wss://example.com) to be capital, so instead WSS://example.com.
so we modify the assume url to use WSS and ensure the returned URL from
discord uses the WSS capital scheme
|
|
|
|
|
|
also: change panic signal to be SIGKILL as sigint being caught would
result in a loop
|
|
also: modify log to exit status 0 on panic instead of 1 (only runs exit
on panicmode respawn which shouldn't cause a fatal termination)
|
|
break out of WSS compatability checker loop when we find a valid match
for wss
|
|
|
|
just read the note on osdev wiki that stated that input operands
shouldn't be changed, so we move both rax and the console lock to the
output operands so the compiler knows we are modifying them for our
lovely optimisation
|
|
move spin locks to dedicated function so we can minimise repetition of
code. now uses more C and less assembly.
init.c uses 8192 * 512 as a maximum even if the stack rlimit is larger
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|