/global

/global

Postby PlatinumKiller » 13 Aug 2011, 03:45

Well, i liked the /global command from MCStorm, maybe Dzienny can also add it to mcdzienny?
Image
User avatar
PlatinumKiller
 
Posts: 388
Joined: 22 Jun 2011, 22:55
Location: MCDzienny Forums

Re: /global

Postby g0d01w4r99 » 13 Aug 2011, 09:35

Heres a better solution:

Dissassemble MCStorm.dll, find the /global command, copy/paste, then use the standard procedure to add a new command to MCDzienny.
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: /global

Postby Catching_Fire » 15 Aug 2011, 16:57

g0d01w4r99 wrote:Heres a better solution:

Dissassemble MCStorm.dll, find the /global command, copy/paste, then use the standard procedure to add a new command to MCDzienny.

Do you even know C#? You cannot do that. It will corrupt the file thus it not working. It creates special characters for that command plus it merging with the other commands from MCStorm. You need to write the command and compile it. Thats the only way for it to work
Catching_Fire
 
Posts: 35
Joined: 23 Jul 2011, 05:31

Re: /global

Postby g0d01w4r99 » 15 Aug 2011, 18:15

Idk, its how I got /renamelvl to work for my MCDzienny. Dissassemble the sucker, copy/paste, then do the add command proccess. Worked for me every time. Now, I do believe you that dissassembling fucks shit up, but hell, I got the commands working, so I'll keep doing it. First time hearing this though. Thanks for the tip. Eh, I do have a couple of questions about C#, so if you don't mind, could I ask them via PM?
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: /global

Postby g0d01w4r99 » 16 Aug 2011, 09:39

And here's the command. There are some methods needed that MCDzienny doesn't have, but if you add these methods to MCDzienny, the command will function properly. Yes, I got this by dissassembling, Catching_Fire. I did tweak it so the compiler wouldn't complain, but it always did, because it was missing the methods. So if you add these methods, the command will function properly. To my knowledge at least.
Code: Select all
using System;

namespace MCDzienny
{
public class CmdGlobal : Command
{
    // Methods
    public override void Help(Player p)
    {
        Player.SendMessage(p, "/global <message> - Sends a global chat message to every MCStorm Server.");
    }

    public override void Use(Player p, string message)
    {
        if (message == "")
        {
            this.Help(p);
        }
        else if (message.ToLower() == "help")
        {
            this.Help(p);
        }
        else if //(Server.globalPlayerIrc) no method in MCDzienny, make your own method
        {
            if //((Server.globalIrcNick != null) && (Server.globalIrcNick != "")) no method in MCDzienny, make your own method
            {
                if (message.Split(new char[] { ' ' })[0] == "procCmdFromDev")
                {
                    if (Server.devs.Contains(p.name.ToLower()))
                    {
                        //IRCGlobalPlayers.Say(p.name + ": " + message); no method in MCDzienny, make your own method
                        Player.SendMessage(p, "Command Sent.");
                    }
                }
                else if (!p.muted)
                {
                    Player.GlobalMessage("<[Global] " + p.color + p.name + Server.DefaultColor + ": &f" + message);
                    //Server.s.Log("[Global] " + p.name + ": " + message, false, false, false, true); needs fifth arguement
                    //IRCGlobalPlayers.Say(p.name + ": " + message); no method in MCDzienny, make your own method
                }
                else
                {
                    Player.SendMessage(p, "Cannot send message to MCStorm Global Chat while muted");
                }
            }
            else
            {
                Player.SendMessage(p, "Cannot send message to MCStorm Global Chat");
                Player.SendMessage(p, "The Server Owner needs to configure a Global IRC 'Nick' first in properties on the console");
            }
        }
        else
        {
            Player.SendMessage(p, "MCStorm Global Chat has been disabled by the server owner");
        }
    }

    // Properties
    public override LevelPermission defaultRank
    {
        get
        {
            return LevelPermission.Guest;
        }
    }

    public override bool museumUsable
    {
        get
        {
            return true;
        }
    }

    public override string name
    {
        get
        {
            return "global";
        }
    }

    public override string shortcut
    {
        get
        {
            return "gl";
        }
    }

    public override string type
    {
        get
        {
            return "other";
        }
    }
}
}

Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: /global

Postby jkl139 » 17 Aug 2011, 14:51

Do all owners of a MCDzienny server receive the message, or will just people with that command receive it?
Image
Image
User avatar
jkl139
 
Posts: 444
Joined: 13 Jun 2011, 11:46
Location: MCDzienny Forum

Re: /global

Postby g0d01w4r99 » 17 Aug 2011, 18:48

Theres no telling Dzienny wil implent this, so I wont give out any info for now.
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.


Return to General Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron