using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SLogicManager : MonoBehaviour
{
    bool isLogin = false;
    bool isRememberPassword = false;
    string account = "";
    string password = "";
    int showPanel = 1;
    static string videoUrl = "";

    void Awake()
    {
        Debug.Log("SLogicManager Awake ... ...");
    }

    void Start()
    {
        Debug.Log("SLogicManager Start ... ...");

        //StartCoroutine(InitLogic());
    }

    //IEnumerator InitLogic()
    //{
    //    Debug.Log("----> SLogicManager - InitLogic Start ... ...");
    //    yield return null;
    //    yield return new WaitForSeconds(1.0f);

    //    // S2CAgent Start.
    //    bool bRetCode = false;
    //    bRetCode = S2CAgent.Init();
    //    Debug.Log("----> SLogicManager - InitLogic S2CAgent.Init() -> " + bRetCode.ToString());
    //    if (!bRetCode) yield break;
    //    yield return new WaitForSeconds(1.0f);

    //    // Start Downloader.exe

    //    // Wait For Downloader.exe Connect.
    //    // Then Connect To Downloder.exe.

    //    bRetCode = C2SAgent.Init();
    //    Debug.Log("----> SLogicManager - InitLogic C2SAgent.Init() -> " + bRetCode.ToString());
    //    if (!bRetCode) yield break;
    //    yield return new WaitForSeconds(1.0f);

    //    //string testMsg = C2SAgent.SayHello("Test From InitLogic.");
    //    //Debug.Log("-> testMsg -> " + testMsg.ToString());
    //    //C2SAgent.Login("luoning", "2333");
    //    //int testMessage = C2SAgent.Login("18551730173", "123456");
    //    //Debug.Log("--> testMsg :" + testMessage.ToString());

    //    Debug.Log("----> SLogicManager -InitLogic Finish ... ...");
    //    SEventManager.FireEvent(SEventManager.EVENT.LOGIC_ACTIVE);
    //}

    public void setLoginStatus(bool loginStatus)
    {
        isLogin = loginStatus;
    }

    public bool getLoginStatus()
    {
        return isLogin;
    }

    public void setRememberPassword(bool rmemberPasswordStatus)
    {
        isRememberPassword = rmemberPasswordStatus;
    }

    public bool getRememberPassword()
    {
        return isRememberPassword;
    }

    public void setAccount(string playAccount)
    {
        account = playAccount;
    }

    public string getAccount()
    {
        return account;
    }

    public void setPassword(string playPassword)
    {
        password = playPassword;
    }

    public string getPassword()
    {
        return password;
    }

    public int getShowPanel()
    {
        return showPanel;
    }

    public void setShowPanel(int panel)
    {
        showPanel = panel;
    }

    public string getVideoUrl()
    {
        Debug.Log("getVideoUrl --> " + videoUrl);
        return videoUrl;
    }

    public void setVideoUrl(string url)
    {
        videoUrl = url;

        Debug.Log("setVideoUrl --> " + videoUrl);
    }

    //public int Login(string account, string password)
    //{
    //    Debug.Log("---> SLoginManager -  C2SAgent.Login() <---");

    //    return C2SAgent.Login(account, password);
    //}

    //public int Logout()
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.Logout() <---");

    //    return C2SAgent.Logout();
    //}

    //public int Register(string account, string password, string code)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.Register() <---");

    //    return C2SAgent.Register(account, password, code);
    //}

    //public int SendSMS(string phone)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.SendSMS() <---");

    //    return C2SAgent.SendSMS(phone);
    //}

    //public IList AddUrl(string url)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.AddUrl() <---");

    //    return C2SAgent.AddUrl(url);
    //}

    //public int CanRegister(string account)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.AddUrl() <---");

    //    return C2SAgent.CanRegister(account);
    //}

    //public IList QueryActive()
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.QueryActive() <---");

    //    return C2SAgent.QueryActive();
    //}

    //public IList QueryWaiting(int offset, int num)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.QueryWaiting() <---");

    //    return C2SAgent.QueryWaiting(offset, num);
    //}

    //public IList QueryStopped(int offset, int num)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.QueryStopped() <---");

    //    return C2SAgent.QueryStopped(offset, num);
    //}

    //public int SpeedupTask(string gid)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.SpeedupTask() <---");

    //    return C2SAgent.SpeedupTask(gid);
    //}

    //public int PauseTask(string gid)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.PauseTask() <---");

    //    return C2SAgent.PauseTask(gid);
    //}

    //public int UnpauseTask(string gid)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.UnpauseTask() <---");

    //    return C2SAgent.UnpauseTask(gid);
    //}

    //public int RemoveTask(string gid)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.RemoveTask() <---");

    //    return C2SAgent.RemoveTask(gid);
    //}

    //public IList AddOfflineTask(string url)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.AddOfflineTask() <---");

    //    return C2SAgent.AddOfflineTask(url);
    //}

    //public IList QueryResourceByGid(string gid)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.QueryResource() <---");

    //    return C2SAgent.QueryResourceByGid(gid);
    //}

    //public IList QueryResourceByUrl(string url)
    //{
    //    Debug.Log("---> SLoginManager - QueryResourceByUrl() <---");

    //    return C2SAgent.QueryResourceByUrl(url);
    //}

    //public IList PrefetchVideo(string fileId, string parentId)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.PrefetchVideo() <---");

    //    return C2SAgent.PrefetchVideo(fileId, parentId);
    //}

    //public IList GetVideoM3U8(string fileId, string key, string value)
    //{
    //    Debug.Log("---> SLoginManager - C2SAgent.GetVideoM3() <---");

    //    return C2SAgent.GetVideoM3U8(fileId, key, value);
    //}
}
