diff --git a/main.c b/main.c index 1a39054..d846c06 100644 --- a/main.c +++ b/main.c @@ -75,7 +75,7 @@ if (dbInit() == 0x1) exit(0x1); - dbQuery("DELETE * FROM active",0); + dbQuery("DELETE FROM active",0); srandom(time(NULL)); diff --git a/tuved.h b/tuved.h index cbf368f..ab6e723 100644 --- a/tuved.h +++ b/tuved.h @@ -13,34 +13,37 @@ #include #include -#define NUM_THREADS 1 -#define MYPORT 9999 // the port users will be connecting to -#define BACKLOG 10 // how many pending connections queue will hold -#define LOG_FILE "./logs/tuved.log" -#define PING_INTERVAL 20 -#define MAX_PING 2 -#define MAX_COUNT 2 -#define MAX_TOPIC_LEN 128 -#define MAX_CHAN_LEN 32 -#define MAX_USER_LEN 32 -#define MAX_USER_AWAYMSG 128 -#define VERSION "v1.87" -#define MYSQL_HOST_NAME "localhost" -#define MYSQL_USERNAME "tuve" -#define MYSQL_PASSWORD "5558585" -#define MYSQL_DB_NAME "tuve" -#define VIDE_PAD_TIME 2 // Time Added To Video End To Ensure All Are In Sync -#define MIN_VER 2.3 // Current client version -#define COM_DELAY 60*20 // Amount Of Seconds For Video Before Commercial; +/* TUved Information */ +#define VERSION "v1.87" // Current Version Of Tuved +#define NUM_THREADS 1 // Number Of Threads In The Deamon +#define MYPORT 9999 // the port users will be connecting to +#define BACKLOG 10 // how many pending connections queue will hold +#define LOG_FILE "./logs/tuved.log" // Default Log File +#define PING_INTERVAL 20 // Interval For Pings +#define MAX_PING 2 // Maximum Number Of Missed Pings +#define MAX_COUNT 2 +#define MAX_TOPIC_LEN 128 // Maximum Length For A Topic +#define MAX_CHAN_LEN 32 // Maximum Length For A Channel Name +#define MAX_USER_LEN 32 // Maximum Length For A Username +#define MAX_USER_AWAYMSG 128 // Maximum Length For Away Message +#define CHAN_MAX_BANS 30 +#define CHAN_LIVE_LENGTH 128 -/* User Defs */ +/* MySQL Information */ +#define MYSQL_HOST_NAME "localhost" // MySQL Server Hostname +#define MYSQL_USERNAME "tuve" // MySQL Server Username +#define MYSQL_PASSWORD "5558585" // MySQL Server Password +#define MYSQL_DB_NAME "tuve" // MySQL Server Database Name + +#define VIDE_PAD_TIME 2 // Video Padding To Ensure All Users Are In Sync +#define MIN_VER 2.7 // Minimum Client Version +#define COM_DELAY 60*20 // Amount Of Playtime Before Commercial; + +/* User Modes */ #define USER_MODES 2 // Count Of User Modes #define USER_OVERLORD 0 // User Is An Overlord #define USER_AWAY 1 // User Is Away -#define CHAN_MAX_BANS 30 -#define CHAN_LIVE_LENGTH 128 - /* Cannel Modes */ #define CHAN_MODES 8 // Count Of Channel Modes #define CHAN_RANDOM 0 // Random Videos @@ -59,6 +62,7 @@ short chanLevel; } tuveUserList_t; +/* Channel Structure */ typedef struct tuveChanList { struct tuveChanList *prev; struct tuveChanList *next; @@ -66,8 +70,8 @@ struct tuveUserList *nextUser; long long bans[CHAN_MAX_BANS][2]; // Ban List char liveStream[CHAN_LIVE_LENGTH]; // Live Stream Name - char modes[CHAN_MODES]; - char topicSetBy[MAX_USER_LEN]; + char modes[CHAN_MODES]; // Channel Modes Array + char topicSetBy[MAX_USER_LEN]; // char topic[MAX_TOPIC_LEN]; char channel[MAX_CHAN_LEN]; char videoFile[256]; // File Name Of Video @@ -79,8 +83,8 @@ int vid; // Video ID int comTime; // Total Ad Time int comDelay; // Video Play Counter For Next Ad - short count; - short maxTime; + short count; // Counter For Querying A User For A Video + short maxTime; // Maximum Length For A Video short vidClass; // Video Class - For Skip Protection time_t topicSet; } tuveChanList_t;