Esempio n. 1
0
        static void Main(string[] args)
        {
            //链接网络
            string errorlog     = "";
            Socket clientsocket = SocketAPI.ConnectToServer("127.0.0.1", 9999, ref errorlog);
            //  if (clientsocket != null)
            {
                CS10002 data = (CS10002)PacketDistributed.CreatePacket(MessageID.CS10002);
                data.SetUserName("zhuzhu");
                data.SetPassword("Mini");
                data.SetVersion("10.0");

                data.SendPacket(clientsocket);
                while (true)
                {
                    Thread.Sleep(500);
                }
            }
        }
    void CloseWindow()
    {
        if (m_bIsNeedSendLevelCopySceneMsg)
        {
            CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
            packet.NoParam = -1;
            packet.SendPacket();
        }
        else
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer != null && _mainPlayer.IsDie())
            {
                SendPlayerReliveMsg();
            }
        }
        UIManager.CloseUI(UIInfo.StoryCopySceneResultRoot);
    }
    void OnSaveAuthorityClick()
    {
        if (m_CurGuildJob != (int)GameDefine_Globe.GUILD_JOB.VICE_CHIEF &&
            m_CurGuildJob != (int)GameDefine_Globe.GUILD_JOB.ELDER)
        {
            return;
        }

        CG_GUILD_SET_AUTHORITY pak = (CG_GUILD_SET_AUTHORITY)PacketDistributed.CreatePacket(MessageID.PACKET_CG_GUILD_SET_AUTHORITY);

        pak.SetGuildJobId = m_CurGuildJob;
        pak.GuildJoin     = m_SeniorAuthority_ToggleJoin.value ? 1 : 0;
        pak.Declaration   = m_SeniorAuthority_ToggleDeclaration.value ? 1 : 0;
        pak.ChangeNotice  = m_SeniorAuthority_ToggleNotice.value ? 1 : 0;
        pak.ChangeJoinReq = m_SeniorAuthority_ToggleJoinReq.value ? 1 : 0;
        pak.GuildKick     = m_SeniorAuthority_ToggleKick.value ? 1 : 0;
        pak.ShopLevelUp   = 0;
        pak.OpenActivity  = m_SeniorAuthority_ToggleActivity.value ? 1 : 0;
        pak.SendPacket();
    }
    public void BillingDesk(RestaurantDesk curDesk)
    {
        if (!m_bSelfData)
        {
            GUIData.AddNotifyData("#{2017}");
            return;
        }
        if (null == curDesk)
        {
            LogModule.ErrorLog("curDesk is null");
            return;
        }
        CG_RESTAURANT_BILLINGALL packet = (CG_RESTAURANT_BILLINGALL)PacketDistributed.CreatePacket(MessageID.PACKET_CG_RESTAURANT_BILLINGALL);

        packet.None = 0;
        packet.SetDeskIndex(curDesk.Index);
        packet.SendPacket();

        GameManager.gameManager.SoundManager.PlaySoundEffect(118);  //check
    }
Esempio n. 5
0
    /*
     * public void OnClickPrePage()
     * {
     *  if (m_CurGemItemPage > 1)
     *  {
     *      m_CurGemItemPage--;
     *  }
     *  else
     *  {
     *      Singleton<ObjManager>.GetInstance().MainPlayer.SendNoticMsg(false, "#{2105}");
     *  }
     *  UpdateGemItemList();
     *  m_CurGemItem = null;
     * }
     *
     * public void OnClickNextPage()
     * {
     *  int TotalPage = (int)(m_GemItemList.Count / (int)CONSTVALUE.GEM_ITEM_NUM) + 1;
     *  if (m_CurGemItemPage < TotalPage)
     *  {
     *      m_CurGemItemPage++;
     *  }
     *  else
     *  {
     *      Singleton<ObjManager>.GetInstance().MainPlayer.SendNoticMsg(false, "#{2105}");
     *  }
     *  UpdateGemItemList();
     *  m_CurGemItem = null;
     * }*/

    public void OnClickUnEquipGem()
    {
        if (m_CurEquipSlot < 0 || m_CurEquipSlot >= (int)EquipPackSlot.Slot_NUM)
        {
            return;
        }
        if (m_CurGemSlot < 0 || m_CurGemSlot >= (int)CONSTVALUE.GEM_SLOT_NUM)
        {
            return;
        }
        if (m_GemSlotId[m_CurGemSlot] < 0)
        {
            return;
        }
        CG_TAKE_GEM gemPacket = (CG_TAKE_GEM)PacketDistributed.CreatePacket(MessageID.PACKET_CG_TAKE_GEM);

        gemPacket.SetEquipslot(m_CurEquipSlot);
        gemPacket.SetIndex(m_CurGemSlot);
        gemPacket.SendPacket();
    }
        //向服务器发起添加黑名单请求
        public void ReqAddBlack(UInt64 guid)
        {
            //判断guid合法性
            if (guid == GlobeVar.INVALID_GUID)
            {
                return;
            }

            //超过上限,不进行添加操作
            if (GameManager.gameManager.PlayerDataPool.BlackList.GetRelationNum() >= GlobeVar.MAX_BLACK_NUM)
            {
                return;
            }

            //向服务器发送添加黑名单包
            CG_ADDBLACKLIST msg = (CG_ADDBLACKLIST)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ADDBLACKLIST);

            msg.Guid = guid;
            msg.SendPacket();
        }
    /// <summary>
    /// 装备侠客
    /// </summary>
    void OnEquipSwordsMan()
    {
        int nSiize = GameManager.gameManager.PlayerDataPool.SwordsManEquipPack.GetEmptyContainerSize();

        if (nSiize <= 0)
        {
            MessageBoxLogic.OpenOKBox(2556, 1000);
            return;
        }
        if (null == m_SwordsMan)
        {
            LogModule.ErrorLog("OnEquipSwordsMan::m_SwordsMan is null");
            return;
        }
        CG_EQUIP_SWORDSMAN packet = (CG_EQUIP_SWORDSMAN)PacketDistributed.CreatePacket(MessageID.PACKET_CG_EQUIP_SWORDSMAN);

        packet.Swordsmanguid = m_SwordsMan.Guid;
        packet.SendPacket();
        CloseWindow();
    }
Esempio n. 8
0
    void OnClickBuy()
    {
        if (null == m_SelectShopSwordsManItem)
        {
            //MessageBoxLogic.OpenOKBox("请先选择想要购买的侠客", "");
            MessageBoxLogic.OpenOKBox(StrDictionary.GetClientDictionaryString("#{2810}"), "");
            return;
        }
        int nSiize = GameManager.gameManager.PlayerDataPool.SwordsManBackPack.GetEmptyContainerSize();

        if (nSiize <= 0)
        {
            MessageBoxLogic.OpenOKBox(2488, 1000);
        }

        CG_BUY_SWORDSMAN packet = (CG_BUY_SWORDSMAN)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BUY_SWORDSMAN);

        packet.Swordsmanid = m_SelectShopSwordsManItem.SwordsManDataID;
        packet.SendPacket();
    }
        //向服务器发起删除好友请求
        public void ReqDelFriend(UInt64 guid)
        {
            //判断guid合法性
            if (guid == GlobeVar.INVALID_GUID)
            {
                return;
            }

            //是否已经是好友,不是则不删除
            if (false == GameManager.gameManager.PlayerDataPool.FriendList.RelationDataList.ContainsKey(guid))
            {
                return;
            }

            //向服务器发送删除好友包
            CG_DELFRIEND msg = (CG_DELFRIEND)PacketDistributed.CreatePacket(MessageID.PACKET_CG_DELFRIEND);

            msg.Guid = guid;
            msg.SendPacket();
        }
Esempio n. 10
0
    /// <summary>
    /// 确定寻找
    /// </summary>
    /// <param name="go"></param>
    void LookingForMatching(GameObject go)
    {
        CG_CHAT packet = (CG_CHAT)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CHAT);

        packet.Chattype   = (int)CG_CHAT.CHATTYPE.CHAT_TYPE_WORLD;
        packet.Chatinfo   = StrDictionary.GetClientDictionaryString("#{10274}", m_BabyFellow.Name);
        packet.Linktype   = (int)GC_CHAT.LINKTYPE.LINK_TYPE_SUB_PROPAGATE;
        packet.Fellowguid = m_BabyFellow.Guid;
        packet.SendPacket();

        CG_CHAT packetPro = (CG_CHAT)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CHAT);

        packetPro.Chattype   = (int)CG_CHAT.CHATTYPE.CHAT_TYPE_PROPAGATE;
        packetPro.Chatinfo   = StrDictionary.GetClientDictionaryString("#{10274}", m_BabyFellow.Name);
        packetPro.Linktype   = (int)GC_CHAT.LINKTYPE.LINK_TYPE_SUB_PROPAGATE;
        packetPro.Fellowguid = m_BabyFellow.Guid;
        packetPro.SendPacket();

        m_PublishConfirmDialog.gameObject.SetActive(false);
    }
Esempio n. 11
0
    public void ReliveEntryButton()
    {
        if (m_nTimeData <= 0)
        {
            //可以复活
            CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);
            packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_ENTRY);
            packet.SendPacket();
        }
        else
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer != null)
            {
                //提示CD未到
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1027}");
            }
        }
    }
Esempio n. 12
0
        //帮会踢人MessageBox确认函数
        private void MsgBoxKickGuildMmeberOK()
        {
            if (m_CacheKickMemberGuid == GlobeVar.INVALID_GUID)
            {
                return;
            }

            //无帮会无法申请
            if (GameManager.gameManager.PlayerDataPool.GuildInfo.GuildGuid == GlobeVar.INVALID_GUID)
            {
                return;
            }

            CG_GUILD_KICK msg = (CG_GUILD_KICK)PacketDistributed.CreatePacket(MessageID.PACKET_CG_GUILD_KICK);

            msg.Kicked = m_CacheKickMemberGuid;
            msg.SendPacket();

            m_CacheKickMemberGuid = GlobeVar.INVALID_GUID;
        }
Esempio n. 13
0
    void OnClickGetCur()
    {
        MailData.UserMail curMail = GetMailByItem(m_curSelectItem);
        if (null == curMail)
        {
            return;
        }

        if (curMail.itemID > 0 || curMail.moneyCount > 0)
        {
            CG_MAIL_OPERATION packetDelMail = (CG_MAIL_OPERATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MAIL_OPERATION);
            packetDelMail.SetOperationType((int)CG_MAIL_OPERATION.MailOperation.OPERATION_GETITEM);
            packetDelMail.SetMailGuid(curMail.key);
            packetDelMail.SendPacket();
        }
        else
        {
            OnClickDelCur();
        }
    }
Esempio n. 14
0
        public void UpdateSellItem(int index)
        {
            if (BaseAttr.Level < GlobeVar.MAX_AUTOEQUIT_LIVE)
            {
                return;
            }
            if (IsOpenAutoCombat == false)
            {
                return;
            }
            GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
            //List<ulong> selllist = new List<ulong>();
            //做自动强化物品
            GameItem eItem = BackPack.GetItem(index);

            if (eItem != null) //身上有这个药
            {
                Tab_CommonItem line = TableManager.GetCommonItemByID(eItem.DataID, 0);
                if (line != null)
                {
                    //计算品级及拾取规则
                    if (line.ClassID == (int)ItemClass.EQUIP && GetAutoPickUpFlag(line.Quality)
                        /* && eItem.EnchanceLevel <= 0 && eItem.EnchanceExp <= 0 && eItem.StarLevel <= 0*/
                        && EquipStrengthenLogic.IsAutoEnchanceMaterial(eItem) &&
                        AutoEquipGuid != GlobeVar.INVALID_GUID)
                    {
                        //selllist.Add(eItem.Guid);
                        CG_EQUIP_ENCHANCE equipEnchance = (CG_EQUIP_ENCHANCE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_EQUIP_ENCHANCE);
                        equipEnchance.SetPacktype(1);
                        equipEnchance.SetEquipguid(AutoEquipGuid);
                        equipEnchance.AddMaterialguid(eItem.Guid);
                        equipEnchance.AddMaterialcount(eItem.StackCount);
                        equipEnchance.SendPacket();
                    }
                }
            }
//             if (selllist.Count > 0)
//             {
//                 SysShopController.SellItem((int)GameItemContainer.Type.TYPE_BACKPACK, selllist);
//             }
        }
