Aller au contenu

Moha

Contributeur
  • Compteur de contenus

    172
  • Inscription

  • Dernière visite

  • Jours gagnés

    4

Messages posté(e)s par Moha

  1. il y a 3 minutes, TheJill a dit :

    Merci pour le partage j'ai déjà vu cette commande sur d'autres ému c'est assez fun ;) Perso je verrais bien une fonction en plus pour remplacer automatiquement certains smileys écris normalement genre":)" ,":p" etc... par les smileys ajoutés par cette commande ça doit être faisable mais ne sachant pas programmer ...;)

    Oui bonne idée bonne chance a toi

     

  2. Bonjour tout le monde:humour-20--49d90d: , je vous partage une petite commande :emoji 

    Q6I1Kwc.png

     

    Alors pour commencer allez dans HabboHotel => Rooms => Chat => Commands => CommandManager.cs , en dessous de this.Register("mimic", new MimicCommand()); ajoutez ça : 

    this.Register("emoji", new EmojiCommand());

    Après rendez-vous : .\HabboHotel\Rooms\Chat\Commands\User\

    Ensuite ajouter une nouvelle class nommé  EmojiCommand.cs

    Et ajoutez donc dans la class:

    using Plus.Communication.Packets.Outgoing;
                                              
    //                © 2018 - 2019 M2o .
    using Plus.Communication.Packets.Outgoing.Notifications;
    using Plus.Communication.Packets.Outgoing.Rooms.Chat;
    using Plus.Communication.Packets.Outgoing.Rooms.Engine;
    using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Plus.HabboHotel.Rooms.Chat.Commands.User
    {
        class EmojiCommand : IChatCommand
        {
            public string PermissionRequired
            {
                get { return ""; }
            }
            public string Parameters
            {
                get { return ""; }
            }
            public string Description
            {
                get { return "Emoji"; }
            }
            public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
            {
                if (Params.Length == 1)
                {
                    Session.SendWhisper("Tape :emoji liste");
                    return;
                }
                string emoji = Params[1];
    
                if (emoji.Equals("liste"))
                {
                    ServerPacket notif = new ServerPacket(ServerPacketHeader.NuxAlertMessageComposer);
                    notif.WriteString("habbopages/chat/emoji.txt");
                    Session.SendMessage(notif);
                }
                else
                {
                    int emojiNum;
                    bool isNumeric = int.TryParse(emoji, out emojiNum);
                    if (isNumeric)
                    {
                        switch (emojiNum)
                        {
                            default:
                                bool isValid = true;
                                if (emojiNum < 1)
                                {
                                    isValid = false;
                                }
    
                                if (emojiNum > 189 && Session.GetHabbo().Rank < 6)
                                {
                                    isValid = false;
                                }
    
                                
                                if (isValid)
                                {
                                    string Username;
                                    RoomUser TargetUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username);
                                    if (emojiNum < 10)
                                    {
                                        Username = "<img src='/swf/c_images/emoji/yzf/Emoji Smiley-" + emojiNum + ".png' height='20' width='20'><br>    >";
                                    }
                                    else
                                    {
                                        Username = "<img src='/swf/c_images/emoji/yzf/Emoji Smiley-" + emojiNum + ".png' height='20' width='20'><br>    >";
                                    }
                                    if (Room != null)
                                        Room.SendMessage(new UserNameChangeComposer(Session.GetHabbo().CurrentRoomId, TargetUser.VirtualId, Username));
    
                                    string Message = " ";
                                    Room.SendMessage(new ChatComposer(TargetUser.VirtualId, Message, 0, TargetUser.LastBubble));
                                    TargetUser.SendNamePacket();
    
                                }
                                else
                                {
                                    Session.SendWhisper("Emoji invalide");
                                }
    
                                break;
                        }
                    }
                    else
                    {
                        Session.SendWhisper("Numero invalide tape :emoji liste , pour voir les numéros des emojis");
                    }
                }
            }
        }
    }

     Ensuite rendez-vous dans vos SWF - dossier " c_images", importer le dossier "yzf".

     Après importer : emoji.txt dans ./gamedata/habbopages/chat/

     Et pour finir ajoutez sa a votre base de donnée.

    INSERT INTO `permissions_commands` VALUES ('command_emoji', '1', '0');

    Bonne utilisation , en cas de d'erreurs contactez moi.

    Ps: Le fichier PACK.rar contient : (emoji.txt et le dossier yzf)

    Pack.rar

  3. ServerPacketHeader
    https://pastebin.com/4QXJ3qhC

    ClientPacketHeader
    https://pastebin.com/ZRcURtY8

    RSAKeys & SWF:
    public class RSAKeys
    {
    public string N = "86851DD364D5C5CECE3C883171CC6DDC5760779B992482BD1E20DD296888DF91B33B936A7B93F06D29E8870F703A216257DEC7C81DE0058FEA4CC5116F75E6EFC4E9113513E45357DC3FD43D4EFAB5963EF178B78BD61E81A14C603B24C8BCCE0A12230B320045498EDC29282FF0603BC7B7DAE8FC1B05B52B2F301A9DC783B7";
    public string D = "59ae13e243392e89ded305764bdd9e92e4eafa67bb6dac7e1415e8c645b0950bccd26246fd0d4af37145af5fa026c0ec3a94853013eaae5ff1888360f4f9449ee023762ec195dff3f30ca0b08b8c947e3859877b5d7dced5c8715c58b53740b84e11fbc71349a27c31745fcefeeea57cff291099205e230e0c7c27e8e1c0512b";
    public string E = "3";
    }


     

    Citation

     

  4. Dans ton fichier : StringCharFilter.cs, remplace ton public par :

    Citation

    public static string Escape(string str, bool allowBreaks = false)
    {
    char[] chArray = new char[2]
    {
    ' ',
    '\t'
    };
    str = str.Trim(chArray);
    str = str.Replace(Convert.ToChar(1), ' ');
    str = str.Replace(Convert.ToChar(2), ' ');
    str = str.Replace(Convert.ToChar(3), ' ');
    str = str.Replace(Convert.ToChar(9), ' ');
    if (!allowBreaks)
    {
    str = str.Replace(Convert.ToChar(10), ' ');
    str = str.Replace(Convert.ToChar(13), ' ');
    }
    str = Regex.Replace(str, "<(.|\n)*?>", string.Empty);
    return str;
    }

     

×
×
  • Créer...