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
81446259
Commit
81446259
authored
Nov 29, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
koishi room list
parent
07ebe1bf
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
204 additions
and
49 deletions
+204
-49
data/constants.json
data/constants.json
+2
-1
data/default_config.json
data/default_config.json
+3
-0
data/i18n.json
data/i18n.json
+2
-0
ygopro-server.coffee
ygopro-server.coffee
+68
-0
ygopro-server.js
ygopro-server.js
+129
-48
No files found.
data/constants.json
View file @
81446259
...
@@ -53,7 +53,8 @@
...
@@ -53,7 +53,8 @@
"32"
:
"HS_PLAYER_ENTER"
,
"32"
:
"HS_PLAYER_ENTER"
,
"33"
:
"HS_PLAYER_CHANGE"
,
"33"
:
"HS_PLAYER_CHANGE"
,
"34"
:
"HS_WATCH_CHANGE"
,
"34"
:
"HS_WATCH_CHANGE"
,
"48"
:
"FIELD_FINISH"
"48"
:
"FIELD_FINISH"
,
"49"
:
"SRVPRO_ROOMLIST"
},
},
"PLAYERCHANGE"
:{
"PLAYERCHANGE"
:{
"8"
:
"OBSERVE"
,
"8"
:
"OBSERVE"
,
...
...
data/default_config.json
View file @
81446259
...
@@ -69,6 +69,9 @@
...
@@ -69,6 +69,9 @@
"enabled"
:
true
,
"enabled"
:
true
,
"get"
:
false
"get"
:
false
},
},
"koishi_roomlist"
:
{
"enabled"
:
true
},
"vip"
:
{
"vip"
:
{
"enabled"
:
false
,
"enabled"
:
false
,
"generate_count"
:
500
"generate_count"
:
500
...
...
data/i18n.json
View file @
81446259
...
@@ -89,6 +89,7 @@
...
@@ -89,6 +89,7 @@
"chat_order_vip_dialogues"
:
"/vip dialogues CARD_CODE DIALOGUE to set a dialogue for a specific card"
,
"chat_order_vip_dialogues"
:
"/vip dialogues CARD_CODE DIALOGUE to set a dialogue for a specific card"
,
"chat_order_vip_words"
:
"/vip words WORD to set your word when joining in the server"
,
"chat_order_vip_words"
:
"/vip words WORD to set your word when joining in the server"
,
"chat_order_vip_victory"
:
"/vip victory WORD to set your word when you win a duel"
,
"chat_order_vip_victory"
:
"/vip victory WORD to set your word when you win a duel"
,
"koishi_roomlist_hint"
:
"Checking room list ..."
,
"room_name"
:
"Room name is"
,
"room_name"
:
"Room name is"
,
"banned_chat_tip"
:
"You are banned from chatting."
,
"banned_chat_tip"
:
"You are banned from chatting."
,
"banned_duel_tip"
:
"You are banned from the random duel system for sending inappropriate messages."
,
"banned_duel_tip"
:
"You are banned from the random duel system for sending inappropriate messages."
,
...
@@ -421,6 +422,7 @@
...
@@ -421,6 +422,7 @@
"chat_order_vip_dialogues"
:
"/vip dialogues 卡号 台词 设置特定卡的召唤台词"
,
"chat_order_vip_dialogues"
:
"/vip dialogues 卡号 台词 设置特定卡的召唤台词"
,
"chat_order_vip_words"
:
"/vip words 台词 设置自己的进场台词"
,
"chat_order_vip_words"
:
"/vip words 台词 设置自己的进场台词"
,
"chat_order_vip_victory"
:
"/vip victory 台词 设置自己的胜利台词"
,
"chat_order_vip_victory"
:
"/vip victory 台词 设置自己的胜利台词"
,
"koishi_roomlist_hint"
:
"正在获取房间列表……"
,
"room_name"
:
"您当前的房间名是"
,
"room_name"
:
"您当前的房间名是"
,
"banned_chat_tip"
:
"您已被禁言!"
,
"banned_chat_tip"
:
"您已被禁言!"
,
"banned_duel_tip"
:
"您的发言存在严重不适当的内容,禁止您使用随机对战功能!"
,
"banned_duel_tip"
:
"您的发言存在严重不适当的内容,禁止您使用随机对战功能!"
,
...
...
ygopro-server.coffee
View file @
81446259
...
@@ -1733,6 +1733,74 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -1733,6 +1733,74 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
CLIENT_kick(client)
CLIENT_kick(client)
return), 500
return), 500
else if info.pass.toUpperCase()=="L" and settings.modules.koishi_roomlist.enabled
ygopro.stoc_send_chat(client,"${koishi_roomlist_hint}", ygopro.constants.COLORS.BABYBLUE)
room_showed = []
for room in ROOM_all when room and room.established and room.name.indexOf('$') < 0
room_showed.push(room)
buffer_pos = 0
room_buffer = Buffer.alloc(2 + 333 * room_showed.length)
room_buffer.writeUInt16LE(room_showed.length, buffer_pos)
buffer_pos += 2
for room in room_showed
room_buffer.write(room.name, buffer_pos, 64, "utf8")
buffer_pos += 64
oppo_pos = if room.hostinfo.mode == 2 then 2 else 1
room_buffer.writeUInt8((if !room.started then 0 else if room.changing_side then 2 else 1), buffer_pos)
buffer_pos++
room_buffer.writeInt8(room.duel_count, buffer_pos)
buffer_pos++
room_buffer.writeInt8((if room.turn? then room.turn else 0), buffer_pos)
buffer_pos++
room_players = []
for player in room.get_playing_player() when player
room_players[player.pos] = player
player_string = "???"
if room_players[0]
player_string = room_players[0].name
if room.hostinfo.mode == 2
player_string = player_string + "+" + (if room_players[1] then room_players[1].name else "???")
room_buffer.write(player_string, buffer_pos, 128, "utf8")
buffer_pos += 128
if room.started
room_buffer.writeInt8((if room.scores[room_players[0].name_vpass]? then room.scores[room_players[0].name_vpass] else 0), buffer_pos)
buffer_pos++
room_buffer.writeInt32LE((if room_players[0].lp? then room_players[0].lp else room.hostinfo.start_lp), buffer_pos)
buffer_pos += 4
else
room_buffer.writeInt8(0, buffer_pos)
buffer_pos++
room_buffer.writeInt32LE(0, buffer_pos)
buffer_pos += 4
player_string = "???"
if room_players[oppo_pos]
player_string = room_players[oppo_pos].name
if room.hostinfo.mode == 2
player_string = player_string + "+" + (if room_players[oppo_pos + 1] then room_players[oppo_pos + 1].name else "???")
room_buffer.write(player_string, buffer_pos, 128, "utf8")
buffer_pos += 128
if room.started
room_buffer.writeInt8((if room.scores[room_players[oppo_pos].name_vpass]? then room.scores[room_players[oppo_pos].name_vpass] else 0), buffer_pos)
buffer_pos++
room_buffer.writeInt32LE((if room_players[oppo_pos].lp? then room_players[oppo_pos].lp else room.hostinfo.start_lp), buffer_pos)
buffer_pos += 4
else
room_buffer.writeInt8(0, buffer_pos)
buffer_pos++
room_buffer.writeInt32LE(0, buffer_pos)
buffer_pos += 4
#console.log(room_buffer.length)
ygopro.stoc_send(client, "SRVPRO_ROOMLIST", room_buffer)
setTimeout (()->
ygopro.stoc_send client, 'ERROR_MSG',{
msg: 1
code: 9
}
CLIENT_kick(client)
return), 500
else if info.pass[0...2].toUpperCase()=="R#" and settings.modules.cloud_replay.enabled
else if info.pass[0...2].toUpperCase()=="R#" and settings.modules.cloud_replay.enabled
replay_id=info.pass.split("#")[1]
replay_id=info.pass.split("#")[1]
if (replay_id>0 and replay_id<=9)
if (replay_id>0 and replay_id<=9)
...
...
ygopro-server.js
View file @
81446259
This diff is collapsed.
Click to expand it.
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