Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VOID WINAPI recvD(BSTR recvBuffer)
- {
- __asm PUSHAD;
- __asm PUSHFD;
- OutputDebugStringW(recvBuffer);
- if (wcsstr(recvBuffer, L"RM") != NULL)
- {
- wstring modifiedB = recvBuffer;
- string str(modifiedB.begin(), modifiedB.end());
- vector<string> bufferC = split(str, ',');
- if (bufferC.size() > 11)
- {
- map<int, playerClass*> miMapa;
- int id = stoi(bufferC[3]);
- int xPos = stoi(bufferC[4]);
- int yPos = stoi(bufferC[5]);
- string name; // CAMBIAR A WSTRING, TESTEANDO CLASS
- name.assign(bufferC[11].begin(), bufferC[11].end());
- miMapa[id] = new playerClass(xPos,yPos,name);
- for (auto it = miMapa.begin(); it != miMapa.end(); it++)
- {
- char* msgBuffer;
- OutputDebugString(it->second->namex.c_str()); // Para probar, pero no aparece nada asi que parece que esta vacio esto
- sprintf(msgBuffer, "ID:%d NAME:%s XPOS:%d YPOS:%d", it->first, it->second->namex.c_str(), it->second->xPos, it->second->yPos);
- OutputDebugString(msgBuffer);
- }
- /*int nose = stoi(bufferC[16]);
- wstring inix;
- inix.assign(bufferC[0].begin(), bufferC[0].end());
- 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);
- BSTR mensaje = SysAllocStringLen(modifiedB.data(), modifiedB.size());
- recvBuffer = mensaje;*/
- }
- }
- PFunctionRecv(recvBuffer);
- __asm POPFD;
- __asm POPAD;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement