public override IEnumerator ReOpen( Gs2WebSocketSession session, Gs2RestSession restSession, UnityAction <AsyncResult <OpenResult> > callback ) { yield return(session.Open(callback)); yield return(restSession.Open(callback)); onReOpen.Invoke(); }
public Profile( string clientId, string clientSecret, IReopener reopener, bool checkCertificateRevocation = true ) { BasicGs2Credential credential = new BasicGs2Credential( clientId, clientSecret ); Gs2Session = new Gs2WebSocketSession( credential, checkCertificateRevocation ); Gs2RestSession = new Gs2RestSession( credential ); _reopener = reopener; _authenticator = null; this.checkRevokeCertificate = checkCertificateRevocation; }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2DeployRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2JobQueueRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2LogRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2AuthRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2IdentifierRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2ScriptRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
public static IEnumerator IncreaseExperience( GameSession session, string identifierIncreaseExperienceClientId, string identifierIncreaseExperienceClientSecret, string experienceNamespaceName, EzExperienceModel experienceModel, string propertyId, int value, IncreaseExperienceEvent onIncreaseExperience, ErrorEvent onError ) { // このコードは実際にアプリケーションで使用するべきではありません。 // アプリ内から課金通貨の残高を加算できるようにすることは、事業に多大な悪い影響を及ぼす可能性があります。 var restSession = new Gs2RestSession( new BasicGs2Credential( identifierIncreaseExperienceClientId, identifierIncreaseExperienceClientSecret ) ); var error = false; yield return(restSession.Open( r => { if (r.Error != null) { onError.Invoke(r.Error); error = true; } } )); if (error) { yield return(restSession.Close(() => { })); yield break; } var restClient = new Gs2ExperienceRestClient( restSession ); yield return(restClient.AddExperienceByUserId( new AddExperienceByUserIdRequest() .WithNamespaceName(experienceNamespaceName) .WithUserId(session.AccessToken.userId) .WithExperienceName(experienceModel.Name) .WithPropertyId(propertyId) .WithExperienceValue(value), r => { if (r.Error != null) { onError.Invoke(r.Error); error = true; } else { onIncreaseExperience.Invoke( experienceModel, new EzStatus(r.Result.item), value ); } } )); yield return(restSession.Close(() => { })); }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2KeyRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
public static IEnumerator Acquire( GameSession session, string identifierAcquireItemClientId, string identifierAcquireItemClientSecret, string inventoryNamespaceName, string inventoryModelName, string itemModelName, int value, AcquireEvent onAcquire, ErrorEvent onError ) { // このコードは実際にアプリケーションで使用するべきではありません。 // アプリ内から課金通貨の残高を加算できるようにすることは、事業に多大な悪い影響を及ぼす可能性があります。 var restSession = new Gs2RestSession( new BasicGs2Credential( identifierAcquireItemClientId, identifierAcquireItemClientSecret ) ); var error = false; yield return(restSession.Open( r => { if (r.Error != null) { onError.Invoke(r.Error); error = true; } } )); if (error) { yield return(restSession.Close(() => { })); yield break; } var restClient = new Gs2InventoryRestClient( restSession ); yield return(restClient.AcquireItemSetByUserId( new AcquireItemSetByUserIdRequest() .WithNamespaceName(inventoryNamespaceName) .WithUserId(session.AccessToken.userId) .WithInventoryName(inventoryModelName) .WithItemName(itemModelName) .WithAcquireCount(value), r => { if (r.Error != null) { onError.Invoke(r.Error); error = true; } else { onAcquire.Invoke( new EzInventory(r.Result.inventory), r.Result.items.Select(item => new EzItemSet(item)).ToList(), value ); } } )); yield return(restSession.Close(() => { })); }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2WatchRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
public abstract IEnumerator ReOpen(Gs2WebSocketSession session, Gs2RestSession restSession, UnityAction <AsyncResult <OpenResult> > callback);
public IEnumerator Finalize() { yield return(Gs2Session.Close(() => {})); yield return(Gs2RestSession.Close(() => {})); }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="gs2RestSession">REST API 用セッション</param> /// <param name="certificateHandler"></param> public Gs2DeployRestClient(Gs2RestSession gs2RestSession, CertificateHandler certificateHandler) : base(gs2RestSession) { _certificateHandler = certificateHandler; }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="Gs2RestSession">REST API 用セッション</param> public Gs2NewsRestClient(Gs2RestSession Gs2RestSession) : base(Gs2RestSession) { }
public static IEnumerator Deposit( string identifierDepositClientId, string identifierDepositClientSecret, string moneyNamespaceName, string userId, int slot, float price, int value, DepositEvent onDeposit, ErrorEvent onError ) { // このコードは実際にアプリケーションで使用するべきではありません。 // アプリ内から課金通貨の残高を加算できるようにすることは、事業に多大な悪い影響を及ぼす可能性があります。 var restSession = new Gs2RestSession( new BasicGs2Credential( identifierDepositClientId, identifierDepositClientSecret ) ); var error = false; yield return(restSession.Open( r => { if (r.Error != null) { onError.Invoke(r.Error); error = true; } } )); if (error) { yield return(restSession.Close(() => { })); yield break; } var restClient = new Gs2MoneyRestClient( restSession ); yield return(restClient.DepositByUserId( new DepositByUserIdRequest() .WithNamespaceName(moneyNamespaceName) .WithUserId(userId) .WithSlot(slot) .WithPrice(price) .WithCount(value), r => { if (r.Error != null) { onError.Invoke(r.Error); error = true; } else { onDeposit.Invoke(new EzWallet(r.Result.item), price, value); } } )); yield return(restSession.Close(() => { })); }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="gs2RestSession">REST API 用セッション</param> /// <param name="certificateHandler"></param> public Gs2JobQueueRestClient(Gs2RestSession gs2RestSession, CertificateHandler certificateHandler) : base(gs2RestSession) { _certificateHandler = certificateHandler; }