summaryrefslogtreecommitdiff
path: root/src/screen_gameType.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-24 15:56:36 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-24 15:56:36 +0000
commit826a768318d071200b289ed3a93ee409759dbae3 (patch)
tree3b3ade45833382db74ab0cb33d8d4327da672bfc /src/screen_gameType.c
parent13064d1bfc0459be37d8229f3f8c037fb8a10b8f (diff)
- podpora IPv6
- game server je schopny obsluhovat clientov zo sieti IPv4 a IPv6 sucastne - hrac si moze zvolit v nastaveniach, ci che pouzivat IPv4 alebo IPv6 - odkolnenie od SDL_net ( nepodporuje IPv6 ) // ale v kode este podpora SDL_Net je git-svn-id: http://opensvn.csie.org/tuxanci_ng@70 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen_gameType.c')
-rw-r--r--src/screen_gameType.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/screen_gameType.c b/src/screen_gameType.c
index da0e73e..814c9c8 100644
--- a/src/screen_gameType.c
+++ b/src/screen_gameType.c
@@ -16,6 +16,7 @@
#include "list.h"
#include "screen_setting.h"
#include "tux.h"
+#include "udp.h"
#include "widget_label.h"
#include "widget_button.h"
@@ -31,6 +32,7 @@ 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;
@@ -39,6 +41,8 @@ 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;
@@ -55,33 +59,30 @@ void drawScreenGameType()
drawWidgetLabel(label_server);
drawWidgetLabel(label_client);
- if( check_client->status == TRUE )
- {
- drawWidgetLabel(label_ip);
- drawWidgetTextfield(textfield_ip);
- }
-
if( check_none->status == FALSE )
{
drawWidgetLabel(label_port);
drawWidgetTextfield(textfield_port);
+ drawWidgetLabel(label_ip);
+ drawWidgetTextfield(textfield_ip);
+ drawWidgetCheck(check_ipv6);
+ drawWidgetLabel(label_ipv6);
}
drawWidgetCheck(check_none);
drawWidgetCheck(check_server);
drawWidgetCheck(check_client);
-
drawWidgetButton(button_back);
drawWidgetButton(button_play);
}
void eventScreenGameType()
{
-
eventWidgetCheck(check_none);
eventWidgetCheck(check_server);
eventWidgetCheck(check_client);
+ eventWidgetCheck(check_ipv6);
eventWidgetTextfield(textfield_ip);
eventWidgetTextfield(textfield_port);
@@ -181,6 +182,9 @@ 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) );
}
@@ -217,6 +221,11 @@ int getSettingPort()
return atoi( textfield_port->text );
}
+int getSettingProto()
+{
+ return ( check_ipv6->status == TRUE ? PROTO_UDPv6 : PROTO_UDPv4 );
+}
+
void quitScreenGameType()
{
destroyWidgetImage(image_backgorund);