Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Lynchburg Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor 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
Lynchburg
Lynchburg Server
Commits
9dd12c77
Commit
9dd12c77
authored
4 years ago
by
Nils G.
Browse files
Options
Downloads
Patches
Plain Diff
Respect player_max when creating new players
parent
ad19eb88
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controllers/player.py
+3
-0
3 additions, 0 deletions
controllers/player.py
views/default/index.html
+4
-1
4 additions, 1 deletion
views/default/index.html
with
7 additions
and
1 deletion
controllers/player.py
+
3
−
0
View file @
9dd12c77
...
...
@@ -25,6 +25,9 @@ def create():
players
=
PLAYERS_GET
(
room_record
)
if
len
(
players
)
>=
room_record
[
"
player_max
"
]:
return
(
FAIL
(
CODE_NOTFOUND
))
for
player
in
players
:
if
player
[
"
name
"
]
==
user_name
:
return
(
FAIL
(
CODE_CONFLICT
))
...
...
This diff is collapsed.
Click to expand it.
views/default/index.html
+
4
−
1
View file @
9dd12c77
...
...
@@ -26,7 +26,7 @@
case
200
:
break
;
case
404
:
$
(
"
#form_login_error
"
).
html
(
"
Room
could not be found
.
"
);
$
(
"
#form_login_error
"
).
html
(
"
Room
not found or full
.
"
);
break
;
case
409
:
$
(
"
#form_login_error
"
).
html
(
"
Please choose a different user name.
"
);
...
...
@@ -34,6 +34,9 @@
case
422
:
$
(
"
#form_login_error
"
).
html
(
"
Please provide valid values.
"
);
break
;
case
500
:
$
(
"
#form_login_error
"
).
html
(
"
500 - Internal Server Error
"
);
break
;
default
:
$
(
"
#form_login_error
"
).
html
(
"
Error
"
+
_code
);
}
...
...
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