summaryrefslogtreecommitdiff
path: root/src/screen_gameType.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-25 16:24:57 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-25 16:24:57 +0000
commitaa864b63aba5260b8bd35da61c543e08ae03bd49 (patch)
treefa072c79336b0b74afffa3af9ff30874e67ae3ef /src/screen_gameType.c
parentc2c45aad274638acc14e603014f5fc68b13500c5 (diff)
- kod uz nepouizva buffer_t a buffer.c bol to iba historizmus z pouzivania TCP
( teraz na frontu prijatcy packetov pouizva list_t ) - odstranenie zakrkavacieho GUI "support IPv6", program je schopny zistit sam IP protokol na zaklade IP adresy ( ake logicke, ze ? ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@72 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen_gameType.c')
-rw-r--r--src/screen_gameType.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/screen_gameType.c b/src/screen_gameType.c
index 814c9c8..38cdbf8 100644
--- a/src/screen_gameType.c
+++ b/src/screen_gameType.c
@@ -32,7 +32,6 @@ static widget_button_t *button_play;
static widget_label_t *label_none;
static widget_label_t *label_server;
static widget_label_t *label_client;
-static widget_label_t *label_ipv6;
static widget_label_t *label_ip;
static widget_label_t *label_port;
@@ -41,8 +40,6 @@ static widget_check_t *check_none;
static widget_check_t *check_server;
static widget_check_t *check_client;
-static widget_check_t *check_ipv6;
-
static widget_textfield_t *textfield_ip;
static widget_textfield_t *textfield_port;
@@ -65,8 +62,6 @@ void drawScreenGameType()
drawWidgetTextfield(textfield_port);
drawWidgetLabel(label_ip);
drawWidgetTextfield(textfield_ip);
- drawWidgetCheck(check_ipv6);
- drawWidgetLabel(label_ipv6);
}
drawWidgetCheck(check_none);
@@ -82,7 +77,6 @@ void eventScreenGameType()
eventWidgetCheck(check_none);
eventWidgetCheck(check_server);
eventWidgetCheck(check_client);
- eventWidgetCheck(check_ipv6);
eventWidgetTextfield(textfield_ip);
eventWidgetTextfield(textfield_port);
@@ -182,9 +176,6 @@ void initScreenGameType()
textfield_ip = newWidgetTextfield(getParamElse("--ip", "127.0.0.1"), 300, 180);
textfield_port = newWidgetTextfield(getParamElse("--port", "2200"), 300, 280);
- check_ipv6 = newWidgetCheck(300, 330, FALSE, eventWidget);
- label_ipv6 = newWidgetLabel("support IPv6", 330, 325, WIDGET_LABEL_LEFT);
-
registerScreen( newScreen("gameType", startScreenGameType, eventScreenGameType,
drawScreenGameType, stopScreenGameType) );
}
@@ -223,7 +214,18 @@ int getSettingPort()
int getSettingProto()
{
- return ( check_ipv6->status == TRUE ? PROTO_UDPv6 : PROTO_UDPv4 );
+ if( strstr(textfield_ip->text, ".") != NULL )
+ {
+ return PROTO_UDPv4;
+ }
+
+ if( strstr(textfield_ip->text, ":") != NULL )
+ {
+ return PROTO_UDPv6;
+ }
+
+ printf("IP protokol unknown !\n");
+ return -1;
}
void quitScreenGameType()