Author Topic: I3/IMC tell loophole fix.  (Read 1339 times)

Offline quixadhal

  • BFF
  • ***
  • Posts: 631
    • View Profile
    • WileyMUD
I3/IMC tell loophole fix.
« on: September 19, 2014, 09:02:23 PM »
So, here's a small fix to make I3 tells (and IMC2 tells) use the existing intermud restriction settings.  If you have your mud set to restircted, you have to explicitly add characters to the list of people allowed to use I3 channels, which for most cases is a small subset of immortals and trusted players.

/daemon/services/tell.c
Code: [Select]
void eventSendTell(string who, string where, string msg) {
    string pl, plc, ret;

    pl = this_player(1)->GetName();
    plc = this_player(1)->GetCapName();
    where = INTERMUD_D->GetMudName(where);

    if(RESTRICTED_INTERMUD) {
        if(!imud_privp(lower_case(pl))) {
            this_player(1)->eventPrint("You lack the power to send tells to other worlds.", MSG_CONV);
            return;
        }
    }

    INTERMUD_D->eventWrite(({ "tell", 5, mud_name(), pl, where,
                convert_name(who), plc, msg }));
    ret = "%^BOLD%^RED%^You tell " + capitalize(who) +
        "@" +  where + ":%^RESET%^ " + msg;
    this_player(1)->eventPrint(ret, MSG_CONV);
    this_player(1)->eventTellHist(ret);
    tn("eventSendTell: "+identify( ({ "tell", 5, mud_name(), pl, where, convert_name(who), plc, msg }) ), "yellow");
}

and for imc2:

/secure/daemon/imc2.c
Code: [Select]
    varargs static void tell_out(object from, string targname, string targmud, string msg, int reply, int emote){
        string ret = "%^BOLD%^RED%^You tell " + capitalize(targname) +
          "@" + targmud + ":%^RESET%^ " + msg;
        // Send outgoing tell.
        if(RESTRICTED_INTERMUD) {
            if(!imud_privp(lower_case(from->GetKeyName()))) {
                this_player(1)->eventPrint("You lack the power to send tells to other worlds.", MSG_CONV);
                return;
            }
        }

        if(!reply) reply=0;
        send_packet(capitalize(from->GetKeyName()),"tell",targname,targmud,
          "text="+escape(msg));
        from->eventPrint(ret, MSG_CONV);
        from->eventTellHist(ret);
    }

The same code that's been added to eventSendTell() should also be added to eventSendEmote() in /daemon/services/emote.c.

Offline Salius

  • Acquaintance
  • *
  • Posts: 2
    • View Profile
Re: I3/IMC tell loophole fix.
« Reply #1 on: September 20, 2014, 01:11:14 AM »
this space for rent

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: I3/IMC tell loophole fix.
« Reply #2 on: September 20, 2014, 05:29:41 AM »
licensing please. I want to know whether I can just lift it or whether I have to come up with my own for the distro.

Offline Gogron

  • Acquaintance
  • *
  • Posts: 3
    • View Profile
Re: I3/IMC tell loophole fix.
« Reply #3 on: September 21, 2014, 07:17:55 AM »
Code: [Select]
        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2014 Dread Quixadhal <quixadhal@awasteoftime.net>

 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO.
« Last Edit: September 21, 2014, 07:20:20 AM by Gogron »

Offline quixadhal

  • BFF
  • ***
  • Posts: 631
    • View Profile
    • WileyMUD
Re: I3/IMC tell loophole fix.
« Reply #4 on: September 21, 2014, 09:59:26 AM »
Oh, yep... public domain.  If you want to be nice, stick a one line comment like // Quixadhal was here, but not required. :)