예제 #1
0
 void RecieveVideoList(URLRequestMessage msg)
 {
     if (m_videoManager.SetVideoList((List <VideoInfo>)msg.GetMessage(Global.MSG_POSTVIDEO_VIDEO_KEY)
                                     , msg.GetMessage(Global.MSG_POSTVIDEO_NAME_KEY).ToString()))
     {
         RefreshAndShowVideo();
     }
     if (msg.GetMessage(Global.MSG_POSTVIDEO_NAME_KEY).ToString() != Global.LIVE_VIDEOLIST_NAME)
     {
         videoTopButton.SetName(msg.GetMessage(Global.MSG_POSTVIDEO_NAME_KEY).ToString());
     }
 }
예제 #2
0
    void RequestLogin(URLRequestMessage msg)
    {
        WWWForm form = new WWWForm();

        form.AddField("username", msg.GetMessage(Global.MSG_LOGIN_USERNAME).ToString());
        form.AddField("password", msg.GetMessage(Global.MSG_LOGIN_PASSWORD).ToString());

        string url = msg.url;

        if (string.IsNullOrEmpty(url))
        {
            url = Global.LoginURL;
        }
        StartCoroutine(WaitForRequest(url, LoginHandler, msg, form));
    }
예제 #3
0
 void PostLogin(URLRequestMessage msg)
 {
     if (msg.postObj == this)
     {
         m_token = msg.GetMessage(Global.MSG_LOGIN_TOKEN).ToString();
     }
 }
예제 #4
0
 void RecieveTexture(URLRequestMessage msg)
 {
     if (msg.postObj == this)
     {
         img.sprite = (Sprite)msg.GetMessage(Global.MSG_REQUEST_TEXTURE_SPRITE_KEY);
     }
 }
예제 #5
0
 void RecieveTexture(URLRequestMessage msg)
 {
     if (msg.postObj == this)
     {
         m_info.Post = (Sprite)msg.GetMessage(Global.MSG_REQUEST_TEXTURE_SPRITE_KEY);
         PlayRecieveImgAnimation();
     }
 }
예제 #6
0
    void CategoryVideoHandeler(WWW www, URLRequestMessage postMsg)
    {
        JSONObject       json = new JSONObject(www.text);
        List <VideoInfo> list = Json2VideoList(json.GetField("videoList"));
        string           name = postMsg.GetMessage(Global.MSG_REQUEST_CATEGORYVIDEO_CATEGORY_KEY).ToString();

        postMsg.AddMessage(Global.MSG_POSTVIDEO_VIDEO_KEY, list);
        VREvents.FirePostVideoList(postMsg);
    }
예제 #7
0
    void RequestCategoryVideoList(URLRequestMessage msg)
    {
        string url = msg.url;

        if (string.IsNullOrEmpty(url))
        {
            string category = msg.GetMessage(Global.MSG_REQUEST_CATEGORYVIDEO_CATEGORY_KEY).ToString();
            url = Global.CategoryVideoRequestURL.Replace("CATEGORY", category);
            msg.AddMessage(Global.MSG_POSTVIDEO_NAME_KEY, category);
        }
        StartCoroutine(WaitForRequest(url, CategoryVideoHandeler, msg));
    }
예제 #8
0
    /// <summary>
    /// Deal with the request video info
    /// </summary>
    /// <param name="msg">Message.</param>
    void RequestVideoInfo(URLRequestMessage msg)
    {
//		Debug.Log(" Request Video Info ");
        string url = msg.url;

        if (string.IsNullOrEmpty(url))
        {
            string number = msg.GetMessage(Global.MSG_REQUESTVIDEO_NUMBER_KEY).ToString();
            url = Global.VideoRequestURL.Replace("NUMBER", number);
        }
        msg.AddMessage(Global.MSG_POSTVIDEO_NAME_KEY, "Latest");

        StartCoroutine(WaitForRequest(url, DayVideoInfoHandler, msg));
    }