示例#1
0
文件: Spy.cpp 项目: beyondlwm/Beats
bool Spy_SendMessageCommand(SOCKET sock, const TCHAR* pszMsg, const TCHAR* pszCapital)
{
    bool bRet = false;
    CSpyCommandMessageBox cmd;
    cmd.SetMessage(pszMsg);
    cmd.SetCaption(pszCapital);
    SharePtr<SSocketContext> socketContent = CSpyManager::GetInstance()->GetSocket(sock);
    BEATS_ASSERT(socketContent.Get() != NULL, _T("Invalid socket!"));
    if (socketContent.Get() != NULL)
    {
        bRet = CSpyCommandManager::GetInstance()->SendCommand(socketContent, &cmd);
    }
    return bRet;
}
示例#2
0
文件: Spy.cpp 项目: beyondlwm/Beats
bool Spy_SendFileInfoCommand(SOCKET sock, const TCHAR* pszCmd, TFileInfoFeedbackFunc pFeedbackFunc, void* pUserData)
{
    bool bRet = false;
    CSpyCommandGetFileInfo cmd;
    cmd.SetFeedBackFuncAddr((uint32_t)pFeedbackFunc, (uint32_t)pUserData);
    cmd.SetFileName(pszCmd);
    SharePtr<SSocketContext> socketContent = CSpyManager::GetInstance()->GetSocket(sock);
    BEATS_ASSERT(socketContent.Get() != NULL, _T("Invalid socket!"));
    if (socketContent.Get() != NULL)
    {
        bRet = CSpyCommandManager::GetInstance()->SendCommand(socketContent, &cmd);
    }
    return bRet;
}
示例#3
0
文件: Spy.cpp 项目: beyondlwm/Beats
bool Spy_UploadFiles(SOCKET sock, const std::vector<TString>& files, const TString& strStorePath, CFileFilter* pFilter)
{
    bool bRet = false;
    CSpyCommandUploadFile cmd;
    cmd.SetUploadFile(files);
    cmd.SetStorePath(strStorePath.c_str());
    cmd.SetFileFilter(pFilter);
    SharePtr<SSocketContext> socketContent = CSpyManager::GetInstance()->GetSocket(sock);
    BEATS_ASSERT(socketContent.Get() != NULL, _T("Invalid socket!"));
    if (socketContent.Get() != NULL)
    {
        bRet = CSpyCommandManager::GetInstance()->SendCommand(socketContent, &cmd);
    }
    return bRet;
}
示例#4
0
CTextureFrag *CTextureAtlas::CreateTextureFrag(const TString &name, kmVec2 point, kmVec2 size)
{
    BEATS_ASSERT(m_textureFrags.find(name) == m_textureFrags.end());
    SharePtr<CResource> pSelf;
    CResourceManager::GetInstance()->QueryResource(GetFilePath(), pSelf);
    BEATS_ASSERT(pSelf.Get() == this);
    CTextureFrag *frag = new CTextureFrag(name, pSelf, point, size);
    m_textureFrags[name] = frag;
    return frag;
}
示例#5
0
文件: Spy.cpp 项目: beyondlwm/Beats
const SBeatsSocket* Spy_Connect(uint32_t uIPAddress)
{
    const SBeatsSocket* pRet = NULL;
    SOCKET socket = Beats_CreateSocket(SOCK_STREAM, 0);
    BEATS_ASSERT(socket != INVALID_SOCKET, _T("Create socket failed!"));
    if (socket != INVALID_SOCKET)
    {
        sockaddr_in address_in;
        memset(&address_in, 0, sizeof(address_in));
        address_in.sin_family = AF_INET;
        address_in.sin_port = htons(SPY_DEFAULT_PORT);
        address_in.sin_addr.S_un.S_addr = uIPAddress;
        SharePtr<SSocketContext> pContext = CSpyManager::GetInstance()->ConnectToSpy(socket, &address_in, true);
        if (pContext.Get() != NULL)
        {
            pRet = Beats_GetSockInfo(pContext->m_socket);
        }
    }
    return pRet;
}