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
a0863d1f
Commit
a0863d1f
authored
May 25, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix room error
parent
f9321212
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
12 deletions
+74
-12
ygopro-server.coffee
ygopro-server.coffee
+36
-6
ygopro-server.js
ygopro-server.js
+38
-6
No files found.
ygopro-server.coffee
View file @
a0863d1f
...
...
@@ -379,10 +379,25 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
windbot
=
_
.
sample
settings
.
modules
.
windbots
room
=
Room
.
find_or_create_by_name
(
'AI#'
+
Math
.
floor
(
Math
.
random
()
*
100000
))
# 这个 AI# 没有特殊作用, 仅作为标记
room
.
windbot
=
windbot
room
.
private
=
true
client
.
room
=
room
client
.
room
.
connect
(
client
)
if
!
room
ygopro
.
stoc_send_chat
(
client
,
"服务器已经爆满,请稍候再试"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,
{
msg
:
1
code
:
2
}
client
.
end
()
else
if
room
.
error
ygopro
.
stoc_send_chat
(
client
,
room
.
error
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,
{
msg
:
1
code
:
2
}
client
.
end
()
else
room
.
windbot
=
windbot
room
.
private
=
true
client
.
room
=
room
client
.
room
.
connect
(
client
)
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard_auth
ygopro
.
stoc_send_chat
(
client
,
'正在读取用户信息...'
,
ygopro
.
constants
.
COLORS
.
RED
)
...
...
@@ -480,8 +495,23 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
}
client
.
end
()
return
client
.
room
=
room
client
.
room
.
connect
(
client
)
if
!
room
ygopro
.
stoc_send_chat
(
client
,
"服务器已经爆满,请稍候再试"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,
{
msg
:
1
code
:
2
}
client
.
end
()
else
if
room
.
error
ygopro
.
stoc_send_chat
(
client
,
room
.
error
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,
{
msg
:
1
code
:
2
}
client
.
end
()
else
client
.
room
=
room
client
.
room
.
connect
(
client
)
if
id
=
users_cache
[
client
.
name
]
secret
=
id
%
65535
+
1
...
...
ygopro-server.js
View file @
a0863d1f
...
...
@@ -432,10 +432,26 @@
windbot
=
_
.
sample
(
settings
.
modules
.
windbots
);
}
room
=
Room
.
find_or_create_by_name
(
'
AI#
'
+
Math
.
floor
(
Math
.
random
()
*
100000
));
room
.
windbot
=
windbot
;
room
[
"
private
"
]
=
true
;
client
.
room
=
room
;
client
.
room
.
connect
(
client
);
if
(
!
room
)
{
ygopro
.
stoc_send_chat
(
client
,
"
服务器已经爆满,请稍候再试
"
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
client
.
end
();
}
else
if
(
room
.
error
)
{
ygopro
.
stoc_send_chat
(
client
,
room
.
error
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
client
.
end
();
}
else
{
room
.
windbot
=
windbot
;
room
[
"
private
"
]
=
true
;
client
.
room
=
room
;
client
.
room
.
connect
(
client
);
}
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard_auth
)
{
ygopro
.
stoc_send_chat
(
client
,
'
正在读取用户信息...
'
,
ygopro
.
constants
.
COLORS
.
RED
);
if
(
info
.
pass
.
length
<=
8
)
{
...
...
@@ -538,8 +554,24 @@
client
.
end
();
return
;
}
client
.
room
=
room
;
return
client
.
room
.
connect
(
client
);
if
(
!
room
)
{
ygopro
.
stoc_send_chat
(
client
,
"
服务器已经爆满,请稍候再试
"
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
return
client
.
end
();
}
else
if
(
room
.
error
)
{
ygopro
.
stoc_send_chat
(
client
,
room
.
error
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
return
client
.
end
();
}
else
{
client
.
room
=
room
;
return
client
.
room
.
connect
(
client
);
}
};
if
(
id
=
users_cache
[
client
.
name
])
{
secret
=
id
%
65535
+
1
;
...
...
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