public void RequestOperation(IEntity entity, Location location, Operation op, bool makeEntity) { IEntityProxy connection = this.Connect(entity, location, makeEntity); connection.ConnectionSucceeded += delegate(object sender, EventArgs <IEntityProxy> e) { connection.RequestOperation(op); }; connection.ConnectionFailed += delegate(object sender, EventArgs <IEntityProxy> e) { op.IssueFailEvent(); }; op.OnComplete += delegate(Operation _) { connection.Close(); }; op.OnFail += delegate(Operation _) { connection.Close(); }; }
private static void UpdateRankBasis(Service service, IEntity entity, long cID, string rankID, long score) { if (FeatureMatrix.IsEnable("CharacterRank") && service != null && entity != null) { IEntityProxy connection = service.Connect(entity, new Location { ID = cID, Category = "RankService.RankService" }); UpdateRankBasis updateRankBasis = new UpdateRankBasis(cID, rankID, score, 0L); updateRankBasis.OnFail += delegate(Operation _) { }; updateRankBasis.OnComplete += delegate(Operation _) { connection.Close(); }; connection.ConnectionSucceeded += delegate(object _, EventArgs <IEntityProxy> __) { connection.RequestOperation(updateRankBasis); }; } }