Пример #1
0
    void Update()
    {
        if (mUpdateCnt++ >= 600)
        {
            mUpdateCnt = 0;
            NetMgr.Alive();
//			NetMgr.JoinGame();
            string msg = "\n[" + UtilMgr.GetDateTimeNow("HH:mm:ss") + "][00ff00]Send:Alive[-]," + mMsgCount;
            transform.FindChild("Top").FindChild("BtnDebug").GetComponent <BtnDebugLiveBingo>().AddLog(msg);
        }
//		NetMgr.UpdateSocket();

        Transform outs = transform.FindChild("Body").FindChild("Scroll View").FindChild("Btm").FindChild("Info")
                         .FindChild("BG").FindChild("Outs");

        for (int i = 1; i <= 3; i++)
        {
            outs.FindChild(i + "").FindChild("Red").gameObject.SetActive(false);
            outs.FindChild(i + "").FindChild("Gray").gameObject.SetActive(true);
        }
        for (int i = 1; i <= mOutCount; i++)
        {
            outs.FindChild(i + "").FindChild("Red").gameObject.SetActive(true);
            outs.FindChild(i + "").FindChild("Gray").gameObject.SetActive(false);
        }
    }
Пример #2
0
    public static void OpenCamera(EventDelegate eventDelegate)
    {
        Instance.mEventDelegate = eventDelegate;
        string timeStr = UtilMgr.GetDateTimeNow("yyyy-MM-dd HH:mm:ss");

        timeStr += " by lb.jpg";
        IOSMgr.CallIOSFunc("OpenCamera", timeStr);
    }
    public GetScheduleAllRequest()
    {
        Add("memSeq", UserMgr.UserInfo.memSeq);
        Add("date", UtilMgr.GetDateTimeNow("yyyyMMdd"));

//		mParams = JsonFx.Json.JsonWriter.Serialize (this);
        mDic = this;
    }
    public GetScheduleMoreRequest(string teamCode, int teamSeq)
    {
        Add("memSeq", UserMgr.UserInfo.memSeq);
        Add("date", UtilMgr.GetDateTimeNow("yyyyMMdd"));
        if (teamCode != null && teamCode.Length > 0)
        {
            Add("teamCode", teamCode);
            Add("teamSeq", teamSeq);
        }

//		mParams = JsonFx.Json.JsonWriter.Serialize (this);
        mDic = this;
    }
Пример #5
0
    IEnumerator LoadImage(WWW www)
    {
        yield return(www);

        Texture2D tempTex = new Texture2D(0, 0);

        www.LoadImageIntoTexture(tempTex);
        www.Dispose();

        int   width        = tempTex.width;
        int   height       = tempTex.height;
        float targetWidth  = 0;
        float targetHeight = 0;

        if (width > height)
        {
            float ratio = 200f / width;
            targetWidth  = width * ratio;
            targetHeight = height * ratio;
        }
        else
        {
            float ratio = 200f / height;
            targetWidth  = width * ratio;
            targetHeight = height * ratio;
        }
        Debug.Log("width : " + targetWidth + ", height : " + targetHeight);
        tempTex = UtilMgr.ScaleTexture(tempTex, (int)targetWidth, (int)targetHeight);
        byte[] bytes = tempTex.EncodeToPNG();
        mTempFile = UtilMgr.GetDateTimeNow("yyyyMMddHHmmss.png");
        mTempFile = Application.temporaryCachePath + "/" + mTempFile;
        try{
            System.IO.File.WriteAllBytes(mTempFile, bytes);
        } catch {
            mTempFile = "";
        }

        UploadFile();
    }
Пример #6
0
    public void AddLog(SocketMsgInfo info)
    {
//		mStrLog += log;
//		string msg = "\n[00ff00][" + UtilMgr.GetDateTimeNow("HH:mm:ss") + "]" + "Send:7000[-]";
        string value = "\n[" + UtilMgr.GetDateTimeNow("HH:mm:ss") + "]";

        switch (info.type)
        {
        case ConstantsSocketType.RES.TYPE_JOIN: value += "[00ff00]Received:Join"; break;

        case ConstantsSocketType.RES.TYPE_ALIVE_OK: value += "[00ff00]Received:Alive"; break;

        case ConstantsSocketType.RES.RESULT_HITTER:
            value += "[ff0000]Received:ResultHitter(";
            PlayerInfo player = null;
            try{
                player = UserMgr.PlayerDic[info.data.playerId];
            } catch {
                player = new PlayerInfo();
                if (UtilMgr.IsMLB())
                {
                    player.lastName = "Unknown:" + info.data.playerId;
                }
                else
                {
                    player.korName = "선수정보없음:" + info.data.playerId;
                }
            }

            if (UtilMgr.IsMLB())
            {
                value += player.lastName + "," + info.data.result + ","
                         + info.data.value + ")"; break;
            }
            else
            {
                value += player.korName + "," + info.data.result + ","
                         + info.data.value + ")"; break;
            }

        case ConstantsSocketType.RES.CHANGE_PLAYER: value += "[ff00ff]Received:ChangePlayer(";
            PlayerInfo hitter  = null;
            PlayerInfo pitcher = null;
            try{
                hitter = UserMgr.PlayerDic[info.data.playerId];
            } catch {
                hitter = new PlayerInfo();
                if (UtilMgr.IsMLB())
                {
                    hitter.lastName = "Unknown:" + info.data.playerId;
                }
                else
                {
                    hitter.korName = "선수정보없음:" + info.data.playerId;
                }
            }
            try{
                pitcher = UserMgr.PlayerDic[info.data.pitcherId];
            } catch {
                pitcher = new PlayerInfo();
                if (UtilMgr.IsMLB())
                {
                    pitcher.lastName = "Unknown:" + info.data.playerId;
                }
                else
                {
                    pitcher.korName = "선수정보없음:" + info.data.pitcherId;
                }
            }
            if (UtilMgr.IsMLB())
            {
                value += "hit:" + hitter.lastName + ",pit:" + pitcher.lastName + ")";                   break;
            }
            else
            {
                value += "hit:" + hitter.korName + ",pit:" + pitcher.korName + ")";                     break;
            }

        case ConstantsSocketType.RES.RELOAD_BINGO: value += "[ffff00]Received:UpdateBingo"; break;

        case ConstantsSocketType.RES.CHANGE_INNING: value += "[00ffff]Received:ChangeInning(";
            value += info.data.inning + "," + info.data.inningHalf + "," + info.data.inningState + ")"; break;

        default: value += "[ffffff]Recieved:" + info.type; break;
        }
        value   += "[-]," + info.data.msgCount;
        mStrLog += value;

        Reposition();
    }