Anope IRC Services

Anope Development => Modules => Topic started by: IceCube on July 07, 2011, 10:08:27 PM

Title: Ideas for development
Post by: IceCube on July 07, 2011, 10:08:27 PM
Hi,

My english is no good, but u all may understand I guess.

I am willing to explain and discuss new ideas.

I want to share the creation of a Virtual Link (Vlink). It has been discussed before I could see, but a long time. Thus I have to explain what would be:

Some IRCd's PTlink based or not, support the Vlink, which runs through the commands OperServ.
It's simple. You can create virtual links to improve the performance of your IRC Network. To operate simply to provide network services that command
/ Server add OperServ vlink description
/ OperServ vlink del server
along with the commands:
/ OperServ VAdmin add Nick Server
/ Nick del OperServ VAdmin
/ OperServ VCop add Nick Server
/ Nick del OperServ VCop
(VAdmin = Virtual Server Administrator mode + X)
(VCop = Virtual Server Administrator mode + x)

Another idea is to create a team that can be responsible for the Virtual Host, BotServ and Global Notice, for example:

/ OperServ botadm add nick

That is, all that are added to this list, will be responsible for creating bots BotServ. This same idea works for HostServ and Global Notice.

Another idea is that RANDOMNEWS LOGONNEWS and can be sent to the user via PVT, with the normal commands, continue to be sent through the normal means.
Another thing they share is a mechanism that all users who
I am willing to explain and discuss new ideas.

Another thing they share is a mechanism that all users who are Helper + h when they were not in HelpChan or Away or Idle lose their status +h as the list of / helpers / staff show up just for those who are online and available to support
Title: Re: Ideas for development
Post by: katsklaw on July 08, 2011, 03:03:04 AM
If I remember correctly, PTlink is a long dead ircd (last release I found was May '06). Which makes me wonder why Anope should expand support. Also I seriously doubt there are many, if more than a handful of users that actually use PTlink.

Additionally, I swear this was requested before and not acted upon. See: http://forum.anope.org/index.php?topic=1269.0 Faking server names in messages will not enhance performance at all. It's no different than BotServ answering is place of ChanServ. Regardless, Anope as an ircd still uses the same amount of resources. "If the server name matches an existing virtual link, all messages sent to that client will look like originating from the virtual server. "

Lastly, I'm willing to bet without digging deeper that it would require an expansion of the ircd struct for at the very least 1 ircd.

/opinion
Title: Re: Ideas for development
Post by: IceCube on July 08, 2011, 01:24:58 PM
Most of IRCd's here in Brazil use Virtual Link, and I said IRCd based on PTlink.

See the IRCd's Code

File: vlinks.c
 Desc: virtual links
 Author: Lamego@PTlink.net
 Based on Brasnet vlinks from fabulous@t7ds.com.br
*/

#include "client.h"
#include "common.h"
#include "ircd.h"
#include "numeric.h"
#include "s_serv.h"
#include "irc_string.h"
#include "send.h"
#include "s_conf.h"
#include "struct.h"
#include "s_user.h"
#include "vlinks.h"


#include <stdlib.h>
#include <string.h>


/* svlinks storage
   name = server name
   passwd = description
*/
aConfItem *vlinks = (aConfItem *)NULL;


/*
 * m_vlink () - add/delete virtual link
 *
 *   parv[0] = sender prefix
 *   parv[1] = [-]virtual server name ('-' as prefix means delete)
 *   parv[2] = virtual server description (only used when adding)
 */
int   m_vlink(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
  {
    aConfItem *vl, *last_vl = NULL;
   
   int is_del = 0; /* delete flag */
   if (!IsServer(sptr) && !IsService(sptr))
     {   
      if (IsServer(cptr))
        {
         ts_warn("Got VLINK from non-service/server: %s",
           sptr->name);
         sendto_one(cptr, ":%s WALLOPS :ignoring VLINK from non-service/server %s",
           me.name, sptr->name);
        }      
      return 0;
     }
     
    if(parc>1 && parv[1][0]=='-')
        is_del = 1;
   
   if(parc<2 || (!is_del && parc<3))
     {
      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
           me.name, parv[0], "VLINK");
        return 0;
     }

    if(is_del) /* delete vlink */
      {
        vl = vlinks;
        while(vl && irccmp(vl->name, &parv[1][1]))
        {
            last_vl = vl;
          vl = vl->next;
         }
         
        if (vl) /* if vlink does exist */
         {
            struct Client *acptr;
            /* lets check if any user pointing to this vlink */
            for (acptr = GlobalClientList; acptr; acptr = acptr->next)
              {
                if(acptr->user && acptr->user->vlink==vl)
                  acptr->user->vlink = NULL;
              }
          if(last_vl) /* this is not the first sqline */
           last_vl->next=vl->next; /* adjust list link -> */
          else
           vlinks = vl->next;         
          free_conf(vl);
          }
         
       sendto_serv_butone(cptr, ":%s VLINK %s",
         parv[0], parv[1]);         
      }
    else /* add vlink */
      {
        if(!valid_hostname(parv[1]))
          {
             ts_warn("Got invalid VLINK hostname: %s from %s",
           parv[1], sptr->name);
            return 0;
          }
        vl = find_vlink(parv[1]);
        if(!vl)
          {
            vl = make_conf();
           DupString(vl->name, parv[1]);
            DupString(vl->passwd, parv[2]);
            vl->next = vlinks;
            vlinks = vl;
          }
        sendto_serv_butone(cptr, ":%s VLINK %s :%s",
        parv[0], parv[1], parv[2]);
      }
    return 1;
  }

/*
 * find_vlink  - checks if nick/mask matchs any entry on the vlink list
 * inputs       - lookup nick/mask
 * output       - return gline entry if found or NULL if not found;
 * side effects - none
 */
struct ConfItem* find_vlink(char *nick)
  {
   aConfItem *vl = vlinks;
   
   while(vl && !match(vl->name, nick))
     vl = vl->next;
         
   return vl;   
  }
 
/* send_all_vlinks
 *
 * inputs       - pointer to aClient
 * output       - none
 * Side effects - sends all vlinks to the specified server
 *
 */
void send_all_vlinks(struct Client *acptr)
  {
   aConfItem *vl = vlinks;
   
   while(vl)
     {
       sendto_one(acptr, ":%s VLINK %s :%s",
         me.name, vl->name, vl->passwd);   
      vl = vl->next;      
     }
  }
 
/*
 * report_vlinks
 *
 * inputs       - pointer to client to report to
 * output       - none
 * side effects - all Q lines are listed to client
 */
void report_vlinks(struct Client *sptr)
{
  struct ConfItem *aconf = vlinks;
  char *host;
  char *user;
  char *pass;
  char *name;
  int port;

  while(aconf)
   {
       get_printable_conf(aconf, &name, &host, &pass, &user, &port);
         
      sendto_one(sptr, form_str(RPL_STATSQLINE),
                   me.name, sptr->name, name, pass, "", "");
     aconf=aconf->next;    
    }
}


/*
 * clear_vlinks
 *
 * inputs       - none
 * output       - none
 * side effects - clear the vlinks list
 */
void clear_vlinks()
  {
 
    aConfItem *aconf;   
    aConfItem *vl=vlinks;
    aClient *acptr;
       
    /* clear all vlink bindings */
    for (acptr = GlobalClientList; acptr; acptr = acptr->next)
      {
        if(acptr->user && acptr->user->vlink)
          acptr->user->vlink = NULL;
      }     
   while(vl)
     {
      aconf = vl->next;
      free_conf(vl);
      vl = aconf;
     }
          
   vlinks = NULL;   
  }

/*
 * dump_vlinks
 *
 * inputs       - none
 * output       - none
 * side effects - send vlinks list with LINKS format
 */
void dump_vlinks(char* dest, struct Client *acptr)
  {
     aConfItem *vl=vlinks;
    char *mename = me.name;

    if(acptr->user && acptr->user->vlink)
      mename = acptr->user->vlink->name;
   
    while(vl)
      {
        sendto_one(acptr, form_str(RPL_LINKS),
            mename, dest, vl->name, mename,
            0, vl->passwd);   
        vl=vl->next;
      }
  }


On IRC Services will appear just link that

-OperServ- Syntax: VLINK ADD virtualhost serverinfo
-OperServ- VLINK DEL virtualhost
-OperServ- VLINK LIST [pattern]
-OperServ- VLINK VIEW [pattern]
-OperServ-
-OperServ- Allows Services admins to manipulate the VLINK list.
-OperServ- VLINK allows you to set virtual server names (vhost).





-OperServ- Syntax: VADMIN ADD nick
-OperServ-             VADMIN DEL nick
-OperServ-
-OperServ- Allows Services admins to manipulate the VADMIN list.




-OperServ- Syntax: VCOP ADD nick
-OperServ-             VCOP DEL nick
-OperServ-
-OperServ- Allows Services admins to manipulate the VCOP list.
Title: Re: Ideas for development
Post by: Jan Milants on July 09, 2011, 11:53:42 PM
PTlink support will not be added to 1.9 due to PTlink being dead (hasn't been maintained for some time), thus the next anope stable branch will not support it..
Title: Re: Ideas for development
Post by: IceCube on July 10, 2011, 12:02:50 AM
what about those one?
Could u creat a module for that ideas?

Another idea is to create a team that can be responsible for the Virtual Host, BotServ and Global Notice, for example:

/ OperServ botadm add nick

That is, all that are added to this list, will be responsible for creating bots BotServ. This same idea works for HostServ and Global Notice.

Another idea is that RANDOMNEWS LOGONNEWS and can be sent to the user via PVT, with the normal commands, continue to be sent through the normal means.
Another thing they share is a mechanism that all users who
I am willing to explain and discuss new ideas.

Another thing they share is a mechanism that all users who are Helper + h when they were not in HelpChan or Away or Idle lose their status +h as the list of / helpers / staff show up just for those who are online and available to support
Title: Re: Ideas for development
Post by: katsklaw on July 10, 2011, 05:48:15 AM
what about those one?
Could u creat a module for that ideas?

Another idea is to create a team that can be responsible for the Virtual Host, BotServ and Global Notice, for example:

/ OperServ botadm add nick

That is, all that are added to this list, will be responsible for creating bots BotServ. This same idea works for HostServ and Global Notice.

Another idea is that RANDOMNEWS LOGONNEWS and can be sent to the user via PVT, with the normal commands, continue to be sent through the normal means.
Another thing they share is a mechanism that all users who
I am willing to explain and discuss new ideas.

Another thing they share is a mechanism that all users who are Helper + h when they were not in HelpChan or Away or Idle lose their status +h as the list of / helpers / staff show up just for those who are online and available to support

1> You can already have vhost staff, see HostSetters in example.conf
2> Botserv handles bots, not OperServ. If you don't want certain opers adding bots, or sending globals then tell them not to. If you can't trust them to follow such simple instructions, then do they really need to be opers?
3> +h for non-opers in the help channel shouldn't be on the staff list. /os staff only shows Services Opers and above because +h, non-oper helpers are not considered staff. The +h is an IRCd thing to start with and Anope is nice enough to set +h but has no control over how +h is used by the IRCd nor is +h available on all IRCds.
Title: Re: Ideas for development
Post by: Jan Milants on July 10, 2011, 11:41:12 AM
1 and 2 are redundant given that 1.9 uses opertypes with configurable privileges and cmd access..
Title: Re: Ideas for development
Post by: katsklaw on July 10, 2011, 02:53:48 PM
1 and 2 are redundant given that 1.9 uses opertypes with configurable privileges and cmd access..

I was strictly speaking from 1.8's point of view. I probably shouldn't do that since the topic is "development". lol
Title: Re: Ideas for development
Post by: IceCube on July 11, 2011, 05:50:26 PM
katsklaw I wanna use a non-oper to handle botserv. Is that possible?
Title: Re: Ideas for development
Post by: katsklaw on July 12, 2011, 12:33:16 AM
In 1.8: yes, with a module.

In 1.9: I don't know, I don't use it.
Title: Re: Ideas for development
Post by: IceCube on July 12, 2011, 04:22:23 PM
Can you do the module to use a non-oper to handle botserv? win32 too
Title: Re: Ideas for development
Post by: katsklaw on July 12, 2011, 05:20:49 PM
Can you do the module to use a non-oper to handle botserv? win32 too

Maybe. I only do 1.8 modules though. I work 70+ hours per week so please don't hold your breath.
Title: Re: Ideas for development
Post by: IceCube on July 12, 2011, 06:16:01 PM
that's okay... I only work 20 hours per week... I can wait.