remove POKE and improve item animation

master
Henrique 13 years ago
parent 1406e23c23
commit b05bb7818d

@ -24,7 +24,6 @@
#define OTCLIENT_CONST_H
#include <framework/util/color.h>
//#define POKE
namespace Otc
{
@ -43,24 +42,16 @@ namespace Otc
"6207862794310902180176810615217550567108238764764442605581471797"
"07119674283982419152118103759076030616683978566631413";
#ifdef POKE
static const int ClientVersion = 810;
static const int PicSignature = 0x4D407EF6;
static const char* Host = "pxg01.loginto.me";
static const int HostPort = 7171;
#else
static const int ClientVersion = 862;
static const int PicSignature = 0x4E119CBF;
static const char* Host = "sv3.radbr.com";
static const int HostPort = 7171;
#endif
enum OsTypes {
OsWindow = 1,
OsLinux = 2,
OsMac = 3,
OsBrowser = 4,
OsPoke = 9
OsBrowser = 4
};
enum DatOpts {
@ -72,9 +63,6 @@ namespace Otc
DatStackable,
DatForceUse,
DatMultiUse,
#ifdef POKE
DatRunes,
#endif
DatWritable,
DatWritableOnce,
DatFluidContainer,

@ -36,7 +36,8 @@ void Item::draw(int x, int y)
{
const ThingType& type = g_thingsType.getItemType(m_id);
m_animation = (g_platform.getTicks() % (500 * type.animationPhases)) / 500;
if(type.animationPhases > 1)
m_animation = (g_platform.getTicks() % (TICKS_PER_FRAME * type.animationPhases)) / TICKS_PER_FRAME;
/*if(type.group == Otc::ThingSplashGroup || type.group == Otc::ThingFluidGroup) {
//xPattern = m_count % type.xPattern;

@ -31,6 +31,10 @@ class Item : public Thing
public:
Item();
enum {
TICKS_PER_FRAME = 500
};
void draw(int x, int y);
void setCount(int count);

@ -104,10 +104,6 @@ void ThingsType::parseThingType(std::stringstream& fin, ThingType& thingType)
case Otc::DatMultiUse: // Usable items
thingType.isMultiUse = true;
break;
#ifdef POKE
case Otc::DatRunes:
break;
#endif
case Otc::DatWritable: // Writable
thingType.isWritable = true;
thingType.maxTextLength = Fw::getU16(fin);

@ -28,7 +28,7 @@ void ProtocolGame::sendLoginPacket(uint32 timestamp, uint8 unknown)
OutputMessage oMsg;
oMsg.addU8(Otc::ClientEnterGame);
oMsg.addU16(Otc::OsPoke);
oMsg.addU16(Otc::OsLinux);
oMsg.addU16(Otc::ClientVersion);
oMsg.addU8(0); // first RSA byte must be 0

@ -30,9 +30,7 @@
ProtocolLogin::ProtocolLogin()
{
#ifndef POKE
enableChecksum();
#endif
}
void ProtocolLogin::login(const std::string& accountName, const std::string& accountPassword)
@ -84,30 +82,6 @@ void ProtocolLogin::sendLoginPacket()
{
OutputMessage oMsg;
#ifdef POKE
oMsg.addU8(Otc::ClientEnterAccount);
oMsg.addU16(Otc::OsPoke);
oMsg.addU16(Otc::ClientVersion);
oMsg.addU32(g_thingsType.getSignature()); // data signature
oMsg.addU32(g_sprites.getSignature()); // sprite signature
oMsg.addU32(Otc::PicSignature); // pic signature
oMsg.addU8(0); // first RSA byte must be 0
// xtea key
generateXteaKey();
oMsg.addU32(m_xteaKey[0]);
oMsg.addU32(m_xteaKey[1]);
oMsg.addU32(m_xteaKey[2]);
oMsg.addU32(m_xteaKey[3]);
oMsg.addU32(Fw::unsafeCast<int>(m_accountName));
oMsg.addString(m_accountPassword);
// complete the 128 bytes for rsa encryption with zeros
oMsg.addPaddingBytes(128 - (23 + m_accountPassword.length()));
#else
oMsg.addU8(Otc::ClientEnterAccount);
oMsg.addU16(Otc::OsLinux);
oMsg.addU16(Otc::ClientVersion);
@ -130,7 +104,6 @@ void ProtocolLogin::sendLoginPacket()
// complete the 128 bytes for rsa encryption with zeros
oMsg.addPaddingBytes(128 - (21 + m_accountName.length() + m_accountPassword.length()));
#endif
if(!Rsa::encrypt((char*)oMsg.getBuffer() + InputMessage::DATA_POS + oMsg.getMessageSize() - 128, 128, Otc::OtservPublicRSA))
return;

Loading…
Cancel
Save