Windows compile fixed and ao fixed I think...
This commit is contained in:
@@ -1304,7 +1304,7 @@ void CRijndael::Encrypt(char const* in, char* result, size_t n, int iMode)
|
||||
char* presult;
|
||||
if(CBC == iMode) //CBC mode, using the Chain
|
||||
{
|
||||
for(i=0,pin=in,presult=result; i<n/m_blockSize; i++)
|
||||
for(i=0,pin=in,presult=result; i<(int)n/m_blockSize; i++)
|
||||
{
|
||||
Xor(m_chain, pin);
|
||||
EncryptBlock(m_chain, presult);
|
||||
@@ -1315,7 +1315,7 @@ void CRijndael::Encrypt(char const* in, char* result, size_t n, int iMode)
|
||||
}
|
||||
else if(CFB == iMode) //CFB mode, using the Chain
|
||||
{
|
||||
for(i=0,pin=in,presult=result; i<n/m_blockSize; i++)
|
||||
for(i=0,pin=in,presult=result; i<(int)n/m_blockSize; i++)
|
||||
{
|
||||
EncryptBlock(m_chain, presult);
|
||||
Xor(presult, pin);
|
||||
@@ -1326,7 +1326,7 @@ void CRijndael::Encrypt(char const* in, char* result, size_t n, int iMode)
|
||||
}
|
||||
else //ECB mode, not using the Chain
|
||||
{
|
||||
for(i=0,pin=in,presult=result; i<n/m_blockSize; i++)
|
||||
for(i=0,pin=in,presult=result; i<(int)n/m_blockSize; i++)
|
||||
{
|
||||
EncryptBlock(pin, presult);
|
||||
pin += m_blockSize;
|
||||
@@ -1347,7 +1347,7 @@ void CRijndael::Decrypt(char const* in, char* result, size_t n, int iMode)
|
||||
char* presult;
|
||||
if(CBC == iMode) //CBC mode, using the Chain
|
||||
{
|
||||
for(i=0,pin=in,presult=result; i<n/m_blockSize; i++)
|
||||
for(i=0,pin=in,presult=result; i<(int)n/m_blockSize; i++)
|
||||
{
|
||||
DecryptBlock(pin, presult);
|
||||
Xor(presult, m_chain);
|
||||
@@ -1358,7 +1358,7 @@ void CRijndael::Decrypt(char const* in, char* result, size_t n, int iMode)
|
||||
}
|
||||
else if(CFB == iMode) //CFB mode, using the Chain, not using Decrypt()
|
||||
{
|
||||
for(i=0,pin=in,presult=result; i<n/m_blockSize; i++)
|
||||
for(i=0,pin=in,presult=result; i<(int)n/m_blockSize; i++)
|
||||
{
|
||||
EncryptBlock(m_chain, presult);
|
||||
//memcpy(presult, pin, m_blockSize);
|
||||
@@ -1370,7 +1370,7 @@ void CRijndael::Decrypt(char const* in, char* result, size_t n, int iMode)
|
||||
}
|
||||
else //ECB mode, not using the Chain
|
||||
{
|
||||
for(i=0,pin=in,presult=result; i<n/m_blockSize; i++)
|
||||
for(i=0,pin=in,presult=result; i<(int)n/m_blockSize; i++)
|
||||
{
|
||||
DecryptBlock(pin, presult);
|
||||
pin += m_blockSize;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
#include "linden_common.h"
|
||||
#include "llimagemetadatareader.h"
|
||||
#include "aes.h"
|
||||
#include "llapr.h"
|
||||
#include "llerror.h"
|
||||
const char EMKDU_AES_KEY[] = {0x01,0x00,0x81,0x07,0x63,0x78,0xB6,0xFE,0x6E,0x3F,0xB0,0x12,0xCC,0x65,0x66,0xC1,
|
||||
//#include "llapr.h"
|
||||
//#include "llerror.h"
|
||||
const unsigned char EMKDU_AES_KEY[] = {0x01,0x00,0x81,0x07,0x63,0x78,0xB6,0xFE,0x6E,0x3F,0xB0,0x12,0xCC,0x65,0x66,0xC1,
|
||||
0x81,0x96,0xAC,0xC1,0x3B,0x66,0x0B,0xF7};
|
||||
//#define COMMENT_DEBUGG1ING
|
||||
LLJ2cParser::LLJ2cParser(U8* data,int data_size)
|
||||
@@ -146,7 +146,7 @@ unsigned int LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size
|
||||
CRijndael aes;
|
||||
try
|
||||
{
|
||||
aes.MakeKey(EMKDU_AES_KEY,"", 24, 16);
|
||||
aes.MakeKey(reinterpret_cast<const char*>(EMKDU_AES_KEY),"", 24, 16);
|
||||
} catch(std::string error)
|
||||
{
|
||||
llinfos << error << llendl;
|
||||
|
||||
@@ -8,13 +8,17 @@
|
||||
#include "llsdserialize.h"
|
||||
#include "llagent.h"
|
||||
#include "llvoavatar.h"
|
||||
//this is for debugging ;D
|
||||
//#define AO_DEBUG
|
||||
|
||||
//static variables
|
||||
std::list<LLUUID> LLAO::mStandOverrides;
|
||||
std::map<LLUUID,LLUUID> LLAO::mOverrides;
|
||||
LLFloaterAO* LLFloaterAO::sInstance;
|
||||
BOOL LLAO::mEnabled = FALSE;
|
||||
F32 LLAO::mPeriod;
|
||||
LLAOStandTimer* LLAO::mTimer = NULL;
|
||||
S32 LLAO::playingStands = 0;
|
||||
|
||||
LLAOStandTimer::LLAOStandTimer(F32 period) : LLEventTimer(period)
|
||||
{
|
||||
@@ -23,6 +27,9 @@ BOOL LLAOStandTimer::tick()
|
||||
{
|
||||
if(!mPaused && LLAO::isEnabled() && !LLAO::mStandOverrides.empty())
|
||||
{
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "tick" << llendl;
|
||||
#endif
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if (avatarp)
|
||||
{
|
||||
@@ -35,7 +42,13 @@ BOOL LLAOStandTimer::tick()
|
||||
{
|
||||
//back is always last played, front is next
|
||||
avatarp->stopMotion(LLAO::mStandOverrides.back());
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Stopping " << LLAO::mStandOverrides.back().asString() << llendl;
|
||||
#endif
|
||||
avatarp->startMotion(LLAO::mStandOverrides.front());
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Starting " << LLAO::mStandOverrides.front().asString() << llendl;
|
||||
#endif
|
||||
LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front());
|
||||
LLAO::mStandOverrides.pop_front();
|
||||
LLFloaterAO* ao = LLFloaterAO::sInstance;
|
||||
@@ -54,6 +67,9 @@ BOOL LLAOStandTimer::tick()
|
||||
void LLAOStandTimer::pause()
|
||||
{
|
||||
if(mPaused) return;
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Pausing AO Timer...." << llendl;
|
||||
#endif
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if (avatarp)
|
||||
{
|
||||
@@ -68,6 +84,9 @@ void LLAOStandTimer::pause()
|
||||
void LLAOStandTimer::resume()
|
||||
{
|
||||
if(!mPaused) return;
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Unpausing AO Timer...." << llendl;
|
||||
#endif
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if (avatarp)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ class LLAO
|
||||
{
|
||||
public:
|
||||
static void setup();
|
||||
static S32 playingStands;
|
||||
static std::map<LLUUID,LLUUID> mOverrides;
|
||||
static std::list<LLUUID> mStandOverrides;
|
||||
static BOOL isEnabled(){ return mEnabled; }
|
||||
|
||||
@@ -5163,7 +5163,9 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
|
||||
{
|
||||
if(LLAO::isStand(id))
|
||||
{
|
||||
LLAO::mTimer->resume();
|
||||
if(LLAO::playingStands == 0)
|
||||
LLAO::mTimer->resume();//Timer only resumes if its paused, check is inside function.
|
||||
LLAO::playingStands++;
|
||||
}
|
||||
if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||
{
|
||||
@@ -5211,10 +5213,12 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
||||
// <edit>
|
||||
if(LLAO::isEnabled())
|
||||
{
|
||||
if(LLAO::isStand(id))
|
||||
if(LLAO::isStand(id) && LLAO::playingStands > 0) //LLAO::playingStands > 0 stops it from going negative
|
||||
{
|
||||
//help the timer get started again
|
||||
LLAO::mTimer->pause();
|
||||
LLAO::playingStands--;
|
||||
if(LLAO::playingStands == 0)
|
||||
LLAO::mTimer->pause();//Timer only pauses if its not paused, check is inside function.
|
||||
}
|
||||
if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||
&& (id != LLAO::mOverrides[id]) )
|
||||
|
||||
Reference in New Issue
Block a user