Esempio n. 15
0
    //////////////////////////////////////////////////////////////////////////
    //PopMenu下的一些通用方法,只要在弹出PopMenu的时候记录了弹出目标的Guid与Name即可
    //////////////////////////////////////////////////////////////////////////
    //加好友
    void PopMenuAddFriend()
    {
        //如果非玩家,则不显示
        if (GlobeVar.INVALID_GUID == m_PopMenuSelectGuid)
        {
            return;
        }

        if (null == Singleton <ObjManager> .GetInstance().MainPlayer)
        {
            return;
        }

        //如果目标是自己也不发送加好友
        if (Singleton <ObjManager> .GetInstance().MainPlayer.GUID == m_PopMenuSelectGuid)
        {
            return;
        }

        if (GameManager.gameManager.PlayerDataPool.FriendList.IsExist(m_PopMenuSelectGuid))
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2394}");

            return;
        }

        /* if (GameManager.gameManager.PlayerDataPool.BlackList.IsExist(m_PopMenuSelectGuid))
         * {
         *   Singleton<ObjManager>.Instance.MainPlayer.SendNoticMsg(false, "#{4723}");
         *   return;
         * }
         *
         */

        CG_ADDFRIEND msg = (CG_ADDFRIEND)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ADDFRIEND);

        msg.Guid = m_PopMenuSelectGuid;
        msg.SendPacket();

        Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2906}");
    }
Esempio n. 16
0
    void BoxBuyItemOK(int nCurNum)
    {
        //nCurNum数量判断
        if (nCurNum < m_nShopItemChangeMin || nCurNum > m_nShopItemChangeMax)
        {
            return;
        }

        //背包判断
        if (GameManager.gameManager.PlayerDataPool.BackPack.GetCanContainerSize() <= 0)
        {
            GUIData.AddNotifyData2Client(false, "#{1903}");
            return;
        }

        //判断是否够
        int nRealCost = Price * nCurNum;

        if (nRealCost > 0)
        {
            int GongJiItemNum = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(ConsumItemID);
            if (nRealCost > GongJiItemNum)
            {
                //不够,返回
                GUIData.AddNotifyData2Client(false, "#{5295}");
                return;
            }
        }
        else
        {
            //可能溢出,直接返回
            return;
        }

        //发送购买消息包
        CG_GONGJISHOP_BUY msg = (CG_GONGJISHOP_BUY)PacketDistributed.CreatePacket(MessageID.PACKET_CG_GONGJISHOP_BUY);

        msg.GoodID = ShopTabID;
        msg.BuyNum = nCurNum;
        msg.SendPacket();
    }
Esempio n. 17
0
    void ConfirmOK()
    {
        if (m_Type == SHOW_TYPE.TYPE_INVALID)
        {
            return;
        }

        if (m_Type == SHOW_TYPE.TYPE_PRESENT || m_Type == SHOW_TYPE.TYPE_PAY)
        {
            int nPlayerYuanBao = GameManager.gameManager.PlayerDataPool.Money.GetMoney_YuanBao();
            if (nPlayerYuanBao < m_CostYuanBao)
            {
                MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{1848}"), "", BuyChargeOK);
                return;
            }
        }

        if (m_Type == SHOW_TYPE.TYPE_PRESENT)
        {
            GameManager.gameManager.PlayerDataPool.ShoppingCart.Submit(m_ChooseFriendGuid, m_ChooseFriendName, ShoppingCart.SUBMIT_TYPE.TYPE_PRESENT);
        }
        else if (m_Type == SHOW_TYPE.TYPE_WAITPAY)
        {
            GameManager.gameManager.PlayerDataPool.ShoppingCart.Submit(m_ChooseFriendGuid, m_ChooseFriendName, ShoppingCart.SUBMIT_TYPE.TYPE_WAITPAY);
        }
        else if (m_Type == SHOW_TYPE.TYPE_PAY)
        {
            CG_PAY_SHOPPINGLIST_WAITPAY packet = (CG_PAY_SHOPPINGLIST_WAITPAY)PacketDistributed.CreatePacket(MessageID.PACKET_CG_PAY_SHOPPINGLIST_WAITPAY);
            packet.Guid = m_ChooseShoppingListGuid;
            packet.SendPacket();
        }

        CleanUp();

        if (PresentRootLogic.Instance() != null)
        {
            PresentRootLogic.Instance().CleanUp();
        }

        gameObject.SetActive(false);
    }
Esempio n. 18
0
        public void ReqChangeGuildDeclaration(string message)
        {
            if (false == GameManager.gameManager.PlayerDataPool.IsHaveGuild())
            {
                return;
            }

            Guild info = GameManager.gameManager.PlayerDataPool.GuildInfo;

            GuildMember mainPlayerGuildInfo = info.GetMainPlayerGuildInfo();

            if (false == mainPlayerGuildInfo.IsValid())
            {
                return;
            }

            if (false == info.IsHaveAuthority(mainPlayerGuildInfo.Job, (int)GameDefine_Globe.GUILD_ROUTINE.GUILD_ROUTINE_DECLARATION))
            {
                GUIData.AddNotifyData("#{2513}");
                return;
            }

            //判断字符串的合法性
            if (message.Length <= 0)
            {
                return;
            }

            CG_GUILD_REQ_CHANGE_DECLARATION msg = (CG_GUILD_REQ_CHANGE_DECLARATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_GUILD_REQ_CHANGE_DECLARATION);

            msg.GuildDeclaration = message;
            msg.SendPacket();

            //为了避免实时刷新,这里暂时将帮会公告设置为修改后的。等待下次向服务器申请后即可再次被赋值
            GameManager.gameManager.PlayerDataPool.GuildInfo.GuildDeclaration = message;

            if (GuildWindow.Instance() != null)
            {
                GuildWindow.Instance().UpdateGuildDeclaration();
            }
        }
Esempio n. 19
0
    void OnSearchClick()
    {
        if (m_GuildNameInput.value.Length <= 0)
        {
            GUIData.AddNotifyData("#{1761}"); //请输入帮会名称
            return;
        }

        if (Encoding.UTF8.GetBytes(m_GuildNameInput.value).Length > GlobeVar.MAX_GUILD_NAME)
        {
            GUIData.AddNotifyData("#{10365}"); //公会名过长
            return;
        }

        Utils.CleanGrid(m_GuildListGrid);

        CG_GUILD_SEARCH pak = (CG_GUILD_SEARCH)PacketDistributed.CreatePacket(MessageID.PACKET_CG_GUILD_SEARCH);

        pak.GuildName = m_GuildNameInput.value;
        pak.SendPacket();
    }
Esempio n. 20
0
    public void SwitchKillModeOnOk()
    {
        if (m_nPKModle != (int)CharacterDefine.PKMODLE.KILL || m_nPKCDTime > 0)
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer)
            {
                //发包请求切换
                CG_CHANGE_PKMODLE pkChange = (CG_CHANGE_PKMODLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CHANGE_PKMODLE);
                pkChange.SetObjId(_mainPlayer.ServerID);
                pkChange.SetPKModle((int)CharacterDefine.PKMODLE.KILL);
                pkChange.SendPacket();
            }
        }
        OnCloseClick();
        if (FunctionButtonLogic.Instance() != null)
        {
            FunctionButtonLogic.Instance().UpdateNewFunctionButtonState(FunctionButtonLogic.DynamicLogo.PKModel);
        }
    }
Esempio n. 21
0
    //现在去评价按钮
    void ReviewNow()
    {
        //先把客户端的状态给改了
        PlayerPreferenceData.ReviewRefuseType = (int)Games.GlobeDefine.GameDefine_Globe.REVIEW_TYPE.WITH_PLEASURE;
        GameManager.gameManager.PlayerDataPool.ReviewResult = (int)Games.GlobeDefine.GameDefine_Globe.REVIEW_TYPE.WITH_PLEASURE;

        //notice gameserver
        CG_REVIEW_RESULT pPacket = (CG_REVIEW_RESULT)PacketDistributed.CreatePacket(MessageID.PACKET_CG_REVIEW_RESULT);

        if (null != pPacket)
        {
            pPacket.SetResult(GameManager.gameManager.PlayerDataPool.ReviewResult);//It is the most effective way that encourages us programming.
            pPacket.SendPacket();
        }

        Application.OpenURL(PlatformHelper.GetAppDetailUrl());

        //隐藏tab
        CloseWindow();
        HideReviewTab();
    }
Esempio n. 22
0
    void OnUseBtClick()
    {
        if (m_UseItemBuffer == null ||
            m_UseItemBuffer.Count <= 0 ||
            m_UseItemBuffer[0] == null ||
            !m_UseItemBuffer[0].IsValid())
        {
            GUIData.AddNotifyData2Client(false, StrDictionary.GetClientDictionaryString("#{3286}"));
            CloseCurItem();
        }

        int canuse = TableManager.GetCommonItemByID(m_UseItemBuffer[0].DataID, 0).CanUse;

        if (canuse == 1)
        {
            CG_USE_ITEM useitem = (CG_USE_ITEM)PacketDistributed.CreatePacket(MessageID.PACKET_CG_USE_ITEM);
            useitem.SetItemguid(m_UseItemBuffer[0].Guid);
            useitem.SendPacket();
        }
        CloseCurItem();
    }
Esempio n. 23
0
    void ProduceItem( )
    {
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        if (m_CurItemData.IsValid())
        {
            if (GuildWindow.GuildWealthBak < m_CurItemData.m_Price)
            {
                _mainPlayer.SendNoticMsg(false, "#{3956}");
                return;
            }

            CG_GUILD_SHOP_ITEM_MAKE packet = (CG_GUILD_SHOP_ITEM_MAKE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_GUILD_SHOP_ITEM_MAKE);
            packet.SetItemID(m_CurItemData.m_ItemID);
            packet.SendPacket();
        }
    }
Esempio n. 24
0
        //请求修改公告
        public void ReqChangeNotice(string notice)
        {
            //检测公告长度
            if (notice.Length <= 0 || notice.Length > GlobeVar.MAX_MASTER_NOTICE)
            {
                return;
            }

            //只有掌门才能修改
            if (GameManager.gameManager.PlayerDataPool.IsMasterChief() == false)
            {
                return;
            }

            CG_MASTER_REQ_CHANGE_NOTICE msg = (CG_MASTER_REQ_CHANGE_NOTICE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MASTER_REQ_CHANGE_NOTICE);

            msg.MasterNotice = notice;
            msg.SendPacket();
            //把本地的也改掉
            GameManager.gameManager.PlayerDataPool.MasterInfo.MasterNotice = notice;
        }
Esempio n. 25
0
        public void SendDropItem()
        {
            CG_ASK_PICKUP_ITEM packet = (CG_ASK_PICKUP_ITEM)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_PICKUP_ITEM);

            packet.SetObjId(ServerID);
            packet.SendPacket();
            //播放拾取声音
            if (null != GameManager.gameManager.SoundManager)
            {
                if (DropType == (int)Games.GlobeDefine.GameDefine_Globe.DROP_TYPE.DROP_COIN)
                {
                    GameManager.gameManager.SoundManager.PlaySoundEffect(31);   //pickup_coin
                }
                else if (DropType == (int)Games.GlobeDefine.GameDefine_Globe.DROP_TYPE.DROP_ITEM)
                {
                    GameManager.gameManager.SoundManager.PlaySoundEffect(32);   //pickup_goods
                }
            }

            bIsDrop = false;
        }
Esempio n. 26
0
    public void AdvancedOnce()
    {
        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }
        CG_ASK_ABSORB_BELLEPIECE belleAbsorb = (CG_ASK_ABSORB_BELLEPIECE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_ABSORB_BELLEPIECE);

        belleAbsorb.SetIndex(belleTab.Id);
        belleAbsorb.SetAbsorbAll(0);
        belleAbsorb.SendPacket();
        if (BelleController.Instance() != null)
        {
            if (BelleController.Instance().FTEIndex == 4)
            {
                BelleController.Instance().DoFTE(5);
            }
        }
    }
Esempio n. 27
0
    public void OnReportOK()
    {
        if (Singleton <ObjManager> .GetInstance().MainPlayer != null)
        {
            if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_COMPLAIN))
            {
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{5483}");

                return;
            }
            MailData.UserMail curMail = GetMailByItem(m_curSelectItem);
            if (null == curMail)
            {
                return;
            }
            StartCoroutine(Singleton <ObjManager> .GetInstance().MainPlayer.SendComplain(curMail.SenderID, curMail.SenderName, curMail.text, 2));
            CG_ADDBLACKLIST msg = (CG_ADDBLACKLIST)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ADDBLACKLIST);
            msg.Guid = curMail.SenderID;
            msg.SendPacket();
        }
    }
Esempio n. 28
0
 void SendData(int All)
 {
     if (m_bSend == false)
     {
         CG_ASK_COPYSCENE_REWARD packet = (CG_ASK_COPYSCENE_REWARD)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_COPYSCENE_REWARD);
         packet.SetSceneID(GameManager.gameManager.RunningScene);
         packet.SetType(All);
         packet.SendPacket();
         m_bSend = true;
         //MessageBoxLogic.OpenWaitBox(1290, 5, 0); 
     }
     else
     {
         if (Singleton<ObjManager>.Instance.MainPlayer)
         {
             //Singleton<ObjManager>.Instance.MainPlayer.SendMessage("请耐心等待");   //稍后替换
             Singleton<ObjManager>.Instance.MainPlayer.SendMessage(StrDictionary.GetClientDictionaryString("#{2891}"));   //稍后替换
         }
     }
     
 }
Esempio n. 29
0
    void ChallengeOkCallBack()
    {
        switch (ChallengeRewardLogic.RewardType)
        {
        case 0:
            HandleClickChallengeOk();
            SendLeaveCopySceneMsg();
//                 if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_WUDAOZHIDIAN)
//                 {// 副本场景直接发包返回副本前场景 不查表
//                     CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
//                     packet.NoParam = -1;
//                     packet.SendPacket();
//                 }
            break;

        case 1:
            if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_HUASHANLUNJIAN)
            {    // 副本场景直接发包返回副本前场景 不查表
                CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
                packet.NoParam = -1;
                packet.SendPacket();
            }
            break;

        case 2:
            if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_RICHANGJUEDOU)
            {    // 副本场景直接发包返回副本前场景 不查表
                CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
                packet.NoParam = -1;
                packet.SendPacket();
            }
            break;

        default:
            break;
        }
        ;

        UIManager.CloseUI(UIInfo.ChallengeRewardRoot);
    }
Esempio n. 30
0
    // 购买物品
    public static void BuyItem(string strItemIndex, int count)
    {
        int  curItemIndex;
        bool bCanGetID = int.TryParse(strItemIndex, out curItemIndex);

        if (!bCanGetID)
        {
            LogModule.ErrorLog("cur item id set error!");
            return;
        }

        Tab_SystemShop sysShopTable = TableManager.GetSystemShopByID(m_curShopID, 0);

        if (null == sysShopTable)
        {
            LogModule.ErrorLog("cur sysshop id isn't exist! : id " + m_curShopID.ToString());
            return;
        }

        int pid = sysShopTable.GetPricebyIndex(curItemIndex);

        if (pid < 0)
        {
            LogModule.ErrorLog("can not find cur item pid : itemID" + pid.ToString());
            return;
        }

        if (count < ITEMCOUNT_MIN || count > ITEMCOUNT_MAX)
        {
            LogModule.ErrorLog("item count is out range : count " + count.ToString());
            return;
        }

        CG_SYSTEMSHOP_BUY buyPacket = (CG_SYSTEMSHOP_BUY)PacketDistributed.CreatePacket(MessageID.PACKET_CG_SYSTEMSHOP_BUY);

        buyPacket.SetBuyNum(count);
        buyPacket.SetShopId(m_curShopID);
        buyPacket.SetMercIndex(curItemIndex);
        buyPacket.SendPacket();
    }