Ejemplo n.º 1
0
    public Original(Game1 game) : base(game)
    {
        bulletScreen = new BulletScreen(game);
        hitScreen    = new HitScreen(game);
        roundScreen  = new RoundScreen(game);
        scoreScreen  = new ScoreScreen(game);

        AddDucks(1);
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String       danmu    = Request.Form["danmu"];
        String       video_id = Request.QueryString["video_id"];
        BulletScreen bs       = ParseFormJson <BulletScreen>(danmu);

        MySqlConnection mysql  = DBConn.getMySqlCon();
        String          values = "(" + "'" + video_id + "','" + bs.color + "','" + bs.position + "','" + bs.size + "','"
                                 + bs.text + "','" + bs.time + "')";

        String       sql          = "insert into bulletscreen (video_id,color,position,size,text,time) values " + values;
        MySqlCommand mySqlCommand = DBConn.getSqlCommand(sql, mysql);

        mysql.Open();

        DBConn.getUpdate(mySqlCommand);

        mysql.Close();
    }
Ejemplo n.º 3
0
    private void Init()
    {
        Debug.Log(this.name + "开始初始化");

        if (zjhPanel == null)
        {
            zjhPanel = PlayerCache.zjhPanel;
        }
        if (bulletScreen == null)
        {
            bulletScreen = PlayerCache.bulletScreen;
        }


        ChipsTrans            = XUIUtils.GetCompmentT <Transform>(PlayerCache.zjhPanel.transform, "Chips");
        progressImg           = XUIUtils.GetCompmentT <Image>(transform, "Player/progress");
        btn_HeadImg           = XUIUtils.GetCompmentT <Button>(transform, "Player/headimg");
        settleTxt             = XUIUtils.GetCompmentT <Text>(transform, "settleTxt");
        changeCardParentTrans = transform.Find("Player/ChangedCard");
        Transform compareTrans = transform.Find("Player/btn_Compare");

        if (compareTrans != null)
        {
            btn_Compare = compareTrans.GetComponent <Button>();
            XUIUtils.ListenerBtn(btn_Compare, BtnCompareOnClick);
        }
        if (player != null)
        {
            XUIUtils.ListenerBtn(btn_HeadImg, delegate() { this.BtnGetFriendInfoOnClick(player.uid); });
        }
        cardTrans = new List <Transform>();
        if (this.name.Equals("self"))
        {
            for (int i = 0; i < 3; i++)
            {
                cardTrans.Add(zjhPanel.transform.Find("Players/Cards/card_self_" + (i + 1)));
            }
        }
        else if (this.name.Equals("other1"))
        {
            for (int i = 0; i < 3; i++)
            {
                cardTrans.Add(zjhPanel.transform.Find("Players/Cards/card_other1_" + (i + 1)));
            }
        }
        else if (this.name.Equals("other2"))
        {
            for (int i = 0; i < 3; i++)
            {
                cardTrans.Add(zjhPanel.transform.Find("Players/Cards/card_other2_" + (i + 1)));
            }
        }
        else if (this.name.Equals("other3"))
        {
            for (int i = 0; i < 3; i++)
            {
                cardTrans.Add(zjhPanel.transform.Find("Players/Cards/card_other3_" + (i + 1)));
            }
        }
        else if (this.name.Equals("other4"))
        {
            for (int i = 0; i < 3; i++)
            {
                cardTrans.Add(zjhPanel.transform.Find("Players/Cards/card_other4_" + (i + 1)));
            }
        }

        //初始化牌  若对象没有销毁 只初始化一次
        if (!isCardInit)
        {
            cardsEndPos = new List <Vector3>();
            CardInit();
            isCardInit = true;
        }
        Debug.Log(this.name + "初始化完成");
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String video_id = Request.QueryString["video_id"];

        if (video_id == null)
        {
            return;
        }


        MySqlConnection mysql = DBConn.getMySqlCon();

        String       sqlSearch    = "select * from bulletscreen where video_id = " + video_id;
        MySqlCommand mySqlCommand = DBConn.getSqlCommand(sqlSearch, mysql);

        mysql.Open();
        MySqlDataReader reader = DBConn.getResultset(mySqlCommand);


        List <BulletScreen> list = new List <BulletScreen>();

        while (reader.Read())
        {
            if (reader.HasRows)
            {
                BulletScreen bs = new BulletScreen();



                bs.position = reader.GetString("position");
                bs.size     = reader.GetString("size");
                bs.text     = reader.GetString("text");
                bs.time     = reader.GetString("time");
                bs.color    = reader.GetString("color");



                list.Add(bs);
            }
        }


        String json = "[";

        for (int i = 0; i < list.Count; i++)
        {
            String json1 = "'" + GetJson(list[i]) + "'";
            json = json + json1;
            json = json + ",";
        }

        json = json + "]";
        // String json = GetJson<List<BulletScreen>>(list);



        // String json1 = "['{ \"text\":\"222222\" , \"color\":\"red\" ,\"size\":\"1\",\"position\":\"0\",\"time\":10}','{ \"text\":\"6666\" , \"color\":\"red\" ,\"size\":\"1\",\"position\":\"0\",\"time\":20}','{ \"text\":\"我是大茄子\" , \"color\":\"red\" ,\"size\":\"1\",\"position\":\"0\",\"time\":25}']";


        //String json = "[";
        //json = json
        //        + "'{ \"text\":\"ssssaaaaass\" , \"color\":\"red\" ,\"size\":\"1\",\"position\":\"0\",\"time\":60,\"id\":1}',";

        //json = json
        //        + "'{ \"text\":\"33331\" , \"color\":\"red\" ,\"size\":\"1\",\"position\":\"0\",\"time\":20}',";
        //json = json
        //        + "'{ \"text\":\"dd\" , \"color\":\"red\" ,\"size\":\"1\",\"position\":\"0\",\"time\":25}'";
        //json = json + "]";


        Response.Write(json);
    }