Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TDT4240 Tank Wars
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Snorre Skjellestad Kristiansen
TDT4240 Tank Wars
Commits
47fe6901
Commit
47fe6901
authored
2 years ago
by
Sander Østrem Fagernes
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Change port to 80; Selogin transition to main menu
parent
85940ab2
No related branches found
No related tags found
1 merge request
!31
Connect login frontend to backend
Pipeline
#214084
failed
2 years ago
Stage: backend test
Stage: frontend test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/core/src/com/game/tankwars/controller/LoginController.java
+4
-8
4 additions, 8 deletions
...ore/src/com/game/tankwars/controller/LoginController.java
with
4 additions
and
8 deletions
frontend/core/src/com/game/tankwars/controller/LoginController.java
+
4
−
8
View file @
47fe6901
...
...
@@ -14,11 +14,10 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import
com.badlogic.gdx.utils.Json
;
import
com.game.tankwars.Callback
;
import
com.game.tankwars.ReceiverHandler
;
import
com.game.tankwars.ResourceManager
;
import
com.game.tankwars.TankWarsGame
;
import
com.game.tankwars.model.CurrentUser
;
import
com.game.tankwars.model.User
;
import
com.game.tankwars.view.
Game
Screen
;
import
com.game.tankwars.view.
MainMenu
Screen
;
/**
...
...
@@ -93,16 +92,13 @@ public class LoginController {
}
public
void
handleInput
(
String
username
)
{
// TODO: Move clear line to MainMenuController when the main menu is operational
retries
=
0
;
failed
=
false
;
fetchUser
(
username
);
while
(
getCurrentUser
().
getUser
()
==
null
&&
!
failed
){
}
if
(!
failed
)
{
ResourceManager
.
getInstance
().
clear
();
tankWarsGame
.
setScreen
(
new
GameScreen
(
tankWarsGame
));
}
if
(!
failed
)
tankWarsGame
.
setScreen
(
new
MainMenuScreen
(
tankWarsGame
));
}
public
void
fetchUser
(
final
String
username
)
{
...
...
@@ -125,7 +121,7 @@ public class LoginController {
}
};
String
url
=
String
.
format
(
"http://localhost:
300
0/user/create/%s"
,
username
);
String
url
=
String
.
format
(
"http://localhost:
8
0/user/create/%s"
,
username
);
Net
.
HttpRequest
httpRequest
=
new
HttpRequestBuilder
()
.
newRequest
()
.
method
(
Net
.
HttpMethods
.
POST
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment