mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:35:10 +00:00
[MOD/WIP] Use actual router
This commit is contained in:
parent
307fe6a341
commit
0ee79cc586
7 changed files with 183 additions and 87 deletions
28
src/Commands/SetPL.c
Normal file
28
src/Commands/SetPL.c
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <Routes.h>
|
||||
|
||||
#include <AS.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
CommandHead(CmdSetPL, cmd, argp)
|
||||
{
|
||||
ParseeCmdArg *args = argp;
|
||||
ParseeData *data = args->data;
|
||||
char *user = HashMapGet(cmd->arguments, "user");
|
||||
char *room = HashMapGet(cmd->arguments, "room");
|
||||
char *pl_str = HashMapGet(cmd->arguments, "pl");
|
||||
long pl = strtol(pl_str, NULL, 10);
|
||||
HashMap *map;
|
||||
|
||||
|
||||
if (!user || !pl_str)
|
||||
{
|
||||
return;
|
||||
}
|
||||
map = ASGetPL(data->config, room);
|
||||
JsonValueFree(JsonSet(
|
||||
map, JsonValueInteger(pl),
|
||||
2, "users", user
|
||||
));
|
||||
ASSetPL(data->config, room, map);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue