상속: MonoBehaviour
예제 #1
0
        //刷新游戏设置
        private void button_readServerSet_Click(object sender, EventArgs e)
        {
            config.SelectedObject = null;
            server server = new server();

            config.SelectedObject = server.ReadMCServerConfig(server_save);
        }
예제 #2
0
        public void Handler154_type_33()
        {
            //±š³!³²
            //1³²1³²0³²0³²3³²4³²BaoBab 1³²0³²12³²
            //1³²1³²0³²0³²21³²4³²BaoBab 2³²11³²12³²°
            //1³²1³²0³²0³²1³²2³²U.F.O. 1³²11³²12³²
            //1³²1³²0³²0³²23³²2³²U.F.O. 2³²1³²12³²

            int null_0  = Convert.ToInt32(Message.getParameter());
            int id_area = Convert.ToInt32(Message.getParameter());

            server message = new server("š³!");

            foreach (KeyValuePair <int, scenario.dataScenario> escenario in Environment.Game.areas.areas)
            {
                if (escenario.Value.id_principal == id_area)
                {
                    message.Append("³²" + 1 + "³²" + 1 + "³²" + 0 + "³²" + 0 + "³²" + escenario.Value.id_area + "³²" + escenario.Value.id_principal + "³²" + escenario.Value.nombre + "³²" + escenario.Value.visitantes + "³²" + escenario.Value.max_visitantes);
                }
            }


            message.Append("³²");
            SendMessage(message);
        }
예제 #3
0
        public async Task <IActionResult> PutServer_Info([FromRoute] int id, [FromBody] server Server_Info)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != Server_Info.Server_ID)
            {
                return(BadRequest());
            }

            _context.Entry(Server_Info).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Server_InfoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #4
0
 public void enviar_atodoelarea(server message)
 {
     foreach (int session_id in sesiones_usuarios.Keys)
     {
         Environment.sessions.GetSession(session_id).SendMessage(message);
     }
 }
예제 #5
0
        public void Handler200_type_121()
        {
            string id_objeto = Message.getParameter();

            server message = new server("ȳz³²");

            message.Append(id_objeto + "³²"); //ID objeto
            message.Append("1³²");
            message.Append(mUser.usuario + " ha atrapado un cofre y obtiene: 1000 créditos de oro.³²");

            server message_2 = new server("ȳ{³²1³²");

            message_2.Append(id_objeto + "³²");

            server message_3 = new server("¢³²");

            message_3.Append("1000³²");

            mUser.scenarioInstance.enviar_atodoelarea(message);
            mUser.scenarioInstance.enviar_atodoelarea(message_2);
            mUser.scenarioInstance.enviar_atodoelarea(message_3);

            mUser.creditos_oro = mUser.creditos_oro + 1000;

            Environment.Game.User.update_credits(mUser);
        }
예제 #6
0
        public void Handler120_type_134()
        {
            server message = new server("x");

            message.Append("³†³²1³2³3³4³5³6³23³81³89³90³91³92³93³94³95³96³97³98³99³100³101³102³103³104³105³110³153³154³155³156³157³158³159³160³161³162³163³164³165³166³167³168³169³170³171³172³173³174³175³176³177³178³179³180³181³182³183³184³185³186³187³188³189³²0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³0³²");
            SendMessage(message);
        }
예제 #7
0
        public void Handler187_type_0() //Inicio navegador islas
        {
            server message = new server("»");

            message.Append("³²4³²");
            SendMessage(message);
        }
예제 #8
0
        public void quitar_usuario(long session_id)
        {
            Environment.Game.areas.areas[Environment.sessions.GetSession(session_id).id_areaActual].visitantes--;
            Environment.sessions.GetSession(session_id).id_areaActual = 0;
            Environment.sessions.GetSession(session_id).area_actual   = string.Empty;

            if (sesiones_usuarios.ContainsKey(session_id))
            {
                Environment.sessions.GetSession(session_id).RemoveListener(sesiones_usuarios[session_id]);
                sesiones_usuarios.Remove(session_id);
            }

            if (usuarios_enArea.ContainsKey(session_id))
            {
                server message = new server("€³{");

                message.Append("³²" + usuarios_enArea[session_id].userid_en_escenario + "³²");
                enviar_atodoelarea(message);

                id_usuarios.Remove(usuarios_enArea[session_id].userid_en_escenario);

                usuarios_enArea[session_id].esta_bloqueado = false;
                usuarios_enArea.Remove(session_id);
            }

            Environment.sessions.GetSession(session_id).en_areapublica = false;

            //if (usuarios_enArea.Count == 0) Environment.Game.areas.destruir_instancia(id_area, mDataScenario.es_publica);
        }
