public void OnCleanBtn()
 {
     if (!GameConfig.IsMultiMode)
     {
         plant.UpdateStatus();
         int needNum = (int)((plant.mPlantInfo.mCleanLevel[1] - plant.mClean) / VarPerOp);
         Pathea.PlayerPackageCmpt packageCmpt = Pathea.PeCreature.Instance.mainPlayer.GetCmpt <Pathea.PlayerPackageCmpt>();
         int haveNum = packageCmpt.GetItemCount(ProtoTypeId.INSECTICIDE);
         if (haveNum <= 0)
         {
             MessageBox_N.ShowOkBox(PELocalization.GetString(8000091));
         }
         else
         {
             plant.mClean += VarPerOp * Mathf.Min(haveNum, needNum);
             packageCmpt.Destory(ProtoTypeId.INSECTICIDE, Mathf.Min(haveNum, needNum));
             plant.UpdateStatus();
         }
     }
     else
     {
         if (null != PlayerNetwork.mainPlayer)
         {
             PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_InGame_Plant_Clean, plant.mPlantInstanceId);
         }
     }
     HideItemOpGui();
     //UpdateCmdList();
 }
Exemple #2
0
    void DeleteServer()
    {
        if (null == mServerCtrl)
        {
            return;
        }

        if (mServerCtrl.mList.mSelectedIndex == -1)
        {
            return;
        }

        int    index      = mServerCtrl.mList.mSelectedIndex;
        string serverName = mServerCtrl.mList.mItems[index].mData[0];
        int    sceneMode  = (int)MyServer.AdventureOrBuild(mServerCtrl.mList.mItems[index].mData[2]);

        try
        {
            if (LoadServer.DeleteServer(serverName, sceneMode))
            {
                mServerCtrl.mList.mItems.RemoveAt(index);
                mServerCtrl.mList.UpdateList();
            }
        }
        catch
        {
            Debug.Log("Server is running!");
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000497));
        }
    }
    void OnVoteCallBack(PublishedFileId_t p_id, bool bFor, bool bOK)
    {
        if (isActve == false)
        {
            return;
        }

        if (bOK)
        {
            if (bFor)
            {
                mVoteMap[p_id] = 1;
            }
            else
            {
                mVoteMap[p_id] = 2;
            }

            if (e_VoteDetailCallBack != null)
            {
                e_VoteDetailCallBack(p_id, bFor);
            }
        }
        else
        {
            mVoteMap[p_id] = 0;
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000491));
        }
    }
    void RPC_L2C_CloseServer(uLink.BitStream stream, LobbyMessageInfo info)
    {
        string msg = stream.Read <string>();

        MessageBox_N.CancelMask(MsgInfoType.ServerDeleteMask);
        MessageBox_N.ShowOkBox(msg);
    }
    bool OnWndStartClick()
    {
        if (mIsProcessCheck)
        {
            return(true);
        }

        if (selectWnd.selectedItem != null && !selectWnd.selectedItem.IsFile)
        {
            MapItemDescs          desc       = mMapItems[selectWnd.selectedItem.index];
            Pathea.CustomGameData customdata = Pathea.CustomGameData.Mgr.Instance.GetCustomData(desc.UID, desc.Path);
            if (customdata == null || customdata.humanDescs.Length == 0)
            {
                //lz-2016.10.31 Need a player to start
                MessageBox_N.ShowOkBox(PELocalization.GetString(8000859));
                return(true);
            }

            MapItemDescs           mid   = mMapItems[selectWnd.selectedItem.index];
            ScenarioIntegrityCheck check = ScenarioMapUtils.CheckIntegrityByPath(mid.Path);
            StartCoroutine(ProcessIntegrityCheck(check));
            selectWnd.HintBox.Msg          = "Checking";
            selectWnd.HintBox.isProcessing = true;
            selectWnd.HintBox.Open();
        }

        return(true);
    }
    public void JoinToServerByInvite()
    {
        if (mInviteServerData == null)
        {
            MessageBox_N.ShowOkBox(UIMsgBoxInfo.mRoomIsClose.GetString());
            return;
        }


        bool mNeedPaseWord = (mInviteServerData.PasswordStatus == 1);

        if (mNeedPaseWord)
        {
            mPassWordWnd.SetActive(true);
        }
        else
        {
            ConnectServer(false, mInviteServerData);
            //SteamFriendPrcMgr.Instance.InviteClear();
        }

        ServerRegistered mServerData = _curServerList.Find(
            delegate(ServerRegistered sr)
        {
            return(sr.ServerUID == roomUID);
        });

        if (mServerData != null)
        {
            mRecentRoom_M.AddItem(mServerData.ServerUID, mServerData.ServerName, mServerData.ServerMasterName, mServerData.ServerVersion);
        }
    }
    void RPC_L2C_CreateRoleFailed(uLink.BitStream stream, LobbyMessageInfo info)
    {
        int _error;

        stream.TryRead <int>(out _error);
        if (_error == 1)//name used
        {
            MessageBox_N.ShowOkBox(PELocalization.GetString(ErrorMessage.NAME_HAS_EXISTED));
        }
        else if (_error == 2)//something must be wrong
        {
            RoleInfo[] _myRoles;
            stream.TryRead <RoleInfo[]>(out _myRoles);
            myRoles        = new List <RoleInfo>();
            myRolesExisted = new List <RoleInfo>();
            myRolesDeleted = new List <RoleInfo>();
            myRoles.AddRange(_myRoles);
            for (int m = 0; m < myRoles.Count; m++)
            {
                if (myRoles[m].deletedFlag != 1 && myRolesExisted.Count <= 3)
                {
                    myRolesExisted.Add(myRoles[m]);
                }
                else
                {
                    myRolesDeleted.Add(myRoles[m]);
                }
            }
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000496), PeSceneCtrl.Instance.GotoMultiRoleScene);
        }
        Debug.Log("Create Role Failed");
    }
    void OnLineNameChange(string text)
    {
        if ("" != text.Trim() && isConnectLine)
        {
            UIRailLine line = mRailLineList.Find(
                delegate(UIRailLine li)
            {
                return(li.mRoute.id == mSelectedLineId);
            });

            if (line != null && line.mRoute.name != text)
            {
                if (!Railway.Manager.Instance.IsRouteNameExist(text))
                {
                    line.mRoute.name    = text;
                    mTitleLineName.text = text;
                    if (null != e_ResetRouteName)
                    {
                        e_ResetRouteName(line.mRoute.id, text);
                    }
                }
                else
                {
                    MessageBox_N.ShowOkBox(UIMsgBoxInfo.ReNameNotice.GetString());
                }
                mLineName.text = line.mRoute.name;
            }
        }
    }
    void Update()
    {
        if (mPointGui.IsOpen())
        {
            if (mInputSel && !mPointGui.mNameInput.selected && null != mOpPoint &&
                mPointGui.PointName != mOpPoint.name && mPointGui.PointName.Trim() != "")
            {
                if (Railway.Manager.Instance.IsPointNameExist(mPointGui.mNameInput.text))
                {
                    MessageBox_N.ShowOkBox(UIMsgBoxInfo.ReNameNotice.GetString());
                }
                else
                {
                    mOpPoint.name = mPointGui.mNameInput.text;
                }

                mPointGui.PointName = mOpPoint.name;
            }
            mInputSel = mPointGui.mNameInput.selected;

            if (null != GameUI.Instance.mMainPlayer && null != mOpPoint && Vector3.Distance(GameUI.Instance.mMainPlayer.position, mOpPoint.position) > 30f)
            {
                mPointGui.Hide();
            }
        }
    }
    // login game

    public void FirstToTutorial()
    {
        //lw:多人出教程后,进入lobby
        TutorialExit.type = Pathea.PeGameMgr.playerType == Pathea.PeGameMgr.EPlayerType.Multiple ?
                            TutorialExit.TutorialType.MultiLobby : TutorialExit.TutorialType.Story;

        SystemSettingData.Instance.Tutorialed = true;

        string nickname = mNameInput.text;

        if (string.IsNullOrEmpty(nickname))
        {
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000051));
            return;
        }

        CustomDataMgr.Instance.Current = CreateCustomData();
        CustomDataMgr.Instance.Current.charactorName = nickname;

        Pathea.PeGameMgr.playerType   = Pathea.PeGameMgr.EPlayerType.Tutorial;
        Pathea.PeGameMgr.sceneMode    = Pathea.PeGameMgr.ESceneMode.Tutorial;
        Pathea.PeGameMgr.tutorialMode = Pathea.PeGameMgr.ETutorialMode.DigBuild;

        Pathea.PeFlowMgr.Instance.LoadScene(Pathea.PeFlowMgr.EPeScene.GameScene);
    }
    void Lobby_OnFailedToConnect(LobbyConnectionError error)
    {
        MessageBox_N.CancelMask(MsgInfoType.LobbyLoginMask);

        switch (error)
        {
        case LobbyConnectionError.RSAPublicKeyMismatch:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000034));
            break;

        //lz-2016.10.31 ·­ÒëÁ¬½Ó´íÎóÂë
        case LobbyConnectionError.CreateSocketOrThreadFailure:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000860));
            break;

        case LobbyConnectionError.ConnectionTimeout:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000861));
            break;

        case LobbyConnectionError.ConnectionFailed:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000862));
            break;

        default:
            MessageBox_N.ShowOkBox(error.ToString());
            break;
        }

        //LoginGui_N.Instance.HideMask();
        LogManager.Error("Failed to connect lobby server:", error);
    }
