mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-22 07:07:10 +01:00
Allow setting host on local connections
This commit is contained in:
parent
cca6c03c00
commit
a81356aee7
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
/* TODO: */
|
/* TODO: */
|
||||||
extern char *fixme_tmp_network_client;
|
extern char *fixme_tmp_network_client;
|
||||||
extern int fixme_tmp_network_server;
|
extern char *fixme_tmp_network_server;
|
||||||
|
|
||||||
|
|
||||||
static struct timeval tv_start;
|
static struct timeval tv_start;
|
||||||
@ -79,7 +79,7 @@ void C64::c64_ctor1(void)
|
|||||||
this->peer = NULL;
|
this->peer = NULL;
|
||||||
|
|
||||||
if (fixme_tmp_network_server) {
|
if (fixme_tmp_network_server) {
|
||||||
int i;
|
strcpy(this->server_hostname, fixme_tmp_network_server);
|
||||||
this->peer = new Network(this->server_hostname, this->server_port, true);
|
this->peer = new Network(this->server_hostname, this->server_port, true);
|
||||||
this->network_connection_type = MASTER;
|
this->network_connection_type = MASTER;
|
||||||
printf("Waiting for connection\n");
|
printf("Waiting for connection\n");
|
||||||
|
@ -945,6 +945,7 @@ bool Network::ConnectFSM()
|
|||||||
this->network_connection_state = CONN_CONNECT_TO_PEER;
|
this->network_connection_state = CONN_CONNECT_TO_PEER;
|
||||||
break;
|
break;
|
||||||
case CONN_CONNECT_TO_PEER:
|
case CONN_CONNECT_TO_PEER:
|
||||||
|
printf("Connecting to peer\n");
|
||||||
if (this->ConnectToPeer() == false)
|
if (this->ConnectToPeer() == false)
|
||||||
return false;
|
return false;
|
||||||
/* Allow some transit time */
|
/* Allow some transit time */
|
||||||
@ -954,10 +955,13 @@ bool Network::ConnectFSM()
|
|||||||
case CONN_WAIT_FOR_PEER_REPLY:
|
case CONN_WAIT_FOR_PEER_REPLY:
|
||||||
/* Connect again in case the first sent was dropped on
|
/* Connect again in case the first sent was dropped on
|
||||||
* its way to the peer */
|
* its way to the peer */
|
||||||
|
printf("Connecting to peer again\n");
|
||||||
if (this->ConnectToPeer() == false)
|
if (this->ConnectToPeer() == false)
|
||||||
return false;
|
return false;
|
||||||
|
printf("Waiting for peer reply\n");
|
||||||
if (this->WaitForPeerReply() == false)
|
if (this->WaitForPeerReply() == false)
|
||||||
return false;
|
return false;
|
||||||
|
printf("Got peer reply\n");
|
||||||
this->network_connection_state = CONN_CONNECTED;
|
this->network_connection_state = CONN_CONNECTED;
|
||||||
break;
|
break;
|
||||||
case CONN_CONNECTED:
|
case CONN_CONNECTED:
|
||||||
|
15
Src/main_x.h
15
Src/main_x.h
@ -104,16 +104,17 @@ Frodo::Frodo()
|
|||||||
* Process command line arguments
|
* Process command line arguments
|
||||||
*/
|
*/
|
||||||
char *fixme_tmp_network_client = 0;
|
char *fixme_tmp_network_client = 0;
|
||||||
int fixme_tmp_network_server = 0;
|
char *fixme_tmp_network_server = 0;
|
||||||
|
|
||||||
void Frodo::ArgvReceived(int argc, char **argv)
|
void Frodo::ArgvReceived(int argc, char **argv)
|
||||||
{
|
{
|
||||||
if (argc == 2 &&
|
if (argc == 3)
|
||||||
strcmp(argv[1], "-s") == 0)
|
{
|
||||||
fixme_tmp_network_server = 1;
|
if (strcmp(argv[1], "-s") == 0)
|
||||||
if (argc == 3 &&
|
fixme_tmp_network_server = argv[2];
|
||||||
strcmp(argv[1], "-c") == 0)
|
else if (strcmp(argv[1], "-c") == 0)
|
||||||
fixme_tmp_network_client = argv[2];
|
fixme_tmp_network_client = argv[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user