예제 #9
0
        public void Handler133_type_178()
        {
            string contenido = Message.Tostring().Substring(4);

            string[] split_data = Regex.Split(contenido, "³²");

            string mensaje = split_data[1];
            int    color   = (mUser.es_moderador == true) ? 2 : 1;

            if (mensaje.Contains(":cofre") && mUser.es_moderador == true)
            {
                Random rand   = new Random();
                int    x      = rand.Next(7, 16); // yo nose como coño va esta mierda
                int    y      = rand.Next(6, 17); // necesito saber el x y maximo y el minimo de cada area xdxd ostia ya se 1 sec
                int    id     = rand.Next(100, 5000);
                int    objeto = Convert.ToInt32(mensaje.Substring(7));
                Console.WriteLine("[DEBUG] Se ha tirado un cofre.");

                //ȳx³,1682³,3³,15³,16³,2³,1³,1³
                server message = new server("ȳx³² " + id + "³²3³²" + y + "³²" + x + "³²" + objeto + "³²1³²1³²1³²");
                mUser.scenarioInstance.enviar_atodoelarea(message);
            }
            else
            {
                mUser.scenarioInstance.hablar_atodalasala(mensaje, mUser.sUser, color);
            }
        }
예제 #10
0
        public void Handler189_type_133()
        {
            server message = new server("½");

            message.Append("³" + Convert.ToChar(133) + "³²8³²cactus³²Cactus³²cactus³²Cuidado! NO TE PINCHES!³²-1³²20³²1³²7F471309A21D06B5DA³²125,41,50,29,17,64,2,84,86³");
            SendCatalog(message);
        }
예제 #11
0
 public Form1()
 {
     InitializeComponent();
     myServer = new server();
     //webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(test);
     webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(changeText);
 }
예제 #12
0
        public void Handler128_type_121()
        {
            //€³y³x³²
            entrar_area(mUser.area_a_entrar, true, "");

            server message = new server("¯³²1³0³1³²2³0³1³²3³0³1³²");

            if (mUser.dataScenario.permitir_uppercut == 1 && mUser.dataScenario.permitir_coco == 1)
            {
                message.Append("4³-1³0³²5³-1³0³²");
            }
            else if (mUser.dataScenario.permitir_uppercut == 1)
            {
                message.Append("4³-1³0³²5³25³1³²");
            }
            else if (mUser.dataScenario.permitir_coco == 1)
            {
                message.Append("4³250³1³²5³-1³0³²");
            }
            else
            {
                message.Append("4³250³1³²5³25³1³²");
            }

            SendMessage(message);
        }
