Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
srvpro
Commits
ad1f15a5
Commit
ad1f15a5
authored
Oct 07, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
f864cd51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
room.coffee
room.coffee
+2
-1
room.js
room.js
+2
-1
No files found.
room.coffee
View file @
ad1f15a5
...
@@ -48,7 +48,7 @@ class Room
...
@@ -48,7 +48,7 @@ class Room
@
find_or_create_random
:
(
type
,
player_name
)
->
@
find_or_create_random
:
(
type
,
player_name
)
->
result
=
_
.
find
@
all
,
(
room
)
->
result
=
_
.
find
@
all
,
(
room
)
->
room
.
random_type
!=
''
and
(
type
==
''
or
room
.
random_type
==
type
)
and
room
.
get_playing_player
().
length
==
1
and
room
.
get_playing_player
()[
0
].
name
!=
Room
.
players_oppentlist
[
player_name
]
room
.
random_type
!=
''
and
!
room
.
started
and
(
type
==
''
or
room
.
random_type
==
type
)
and
room
.
get_playing_player
().
length
==
1
and
room
.
get_playing_player
()[
0
].
name
!=
Room
.
players_oppentlist
[
player_name
]
if
result
if
result
result
.
welcome
=
'对手已经在等你了,开始决斗吧!'
result
.
welcome
=
'对手已经在等你了,开始决斗吧!'
#log.info 'found room', player_name
#log.info 'found room', player_name
...
@@ -86,6 +86,7 @@ class Room
...
@@ -86,6 +86,7 @@ class Room
@
alive
=
true
@
alive
=
true
@
players
=
[]
@
players
=
[]
@
status
=
'starting'
@
status
=
'starting'
@
started
=
false
@
established
=
false
@
established
=
false
@
watcher_buffers
=
[]
@
watcher_buffers
=
[]
@
watchers
=
[]
@
watchers
=
[]
...
...
room.js
View file @
ad1f15a5
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
Room
.
find_or_create_random
=
function
(
type
,
player_name
)
{
Room
.
find_or_create_random
=
function
(
type
,
player_name
)
{
var
name
,
result
;
var
name
,
result
;
result
=
_
.
find
(
this
.
all
,
function
(
room
)
{
result
=
_
.
find
(
this
.
all
,
function
(
room
)
{
return
room
.
random_type
!==
''
&&
(
type
===
''
||
room
.
random_type
===
type
)
&&
room
.
get_playing_player
().
length
===
1
&&
room
.
get_playing_player
()[
0
].
name
!==
Room
.
players_oppentlist
[
player_name
];
return
room
.
random_type
!==
''
&&
!
room
.
started
&&
(
type
===
''
||
room
.
random_type
===
type
)
&&
room
.
get_playing_player
().
length
===
1
&&
room
.
get_playing_player
()[
0
].
name
!==
Room
.
players_oppentlist
[
player_name
];
});
});
if
(
result
)
{
if
(
result
)
{
result
.
welcome
=
'
对手已经在等你了,开始决斗吧!
'
;
result
.
welcome
=
'
对手已经在等你了,开始决斗吧!
'
;
...
@@ -110,6 +110,7 @@
...
@@ -110,6 +110,7 @@
this
.
alive
=
true
;
this
.
alive
=
true
;
this
.
players
=
[];
this
.
players
=
[];
this
.
status
=
'
starting
'
;
this
.
status
=
'
starting
'
;
this
.
started
=
false
;
this
.
established
=
false
;
this
.
established
=
false
;
this
.
watcher_buffers
=
[];
this
.
watcher_buffers
=
[];
this
.
watchers
=
[];
this
.
watchers
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment