void Init(string applicationKey, string privateKey, UriPrototype storageurl, UriPrototype messengerUrl) { ApplicationKey = applicationKey; PrivateKey = privateKey; MessengerUrl = messengerUrl; Metadata = new StorageMetadata(); Repository = new StorageRepository(applicationKey, PrivateKey, storageurl); Connect(); }
void Init(string appKey, string privateKey, UriPrototype uri) { ApplicationKey = appKey; PrivateKey = privateKey; PrototypeUri = uri; ItemMetadata = new Dictionary <Type, ItemMetadata>(); Client = new HttpTaskService { Accept = "application/json", ContentType = "application/json", }; StorageConverters.Initialize(); }
/// <summary> /// Constructs a new messenger /// </summary> /// <param name="uri"></param> /// <param name="appKey"></param> public StorageMessenger(UriPrototype uri, string appKey) { AppKey = appKey; Client = new UnityOrtcClient(); Client.OnConnected += OnConnected; Client.OnSubscribed += OnSubscribed; Client.OnException += OnException; if (uri.IsCluster) { Url = uri.IsSecure ? "https://" + uri.Url + "/server/ssl/2.1" : "http://" + uri.Url + "/server/2.1"; Client.ClusterUrl = Url; } else { Url = uri.IsSecure ? "https://" + uri.Url : "http://" + uri.Url; Client.Url = Url; } }
/// <summary> /// Creates a new storage controller with custom settings /// </summary> /// <param name="applicationKey"></param> /// <param name="privateKey"></param> /// <param name="storageurl"></param> /// <param name="messengerUrl"></param> public StorageController(string applicationKey, string privateKey, UriPrototype storageurl, UriPrototype messengerUrl) { Init(applicationKey, privateKey, storageurl, messengerUrl); }
/// <summary> /// new storage repository with custom settings /// </summary> /// <param name="appKey"></param> /// <param name="privateKey"></param> /// <param name="uri"></param> public StorageRepository(string appKey, string privateKey, UriPrototype uri) { Init(appKey, privateKey, uri); }