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

            String   name = packet.ReadString(leaf);
            LinkUser user = leaf.Users.Find(x => x.Name == name);

            if (user != null)
            {
                user.Name = packet.ReadString(leaf);

                LeafPool.Leaves.ForEachWhere(x => x.SendPacket(HubOutbound.HubNickChanged(x, leaf.Ident, name, user.Name)),
                                             x => x.Ident != leaf.Ident && x.LoginPhase == LinkLogin.Ready);
            }
        }