Twister
New Member
- May 24, 2015
- 29
- 1
Hello DevBest,
I install new PRODUCTION-201802201205-141713395 on PlusEmuR2 and I try to fixe EventAlertCommand. But she doesn't work, when I execute this commande on the client nothing is coming.
This is my EventCommand.cs
and the code of RoomNotificationComposer.cs
My packet for RoomNotificationMessageComposer -> 2940
Thnks for your help
Have a good day
PS: I have see my AboutCommand doesn't work. I think the problem come RoomNotificationComposer
I install new PRODUCTION-201802201205-141713395 on PlusEmuR2 and I try to fixe EventAlertCommand. But she doesn't work, when I execute this commande on the client nothing is coming.
This is my EventCommand.cs
Code:
using Plus.Communication.Packets.Outgoing.Moderation;
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.GameClients;
using System;
using System.Linq;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Events
{
internal class EventAlertCommand : IChatCommand
{
public string PermissionRequired
{
get
{
return "command_event_alert";
}
}
public string Parameters
{
get
{
return "";
}
}
public string Description
{
get
{
return "Permet d'envoyer une alerte concernant les animations.";
}
}
public void Execute(GameClient Session, Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Merci d'entrer un message pour l'évenement a annoncer exemple d'utilisation de la commande :eventha message");
return;
}
string Message = CommandManager.MergeParams(Params, 1);
PlusEnvironment.GetGame().GetClientManager().SendPacket(new RoomNotificationComposer("Messages des animateurs", "Une nouvelle animation se déroule chez <b> " + Room.OwnerName + "</b>.\n\nDépêche toi de participer avan que l'appart ne soit fermé ! Clique sur le bouton <b><i> Aller dans l'appart</i></b> pour participer à l'animation. \n\n" + "Plus de détails :<b> " + Message + "</b>\n\n", "evento", "Aller dans l'appart", "event:navigator/goto/" + Session.GetHabbo().CurrentRoom.RoomId));
}
}
}
and the code of RoomNotificationComposer.cs
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace Plus.Communication.Packets.Outgoing.Rooms.Notifications
{
class RoomNotificationComposer : ServerPacket
{
public RoomNotificationComposer(string Title, string Message, string Image, string HotelName = "", string HotelURL = "")
: base(ServerPacketHeader.RoomNotificationMessageComposer)
{
base.WriteString(Image);
base.WriteInteger(string.IsNullOrEmpty(HotelName) ? 2 : 4);
base.WriteString("title");
base.WriteString(Title);
base.WriteString("message");
base.WriteString(Message);
if (!string.IsNullOrEmpty(HotelName))
{
base.WriteString("linkUrl");
base.WriteString(HotelURL);
base.WriteString("linkTitle");
base.WriteString(HotelName);
}
}
public RoomNotificationComposer(string Type, string Key, string Value)
: base(ServerPacketHeader.RoomNotificationMessageComposer)
{
base.WriteString(Type);
base.WriteInteger(1);//Count
{
base.WriteString(Key);//Type of message
base.WriteString(Value);
}
}
public RoomNotificationComposer(string type, Dictionary<string, string> dataDict)
: base(ServerPacketHeader.RoomNotificationMessageComposer)
{
base.WriteString(type);
// Assumed 'count' of key-value pairs is equal to num keys.
// Hopefully no one puts a null value.
base.WriteInteger(dataDict.Keys.Count);
foreach (KeyValuePair<string, string> dictPair in dataDict)
{
base.WriteString(dictPair.Key);
base.WriteString(dictPair.Value);
}
}
public static ServerPacket SendBubble(string image, string message, string linkUrl = "")
{
var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);
bubbleNotification.WriteString(image);
bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);
bubbleNotification.WriteString("display");
bubbleNotification.WriteString("BUBBLE");
bubbleNotification.WriteString("message");
bubbleNotification.WriteString(message);
if (string.IsNullOrEmpty(linkUrl)) return bubbleNotification;
bubbleNotification.WriteString("linkUrl");
bubbleNotification.WriteString(linkUrl);
return bubbleNotification;
}
public RoomNotificationComposer(string Type)
: base(ServerPacketHeader.RoomNotificationMessageComposer)
{
base.WriteString(Type);
base.WriteInteger(0);//Count
}
}
}
My packet for RoomNotificationMessageComposer -> 2940
Thnks for your help
Have a good day
PS: I have see my AboutCommand doesn't work. I think the problem come RoomNotificationComposer