private void sendFriendRequest() { uint[] useridArray = new uint[1]; useridArray[0] = m_SearchUserId; ServerDataUtilSend.SendPacketAPI_FriendRequest(useridArray) .setSuccessAction(_data => { UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(_data.GetResult <RecvFriendRequest>().result.friend); // すでにお気に入り登録しているフレンドの可能性があるので削除しておく LocalSaveManager.Instance.SaveFuncAddFavoriteFriend(useridArray[0], false, true); MainMenuManager.Instance.SubTab.updateTabItem(); Dialog _newDialog = Dialog.Create(DialogType.DialogOK); _newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "fr164q_title"); _newDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "fr164q_content"); _newDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1"); _newDialog.EnableFadePanel(); _newDialog.Show(); resetSearchUserId(); }) .setErrorAction(_data => { MainMenuUtil.openFriendRequestErrorDialog(_data.m_PacketCode, resetSearchUserId); }) .SendStart(); }
private void SendGetScoreReward(int[] reward_ids) { ServerDataUtilSend.SendPacketAPI_GetScoreReward(scoreInfo.event_id, reward_ids) .setSuccessAction(data => { RecvGetScoreReward getReward = data.GetResult <RecvGetScoreReward>(); if (getReward != null && getReward.result != null) { //スコア情報 scoreInfo = getReward.result.score_info; //報酬リスト更新 updateRewardList(); //プレゼント更新 if (getReward.result.present != null) { UserDataAdmin.Instance.m_StructPresentList = UserDataAdmin.PresentListClipTimeLimit(getReward.result.present); } openGetScoreRewardDialog(); } }) .setErrorAction(data => { }) .SendStart(); }
private void SendGetChallengeReward(int event_id, int[] reward_ids, int[] loop_cnts) { ServerDataUtilSend.SendPacketAPI_GetChallengeReward(event_id, reward_ids, loop_cnts) .setSuccessAction((data) => { RecvGetChallengeRewardValue result = data.GetResult <RecvGetChallengeReward>().result; if (result != null) { //プレゼント情報更新 UserDataAdmin.Instance.m_StructPresentList = UserDataAdmin.PresentListClipTimeLimit(result.present); //受取報酬リスト更新 m_ChallengeInfo.get_list = result.get_list; updateGetRewardList(result.get_list); scrollContent.Initialize(this); openGetRewardSuccesDialog(); } }) .setErrorAction((data) => { }) .SendStart(); }
/// <summary> /// フレンド申請受諾通信 /// </summary> private void sendFriendConsent() { uint[] selectFriendArray = new uint[1]; selectFriendArray[0] = m_SelectFriend.FriendData.user_id; ServerDataUtilSend.SendPacketAPI_FriendConsent(selectFriendArray) .setSuccessAction(_data => { UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(_data.GetResult <RecvFriendConsent>().result.friend); Dialog _newDialog = Dialog.Create(DialogType.DialogOK); _newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "fr157q_title"); _newDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "fr157q_content"); _newDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1"); _newDialog.SetDialogEvent(DialogButtonEventType.OK, () => { MainMenuManager.Instance.SubTab.updateTabItem(); updateFriendList(); StartCoroutine(MainMenuWebViewShowChk.PopupWebViewStart(MainMenuWebViewShowChk.PopupWebViewType.Mission)); }); _newDialog.Show(); }) .setErrorAction(_data => { MainMenuUtil.openFriendRequestErrorDialog(_data.m_PacketCode); }) .SendStart(); }
/// <summary> /// フレンド申請キャンセル通信 /// </summary> private void sendFriendRequestCancel() { uint[] selectFriendArray = new uint[1]; selectFriendArray[0] = m_SelectFriend.FriendData.user_id; ServerDataUtilSend.SendPacketAPI_FriendRefusal(selectFriendArray) .setSuccessAction(_data => { UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(_data.GetResult <RecvFriendRefusal>().result.friend); Dialog _newDialog = Dialog.Create(DialogType.DialogOK); _newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "fr159q_title"); string mainFormat = GameTextUtil.GetText("fr159q_content"); _newDialog.SetDialogText(DialogTextType.MainText, string.Format(mainFormat, m_SelectFriend.FriendData.user_name)); _newDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1"); _newDialog.SetDialogEvent(DialogButtonEventType.OK, () => { MainMenuManager.Instance.SubTab.updateTabItem(); updateFriendList(); }); _newDialog.Show(); }) .setErrorAction(_data => { MainMenuUtil.openFriendRequestErrorDialog(_data.m_PacketCode); }) .SendStart(); }
/// <summary> /// プレゼントを開く /// </summary> /// <param name="present_ids"></param> /// <param name="isAll">全部受け取りかどうか</param> private void presentOpen(long[] present_ids, bool isAll = false, bool isNoticeEnable = false) { var serverApi = ServerDataUtilSend.SendPacketAPI_PresentOpen(present_ids); // SendStartの成功時の振る舞い serverApi.setSuccessAction(_data => { UserDataAdmin.Instance.m_StructPlayer = _data.UpdateStructPlayer <RecvPresentOpen>(UserDataAdmin.Instance.m_StructPlayer); UserDataAdmin.Instance.ConvertPartyAssing(); // 開封結果を取得 var presentOpen = _data.GetResult <RecvPresentOpen>().result; // プレゼントリストを更新 UserDataAdmin.Instance.m_StructPresentList = UserDataAdmin.PresentListClipTimeLimit(presentOpen.present); // プレゼント開封個数 var presentOpenArray = presentOpen.open_serial_id; for (int i = 0; i < presentOpenArray.Length; ++i) { // レコードcontextを、DoneRecordsへ移動 moveRecord(presentOpenArray[i]); } updatePresentList(false); // レコード数の更新 RecordCount0 = Records0.Count; RecordCount1 = Records1.Count; RecordCount2 = Records0.Where(p => p.NoticeEnable == false).ToList().Count; //---------------------------------------------------- // 開封結果ダイアログの表示 //---------------------------------------------------- if (isAll) { PresentAllOpenResultMessage(presentOpen); } else { PresentOneOpenResultMessage(presentOpen, isNoticeEnable); } // ページ表示の更新 //StartCoroutine(PageUpdate()); }); // SendStartの失敗時の振る舞い serverApi.setErrorAction(_data => { #if BUILD_TYPE_DEBUG Debug.Log("MASTER_HASH_GET:Error"); #endif }); serverApi.SendStart(); }
/// <summary> /// API終了:フレンド一覧取得成功 /// </summary> void ReceiveGetFriendListSuccess(ServerApi.ResultData data) { PacketStructFriend[] friendList = data.GetResult <RecvFriendListGet>().result.friend; if (!friendList.IsNullOrEmpty()) { // ユーザーデータ情報を更新 UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(friendList); MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_FRIEND_LIST, false, false); // ページ再表示 SoundUtil.PlaySE(SEID.SE_MENU_OK2); } }
/// <summary> /// リストの更新 /// </summary> void OnClickReloadButton() { if (ServerApi.IsExists == true) { return; } SoundUtil.PlaySE(SEID.SE_MENU_OK2); ServerDataUtilSend.SendPacketAPI_LoginPack(false, true, true, false). setSuccessAction( _data => { RecvLoginPackValue cLoginPack = _data.GetResult<RecvLoginPack>().result; //---------------------------------------- // 助っ人情報保持 //---------------------------------------- if (cLoginPack.result_helper != null && cLoginPack.result_helper.friend != null ) { UserDataAdmin.Instance.m_StructHelperList = UserDataAdmin.FriendListClipMe(cLoginPack.result_helper.friend); } //---------------------------------------- // フレンド情報保持 //---------------------------------------- if (cLoginPack.result_friend != null && cLoginPack.result_friend.friend != null ) { UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(cLoginPack.result_friend.friend); LocalSaveManager.Instance.SaveFuncAddFavoriteFriendClip(UserDataAdmin.Instance.m_StructFriendList); } // 更新ボタンの無効化 MainMenuParam.m_IsEnableQuestFriendReload = false; m_FriendList.m_ReloadButton.SetEnable(false); // 更新 setupFriend(); }). setErrorAction( _data => { }). SendStart(); }
//---------------------------------------------------------------------------- /*! * @brief リンクシステム:リンクユニットの取得(ユニークID指定) * @param[in] long (lLinkUnitUniqueID) リンクユニット:ユニークID * @return PacketStructUnit [リンクユニット] * @note 自分のユニットリストから、リンクユニットを取得 */ //---------------------------------------------------------------------------- static public PacketStructUnit GetLinkUnit(long lLinkUnitUniqueID) { UserDataAdmin cUserData = UserDataAdmin.Instance; PacketStructUnit cLinkUnit = null; //-------------------------------- // エラーチェック //-------------------------------- if (cUserData == null) { return(cLinkUnit); } cLinkUnit = cUserData.SearchChara(lLinkUnitUniqueID); return(cLinkUnit); }
/// <summary> /// フレンド解除通信 /// </summary> private void requestFriendRefusal() { uint[] aunFriendIDList = new uint[1]; aunFriendIDList[0] = m_SelectFriend.FriendData.user_id; ServerDataUtilSend.SendPacketAPI_FriendRefusal(aunFriendIDList) .setSuccessAction(_data => { UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(_data.GetResult <RecvFriendRefusal>().result.friend); CreateFriendList(); }) .setErrorAction(_data => { MainMenuUtil.openFriendRequestErrorDialog(_data.m_PacketCode); }) .SendStart(); }
/// <summary> /// フレンド申請申し込みキャンセル通信 /// </summary> private void sendFriendRequestCancel() { uint[] selectFriendArray = new uint[1]; selectFriendArray[0] = m_SelectFriend.FriendData.user_id; ServerDataUtilSend.SendPacketAPI_FriendRefusal(selectFriendArray) .setSuccessAction(_data => { UserDataAdmin.Instance.m_StructFriendList = UserDataAdmin.FriendListClipNotExist(_data.GetResult <RecvFriendRefusal>().result.friend); MainMenuManager.Instance.SubTab.updateTabItem(); updateFriendList(); }) .setErrorAction(_data => { MainMenuUtil.openFriendRequestErrorDialog(_data.m_PacketCode); }) .SendStart(); }
public const uint SKILL_LINK_ODDS_MAX = (10000); // リンクスキル発動率最大値 /*==========================================================================*/ /* var */ /*==========================================================================*/ /*==========================================================================*/ /* func */ /*==========================================================================*/ //---------------------------------------------------------------------------- /*! * @brief リンクシステム:リンクユニットの取得 * @param[in] PacketStructUnit (cBaseUnit) ベースユニット * @return PacketStructUnit [リンクユニット] * @note 自分のユニットリストから、リンクユニットを取得 */ //---------------------------------------------------------------------------- static public PacketStructUnit GetLinkUnit(PacketStructUnit cBaseUnit) { UserDataAdmin cUserData = UserDataAdmin.Instance; PacketStructUnit cLinkUnit = null; //-------------------------------- // エラーチェック //-------------------------------- if (cUserData == null || cBaseUnit == null) { return(cLinkUnit); } cLinkUnit = cUserData.SearchChara(cBaseUnit.link_unique_id); return(cLinkUnit); }
//---------------------------------------------------------------------------- /*! * @brief 購入シーケンス:ストア処理完了ダイアログ * @note */ //---------------------------------------------------------------------------- private void ExecStepStoreExec(StoreRequest cRequestResult) { if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_OK) { // 成功時プレゼントの付与があった場合はプレゼントリスト獲得通信を行う if (cRequestResult.m_AddPresent == true) { //----------------------- // プレゼントリストリクエストを発行 //----------------------- ServerDataUtilSend.SendPacketAPI_PresentListGet() .setSuccessAction(_data => { //---------------------------------------- // 情報反映 //---------------------------------------- var list = UserDataAdmin.PresentListClipTimeLimit(_data.GetResult <RecvPresentListGet>().result.present); UserDataAdmin.Instance.m_StructPresentList = list; //---------------------------------------- // 処理終了。 //---------------------------------------- // プレゼント付きダイアログ表示 uint nProductNum = cRequestResult.m_WorkResultAddTip; string strDialogTitle = GameTextUtil.GetText("MM_SHOP_BUY_SUCCESS_TITLE"); string strDialogMsg = GameTextUtil.GetText("MM_SHOP_BUY_SUCCESS_ADD_PRESENT"); strDialogMsg = string.Format(strDialogMsg, nProductNum, UserDataAdmin.Instance.m_StructPlayer.have_stone); DialogManager.Open1B_Direct(strDialogTitle, strDialogMsg, "common_button7", true, true). SetOkEvent(() => { finishAction(true); }); }) .setErrorAction(_data => { //---------------------------------------- // 何らかの不具合により通信失敗したら戻る //---------------------------------------- DialogManager.Open1B("ERROR_MSG_WIDEUSE_TITLE", "ERROR_MSG_WIDEUSE", "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); SoundUtil.PlaySE(SEID.SE_MENU_RET); }) .SendStart(); } else { // 通常購入 uint nProductNum = cRequestResult.m_WorkResultAddTip; string strDialogTitle = GameTextUtil.GetText("sh123q_title"); string strDialogMsg = GameTextUtil.GetText("sh123q1_content"); strDialogMsg = string.Format(strDialogMsg, nProductNum, UserDataAdmin.Instance.m_StructPlayer.have_stone); DialogManager.Open1B_Direct(strDialogTitle, strDialogMsg, "common_button1", true, true). SetOkEvent(() => { finishAction(false); }); } } else if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_NG) { if (cRequestResult.m_PacketCode == API_CODE.API_CODE_Android_QueryInventoryFailed_ERROR || cRequestResult.m_PacketCode == API_CODE.API_CODE_Android_ConsumePurchaseFailed_ERROR || cRequestResult.m_PacketCode == API_CODE.API_CODE_Android_OnPurchaseReceipt_ERROR ) { //下記のエラーコード対応のため // API_CODE.API_CODE_Android_QueryInventoryFailed_ERROR: // API_CODE.API_CODE_Android_ConsumePurchaseFailed_ERROR: // API_CODE.API_CODE_Android_OnPurchaseReceipt_ERROR: string strDialogTitle = GameTextUtil.GetText("ERROR_MSG_CANCEL_TITLE"); string strDialogMsg = GameTextUtil.GetText("ERROR_MSG_CANCEL"); strDialogMsg = string.Format(strDialogMsg, (uint)cRequestResult.m_PacketCode); DialogManager.Open1B_Direct(strDialogTitle, strDialogMsg, "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); } else { //それ以外のエラーときはServerApiがダイアログを表示しているので終了処理のみ行う finishAction(false); } } else if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_NG_LOCK) { //----------------------- // 課金機能がロックされている //----------------------- DialogManager.Open1B("ERROR_STORE_LOCK_TITLE", "ERROR_STORE_LOCK", "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); } else if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_NG_INIT) { //----------------------- // 初期化に失敗している //----------------------- DialogManager.Open1B("ERROR_PAY_INIT_TITLE", "ERROR_PAY_INIT", "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); } else if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_CANCEL) { //----------------------- // ユーザー操作でキャンセルされた //----------------------- SoundUtil.PlaySE(SEID.SE_MENU_RET); finishAction(false); } else if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_TRANSACTION) { //----------------------- // 前回購入処理が完了していない // キャンセルダイアログに乗せてボタンを押したら最初に戻す //----------------------- DialogManager.Open1B("ERROR_PAY_TRANSACTION_TITLE", "ERROR_PAY_TRANSACTION", "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); } else if (cRequestResult.m_WorkResult == STORE_RESULT.FINISH_RESTORE) { //----------------------- // 購入しようとしたら補填処理が走った // キャンセルダイアログに乗せてボタンを押したら最初に戻す //----------------------- DialogManager.Open1B("ERROR_PAY_RESTORE_TITLE", "ERROR_PAY_RESTORE", "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); } else { //----------------------- // 想定外エラー //----------------------- DialogManager.Open1B("ERROR_MSG_USER_TITLE", "ERROR_MSG_USER", "common_button7", true, true). SetOkEvent(() => { finishAction(false); }); } }
// ガチャ実行 // fix_id: count:回数 tutorial:チュートリアルフラグ private void SendScratch(int count) { //連打防止 if (ServerApi.IsExists) { return; } //スクラッチのリザルトが終わるまでHomeに戻るバックキー無効 if (MainMenuManager.HasInstance) { MainMenuManager.Instance.DisableBackKey(); } //ユニット取得フラグ保存 MainMenuParam.m_GachaPrevUnitGetFlag = UserDataAdmin.Instance.m_StructPlayer.flag_unit_get; #if BUILD_TYPE_DEBUG Debug.Log("Scratch Send"); #endif int tutorial = (TutorialManager.IsExists) ? 1 : 0; var serverApi = ServerDataUtilSend.SendPacketAPI_GachaPlay(Context.gachaMaster.fix_id, (uint)count, (uint)tutorial); // SendStartの成功時の振る舞い serverApi.setSuccessAction(_data => { #if BUILD_TYPE_DEBUG Debug.Log("Scratch Send Success"); #endif // DG0-2733 Tutorial時、StructPlayer.renew_tutorial_step == 602 に更新される UserDataAdmin.Instance.m_StructPlayer = _data.UpdateStructPlayer <RecvGachaPlay>((PacketStructPlayer)UserDataAdmin.Instance.m_StructPlayer); UserDataAdmin.Instance.ConvertPartyAssing(); RecvGachaPlayValue result = _data.GetResult <RecvGachaPlay>().result; //---------------------------------------- // ガチャの結果表示画面で使う情報入力 //---------------------------------------- MainMenuParam.m_GachaUnitUniqueID = result.unit_unique_id; MainMenuParam.m_GachaBlankUnitID = result.blank_unit_id; MainMenuParam.m_GachaOmakeID = result.gacha_bonus_data; MainMenuParam.m_GachaGetUnitNum = MainMenuParam.m_GachaUnitUniqueID.Length; if (result.gacha_status != null) { UserDataAdmin.Instance.UpdateGachaStatusList(result.gacha_status); } if (result.result_present != null) { UserDataAdmin.Instance.m_StructPresentList = UserDataAdmin.PresentListClipTimeLimit(result.result_present.present); } Context.m_IsMoveScratchResult = true; if (MainMenuManager.HasInstance) { MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_GACHA_RESULT, false, false); } }); // SendStartの失敗時の振る舞い serverApi.setErrorAction(_data => { // ステップが更新された if (_data.m_PacketCode == API_CODE.API_CODE_STEP_UP_GACHA_REST_TIME_NOW) { RecvGachaPlayValue result = _data.GetResult <RecvGachaPlay>().result; if (result.gacha_status != null) { UserDataAdmin.Instance.UpdateGachaStatusList(result.gacha_status); } MainMenuManager.Instance.SetResetSubTabFlag(); MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_GACHA_MAIN, false, false); } #if BUILD_TYPE_DEBUG Debug.Log("Scratch Send Error"); #endif }); serverApi.SendStart(); }