Exemple #12
0
    public void PublishFinishCellBack(int _upLoadindex, ulong publishID, ulong hash)
    {
        string path = "";

        if (mUpLoadMap.ContainsKey(_upLoadindex))
        {
            path = mUpLoadMap[_upLoadindex];
            path = path.Replace('\\', '/');
            path = path.Replace(mDefoutIcoPath, "[ISO]/");
        }

        string text = "";

        if (path.Length > 0 && publishID != 0)
        {
            mUpLoadStateMap[mUpLoadMap[_upLoadindex]] = 101;
            text = "'" + path + "' " + UIMsgBoxInfo.mCZ_WorkShopUpLoadIso.GetString();
        }
        else
        {
            mUpLoadStateMap[mUpLoadMap[_upLoadindex]] = -1;
            text = "'" + path + "' " + UIMsgBoxInfo.mCZ_WorkShopUpLoadIsoFailed.GetString();
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000491));
        }
        if (null != m_UploadingIsoHashList && m_UploadingIsoHashList.Contains(hash))
        {
            m_UploadingIsoHashList.Remove(hash);
        }
        UpdateDownLoadInfo();
        SetInfoMsg(text);
    }
 public void OnArmorPartEquiped(bool success)
 {
     if (!success)
     {
         MessageBox_N.ShowOkBox("/\\__/\\");
     }
 }
Exemple #14
0
    void OnDeletBtn()
    {
        Pathea.ArchiveMgr.Instance.Delete((Pathea.ArchiveMgr.ESave)mIndex);

        MessageBox_N.ShowOkBox(PELocalization.GetString(8000030));

        UpdateArchiveList();
    }
    void RPC_L2C_RepeatLogin(uLink.BitStream stream, LobbyMessageInfo info)
    {
        Disconnect();
        MessageBox_N.ShowOkBox(PELocalization.GetString(8000041));

//		if (null != LoginGui_N.Instance)
//			LoginGui_N.Instance.HideMask();
    }
 static void OnResponse(object sender, PeEvent.EventArg arg)
 {
     if (!NetworkInterface.IsClient && arg is Pathea.PeLauncher.LoadFinishedArg)
     {
         MessageBox_N.ShowOkBox(PELocalization.GetString(8000048), PeSceneCtrl.Instance.GotoLobbyScene);
         Pathea.PeLauncher.Instance.eventor.Unsubscribe(OnResponse);
     }
 }
    void CreatePlayer()
    {
        string nickname = mNameInput.text;

        if (string.IsNullOrEmpty(nickname))
        {
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000051));
            return;
        }

        int mSex = (int)Sex;

        if (Pathea.PeGameMgr.IsSingle)
        {
            CustomDataMgr.Instance.Current = CreateCustomData();
            CustomDataMgr.Instance.Current.charactorName = nickname;

            if (Pathea.PeGameMgr.sceneMode == Pathea.PeGameMgr.ESceneMode.Custom)
            {
                //				mUIMapSelect.SetActive(true);
                Pathea.PeGameMgr.playerType  = Pathea.PeGameMgr.EPlayerType.Single;
                Pathea.PeGameMgr.loadArchive = Pathea.ArchiveMgr.ESave.New;
                Pathea.PeGameMgr.sceneMode   = Pathea.PeGameMgr.ESceneMode.Custom;

                Pathea.PeFlowMgr.Instance.LoadScene(Pathea.PeFlowMgr.EPeScene.GameScene);
            }

            else if (Pathea.PeGameMgr.randomMap)
            {
                SeedSetGui_N.Instance.Show();
            }
            else
            {
                IntroRunner.movieEnd = (() =>
                {
                    Debug.Log("<color=aqua>intro movie end.</color>");
                    PeSceneCtrl.Instance.GotoGameSence();
                });

                Pathea.PeFlowMgr.Instance.LoadScene(Pathea.PeFlowMgr.EPeScene.Intro);
            }
        }
        else if (Pathea.PeGameMgr.IsMulti)
        {
            if (actionOk)
            {
                byte[] appearData = mCurrent.mAppearData.Serialize();
                byte[] nudeData   = mCurrent.mNude.Serialize();
                LobbyInterface.LobbyRPC(ELobbyMsgType.RoleCreate, nickname, (byte)(mSex), appearData, nudeData);
                actionOk = false;
                Invoke("ResetActionOK", 2.0f);
            }
        }
        else
        {
            Debug.LogError("error player mode.");
        }
    }
