Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. VOID WINAPI recvD(BSTR recvBuffer)
  2. {
  3. __asm PUSHAD;
  4. __asm PUSHFD;
  5. OutputDebugStringW(recvBuffer);
  6.  
  7. if (wcsstr(recvBuffer, L"RM") != NULL)
  8. {
  9. wstring modifiedB = recvBuffer;
  10. string str(modifiedB.begin(), modifiedB.end());
  11. vector<string> bufferC = split(str, ',');
  12. if (bufferC.size() > 11)
  13. {
  14. map<int, playerClass*> miMapa;
  15. int id = stoi(bufferC[3]);
  16. int xPos = stoi(bufferC[4]);
  17. int yPos = stoi(bufferC[5]);
  18. string name; // CAMBIAR A WSTRING, TESTEANDO CLASS
  19. name.assign(bufferC[11].begin(), bufferC[11].end());
  20. miMapa[id] = new playerClass(xPos,yPos,name);
  21.  
  22. for (auto it = miMapa.begin(); it != miMapa.end(); it++)
  23. {
  24. char* msgBuffer;
  25. OutputDebugString(it->second->namex.c_str()); // Para probar, pero no aparece nada asi que parece que esta vacio esto
  26. sprintf(msgBuffer, "ID:%d NAME:%s XPOS:%d YPOS:%d", it->first, it->second->namex.c_str(), it->second->xPos, it->second->yPos);
  27. OutputDebugString(msgBuffer);
  28. }
  29. /*int nose = stoi(bufferC[16]);
  30. wstring inix;
  31. inix.assign(bufferC[0].begin(), bufferC[0].end());
  32. modifiedB = inix + L",3,3," + to_wstring(id) + L"," + to_wstring(xPos) + L"," + to_wstring(yPos) + L",2,2,0,999,2," + name + L" [HOLA]" + L",5,0,0,0," + to_wstring(nose);
  33. BSTR mensaje = SysAllocStringLen(modifiedB.data(), modifiedB.size());
  34. recvBuffer = mensaje;*/
  35.  
  36. }
  37. }
  38.  
  39. PFunctionRecv(recvBuffer);
  40. __asm POPFD;
  41. __asm POPAD;
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement