コード例 #1
0
ファイル: RASocket.cpp プロジェクト: mmihail/trinitycore10353
void RASocket::commandFinished(void* callbackArg, bool /*success*/)
{
    RASocket* raSocket = (RASocket*)callbackArg;
    raSocket->Sendf("TC>");
    uint64 remainingCommands = --raSocket->pendingCommands;

    if (remainingCommands == 0)
        raSocket->SetDeleteByHandler(true);
 }
コード例 #2
0
void RASocket::commandFinished(void* callbackArg, bool /*success*/)
{
    if (!callbackArg)
        return;

    RASocket* socket = static_cast<RASocket*>(callbackArg);
    ACE_Message_Block* mb = new ACE_Message_Block();
    mb->msg_type(ACE_Message_Block::MB_BREAK);
    if (socket->putq(mb) == -1)
    {
        sLog.outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
        mb->release();
    }
}
コード例 #3
0
ファイル: RASocket.cpp プロジェクト: Sar777/SkyFireEMU
void RASocket::zprint(void* callbackArg, const char * szText)
{
    if (!szText || !callbackArg)
        return;

    RASocket* socket = static_cast<RASocket*>(callbackArg);
    size_t sz = strlen(szText);

    ACE_Message_Block* mb = new ACE_Message_Block(sz);
    mb->copy(szText, sz);

    if (socket->putq(mb, const_cast<ACE_Time_Value*>(&ACE_Time_Value::zero)) == -1)
    {
        sLog->outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
        mb->release();
    }
}
コード例 #4
0
void RASocket::zprint(void* callbackArg, const char * szText)
{
    if (!szText || !callbackArg)
        return;

    RASocket* socket = static_cast<RASocket*>(callbackArg);
    size_t sz = strlen(szText);

    ACE_Message_Block* mb = new ACE_Message_Block(sz);
    mb->copy(szText, sz);

    ACE_Time_Value tv = ACE_Time_Value::zero;
    if (socket->putq(mb, &tv) == -1)
    {
        TC_LOG_DEBUG(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
        mb->release();
    }
}
コード例 #5
0
ファイル: RASocket.cpp プロジェクト: Bootz/DeepshjirRepack
void RASocket::commandFinished(void* callbackArg, bool /*success*/) {
	if (!callbackArg)
		return;

	RASocket* socket = static_cast<RASocket*>(callbackArg);

	ACE_Message_Block* mb = new ACE_Message_Block();

	mb->msg_type(ACE_Message_Block::MB_BREAK);

	// the message is 0 size control message to tell that command output is finished
	// hence we don't put timeout, because it shouldn't increase queue size and shouldn't block
	if (socket->putq(mb) == -1) {
		// getting here is bad, command can't be marked as complete
		sLog->outRemote("Failed to enqueue command end message. Error is %s",
				ACE_OS::strerror(errno));
		mb->release();
	}
}
コード例 #6
0
ファイル: RASocket.cpp プロジェクト: mynew4/Core-2
void RASocket::commandFinished(void* callbackArg, bool success)
{
    RASocket* raSocket = (RASocket*)callbackArg;
    raSocket->sendf("mangos>");
    raSocket->pendingCommands.release();
}
コード例 #7
0
void RASocket::commandFinished(void* callbackArg, bool /* success */ )
{
    RASocket* raSocket = (RASocket*)callbackArg;
    raSocket->SendString(CMANGOS_PROMPT);
}