Exemple #18
0
    //void OnMenuQuickSwitchPointBrush()
    //{
    //    if (pointMode == EBSBrushMode.Add)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.pointRemove);
    //    else if (pointMode == EBSBrushMode.Subtract)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.pointAdd);
    //}

    //void OnMenuQuickSwitchDiagonalBrush()
    //{
    //    if (diagonalRot == 0)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.diagonalZPos);
    //    else if (diagonalRot == 1)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.diagonalXNeg);
    //    else if (diagonalRot == 2)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.diagonalZNeg);
    //    else if (diagonalRot == 3)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.diagonalXPos);
    //}

    //void OnMenuQuickSwitchBoxBrush()
    //{
    //    if (boxMode == EBSBrushMode.Add)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.boxRemove);
    //    else if (boxMode == EBSBrushMode.Subtract)
    //        mMenuCtrl.OnBrushItemClick(UIBrushMenuItem.BrushType.boxAdd);
    //}


    #endregion

    #endregion



    #region Save_Wnd_Event

    bool OnSaveIsoClick(string iso_name)
    {
        BSMiscBrush      select_brush = m_CurBrush as BSMiscBrush;
        BSIsoSelectBrush iso_select   = m_CurBrush as BSIsoSelectBrush;

        if (select_brush != null || iso_select != null)
        {
            if (iso_name != "")
            {
                // Icon
                int       width   = PEBuildingMan.Self.IsoCaputure.photoRT.width;
                int       height  = PEBuildingMan.Self.IsoCaputure.photoRT.height;
                Texture2D iconTex = new Texture2D(width, height, TextureFormat.ARGB32, false);

                RenderTexture.active = PEBuildingMan.Self.IsoCaputure.photoRT;

                iconTex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
                iconTex.Apply();

                RenderTexture.active = null;


                BSIsoData iso = null;

                if (select_brush != null && select_brush.SaveToIso(iso_name, iconTex.EncodeToPNG(), out iso))
                {
                    _initIosBlockPage = false;
                    InitIsoBlockPage();
                    if (onSaveIsoClick != null)
                    {
                        onSaveIsoClick();
                    }
                    return(true);
                }
                else if (iso_select != null && iso_select.SaveToIso(iso_name, iconTex.EncodeToPNG(), out iso))
                {
                    _initIosBlockPage = false;
                    InitIsoBlockPage();
                    if (onSaveIsoClick != null)
                    {
                        onSaveIsoClick();
                    }
                    return(true);
                }
                else
                {
                    MessageBox_N.ShowOkBox(PELocalization.GetString(8000494));
                }
            }
            else
            {
                MessageBox_N.ShowOkBox(PELocalization.GetString(8000494));
            }
        }

        return(false);
    }
    void Repair()
    {
        Repair repairItem = mRepairItem.ItemObj.GetCmpt <Repair>();

        if (null != repairItem && !repairItem.GetValue().IsCurrentMax())
        {
            bool   itemenough = true;
            string des        = PELocalization.GetString(8000026) + " [ffff00]";
            foreach (ItemAsset.MaterialItem item in repairItem.protoData.repairMaterialList)
            {
                int n   = Mathf.CeilToInt(item.count * c_MultiplierOfCost * (1 - repairItem.GetValue().percent));
                int max = m_PlayerPackageCmpt.package.GetCount(item.protoId);
                if (max < n)
                {
                    des       += " " + ItemProto.Mgr.Instance.Get(item.protoId).GetName() + "";
                    itemenough = false;
                    break;
                }
            }
            //if(PlayerFactory.mMainPlayer.GetItemNum(mi.ItemId) < mi.needNum)
            //{
            //    itemenough = false;
            //    ItemProto item = ItemProto.GetItemData(mi.ItemId);
            //    des += " " + item.GetName() + "";
            //    MessageBox_N.ShowOkBox(PELocalization.GetString(8000026) + item.GetName() + " " + PELocalization.GetString(8000027));
            //    return;
            //}
            if (!itemenough)
            {
                des += "[-]" + " " + PELocalization.GetString(8000027);
                MessageBox_N.ShowOkBox(des);
                return;
            }

            if (PeGameMgr.IsMulti)
            {
                if (null != mRepairItem.ItemObj)
                {
                    _net.RequestRepair(mRepairItem.ItemObj.instanceId);
                }
                return;
            }

            foreach (ItemAsset.MaterialItem item in repairItem.protoData.repairMaterialList)
            {
                int n = Mathf.CeilToInt(item.count * c_MultiplierOfCost * (1 - repairItem.GetValue().percent));
                m_PlayerPackageCmpt.package.Destroy(item.protoId, n);
            }
            GameUI.Instance.mItemPackageCtrl.ResetItem();
            this.mRepairMachine.m_Repair.StartCounter();
            this.mRepairMachine.m_Repair.onRepairedTimeUp = this.RepairComplate;
            UpdateItem(repairItem);
        }
    }
