Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Releases
Package registry
Container 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
Main
Synchronet
Commits
38804ed1
Commit
38804ed1
authored
7 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug with user aliases containing "."
parent
5bec9e2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xtrn/dicewarz2/game.js
+7
-6
7 additions, 6 deletions
xtrn/dicewarz2/game.js
xtrn/synchronetris/tetrisobj.js
+3
-2
3 additions, 2 deletions
xtrn/synchronetris/tetrisobj.js
with
10 additions
and
8 deletions
xtrn/dicewarz2/game.js
+
7
−
6
View file @
38804ed1
...
...
@@ -11,6 +11,7 @@ var inputFrame = new Frame(10,24,70,1,BG_LIGHTGRAY|BLACK,frame);
var
promptFrame
=
new
Frame
(
10
,
24
,
70
,
1
,
BG_BROWN
|
WHITE
,
frame
);
var
input
=
new
InputLine
(
inputFrame
);
var
chat
=
new
JSONChat
(
user
.
number
,
undefined
,
serverAddr
,
serverPort
);
var
useralias
=
user
.
alias
.
replace
(
/
\.
/g
,
"
_
"
);
function
open
()
{
console
.
clear
();
...
...
@@ -210,7 +211,7 @@ function lobby() {
for
(
var
i
in
array
)
{
var
game
=
array
[
i
];
var
in_game
=
findPlayer
(
game
,
user
.
alias
);
var
in_game
=
findPlayer
(
game
,
useralias
);
if
(
game
.
single_player
)
{
sorted
.
singleplayer
.
push
(
i
);
...
...
@@ -269,7 +270,7 @@ function lobby() {
}
var
score
=
scores
[
s
];
var
color
=
"
\
1y
\
1h
"
;
if
(
score
.
name
==
user
.
alias
)
if
(
score
.
name
==
useralias
)
color
=
"
\
1g
\
1h
"
;
wrap
(
scoreFrame
,
color
+
"
"
+
format
(
"
%-20s
\
1h
"
+
color
,
score
.
name
.
substr
(
0
,
20
))
+
...
...
@@ -328,7 +329,7 @@ function lobby() {
}
infoFrame
.
draw
();
var
player
=
findPlayer
(
game
,
user
.
alias
);
var
player
=
findPlayer
(
game
,
useralias
);
if
(
player
>=
0
)
{
if
(
askRemove
(
game
,
player
))
return
;
...
...
@@ -375,7 +376,7 @@ function lobby() {
return
;
}
var
vote
=
menuPrompt
(
"
Vote to start? [y/N]
"
,
false
,
false
,
true
);
addPlayer
(
game
,
user
.
alias
,
system
.
name
,(
vote
==
"
Y
"
?
true
:
false
));
addPlayer
(
game
,
useralias
,
system
.
name
,(
vote
==
"
Y
"
?
true
:
false
));
}
function
canView
(
gameNumber
)
{
//todo
...
...
@@ -498,7 +499,7 @@ function lobby() {
gameNumber
++
;
var
game
=
new
Game
(
gameNumber
,
hidden_names
);
addPlayer
(
game
,
user
.
alias
,
system
.
name
,
start_now
);
addPlayer
(
game
,
useralias
,
system
.
name
,
start_now
);
data
.
games
[
gameNumber
]
=
game
;
if
(
single_player
)
{
...
...
@@ -588,7 +589,7 @@ function playGame(gameNumber) {
var
infoFrame
=
new
Frame
(
67
,
3
,
13
,
7
,
undefined
,
frame
);
var
battleFrame
=
new
Frame
(
30
,
8
,
20
,
8
,
BG_BLUE
,
frame
);
var
cursor
=
new
Frame
(
1
,
1
,
1
,
1
,
BG_LIGHTGRAY
|
BLACK
,
frame
);
var
localPlayer
=
findPlayer
(
game
,
user
.
alias
);
var
localPlayer
=
findPlayer
(
game
,
useralias
);
var
channel
=
"
dicewarz2_
"
+
gameNumber
;
var
menu
;
...
...
This diff is collapsed.
Click to expand it.
xtrn/synchronetris/tetrisobj.js
+
3
−
2
View file @
38804ed1
...
...
@@ -16,8 +16,9 @@ function GameData()
this
.
profiles
=
client
.
read
(
game_id
,
"
profiles
"
,
1
);
if
(
!
this
.
profiles
)
this
.
profiles
=
{};
if
(
!
this
.
profiles
[
user
.
alias
])
{
var
p
=
new
Profile
(
user
.
alias
);
var
alias
=
user
.
alias
.
replace
(
/
\.
/g
,
"
_
"
);
if
(
!
this
.
profiles
[
alias
])
{
var
p
=
new
Profile
(
alias
);
this
.
profiles
[
p
.
name
]
=
p
;
client
.
write
(
game_id
,
"
profiles.
"
+
p
.
name
,
p
,
2
);
}
...
...
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