-
#include <stdio.h>
#include <ctype.h>
#include <string.h>
fprintf(out,"\n%% account structure:\n");
fprintf(out,"%% name (string):\n");
- fprintf(out,"%% level (integer):\n");
+ fprintf(out,"%% level (integer) flags (integer) last_activity (integer):\n");
for(;ptr;ptr=ptr->next)
{
hchannel *hchan;
char buf[256],*ptr=(char*)buf;
- int flags, entries, i;
+ int flags, entries, idlekick, i;
/* name */
fgets(buf, 256, in);
if (feof(in))
hchan->lc_profile = hlc_get(ptr);
+ if (hconf_version >= HELPMOD_VERSION_2_11)
+ {
+ fgets((ptr = buf), 256, in);
+ if (feof(in))
+ return -1;
+ helpmod_line_fix(&ptr);
+
+ if (sscanf(ptr, "%d", &idlekick) != 1)
+ return -1;
+
+ hchan->max_idle = idlekick;
+
+ fgets((ptr = buf), 256, in);
+ if (feof(in))
+ return -1;
+ helpmod_line_fix(&ptr);
+
+ hchan->ticket_message = getsstring(ptr,strlen(ptr));
+ }
+
/* censor entries for channel, a bit complex */
fgets((ptr = buf), 256, in);
if (feof(in))
if (target->lc_profile == NULL)
fprintf(out, "\t(null)\n");
else
- fprintf(out, "\t%s\n", target->lc_profile->name->content);
+ fprintf(out, "\t%s\n", target->lc_profile->name->content);
+
+ fprintf(out, "\t%d\n", target->max_idle);
+
+ if (target->ticket_message == NULL)
+ fprintf(out, "\t(null)\n");
+ else
+ fprintf(out, "\t%s\n", target->ticket_message->content);
fprintf(out, "\t%d %% censor\n", hcensor_count(target->censor));
{
int nstats;
char buf[256],*ptr=(char*)buf;
- int flags, level;
+ int flags, level, last_activity = time(NULL);
fgets(ptr = buf, 256, in);
if (feof(in))
if (feof(in))
return -1;
helpmod_line_fix(&ptr);
+ if (hconf_version < HELPMOD_VERSION_2_11)
+ {
+ if (sscanf(ptr, "%x %x", (unsigned int*)&level, (unsigned int*)&flags) != 2)
+ return -1;
+ }
+ else
+ if (sscanf(ptr, "%x %x %x", (unsigned int*)&level, (unsigned int*)&flags, (unsigned int *)&last_activity) != 3)
+ return -1;
- if (sscanf(ptr, "%x %x", (unsigned int*)&level, (unsigned int*)&flags) != 2)
- return -1;
+ if (hconf_version < HELPMOD_VERSION_2_16)
+ { /* For the new friend userlevel */
+ if (level >= H_FRIEND)
+ level++;
+ }
hack->level = level;
hack->flags = flags;
+ hack->last_activity = last_activity;
fgets(ptr = buf, 256, in);
if (feof(in))
{
hstat_account *tmp;
fprintf(out, "\t%s\n", target->name->content);
- fprintf(out, "\t%x\t%x\n", target->level, target->flags);
+ fprintf(out, "\t%x\t%x\t%x\n", target->level, target->flags, (unsigned int)target->last_activity);
fprintf(out, "\t%d %% statistics for this channel\n", hstat_account_count(target->stats));
for (tmp = target->stats;tmp;tmp = tmp->next)
helpmod_line_fix(&ptr);
if ((hlc_prof = hlc_add(ptr)) == NULL)
- return -1;
+ return -1;
/* caps */
fgets(ptr = buf, 256, in);
return -1;
if (tmp > time(NULL))
- hticket_add(buf3, tmp, hchannel_get_by_name(buf2));
+ {
+ if (hconf_version < HELPMOD_VERSION_2_17)
+ hticket_add(buf3, tmp, hchannel_get_by_name(buf2), NULL);
+ else
+ {
+ fgets(ptr = buf, 256, in);
+ if (feof(in))
+ return -1;
+ helpmod_line_fix(&ptr);
+
+ if (*ptr == '\0')
+ hticket_add(buf3, tmp, hchannel_get_by_name(buf2), NULL);
+ else
+ hticket_add(buf3, tmp, hchannel_get_by_name(buf2), ptr);
+ }
+ }
return 0;
}
fprintf(out, "\t%s\n", hchannel_get_name(hchan));
fprintf(out, "\t%s\n", htick->authname);
fprintf(out, "\t%u\n", (unsigned int)htick->time_expiration);
+ if (htick->message)
+ fprintf(out, "\t%s\n", htick->message->content);
+ else
+ fprintf(out, "\n");
return 0;
}