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
a91682f0
Commit
a91682f0
authored
13 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
fixed chat parsing. verify game existence before joining. beep when you hit a wall.
parent
f8a6e279
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xtrn/maze/game.js
+17
-4
17 additions, 4 deletions
xtrn/maze/game.js
with
17 additions
and
4 deletions
xtrn/maze/game.js
+
17
−
4
View file @
a91682f0
...
...
@@ -190,7 +190,12 @@ function lobby() {
var
channel
=
chat
.
channels
[
chat_tab
.
title
.
toUpperCase
()];
while
(
channel
&&
channel
.
messages
.
length
>
0
)
{
var
msg
=
channel
.
messages
.
shift
();
var
str
=
msg
.
nick
.
name
+
"
:
"
+
msg
.
str
;
var
str
=
""
;
if
(
msg
.
nick
)
var
str
=
getColor
(
chat
.
settings
.
NICK_COLOR
)
+
msg
.
nick
.
name
+
"
\
1n:
"
+
getColor
(
chat
.
settings
.
TEXT_COLOR
)
+
msg
.
str
;
else
var
str
=
getColor
(
chat
.
settings
.
NOTICE_COLOR
)
+
msg
.
str
;
chat_tab
.
getcmd
(
str
+
"
\r\n
"
);
}
}
...
...
@@ -334,17 +339,23 @@ function lobby() {
function
joinMaze
()
{
/* find the first open game number */
gnum
=
getOpenGame
();
if
(
isNaN
(
gnum
))
{
log
(
LOG_WARNING
,
"
Error finding game number
"
);
return
false
;
}
client
.
lock
(
"
mazerace
"
,
"
games.
"
+
gnum
,
2
);
var
game
=
client
.
read
(
"
mazerace
"
,
"
games.
"
+
gnum
);
var
player
=
new
Player
(
profile
.
name
,
profile
.
avatar
,
profile
.
color
);
/* if the game doesnt exist, create it */
if
(
!
data
.
games
[
gnum
]
)
{
if
(
!
game
)
{
data
.
games
[
gnum
]
=
new
Game
(
gnum
);
data
.
games
[
gnum
].
players
[
profile
.
name
]
=
player
;
client
.
write
(
"
mazerace
"
,
"
games.
"
+
gnum
,
data
.
games
[
gnum
]);
}
/* otherwise, store player info in game */
else
{
data
.
games
[
gnum
]
=
game
;
data
.
games
[
gnum
].
players
[
profile
.
name
]
=
player
;
client
.
write
(
"
mazerace
"
,
"
games.
"
+
gnum
+
"
.players.
"
+
profile
.
name
,
player
);
}
...
...
@@ -661,8 +672,10 @@ function race(gameNumber) {
data
.
storePlayerPosition
(
gameNumber
,
player
);
}
function
takeDamage
()
{
if
(
settings
.
damage
)
if
(
settings
.
damage
)
{
player
.
health
-=
settings
.
damage_qty
;
write
(
ascii
(
7
));
}
data
.
storePlayerHealth
(
gameNumber
,
player
);
showPlayerInfo
();
}
...
...
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