コード例 #1
0
    public void OnHanRenClick()
    {
        if (Time.realtimeSinceStartup - OnHanRentimeSend < 30)
        {
            Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{2163}");

            return;
        }
        OnHanRentimeSend = Time.realtimeSinceStartup;
        if (GameDefine_Globe.CopyScene_PlayType.MULTIPLE != CopyScenePlayerMode)
        {
            return;
        }
        Tab_SceneClass pSceneClass = TableManager.GetSceneClassByID(CopySceneId, 0);

        if (pSceneClass == null)
        {
            return;
        }
        //判断队伍是否已满
        if (GameManager.gameManager.PlayerDataPool.IsHaveTeam())
        {
            if (GameManager.gameManager.PlayerDataPool.TeamInfo.IsFull())
            {
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1145}");

                return;
            }
        }
        else
        {
            if (Singleton <ObjManager> .GetInstance().MainPlayer)
            {
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{3170}");
            }

            CG_REQ_TEAM_INVITE msg = (CG_REQ_TEAM_INVITE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_REQ_TEAM_INVITE);
            if (msg != null)
            {
                msg.Guid = GlobeVar.INVALID_GUID;
                msg.SendPacket();
            }
        }

        string text = StrDictionary.GetClientDictionaryString("#{11184}");

        if (null != Singleton <ObjManager> .GetInstance().MainPlayer)
        {
            CG_CHAT packet = (CG_CHAT)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CHAT);
            packet.Chattype = (int)CG_CHAT.CHATTYPE.CHAT_TYPE_WORLD;
            packet.Chatinfo = text;
            packet.Linktype = (int)GC_CHAT.LINKTYPE.LINK_TYPE_COPYTEAM;
            packet.AddIntdata(CopySceneId);
            packet.AddIntdata(1);
            packet.SendPacket();
        }
    }
コード例 #2
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);
    }