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()); } }
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)); }
void PostLogin(URLRequestMessage msg) { if (msg.postObj == this) { m_token = msg.GetMessage(Global.MSG_LOGIN_TOKEN).ToString(); } }
void RecieveTexture(URLRequestMessage msg) { if (msg.postObj == this) { img.sprite = (Sprite)msg.GetMessage(Global.MSG_REQUEST_TEXTURE_SPRITE_KEY); } }
void RecieveTexture(URLRequestMessage msg) { if (msg.postObj == this) { m_info.Post = (Sprite)msg.GetMessage(Global.MSG_REQUEST_TEXTURE_SPRITE_KEY); PlayRecieveImgAnimation(); } }
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); }
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)); }
/// <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)); }