Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum ST_ConStructID {
- STRUCT_INIT_NUM, // init character
- STRUCT_DATA_NUM, // actuall data
- };
- struct ST_ConInitChar {
- char * name;
- int hp_min;
- int hp_max;
- int mp_min;
- int mp_max;
- int yang;
- int charint;
- };
- //SEND
- int id=STRUCT_INIT_NUM;
- struct ST_ConInitChar a;
- a = { "NickName", python_func.py_getCurrentHp(), python_func.py_getMaxHp(), python_func.py_getMaxSp(), python_func.py_getMaxSp(), python_func.py_getMoney() };
- DWORD wpisano,wpisano2 = 0;
- wpisano = send(maindll_socket,(char *) &id, sizeof(id), 0);
- wpisano2 = send(maindll_socket, (char *)&a, sizeof(a), 0);
- //recv
- unsigned __stdcall main_pipe_server(void* Args)
- {
- Sleep(500);
- LRESULT uiMessage;
- char wiadomosc[512];
- char tmpbuff[1024];
- int bytesRecv = SOCKET_ERROR;
- while (true){
- bytesRecv = recv(mainmenu::getInstance().dll_clients[0], wiadomosc, sizeof(wiadomosc), 0);
- if (bytesRecv > sizeof(int)){
- char * p = wiadomosc;
- int *pId = (int*)p;
- p += sizeof(*pId);
- if (*pId == STRUCT_INIT_NUM){
- ST_ConInitChar * a = (ST_ConInitChar *)p;
- if (sizeof(a) > 0 && strlen(wiadomosc) > 0){
- MessageBox(NULL, (LPCSTR)a->name, (LPCSTR) "DONE", NULL);
- }
- }
- }
- Sleep(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement