• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Random Place player freezing

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Hi
I have problem with some random places on map when player get to range of some position he freez with error on terminal :

ERROR: invalid encrypted network message
at:
[C++]: Protocol::xteaDecrypt
ERROR: failed to decrypt message
at:
[C++]: Protocol::internalRecvData

Can someone say its problem in otc , tfs or maybe some kind of broken map ? I deleted all items in place but still the same ! Please fast help becouse i must to manualy change position on bugged players. Thank You!
 
Hi
I have problem with some random places on map when player get to range of some position he freez with error on terminal :

ERROR: invalid encrypted network message
at:
[C++]: Protocol::xteaDecrypt
ERROR: failed to decrypt message
at:
[C++]: Protocol::internalRecvData

Can someone say its problem in otc , tfs or maybe some kind of broken map ? I deleted all items in place but still the same ! Please fast help becouse i must to manualy change position on bugged players. Thank You!

Did you increased your screen tiles? Be more specific.
 
yeah i have 12/14 tiles i also added more inventory slots, skull, icons, skills, effects but i compiled the newest otclient with changed only map range tiles and still get the same error. I think the problem start after i add more tiles to source becouse the quests that were works good before after no changing anything on map dont works now. I have 0.3.6 tfs and the problem is when player teleport/walk/changefloor in range of buged position and only on one floor but bugs floor is random same as positions. Player after first logout cant enter just stop on connecting to game server window but there is a massage in console that player has been logged in
 
Last edited:
yeah i have 12/14 tiles i also added more inventory slots, skull, icons, skills, effects but i compiled the newest otclient with changed only map range tiles and still get the same error. I think the problem start after i add more tiles to source becouse the quests that were works good before after no changing anything on map dont works now. I have 0.3.6 tfs and the problem is when player teleport/walk/changefloor in range of buged position and only on one floor but bugs floor is random same as positions. Player after first logout cant enter just stop on connecting to game server window but there is a massage in console that player has been logged in

You are using 0.3.6 TFS? or 1.1+ ? (When you will answer me, click on Reply, then Ill be noticed, if not I may take a while to answer you.)
 
You are using 0.3.6 TFS? or 1.1+ ? (When you will answer me, click on Reply, then Ill be noticed, if not I may take a while to answer you.)
i already said that man :D I have 0.3.6 tfs and i fixed the double ViewportX line. The bug is only on one floor of position now i have bugs on floors like 3,6,7,8,11
 
i already said that man :D I have 0.3.6 tfs and i fixed the double ViewportX line. The bug is only on one floor of position now i have bugs on floors like 3,6,7,8,11

Well, did you found out that the MoveCreatureUp and Down aren't called when you change floors? You are teletransported instead?
 
i already said that man :D I have 0.3.6 tfs and i fixed the double ViewportX line. The bug is only on one floor of position now i have bugs on floors like 3,6,7,8,11

Well, to be more specific. I believe you don't have to change anything in the server sources file, if you want to change it back. Open you OTClient sources and look for this string: "failed to decrypt message", or look for the function xteaDecrypt at Protocol.cpp. Its probably blocking the message for being higher than the value estimated at that function. I believe this should do.
 
Well, to be more specific. I believe you don't have to change anything in the server sources file, if you want to change it back. Open you OTClient sources and look for this string: "failed to decrypt message", or look for the function xteaDecrypt at Protocol.cpp. Its probably blocking the message for being higher than the value estimated at that function. I believe this should do.

I dont had that in my otc source but i found and download newest one and removed this return false in decrypt and it realy helped, NICE ! :D ( i firstly modify encryptedSize to uint32 but dont change anything) It was good i removed this or should i modify this line to dont make another bugs ?
Code:
    if(encryptedSize % 8 != 0) {
        g_logger.traceError("invalid encrypted network message");
        return false;
    }
Thank you very much for helping :)
 
I dont had that in my otc source but i found and download newest one and removed this return false in decrypt and it realy helped, NICE ! :D ( i firstly modify encryptedSize to uint32 but dont change anything) It was good i removed this or should i modify this line to dont make another bugs ?
Code:
    if(encryptedSize % 8 != 0) {
        g_logger.traceError("invalid encrypted network message");
        return false;
    }
Thank you very much for helping :)

Well, I can't tell you if its good or bad to remove it. But I believe that if you set a lower value than 8 at the statement it may works. Though I don't believe its necessary, it's better to remove at the moment.
 
Well, I can't tell you if its good or bad to remove it. But I believe that if you set a lower value than 8 at the statement it may works. Though I don't believe its necessary, it's better to remove at the moment.
I already got some errors in terminal like
Code:
at:
    [C++]: ProtocolGame::parseCreatureMove
ERROR: no thing at pos:670 1003 7, stackpos:1
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no creature found to move
at:
    [C++]: ProtocolGame::parseCreatureMove
ERROR: no thing at pos:670 1002 7, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileRemoveThing
ERROR: server said that a creature is known, but it's not
at:

ERROR: ProtocolGame parse message exception (0 bytes unread, last opcode is 100, prev opcode is 108): unable to create item with invalid id 27392
ERROR: ProtocolGame parse message exception (1 bytes unread, last opcode is 100, prev opcode is 108): InputMessage eof reached
ERROR: ProtocolGame parse message exception (1 bytes unread, last opcode is 100, prev opcode is 108): InputMessage eof reached
ERROR: server said that a creature is known, but it's not
at:
    [C++]: ProtocolGame::getCreature
i get this only on bugged positions
 
I already got some errors in terminal like
Code:
at:
    [C++]: ProtocolGame::parseCreatureMove
ERROR: no thing at pos:670 1003 7, stackpos:1
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no creature found to move
at:
    [C++]: ProtocolGame::parseCreatureMove
ERROR: no thing at pos:670 1002 7, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileRemoveThing
ERROR: server said that a creature is known, but it's not
at:

ERROR: ProtocolGame parse message exception (0 bytes unread, last opcode is 100, prev opcode is 108): unable to create item with invalid id 27392
ERROR: ProtocolGame parse message exception (1 bytes unread, last opcode is 100, prev opcode is 108): InputMessage eof reached
ERROR: ProtocolGame parse message exception (1 bytes unread, last opcode is 100, prev opcode is 108): InputMessage eof reached
ERROR: server said that a creature is known, but it's not
at:
    [C++]: ProtocolGame::getCreature
i get this only on bugged positions

Maybe this item ID is bugging your location:
unable to create item with invalid id 27392
 
Maybe this item ID is bugging your location:
unable to create item with invalid id 27392
but the problem is that i get everytime different item id even 50k+ and my last item have only 12000 number. I saw the problems like
Code:
ERROR: ProtocolGame parse message exception (0 bytes unread, last opcode is 100, prev opcode is 108): unable to create item with invalid id 27392
ERROR: ProtocolGame parse message exception (1 bytes unread, last opcode is 100, prev opcode is 108): InputMessage eof reached
pops up when player is teleporting and this when moving player
Code:
ERROR: server said that a creature is known, but it's not
at:
    [C++]: ProtocolGame::getCreature
and also i get some wierd floor fusions like this
Bez_nazwy3_Kopia.png

and when i stand near mountain i see only on down and right last pack of tiles someting like this
Bez_nazwy3.png

only on bugged quest map
 
but the problem is that i get everytime different item id even 50k+ and my last item have only 12000 number. I saw the problems like
Code:
ERROR: ProtocolGame parse message exception (0 bytes unread, last opcode is 100, prev opcode is 108): unable to create item with invalid id 27392
ERROR: ProtocolGame parse message exception (1 bytes unread, last opcode is 100, prev opcode is 108): InputMessage eof reached
pops up when player is teleporting and this when moving player
Code:
ERROR: server said that a creature is known, but it's not
at:
    [C++]: ProtocolGame::getCreature
and also i get some wierd floor fusions like this
Bez_nazwy3_Kopia.png

and when i stand near mountain i see only on down and right last pack of tiles someting like this
Bez_nazwy3.png

only on bugged quest map

Well Maybe the problem ins't related to items, but to the loading of the floors. Did you changed anything at the server sources related to it ? I mean, is it original sources? Also, There's any new sprite there that other areas don't?
 
Well Maybe the problem ins't related to items, but to the loading of the floors. Did you changed anything at the server sources related to it ? I mean, is it original sources? Also, There's any new sprite there that other areas don't?
Yeah i base on original source 0.3.6 but i work on it like year i add much things into source i cant check it on clean source. I found a different between original source and mine i fix lines is it good now?
original
Code:
    //moving down a floor makes us out of sync
    //east
    msg->AddByte(0x66);
    GetMapDescription(oldPos.x + 9, oldPos.y - 1 - 6, newPos.z, 1, 14, msg);

    //south
    msg->AddByte(0x67);
    GetMapDescription(oldPos.x - 8, oldPos.y + 7, newPos.z, 18, 1, msg);
}
Code:
    //moving down a floor makes us out of sync
    //east
    msg->AddByte(0x66);
    GetMapDescription(oldPos.x + (Map::maxClientViewportX + 1), oldPos.y - (Map::maxClientViewportY + 1), newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);

    //south
    msg->AddByte(0x67);
    GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
I checked all pos.x in protocolgame.cpp and they are now all good but still i have same errors and problems also i saw sometimes the creatures are some kind of invisible(they shouldnt) and they block path also can be look. Sometimes it removes the tiles like that, only south east side

Bez_nazwy3_Kopia.png

and send the random item sprite but it only sprite i cant look on that item also when i move/teleport it removes
Bez_nazwy3.png
 
Last edited:
Yeah i base on original source 0.3.6 but i work on it like year i add much things into source i cant check it on clean source. I found a different between original source and mine i fix lines is it good now?
original
Code:
    //moving down a floor makes us out of sync
    //east
    msg->AddByte(0x66);
    GetMapDescription(oldPos.x + 9, oldPos.y - 1 - 6, newPos.z, 1, 14, msg);

    //south
    msg->AddByte(0x67);
    GetMapDescription(oldPos.x - 8, oldPos.y + 7, newPos.z, 18, 1, msg);
}
Code:
    //moving down a floor makes us out of sync
    //east
    msg->AddByte(0x66);
    GetMapDescription(oldPos.x + (Map::maxClientViewportX + 1), oldPos.y - (Map::maxClientViewportY + 1), newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);

    //south
    msg->AddByte(0x67);
    GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
I checked all pos.x in protocolgame.cpp and they are now all good but still i have same errors and problems also i saw sometimes the creatures are some kind of invisible(they shouldnt) and they block path also can be look. Sometimes it removes the tiles like that, only south east side

Bez_nazwy3_Kopia.png

and send the random item sprite but it only sprite i cant look on that item also when i move/teleport it removes
Bez_nazwy3.png

Can you show me your protocolgame function sendCreatureMove?
 
Can you show me your protocolgame function sendCreatureMove?
Code:
void ProtocolGame::sendMoveCreature(const Creature* creature, const Tile* newTile, const Position& newPos,
    uint32_t newStackpos, const Tile* oldTile, const Position& oldPos, uint32_t oldStackpos, bool teleport)
{
    if(creature == player)
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(teleport || oldStackpos >= 10)
            {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddMapDescription(msg, newPos);
            }
            else
            {
                if(oldPos.z != 7 || newPos.z < 8)
                {
                    msg->AddByte(0x6D);
                    msg->AddPosition(oldPos);
                    msg->AddByte(oldStackpos);
                    msg->AddPosition(newPos);
                }
                else
                    RemoveTileItem(msg, oldPos, oldStackpos);

                if(newPos.z > oldPos.z)
                    MoveDownCreature(msg, creature, newPos, oldPos, oldStackpos);
                else if(newPos.z < oldPos.z)
                    MoveUpCreature(msg, creature, newPos, oldPos, oldStackpos);

                if(oldPos.y > newPos.y) // north, for old x
                {
                    msg->AddByte(0x65);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }
                else if(oldPos.y < newPos.y) // south, for old x
                {
                    msg->AddByte(0x67);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }

                if(oldPos.x < newPos.x) // east, [with new y]
                {
                    msg->AddByte(0x66);
                    GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
                else if(oldPos.x > newPos.x) // west, [with new y]
                {
                    msg->AddByte(0x68);
                    GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
            }
        }
    }
    else if(canSee(oldPos) && canSee(newPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(!teleport && (oldPos.z != 7 || newPos.z < 8) && oldStackpos < 10)
            {
                msg->AddByte(0x6D);
                msg->AddPosition(oldPos);
                msg->AddByte(oldStackpos);
                msg->AddPosition(newPos);
            }
            else
            {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddTileCreature(msg, newPos, newStackpos, creature);
            }
        }
    }
    else if(canSee(oldPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            RemoveTileItem(msg, oldPos, oldStackpos);
        }
    }
    else if(canSee(newPos) && player->canSeeCreature(creature))
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            AddTileCreature(msg, newPos, newStackpos, creature);
        }
    }
}
 
Code:
void ProtocolGame::sendMoveCreature(const Creature* creature, const Tile* newTile, const Position& newPos,
    uint32_t newStackpos, const Tile* oldTile, const Position& oldPos, uint32_t oldStackpos, bool teleport)
{
    if(creature == player)
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(teleport || oldStackpos >= 10)
            {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddMapDescription(msg, newPos);
            }
            else
            {
                if(oldPos.z != 7 || newPos.z < 8)
                {
                    msg->AddByte(0x6D);
                    msg->AddPosition(oldPos);
                    msg->AddByte(oldStackpos);
                    msg->AddPosition(newPos);
                }
                else
                    RemoveTileItem(msg, oldPos, oldStackpos);

                if(newPos.z > oldPos.z)
                    MoveDownCreature(msg, creature, newPos, oldPos, oldStackpos);
                else if(newPos.z < oldPos.z)
                    MoveUpCreature(msg, creature, newPos, oldPos, oldStackpos);

                if(oldPos.y > newPos.y) // north, for old x
                {
                    msg->AddByte(0x65);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }
                else if(oldPos.y < newPos.y) // south, for old x
                {
                    msg->AddByte(0x67);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }

                if(oldPos.x < newPos.x) // east, [with new y]
                {
                    msg->AddByte(0x66);
                    GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
                else if(oldPos.x > newPos.x) // west, [with new y]
                {
                    msg->AddByte(0x68);
                    GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
            }
        }
    }
    else if(canSee(oldPos) && canSee(newPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(!teleport && (oldPos.z != 7 || newPos.z < 8) && oldStackpos < 10)
            {
                msg->AddByte(0x6D);
                msg->AddPosition(oldPos);
                msg->AddByte(oldStackpos);
                msg->AddPosition(newPos);
            }
            else
            {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddTileCreature(msg, newPos, newStackpos, creature);
            }
        }
    }
    else if(canSee(oldPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            RemoveTileItem(msg, oldPos, oldStackpos);
        }
    }
    else if(canSee(newPos) && player->canSeeCreature(creature))
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            AddTileCreature(msg, newPos, newStackpos, creature);
        }
    }
}

