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
a481f165
Commit
a481f165
authored
Aug 27, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test2
parent
894a1a31
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
2 deletions
+20
-2
config.sample.json
config.sample.json
+1
-0
room.coffee
room.coffee
+2
-1
room.js
room.js
+2
-1
ygopro-server.coffee
ygopro-server.coffee
+8
-0
ygopro-server.js
ygopro-server.js
+7
-0
No files found.
config.sample.json
View file @
a481f165
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
"version"
:
4918
,
"version"
:
4918
,
"modules"
:
{
"modules"
:
{
"welcome"
:
"YGOPRO Server"
,
"welcome"
:
"YGOPRO Server"
,
"stop"
:
"停服"
,
"tips"
:
"http://mercury233.me/ygosrv233/tips.json"
,
"tips"
:
"http://mercury233.me/ygosrv233/tips.json"
,
"dialogues"
:
"http://mercury233.me/ygosrv233/dialogues.json"
,
"dialogues"
:
"http://mercury233.me/ygosrv233/dialogues.json"
,
"post_start_watching"
:
true
,
"post_start_watching"
:
true
,
...
...
room.coffee
View file @
a481f165
...
@@ -99,6 +99,7 @@ class Room
...
@@ -99,6 +99,7 @@ class Room
#积分
#积分
return
if
@
deleted
return
if
@
deleted
#log.info 'room-delete', this.name, Room.all.length
#log.info 'room-delete', this.name, Room.all.length
@
watcher_buffers
=
[]
index
=
_
.
indexOf
(
Room
.
all
,
this
)
index
=
_
.
indexOf
(
Room
.
all
,
this
)
#Room.all[index] = null unless index == -1
#Room.all[index] = null unless index == -1
Room
.
all
.
splice
(
index
,
1
)
unless
index
==
-
1
Room
.
all
.
splice
(
index
,
1
)
unless
index
==
-
1
...
@@ -111,7 +112,7 @@ class Room
...
@@ -111,7 +112,7 @@ class Room
client
.
server
.
connect
@
port
,
'127.0.0.1'
,
->
client
.
server
.
connect
@
port
,
'127.0.0.1'
,
->
client
.
server
.
write
buffer
for
buffer
in
client
.
pre_establish_buffers
client
.
server
.
write
buffer
for
buffer
in
client
.
pre_establish_buffers
client
.
established
=
true
client
.
established
=
true
client
.
pre_establish_buffers
=
null
client
.
pre_establish_buffers
=
[]
disconnect
:
(
client
,
error
)
->
disconnect
:
(
client
,
error
)
->
if
client
.
is_post_watcher
if
client
.
is_post_watcher
...
...
room.js
View file @
a481f165
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
if
(
this
.
deleted
)
{
if
(
this
.
deleted
)
{
return
;
return
;
}
}
this
.
watcher_buffers
=
[];
index
=
_
.
indexOf
(
Room
.
all
,
this
);
index
=
_
.
indexOf
(
Room
.
all
,
this
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
Room
.
all
.
splice
(
index
,
1
);
Room
.
all
.
splice
(
index
,
1
);
...
@@ -149,7 +150,7 @@
...
@@ -149,7 +150,7 @@
client
.
server
.
write
(
buffer
);
client
.
server
.
write
(
buffer
);
}
}
client
.
established
=
true
;
client
.
established
=
true
;
return
client
.
pre_establish_buffers
=
null
;
return
client
.
pre_establish_buffers
=
[]
;
});
});
}
}
};
};
...
...
ygopro-server.coffee
View file @
a481f165
...
@@ -197,6 +197,14 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -197,6 +197,14 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
}
}
client
.
end
()
client
.
end
()
else
if
settings
.
modules
.
stop
ygopro
.
stoc_send_chat
(
client
,
settings
.
modules
.
stop
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,{
msg
:
1
code
:
2
}
client
.
end
()
else
if
!
info
.
pass
.
length
else
if
!
info
.
pass
.
length
ygopro
.
stoc_send_chat
(
client
,
"房间为空,请修改房间名"
)
ygopro
.
stoc_send_chat
(
client
,
"房间为空,请修改房间名"
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,{
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,{
...
...
ygopro-server.js
View file @
a481f165
...
@@ -222,6 +222,13 @@
...
@@ -222,6 +222,13 @@
code
:
settings
.
version
code
:
settings
.
version
});
});
return
client
.
end
();
return
client
.
end
();
}
else
if
(
settings
.
modules
.
stop
)
{
ygopro
.
stoc_send_chat
(
client
,
settings
.
modules
.
stop
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
return
client
.
end
();
}
else
if
(
!
info
.
pass
.
length
)
{
}
else
if
(
!
info
.
pass
.
length
)
{
ygopro
.
stoc_send_chat
(
client
,
"
房间为空,请修改房间名
"
);
ygopro
.
stoc_send_chat
(
client
,
"
房间为空,请修改房间名
"
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
...
...
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