예제 #1
0
        internal void SendInstantMessageGroup(Int32 GroupId, string Message)
        {
            var       realGroupID = Math.Abs(GroupId);
            GroupItem theGroup    = OtanixEnvironment.GetGame().GetGroup().LoadGroup(Convert.ToUInt32(realGroupID));

            if (!theGroup.IsMember(UserId))
            {
                return;
            }

            //Console.WriteLine(Message);
            ServerMessage InstantMessage = new ServerMessage(Outgoing.InstantChat);

            InstantMessage.AppendInt32(GroupId);
            InstantMessage.AppendString(Message);
            InstantMessage.AppendInt32(0);
            InstantMessage.AppendString(GetClient().GetHabbo().Username + "/" + GetClient().GetHabbo().Look + "/" + UserId);
            OtanixEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(InstantMessage, "ingroup_" + realGroupID, UserId);
        }
예제 #2
0
        private void BroadcastPacketsWithRankRequirement()
        {
            if (authorizedPacketSending.Count > 0)
            {
                lock (authorizedPacketSending.SyncRoot)
                {
                    while (authorizedPacketSending.Count > 0)
                    {
                        FusedPacket packet = (FusedPacket)authorizedPacketSending.Dequeue();
                        foreach (var client in clients.Values)
                        {
                            if (packet.requirements.Contains("ingroup"))
                            {
                                var       reqSplit = packet.requirements.Split('_');
                                GroupItem Group    = OtanixEnvironment.GetGame().GetGroup().LoadGroup(Convert.ToUInt32(reqSplit[1]));
                                if (!Group.IsMember(client.GetHabbo().Id) || client.GetHabbo().Id == packet.userId)
                                {
                                    continue;
                                }

                                client.SendMessage(packet.content);
                            }
                            else
                            {
                                if (client == null || client.GetHabbo() == null || !client.GetHabbo().HasFuse(packet.requirements) || client.GetHabbo().Id == packet.userId)
                                {
                                    continue;
                                }

                                client.SendMessage(packet.content);
                            }
                        }
                    }
                }
            }
        }