Skip to content

Commit

Permalink
help message registered for MCDR
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Apr 7, 2020
1 parent 005a892 commit 33239d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
a MCDaemon plugin, compatible with MCDReforged
joinMOTD
---------

send player a MOTD when he joins
一个 MCDaemon 插件,与 MCDReforged 兼容

当玩家加入游戏时向其发送欢迎信息

需要前置插件 [daycount](https://github.com/TISUnion/daycount)

A MCDaemon plugin, compatible with MCDReforged

Send player a MOTD when he joins

Plugin [daycount](https://github.com/TISUnion/daycount) is required
9 changes: 8 additions & 1 deletion joinMOTD.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,22 @@ def onPlayerJoin(server, player):
'''.strip().format(serverName, mainServerName, getday())
tellMessage(server, player, msg)
server.execute(cmd)



def onServerInfo(server, info):
if info.content == Prefix and info.isPlayer:
onPlayerJoin(server, info.player)


def on_info(server, info):
info2 = copy.deepcopy(info)
info2.isPlayer = info2.is_player
onServerInfo(server, info2)


def on_player_joined(server, playername):
onPlayerJoin(server, playername)


def on_load(server, old):
server.add_help_message(Prefix, '显示欢迎消息')

0 comments on commit 33239d5

Please sign in to comment.