예제 #13
0
        public void Handler132_type_129()
        {
            //„³³,1³,4815³,jairo³,3³,B88A5CFF99000099CC0099CCE31709FFFFFF336666³,-2³,-2³,-2³,-2³,-2³,-2³,0000-00-00 00:00:00³,28³,BoomBang³ -> Offline
            //„³³,1³,2805³,jairo³,3³,090D66FCF30E15E7FFFFF91A14F7FFFFFFFF36FC0F³,-1³,-1³,0³,0³,-1³,0³,Flower Power³,16³,BoomBang³ -> Online
            //„³³,1³,2135³,zinzi³,5³,A17850996600A17850003A75FF0066006666FFFFFF³,-2³,-2³,-2³,-2³,-2³,-2³,2011-07-18 15:03:38³,15³,bcn³ -> Ya amigo
            string nombre_busqueda = Message.getParameter();

            List <userInfo> nUser_list     = Environment.Game.bpad.buscar_usuario(nombre_busqueda);
            List <userInfo> es_amigo       = new List <userInfo>();
            List <userInfo> es_desconocido = new List <userInfo>();

            foreach (userInfo nUser in nUser_list)
            {
                if (Environment.Game.bpad.esAmigo(mUser.id, nUser.id))
                {
                    es_amigo.Add(nUser);
                }
                else
                {
                    es_desconocido.Add(nUser);
                }
            }

            server message = new server("„³³²");

            message.Append(es_desconocido.Count + es_amigo.Count);

            foreach (userInfo nUser in es_amigo)
            {
                long   session     = Environment.sessions.GetSessionFromUser(nUser.id);
                string area_actual = (string.IsNullOrEmpty(Environment.sessions.GetSession(session).area_actual)) ? "Flower Power" : Environment.sessions.GetSession(session).area_actual;

                if (session != -1)
                {
                    message.Append("³²" + nUser.id + "³²" + nUser.usuario + "³²" + nUser.tipo_avatar + "³²" + nUser.colores_avatar + "³²" + -1 + "³²" + -1 + "³²" + 0 + "³²" + 0 + "³²" + -1 + "³²" + 0 + "³²" + area_actual + "³²" + nUser.edad + "³²" + nUser.ciudad);
                }
                else
                {
                    message.Append("³²" + nUser.id + "³²" + nUser.usuario + "³²" + nUser.tipo_avatar + "³²" + nUser.colores_avatar + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + nUser.ultimo_login + "³²" + nUser.edad + "³²" + nUser.ciudad);
                }
            }

            foreach (userInfo nUser in es_desconocido)
            {
                long   session     = Environment.sessions.GetSessionFromUser(nUser.id);
                string area_actual = (string.IsNullOrEmpty(Environment.sessions.GetSession(session).area_actual)) ? "Flower Power" : Environment.sessions.GetSession(session).area_actual;

                if (session != -1)
                {
                    message.Append("³²" + nUser.id + "³²" + nUser.usuario + "³²" + nUser.tipo_avatar + "³²" + nUser.colores_avatar + "³²" + -1 + "³²" + -1 + "³²" + 0 + "³²" + 0 + "³²" + -1 + "³²" + 0 + "³²" + area_actual + "³²" + nUser.edad + "³²" + nUser.ciudad);
                }
                else
                {
                    message.Append("³²" + nUser.id + "³²" + nUser.usuario + "³²" + nUser.tipo_avatar + "³²" + nUser.colores_avatar + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + -2 + "³²" + nUser.ultimo_login + "³²" + nUser.edad + "³²" + nUser.ciudad);
                }
            }

            message.Append("³²");
            SendMessage(message);
        }
예제 #14
0
        public void Handler120_type_143()
        {
            server message = new server("x");

            message.Append("³³²16³²-1³²-1³²25³²");
            SendMessage(message);
        }
예제 #15
0
        public void Handler189_type_180()
        {
            server message = new server("½");

            message.Append("³´³²");
            SendMessage(message);
        }
예제 #16
0
        public void Handler132_type_121() //„³y³²0³
        {
            server message = new server("„");

            message.Append("³y³²0³²");
            SendMessage(message);
        }
예제 #17
0
        public void cstr_is_reading_from_xml_file()
        {
            // this is reliant on there being data in the XML file
            _server = new server(constantinople.XML_FILEPATH);

            Assert.IsNotNull(_server.Name);
            Assert.IsNotNull(_server.Db);
        }
        public void process_test_logic()
        {
            server  _server = new server(constantinople.XML_FILEPATH);
            dir     _dir    = new dir(constantinople.XML_FILEPATH);
            batchIt bi      = new batchIt(_dir, new runSql(_server.connectionString, _dir));

            bi.process();
        }
        public void remove_test_logic()
        {
            server  _server = new server(constantinople.XML_FILEPATH);
            dir     _dir    = new dir(constantinople.XML_FILEPATH);
            batchIt bi      = new batchIt(_dir, new runSql(_server.connectionString, _dir));

            bi.remove(new System.IO.FileInfo("test_sp.sql"));
        }
예제 #20
0
        public void Handler120_type_141()
        {
            //x³³,0³
            server message = new server("x");

            message.Append("³³²0³²");
            SendMessage(message);
        }
예제 #21
0
        public server Post(server f)
        {
            iservermanager.allserverslist.Add(f);



            return(f);
        }
예제 #22
0
        public void publicar_usuario(long session_id)
        {
            server message = new server("€³z³²");

            message.Append(construir_usuario(session_id));
            enviar_atodoelareamenosami(message, session_id);
            //publicar_statususuario(session_id, true);
        }
예제 #23
0
        public void Handler120_type_145() //Inicio login
        {
            server message = new server("x");

            message.Append("³‘³x³²1³²135271416547234³²http://esp.mus.boombang.tv/facebook/connect.php³²user_birthday³²2GZZM5VLsQ+jmHE5bWa4QA==³²");
            SendMessage(message);
            //Console.WriteLine("[DEBUG] Login iniciado.");
        }
