コード例 #1
0
        private static void LeafIUser(Leaf leaf, TCPPacketReader packet)
        {
            if (leaf.LoginPhase != LinkLogin.Ready)
            {
                leaf.SendPacket(HubOutbound.LinkError(LinkError.BadProtocol));
                leaf.Disconnect();
                return;
            }

            uint target_leaf = packet;
            Leaf l           = LeafPool.Leaves.Find(x => x.Ident == target_leaf && x.LoginPhase == LinkLogin.Ready);

            if (l != null)
            {
                String        name    = packet.ReadString(leaf);
                String        command = packet.ReadString(leaf);
                List <String> args    = new List <String>();

                while (packet.Remaining > 0)
                {
                    args.Add(packet.ReadString(leaf));
                }

                l.SendPacket(HubOutbound.HubIUser(l, name, command, args.ToArray()));
            }
        }