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
ca3b525c
Commit
ca3b525c
authored
13 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
minor fix related to json-db.js update
parent
6f5fc961
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
xtrn/bublbogl/game.js
+5
-3
5 additions, 3 deletions
xtrn/bublbogl/game.js
xtrn/uberblox/game.js
+14
-21
14 additions, 21 deletions
xtrn/uberblox/game.js
with
19 additions
and
24 deletions
xtrn/bublbogl/game.js
+
5
−
3
View file @
ca3b525c
...
...
@@ -555,7 +555,8 @@ function GameData() {
this
.
loadMonth
();
client
.
unlock
(
game_id
,
"
month
"
);
this
.
players
=
client
.
read
(
game_id
,
"
players
"
,
1
);
if
(
!
this
.
players
)
this
.
players
=
{};
if
(
!
this
.
players
[
user
.
alias
])
{
this
.
players
[
user
.
alias
]
=
new
Player
();
this
.
storePlayer
();
...
...
@@ -564,6 +565,7 @@ function GameData() {
/* load this month's boggle boards */
this
.
loadMonth
=
function
()
{
console
.
putmsg
(
"
\r
Please wait. Loading puzzles for this month...
\r\n
"
);
this
.
players
=
client
.
read
(
game_id
,
"
players
"
,
1
)
this
.
winner
=
client
.
read
(
game_id
,
"
winner
"
,
1
);
this
.
boards
=
client
.
read
(
game_id
,
"
boards
"
,
1
);
}
...
...
@@ -589,12 +591,12 @@ function GameData() {
this
.
storeRoundWinner
();
client
.
write
(
game_id
,
"
month
"
,
this
.
month
);
client
.
writ
e
(
game_id
,
"
players
"
,
{},
2
);
client
.
remov
e
(
game_id
,
"
players
"
,
2
);
console
.
putmsg
(
"
\r
Please wait. Creating puzzles for new month...
\r\n
"
);
client
.
lock
(
game_id
,
"
boards
"
,
2
);
client
.
writ
e
(
game_id
,
"
boards
"
,{}
);
client
.
remov
e
(
game_id
,
"
boards
"
);
this
.
boards
=
[];
var
numdays
=
date
.
daysInMonth
();
for
(
var
dn
=
1
;
dn
<=
numdays
;
dn
++
)
{
...
...
This diff is collapsed.
Click to expand it.
xtrn/uberblox/game.js
+
14
−
21
View file @
ca3b525c
...
...
@@ -202,8 +202,7 @@ function blox()
}
function
endGame
()
{
if
(
data
.
players
[
user
.
alias
].
score
<
points
)
{
if
(
data
.
players
[
user
.
alias
].
score
<
points
)
{
data
.
players
[
user
.
alias
].
score
=
points
;
data
.
storePlayer
();
}
...
...
@@ -530,13 +529,11 @@ function blox()
index
++
;
}
}
if
(
data
.
alltime
.
score
>
0
)
{
console
.
gotoxy
(
46
,
20
);
console
.
putmsg
(
"
\
1n
\
1yName
\
1h:
"
+
data
.
alltime
.
name
);
console
.
gotoxy
(
46
,
21
);
console
.
putmsg
(
"
\
1n
\
1yScore
\
1h:
"
+
data
.
alltime
.
score
,
P_SAVEATR
);
}
}
init
();
mainLobby
();
...
...
@@ -552,8 +549,8 @@ function Grid(c,r)
}
function
GameData
()
{
this
.
players
=
[]
;
this
.
alltime
=
[]
;
this
.
players
=
client
.
read
(
"
uberblox
"
,
"
players
"
,
1
)
;
this
.
alltime
=
client
.
read
(
"
uberblox
"
,
"
alltime
"
,
1
)
;
this
.
update
=
false
;
this
.
month
=
new
Date
().
getMonth
();
...
...
@@ -565,16 +562,11 @@ function GameData()
this
.
reset
();
client
.
unlock
(
"
uberblox
"
,
"
month
"
);
this
.
alltime
=
client
.
read
(
"
uberblox
"
,
"
alltime
"
,
1
);
if
(
!
this
.
alltime
.
name
)
{
this
.
alltime
=
{
name
:
"
no one
"
,
score
:
0
}
client
.
write
(
"
uberblox
"
,
"
alltime
"
,
this
.
alltime
,
2
);
}
if
(
!
this
.
alltime
)
this
.
alltime
=
{
name
:
"
none
"
,
score
:
0
};
this
.
players
=
client
.
read
(
"
uberblox
"
,
"
players
"
,
1
);
if
(
!
this
.
players
)
this
.
players
=
{};
if
(
!
this
.
players
[
user
.
alias
])
{
this
.
players
[
user
.
alias
]
=
new
Player
();
client
.
write
(
"
uberblox
"
,
"
players.
"
+
user
.
alias
,
this
.
players
[
user
.
alias
],
2
);
...
...
@@ -596,15 +588,16 @@ function GameData()
this
.
reset
=
function
()
{
client
.
write
(
"
uberblox
"
,
"
month
"
,
this
.
month
);
client
.
writ
e
(
"
uberblox
"
,
"
players
"
,
{},
2
);
client
.
remov
e
(
"
uberblox
"
,
"
players
"
,
2
);
}
this
.
storePlayer
=
function
()
{
client
.
write
(
"
uberblox
"
,
"
players.
"
+
user
.
alias
,
this
.
players
[
user
.
alias
],
2
);
client
.
lock
(
"
uberblox
"
,
"
alltime
"
,
2
);
if
(
this
.
players
[
user
.
alias
].
score
>
this
.
alltime
.
score
)
{
this
.
alltime
=
client
.
read
(
"
uberblox
"
,
"
alltime
"
);
if
(
!
this
.
alltime
)
this
.
alltime
=
{
name
:
"
none
"
,
score
:
0
};
if
(
this
.
players
[
user
.
alias
].
score
>
this
.
alltime
.
score
)
{
this
.
alltime
.
score
=
this
.
players
[
user
.
alias
].
score
;
this
.
alltime
.
name
=
user
.
alias
;
...
...
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