Could you try that?
Code:
void ProtocolGame::sendMoveCreature(const Creature* creature, const Tile* newTile, const Position& newPos,
    uint32_t newStackpos, const Tile* oldTile, const Position& oldPos, uint32_t oldStackpos, bool teleport)
{
    if(creature == player)
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(teleport || oldStackpos >= 10)
              {
                    //New Code
                 if (newPos.z > oldPos.z && newPos.z - oldPos.z == 1) {
                  msg.AddByte(0x6D);
                  msg.AddPosition(oldPos);
                  msg.AddByte(oldStackPos);
                  msg.AddPosition(newPos);
                  std::cout << "MoveDownCreature called" << std::endl;
                  MoveDownCreature(msg, creature, newPos, oldPos);
                 }
               else if (newPos.z < oldPos.z && oldPos.z - newPos.z == 1) {
                   msg.AddByte(0x6D);
                   msg.AddPosition(oldPos);
                   msg.AddByte(oldStackPos);
                   msg.AddPosition(newPos);
                  std::cout << "MoveUpCreature called" << std::endl;
                  MoveUpCreature(msg, creature, newPos, oldPos);
               }
               else {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddMapDescription(msg, newPos);
                 }
                //End of New Code

               //Old Code
                //RemoveTileItem(msg, oldPos, oldStackpos);
                //AddMapDescription(msg, newPos); 
            }
            else
            {
                if(oldPos.z != 7 || newPos.z < 8)
                {
                    msg->AddByte(0x6D);
                    msg->AddPosition(oldPos);
                    msg->AddByte(oldStackpos);
                    msg->AddPosition(newPos);
                }
                else
                    RemoveTileItem(msg, oldPos, oldStackpos);

                if(newPos.z > oldPos.z)
                    MoveDownCreature(msg, creature, newPos, oldPos, oldStackpos);
                else if(newPos.z < oldPos.z)
                    MoveUpCreature(msg, creature, newPos, oldPos, oldStackpos);

                if(oldPos.y > newPos.y) // north, for old x
                {
                    msg->AddByte(0x65);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }
                else if(oldPos.y < newPos.y) // south, for old x
                {
                    msg->AddByte(0x67);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }

                if(oldPos.x < newPos.x) // east, [with new y]
                {
                    msg->AddByte(0x66);
                    GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
                else if(oldPos.x > newPos.x) // west, [with new y]
                {
                    msg->AddByte(0x68);
                    GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
            }
        }
    }
    else if(canSee(oldPos) && canSee(newPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(!teleport && (oldPos.z != 7 || newPos.z < 8) && oldStackpos < 10)
            {
                msg->AddByte(0x6D);
                msg->AddPosition(oldPos);
                msg->AddByte(oldStackpos);
                msg->AddPosition(newPos);
            }
            else
            {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddTileCreature(msg, newPos, newStackpos, creature);
            }
        }
    }
    else if(canSee(oldPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            RemoveTileItem(msg, oldPos, oldStackpos);
        }
    }
    else if(canSee(newPos) && player->canSeeCreature(creature))
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            AddTileCreature(msg, newPos, newStackpos, creature);
        }
    }
}
 
Could you try that?
Code:
void ProtocolGame::sendMoveCreature(const Creature* creature, const Tile* newTile, const Position& newPos,
    uint32_t newStackpos, const Tile* oldTile, const Position& oldPos, uint32_t oldStackpos, bool teleport)
{
    if(creature == player)
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(teleport || oldStackpos >= 10)
              {
                    //New Code
                 if (newPos.z > oldPos.z && newPos.z - oldPos.z == 1) {
                  msg.AddByte(0x6D);
                  msg.AddPosition(oldPos);
                  msg.AddByte(oldStackPos);
                  msg.AddPosition(newPos);
                  std::cout << "MoveDownCreature called" << std::endl;
                  MoveDownCreature(msg, creature, newPos, oldPos);
                 }
               else if (newPos.z < oldPos.z && oldPos.z - newPos.z == 1) {
                   msg.AddByte(0x6D);
                   msg.AddPosition(oldPos);
                   msg.AddByte(oldStackPos);
                   msg.AddPosition(newPos);
                  std::cout << "MoveUpCreature called" << std::endl;
                  MoveUpCreature(msg, creature, newPos, oldPos);
               }
               else {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddMapDescription(msg, newPos);
                 }
                //End of New Code

               //Old Code
                //RemoveTileItem(msg, oldPos, oldStackpos);
                //AddMapDescription(msg, newPos);
            }
            else
            {
                if(oldPos.z != 7 || newPos.z < 8)
                {
                    msg->AddByte(0x6D);
                    msg->AddPosition(oldPos);
                    msg->AddByte(oldStackpos);
                    msg->AddPosition(newPos);
                }
                else
                    RemoveTileItem(msg, oldPos, oldStackpos);

                if(newPos.z > oldPos.z)
                    MoveDownCreature(msg, creature, newPos, oldPos, oldStackpos);
                else if(newPos.z < oldPos.z)
                    MoveUpCreature(msg, creature, newPos, oldPos, oldStackpos);

                if(oldPos.y > newPos.y) // north, for old x
                {
                    msg->AddByte(0x65);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }
                else if(oldPos.y < newPos.y) // south, for old x
                {
                    msg->AddByte(0x67);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }

                if(oldPos.x < newPos.x) // east, [with new y]
                {
                    msg->AddByte(0x66);
                    GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
                else if(oldPos.x > newPos.x) // west, [with new y]
                {
                    msg->AddByte(0x68);
                    GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
            }
        }
    }
    else if(canSee(oldPos) && canSee(newPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            if(!teleport && (oldPos.z != 7 || newPos.z < 8) && oldStackpos < 10)
            {
                msg->AddByte(0x6D);
                msg->AddPosition(oldPos);
                msg->AddByte(oldStackpos);
                msg->AddPosition(newPos);
            }
            else
            {
                RemoveTileItem(msg, oldPos, oldStackpos);
                AddTileCreature(msg, newPos, newStackpos, creature);
            }
        }
    }
    else if(canSee(oldPos))
    {
        if(!player->canSeeCreature(creature))
            return;

        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            RemoveTileItem(msg, oldPos, oldStackpos);
        }
    }
    else if(canSee(newPos) && player->canSeeCreature(creature))
    {
        NetworkMessage_ptr msg = getOutputBuffer();
        if(msg)
        {
            TRACK_MESSAGE(msg);
            AddTileCreature(msg, newPos, newStackpos, creature);
        }
    }
}
i have to change msg. to msg-> and add for moveupcreature and movedowncreature oldstackpos to compile but it dont helped only i get msg in console and new problems i sometimes see the other map or just all tiles black and i need to teleport to make it good also get some new errors
Code:
forced player position update
ERROR: no thing at pos:589 670 8, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileTransformThing
ERROR: no thing at pos:589 670 8, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileRemoveThing
i also tried to remove oldstackpos in movecreature up and down but it dont change anything becouse it wasnt even used in functions :D
 
Last edited:
i have to change msg. to msg-> and add for moveupcreature and movedowncreature oldstackpos to compile but it dont helped only i get msg in console and new problems i sometimes see the other map or just all tiles black and i need to teleport to make it good also get some new errors
Code:
forced player position update
ERROR: no thing at pos:589 670 8, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileTransformThing
ERROR: no thing at pos:589 670 8, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileRemoveThing
i also tried to remove oldstackpos in movecreature up and down but it dont change anything becouse it wasnt even used in functions :D

Allright then, look, I believe the error is a at the communication between server and client. "But what do you mean?" I mean that the way that the server is building up the message is different than the way the OTC is reading. I assume that an update to all files that are involved at this communication should be updated. That's what fixed my errors, and may fix up yours. Look, I took 3 months to solve this error, like this. But your error now is different than mine, then, MAYBE, another fix should work. You could try something with moveUp and movedown functions, if you don't want to try that updated I suggested.
 
Back
Top