public void f_sync(  )
        {
            Obj_Machinery_Computer_Rdconsole RDC = null;
            dynamic v  = null;
            Tech    T  = null;
            dynamic v2 = null;
            dynamic D  = null;

            this.temp = "Updating local R&D database...";
            this.updateUsrDialog();
            Task13.Sleep(30);

            foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInViewExcludeThis(this, 5), typeof(Obj_Machinery_Computer_Rdconsole)))
            {
                RDC = _c;


                if (!RDC.sync)
                {
                    continue;
                }

                foreach (dynamic _a in Lang13.Enumerate(RDC.files.known_tech))
                {
                    v = _a;

                    T = RDC.files.known_tech[v];
                    this.files.AddTech2Known(T);
                }

                foreach (dynamic _b in Lang13.Enumerate(RDC.files.known_designs))
                {
                    v2 = _b;

                    D = RDC.files.known_designs[v2];
                    this.files.AddDesign2Known(D);
                }
                this.files.RefreshResearch();
                this.temp  = "Processed equipment designs.<br>";
                this.temp += this.update_tech();
                this.temp += new Txt("<a href='?src=").Ref(this).str(";clear_temp=1'>Return</a>").ToString();
                this.updateUsrDialog();
                this.visible_message(new Txt().icon(this).str(" <b>").The(this).item().str("</b> beeps, \"Successfully synchronized with R&D server.\"").ToString());
                return;
            }
            this.temp = new Txt("Unable to connect to local R&D Database.<br>Please check your connections and try again.<br><a href='?src=").Ref(this).str(";clear_temp=1'>Return</a>").ToString();
            this.updateUsrDialog();
            return;
        }
Exemple #2
0
        // Function from file: server.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string dat = null;
            Obj_Machinery_RND_Server         S = null;
            Obj_Machinery_Computer_Rdconsole C = null;
            dynamic console_turf = null;
            Obj_Machinery_Computer_Rdconsole C2 = null;
            dynamic console_turf2       = null;
            dynamic v                   = null;
            dynamic T                   = null;
            dynamic v2                  = null;
            dynamic D                   = null;
            Obj_Machinery_RND_Server S2 = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            ((Mob)a).set_machine(this);
            dat = "";

            switch ((int)(this.screen))
            {
            case 0:
                dat += "Connected Servers:<BR><BR>";

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                {
                    S = _a;


                    if (S is Obj_Machinery_RND_Server_Centcom && !this.badmin)
                    {
                        continue;
                    }
                    dat += "" + S.name + " || ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";access=").item(S.server_id).str("'>Access Rights</A> | ").ToString();
                    dat += new Txt("<A href='?src=").Ref(this).str(";data=").item(S.server_id).str("'>Data Management</A>").ToString();

                    if (this.badmin)
                    {
                        dat += new Txt(" | <A href='?src=").Ref(this).str(";transfer=").item(S.server_id).str("'>Server-to-Server Transfer</A>").ToString();
                    }
                    dat += "<BR>";
                }
                break;

            case 1:
                dat += "" + this.temp_server.name + " Access Rights<BR><BR>";
                dat += "Consoles with Upload Access<BR>";

                foreach (dynamic _b in Lang13.Enumerate(this.consoles, typeof(Obj_Machinery_Computer_Rdconsole)))
                {
                    C = _b;

                    console_turf = GlobalFuncs.get_turf(C);
                    dat         += new Txt("* <A href='?src=").Ref(this).str(";upload_toggle=").item(C.id).str("'>").item(console_turf.loc).ToString();

                    if (this.temp_server.id_with_upload.Contains(C.id))
                    {
                        dat += " (Remove)</A><BR>";
                    }
                    else
                    {
                        dat += " (Add)</A><BR>";
                    }
                }
                dat += "Consoles with Download Access<BR>";

                foreach (dynamic _c in Lang13.Enumerate(this.consoles, typeof(Obj_Machinery_Computer_Rdconsole)))
                {
                    C2 = _c;

                    console_turf2 = GlobalFuncs.get_turf(C2);
                    dat          += new Txt("* <A href='?src=").Ref(this).str(";download_toggle=").item(C2.id).str("'>").item(console_turf2.loc).ToString();

                    if (this.temp_server.id_with_download.Contains(C2.id))
                    {
                        dat += " (Remove)</A><BR>";
                    }
                    else
                    {
                        dat += " (Add)</A><BR>";
                    }
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";main=1'>Main Menu</A>").ToString();
                break;

            case 2:
                dat += "" + this.temp_server.name + " Data ManagementP<BR><BR>";
                dat += "Known Technologies<BR>";

                foreach (dynamic _d in Lang13.Enumerate(this.temp_server.files.known_tech))
                {
                    v = _d;

                    T    = this.temp_server.files.known_tech[v];
                    dat += "* " + T.name + " ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";reset_tech=").item(T.id).str("'>(Reset)</A><BR>").ToString();
                }
                dat += "Known Designs<BR>";

                foreach (dynamic _e in Lang13.Enumerate(this.temp_server.files.known_designs))
                {
                    v2 = _e;

                    D    = this.temp_server.files.known_designs[v2];
                    dat += "* " + D.name + " ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";reset_design=").item(D.id).str("'>(Delete)</A><BR>").ToString();
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";main=1'>Main Menu</A>").ToString();
                break;

            case 3:
                dat += "" + this.temp_server.name + " Server to Server Transfer<BR><BR>";
                dat += "Send Data to what server?<BR>";

                foreach (dynamic _f in Lang13.Enumerate(this.servers, typeof(Obj_Machinery_RND_Server)))
                {
                    S2 = _f;

                    dat += new Txt().item(S2.name).str(" <A href='?src=").Ref(this).str(";send_to=").item(S2.server_id).str("'>(Transfer)</A><BR>").ToString();
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";main=1'>Main Menu</A>").ToString();
                break;
            }
            Interface13.Browse(a, "<TITLE>R&D Server Control</TITLE><HR>" + dat, "window=server_control;size=575x400");
            GlobalFuncs.onclose(a, "server_control");
            return(null);
        }