Exemple #20
0
 public static void KickPlayerByNet(int playerInstanceId)
 {
     if (null == Instance)
     {
         return;
     }
     Instance.TryRemovePlayer(playerInstanceId);
     if (BaseNetwork.MainPlayer.Id == playerInstanceId)
     {
         MessageBox_N.ShowOkBox(PELocalization.GetString(8000183), PeSceneCtrl.Instance.GotoLobbyScene);
     }
 }
Exemple #21
0
        public static bool CreatePlayer(UIPlayerBuildCtrl __instance)
        {
            if (Pathea.PeGameMgr.IsMulti)
            {
                if (__instance.actionOk)
                {
                    __instance.actionOk = false;
                    __instance.Invoke("ResetActionOK", 2.0f);

                    var name = Traverse.Create(__instance).Field("mNameInput").Property("text").GetValue <string>();

                    if (!string.IsNullOrEmpty(name))
                    {
                        if (GameClientLobby.Self.myRoles.Any(r => r.deletedFlag == 0 && r.name == name))
                        {
                            MessageBox_N.ShowOkBox(PELocalization.GetString(ErrorMessage.NAME_HAS_EXISTED));
                            return(false);
                        }

                        var    playerModel = Traverse.Create(__instance).Field("mCurrent").GetValue <PlayerModel>();
                        byte[] appearData  = playerModel.mAppearData.Serialize();
                        byte[] nudeData    = playerModel.mNude.Serialize();

                        var steamId = SteamFriendPrcMgr.Instance.GetMyInfo()._SteamID.m_SteamID;

                        var roleId = (steamId.GetHashCode() ^ name.GetHashCode()) % 13000000;

                        var role = new CustomData.RoleInfo()
                        {
                            appearData = appearData,
                            nudeData   = nudeData,
                            name       = name,
                            sex        = (byte)(int)Traverse.Create(__instance).Property("Sex").GetValue(),
                            steamId    = steamId,
                            roleID     = roleId
                        };

                        GameClientLobby.Self.myRoles.Add(role);
                        GameClientLobby.Self.myRolesExisted.Add(role);

                        PatchUtils.SaveMultiplayerData();

                        MLPlayerInfo.Instance.SetSelectedRole(role.name);

                        PeSceneCtrl.Instance.GotoMultiRoleScene();

                        return(false);
                    }
                }
            }

            return(true);
        }
 void OnRemoteStorageFilePublishResult(RemoteStoragePublishFileResult_t pCallback, bool bIOFailure)
 {
     if (pCallback.m_eResult == EResult.k_EResultOK)
     {
         _PublishedFileId = pCallback.m_nPublishedFileId;
         LobbyInterface.LobbyRPC(ELobbyMsgType.UploadISOSuccess, _hashCode, SteamMgr.steamId.m_SteamID);
     }
     if (EResult.k_EResultInsufficientPrivilege == pCallback.m_eResult)
     {
         MessageBox_N.ShowOkBox(PELocalization.GetString(8000491));
     }
     OnFilePublished();
 }
    void OnDownLoadFileCallBack(byte[] fileData, PublishedFileId_t p_id, bool bOK, int index = -1, int dungeonId = -1)
    {
        if (isActve == false)
        {
            return;
        }

        //bool DonLoadSucess = false;
        if (bOK)
        {
            if (mItemsMap.ContainsKey(p_id))
            {
                if (mItemsMap[p_id] != null)
                {
                    SteamPreFileAndVoteDetail detail = mItemsMap[p_id];

                    VCIsoHeadData headData;

                    string creation = "Object";
                    if (VCIsoData.ExtractHeader(fileData, out headData) > 0)
                    {
                        creation = headData.Category.ToString();
                        creation = creation.Substring(2, creation.Length - 2);
                    }

                    string downLoadFilePath = VCConfig.s_IsoPath + string.Format("/Download/{0}/", creation);
                    string netCacheFilePath = VCConfig.s_CreationNetCachePath;

                    string downLoadFileName = detail.m_rgchTitle;
                    string netCacheFileName = CRC64.Compute(fileData).ToString();

                    if (SaveToFile(fileData, downLoadFileName, downLoadFilePath, VCConfig.s_IsoFileExt))
                    {
                        UIWorkShopCtrl.AddDownloadFileName(mItemsMap[p_id].m_rgchTitle + VCConfig.s_IsoFileExt, mIsPrivate);
                        mDownMap[p_id] = 100;
                    }

                    //lz-2016.05.30 保存一份到NetCache路径下,避免NetCache重复下载
                    SaveToFile(fileData, netCacheFileName, netCacheFilePath, VCConfig.s_CreationNetCacheFileExt);
                }
            }
        }
        else
        {
            mDownMap[p_id] = -1;
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000493));
        }

//		if (e_DownLoadFile != null)
//			e_DownLoadFile(filePath,DonLoadSucess);
    }
Exemple #24
0
    public static void RPC_S2C_RequestUGCData(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int[] objIDs = stream.Read <int[]>();
        foreach (int id in objIDs)
        {
            CreationData data = CreationMgr.GetCreation(id);
            if (null == data)
            {
                CreationOriginData cData = CreationList.Find(iter => iter.ObjectID == id);
                if (cData != null)
                {
                    CreationMgr.NewCreation(cData.ObjectID, cData.HashCode, (float)cData.Seed);
                }
                else
                {
                    MessageBox_N.ShowOkBox(PELocalization.GetString(8000500));
                    LogManager.Error("Creation item create failed. ID:" + id);
                    GameClientNetwork.Disconnect();
                }

                return;
            }

            ItemProto item = ItemProto.GetItemData(id);
            if (null != item)
            {
                byte[] itemData = ItemProto.GetBuffer(item);
                NetworkManager.SyncServer(EPacketType.PT_Common_UGCItem, id, itemData);

                var components = from component in data.m_IsoData.m_Components
                                 where VCUtils.IsSeat(component.m_Type)
                                 select(int) component.m_Type;

                float hp     = data.m_Attribute.m_Durability;
                float energy = data.m_Attribute.m_MaxFuel;

                if (components.Count() >= 1)
                {
                    NetworkManager.SyncServer(EPacketType.PT_Common_UGCData, id, hp, energy,
                                              data.m_Attribute.m_Cost.Keys.ToArray(), data.m_Attribute.m_Cost.Values.ToArray(), true,
                                              components.ToArray());
                }
                else
                {
                    NetworkManager.SyncServer(EPacketType.PT_Common_UGCData, id, hp, energy,
                                              data.m_Attribute.m_Cost.Keys.ToArray(), data.m_Attribute.m_Cost.Values.ToArray(), false);
                }
            }
        }
    }
    void OnDeleteRoute(Railway.Point point)
    {
        Railway.Route route = Railway.Manager.Instance.GetRoute(point.routeId);
        if (null != route)
        {
            if (route.HasPassenger())
            {
                MessageBox_N.ShowOkBox(UIMsgBoxInfo.RailwayDeleteNotice.GetString());
                return;
            }

            RailwayOperate.Instance.RequestDeleteRoute(point.routeId);
        }
    }
 void BtnHostOnClick()
 {
     if (Input.GetMouseButtonUp(0))
     {
         if (!UnityEngine.Network.HavePublicAddress())
         {
             MessageBox_N.ShowOkBox(PELocalization.GetString(8000057), ShowUIServerWnd);
         }
         else
         {
             ShowUIServerWnd();
         }
     }
 }
