Jump to content

Erro Global Chat v3.0


Recommended Posts

Ola pessoal eu coloquei um sistema de global chat  aonde objetivo  in game é mostra a bandeira do reino que a pessoa é.

coloquei o sistema mais quando eu digo algo no chat ele não me mostra a bandeira.No sysser do cliente não me da erro.

deixo a img do erro aqui quem puder me ajudar ficarei agradecido.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Aonde esta o era para ser a bandeira.

Link to post
Share on other sites
4 horas atrás, Tierri Lopes disse:

Podes colocar localização do sistema e prints/pastebin das partes que modificaste na tua source/cliente sff?

Para revermos a instalação do mesmo e notarmos em eventuais erros

PythonChat.h

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

PythonChat.ccp

Spoiler

// search this

    void CPythonChat::UpdateViewMode(DWORD dwID)
// after 
        pChatLine->Instance.Update();
// add this
#ifdef ENABLE_GLOBAL_CHAT
        if(pChatLine->ImageInstance)
            pChatLine->ImageInstance->SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight + 2);
#endif
// search this

    void CPythonChat::UpdateEditMode(DWORD dwID)
// after this 
        pChatLine->Instance.Update();
// add this
#ifdef ENABLE_GLOBAL_CHAT
    if(pChatLine->ImageInstance)
            pChatLine->ImageInstance->SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight + 2);
#endif
// search this

    void CPythonChat::UpdateLogMode(DWORD dwID)
// after this
pChatLine->Instance.Update();
// add this
#ifdef ENABLE_GLOBAL_CHAT
    if(pChatLine->ImageInstance)
            pChatLine->ImageInstance->SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight + 2);
#endif
// search this  

    void CPythonChat::Render(DWORD dwID)

// after this
        rInstance.Render();
// add this
#ifdef ENABLE_GLOBAL_CHAT
        CGraphicImageInstance *& imInstance = (*itor)->ImageInstance;
        if (imInstance)
            imInstance->Render();
#endif
// search this  

    void CPythonChat::AppendChat(int iType, const char * c_szChat)
// after this function
    for (TChatSetMap::iterator itor = m_ChatSetMap.begin(); itor != m_ChatSetMap.end(); ++itor)
    {
        -
        -
        -
    }
// add this

#ifdef ENABLE_GLOBAL_CHAT
    std::string const s = c_szChat;
    std::size_t EP1 = 0;
    std::size_t EP2 = 0;
    std::size_t EP3 = 0;

    CGraphicImageInstance *& prFlag = pChatLine->ImageInstance;

    std::string sub_s = s.substr(0, 1);
    if (iType == 6) {
        EP1 = sub_s.find_first_of("1");
        EP2 = sub_s.find_first_of("2");
        EP3 = sub_s.find_first_of("3");
    }
    else {
        EP1 = sub_s.find("!ยง$%&/(845945)=X");
        EP2 = sub_s.find("!ยง$%&/(845945)=X");
        EP3 = sub_s.find("!ยง$%&/(845945)=X");
    }

    if (EP1 != std::string::npos) {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/shinsoo.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/shinsoo.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }

    else if (EP2 != std::string::npos) {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/chunjo.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/chunjo.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }

    else if (EP3 != std::string::npos) {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/jinno.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/jinno.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }

    else {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/none.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/none.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }
#endif

(aqui esta arquivos pastabin do sistema que abaixei .)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(deixo meu arquivo modificado.)

PythonChat.ccp

void CPythonChat::UpdateViewMode(DWORD dwID)....

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

void CPythonChat::UpdateEditMode(DWORD dwID)....

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Spoiler

void CPythonChat::AppendChat(int iType, const char * c_szChat)
{
    if (strstr(c_szChat, "#ebvs"))
        return;
    //static CResource * s_pResource = CResourceManager::Instance().GetResourcePointer(g_strDefaultFontName.c_str());

    CGraphicText* pkDefaultFont = static_cast<CGraphicText*>(DefaultFont_GetResource());
    if (!pkDefaultFont)
    {
        TraceError("CPythonChat::AppendChat - CANNOT_FIND_DEFAULT_FONT");
        return;
    }
    // END_OF_DEFAULT_FONT

    IAbstractApplication& rApp=IAbstractApplication::GetSingleton();
    SChatLine * pChatLine = SChatLine::New();
    pChatLine->iType = iType;
    pChatLine->Instance.SetValue(c_szChat);

    // DEFAULT_FONT
    pChatLine->Instance.SetTextPointer(pkDefaultFont);
    // END_OF_DEFAULT_FONT

    pChatLine->fAppendedTime = rApp.GetGlobalTime();
    pChatLine->SetColorAll(GetChatColor(iType));

    m_ChatLineDeque.push_back(pChatLine);
    if (m_ChatLineDeque.size() > CHAT_LINE_MAX_NUM)
    {
        SChatLine * pChatLine = m_ChatLineDeque.front();
        SChatLine::Delete(pChatLine);
        m_ChatLineDeque.pop_front();
    }

    for (TChatSetMap::iterator itor = m_ChatSetMap.begin(); itor != m_ChatSetMap.end(); ++itor)
    {
        TChatSet * pChatSet = &(itor->second);
        //pChatLine->SetColor(itor->first, GetChatColor(iType));

        // Edit Mode ¸¦ ¾ïÁö·Î ³¢¿ö ¸ÂÃß±â À§ÇØ Ãß°¡
        if (BOARD_STATE_EDIT == pChatSet->m_iBoardState)
        {
            ArrangeShowingChat(itor->first);
        }
        else// if (BOARD_STATE_VIEW == pChatSet->m_iBoardState)
        {
            pChatSet->m_ShowingChatLineList.push_back(pChatLine);
            if (pChatSet->m_ShowingChatLineList.size() > CHAT_LINE_MAX_NUM)
            {
                pChatSet->m_ShowingChatLineList.pop_front();
            }
        }
    }
#ifdef ENABLE_GLOBAL_CHAT
    std::string const s = c_szChat;
    std::size_t EP1 = 0;
    std::size_t EP2 = 0;
    std::size_t EP3 = 0;

    CGraphicImageInstance *& prFlag = pChatLine->ImageInstance;

    std::string sub_s = s.substr(0, 1);
    if (iType == 6)
    {
        EP1 = sub_s.find_first_of("1");
        EP2 = sub_s.find_first_of("2");
        EP3 = sub_s.find_first_of("3");
    }
    else 
    {
        EP1 = sub_s.find("!§$%&/(845945)=X");
        EP2 = sub_s.find("!§$%&/(845945)=X");
        EP3 = sub_s.find("!§$%&/(845945)=X");
    }
    if (EP1 != std::string::npos)
    {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/shinsoo.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/shinsoo.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }
    else if (EP2 != std::string::npos)
    {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/chunjo.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/chunjo.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }
    else if (EP3 != std::string::npos)
    {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/jinno.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/jinno.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }
    else
    {

        if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/none.tga"))
        {
            CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/none.tga");
            if (pFlagImage)
            {
                prFlag = CGraphicImageInstance::New();
                prFlag->SetImagePointer(pFlagImage);
            }
        }
    }
#endif
}
 

 

 

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...