Exemple #3
0
        // Function from file: server.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_Machinery_RND_Server         S = null;
            Obj_Machinery_Computer_Rdconsole C = null;
            Obj_Machinery S2      = null;
            double?       num     = null;
            double?       num2    = null;
            string        choice  = null;
            dynamic       T       = null;
            string        choice2 = null;
            dynamic       D       = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            Task13.User.set_machine(this);

            if (!this.allowed(Task13.User) && !Lang13.Bool(this.emagged))
            {
                Task13.User.WriteMsg("<span class='danger'>You do not have the required access level.</span>");
                return(null);
            }

            if (Lang13.Bool(href_list["main"]))
            {
                this.screen = 0;
            }
            else if (Lang13.Bool(href_list["access"]) || Lang13.Bool(href_list["data"]) || Lang13.Bool(href_list["transfer"]))
            {
                this.temp_server = null;
                this.consoles    = new ByTable();
                this.servers     = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                {
                    S = _a;


                    if (S.server_id == String13.ParseNumber(href_list["access"]) || S.server_id == String13.ParseNumber(href_list["data"]) || S.server_id == String13.ParseNumber(href_list["transfer"]))
                    {
                        this.temp_server = S;
                        break;
                    }
                }

                if (Lang13.Bool(href_list["access"]))
                {
                    this.screen = 1;

                    foreach (dynamic _b in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Rdconsole)))
                    {
                        C = _b;


                        if (C.sync)
                        {
                            this.consoles.Add(C);
                        }
                    }
                }
                else if (Lang13.Bool(href_list["data"]))
                {
                    this.screen = 2;
                }
                else if (Lang13.Bool(href_list["transfer"]))
                {
                    this.screen = 3;

                    foreach (dynamic _c in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                    {
                        S2 = _c;


                        if (S2 == this)
                        {
                            continue;
                        }
                        this.servers.Add(S2);
                    }
                }
            }
            else if (Lang13.Bool(href_list["upload_toggle"]))
            {
                num = String13.ParseNumber(href_list["upload_toggle"]);

                if (this.temp_server.id_with_upload.Contains(num))
                {
                    this.temp_server.id_with_upload.Remove(num);
                }
                else
                {
                    this.temp_server.id_with_upload.Add(num);
                }
            }
            else if (Lang13.Bool(href_list["download_toggle"]))
            {
                num2 = String13.ParseNumber(href_list["download_toggle"]);

                if (this.temp_server.id_with_download.Contains(num2))
                {
                    this.temp_server.id_with_download.Remove(num2);
                }
                else
                {
                    this.temp_server.id_with_download.Add(num2);
                }
            }
            else if (Lang13.Bool(href_list["reset_tech"]))
            {
                choice = Interface13.Alert("Technology Data Reset", "Are you sure you want to reset this technology to its default data? Data lost cannot be recovered.", "Continue", "Cancel");

                if (choice == "Continue")
                {
                    T = this.temp_server.files.known_tech[href_list["reset_tech"]];

                    if (Lang13.Bool(T))
                    {
                        T.level = 1;
                    }
                }
                this.temp_server.files.RefreshResearch();
            }
            else if (Lang13.Bool(href_list["reset_design"]))
            {
                choice2 = Interface13.Alert("Design Data Deletion", "Are you sure you want to delete this design? If you still have the prerequisites for the design, it'll reset to its base reliability. Data lost cannot be recovered.", "Continue", "Cancel");

                if (choice2 == "Continue")
                {
                    D = this.temp_server.files.known_designs[href_list["reset_design"]];

                    if (Lang13.Bool(D))
                    {
                        this.temp_server.files.known_designs.Remove(D.id);
                    }
                }
                this.temp_server.files.RefreshResearch();
            }
            this.updateUsrDialog();
            return(null);
        }