All pastes #838635 Raw Edit

Anonymous

public text v1 · immutable
#838635 ·published 2007-12-30 15:22 UTC
rendered paste body
        static void GetRemoteAuth(ref bool auth)
        {

            dupe = flow;
            RemoteHost = dupe.Substring(dupe.IndexOf("@") + 1, dupe.IndexOf("\x20") - dupe.IndexOf("@") - 1);


            id = Array.BinarySearch(usrdb.entries, RemoteNick, new ObjSearch());

            if (id >= 0 && (validDNS = (bool)((object[])usrdb.entries[id])[2]) && RemoteHost.Equals(((object[])usrdb.entries[id])[1]))
            {
                core.mixArray = (string[])((object[])usrdb.entries[id])[3];
                auth = true;
            }

            else
            {
                RemoteIP = (database.resolve(RemoteHost));


                if (id >= 0 && !validDNS && RemoteIP.StartsWith((string)((object[])usrdb.entries[id])[1]))
                {
                    core.mixArray = (string[])((object[])usrdb.entries[id])[3];
                    auth = true;
                }

                else
                {
                    STREAM_WRLINE("WHOIS " + RemoteNick);
                    auth = false;
                }
            }

        }

        static void timeMode()
        {
            Thread.Sleep(3600000);
            STREAM_WRLINE(Thread.CurrentThread.Name);
        }

        public static void STREAM_WRLINE(string FLOW_IN)
        {
            STREAM_WR.WriteLine(FLOW_IN);
            STREAM_WR.Flush();
        }


        static bool predi(string x)
        {
            if (x.Remove(0, x.IndexOf("#")).Equals(AuthProbe))
                return true;
            else
                return false;
        }

    }



    struct ObjSort : IComparer
    {
        int IComparer.Compare(object x, object y)
        {
            return ((string)((object[])x)[0]).CompareTo((string)((object[])y)[0]);
        }

    }

    struct ObjSearch : IComparer
    {
        int IComparer.Compare(object x, object y)
        {


            return ((string)((object[])x)[0]).CompareTo(y);
        }

    }