tomchesley
Technical User
I am a newbee in C / C++
I currently have the current IRC Hybrid server 7.2.3 working successfully.
I would like to modify it just a little to only allow names that are 12 characters in length and are all uppercase letters between A and P
I have the length test working great, that wasnt to hard.
But not sure how to test the contents of the name/NICK
Any assistance is appreciated
My current code that i am modifying is below
I currently have the current IRC Hybrid server 7.2.3 working successfully.
I would like to modify it just a little to only allow names that are 12 characters in length and are all uppercase letters between A and P
I have the length test working great, that wasnt to hard.
But not sure how to test the contents of the name/NICK
Any assistance is appreciated
My current code that i am modifying is below
Code:
// source_p->name = NICK
// source_p->host = IP in the form of x.x.x.x where x = 0 - 255
int nlen;
nlen = strlen(source_p->name);
//test if 12 char NICK if not disconnect them
if (nlen !=12)
{
exit_client(source_p, &me, "BAD NICK");
return;
}
sendto_one(source_p, form_str(RPL_WELCOME), me.name, source_p->name,
ServerInfo.network_name, source_p->name);
sendto_one(source_p, form_str(RPL_YOURHOST), me.name, source_p->name,
get_listener_name(source_p->localClient->listener), ircd_version);
sendto_one(source_p, form_str(RPL_CREATED),
me.name, source_p->name, built_date);
sendto_one(source_p, form_str(RPL_MYINFO),
me.name, source_p->name, me.name, ircd_version, umode_buffer);
show_isupport(source_p);