Exemple #27
0
    void SaveData()
    {
        if (Pathea.PeGameMgr.playerType == Pathea.PeGameMgr.EPlayerType.Tutorial || (Pathea.PeGameMgr.IsSingleAdventure && Pathea.PeGameMgr.yirdName == Pathea.AdventureScene.Dungen.ToString()))
        {
            //lz-2016.10.31 You can't save file in this area!
            new PeTipMsg("[C8C800]" + PELocalization.GetString(8000852), PeTipMsg.EMsgLevel.Norm, PeTipMsg.EMsgType.Stroy);
            return;
        }
        Pathea.ArchiveMgr.Instance.Save((Pathea.ArchiveMgr.ESave)mIndex);
        MessageBox_N.ShowOkBox(PELocalization.GetString(8000029));

        UpdateArchiveList();
        //mDataList[mIndex].OnActivate(true);
    }
 public void OnArmorSuitChanged(bool success)
 {
     if (success)
     {
         for (int i = 0; i < armorSuitButtons.Length; i++)
         {
             armorSuitButtons[i].SetSelected(playerArmorCmpt.currentSuitIndex == i);
         }
     }
     else
     {
         MessageBox_N.ShowOkBox("/\\__/\\");
     }
 }
 void OnServantRevive()
 {
     if (this.IsDead)
     {
         //log:lz-2016.05.25 唐小力说在复活范围内的时候可以复活,没在就提示没在范围内
         if (this.m_Cmpt.CanRecive)
         {
             GameUI.Instance.mRevive.ShowServantRevive(m_Cmpt);
         }
         else
         {
             MessageBox_N.ShowOkBox(PELocalization.GetString(8000188));
         }
     }
 }
    public static void OnDisconnectFromServer()
    {
        if (Pathea.PeGameMgr.IsMultiStory)
        {
            Pathea.PeGameMgr.yirdName = null;
        }

        if (null != Pathea.PeLauncher.Instance.endLaunch)
        {
            Pathea.PeLauncher.Instance.eventor.Subscribe(OnResponse);
        }
        else
        {
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000048), PeSceneCtrl.Instance.GotoLobbyScene);
        }
    }