CMsgStreamBuffer::operator>> Help

07/11/2021 08:20 halloway520#1
PHP Code:
void CNetProcessIn::OnB001(CMsgStreamBuffer &msg) {
    
DEBUG_PRINT_CALL()

    
int n;
    
CMsgStreamBuffer cs(0xB001);
    
memcpy(cs.m_node1msg.m_node1sizeof(msg.m_node1));
    
memcpy(cs.m_node2msg.m_node2sizeof(msg.m_node2));

    
cs.m_availableBytesForReading msg.m_availableBytesForReading;
    
cs.m_currentReadBytes msg.m_currentReadBytes;
    
cs.m_msgid msg.m_msgid;

    
cs >> n//crash!!!

    
reinterpret_cast<void(__thiscall *)(CNetProcessIn *, CMsgStreamBuffer &)>(0x008A4960)(thismsg);


How to save a copy of "msg" correctly ?

CMsgStreamBuffer cs = msg; is crash also.


Thanks!
07/11/2021 16:12 SubZero**#2
read the packet then use

msg->FlushRemaining(); //for custom packet
msg->m_currentReadBytes=0 // for org packets
08/05/2021 12:15 halloway520#3
Quote:
Originally Posted by SubZero** View Post
read the packet then use

msg->FlushRemaining(); //for custom packet
msg->m_currentReadBytes=0 // for org packets

Tanks bro, you fix my problem!
10/13/2021 20:11 kotsh23#4
Quote:
Originally Posted by SubZero** View Post
read the packet then use

msg->FlushRemaining(); //for custom packet
msg->m_currentReadBytes=0 // for org packets
thank you boss
you really good person ;)