Exemple #1
0
    private IEnumerator MyOnMaintenance()
    {
        /*
         *              run your own maintenance behaviour.
         *
         *              this sample runs http get method for getting the maintenance information from www.
         */
        var http = new AutoyaFramework.Connections.HTTP.HTTPConnection();

        return(http.Get(
                   string.Empty,
                   null,
                   "https://google.com",// fake url. please use your own url for serve maintenance information data.
                   (string conId, int code, Dictionary <string, string> responseHeader, string result) =>
        {
            Debug.Log("here you've got maintenance information from your host(recommend to set that server is not same with your game server).");
            Debug.Log("maintenance info:" + result);
        },
                   (conId, code, reason, responseHeader) =>
        {
            // do something..
        },
                   10
                   ));
    }
Exemple #2
0
    void Awake()
    {
        var http          = new AutoyaFramework.Connections.HTTP.HTTPConnection();
        var httpCoroutine = http.Get(
            "newConnectionId",
            new Dictionary <string, string>(),
            "https://google.com",
            (string conId, int code, Dictionary <string, string> responseHeaders, string data) =>
        {
            // succeeded.
            Debug.Log("data:" + data);
        },
            (conId, code, reason, responseHeaders) =>
        {
            // failed.
            Debug.Log("code:" + code + " reason:" + reason);
        }
            );

        Autoya.Mainthread_Commit(httpCoroutine);
    }