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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
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
nanahira
srvpro
Commits
169e8205
Commit
169e8205
authored
Jan 04, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add send card hint to client function
parent
185af253
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
3 deletions
+68
-3
proto_structs.json
proto_structs.json
+1
-0
structs.json
structs.json
+6
-1
ygopro-server.coffee
ygopro-server.coffee
+3
-0
ygopro-server.js
ygopro-server.js
+5
-1
ygopro.coffee
ygopro.coffee
+21
-1
ygopro.js
ygopro.js
+32
-0
No files found.
proto_structs.json
View file @
169e8205
...
...
@@ -14,6 +14,7 @@
"HS_PLAYER_CHANGE"
:
"STOC_HS_PlayerChange"
,
"HS_PLAYER_ENTER"
:
"STOC_HS_PlayerEnter"
,
"ERROR_MSG"
:
"STOC_ErrorMsg"
,
"GAME_MSG"
:
"GameMsg_Hint_Card_only"
,
"CHAT"
:
"STOC_Chat"
}
}
structs.json
View file @
169e8205
...
...
@@ -83,7 +83,12 @@
"STOC_HS_WatchChange"
:
[
{
"name"
:
"watch_count"
,
"type"
:
"unsigned short"
}
],
"GameMsg_Hint_Card_only"
:
[
{
"name"
:
"curmsg"
,
"type"
:
"word8Ule"
},
{
"name"
:
"type"
,
"type"
:
"word8"
},
{
"name"
:
"player"
,
"type"
:
"word8"
},
{
"name"
:
"data"
,
"type"
:
"word32Ule"
}
],
"deck"
:
[
{
"name"
:
"mainc"
,
"type"
:
"unsigned int"
},
{
"name"
:
"sidec"
,
"type"
:
"unsigned int"
},
...
...
ygopro-server.coffee
View file @
169e8205
...
...
@@ -552,6 +552,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when
'/roomname'
ygopro
.
stoc_send_chat
(
client
,
"您当前的房间名是 "
+
client
.
room
.
name
)
if
client
.
room
when
'/test'
ygopro
.
stoc_send_hint_card_to_room
(
client
.
room
,
2333365
)
return
cancel
...
...
ygopro-server.js
View file @
169e8205
...
...
@@ -636,6 +636,7 @@
case
'
/help
'
:
ygopro
.
stoc_send_chat
(
client
,
"
YGOSrv233 指令帮助
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/help 显示这个帮助信息
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/roomname 显示当前房间的名字
"
);
if
(
settings
.
modules
.
tips
)
{
ygopro
.
stoc_send_chat
(
client
,
"
/tip 显示一条提示
"
);
}
...
...
@@ -647,8 +648,11 @@
break
;
case
'
/roomname
'
:
if
(
client
.
room
)
{
ygopro
.
stoc_send_chat
(
client
,
"
您当前的房间名是
"
+
client
.
room
.
name
);
ygopro
.
stoc_send_chat
(
client
,
"
您当前的房间名是
"
+
client
.
room
.
name
);
}
break
;
case
'
/test
'
:
ygopro
.
stoc_send_hint_card_to_room
(
client
.
room
,
2333365
);
}
return
cancel
;
});
...
...
ygopro.coffee
View file @
169e8205
...
...
@@ -130,4 +130,24 @@ for name, declaration of structs_declaration
@
stoc_send_chat
(
client
,
msg
,
player
)
if
client
for
client
in
room
.
watchers
@
stoc_send_chat
(
client
,
msg
,
player
)
if
client
return
\ No newline at end of file
return
@
stoc_send_hint_card_to_room
=
(
room
,
card
)
->
if
!
room
console
.
log
"err stoc_send_hint_card_to_room"
return
for
client
in
room
.
players
@
stoc_send
client
,
'GAME_MSG'
,{
curmsg
:
2
,
type
:
10
,
player
:
0
,
data
:
card
}
if
client
for
client
in
room
.
watchers
@
stoc_send
client
,
'GAME_MSG'
,{
curmsg
:
2
,
type
:
10
,
player
:
0
,
data
:
card
}
if
client
return
ygopro.js
View file @
169e8205
...
...
@@ -213,4 +213,36 @@
}
};
this
.
stoc_send_hint_card_to_room
=
function
(
room
,
card
)
{
var
client
,
j
,
k
,
len1
,
len2
,
ref
,
ref1
;
if
(
!
room
)
{
console
.
log
(
"
err stoc_send_hint_card_to_room
"
);
return
;
}
ref
=
room
.
players
;
for
(
j
=
0
,
len1
=
ref
.
length
;
j
<
len1
;
j
++
)
{
client
=
ref
[
j
];
if
(
client
)
{
this
.
stoc_send
(
client
,
'
GAME_MSG
'
,
{
curmsg
:
2
,
type
:
10
,
player
:
0
,
data
:
card
});
}
}
ref1
=
room
.
watchers
;
for
(
k
=
0
,
len2
=
ref1
.
length
;
k
<
len2
;
k
++
)
{
client
=
ref1
[
k
];
if
(
client
)
{
this
.
stoc_send
(
client
,
'
GAME_MSG
'
,
{
curmsg
:
2
,
type
:
10
,
player
:
0
,
data
:
card
});
}
}
};
}).
call
(
this
);
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