예제 #24
0
        public void Handler163_type_178() //Ping
        {
            server message = new server("£");

            message.Append("³²20³²");
            SendMessage(message);
            //Console.WriteLine("[DEBUG] Respuesta de ping enviada.");
        }
예제 #25
0
        public void Handler145_type_178() //Uppercut
        {
            /*
             * punx enviado
             * ¡³,250³ -> quito creditos
             * ’³,2805352³,4³,38³,175³ -> mis datos
             * ’³,759438³,tipo_dato³,2494³,2526³ -> sus datos
             * ‘³,4³,0³,16³,18³,1³,17³,19³ -> hostia con coordenadas
             * punx recibido
             * ’³,759438³,4³,2492³,249³ -> sus datos
             * ’³,2805352³,tipo_dato³,35³,174³ -> mis datos
             * ‘³,4³,1³,14³,19³,0³,15³,20³ -> hostia con coordenadas
             */

            if (mUser.sUser.esta_bloqueado == false)
            {
                string   contenido  = Message.Tostring().Substring(4);
                string[] split_data = Regex.Split(contenido, "³²");

                string tipo      = split_data[0];
                string id_envia  = split_data[1];
                string id_recibe = split_data[4];
                string envia_x   = split_data[2];
                string envia_y   = split_data[3];
                string recibe_x  = split_data[5];
                string recibe_y  = split_data[6];

                Console.WriteLine("[DEBUG] id envia: " + id_envia);
                Console.WriteLine("[DEBUG] id recibe: " + id_recibe);

                userInfo oUser = mUser.scenarioInstance.getUserByUserAreaID(int.Parse(id_recibe)).userInfo;

                mUser.scenarioInstance.getUserByUserAreaID(int.Parse(id_recibe)).esta_bloqueado = true;
                mUser.sUser.esta_bloqueado = true;

                server message   = new server("¡³²250³²");
                server message_2 = new server("’³²");
                server message_3 = new server("’³²");
                server message_4 = new server("‘³²");
                message_2.Append(mUser.id + "³²4³²" + mUser.uppercuts_enviados + "³²" + mUser.uppercuts_recibidos + "³²");
                message_3.Append(oUser.id + "³²4³²" + oUser.uppercuts_enviados + "³²" + oUser.uppercuts_recibidos + "³²");
                message_4.Append("4³²" + id_envia + "³²" + envia_x + "³²" + envia_y + "³²" + id_recibe + "³²" + recibe_x + "³²" + recibe_y + "³²");

                SendMessage(message);
                mUser.scenarioInstance.enviar_atodoelarea(message_2);
                mUser.scenarioInstance.enviar_atodoelarea(message_3);
                mUser.scenarioInstance.enviar_atodoelarea(message_4);

                Thread.Sleep(15000);
                mUser.sUser.esta_bloqueado = false;

                Thread.Sleep(5000);
                server message_5 = new server("™³²");
                Environment.sessions.GetSession(Environment.sessions.GetSessionFromUser(oUser.id)).SendMessage(message_5);
                Console.WriteLine("[DEBUG] " + oUser.usuario + " ha sido expulsado de la sala por " + mUser.usuario);
                mUser.scenarioInstance.quitar_usuario(Environment.sessions.GetSessionFromUser(oUser.id));
            }
        }
예제 #26
0
 private void mensaje_server(server s)
 {
     text = s.cuenta.ToString();
     if (s.cuenta == 0)
     {
         juego_iniciado = true;
         text           = start;
     }
 }
        public void cstr_test()
        {
            server  _server = new server(constantinople.XML_FILEPATH);
            dir     _dir    = new dir(constantinople.XML_FILEPATH);
            batchIt bi      = new batchIt(_dir, new runSql(_server.connectionString, _dir));

            //bi.process();
            Assert.IsNotNull(bi);
        }
예제 #28
0
    public void getClient()
    {
        obj = GameObject.Find("client");
        c   = obj.transform;
        networkView.observed = c;

        se         = this.GetComponent <server> ();
        se.enabled = false;
    }
예제 #29
0
        //GET: api/Pptp/5
        //public server GetServer([FromBody] server srv)
        //{
        //    using (PPTPEntities db = new PPTPEntities())
        //    {
        //        var res = db.servers.ToList().Find(p => p.Server1 == srv.Server1);
        //        return res;
        //    }
        //}

        // POST: api/Pptp
        public string PostServer([FromBody] server srv)
        {
            using (PPTPEntities db = new PPTPEntities())
            {
                db.servers.Add(srv);
                db.SaveChanges();
                return("Server Saved Successfully");
            }
        }
예제 #30
0
        public void publicar_todoslosusuarios(long session_id)
        {
            server message = new server("€³y³x³²0³²");

            foreach (long sessionid in sesiones_usuarios.Keys)
            {
                message.Append(construir_usuario(sessionid));
            }
            Environment.sessions.GetSession(session_id).SendMessage(message);
        }
예제 #31
0
 public void enviar_atodoelareamenosami(server message, long mi_session_id)
 {
     foreach (int session_id in sesiones_usuarios.Keys)
     {
         if (session_id != mi_session_id)
         {
             Environment.sessions.GetSession(session_id).SendMessage(message);
         }
     }
 }
예제 #32
0
        //==========================================================
        /*         public enum servers
                  {
                            Not_assigned = 0,
                            Able = 1 ,
                            baker = 2 ,

                       }    */
        public static int check_which_server(Customer x, server a, server b)
        {
            if (a.is_idle == false)    // Able is  busy
            {

                if (b.is_idle == true)  // Baker is free
                {
                    x.which_server = "Baker";
                    b.is_idle = false;
                    b.Finish_service = b.Generate_Baker_Service_Time();
                    x.Service_time = b.Finish_service;
                }
                else if (a.is_idle == false && b.is_idle == false)   // baker is also busy
                {
                    // to obtain the delay of the customer
                    // find min of both server's finish time   - arrival time of customer
                    int t = Math.Min(a.Finish_service, b.Finish_service);
                    x.delay = t - x.Get_Arrival_time();

                    if (t == a.Finish_service)
                    {
                        a.is_idle = false;
                        a.Finish_service = a.Generate_Able_Service_Time();
                        x.Service_time = a.Finish_service;
                    }
                    else
                    {
                        b.is_idle = false;
                        b.Finish_service = b.Generate_Baker_Service_Time();
                        x.Service_time = b.Finish_service;
                    }
                }

                else
                {
                    x.which_server = "Able";
                    a.is_idle = false;
                    a.Finish_service = a.Generate_Able_Service_Time();
                    x.Service_time = a.Finish_service;

                }
            }
            return x.Service_time;
        }
 new return HttpMessageInvoker(server);
예제 #34
0
        //===================== End  of Class ======================
        private void button1_Click(object sender, EventArgs e)
        {
            // grab input experiments from user
            int number_of_customers = int.Parse(textBox1.Text);

            // create 2 servers that will handle the customers
            server Able = new server();
            server Baker = new server();

            // set row number as the user entered  and customize the Data Grid
            dataGridView1.RowCount = number_of_customers;
            dataGridView1.Columns[0].Name = "Customer Number";
            dataGridView1.Columns[1].Name = "Random Digits for Arrivals";
            dataGridView1.Columns[2].Name = "Time Between Arrivals";
            dataGridView1.Columns[3].Name = "Clock Time of Arrivals";
            dataGridView1.Columns[4].Name = "Random Digits for Service";
            dataGridView1.Columns[5].Name = "Time Service Begins";
            dataGridView1.Columns[6].Name = "Service Time";
            dataGridView1.Columns[7].Name = "Time Service Ends";
            dataGridView1.Columns[8].Name = "Time Server Begins";
            dataGridView1.Columns[9].Name = "Service Time";
            dataGridView1.Columns[10].Name = "Time Service Ends";
            dataGridView1.Columns[11].Name = "Time In Queue";

            // create array of customers with the input size
            Customer[] batch = new Customer[number_of_customers];

            int last_arrival_time = 0;

            for (int count = 0; count < number_of_customers; count++)
            {
                dataGridView1[0, count].Value = count;

                if (count == 0)
                {
                    batch[count].Set_Arrival_Time(0);
                    batch[count].Service_time = check_which_server(batch[count], Able, Baker);
                    batch[count].Calculate_Start_Time();
                    batch[count].Set_End_Time();

                }

                else
                {

                    batch[count].Set_Arrival_Time(last_arrival_time);
                    batch[count].Service_time = check_which_server(batch[count], Able, Baker);
                    batch[count].Calculate_Start_Time();
                    batch[count].Set_End_Time();

                }

                last_arrival_time = batch[count].Get_Arrival_time();

            }
        }