37 m_firstTime( firstTime )
51 unsigned int amods = 0;
78 joinAcct->
setLabel(
"Online Account Server" );
87 serverConnGroup->
addChild( joinAcct );
92 joinServer->
setLabel(
"Independent Server" );
100 serverConnGroup->
addChild( joinServer );
105 acctConnGroup->
setId(
"MultiPlayerAccountServer" );
106 acctConnGroup->setHidden( !useacctserver );
107 serverConnGroup->
addChild( acctConnGroup );
110 hostConnGroup->
setId(
"MultiPlayerHostPort" );
111 hostConnGroup->
setHidden( useacctserver );
112 serverConnGroup->
addChild( hostConnGroup );
115 mplayTitle->
setText(
"Independent Server IP Address:" );
119 mplayTitle->
setId(
"HostTitle" );
120 hostConnGroup->
addChild( mplayTitle );
124 serverInputText->
setRect(
Rect( -.6, .42, 1.2, .15 ) );
131 serverInputText->
setId(
"VegaserverHost" );
133 hostConnGroup->
addChild( serverInputText );
137 mplayTitle->
setText(
"Server Port: (default 6777)" );
141 mplayTitle->
setId(
"PortTitle" );
142 hostConnGroup->
addChild( mplayTitle );
145 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" );
146 portInputText->
setRect(
Rect( -.6, .12, .4, .15 ) );
153 portInputText->
setId(
"VegaserverPort" );
155 hostConnGroup->
addChild( portInputText );
159 mplayTitle->
setText(
"Account Server URL:" );
163 mplayTitle->
setId(
"AcctserverTitle" );
164 acctConnGroup->addChild( mplayTitle );
167 acctserverInput->
setRect(
Rect( -.6, .42, 1.2, .15 ) );
174 acctserverInput->
setId(
"AccountServer" );
176 "http://vegastrike.sourceforge.net/cgi-bin/accountserver.py?" ) );
177 acctConnGroup->addChild( acctserverInput );
181 mplayTitle->
setText(
"Callsign:" );
185 mplayTitle->
setId(
"UsernameTitle" );
186 serverConnGroup->
addChild( mplayTitle );
190 usernameInput->setRect(
Rect( -.6, -.18, 1.2, .15 ) );
191 usernameInput->setColor(
GFXColor( 1, .5, 0, .1 ) );
193 usernameInput->setFont(
Font( .07 ) );
194 usernameInput->setMultiLine(
false );
196 usernameInput->setTextMargins(
Size( .02, .01 ) );
197 usernameInput->setId(
"Username" );
198 if ( !origpass.empty() ) usernameInput->setText(
vs_config->
getVariable(
"player",
"callsign",
"" ) );
199 serverConnGroup->
addChild( usernameInput );
203 mplayTitle->
setText(
"Password: (Server password is usually blank on local games)" );
207 mplayTitle->
setId(
"PasswordTitleHost" );
208 hostConnGroup->
addChild( mplayTitle );
212 mplayTitle->
setText(
"Password:" );
216 mplayTitle->
setId(
"PasswordTitle" );
217 acctConnGroup->addChild( mplayTitle );
221 passwordInput->
setRect(
Rect( -.6, -.48, 1.2, .15 ) );
228 passwordInput->
setId(
"Password" );
229 passwordInput->
setText( origpass );
230 serverConnGroup->
addChild( passwordInput );
233 multiStart->
setRect(
Rect( -.25, -.65, .5, .15 ) );
240 multiStart->
setLabel(
"Join Game" );
241 serverConnGroup->
addChild( multiStart );
244 namespace UniverseUtil
256 if ( !error.empty() ) {
282 baseTitle->
setText(
"Vega Strike menu" );
287 baseTitle->
setId(
"GameTitle" );
291 mainMenuGroup->
setId(
"MainMenu" );
294 mainMenuGroup->
addChild( baseTitle );
297 singlePlayer->
setRect(
Rect( -.75, .2, 1.5, .15 ) );
304 singlePlayer->
setLabel(
"Single Player Game" );
305 mainMenuGroup->
addChild( singlePlayer );
315 multiPlayer->
setLabel(
"MultiPlayer" );
316 mainMenuGroup->
addChild( multiPlayer );
327 mainMenuGroup->
addChild( exitGame );
330 serverConnGroup->
setId(
"MultiPlayerMenu" );
336 mplayTitle->
setText(
"MultiPlayer Settings" );
340 mplayTitle->
setId(
"GameTitle" );
342 serverConnGroup->
addChild( mplayTitle );
345 returnMainMenu->
setRect(
Rect( .7, .81, .25, .1 ) );
351 returnMainMenu->
setCommand(
"ReturnMainMenu" );
353 serverConnGroup->
addChild( returnMainMenu );
364 serverConnGroup->
addChild( exitGame );
460 , onlyMessage( onlyMessage ) {}
493 text->
setText(
"Leaving your current game and joining a new one will lose all progress since your last save." );
495 text->
setText(
"Do you want to save your current account progress?" );
496 else if (netAction ==
DIE)
497 text->
setText(
"Rejoining your current game will lose all progress since your last save." );
502 text->
setId(
"Information" );
512 }
else if (netAction ==
DIE) {
548 if (command ==
"Save") {
551 }
else if (command ==
"Load") {
554 }
else if (command ==
"JoinGame") {
567 string::size_type pos = user.find(
' ' );
568 while (pos != string::npos) {
570 pos = user.find(
' ', pos );
578 static_cast< TextInputDisplay* > ( window->
findControlById(
"VegaserverHost" ) )->text() );
580 static_cast< TextInputDisplay* > ( window->
findControlById(
"VegaserverPort" ) )->text() );
584 static_cast< TextInputDisplay* > ( window->
findControlById(
"AccountServer" ) )->text() );
610 string user, pass, err;
624 if (shipList.size() > 1) {
639 err =
"\nThe server said: "+err;
640 showAlert(
"Error when joining game!\n"+err );
651 if (launchShip == -1) {
660 if ( !
Network[player].loginSavedGame( launchShip ) ) {
661 showAlert(
"Error when logging into game with this ship!" );
680 Window *parentWin = m_parent;