Esempio n. 1
0
        private static void LeafPrivateText(Leaf leaf, TCPPacketReader packet)
        {
            if (leaf.LoginPhase != LinkLogin.Ready)
            {
                leaf.SendPacket(HubOutbound.LinkError(LinkError.BadProtocol));
                leaf.Disconnect();
                return;
            }

            uint   target_leaf = packet;
            String target_name = packet.ReadString(leaf);
            String sender_name = packet.ReadString(leaf);
            String text        = packet.ReadString(leaf);
            Leaf   l           = LeafPool.Leaves.Find(x => x.Ident == target_leaf && x.LoginPhase == LinkLogin.Ready);

            if (l != null)
            {
                l.SendPacket(HubOutbound.HubPrivateText(l, leaf.Ident, sender_name, target_name, text));
            }
        }