MCPcopy Create free account
hub / github.com/TASEmulators/fceux / NetCon

Function NetCon

src/drivers/win/netplay.cpp:396–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394
395
396static INT_PTR CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
397{
398 switch(uMsg)
399 {
400 case WM_CLOSE:
401 GetSettings(hwndDlg);
402 DestroyWindow(hwndDlg);
403 netwin=0;
404 FCEUD_NetworkClose();
405 break;
406 case WM_COMMAND:
407 if(HIWORD(wParam)==BN_CLICKED)
408 {
409 switch(LOWORD(wParam))
410 {
411 case BTN_NETMOO_CONNECT:
412 if(FCEUDnetplay)
413 {
414 FCEUD_NetworkClose();
415 SetDlgItemText(hwndDlg,BTN_NETMOO_CONNECT,"Connect");
416 FixCDis(hwndDlg,1);
417 }
418 else if(GameInfo)
419 {
420 GetSettings(hwndDlg);
421 if(FCEUD_NetworkConnect())
422 {
423 SetDlgItemText(hwndDlg,BTN_NETMOO_CONNECT,"Disconnect");
424 FixCDis(hwndDlg,0);
425 }
426 }
427 break;
428 }
429 }
430 else if(HIWORD(wParam)==EN_CHANGE && Socket!=INVALID_SOCKET)
431 {
432 char buf[1024];
433 int t;
434
435
436 t=GetDlgItemText(hwndDlg,IDC_NETMOO_CMD_INPUT,buf,1024);
437 buf[1023]=0;
438
439 if(strchr(buf,'\r'))
440 {
441 char *src,*dest;
442
443 src=dest=buf;
444
445 while(*src)
446 {
447 if(*src != '\n' && *src != '\r')
448 {
449 *dest = *src;
450 dest++;
451 }
452 src++;
453 }

Callers

nothing calls this directly

Calls 6

GetSettingsFunction · 0.85
FixCDisFunction · 0.85
GetDlgItemTextFunction · 0.85
FCEUI_NetplayTextFunction · 0.85
FCEUD_NetworkCloseFunction · 0.70
FCEUD_NetworkConnectFunction · 0.70

Tested by

no test coverage detected