Fork me on GitHub
How can I convert this TrinityCore code over to Mangos?
Post: #1
There's this bit of code:

I'm trying to mimic this bit of code

Code:
uint8 size = *(GetReadBuffer().GetReadPointer() + sizeof(sAuthLogonProof_C));
std::string token(reinterpret_cast<char*>(GetReadBuffer().GetReadPointer() + sizeof(sAuthLogonProof_C) + sizeof(size)), size);
GetReadBuffer().ReadCompleted(sizeof(size) + size);

uint32 incomingToken = atoi(token.c_str());

This is what I have came up with but it doesn't seem to be working as intended, any suggestions?
Code:
uint8 size = (uint8)*InPeak() + sizeof(sAuthLogonProof_C);
std::string token(reinterpret_cast<char*>((uint8)InPeak()) + sizeof(sAuthLogonProof_C) + sizeof(size)), size);
ReadSkip(sizeof(size) + size);
BASIC_LOG("[AuthLogon] Token = %s", token);

uint32 incomingToken = atoi(token.c_str());
BASIC_LOG("[AuthLogon] Token = %u", incomingToken);
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  How do I receive the authenticator code on the server side Gacnt 0 382 01-25-2017, 06:01 AM
Last Post: Gacnt
Shocked Confused about Mangos and CMangos Mightylink 6 969 01-24-2017, 08:01 AM
Last Post: Mightylink
  [Classic] Debuff Limit (8/16) Settings/Code?.. hunter9 2 602 12-13-2016, 05:14 PM
Last Post: namreeb
  where to find monster aggro code? mikool 0 414 12-05-2016, 08:22 AM
Last Post: mikool
  MaNGOS Automatic installation on fresh ubuntu dvd_video 2 1,039 09-02-2016, 11:53 AM
Last Post: dvd_video
  Mangos Conf for Single Player taters 0 977 04-07-2016, 08:22 PM
Last Post: taters
  Questions about ike3's mangos bots and AHBOT sout12 0 1,203 02-16-2016, 05:15 AM
Last Post: sout12
  RefManager class in cmangos code magiceye 0 890 08-12-2015, 09:31 AM
Last Post: magiceye
Question Code Help -- Spell Damage tarwyn 0 1,318 07-03-2014, 05:23 AM
Last Post: tarwyn
  Accelerate mangos compiling Dany 5 4,848 10-20-2013, 03:36 PM
Last Post: Dany

Forum Jump:


Users browsing this thread: 1 Guest(s)

Continued MaNGOS | Return to Top | | Lite (Archive) Mode | RSS Syndication